summaryrefslogtreecommitdiff
path: root/fpicker
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-12-11 17:44:34 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-12-11 21:25:10 +0100
commit35e471bb4d1388cf5afcdcee214cf5111edf44e3 (patch)
treebb78f4f13f131f0cb206a9707cc3cfc495a3876a /fpicker
parent0c06e77c122f10a1842bc908bd6e25b1110ddbd2 (diff)
Adapt the remaining OUString functions to std string_view
...for LIBO_INTERNAL_ONLY. These had been missed by 1b43cceaea2084a0489db68cd0113508f34b6643 "Make many OUString functions take std::u16string_view parameters" because they did not match the multi-overload pattern that was addressed there, but they nevertheless benefit from being changed just as well (witness e.g. the various resulting changes from copy() to subView()). This showed a conversion from OStringChar to std::string_view to be missing (while the corresponding conversion form OUStringChar to std::u16string_view was already present). The improvement to loplugin:stringadd became necessary to fix > [CPT] compilerplugins/clang/test/stringadd.cxx > error: 'error' diagnostics expected but not seen: > File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 43 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:42): simplify by merging with the preceding assignment [loplugin:stringadd] > File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 61 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:60): simplify by merging with the preceding assignment [loplugin:stringadd] > 2 errors generated. Change-Id: Ie40de0616a66e60e289c1af0ca60aed6f9ecc279 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107602 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'fpicker')
-rw-r--r--fpicker/source/office/OfficeControlAccess.cxx12
-rw-r--r--fpicker/source/office/OfficeControlAccess.hxx16
2 files changed, 16 insertions, 12 deletions
diff --git a/fpicker/source/office/OfficeControlAccess.cxx b/fpicker/source/office/OfficeControlAccess.cxx
index b8bd0cfed4d7..9095c12ee873 100644
--- a/fpicker/source/office/OfficeControlAccess.cxx
+++ b/fpicker/source/office/OfficeControlAccess.cxx
@@ -211,7 +211,7 @@ namespace svt
return sHelpURL;
}
- Any OControlAccess::getControlProperty( const OUString& rControlName, const OUString& rControlProperty )
+ Any OControlAccess::getControlProperty( std::u16string_view rControlName, const OUString& rControlProperty )
{
// look up the control
sal_Int16 nControlId = -1;
@@ -232,7 +232,7 @@ namespace svt
return implGetControlProperty( pControl, aPropDesc->nPropertyId );
}
- weld::Widget* OControlAccess::implGetControl( const OUString& rControlName, sal_Int16* _pId, PropFlags* _pPropertyMask ) const
+ weld::Widget* OControlAccess::implGetControl( std::u16string_view rControlName, sal_Int16* _pId, PropFlags* _pPropertyMask ) const
{
weld::Widget* pControl = nullptr;
ControlDescription tmpDesc;
@@ -260,7 +260,7 @@ namespace svt
return pControl;
}
- void OControlAccess::setControlProperty( const OUString& rControlName, const OUString& rControlProperty, const css::uno::Any& rValue )
+ void OControlAccess::setControlProperty( std::u16string_view rControlName, const OUString& rControlProperty, const css::uno::Any& rValue )
{
// look up the control
sal_Int16 nControlId = -1;
@@ -292,7 +292,7 @@ namespace svt
return aControls;
}
- Sequence< OUString > OControlAccess::getSupportedControlProperties( const OUString& rControlName )
+ Sequence< OUString > OControlAccess::getSupportedControlProperties( std::u16string_view rControlName )
{
sal_Int16 nControlId = -1;
PropFlags nPropertyMask = PropFlags::NONE;
@@ -311,7 +311,7 @@ namespace svt
return aProps;
}
- bool OControlAccess::isControlSupported( const OUString& rControlName )
+ bool OControlAccess::isControlSupported( std::u16string_view rControlName )
{
ControlDescription tmpDesc;
OString aControlName = OUStringToOString(rControlName, RTL_TEXTENCODING_UTF8);
@@ -319,7 +319,7 @@ namespace svt
return ::std::binary_search( s_pControls, s_pControlsEnd, tmpDesc, ControlDescriptionLookup() );
}
- bool OControlAccess::isControlPropertySupported( const OUString& rControlName, const OUString& rControlProperty )
+ bool OControlAccess::isControlPropertySupported( std::u16string_view rControlName, const OUString& rControlProperty )
{
// look up the control
sal_Int16 nControlId = -1;
diff --git a/fpicker/source/office/OfficeControlAccess.hxx b/fpicker/source/office/OfficeControlAccess.hxx
index eabc3c3705c8..3495e95aedc3 100644
--- a/fpicker/source/office/OfficeControlAccess.hxx
+++ b/fpicker/source/office/OfficeControlAccess.hxx
@@ -20,6 +20,10 @@
#ifndef INCLUDED_FPICKER_SOURCE_OFFICE_OFFICECONTROLACCESS_HXX
#define INCLUDED_FPICKER_SOURCE_OFFICE_OFFICECONTROLACCESS_HXX
+#include <sal/config.h>
+
+#include <string_view>
+
#include "fileview.hxx"
#include "pickercallbacks.hxx"
#include <o3tl/typed_flags_set.hxx>
@@ -66,14 +70,14 @@ namespace svt
OControlAccess( IFilePickerController* pController, SvtFileView* pFileView );
// XControlAccess implementation
- void setControlProperty( const OUString& rControlName, const OUString& rControlProperty, const css::uno::Any& rValue );
- css::uno::Any getControlProperty( const OUString& rControlName, const OUString& rControlProperty );
+ void setControlProperty( std::u16string_view rControlName, const OUString& rControlProperty, const css::uno::Any& rValue );
+ css::uno::Any getControlProperty( std::u16string_view rControlName, const OUString& rControlProperty );
// XControlInformation implementation
css::uno::Sequence< OUString > getSupportedControls( ) const;
- css::uno::Sequence< OUString > getSupportedControlProperties( const OUString& rControlName );
- static bool isControlSupported( const OUString& rControlName );
- bool isControlPropertySupported( const OUString& rControlName, const OUString& rControlProperty );
+ css::uno::Sequence< OUString > getSupportedControlProperties( std::u16string_view rControlName );
+ static bool isControlSupported( std::u16string_view rControlName );
+ bool isControlPropertySupported( std::u16string_view rControlName, const OUString& rControlProperty );
// XFilePickerControlAccess
void setValue( sal_Int16 nId, sal_Int16 nCtrlAction, const css::uno::Any& rValue );
@@ -105,7 +109,7 @@ namespace svt
weld::Widget* pControl, PropFlags nProperty, const css::uno::Any& rValue,
bool bIgnoreIllegalArgument = true );
- weld::Widget* implGetControl( const OUString& rControlName, sal_Int16* pId, PropFlags* pPropertyMask = nullptr ) const;
+ weld::Widget* implGetControl( std::u16string_view rControlName, sal_Int16* pId, PropFlags* pPropertyMask = nullptr ) const;
/** implements the various methods for retrieving properties from controls