diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-25 19:11:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-26 09:17:47 +0200 |
commit | 2dbe6a2d57956be392966c363d03f54cb68dd4fa (patch) | |
tree | 148065e98b7470331edaa83b95c85eae6e179ed2 /sfx2/source/view | |
parent | d416a5ff59b31dd7250d392278c43f66cdb81e35 (diff) |
loplugin:oncevar in sfx2
Change-Id: I9aadcb9a12ef9b0c3f93ea255f2542e51d31fbf7
Reviewed-on: https://gerrit.libreoffice.org/39242
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/view')
-rw-r--r-- | sfx2/source/view/frame2.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/view/sfxbasecontroller.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/view/viewfrm2.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/view/viewprn.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 12 |
5 files changed, 8 insertions, 18 deletions
diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx index fbb44fc5b6e7..e89086bc02f6 100644 --- a/sfx2/source/view/frame2.cxx +++ b/sfx2/source/view/frame2.cxx @@ -247,10 +247,9 @@ SfxFrame* SfxFrame::Create( SfxObjectShell& rDoc, vcl::Window& rWindow, SfxInter aLoadArgs = aArgs.getPropertyValues(); // load the doc into that frame - OUString sLoaderURL( "private:object" ); Reference< XComponentLoader > xLoader( xFrame, UNO_QUERY_THROW ); xLoader->loadComponentFromURL( - sLoaderURL, + "private:object", "_self", 0, aLoadArgs diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 448adcfb4812..bede7424acaf 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -1144,7 +1144,6 @@ uno::Sequence< frame::DispatchInformation > SAL_CALL SfxBaseController::getConfi SfxViewFrame* pViewFrame( m_pData->m_pViewShell->GetFrame() ); SfxSlotPool* pPool( &SfxSlotPool::GetSlotPool( pViewFrame )); - OUString aCmdPrefix( ".uno:" ); SfxSlotPool* pSlotPool = pPool ? pPool : &SFX_SLOTPOOL(); for ( sal_uInt16 i=0; i<pSlotPool->GetGroupCount(); i++ ) @@ -1161,9 +1160,7 @@ uno::Sequence< frame::DispatchInformation > SAL_CALL SfxBaseController::getConfi if ( pSfxSlot->GetMode() & nMode ) { frame::DispatchInformation aCmdInfo; - OUStringBuffer aBuf( aCmdPrefix ); - aBuf.appendAscii( pSfxSlot->GetUnoName() ); - aCmdInfo.Command = aBuf.makeStringAndClear(); + aCmdInfo.Command = ".uno:" + OUString::createFromAscii( pSfxSlot->GetUnoName() ); aCmdInfo.GroupId = nCommandGroup; aCmdList.push_back( aCmdInfo ); } diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx index 116df435e91b..b6e5b96a1e4d 100644 --- a/sfx2/source/view/viewfrm2.cxx +++ b/sfx2/source/view/viewfrm2.cxx @@ -233,8 +233,7 @@ void SfxViewFrame::Exec_Impl(SfxRequest &rReq ) // Document only needs to be queried, if no other View present. bool bClosed = false; - bool bUI = true; - if ( ( bOther || pDocSh->PrepareClose( bUI ) ) ) + if ( ( bOther || pDocSh->PrepareClose( true/*bUI*/ ) ) ) { if ( !bOther ) pDocSh->SetModified( false ); diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index a616d2d1237f..2a4fca34715c 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -642,10 +642,9 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) // no help button in dialogs if called from the help window // (pressing help button would exchange the current page inside the help // document that is going to be printed!) - OUString aHelpFilterName( "writer_web_HTML_help" ); SfxMedium* pMedium = GetViewFrame()->GetObjectShell()->GetMedium(); std::shared_ptr<const SfxFilter> pFilter = pMedium ? pMedium->GetFilter() : nullptr; - bool bPrintOnHelp = ( pFilter && pFilter->GetFilterName() == aHelpFilterName ); + bool bPrintOnHelp = ( pFilter && pFilter->GetFilterName() == "writer_web_HTML_help" ); const sal_uInt16 nId = rReq.GetSlot(); switch( nId ) diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index dd81339f9783..2fc7afaf330a 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -418,17 +418,14 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) aValue >>= xLayoutManager; if ( xLayoutManager.is() ) { - OUString aTextResString( "private:resource/toolbar/textobjectbar" ); - uno::Reference< ui::XUIElement > xElement = xLayoutManager->getElement( aTextResString ); + uno::Reference< ui::XUIElement > xElement = xLayoutManager->getElement( "private:resource/toolbar/textobjectbar" ); if(!xElement.is()) { - OUString aFrameResString( "private:resource/toolbar/frameobjectbar" ); - xElement = xLayoutManager->getElement( aFrameResString ); + xElement = xLayoutManager->getElement( "private:resource/toolbar/frameobjectbar" ); } if(!xElement.is()) { - OUString aOleResString( "private:resource/toolbar/oleobjectbar" ); - xElement = xLayoutManager->getElement( aOleResString ); + xElement = xLayoutManager->getElement( "private:resource/toolbar/oleobjectbar" ); } if(xElement.is()) { @@ -585,7 +582,6 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) OUString aFilterName; OUString aTypeName( "generic_HTML" ); OUString aFileName; - OUString aExtension( "htm" ); OUString aLocation = xStorable->getLocation(); INetURLObject aFileObj( aLocation ); @@ -637,7 +633,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) INetURLObject aFilePathObj( aTempDir.GetURL() ); aFilePathObj.insertName( aFileName ); - aFilePathObj.setExtension( aExtension ); + aFilePathObj.setExtension( "htm" ); OUString aFileURL = aFilePathObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); |