loplugin:constantparam in sfx2

Change-Id: I9a5a9fd1f4f43e0b7ef13d14979cb231f6aa9d46
Reviewed-on: https://gerrit.libreoffice.org/23801
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
Noel Grandin
2016-04-04 10:33:59 +02:00
committed by Noel Grandin
parent 8372d8532b
commit afd3ab436b
11 changed files with 18 additions and 31 deletions

View File

@@ -159,7 +159,7 @@ void ODbAdminDialog::impl_selectDataSource(const css::uno::Any& _aDataSourceName
case ::dbaccess::DST_USERDEFINE10: case ::dbaccess::DST_USERDEFINE10:
{ {
OUString aTitle(ModuleRes(STR_PAGETITLE_ADVANCED)); OUString aTitle(ModuleRes(STR_PAGETITLE_ADVANCED));
AddTabPage(PAGE_USERDRIVER, aTitle, ODriversSettings::CreateUser, nullptr, false, 1); AddTabPage(PAGE_USERDRIVER, aTitle, ODriversSettings::CreateUser, nullptr, 1);
m_aCurrentDetailPages.push(PAGE_USERDRIVER); m_aCurrentDetailPages.push(PAGE_USERDRIVER);
} }
break; break;

View File

@@ -42,8 +42,8 @@ class SFX2_DLLPUBLIC SfxProgress
public: public:
SfxProgress( SfxObjectShell* pObjSh, SfxProgress( SfxObjectShell* pObjSh,
const rtl::OUString& rText, const rtl::OUString& rText,
sal_uIntPtr nRange, bool bAllDocs = false, sal_uIntPtr nRange,
bool bWait = true ); bool bWait = true);
virtual ~SfxProgress(); virtual ~SfxProgress();
bool SetStateText( sal_uIntPtr nVal, const rtl::OUString &rVal ); bool SetStateText( sal_uIntPtr nVal, const rtl::OUString &rVal );

View File

@@ -136,7 +136,6 @@ public:
const OUString &rRiderText, const OUString &rRiderText,
CreateTabPage pCreateFunc, // != 0 CreateTabPage pCreateFunc, // != 0
GetTabPageRanges pRangesFunc, // can be 0 GetTabPageRanges pRangesFunc, // can be 0
bool bItemsOnDemand = false,
sal_uInt16 nPos = TAB_APPEND); sal_uInt16 nPos = TAB_APPEND);
void AddTabPage( sal_uInt16 nId, void AddTabPage( sal_uInt16 nId,

View File

@@ -283,10 +283,6 @@ public:
SfxPoolItem( 0 ), SfxPoolItem( 0 ),
pFrame( pViewFrame) pFrame( pViewFrame)
{} {}
SfxViewFrameItem( sal_uInt16 nWhichId, SfxViewFrame *pViewFrame ):
SfxPoolItem( nWhichId ),
pFrame( pViewFrame)
{}
virtual bool operator==( const SfxPoolItem& ) const override; virtual bool operator==( const SfxPoolItem& ) const override;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;

View File

@@ -107,7 +107,7 @@ ScProgress::ScProgress(SfxObjectShell* pObjSh, const OUString& rText,
} }
else else
{ {
pProgress = new SfxProgress( pObjSh, rText, nRange, false/*bAllDocs*/, bWait ); pProgress = new SfxProgress( pObjSh, rText, nRange, bWait );
pGlobalProgress = pProgress; pGlobalProgress = pProgress;
nGlobalRange = nRange; nGlobalRange = nRange;
nGlobalPercent = 0; nGlobalPercent = 0;

View File

@@ -1015,7 +1015,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
if ( !pView ) if ( !pView )
pView = SfxViewFrame::Current(); pView = SfxViewFrame::Current();
pView->GetViewShell()->JumpToMark( aFileName.copy(1) ); pView->GetViewShell()->JumpToMark( aFileName.copy(1) );
rReq.SetReturnValue( SfxViewFrameItem( 0, pView ) ); rReq.SetReturnValue( SfxViewFrameItem( pView ) );
return; return;
} }
@@ -1093,7 +1093,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
SfxObjectShell* pSh = pCntrFrame->GetCurrentDocument(); SfxObjectShell* pSh = pCntrFrame->GetCurrentDocument();
DBG_ASSERT( pSh, "Controller without ObjectShell ?!" ); DBG_ASSERT( pSh, "Controller without ObjectShell ?!" );
rReq.SetReturnValue( SfxViewFrameItem( 0, pCntrFrame->GetCurrentViewFrame() ) ); rReq.SetReturnValue( SfxViewFrameItem( pCntrFrame->GetCurrentViewFrame() ) );
if ( bHidden ) if ( bHidden )
pSh->RestoreNoDelete(); pSh->RestoreNoDelete();

View File

@@ -56,7 +56,7 @@ struct SfxProgress_Impl
sal_uIntPtr nMax; sal_uIntPtr nMax;
clock_t nCreate; clock_t nCreate;
clock_t nNextReschedule; clock_t nNextReschedule;
bool bLocked, bAllDocs; bool bLocked;
bool bWaitMode; bool bWaitMode;
bool bAllowRescheduling; bool bAllowRescheduling;
bool bRunning; bool bRunning;
@@ -74,8 +74,8 @@ struct SfxProgress_Impl
void SfxProgress_Impl::Enable_Impl() void SfxProgress_Impl::Enable_Impl()
{ {
SfxObjectShell* pDoc = bAllDocs ? nullptr : static_cast<SfxObjectShell*>(xObjSh); SfxObjectShell* pDoc = static_cast<SfxObjectShell*>(xObjSh);
SfxViewFrame *pFrame= SfxViewFrame::GetFirst(pDoc); SfxViewFrame *pFrame = SfxViewFrame::GetFirst(pDoc);
while ( pFrame ) while ( pFrame )
{ {
pFrame->Enable(true/*bEnable*/); pFrame->Enable(true/*bEnable*/);
@@ -99,7 +99,6 @@ SfxProgress_Impl::SfxProgress_Impl( const OUString &/*rTitle*/ )
, nCreate(0) , nCreate(0)
, nNextReschedule(0) , nNextReschedule(0)
, bLocked(false) , bLocked(false)
, bAllDocs(false)
, bWaitMode(false) , bWaitMode(false)
, bAllowRescheduling(false) , bAllowRescheduling(false)
, bRunning(false) , bRunning(false)
@@ -122,7 +121,6 @@ SfxProgress::SfxProgress
sal_uIntPtr nRange, /* Max value for range */ sal_uIntPtr nRange, /* Max value for range */
bool bAll, /* Disable all documents or only the document of the ViewFram */
bool bWait /* Activate the wait-Pointer initially (TRUE) */ bool bWait /* Activate the wait-Pointer initially (TRUE) */
) )
@@ -153,7 +151,6 @@ SfxProgress::SfxProgress
"sfx.bastyp", "sfx.bastyp",
"SfxProgress: created for '" << rText << "' at " << pImp->nCreate "SfxProgress: created for '" << rText << "' at " << pImp->nCreate
<< "ds"); << "ds");
pImp->bAllDocs = bAll;
pImp->pWorkWin = nullptr; pImp->pWorkWin = nullptr;
pImp->pView = nullptr; pImp->pView = nullptr;
@@ -333,7 +330,7 @@ void SfxProgress::Resume()
if ( pImp->bWaitMode ) if ( pImp->bWaitMode )
{ {
if ( pImp->xObjSh.Is() && !pImp->bAllDocs ) if ( pImp->xObjSh.Is() )
{ {
for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst(pImp->xObjSh); for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst(pImp->xObjSh);
pFrame; pFrame;
@@ -377,7 +374,7 @@ void SfxProgress::Suspend()
pImp->xStatusInd->reset(); pImp->xStatusInd->reset();
} }
if ( pImp->xObjSh.Is() && !pImp->bAllDocs ) if ( pImp->xObjSh.Is() )
{ {
for ( SfxViewFrame *pFrame = for ( SfxViewFrame *pFrame =
SfxViewFrame::GetFirst(pImp->xObjSh); SfxViewFrame::GetFirst(pImp->xObjSh);

View File

@@ -631,7 +631,6 @@ void SfxTabDialog::AddTabPage
const OUString& rRiderText, const OUString& rRiderText,
CreateTabPage pCreateFunc, CreateTabPage pCreateFunc,
GetTabPageRanges pRangesFunc, GetTabPageRanges pRangesFunc,
bool bItemsOnDemand,
sal_uInt16 nPos sal_uInt16 nPos
) )
{ {
@@ -639,7 +638,7 @@ void SfxTabDialog::AddTabPage
"Double Page-Ids in the Tabpage" ); "Double Page-Ids in the Tabpage" );
m_pTabCtrl->InsertPage( nId, rRiderText, nPos ); m_pTabCtrl->InsertPage( nId, rRiderText, nPos );
pImpl->aData.push_back( pImpl->aData.push_back(
new Data_Impl( nId, pCreateFunc, pRangesFunc, bItemsOnDemand ) ); new Data_Impl( nId, pCreateFunc, pRangesFunc, false/*bItemsOnDemand*/ ) );
} }
void SfxTabDialog::RemoveTabPage( sal_uInt16 nId ) void SfxTabDialog::RemoveTabPage( sal_uInt16 nId )

View File

@@ -107,13 +107,11 @@ public:
class IFrameWindow_Impl : public vcl::Window class IFrameWindow_Impl : public vcl::Window
{ {
public: public:
IFrameWindow_Impl( vcl::Window *pParent, IFrameWindow_Impl( vcl::Window *pParent, bool bHasBorder );
bool bHasBorder,
WinBits nWinBits = 0 );
}; };
IFrameWindow_Impl::IFrameWindow_Impl( vcl::Window *pParent, bool bHasBorder, WinBits nWinBits ) IFrameWindow_Impl::IFrameWindow_Impl( vcl::Window *pParent, bool bHasBorder )
: Window( pParent, nWinBits | WB_CLIPCHILDREN | WB_NODIALOGCONTROL | WB_DOCKBORDER ) : Window( pParent, WB_CLIPCHILDREN | WB_NODIALOGCONTROL | WB_DOCKBORDER )
{ {
if ( !bHasBorder ) if ( !bHasBorder )
SetBorderStyle( WindowBorderStyle::NOBORDER ); SetBorderStyle( WindowBorderStyle::NOBORDER );

View File

@@ -79,8 +79,8 @@ class SfxFrameViewWindow_Impl : public vcl::Window
SfxViewFrame* pFrame; SfxViewFrame* pFrame;
public: public:
SfxFrameViewWindow_Impl( SfxViewFrame* p, vcl::Window& rParent, WinBits nBits=0 ) : SfxFrameViewWindow_Impl( SfxViewFrame* p, vcl::Window& rParent ) :
Window( &rParent, nBits | WB_CLIPCHILDREN ), Window( &rParent, WB_CLIPCHILDREN ),
pFrame( p ) pFrame( p )
{ {
p->GetFrame().GetWindow().SetBorderStyle( WindowBorderStyle::NOBORDER ); p->GetFrame().GetWindow().SetBorderStyle( WindowBorderStyle::NOBORDER );

View File

@@ -66,9 +66,7 @@ void StartProgress( sal_uInt16 nMessResId, long nStartValue, long nEndValue,
pProgress = new SwProgress; pProgress = new SwProgress;
pProgress->pProgress = new SfxProgress( pDocShell, pProgress->pProgress = new SfxProgress( pDocShell,
SW_RESSTR(nMessResId), SW_RESSTR(nMessResId),
nEndValue - nStartValue, nEndValue - nStartValue );
false,
true );
pProgress->nStartCount = 1; pProgress->nStartCount = 1;
pProgress->pDocShell = pDocShell; pProgress->pDocShell = pDocShell;
pProgressContainer->insert( pProgressContainer->begin(), pProgress ); pProgressContainer->insert( pProgressContainer->begin(), pProgress );