summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-05-16 13:31:58 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-05-16 14:49:58 +0200
commit45f9627659e882b9157782dfc5981e31567a306e (patch)
tree5c85df9bc07879561e7f93781738d7e3f5c9ae14 /tools
parentf4c7ffc8edf83529550eb3897024792cbb6e48e0 (diff)
loplugin:ostr in tools
Change-Id: I0e601100b034eaa99b08c7cbf09e5f817e69b507 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167736 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
Diffstat (limited to 'tools')
-rw-r--r--tools/qa/cppunit/test_color.cxx48
-rw-r--r--tools/qa/cppunit/test_inetmime.cxx30
-rw-r--r--tools/qa/cppunit/test_json_writer.cxx12
-rw-r--r--tools/qa/cppunit/test_urlobj.cxx60
-rw-r--r--tools/source/inet/inetmsg.cxx8
-rw-r--r--tools/source/inet/inetstrm.cxx4
-rw-r--r--tools/source/misc/extendapplicationenvironment.cxx2
7 files changed, 82 insertions, 82 deletions
diff --git a/tools/qa/cppunit/test_color.cxx b/tools/qa/cppunit/test_color.cxx
index 02f23fb3b81d..4e2046c58e71 100644
--- a/tools/qa/cppunit/test_color.cxx
+++ b/tools/qa/cppunit/test_color.cxx
@@ -84,27 +84,27 @@ void Test::test_asRGBColor()
{
Color aColor;
aColor = COL_BLACK;
- CPPUNIT_ASSERT_EQUAL(OUString("000000"), aColor.AsRGBHexString());
+ CPPUNIT_ASSERT_EQUAL(u"000000"_ustr, aColor.AsRGBHexString());
aColor = COL_WHITE;
- CPPUNIT_ASSERT_EQUAL(OUString("ffffff"), aColor.AsRGBHexString());
+ CPPUNIT_ASSERT_EQUAL(u"ffffff"_ustr, aColor.AsRGBHexString());
aColor = COL_RED;
- CPPUNIT_ASSERT_EQUAL(OUString("800000"), aColor.AsRGBHexString());
+ CPPUNIT_ASSERT_EQUAL(u"800000"_ustr, aColor.AsRGBHexString());
aColor = COL_TRANSPARENT;
- CPPUNIT_ASSERT_EQUAL(OUString("ffffff"), aColor.AsRGBHexString());
+ CPPUNIT_ASSERT_EQUAL(u"ffffff"_ustr, aColor.AsRGBHexString());
aColor = COL_BLUE;
- CPPUNIT_ASSERT_EQUAL(OUString("000080"), aColor.AsRGBHexString());
+ CPPUNIT_ASSERT_EQUAL(u"000080"_ustr, aColor.AsRGBHexString());
aColor.SetRed(0x12);
aColor.SetGreen(0x34);
aColor.SetBlue(0x56);
- CPPUNIT_ASSERT_EQUAL(OUString("123456"), aColor.AsRGBHexString());
+ CPPUNIT_ASSERT_EQUAL(u"123456"_ustr, aColor.AsRGBHexString());
aColor = COL_AUTO;
- CPPUNIT_ASSERT_EQUAL(OUString("ffffff"), aColor.AsRGBHexString());
+ CPPUNIT_ASSERT_EQUAL(u"ffffff"_ustr, aColor.AsRGBHexString());
}
OUString createTintShade(sal_uInt8 nR, sal_uInt8 nG, sal_uInt8 nB, std::u16string_view sReference, sal_Int16 nTintShade)
@@ -121,48 +121,48 @@ void Test::test_ApplyTintOrShade()
// BLACK reference
// 5% tint
- CPPUNIT_ASSERT_EQUAL(OUString("0d0d0d"), createTintShade(0x00, 0x00, 0x00, u"000000", 500));
+ CPPUNIT_ASSERT_EQUAL(u"0d0d0d"_ustr, createTintShade(0x00, 0x00, 0x00, u"000000", 500));
// 15% tint
- CPPUNIT_ASSERT_EQUAL(OUString("262626"), createTintShade(0x00, 0x00, 0x00, u"000000", 1500));
+ CPPUNIT_ASSERT_EQUAL(u"262626"_ustr, createTintShade(0x00, 0x00, 0x00, u"000000", 1500));
// 25% tint
- CPPUNIT_ASSERT_EQUAL(OUString("404040"), createTintShade(0x00, 0x00, 0x00, u"000000", 2500));
+ CPPUNIT_ASSERT_EQUAL(u"404040"_ustr, createTintShade(0x00, 0x00, 0x00, u"000000", 2500));
// 50% tint
- CPPUNIT_ASSERT_EQUAL(OUString("808080"), createTintShade(0x00, 0x00, 0x00, u"000000", 5000));
+ CPPUNIT_ASSERT_EQUAL(u"808080"_ustr, createTintShade(0x00, 0x00, 0x00, u"000000", 5000));
// 100% tint
- CPPUNIT_ASSERT_EQUAL(OUString("ffffff"), createTintShade(0x00, 0x00, 0x00, u"000000", 10000));
+ CPPUNIT_ASSERT_EQUAL(u"ffffff"_ustr, createTintShade(0x00, 0x00, 0x00, u"000000", 10000));
// WHITE reference
// 5% shade
- CPPUNIT_ASSERT_EQUAL(OUString("f2f2f2"), createTintShade(0xff, 0xff, 0xff, u"ffffff", -500));
+ CPPUNIT_ASSERT_EQUAL(u"f2f2f2"_ustr, createTintShade(0xff, 0xff, 0xff, u"ffffff", -500));
// 15% shade
- CPPUNIT_ASSERT_EQUAL(OUString("d9d9d9"), createTintShade(0xff, 0xff, 0xff, u"ffffff", -1500));
+ CPPUNIT_ASSERT_EQUAL(u"d9d9d9"_ustr, createTintShade(0xff, 0xff, 0xff, u"ffffff", -1500));
// 25% shade
- CPPUNIT_ASSERT_EQUAL(OUString("bfbfbf"), createTintShade(0xff, 0xff, 0xff, u"ffffff", -2500));
+ CPPUNIT_ASSERT_EQUAL(u"bfbfbf"_ustr, createTintShade(0xff, 0xff, 0xff, u"ffffff", -2500));
// 50% shade
- CPPUNIT_ASSERT_EQUAL(OUString("808080"), createTintShade(0xff, 0xff, 0xff, u"ffffff", -5000));
+ CPPUNIT_ASSERT_EQUAL(u"808080"_ustr, createTintShade(0xff, 0xff, 0xff, u"ffffff", -5000));
// 100% shade
- CPPUNIT_ASSERT_EQUAL(OUString("000000"), createTintShade(0xff, 0xff, 0xff, u"ffffff", -10000));
+ CPPUNIT_ASSERT_EQUAL(u"000000"_ustr, createTintShade(0xff, 0xff, 0xff, u"ffffff", -10000));
// GREY reference
// 0% - no change
- CPPUNIT_ASSERT_EQUAL(OUString("808080"), createTintShade(0x80, 0x80, 0x80, u"808080", 0));
+ CPPUNIT_ASSERT_EQUAL(u"808080"_ustr, createTintShade(0x80, 0x80, 0x80, u"808080", 0));
// 25% tint
- CPPUNIT_ASSERT_EQUAL(OUString("a0a0a0"), createTintShade(0x80, 0x80, 0x80, u"808080", 2500));
+ CPPUNIT_ASSERT_EQUAL(u"a0a0a0"_ustr, createTintShade(0x80, 0x80, 0x80, u"808080", 2500));
// 50% tint
//CPPUNIT_ASSERT_EQUAL(OUString("c0c0c0"), createTintShade(0x80, 0x80, 0x80, "808080", 5000));
// disable for now - a rounding error happens on come platforms...
// 100% tint
- CPPUNIT_ASSERT_EQUAL(OUString("ffffff"), createTintShade(0x80, 0x80, 0x80, u"808080", 10000));
+ CPPUNIT_ASSERT_EQUAL(u"ffffff"_ustr, createTintShade(0x80, 0x80, 0x80, u"808080", 10000));
// 25% shade
- CPPUNIT_ASSERT_EQUAL(OUString("606060"), createTintShade(0x80, 0x80, 0x80, u"808080", -2500));
+ CPPUNIT_ASSERT_EQUAL(u"606060"_ustr, createTintShade(0x80, 0x80, 0x80, u"808080", -2500));
// 50% shade
- CPPUNIT_ASSERT_EQUAL(OUString("404040"), createTintShade(0x80, 0x80, 0x80, u"808080", -5000));
+ CPPUNIT_ASSERT_EQUAL(u"404040"_ustr, createTintShade(0x80, 0x80, 0x80, u"808080", -5000));
// 100% shade
- CPPUNIT_ASSERT_EQUAL(OUString("000000"), createTintShade(0x80, 0x80, 0x80, u"808080", -10000));
+ CPPUNIT_ASSERT_EQUAL(u"000000"_ustr, createTintShade(0x80, 0x80, 0x80, u"808080", -10000));
}
void Test::test_ApplyLumModOff()
@@ -173,7 +173,7 @@ void Test::test_ApplyLumModOff()
// PowerPoint calls this "Lighter 40%".
aColor.ApplyLumModOff(6000, 4000);
- CPPUNIT_ASSERT_EQUAL(OUString("8faadc"), aColor.AsRGBHexString());
+ CPPUNIT_ASSERT_EQUAL(u"8faadc"_ustr, aColor.AsRGBHexString());
}
void Test::testGetColorError()
diff --git a/tools/qa/cppunit/test_inetmime.cxx b/tools/qa/cppunit/test_inetmime.cxx
index d079f19cf22f..032925dea245 100644
--- a/tools/qa/cppunit/test_inetmime.cxx
+++ b/tools/qa/cppunit/test_inetmime.cxx
@@ -59,7 +59,7 @@ namespace
void Test::test_scanContentType_basic()
{
OUString input
- = "TEST/subTST; parm1=Value1; Parm2=\"unpacked value; %20\"";
+ = u"TEST/subTST; parm1=Value1; Parm2=\"unpacked value; %20\""_ustr;
// Just scan input for valid string:
auto end = INetMIME::scanContentType(input);
CPPUNIT_ASSERT(end != nullptr);
@@ -72,21 +72,21 @@ namespace
&type, &subType, &parameters);
CPPUNIT_ASSERT(end != nullptr);
CPPUNIT_ASSERT_EQUAL(OUString(), OUString(end));
- CPPUNIT_ASSERT_EQUAL(OUString("test"), type);
- CPPUNIT_ASSERT_EQUAL(OUString("subtst"), subType);
+ CPPUNIT_ASSERT_EQUAL(u"test"_ustr, type);
+ CPPUNIT_ASSERT_EQUAL(u"subtst"_ustr, subType);
CPPUNIT_ASSERT_EQUAL(
INetContentTypeParameterList::size_type(2), parameters.size());
auto i = parameters.find("parm1"_ostr);
CPPUNIT_ASSERT(i != parameters.end());
CPPUNIT_ASSERT_EQUAL(OString(), i->second.m_sCharset);
CPPUNIT_ASSERT_EQUAL(OString(), i->second.m_sLanguage);
- CPPUNIT_ASSERT_EQUAL(OUString("Value1"), i->second.m_sValue);
+ CPPUNIT_ASSERT_EQUAL(u"Value1"_ustr, i->second.m_sValue);
CPPUNIT_ASSERT(i->second.m_bConverted);
i = parameters.find("parm2"_ostr);
CPPUNIT_ASSERT(i != parameters.end());
CPPUNIT_ASSERT_EQUAL(OString(), i->second.m_sCharset);
CPPUNIT_ASSERT_EQUAL(OString(), i->second.m_sLanguage);
- CPPUNIT_ASSERT_EQUAL(OUString("unpacked value; %20"), i->second.m_sValue);
+ CPPUNIT_ASSERT_EQUAL(u"unpacked value; %20"_ustr, i->second.m_sValue);
CPPUNIT_ASSERT(i->second.m_bConverted);
}
@@ -94,10 +94,10 @@ namespace
{
// Test extended parameter with value split in 3 sections:
OUString input
- = "TEST/subTST; "
+ = u"TEST/subTST; "
"parm1*0*=US-ASCII'En'5%25%20; "
"Parm1*1*=of%2010;\t"
- "parm1*2*=%20%3d%200.5";
+ "parm1*2*=%20%3d%200.5"_ustr;
// Just scan input for valid string:
auto end = INetMIME::scanContentType(input);
CPPUNIT_ASSERT(end != nullptr);
@@ -110,15 +110,15 @@ namespace
&type, &subType, &parameters);
CPPUNIT_ASSERT(end != nullptr);
CPPUNIT_ASSERT_EQUAL(OUString(), OUString(end));
- CPPUNIT_ASSERT_EQUAL(OUString("test"), type);
- CPPUNIT_ASSERT_EQUAL(OUString("subtst"), subType);
+ CPPUNIT_ASSERT_EQUAL(u"test"_ustr, type);
+ CPPUNIT_ASSERT_EQUAL(u"subtst"_ustr, subType);
CPPUNIT_ASSERT_EQUAL(
INetContentTypeParameterList::size_type(1), parameters.size());
auto i = parameters.find("parm1"_ostr);
CPPUNIT_ASSERT(i != parameters.end());
CPPUNIT_ASSERT_EQUAL("us-ascii"_ostr, i->second.m_sCharset);
CPPUNIT_ASSERT_EQUAL("en"_ostr, i->second.m_sLanguage);
- CPPUNIT_ASSERT_EQUAL(OUString("5% of 10 = 0.5"), i->second.m_sValue);
+ CPPUNIT_ASSERT_EQUAL(u"5% of 10 = 0.5"_ustr, i->second.m_sValue);
CPPUNIT_ASSERT(i->second.m_bConverted);
// Test extended parameters with different value charsets:
@@ -131,21 +131,21 @@ namespace
// Just scan input for valid string:
end = INetMIME::scanContentType(input);
CPPUNIT_ASSERT(end != nullptr);
- CPPUNIT_ASSERT_EQUAL(OUString(";parm1*1*=2"), OUString(end)); // the invalid end of input
+ CPPUNIT_ASSERT_EQUAL(u";parm1*1*=2"_ustr, OUString(end)); // the invalid end of input
// Scan input and parse type, subType and parameters:
end = INetMIME::scanContentType(input,
&type, &subType, &parameters);
CPPUNIT_ASSERT(end != nullptr);
- CPPUNIT_ASSERT_EQUAL(OUString(";parm1*1*=2"), OUString(end)); // the invalid end of input
- CPPUNIT_ASSERT_EQUAL(OUString("test"), type);
- CPPUNIT_ASSERT_EQUAL(OUString("subtst"), subType);
+ CPPUNIT_ASSERT_EQUAL(u";parm1*1*=2"_ustr, OUString(end)); // the invalid end of input
+ CPPUNIT_ASSERT_EQUAL(u"test"_ustr, type);
+ CPPUNIT_ASSERT_EQUAL(u"subtst"_ustr, subType);
CPPUNIT_ASSERT_EQUAL(
INetContentTypeParameterList::size_type(3), parameters.size());
i = parameters.find("parm1"_ostr);
CPPUNIT_ASSERT(i != parameters.end());
CPPUNIT_ASSERT_EQUAL("us-ascii"_ostr, i->second.m_sCharset);
CPPUNIT_ASSERT_EQUAL("en"_ostr, i->second.m_sLanguage);
- CPPUNIT_ASSERT_EQUAL(OUString("value1"), i->second.m_sValue);
+ CPPUNIT_ASSERT_EQUAL(u"value1"_ustr, i->second.m_sValue);
CPPUNIT_ASSERT(i->second.m_bConverted);
i = parameters.find("parm2"_ostr);
CPPUNIT_ASSERT(i != parameters.end());
diff --git a/tools/qa/cppunit/test_json_writer.cxx b/tools/qa/cppunit/test_json_writer.cxx
index 7e2a7baab0e2..50dda8d2bee0 100644
--- a/tools/qa/cppunit/test_json_writer.cxx
+++ b/tools/qa/cppunit/test_json_writer.cxx
@@ -38,7 +38,7 @@ void JsonWriterTest::test1()
{
auto testNode = aJson.startNode("node");
- aJson.put("oustring", OUString("val1"));
+ aJson.put("oustring", u"val1"_ustr);
aJson.put("charptr", "val3");
aJson.put("int", static_cast<sal_Int32>(12));
}
@@ -56,15 +56,15 @@ void JsonWriterTest::test2()
{
auto testNode = aJson.startNode("node");
- aJson.put("field1", OUString("val1"));
- aJson.put("field2", OUString("val2"));
+ aJson.put("field1", u"val1"_ustr);
+ aJson.put("field2", u"val2"_ustr);
{
auto testNode2 = aJson.startNode("node");
- aJson.put("field3", OUString("val3"));
+ aJson.put("field3", u"val3"_ustr);
{
auto testNode3 = aJson.startNode("node");
- aJson.put("field4", OUString("val4"));
- aJson.put("field5", OUString("val5"));
+ aJson.put("field4", u"val4"_ustr);
+ aJson.put("field5", u"val5"_ustr);
}
}
}
diff --git a/tools/qa/cppunit/test_urlobj.cxx b/tools/qa/cppunit/test_urlobj.cxx
index fff77e41f5e7..cf4fa5a03cd2 100644
--- a/tools/qa/cppunit/test_urlobj.cxx
+++ b/tools/qa/cppunit/test_urlobj.cxx
@@ -39,27 +39,27 @@ namespace tools_urlobj
{
INetURLObject aUrl( u"file://10.10.1.1/sampledir/sample.file" );
CPPUNIT_ASSERT_EQUAL(INetProtocol::File, aUrl.GetProtocol());
- CPPUNIT_ASSERT_EQUAL(OUString("10.10.1.1"),
+ CPPUNIT_ASSERT_EQUAL(u"10.10.1.1"_ustr,
aUrl.GetHost(INetURLObject::DecodeMechanism::NONE));
- CPPUNIT_ASSERT_EQUAL(OUString("/sampledir/sample.file"),
+ CPPUNIT_ASSERT_EQUAL(u"/sampledir/sample.file"_ustr,
aUrl.GetURLPath(INetURLObject::DecodeMechanism::NONE));
- CPPUNIT_ASSERT_EQUAL(OUString("sample.file"),
+ CPPUNIT_ASSERT_EQUAL(u"sample.file"_ustr,
aUrl.getName());
- CPPUNIT_ASSERT_EQUAL(OUString("sample"), aUrl.getBase());
- CPPUNIT_ASSERT_EQUAL(OUString("file"), aUrl.getExtension());
+ CPPUNIT_ASSERT_EQUAL(u"sample"_ustr, aUrl.getBase());
+ CPPUNIT_ASSERT_EQUAL(u"file"_ustr, aUrl.getExtension());
}
void urlobjTest_004( )
{
INetURLObject aUrl( u"smb://10.10.1.1/sampledir/sample.file" );
CPPUNIT_ASSERT_EQUAL( INetProtocol::Smb, aUrl.GetProtocol( ) );
- CPPUNIT_ASSERT_EQUAL(OUString("10.10.1.1"),
+ CPPUNIT_ASSERT_EQUAL(u"10.10.1.1"_ustr,
aUrl.GetHost(INetURLObject::DecodeMechanism::NONE));
- CPPUNIT_ASSERT_EQUAL(OUString("/sampledir/sample.file"),
+ CPPUNIT_ASSERT_EQUAL(u"/sampledir/sample.file"_ustr,
aUrl.GetURLPath(INetURLObject::DecodeMechanism::NONE));
- CPPUNIT_ASSERT_EQUAL(OUString("sample.file"), aUrl.getName());
- CPPUNIT_ASSERT_EQUAL(OUString("sample"), aUrl.getBase());
- CPPUNIT_ASSERT_EQUAL(OUString("file"), aUrl.getExtension());
+ CPPUNIT_ASSERT_EQUAL(u"sample.file"_ustr, aUrl.getName());
+ CPPUNIT_ASSERT_EQUAL(u"sample"_ustr, aUrl.getBase());
+ CPPUNIT_ASSERT_EQUAL(u"file"_ustr, aUrl.getExtension());
}
void urlobjCmisTest( )
@@ -92,8 +92,8 @@ namespace tools_urlobj
{
INetURLObject url(u"http://example.com");
CPPUNIT_ASSERT_EQUAL(INetProtocol::Http, url.GetProtocol());
- CPPUNIT_ASSERT_EQUAL(OUString("example.com"), url.GetHost());
- CPPUNIT_ASSERT_EQUAL(OUString("/"), url.GetURLPath());
+ CPPUNIT_ASSERT_EQUAL(u"example.com"_ustr, url.GetHost());
+ CPPUNIT_ASSERT_EQUAL(u"/"_ustr, url.GetURLPath());
}
{
// This is a valid http URL per RFC 7230:
@@ -103,9 +103,9 @@ namespace tools_urlobj
{
INetURLObject url(u"http://example.com#fragment");
CPPUNIT_ASSERT_EQUAL(INetProtocol::Http, url.GetProtocol());
- CPPUNIT_ASSERT_EQUAL(OUString("example.com"), url.GetHost());
- CPPUNIT_ASSERT_EQUAL(OUString("/"), url.GetURLPath());
- CPPUNIT_ASSERT_EQUAL(OUString("fragment"), url.GetMark());
+ CPPUNIT_ASSERT_EQUAL(u"example.com"_ustr, url.GetHost());
+ CPPUNIT_ASSERT_EQUAL(u"/"_ustr, url.GetURLPath());
+ CPPUNIT_ASSERT_EQUAL(u"fragment"_ustr, url.GetMark());
}
}
@@ -246,21 +246,21 @@ namespace tools_urlobj
bool ok = obj.setName(u"bar");
CPPUNIT_ASSERT(ok);
CPPUNIT_ASSERT_EQUAL(
- OUString("file:///bar"), obj.GetMainURL(INetURLObject::DecodeMechanism::NONE));
+ u"file:///bar"_ustr, obj.GetMainURL(INetURLObject::DecodeMechanism::NONE));
}
{
INetURLObject obj(u"file:///foo/");
bool ok = obj.setName(u"bar");
CPPUNIT_ASSERT(ok);
CPPUNIT_ASSERT_EQUAL(
- OUString("file:///bar/"), obj.GetMainURL(INetURLObject::DecodeMechanism::NONE));
+ u"file:///bar/"_ustr, obj.GetMainURL(INetURLObject::DecodeMechanism::NONE));
}
{
INetURLObject obj(u"file:///foo/bar");
bool ok = obj.setName(u"baz");
CPPUNIT_ASSERT(ok);
CPPUNIT_ASSERT_EQUAL(
- OUString("file:///foo/baz"),
+ u"file:///foo/baz"_ustr,
obj.GetMainURL(INetURLObject::DecodeMechanism::NONE));
}
{
@@ -268,7 +268,7 @@ namespace tools_urlobj
bool ok = obj.setName(u"baz");
CPPUNIT_ASSERT(ok);
CPPUNIT_ASSERT_EQUAL(
- OUString("file:///foo/baz/"),
+ u"file:///foo/baz/"_ustr,
obj.GetMainURL(INetURLObject::DecodeMechanism::NONE));
}
}
@@ -279,7 +279,7 @@ namespace tools_urlobj
u"other", INetURLObject::LAST_SEGMENT, false);
CPPUNIT_ASSERT(ok);
CPPUNIT_ASSERT_EQUAL(
- OUString("file:///foo/bar.baz/.other"),
+ u"file:///foo/bar.baz/.other"_ustr,
obj.GetMainURL(INetURLObject::DecodeMechanism::NONE));
}
@@ -288,15 +288,15 @@ namespace tools_urlobj
CPPUNIT_ASSERT(!obj.HasError());
obj.changeScheme(INetProtocol::Http);
CPPUNIT_ASSERT_EQUAL(
- OUString("http://example.com/foo/bar"),
+ u"http://example.com/foo/bar"_ustr,
obj.GetMainURL(INetURLObject::DecodeMechanism::NONE));
obj.changeScheme(INetProtocol::Https);
CPPUNIT_ASSERT_EQUAL(
- OUString("https://example.com/foo/bar"),
+ u"https://example.com/foo/bar"_ustr,
obj.GetMainURL(INetURLObject::DecodeMechanism::NONE));
obj.changeScheme(INetProtocol::Ftp);
CPPUNIT_ASSERT_EQUAL(
- OUString("ftp://example.com/foo/bar"),
+ u"ftp://example.com/foo/bar"_ustr,
obj.GetMainURL(INetURLObject::DecodeMechanism::NONE));
}
@@ -304,7 +304,7 @@ namespace tools_urlobj
INetURLObject obj(u"file://share.allotropia.de@SSL/DavWWWRoot/remote.php");
CPPUNIT_ASSERT(!obj.HasError());
CPPUNIT_ASSERT_EQUAL(
- OUString("file://share.allotropia.de@SSL/DavWWWRoot/remote.php"),
+ u"file://share.allotropia.de@SSL/DavWWWRoot/remote.php"_ustr,
obj.GetMainURL(INetURLObject::DecodeMechanism::NONE));
}
@@ -314,23 +314,23 @@ namespace tools_urlobj
// host:port must not be misinterpreted as scheme:path
INetURLObject obj(u"example.com:8080/foo", INetProtocol::Http);
CPPUNIT_ASSERT(!obj.HasError());
- CPPUNIT_ASSERT_EQUAL(OUString("http://example.com:8080/foo"),
+ CPPUNIT_ASSERT_EQUAL(u"http://example.com:8080/foo"_ustr,
obj.GetMainURL(INetURLObject::DecodeMechanism::NONE));
CPPUNIT_ASSERT_EQUAL(INetProtocol::Http, obj.GetProtocol());
- CPPUNIT_ASSERT_EQUAL(OUString("example.com"), obj.GetHost());
+ CPPUNIT_ASSERT_EQUAL(u"example.com"_ustr, obj.GetHost());
CPPUNIT_ASSERT_EQUAL(sal_uInt32(8080), obj.GetPort());
- CPPUNIT_ASSERT_EQUAL(OUString("/foo"), obj.GetURLPath());
+ CPPUNIT_ASSERT_EQUAL(u"/foo"_ustr, obj.GetURLPath());
}
{
// port may only contain decimal digits, so this must be treated as unknown scheme
INetURLObject obj(u"example.com:80a0/foo", INetProtocol::Http);
CPPUNIT_ASSERT(!obj.HasError());
- CPPUNIT_ASSERT_EQUAL(OUString("example.com:80a0/foo"),
+ CPPUNIT_ASSERT_EQUAL(u"example.com:80a0/foo"_ustr,
obj.GetMainURL(INetURLObject::DecodeMechanism::NONE));
CPPUNIT_ASSERT_EQUAL(INetProtocol::Generic, obj.GetProtocol());
CPPUNIT_ASSERT(obj.isSchemeEqualTo(u"example.com"));
- CPPUNIT_ASSERT_EQUAL(OUString(""), obj.GetHost());
- CPPUNIT_ASSERT_EQUAL(OUString("80a0/foo"), obj.GetURLPath());
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, obj.GetHost());
+ CPPUNIT_ASSERT_EQUAL(u"80a0/foo"_ustr, obj.GetURLPath());
}
{
// Test Windows \\?\C:... long path scheme
diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx
index a5c6838176a1..4cef5ca5ad0f 100644
--- a/tools/source/inet/inetmsg.cxx
+++ b/tools/source/inet/inetmsg.cxx
@@ -250,9 +250,9 @@ OUString INetMIMEMessage::GetDefaultContentType()
aParentCT = pParent->GetDefaultContentType();
if (aParentCT.equalsIgnoreAsciiCase("multipart/digest"))
- return "message/rfc822";
+ return u"message/rfc822"_ustr;
}
- return "text/plain; charset=us-ascii";
+ return u"text/plain; charset=us-ascii"_ustr;
}
void INetMIMEMessage::EnableAttachMultipartFormDataChild()
@@ -273,10 +273,10 @@ void INetMIMEMessage::EnableAttachMultipartFormDataChild()
m_aBoundary += sTail;
// Set header fields.
- SetMIMEVersion("1.0");
+ SetMIMEVersion(u"1.0"_ustr);
SetContentType(
"multipart/form-data; boundary=" + OUString::fromUtf8(m_aBoundary));
- SetContentTransferEncoding("7bit");
+ SetContentTransferEncoding(u"7bit"_ustr);
}
void INetMIMEMessage::AttachChild(std::unique_ptr<INetMIMEMessage> pChildMsg)
diff --git a/tools/source/inet/inetstrm.cxx b/tools/source/inet/inetstrm.cxx
index f4a841da9331..2feaad7f1167 100644
--- a/tools/source/inet/inetstrm.cxx
+++ b/tools/source/inet/inetstrm.cxx
@@ -94,13 +94,13 @@ int INetMIMEMessageStream::GetMsgLine(char* pData, sal_uInt32 nSize)
{
OUString aPCT(pSourceMsg->GetParent()->GetContentType());
if (aPCT.startsWithIgnoreAsciiCase("message/rfc822"))
- pSourceMsg->SetMIMEVersion("1.0");
+ pSourceMsg->SetMIMEVersion(u"1.0"_ustr);
else
pSourceMsg->SetMIMEVersion(OUString());
}
else
{
- pSourceMsg->SetMIMEVersion("1.0");
+ pSourceMsg->SetMIMEVersion(u"1.0"_ustr);
}
// Check ContentType.
diff --git a/tools/source/misc/extendapplicationenvironment.cxx b/tools/source/misc/extendapplicationenvironment.cxx
index 07f9779ccc26..a98d63bc4958 100644
--- a/tools/source/misc/extendapplicationenvironment.cxx
+++ b/tools/source/misc/extendapplicationenvironment.cxx
@@ -50,7 +50,7 @@ void extendApplicationEnvironment()
// Make sure URE_BOOTSTRAP environment variable is set (failure is fatal):
OUStringBuffer env(512);
- OUString envVar("URE_BOOTSTRAP");
+ OUString envVar(u"URE_BOOTSTRAP"_ustr);
OUString uri;
if (rtl::Bootstrap::get(envVar, uri))
{