From 6a043e9c0acff20e1618ca8ec15c21d5d0fd0d37 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 2 May 2013 10:36:43 +0200 Subject: Use the new type-checking Reference constructor to reduce code noise Also create a Clang compiler plugin to detect such cases. Change-Id: I61ad1a1d6b1c017eeb51f226d2dde0e9bb7f1752 Reviewed-on: https://gerrit.libreoffice.org/4001 Tested-by: LibreOffice gerrit bot Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- basctl/source/basicide/baside3.cxx | 4 +--- basctl/source/basicide/moduldl2.cxx | 14 ++++++-------- 2 files changed, 7 insertions(+), 11 deletions(-) (limited to 'basctl/source') diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx index a6b87743f4f0..6a0a688652d8 100644 --- a/basctl/source/basicide/baside3.cxx +++ b/basctl/source/basicide/baside3.cxx @@ -838,10 +838,8 @@ bool DialogWindow::SaveDialog() xStringResourceWithLocation->newLocale( rLocale ); } - Reference< XStringResourceManager > xTargetStringResourceManager( xStringResourceWithLocation, uno::UNO_QUERY ); - LocalizationMgr::copyResourceForDialog( xDialogModel, - xStringResourceResolver, xTargetStringResourceManager ); + xStringResourceResolver, xStringResourceWithLocation ); xStringResourceWithLocation->store(); } diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index 68b41ba53eb0..ae513291a8fb 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -802,8 +802,7 @@ void LibPage::InsertLib() aFilter += ";*.sdd;*.sxi;*.odp" ; // presentation aFilter += ";*.sti;*.otp" ; // presentation template aFilter += ";*.sxm;*.odf" ; // formula - Reference< XFilterManager > xFltMgr(xFP, UNO_QUERY); - xFltMgr->appendFilter( aTitle, aFilter ); + xFP->appendFilter( aTitle, aFilter ); // set display directory and filter OUString aPath(GetExtraData()->GetAddLibPath()); @@ -817,14 +816,14 @@ void LibPage::InsertLib() OUString aLastFilter(GetExtraData()->GetAddLibFilter()); if ( !aLastFilter.isEmpty() ) - xFltMgr->setCurrentFilter( aLastFilter ); + xFP->setCurrentFilter( aLastFilter ); else - xFltMgr->setCurrentFilter( IDE_RESSTR(RID_STR_BASIC) ); + xFP->setCurrentFilter( IDE_RESSTR(RID_STR_BASIC) ); if ( xFP->execute() == RET_OK ) { GetExtraData()->SetAddLibPath( xFP->getDisplayDirectory() ); - GetExtraData()->SetAddLibFilter( xFltMgr->getCurrentFilter() ); + GetExtraData()->SetAddLibFilter( xFP->getCurrentFilter() ); // library containers for import Reference< script::XLibraryContainer2 > xModLibContImport; @@ -1252,8 +1251,7 @@ void LibPage::ExportAsPackage( const String& aLibName ) OUString aTitle = String( IDEResId( RID_STR_PACKAGE_BUNDLE ) ); OUString aFilter; aFilter = "*.oxt" ; // library files - Reference< XFilterManager > xFltMgr(xFP, UNO_QUERY); - xFltMgr->appendFilter( aTitle, aFilter ); + xFP->appendFilter( aTitle, aFilter ); // set display directory and filter String aPath = GetExtraData()->GetAddLibPath(); @@ -1266,7 +1264,7 @@ void LibPage::ExportAsPackage( const String& aLibName ) // macro path from configuration management xFP->setDisplayDirectory( SvtPathOptions().GetWorkPath() ); } - xFltMgr->setCurrentFilter( aTitle ); + xFP->setCurrentFilter( aTitle ); if ( xFP->execute() == RET_OK ) { -- cgit