summaryrefslogtreecommitdiffstats
path: root/basctl/source/basicide
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-07-19 09:49:23 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-07-19 12:22:43 +0200
commitee2bb231036b1d9d954dec369855948e6ea1f53a (patch)
treeeb7d4e569683d981e7cb9c76863f78739eefa870 /basctl/source/basicide
parenttdf#126334 Fix number format array in init controls. (diff)
downloadcore-ee2bb231036b1d9d954dec369855948e6ea1f53a.tar.gz
core-ee2bb231036b1d9d954dec369855948e6ea1f53a.zip
loplugin:referencecasting in avmedia..basic
Change-Id: I6790b2e3902d64fb6f714f031affa221dbaba014 Reviewed-on: https://gerrit.libreoffice.org/75934 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basctl/source/basicide')
-rw-r--r--basctl/source/basicide/baside3.cxx6
-rw-r--r--basctl/source/basicide/bastype2.cxx40
-rw-r--r--basctl/source/basicide/bastype3.cxx4
-rw-r--r--basctl/source/basicide/iderdll.cxx2
-rw-r--r--basctl/source/basicide/moduldl2.cxx23
-rw-r--r--basctl/source/basicide/moduldlg.cxx3
6 files changed, 30 insertions, 48 deletions
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index eda571040c6b..ab9bbe06f544 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -1034,16 +1034,14 @@ bool implImportDialog(weld::Window* pWin, const OUString& rCurPath, const Script
}
else if( !bLibLocalized )
{
- Reference< resource::XStringResourceManager > xImportStringResourceManager( xImportStringResource, UNO_QUERY );
- LocalizationMgr::resetResourceForDialog( xDialogModel, xImportStringResourceManager );
+ LocalizationMgr::resetResourceForDialog( xDialogModel, xImportStringResource );
bCopyResourcesForDialog = false;
}
if( bCopyResourcesForDialog )
{
- Reference< resource::XStringResourceResolver > xImportStringResourceResolver( xImportStringResource, UNO_QUERY );
LocalizationMgr::copyResourceForDroppedDialog( xDialogModel, aXmlDlgName,
- xLibStringResourceManager, xImportStringResourceResolver );
+ xLibStringResourceManager, xImportStringResource );
}
}
else if( bLibLocalized )
diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx
index 2141278861b2..b63a2f889daf 100644
--- a/basctl/source/basicide/bastype2.cxx
+++ b/basctl/source/basicide/bastype2.cxx
@@ -696,20 +696,16 @@ void TreeListBox::GetRootEntryBitmaps( const ScriptDocument& rDocument, Image& r
try
{
OUString sModule( xModuleManager->identify( rDocument.getDocument() ) );
- Reference< container::XNameAccess > xModuleConfig( xModuleManager, UNO_QUERY );
- if ( xModuleConfig.is() )
+ Sequence< beans::PropertyValue > aModuleDescr;
+ xModuleManager->getByName( sModule ) >>= aModuleDescr;
+ sal_Int32 nCount = aModuleDescr.getLength();
+ const beans::PropertyValue* pModuleDescr = aModuleDescr.getConstArray();
+ for ( sal_Int32 i = 0; i < nCount; ++i )
{
- Sequence< beans::PropertyValue > aModuleDescr;
- xModuleConfig->getByName( sModule ) >>= aModuleDescr;
- sal_Int32 nCount = aModuleDescr.getLength();
- const beans::PropertyValue* pModuleDescr = aModuleDescr.getConstArray();
- for ( sal_Int32 i = 0; i < nCount; ++i )
+ if ( pModuleDescr[ i ].Name == "ooSetupFactoryEmptyDocumentURL" )
{
- if ( pModuleDescr[ i ].Name == "ooSetupFactoryEmptyDocumentURL" )
- {
- pModuleDescr[ i ].Value >>= sFactoryURL;
- break;
- }
+ pModuleDescr[ i ].Value >>= sFactoryURL;
+ break;
}
}
}
@@ -1392,20 +1388,16 @@ OUString SbTreeListBox::GetRootEntryBitmaps(const ScriptDocument& rDocument)
try
{
OUString sModule( xModuleManager->identify( rDocument.getDocument() ) );
- Reference< container::XNameAccess > xModuleConfig( xModuleManager, UNO_QUERY );
- if ( xModuleConfig.is() )
+ Sequence< beans::PropertyValue > aModuleDescr;
+ xModuleManager->getByName( sModule ) >>= aModuleDescr;
+ sal_Int32 nCount = aModuleDescr.getLength();
+ const beans::PropertyValue* pModuleDescr = aModuleDescr.getConstArray();
+ for ( sal_Int32 i = 0; i < nCount; ++i )
{
- Sequence< beans::PropertyValue > aModuleDescr;
- xModuleConfig->getByName( sModule ) >>= aModuleDescr;
- sal_Int32 nCount = aModuleDescr.getLength();
- const beans::PropertyValue* pModuleDescr = aModuleDescr.getConstArray();
- for ( sal_Int32 i = 0; i < nCount; ++i )
+ if ( pModuleDescr[ i ].Name == "ooSetupFactoryEmptyDocumentURL" )
{
- if ( pModuleDescr[ i ].Name == "ooSetupFactoryEmptyDocumentURL" )
- {
- pModuleDescr[ i ].Value >>= sFactoryURL;
- break;
- }
+ pModuleDescr[ i ].Value >>= sFactoryURL;
+ break;
}
}
}
diff --git a/basctl/source/basicide/bastype3.cxx b/basctl/source/basicide/bastype3.cxx
index 084b7def7345..e4944bda3f97 100644
--- a/basctl/source/basicide/bastype3.cxx
+++ b/basctl/source/basicide/bastype3.cxx
@@ -89,7 +89,7 @@ void TreeListBox::RequestingChildren( SvTreeListEntry* pEntry )
// load dialog library
bool bDlgLibLoaded = false;
- Reference< script::XLibraryContainer > xDlgLibContainer( aDocument.getLibraryContainer( E_DIALOGS ), UNO_QUERY );
+ Reference< script::XLibraryContainer > xDlgLibContainer = aDocument.getLibraryContainer( E_DIALOGS );
if ( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aOULibName ) )
{
if ( !xDlgLibContainer->isLibraryLoaded( aOULibName ) )
@@ -178,7 +178,7 @@ IMPL_LINK(SbTreeListBox, RequestingChildrenHdl, const weld::TreeIter&, rEntry, b
// load dialog library
bool bDlgLibLoaded = false;
- Reference< script::XLibraryContainer > xDlgLibContainer( aDocument.getLibraryContainer( E_DIALOGS ), UNO_QUERY );
+ Reference< script::XLibraryContainer > xDlgLibContainer = aDocument.getLibraryContainer( E_DIALOGS );
if ( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aOULibName ) )
{
if ( !xDlgLibContainer->isLibraryLoaded( aOULibName ) )
diff --git a/basctl/source/basicide/iderdll.cxx b/basctl/source/basicide/iderdll.cxx
index 12b8c3f6a8a9..9f2f2dcf6315 100644
--- a/basctl/source/basicide/iderdll.cxx
+++ b/basctl/source/basicide/iderdll.cxx
@@ -179,7 +179,7 @@ IMPL_STATIC_LINK(ExtraData, GlobalBasicBreakHdl, StarBASIC *, pBasic, BasicDebug
if ( aDocument.isValid() )
{
OUString aOULibName( pBasic->GetName() );
- Reference< script::XLibraryContainer > xModLibContainer( aDocument.getLibraryContainer( E_SCRIPTS ), UNO_QUERY );
+ Reference< script::XLibraryContainer > xModLibContainer = aDocument.getLibraryContainer( E_SCRIPTS );
if ( xModLibContainer.is() && xModLibContainer->hasByName( aOULibName ) )
{
Reference< script::XLibraryContainerPassword > xPasswd( xModLibContainer, UNO_QUERY );
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 37254f2c63ee..515cbc55aa67 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -271,8 +271,7 @@ IMPL_LINK(LibPage, EditingEntryHdl, const weld::TreeIter&, rIter, bool)
if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aLibName ) && !xPasswd->isLibraryPasswordVerified( aLibName ) )
{
OUString aPassword;
- Reference< script::XLibraryContainer > xModLibContainer1( xModLibContainer, UNO_QUERY );
- bOK = QueryPassword( xModLibContainer1, aLibName, aPassword );
+ bOK = QueryPassword( xModLibContainer, aLibName, aPassword );
}
if ( !bOK )
return false;
@@ -613,13 +612,13 @@ void LibPage::InsertLib()
OUString aModURL( aModURLObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
if ( xSFA->exists( aModURL ) )
{
- xModLibContImport.set( script::DocumentScriptLibraryContainer::createWithURL(xContext, aModURL), UNO_QUERY );
+ xModLibContImport = script::DocumentScriptLibraryContainer::createWithURL(xContext, aModURL);
}
OUString aDlgURL( aDlgURLObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
if ( xSFA->exists( aDlgURL ) )
{
- xDlgLibContImport.set( script::DocumentDialogLibraryContainer::createWithURL(xContext, aDlgURL), UNO_QUERY );
+ xDlgLibContImport = script::DocumentDialogLibraryContainer::createWithURL(xContext, aDlgURL);
}
if ( !xModLibContImport.is() && !xDlgLibContImport.is() )
@@ -627,9 +626,7 @@ void LibPage::InsertLib()
std::shared_ptr<LibDialog> xLibDlg;
- Reference< script::XLibraryContainer > xModLibContImp( xModLibContImport, UNO_QUERY );
- Reference< script::XLibraryContainer > xDlgLibContImp( xDlgLibContImport, UNO_QUERY );
- Sequence< OUString > aLibNames = GetMergedLibraryNames( xModLibContImp, xDlgLibContImp );
+ Sequence< OUString > aLibNames = GetMergedLibraryNames( xModLibContImport, xDlgLibContImport );
sal_Int32 nLibCount = aLibNames.getLength();
const OUString* pLibNames = aLibNames.getConstArray();
for ( sal_Int32 i = 0 ; i < nLibCount ; i++ )
@@ -672,7 +669,7 @@ void LibPage::InsertLib()
if ( aExtension != aLibExtension && aExtension != aContExtension )
xLibDlg->EnableReference(false);
- weld::DialogController::runAsync(xLibDlg, [aContExtension, aDlgURLObj, aExtension, aLibExtension, aModURLObj, xLibDlg, xDlgLibContImport, xModLibContImp, xModLibContImport, this](sal_Int32 nResult)
+ weld::DialogController::runAsync(xLibDlg, [aContExtension, aDlgURLObj, aExtension, aLibExtension, aModURLObj, xLibDlg, xDlgLibContImport, xModLibContImport, this](sal_Int32 nResult)
{
if (!nResult )
return;
@@ -744,7 +741,7 @@ void LibPage::InsertLib()
Reference< script::XLibraryContainerPassword > xPasswd( xModLibContImport, UNO_QUERY );
if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aLibName ) && !xPasswd->isLibraryPasswordVerified( aLibName ) && !bReference )
{
- bOK = QueryPassword( xModLibContImp, aLibName, aPassword, true, true );
+ bOK = QueryPassword( xModLibContImport, aLibName, aPassword, true, true );
if ( !bOK )
{
@@ -928,8 +925,7 @@ void LibPage::Export()
if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aLibName ) && !xPasswd->isLibraryPasswordVerified( aLibName ) )
{
OUString aPassword;
- Reference< script::XLibraryContainer > xModLibContainer1( xModLibContainer, UNO_QUERY );
- bOK = QueryPassword( xModLibContainer1, aLibName, aPassword );
+ bOK = QueryPassword( xModLibContainer, aLibName, aPassword );
}
if ( !bOK )
return;
@@ -1052,10 +1048,7 @@ void LibPage::ExportAsPackage( const OUString& aLibName )
Reference< task::XInteractionHandler > xDummyHandler( new DummyInteractionHandler( xHandler ) );
implExportLib( aLibName, aTmpPath, xDummyHandler );
- Reference< XCommandEnvironment > xCmdEnv =
- new OLibCommandEnvironment(
- Reference< task::XInteractionHandler >(
- xHandler, UNO_QUERY));
+ Reference< XCommandEnvironment > xCmdEnv = new OLibCommandEnvironment(xHandler);
::ucbhelper::Content sourceContent( aSourcePath, xCmdEnv, comphelper::getProcessComponentContext() );
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index 531fd7a00e0e..cf4ff447547f 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -165,8 +165,7 @@ void Shell::CopyDialogResources(
{
if( bSourceLocalized && bDestLocalized )
{
- Reference< resource::XStringResourceResolver > xSourceStringResolver( xSourceMgr, UNO_QUERY );
- LocalizationMgr::copyResourceForDroppedDialog( xDialogModel, rDlgName, xDestMgr, xSourceStringResolver );
+ LocalizationMgr::copyResourceForDroppedDialog( xDialogModel, rDlgName, xDestMgr, xSourceMgr );
}
else if( bSourceLocalized )
{