diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2013-05-03 17:47:24 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-05-06 11:36:37 +0000 |
commit | f7eb34071af02e9cfe79f926a69e66992f1c6b20 (patch) | |
tree | 9c528b535f8529430747c38f53f19d7ae6e5fe1e /reportdesign | |
parent | 5672bfda87bce5e05e6ef1ecc20f36b4fc7a92ef (diff) |
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
Reviewed-on: https://gerrit.libreoffice.org/3766
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Miklos Vajna <vmiklos@suse.cz>
Reviewed-by: Miklos Vajna <vmiklos@suse.cz>
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/source/core/api/FixedLine.cxx | 5 | ||||
-rw-r--r-- | reportdesign/source/core/api/FixedText.cxx | 5 | ||||
-rw-r--r-- | reportdesign/source/core/api/FormattedField.cxx | 3 | ||||
-rw-r--r-- | reportdesign/source/core/api/ImageControl.cxx | 5 | ||||
-rw-r--r-- | reportdesign/source/core/api/ReportDefinition.cxx | 4 | ||||
-rw-r--r-- | reportdesign/source/core/api/Shape.cxx | 5 |
6 files changed, 23 insertions, 4 deletions
diff --git a/reportdesign/source/core/api/FixedLine.cxx b/reportdesign/source/core/api/FixedLine.cxx index 51dff9d179a7..f21105375d53 100644 --- a/reportdesign/source/core/api/FixedLine.cxx +++ b/reportdesign/source/core/api/FixedLine.cxx @@ -526,7 +526,10 @@ void SAL_CALL OFixedLine::setSize( const awt::Size& aSize ) throw (beans::Proper // 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 2d127a1eac0f..215b89c46b73 100644 --- a/reportdesign/source/core/api/FixedText.cxx +++ b/reportdesign/source/core/api/FixedText.cxx @@ -321,7 +321,10 @@ void SAL_CALL OFixedText::setSize( const awt::Size& aSize ) throw (beans::Proper // 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 a05fc557f320..9b4792440d2f 100644 --- a/reportdesign/source/core/api/FormattedField.cxx +++ b/reportdesign/source/core/api/FormattedField.cxx @@ -364,6 +364,9 @@ void SAL_CALL OFormattedField::setSize( const awt::Size& aSize ) throw (beans::P // 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 99081f7159c7..8c71eb7d78a5 100644 --- a/reportdesign/source/core/api/ImageControl.cxx +++ b/reportdesign/source/core/api/ImageControl.cxx @@ -458,7 +458,10 @@ void SAL_CALL OImageControl::setSize( const awt::Size& aSize ) throw (beans::Pro // 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 1ae1719956e4..1825836c91b6 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -2432,6 +2432,10 @@ void SAL_CALL OReportDefinition::setSize( const awt::Size& aSize ) throw (beans: // 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 d57fb95e278c..f5db00aab269 100644 --- a/reportdesign/source/core/api/Shape.cxx +++ b/reportdesign/source/core/api/Shape.cxx @@ -414,7 +414,10 @@ void SAL_CALL OShape::setSize( const awt::Size& aSize ) throw (beans::PropertyVe // 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) |