diff options
author | Noel Grandin <noel@peralex.com> | 2016-03-01 14:52:24 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-03-02 07:57:36 +0200 |
commit | bd5ceabb533a3af7e4140e195de885bf23f650bf (patch) | |
tree | 5178589f4616f7d5da32e88eb09f3a73279f63ff /sfx2 | |
parent | 0d34f4ac9b17348d7956285c6cefb28bea2537b6 (diff) |
loplugin:unuseddefaultparam in sfx2
Change-Id: I37afde801a6468c79259fe51acbdea0614c2c8c5
Diffstat (limited to 'sfx2')
26 files changed, 76 insertions, 138 deletions
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index cd18dbc29eb7..f29288ed0408 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -840,7 +840,7 @@ extern "C" rtl_uString* basicide_choose_macro(void*, sal_Bool, rtl_uString*); #endif -OUString ChooseMacro( const Reference< XModel >& rxLimitToDocument, bool bChooseOnly, const OUString& rMacroDesc = OUString() ) +OUString ChooseMacro( const Reference< XModel >& rxLimitToDocument, bool bChooseOnly ) { #ifndef DISABLE_DYNLOADING osl::Module aMod; @@ -859,6 +859,7 @@ OUString ChooseMacro( const Reference< XModel >& rxLimitToDocument, bool bChoose #endif // call basicide_choose_macro in basctl + OUString rMacroDesc; rtl_uString* pScriptURL = pSymbol( rxLimitToDocument.get(), bChooseOnly, rMacroDesc.pData ); OUString aScriptURL( pScriptURL ); rtl_uString_release( pScriptURL ); diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx index 650057fda829..1e1780e6ecf4 100644 --- a/sfx2/source/appl/childwin.cxx +++ b/sfx2/source/appl/childwin.cxx @@ -580,8 +580,7 @@ bool SfxChildWinInfo::GetExtraData_Impl SfxChildAlignment *pAlign, SfxChildAlignment *pLastAlign, Size *pSize, - sal_uInt16 *pLine, - sal_uInt16 *pPos + sal_uInt16 *pLine ) const { // invalid? @@ -634,8 +633,6 @@ bool SfxChildWinInfo::GetExtraData_Impl *pSize = aChildSize; if ( pLine ) *pLine = (sal_uInt16) aChildPos.X(); - if ( pPos ) - *pPos = (sal_uInt16) aChildPos.Y(); return true; } return false; diff --git a/sfx2/source/appl/linksrc.cxx b/sfx2/source/appl/linksrc.cxx index eaea196c80f4..7e90802a5ffc 100644 --- a/sfx2/source/appl/linksrc.cxx +++ b/sfx2/source/appl/linksrc.cxx @@ -397,13 +397,11 @@ void SvLinkSource::RemoveConnectAdvise( SvBaseLink * pLink ) } } -bool SvLinkSource::HasDataLinks( const SvBaseLink* pLink ) const +bool SvLinkSource::HasDataLinks() const { bool bRet = false; - const SvLinkSource_Entry_Impl* p; for( sal_uInt16 n = 0, nEnd = pImpl->aArr.size(); n < nEnd; ++n ) - if( ( p = pImpl->aArr[ n ] )->bIsDataSink && - ( !pLink || &p->xSink == pLink ) ) + if( pImpl->aArr[ n ]->bIsDataSink ) { bRet = true; break; diff --git a/sfx2/source/appl/macroloader.cxx b/sfx2/source/appl/macroloader.cxx index ba2de7477d84..afddd82160ce 100644 --- a/sfx2/source/appl/macroloader.cxx +++ b/sfx2/source/appl/macroloader.cxx @@ -247,7 +247,7 @@ ErrCode SfxMacroLoader::loadMacro( const OUString& rURL, css::uno::Any& rRetval, if ( pDoc ) { // security check for macros from document basic if an SFX doc is given - if ( !pDoc->AdjustMacroMode( OUString() ) ) + if ( !pDoc->AdjustMacroMode() ) // check forbids execution return ERRCODE_IO_ACCESSDENIED; } diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index a2893a524223..b908d7ebd6c9 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -375,8 +375,7 @@ const SfxFilter* SfxFilterMatcher::GetAnyFilter( SfxFilterFlags nMust, SfxFilter sal_uInt32 SfxFilterMatcher::GuessFilterIgnoringContent( SfxMedium& rMedium, const SfxFilter**ppFilter, - SfxFilterFlags nMust, - SfxFilterFlags nDont ) const + SfxFilterFlags nMust ) const { uno::Reference<document::XTypeDetection> xDetection( comphelper::getProcessServiceFactory()->createInstance("com.sun.star.document.TypeDetection"), uno::UNO_QUERY); @@ -395,7 +394,7 @@ sal_uInt32 SfxFilterMatcher::GuessFilterIgnoringContent( { // make sure filter list is initialized m_rImpl.InitForIterating(); - *ppFilter = GetFilter4EA( sTypeName, nMust, nDont ); + *ppFilter = GetFilter4EA( sTypeName, nMust ); } return *ppFilter ? ERRCODE_NONE : ERRCODE_ABORT; @@ -535,7 +534,7 @@ bool SfxFilterMatcher::IsFilterInstalled_Impl( const SfxFilter* pFilter ) } -sal_uInt32 SfxFilterMatcher::DetectFilter( SfxMedium& rMedium, const SfxFilter**ppFilter, bool /*bPlugIn*/, bool bAPI ) const +sal_uInt32 SfxFilterMatcher::DetectFilter( SfxMedium& rMedium, const SfxFilter**ppFilter ) const /* [Description] Here the Filter selection box is pulled up. Otherwise GuessFilter @@ -606,7 +605,7 @@ sal_uInt32 SfxFilterMatcher::DetectFilter( SfxMedium& rMedium, const SfxFilter** } *ppFilter = pFilter; - if ( bHidden || (bAPI && nErr == ERRCODE_SFX_CONSULTUSER) ) + if ( bHidden ) nErr = pFilter ? ERRCODE_NONE : ERRCODE_ABORT; return nErr; } diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx index 07c2d437e7b4..e9eba41d1b04 100644 --- a/sfx2/source/control/bindings.cxx +++ b/sfx2/source/control/bindings.cxx @@ -874,9 +874,10 @@ void SfxBindings::Invalidate } -bool SfxBindings::IsBound( sal_uInt16 nSlotId, sal_uInt16 nStartSearchAt ) +bool SfxBindings::IsBound( sal_uInt16 nSlotId ) { DBG_ASSERT( pImp->pCaches != nullptr, "SfxBindings not initialized" ); + sal_uInt16 nStartSearchAt = 0; return GetStateCache(nSlotId, &nStartSearchAt ) != nullptr; } @@ -1963,16 +1964,9 @@ void SfxBindings::SetSubBindings_Impl( SfxBindings *pSub ) } } -SfxBindings* SfxBindings::GetSubBindings_Impl( bool bTop ) const +SfxBindings* SfxBindings::GetSubBindings_Impl() const { - SfxBindings *pRet = pImp->pSubBindings; - if ( bTop ) - { - while ( pRet->pImp->pSubBindings ) - pRet = pRet->pImp->pSubBindings; - } - - return pRet; + return pImp->pSubBindings; } void SfxBindings::SetWorkWindow_Impl( SfxWorkWindow* pWork ) diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx index 119880e37356..3dcfe2ef5152 100644 --- a/sfx2/source/control/request.cxx +++ b/sfx2/source/control/request.cxx @@ -424,16 +424,10 @@ const SfxPoolItem* SfxRequest::GetReturnValue() const void SfxRequest::Done ( - const SfxItemSet& rSet, /* parameters passed on by the application, + const SfxItemSet& rSet /* parameters passed on by the application, that for example were asked for by the user in a dialogue, 0 if no parameters have been set */ - - bool bKeep /* true (default) - 'rSet' is saved and GetArgs() queryable. - - false - 'rSet' is not copied (faster) */ ) /* [Description] @@ -460,23 +454,20 @@ void SfxRequest::Done Done_Impl( &rSet ); // Keep items if possible, so they can be queried by StarDraw. - if ( bKeep ) + if ( !pArgs ) { - if ( !pArgs ) - { - pArgs = new SfxAllItemSet( rSet ); - pImp->SetPool( pArgs->GetPool() ); - } - else + pArgs = new SfxAllItemSet( rSet ); + pImp->SetPool( pArgs->GetPool() ); + } + else + { + SfxItemIter aIter(rSet); + const SfxPoolItem* pItem = aIter.FirstItem(); + while(pItem) { - SfxItemIter aIter(rSet); - const SfxPoolItem* pItem = aIter.FirstItem(); - while(pItem) - { - if(!IsInvalidItem(pItem)) - pArgs->Put(*pItem,pItem->Which()); - pItem = aIter.NextItem(); - } + if(!IsInvalidItem(pItem)) + pArgs->Put(*pItem,pItem->Which()); + pItem = aIter.NextItem(); } } } diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index d82ffa2ed304..28011c99ab32 100644 --- a/sfx2/source/dialog/dockwin.cxx +++ b/sfx2/source/dialog/dockwin.cxx @@ -1807,14 +1807,11 @@ bool SfxDockingWindow::IsAutoHide_Impl() const return false; } -void SfxDockingWindow::AutoShow_Impl( bool bShow ) +void SfxDockingWindow::AutoShow_Impl() { if ( pImp->pSplitWin ) { - if ( bShow ) - pImp->pSplitWin->FadeIn(); - else - pImp->pSplitWin->FadeOut(); + pImp->pSplitWin->FadeIn(); } } diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx index a5fbf5cdd09d..6765452cb15b 100644 --- a/sfx2/source/dialog/mgetempl.cxx +++ b/sfx2/source/dialog/mgetempl.cxx @@ -376,7 +376,7 @@ IMPL_LINK_NOARG_TYPED( SfxManageStyleSheetPage, EditLinkStyleHdl_Impl, Button*, // Internal: Perform functions through the Dispatcher bool SfxManageStyleSheetPage::Execute_Impl( sal_uInt16 nId, const OUString &rStr, const OUString& rRefStr, sal_uInt16 nFamily, - sal_uInt16 nMask, const sal_uInt16* pModifier) + sal_uInt16 nMask) { SfxDispatcher &rDispatcher = *SfxGetpApp()->GetDispatcher_Impl(); @@ -397,10 +397,9 @@ bool SfxManageStyleSheetPage::Execute_Impl( pItems[ nCount++ ] = nullptr; - sal_uInt16 nModi = pModifier ? *pModifier : 0; const SfxPoolItem* mpItem = rDispatcher.Execute( nId, SfxCallMode::SYNCHRON | SfxCallMode::RECORD | SfxCallMode::MODAL, - pItems, nModi ); + pItems ); if ( !mpItem ) return false; diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx index 2184b06067cf..ad6c3d261af9 100644 --- a/sfx2/source/dialog/splitwin.cxx +++ b/sfx2/source/dialog/splitwin.cxx @@ -1011,7 +1011,7 @@ IMPL_LINK_TYPED( SfxSplitWindow, TimerHdl, Timer*, pTimer, void) } -bool SfxSplitWindow::CursorIsOverRect( bool bForceAdding ) const +bool SfxSplitWindow::CursorIsOverRect() const { bool bVisible = IsVisible(); @@ -1019,15 +1019,6 @@ bool SfxSplitWindow::CursorIsOverRect( bool bForceAdding ) const Point aPos = pEmptyWin->GetParent()->OutputToScreenPixel( pEmptyWin->GetPosPixel() ); Size aSize = pEmptyWin->GetSizePixel(); - if ( bForceAdding ) - { - // Extend with +/- a few pixels, otherwise it is too nervous - aPos.X() -= nPixel; - aPos.Y() -= nPixel; - aSize.Width() += 2 * nPixel; - aSize.Height() += 2 * nPixel; - } - Rectangle aRect( aPos, aSize ); if ( bVisible ) diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index cdec405a15df..106b93d04c65 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -575,9 +575,9 @@ void SfxTabDialog::Start_Impl() ActivatePageHdl( m_pTabCtrl ); } -void SfxTabDialog::AddTabPage( sal_uInt16 nId, const OUString &rRiderText, bool bItemsOnDemand, sal_uInt16 nPos ) +void SfxTabDialog::AddTabPage( sal_uInt16 nId, const OUString &rRiderText, bool bItemsOnDemand ) { - AddTabPage( nId, rRiderText, nullptr, nullptr, bItemsOnDemand, nPos ); + AddTabPage( nId, rRiderText, nullptr, nullptr, bItemsOnDemand ); } /* @@ -588,15 +588,13 @@ sal_uInt16 SfxTabDialog::AddTabPage ( const OString &rName, // Page ID CreateTabPage pCreateFunc, // Pointer to the Factory Method - GetTabPageRanges pRangesFunc, // Pointer to the Method for quering + GetTabPageRanges pRangesFunc // Pointer to the Method for quering // Ranges onDemand - bool bItemsOnDemand // indicates whether the set of this page is - // requested when created ) { sal_uInt16 nId = m_pTabCtrl->GetPageId(rName); pImpl->aData.push_back( - new Data_Impl( nId, pCreateFunc, pRangesFunc, bItemsOnDemand ) ); + new Data_Impl( nId, pCreateFunc, pRangesFunc, false/*bItemsOnDemand*/ ) ); return nId; } diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx index e5a98ed994b9..a244622f1185 100644 --- a/sfx2/source/doc/docfac.cxx +++ b/sfx2/source/doc/docfac.cxx @@ -74,7 +74,7 @@ struct SfxObjectFactory_Impl }; -SfxFilterContainer* SfxObjectFactory::GetFilterContainer( bool /*bForceLoad*/ ) const +SfxFilterContainer* SfxObjectFactory::GetFilterContainer() const { return pImpl->pFilterContainer; } diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 705d44244f83..a10bf5bc7cbd 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -2666,7 +2666,7 @@ SfxMedium::GetInteractionHandler( bool bGetAlways ) } -void SfxMedium::SetFilter( const SfxFilter* pFilterP, bool /*bResetOrig*/ ) +void SfxMedium::SetFilter( const SfxFilter* pFilterP ) { pImp->m_pFilter = pFilterP; } @@ -2677,9 +2677,9 @@ const SfxFilter* SfxMedium::GetFilter() const } -const SfxFilter* SfxMedium::GetOrigFilter( bool bNotCurrent ) const +const SfxFilter* SfxMedium::GetOrigFilter() const { - return ( pImp->pOrigFilter || bNotCurrent ) ? pImp->pOrigFilter : pImp->m_pFilter; + return pImp->pOrigFilter ? pImp->pOrigFilter : pImp->m_pFilter; } diff --git a/sfx2/source/doc/docfilt.cxx b/sfx2/source/doc/docfilt.cxx index bcafad22c3ab..ac457c07381b 100644 --- a/sfx2/source/doc/docfilt.cxx +++ b/sfx2/source/doc/docfilt.cxx @@ -179,17 +179,11 @@ OUString SfxFilter::GetTypeFromStorage( const SotStorage& rStg ) } OUString SfxFilter::GetTypeFromStorage( - const uno::Reference<embed::XStorage>& xStorage, bool bTemplate, OUString* pFilterName ) + const uno::Reference<embed::XStorage>& xStorage, bool bTemplate ) throw ( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception ) { SfxFilterMatcher aMatcher; - OUString aName; - if ( pFilterName ) - { - aName = *pFilterName; - pFilterName->clear(); - } css::uno::Reference< css::beans::XPropertySet > xProps( xStorage, css::uno::UNO_QUERY ); if ( xProps.is() ) @@ -211,25 +205,15 @@ OUString SfxFilter::GetTypeFromStorage( // template filters shouldn't be detected if not explicitly asked for nDont |= SfxFilterFlags::TEMPLATEPATH; - const SfxFilter* pFilter = nullptr; - if (!aName.isEmpty()) - // get preselected Filter if it matches the desired filter flags - pFilter = aMatcher.GetFilter4FilterName( aName, nMust, nDont ); - - if ( !pFilter || pFilter->GetFormat() != nClipId ) - { - // get filter from storage MediaType - pFilter = aMatcher.GetFilter4ClipBoardId( nClipId, nMust, nDont ); - if ( !pFilter ) - // template filter is asked for , but there isn't one; so at least the "normal" format should be detected - // or storage *is* a template, but bTemplate is not set - pFilter = aMatcher.GetFilter4ClipBoardId( nClipId ); - } + // get filter from storage MediaType + const SfxFilter* pFilter = aMatcher.GetFilter4ClipBoardId( nClipId, nMust, nDont ); + if ( !pFilter ) + // template filter is asked for , but there isn't one; so at least the "normal" format should be detected + // or storage *is* a template, but bTemplate is not set + pFilter = aMatcher.GetFilter4ClipBoardId( nClipId ); if ( pFilter ) { - if ( pFilterName ) - *pFilterName = pFilter->GetName(); return pFilter->GetTypeName(); } } diff --git a/sfx2/source/doc/docinsert.cxx b/sfx2/source/doc/docinsert.cxx index ca097d5136af..84f1ce5b1611 100644 --- a/sfx2/source/doc/docinsert.cxx +++ b/sfx2/source/doc/docinsert.cxx @@ -96,7 +96,7 @@ SfxMedium* DocumentInserter::CreateMedium() pMatcher = new SfxFilterMatcher(); const SfxFilter* pFilter = nullptr; - sal_uInt32 nError = pMatcher->DetectFilter( *pMedium, &pFilter, false ); + sal_uInt32 nError = pMatcher->DetectFilter( *pMedium, &pFilter ); if ( nError == ERRCODE_NONE && pFilter ) pMedium->SetFilter( pFilter ); else @@ -126,7 +126,7 @@ SfxMediumList* DocumentInserter::CreateMediumList() SfxFilterMatcher aMatcher( m_sDocFactory ); const SfxFilter* pFilter = nullptr; - sal_uInt32 nError = aMatcher.DetectFilter( *pMedium, &pFilter, false ); + sal_uInt32 nError = aMatcher.DetectFilter( *pMedium, &pFilter ); if ( nError == ERRCODE_NONE && pFilter ) pMedium->SetFilter( pFilter ); else diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx index 69a99d030bed..0592e28bd62b 100644 --- a/sfx2/source/doc/doctempl.cxx +++ b/sfx2/source/doc/doctempl.cxx @@ -1218,11 +1218,9 @@ SfxDocumentTemplates::~SfxDocumentTemplates() pImp = nullptr; } -void SfxDocumentTemplates::Update( bool _bSmart ) +void SfxDocumentTemplates::Update( ) { - if ( !_bSmart // don't be smart - || ::svt::TemplateFolderCache( true ).needsUpdate() // update is really necessary - ) + if ( ::svt::TemplateFolderCache( true ).needsUpdate() ) // update is really necessary { if ( pImp->Construct() ) pImp->Rescan(); diff --git a/sfx2/source/doc/frmdescr.cxx b/sfx2/source/doc/frmdescr.cxx index c0746480f33a..4ed074e08283 100644 --- a/sfx2/source/doc/frmdescr.cxx +++ b/sfx2/source/doc/frmdescr.cxx @@ -95,7 +95,7 @@ bool SfxFrameDescriptor::IsEditable() const return pImp->bEditable; } -SfxFrameDescriptor* SfxFrameDescriptor::Clone( bool bWithIds ) const +SfxFrameDescriptor* SfxFrameDescriptor::Clone() const { SfxFrameDescriptor *pFrame = new SfxFrameDescriptor; @@ -122,10 +122,7 @@ SfxFrameDescriptor* SfxFrameDescriptor::Clone( bool bWithIds ) const pFrame->pImp->pArgs->Put(*pImp->pArgs); } - if ( bWithIds ) - pFrame->nItemId = nItemId; - else - pFrame->nItemId = 0; + pFrame->nItemId = nItemId; return pFrame; } diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index b8fe4074acf1..6a291cbf2fa3 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -1439,7 +1439,7 @@ ErrCode SfxObjectShell::CallBasic( const OUString& rMacro, SfxApplication* pApp = SfxGetpApp(); if( pApp->GetName() != rBasic ) { - if ( !AdjustMacroMode( OUString() ) ) + if ( !AdjustMacroMode() ) return ERRCODE_IO_ACCESSDENIED; } @@ -1694,10 +1694,10 @@ void SfxObjectShell::Invalidate( sal_uInt16 nId ) Invalidate_Impl( pFrame->GetBindings(), nId ); } -bool SfxObjectShell::AdjustMacroMode( const OUString& /*rScriptType*/, bool bSuppressUI ) +bool SfxObjectShell::AdjustMacroMode() { uno::Reference< task::XInteractionHandler > xInteraction; - if ( pMedium && !bSuppressUI ) + if ( pMedium ) xInteraction = pMedium->GetInteractionHandler(); CheckForBrokenDocSignatures_Impl( xInteraction ); diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 09172c26bba8..a3c1049e122c 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -1060,7 +1060,7 @@ SfxObjectShell* SfxObjectShell::CreateObject( const OUString& rServiceName, SfxO return nullptr; } -Reference<lang::XComponent> SfxObjectShell::CreateAndLoadComponent( const SfxItemSet& rSet, SfxFrame* pFrame ) +Reference<lang::XComponent> SfxObjectShell::CreateAndLoadComponent( const SfxItemSet& rSet ) { uno::Sequence < beans::PropertyValue > aProps; TransformItems( SID_OPENDOC, rSet, aProps ); @@ -1074,12 +1074,7 @@ Reference<lang::XComponent> SfxObjectShell::CreateAndLoadComponent( const SfxIte aTarget = pTargetItem->GetValue(); uno::Reference < frame::XComponentLoader > xLoader; - if ( pFrame ) - { - xLoader.set( pFrame->GetFrameInterface(), uno::UNO_QUERY ); - } - else - xLoader.set( frame::Desktop::create(comphelper::getProcessComponentContext()), uno::UNO_QUERY ); + xLoader.set( frame::Desktop::create(comphelper::getProcessComponentContext()), uno::UNO_QUERY ); Reference <lang::XComponent> xComp; try diff --git a/sfx2/source/doc/oleprops.cxx b/sfx2/source/doc/oleprops.cxx index 8e8cc0808d56..f25c14f081c4 100644 --- a/sfx2/source/doc/oleprops.cxx +++ b/sfx2/source/doc/oleprops.cxx @@ -817,9 +817,9 @@ void SfxOleSection::SetBoolValue( sal_Int32 nPropId, bool bValue ) SetProperty( SfxOlePropertyRef( new SfxOleBoolProperty( nPropId, bValue ) ) ); } -bool SfxOleSection::SetStringValue( sal_Int32 nPropId, const OUString& rValue, bool bSkipEmpty ) +bool SfxOleSection::SetStringValue( sal_Int32 nPropId, const OUString& rValue ) { - bool bInserted = !bSkipEmpty || !rValue.isEmpty(); + bool bInserted = !rValue.isEmpty(); if( bInserted ) SetProperty( SfxOlePropertyRef( new SfxOleString8Property( nPropId, maCodePageProp, rValue ) ) ); return bInserted; diff --git a/sfx2/source/doc/oleprops.hxx b/sfx2/source/doc/oleprops.hxx index d0174b901df6..ffe70d30b4d4 100644 --- a/sfx2/source/doc/oleprops.hxx +++ b/sfx2/source/doc/oleprops.hxx @@ -301,7 +301,7 @@ public: void SetBoolValue( sal_Int32 nPropId, bool bValue ); /** Inserts a string property with the passed value. @return true = Property inserted; false = String was empty, property not inserted. */ - bool SetStringValue( sal_Int32 nPropId, const OUString& rValue, bool bSkipEmpty = false ); + bool SetStringValue( sal_Int32 nPropId, const OUString& rValue ); /** Inserts a time stamp property with the passed value. */ void SetFileTimeValue( sal_Int32 nPropId, const css::util::DateTime& rValue ); /** Inserts a date property with the passed value. */ diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index e510588ab1b5..e4d949dc7aea 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -2350,7 +2350,7 @@ sal_Bool SAL_CALL SfxBaseModel::getAllowMacroExecution() throw (RuntimeException SfxModelGuard aGuard( *this ); if ( m_pData->m_pObjectShell ) - return m_pData->m_pObjectShell->AdjustMacroMode( OUString() ); + return m_pData->m_pObjectShell->AdjustMacroMode(); return sal_False; } diff --git a/sfx2/source/inc/splitwin.hxx b/sfx2/source/inc/splitwin.hxx index 2f3b8d65c984..4ef48c1f88b9 100644 --- a/sfx2/source/inc/splitwin.hxx +++ b/sfx2/source/inc/splitwin.hxx @@ -60,7 +60,7 @@ private: bool bNewLine=false ); DECL_LINK_TYPED( TimerHdl, Timer*, void ); - bool CursorIsOverRect( bool bForceAdding = false ) const; + bool CursorIsOverRect() const; void SetPinned_Impl( bool ); void SetFadeIn_Impl( bool ); void SaveConfig_Impl(); diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx index fd8d4fafcdcc..007f3ec3a5e9 100644 --- a/sfx2/source/view/frame.cxx +++ b/sfx2/source/view/frame.cxx @@ -278,7 +278,7 @@ sal_uInt16 SfxFrame::GetChildFrameCount() const return pChildArr ? pChildArr->size() : 0; } -void SfxFrame::CancelTransfers( bool /*bCancelLoadEnv*/ ) +void SfxFrame::CancelTransfers() { if( !pImp->bInCancelTransfers ) { diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 5b1e61315799..b19470bf1583 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1114,11 +1114,11 @@ bool SfxViewFrame::Close() return true; } -void SfxViewFrame::DoActivate( bool bUI, SfxViewFrame* pOldFrame ) +void SfxViewFrame::DoActivate( bool bUI ) { SfxGetpApp(); - pDispatcher->DoActivate_Impl( bUI, pOldFrame ); + pDispatcher->DoActivate_Impl( bUI, nullptr ); // If this ViewFrame has got a parent and this is not a parent of the // old ViewFrames, it gets a ParentActivate. @@ -1127,8 +1127,7 @@ void SfxViewFrame::DoActivate( bool bUI, SfxViewFrame* pOldFrame ) SfxViewFrame *pFrame = GetParentViewFrame(); while ( pFrame ) { - if ( !pOldFrame || !pOldFrame->GetFrame().IsParent( &pFrame->GetFrame() ) ) - pFrame->pDispatcher->DoParentActivate_Impl(); + pFrame->pDispatcher->DoParentActivate_Impl(); pFrame = pFrame->GetParentViewFrame(); } } @@ -1707,13 +1706,13 @@ bool SfxViewFrame::IsVisible() const } -void SfxViewFrame::LockObjectShell_Impl( bool bLock ) +void SfxViewFrame::LockObjectShell_Impl() { - DBG_ASSERT( pImp->bObjLocked != bLock, "Wrong Locked status!" ); + DBG_ASSERT( !pImp->bObjLocked, "Wrong Locked status!" ); DBG_ASSERT( GetObjectShell(), "No Document!" ); - GetObjectShell()->OwnerLock(bLock); - pImp->bObjLocked = bLock; + GetObjectShell()->OwnerLock(true); + pImp->bObjLocked = true; } @@ -1914,9 +1913,9 @@ SfxViewFrame* SfxViewFrame::LoadDocument( SfxObjectShell& i_rDoc, const sal_uInt return LoadViewIntoFrame_Impl_NoThrow( i_rDoc, Reference< XFrame >(), i_nViewId, false ); } -SfxViewFrame* SfxViewFrame::LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const Reference< XFrame >& i_rTargetFrame, const sal_uInt16 i_nViewId ) +SfxViewFrame* SfxViewFrame::LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const Reference< XFrame >& i_rTargetFrame ) { - return LoadViewIntoFrame_Impl_NoThrow( i_rDoc, i_rTargetFrame, i_nViewId, false ); + return LoadViewIntoFrame_Impl_NoThrow( i_rDoc, i_rTargetFrame, 0, false ); } SfxViewFrame* SfxViewFrame::LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const SfxFrameItem* i_pFrameItem, const sal_uInt16 i_nViewId ) @@ -1924,7 +1923,7 @@ SfxViewFrame* SfxViewFrame::LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const return LoadViewIntoFrame_Impl_NoThrow( i_rDoc, i_pFrameItem && i_pFrameItem->GetFrame() ? i_pFrameItem->GetFrame()->GetFrameInterface() : nullptr, i_nViewId, false ); } -SfxViewFrame* SfxViewFrame::DisplayNewDocument( SfxObjectShell& i_rDoc, const SfxRequest& i_rCreateDocRequest, const sal_uInt16 i_nViewId ) +SfxViewFrame* SfxViewFrame::DisplayNewDocument( SfxObjectShell& i_rDoc, const SfxRequest& i_rCreateDocRequest ) { const SfxUnoFrameItem* pFrameItem = i_rCreateDocRequest.GetArg<SfxUnoFrameItem>(SID_FILLFRAME); const SfxBoolItem* pHiddenItem = i_rCreateDocRequest.GetArg<SfxBoolItem>(SID_HIDDEN); @@ -1932,7 +1931,7 @@ SfxViewFrame* SfxViewFrame::DisplayNewDocument( SfxObjectShell& i_rDoc, const Sf return LoadViewIntoFrame_Impl_NoThrow( i_rDoc, pFrameItem ? pFrameItem->GetFrame() : nullptr, - i_nViewId, + 0, pHiddenItem && pHiddenItem->GetValue() ); } diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index db2f60f7d263..ea6518e6bf6c 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -1403,7 +1403,7 @@ void SfxViewShell::ReadUserDataSequence ( const uno::Sequence < beans::PropertyV { } -void SfxViewShell::WriteUserDataSequence ( uno::Sequence < beans::PropertyValue >&, bool ) +void SfxViewShell::WriteUserDataSequence ( uno::Sequence < beans::PropertyValue >& ) { } |