summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-09-27 23:44:21 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-09-28 08:27:11 +0200
commitc9f3277ea7bb22c395e8938168ce4df9101f7850 (patch)
treeb155ca6e534e751cd2c4ba4b2ead8a181bbafa22 /starmath
parent0fa21336428b286d69684cfbb7b845f123657041 (diff)
loplugin:stringconstant: Simplify construction of non-ASCII OUString
Change-Id: If80c53978106789824e6154db396baeecc1969dd Reviewed-on: https://gerrit.libreoffice.org/42876 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/qa/cppunit/test_nodetotextvisitors.cxx7
-rw-r--r--starmath/source/ElementsDockingWindow.cxx2
2 files changed, 3 insertions, 6 deletions
diff --git a/starmath/qa/cppunit/test_nodetotextvisitors.cxx b/starmath/qa/cppunit/test_nodetotextvisitors.cxx
index aec16ea30738..dee561d371aa 100644
--- a/starmath/qa/cppunit/test_nodetotextvisitors.cxx
+++ b/starmath/qa/cppunit/test_nodetotextvisitors.cxx
@@ -667,12 +667,9 @@ void Test::testMiscEquivalent()
void Test::testParser()
{
- char const* const formula = "{ \xf0\x9d\x91\x8e }"; // non-BMP Unicode
- char const* const expected = "\xf0\x9d\x91\x8e";
-
OUString sOutput;
- OUString sInput = OUString(formula, strlen(formula), RTL_TEXTENCODING_UTF8);
- OUString sExpected = OUString(expected, strlen(expected), RTL_TEXTENCODING_UTF8);
+ OUString sInput(u"{ \U0001D44E }"); // non-BMP Unicode
+ OUString sExpected(u"\U0001D44E");
std::unique_ptr<SmNode> pNode(SmParser().ParseExpression(sInput));
pNode->Prepare(xDocShRef->GetFormat(), *xDocShRef);
SmNodeToTextVisitor(pNode.get(), sOutput);
diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx
index 7adf4ce5fd92..1a8f93119d5d 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -559,7 +559,7 @@ void SmElementsControl::addElements(const std::pair<const char*, const char*> aE
} else {
OUString aElement(OUString::createFromAscii(pElement));
if (aElement == RID_NEWLINE)
- addElement(OUString( "\xe2\x86\xb5", 3, RTL_TEXTENCODING_UTF8 ), aElement, SmResId(pElementHelp));
+ addElement(OUString(u"\u21B5"), aElement, SmResId(pElementHelp));
else if (aElement == RID_SBLANK)
addElement("\"`\"", aElement, SmResId(pElementHelp));
else if (aElement == RID_BLANK)