summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-11-25 08:14:07 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-11-30 12:32:14 +0100
commit8332d6d8200e8ca1f22dd98d9373efd5a431d09c (patch)
treedd45d452202998297b8562743ea6345462304d04 /svx
parentd05a4cfbdcece491f7385dbeaa7eca03f2fdc1d5 (diff)
loplugin:stringviewparam include comparisons with string literals
Change-Id: I8ba1214500dddaf413c506a4b82f43d63cda804b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/inc/galbrws2.hxx2
-rw-r--r--svx/source/dialog/ClassificationDialog.cxx2
-rw-r--r--svx/source/dialog/_contdlg.cxx4
-rw-r--r--svx/source/dialog/charmap.cxx2
-rw-r--r--svx/source/dialog/contimp.hxx4
-rw-r--r--svx/source/dialog/imapdlg.cxx2
-rw-r--r--svx/source/form/datanavi.cxx4
-rw-r--r--svx/source/gallery2/galbrws1.cxx2
-rw-r--r--svx/source/gallery2/galbrws1.hxx2
-rw-r--r--svx/source/gallery2/galbrws2.cxx2
-rw-r--r--svx/source/inc/datanavi.hxx4
-rw-r--r--svx/source/sidebar/line/LinePropertyPanelBase.cxx4
-rw-r--r--svx/source/stbctrls/pszctrl.cxx4
-rw-r--r--svx/source/stbctrls/selctrl.cxx4
-rw-r--r--svx/source/tbxctrls/SvxPresetListBox.cxx2
-rw-r--r--svx/source/xoutdev/xattr.cxx14
16 files changed, 29 insertions, 29 deletions
diff --git a/svx/inc/galbrws2.hxx b/svx/inc/galbrws2.hxx
index d26044056c7d..088013946d22 100644
--- a/svx/inc/galbrws2.hxx
+++ b/svx/inc/galbrws2.hxx
@@ -151,7 +151,7 @@ public:
static css::uno::Reference< css::frame::XFrame > GetFrame();
const css::uno::Reference< css::util::XURLTransformer >& GetURLTransformer() const { return m_xTransformer; }
- void Execute(const OString &rIdent);
+ void Execute(std::string_view rIdent);
void DispatchAdd(const css::uno::Reference<css::frame::XDispatch> &rxDispatch,
const css::util::URL &rURL);
diff --git a/svx/source/dialog/ClassificationDialog.cxx b/svx/source/dialog/ClassificationDialog.cxx
index 1cd3a7b6ee93..79ebf7548805 100644
--- a/svx/source/dialog/ClassificationDialog.cxx
+++ b/svx/source/dialog/ClassificationDialog.cxx
@@ -97,7 +97,7 @@ bool fileExists(OUString const & sFilename)
return osl::FileBase::E_None == eRC;
}
-bool stringToClassificationType(OString const & rsType, svx::ClassificationType & reType)
+bool stringToClassificationType(std::string_view rsType, svx::ClassificationType & reType)
{
if (rsType == "CATEGORY")
reType = svx::ClassificationType::CATEGORY;
diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx
index 82d50178d0fd..698ce31b9821 100644
--- a/svx/source/dialog/_contdlg.cxx
+++ b/svx/source/dialog/_contdlg.cxx
@@ -456,7 +456,7 @@ IMPL_LINK(SvxSuperContourDlg, Tbx1ClickHdl, const OString&, rId, void)
m_xContourWnd->QueueIdleUpdate();
}
-void SvxSuperContourDlg::SetActiveTool(const OString& rId)
+void SvxSuperContourDlg::SetActiveTool(std::string_view rId)
{
m_xTbx1->set_item_active("TBI_SELECT", rId == "TBI_SELECT");
m_xTbx1->set_item_active("TBI_RECT", rId == "TBI_RECT");
@@ -464,7 +464,7 @@ void SvxSuperContourDlg::SetActiveTool(const OString& rId)
m_xTbx1->set_item_active("TBI_POLY", rId == "TBI_POLY");
}
-void SvxSuperContourDlg::SetActivePoly(const OString& rId)
+void SvxSuperContourDlg::SetActivePoly(std::string_view rId)
{
m_xTbx1->set_item_active("TBI_POLYMOVE", rId == "TBI_POLYMOVE");
m_xTbx1->set_item_active("TBI_POLYINSERT", rId == "TBI_POLYINSERT");
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index 0ff9631fcb3e..a8328fc137b5 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -236,7 +236,7 @@ void SvxShowCharSet::createContextMenu()
Invalidate();
}
-void SvxShowCharSet::ContextMenuSelect(const OString& rIdent)
+void SvxShowCharSet::ContextMenuSelect(std::string_view rIdent)
{
sal_UCS4 cChar = GetSelectCharacter();
OUString aOUStr(&cChar, 1);
diff --git a/svx/source/dialog/contimp.hxx b/svx/source/dialog/contimp.hxx
index c8b59cb72e14..91579a2c901f 100644
--- a/svx/source/dialog/contimp.hxx
+++ b/svx/source/dialog/contimp.hxx
@@ -100,8 +100,8 @@ class SvxSuperContourDlg
DECL_LINK( WorkplaceClickHdl, ContourWindow&, void );
DECL_LINK( CancelHdl, weld::Button&, void );
- void SetActiveTool(const OString& rId);
- void SetActivePoly(const OString& rId);
+ void SetActiveTool(std::string_view rId);
+ void SetActivePoly(std::string_view rId);
SfxBindings& GetBindings() { return *mpBindings; }
diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx
index d093f44fe515..c7769519c0e1 100644
--- a/svx/source/dialog/imapdlg.cxx
+++ b/svx/source/dialog/imapdlg.cxx
@@ -472,7 +472,7 @@ bool SvxIMapDlg::DoSave()
return bRet;
}
-void SvxIMapDlg::SetActiveTool(const OString& rId)
+void SvxIMapDlg::SetActiveTool(std::string_view rId)
{
m_xTbxIMapDlg1->set_item_active("TBI_SELECT", rId == "TBI_SELECT");
m_xTbxIMapDlg1->set_item_active("TBI_RECT", rId == "TBI_RECT");
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index 98a3dfe4bcd4..4fe1e926d186 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -372,7 +372,7 @@ namespace svxform
}
}
- bool XFormsPage::DoToolBoxAction(const OString& rToolBoxID)
+ bool XFormsPage::DoToolBoxAction(std::string_view rToolBoxID)
{
bool bHandled = false;
bool bIsDocModified = false;
@@ -1154,7 +1154,7 @@ namespace svxform
return sRet;
}
- bool XFormsPage::DoMenuAction(const OString& rMenuID)
+ bool XFormsPage::DoMenuAction(std::string_view rMenuID)
{
return DoToolBoxAction(rMenuID);
}
diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx
index 9ab962b6deb2..2c2d8efa64cf 100644
--- a/svx/source/gallery2/galbrws1.cxx
+++ b/svx/source/gallery2/galbrws1.cxx
@@ -237,7 +237,7 @@ void GalleryBrowser1::EndThemePropertiesDlgHdl(sal_Int32 nResult)
ImplEndGalleryThemeProperties(false, nResult);
}
-void GalleryBrowser1::ImplExecute(const OString &rIdent)
+void GalleryBrowser1::ImplExecute(std::string_view rIdent)
{
if (rIdent == "update")
{
diff --git a/svx/source/gallery2/galbrws1.hxx b/svx/source/gallery2/galbrws1.hxx
index 6d06129d75b5..d179972dc999 100644
--- a/svx/source/gallery2/galbrws1.hxx
+++ b/svx/source/gallery2/galbrws1.hxx
@@ -60,7 +60,7 @@ private:
void ImplInsertThemeEntry( const GalleryThemeEntry* pEntry );
static void ImplFillExchangeData( const GalleryTheme* pThm, ExchangeData& rData );
void ImplGetExecuteVector(std::vector<OString>& o_aExec);
- void ImplExecute(const OString &rIdent);
+ void ImplExecute(std::string_view rIdent);
void ImplGalleryThemeProperties( std::u16string_view rThemeName, bool bCreateNew );
void EndNewThemePropertiesDlgHdl(sal_Int32 nResult);
void EndThemePropertiesDlgHdl(sal_Int32 nResult);
diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx
index 9338689c7c4a..53a80f81bc16 100644
--- a/svx/source/gallery2/galbrws2.cxx
+++ b/svx/source/gallery2/galbrws2.cxx
@@ -1093,7 +1093,7 @@ void GalleryBrowser2::DispatchAdd(
pInfo.release();
}
-void GalleryBrowser2::Execute(const OString &rIdent)
+void GalleryBrowser2::Execute(std::string_view rIdent)
{
Point aSelPos;
const sal_uInt32 nItemId = ImplGetSelectedItemId( nullptr, aSelPos );
diff --git a/svx/source/inc/datanavi.hxx b/svx/source/inc/datanavi.hxx
index 8feee550c5a8..a208dc2062ef 100644
--- a/svx/source/inc/datanavi.hxx
+++ b/svx/source/inc/datanavi.hxx
@@ -209,7 +209,7 @@ namespace svxform
void AddChildren(const weld::TreeIter* _pParent,
const css::uno::Reference< css::xml::dom::XNode >& _xNode);
- bool DoToolBoxAction(const OString& rToolBoxID);
+ bool DoToolBoxAction(std::string_view rToolBoxID);
void AddEntry(std::unique_ptr<ItemNode> _pNewNode, bool _bIsElement, weld::TreeIter* pRet = nullptr);
void AddEntry(const css::uno::Reference< css::beans::XPropertySet >& _rPropSet, weld::TreeIter* pRet = nullptr);
void EditEntry( const css::uno::Reference< css::beans::XPropertySet >& _rPropSet );
@@ -228,7 +228,7 @@ namespace svxform
void ClearModel();
OUString LoadInstance(const css::uno::Sequence< css::beans::PropertyValue >& _xPropSeq);
- bool DoMenuAction(const OString& rMenuID);
+ bool DoMenuAction(std::string_view rMenuID);
void EnableMenuItems(weld::Menu* pMenu);
const OUString& GetInstanceName() const { return m_sInstanceName; }
diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
index 2c144e48ccd8..2738f1fc4023 100644
--- a/svx/source/sidebar/line/LinePropertyPanelBase.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
@@ -47,9 +47,9 @@ public:
{
}
- bool operator()(const OUString& rCommand, const css::uno::Any& rValue)
+ bool operator()(std::u16string_view rCommand, const css::uno::Any& rValue)
{
- if (rCommand == ".uno:XLineStyle")
+ if (rCommand == u".uno:XLineStyle")
{
css::drawing::LineStyle eLineStyle(css::drawing::LineStyle_NONE);
rValue >>= eLineStyle;
diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx
index bdd8a36c20d0..4dee38e06930 100644
--- a/svx/source/stbctrls/pszctrl.cxx
+++ b/svx/source/stbctrls/pszctrl.cxx
@@ -95,7 +95,7 @@ class FunctionPopup_Impl
VclBuilder m_aBuilder;
VclPtr<PopupMenu> m_xMenu;
sal_uInt32 m_nSelected;
- static sal_uInt16 id_to_function(const OString& rIdent);
+ static sal_uInt16 id_to_function(std::string_view rIdent);
sal_uInt16 function_to_id(sal_uInt16 nFunc) const;
public:
explicit FunctionPopup_Impl( sal_uInt32 nCheckEncoded );
@@ -105,7 +105,7 @@ public:
}
-sal_uInt16 FunctionPopup_Impl::id_to_function(const OString& rIdent)
+sal_uInt16 FunctionPopup_Impl::id_to_function(std::string_view rIdent)
{
if (rIdent == "avg")
return PSZ_FUNC_AVG;
diff --git a/svx/source/stbctrls/selctrl.cxx b/svx/source/stbctrls/selctrl.cxx
index 37747b919436..0411d3555758 100644
--- a/svx/source/stbctrls/selctrl.cxx
+++ b/svx/source/stbctrls/selctrl.cxx
@@ -41,7 +41,7 @@ class SelectionTypePopup
{
VclBuilder m_aBuilder;
VclPtr<PopupMenu> m_xMenu;
- static sal_uInt16 id_to_state(const OString& rIdent);
+ static sal_uInt16 id_to_state(std::string_view rIdent);
sal_uInt16 state_to_id(sal_uInt16 nState) const;
public:
explicit SelectionTypePopup(sal_uInt16 nCurrent);
@@ -53,7 +53,7 @@ public:
}
-sal_uInt16 SelectionTypePopup::id_to_state(const OString& rIdent)
+sal_uInt16 SelectionTypePopup::id_to_state(std::string_view rIdent)
{
if (rIdent == "block")
return 3;
diff --git a/svx/source/tbxctrls/SvxPresetListBox.cxx b/svx/source/tbxctrls/SvxPresetListBox.cxx
index 9cfe5894b8e9..5cda71a8cfa7 100644
--- a/svx/source/tbxctrls/SvxPresetListBox.cxx
+++ b/svx/source/tbxctrls/SvxPresetListBox.cxx
@@ -101,7 +101,7 @@ void SvxPresetListBox::FillPresetListBox(XPatternList& pList, sal_uInt32 nStartI
FillPresetListBoxImpl<XPatternList, XBitmapEntry>(pList, nStartIndex);
}
-void SvxPresetListBox::OnMenuItemSelected(const OString& rIdent)
+void SvxPresetListBox::OnMenuItemSelected(std::string_view rIdent)
{
if (rIdent == "rename")
maRenameHdl.Call(this);
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index f8b532ab554e..43f0e6c1a2f2 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -1982,19 +1982,19 @@ std::string XGradient::GradientStyleToString(css::awt::GradientStyle eStyle)
namespace
{
- css::awt::GradientStyle lcl_getStyleFromString(const OUString& rStyle)
+ css::awt::GradientStyle lcl_getStyleFromString(std::u16string_view rStyle)
{
- if (rStyle == "LINEAR")
+ if (rStyle == u"LINEAR")
return css::awt::GradientStyle_LINEAR;
- else if (rStyle == "AXIAL")
+ else if (rStyle == u"AXIAL")
return css::awt::GradientStyle_AXIAL;
- else if (rStyle == "RADIAL")
+ else if (rStyle == u"RADIAL")
return css::awt::GradientStyle_RADIAL;
- else if (rStyle == "ELLIPTICAL")
+ else if (rStyle == u"ELLIPTICAL")
return css::awt::GradientStyle_ELLIPTICAL;
- else if (rStyle == "SQUARE")
+ else if (rStyle == u"SQUARE")
return css::awt::GradientStyle_SQUARE;
- else if (rStyle == "RECT")
+ else if (rStyle == u"RECT")
return css::awt::GradientStyle_RECT;
return css::awt::GradientStyle_LINEAR;