diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-12-20 09:47:06 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-12-20 13:07:02 +0100 |
commit | cf7306194f5c677fef75e3ff5098676ee302359e (patch) | |
tree | a52a0980de72c7f70e4f3ae55126579655440773 /vcl/source | |
parent | 24b02a4f2507f40fe9d36c393c59e12c072428c3 (diff) |
No longer need to worry about ambiguous operator== in loplugin:stringviewparam
...after 46c5de832868d2812448b2caace3eeaa9237b9f6 "make *String(string_view)
constructors explicit"
Change-Id: I6e884c762a2fc91f5dd6fbb197a596fd60f17cae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108043
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/app/salvtables.cxx | 6 | ||||
-rw-r--r-- | vcl/source/control/ivctrl.cxx | 12 | ||||
-rw-r--r-- | vcl/source/window/builder.cxx | 6 | ||||
-rw-r--r-- | vcl/source/window/menu.cxx | 4 |
4 files changed, 16 insertions, 12 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 0524244ed6d2..2f487c53b6e4 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <string_view> + #include <com/sun/star/accessibility/AccessibleRelationType.hpp> #include <com/sun/star/awt/XWindow.hpp> #include <com/sun/star/awt/XWindowPeer.hpp> @@ -1704,7 +1708,7 @@ private: std::vector<VclPtr<VclGrid>> m_aAddedGrids; Idle m_aUpdateRoadmapIdle; - int find_page(const OString& rIdent) const + int find_page(std::string_view rIdent) const { for (size_t i = 0; i < m_aAddedPages.size(); ++i) { diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx index 87b746c88da0..f59e6784c7da 100644 --- a/vcl/source/control/ivctrl.cxx +++ b/vcl/source/control/ivctrl.cxx @@ -505,7 +505,7 @@ VerticalTabPageData* VerticalTabControl::GetPageData(const SvxIconChoiceCtrlEntr return pRet; } -VerticalTabPageData* VerticalTabControl::GetPageData(const OString& rId) const +VerticalTabPageData* VerticalTabControl::GetPageData(std::string_view rId) const { VerticalTabPageData* pRet = nullptr; for (auto & pData : maPageList) @@ -579,7 +579,7 @@ void VerticalTabControl::InsertPage(const rtl::OString &rIdent, const rtl::OUStr pNew->xPage->Hide(); } -void VerticalTabControl::RemovePage(const rtl::OString &rPageId) +void VerticalTabControl::RemovePage(std::string_view rPageId) { for (auto it = maPageList.begin(), end = maPageList.end(); it != end; ++it) { @@ -595,7 +595,7 @@ void VerticalTabControl::RemovePage(const rtl::OString &rPageId) } } -sal_uInt16 VerticalTabControl::GetPagePos(const OString& rPageId) const +sal_uInt16 VerticalTabControl::GetPagePos(std::string_view rPageId) const { VerticalTabPageData* pData = GetPageData(rPageId); if (!pData) @@ -603,7 +603,7 @@ sal_uInt16 VerticalTabControl::GetPagePos(const OString& rPageId) const return m_xChooser->GetEntryListPos(pData->pEntry); } -VclPtr<vcl::Window> VerticalTabControl::GetPage(const OString& rPageId) +VclPtr<vcl::Window> VerticalTabControl::GetPage(std::string_view rPageId) { VerticalTabPageData* pData = GetPageData(rPageId); if (!pData) @@ -611,7 +611,7 @@ VclPtr<vcl::Window> VerticalTabControl::GetPage(const OString& rPageId) return pData->xPage; } -OUString VerticalTabControl::GetPageText(const OString& rPageId) const +OUString VerticalTabControl::GetPageText(std::string_view rPageId) const { VerticalTabPageData* pData = GetPageData(rPageId); if (!pData) @@ -619,7 +619,7 @@ OUString VerticalTabControl::GetPageText(const OString& rPageId) const return pData->pEntry->GetText(); } -void VerticalTabControl::SetPageText(const OString& rPageId, const OUString& rText) +void VerticalTabControl::SetPageText(std::string_view rPageId, const OUString& rText) { VerticalTabPageData* pData = GetPageData(rPageId); if (!pData) diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 03a79f0eca8b..a9d150d6a883 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -4188,7 +4188,7 @@ vcl::Window *VclBuilder::get_widget_root() return m_aChildren.empty() ? nullptr : m_aChildren[0].m_pWindow.get(); } -vcl::Window *VclBuilder::get_by_name(const OString& sID) +vcl::Window *VclBuilder::get_by_name(std::string_view sID) { for (auto const& child : m_aChildren) { @@ -4199,7 +4199,7 @@ vcl::Window *VclBuilder::get_by_name(const OString& sID) return nullptr; } -PopupMenu *VclBuilder::get_menu(const OString& sID) +PopupMenu *VclBuilder::get_menu(std::string_view sID) { for (auto const& menu : m_aMenus) { @@ -4210,7 +4210,7 @@ PopupMenu *VclBuilder::get_menu(const OString& sID) return nullptr; } -void VclBuilder::set_response(const OString& sID, short nResponse) +void VclBuilder::set_response(std::string_view sID, short nResponse) { switch (nResponse) { diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index f14056057aa5..06aefe570199 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -641,7 +641,7 @@ sal_uInt16 Menu::GetItemId(sal_uInt16 nPos) const return 0; } -sal_uInt16 Menu::GetItemId(const OString &rIdent) const +sal_uInt16 Menu::GetItemId(std::string_view rIdent) const { for (size_t n = 0; n < pItemList->size(); ++n) { @@ -886,7 +886,7 @@ void Menu::CheckItem( sal_uInt16 nItemId, bool bCheck ) ImplCallEventListeners( bCheck ? VclEventId::MenuItemChecked : VclEventId::MenuItemUnchecked, nPos ); } -void Menu::CheckItem( const OString &rIdent , bool bCheck ) +void Menu::CheckItem( std::string_view rIdent , bool bCheck ) { CheckItem( GetItemId( rIdent ), bCheck ); } |