From 09bdea8900c5ce79df3e8f2b7fbeeed06a5b4111 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 1 Apr 2012 21:25:49 +0100 Subject: remove static objects from static_initialization_and_destruction chain --- filter/source/msfilter/msvbahelper.cxx | 19 +++++--- framework/inc/services/taskcreatorsrv.hxx | 71 +++++++++++++--------------- framework/source/classes/taskcreator.cxx | 10 ++-- framework/source/services/taskcreatorsrv.cxx | 27 ++++------- salhelper/source/timer.cxx | 24 +++++----- svx/inc/svx/dbtoolsclient.hxx | 1 - svx/source/form/dbtoolsclient.cxx | 12 +++-- sw/inc/unosett.hxx | 3 +- sw/source/core/unocore/unocrsrhelper.cxx | 4 +- sw/source/core/unocore/unosett.cxx | 16 +++---- sw/source/core/unocore/unostyle.cxx | 4 +- 11 files changed, 94 insertions(+), 97 deletions(-) diff --git a/filter/source/msfilter/msvbahelper.cxx b/filter/source/msfilter/msvbahelper.cxx index b7071580f2a2..8fec414f1ebf 100644 --- a/filter/source/msfilter/msvbahelper.cxx +++ b/filter/source/msfilter/msvbahelper.cxx @@ -53,21 +53,26 @@ using namespace ::com::sun::star; namespace ooo { namespace vba { -const static rtl::OUString sUrlPart0( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.script:" )); -const static rtl::OUString sUrlPart1( RTL_CONSTASCII_USTRINGPARAM( "?language=Basic&location=document" )); +const char sUrlPart0[] = "vnd.sun.star.script:"; +const char sUrlPart1[] = "?language=Basic&location=document"; String makeMacroURL( const String& sMacroName ) { - return sUrlPart0.concat( sMacroName ).concat( sUrlPart1 ) ; + return rtl::OUStringBuffer(). + appendAscii(RTL_CONSTASCII_STRINGPARAM(sUrlPart0)). + append(sMacroName). + appendAscii(RTL_CONSTASCII_STRINGPARAM(sUrlPart1)). + makeStringAndClear(); } ::rtl::OUString extractMacroName( const ::rtl::OUString& rMacroUrl ) { - if( (rMacroUrl.getLength() > sUrlPart0.getLength() + sUrlPart1.getLength()) && - rMacroUrl.match( sUrlPart0 ) && - rMacroUrl.match( sUrlPart1, rMacroUrl.getLength() - sUrlPart1.getLength() ) ) + if( (rMacroUrl.getLength() > RTL_CONSTASCII_LENGTH(sUrlPart0) + RTL_CONSTASCII_LENGTH(sUrlPart1)) && + rMacroUrl.matchAsciiL( RTL_CONSTASCII_STRINGPARAM(sUrlPart0) ) && + rMacroUrl.matchAsciiL( RTL_CONSTASCII_STRINGPARAM(sUrlPart1), rMacroUrl.getLength() - RTL_CONSTASCII_LENGTH(sUrlPart1) ) ) { - return rMacroUrl.copy( sUrlPart0.getLength(), rMacroUrl.getLength() - sUrlPart0.getLength() - sUrlPart1.getLength() ); + return rMacroUrl.copy( RTL_CONSTASCII_LENGTH(sUrlPart0), + rMacroUrl.getLength() - RTL_CONSTASCII_LENGTH(sUrlPart0) - RTL_CONSTASCII_LENGTH(sUrlPart1) ); } return ::rtl::OUString(); } diff --git a/framework/inc/services/taskcreatorsrv.hxx b/framework/inc/services/taskcreatorsrv.hxx index ebabdd1eb31f..1d7de6c55320 100644 --- a/framework/inc/services/taskcreatorsrv.hxx +++ b/framework/inc/services/taskcreatorsrv.hxx @@ -57,6 +57,40 @@ //_______________________________________________ // definition +/// [XFrame] if it's set, it will be used as parent frame for the new created frame. +const char ARGUMENT_PARENTFRAME[] = "ParentFrame"; // XFrame + +/** [OUString] if it's not a special name (beginning with "_" ... which are not allowed here!) + it will be set as the API name of the new created frame. + */ +const char ARGUMENT_FRAMENAME[] = "FrameName"; // OUString + +/// [sal_Bool] If its set to sal_True we will make the new created frame visible. +const char ARGUMENT_MAKEVISIBLE[] = "MakeVisible"; // sal_Bool + +/** [sal_Bool] If not "ContainerWindow" property is set it force creation of a + top level window as new container window. + */ +const char ARGUMENT_CREATETOPWINDOW[] = "CreateTopWindow"; // sal_Bool + +/// [Rectangle] Place the new created frame on this place and resize the container window. +const char ARGUMENT_POSSIZE[] = "PosSize"; // Rectangle + +/// [XWindow] an outside created window, used as container window of the new created frame. +const char ARGUMENT_CONTAINERWINDOW[] = "ContainerWindow"; // XWindow + +/** [sal_Bool] enable/disable special mode, where this frame will be part of + the persistent window state feature suitable for any office module window + */ +const char ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE[] = "SupportPersistentWindowState"; // sal_Bool + +/** [sal_Bool] enable/disable special mode, where the title bar of our + the new created frame will be updated automaticly. + Default = ON ! + */ +const char ARGUMENT_ENABLE_TITLEBARUPDATE[] = "EnableTitleBarUpdate"; // sal_Bool + + namespace framework { @@ -72,43 +106,6 @@ class TaskCreatorService : public css::lang::XTypeProvider , public ::cppu::OWeakObject { //___________________________________________ - // types - - public: - - /// [XFrame] if it's set, it will be used as parent frame for the new created frame. - static const ::rtl::OUString ARGUMENT_PARENTFRAME; - - /** [OUString] if it's not a special name (beginning with "_" ... which are not allowed here!) - it will be set as the API name of the new created frame. - */ - static const ::rtl::OUString ARGUMENT_FRAMENAME; - - /// [sal_Bool] If its set to sal_True we will make the new created frame visible. - static const ::rtl::OUString ARGUMENT_MAKEVISIBLE; - - /** [sal_Bool] If not "ContainerWindow" property is set it force creation of a - top level window as new container window. - */ - static const ::rtl::OUString ARGUMENT_CREATETOPWINDOW; - - /// [Rectangle] Place the new created frame on this place and resize the container window. - static const ::rtl::OUString ARGUMENT_POSSIZE; - - /// [XWindow] an outside created window, used as container window of the new created frame. - static const ::rtl::OUString ARGUMENT_CONTAINERWINDOW; - - /** [sal_Bool] enable/disable special mode, where this frame will be part of - the persistent window state feature suitable for any office module window - */ - static const ::rtl::OUString ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE; - - /** [sal_Bool] enable/disable special mode, where the title bar of our - the new created frame will be updated automaticly. - Default = ON ! - */ - static const ::rtl::OUString ARGUMENT_ENABLE_TITLEBARUPDATE; - //___________________________________________ // member private: diff --git a/framework/source/classes/taskcreator.cxx b/framework/source/classes/taskcreator.cxx index 6c3d52916608..05aa9b44e5d3 100644 --- a/framework/source/classes/taskcreator.cxx +++ b/framework/source/classes/taskcreator.cxx @@ -143,23 +143,23 @@ css::uno::Reference< css::frame::XFrame > TaskCreator::createTask( const ::rtl:: css::uno::Sequence< css::uno::Any > lArgs(5); css::beans::NamedValue aArg ; - aArg.Name = TaskCreatorService::ARGUMENT_PARENTFRAME; + aArg.Name = rtl::OUString(ARGUMENT_PARENTFRAME); aArg.Value <<= css::uno::Reference< css::frame::XFrame >(xSMGR->createInstance(SERVICENAME_DESKTOP), css::uno::UNO_QUERY_THROW); lArgs[0] <<= aArg; - aArg.Name = TaskCreatorService::ARGUMENT_CREATETOPWINDOW; + aArg.Name = rtl::OUString(ARGUMENT_CREATETOPWINDOW); aArg.Value <<= sal_True; lArgs[1] <<= aArg; - aArg.Name = TaskCreatorService::ARGUMENT_MAKEVISIBLE; + aArg.Name = rtl::OUString(ARGUMENT_MAKEVISIBLE); aArg.Value <<= bVisible; lArgs[2] <<= aArg; - aArg.Name = TaskCreatorService::ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE; + aArg.Name = rtl::OUString(ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE); aArg.Value <<= sal_True; lArgs[3] <<= aArg; - aArg.Name = TaskCreatorService::ARGUMENT_FRAMENAME; + aArg.Name = rtl::OUString(ARGUMENT_FRAMENAME); aArg.Value <<= sName; lArgs[4] <<= aArg; diff --git a/framework/source/services/taskcreatorsrv.cxx b/framework/source/services/taskcreatorsrv.cxx index dd14cf3607ac..2f5d4fe62878 100644 --- a/framework/source/services/taskcreatorsrv.cxx +++ b/framework/source/services/taskcreatorsrv.cxx @@ -62,17 +62,6 @@ namespace framework { - -//----------------------------------------------- -const ::rtl::OUString TaskCreatorService::ARGUMENT_PARENTFRAME(RTL_CONSTASCII_USTRINGPARAM("ParentFrame")); // XFrame -const ::rtl::OUString TaskCreatorService::ARGUMENT_FRAMENAME(RTL_CONSTASCII_USTRINGPARAM("FrameName")); // OUString -const ::rtl::OUString TaskCreatorService::ARGUMENT_MAKEVISIBLE(RTL_CONSTASCII_USTRINGPARAM("MakeVisible")); // sal_Bool -const ::rtl::OUString TaskCreatorService::ARGUMENT_CREATETOPWINDOW(RTL_CONSTASCII_USTRINGPARAM("CreateTopWindow")); // sal_Bool -const ::rtl::OUString TaskCreatorService::ARGUMENT_POSSIZE(RTL_CONSTASCII_USTRINGPARAM("PosSize")); // Rectangle -const ::rtl::OUString TaskCreatorService::ARGUMENT_CONTAINERWINDOW(RTL_CONSTASCII_USTRINGPARAM("ContainerWindow")); // XWindow -const ::rtl::OUString TaskCreatorService::ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE(RTL_CONSTASCII_USTRINGPARAM("SupportPersistentWindowState")); // sal_Bool -const ::rtl::OUString TaskCreatorService::ARGUMENT_ENABLE_TITLEBARUPDATE(RTL_CONSTASCII_USTRINGPARAM("EnableTitleBarUpdate")); // sal_Bool - //----------------------------------------------- DEFINE_XINTERFACE_3(TaskCreatorService , OWeakObject , @@ -139,14 +128,14 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL TaskCreatorService::createI ::comphelper::SequenceAsHashMap lArgs(lArguments); - css::uno::Reference< css::frame::XFrame > xParentFrame = lArgs.getUnpackedValueOrDefault(TaskCreatorService::ARGUMENT_PARENTFRAME , css::uno::Reference< css::frame::XFrame >()); - ::rtl::OUString sFrameName = lArgs.getUnpackedValueOrDefault(TaskCreatorService::ARGUMENT_FRAMENAME , DEFAULTVAL_FRAMENAME ); - sal_Bool bVisible = lArgs.getUnpackedValueOrDefault(TaskCreatorService::ARGUMENT_MAKEVISIBLE , DEFAULTVAL_MAKEVISIBLE ); - sal_Bool bCreateTopWindow = lArgs.getUnpackedValueOrDefault(TaskCreatorService::ARGUMENT_CREATETOPWINDOW , DEFAULTVAL_CREATETOPWINDOW ); - css::awt::Rectangle aPosSize = lArgs.getUnpackedValueOrDefault(TaskCreatorService::ARGUMENT_POSSIZE , DEFAULTVAL_POSSIZE ); - css::uno::Reference< css::awt::XWindow > xContainerWindow = lArgs.getUnpackedValueOrDefault(TaskCreatorService::ARGUMENT_CONTAINERWINDOW , css::uno::Reference< css::awt::XWindow >() ); - sal_Bool bSupportPersistentWindowState = lArgs.getUnpackedValueOrDefault(TaskCreatorService::ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE , DEFAULTVAL_SUPPORTPERSSISTENTWINDOWSTATE ); - sal_Bool bEnableTitleBarUpdate = lArgs.getUnpackedValueOrDefault(TaskCreatorService::ARGUMENT_ENABLE_TITLEBARUPDATE , DEFAULTVAL_ENABLE_TITLEBARUPDATE ); + css::uno::Reference< css::frame::XFrame > xParentFrame = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_PARENTFRAME) , css::uno::Reference< css::frame::XFrame >()); + ::rtl::OUString sFrameName = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_FRAMENAME) , DEFAULTVAL_FRAMENAME ); + sal_Bool bVisible = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_MAKEVISIBLE) , DEFAULTVAL_MAKEVISIBLE ); + sal_Bool bCreateTopWindow = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_CREATETOPWINDOW) , DEFAULTVAL_CREATETOPWINDOW ); + css::awt::Rectangle aPosSize = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_POSSIZE) , DEFAULTVAL_POSSIZE ); + css::uno::Reference< css::awt::XWindow > xContainerWindow = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_CONTAINERWINDOW) , css::uno::Reference< css::awt::XWindow >() ); + sal_Bool bSupportPersistentWindowState = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE) , DEFAULTVAL_SUPPORTPERSSISTENTWINDOWSTATE ); + sal_Bool bEnableTitleBarUpdate = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_ENABLE_TITLEBARUPDATE) , DEFAULTVAL_ENABLE_TITLEBARUPDATE ); /* SAFE { */ ReadGuard aReadLock( m_aLock ); diff --git a/salhelper/source/timer.cxx b/salhelper/source/timer.cxx index aff006c95e8b..d7ad3edf37ee 100644 --- a/salhelper/source/timer.cxx +++ b/salhelper/source/timer.cxx @@ -32,6 +32,7 @@ #include #include #include +#include using namespace salhelper; @@ -77,9 +78,6 @@ protected: // Signal the insertion of a timer osl::Condition m_notEmpty; - // Synchronize access to TimerManager - static osl::Mutex m_Access; - // "Singleton Pattern" static salhelper::TimerManager* m_pManager; @@ -251,13 +249,17 @@ TTimeValue Timer::getRemainingTime() const // // Timer manager // +namespace +{ + // Synchronize access to TimerManager + struct theTimerManagerMutex : public rtl::Static< osl::Mutex, theTimerManagerMutex> {}; +} -osl::Mutex salhelper::TimerManager::m_Access; TimerManager* salhelper::TimerManager::m_pManager = NULL; TimerManager::TimerManager() { - osl::MutexGuard Guard(&m_Access); + osl::MutexGuard Guard(theTimerManagerMutex::get()); OSL_ASSERT(m_pManager == 0); @@ -273,7 +275,7 @@ TimerManager::TimerManager() TimerManager::~TimerManager() { - osl::MutexGuard Guard(&m_Access); + osl::MutexGuard Guard(theTimerManagerMutex::get()); if ( m_pManager == this ) m_pManager = 0; @@ -286,12 +288,12 @@ void TimerManager::onTerminated() TimerManager* TimerManager::getTimerManager() { - osl::MutexGuard Guard(&m_Access); + osl::MutexGuard Guard(theTimerManagerMutex::get()); if (! m_pManager) new TimerManager; - return (m_pManager); + return m_pManager; } sal_Bool TimerManager::registerTimer(Timer* pTimer) @@ -303,7 +305,7 @@ sal_Bool TimerManager::registerTimer(Timer* pTimer) return sal_False; } - osl::MutexGuard Guard(&m_Lock); + osl::MutexGuard Guard(m_Lock); // try to find one with equal or lower remaining time. Timer** ppIter = &m_pHead; @@ -345,7 +347,7 @@ sal_Bool TimerManager::unregisterTimer(Timer* pTimer) } // lock access - osl::MutexGuard Guard(&m_Lock); + osl::MutexGuard Guard(m_Lock); Timer** ppIter = &m_pHead; @@ -373,7 +375,7 @@ sal_Bool TimerManager::lookupTimer(const Timer* pTimer) } // lock access - osl::MutexGuard Guard(&m_Lock); + osl::MutexGuard Guard(m_Lock); // check the list for (Timer* pIter = m_pHead; pIter != 0; pIter= pIter->m_pNext) diff --git a/svx/inc/svx/dbtoolsclient.hxx b/svx/inc/svx/dbtoolsclient.hxx index 8c86223e20d7..661f8d8ad2c3 100644 --- a/svx/inc/svx/dbtoolsclient.hxx +++ b/svx/inc/svx/dbtoolsclient.hxx @@ -52,7 +52,6 @@ namespace svxform class SVX_DLLPUBLIC ODbtoolsClient { private: - static ::osl::Mutex s_aMutex; static sal_Int32 s_nClients; static oslModule s_hDbtoolsModule; static ::connectivity::simple::createDataAccessToolsFactoryFunction diff --git a/svx/source/form/dbtoolsclient.cxx b/svx/source/form/dbtoolsclient.cxx index e71025c9aa0d..78c04445c70f 100644 --- a/svx/source/form/dbtoolsclient.cxx +++ b/svx/source/form/dbtoolsclient.cxx @@ -32,6 +32,7 @@ #include #include "svx/dbtoolsclient.hxx" #include +#include #include //........................................................................ @@ -51,7 +52,12 @@ namespace svxform //==================================================================== //= ODbtoolsClient //==================================================================== - ::osl::Mutex ODbtoolsClient::s_aMutex; + + namespace + { + struct theODbtoolsClientMutex : public rtl::Static< osl::Mutex, theODbtoolsClientMutex> {}; + } + sal_Int32 ODbtoolsClient::s_nClients = 0; oslModule ODbtoolsClient::s_hDbtoolsModule = NULL; createDataAccessToolsFactoryFunction @@ -103,7 +109,7 @@ namespace svxform void ODbtoolsClient::registerClient() { - ::osl::MutexGuard aGuard(s_aMutex); + ::osl::MutexGuard aGuard(theODbtoolsClientMutex::get()); if (1 == ++s_nClients) { OSL_ENSURE(NULL == s_hDbtoolsModule, "ODbtoolsClient::registerClient: inconsistence: already have a module!"); @@ -138,7 +144,7 @@ namespace svxform //-------------------------------------------------------------------- void ODbtoolsClient::revokeClient() { - ::osl::MutexGuard aGuard(s_aMutex); + ::osl::MutexGuard aGuard(theODbtoolsClientMutex::get()); if (0 == --s_nClients) { s_pFactoryCreationFunc = NULL; diff --git a/sw/inc/unosett.hxx b/sw/inc/unosett.hxx index b22783062589..a3073f261894 100644 --- a/sw/inc/unosett.hxx +++ b/sw/inc/unosett.hxx @@ -159,7 +159,6 @@ class SwXNumberingRules : public cppu::WeakAggImplHelper5 SwNumRule* pNumRule; const SfxItemPropertySet* m_pPropertySet; sal_Bool bOwnNumRuleCreated; - static String sInvalidStyle; protected: virtual ~SwXNumberingRules(); @@ -217,7 +216,7 @@ public: const String* GetBulletFontNames() const {return sNewBulletFontNames;} const SwNumRule* GetNumRule() {return pNumRule;} - static const String& GetInvalidStyle(); + static bool isInvalidStyle(const rtl::OUString &rName); void Invalidate() {pDocShell = 0;} const String& GetCreatedNumRuleName() const{return sCreatedNumRuleName; } }; diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index b4a5c6dd5e3b..d5b8a6422a48 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -599,7 +599,7 @@ void setNumberingProperty(const Any& rValue, SwPaM& rPam) { SwNumFmt aFmt(aRule.Get( i )); if( pNewCharStyles[i].Len() && - pNewCharStyles[i] != SwXNumberingRules::GetInvalidStyle() && + !SwXNumberingRules::isInvalidStyle(pNewCharStyles[i]) && (!aFmt.GetCharFmt() || pNewCharStyles[i] != aFmt.GetCharFmt()->GetName())) { if(!pNewCharStyles[i].Len()) @@ -636,7 +636,7 @@ void setNumberingProperty(const Any& rValue, SwPaM& rPam) } //Now again for fonts if( - pBulletFontNames[i] != SwXNumberingRules::GetInvalidStyle() && + !SwXNumberingRules::isInvalidStyle(pBulletFontNames[i]) && ( (pBulletFontNames[i].Len() && !aFmt.GetBulletFont()) || (pBulletFontNames[i].Len() && diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index 12664bde6d34..74bc40dcf905 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -1124,11 +1124,11 @@ OSL_FAIL("not implemented"); /****************************************************************** * SwXNumberingRules ******************************************************************/ -String SwXNumberingRules::sInvalidStyle(String::CreateFromAscii("__XXX___invalid")); +const char aInvalidStyle[] = "__XXX___invalid"; -const String& SwXNumberingRules::GetInvalidStyle() +bool SwXNumberingRules::isInvalidStyle(const rtl::OUString &rName) { - return sInvalidStyle; + return rName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(aInvalidStyle)); } namespace @@ -1196,8 +1196,8 @@ SwXNumberingRules::SwXNumberingRules(const SwNumRule& rRule) : pDoc->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this); for(i = 0; i < MAXLEVEL; i++) { - sNewCharStyleNames[i] = SwXNumberingRules::GetInvalidStyle(); - sNewBulletFontNames[i] = SwXNumberingRules::GetInvalidStyle(); + sNewCharStyleNames[i] = rtl::OUString(aInvalidStyle); + sNewBulletFontNames[i] = rtl::OUString(aInvalidStyle); } } @@ -1399,7 +1399,7 @@ uno::Sequence SwXNumberingRules::GetNumberingRuleByIndex( CharStyleName = pCharFmt->GetName(); //egal ob ein Style vorhanden ist oder nicht ueberschreibt der Array-Eintrag diesen String if(sNewCharStyleNames[(sal_uInt16)nIndex].Len() && - SwXNumberingRules::sInvalidStyle != sNewCharStyleNames[(sal_uInt16)nIndex]) + !SwXNumberingRules::isInvalidStyle(sNewCharStyleNames[(sal_uInt16)nIndex])) CharStyleName = sNewCharStyleNames[(sal_uInt16)nIndex]; String aString; @@ -1752,7 +1752,7 @@ void SwXNumberingRules::SetNumberingRuleByIndex( SwStyleNameMapper::FillUIName( uTmp, sCharFmtName, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, sal_True ); if(sCharFmtName.EqualsAscii(SW_PROP_NAME_STR(UNO_NAME_CHARACTER_FORMAT_NONE))) { - sNewCharStyleNames[(sal_uInt16)nIndex] = SwXNumberingRules::GetInvalidStyle(); + sNewCharStyleNames[(sal_uInt16)nIndex] = rtl::OUString(aInvalidStyle); aFmt.SetCharFmt(0); } else if(pDocShell || pDoc) @@ -2095,7 +2095,7 @@ void SwXNumberingRules::SetNumberingRuleByIndex( } if((!bCharStyleNameSet || !sNewCharStyleNames[(sal_uInt16)nIndex].Len()) && aFmt.GetNumberingType() == NumberingType::BITMAP && !aFmt.GetCharFmt() - && SwXNumberingRules::GetInvalidStyle() != sNewCharStyleNames[(sal_uInt16)nIndex]) + && !SwXNumberingRules::isInvalidStyle(sNewCharStyleNames[(sal_uInt16)nIndex])) { SwStyleNameMapper::FillProgName ( RES_POOLCHR_BUL_LEVEL, sNewCharStyleNames[(sal_uInt16)nIndex] ); } diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 5e6375458429..f2f13313282e 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -1753,7 +1753,7 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, { SwNumFmt aFmt(*pFmt); if( - pCharStyleNames[i] != SwXNumberingRules::GetInvalidStyle() && + !SwXNumberingRules::isInvalidStyle(pCharStyleNames[i]) && ((pCharStyleNames[i].Len() && !pFmt->GetCharFmt()) || (pCharStyleNames[i].Len() && pFmt->GetCharFmt()->GetName() != pCharStyleNames[i]) )) @@ -1786,7 +1786,7 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, } } //jetzt nochmal fuer Fonts - if(pBulletFontNames[i] != SwXNumberingRules::GetInvalidStyle() && + if (!SwXNumberingRules::isInvalidStyle(pBulletFontNames[i]) && ((pBulletFontNames[i].Len() && !pFmt->GetBulletFont()) || (pBulletFontNames[i].Len() && pFmt->GetBulletFont()->GetName() != pBulletFontNames[i]) )) -- cgit