diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-23 07:36:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-23 08:39:10 +0200 |
commit | 44688e498c9672f0a1759ead394f6d6e0f0ef5fd (patch) | |
tree | f2f1b33f882ced5c23c2854177c9b266c907ac56 /basctl | |
parent | b0c6d587405af9e2263dc5073a9a965db46ff986 (diff) |
clang-tidy performance-unnecessary-copy-initialization in
basctl..basic
Change-Id: I4009282869cd8a2f269093564bd4fafccab80ec3
Reviewed-on: https://gerrit.libreoffice.org/62212
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/accessibility/accessibledialogwindow.cxx | 2 | ||||
-rw-r--r-- | basctl/source/basicide/basicbox.cxx | 4 | ||||
-rw-r--r-- | basctl/source/basicide/baside2b.cxx | 3 | ||||
-rw-r--r-- | basctl/source/basicide/baside3.cxx | 2 | ||||
-rw-r--r-- | basctl/source/basicide/basides1.cxx | 8 | ||||
-rw-r--r-- | basctl/source/basicide/basobj3.cxx | 6 | ||||
-rw-r--r-- | basctl/source/basicide/bastype2.cxx | 22 | ||||
-rw-r--r-- | basctl/source/basicide/bastype3.cxx | 14 | ||||
-rw-r--r-- | basctl/source/basicide/macrodlg.cxx | 24 | ||||
-rw-r--r-- | basctl/source/basicide/moduldl2.cxx | 6 | ||||
-rw-r--r-- | basctl/source/basicide/moduldlg.cxx | 36 | ||||
-rw-r--r-- | basctl/source/dlged/managelang.cxx | 2 |
12 files changed, 64 insertions, 65 deletions
diff --git a/basctl/source/accessibility/accessibledialogwindow.cxx b/basctl/source/accessibility/accessibledialogwindow.cxx index 177c79a8eed0..3c5987a2cb28 100644 --- a/basctl/source/accessibility/accessibledialogwindow.cxx +++ b/basctl/source/accessibility/accessibledialogwindow.cxx @@ -180,7 +180,7 @@ bool AccessibleDialogWindow::IsChildVisible( const ChildDescriptor& rDesc ) const SdrLayer* pSdrLayer = rLayerAdmin.GetLayerPerID( nLayerId ); if ( pSdrLayer ) { - OUString aLayerName = pSdrLayer->GetName(); + const OUString& aLayerName = pSdrLayer->GetName(); SdrView& rView = m_pDialogWindow->GetView(); if (rView.IsLayerVisible(aLayerName)) { diff --git a/basctl/source/basicide/basicbox.cxx b/basctl/source/basicide/basicbox.cxx index dd5eb2f36fdf..15fa69537a74 100644 --- a/basctl/source/basicide/basicbox.cxx +++ b/basctl/source/basicide/basicbox.cxx @@ -300,9 +300,9 @@ void LibBox::NotifyIDE() sal_Int32 nSelPos = GetSelectedEntryPos(); if (LibEntry* pEntry = static_cast<LibEntry*>(GetEntryData(nSelPos))) { - ScriptDocument aDocument( pEntry->GetDocument() ); + const ScriptDocument& aDocument( pEntry->GetDocument() ); SfxUnoAnyItem aDocumentItem( SID_BASICIDE_ARG_DOCUMENT_MODEL, uno::Any( aDocument.getDocumentOrNull() ) ); - OUString aLibName = pEntry->GetLibName(); + const OUString& aLibName = pEntry->GetLibName(); SfxStringItem aLibNameItem( SID_BASICIDE_ARG_LIBNAME, aLibName ); if (SfxDispatcher* pDispatcher = GetDispatcher()) pDispatcher->ExecuteList( diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index 627c62eb0ec9..bc0e4c3b7ba1 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -2485,8 +2485,7 @@ void WatchTreeListBox::UpdateWatches( bool bBasicStopped ) for( sal_uInt16 i = 0 ; i < nPropCount - 3 ; i++ ) { SbxVariable* pVar_ = pProps->Get( i ); - OUString aName( pVar_->GetName() ); - if( pItem->maMemberList[i] != aName ) + if( pItem->maMemberList[i] != pVar_->GetName() ) { bObjChanged = true; break; diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx index 1e216698d1d9..8a88185516b7 100644 --- a/basctl/source/basicide/baside3.cxx +++ b/basctl/source/basicide/baside3.cxx @@ -983,7 +983,7 @@ bool implImportDialog(weld::Window* pWin, const OUString& rCurPath, const Script bool bCopyResourcesForDialog = true; if( bAddDialogLanguagesToLib ) { - std::shared_ptr<LocalizationMgr> pCurMgr = pShell->GetCurLocalizationMgr(); + const std::shared_ptr<LocalizationMgr>& pCurMgr = pShell->GetCurLocalizationMgr(); lang::Locale aFirstLocale; aFirstLocale = aOnlyInImportLanguages[0]; diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx index 007269ec71ad..1159777d9037 100644 --- a/basctl/source/basicide/basides1.cxx +++ b/basctl/source/basicide/basides1.cxx @@ -416,7 +416,7 @@ void Shell::ExecuteGlobal( SfxRequest& rReq ) bool bRenameOk = false; if (ModulWindow* pModWin = dynamic_cast<ModulWindow*>(pWin.get())) { - OUString aLibName = pModWin->GetLibName(); + const OUString& aLibName = pModWin->GetLibName(); ScriptDocument aDocument( pWin->GetDocument() ); if (RenameModule(pModWin->GetFrameWeld(), aDocument, aLibName, aOldName, aNewName)) @@ -625,7 +625,7 @@ void Shell::ExecuteGlobal( SfxRequest& rReq ) const SfxStringItem* pDocumentItem = rReq.GetArg<SfxStringItem>(SID_BASICIDE_ARG_DOCUMENT); if ( pDocumentItem ) { - OUString sDocumentCaption = pDocumentItem->GetValue(); + const OUString& sDocumentCaption = pDocumentItem->GetValue(); if ( !sDocumentCaption.isEmpty() ) pDocument.reset( new ScriptDocument( ScriptDocument::getDocumentWithURLOrCaption( sDocumentCaption ) ) ); } @@ -651,7 +651,7 @@ void Shell::ExecuteGlobal( SfxRequest& rReq ) const SfxStringItem* pNameItem = rReq.GetArg<SfxStringItem>(SID_BASICIDE_ARG_NAME); if ( pNameItem ) { - OUString aName( pNameItem->GetValue() ); + const OUString& aName( pNameItem->GetValue() ); OUString aModType( "Module" ); OUString aType( aModType ); const SfxStringItem* pTypeItem = rReq.GetArg<SfxStringItem>(SID_BASICIDE_ARG_TYPE); @@ -1297,7 +1297,7 @@ VclPtr<ModulWindow> Shell::ShowActiveModuleWindow( StarBASIC const * pBasic ) if (BasicManager* pBasMgr = FindBasicManager(pLib)) { ScriptDocument aDocument( ScriptDocument::getDocumentForBasicManager( pBasMgr ) ); - OUString aLibName = pLib->GetName(); + const OUString& aLibName = pLib->GetName(); pWin = FindBasWin( aDocument, aLibName, pActiveModule->GetName(), true ); DBG_ASSERT( pWin, "Error/Step-Hdl: Window was not created/found!" ); SetCurLib( aDocument, aLibName ); diff --git a/basctl/source/basicide/basobj3.cxx b/basctl/source/basicide/basobj3.cxx index 3ac49d89e2aa..4b4391bbcf95 100644 --- a/basctl/source/basicide/basobj3.cxx +++ b/basctl/source/basicide/basobj3.cxx @@ -110,8 +110,8 @@ SbMethod* CreateMacro( SbModule* pModule, const OUString& rMacroName ) if (aDocument.isValid()) { - OUString aLibName = pBasic->GetName(); - OUString aModName = pModule->GetName(); + const OUString& aLibName = pBasic->GetName(); + const OUString& aModName = pModule->GetName(); OSL_VERIFY( aDocument.updateModule( aLibName, aModName, aOUSource ) ); } @@ -378,7 +378,7 @@ long HandleBasicError( StarBASIC const * pBasic ) OSL_ENSURE( aDocument.isValid(), "basctl::HandleBasicError: no document for the given BasicManager!" ); if ( aDocument.isValid() ) { - OUString aOULibName( pBasic->GetName() ); + const OUString& aOULibName( pBasic->GetName() ); Reference< script::XLibraryContainer > xModLibContainer( aDocument.getLibraryContainer( E_SCRIPTS ) ); if ( xModLibContainer.is() && xModLibContainer->hasByName( aOULibName ) ) { diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx index 5997980df2ea..b3efc5d4209a 100644 --- a/basctl/source/basicide/bastype2.cxx +++ b/basctl/source/basicide/bastype2.cxx @@ -638,14 +638,14 @@ bool TreeListBox::ExpandingHdl() { SvTreeListEntry* pCurEntry = GetCurEntry(); EntryDescriptor aDesc( GetEntryDescriptor( pCurEntry ) ); - ScriptDocument aDocument( aDesc.GetDocument() ); + const ScriptDocument& aDocument( aDesc.GetDocument() ); OSL_ENSURE( aDocument.isAlive(), "TreeListBox::ExpandingHdl: no document, or document is dead!" ); if ( aDocument.isAlive() ) { - OUString aLibName( aDesc.GetLibName() ); - OUString aLibSubName( aDesc.GetLibSubName() ); - OUString aName( aDesc.GetName() ); - OUString aMethodName( aDesc.GetMethodName() ); + const OUString& aLibName( aDesc.GetLibName() ); + const OUString& aLibSubName( aDesc.GetLibSubName() ); + const OUString& aName( aDesc.GetName() ); + const OUString& aMethodName( aDesc.GetMethodName() ); if ( !aLibName.isEmpty() && aLibSubName.isEmpty() && aName.isEmpty() && aMethodName.isEmpty() ) { @@ -672,11 +672,11 @@ bool TreeListBox::IsEntryProtected( SvTreeListEntry* pEntry ) if ( pEntry && ( GetModel()->GetDepth( pEntry ) == 1 ) ) { EntryDescriptor aDesc( GetEntryDescriptor( pEntry ) ); - ScriptDocument aDocument( aDesc.GetDocument() ); + const ScriptDocument& aDocument( aDesc.GetDocument() ); OSL_ENSURE( aDocument.isAlive(), "TreeListBox::IsEntryProtected: no document, or document is dead!" ); if ( aDocument.isAlive() ) { - OUString aOULibName( aDesc.GetLibName() ); + const OUString& aOULibName( aDesc.GetLibName() ); Reference< script::XLibraryContainer > xModLibContainer( aDocument.getLibraryContainer( E_SCRIPTS ) ); if ( xModLibContainer.is() && xModLibContainer->hasByName( aOULibName ) ) { @@ -799,7 +799,7 @@ void TreeListBox::SetCurrentEntry (EntryDescriptor const & rDesc) if ( pRootEntry ) { pCurEntry = pRootEntry; - OUString aLibName( aDesc.GetLibName() ); + const OUString& aLibName( aDesc.GetLibName() ); if ( !aLibName.isEmpty() ) { Expand( pRootEntry ); @@ -807,7 +807,7 @@ void TreeListBox::SetCurrentEntry (EntryDescriptor const & rDesc) if ( pLibEntry ) { pCurEntry = pLibEntry; - OUString aLibSubName( aDesc.GetLibSubName() ); + const OUString& aLibSubName( aDesc.GetLibSubName() ); if( !aLibSubName.isEmpty() ) { Expand( pLibEntry ); @@ -817,7 +817,7 @@ void TreeListBox::SetCurrentEntry (EntryDescriptor const & rDesc) pCurEntry = pLibSubEntry; } } - OUString aName( aDesc.GetName() ); + const OUString& aName( aDesc.GetName() ); if ( !aName.isEmpty() ) { Expand( pCurEntry ); @@ -828,7 +828,7 @@ void TreeListBox::SetCurrentEntry (EntryDescriptor const & rDesc) if ( pEntry ) { pCurEntry = pEntry; - OUString aMethodName( aDesc.GetMethodName() ); + const OUString& aMethodName( aDesc.GetMethodName() ); if ( !aMethodName.isEmpty() ) { Expand( pEntry ); diff --git a/basctl/source/basicide/bastype3.cxx b/basctl/source/basicide/bastype3.cxx index 2b8e3f79d8e3..ba00c2516488 100644 --- a/basctl/source/basicide/bastype3.cxx +++ b/basctl/source/basicide/bastype3.cxx @@ -41,7 +41,7 @@ typedef std::deque< SvTreeListEntry* > EntryArray; void TreeListBox::RequestingChildren( SvTreeListEntry* pEntry ) { EntryDescriptor aDesc = GetEntryDescriptor(pEntry); - ScriptDocument aDocument = aDesc.GetDocument(); + const ScriptDocument& aDocument = aDesc.GetDocument(); OSL_ENSURE( aDocument.isAlive(), "basctl::TreeListBox::RequestingChildren: invalid document!" ); if ( !aDocument.isAlive() ) return; @@ -55,7 +55,7 @@ void TreeListBox::RequestingChildren( SvTreeListEntry* pEntry ) } else if ( eType == OBJ_TYPE_LIBRARY ) { - OUString aOULibName( aDesc.GetLibName() ); + const OUString& aOULibName( aDesc.GetLibName() ); // check password bool bOK = true; @@ -120,7 +120,7 @@ void TreeListBox::RequestingChildren( SvTreeListEntry* pEntry ) || eType == OBJ_TYPE_NORMAL_MODULES || eType == OBJ_TYPE_CLASS_MODULES ) { - OUString aLibName( aDesc.GetLibName() ); + const OUString& aLibName( aDesc.GetLibName() ); ImpCreateLibSubSubEntriesInVBAMode( pEntry, aDocument, aLibName ); } else { @@ -369,11 +369,11 @@ bool TreeListBox::IsValidEntry( SvTreeListEntry* pEntry ) bool bIsValid = false; EntryDescriptor aDesc( GetEntryDescriptor( pEntry ) ); - ScriptDocument aDocument( aDesc.GetDocument() ); + const ScriptDocument& aDocument( aDesc.GetDocument() ); LibraryLocation eLocation( aDesc.GetLocation() ); - OUString aLibName( aDesc.GetLibName() ); - OUString aName( aDesc.GetName() ); - OUString aMethodName( aDesc.GetMethodName() ); + const OUString& aLibName( aDesc.GetLibName() ); + const OUString& aName( aDesc.GetName() ); + const OUString& aMethodName( aDesc.GetMethodName() ); EntryType eType( aDesc.GetType() ); switch ( eType ) diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx index ca0b9161de7d..25f94c59c12e 100644 --- a/basctl/source/basicide/macrodlg.cxx +++ b/basctl/source/basicide/macrodlg.cxx @@ -324,7 +324,7 @@ SbMethod* MacroChooser::CreateMacro() SbMethod* pMethod = nullptr; SvTreeListEntry* pCurEntry = m_pBasicBox->GetCurEntry(); EntryDescriptor aDesc = m_pBasicBox->GetEntryDescriptor(pCurEntry); - ScriptDocument aDocument( aDesc.GetDocument() ); + const ScriptDocument& aDocument( aDesc.GetDocument() ); OSL_ENSURE( aDocument.isAlive(), "MacroChooser::CreateMacro: no document!" ); if ( !aDocument.isAlive() ) return nullptr; @@ -403,8 +403,8 @@ void MacroChooser::CheckButtons() sal_uInt16 nDepth = pCurEntry ? m_pBasicBox->GetModel()->GetDepth( pCurEntry ) : 0; if ( nDepth == 1 || nDepth == 2 ) { - ScriptDocument aDocument( aDesc.GetDocument() ); - OUString aOULibName( aDesc.GetLibName() ); + const ScriptDocument& aDocument( aDesc.GetDocument() ); + const OUString& aOULibName( aDesc.GetLibName() ); Reference< script::XLibraryContainer2 > xModLibContainer( aDocument.getLibraryContainer( E_SCRIPTS ), UNO_QUERY ); Reference< script::XLibraryContainer2 > xDlgLibContainer( aDocument.getLibraryContainer( E_DIALOGS ), UNO_QUERY ); if ( ( xModLibContainer.is() && xModLibContainer->hasByName( aOULibName ) && xModLibContainer->isLibraryReadOnly( aOULibName ) ) || @@ -659,12 +659,12 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton, void ) { SvTreeListEntry* pCurEntry = m_pBasicBox->GetCurEntry(); EntryDescriptor aDesc = m_pBasicBox->GetEntryDescriptor(pCurEntry); - ScriptDocument aDocument( aDesc.GetDocument() ); + const ScriptDocument& aDocument( aDesc.GetDocument() ); DBG_ASSERT( aDocument.isAlive(), "MacroChooser::ButtonHdl: no document, or document is dead!" ); if ( !aDocument.isAlive() ) return; BasicManager* pBasMgr = aDocument.getBasicManager(); - OUString aLib( aDesc.GetLibName() ); + const OUString& aLib( aDesc.GetLibName() ); OUString aMod( aDesc.GetName() ); // extract the module name from the string like "Sheet1 (Example1)" if( aDesc.GetLibSubName() == IDEResId(RID_STR_DOCUMENT_OBJECTS) ) @@ -672,7 +672,7 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton, void ) sal_Int32 nIndex = 0; aMod = aMod.getToken( 0, ' ', nIndex ); } - OUString aSub( aDesc.GetMethodName() ); + const OUString& aSub( aDesc.GetMethodName() ); SfxMacroInfoItem aInfoItem( SID_BASICIDE_ARG_MACROINFO, pBasMgr, aLib, aMod, aSub, OUString() ); if (pButton == m_pEditButton) { @@ -742,13 +742,13 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton, void ) { SvTreeListEntry* pCurEntry = m_pBasicBox->GetCurEntry(); EntryDescriptor aDesc = m_pBasicBox->GetEntryDescriptor(pCurEntry); - ScriptDocument aDocument( aDesc.GetDocument() ); + const ScriptDocument& aDocument( aDesc.GetDocument() ); DBG_ASSERT( aDocument.isAlive(), "MacroChooser::ButtonHdl: no document, or document is dead!" ); if ( !aDocument.isAlive() ) return; BasicManager* pBasMgr = aDocument.getBasicManager(); - OUString aLib( aDesc.GetLibName() ); - OUString aMod( aDesc.GetName() ); + const OUString& aLib( aDesc.GetLibName() ); + const OUString& aMod( aDesc.GetName() ); OUString aSub( m_pMacroNameEdit->GetText() ); SbMethod* pMethod = GetMacro(); DBG_ASSERT( pBasMgr, "BasMgr?" ); @@ -769,15 +769,15 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton, void ) { SvTreeListEntry* pCurEntry = m_pBasicBox->GetCurEntry(); EntryDescriptor aDesc = m_pBasicBox->GetEntryDescriptor(pCurEntry); - ScriptDocument aDocument( aDesc.GetDocument() ); + const ScriptDocument& aDocument( aDesc.GetDocument() ); createLibImpl(GetFrameWeld(), aDocument, nullptr, m_pBasicBox); } else if (pButton == m_pNewModButton) { SvTreeListEntry* pCurEntry = m_pBasicBox->GetCurEntry(); EntryDescriptor aDesc = m_pBasicBox->GetEntryDescriptor(pCurEntry); - ScriptDocument aDocument( aDesc.GetDocument() ); - OUString aLibName( aDesc.GetLibName() ); + const ScriptDocument& aDocument( aDesc.GetDocument() ); + const OUString& aLibName( aDesc.GetLibName() ); createModImpl(GetFrameWeld(), aDocument, *m_pBasicBox, aLibName, OUString(), true); } else if (pButton == m_pOrganizeButton) diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index b446588a6b93..f1940c1c8b0c 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -706,7 +706,7 @@ void LibPage::InsertLib() Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); // file open dialog sfx2::FileDialogHelper aDlg(ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, FileDialogFlags::NONE, pTabDlg ? pTabDlg->GetFrameWeld() : nullptr); - Reference <XFilePicker3> xFP = aDlg.GetFilePicker(); + const Reference <XFilePicker3>& xFP = aDlg.GetFilePicker(); xFP->setTitle(IDEResId(RID_STR_APPENDLIBS)); @@ -1163,7 +1163,7 @@ void LibPage::ExportAsPackage( const OUString& aLibName ) { // file open dialog sfx2::FileDialogHelper aDlg(ui::dialogs::TemplateDescription::FILESAVE_SIMPLE, FileDialogFlags::NONE, pTabDlg ? pTabDlg->GetFrameWeld() : nullptr); - Reference <XFilePicker3> xFP = aDlg.GetFilePicker(); + const Reference <XFilePicker3>& xFP = aDlg.GetFilePicker(); Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); Reference< task::XInteractionHandler2 > xHandler( task::InteractionHandler::createWithParent(xContext, nullptr) ); @@ -1374,7 +1374,7 @@ void LibPage::SetCurLib() DocumentEntry* pEntry = static_cast<DocumentEntry*>(m_pBasicsBox->GetEntryData( nSelPos )); if ( pEntry ) { - ScriptDocument aDocument( pEntry->GetDocument() ); + const ScriptDocument& aDocument( pEntry->GetDocument() ); DBG_ASSERT( aDocument.isAlive(), "LibPage::SetCurLib: no document, or document is dead!" ); if ( !aDocument.isAlive() ) return; diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx index 7e28a20ddd17..e45d96d378b3 100644 --- a/basctl/source/basicide/moduldlg.cxx +++ b/basctl/source/basicide/moduldlg.cxx @@ -67,8 +67,8 @@ bool ExtTreeListBox::EditingEntry( SvTreeListEntry* pEntry, Selection& ) if ( nDepth >= 2 ) { EntryDescriptor aDesc = GetEntryDescriptor(pEntry); - ScriptDocument aDocument( aDesc.GetDocument() ); - OUString aLibName( aDesc.GetLibName() ); + const ScriptDocument& aDocument( aDesc.GetDocument() ); + const OUString& aLibName( aDesc.GetLibName() ); Reference< script::XLibraryContainer2 > xModLibContainer( aDocument.getLibraryContainer( E_SCRIPTS ), UNO_QUERY ); Reference< script::XLibraryContainer2 > xDlgLibContainer( aDocument.getLibraryContainer( E_DIALOGS ), UNO_QUERY ); if ( !( ( xModLibContainer.is() && xModLibContainer->hasByName( aLibName ) && xModLibContainer->isLibraryReadOnly( aLibName ) ) || @@ -99,11 +99,11 @@ bool ExtTreeListBox::EditedEntry( SvTreeListEntry* pEntry, const OUString& rNewT return true; EntryDescriptor aDesc = GetEntryDescriptor(pEntry); - ScriptDocument aDocument( aDesc.GetDocument() ); + const ScriptDocument& aDocument( aDesc.GetDocument() ); DBG_ASSERT( aDocument.isValid(), "ExtTreeListBox::EditedEntry: no document!" ); if ( !aDocument.isValid() ) return false; - OUString aLibName( aDesc.GetLibName() ); + const OUString& aLibName( aDesc.GetLibName() ); EntryType eType = aDesc.GetType(); bool bSuccess = eType == OBJ_TYPE_MODULE ? @@ -144,8 +144,8 @@ DragDropMode ExtTreeListBox::NotifyStartDrag( TransferDataContainer&, SvTreeList { nMode_ = DragDropMode::CTRL_COPY; EntryDescriptor aDesc = GetEntryDescriptor(pEntry); - ScriptDocument aDocument( aDesc.GetDocument() ); - OUString aLibName( aDesc.GetLibName() ); + const ScriptDocument& aDocument( aDesc.GetDocument() ); + const OUString& aLibName( aDesc.GetLibName() ); // allow MOVE mode only for libraries, which are not readonly Reference< script::XLibraryContainer2 > xModLibContainer( aDocument.getLibraryContainer( E_SCRIPTS ), UNO_QUERY ); Reference< script::XLibraryContainer2 > xDlgLibContainer( aDocument.getLibraryContainer( E_DIALOGS ), UNO_QUERY ); @@ -194,13 +194,13 @@ bool ExtTreeListBox::NotifyAcceptDrop( SvTreeListEntry* pEntry ) { // get source module/dialog name EntryDescriptor aSourceDesc = GetEntryDescriptor(pSelected); - OUString aSourceName = aSourceDesc.GetName(); + const OUString& aSourceName = aSourceDesc.GetName(); EntryType eSourceType = aSourceDesc.GetType(); // get target shell and target library name EntryDescriptor aDestDesc = GetEntryDescriptor(pEntry); ScriptDocument const& rDestDoc = aDestDesc.GetDocument(); - OUString aDestLibName = aDestDesc.GetLibName(); + const OUString& aDestLibName = aDestDesc.GetLibName(); // check if module library is not loaded, readonly or password protected Reference< script::XLibraryContainer2 > xModLibContainer( rDestDoc.getLibraryContainer( E_SCRIPTS ), UNO_QUERY ); @@ -332,13 +332,13 @@ TriState ExtTreeListBox::NotifyCopyingMoving( SvTreeListEntry* pTarget, SvTreeLi // get target shell and target library name EntryDescriptor aDestDesc = GetEntryDescriptor(rpNewParent); const ScriptDocument& rDestDoc( aDestDesc.GetDocument() ); - OUString aDestLibName( aDestDesc.GetLibName() ); + const OUString& aDestLibName( aDestDesc.GetLibName() ); // get source shell, library name and module/dialog name EntryDescriptor aSourceDesc = GetEntryDescriptor(FirstSelected()); - const ScriptDocument rSourceDoc( aSourceDesc.GetDocument() ); - OUString aSourceLibName( aSourceDesc.GetLibName() ); - OUString aSourceName( aSourceDesc.GetName() ); + const ScriptDocument& rSourceDoc( aSourceDesc.GetDocument() ); + const OUString& aSourceLibName( aSourceDesc.GetLibName() ); + const OUString& aSourceName( aSourceDesc.GetName() ); EntryType eType = aSourceDesc.GetType(); // get dispatcher @@ -626,9 +626,9 @@ void ObjectPage::CheckButtons() // enable/disable edit button SvTreeListEntry* pCurEntry = m_pBasicBox->GetCurEntry(); EntryDescriptor aDesc = m_pBasicBox->GetEntryDescriptor(pCurEntry); - ScriptDocument aDocument( aDesc.GetDocument() ); - OUString aLibName( aDesc.GetLibName() ); - OUString aLibSubName( aDesc.GetLibSubName() ); + const ScriptDocument& aDocument( aDesc.GetDocument() ); + const OUString& aLibName( aDesc.GetLibName() ); + const OUString& aLibSubName( aDesc.GetLibSubName() ); bool bVBAEnabled = aDocument.isInVBAMode(); BrowseMode nMode = m_pBasicBox->GetMode(); @@ -879,12 +879,12 @@ void ObjectPage::DeleteCurrent() SvTreeListEntry* pCurEntry = m_pBasicBox->GetCurEntry(); DBG_ASSERT( pCurEntry, "No current entry!" ); EntryDescriptor aDesc( m_pBasicBox->GetEntryDescriptor( pCurEntry ) ); - ScriptDocument aDocument( aDesc.GetDocument() ); + const ScriptDocument& aDocument( aDesc.GetDocument() ); DBG_ASSERT( aDocument.isAlive(), "ObjectPage::DeleteCurrent: no document!" ); if ( !aDocument.isAlive() ) return; - OUString aLibName( aDesc.GetLibName() ); - OUString aName( aDesc.GetName() ); + const OUString& aLibName( aDesc.GetLibName() ); + const OUString& aName( aDesc.GetName() ); EntryType eType = aDesc.GetType(); if ( ( eType == OBJ_TYPE_MODULE && QueryDelModule(aName, GetFrameWeld()) ) || diff --git a/basctl/source/dlged/managelang.cxx b/basctl/source/dlged/managelang.cxx index 757b98af872e..2339b5573e2c 100644 --- a/basctl/source/dlged/managelang.cxx +++ b/basctl/source/dlged/managelang.cxx @@ -91,7 +91,7 @@ void ManageLanguageDialog::Init() { // get current IDE Shell* pShell = GetShell(); - OUString sLibName = pShell->GetCurLibName(); + const OUString& sLibName = pShell->GetCurLibName(); // set dialog title with library name OUString sText = GetText(); sText = sText.replaceAll("$1", sLibName); |