diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2013-08-21 08:58:16 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-08-21 11:43:35 +0000 |
commit | 64b315df9b7f90621db92062c6ce62f487325388 (patch) | |
tree | ef077227543eca2913b5952ca3050c978e449d23 /sw | |
parent | cf3318f6edc93bfb0d8951a3c1d74ecfbc393a8d (diff) |
GetOutlineRuleName: return OUString instead of char*
Change-Id: I79cd722aa2d3bb0292f9b0f7fb6989e2e17d0ff0
Reviewed-on: https://gerrit.libreoffice.org/5563
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/numrule.hxx | 3 | ||||
-rw-r--r-- | sw/source/core/doc/docnew.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/docnum.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/number.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/txtnode/ndtxt.cxx | 5 |
5 files changed, 11 insertions, 13 deletions
diff --git a/sw/inc/numrule.hxx b/sw/inc/numrule.hxx index a01e0b5a0438..850d4128cd9c 100644 --- a/sw/inc/numrule.hxx +++ b/sw/inc/numrule.hxx @@ -115,7 +115,6 @@ private: /// default list level properties for position-and-space mode LABEL_ALIGNMENT static SwNumFmt* aLabelAlignmentBaseFmts [ RULE_END ][ MAXLEVEL ]; static sal_uInt16 nRefCount; - static char* pDefOutlineName; SwNumFmt* aFmts[ MAXLEVEL ]; @@ -208,7 +207,7 @@ public: void SetNumRuleMap( boost::unordered_map<OUString, SwNumRule *, OUStringHash>* pNumRuleMap ); - static char* GetOutlineRuleName() { return pDefOutlineName; } + static OUString GetOutlineRuleName(); static sal_uInt16 GetNumIndent( sal_uInt8 nLvl ); static sal_uInt16 GetBullIndent( sal_uInt8 nLvl ); diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 5d81fd1c8f75..7c3b3c8435f1 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -370,7 +370,7 @@ SwDoc::SwDoc() _InitFieldTypes(); // Create a default OutlineNumRule (for Filters) - mpOutlineRule = new SwNumRule( OUString::createFromAscii( SwNumRule::GetOutlineRuleName() ), + mpOutlineRule = new SwNumRule( SwNumRule::GetOutlineRuleName(), // #i89178# numfunc::GetDefaultPositionAndSpaceMode(), OUTLINE_RULE ); @@ -843,7 +843,7 @@ void SwDoc::ClearDoc() maListStyleLists.clear(); // creation of new outline numbering rule - mpOutlineRule = new SwNumRule( OUString::createFromAscii( SwNumRule::GetOutlineRuleName() ), + mpOutlineRule = new SwNumRule( SwNumRule::GetOutlineRuleName(), // #i89178# numfunc::GetDefaultPositionAndSpaceMode(), OUTLINE_RULE ); diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 97e08fa246c5..dca77538ca44 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -104,9 +104,7 @@ void SwDoc::SetOutlineNumRule( const SwNumRule& rRule ) } mpOutlineRule->SetRuleType( OUTLINE_RULE ); - mpOutlineRule->SetName( OUString::createFromAscii( - SwNumRule::GetOutlineRuleName() ), - *this); + mpOutlineRule->SetName(SwNumRule::GetOutlineRuleName(), *this); // assure that the outline numbering rule is an automatic rule mpOutlineRule->SetAutoRule( sal_True ); diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index 9f1fc8686900..aa9b4252e63e 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -59,15 +59,17 @@ SwNumFmt* SwNumRule::aBaseFmts[ RULE_END ][ MAXLEVEL ] = { SwNumFmt* SwNumRule::aLabelAlignmentBaseFmts[ RULE_END ][ MAXLEVEL ] = { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; -char sOutline[] = "Outline"; -char* SwNumRule::pDefOutlineName = sOutline; - const sal_uInt16 SwNumRule::aDefNumIndents[ MAXLEVEL ] = { //inch: 0,5 1,0 1,5 2,0 2,5 3,0 3,5 4,0 4,5 5,0 1440/4, 1440/2, 1440*3/4, 1440, 1440*5/4, 1440*3/2, 1440*7/4, 1440*2, 1440*9/4, 1440*5/2 }; +OUString SwNumRule::GetOutlineRuleName() +{ + return OUString("Outline"); +} + const SwNumFmt& SwNumRule::Get( sal_uInt16 i ) const { OSL_ASSERT( i < MAXLEVEL && eRuleType < RULE_END ); diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 9cfe80739464..d0cd25a26862 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -3599,7 +3599,7 @@ namespace { rTxtNode.RemoveFromList(); // If new list style is the outline style, apply outline // level as the list level. - if (sNumRule.equalsAscii(SwNumRule::GetOutlineRuleName())) + if (sNumRule==SwNumRule::GetOutlineRuleName()) { // #i70748# OSL_ENSURE( rTxtNode.GetTxtColl()->IsAssignedToListLevelOfOutlineStyle(), @@ -4830,8 +4830,7 @@ namespace { // If paragraph has no list level attribute set and list style // is the outline style, apply outline level as the list level. if ( !mrTxtNode.HasAttrListLevel() && - mrTxtNode.GetNumRule()->GetName().equalsAscii( - SwNumRule::GetOutlineRuleName()) && + mrTxtNode.GetNumRule()->GetName()==SwNumRule::GetOutlineRuleName() && mrTxtNode.GetTxtColl()->IsAssignedToListLevelOfOutlineStyle() ) { int nNewListLevel = mrTxtNode.GetTxtColl()->GetAssignedOutlineStyleLevel(); |