diff options
Diffstat (limited to 'svtools/source/uno')
-rw-r--r-- | svtools/source/uno/unoiface.cxx | 17 | ||||
-rw-r--r-- | svtools/source/uno/unoimap.cxx | 15 |
2 files changed, 9 insertions, 23 deletions
diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx index 595106ee2f7c..4563803745ee 100644 --- a/svtools/source/uno/unoiface.cxx +++ b/svtools/source/uno/unoiface.cxx @@ -810,8 +810,7 @@ void VCLXFileControl::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds ) SVTXFormattedField::SVTXFormattedField() - :m_pCurrentSupplier(nullptr) - ,bIsStandardSupplier(true) + :bIsStandardSupplier(true) ,nKeyToSetDelayed(-1) { } @@ -819,11 +818,6 @@ SVTXFormattedField::SVTXFormattedField() SVTXFormattedField::~SVTXFormattedField() { - if (m_pCurrentSupplier) - { - m_pCurrentSupplier->release(); - m_pCurrentSupplier = nullptr; - } } @@ -1029,7 +1023,7 @@ css::uno::Any SVTXFormattedField::getProperty( const OUString& PropertyName ) th css::uno::Reference< css::util::XNumberFormatsSupplier > SVTXFormattedField::getFormatsSupplier() const { - return css::uno::Reference< css::util::XNumberFormatsSupplier > (m_pCurrentSupplier); + return m_xCurrentSupplier; } css::uno::Any SVTXFormattedField::convertEffectiveValue(const css::uno::Any& rValue) @@ -1317,15 +1311,12 @@ void SVTXFormattedField::setFormatsSupplier(const css::uno::Reference< css::util if (!pNew) return; // TODO : how to process ? - if (m_pCurrentSupplier) - m_pCurrentSupplier->release(); - m_pCurrentSupplier = pNew; - m_pCurrentSupplier->acquire(); + m_xCurrentSupplier = pNew; if (pField) { // save the actual value css::uno::Any aCurrent = GetValue(); - pField->SetFormatter(m_pCurrentSupplier->GetNumberFormatter(), false); + pField->SetFormatter(m_xCurrentSupplier->GetNumberFormatter(), false); if (nKeyToSetDelayed != -1) { pField->SetFormatKey(nKeyToSetDelayed); diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx index 8dee26a8741b..e5805c5dafc9 100644 --- a/svtools/source/uno/unoimap.cxx +++ b/svtools/source/uno/unoimap.cxx @@ -79,7 +79,7 @@ public: IMapObject* createIMapObject() const; - SvMacroTableEventDescriptor* mpEvents; + css::uno::Reference<SvMacroTableEventDescriptor> mxEvents; // overriden helpers from PropertySetHelper virtual void _setPropertyValues( const PropertyMapEntry** ppEntries, const Any* pValues ) throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException ) override; @@ -186,8 +186,7 @@ SvUnoImageMapObject::SvUnoImageMapObject( sal_uInt16 nType, const SvEventDescrip , mbIsActive( true ) , mnRadius( 0 ) { - mpEvents = new SvMacroTableEventDescriptor( pSupportedMacroItems ); - mpEvents->acquire(); + mxEvents = new SvMacroTableEventDescriptor( pSupportedMacroItems ); } SvUnoImageMapObject::SvUnoImageMapObject( const IMapObject& rMapObject, const SvEventDescription* pSupportedMacroItems ) @@ -243,13 +242,11 @@ SvUnoImageMapObject::SvUnoImageMapObject( const IMapObject& rMapObject, const Sv } } - mpEvents = new SvMacroTableEventDescriptor( rMapObject.GetMacroTable(), pSupportedMacroItems ); - mpEvents->acquire(); + mxEvents = new SvMacroTableEventDescriptor( rMapObject.GetMacroTable(), pSupportedMacroItems ); } SvUnoImageMapObject::~SvUnoImageMapObject() throw() { - mpEvents->release(); } IMapObject* SvUnoImageMapObject::createIMapObject() const @@ -297,7 +294,7 @@ IMapObject* SvUnoImageMapObject::createIMapObject() const } SvxMacroTableDtor aMacroTable; - mpEvents->copyMacrosIntoTable(aMacroTable); + mxEvents->copyMacrosIntoTable(aMacroTable); pNewIMapObject->SetMacroTable( aMacroTable ); return pNewIMapObject; @@ -512,9 +509,7 @@ void SvUnoImageMapObject::_getPropertyValues( const PropertyMapEntry** ppEntries Reference< XNameReplace > SAL_CALL SvUnoImageMapObject::getEvents() throw( RuntimeException, std::exception ) { - // try weak reference first - Reference< XNameReplace > xEvents( mpEvents ); - return xEvents; + return mxEvents; } |