diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-01-07 16:42:41 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-01-07 19:45:35 +0100 |
commit | 0701aca589b819b845d08ea60263ad89718cfd7f (patch) | |
tree | f191b28d43c6498783c044b67b58c72c6c0053ae /sw | |
parent | 1d9128b6d712669185f402314e5fb57130d4ba5a (diff) |
Use o3tl::temporary in calls to OUString::iterateCodePoints
...that are not interested in the updated *indexUtf16 value
Change-Id: Iaaa0fe45dcb54c4a8a347bcdb6fca6041218d009
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108941
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/ww8par2.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par3.cxx | 5 | ||||
-rw-r--r-- | sw/source/uibase/wrtsh/delete.cxx | 7 |
3 files changed, 9 insertions, 8 deletions
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 6bc5b6866f21..e6901f360f84 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -22,6 +22,7 @@ #include <comphelper/string.hxx> #include <o3tl/safeint.hxx> +#include <o3tl/temporary.hxx> #include <tools/solar.h> #include <vcl/font.hxx> #include <hintids.hxx> @@ -670,8 +671,8 @@ void SwWW8ImplReader::SetAnlvStrings(SwNumFormat &rNum, WW8_ANLV const &rAV, // take only the very first character if (rAV.cbTextBefore || rAV.cbTextAfter) { - sal_Int32 nIndexUtf16 = 0; - rNum.SetBulletChar(sText.toString().iterateCodePoints(&nIndexUtf16)); + rNum.SetBulletChar( + sText.toString().iterateCodePoints(&o3tl::temporary(sal_Int32(0)))); } else rNum.SetBulletChar( 0x2190 ); diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index 175f7b948613..5c44be1ad5f5 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -46,6 +46,7 @@ #include <editeng/udlnitem.hxx> #include <editeng/postitem.hxx> #include <o3tl/safeint.hxx> +#include <o3tl/temporary.hxx> #include <unotextrange.hxx> #include <doc.hxx> #include <docary.hxx> @@ -832,8 +833,8 @@ bool WW8ListManager::ReadLVL(SwNumFormat& rNumFormat, std::unique_ptr<SfxItemSet if (style::NumberingType::CHAR_SPECIAL == nType) { - sal_Int32 nIndexUtf16 = 0; - cBullet = !sNumString.isEmpty() ? sNumString.iterateCodePoints(&nIndexUtf16) : 0x2190; + cBullet = !sNumString.isEmpty() + ? sNumString.iterateCodePoints(&o3tl::temporary(sal_Int32(0))) : 0x2190; if (!cBullet) // unsave control code? cBullet = 0x2190; diff --git a/sw/source/uibase/wrtsh/delete.cxx b/sw/source/uibase/wrtsh/delete.cxx index 0dbc7eb89cc5..4a9b29af36e3 100644 --- a/sw/source/uibase/wrtsh/delete.cxx +++ b/sw/source/uibase/wrtsh/delete.cxx @@ -30,6 +30,7 @@ #include <docufld.hxx> #include <IDocumentUndoRedo.hxx> #include <i18nutil/unicode.hxx> +#include <o3tl/temporary.hxx> #include <rtl/character.hxx> #include <doc.hxx> @@ -258,8 +259,7 @@ bool SwWrtShell::DelLeft() if ( rtl::isSurrogate( nCode ) ) { OUString sStr = GetSelText(); - sal_Int32 nIndex = 0; - nCode = sStr.iterateCodePoints( &nIndex ); + nCode = sStr.iterateCodePoints( &o3tl::temporary(sal_Int32(0)) ); } if ( unicode::isIVSSelector( nCode ) ) @@ -267,8 +267,7 @@ bool SwWrtShell::DelLeft() SwCursorShell::Push(); SwCursorShell::Left(1, CRSR_SKIP_CHARS); OUString sStr = GetSelText(); - sal_Int32 nIndex = 0; - nCode = sStr.iterateCodePoints( &nIndex ); + nCode = sStr.iterateCodePoints( &o3tl::temporary(sal_Int32(0)) ); if ( unicode::isCJKIVSCharacter( nCode ) ) SwCursorShell::Pop( SwCursorShell::PopMode::DeleteStack ); else |