Kaydet (Commit) 64b315df authored tarafından Matteo Casalin's avatar Matteo Casalin Kaydeden (comit) Michael Stahl

GetOutlineRuleName: return OUString instead of char*

Change-Id: I79cd722aa2d3bb0292f9b0f7fb6989e2e17d0ff0
Reviewed-on: https://gerrit.libreoffice.org/5563Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
Tested-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst cf3318f6
...@@ -115,7 +115,6 @@ private: ...@@ -115,7 +115,6 @@ private:
/// default list level properties for position-and-space mode LABEL_ALIGNMENT /// default list level properties for position-and-space mode LABEL_ALIGNMENT
static SwNumFmt* aLabelAlignmentBaseFmts [ RULE_END ][ MAXLEVEL ]; static SwNumFmt* aLabelAlignmentBaseFmts [ RULE_END ][ MAXLEVEL ];
static sal_uInt16 nRefCount; static sal_uInt16 nRefCount;
static char* pDefOutlineName;
SwNumFmt* aFmts[ MAXLEVEL ]; SwNumFmt* aFmts[ MAXLEVEL ];
...@@ -208,7 +207,7 @@ public: ...@@ -208,7 +207,7 @@ public:
void SetNumRuleMap( void SetNumRuleMap(
boost::unordered_map<OUString, SwNumRule *, OUStringHash>* pNumRuleMap ); 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 GetNumIndent( sal_uInt8 nLvl );
static sal_uInt16 GetBullIndent( sal_uInt8 nLvl ); static sal_uInt16 GetBullIndent( sal_uInt8 nLvl );
......
...@@ -370,7 +370,7 @@ SwDoc::SwDoc() ...@@ -370,7 +370,7 @@ SwDoc::SwDoc()
_InitFieldTypes(); _InitFieldTypes();
// Create a default OutlineNumRule (for Filters) // Create a default OutlineNumRule (for Filters)
mpOutlineRule = new SwNumRule( OUString::createFromAscii( SwNumRule::GetOutlineRuleName() ), mpOutlineRule = new SwNumRule( SwNumRule::GetOutlineRuleName(),
// #i89178# // #i89178#
numfunc::GetDefaultPositionAndSpaceMode(), numfunc::GetDefaultPositionAndSpaceMode(),
OUTLINE_RULE ); OUTLINE_RULE );
...@@ -843,7 +843,7 @@ void SwDoc::ClearDoc() ...@@ -843,7 +843,7 @@ void SwDoc::ClearDoc()
maListStyleLists.clear(); maListStyleLists.clear();
// creation of new outline numbering rule // creation of new outline numbering rule
mpOutlineRule = new SwNumRule( OUString::createFromAscii( SwNumRule::GetOutlineRuleName() ), mpOutlineRule = new SwNumRule( SwNumRule::GetOutlineRuleName(),
// #i89178# // #i89178#
numfunc::GetDefaultPositionAndSpaceMode(), numfunc::GetDefaultPositionAndSpaceMode(),
OUTLINE_RULE ); OUTLINE_RULE );
......
...@@ -104,9 +104,7 @@ void SwDoc::SetOutlineNumRule( const SwNumRule& rRule ) ...@@ -104,9 +104,7 @@ void SwDoc::SetOutlineNumRule( const SwNumRule& rRule )
} }
mpOutlineRule->SetRuleType( OUTLINE_RULE ); mpOutlineRule->SetRuleType( OUTLINE_RULE );
mpOutlineRule->SetName( OUString::createFromAscii( mpOutlineRule->SetName(SwNumRule::GetOutlineRuleName(), *this);
SwNumRule::GetOutlineRuleName() ),
*this);
// assure that the outline numbering rule is an automatic rule // assure that the outline numbering rule is an automatic rule
mpOutlineRule->SetAutoRule( sal_True ); mpOutlineRule->SetAutoRule( sal_True );
......
...@@ -59,15 +59,17 @@ SwNumFmt* SwNumRule::aBaseFmts[ RULE_END ][ MAXLEVEL ] = { ...@@ -59,15 +59,17 @@ SwNumFmt* SwNumRule::aBaseFmts[ RULE_END ][ MAXLEVEL ] = {
SwNumFmt* SwNumRule::aLabelAlignmentBaseFmts[ RULE_END ][ MAXLEVEL ] = { SwNumFmt* SwNumRule::aLabelAlignmentBaseFmts[ RULE_END ][ MAXLEVEL ] = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; {0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } };
char sOutline[] = "Outline";
char* SwNumRule::pDefOutlineName = sOutline;
const sal_uInt16 SwNumRule::aDefNumIndents[ MAXLEVEL ] = { 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 //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/4, 1440/2, 1440*3/4, 1440, 1440*5/4, 1440*3/2, 1440*7/4, 1440*2,
1440*9/4, 1440*5/2 1440*9/4, 1440*5/2
}; };
OUString SwNumRule::GetOutlineRuleName()
{
return OUString("Outline");
}
const SwNumFmt& SwNumRule::Get( sal_uInt16 i ) const const SwNumFmt& SwNumRule::Get( sal_uInt16 i ) const
{ {
OSL_ASSERT( i < MAXLEVEL && eRuleType < RULE_END ); OSL_ASSERT( i < MAXLEVEL && eRuleType < RULE_END );
......
...@@ -3599,7 +3599,7 @@ namespace { ...@@ -3599,7 +3599,7 @@ namespace {
rTxtNode.RemoveFromList(); rTxtNode.RemoveFromList();
// If new list style is the outline style, apply outline // If new list style is the outline style, apply outline
// level as the list level. // level as the list level.
if (sNumRule.equalsAscii(SwNumRule::GetOutlineRuleName())) if (sNumRule==SwNumRule::GetOutlineRuleName())
{ {
// #i70748# // #i70748#
OSL_ENSURE( rTxtNode.GetTxtColl()->IsAssignedToListLevelOfOutlineStyle(), OSL_ENSURE( rTxtNode.GetTxtColl()->IsAssignedToListLevelOfOutlineStyle(),
...@@ -4830,8 +4830,7 @@ namespace { ...@@ -4830,8 +4830,7 @@ namespace {
// If paragraph has no list level attribute set and list style // If paragraph has no list level attribute set and list style
// is the outline style, apply outline level as the list level. // is the outline style, apply outline level as the list level.
if ( !mrTxtNode.HasAttrListLevel() && if ( !mrTxtNode.HasAttrListLevel() &&
mrTxtNode.GetNumRule()->GetName().equalsAscii( mrTxtNode.GetNumRule()->GetName()==SwNumRule::GetOutlineRuleName() &&
SwNumRule::GetOutlineRuleName()) &&
mrTxtNode.GetTxtColl()->IsAssignedToListLevelOfOutlineStyle() ) mrTxtNode.GetTxtColl()->IsAssignedToListLevelOfOutlineStyle() )
{ {
int nNewListLevel = mrTxtNode.GetTxtColl()->GetAssignedOutlineStyleLevel(); int nNewListLevel = mrTxtNode.GetTxtColl()->GetAssignedOutlineStyleLevel();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment