diff options
Diffstat (limited to 'svx/source/unodraw')
-rw-r--r-- | svx/source/unodraw/SvxXTextColumns.cxx | 8 | ||||
-rw-r--r-- | svx/source/unodraw/UnoNamespaceMap.cxx | 2 | ||||
-rw-r--r-- | svx/source/unodraw/unomod.cxx | 10 | ||||
-rw-r--r-- | svx/source/unodraw/unopool.cxx | 4 | ||||
-rw-r--r-- | svx/source/unodraw/unoshap2.cxx | 2 | ||||
-rw-r--r-- | svx/source/unodraw/unoshap4.cxx | 8 | ||||
-rw-r--r-- | svx/source/unodraw/unoshape.cxx | 14 | ||||
-rw-r--r-- | svx/source/unodraw/unoshcol.cxx | 2 |
8 files changed, 24 insertions, 26 deletions
diff --git a/svx/source/unodraw/SvxXTextColumns.cxx b/svx/source/unodraw/SvxXTextColumns.cxx index 95d289632241..3103019adacc 100644 --- a/svx/source/unodraw/SvxXTextColumns.cxx +++ b/svx/source/unodraw/SvxXTextColumns.cxx @@ -197,10 +197,10 @@ void SvxXTextColumns::setPropertyValue(const OUString& rPropertyName, const css: const SfxItemPropertyMapEntry* pEntry = m_aPropSet.getPropertyMap().getByName(rPropertyName); if (!pEntry) throw css::beans::UnknownPropertyException("Unknown property: " + rPropertyName, - static_cast<cppu::OWeakObject*>(this)); + getXWeak()); if (pEntry->nFlags & css::beans::PropertyAttribute::READONLY) throw css::beans::PropertyVetoException("Property is read-only: " + rPropertyName, - static_cast<cppu::OWeakObject*>(this)); + getXWeak()); switch (pEntry->nWID) { @@ -264,7 +264,7 @@ css::uno::Any SvxXTextColumns::getPropertyValue(const OUString& rPropertyName) const SfxItemPropertyMapEntry* pEntry = m_aPropSet.getPropertyMap().getByName(rPropertyName); if (!pEntry) throw css::beans::UnknownPropertyException("Unknown property: " + rPropertyName, - static_cast<cppu::OWeakObject*>(this)); + getXWeak()); css::uno::Any aRet; switch (pEntry->nWID) @@ -324,7 +324,7 @@ void SvxXTextColumns::removeVetoableChangeListener( css::uno::Reference<css::uno::XInterface> SvxXTextColumns_createInstance() noexcept { - return static_cast<cppu::OWeakObject*>(new SvxXTextColumns); + return getXWeak(new SvxXTextColumns); } extern "C" SVXCORE_DLLPUBLIC css::uno::XInterface* diff --git a/svx/source/unodraw/UnoNamespaceMap.cxx b/svx/source/unodraw/UnoNamespaceMap.cxx index cd49cc0a6134..0eced8574da5 100644 --- a/svx/source/unodraw/UnoNamespaceMap.cxx +++ b/svx/source/unodraw/UnoNamespaceMap.cxx @@ -72,7 +72,7 @@ namespace svx Reference< XInterface > NamespaceMap_createInstance( sal_uInt16* pWhichIds, SfxItemPool* pPool ) { - return static_cast<XWeak*>(new NamespaceMap( pWhichIds, pPool )); + return getXWeak(new NamespaceMap( pWhichIds, pPool )); } static Sequence< OUString > NamespaceMap_getSupportedServiceNames() diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx index c6d3ee635cf7..6464edfb7e36 100644 --- a/svx/source/unodraw/unomod.cxx +++ b/svx/source/unodraw/unomod.cxx @@ -173,14 +173,12 @@ css::uno::Reference<css::uno::XInterface> create( { SdrInventor nI = IsInventorE3D(*nType) ? SdrInventor::E3d : SdrInventor::Default; - return uno::Reference< uno::XInterface >( static_cast<drawing::XShape*>(SvxDrawPage::CreateShapeByTypeAndInventor( *nType, nI, nullptr, nullptr, referer ).get()) ); + return cppu::getXWeak(SvxDrawPage::CreateShapeByTypeAndInventor( *nType, nI, nullptr, nullptr, referer ).get()); } } else if (rServiceSpecifier == "com.sun.star.document.ImportGraphicStorageHandler") { - rtl::Reference<SvXMLGraphicHelper> pGraphicHelper = SvXMLGraphicHelper::Create( SvXMLGraphicHelperMode::Read ); - uno::Reference< uno::XInterface> xRet( static_cast< ::cppu::OWeakObject* >( pGraphicHelper.get() ) ); - return xRet; + return cppu::getXWeak( SvXMLGraphicHelper::Create( SvXMLGraphicHelperMode::Read ).get() ); } else if (rServiceSpecifier == "com.sun.star.text.TextColumns") { @@ -368,7 +366,7 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawingModel::createInstance( c if( aServiceSpecifier == "com.sun.star.text.TextField.DateTime" ) { - return static_cast<cppu::OWeakObject *>(new SvxUnoTextField(text::textfield::Type::DATE)); + return cppu::getXWeak(new SvxUnoTextField(text::textfield::Type::DATE)); } uno::Reference< uno::XInterface > xRet; @@ -454,7 +452,7 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawingModel::createInstance( c if( pShape ) pShape->SetShapeType(aServiceSpecifier); - xRet = static_cast<uno::XWeak*>(pShape); + xRet = cppu::getXWeak(pShape); } else { diff --git a/svx/source/unodraw/unopool.cxx b/svx/source/unodraw/unopool.cxx index b6172876152a..e94ccb2d7450 100644 --- a/svx/source/unodraw/unopool.cxx +++ b/svx/source/unodraw/unopool.cxx @@ -200,7 +200,7 @@ void SvxUnoDrawPool::_setPropertyValues( const comphelper::PropertyMapEntry** pp DBG_ASSERT( pPool, "I need a SfxItemPool!" ); if( nullptr == pPool ) - throw beans::UnknownPropertyException( "no pool, no properties..", static_cast<cppu::OWeakObject*>(this)); + throw beans::UnknownPropertyException( "no pool, no properties..", getXWeak()); while( *ppEntries ) putAny( pPool, *ppEntries++, *pValues++ ); @@ -214,7 +214,7 @@ void SvxUnoDrawPool::_getPropertyValues( const comphelper::PropertyMapEntry** pp DBG_ASSERT( pPool, "I need a SfxItemPool!" ); if( nullptr == pPool ) - throw beans::UnknownPropertyException( "no pool, no properties..", static_cast<cppu::OWeakObject*>(this)); + throw beans::UnknownPropertyException( "no pool, no properties..", getXWeak()); while( *ppEntries ) getAny( pPool, *ppEntries++, *pValue++ ); diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index 8ae6879ef337..c1f715bd2ad5 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -866,7 +866,7 @@ uno::Any SAL_CALL SvxShapeControl::getPropertyDefault( const OUString& aProperty return aDefault; } - throw beans::UnknownPropertyException( aPropertyName, static_cast<cppu::OWeakObject*>(this)); + throw beans::UnknownPropertyException( aPropertyName, getXWeak()); } else { diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx index 02790b767084..27ae6d2899b4 100644 --- a/svx/source/unodraw/unoshap4.cxx +++ b/svx/source/unodraw/unoshap4.cxx @@ -935,7 +935,7 @@ bool SvxMediaShape::setPropertyValueImpl( const OUString& rName, const SfxItemPr css::uno::Any exc = cppu::getCaughtException(); throw css::lang::WrappedTargetException( "ContentCreationException Setting InputStream!", - static_cast<OWeakObject *>(this), + getXWeak(), exc); } catch (const css::ucb::CommandFailedException&) @@ -943,7 +943,7 @@ bool SvxMediaShape::setPropertyValueImpl( const OUString& rName, const SfxItemPr css::uno::Any anyEx = cppu::getCaughtException(); throw css::lang::WrappedTargetException( "CommandFailedException Setting InputStream!", - static_cast<OWeakObject *>(this), + getXWeak(), anyEx); } #endif @@ -1028,14 +1028,14 @@ bool SvxMediaShape::getPropertyValueImpl( const OUString& rName, const SfxItemPr css::uno::Any anyEx = cppu::getCaughtException(); throw css::lang::WrappedTargetException( "ContentCreationException Getting InputStream!", - static_cast < OWeakObject * > ( this ), anyEx ); + getXWeak(), anyEx ); } catch (const css::ucb::CommandFailedException&) { css::uno::Any anyEx = cppu::getCaughtException(); throw css::lang::WrappedTargetException( "CommandFailedException Getting InputStream!", - static_cast < OWeakObject * > ( this ), anyEx ); + getXWeak(), anyEx ); } break; diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 32695605dfb0..95adad4150a0 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -1531,7 +1531,7 @@ void SvxShape::_setPropertyValue( const OUString& rPropertyName, const uno::Any& // reduce log noise by ignoring two properties that higher level code queries for on all objects SAL_WARN_IF(rPropertyName != "FromWordArt" && rPropertyName != "GraphicColorMode", "svx.uno", "Unknown Property: " << rPropertyName); - throw beans::UnknownPropertyException( rPropertyName, static_cast<cppu::OWeakObject*>(this)); + throw beans::UnknownPropertyException( rPropertyName, getXWeak()); } if ((pMap->nFlags & beans::PropertyAttribute::READONLY) != 0) @@ -1633,7 +1633,7 @@ uno::Any SvxShape::_getPropertyValue( const OUString& PropertyName ) if(HasSdrObject()) { if(pMap == nullptr ) - throw beans::UnknownPropertyException( PropertyName, static_cast<cppu::OWeakObject*>(this)); + throw beans::UnknownPropertyException( PropertyName, getXWeak()); if( !getPropertyValueImpl( PropertyName, pMap, aAny ) ) { @@ -1688,7 +1688,7 @@ void SAL_CALL SvxShape::setPropertyValues( const css::uno::Sequence< OUString >& const sal_Int32 nCount = aPropertyNames.getLength(); if (nCount != aValues.getLength()) throw css::lang::IllegalArgumentException("lengths do not match", - static_cast<cppu::OWeakObject*>(this), -1); + getXWeak(), -1); const OUString* pNames = aPropertyNames.getConstArray(); const uno::Any* pValues = aValues.getConstArray(); @@ -1907,7 +1907,7 @@ beans::PropertyState SvxShape::_getPropertyState( const OUString& PropertyName ) const SfxItemPropertyMapEntry* pMap = mpPropSet->getPropertyMapEntry(PropertyName); if( !HasSdrObject() || pMap == nullptr ) - throw beans::UnknownPropertyException( PropertyName, static_cast<cppu::OWeakObject*>(this)); + throw beans::UnknownPropertyException( PropertyName, getXWeak()); beans::PropertyState eState; if( !getPropertyStateImpl( pMap, eState ) ) @@ -3034,7 +3034,7 @@ void SvxShape::_setPropertyToDefault( const OUString& PropertyName ) const SfxItemPropertyMapEntry* pProperty = mpPropSet->getPropertyMapEntry(PropertyName); if( !HasSdrObject() || pProperty == nullptr ) - throw beans::UnknownPropertyException( PropertyName, static_cast<cppu::OWeakObject*>(this)); + throw beans::UnknownPropertyException( PropertyName, getXWeak()); if( !setPropertyToDefaultImpl( pProperty ) ) { @@ -3064,7 +3064,7 @@ uno::Any SvxShape::_getPropertyDefault( const OUString& aPropertyName ) const SfxItemPropertyMapEntry* pMap = mpPropSet->getPropertyMapEntry(aPropertyName); if( !HasSdrObject() || pMap == nullptr ) - throw beans::UnknownPropertyException( aPropertyName, static_cast<cppu::OWeakObject*>(this)); + throw beans::UnknownPropertyException( aPropertyName, getXWeak()); if(( pMap->nWID >= OWN_ATTR_VALUE_START && pMap->nWID <= OWN_ATTR_VALUE_END ) || ( pMap->nWID >= SDRATTR_NOTPERSIST_FIRST && pMap->nWID <= SDRATTR_NOTPERSIST_LAST )) @@ -3074,7 +3074,7 @@ uno::Any SvxShape::_getPropertyDefault( const OUString& aPropertyName ) // get default from ItemPool if(!SfxItemPool::IsWhich(pMap->nWID)) - throw beans::UnknownPropertyException( "No WhichID " + OUString::number(pMap->nWID) + " for " + aPropertyName, static_cast<cppu::OWeakObject*>(this)); + throw beans::UnknownPropertyException( "No WhichID " + OUString::number(pMap->nWID) + " for " + aPropertyName, getXWeak()); SfxItemSet aSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool(), pMap->nWID, pMap->nWID ); aSet.Put(GetSdrObject()->getSdrModelFromSdrObject().GetItemPool().GetDefaultItem(pMap->nWID)); diff --git a/svx/source/unodraw/unoshcol.cxx b/svx/source/unodraw/unoshcol.cxx index c7fadc620147..2cc6d39c88d7 100644 --- a/svx/source/unodraw/unoshcol.cxx +++ b/svx/source/unodraw/unoshcol.cxx @@ -42,7 +42,7 @@ void SvxShapeCollection::release() noexcept { if (! bDisposed) { - uno::Reference< uno::XInterface > xHoldAlive( static_cast<uno::XWeak*>(this) ); + uno::Reference< uno::XInterface > xHoldAlive( getXWeak() ); // First dispose try { |