summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-04-01 21:25:49 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-04-02 14:53:48 +0100
commit09bdea8900c5ce79df3e8f2b7fbeeed06a5b4111 (patch)
treebf8ccafec8f39df52a0b1c595e7c8a355630ac04 /sw
parent15f14ec79477142cf2bcb1484511b7bea6f1485b (diff)
remove static objects from static_initialization_and_destruction chain
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/unosett.hxx3
-rw-r--r--sw/source/core/unocore/unocrsrhelper.cxx4
-rw-r--r--sw/source/core/unocore/unosett.cxx16
-rw-r--r--sw/source/core/unocore/unostyle.cxx4
4 files changed, 13 insertions, 14 deletions
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<beans::PropertyValue> 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]) ))