Kaydet (Commit) 44688e49 authored tarafından Noel Grandin's avatar Noel Grandin

clang-tidy performance-unnecessary-copy-initialization in

basctl..basic

Change-Id: I4009282869cd8a2f269093564bd4fafccab80ec3
Reviewed-on: https://gerrit.libreoffice.org/62212
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst b0c6d587
......@@ -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))
{
......
......@@ -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(
......
......@@ -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;
......
......@@ -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];
......
......@@ -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 );
......
......@@ -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 ) )
{
......
......@@ -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 );
......
......@@ -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 )
......
......@@ -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)
......
......@@ -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;
......
......@@ -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()) ) ||
......
......@@ -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);
......
......@@ -991,7 +991,7 @@ namespace basegfx
for(sal_uInt32 m(0); m < nCountM; m++)
{
const B2DPolygon aMask(rPolyMask.getB2DPolygon(m));
const B2DPolygon& aMask(rPolyMask.getB2DPolygon(m));
const sal_uInt32 nCountB(aMask.count());
if(nCountB)
......
......@@ -1451,7 +1451,7 @@ namespace basegfx
bool isInEpsilonRange(const B2DPolygon& rCandidate, const B2DPoint& rTestPosition, double fDistance)
{
// force to non-bezier polygon
const B2DPolygon aCandidate(rCandidate.getDefaultAdaptiveSubdivision());
const B2DPolygon& aCandidate(rCandidate.getDefaultAdaptiveSubdivision());
const sal_uInt32 nPointCount(aCandidate.count());
if(nPointCount)
......
......@@ -220,7 +220,7 @@ namespace basegfx
{
for(sal_uInt32 a(0); a < rCandidate.count(); a++)
{
const B2DPolygon aPolygonCandidate(rCandidate.getB2DPolygon(a));
const B2DPolygon& aPolygonCandidate(rCandidate.getB2DPolygon(a));
const sal_uInt32 nCount(aPolygonCandidate.count());
if(nCount > 2)
......@@ -419,7 +419,7 @@ namespace basegfx
if(aCandidate.count() == 1)
{
// single polygon -> single polygon triangulation
const B2DPolygon aSinglePolygon(aCandidate.getB2DPolygon(0));
const B2DPolygon& aSinglePolygon(aCandidate.getB2DPolygon(0));
aRetval = triangulate(aSinglePolygon);
}
......
......@@ -535,7 +535,7 @@ namespace basegfx
// count points
for(a = 0; a < nOriginalCount; a++)
{
const B2DPolygon aCandidate(aGeometry.getB2DPolygon(a));
const B2DPolygon& aCandidate(aGeometry.getB2DPolygon(a));
const sal_uInt32 nCandCount(aCandidate.count());
// If it's not a bezier curve, at least three points would be needed to have a
......@@ -561,7 +561,7 @@ namespace basegfx
for(a = 0; a < nOriginalCount; a++)
{
const B2DPolygon aCandidate(aGeometry.getB2DPolygon(a));
const B2DPolygon& aCandidate(aGeometry.getB2DPolygon(a));
const sal_uInt32 nCandCount(aCandidate.count());
// use same condition as above, the data vector is
......@@ -710,7 +710,7 @@ namespace basegfx
for(sal_uInt32 a(0); a < rCandidate.count(); a++)
{
const B2DPolygon aCandidate(rCandidate.getB2DPolygon(a));
const B2DPolygon& aCandidate(rCandidate.getB2DPolygon(a));
if(utils::getOrientation(aCandidate) != B2VectorOrientation::Neutral)
{
......@@ -749,7 +749,7 @@ namespace basegfx
for(a = 0; a < nCount; a++)
{
const B2DPolygon aCand(aCandidate.getB2DPolygon(a));
const B2DPolygon& aCand(aCandidate.getB2DPolygon(a));
StripHelper* pNewHelper = &(aHelpers[a]);
pNewHelper->maRange = utils::getRange(aCand);
pNewHelper->meOrinetation = utils::getOrientation(aCand);
......@@ -760,12 +760,12 @@ namespace basegfx
for(a = 0; a < nCount - 1; a++)
{
const B2DPolygon aCandA(aCandidate.getB2DPolygon(a));
const B2DPolygon& aCandA(aCandidate.getB2DPolygon(a));
StripHelper& rHelperA = aHelpers[a];
for(b = a + 1; b < nCount; b++)
{
const B2DPolygon aCandB(aCandidate.getB2DPolygon(b));
const B2DPolygon& aCandB(aCandidate.getB2DPolygon(b));
StripHelper& rHelperB = aHelpers[b];
const bool bAInB(rHelperB.maRange.isInside(rHelperA.maRange) && utils::isInside(aCandB, aCandA, true));
......@@ -829,7 +829,7 @@ namespace basegfx
for(a = 0; a < nCount; a++)
{
const B2DPolygon aCandidate(rCandidate.getB2DPolygon(a));
const B2DPolygon& aCandidate(rCandidate.getB2DPolygon(a));
StripHelper* pNewHelper = &(aHelpers[a]);
pNewHelper->maRange = utils::getRange(aCandidate);
pNewHelper->meOrinetation = utils::getOrientation(aCandidate);
......@@ -838,12 +838,12 @@ namespace basegfx
for(a = 0; a < nCount - 1; a++)
{
const B2DPolygon aCandA(rCandidate.getB2DPolygon(a));
const B2DPolygon& aCandA(rCandidate.getB2DPolygon(a));
StripHelper& rHelperA = aHelpers[a];
for(b = a + 1; b < nCount; b++)
{
const B2DPolygon aCandB(rCandidate.getB2DPolygon(b));
const B2DPolygon& aCandB(rCandidate.getB2DPolygon(b));
StripHelper& rHelperB = aHelpers[b];
const bool bAInB(rHelperB.maRange.isInside(rHelperA.maRange) && utils::isInside(aCandB, aCandA, true));
const bool bBInA(rHelperA.maRange.isInside(rHelperB.maRange) && utils::isInside(aCandA, aCandB, true));
......
......@@ -733,7 +733,7 @@ namespace basegfx
for(sal_uInt32 i(0); i < nCount; i++)
{
const B2DPolygon aPolygon(rPolyPolygon.getB2DPolygon(i));
const B2DPolygon& aPolygon(rPolyPolygon.getB2DPolygon(i));
const sal_uInt32 nPointCount(aPolygon.count());
if(nPointCount)
......
......@@ -46,7 +46,7 @@ namespace basegfx
for(sal_uInt32 a(0); a < nPolygonCount; a++)
{
B3DPolygon aCandidate = rCandidate.getB3DPolygon(a);
const B3DPolygon& aCandidate = rCandidate.getB3DPolygon(a);
aRetval.expand(getRange(aCandidate));
}
......@@ -470,7 +470,7 @@ namespace basegfx
for(sal_uInt32 a(0); a < nPolygonCount; a++)
{
const B3DPolygon aPolygon(rCandidate.getB3DPolygon(a));
const B3DPolygon& aPolygon(rCandidate.getB3DPolygon(a));
const bool bInside(isInside(aPolygon, rPoint, false/*bWithBorder*/));
if(bInside)
......@@ -550,7 +550,7 @@ namespace basegfx
for(sal_uInt32 a(0); a < nPolygonCount; a++)
{
const basegfx::B3DPolygon aPoly(rPolyPolygonSource.getB3DPolygon(a));
const basegfx::B3DPolygon& aPoly(rPolyPolygonSource.getB3DPolygon(a));
const sal_uInt32 nPointCount(aPoly.count());
if(nPointCount)
......
......@@ -465,7 +465,7 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
SbxProperty* pTypeElem = static_cast< SbxProperty* > ( pTypeMembers->Get(j) );
OUString aElemName = pTypeElem->GetName();
const OUString& aElemName = pTypeElem->GetName();
r.WriteUniOrByteString( aElemName, eCharSet );
SbxDataType dataType = pTypeElem->GetType();
......
......@@ -730,7 +730,7 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
SbxObject* pObj = dynamic_cast<SbxObject*>( pObjBase );
if( pObj != nullptr )
{
OUString aObjClass = pObj->GetClassName();
const OUString& aObjClass = pObj->GetClassName();
SbClassModuleObject* pClassModuleObj = dynamic_cast<SbClassModuleObject*>( pObjBase );
if( pClassModuleObj != nullptr )
......
......@@ -327,7 +327,7 @@ static OUString implGetExceptionMsg( const Any& _rCaughtException )
static Any convertAny( const Any& rVal, const Type& aDestType )
{
Any aConvertedVal;
Reference< XTypeConverter > xConverter = getTypeConverter_Impl();
const Reference< XTypeConverter >& xConverter = getTypeConverter_Impl();
try
{
aConvertedVal = xConverter->convertTo( rVal, aDestType );
......@@ -1146,7 +1146,7 @@ static bool implGetTypeByName( const OUString& rName, Type& rRetType )
{
bool bSuccess = false;
Reference< XHierarchicalNameAccess > xTypeAccess = getTypeProvider_Impl();
const Reference< XHierarchicalNameAccess >& xTypeAccess = getTypeProvider_Impl();
if( xTypeAccess->hasByHierarchicalName( rName ) )
{
Any aRet = xTypeAccess->getByHierarchicalName( rName );
......@@ -2835,7 +2835,7 @@ static SbUnoObject* Impl_CreateUnoStruct( const OUString& aClassName )
// search for the class
Reference< XIdlClass > xClass;
Reference< XHierarchicalNameAccess > xHarryName =
const Reference< XHierarchicalNameAccess >& xHarryName =
getCoreReflection_HierarchicalNameAccess_Impl();
if( xHarryName.is() && xHarryName->hasByHierarchicalName( aClassName ) )
xClass = xCoreReflection->forName( aClassName );
......@@ -3294,7 +3294,7 @@ SbUnoClass* findUnoClass( const OUString& rName )
// #105550 Check if module exists
SbUnoClass* pUnoClass = nullptr;
Reference< XHierarchicalNameAccess > xTypeAccess = getTypeProvider_Impl();
const Reference< XHierarchicalNameAccess >& xTypeAccess = getTypeProvider_Impl();
if( xTypeAccess->hasByHierarchicalName( rName ) )
{
Any aRet = xTypeAccess->getByHierarchicalName( rName );
......@@ -3444,7 +3444,7 @@ SbUnoService* findUnoService( const OUString& rName )
{
SbUnoService* pSbUnoService = nullptr;
Reference< XHierarchicalNameAccess > xTypeAccess = getTypeProvider_Impl();
const Reference< XHierarchicalNameAccess >& xTypeAccess = getTypeProvider_Impl();
if( xTypeAccess->hasByHierarchicalName( rName ) )
{
Any aRet = xTypeAccess->getByHierarchicalName( rName );
......@@ -3691,7 +3691,7 @@ SbUnoSingleton* findUnoSingleton( const OUString& rName )
{
SbUnoSingleton* pSbUnoSingleton = nullptr;
Reference< XHierarchicalNameAccess > xTypeAccess = getTypeProvider_Impl();
const Reference< XHierarchicalNameAccess >& xTypeAccess = getTypeProvider_Impl();
if( xTypeAccess->hasByHierarchicalName( rName ) )
{
Any aRet = xTypeAccess->getByHierarchicalName( rName );
......@@ -4130,7 +4130,7 @@ void RTL_Impl_CreateUnoValue( SbxArray& rPar )
}
// Check the type
Reference< XHierarchicalNameAccess > xTypeAccess = getTypeProvider_Impl();
const Reference< XHierarchicalNameAccess >& xTypeAccess = getTypeProvider_Impl();
Any aRet;
try
{
......@@ -4507,7 +4507,7 @@ bool SbModule::createCOMWrapperForIface( Any& o_rRetAny, SbClassModuleObject* pP
for( sal_uInt16 i = 0 ; i < nCount ; ++i )
{
SbxVariable* pVar = pModIfaces->Get( i );
OUString aIfaceName = pVar->GetName();
const OUString& aIfaceName = pVar->GetName();
if( !aIfaceName.isEmpty() )
{
......@@ -4778,7 +4778,7 @@ OUString SbUnoStructRefObject::Impl_DumpProperties()
// Is it in Uno a sequence?
SbxDataType eType = pVar->GetFullType();
OUString aName( pVar->GetName() );
const OUString& aName( pVar->GetName() );
StructFieldInfo::iterator it = maFields.find( aName );
if ( it != maFields.end() )
......
......@@ -460,7 +460,7 @@ void SbRtl_ChDrive(StarBASIC *, SbxArray & rPar, bool)
// Implementation of StepRENAME with UCB
void implStepRenameUCB( const OUString& aSource, const OUString& aDest )
{
uno::Reference< ucb::XSimpleFileAccess3 > xSFI = getFileAccess();
const uno::Reference< ucb::XSimpleFileAccess3 >& xSFI = getFileAccess();