diff options
author | Caolán McNamara <caolanm@redhat.com> | 2010-10-27 11:38:46 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2010-10-27 16:05:02 +0100 |
commit | 5bd92787713263456680d3bc984ae4fed80e1d3a (patch) | |
tree | 5e5d57b0084fd89e30eb2931122ac25502f16de8 /sw/inc/PostItMgr.hxx | |
parent | 1af4026d3fbb205044059d4024527c217bd24d82 (diff) |
micro optimizations
Diffstat (limited to 'sw/inc/PostItMgr.hxx')
-rw-r--r-- | sw/inc/PostItMgr.hxx | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx index abb46114b035..946492a3b794 100644 --- a/sw/inc/PostItMgr.hxx +++ b/sw/inc/PostItMgr.hxx @@ -112,7 +112,7 @@ class SwNoteProps: public utl::ConfigItem bool bIsShowAnchor; public: SwNoteProps() - : ConfigItem(::rtl::OUString::createFromAscii("Office.Writer/Notes")) + : ConfigItem(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Writer/Notes"))) , bIsShowAnchor(false) { const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rNames = GetPropertyNames(); @@ -127,23 +127,17 @@ class SwNoteProps: public utl::ConfigItem { return bIsShowAnchor; } - ::com::sun::star::uno::Sequence< ::rtl::OUString >& GetPropertyNames() - { + ::com::sun::star::uno::Sequence< ::rtl::OUString >& GetPropertyNames() + { static ::com::sun::star::uno::Sequence< ::rtl::OUString > aNames; - if(!aNames.getLength()) - { - static const char* aPropNames[] = - { - "ShowAnkor" - }; - const int nCount = sizeof(aPropNames)/sizeof(const char*); - aNames.realloc(nCount); - ::rtl::OUString* pNames = aNames.getArray(); - for(int i = 0; i < nCount; i++) - pNames[i] = ::rtl::OUString::createFromAscii(aPropNames[i]); - } - return aNames; + if(!aNames.getLength()) + { + aNames.realloc(1); + ::rtl::OUString* pNames = aNames.getArray(); + pNames[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShowAnkor")); } + return aNames; + } virtual void Commit(); virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); |