Replace some uses of OUStringChar with string literals
Change-Id: I763f9a3f57efcd47643ca4651e2454e95c6921c9 Reviewed-on: https://gerrit.libreoffice.org/81127 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
parent
4444d5dbe7
commit
ac2c1fb821
@ -66,7 +66,7 @@ void TestString::testDecimalStringToNumber()
|
||||
{
|
||||
OUString s1("1234");
|
||||
CPPUNIT_ASSERT_EQUAL(sal_uInt32(1234), comphelper::string::decimalStringToNumber(s1));
|
||||
s1 += OUStringChar(0x07C6);
|
||||
s1 += u"\u07C6";
|
||||
CPPUNIT_ASSERT_EQUAL(sal_uInt32(12346), comphelper::string::decimalStringToNumber(s1));
|
||||
// Codepoints on 2 16bits words
|
||||
sal_uInt32 utf16String[] = { 0x1D7FE /* 8 */, 0x1D7F7 /* 1 */};
|
||||
|
@ -153,10 +153,8 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, SelectHdl_Impl, weld::TreeView&, void)
|
||||
{
|
||||
// set installation directory info
|
||||
OUString sLocation = m_xJavaList->get_selected_id();
|
||||
OUString sInfo = m_sInstallText;
|
||||
// tdf#80646 insert LTR mark after label
|
||||
sInfo += OUStringChar(0x200E);
|
||||
sInfo += sLocation;
|
||||
OUString sInfo = m_sInstallText + u"\u200E" + sLocation;
|
||||
m_xJavaPathText->set_label(sInfo);
|
||||
}
|
||||
|
||||
|
@ -635,7 +635,7 @@ void SvxGrfCropPage::GraphicHasChanged( bool bFound )
|
||||
OUString sTemp = aFld->GetText();
|
||||
aFld->SetValue( aFld->Normalize( aOrigSize.Height() ), eUnit );
|
||||
// multiplication sign (U+00D7)
|
||||
sTemp += OUStringChar(0x00D7) + aFld->GetText();
|
||||
sTemp += u"\u00D7" + aFld->GetText();
|
||||
|
||||
if ( aOrigPixelSize.Width() && aOrigPixelSize.Height() ) {
|
||||
sal_Int32 ax = sal_Int32(floor(static_cast<float>(aOrigPixelSize.Width()) /
|
||||
@ -645,7 +645,7 @@ void SvxGrfCropPage::GraphicHasChanged( bool bFound )
|
||||
sTemp += " " + CuiResId( RID_SVXSTR_PPI );
|
||||
OUString sPPI = OUString::number(ax);
|
||||
if (abs(ax - ay) > 1) {
|
||||
sPPI += OUStringChar(0x00D7) + OUString::number(ay);
|
||||
sPPI += u"\u00D7" + OUString::number(ay);
|
||||
}
|
||||
sTemp = sTemp.replaceAll("%1", sPPI);
|
||||
}
|
||||
|
@ -460,9 +460,9 @@ OUString DXFRepresentation::ToOUString(const OString& s) const
|
||||
| RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR);
|
||||
result = result.replaceAll("%%o", "") // Overscore - simply remove
|
||||
.replaceAll("%%u", "") // Underscore - simply remove
|
||||
.replaceAll("%%d", OUStringChar(0x00B0)) // Degrees symbol (°)
|
||||
.replaceAll("%%p", OUStringChar(0x00B1)) // Tolerance symbol (±)
|
||||
.replaceAll("%%c", OUStringChar(0x2205)) // Diameter symbol
|
||||
.replaceAll("%%d", u"\u00B0") // Degrees symbol (°)
|
||||
.replaceAll("%%p", u"\u00B1") // Tolerance symbol (±)
|
||||
.replaceAll("%%c", u"\u2205") // Diameter symbol
|
||||
.replaceAll("%%%", "%"); // Percent symbol
|
||||
|
||||
sal_Int32 pos = result.indexOf("%%"); // %%nnn, where nnn - 3-digit decimal ASCII code
|
||||
|
@ -1032,7 +1032,7 @@ void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider* pBuProv, sal_Int1
|
||||
break;
|
||||
case SVX_NUM_NUMBER_LOWER_ZH :
|
||||
{
|
||||
if ( sSuffix == OUStringChar(0xff0e) )
|
||||
if ( sSuffix == u"\uff0e" )
|
||||
nMappedNumType = 0x260001; // Japanese with double-byte period.
|
||||
else if ( !sSuffix.isEmpty() )
|
||||
nMappedNumType = 0x1B0001; // Japanese/Korean with single-byte period.
|
||||
|
@ -316,7 +316,7 @@ bool MathType::LookupChar(sal_Unicode nChar,OUStringBuffer &rRet,sal_uInt8 nVers
|
||||
rRet.append(" func ").append(OUStringChar(nChar)).append(" ");
|
||||
break;
|
||||
case 0x220d: // owns
|
||||
rRet.append(" func ").append(OUStringChar(0x220b)).append(" ");
|
||||
rRet.append(" func \u220b ");
|
||||
break;
|
||||
case 0x220f:
|
||||
pC = " prod ";
|
||||
|
@ -317,9 +317,9 @@ OUString SmOoxmlImport::handleD()
|
||||
opening = "left lbrace ";
|
||||
if( closing == "}" )
|
||||
closing = " right rbrace";
|
||||
if( opening == OUStringChar(0x27e6) )
|
||||
if( opening == u"\u27e6" )
|
||||
opening = "left ldbracket ";
|
||||
if( closing == OUStringChar(0x27e7) )
|
||||
if( closing == u"\u27e7" )
|
||||
closing = " right rdbracket";
|
||||
if( opening == "|" )
|
||||
opening = "left lline ";
|
||||
|
@ -1400,11 +1400,7 @@ void Test::testUserDefinedNumberFormats()
|
||||
{ // tdf#79399 tdf#101462 Native Number Formats
|
||||
sCode = "[NatNum5][$-0404]General\\ ";
|
||||
// Chinese upper case number characters for 120
|
||||
sExpected = OUStringChar(22777) +
|
||||
OUStringChar(20336) +
|
||||
OUStringChar(36019) +
|
||||
OUStringChar(25342) +
|
||||
" ";
|
||||
sExpected = u"\u58F9\u4F70\u8CB3\u62FE ";
|
||||
checkPreviewString(aFormatter, sCode, 120, eLang, sExpected);
|
||||
sCode = "[DBNum2][$-0404]General\\ ";
|
||||
checkPreviewString(aFormatter, sCode, 120, eLang, sExpected);
|
||||
|
@ -320,7 +320,7 @@ void TableWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectang
|
||||
|
||||
// #i95350# force RTL output
|
||||
if (IsRTLEnabled())
|
||||
aText = OUStringChar(0x202D) + aText;
|
||||
aText = u"\u202D" + aText;
|
||||
|
||||
rRenderContext.DrawText(Point(nTextX, nTextY), aText);
|
||||
}
|
||||
|
@ -6945,7 +6945,7 @@ void SwUiWriterTest::testTdf108423()
|
||||
pWrtShell->AutoCorrect(corr, cChar);
|
||||
// The word "i" should be capitalized due to autocorrect, followed by a typographical apostrophe
|
||||
sal_uLong nIndex = pWrtShell->GetCursor()->GetNode().GetIndex();
|
||||
OUString sIApostrophe(u"I" + OUStringChar(0x2019));
|
||||
OUString sIApostrophe(u"I\u2019");
|
||||
CPPUNIT_ASSERT_EQUAL(sIApostrophe, static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText());
|
||||
pWrtShell->Insert(" i");
|
||||
pWrtShell->AutoCorrect(corr, cChar);
|
||||
|
@ -2452,7 +2452,7 @@ bool SwCursorShell::SelectNxtPrvHyperlink( bool bNext )
|
||||
rAttr.GetStart(),
|
||||
*rAttr.GetEnd() - rAttr.GetStart() ) );
|
||||
|
||||
sText = sText.replaceAll(OUStringChar(0x0a), "");
|
||||
sText = sText.replaceAll("\x0a", "");
|
||||
sText = comphelper::string::strip(sText, ' ');
|
||||
|
||||
if( !sText.isEmpty() )
|
||||
|
@ -714,7 +714,7 @@ void SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr )
|
||||
OUString sText( pTextNd->GetExpandText(GetLayout(),
|
||||
rAttr.GetStart(), *rAttr.GetEnd() - rAttr.GetStart()) );
|
||||
|
||||
sText = sText.replaceAll(OUStringChar(0x0a), "");
|
||||
sText = sText.replaceAll("\x0a", "");
|
||||
sText = comphelper::string::strip(sText, ' ');
|
||||
|
||||
if( !sText.isEmpty() )
|
||||
|
@ -439,7 +439,7 @@ static void FilterText(OUString & rText, LanguageType const eLang,
|
||||
// remove all special characters (replace them with blanks)
|
||||
if (!rText.isEmpty())
|
||||
{
|
||||
rText = rText.replaceAll(OUStringChar(0xad), "");
|
||||
rText = rText.replaceAll(u"\u00ad", "");
|
||||
OUStringBuffer aBuf(rText);
|
||||
const sal_Int32 l = aBuf.getLength();
|
||||
for (sal_Int32 i = 0; i < l; ++i)
|
||||
|
@ -39,14 +39,14 @@ static const char UNO_NAME_CHAR_STYLE_NAME[] = "CharStyleName";
|
||||
static const char UNO_NAME_NUMBERING_TYPE[] = "NumberingType";
|
||||
static const char UNO_NAME_BULLET_CHAR[] = "BulletChar";
|
||||
|
||||
static const sal_Int16 CHAR_CLOSED_DOT = 8226;
|
||||
static const sal_Int16 CHAR_EMPTY_DOT = 111;
|
||||
static const sal_Int16 CHAR_SQUARE = 9632;
|
||||
static const sal_Int16 CHAR_STAR_SYMBOL = 10026;
|
||||
static const sal_Int16 CHAR_FOUR_DIAMONDS = 10070;
|
||||
static const sal_Int16 CHAR_DIAMOND = 10022;
|
||||
static const sal_Int16 CHAR_ARROW = 10146;
|
||||
static const sal_Int16 CHAR_CHECK_MARK = 10003;
|
||||
static const sal_Unicode CHAR_CLOSED_DOT[] = u"\u2022";
|
||||
static const char CHAR_EMPTY_DOT[] = "o";
|
||||
static const sal_Unicode CHAR_SQUARE[] = u"\u2540";
|
||||
static const sal_Unicode CHAR_STAR_SYMBOL[] = u"\u272A";
|
||||
static const sal_Unicode CHAR_FOUR_DIAMONDS[] = u"\u2756";
|
||||
static const sal_Unicode CHAR_DIAMOND[] = u"\u2726";
|
||||
static const sal_Unicode CHAR_ARROW[] = u"\u27A2";
|
||||
static const sal_Unicode CHAR_CHECK_MARK[] = u"\u2713";
|
||||
|
||||
SwVbaListHelper::SwVbaListHelper( const css::uno::Reference< css::text::XTextDocument >& xTextDoc, sal_Int32 nGalleryType, sal_Int32 nTemplateType ) : mxTextDocument( xTextDoc ), mnGalleryType( nGalleryType ), mnTemplateType( nTemplateType )
|
||||
{
|
||||
@ -144,37 +144,37 @@ void SwVbaListHelper::CreateBulletListTemplate()
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
aBulletChar = OUString( sal_Unicode( CHAR_CLOSED_DOT ) );
|
||||
aBulletChar = CHAR_CLOSED_DOT;
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
aBulletChar = OUStringChar(CHAR_EMPTY_DOT);
|
||||
aBulletChar = CHAR_EMPTY_DOT;
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
aBulletChar = OUString( sal_Unicode( CHAR_SQUARE ) );
|
||||
aBulletChar = CHAR_SQUARE;
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
aBulletChar = OUString( sal_Unicode( CHAR_STAR_SYMBOL ) );
|
||||
aBulletChar = CHAR_STAR_SYMBOL;
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
aBulletChar = OUString( sal_Unicode( CHAR_FOUR_DIAMONDS ) );
|
||||
aBulletChar = CHAR_FOUR_DIAMONDS;
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
{
|
||||
aBulletChar = OUString( sal_Unicode( CHAR_ARROW ) );
|
||||
aBulletChar = CHAR_ARROW;
|
||||
break;
|
||||
}
|
||||
case 7:
|
||||
{
|
||||
aBulletChar = OUString( sal_Unicode( CHAR_CHECK_MARK ) );
|
||||
aBulletChar = CHAR_CHECK_MARK;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -411,31 +411,31 @@ void SwVbaListHelper::CreateOutlineNumberForType3()
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
aBulletChar = OUString( sal_Unicode( CHAR_FOUR_DIAMONDS ) );
|
||||
aBulletChar = CHAR_FOUR_DIAMONDS;
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
case 5:
|
||||
{
|
||||
aBulletChar = OUString( sal_Unicode( CHAR_ARROW ) );
|
||||
aBulletChar = CHAR_ARROW;
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
case 6:
|
||||
{
|
||||
aBulletChar = OUString( sal_Unicode( CHAR_SQUARE ) );
|
||||
aBulletChar = CHAR_SQUARE;
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
case 7:
|
||||
{
|
||||
aBulletChar = OUString( sal_Unicode( CHAR_CLOSED_DOT ) );
|
||||
aBulletChar = CHAR_CLOSED_DOT;
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
case 8:
|
||||
{
|
||||
aBulletChar = OUString( sal_Unicode( CHAR_DIAMOND ) );
|
||||
aBulletChar = CHAR_DIAMOND;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -205,7 +205,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
|
||||
|
||||
if( !sText.isEmpty() )
|
||||
{
|
||||
OUStringBuffer sTmp(sText.replaceAll(OUStringChar(0xad), ""));
|
||||
OUStringBuffer sTmp(sText.replaceAll(u"\u00ad", ""));
|
||||
for (sal_Int32 i = 0; i < sTmp.getLength(); ++i)
|
||||
{
|
||||
if (sTmp[i] < 0x20)
|
||||
|
@ -196,7 +196,7 @@ namespace Translate
|
||||
if (std::use_facet<boost::locale::info>(loc).language() == "qtz")
|
||||
{
|
||||
OString sKeyId(genKeyId(OString(pContextAndId).replace('\004', '|')));
|
||||
return OUString::fromUtf8(sKeyId) + OUStringChar(0x2016) + createFromUtf8(pId, strlen(pId));
|
||||
return OUString::fromUtf8(sKeyId) + u"\u2016" + createFromUtf8(pId, strlen(pId));
|
||||
}
|
||||
|
||||
//otherwise translate it
|
||||
@ -230,7 +230,7 @@ namespace Translate
|
||||
{
|
||||
OString sKeyId(genKeyId(aContextIdId[0] + "|" + aContextIdId[1]));
|
||||
int nForm = n == 0 ? 1 : 2;
|
||||
return OUString::fromUtf8(sKeyId) + OUStringChar(0x2016) + createFromUtf8(aContextIdId[nForm].getStr(), aContextIdId[nForm].getLength());
|
||||
return OUString::fromUtf8(sKeyId) + u"\u2016" + createFromUtf8(aContextIdId[nForm].getStr(), aContextIdId[nForm].getLength());
|
||||
}
|
||||
|
||||
//otherwise translate it
|
||||
|
Loading…
x
Reference in New Issue
Block a user