summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-11-13 14:29:59 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-11-17 09:57:35 +0100
commit8ef6067596cf4b2c52fbce94b44bf7af9fefa643 (patch)
treef4cca1a99ba97683b14fa6fe0f1f45f75bf855c2 /dbaccess
parent75bada928cf08d2afc6efe52ba99b45088bc9eec (diff)
loplugin:stringviewparam check methods too
not just functions Change-Id: Icca295dd159002b428b73f2c95d40725434f04d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105789 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/inc/core_resource.hxx6
-rw-r--r--dbaccess/source/core/dataaccess/databasedocument.cxx2
-rw-r--r--dbaccess/source/core/dataaccess/databasedocument.hxx2
-rw-r--r--dbaccess/source/core/dataaccess/databaseregistrations.cxx6
-rw-r--r--dbaccess/source/core/resource/core_resource.cxx6
-rw-r--r--dbaccess/source/ui/dlg/generalpage.cxx4
-rw-r--r--dbaccess/source/ui/dlg/generalpage.hxx2
-rw-r--r--dbaccess/source/ui/inc/WCopyTable.hxx2
-rw-r--r--dbaccess/source/ui/misc/WCopyTable.cxx2
9 files changed, 16 insertions, 16 deletions
diff --git a/dbaccess/inc/core_resource.hxx b/dbaccess/inc/core_resource.hxx
index 8cddf133f029..0e1e80ee3efd 100644
--- a/dbaccess/inc/core_resource.hxx
+++ b/dbaccess/inc/core_resource.hxx
@@ -54,7 +54,7 @@ namespace dbaccess
static OUString loadString(
const char* pResId,
const char* _pPlaceholderAscii,
- const OUString& _rReplace
+ std::u16string_view _rReplace
);
/** loads a string from the resource file, substituting two placeholders with given strings
@@ -73,9 +73,9 @@ namespace dbaccess
static OUString loadString(
const char* pResId,
const char* _pPlaceholderAscii1,
- const OUString& _rReplace1,
+ std::u16string_view _rReplace1,
const char* _pPlaceholderAscii2,
- const OUString& _rReplace2
+ std::u16string_view _rReplace2
);
};
}
diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx
index 4e9bde5f31d2..1cb595279f20 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -991,7 +991,7 @@ void SAL_CALL ODatabaseDocument::store( )
}
}
-void ODatabaseDocument::impl_throwIOExceptionCausedBySave_throw( const Any& i_rError, const OUString& i_rTargetURL ) const
+void ODatabaseDocument::impl_throwIOExceptionCausedBySave_throw( const Any& i_rError, std::u16string_view i_rTargetURL ) const
{
OUString sErrorMessage = extractExceptionMessage( m_pImpl->m_aContext, i_rError );
sErrorMessage = ResourceManager::loadString(
diff --git a/dbaccess/source/core/dataaccess/databasedocument.hxx b/dbaccess/source/core/dataaccess/databasedocument.hxx
index 1ed509c27d60..6ce35092ea5b 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.hxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.hxx
@@ -625,7 +625,7 @@ private:
*/
void impl_throwIOExceptionCausedBySave_throw(
const css::uno::Any& i_rError,
- const OUString& i_rTargetURL
+ std::u16string_view i_rTargetURL
) const;
};
diff --git a/dbaccess/source/core/dataaccess/databaseregistrations.cxx b/dbaccess/source/core/dataaccess/databaseregistrations.cxx
index c147f99ec694..3e9b59551546 100644
--- a/dbaccess/source/core/dataaccess/databaseregistrations.cxx
+++ b/dbaccess/source/core/dataaccess/databaseregistrations.cxx
@@ -94,7 +94,7 @@ namespace dbaccess
private:
void
- impl_checkValidName_common(const OUString& _rName);
+ impl_checkValidName_common(std::u16string_view _rName);
::utl::OConfigurationNode
impl_checkValidName_throw_must_exist(const OUString& _rName);
::utl::OConfigurationNode
@@ -201,12 +201,12 @@ namespace dbaccess
return aNewNode;
}
- void DatabaseRegistrations::impl_checkValidName_common(const OUString& _rName)
+ void DatabaseRegistrations::impl_checkValidName_common(std::u16string_view _rName)
{
if ( !m_aConfigurationRoot.isValid() )
throw RuntimeException( OUString(), *this );
- if ( _rName.isEmpty() )
+ if ( _rName.empty() )
throw IllegalArgumentException( OUString(), *this, 1 );
}
diff --git a/dbaccess/source/core/resource/core_resource.cxx b/dbaccess/source/core/resource/core_resource.cxx
index 34ab1b0ba829..cecf7d3b4773 100644
--- a/dbaccess/source/core/resource/core_resource.cxx
+++ b/dbaccess/source/core/resource/core_resource.cxx
@@ -38,14 +38,14 @@ namespace dbaccess
return Translate::get(pResId, Translate::Create("dba"));
}
- OUString ResourceManager::loadString(const char* pResId, const char* _pPlaceholderAscii, const OUString& _rReplace)
+ OUString ResourceManager::loadString(const char* pResId, const char* _pPlaceholderAscii, std::u16string_view _rReplace)
{
OUString sString(loadString(pResId));
return sString.replaceFirst( OUString::createFromAscii(_pPlaceholderAscii), _rReplace );
}
- OUString ResourceManager::loadString(const char* pResId, const char* _pPlaceholderAscii1, const OUString& _rReplace1,
- const char* _pPlaceholderAscii2, const OUString& _rReplace2)
+ OUString ResourceManager::loadString(const char* pResId, const char* _pPlaceholderAscii1, std::u16string_view _rReplace1,
+ const char* _pPlaceholderAscii2, std::u16string_view _rReplace2)
{
OUString sString(loadString(pResId));
sString = sString.replaceFirst( OUString::createFromAscii(_pPlaceholderAscii1), _rReplace1 );
diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx
index 37ac9c5c1ae5..d61032fd4919 100644
--- a/dbaccess/source/ui/dlg/generalpage.cxx
+++ b/dbaccess/source/ui/dlg/generalpage.cxx
@@ -171,10 +171,10 @@ namespace dbaui
{
}
- void OGeneralPage::switchMessage(const OUString& _sURLPrefix)
+ void OGeneralPage::switchMessage(std::u16string_view _sURLPrefix)
{
SPECIAL_MESSAGE eMessage = smNone;
- if ( _sURLPrefix.isEmpty()/*_eType == m_eNotSupportedKnownType*/ )
+ if ( _sURLPrefix.empty()/*_eType == m_eNotSupportedKnownType*/ )
{
eMessage = smUnsupportedType;
}
diff --git a/dbaccess/source/ui/dlg/generalpage.hxx b/dbaccess/source/ui/dlg/generalpage.hxx
index 68e7a90cbfa0..452817a056cf 100644
--- a/dbaccess/source/ui/dlg/generalpage.hxx
+++ b/dbaccess/source/ui/dlg/generalpage.hxx
@@ -90,7 +90,7 @@ namespace dbaui
void implSetCurrentType( const OUString& _eType );
- void switchMessage(const OUString& _sURLPrefix);
+ void switchMessage(std::u16string_view _sURLPrefix);
/// sets the title of the parent dialog
virtual void setParentTitle( const OUString& _sURLPrefix );
diff --git a/dbaccess/source/ui/inc/WCopyTable.hxx b/dbaccess/source/ui/inc/WCopyTable.hxx
index 6307234e89de..1d650d7a6171 100644
--- a/dbaccess/source/ui/inc/WCopyTable.hxx
+++ b/dbaccess/source/ui/inc/WCopyTable.hxx
@@ -402,7 +402,7 @@ namespace dbaui
OUString createUniqueName(const OUString& _sName);
// displays an error message that a column type is not supported
- void showColumnTypeNotSupported(const OUString& _rColumnName);
+ void showColumnTypeNotSupported(std::u16string_view _rColumnName);
void removeColumnNameFromNameMap(const OUString& _sName);
void showError(const OUString& _sErrorMessage);
diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx
index 373a17907952..9c92f1301c71 100644
--- a/dbaccess/source/ui/misc/WCopyTable.cxx
+++ b/dbaccess/source/ui/misc/WCopyTable.cxx
@@ -1525,7 +1525,7 @@ OUString OCopyTableWizard::createUniqueName(const OUString& _sName)
return sName;
}
-void OCopyTableWizard::showColumnTypeNotSupported(const OUString& _rColumnName)
+void OCopyTableWizard::showColumnTypeNotSupported(std::u16string_view _rColumnName)
{
OUString sMessage( DBA_RES( STR_UNKNOWN_TYPE_FOUND ) );
sMessage = sMessage.replaceFirst("#1",_rColumnName);