diff options
author | Noel Grandin <noel@peralex.com> | 2016-03-08 10:51:28 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-03-08 11:45:47 +0000 |
commit | 2600220f53f51be2d017b012c56293bf8cf835ef (patch) | |
tree | 88bb373d0ecaea1e64c71ca4388e55e593d58aa7 /vcl/source | |
parent | 7f40ed57eb921e491f2fb83c820cb453babd9843 (diff) |
loplugin:constantparams in vcl
Change-Id: I2114436f4bef3ac71a3035a206186cefaf88bca1
Reviewed-on: https://gerrit.libreoffice.org/23023
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/filter/sgvspln.cxx | 12 | ||||
-rw-r--r-- | vcl/source/font/PhysicalFontCollection.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 8 | ||||
-rw-r--r-- | vcl/source/gdi/print.cxx | 29 | ||||
-rw-r--r-- | vcl/source/gdi/virdev.cxx | 2 | ||||
-rw-r--r-- | vcl/source/helper/threadex.cxx | 4 | ||||
-rw-r--r-- | vcl/source/outdev/font.cxx | 10 | ||||
-rw-r--r-- | vcl/source/window/mouse.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/paint.cxx | 8 | ||||
-rw-r--r-- | vcl/source/window/printdlg.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 25 | ||||
-rw-r--r-- | vcl/source/window/winproc.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/wrkwin.cxx | 4 |
13 files changed, 52 insertions, 62 deletions
diff --git a/vcl/source/filter/sgvspln.cxx b/vcl/source/filter/sgvspln.cxx index 40f168ac614f..7129b0a3508d 100644 --- a/vcl/source/filter/sgvspln.cxx +++ b/vcl/source/filter/sgvspln.cxx @@ -124,7 +124,7 @@ short basis() /* calculate BASE machine independence */ /*---------------------- MODULE tridiagonal -----------------------*/ -sal_uInt16 TriDiagGS(bool rep, sal_uInt16 n, double* lower, +sal_uInt16 TriDiagGS(sal_uInt16 n, double* lower, double* diag, double* upper, double* b) /*************************/ /* Gaussian methods for */ @@ -212,11 +212,10 @@ sal_uInt16 TriDiagGS(bool rep, sal_uInt16 n, double* lower, if ( n < 2 ) return 1; /* n at least 2 */ - /* if rep = false, */ /* determine the */ /* triangular */ /* decomposition of */ - if (!rep) /* matrix and determinant*/ + /* matrix and determinant*/ { for (i = 1; i < n; i++) { if ( fabs(diag[i-1]) < MACH_EPS ) /* do not decompose */ @@ -248,7 +247,7 @@ sal_uInt16 TriDiagGS(bool rep, sal_uInt16 n, double* lower, /*---------------- Module cyclic tridiagonal -----------------------*/ -sal_uInt16 ZyklTriDiagGS(bool rep, sal_uInt16 n, double* lower, double* diag, +sal_uInt16 ZyklTriDiagGS(sal_uInt16 n, double* lower, double* diag, double* upper, double* lowrow, double* ricol, double* b) /******************************/ /* Systems with cyclic */ @@ -335,7 +334,6 @@ sal_uInt16 ZyklTriDiagGS(bool rep, sal_uInt16 n, double* lower, double* diag, if ( n < 3 ) return 1; - if (!rep) /* If rep = false, */ { /* calculate decomposition */ lower[0] = upper[n-1] = 0.0; /* of the matrix. */ @@ -449,7 +447,7 @@ sal_uInt16 NaturalSpline(sal_uInt16 n, double* x, double* y, if (n==2) { c[1]=a[0]/d[0]; } else { - error=TriDiagGS(false,n-1,b,d,c,a.get()); + error=TriDiagGS(n-1,b,d,c,a.get()); if (error!=0) return error+2; for (i=0;i<n-1;i++) c[i+1]=a[i]; } @@ -528,7 +526,7 @@ sal_uInt16 PeriodicSpline(sal_uInt16 n, double* x, double* y, lowrow[0]=hr; ricol[0]=hr; a[nm1]=3.0*((y[1]-y[0])/hr-(y[n]-y[nm1])/hl); - Error=ZyklTriDiagGS(false,n,b,d,c,lowrow.get(),ricol.get(),a.get()); + Error=ZyklTriDiagGS(n,b,d,c,lowrow.get(),ricol.get(),a.get()); if ( Error != 0 ) { return Error+4; diff --git a/vcl/source/font/PhysicalFontCollection.cxx b/vcl/source/font/PhysicalFontCollection.cxx index dabc7668012d..823c06d90f32 100644 --- a/vcl/source/font/PhysicalFontCollection.cxx +++ b/vcl/source/font/PhysicalFontCollection.cxx @@ -923,7 +923,7 @@ PhysicalFontFamily* PhysicalFontCollection::ImplFindFontFamilyOfDefaultFont() co return pFoundData; } -PhysicalFontCollection* PhysicalFontCollection::Clone( bool bScalable, bool bEmbeddable ) const +PhysicalFontCollection* PhysicalFontCollection::Clone( bool bEmbeddable ) const { PhysicalFontCollection* pClonedCollection = new PhysicalFontCollection; pClonedCollection->mbMapNames = mbMapNames; @@ -937,7 +937,7 @@ PhysicalFontCollection* PhysicalFontCollection::Clone( bool bScalable, bool bEmb for(; it != maPhysicalFontFamilies.end(); ++it ) { const PhysicalFontFamily* pFontFace = (*it).second; - pFontFace->UpdateCloneFontList( *pClonedCollection, bScalable, bEmbeddable ); + pFontFace->UpdateCloneFontList( *pClonedCollection, true/*bScalable*/, bEmbeddable ); } return pClonedCollection; diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 7a08891ecda0..5989355ff71f 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -2211,7 +2211,7 @@ OutputDevice* PDFWriterImpl::getReferenceDevice() pVDev->SetMapMode( MAP_MM ); m_pReferenceDevice->mpPDFWriter = this; - m_pReferenceDevice->ImplUpdateFontData( true ); + m_pReferenceDevice->ImplUpdateFontData(); } return m_pReferenceDevice; } @@ -6392,7 +6392,7 @@ OUString PKIStatusInfoToString(const PKIStatusInfo& rStatusInfo) // not exported from libsmime, so copy them here. Sigh. SECStatus -my_SEC_StringToOID(PLArenaPool *pool, SECItem *to, const char *from, PRUint32 len) +my_SEC_StringToOID(SECItem *to, const char *from, PRUint32 len) { PRUint32 decimal_numbers = 0; PRUint32 result_bytes = 0; @@ -6478,7 +6478,7 @@ bad_data: SECItem result_item = {siBuffer, nullptr, 0 }; result_item.data = result; result_item.len = result_bytes; - rv = SECITEM_CopyItem(pool, to, &result_item); + rv = SECITEM_CopyItem(nullptr, to, &result_item); } return rv; } @@ -7091,7 +7091,7 @@ bool PDFWriterImpl::finalizeSignature() // id-aa-timeStampToken OBJECT IDENTIFIER ::= { iso(1) // member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) // smime(16) aa(2) 14 } - if (my_SEC_StringToOID(nullptr, &typetag.oid, "1.2.840.113549.1.9.16.2.14", 0) != SECSuccess) + if (my_SEC_StringToOID(&typetag.oid, "1.2.840.113549.1.9.16.2.14", 0) != SECSuccess) { SAL_WARN("vcl.pdfwriter", "SEC_StringToOID failed"); free(pass); diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 2d3cfe06271a..9e9156ad7589 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -712,14 +712,14 @@ void Printer::ImplInit( SalPrinterQueueInfo* pInfo ) if ( !mpInfoPrinter ) { - ImplInitDisplay( nullptr ); + ImplInitDisplay(); return; } // we need a graphics if ( !AcquireGraphics() ) { - ImplInitDisplay( nullptr ); + ImplInitDisplay(); return; } @@ -730,7 +730,7 @@ void Printer::ImplInit( SalPrinterQueueInfo* pInfo ) mpGraphics->GetDevFontList( mpFontCollection ); } -void Printer::ImplInitDisplay( const vcl::Window* pWindow ) +void Printer::ImplInitDisplay() { ImplSVData* pSVData = ImplGetSVData(); @@ -738,10 +738,7 @@ void Printer::ImplInitDisplay( const vcl::Window* pWindow ) mpPrinter = nullptr; mpJobGraphics = nullptr; - if ( pWindow ) - mpDisplayDev = VclPtr<VirtualDevice>::Create( *pWindow ); - else - mpDisplayDev = VclPtr<VirtualDevice>::Create(); + mpDisplayDev = VclPtr<VirtualDevice>::Create(); mpFontCollection = pSVData->maGDIData.mpScreenFontList; mpFontCache = pSVData->maGDIData.mpScreenFontCache; mnDPIX = mpDisplayDev->mnDPIX; @@ -896,7 +893,7 @@ void Printer::ImplUpdatePageData() void Printer::ImplUpdateFontList() { - ImplUpdateFontData( true ); + ImplUpdateFontData(); } long Printer::GetGradientStepCount( long nMinRect ) @@ -918,7 +915,7 @@ Printer::Printer() mbDefPrinter = true; } else - ImplInitDisplay( nullptr ); + ImplInitDisplay(); } Printer::Printer( const JobSetup& rJobSetup ) : @@ -934,7 +931,7 @@ Printer::Printer( const JobSetup& rJobSetup ) : } else { - ImplInitDisplay( nullptr ); + ImplInitDisplay(); maJobSetup = JobSetup(); } } @@ -947,7 +944,7 @@ Printer::Printer( const QueueInfo& rQueueInfo ) if ( pInfo ) ImplInit( pInfo ); else - ImplInitDisplay( nullptr ); + ImplInitDisplay(); } Printer::Printer( const OUString& rPrinterName ) @@ -957,7 +954,7 @@ Printer::Printer( const OUString& rPrinterName ) if ( pInfo ) ImplInit( pInfo ); else - ImplInitDisplay( nullptr ); + ImplInitDisplay(); } Printer::~Printer() @@ -1164,7 +1161,7 @@ bool Printer::SetPrinterProps( const Printer* pPrinter ) } // Construct new printer - ImplInitDisplay( nullptr ); + ImplInitDisplay(); return true; } @@ -1213,7 +1210,7 @@ bool Printer::SetPrinterProps( const Printer* pPrinter ) SetJobSetup( pPrinter->GetJobSetup() ); } else - ImplInitDisplay( nullptr ); + ImplInitDisplay(); } else SetJobSetup( pPrinter->GetJobSetup() ); @@ -1537,13 +1534,13 @@ OUString Printer::GetPaperName( Paper ePaper ) return (it != pSVData->mpPaperNames->end()) ? it->second : OUString(); } -OUString Printer::GetPaperName( bool i_bPaperUser ) const +OUString Printer::GetPaperName() const { Size aPageSize = PixelToLogic( GetPaperSizePixel(), MAP_100TH_MM ); Paper ePaper = ImplGetPaperFormat( aPageSize.Width(), aPageSize.Height() ); if( ePaper == PAPER_USER ) ePaper = ImplGetPaperFormat( aPageSize.Height(), aPageSize.Width() ); - return (ePaper != PAPER_USER || i_bPaperUser ) ? GetPaperName( ePaper ) : OUString(); + return (ePaper != PAPER_USER) ? GetPaperName( ePaper ) : OUString(); } const PaperInfo& Printer::GetPaperInfo( int nPaper ) const diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx index 016bf034f839..b32486ed7c0b 100644 --- a/vcl/source/gdi/virdev.cxx +++ b/vcl/source/gdi/virdev.cxx @@ -525,7 +525,7 @@ void VirtualDevice::ImplSetReferenceDevice( RefDevMode i_eRefDevMode, sal_Int32 // get font list with scalable fonts only AcquireGraphics(); - mpFontCollection = pSVData->maGDIData.mpScreenFontList->Clone( true, false ); + mpFontCollection = pSVData->maGDIData.mpScreenFontList->Clone( false ); // prepare to use new font lists mpFontCache = new ImplFontCache(); diff --git a/vcl/source/helper/threadex.cxx b/vcl/source/helper/threadex.cxx index 628a216c3a68..171b569a70b8 100644 --- a/vcl/source/helper/threadex.cxx +++ b/vcl/source/helper/threadex.cxx @@ -46,7 +46,7 @@ IMPL_LINK_NOARG_TYPED(SolarThreadExecutor, worker, void*, void) } } -long SolarThreadExecutor::impl_execute( const TimeValue* _pTimeout ) +long SolarThreadExecutor::impl_execute() { if( ::osl::Thread::getCurrentIdentifier() == Application::GetMainThreadIdentifier() ) { @@ -60,7 +60,7 @@ long SolarThreadExecutor::impl_execute( const TimeValue* _pTimeout ) osl_resetCondition( m_aFinish ); SolarMutexReleaser aReleaser; ImplSVEvent * nEvent = Application::PostUserEvent( LINK( this, SolarThreadExecutor, worker ) ); - if ( osl_cond_result_timeout == osl_waitCondition( m_aStart, _pTimeout ) ) + if ( osl_cond_result_timeout == osl_waitCondition( m_aStart, nullptr ) ) { m_bTimeout = true; Application::RemoveUserEvent( nEvent ); diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index 751900d218e8..7b1ed3abfb88 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -554,7 +554,7 @@ void OutputDevice::ImplRefreshFontData( const bool bNewFontLists ) { if( mpPDFWriter ) { - mpFontCollection = pSVData->maGDIData.mpScreenFontList->Clone( true, true ); + mpFontCollection = pSVData->maGDIData.mpScreenFontList->Clone( true ); mpFontCache = new ImplFontCache(); } else @@ -577,10 +577,10 @@ void OutputDevice::ImplRefreshFontData( const bool bNewFontLists ) } } -void OutputDevice::ImplUpdateFontData( bool bNewFontLists ) +void OutputDevice::ImplUpdateFontData() { - ImplClearFontData( bNewFontLists ); - ImplRefreshFontData( bNewFontLists ); + ImplClearFontData( true/*bNewFontLists*/ ); + ImplRefreshFontData( true/*bNewFontLists*/ ); } void OutputDevice::ImplClearAllFontData(bool bNewFontLists) @@ -1021,7 +1021,7 @@ bool OutputDevice::ImplNewFont() const const ImplSVData* pSVData = ImplGetSVData(); if( mpFontCollection == pSVData->maGDIData.mpScreenFontList || mpFontCache == pSVData->maGDIData.mpScreenFontCache ) - const_cast<OutputDevice&>(*this).ImplUpdateFontData( true ); + const_cast<OutputDevice&>(*this).ImplUpdateFontData(); } if ( !mbNewFont ) diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx index 913b47c7bb42..94a8f9757e36 100644 --- a/vcl/source/window/mouse.cxx +++ b/vcl/source/window/mouse.cxx @@ -290,7 +290,7 @@ void Window::ImplGrabFocus( GetFocusFlags nFlags ) // EndExtTextInput if it is not the same window if ( pSVData->maWinData.mpExtTextInputWin && (pSVData->maWinData.mpExtTextInputWin.get() != this) ) - pSVData->maWinData.mpExtTextInputWin->EndExtTextInput( EndExtTextInputFlags::Complete ); + pSVData->maWinData.mpExtTextInputWin->EndExtTextInput(); // mark this windows as the last FocusWindow vcl::Window* pOverlapWindow = ImplGetFirstOverlapWindow(); diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx index 0c49837cdf4f..08ce4e43703f 100644 --- a/vcl/source/window/paint.cxx +++ b/vcl/source/window/paint.cxx @@ -945,10 +945,10 @@ void Window::ImplValidateFrameRegion( const vcl::Region* pRegion, ValidateFlags } } -void Window::ImplValidate( const vcl::Region* pRegion, ValidateFlags nFlags ) +void Window::ImplValidate( ValidateFlags nFlags ) { // assemble region - bool bValidateAll = !pRegion; + bool bValidateAll = true; ValidateFlags nOrgFlags = nFlags; if ( !(nFlags & (ValidateFlags::Children | ValidateFlags::NoChildren)) ) { @@ -965,8 +965,6 @@ void Window::ImplValidate( const vcl::Region* pRegion, ValidateFlags nFlags ) { Rectangle aRect( Point( mnOutOffX, mnOutOffY ), Size( mnOutWidth, mnOutHeight ) ); vcl::Region aRegion( aRect ); - if ( pRegion ) - aRegion.Intersect( *pRegion ); ImplClipBoundaries( aRegion, true, true ); if ( nFlags & ValidateFlags::NoChildren ) { @@ -1225,7 +1223,7 @@ void Window::Validate() if ( !comphelper::LibreOfficeKit::isActive() && (!IsDeviceOutputNecessary() || !mnOutWidth || !mnOutHeight) ) return; - ImplValidate( nullptr, ValidateFlags::NONE ); + ImplValidate( ValidateFlags::NONE ); } bool Window::HasPaintEvent() const diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 28c739f999c4..53d8ea7be466 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -1344,7 +1344,7 @@ void PrintDialog::preparePreview( bool i_bNewPage, bool i_bMayUseCache ) Size aCurPageSize = aPrt->PixelToLogic( aPrt->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ); mpPreviewWindow->setPreview( aMtf, aCurPageSize, - aPrt->GetPaperName( false ), + aPrt->GetPaperName(), nPages > 0 ? OUString() : maNoPageStr, aPrt->GetDPIX(), aPrt->GetDPIY(), aPrt->GetPrinterOptions().IsConvertToGreyscales() diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 4d89a1789394..9f1e38cef4e4 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -413,7 +413,7 @@ void Window::dispose() // EndExtTextInputMode if ( pSVData->maWinData.mpExtTextInputWin == this ) { - EndExtTextInput( EndExtTextInputFlags::Complete ); + EndExtTextInput(); if ( pSVData->maWinData.mpExtTextInputWin == this ) pSVData->maWinData.mpExtTextInputWin = nullptr; } @@ -1970,20 +1970,17 @@ void Window::StateChanged(StateChangedType eType) } } -bool Window::IsLocked( bool bChildren ) const +bool Window::IsLocked() const { if ( mpWindowImpl->mnLockCount != 0 ) return true; - if ( bChildren || mpWindowImpl->mbChildNotify ) + vcl::Window* pChild = mpWindowImpl->mpFirstChild; + while ( pChild ) { - vcl::Window* pChild = mpWindowImpl->mpFirstChild; - while ( pChild ) - { - if ( pChild->IsLocked( true ) ) - return true; - pChild = pChild->mpWindowImpl->mpNext; - } + if ( pChild->IsLocked() ) + return true; + pChild = pChild->mpWindowImpl->mpNext; } return false; @@ -2113,11 +2110,11 @@ void Window::SetInputContext( const InputContext& rInputContext ) ImplNewInputContext(); } -void Window::EndExtTextInput( EndExtTextInputFlags nFlags ) +void Window::EndExtTextInput() { if ( mpWindowImpl->mbExtTextInput ) - ImplGetFrame()->EndExtTextInput( nFlags ); + ImplGetFrame()->EndExtTextInput( EndExtTextInputFlags::Complete ); } void Window::SetCursorRect( const Rectangle* pRect, long nExtTextInputWidth ) @@ -2967,10 +2964,10 @@ Rectangle Window::GetWindowExtentsRelative( vcl::Window *pRelativeWindow ) const return ImplGetWindowExtentsRelative( pRelativeWindow, false ); } -Rectangle Window::GetClientWindowExtentsRelative( vcl::Window *pRelativeWindow ) const +Rectangle Window::GetClientWindowExtentsRelative() const { // without decoration - return ImplGetWindowExtentsRelative( pRelativeWindow, true ); + return ImplGetWindowExtentsRelative( nullptr, true ); } Rectangle Window::ImplGetWindowExtentsRelative( vcl::Window *pRelativeWindow, bool bClientOnly ) const diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index c680cb4bce66..4fba05c55662 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -407,7 +407,7 @@ bool ImplHandleMouseEvent( const VclPtr<vcl::Window>& xWindow, MouseNotifyEvent if ( pSVData->maWinData.mpExtTextInputWin && ((nSVEvent == MouseNotifyEvent::MOUSEBUTTONDOWN) || (nSVEvent == MouseNotifyEvent::MOUSEBUTTONUP)) ) - pSVData->maWinData.mpExtTextInputWin->EndExtTextInput( EndExtTextInputFlags::Complete ); + pSVData->maWinData.mpExtTextInputWin->EndExtTextInput(); } // determine mouse event data @@ -1807,7 +1807,7 @@ IMPL_LINK_NOARG_TYPED(vcl::Window, ImplAsyncFocusHdl, void*, void) // TrackingMode is ended in ImplHandleLoseFocus #ifdef _WIN32 // To avoid problems with the Unix IME - pFocusWin->EndExtTextInput( EndExtTextInputFlags::Complete ); + pFocusWin->EndExtTextInput(); #endif // XXX #102010# hack for accessibility: do not close the menu, diff --git a/vcl/source/window/wrkwin.cxx b/vcl/source/window/wrkwin.cxx index 0d4e9d1f369f..caeee5642d2b 100644 --- a/vcl/source/window/wrkwin.cxx +++ b/vcl/source/window/wrkwin.cxx @@ -155,9 +155,9 @@ void WorkWindow::ShowFullScreenMode( bool bFullScreenMode, sal_Int32 nDisplayScr } } -void WorkWindow::StartPresentationMode( bool bPresentation, PresentationFlags nFlags ) +void WorkWindow::StartPresentationMode( PresentationFlags nFlags ) { - return StartPresentationMode( bPresentation, nFlags, GetScreenNumber()); + return StartPresentationMode( false/*bPresentation*/, nFlags, GetScreenNumber()); } void WorkWindow::StartPresentationMode( bool bPresentation, PresentationFlags nFlags, sal_uInt32 nDisplayScreen ) |