From 4c0d933278c13b6197da40deaf4842fcf57c37ca Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 6 Aug 2013 15:34:01 +0200 Subject: convert more SwTxtNode methods to OUString Change-Id: If7cc107e521e1a70ba00b0f24057039fcdd2c576 --- sw/inc/ndtxt.hxx | 4 ++-- sw/source/core/txtnode/ndtxt.cxx | 21 ++++++++++----------- sw/source/core/txtnode/thints.cxx | 2 +- 3 files changed, 13 insertions(+), 14 deletions(-) (limited to 'sw') diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index 9192ff38420c..71bf01335d2e 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -624,8 +624,8 @@ public: */ bool HasVisibleNumberingOrBullet() const; - void SetListId( const String sListId ); - String GetListId() const; + void SetListId(OUString const& rListId); + OUString GetListId() const; /** Determines, if the list level indent attributes can be applied to the paragraph. diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 824963c518d8..01a2eee83927 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -212,7 +212,7 @@ SwTxtNode::SwTxtNode( const SwNodeIndex &rWhere, if( pAutoAttr ) SetAttr( *pAutoAttr ); - if ( !IsInList() && GetNumRule() && GetListId().Len() > 0 ) + if (!IsInList() && GetNumRule() && !GetListId().isEmpty()) { // #i101516# // apply paragraph style's assigned outline style list level as @@ -2613,7 +2613,7 @@ SwCntntNode* SwTxtNode::AppendNode( const SwPosition & rPos ) pNew->ResetAttr( RES_PARATR_LIST_LEVEL ); } - if ( !IsInList() && GetNumRule() && GetListId().Len() > 0 ) + if (!IsInList() && GetNumRule() && !GetListId().isEmpty()) { AddToList(); } @@ -4047,27 +4047,27 @@ bool SwTxtNode::IsFirstOfNumRule() const return bResult; } -void SwTxtNode::SetListId( const String sListId ) +void SwTxtNode::SetListId(OUString const& rListId) { const SfxStringItem& rListIdItem = dynamic_cast(GetAttr( RES_PARATR_LIST_ID )); - if ( rListIdItem.GetValue() != sListId ) + if (rListIdItem.GetValue() != rListId) { - if ( sListId.Len() == 0 ) + if (rListId.isEmpty()) { ResetAttr( RES_PARATR_LIST_ID ); } else { - SfxStringItem aNewListIdItem( RES_PARATR_LIST_ID, sListId ); + SfxStringItem aNewListIdItem(RES_PARATR_LIST_ID, rListId); SetAttr( aNewListIdItem ); } } } -String SwTxtNode::GetListId() const +OUString SwTxtNode::GetListId() const { - String sListId; + OUString sListId; const SfxStringItem& rListIdItem = dynamic_cast(GetAttr( RES_PARATR_LIST_ID )); @@ -4075,7 +4075,7 @@ String SwTxtNode::GetListId() const // As long as no explicit list id attribute is set, use the list id of // the list, which has been created for the applied list style. - if ( sListId.Len() == 0 ) + if (sListId.isEmpty()) { SwNumRule* pRule = GetNumRule(); if ( pRule ) @@ -4826,8 +4826,7 @@ namespace { { // check, if in spite of the reset of the list style or the list id // the paragraph still has to be added to a list. - if ( mrTxtNode.GetNumRule() && - mrTxtNode.GetListId().Len() > 0 ) + if (mrTxtNode.GetNumRule() && !mrTxtNode.GetListId().isEmpty()) { // #i96062# // If paragraph has no list level attribute set and list style diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index f4f96e04183f..82ccc7325c65 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -1643,7 +1643,7 @@ bool SwTxtNode::TryCharSetExpandToNum(const SfxItemSet& aCharSet) if (!IsDefaultItem(&rInnerItem) && !IsInvalidItem(&rInnerItem)) return bRet; - if ( !IsInList() && GetNumRule() && GetListId().Len() > 0 ) + if (!IsInList() && GetNumRule() && !GetListId().isEmpty()) { return bRet; } -- cgit