diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2017-08-15 22:08:24 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2017-08-27 14:10:52 +0200 |
commit | b312834555658064dd9491484695f84959e0b059 (patch) | |
tree | f2de016a07016456110965bc44de5130cbc3d227 | |
parent | 9786bc48e3fa0500306aa5eeb3e7ffdf6630c904 (diff) |
OUString: constify, avoid unnecessary assignments
Change-Id: I697e19196b7d3ab9febafc05b07eb8c2aa218248
-rw-r--r-- | sw/source/core/txtnode/atrfld.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/txtnode/ndtxt.cxx | 8 |
2 files changed, 5 insertions, 7 deletions
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx index 4beca6d098c6..3aa9a961a784 100644 --- a/sw/source/core/txtnode/atrfld.cxx +++ b/sw/source/core/txtnode/atrfld.cxx @@ -401,8 +401,8 @@ void SwTextField::ExpandTextField(const bool bForceNotify) const } } } - - m_aExpand = aNewExpand; + else + m_aExpand = aNewExpand; const_cast<SwTextField*>(this)->NotifyContentChange( const_cast<SwFormatField&>(GetFormatField()) ); } diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 5d0e74955bc0..8391a652df2f 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -3023,7 +3023,7 @@ OUString SwTextNode::GetExpandText( const sal_Int32 nIdx, eMode |= ExpandMode::ExpandFootnote; ModelToViewHelper aConversionMap(*this, eMode); - OUString aExpandText = aConversionMap.getViewText(); + const OUString aExpandText = aConversionMap.getViewText(); const sal_Int32 nExpandBegin = aConversionMap.ConvertToViewPosition( nIdx ); sal_Int32 nEnd = nLen == -1 ? GetText().getLength() : nIdx + nLen; const sal_Int32 nExpandEnd = aConversionMap.ConvertToViewPosition( nEnd ); @@ -3991,11 +3991,9 @@ void SwTextNode::SetListId(OUString const& rListId) OUString SwTextNode::GetListId() const { - OUString sListId; - const SfxStringItem& rListIdItem = dynamic_cast<const SfxStringItem&>(GetAttr( RES_PARATR_LIST_ID )); - sListId = rListIdItem.GetValue(); + const OUString sListId {rListIdItem.GetValue()}; // 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. @@ -4004,7 +4002,7 @@ OUString SwTextNode::GetListId() const SwNumRule* pRule = GetNumRule(); if ( pRule ) { - sListId = pRule->GetDefaultListId(); + return pRule->GetDefaultListId(); } } |