diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-04-28 17:55:02 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-04-28 18:26:56 +0200 |
commit | 740cf511036cdf881a521a79218d3dcc29422db3 (patch) | |
tree | 9eaa8ec35c47e144dc5dac59ef438bd46a0100e6 /starmath | |
parent | c22ecc18674a8f9f41afa9f6b1364989b18147d7 (diff) |
loplugin:salunicodeliteral: starmath
Change-Id: Ic02e71ccb2d5fe2e3505853c6e164f17e26361b2
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/inc/node.hxx | 2 | ||||
-rw-r--r-- | starmath/qa/cppunit/test_node.cxx | 26 | ||||
-rw-r--r-- | starmath/qa/extras/mmlexport-test.cxx | 2 | ||||
-rw-r--r-- | starmath/source/mathmlattr.cxx | 8 | ||||
-rw-r--r-- | starmath/source/mathmlexport.cxx | 2 | ||||
-rw-r--r-- | starmath/source/node.cxx | 4 | ||||
-rw-r--r-- | starmath/source/ooxmlimport.cxx | 4 | ||||
-rw-r--r-- | starmath/source/rect.cxx | 12 |
8 files changed, 30 insertions, 30 deletions
diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx index dd0a4c663216..4f199ad332a9 100644 --- a/starmath/inc/node.hxx +++ b/starmath/inc/node.hxx @@ -482,7 +482,7 @@ protected: : SmSpecialNode(eNodeType, rNodeToken, FNT_MATH) { sal_Unicode cChar = GetToken().cMathChar; - if (sal_Unicode('\0') != cChar) + if (u'\0' != cChar) SetText(OUString(cChar)); } diff --git a/starmath/qa/cppunit/test_node.cxx b/starmath/qa/cppunit/test_node.cxx index 017089acc628..0086dfe45fb3 100644 --- a/starmath/qa/cppunit/test_node.cxx +++ b/starmath/qa/cppunit/test_node.cxx @@ -99,33 +99,33 @@ void NodeTest::testTdf52225() CPPUNIT_ASSERT_EQUAL(SmNodeType::Special, pNode->GetType()); \ const SmSpecialNode *pSn = static_cast<const SmSpecialNode *>(pNode); \ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pSn->GetText().getLength()); \ - CPPUNIT_ASSERT_EQUAL(sal_Unicode(code), pSn->GetText()[0]); \ + CPPUNIT_ASSERT_EQUAL(code, pSn->GetText()[0]); \ CPPUNIT_ASSERT_EQUAL(OUString(text), pSn->GetToken().aText); \ CPPUNIT_ASSERT_EQUAL(bItalic, IsItalic(pSn->GetFont())); \ } while (false) SmFormat aFormat = mxDocShell->GetFormat(); CPPUNIT_ASSERT_EQUAL(sal_Int16(2), aFormat.GetGreekCharStyle()); // default format = 2 - CHECK_GREEK_SYMBOL("%ALPHA", 0x0391, false); - CHECK_GREEK_SYMBOL("%iALPHA", 0x0391, true); - CHECK_GREEK_SYMBOL("%alpha", 0x03b1, true); - CHECK_GREEK_SYMBOL("%ialpha", 0x03b1, true); + CHECK_GREEK_SYMBOL("%ALPHA", u'\x0391', false); + CHECK_GREEK_SYMBOL("%iALPHA", u'\x0391', true); + CHECK_GREEK_SYMBOL("%alpha", u'\x03b1', true); + CHECK_GREEK_SYMBOL("%ialpha", u'\x03b1', true); // mode 1 aFormat.SetGreekCharStyle(1); mxDocShell->SetFormat(aFormat); - CHECK_GREEK_SYMBOL("%BETA", 0x0392, true); - CHECK_GREEK_SYMBOL("%iBETA", 0x0392, true); - CHECK_GREEK_SYMBOL("%beta", 0x03b2, true); - CHECK_GREEK_SYMBOL("%ibeta", 0x03b2, true); + CHECK_GREEK_SYMBOL("%BETA", u'\x0392', true); + CHECK_GREEK_SYMBOL("%iBETA", u'\x0392', true); + CHECK_GREEK_SYMBOL("%beta", u'\x03b2', true); + CHECK_GREEK_SYMBOL("%ibeta", u'\x03b2', true); // mode 0 aFormat.SetGreekCharStyle(0); mxDocShell->SetFormat(aFormat); - CHECK_GREEK_SYMBOL("%GAMMA", 0x0393, false); - CHECK_GREEK_SYMBOL("%iGAMMA", 0x0393, true); - CHECK_GREEK_SYMBOL("%gamma", 0x03b3, false); - CHECK_GREEK_SYMBOL("%igamma", 0x03b3, true); + CHECK_GREEK_SYMBOL("%GAMMA", u'\x0393', false); + CHECK_GREEK_SYMBOL("%iGAMMA", u'\x0393', true); + CHECK_GREEK_SYMBOL("%gamma", u'\x03b3', false); + CHECK_GREEK_SYMBOL("%igamma", u'\x03b3', true); #undef CHECK_GREEK_SYMBOL } diff --git a/starmath/qa/extras/mmlexport-test.cxx b/starmath/qa/extras/mmlexport-test.cxx index 8254eec92ef9..a4373ac2c780 100644 --- a/starmath/qa/extras/mmlexport-test.cxx +++ b/starmath/qa/extras/mmlexport-test.cxx @@ -104,7 +104,7 @@ void MathMLExportTest::testTdf97049() assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mo[1]", "stretchy", "true"); auto aContent = getXPathContent(pDoc, "/m:math/m:semantics/m:mrow/m:mo[1]"); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aContent.getLength()); - CPPUNIT_ASSERT_EQUAL(sal_Unicode(0x222B), aContent[0]); + CPPUNIT_ASSERT_EQUAL(u'\x222B', aContent[0]); } void MathMLExportTest::testTdf101022() diff --git a/starmath/source/mathmlattr.cxx b/starmath/source/mathmlattr.cxx index 0c39c3e2862e..fd7bf378724c 100644 --- a/starmath/source/mathmlattr.cxx +++ b/starmath/source/mathmlattr.cxx @@ -34,14 +34,14 @@ sal_Int32 ParseMathMLUnsignedNumber(const OUString &rStr, Fraction *pUN) for (nIdx = 0; nIdx < nLen; nIdx++) { auto cD = rStr[nIdx]; - if (cD == sal_Unicode('.')) + if (cD == u'.') { if (nDecimalPoint >= 0) return -1; nDecimalPoint = nIdx; continue; } - if (cD < sal_Unicode('0') || sal_Unicode('9') < cD) + if (cD < u'0' || u'9' < cD) break; } if (nIdx == 0 || (nIdx == 1 && nDecimalPoint == 0)) @@ -72,7 +72,7 @@ sal_Int32 ParseMathMLNumber(const OUString &rStr, Fraction *pN) assert(pN); if (rStr.isEmpty()) return -1; - bool bNegative = (rStr[0] == sal_Unicode('-')); + bool bNegative = (rStr[0] == '-'); sal_Int32 nOffset = bNegative ? 1 : 0; Fraction aF; auto nIdx = ParseMathMLUnsignedNumber(rStr.copy(nOffset), &aF); @@ -137,7 +137,7 @@ sal_Int32 ParseMathMLAttributeLengthValue(const OUString &rStr, MathMLAttributeL pV->eUnit = MathMLLengthUnit::Pc; return nIdx + 2; } - if (sRest[0] == sal_Unicode('%')) + if (sRest[0] == u'%') { pV->eUnit = MathMLLengthUnit::Percent; return nIdx + 2; diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx index 69546741e792..596ad9824129 100644 --- a/starmath/source/mathmlexport.cxx +++ b/starmath/source/mathmlexport.cxx @@ -90,7 +90,7 @@ sal_Unicode ConvertMathToMathML( sal_Unicode cChar ) if (IsInPrivateUseArea( cChar )) { SAL_WARN("starmath", "Error: private use area characters should no longer be in use!" ); - cRes = sal_Unicode('@'); // just some character that should easily be notice as odd in the context + cRes = u'@'; // just some character that should easily be notice as odd in the context } return cRes; } diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index 2907ca4bd5b1..3327d8c57b80 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -2348,7 +2348,7 @@ SmMathSymbolNode::SmMathSymbolNode(const SmToken &rNodeToken) : SmSpecialNode(SmNodeType::Math, rNodeToken, FNT_MATH) { sal_Unicode cChar = GetToken().cMathChar; - if (sal_Unicode('\0') != cChar) + if (u'\0' != cChar) SetText(OUString(cChar)); } @@ -2570,7 +2570,7 @@ static bool lcl_IsFromGreekSymbolSet( const OUString &rTokenText ) bool bRes = false; // valid symbol name needs to have a '%' at pos 0 and at least an additional char - if (rTokenText.getLength() > 2 && rTokenText[0] == sal_Unicode('%')) + if (rTokenText.getLength() > 2 && rTokenText[0] == u'%') { OUString aName( rTokenText.copy(1) ); SmSym *pSymbol = SM_MOD()->GetSymbolManager().GetSymbolByName( aName ); diff --git a/starmath/source/ooxmlimport.cxx b/starmath/source/ooxmlimport.cxx index 8d5c3ed5385a..1b80468320b2 100644 --- a/starmath/source/ooxmlimport.cxx +++ b/starmath/source/ooxmlimport.cxx @@ -457,9 +457,9 @@ OUString SmOoxmlImport::handleGroupChr() } OUString e = readOMathArgInElement( M_TOKEN( e )); m_rStream.ensureClosingTag( M_TOKEN( groupChr )); - if( pos == top && chr == sal_Unicode( 0x23de )) + if( pos == top && chr == u'\x23de') return "{" + e + "} overbrace { }"; - if( pos == bot && chr == sal_Unicode( 0x23df )) + if( pos == bot && chr == u'\x23df') return "{" + e + "} underbrace { }"; if( pos == top ) return "{" + e + "} csup {" + OUStringLiteral1( chr ) + "}"; diff --git a/starmath/source/rect.cxx b/starmath/source/rect.cxx index a693d932d07a..0199290ee215 100644 --- a/starmath/source/rect.cxx +++ b/starmath/source/rect.cxx @@ -119,13 +119,13 @@ bool SmIsMathAlpha(const OUString &rText) // and symbols). static std::unordered_set<sal_Unicode> const aMathAlpha({ MS_ALEPH, MS_IM, MS_RE, - MS_WP, sal_Unicode(0xE070), MS_EMPTYSET, - sal_Unicode(0x2113), sal_Unicode(0xE0D6), sal_Unicode(0x2107), - sal_Unicode(0x2127), sal_Unicode(0x210A), MS_HBAR, + MS_WP, u'\xE070', MS_EMPTYSET, + u'\x2113', u'\xE0D6', u'\x2107', + u'\x2127', u'\x210A', MS_HBAR, MS_LAMBDABAR, MS_SETN, MS_SETZ, MS_SETQ, MS_SETR, MS_SETC, - sal_Unicode(0x2373), sal_Unicode(0xE0A5), sal_Unicode(0x2112), - sal_Unicode(0x2130), sal_Unicode(0x2131) + u'\x2373', u'\xE0A5', u'\x2112', + u'\x2130', u'\x2131' }); if (rText.isEmpty()) @@ -135,7 +135,7 @@ bool SmIsMathAlpha(const OUString &rText) sal_Unicode cChar = rText[0]; // is it a greek symbol? - if (sal_Unicode(0xE0AC) <= cChar && cChar <= sal_Unicode(0xE0D4)) + if (u'\xE0AC' <= cChar && cChar <= u'\xE0D4') return true; // or, does it appear in 'aMathAlpha'? return aMathAlpha.find(cChar) != aMathAlpha.end(); |