[Libreoffice-commits] core.git: 43 commits - basegfx/source basic/source chart2/source compilerplugins/clang configmgr/source cppu/qa cui/source dbaccess/source desktop/source editeng/source filter/source forms/source framework/source i18npool/qa i18npool/source i18nutil/source include/basic include/comphelper include/editeng include/svl include/svx include/vcl include/xmloff l10ntools/source lingucomponent/source linguistic/source lotuswordpro/source oox/source package/source sal/qa sax/source sc/source sdext/source sd/qa sd/source sfx2/source solenv/CompilerTest_compilerplugins_clang.mk starmath/inc starmath/qa starmath/source svgio/source svl/qa svl/source svtools/source svx/source sw/inc sw/qa sw/source testtools/source tools/source ucb/source unotools/source vcl/osx vcl/source vcl/unx writerfilter/source writerperfect/source xmlhelp/source xmloff/source
Stephan Bergmann
sbergman at redhat.com
Fri Apr 28 16:27:33 UTC 2017
basegfx/source/inc/stringconversiontools.hxx | 8
basic/source/classes/image.cxx | 2
basic/source/comp/parser.cxx | 2
basic/source/sbx/sbxscan.cxx | 4
chart2/source/tools/PolynomialRegressionCurveCalculator.cxx | 2
chart2/source/tools/XMLRangeHelper.cxx | 2
compilerplugins/clang/salunicodeliteral.cxx | 86 ++++++++++
compilerplugins/clang/test/salunicodeliteral.cxx | 39 ++++
compilerplugins/clang/test/salunicodeliteral.hxx | 17 +
configmgr/source/dconf.cxx | 2
cppu/qa/cppumaker/test_cppumaker.cxx | 2
cui/source/options/optaboutconfig.cxx | 2
cui/source/options/optgenrl.cxx | 2
cui/source/tabpages/numpages.cxx | 4
dbaccess/source/core/misc/dsntypes.cxx | 4
dbaccess/source/sdbtools/connection/objectnames.cxx | 12 -
desktop/source/deployment/misc/dp_misc.cxx | 2
editeng/source/accessibility/AccessibleEditableTextPara.cxx | 2
editeng/source/editeng/editattr.hxx | 2
editeng/source/lookuptree/Trie.cxx | 4
editeng/source/uno/unotext.cxx | 4
filter/source/msfilter/svdfppt.cxx | 4
filter/source/msfilter/util.cxx | 2
filter/source/xsltdialog/xmlfiltertabpagebasic.cxx | 6
forms/source/xforms/convert.cxx | 12 -
forms/source/xforms/datatypes.cxx | 2
forms/source/xforms/model_ui.cxx | 8
framework/source/accelerators/storageholder.cxx | 2
i18npool/qa/cppunit/test_breakiterator.cxx | 2
i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx | 10 -
i18npool/source/indexentry/indexentrysupplier_default.cxx | 8
i18npool/source/transliteration/ignoreIandEfollowedByYa_ja_JP.cxx | 2
i18npool/source/transliteration/ignoreIterationMark_ja_JP.cxx | 2
i18npool/source/transliteration/ignoreKiKuFollowedBySa_ja_JP.cxx | 2
i18npool/source/transliteration/ignoreProlongedSoundMark_ja_JP.cxx | 2
i18npool/source/transliteration/transliteration_Ignore.cxx | 2
i18npool/source/transliteration/transliteration_OneToOne.cxx | 2
i18nutil/source/utility/widthfolding.cxx | 4
include/basic/sbxdef.hxx | 2
include/comphelper/unwrapargs.hxx | 2
include/editeng/tstpitem.hxx | 4
include/svl/lngmisc.hxx | 8
include/svl/zforlist.hxx | 2
include/svx/svdmodel.hxx | 2
include/vcl/mnemonic.hxx | 2
include/vcl/strhelper.hxx | 2
include/xmloff/xmluconv.hxx | 2
l10ntools/source/merge.cxx | 2
lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx | 8
lingucomponent/source/spellcheck/macosxspell/macspellimp.mm | 8
lingucomponent/source/spellcheck/spell/sspellimp.cxx | 8
linguistic/source/dlistimp.cxx | 2
lotuswordpro/source/filter/lwpfribmark.cxx | 18 +-
lotuswordpro/source/filter/lwpfribptr.cxx | 4
oox/source/ppt/timenodelistcontext.cxx | 2
package/source/zippackage/ZipPackage.cxx | 4
sal/qa/rtl/oustring/rtl_OUString2.cxx | 14 -
sal/qa/rtl/oustringbuffer/test_oustringbuffer_appendchar.cxx | 2
sal/qa/rtl/strings/test_oustring_stringliterals.cxx | 16 -
sal/qa/rtl/textenc/rtl_textcvt.cxx | 4
sal/qa/rtl/uri/rtl_testuri.cxx | 14 -
sax/source/tools/converter.cxx | 68 +++----
sc/source/core/data/dociter.cxx | 2
sc/source/core/data/funcdesc.cxx | 2
sc/source/core/data/table3.cxx | 2
sc/source/core/tool/compiler.cxx | 6
sc/source/filter/excel/xecontent.cxx | 2
sc/source/filter/ftools/ftools.cxx | 4
sc/source/filter/oox/stylesbuffer.cxx | 42 ++--
sc/source/ui/app/inputhdl.cxx | 2
sc/source/ui/optdlg/tpformula.cxx | 2
sc/source/ui/optdlg/tpusrlst.cxx | 4
sc/source/ui/unoobj/filtuno.cxx | 2
sc/source/ui/view/cellsh2.cxx | 2
sd/qa/unit/export-tests-ooxml1.cxx | 2
sd/qa/unit/tiledrendering/tiledrendering.cxx | 2
sd/source/filter/ppt/pptinanimations.cxx | 2
sd/source/ui/animations/CustomAnimationDialog.cxx | 2
sd/source/ui/func/fubullet.cxx | 14 -
sdext/source/pdfimport/tree/drawtreevisiting.cxx | 6
sfx2/source/control/unoctitm.cxx | 2
sfx2/source/doc/DocumentMetadataAccess.cxx | 6
sfx2/source/doc/SfxDocumentMetaData.cxx | 2
solenv/CompilerTest_compilerplugins_clang.mk | 1
starmath/inc/node.hxx | 2
starmath/qa/cppunit/test_node.cxx | 26 +--
starmath/qa/extras/mmlexport-test.cxx | 2
starmath/source/mathmlattr.cxx | 8
starmath/source/mathmlexport.cxx | 2
starmath/source/node.cxx | 4
starmath/source/ooxmlimport.cxx | 4
starmath/source/rect.cxx | 12 -
svgio/source/svgreader/svgnode.cxx | 4
svgio/source/svgreader/svgstyleattributes.cxx | 8
svgio/source/svgreader/svgstylenode.cxx | 18 +-
svgio/source/svgreader/svgtools.cxx | 32 +--
svl/qa/unit/test_lngmisc.cxx | 2
svl/source/misc/gridprinter.cxx | 4
svl/source/numbers/zforfind.cxx | 2
svl/source/numbers/zformat.cxx | 4
svtools/source/svrtf/parrtf.cxx | 6
svx/source/fmcomp/dbaexchange.cxx | 6
svx/source/fmcomp/gridctrl.cxx | 2
svx/source/form/fmview.cxx | 8
svx/source/svdraw/svdotext.cxx | 4
sw/inc/hintids.hxx | 18 +-
sw/inc/swtypes.hxx | 16 -
sw/inc/tox.hxx | 2
sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 8
sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 2
sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 8
sw/qa/extras/rtfimport/rtfimport.cxx | 6
sw/source/core/access/accpara.cxx | 2
sw/source/core/access/accportions.cxx | 4
sw/source/core/doc/DocumentStylePoolManager.cxx | 2
sw/source/core/edit/autofmt.cxx | 12 -
sw/source/core/text/EnhancedPDFExportHelper.cxx | 2
sw/source/core/text/inftxt.cxx | 14 -
sw/source/core/txtnode/fntcache.cxx | 6
sw/source/core/unocore/unoobj.cxx | 2
sw/source/core/unocore/unosett.cxx | 2
sw/source/filter/html/swhtml.cxx | 2
sw/source/filter/ww8/docxattributeoutput.cxx | 4
sw/source/filter/ww8/wrtw8num.cxx | 2
sw/source/filter/ww8/ww8par.cxx | 6
sw/source/ui/index/cnttab.cxx | 6
sw/source/ui/misc/glosbib.cxx | 2
sw/source/uibase/app/docstyle.cxx | 14 -
sw/source/uibase/docvw/edtwin.cxx | 2
sw/source/uibase/inc/glosdoc.hxx | 2
sw/source/uibase/utlui/content.cxx | 2
testtools/source/bridgetest/cppobj.cxx | 2
tools/source/fsys/urlobj.cxx | 10 -
ucb/source/ucp/hierarchy/hierarchyuri.hxx | 2
ucb/source/ucp/inc/urihelper.hxx | 12 -
ucb/source/ucp/package/pkguri.hxx | 2
unotools/source/config/configpaths.cxx | 6
unotools/source/misc/datetime.cxx | 2
vcl/osx/salframe.cxx | 34 +--
vcl/osx/salmenu.cxx | 12 -
vcl/source/control/combobox.cxx | 2
vcl/source/control/edit.cxx | 2
vcl/source/filter/sgvtext.cxx | 2
vcl/source/font/fontmetric.cxx | 4
vcl/source/gdi/pdfwriter_impl.cxx | 12 -
vcl/source/window/printdlg.cxx | 4
vcl/unx/generic/app/i18n_cb.cxx | 4
vcl/unx/generic/window/salframe.cxx | 4
writerfilter/source/dmapper/DomainMapper.cxx | 10 -
writerfilter/source/dmapper/NumberingManager.cxx | 2
writerperfect/source/common/WPXSvInputStream.cxx | 2
xmlhelp/source/cxxhelp/provider/urlparameter.hxx | 4
xmloff/source/chart/SchXMLParagraphContext.cxx | 4
xmloff/source/draw/animationexport.cxx | 2
xmloff/source/text/XMLStringBufferImportContext.cxx | 2
xmloff/source/text/txtimp.cxx | 2
xmloff/source/text/txtparae.cxx | 2
xmloff/source/xforms/TokenContext.cxx | 6
158 files changed, 595 insertions(+), 452 deletions(-)
New commits:
commit 5a4d03131ffe557fed9ab3c8e31a005188c7ea5c
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:59:50 2017 +0200
loplugin:salunicodeliteral
For the c-char in the u'...' literal, the preceding commits consistently use:
* a simple-escape-sequence if the original code already used one
* \0 for U+0000
* the (\ escaped, for ' and \) source character matching U+0020..7E (even if it
is not a basic source character)
* a consistently four-digit hexadecimal-escape-sequence otherwise, \xNNNN
For non-surrogate code points, the last case could probably also use \uNNNN
universal-character-names. However, for one, it isn't quite clear to me whether
conversion of such to members of the execution chacacter set in character
literals (in translation phase 5) is implementation-specific. And for another,
the current C++ standard references the dated (no pun intended) ISO/IEC
10646-1:1993 specification, rather than the current ISO/IEC 10646:2014, and
requires that a universal-characrer-name designate a character with a specific
"character short name in ISO/IEC 10646", but I do not find a specification of a
"short name" in ISO/IEC 10646:2014 and don't have access to ISO/IEC
10646-1:1993, so am not sure whether that would e.g. cover noncharacters like
U+FFFF.
(The only exception is one occurrence of u'\x6C' in bestFitOpenSymbolToMSFont,
filter/source/msfilter/util.cxx, where it is clear from the context that the
value denotes neither a Unicode code point nor a UTF-16 code unit, but rather an
index into the Wingdings font glyph table.)
Change-Id: If36b94168428ba1e05977c370aceaa7e90131e90
diff --git a/compilerplugins/clang/salunicodeliteral.cxx b/compilerplugins/clang/salunicodeliteral.cxx
new file mode 100644
index 000000000000..6b03156b55e7
--- /dev/null
+++ b/compilerplugins/clang/salunicodeliteral.cxx
@@ -0,0 +1,86 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "check.hxx"
+#include "plugin.hxx"
+
+namespace {
+
+bool isAsciiCharacterLiteral(Expr const * expr) {
+ if (auto const e = dyn_cast<CharacterLiteral>(expr)) {
+ return e->getKind() == CharacterLiteral::Ascii;
+ }
+ return false;
+}
+
+class Visitor final:
+ public RecursiveASTVisitor<Visitor>, public loplugin::Plugin
+{
+public:
+ explicit Visitor(InstantiationData const & data): Plugin(data) {}
+
+ bool VisitCXXStaticCastExpr(CXXStaticCastExpr const * expr) {
+ check(expr);
+ return true;
+ }
+
+ bool VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr const * expr) {
+ check(expr);
+ return true;
+ }
+
+ bool VisitCStyleCastExpr(CStyleCastExpr const * expr) {
+ check(expr);
+ return true;
+ }
+
+private:
+ void run() override {
+ if (compiler.getLangOpts().CPlusPlus
+ && compiler.getPreprocessor().getIdentifierInfo(
+ "LIBO_INTERNAL_ONLY")->hasMacroDefinition())
+ {
+ TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
+ }
+ }
+
+ void check(ExplicitCastExpr const * expr) {
+ if (ignoreLocation(expr)
+ || isInUnoIncludeFile(expr->getExprLoc())
+ //TODO: '#ifdef LIBO_INTERNAL_ONLY' within UNO include files
+ || !(loplugin::TypeCheck(expr->getTypeAsWritten())
+ .Typedef("sal_Unicode").GlobalNamespace()))
+ {
+ return;
+ }
+ auto const e1 = expr->getSubExprAsWritten();
+ auto const loc = e1->getLocStart();
+ if (loc.isMacroID()
+ && compiler.getSourceManager().isAtStartOfImmediateMacroExpansion(
+ loc))
+ {
+ return;
+ }
+ auto const e2 = e1->IgnoreParenImpCasts();
+ if (isAsciiCharacterLiteral(e2) || isa<IntegerLiteral>(e2)) {
+ report(
+ DiagnosticsEngine::Warning,
+ ("in LIBO_INTERNAL_ONLY code, replace literal cast to %0 with a"
+ " u'...' char16_t character literal"),
+ e2->getExprLoc())
+ << expr->getTypeAsWritten() << expr->getSourceRange();
+ }
+ }
+};
+
+static loplugin::Plugin::Registration<Visitor> reg("salunicodeliteral");
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/compilerplugins/clang/test/salunicodeliteral.cxx b/compilerplugins/clang/test/salunicodeliteral.cxx
new file mode 100644
index 000000000000..1daf9df0acb9
--- /dev/null
+++ b/compilerplugins/clang/test/salunicodeliteral.cxx
@@ -0,0 +1,39 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "sal/config.h"
+
+#include "sal/types.h"
+
+#include "salunicodeliteral.hxx"
+
+#define TEST1 'x'
+#define TEST2 sal_Unicode('x')
+
+namespace {
+
+void f(sal_Unicode) {}
+
+}
+
+void test() {
+ f(sal_Unicode('x')); // expected-error {{in LIBO_INTERNAL_ONLY code, replace literal cast to 'sal_Unicode' (aka 'char16_t') with a u'...' char16_t character literal [loplugin:salunicodeliteral]}}
+ f(static_cast<sal_Unicode>('x')); // expected-error {{in LIBO_INTERNAL_ONLY code, replace literal cast to 'sal_Unicode' (aka 'char16_t') with a u'...' char16_t character literal [loplugin:salunicodeliteral]}}
+ f(static_cast<sal_Unicode const>('x')); // expected-error {{in LIBO_INTERNAL_ONLY code, replace literal cast to 'const sal_Unicode' (aka 'const char16_t') with a u'...' char16_t character literal [loplugin:salunicodeliteral]}}
+ f((sal_Unicode) 'x'); // expected-error {{in LIBO_INTERNAL_ONLY code, replace literal cast to 'sal_Unicode' (aka 'char16_t') with a u'...' char16_t character literal [loplugin:salunicodeliteral]}}
+ f(sal_Unicode(('x'))); // expected-error {{in LIBO_INTERNAL_ONLY code, replace literal cast to 'sal_Unicode' (aka 'char16_t') with a u'...' char16_t character literal [loplugin:salunicodeliteral]}}
+ f(sal_Unicode(120)); // expected-error {{in LIBO_INTERNAL_ONLY code, replace literal cast to 'sal_Unicode' (aka 'char16_t') with a u'...' char16_t character literal [loplugin:salunicodeliteral]}}
+ f(sal_Unicode(TEST1));
+ f(TEST2); // expected-error {{in LIBO_INTERNAL_ONLY code, replace literal cast to 'sal_Unicode' (aka 'char16_t') with a u'...' char16_t character literal [loplugin:salunicodeliteral]}}
+ char c = 'x';
+ f(sal_Unicode(c));
+ f(char16_t('x'));
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/compilerplugins/clang/test/salunicodeliteral.hxx b/compilerplugins/clang/test/salunicodeliteral.hxx
new file mode 100644
index 000000000000..f4491c72397f
--- /dev/null
+++ b/compilerplugins/clang/test/salunicodeliteral.hxx
@@ -0,0 +1,17 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_COMPILERPLUGINS_CLANG_TEST_SALUNICODELITERAL_HXX
+#define INCLUDED_COMPILERPLUGINS_CLANG_TEST_SALUNICODELITERAL_HXX
+
+void test();
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/solenv/CompilerTest_compilerplugins_clang.mk b/solenv/CompilerTest_compilerplugins_clang.mk
index 9f8810eb4057..a4de36ee090a 100644
--- a/solenv/CompilerTest_compilerplugins_clang.mk
+++ b/solenv/CompilerTest_compilerplugins_clang.mk
@@ -22,6 +22,7 @@ $(eval $(call gb_CompilerTest_add_exception_objects,compilerplugins_clang, \
compilerplugins/clang/test/redundantcast \
compilerplugins/clang/test/redundantinline \
compilerplugins/clang/test/salbool \
+ compilerplugins/clang/test/salunicodeliteral \
compilerplugins/clang/test/stringconstant \
compilerplugins/clang/test/unnecessaryoverride-dtor \
compilerplugins/clang/test/unoany \
commit e3f8ef0a8eb153e276cba172bdbadd3cdb8e9cdf
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:58:56 2017 +0200
loplugin:salunicodeliteral: basegfx
Change-Id: Ice43bae52ac244815ee62ee843108fd36b9918d7
diff --git a/basegfx/source/inc/stringconversiontools.hxx b/basegfx/source/inc/stringconversiontools.hxx
index 519bc2ce83e7..b49804849855 100644
--- a/basegfx/source/inc/stringconversiontools.hxx
+++ b/basegfx/source/inc/stringconversiontools.hxx
@@ -39,10 +39,10 @@ namespace basegfx
bool bSignAllowed,
bool bDotAllowed)
{
- const bool bPredicate( (sal_Unicode('0') <= aChar && sal_Unicode('9') >= aChar)
- || (bSignAllowed && sal_Unicode('+') == aChar)
- || (bSignAllowed && sal_Unicode('-') == aChar)
- || (bDotAllowed && sal_Unicode('.') == aChar));
+ const bool bPredicate( (u'0' <= aChar && u'9' >= aChar)
+ || (bSignAllowed && u'+' == aChar)
+ || (bSignAllowed && u'-' == aChar)
+ || (bDotAllowed && u'.' == aChar));
return bPredicate;
}
commit f06e69672302db866f269fbe9cb5f34e91f8bfbb
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:58:50 2017 +0200
loplugin:salunicodeliteral: basic
Change-Id: I479666b439f1d6324f07253d65181983b7c2c3ea
diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx
index 9e9e4c6d6602..e240c17d7854 100644
--- a/basic/source/classes/image.cxx
+++ b/basic/source/classes/image.cxx
@@ -660,7 +660,7 @@ OUString SbiImage::GetString( short nId ) const
if( nLen == 1 )
{
// Force length 1 and make char 0 afterwards
- OUString aNullCharStr( (sal_Unicode)0);
+ OUString aNullCharStr( u'\0');
return aNullCharStr;
}
}
diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx
index f930a6c3dc71..3eef2a4e2e73 100644
--- a/basic/source/comp/parser.cxx
+++ b/basic/source/comp/parser.cxx
@@ -860,7 +860,7 @@ void SbiParser::AddConstants()
addStringConst( aPublics, "vbVerticalTab", "\x0B" );
// Force length 1 and make char 0 afterwards
- OUString aNullCharStr((sal_Unicode)0);
+ OUString aNullCharStr(u'\0');
addStringConst( aPublics, "vbNullChar", aNullCharStr );
}
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index 1b46030fd0a7..a6800506faf2 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -530,11 +530,11 @@ static sal_uInt16 printfmtstr( const OUString& rStr, OUString& rRes, const OUStr
case '\\':
do
{
- aTemp.append( *pStr ? *pStr++ : static_cast< sal_Unicode >(' '));
+ aTemp.append( *pStr ? *pStr++ : u' ');
pFmt++;
}
while( *pFmt && *pFmt != '\\' );
- aTemp.append(*pStr ? *pStr++ : static_cast< sal_Unicode >(' '));
+ aTemp.append(*pStr ? *pStr++ : u' ');
pFmt++; break;
case '&':
aTemp = rStr;
diff --git a/include/basic/sbxdef.hxx b/include/basic/sbxdef.hxx
index cfdd3f883b46..9008702ac5a2 100644
--- a/include/basic/sbxdef.hxx
+++ b/include/basic/sbxdef.hxx
@@ -220,7 +220,7 @@ namespace o3tl
// of the implementation. Only type double is greedy and takes
// what it gets.
-#define SbxMAXCHAR ((sal_Unicode)65535)
+#define SbxMAXCHAR u'\xFFFF'
#define SbxMINCHAR (0)
#define SbxMAXBYTE ( 255)
#define SbxMAXINT ( 32767)
commit c9a36f5cb5da15c4441be67913f99c467e734d43
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:58:39 2017 +0200
loplugin:salunicodeliteral: chart2
Change-Id: I8531b2466298a18c06a4c2a690af6bc998cc802f
diff --git a/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx b/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx
index b122cd514001..fbafd9f9def0 100644
--- a/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx
+++ b/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx
@@ -307,7 +307,7 @@ OUString PolynomialRegressionCurveCalculator::ImplGetRepresentation(
OUString aValueOfi = OUString::number( i );
for ( sal_Int32 n = 0; n < aValueOfi.getLength() ; n++ )
{
- sal_Int32 nIndex = aValueOfi[n] - sal_Unicode ( '0' );
+ sal_Int32 nIndex = aValueOfi[n] - u'0';
aTmpBuf.append( aSuperscriptFigures[ nIndex ] );
}
}
diff --git a/chart2/source/tools/XMLRangeHelper.cxx b/chart2/source/tools/XMLRangeHelper.cxx
index e537054abd64..1a484dbb6db5 100644
--- a/chart2/source/tools/XMLRangeHelper.cxx
+++ b/chart2/source/tools/XMLRangeHelper.cxx
@@ -385,7 +385,7 @@ OUString getXMLStringFromCellRange( const CellRange & rRange )
if( ! rRange.aLowerRight.empty())
{
// we have a range (not a single cell)
- aBuffer.append( sal_Unicode( ':' ));
+ aBuffer.append( u':');
lcl_getXMLStringForCell( rRange.aLowerRight, &aBuffer );
}
commit 681ae20dea7edbc054adad647aa66e4b1e8ce5dc
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:58:33 2017 +0200
loplugin:salunicodeliteral: comphelper
Change-Id: I0642d85d92152414d1d110b88a8194363ff4d618
diff --git a/include/comphelper/unwrapargs.hxx b/include/comphelper/unwrapargs.hxx
index 8a2e9aed7d32..afea437bcf7e 100644
--- a/include/comphelper/unwrapargs.hxx
+++ b/include/comphelper/unwrapargs.hxx
@@ -83,7 +83,7 @@ namespace detail {
buf.append( seq[nArg].getValueType().getTypeName() );
buf.append( " } to " );
buf.append( ::cppu::UnoType<T>::get().getTypeName() );
- buf.append( static_cast<sal_Unicode>('!') );
+ buf.append( u'!' );
return unwrapArgsError( buf.makeStringAndClear(), nArg, args... );
}
return unwrapArgs( seq, ++nArg, args... );
commit 74cf1240f0ce18807b46a8fa702665ca7705ffd9
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:58:21 2017 +0200
loplugin:salunicodeliteral: configmgr
Change-Id: I3c37025be286f9fd1892c259e2ac1e2fce7123a1
diff --git a/configmgr/source/dconf.cxx b/configmgr/source/dconf.cxx
index 3ae2716d4348..2ba4d0c9b43c 100644
--- a/configmgr/source/dconf.cxx
+++ b/configmgr/source/dconf.cxx
@@ -227,7 +227,7 @@ bool decode(OUString * string, bool slash) {
return true;
}
if (string->match("00", i + 1)) {
- *string = string->replaceAt(i, 3, OUString(sal_Unicode(0)));
+ *string = string->replaceAt(i, 3, OUString(u'\0'));
} else if (slash && string->match("2F", i + 1)) {
*string = string->replaceAt(i, 3, "/");
} else if (string->match("5C", i + 1)) {
commit fbc2652716aebd95dae9ee8d7d333eb68a4658bf
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:58:13 2017 +0200
loplugin:salunicodeliteral: cppu
Change-Id: I0bb182f258439e6ce7bc7c54d68da4db1581ff19
diff --git a/cppu/qa/cppumaker/test_cppumaker.cxx b/cppu/qa/cppumaker/test_cppumaker.cxx
index 65db58e4b1e8..d0fde124bf13 100644
--- a/cppu/qa/cppumaker/test_cppumaker.cxx
+++ b/cppu/qa/cppumaker/test_cppumaker.cxx
@@ -439,7 +439,7 @@ void Test::testBigStruct() {
CPPUNIT_ASSERT_EQUAL(guard.p->m8, static_cast< sal_uInt64 >(0));
CPPUNIT_ASSERT_EQUAL(guard.p->m9, 0.0f);
CPPUNIT_ASSERT_EQUAL(guard.p->m10, 0.0);
- CPPUNIT_ASSERT_EQUAL(guard.p->m11, static_cast< sal_Unicode >(0));
+ CPPUNIT_ASSERT_EQUAL(guard.p->m11, u'\0');
CPPUNIT_ASSERT_EQUAL(guard.p->m12.getLength(), static_cast< sal_Int32 >(0));
CPPUNIT_ASSERT_EQUAL((sal_Int32)guard.p->m13.getTypeClass(), (sal_Int32)css::uno::TypeClass_VOID);
CPPUNIT_ASSERT_EQUAL(guard.p->m14.hasValue(), false);
commit 20f9bf58ef0326236a699cdd45da20d1e997359b
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:57:55 2017 +0200
loplugin:salunicodeliteral: cui
Change-Id: I06e94b663402b65b7487b314cc71217e43f2de4e
diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index 3eee7ba6cf89..7e8c850ff732 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -531,7 +531,7 @@ std::vector< OUString > CuiAboutConfigTabPage::commaStringToSequence( const OUSt
sal_Int32 index = 0;
do
{
- OUString word = rCommaSepString.getToken(0, static_cast<sal_Unicode> (','), index);
+ OUString word = rCommaSepString.getToken(0, u',', index);
word = word.trim();
if( !word.isEmpty())
tempVector.push_back(word);
diff --git a/cui/source/options/optgenrl.cxx b/cui/source/options/optgenrl.cxx
index 8ea85be28857..991041917020 100644
--- a/cui/source/options/optgenrl.cxx
+++ b/cui/source/options/optgenrl.cxx
@@ -360,7 +360,7 @@ IMPL_LINK( SvxGeneralTabPage, ModifyHdl_Impl, Edit&, rEdit, void )
sShortName += " ";
OUString sName = rEdit.GetText();
OUString sLetter = sName.isEmpty()
- ? OUString(sal_Unicode(' ')) : sName.copy(0, 1);
+ ? OUString(u' ') : sName.copy(0, 1);
rShortName.pEdit->SetText(sShortName.replaceAt(nField, 1, sLetter).trim());
}
}
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 6dc34355bcf6..441b143c69c9 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -100,8 +100,8 @@ using namespace css::style;
#define MAX_BMP_WIDTH 16
#define MAX_BMP_HEIGHT 16
-#define SEARCHPATH_DELIMITER ((sal_Unicode)';')
-#define SEARCHFILENAME_DELIMITER ((sal_Unicode)'/')
+#define SEARCHPATH_DELIMITER u';'
+#define SEARCHFILENAME_DELIMITER u'/'
static bool bLastRelative = false;
commit 49300975187df0d72bbd5cbf454ece56bfe5b0e6
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:57:51 2017 +0200
loplugin:salunicodeliteral: dbaccess
Change-Id: I294909d2596283a3249cd77c03c8e5518fdf32fb
diff --git a/dbaccess/source/core/misc/dsntypes.cxx b/dbaccess/source/core/misc/dsntypes.cxx
index 57a8ee775501..daa0bc8f3487 100644
--- a/dbaccess/source/core/misc/dsntypes.cxx
+++ b/dbaccess/source/core/misc/dsntypes.cxx
@@ -314,7 +314,7 @@ OUString ODsnTypeCollection::getEmbeddedDatabase() const
DATASOURCE_TYPE ODsnTypeCollection::determineType(const OUString& _rDsn) const
{
OUString sDsn(comphelper::string::stripEnd(_rDsn, '*'));
- sal_Int32 nSeparator = sDsn.indexOf(static_cast<sal_Unicode>(':'));
+ sal_Int32 nSeparator = sDsn.indexOf(u':');
if (-1 == nSeparator)
{
if (!sDsn.isEmpty())
@@ -340,7 +340,7 @@ DATASOURCE_TYPE ODsnTypeCollection::determineType(const OUString& _rDsn) const
return DST_EMBEDDED_FIREBIRD;
// find second :
- nSeparator = sDsn.indexOf(static_cast<sal_Unicode>(':'), nSeparator + 1);
+ nSeparator = sDsn.indexOf(u':', nSeparator + 1);
if (-1 == nSeparator)
{
// at the moment only jdbc is allowed to have just one separator
diff --git a/dbaccess/source/sdbtools/connection/objectnames.cxx b/dbaccess/source/sdbtools/connection/objectnames.cxx
index 25452bd5a44c..d2026b579fff 100644
--- a/dbaccess/source/sdbtools/connection/objectnames.cxx
+++ b/dbaccess/source/sdbtools/connection/objectnames.cxx
@@ -161,12 +161,12 @@ namespace sdbtools
static ::connectivity::ErrorCondition validateName_getErrorCondition( const OUString& _rName )
{
- if ( ( _rName.indexOf( (sal_Unicode)34 ) >= 0 ) // "
- || ( _rName.indexOf( (sal_Unicode)39 ) >= 0 ) // '
- || ( _rName.indexOf( (sal_Unicode)96 ) >= 0 )
- || ( _rName.indexOf( (sal_Unicode)145 ) >= 0 )
- || ( _rName.indexOf( (sal_Unicode)146 ) >= 0 )
- || ( _rName.indexOf( (sal_Unicode)180 ) >= 0 ) // removed unparsable chars
+ if ( ( _rName.indexOf( u'"' ) >= 0 )
+ || ( _rName.indexOf( u'\'' ) >= 0 )
+ || ( _rName.indexOf( u'`' ) >= 0 )
+ || ( _rName.indexOf( u'\x0091' ) >= 0 )
+ || ( _rName.indexOf( u'\x0092' ) >= 0 )
+ || ( _rName.indexOf( u'\x00B4' ) >= 0 ) // removed unparsable chars
)
return ErrorCondition::DB_QUERY_NAME_WITH_QUOTES;
commit effd780dde65d4d51b5aeefc82b71a6306a09cc2
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:57:44 2017 +0200
loplugin:salunicodeliteral: desktop
Change-Id: Id4594d5e0ff79dbe75c5545c22e5b95745d64061
diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx
index a17a214978f2..2083075a608e 100644
--- a/desktop/source/deployment/misc/dp_misc.cxx
+++ b/desktop/source/deployment/misc/dp_misc.cxx
@@ -296,7 +296,7 @@ OUString makeURL( OUString const & baseURL, OUString const & relPath_ )
OUString makeURLAppendSysPathSegment( OUString const & baseURL, OUString const & segment )
{
- OSL_ASSERT(segment.indexOf(static_cast<sal_Unicode>('/')) == -1);
+ OSL_ASSERT(segment.indexOf(u'/') == -1);
::rtl::Uri::encode(
segment, rtl_UriCharClassPchar, rtl_UriEncodeIgnoreEscapes,
commit 40045b5c119776621897f2a51e00373eba5b33f6
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:57:33 2017 +0200
loplugin:salunicodeliteral: editeng
Change-Id: I5db29ba3505d914ec05826128713d7e25091ed11
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index 993f906d5b05..670253270f11 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -2070,7 +2070,7 @@ namespace accessibility
if( nIndex <= aBoundary.endPos )
{
nextWord = aBoundary.endPos;
- if( sText.getStr()[nextWord] == sal_Unicode(' ') ) nextWord++;
+ if( sText.getStr()[nextWord] == u' ' ) nextWord++;
bWord = implGetWordBoundary( aBoundary, nextWord );
}
diff --git a/editeng/source/editeng/editattr.hxx b/editeng/source/editeng/editattr.hxx
index 8bec824a75f8..4307f4618538 100644
--- a/editeng/source/editeng/editattr.hxx
+++ b/editeng/source/editeng/editattr.hxx
@@ -51,7 +51,7 @@ class SvxCaseMapItem;
class SfxGrabBagItem;
#define CH_FEATURE_OLD (sal_uInt8) 0xFF
-#define CH_FEATURE (sal_Unicode) 0x01
+#define CH_FEATURE u'\x0001'
// DEF_METRIC: For my pool, the DefMetric should always appear when
// GetMetric (nWhich)!
diff --git a/editeng/source/lookuptree/Trie.cxx b/editeng/source/lookuptree/Trie.cxx
index 57b0167e97bf..b661d6d81010 100644
--- a/editeng/source/lookuptree/Trie.cxx
+++ b/editeng/source/lookuptree/Trie.cxx
@@ -71,7 +71,7 @@ void TrieNode::addNewChild(TrieNode* pChild)
if (pChild->mCharacter >= 'a' &&
pChild->mCharacter <= 'z')
{
- mLatinArray[pChild->mCharacter - sal_Unicode('a')] = pChild;
+ mLatinArray[pChild->mCharacter - u'a'] = pChild;
}
else
{
@@ -84,7 +84,7 @@ TrieNode* TrieNode::findChild(sal_Unicode aInputCharacter)
if (aInputCharacter >= 'a' &&
aInputCharacter <= 'z')
{
- return mLatinArray[aInputCharacter - sal_Unicode('a')];
+ return mLatinArray[aInputCharacter - u'a'];
}
vector<TrieNode*>::iterator iNode;
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index bd55ed046413..f2e5cbac548f 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -1806,7 +1806,7 @@ void SAL_CALL SvxUnoTextBase::insertControlCharacter( const uno::Reference< text
{
case text::ControlCharacter::PARAGRAPH_BREAK:
{
- const OUString aText( (sal_Unicode)13 ); // '\r' does not work on Mac
+ const OUString aText( u'\x000D' ); // '\r' does not work on Mac
insertString( xRange, aText, bAbsorb );
return;
@@ -1856,7 +1856,7 @@ void SAL_CALL SvxUnoTextBase::insertControlCharacter( const uno::Reference< text
aRange.nEndPos = aRange.nStartPos;
pRange->SetSelection( aRange );
- const OUString aText( (sal_Unicode)13 ); // '\r' does not work on Mac
+ const OUString aText( u'\x000D' ); // '\r' does not work on Mac
pRange->setString( aText );
aRange.nStartPos = 0;
diff --git a/include/editeng/tstpitem.hxx b/include/editeng/tstpitem.hxx
index 1c89a0a8b744..880b46e10c22 100644
--- a/include/editeng/tstpitem.hxx
+++ b/include/editeng/tstpitem.hxx
@@ -29,8 +29,8 @@
#define SVX_TAB_DEFCOUNT 10
#define SVX_TAB_DEFDIST 1134 // 2cm in twips
#define SVX_TAB_NOTFOUND USHRT_MAX
-#define cDfltDecimalChar (sal_Unicode(0x00)) // Get from IntlWrapper
-#define cDfltFillChar (sal_Unicode(' '))
+#define cDfltDecimalChar u'\0' // Get from IntlWrapper
+#define cDfltFillChar u' '
class EDITENG_DLLPUBLIC SvxTabStop
{
commit c049946e16f7fc01a0537911e6d46796528358bb
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:57:25 2017 +0200
loplugin:salunicodeliteral: filter
Change-Id: I0f398e2ebd22368f0b8698a759967b5da2ca36d8
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 6b50a7bda803..5143f1a403f6 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -3612,13 +3612,13 @@ bool PPTNumberFormatCreator::ImplGetExtNumberFormat( SdrPowerPointImport& rManag
case 29: // Double-byte Arabic numbers with double-byte period.
{
rNumberFormat.SetNumberingType( SVX_NUM_FULL_WIDTH_ARABIC );
- rNumberFormat.SetSuffix( OUString( sal_Unicode(0xff0e) ) );
+ rNumberFormat.SetSuffix( OUString( u'\xff0e' ) );
}
break;
case 38: // Japanese with double-byte period.
{
rNumberFormat.SetNumberingType( SVX_NUM_NUMBER_LOWER_ZH ); // No such type. Instead with Lower Chinese Number
- rNumberFormat.SetSuffix( OUString( sal_Unicode(0xff0e) ) );
+ rNumberFormat.SetSuffix( OUString( u'\xff0e' ) );
}
break;
}
diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx
index 91b5f4dc6bbf..047d6e486368 100644
--- a/filter/source/msfilter/util.cxx
+++ b/filter/source/msfilter/util.cxx
@@ -120,7 +120,7 @@ sal_Unicode bestFitOpenSymbolToMSFont(sal_Unicode cChar,
bullet symbol
*/
rFontName = "Wingdings";
- cChar = static_cast< sal_Unicode >(0x6C);
+ cChar = u'\x6C';
}
return cChar;
}
diff --git a/filter/source/xsltdialog/xmlfiltertabpagebasic.cxx b/filter/source/xsltdialog/xmlfiltertabpagebasic.cxx
index e635798ecd2b..fe6a2b7f449c 100644
--- a/filter/source/xsltdialog/xmlfiltertabpagebasic.cxx
+++ b/filter/source/xsltdialog/xmlfiltertabpagebasic.cxx
@@ -67,11 +67,11 @@ static OUString checkExtensions( const OUString& rExtensions )
{
switch(*pSource)
{
- case sal_Unicode(','):
+ case u',':
aRet += ";";
break;
- case sal_Unicode('.'):
- case sal_Unicode('*'):
+ case u'.':
+ case u'*':
break;
default:
aRet += OUStringLiteral1( *pSource );
commit 71ccd61a06d3f744f261fe523d97c13fbf61df84
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:57:11 2017 +0200
loplugin:salunicodeliteral: forms
Change-Id: If5bc83be6bd633c84811160e3e504bbee31f4d9d
diff --git a/forms/source/xforms/convert.cxx b/forms/source/xforms/convert.cxx
index 7acec4786005..50a57ff53fce 100644
--- a/forms/source/xforms/convert.cxx
+++ b/forms/source/xforms/convert.cxx
@@ -328,14 +328,14 @@ OUString Convert::collapseWhitespace( const OUString& _rString )
for( sal_Int32 i = 0; i < nLength; i++ )
{
sal_Unicode c = pStr[i];
- if( c == sal_Unicode(0x08) ||
- c == sal_Unicode(0x0A) ||
- c == sal_Unicode(0x0D) ||
- c == sal_Unicode(0x20) )
+ if( c == u'\x0008' ||
+ c == u'\x000A' ||
+ c == u'\x000D' ||
+ c == u' ' )
{
if( ! bStrip )
{
- aBuffer.append( sal_Unicode(0x20) );
+ aBuffer.append( u' ' );
bStrip = true;
}
}
@@ -345,7 +345,7 @@ OUString Convert::collapseWhitespace( const OUString& _rString )
aBuffer.append( c );
}
}
- if( aBuffer[ aBuffer.getLength() - 1 ] == sal_Unicode( 0x20 ) )
+ if( aBuffer[ aBuffer.getLength() - 1 ] == u' ' )
aBuffer.setLength( aBuffer.getLength() - 1 );
return aBuffer.makeStringAndClear();
}
diff --git a/forms/source/xforms/datatypes.cxx b/forms/source/xforms/datatypes.cxx
index 6eb1478a552a..2c1c6d2029b4 100644
--- a/forms/source/xforms/datatypes.cxx
+++ b/forms/source/xforms/datatypes.cxx
@@ -409,7 +409,7 @@ namespace xforms
rtl_math_ConversionStatus eStatus;
sal_Int32 nEnd;
double f = ::rtl::math::stringToDouble(
- rValue, '.', sal_Unicode(0), &eStatus, &nEnd );
+ rValue, '.', u'\0', &eStatus, &nEnd );
// error checking...
bool bReturn = false;
diff --git a/forms/source/xforms/model_ui.cxx b/forms/source/xforms/model_ui.cxx
index e5a899340836..b487f8680667 100644
--- a/forms/source/xforms/model_ui.cxx
+++ b/forms/source/xforms/model_ui.cxx
@@ -262,10 +262,10 @@ static bool lcl_isWhitespace( const OUString& rString )
for( sal_Int32 i = 0; bWhitespace && ( i < nLength ); i++ )
{
sal_Unicode c = pStr[i];
- bWhitespace = ( c == sal_Unicode(0x09) ||
- c == sal_Unicode(0x0A) ||
- c == sal_Unicode(0x0D) ||
- c == sal_Unicode(0x20) );
+ bWhitespace = ( c == u'\x0009' ||
+ c == u'\x000A' ||
+ c == u'\x000D' ||
+ c == u' ' );
}
return bWhitespace;
}
commit c561a6a636374be151e54e227aba0f8e89748235
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:57:05 2017 +0200
loplugin:salunicodeliteral: framework
Change-Id: I80665b97a7fb278dd9a1e9cc0fc48174ce18b4a9
diff --git a/framework/source/accelerators/storageholder.cxx b/framework/source/accelerators/storageholder.cxx
index 977c700a7492..49e0ca821c87 100644
--- a/framework/source/accelerators/storageholder.cxx
+++ b/framework/source/accelerators/storageholder.cxx
@@ -41,7 +41,7 @@
#include <algorithm>
#define PATH_SEPARATOR "/"
-#define PATH_SEPARATOR_UNICODE ((sal_Unicode)'/')
+#define PATH_SEPARATOR_UNICODE u'/'
namespace framework
{
commit fb2013ccb1a13921eb398fb6e4f2b4d55f0761a2
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:56:59 2017 +0200
loplugin:salunicodeliteral: i18npool
Change-Id: I7307cc96eac5868ed26e8ace1fc3c1a93e1bfec4
diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx b/i18npool/qa/cppunit/test_breakiterator.cxx
index fb1a155ae9db..d3da7dda4d95 100644
--- a/i18npool/qa/cppunit/test_breakiterator.cxx
+++ b/i18npool/qa/cppunit/test_breakiterator.cxx
@@ -380,7 +380,7 @@ void TestBreakIterator::testWordBoundaries()
}
const sal_Int32 aSingleQuotePositions[] = {0, 1, 9, 10};
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Unicode>('\''), aTests[0]);
+ CPPUNIT_ASSERT_EQUAL(u'\'', aTests[0]);
{
OUString aTest = aBase.replaceAll("xx", OUStringLiteral1(aTests[0]));
sal_Int32 nPos = -1;
diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
index e9a3e299bccc..901dd3048dd7 100644
--- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
+++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
@@ -413,7 +413,7 @@ void lcl_formatPersianWord( sal_Int32 nNumber, OUString& rsResult )
if ((nDigit = nPart % 100) < 20)
{
if (!aTemp.isEmpty())
- aTemp.insert( 0, sal_Unicode(0x0020));
+ aTemp.insert( 0, u' ');
aTemp.insert( 0, table_PersianWord_decade1[nDigit]);
}
else
@@ -449,10 +449,10 @@ void lcl_formatPersianWord( sal_Int32 nNumber, OUString& rsResult )
// Greek Letter Numbering
// KERAIA separates numerals from other text
-#define STIGMA (sal_Unicode) 0x03DB
-#define LEFT_KERAIA (sal_Unicode) 0x0375
-#define MYRIAD_SYM (sal_Unicode) 0x039C
-#define DOT_SYM (sal_Unicode) 0x002E
+#define STIGMA u'\x03DB'
+#define LEFT_KERAIA u'\x0375'
+#define MYRIAD_SYM u'\x039C'
+#define DOT_SYM u'.'
#define SIGMA_OFFSET 19
#define TAU_OFFSET 20
#define MYRIAD 10000
diff --git a/i18npool/source/indexentry/indexentrysupplier_default.cxx b/i18npool/source/indexentry/indexentrysupplier_default.cxx
index e88cabf47465..419d84c80c5e 100644
--- a/i18npool/source/indexentry/indexentrysupplier_default.cxx
+++ b/i18npool/source/indexentry/indexentrysupplier_default.cxx
@@ -187,7 +187,7 @@ void Index::makeIndexKeys(const lang::Locale &rLocale, const OUString &algorithm
continue;
switch(curr) {
- case sal_Unicode('-'):
+ case u'-':
if (key_count > 0 && i + 1 < len ) {
for (curr = keyStr[++i]; key_count < MAX_KEYS && keys[key_count-1].key < curr; key_count++) {
keys[key_count].key = keys[key_count-1].key+1;
@@ -196,7 +196,7 @@ void Index::makeIndexKeys(const lang::Locale &rLocale, const OUString &algorithm
} else
throw RuntimeException();
break;
- case sal_Unicode('['):
+ case u'[':
for (i++; i < len && keyStr[i] != ']'; i++) {
if (unicode::isWhiteSpace(keyStr[i])) {
continue;
@@ -209,10 +209,10 @@ void Index::makeIndexKeys(const lang::Locale &rLocale, const OUString &algorithm
}
}
break;
- case sal_Unicode('{'):
+ case u'{':
close = '}';
SAL_FALLTHROUGH;
- case sal_Unicode('('):
+ case u'(':
if (key_count > 0) {
sal_Int16 end = i+1;
for (; end < len && keyStr[end] != close; end++) ;
diff --git a/i18npool/source/transliteration/ignoreIandEfollowedByYa_ja_JP.cxx b/i18npool/source/transliteration/ignoreIandEfollowedByYa_ja_JP.cxx
index 642466c66185..ac7630c3facf 100644
--- a/i18npool/source/transliteration/ignoreIandEfollowedByYa_ja_JP.cxx
+++ b/i18npool/source/transliteration/ignoreIandEfollowedByYa_ja_JP.cxx
@@ -120,7 +120,7 @@ ignoreIandEfollowedByYa_ja_JP::folding( const OUString& inStr, sal_Int32 startPo
*dst ++ = previousChar;
}
- *dst = (sal_Unicode) 0;
+ *dst = u'\0';
newStr->length = sal_Int32(dst - newStr->buffer);
if (useOffset)
diff --git a/i18npool/source/transliteration/ignoreIterationMark_ja_JP.cxx b/i18npool/source/transliteration/ignoreIterationMark_ja_JP.cxx
index 08cdc76f1811..9935d53590e4 100644
--- a/i18npool/source/transliteration/ignoreIterationMark_ja_JP.cxx
+++ b/i18npool/source/transliteration/ignoreIterationMark_ja_JP.cxx
@@ -130,7 +130,7 @@ ignoreIterationMark_ja_JP::folding( const OUString& inStr, sal_Int32 startPos, s
*dst ++ = previousChar;
}
- *dst = (sal_Unicode) 0;
+ *dst = u'\0';
newStr->length = sal_Int32(dst - newStr->buffer);
if (useOffset)
diff --git a/i18npool/source/transliteration/ignoreKiKuFollowedBySa_ja_JP.cxx b/i18npool/source/transliteration/ignoreKiKuFollowedBySa_ja_JP.cxx
index aae059ed95f9..f057876a7dd9 100644
--- a/i18npool/source/transliteration/ignoreKiKuFollowedBySa_ja_JP.cxx
+++ b/i18npool/source/transliteration/ignoreKiKuFollowedBySa_ja_JP.cxx
@@ -78,7 +78,7 @@ ignoreKiKuFollowedBySa_ja_JP::folding( const OUString& inStr, sal_Int32 startPos
*dst ++ = previousChar;
}
- *dst = (sal_Unicode) 0;
+ *dst = u'\0';
newStr->length = sal_Int32(dst - newStr->buffer);
if (useOffset)
diff --git a/i18npool/source/transliteration/ignoreProlongedSoundMark_ja_JP.cxx b/i18npool/source/transliteration/ignoreProlongedSoundMark_ja_JP.cxx
index 11809b98251d..7c37be6e36bc 100644
--- a/i18npool/source/transliteration/ignoreProlongedSoundMark_ja_JP.cxx
+++ b/i18npool/source/transliteration/ignoreProlongedSoundMark_ja_JP.cxx
@@ -336,7 +336,7 @@ ignoreProlongedSoundMark_ja_JP::folding( const OUString& inStr, sal_Int32 startP
*dst ++ = previousChar;
}
- *dst = (sal_Unicode) 0;
+ *dst = u'\0';
newStr->length = sal_Int32(dst - newStr->buffer);
if (useOffset)
diff --git a/i18npool/source/transliteration/transliteration_Ignore.cxx b/i18npool/source/transliteration/transliteration_Ignore.cxx
index 3d852afb8aea..355334ab28e0 100644
--- a/i18npool/source/transliteration/transliteration_Ignore.cxx
+++ b/i18npool/source/transliteration/transliteration_Ignore.cxx
@@ -190,7 +190,7 @@ transliteration_Ignore::folding( const OUString& inStr, sal_Int32 startPos,
newStr->length = sal_Int32(dst - newStr->buffer);
if (useOffset)
offset.realloc(newStr->length);
- *dst = (sal_Unicode) 0;
+ *dst = u'\0';
return OUString(newStr, SAL_NO_ACQUIRE); // take ownership
}
diff --git a/i18npool/source/transliteration/transliteration_OneToOne.cxx b/i18npool/source/transliteration/transliteration_OneToOne.cxx
index 978d7cf9cd7a..f820a35921e9 100644
--- a/i18npool/source/transliteration/transliteration_OneToOne.cxx
+++ b/i18npool/source/transliteration/transliteration_OneToOne.cxx
@@ -75,7 +75,7 @@ transliteration_OneToOne::transliterate( const OUString& inStr, sal_Int32 startP
if (useOffset)
*p ++ = position ++;
}
- *dst = (sal_Unicode) 0;
+ *dst = u'\0';
return OUString(newStr, SAL_NO_ACQUIRE); // take ownership
}
commit 01eeb20ffe7266ad630f89ff40720ac0c755d7fa
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:56:51 2017 +0200
loplugin:salunicodeliteral: i18nutil
Change-Id: Ie7dfc21fccbeed5005c2b881ff593853513b13e1
diff --git a/i18nutil/source/utility/widthfolding.cxx b/i18nutil/source/utility/widthfolding.cxx
index c98acb4a3e8a..acc413598613 100644
--- a/i18nutil/source/utility/widthfolding.cxx
+++ b/i18nutil/source/utility/widthfolding.cxx
@@ -83,7 +83,7 @@ OUString widthfolding::decompose_ja_voiced_sound_marks (const OUString& inStr, s
if (useOffset)
*p ++ = position ++;
}
- *dst = (sal_Unicode) 0;
+ *dst = u'\0';
newStr->length = sal_Int32(dst - newStr->buffer);
if (useOffset)
@@ -187,7 +187,7 @@ OUString widthfolding::compose_ja_voiced_sound_marks (const OUString& inStr, sal
*dst ++ = previousChar;
}
- *dst = (sal_Unicode) 0;
+ *dst = u'\0';
newStr->length = sal_Int32(dst - newStr->buffer);
}
commit b75968c8c31d2ce191a5cfa76cac86c9832d3f96
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:56:41 2017 +0200
loplugin:salunicodeliteral: l10ntools
Change-Id: Id291a2242a2ec0d19cf7a679825fb4a1ec468d07
diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx
index 5a928f7ca7ae..e08f35f4f87b 100644
--- a/l10ntools/source/merge.cxx
+++ b/l10ntools/source/merge.cxx
@@ -127,7 +127,7 @@ namespace
{
//DOUBLE VERTICAL LINE instead of || because the translations make their
//way into action_names under gtk3 where || is illegal
- return OUStringToOString(OUString(static_cast<sal_Unicode>(0x2016)), RTL_TEXTENCODING_UTF8);
+ return OUStringToOString(OUString(u'\x2016'), RTL_TEXTENCODING_UTF8);
}
}
commit 6d4a0474b398f754fd960045c050b4e065ac61a1
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:56:23 2017 +0200
loplugin:salunicodeliteral: lingucomponent
Change-Id: I130ca7e2d98626f0d187eb69e6ea4b0554f1bd00
diff --git a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
index e124a9c6e61d..5183bc39007d 100644
--- a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
+++ b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
@@ -327,9 +327,9 @@ Reference< XHyphenatedWord > SAL_CALL Hyphenator::hyphenate( const OUString& aWo
{
ch = rBuf[ix];
if ((ch == 0x201C) || (ch == 0x201D))
- rBuf[ix] = (sal_Unicode)0x0022;
+ rBuf[ix] = u'"';
if ((ch == 0x2018) || (ch == 0x2019))
- rBuf[ix] = (sal_Unicode)0x0027;
+ rBuf[ix] = u'\'';
}
OUString nWord(rBuf.makeStringAndClear());
@@ -606,9 +606,9 @@ Reference< XPossibleHyphens > SAL_CALL Hyphenator::createPossibleHyphens( const
{
ch = rBuf[ix];
if ((ch == 0x201C) || (ch == 0x201D))
- rBuf[ix] = (sal_Unicode)0x0022;
+ rBuf[ix] = u'"';
if ((ch == 0x2018) || (ch == 0x2019))
- rBuf[ix] = (sal_Unicode)0x0027;
+ rBuf[ix] = u'\'';
}
OUString nWord(rBuf.makeStringAndClear());
diff --git a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm
index 4c4c23fed3ff..a68fed705570 100644
--- a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm
+++ b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm
@@ -223,8 +223,8 @@ sal_Int16 MacSpellChecker::GetSpellFailure( const OUString &rWord, const Locale
sal_Unicode c;
for (sal_Int32 ix=0; ix < n; ix++) {
c = rBuf[ix];
- if ((c == 0x201C) || (c == 0x201D)) rBuf[ix] = (sal_Unicode)0x0022;
- if ((c == 0x2018) || (c == 0x2019)) rBuf[ix] = (sal_Unicode)0x0027;
+ if ((c == 0x201C) || (c == 0x201D)) rBuf[ix] = u'"';
+ if ((c == 0x2018) || (c == 0x2019)) rBuf[ix] = u'\'';
}
OUString nWord(rBuf.makeStringAndClear());
@@ -326,8 +326,8 @@ Reference< XSpellAlternatives >
sal_Unicode c;
for (sal_Int32 ix=0; ix < n; ix++) {
c = rBuf[ix];
- if ((c == 0x201C) || (c == 0x201D)) rBuf[ix] = (sal_Unicode)0x0022;
- if ((c == 0x2018) || (c == 0x2019)) rBuf[ix] = (sal_Unicode)0x0027;
+ if ((c == 0x201C) || (c == 0x201D)) rBuf[ix] = u'"';
+ if ((c == 0x2018) || (c == 0x2019)) rBuf[ix] = u'\'';
}
OUString nWord(rBuf.makeStringAndClear());
diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
index 29f94cf8babb..bbb1231a4c24 100644
--- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx
+++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
@@ -298,9 +298,9 @@ sal_Int16 SpellChecker::GetSpellFailure(const OUString &rWord, const Locale &rLo
{
c = rBuf[ix];
if ((c == 0x201C) || (c == 0x201D))
- rBuf[ix] = (sal_Unicode)0x0022;
+ rBuf[ix] = u'"';
else if ((c == 0x2018) || (c == 0x2019))
- rBuf[ix] = (sal_Unicode)0x0027;
+ rBuf[ix] = u'\'';
// recognize words with Unicode ligatures and ZWNJ/ZWJ characters (only
// with 8-bit encoded dictionaries. For UTF-8 encoded dictionaries
@@ -464,9 +464,9 @@ Reference< XSpellAlternatives >
{
c = rBuf[ix];
if ((c == 0x201C) || (c == 0x201D))
- rBuf[ix] = (sal_Unicode)0x0022;
+ rBuf[ix] = u'"';
if ((c == 0x2018) || (c == 0x2019))
- rBuf[ix] = (sal_Unicode)0x0027;
+ rBuf[ix] = u'\'';
}
OUString nWord(rBuf.makeStringAndClear());
commit 6194da0903528ecf07a4dcbea76ce5de6a5c2465
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:56:09 2017 +0200
loplugin:salunicodeliteral: linguistic
Change-Id: Idafaabdb44dbb8a608d5ca8f707ff144df3f3384
diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx
index 5ac22f539e54..e432114d75ab 100644
--- a/linguistic/source/dlistimp.cxx
+++ b/linguistic/source/dlistimp.cxx
@@ -771,7 +771,7 @@ static void AddInternal(
{
//! TL TODO: word iterator should be used to break up the text
OUString aDelim("!\"#$%&'()*+,-/:;<=>?[]\\_^`{|}~\t \n");
- OSL_ENSURE(aDelim.indexOf(static_cast<sal_Unicode>('.')) == -1,
+ OSL_ENSURE(aDelim.indexOf(u'.') == -1,
"ensure no '.'");
OUString aToken;
commit e66308b3d8ba6945c13467a2d7759e9637f40b23
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:56:00 2017 +0200
loplugin:salunicodeliteral: lotuswordpro
Change-Id: Ib59d33d2b09f979d938d88037d9327b9a927dcd5
diff --git a/lotuswordpro/source/filter/lwpfribmark.cxx b/lotuswordpro/source/filter/lwpfribmark.cxx
index abcf2989ef7b..f1578c128da1 100644
--- a/lotuswordpro/source/filter/lwpfribmark.cxx
+++ b/lotuswordpro/source/filter/lwpfribmark.cxx
@@ -645,13 +645,13 @@ void LwpFribField::RegisterDateTimeStyle(const OUString& sFormula)
pDateStyle = new XFDateStyle;
OUString sText;
pDateStyle->AddYear();
- sText = OUString(sal_Unicode(0x5e74));
+ sText = OUString(u'\x5e74');
pDateStyle->AddText(sText);
pDateStyle->AddMonth(false);
- sText = OUString(sal_Unicode(0x6708));
+ sText = OUString(u'\x6708');
pDateStyle->AddText(sText);
pDateStyle->AddMonthDay(false);
- sText = OUString(sal_Unicode(0x65e5));
+ sText = OUString(u'\x65e5');
pDateStyle->AddText(sText);
}
else if (sFormula == "%FLoa" || sFormula == "%FLooaa" || sFormula == "%FLOA" )
@@ -659,10 +659,10 @@ void LwpFribField::RegisterDateTimeStyle(const OUString& sFormula)
pDateStyle = new XFDateStyle;
OUString sText;
pDateStyle->AddMonth(false);
- sText = OUString(sal_Unicode(0x6708));
+ sText = OUString(u'\x6708');
pDateStyle->AddText(sText);
pDateStyle->AddMonthDay(false);
- sText = OUString(sal_Unicode(0x65e5));
+ sText = OUString(u'\x65e5');
pDateStyle->AddText(sText);
}
else if (sFormula == "%FLYYYY/M/D" || sFormula == "%FLGGGG/od/ad")
@@ -952,10 +952,10 @@ void LwpFribField::RegisterDateTimeStyle(const OUString& sFormula)
pTimeStyle = new XFTimeStyle;
pTimeStyle->AddHour(false);
OUString sText;
- sText = OUString(sal_Unicode(0x70b9));
+ sText = OUString(u'\x70b9');
pTimeStyle->AddText(sText);
pTimeStyle->AddMinute(false);
- sText = OUString(sal_Unicode(0x5206));
+ sText = OUString(u'\x5206');
pTimeStyle->AddText(sText);
}
else if (sFormula == "%FLjjjF" || sFormula == "%FLJJJFF" )
@@ -964,10 +964,10 @@ void LwpFribField::RegisterDateTimeStyle(const OUString& sFormula)
pTimeStyle->SetAmPm(true);
pTimeStyle->AddHour(false);
OUString sText;
- sText = OUString(sal_Unicode(0x70b9));
+ sText = OUString(u'\x70b9');
pTimeStyle->AddText(sText);
pTimeStyle->AddMinute(false);
- sText = OUString(sal_Unicode(0x5206));
+ sText = OUString(u'\x5206');
pTimeStyle->AddText(sText);
}
//chinese version end
diff --git a/lotuswordpro/source/filter/lwpfribptr.cxx b/lotuswordpro/source/filter/lwpfribptr.cxx
index c89425486933..304678ebfc2e 100644
--- a/lotuswordpro/source/filter/lwpfribptr.cxx
+++ b/lotuswordpro/source/filter/lwpfribptr.cxx
@@ -262,7 +262,7 @@ void LwpFribPtr::XFConvert()
break;
case FRIB_TAG_HARDSPACE:
{
- OUString sHardSpace(sal_Unicode(0x00a0));
+ OUString sHardSpace(u'\x00a0');
LwpStory *pStory = m_pPara->GetStory();
LwpHyperlinkMgr* pHyperlink = pStory ? pStory->GetHyperlinkMgr() : nullptr;
if (pHyperlink && pHyperlink->GetHyperlinkFlag())
@@ -273,7 +273,7 @@ void LwpFribPtr::XFConvert()
break;
case FRIB_TAG_SOFTHYPHEN:
{
- OUString sSoftHyphen(sal_Unicode(0x00ad));
+ OUString sSoftHyphen(u'\x00ad');
pFrib->ConvertChars(m_pXFPara,sSoftHyphen);
}
break;
commit 2ee486814b8a3cac035a2538646b6a9988bd6bb0
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:55:50 2017 +0200
loplugin:salunicodeliteral: oox
Change-Id: I392f52f0371befc92cb5ddd51ec68bce07b689cf
diff --git a/oox/source/ppt/timenodelistcontext.cxx b/oox/source/ppt/timenodelistcontext.cxx
index e97a8f148b84..6cb0d96bcbda 100644
--- a/oox/source/ppt/timenodelistcontext.cxx
+++ b/oox/source/ppt/timenodelistcontext.cxx
@@ -273,7 +273,7 @@ namespace oox { namespace ppt {
{
const OUString aMediaTime( msCommand.copy( 9, msCommand.getLength() - 10 ) );
rtl_math_ConversionStatus eStatus;
- double fMediaTime = ::rtl::math::stringToDouble( aMediaTime, (sal_Unicode)('.'), (sal_Unicode)(','), &eStatus );
+ double fMediaTime = ::rtl::math::stringToDouble( aMediaTime, u'.', u',', &eStatus );
if( eStatus == rtl_math_ConversionStatus_Ok )
{
aParamValue.Name = "MediaTime";
commit 7e6aa4e2f8aef4c62b22d45f9447796f540b603a
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:55:44 2017 +0200
loplugin:salunicodeliteral: package
Change-Id: I5910fdc2ee54fab9105a8e5ffeb3a7575227c13f
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index 891d252c6591..cb87074658be 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -1492,7 +1492,7 @@ void SAL_CALL ZipPackage::commitChanges()
{
uno::Reference < XPropertySet > xPropSet ( xTempInStream, UNO_QUERY_THROW );
- OUString sTargetFolder = m_aURL.copy ( 0, m_aURL.lastIndexOf ( static_cast < sal_Unicode > ( '/' ) ) );
+ OUString sTargetFolder = m_aURL.copy ( 0, m_aURL.lastIndexOf ( u'/' ) );
Content aContent(
sTargetFolder, uno::Reference< XCommandEnvironment >(),
m_xContext );
@@ -1505,7 +1505,7 @@ void SAL_CALL ZipPackage::commitChanges()
aInfo.NameClash = NameClash::OVERWRITE;
aInfo.MoveData = false;
aInfo.SourceURL = sTempURL;
- aInfo.NewTitle = rtl::Uri::decode ( m_aURL.copy ( 1 + m_aURL.lastIndexOf ( static_cast < sal_Unicode > ( '/' ) ) ),
+ aInfo.NewTitle = rtl::Uri::decode ( m_aURL.copy ( 1 + m_aURL.lastIndexOf ( u'/' ) ),
rtl_UriDecodeWithCharset,
RTL_TEXTENCODING_UTF8 );
// if the file is still not corrupted, it can become after the next step
commit c741633310db3e32e9e07c8e045d11b29f2db606
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:55:37 2017 +0200
loplugin:salunicodeliteral: sal
Change-Id: I1b7c3f8de5b09c96e27aa9124096b00638afb3f3
diff --git a/sal/qa/rtl/oustring/rtl_OUString2.cxx b/sal/qa/rtl/oustring/rtl_OUString2.cxx
index 6c71751d3992..15748fcf8d2f 100644
--- a/sal/qa/rtl/oustring/rtl_OUString2.cxx
+++ b/sal/qa/rtl/oustring/rtl_OUString2.cxx
@@ -989,13 +989,13 @@ void createFromCodePoints::test() {
static sal_uInt32 const cp[] = { 0, 0xD800, 0xFFFF, 0x10000, 0x10FFFF };
rtl::OUString s(cp, sizeof cp / sizeof (sal_uInt32));
CPPUNIT_ASSERT_EQUAL(sal_Int32(7), s.getLength());
- CPPUNIT_ASSERT_EQUAL(sal_Unicode(0), s[0]);
- CPPUNIT_ASSERT_EQUAL(sal_Unicode(0xD800), s[1]);
- CPPUNIT_ASSERT_EQUAL(sal_Unicode(0xFFFF), s[2]);
- CPPUNIT_ASSERT_EQUAL(sal_Unicode(0xD800), s[3]);
- CPPUNIT_ASSERT_EQUAL(sal_Unicode(0xDC00), s[4]);
- CPPUNIT_ASSERT_EQUAL(sal_Unicode(0xDBFF), s[5]);
- CPPUNIT_ASSERT_EQUAL(sal_Unicode(0xDFFF), s[6]);
+ CPPUNIT_ASSERT_EQUAL(u'\0', s[0]);
+ CPPUNIT_ASSERT_EQUAL(u'\xD800', s[1]);
+ CPPUNIT_ASSERT_EQUAL(u'\xFFFF', s[2]);
+ CPPUNIT_ASSERT_EQUAL(u'\xD800', s[3]);
+ CPPUNIT_ASSERT_EQUAL(u'\xDC00', s[4]);
+ CPPUNIT_ASSERT_EQUAL(u'\xDBFF', s[5]);
+ CPPUNIT_ASSERT_EQUAL(u'\xDFFF', s[6]);
}
class iterateCodePoints: public CppUnit::TestFixture {
diff --git a/sal/qa/rtl/oustringbuffer/test_oustringbuffer_appendchar.cxx b/sal/qa/rtl/oustringbuffer/test_oustringbuffer_appendchar.cxx
index 707034b3affa..6fca739125b0 100644
--- a/sal/qa/rtl/oustringbuffer/test_oustringbuffer_appendchar.cxx
+++ b/sal/qa/rtl/oustringbuffer/test_oustringbuffer_appendchar.cxx
@@ -30,7 +30,7 @@ void AppendChar::testAppendChar() {
rtl::OUStringBuffer s;
s.append('a');
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), s.getLength());
- CPPUNIT_ASSERT_EQUAL(sal_Unicode('a'), s[0]);
+ CPPUNIT_ASSERT_EQUAL(u'a', s[0]);
}
} }
diff --git a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
index 5b1b8ea83e04..37bc50ecc619 100644
--- a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
+++ b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
@@ -317,17 +317,17 @@ void test::oustring::StringLiterals::checkOUStringLiteral()
void test::oustring::StringLiterals::checkOUStringLiteral1()
{
auto l1 = rtlunittest::OUStringLiteral1('A');
- CPPUNIT_ASSERT_EQUAL(sal_Unicode('A'), l1.c);
+ CPPUNIT_ASSERT_EQUAL(u'A', l1.c);
char const c2 = 'A';
auto l2 = rtlunittest::OUStringLiteral1(c2);
- CPPUNIT_ASSERT_EQUAL(sal_Unicode('A'), l2.c);
+ CPPUNIT_ASSERT_EQUAL(u'A', l2.c);
char c3 = 'A'; auto l3 = rtlunittest::OUStringLiteral1(c3);
- CPPUNIT_ASSERT_EQUAL(sal_Unicode('A'), l3.c);
+ CPPUNIT_ASSERT_EQUAL(u'A', l3.c);
- auto l4 = rtlunittest::OUStringLiteral1(sal_Unicode('A'));
- CPPUNIT_ASSERT_EQUAL(sal_Unicode('A'), l4.c);
+ auto l4 = rtlunittest::OUStringLiteral1(u'A');
+ CPPUNIT_ASSERT_EQUAL(u'A', l4.c);
sal_Unicode const c5 = 0x100;
auto l5 = rtlunittest::OUStringLiteral1(c5);
@@ -335,7 +335,7 @@ void test::oustring::StringLiterals::checkOUStringLiteral1()
rtl::OUString s1{rtlunittest::OUStringLiteral1('A')};
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), s1.getLength());
- CPPUNIT_ASSERT_EQUAL(sal_Unicode('A'), s1[0]);
+ CPPUNIT_ASSERT_EQUAL(u'A', s1[0]);
CPPUNIT_ASSERT_EQUAL(
true, rtl::OUString("A") == rtlunittest::OUStringLiteral1('A'));
@@ -348,8 +348,8 @@ void test::oustring::StringLiterals::checkOUStringLiteral1()
rtl::OUString s2("A" + rtlunittest::OUStringLiteral1('b'));
CPPUNIT_ASSERT_EQUAL(sal_Int32(2), s2.getLength());
- CPPUNIT_ASSERT_EQUAL(sal_Unicode('A'), s2[0]);
- CPPUNIT_ASSERT_EQUAL(sal_Unicode('b'), s2[1]);
+ CPPUNIT_ASSERT_EQUAL(u'A', s2[0]);
+ CPPUNIT_ASSERT_EQUAL(u'b', s2[1]);
}
void test::oustring::StringLiterals::checkUtf16() {
diff --git a/sal/qa/rtl/textenc/rtl_textcvt.cxx b/sal/qa/rtl/textenc/rtl_textcvt.cxx
index bb85141b8052..c9d7e5f08117 100644
--- a/sal/qa/rtl/textenc/rtl_textcvt.cxx
+++ b/sal/qa/rtl/textenc/rtl_textcvt.cxx
@@ -83,7 +83,7 @@ void testSingleByteCharSet(SingleByteCharSet const & rSet) {
CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(OUString("rSet.m_aMap[" + OUString::number(i) + "] == " +
OUString::number(rSet.m_aMap[i], 16)),
RTL_TEXTENCODING_UTF8).getStr(),
- static_cast<sal_Unicode>(0xFFFF), rSet.m_aMap[i]);
+ u'\xFFFF', rSet.m_aMap[i]);
CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(OUString("aUnicode[" + OUString::number(j) + "] == " +
OUString::number(aUnicode[j], 16) +
", rSet.m_aMap[" + OUString::number(i) + "] == " +
@@ -130,7 +130,7 @@ void testSingleByteCharSet(SingleByteCharSet const & rSet) {
CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(OUString("rSet.m_aMap[" + OUString::number(i) + "] == " +
OUString::number(rSet.m_aMap[i], 16)),
RTL_TEXTENCODING_UTF8).getStr(),
- static_cast<sal_Unicode>(0xFFFF), rSet.m_aMap[i]);
+ u'\xFFFF', rSet.m_aMap[i]);
CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(OUString("aText[" + OUString::number(j) + "] == " +
OUString::number(i, 16)),
RTL_TEXTENCODING_UTF8).getStr(),
diff --git a/sal/qa/rtl/uri/rtl_testuri.cxx b/sal/qa/rtl/uri/rtl_testuri.cxx
index 05c3349d5bb8..e60797731d2f 100644
--- a/sal/qa/rtl/uri/rtl_testuri.cxx
+++ b/sal/qa/rtl/uri/rtl_testuri.cxx
@@ -182,10 +182,10 @@ void Test::test_Uri() {
// Check surrogate handling:
- aBuffer.append(static_cast< sal_Unicode >(0xD800)); // %ED%A0%80
- aBuffer.append(static_cast< sal_Unicode >(0xD800)); // %F0%90%8F%BF
- aBuffer.append(static_cast< sal_Unicode >(0xDFFF));
- aBuffer.append(static_cast< sal_Unicode >(0xDFFF)); // %ED%BF%BF
+ aBuffer.append(u'\xD800'); // %ED%A0%80
+ aBuffer.append(u'\xD800'); // %F0%90%8F%BF
+ aBuffer.append(u'\xDFFF');
+ aBuffer.append(u'\xDFFF'); // %ED%BF%BF
aBuffer.append('A'); // A
aText1 = aBuffer.makeStringAndClear();
aText2 = "%ED%A0%80" "%F0%90%8F%BF" "%ED%BF%BF" "A";
@@ -210,8 +210,8 @@ void Test::test_Uri() {
aText1 = "%ed%a0%80" "%f0%90%8f%bf" "%ed%bf%bf" "A";
aBuffer.append("%ED%A0%80");
- aBuffer.append(static_cast< sal_Unicode >(0xD800));
- aBuffer.append(static_cast< sal_Unicode >(0xDFFF));
+ aBuffer.append(u'\xD800');
+ aBuffer.append(u'\xDFFF');
aBuffer.append("%ED%BF%BF");
aBuffer.append('A');
aText2 = aBuffer.makeStringAndClear();
@@ -251,7 +251,7 @@ void Test::test_Uri() {
aText1 = "%30%C3%BF";
aBuffer.append("%30");
- aBuffer.append(static_cast< sal_Unicode >(0x00FF));
+ aBuffer.append(u'\x00FF');
aText2 = aBuffer.makeStringAndClear();
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"failure 18",
commit 40b9caf882554804d83c2423971ad8293d4cef62
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:55:32 2017 +0200
loplugin:salunicodeliteral: sax
Change-Id: I4e571ac28a63a8856a79af44ec0683eca91aee0b
diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx
index 9377e14411b7..6144fac70dee 100644
--- a/sax/source/tools/converter.cxx
+++ b/sax/source/tools/converter.cxx
@@ -135,26 +135,26 @@ bool Converter::convertMeasure( sal_Int32& rValue,
{
switch( rString[nPos] )
{
- case sal_Unicode('c'):
- case sal_Unicode('C'):
+ case u'c':
+ case u'C':
aCmpsL[0] = "cm";
aCmpsU[0] = "CM";
aScales[0] = (72.*20.)/2.54; // twip
break;
- case sal_Unicode('i'):
- case sal_Unicode('I'):
+ case u'i':
+ case u'I':
aCmpsL[0] = "in";
aCmpsU[0] = "IN";
aScales[0] = 72.*20.; // twip
break;
- case sal_Unicode('m'):
- case sal_Unicode('M'):
+ case u'm':
+ case u'M':
aCmpsL[0] = "mm";
aCmpsU[0] = "MM";
aScales[0] = (72.*20.)/25.4; // twip
break;
- case sal_Unicode('p'):
- case sal_Unicode('P'):
+ case u'p':
+ case u'P':
aCmpsL[0] = "pt";
aCmpsU[0] = "PT";
aScales[0] = 20.; // twip
@@ -170,26 +170,26 @@ bool Converter::convertMeasure( sal_Int32& rValue,
double nScaleFactor = (MeasureUnit::MM_100TH == nTargetUnit) ? 100.0 : 10.0;
switch( rString[nPos] )
{
- case sal_Unicode('c'):
- case sal_Unicode('C'):
+ case u'c':
+ case u'C':
aCmpsL[0] = "cm";
aCmpsU[0] = "CM";
aScales[0] = 10.0 * nScaleFactor; // mm/100
break;
- case sal_Unicode('i'):
- case sal_Unicode('I'):
+ case u'i':
+ case u'I':
aCmpsL[0] = "in";
aCmpsU[0] = "IN";
aScales[0] = 1000.*2.54; // mm/100
break;
- case sal_Unicode('m'):
- case sal_Unicode('M'):
+ case u'm':
+ case u'M':
aCmpsL[0] = "mm";
aCmpsU[0] = "MM";
aScales[0] = 1.0 * nScaleFactor; // mm/100
break;
- case sal_Unicode('p'):
- case sal_Unicode('P'):
+ case u'p':
+ case u'P':
aCmpsL[0] = "pt";
aCmpsU[0] = "PT";
aScales[0] = (10.0 * nScaleFactor*2.54)/72.; // mm/100
@@ -565,7 +565,7 @@ bool Converter::convertNumber64( sal_Int64& rValue,
{
// TODO: check overflow!
rValue *= 10;
- rValue += (rString[nPos] - sal_Unicode('0'));
+ rValue += (rString[nPos] - u'0');
nPos++;
}
@@ -810,7 +810,7 @@ bool Converter::convertDuration(double& rfTime,
if ( !bIsFraction )
{
nTemp *= 10;
- nTemp += (c - sal_Unicode('0'));
+ nTemp += (c - u'0');
}
else
{
@@ -978,7 +978,7 @@ readUnsignedNumber(const OUString & rString,
if (('0' <= c) && (c <= '9'))
{
nTemp *= 10;
- nTemp += (c - sal_Unicode('0'));
+ nTemp += (c - u'0');
if (nTemp >= SAL_MAX_INT32)
{
bOverflow = true;
@@ -1020,7 +1020,7 @@ readUnsignedNumberMaxDigits(int maxDigits,
if (maxDigits > 0)
{
nTemp *= 10;
- nTemp += (c - sal_Unicode('0'));
+ nTemp += (c - u'0');
if (nTemp >= SAL_MAX_INT32)
{
bOverflow = true;
@@ -1891,21 +1891,21 @@ sal_Int32 Converter::indexOfComma( const OUString& rStr,
sal_Unicode c = rStr[nPos];
switch( c )
{
- case sal_Unicode('\''):
+ case u'\'':
if( 0 == cQuote )
cQuote = c;
else if( '\'' == cQuote )
cQuote = 0;
break;
- case sal_Unicode('"'):
+ case u'"':
if( 0 == cQuote )
cQuote = c;
else if( '\"' == cQuote )
cQuote = 0;
break;
- case sal_Unicode(','):
+ case u',':
if( 0 == cQuote )
return nPos;
break;
@@ -2474,43 +2474,43 @@ sal_Int16 Converter::GetUnitFromString(const OUString& rString, sal_Int16 nDefau
{
switch(rString[nPos])
{
- case sal_Unicode('%') :
+ case u'%' :
{
nRetUnit = MeasureUnit::PERCENT;
break;
}
- case sal_Unicode('c'):
- case sal_Unicode('C'):
+ case u'c':
+ case u'C':
{
if(nPos+1 < nLen && (rString[nPos+1] == 'm'
|| rString[nPos+1] == 'M'))
nRetUnit = MeasureUnit::CM;
break;
}
- case sal_Unicode('e'):
- case sal_Unicode('E'):
+ case u'e':
+ case u'E':
{
// CSS1_EMS or CSS1_EMX later
break;
}
- case sal_Unicode('i'):
- case sal_Unicode('I'):
+ case u'i':
+ case u'I':
{
if(nPos+1 < nLen && (rString[nPos+1] == 'n'
|| rString[nPos+1] == 'N'))
nRetUnit = MeasureUnit::INCH;
break;
}
- case sal_Unicode('m'):
- case sal_Unicode('M'):
+ case u'm':
+ case u'M':
{
if(nPos+1 < nLen && (rString[nPos+1] == 'm'
|| rString[nPos+1] == 'M'))
nRetUnit = MeasureUnit::MM;
break;
}
- case sal_Unicode('p'):
- case sal_Unicode('P'):
+ case u'p':
+ case u'P':
{
if(nPos+1 < nLen && (rString[nPos+1] == 't'
|| rString[nPos+1] == 'T'))
commit a5993e41410d278233298dcccd34ece04872ee7d
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:55:27 2017 +0200
loplugin:salunicodeliteral: sc
Change-Id: I7f63388d3c0214be8f69095fe5ec0030df59a416
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index 098220582e92..901496de75d6 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -1710,7 +1710,7 @@ bool ScQueryCellIterator::BinarySearch()
::std::numeric_limits<double>::max();
OUString aLastInRangeString;
if (!bLessEqual)
- aLastInRangeString = OUString(sal_Unicode(0xFFFF));
+ aLastInRangeString = OUString(u'\xFFFF');
aCellData = aIndexer.getCell(nLastInRange);
aCell = aCellData.first;
diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx
index 6db1bb73bf26..a5c825a462dc 100644
--- a/sc/source/core/data/funcdesc.cxx
+++ b/sc/source/core/data/funcdesc.cxx
@@ -228,7 +228,7 @@ OUString ScFuncDesc::getSignature() const
aSig.append( "( " );
aSig.append(aParamList);
// U+00A0 (NBSP) prevents automatic line break
- aSig.append( static_cast< sal_Unicode >(0xA0) );
+ aSig.append( u'\x00A0' );
aSig.append( ")" );
}
else
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index cc6477b6dff7..2044a33b7708 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -3013,7 +3013,7 @@ SCSIZE ScTable::Query(ScQueryParam& rParamOrg, bool bKeepSub)
GetString(k, j, aCellStr);
OUStringBuffer aBuf(aStr);
aBuf.append(aCellStr);
- aBuf.append(static_cast<sal_Unicode>(1));
+ aBuf.append(u'\x0001');
aStr = aBuf.makeStringAndClear();
}
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 42317b1a3a5c..9131f6ee3bbc 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -881,7 +881,7 @@ struct ConventionOOO_A1 : public Convention_A1
return '.';
}
- return sal_Unicode(0);
+ return u'\0';
}
virtual bool parseExternalName( const OUString& rSymbol, OUString& rFile, OUString& rName,
@@ -1114,11 +1114,11 @@ struct ConventionXL
switch (eSymType)
{
case ScCompiler::Convention::ABS_SHEET_PREFIX:
- return sal_Unicode(0);
+ return u'\0';
case ScCompiler::Convention::SHEET_SEPARATOR:
return '!';
}
- return sal_Unicode(0);
+ return u'\0';
}
static bool parseExternalName( const OUString& rSymbol, OUString& rFile, OUString& rName,
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index 427a8b3108fe..81fe1e9a922b 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -1663,7 +1663,7 @@ XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) :
OUString aToken( aString.getToken( 0, '\n', nStringIx ) );
if( nToken > 0 )
{
- mxString1->Append(OUString(static_cast<sal_Unicode>('\0')));
+ mxString1->Append(OUString(u'\0'));
sFormulaBuf.append( ',' );
}
mxString1->Append( aToken );
diff --git a/sc/source/filter/ftools/ftools.cxx b/sc/source/filter/ftools/ftools.cxx
index 0bd43ae9778e..e3ebc5597730 100644
--- a/sc/source/filter/ftools/ftools.cxx
+++ b/sc/source/filter/ftools/ftools.cxx
@@ -149,8 +149,8 @@ Color ScfTools::GetMixedColor( const Color& rFore, const Color& rBack, sal_uInt8
OUString ScfTools::ConvertToScDefinedName(const OUString& rName )
{
//fdo#37872: we don't allow points in range names any more
- OUString sName = rName.replace(static_cast<sal_Unicode>('.'),
- static_cast<sal_Unicode>('_'));
+ OUString sName = rName.replace(u'.',
+ u'_');
sal_Int32 nLen = sName.getLength();
if( nLen && !ScCompiler::IsCharFlagAllConventions( sName, 0, ScCharFlags::CharName ) )
sName = sName.replaceAt( 0, 1, "_" );
diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx
index c2a9cb82ca25..25fca16c643e 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -784,29 +784,29 @@ void Font::finalizeImport()
{
// #91658# CJK fonts
bool bHasAsian =
- xFont->hasGlyphs( OUString( sal_Unicode( 0x3041 ) ) ) || // 3040-309F: Hiragana
- xFont->hasGlyphs( OUString( sal_Unicode( 0x30A1 ) ) ) || // 30A0-30FF: Katakana
- xFont->hasGlyphs( OUString( sal_Unicode( 0x3111 ) ) ) || // 3100-312F: Bopomofo
- xFont->hasGlyphs( OUString( sal_Unicode( 0x3131 ) ) ) || // 3130-318F: Hangul Compatibility Jamo
- xFont->hasGlyphs( OUString( sal_Unicode( 0x3301 ) ) ) || // 3300-33FF: CJK Compatibility
- xFont->hasGlyphs( OUString( sal_Unicode( 0x3401 ) ) ) || // 3400-4DBF: CJK Unified Ideographs Extension A
- xFont->hasGlyphs( OUString( sal_Unicode( 0x4E01 ) ) ) || // 4E00-9FAF: CJK Unified Ideographs
- xFont->hasGlyphs( OUString( sal_Unicode( 0x7E01 ) ) ) || // 4E00-9FAF: CJK unified ideographs
- xFont->hasGlyphs( OUString( sal_Unicode( 0xA001 ) ) ) || // A001-A48F: Yi Syllables
- xFont->hasGlyphs( OUString( sal_Unicode( 0xAC01 ) ) ) || // AC00-D7AF: Hangul Syllables
- xFont->hasGlyphs( OUString( sal_Unicode( 0xCC01 ) ) ) || // AC00-D7AF: Hangul Syllables
- xFont->hasGlyphs( OUString( sal_Unicode( 0xF901 ) ) ) || // F900-FAFF: CJK Compatibility Ideographs
- xFont->hasGlyphs( OUString( sal_Unicode( 0xFF71 ) ) ); // FF00-FFEF: Halfwidth/Fullwidth Forms
+ xFont->hasGlyphs( OUString( u'\x3041' ) ) || // 3040-309F: Hiragana
+ xFont->hasGlyphs( OUString( u'\x30A1' ) ) || // 30A0-30FF: Katakana
+ xFont->hasGlyphs( OUString( u'\x3111' ) ) || // 3100-312F: Bopomofo
+ xFont->hasGlyphs( OUString( u'\x3131' ) ) || // 3130-318F: Hangul Compatibility Jamo
+ xFont->hasGlyphs( OUString( u'\x3301' ) ) || // 3300-33FF: CJK Compatibility
+ xFont->hasGlyphs( OUString( u'\x3401' ) ) || // 3400-4DBF: CJK Unified Ideographs Extension A
+ xFont->hasGlyphs( OUString( u'\x4E01' ) ) || // 4E00-9FAF: CJK Unified Ideographs
+ xFont->hasGlyphs( OUString( u'\x7E01' ) ) || // 4E00-9FAF: CJK unified ideographs
+ xFont->hasGlyphs( OUString( u'\xA001' ) ) || // A001-A48F: Yi Syllables
+ xFont->hasGlyphs( OUString( u'\xAC01' ) ) || // AC00-D7AF: Hangul Syllables
+ xFont->hasGlyphs( OUString( u'\xCC01' ) ) || // AC00-D7AF: Hangul Syllables
+ xFont->hasGlyphs( OUString( u'\xF901' ) ) || // F900-FAFF: CJK Compatibility Ideographs
+ xFont->hasGlyphs( OUString( u'\xFF71' ) ); // FF00-FFEF: Halfwidth/Fullwidth Forms
// #113783# CTL fonts
bool bHasCmplx =
- xFont->hasGlyphs( OUString( sal_Unicode( 0x05D1 ) ) ) || // 0590-05FF: Hebrew
- xFont->hasGlyphs( OUString( sal_Unicode( 0x0631 ) ) ) || // 0600-06FF: Arabic
- xFont->hasGlyphs( OUString( sal_Unicode( 0x0721 ) ) ) || // 0700-074F: Syriac
- xFont->hasGlyphs( OUString( sal_Unicode( 0x0911 ) ) ) || // 0900-0DFF: Indic scripts
- xFont->hasGlyphs( OUString( sal_Unicode( 0x0E01 ) ) ) || // 0E00-0E7F: Thai
- xFont->hasGlyphs( OUString( sal_Unicode( 0xFB21 ) ) ) || // FB1D-FB4F: Hebrew Presentation Forms
- xFont->hasGlyphs( OUString( sal_Unicode( 0xFB51 ) ) ) || // FB50-FDFF: Arabic Presentation Forms-A
- xFont->hasGlyphs( OUString( sal_Unicode( 0xFE71 ) ) ); // FE70-FEFF: Arabic Presentation Forms-B
+ xFont->hasGlyphs( OUString( u'\x05D1' ) ) || // 0590-05FF: Hebrew
+ xFont->hasGlyphs( OUString( u'\x0631' ) ) || // 0600-06FF: Arabic
+ xFont->hasGlyphs( OUString( u'\x0721' ) ) || // 0700-074F: Syriac
+ xFont->hasGlyphs( OUString( u'\x0911' ) ) || // 0900-0DFF: Indic scripts
+ xFont->hasGlyphs( OUString( u'\x0E01' ) ) || // 0E00-0E7F: Thai
+ xFont->hasGlyphs( OUString( u'\xFB21' ) ) || // FB1D-FB4F: Hebrew Presentation Forms
+ xFont->hasGlyphs( OUString( u'\xFB51' ) ) || // FB50-FDFF: Arabic Presentation Forms-A
+ xFont->hasGlyphs( OUString( u'\xFE71' ) ); // FE70-FEFF: Arabic Presentation Forms-B
// Western fonts
bool bHasLatin =
(!bHasAsian && !bHasCmplx) ||
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index bcfcef3f2126..e914894145e3 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1006,7 +1006,7 @@ void ScInputHandler::ShowArgumentsTip( OUString& rSelText )
{
OUStringBuffer aBuf;
aBuf.append(aNew.copy(0, nStartPosition));
- aBuf.append(static_cast<sal_Unicode>(0x25BA));
+ aBuf.append(u'\x25BA');
aBuf.append(aNew.copy(nStartPosition));
nArgs = ppFDesc->getParameterCount();
sal_Int16 nVarArgsSet = 0;
diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx
index 104661b61ddb..dd047ff813ff 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -71,7 +71,7 @@ ScTpFormulaOptions::ScTpFormulaOptions(vcl::Window* pParent, const SfxItemSet& r
// Get the decimal separator for current locale.
OUString aSep = ScGlobal::GetpLocaleData()->getNumDecimalSep();
- mnDecSep = aSep.isEmpty() ? sal_Unicode('.') : aSep[0];
+ mnDecSep = aSep.isEmpty() ? u'.' : aSep[0];
maSavedDocOptions = ScDocOptions(
static_cast<const ScTpCalcItem&>(rCoreAttrs.Get(
diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx
index 6a4f823d3bd9..ae2425345311 100644
--- a/sc/source/ui/optdlg/tpusrlst.cxx
+++ b/sc/source/ui/optdlg/tpusrlst.cxx
@@ -35,8 +35,8 @@
#include "globstr.hrc"
#include "tpusrlst.hxx"
-#define CR (sal_Unicode)13
-#define LF (sal_Unicode)10
+#define CR u'\x000D'
+#define LF u'\x000A'
static const sal_Unicode cDelimiter = ',';
diff --git a/sc/source/ui/unoobj/filtuno.cxx b/sc/source/ui/unoobj/filtuno.cxx
index 451f3974189d..7b805717aae6 100644
--- a/sc/source/ui/unoobj/filtuno.cxx
+++ b/sc/source/ui/unoobj/filtuno.cxx
@@ -202,7 +202,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute()
aBuf.append(OUString::number(static_cast<sal_uInt16>(eLang)));
aBuf.append(' ');
- aBuf.append(pDlg->IsDateConversionSet() ? sal_Unicode('1') : sal_Unicode('0'));
+ aBuf.append(pDlg->IsDateConversionSet() ? u'1' : u'0');
aFilterOptions = aBuf.makeStringAndClear();
nRet = ui::dialogs::ExecutableDialogResults::OK;
}
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 3d4277e984a3..91b5c5effe12 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -971,7 +971,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
aExport.SetExportTextOptions( ScExportTextOptions( ScExportTextOptions::None, 0, false ) );
// #i87703# text to columns fails with tab separator
- aExport.SetDelimiter( static_cast< sal_Unicode >( 0 ) );
+ aExport.SetDelimiter( u'\0' );
SvMemoryStream aStream;
aStream.SetStreamCharSet( RTL_TEXTENCODING_UNICODE );
commit afacb9850bde58918ba6a5305320e90124454154
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:55:22 2017 +0200
loplugin:salunicodeliteral: sd
Change-Id: Ide4c05a1c025b4c093daababa499f46f360710c3
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx
index e7a29c25f6c4..ab59ffe226b1 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -623,7 +623,7 @@ void SdOOXMLExportTest1::testBulletCharAndFont()
uno::Reference<container::XIndexAccess> xLevels(xPropSet->getPropertyValue("NumberingRules"), uno::UNO_QUERY);
uno::Sequence<beans::PropertyValue> aProps;
xLevels->getByIndex(0) >>= aProps; // 1st level
- OUString sBulletChar(sal_Unicode(0xf06c));
+ OUString sBulletChar(u'\xf06c');
for (int i = 0; i < aProps.getLength(); ++i)
{
const beans::PropertyValue& rProp = aProps[i];
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 5804fdf34bd4..d1aeb4b4360a 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -241,7 +241,7 @@ void SdTiledRenderingTest::callbackImpl(int nType, const char* pPayload)
{
OUString aPayload = OUString::createFromAscii(pPayload);
m_aSelection.clear();
- for (const OUString& rString : lcl_convertSeparated(aPayload, static_cast<sal_Unicode>(';')))
+ for (const OUString& rString : lcl_convertSeparated(aPayload, u';'))
{
::tools::Rectangle aRectangle;
lcl_convertRectangle(rString, aRectangle);
diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx
index 3c1f76523a72..f25e482895d7 100644
--- a/sd/source/filter/ppt/pptinanimations.cxx
+++ b/sd/source/filter/ppt/pptinanimations.cxx
@@ -1983,7 +1983,7 @@ void AnimationImporter::importCommandContainer( const Atom* pAtom, const Referen
{
const OUString aMediaTime( aParam.copy( 9, aParam.getLength() - 10 ) );
rtl_math_ConversionStatus eStatus;
- double fMediaTime = ::rtl::math::stringToDouble( aMediaTime, (sal_Unicode)('.'), (sal_Unicode)(','), &eStatus );
+ double fMediaTime = ::rtl::math::stringToDouble( aMediaTime, u'.', u',', &eStatus );
if( eStatus == rtl_math_ConversionStatus_Ok )
{
aParamValue.Name = "MediaTime";
diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx
index 791ebf251670..564963f923af 100644
--- a/sd/source/ui/animations/CustomAnimationDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.cxx
@@ -616,7 +616,7 @@ RotationPropertyBox::RotationPropertyBox( sal_Int32 nControlType, vcl::Window* p
{
mpMetric.set( VclPtr<MetricField>::Create( pParent ,WB_TABSTOP|WB_IGNORETAB| WB_NOBORDER) );
mpMetric->SetUnit( FUNIT_CUSTOM );
- mpMetric->SetCustomUnitText( OUString( sal_Unicode(0xb0)) ); // degree sign
+ mpMetric->SetCustomUnitText( OUString( u'\x00b0') ); // degree sign
mpMetric->SetMin( -10000 );
mpMetric->SetMax( 10000 );
diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx
index b0c24ddc925b..52a104404797 100644
--- a/sd/source/ui/func/fubullet.cxx
+++ b/sd/source/ui/func/fubullet.cxx
@@ -45,13 +45,13 @@
namespace sd {
-const sal_Unicode CHAR_HARDBLANK = ((sal_Unicode)0x00A0);
-const sal_Unicode CHAR_HARDHYPHEN = ((sal_Unicode)0x2011);
-const sal_Unicode CHAR_SOFTHYPHEN = ((sal_Unicode)0x00AD);
-const sal_Unicode CHAR_RLM = ((sal_Unicode)0x200F);
-const sal_Unicode CHAR_LRM = ((sal_Unicode)0x200E);
-const sal_Unicode CHAR_ZWSP = ((sal_Unicode)0x200B);
-const sal_Unicode CHAR_ZWNBSP = ((sal_Unicode)0x2060);
+const sal_Unicode CHAR_HARDBLANK = u'\x00A0';
+const sal_Unicode CHAR_HARDHYPHEN = u'\x2011';
+const sal_Unicode CHAR_SOFTHYPHEN = u'\x00AD';
+const sal_Unicode CHAR_RLM = u'\x200F';
+const sal_Unicode CHAR_LRM = u'\x200E';
+const sal_Unicode CHAR_ZWSP = u'\x200B';
+const sal_Unicode CHAR_ZWNBSP = u'\x2060';
FuBullet::FuBullet (
commit 867882bcb2bcea0b9d207c3214d32335b10d409e
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:55:18 2017 +0200
loplugin:salunicodeliteral: sdext
Change-Id: Ibcfe4cec41a18ab3fb79cb0545c71a21200c0f2c
diff --git a/sdext/source/pdfimport/tree/drawtreevisiting.cxx b/sdext/source/pdfimport/tree/drawtreevisiting.cxx
index 50e875605189..7e2bed7b7889 100644
--- a/sdext/source/pdfimport/tree/drawtreevisiting.cxx
+++ b/sdext/source/pdfimport/tree/drawtreevisiting.cxx
@@ -95,9 +95,9 @@ void DrawXmlEmitter::visit( TextElement& elem, const std::list< Element* >::cons
if( elem.Text.isEmpty() )
return;
- OUString strSpace(sal_Unicode(32));
- OUString strNbSpace(sal_Unicode(160));
- OUString tabSpace(sal_Unicode(0x09));
+ OUString strSpace(u' ');
+ OUString strNbSpace(u'\x00A0');
+ OUString tabSpace(u'\x0009');
PropertyMap aProps;
if( elem.StyleId != -1 )
{
commit 106e35108b8b7b9ed7c155ac5bdbedeff38eaf79
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:55:12 2017 +0200
loplugin:salunicodeliteral: sfx2
Change-Id: Iff0e8d0ae884cb45e18e0a84b8fdf6e7fcb5f20a
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index acdf7a3b779d..17a4e5d3c736 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -989,7 +989,7 @@ static void InterceptLOKStateChangeEvent(const SfxViewFrame* pViewFrame, const c
OUStringBuffer aBuffer;
aBuffer.append(aEvent.FeatureURL.Complete);
- aBuffer.append(static_cast<sal_Unicode>('='));
+ aBuffer.append(u'=');
if (aEvent.FeatureURL.Path == "Bold" ||
aEvent.FeatureURL.Path == "CenterPara" ||
diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx
index fd3a14808ea9..2b4f3535dfb6 100644
--- a/sfx2/source/doc/DocumentMetadataAccess.cxx
+++ b/sfx2/source/doc/DocumentMetadataAccess.cxx
@@ -222,7 +222,7 @@ static bool isFileNameValid(const OUString & i_rFileName)
sal_Int32 idx(0);
do {
const OUString segment(
- i_rFileName.getToken(0, static_cast<sal_Unicode> ('/'), idx) );
+ i_rFileName.getToken(0, u'/', idx) );
if (segment.isEmpty() || // no empty segments
segment == "." || // no . segments
segment == ".." || // no .. segments
@@ -238,7 +238,7 @@ static bool
splitPath(OUString const & i_rPath,
OUString & o_rDir, OUString& o_rRest)
{
- const sal_Int32 idx(i_rPath.indexOf(static_cast<sal_Unicode>('/')));
+ const sal_Int32 idx(i_rPath.indexOf(u'/'));
if (idx < 0 || idx >= i_rPath.getLength()) {
o_rDir.clear();
o_rRest = i_rPath;
@@ -257,7 +257,7 @@ static bool
splitXmlId(OUString const & i_XmlId,
OUString & o_StreamName, OUString& o_Idref )
{
- const sal_Int32 idx(i_XmlId.indexOf(static_cast<sal_Unicode>('#')));
+ const sal_Int32 idx(i_XmlId.indexOf(u'#'));
if ((idx <= 0) || (idx >= i_XmlId.getLength() - 1)) {
return false;
} else {
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx
index 06fddd7f3f49..df7574634f79 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -424,7 +424,7 @@ bool isValidDateTime(const css::util::DateTime & i_rDateTime)
std::pair< OUString, OUString > SAL_CALL
getQualifier(const char* i_name) {
OUString nm = OUString::createFromAscii(i_name);
- sal_Int32 ix = nm.indexOf(static_cast<sal_Unicode> (':'));
+ sal_Int32 ix = nm.indexOf(u':');
if (ix == -1) {
return std::make_pair(OUString(), nm);
} else {
commit 740cf511036cdf881a521a79218d3dcc29422db3
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:55:02 2017 +0200
loplugin:salunicodeliteral: starmath
Change-Id: Ic02e71ccb2d5fe2e3505853c6e164f17e26361b2
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();
commit c22ecc18674a8f9f41afa9f6b1364989b18147d7
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 28 17:54:55 2017 +0200
loplugin:salunicodeliteral: svgio
Change-Id: I98461a30c14d3939e8fd5313a49aa478b39df1c3
diff --git a/svgio/source/svgreader/svgnode.cxx b/svgio/source/svgreader/svgnode.cxx
index 06304f193c72..15cb099537b0 100644
--- a/svgio/source/svgreader/svgnode.cxx
+++ b/svgio/source/svgreader/svgnode.cxx
@@ -92,8 +92,8 @@ namespace svgio
while(nPos < nLen)
{
const sal_Int32 nInitPos(nPos);
- copyToLimiter(rClassList, sal_Unicode(' '), nPos, aToken, nLen);
- skip_char(rClassList, sal_Unicode(' '), nPos, nLen);
+ copyToLimiter(rClassList, u' ', nPos, aToken, nLen);
+ skip_char(rClassList, u' ', nPos, nLen);
const OUString aPart(aToken.makeStringAndClear().trim());
if(aPart.getLength())
diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx
index b10c90651969..f6d05d1411e4 100644
--- a/svgio/source/svgreader/svgstyleattributes.cxx
+++ b/svgio/source/svgreader/svgstyleattributes.cxx
@@ -178,7 +178,7 @@ namespace svgio
{
// get TokenName
OUStringBuffer aTokenName;
- skip_char(rCandidate, sal_Unicode(' '), nPos, nLen);
+ skip_char(rCandidate, u' ', nPos, nLen);
copyString(rCandidate, nPos, aTokenName, nLen);
if (aTokenName.isEmpty())
@@ -191,9 +191,9 @@ namespace svgio
// get TokenValue
OUStringBuffer aTokenValue;
- skip_char(rCandidate, sal_Unicode(' '), sal_Unicode(':'), nPos, nLen);
- copyToLimiter(rCandidate, sal_Unicode(';'), nPos, aTokenValue, nLen);
- skip_char(rCandidate, sal_Unicode(' '), sal_Unicode(';'), nPos, nLen);
+ skip_char(rCandidate, u' ', u':', nPos, nLen);
+ copyToLimiter(rCandidate, u';', nPos, aTokenValue, nLen);
+ skip_char(rCandidate, u' ', u';', nPos, nLen);
if (aTokenValue.isEmpty())
{
diff --git a/svgio/source/svgreader/svgstylenode.cxx b/svgio/source/svgreader/svgstylenode.cxx
index 08b3eafd7bcc..c3ca2a5c540b 100644
--- a/svgio/source/svgreader/svgstylenode.cxx
+++ b/svgio/source/svgreader/svgstylenode.cxx
@@ -96,8 +96,8 @@ namespace svgio
while(nPos < nLen)
{
const sal_Int32 nInitPos(nPos);
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list