Kaydet (Commit) c3b9aa09 authored tarafından Lionel Elie Mamane's avatar Lionel Elie Mamane Kaydeden (comit) Petr Mladek

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/3766Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: 's avatarMiklos Vajna <vmiklos@suse.cz>
Reviewed-by: 's avatarMiklos Vajna <vmiklos@suse.cz>
üst 71f61886
......@@ -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)
......
......@@ -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"));
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
......
......@@ -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"));
}
// -----------------------------------------------------------------------------
......
......@@ -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)
......
......@@ -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"));
}
// -----------------------------------------------------------------------------
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment