summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-01-17 11:11:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-17 15:27:33 +0200
commit3b395bc73fb8709c738adebd94de8319e27ba878 (patch)
tree13aabe6ac9f022a6fc77c7fc073fdfbaca118504
parentce0f9962d1d1d5a4f6301be18c23b2d14efd9d6b (diff)
manage SvxPropertySetInfoPool.mpInfos with rtl::Reference
instead of with manual acquire() Change-Id: I9fac619730df6a070c5f0d887ecf9249bd7d65a6
-rw-r--r--include/svx/unoprov.hxx3
-rw-r--r--svx/source/unodraw/unoprov.cxx17
2 files changed, 10 insertions, 10 deletions
diff --git a/include/svx/unoprov.hxx b/include/svx/unoprov.hxx
index f8795e6298ae..9ac270cf7823 100644
--- a/include/svx/unoprov.hxx
+++ b/include/svx/unoprov.hxx
@@ -25,6 +25,7 @@
#include <svl/itemprop.hxx>
#include <svx/svxdllapi.h>
#include <editeng/unoipset.hxx>
+#include <rtl/ref.hxx>
class SvxItemPropertySet;
@@ -116,7 +117,7 @@ public:
SVX_DLLPUBLIC static comphelper::PropertySetInfo* getOrCreate( sal_Int32 nServiceId ) throw();
private:
- static comphelper::PropertySetInfo* mpInfos[SVXUNO_SERVICEID_LASTID+1];
+ static rtl::Reference<comphelper::PropertySetInfo> mxInfos[SVXUNO_SERVICEID_LASTID+1];
};
#endif
diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx
index 2d9f97c47a24..32beef82f295 100644
--- a/svx/source/unodraw/unoprov.cxx
+++ b/svx/source/unodraw/unoprov.cxx
@@ -1375,21 +1375,20 @@ comphelper::PropertySetInfo* SvxPropertySetInfoPool::getOrCreate( sal_Int32 nSer
return nullptr;
}
- if( mpInfos[ nServiceId ] == nullptr )
+ if( !mxInfos[ nServiceId ].is() )
{
- mpInfos[nServiceId] = new comphelper::PropertySetInfo();
- mpInfos[nServiceId]->acquire();
+ mxInfos[nServiceId] = new comphelper::PropertySetInfo();
switch( nServiceId )
{
case SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS:
- mpInfos[SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS]->add( ImplGetSvxDrawingDefaultsPropertyMap() );
+ mxInfos[SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS]->add( ImplGetSvxDrawingDefaultsPropertyMap() );
break;
case SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS_WRITER:
- mpInfos[SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS_WRITER]->add( ImplGetSvxDrawingDefaultsPropertyMap() );
- mpInfos[SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS_WRITER]->remove( UNO_NAME_EDIT_PARA_IS_HANGING_PUNCTUATION );
+ mxInfos[SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS_WRITER]->add( ImplGetSvxDrawingDefaultsPropertyMap() );
+ mxInfos[SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS_WRITER]->remove( UNO_NAME_EDIT_PARA_IS_HANGING_PUNCTUATION );
// OD 13.10.2003 #i18732# - add property map for writer item 'IsFollowingTextFlow'
- mpInfos[SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS_WRITER]->add( ImplGetAdditionalWriterDrawingDefaultsPropertyMap() );
+ mxInfos[SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS_WRITER]->add( ImplGetAdditionalWriterDrawingDefaultsPropertyMap() );
break;
default:
@@ -1397,9 +1396,9 @@ comphelper::PropertySetInfo* SvxPropertySetInfoPool::getOrCreate( sal_Int32 nSer
}
}
- return mpInfos[ nServiceId ];
+ return mxInfos[ nServiceId ].get();
}
-comphelper::PropertySetInfo* SvxPropertySetInfoPool::mpInfos[SVXUNO_SERVICEID_LASTID+1] = { nullptr };
+rtl::Reference<comphelper::PropertySetInfo> SvxPropertySetInfoPool::mxInfos[SVXUNO_SERVICEID_LASTID+1] = { nullptr };
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */