diff options
author | Justin Luth <justin_luth@sil.org> | 2015-10-27 20:20:27 +0300 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-10-28 14:20:27 +0000 |
commit | d24b2a352ad32df843964c687970edc4dc0f27aa (patch) | |
tree | 85caf3c3a0f52953929d22459a742dd734c94d48 | |
parent | 59dfeacf8c08b911e8bf3b1f5d9bf896970dd929 (diff) |
tdf#95354 - pad AltX to 4 characters
Change-Id: I552f305e78427bdbd37e48013f5cc4b78024e8ff
Reviewed-on: https://gerrit.libreoffice.org/19631
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r-- | i18nutil/source/utility/unicode.cxx | 6 | ||||
-rw-r--r-- | sw/qa/extras/uiwriter/data/unicodeAltX.odt | bin | 19259 -> 19978 bytes | |||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/i18nutil/source/utility/unicode.cxx b/i18nutil/source/utility/unicode.cxx index 5180e1ec0674..8b56239550d5 100644 --- a/i18nutil/source/utility/unicode.cxx +++ b/i18nutil/source/utility/unicode.cxx @@ -1242,8 +1242,12 @@ OUString ToggleUnicodeCodepoint::ReplacementString() sal_Int32 nPos = 0; while( nPos < sIn.getLength() ) { + OUStringBuffer aTmp = OUString::number(sIn.iterateCodePoints(&nPos),16); + //pad with zeros - minimum length of 4. + for( sal_Int32 i = 4 - aTmp.getLength(); i > 0; --i ) + aTmp.insert( 0,"0" ); maOutput.append( "U+" ); - maOutput.append( OUString::number(sIn.iterateCodePoints(&nPos),16) ); + maOutput.append( aTmp ); } } return maOutput.toString(); diff --git a/sw/qa/extras/uiwriter/data/unicodeAltX.odt b/sw/qa/extras/uiwriter/data/unicodeAltX.odt Binary files differindex 4c96eff0120f..3ad797c669cc 100644 --- a/sw/qa/extras/uiwriter/data/unicodeAltX.odt +++ b/sw/qa/extras/uiwriter/data/unicodeAltX.odt diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index d4ef3b72b7a5..ff1d65ed9388 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -2609,7 +2609,7 @@ void SwUiWriterTest::testUnicodeNotationToggle() pWrtShell->EndPara(); sOriginalDocString = pWrtShell->GetCrsr()->GetNode().GetTextNode()->GetText(); - CPPUNIT_ASSERT_EQUAL(OUString("uU+2b"), sOriginalDocString); + CPPUNIT_ASSERT_EQUAL(OUString("uU+002b"), sOriginalDocString); lcl_dispatchCommand(mxComponent, ".uno:UnicodeNotationToggle", aPropertyValues); sExpectedString = "u+"; |