diff options
author | Noel <noelgrandin@gmail.com> | 2020-11-18 10:10:40 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-11-24 09:45:04 +0100 |
commit | bb06f51308428500c9c8d11ae05f0aa03ecc179c (patch) | |
tree | b18620e8572ed6d4c43c8605660d59f5f7a7e531 /editeng | |
parent | 42e8e16cf93dcf944e5c1106f76aaa32057c0397 (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')
-rw-r--r-- | editeng/qa/unit/core-test.cxx | 30 | ||||
-rw-r--r-- | editeng/source/editeng/editobj.cxx | 10 | ||||
-rw-r--r-- | editeng/source/editeng/editobj2.hxx | 6 | ||||
-rw-r--r-- | editeng/source/editeng/eertfpar.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/eertfpar.hxx | 2 | ||||
-rw-r--r-- | editeng/source/outliner/outlobj.cxx | 4 |
6 files changed, 27 insertions, 27 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); } } diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index 88cef3a89c35..fb872ca870eb 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -304,13 +304,13 @@ void EditTextObject::SetStyleSheet(sal_Int32 nPara, const OUString& rName, const } bool EditTextObject::ChangeStyleSheets( - const OUString& rOldName, SfxStyleFamily eOldFamily, const OUString& rNewName, SfxStyleFamily eNewFamily) + std::u16string_view rOldName, SfxStyleFamily eOldFamily, const OUString& rNewName, SfxStyleFamily eNewFamily) { return mpImpl->ChangeStyleSheets(rOldName, eOldFamily, rNewName, eNewFamily); } void EditTextObject::ChangeStyleSheetName( - SfxStyleFamily eFamily, const OUString& rOldName, const OUString& rNewName) + SfxStyleFamily eFamily, std::u16string_view rOldName, const OUString& rNewName) { mpImpl->ChangeStyleSheetName(eFamily, rOldName, rNewName); } @@ -1000,7 +1000,7 @@ void EditTextObjectImpl::SetStyleSheet(sal_Int32 nPara, const OUString& rName, c } bool EditTextObjectImpl::ImpChangeStyleSheets( - const OUString& rOldName, SfxStyleFamily eOldFamily, + std::u16string_view rOldName, SfxStyleFamily eOldFamily, const OUString& rNewName, SfxStyleFamily eNewFamily ) { const size_t nParagraphs = aContents.size(); @@ -1023,7 +1023,7 @@ bool EditTextObjectImpl::ImpChangeStyleSheets( } bool EditTextObjectImpl::ChangeStyleSheets( - const OUString& rOldName, SfxStyleFamily eOldFamily, + std::u16string_view rOldName, SfxStyleFamily eOldFamily, const OUString& rNewName, SfxStyleFamily eNewFamily) { bool bChanges = ImpChangeStyleSheets( rOldName, eOldFamily, rNewName, eNewFamily ); @@ -1034,7 +1034,7 @@ bool EditTextObjectImpl::ChangeStyleSheets( } void EditTextObjectImpl::ChangeStyleSheetName( SfxStyleFamily eFamily, - const OUString& rOldName, const OUString& rNewName ) + std::u16string_view rOldName, const OUString& rNewName ) { ImpChangeStyleSheets( rOldName, eFamily, rNewName, eFamily ); } diff --git a/editeng/source/editeng/editobj2.hxx b/editeng/source/editeng/editobj2.hxx index 605571be46cf..45862f31303d 100644 --- a/editeng/source/editeng/editobj2.hxx +++ b/editeng/source/editeng/editobj2.hxx @@ -189,7 +189,7 @@ private: bool bVertical:1; TextRotation mnRotation; - bool ImpChangeStyleSheets( const OUString& rOldName, SfxStyleFamily eOldFamily, + bool ImpChangeStyleSheets( std::u16string_view rOldName, SfxStyleFamily eOldFamily, const OUString& rNewName, SfxStyleFamily eNewFamily ); public: @@ -251,8 +251,8 @@ public: void GetStyleSheet(sal_Int32 nPara, OUString& rName, SfxStyleFamily& eFamily) const; void SetStyleSheet(sal_Int32 nPara, const OUString& rName, const SfxStyleFamily& eFamily); bool ChangeStyleSheets( - const OUString& rOldName, SfxStyleFamily eOldFamily, const OUString& rNewName, SfxStyleFamily eNewFamily); - void ChangeStyleSheetName(SfxStyleFamily eFamily, const OUString& rOldName, const OUString& rNewName); + std::u16string_view rOldName, SfxStyleFamily eOldFamily, const OUString& rNewName, SfxStyleFamily eNewFamily); + void ChangeStyleSheetName(SfxStyleFamily eFamily, std::u16string_view rOldName, const OUString& rNewName); editeng::FieldUpdater GetFieldUpdater() const { return editeng::FieldUpdater(*mpFront);} diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx index a05c3a3b9771..2be675266f36 100644 --- a/editeng/source/editeng/eertfpar.cxx +++ b/editeng/source/editeng/eertfpar.cxx @@ -433,7 +433,7 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) } } -SvxRTFStyleType* EditRTFParser::FindStyleSheet( const OUString& rName ) +SvxRTFStyleType* EditRTFParser::FindStyleSheet( std::u16string_view rName ) { SvxRTFStyleTbl& rTable = GetStyleTbl(); for (auto const& iter : rTable) diff --git a/editeng/source/editeng/eertfpar.hxx b/editeng/source/editeng/eertfpar.hxx index 140385027b1a..582e46a68a81 100644 --- a/editeng/source/editeng/eertfpar.hxx +++ b/editeng/source/editeng/eertfpar.hxx @@ -47,7 +47,7 @@ private: virtual void CalcValue() override; void CreateStyleSheets(); SfxStyleSheet* CreateStyleSheet( SvxRTFStyleType const * pRTFStyle ); - SvxRTFStyleType* FindStyleSheet( const OUString& rName ); + SvxRTFStyleType* FindStyleSheet( std::u16string_view rName ); void AddRTFDefaultValues( const EditPaM& rStart, const EditPaM& rEnd ); void ReadField(); void SkipGroup(); diff --git a/editeng/source/outliner/outlobj.cxx b/editeng/source/outliner/outlobj.cxx index c8a589911079..f9d3479a8b2f 100644 --- a/editeng/source/outliner/outlobj.cxx +++ b/editeng/source/outliner/outlobj.cxx @@ -199,14 +199,14 @@ void OutlinerParaObject::ClearPortionInfo() mpImpl->mpEditTextObject->ClearPortionInfo(); } -bool OutlinerParaObject::ChangeStyleSheets(const OUString& rOldName, +bool OutlinerParaObject::ChangeStyleSheets(std::u16string_view rOldName, SfxStyleFamily eOldFamily, const OUString& rNewName, SfxStyleFamily eNewFamily) { return mpImpl->mpEditTextObject->ChangeStyleSheets(rOldName, eOldFamily, rNewName, eNewFamily); } void OutlinerParaObject::ChangeStyleSheetName(SfxStyleFamily eFamily, - const OUString& rOldName, const OUString& rNewName) + std::u16string_view rOldName, const OUString& rNewName) { mpImpl->mpEditTextObject->ChangeStyleSheetName(eFamily, rOldName, rNewName); } |