Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3766

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/66/3766/1

fdo#48056 revert part of return "correct name for shapetype"

Keep hardcoded values as *fallback* only, but trust 
m_aProps.aComponent.m_xShape->getShapeType when present.

Change-Id: I5a024a9bc5f87d226ab3c857817dfe91ad975acb
---
M reportdesign/source/core/api/FixedLine.cxx
M reportdesign/source/core/api/FixedText.cxx
M reportdesign/source/core/api/FormattedField.cxx
M reportdesign/source/core/api/ImageControl.cxx
M reportdesign/source/core/api/ReportDefinition.cxx
M reportdesign/source/core/api/Shape.cxx
6 files changed, 23 insertions(+), 4 deletions(-)



diff --git a/reportdesign/source/core/api/FixedLine.cxx 
b/reportdesign/source/core/api/FixedLine.cxx
index 51dff9d..f211053 100644
--- a/reportdesign/source/core/api/FixedLine.cxx
+++ b/reportdesign/source/core/api/FixedLine.cxx
@@ -526,7 +526,10 @@
 // XShapeDescriptor
 ::rtl::OUString SAL_CALL OFixedLine::getShapeType(  ) throw 
(uno::RuntimeException)
 {
-   return 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ControlShape"));
+    ::osl::MutexGuard aGuard(m_aMutex);
+    if ( m_aProps.aComponent.m_xShape.is() )
+        return m_aProps.aComponent.m_xShape->getShapeType();
+    return 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ControlShape"));
 }
 // 
-----------------------------------------------------------------------------
 ::rtl::OUString SAL_CALL OFixedLine::getHyperLinkURL() throw 
(uno::RuntimeException, beans::UnknownPropertyException)
diff --git a/reportdesign/source/core/api/FixedText.cxx 
b/reportdesign/source/core/api/FixedText.cxx
index 2d127a1..215b89c 100644
--- a/reportdesign/source/core/api/FixedText.cxx
+++ b/reportdesign/source/core/api/FixedText.cxx
@@ -321,7 +321,10 @@
 // XShapeDescriptor
 ::rtl::OUString SAL_CALL OFixedText::getShapeType(  ) throw 
(uno::RuntimeException)
 {
-   return 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ControlShape"));
+    ::osl::MutexGuard aGuard(m_aMutex);
+    if ( m_aProps.aComponent.m_xShape.is() )
+        return m_aProps.aComponent.m_xShape->getShapeType();
+    return 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ControlShape"));
 }
 // 
-----------------------------------------------------------------------------
 // 
-----------------------------------------------------------------------------
diff --git a/reportdesign/source/core/api/FormattedField.cxx 
b/reportdesign/source/core/api/FormattedField.cxx
index a05fc55..9b47924 100644
--- a/reportdesign/source/core/api/FormattedField.cxx
+++ b/reportdesign/source/core/api/FormattedField.cxx
@@ -364,6 +364,9 @@
 // XShapeDescriptor
 ::rtl::OUString SAL_CALL OFormattedField::getShapeType(  ) throw 
(uno::RuntimeException)
 {
+    ::osl::MutexGuard aGuard(m_aMutex);
+    if ( m_aProps.aComponent.m_xShape.is() )
+        return m_aProps.aComponent.m_xShape->getShapeType();
    return 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ControlShape"));
 }
 // 
-----------------------------------------------------------------------------
diff --git a/reportdesign/source/core/api/ImageControl.cxx 
b/reportdesign/source/core/api/ImageControl.cxx
index 99081f7..8c71eb7 100644
--- a/reportdesign/source/core/api/ImageControl.cxx
+++ b/reportdesign/source/core/api/ImageControl.cxx
@@ -458,7 +458,10 @@
 // XShapeDescriptor
 ::rtl::OUString SAL_CALL OImageControl::getShapeType(  ) throw 
(uno::RuntimeException)
 {
-   return 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ControlShape"));
+    ::osl::MutexGuard aGuard(m_aMutex);
+    if ( m_aProps.aComponent.m_xShape.is() )
+        return m_aProps.aComponent.m_xShape->getShapeType();
+    return 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ControlShape"));
 }
 // 
-----------------------------------------------------------------------------
 ::sal_Int16 SAL_CALL OImageControl::getScaleMode() throw 
(uno::RuntimeException)
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx 
b/reportdesign/source/core/api/ReportDefinition.cxx
index 1ae1719..1825836 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -2432,6 +2432,10 @@
 // XShapeDescriptor
 ::rtl::OUString SAL_CALL OReportDefinition::getShapeType(  ) throw 
(uno::RuntimeException)
 {
+    ::osl::MutexGuard aGuard(m_aMutex);
+    ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+    if ( m_aProps->m_xShape.is() )
+        return m_aProps->m_xShape->getShapeType();
    return 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.OLE2Shape"));
 }
 // 
-----------------------------------------------------------------------------
diff --git a/reportdesign/source/core/api/Shape.cxx 
b/reportdesign/source/core/api/Shape.cxx
index d57fb95..f5db00a 100644
--- a/reportdesign/source/core/api/Shape.cxx
+++ b/reportdesign/source/core/api/Shape.cxx
@@ -414,7 +414,10 @@
 // XShapeDescriptor
 ::rtl::OUString SAL_CALL OShape::getShapeType(  ) throw (uno::RuntimeException)
 {
-   return 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CustomShape"));
+    ::osl::MutexGuard aGuard(m_aMutex);
+    if ( m_aProps.aComponent.m_xShape.is() )
+        return m_aProps.aComponent.m_xShape->getShapeType();
+    return 
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CustomShape"));
 }
 // 
-----------------------------------------------------------------------------
 ::sal_Int32 SAL_CALL OShape::getZOrder() throw (uno::RuntimeException)

-- 
To view, visit https://gerrit.libreoffice.org/3766
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5a024a9bc5f87d226ab3c857817dfe91ad975acb
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Lionel Elie Mamane <lio...@mamane.lu>

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to