diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2017-11-01 11:06:28 +0100 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2017-11-01 11:08:23 +0100 |
commit | 7ca48ce45d8c941587e296f34cba98509e35a5b5 (patch) | |
tree | 93832a041d7a2a6af3eb033347d2ccc49d79db96 /sw/source/core/txtnode/fntcap.cxx | |
parent | 6ee4f63438a2ea7a56a821373679aa56814b2582 (diff) |
OUString: avoid temporaries, constify
Change-Id: I595b90b16c2c2a60a61811878ad06ae729a8943c
Diffstat (limited to 'sw/source/core/txtnode/fntcap.cxx')
-rw-r--r-- | sw/source/core/txtnode/fntcap.cxx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sw/source/core/txtnode/fntcap.cxx b/sw/source/core/txtnode/fntcap.cxx index 2965b496e2d2..ebf7a3086f02 100644 --- a/sw/source/core/txtnode/fntcap.cxx +++ b/sw/source/core/txtnode/fntcap.cxx @@ -478,7 +478,6 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo ) // Look if the length of the original text and the ToUpper-converted // text is different. If yes, do special handling. - OUString aNewText; SwCapitalInfo aCapInf(oldText); bool bCaseMapLengthDiffers(aText.getLength() != oldText.getLength()); if ( bCaseMapLengthDiffers ) @@ -576,8 +575,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo ) // Build an own 'changed' string for the given part of the // source string and use it. That new string may differ in length // from the source string. - const OUString aSnippet(oldText.copy(nOldPos, nPos - nOldPos)); - aNewText = CalcCaseMap( aSnippet ); + const OUString aNewText = CalcCaseMap( oldText.copy(nOldPos, nPos-nOldPos) ); aCapInf.nIdx = nOldPos; aCapInf.nLen = nPos - nOldPos; rDo.GetInf().SetIdx( 0 ); @@ -643,8 +641,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo ) // Build an own 'changed' string for the given part of the // source string and use it. That new string may differ in length // from the source string. - const OUString aSnippet(oldText.copy(nOldPos, nTmp - nOldPos)); - aNewText = CalcCaseMap( aSnippet ); + const OUString aNewText = CalcCaseMap( oldText.copy(nOldPos, nTmp-nOldPos) ); aCapInf.nIdx = nOldPos; aCapInf.nLen = nTmp - nOldPos; rDo.GetInf().SetIdx( 0 ); @@ -684,8 +681,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo ) // Build an own 'changed' string for the given part of the // source string and use it. That new string may differ in length // from the source string. - const OUString aSnippet(oldText.copy(nOldPos, nTmp - nOldPos)); - aNewText = CalcCaseMap( aSnippet ); + const OUString aNewText = CalcCaseMap( oldText.copy(nOldPos, nTmp-nOldPos) ); aCapInf.nIdx = nOldPos; aCapInf.nLen = nTmp - nOldPos; rDo.GetInf().SetIdx( 0 ); |