summaryrefslogtreecommitdiff
path: root/editeng/qa/unit/core-test.cxx
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-11-18 10:10:40 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-11-24 09:45:04 +0100
commitbb06f51308428500c9c8d11ae05f0aa03ecc179c (patch)
treeb18620e8572ed6d4c43c8605660d59f5f7a7e531 /editeng/qa/unit/core-test.cxx
parent42e8e16cf93dcf944e5c1106f76aaa32057c0397 (diff)
loplugin:stringviewparam extend to comparison operators
which means that some call sites have to change to use unicode string literals i.e. u"foo" instead of "foo" Change-Id: Ie51c3adf56d343dd1d1710777f9d2a43ee66221c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106125 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng/qa/unit/core-test.cxx')
-rw-r--r--editeng/qa/unit/core-test.cxx30
1 files changed, 15 insertions, 15 deletions
diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx
index 0a2cb4d8f82b..35094ca07af2 100644
--- a/editeng/qa/unit/core-test.cxx
+++ b/editeng/qa/unit/core-test.cxx
@@ -228,7 +228,7 @@ void Test::testConstruction()
aEngine.SetText("I am Edit Engine.");
}
-bool includes(const uno::Sequence<OUString>& rSeq, const OUString& rVal)
+bool includes(const uno::Sequence<OUString>& rSeq, std::u16string_view rVal)
{
for (OUString const & s : rSeq)
if (s == rVal)
@@ -243,7 +243,7 @@ void Test::testUnoTextFields()
// DATE
rtl::Reference<SvxUnoTextField> xField(new SvxUnoTextField(text::textfield::Type::DATE));
uno::Sequence<OUString> aSvcs = xField->getSupportedServiceNames();
- bool bGood = includes(aSvcs, "com.sun.star.text.textfield.DateTime");
+ bool bGood = includes(aSvcs, u"com.sun.star.text.textfield.DateTime");
CPPUNIT_ASSERT_MESSAGE("expected service is not present.", bGood);
}
@@ -251,7 +251,7 @@ void Test::testUnoTextFields()
// URL
rtl::Reference<SvxUnoTextField> xField(new SvxUnoTextField(text::textfield::Type::URL));
uno::Sequence<OUString> aSvcs = xField->getSupportedServiceNames();
- bool bGood = includes(aSvcs, "com.sun.star.text.textfield.URL");
+ bool bGood = includes(aSvcs, u"com.sun.star.text.textfield.URL");
CPPUNIT_ASSERT_MESSAGE("expected service is not present.", bGood);
}
@@ -259,7 +259,7 @@ void Test::testUnoTextFields()
// PAGE
rtl::Reference<SvxUnoTextField> xField(new SvxUnoTextField(text::textfield::Type::PAGE));
uno::Sequence<OUString> aSvcs = xField->getSupportedServiceNames();
- bool bGood = includes(aSvcs, "com.sun.star.text.textfield.PageNumber");
+ bool bGood = includes(aSvcs, u"com.sun.star.text.textfield.PageNumber");
CPPUNIT_ASSERT_MESSAGE("expected service is not present.", bGood);
}
@@ -267,7 +267,7 @@ void Test::testUnoTextFields()
// PAGES
rtl::Reference<SvxUnoTextField> xField(new SvxUnoTextField(text::textfield::Type::PAGES));
uno::Sequence<OUString> aSvcs = xField->getSupportedServiceNames();
- bool bGood = includes(aSvcs, "com.sun.star.text.textfield.PageCount");
+ bool bGood = includes(aSvcs, u"com.sun.star.text.textfield.PageCount");
CPPUNIT_ASSERT_MESSAGE("expected service is not present.", bGood);
}
@@ -275,7 +275,7 @@ void Test::testUnoTextFields()
// TIME
rtl::Reference<SvxUnoTextField> xField(new SvxUnoTextField(text::textfield::Type::TIME));
uno::Sequence<OUString> aSvcs = xField->getSupportedServiceNames();
- bool bGood = includes(aSvcs, "com.sun.star.text.textfield.DateTime");
+ bool bGood = includes(aSvcs, u"com.sun.star.text.textfield.DateTime");
CPPUNIT_ASSERT_MESSAGE("expected service is not present.", bGood);
}
@@ -283,7 +283,7 @@ void Test::testUnoTextFields()
// FILE
rtl::Reference<SvxUnoTextField> xField(new SvxUnoTextField(text::textfield::Type::DOCINFO_TITLE));
uno::Sequence<OUString> aSvcs = xField->getSupportedServiceNames();
- bool bGood = includes(aSvcs, "com.sun.star.text.textfield.docinfo.Title");
+ bool bGood = includes(aSvcs, u"com.sun.star.text.textfield.docinfo.Title");
CPPUNIT_ASSERT_MESSAGE("expected service is not present.", bGood);
}
@@ -291,7 +291,7 @@ void Test::testUnoTextFields()
// TABLE
rtl::Reference<SvxUnoTextField> xField(new SvxUnoTextField(text::textfield::Type::TABLE));
uno::Sequence<OUString> aSvcs = xField->getSupportedServiceNames();
- bool bGood = includes(aSvcs, "com.sun.star.text.textfield.SheetName");
+ bool bGood = includes(aSvcs, u"com.sun.star.text.textfield.SheetName");
CPPUNIT_ASSERT_MESSAGE("expected service is not present.", bGood);
}
@@ -299,7 +299,7 @@ void Test::testUnoTextFields()
// EXTENDED TIME
rtl::Reference<SvxUnoTextField> xField(new SvxUnoTextField(text::textfield::Type::EXTENDED_TIME));
uno::Sequence<OUString> aSvcs = xField->getSupportedServiceNames();
- bool bGood = includes(aSvcs, "com.sun.star.text.textfield.DateTime");
+ bool bGood = includes(aSvcs, u"com.sun.star.text.textfield.DateTime");
CPPUNIT_ASSERT_MESSAGE("expected service is not present.", bGood);
}
@@ -307,7 +307,7 @@ void Test::testUnoTextFields()
// EXTENDED FILE
rtl::Reference<SvxUnoTextField> xField(new SvxUnoTextField(text::textfield::Type::EXTENDED_FILE));
uno::Sequence<OUString> aSvcs = xField->getSupportedServiceNames();
- bool bGood = includes(aSvcs, "com.sun.star.text.textfield.FileName");
+ bool bGood = includes(aSvcs, u"com.sun.star.text.textfield.FileName");
CPPUNIT_ASSERT_MESSAGE("expected service is not present.", bGood);
}
@@ -315,7 +315,7 @@ void Test::testUnoTextFields()
// AUTHOR
rtl::Reference<SvxUnoTextField> xField(new SvxUnoTextField(text::textfield::Type::AUTHOR));
uno::Sequence<OUString> aSvcs = xField->getSupportedServiceNames();
- bool bGood = includes(aSvcs, "com.sun.star.text.textfield.Author");
+ bool bGood = includes(aSvcs, u"com.sun.star.text.textfield.Author");
CPPUNIT_ASSERT_MESSAGE("expected service is not present.", bGood);
}
@@ -323,7 +323,7 @@ void Test::testUnoTextFields()
// MEASURE
rtl::Reference<SvxUnoTextField> xField(new SvxUnoTextField(text::textfield::Type::MEASURE));
uno::Sequence<OUString> aSvcs = xField->getSupportedServiceNames();
- bool bGood = includes(aSvcs, "com.sun.star.text.textfield.Measure");
+ bool bGood = includes(aSvcs, u"com.sun.star.text.textfield.Measure");
CPPUNIT_ASSERT_MESSAGE("expected service is not present.", bGood);
}
@@ -331,7 +331,7 @@ void Test::testUnoTextFields()
// PRESENTATION HEADER
rtl::Reference<SvxUnoTextField> xField(new SvxUnoTextField(text::textfield::Type::PRESENTATION_HEADER));
uno::Sequence<OUString> aSvcs = xField->getSupportedServiceNames();
- bool bGood = includes(aSvcs, "com.sun.star.presentation.textfield.Header");
+ bool bGood = includes(aSvcs, u"com.sun.star.presentation.textfield.Header");
CPPUNIT_ASSERT_MESSAGE("expected service is not present.", bGood);
}
@@ -339,7 +339,7 @@ void Test::testUnoTextFields()
// PRESENTATION FOOTER
rtl::Reference<SvxUnoTextField> xField(new SvxUnoTextField(text::textfield::Type::PRESENTATION_FOOTER));
uno::Sequence<OUString> aSvcs = xField->getSupportedServiceNames();
- bool bGood = includes(aSvcs, "com.sun.star.presentation.textfield.Footer");
+ bool bGood = includes(aSvcs, u"com.sun.star.presentation.textfield.Footer");
CPPUNIT_ASSERT_MESSAGE("expected service is not present.", bGood);
}
@@ -347,7 +347,7 @@ void Test::testUnoTextFields()
// PRESENTATION DATE TIME
rtl::Reference<SvxUnoTextField> xField(new SvxUnoTextField(text::textfield::Type::PRESENTATION_DATE_TIME));
uno::Sequence<OUString> aSvcs = xField->getSupportedServiceNames();
- bool bGood = includes(aSvcs, "com.sun.star.presentation.textfield.DateTime");
+ bool bGood = includes(aSvcs, u"com.sun.star.presentation.textfield.DateTime");
CPPUNIT_ASSERT_MESSAGE("expected service is not present.", bGood);
}
}