summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-12-28 17:56:40 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-12-29 16:42:33 +0100
commit042033f1e6da22616cb76c8d950c20c9efecbad5 (patch)
tree26b3f1f42d067506f44550b410f3fb9640616a5b /basctl
parentccfd8e9d09f9ac0a0ea92d0f378391006faaf934 (diff)
loplugin:stringviewparam: operator +
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'basctl')
-rw-r--r--basctl/qa/unit/basctl-dialogs-test.cxx2
-rw-r--r--basctl/source/basicide/bastype3.cxx4
-rw-r--r--basctl/source/basicide/bastypes.cxx18
-rw-r--r--basctl/source/basicide/localizationmgr.cxx37
-rw-r--r--basctl/source/basicide/moduldlg.cxx4
-rw-r--r--basctl/source/basicide/moduldlg.hxx6
-rw-r--r--basctl/source/inc/basidesh.hxx3
-rw-r--r--basctl/source/inc/bastypes.hxx13
-rw-r--r--basctl/source/inc/localizationmgr.hxx24
9 files changed, 65 insertions, 46 deletions
diff --git a/basctl/qa/unit/basctl-dialogs-test.cxx b/basctl/qa/unit/basctl-dialogs-test.cxx
index b907681f629d..3b58757f38dc 100644
--- a/basctl/qa/unit/basctl-dialogs-test.cxx
+++ b/basctl/qa/unit/basctl-dialogs-test.cxx
@@ -51,7 +51,7 @@ VclPtr<VclAbstractDialog> BasctlDialogsTest::createDialogByID(sal_uInt32 /*nID*/
void BasctlDialogsTest::openAnyDialog()
{
/// process input file containing the UXMLDescriptions of the dialogs to dump
- processDialogBatchFile("basctl/qa/unit/data/basctl-dialogs-test.txt");
+ processDialogBatchFile(u"basctl/qa/unit/data/basctl-dialogs-test.txt");
}
CPPUNIT_TEST_SUITE_REGISTRATION(BasctlDialogsTest);
diff --git a/basctl/source/basicide/bastype3.cxx b/basctl/source/basicide/bastype3.cxx
index 4318ad803306..5e409a267423 100644
--- a/basctl/source/basicide/bastype3.cxx
+++ b/basctl/source/basicide/bastype3.cxx
@@ -429,9 +429,9 @@ bool SbTreeListBox::FindRootEntry( const ScriptDocument& rDocument, LibraryLocat
return false;
}
-OUString CreateMgrAndLibStr( const OUString& rMgrName, const OUString& rLibName )
+OUString CreateMgrAndLibStr( std::u16string_view rMgrName, std::u16string_view rLibName )
{
- return "[" + rMgrName + "]." + rLibName;
+ return OUString::Concat("[") + rMgrName + "]." + rLibName;
}
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx
index 99a54894a3e8..0a4f2efc62cf 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <string_view>
+
#include <strings.hrc>
#include <helpids.h>
#include <iderid.hxx>
@@ -692,36 +696,36 @@ LibInfo::Item::Item (
m_eCurrentType(eCurrentType)
{ }
-static bool QueryDel(const OUString& rName, const OUString &rStr, weld::Widget* pParent)
+static bool QueryDel(std::u16string_view rName, const OUString &rStr, weld::Widget* pParent)
{
- OUString aName = "\'" + rName + "\'";
+ OUString aName = OUString::Concat("\'") + rName + "\'";
OUString aQuery = rStr.replaceAll("XX", aName);
std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pParent,
VclMessageType::Question, VclButtonsType::YesNo, aQuery));
return (xQueryBox->run() == RET_YES);
}
-bool QueryDelMacro( const OUString& rName, weld::Widget* pParent )
+bool QueryDelMacro( std::u16string_view rName, weld::Widget* pParent )
{
return QueryDel( rName, IDEResId( RID_STR_QUERYDELMACRO ), pParent );
}
-bool QueryReplaceMacro( const OUString& rName, weld::Widget* pParent )
+bool QueryReplaceMacro( std::u16string_view rName, weld::Widget* pParent )
{
return QueryDel( rName, IDEResId( RID_STR_QUERYREPLACEMACRO ), pParent );
}
-bool QueryDelDialog( const OUString& rName, weld::Widget* pParent )
+bool QueryDelDialog( std::u16string_view rName, weld::Widget* pParent )
{
return QueryDel( rName, IDEResId( RID_STR_QUERYDELDIALOG ), pParent );
}
-bool QueryDelLib( const OUString& rName, bool bRef, weld::Widget* pParent )
+bool QueryDelLib( std::u16string_view rName, bool bRef, weld::Widget* pParent )
{
return QueryDel( rName, IDEResId( bRef ? RID_STR_QUERYDELLIBREF : RID_STR_QUERYDELLIB ), pParent );
}
-bool QueryDelModule( const OUString& rName, weld::Widget* pParent )
+bool QueryDelModule( std::u16string_view rName, weld::Widget* pParent )
{
return QueryDel( rName, IDEResId( RID_STR_QUERYDELMODULE ), pParent );
}
diff --git a/basctl/source/basicide/localizationmgr.cxx b/basctl/source/basicide/localizationmgr.cxx
index 1e31f8a47d0f..72408cd61ac0 100644
--- a/basctl/source/basicide/localizationmgr.cxx
+++ b/basctl/source/basicide/localizationmgr.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <string_view>
+
#include <localizationmgr.hxx>
#include <basidesh.hxx>
@@ -146,7 +150,7 @@ void LocalizationMgr::implEnableDisableResourceForAllLibraryDialogs( HandleResou
Any aDialogCtrl;
aDialogCtrl <<= xDialog;
implHandleControlResourceProperties( aDialogCtrl, aDlgName,
- OUString(), m_xStringResourceManager, xDummyStringResolver, eMode );
+ std::u16string_view(), m_xStringResourceManager, xDummyStringResolver, eMode );
// Handle all controls
Sequence< OUString > aNames = xDialog->getElementNames();
@@ -166,7 +170,7 @@ void LocalizationMgr::implEnableDisableResourceForAllLibraryDialogs( HandleResou
static OUString implCreatePureResourceId
- ( const OUString& aDialogName, const OUString& aCtrlName,
+ ( std::u16string_view aDialogName, std::u16string_view aCtrlName,
const OUString& aPropName,
const Reference< XStringResourceManager >& xStringResourceManager )
{
@@ -175,7 +179,7 @@ static OUString implCreatePureResourceId
+ aDot
+ aDialogName
+ aDot;
- if( !aCtrlName.isEmpty() )
+ if( !aCtrlName.empty() )
{
aPureIdStr += aCtrlName + aDot;
}
@@ -187,7 +191,7 @@ static OUString implCreatePureResourceId
// anyway only one language should exist when calling this method then,
// either the first one for mode SET_IDS or the last one for mode RESET_IDS
sal_Int32 LocalizationMgr::implHandleControlResourceProperties
- (const Any& rControlAny, const OUString& aDialogName, const OUString& aCtrlName,
+ (const Any& rControlAny, std::u16string_view aDialogName, std::u16string_view aCtrlName,
const Reference< XStringResourceManager >& xStringResourceManager,
const Reference< XStringResourceResolver >& xSourceStringResolver, HandleResourceMode eMode )
{
@@ -791,7 +795,7 @@ static DialogWindow* FindDialogWindowForEditor( DlgEditor const * pEditor )
void LocalizationMgr::setControlResourceIDsForNewEditorObject( DlgEditor const * pEditor,
- const Any& rControlAny, const OUString& aCtrlName )
+ const Any& rControlAny, std::u16string_view aCtrlName )
{
// Get library for DlgEditor
DialogWindow* pDlgWin = FindDialogWindowForEditor( pEditor );
@@ -821,7 +825,7 @@ void LocalizationMgr::setControlResourceIDsForNewEditorObject( DlgEditor const *
}
void LocalizationMgr::renameControlResourceIDsForEditorObject( DlgEditor const * pEditor,
- const css::uno::Any& rControlAny, const OUString& aNewCtrlName )
+ const css::uno::Any& rControlAny, std::u16string_view aNewCtrlName )
{
// Get library for DlgEditor
DialogWindow* pDlgWin = FindDialogWindowForEditor( pEditor );
@@ -849,7 +853,7 @@ void LocalizationMgr::renameControlResourceIDsForEditorObject( DlgEditor const *
void LocalizationMgr::deleteControlResourceIDsForDeletedEditorObject( DlgEditor const * pEditor,
- const Any& rControlAny, const OUString& aCtrlName )
+ const Any& rControlAny, std::u16string_view aCtrlName )
{
// Get library for DlgEditor
DialogWindow* pDlgWin = FindDialogWindowForEditor( pEditor );
@@ -875,7 +879,7 @@ void LocalizationMgr::deleteControlResourceIDsForDeletedEditorObject( DlgEditor
}
void LocalizationMgr::setStringResourceAtDialog( const ScriptDocument& rDocument, const OUString& aLibName,
- const OUString& aDlgName, const Reference< container::XNameContainer >& xDialogModel )
+ std::u16string_view aDlgName, const Reference< container::XNameContainer >& xDialogModel )
{
// Get library
Reference< container::XNameContainer > xDialogLib( rDocument.getLibrary( E_DIALOGS, aLibName, true ) );
@@ -894,7 +898,7 @@ void LocalizationMgr::setStringResourceAtDialog( const ScriptDocument& rDocument
aDialogCtrl <<= xDialogModel;
Reference< XStringResourceResolver > xDummyStringResolver;
implHandleControlResourceProperties( aDialogCtrl, aDlgName,
- OUString(), xStringResourceManager,
+ std::u16string_view(), xStringResourceManager,
xDummyStringResolver, SET_IDS );
}
@@ -903,7 +907,7 @@ void LocalizationMgr::setStringResourceAtDialog( const ScriptDocument& rDocument
}
void LocalizationMgr::renameStringResourceIDs( const ScriptDocument& rDocument, const OUString& aLibName,
- const OUString& aDlgName, const Reference< container::XNameContainer >& xDialogModel )
+ std::u16string_view aDlgName, const Reference< container::XNameContainer >& xDialogModel )
{
// Get library
Reference< container::XNameContainer > xDialogLib( rDocument.getLibrary( E_DIALOGS, aLibName, true ) );
@@ -916,7 +920,7 @@ void LocalizationMgr::renameStringResourceIDs( const ScriptDocument& rDocument,
aDialogCtrl <<= xDialogModel;
Reference< XStringResourceResolver > xDummyStringResolver;
implHandleControlResourceProperties( aDialogCtrl, aDlgName,
- OUString(), xStringResourceManager,
+ std::u16string_view(), xStringResourceManager,
xDummyStringResolver, RENAME_DIALOG_IDS );
// Handle all controls
@@ -934,7 +938,7 @@ void LocalizationMgr::renameStringResourceIDs( const ScriptDocument& rDocument,
}
void LocalizationMgr::removeResourceForDialog( const ScriptDocument& rDocument, const OUString& aLibName,
- const OUString& aDlgName, const Reference< container::XNameContainer >& xDialogModel )
+ std::u16string_view aDlgName, const Reference< container::XNameContainer >& xDialogModel )
{
// Get library
Reference< container::XNameContainer > xDialogLib( rDocument.getLibrary( E_DIALOGS, aLibName, true ) );
@@ -947,7 +951,7 @@ void LocalizationMgr::removeResourceForDialog( const ScriptDocument& rDocument,
aDialogCtrl <<= xDialogModel;
Reference< XStringResourceResolver > xDummyStringResolver;
implHandleControlResourceProperties( aDialogCtrl, aDlgName,
- OUString(), xStringResourceManager,
+ std::u16string_view(), xStringResourceManager,
xDummyStringResolver, REMOVE_IDS_FROM_RESOURCE );
// Handle all controls
@@ -1019,7 +1023,7 @@ void LocalizationMgr::setResourceIDsForDialog( const Reference< container::XName
}
void LocalizationMgr::copyResourcesForPastedEditorObject( DlgEditor const * pEditor,
- const Any& rControlAny, const OUString& aCtrlName,
+ const Any& rControlAny, std::u16string_view aCtrlName,
const Reference< XStringResourceResolver >& xSourceStringResolver )
{
// Get library for DlgEditor
@@ -1046,7 +1050,8 @@ void LocalizationMgr::copyResourcesForPastedEditorObject( DlgEditor const * pEdi
}
void LocalizationMgr::copyResourceForDroppedDialog( const Reference< container::XNameContainer >& xDialogModel,
- const OUString& aDialogName, const Reference< XStringResourceManager >& xStringResourceManager,
+ std::u16string_view aDialogName,
+ const Reference< XStringResourceManager >& xStringResourceManager,
const Reference< XStringResourceResolver >& xSourceStringResolver )
{
if( !xStringResourceManager.is() )
@@ -1056,7 +1061,7 @@ void LocalizationMgr::copyResourceForDroppedDialog( const Reference< container::
Any aDialogCtrl;
aDialogCtrl <<= xDialogModel;
implHandleControlResourceProperties( aDialogCtrl, aDialogName,
- OUString(), xStringResourceManager, xSourceStringResolver, MOVE_RESOURCES );
+ std::u16string_view(), xStringResourceManager, xSourceStringResolver, MOVE_RESOURCES );
// Handle all controls
Sequence< OUString > aNames = xDialogModel->getElementNames();
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index 92c3ee9654ff..9f5daa34d644 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -133,7 +133,7 @@ void Shell::CopyDialogResources(
OUString const& rSourceLibName,
ScriptDocument const& rDestDoc,
OUString const& rDestLibName,
- OUString const& rDlgName
+ std::u16string_view rDlgName
)
{
if ( !io_xISP.is() )
@@ -906,7 +906,7 @@ LibDialog::~LibDialog()
{
}
-void LibDialog::SetStorageName( const OUString& rName )
+void LibDialog::SetStorageName( std::u16string_view rName )
{
OUString aName = IDEResId(RID_STR_FILENAME) + rName;
m_xStorageFrame->set_label(aName);
diff --git a/basctl/source/basicide/moduldlg.hxx b/basctl/source/basicide/moduldlg.hxx
index 37e3d9556185..b7fb13d8901e 100644
--- a/basctl/source/basicide/moduldlg.hxx
+++ b/basctl/source/basicide/moduldlg.hxx
@@ -19,6 +19,10 @@
#pragma once
+#include <sal/config.h>
+
+#include <string_view>
+
#include <bastype2.hxx>
#include <tools/solar.h>
#include <vcl/weld.hxx>
@@ -94,7 +98,7 @@ public:
explicit LibDialog(weld::Window* pParent);
virtual ~LibDialog() override;
- void SetStorageName( const OUString& rName );
+ void SetStorageName( std::u16string_view rName );
weld::TreeView& GetLibBox() { return *m_xLibBox; }
bool IsReference() const { return m_xReferenceBox->get_active(); }
diff --git a/basctl/source/inc/basidesh.hxx b/basctl/source/inc/basidesh.hxx
index d8fe56feb43c..f3127186ce93 100644
--- a/basctl/source/inc/basidesh.hxx
+++ b/basctl/source/inc/basidesh.hxx
@@ -29,6 +29,7 @@
#include <vcl/scrbar.hxx>
#include <map>
#include <memory>
+#include <string_view>
class SfxViewFactory;
class SdrView;
@@ -197,7 +198,7 @@ public:
static void CopyDialogResources(
css::uno::Reference< css::io::XInputStreamProvider >& io_xISP,
const ScriptDocument& rSourceDoc, const OUString& rSourceLibName, const ScriptDocument& rDestDoc,
- const OUString& rDestLibName, const OUString& rDlgName );
+ const OUString& rDestLibName, std::u16string_view rDlgName );
static void InvalidateControlSlots();
diff --git a/basctl/source/inc/bastypes.hxx b/basctl/source/inc/bastypes.hxx
index 21e6c0227a9c..fecebced52ee 100644
--- a/basctl/source/inc/bastypes.hxx
+++ b/basctl/source/inc/bastypes.hxx
@@ -26,6 +26,7 @@
#include <vcl/dockwin.hxx>
#include <vcl/weld.hxx>
+#include <string_view>
#include <unordered_map>
class SbModule;
@@ -288,14 +289,14 @@ private:
};
void CutLines( OUString& rStr, sal_Int32 nStartLine, sal_Int32 nLines );
-OUString CreateMgrAndLibStr( const OUString& rMgrName, const OUString& rLibName );
+OUString CreateMgrAndLibStr( std::u16string_view rMgrName, std::u16string_view rLibName );
sal_uInt32 CalcLineCount( SvStream& rStream );
-bool QueryReplaceMacro( const OUString& rName, weld::Widget* pParent );
-bool QueryDelMacro( const OUString& rName, weld::Widget* pParent );
-bool QueryDelDialog( const OUString& rName, weld::Widget* pParent );
-bool QueryDelModule( const OUString& rName, weld::Widget* pParent );
-bool QueryDelLib( const OUString& rName, bool bRef, weld::Widget* pParent );
+bool QueryReplaceMacro( std::u16string_view rName, weld::Widget* pParent );
+bool QueryDelMacro( std::u16string_view rName, weld::Widget* pParent );
+bool QueryDelDialog( std::u16string_view rName, weld::Widget* pParent );
+bool QueryDelModule( std::u16string_view rName, weld::Widget* pParent );
+bool QueryDelLib( std::u16string_view rName, bool bRef, weld::Widget* pParent );
bool QueryPassword(weld::Widget* pDialogParent, const css::uno::Reference< css::script::XLibraryContainer >& xLibContainer, const OUString& rLibName, OUString& rPassword, bool bRepeat = false, bool bNewTitle = false);
class ModuleInfoHelper
diff --git a/basctl/source/inc/localizationmgr.hxx b/basctl/source/inc/localizationmgr.hxx
index 4b72a7d8e58d..847ef0f75729 100644
--- a/basctl/source/inc/localizationmgr.hxx
+++ b/basctl/source/inc/localizationmgr.hxx
@@ -19,6 +19,10 @@
#pragma once
+#include <sal/config.h>
+
+#include <string_view>
+
#include "scriptdocument.hxx"
#include <com/sun/star/resource/XStringResourceManager.hpp>
@@ -51,8 +55,8 @@ class LocalizationMgr
COPY_RESOURCES
};
static sal_Int32 implHandleControlResourceProperties(const css::uno::Any& rControlAny,
- const OUString& aDialogName,
- const OUString& aCtrlName,
+ std::u16string_view aDialogName,
+ std::u16string_view aCtrlName,
const css::uno::Reference< css::resource::XStringResourceManager >& xStringResourceManager,
const css::uno::Reference< css::resource::XStringResourceResolver >& xSourceStringResolver,
HandleResourceMode eMode );
@@ -95,21 +99,21 @@ public:
void handleBasicStopped();
static void setControlResourceIDsForNewEditorObject(DlgEditor const * pEditor,
- const css::uno::Any& rControlAny, const OUString& aCtrlName);
+ const css::uno::Any& rControlAny, std::u16string_view aCtrlName);
static void renameControlResourceIDsForEditorObject(DlgEditor const * pEditor,
- const css::uno::Any& rControlAny, const OUString& aNewCtrlName);
+ const css::uno::Any& rControlAny, std::u16string_view aNewCtrlName);
static void deleteControlResourceIDsForDeletedEditorObject(DlgEditor const * pEditor,
- const css::uno::Any& rControlAny, const OUString& aCtrlName);
+ const css::uno::Any& rControlAny, std::u16string_view aCtrlName);
- static void setStringResourceAtDialog( const ScriptDocument& rDocument, const OUString& aLibName, const OUString& aDlgName,
+ static void setStringResourceAtDialog( const ScriptDocument& rDocument, const OUString& aLibName, std::u16string_view aDlgName,
const css::uno::Reference< css::container::XNameContainer >& xDialogModel );
- static void renameStringResourceIDs( const ScriptDocument& rDocument, const OUString& aLibName, const OUString& aDlgName,
+ static void renameStringResourceIDs( const ScriptDocument& rDocument, const OUString& aLibName, std::u16string_view aDlgName,
const css::uno::Reference< css::container::XNameContainer >& xDialogModel );
- static void removeResourceForDialog( const ScriptDocument& rDocument, const OUString& aLibName, const OUString& aDlgName,
+ static void removeResourceForDialog( const ScriptDocument& rDocument, const OUString& aLibName, std::u16string_view aDlgName,
const css::uno::Reference< css::container::XNameContainer >& xDialogModel );
static css::uno::Reference< css::resource::XStringResourceManager >
@@ -125,12 +129,12 @@ public:
const css::uno::Reference< css::resource::XStringResourceManager >& xStringResourceManager );
static void copyResourcesForPastedEditorObject( DlgEditor const * pEditor,
- const css::uno::Any& rControlAny, const OUString& aCtrlName,
+ const css::uno::Any& rControlAny, std::u16string_view aCtrlName,
const css::uno::Reference< css::resource::XStringResourceResolver >& xSourceStringResolver );
static void copyResourceForDroppedDialog(
const css::uno::Reference< css::container::XNameContainer >& xDialogModel,
- const OUString& aDialogName,
+ std::u16string_view aDialogName,
const css::uno::Reference< css::resource::XStringResourceManager >& xStringResourceManager,
const css::uno::Reference< css::resource::XStringResourceResolver >& xSourceStringResolver );