diff options
author | Noel Grandin <noel@peralex.com> | 2016-02-25 15:00:10 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-02-26 07:43:13 +0000 |
commit | 30d8216ba3b471df7276abcd8c8744cd426e6967 (patch) | |
tree | 28b092f04e6e0674f783799c90c743c2f9224ee3 /vcl/source/gdi | |
parent | 2d162b1c70c1bc16d682b74ee1d0b13a9a80717d (diff) |
loplugin:unuseddefaultparam in vcl/
Change-Id: Ic09d160ed6e3cdcd95bc04844ee8f20cfcb286ec
Reviewed-on: https://gerrit.libreoffice.org/22698
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 38 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.hxx | 13 | ||||
-rw-r--r-- | vcl/source/gdi/salgdilayout.cxx | 78 |
3 files changed, 46 insertions, 83 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 3ad54a518a01..69111345ac11 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -838,14 +838,14 @@ void PDFWriterImpl::createWidgetFieldName( sal_Int32 i_nWidgetIndex, const PDFWr m_aWidgets[i_nWidgetIndex].m_aName = aPartialName; } -static void appendFixedInt( sal_Int32 nValue, OStringBuffer& rBuffer, sal_Int32 nPrecision = nLog10Divisor ) +static void appendFixedInt( sal_Int32 nValue, OStringBuffer& rBuffer ) { if( nValue < 0 ) { rBuffer.append( '-' ); nValue = -nValue; } - sal_Int32 nFactor = 1, nDiv = nPrecision; + sal_Int32 nFactor = 1, nDiv = nLog10Divisor; while( nDiv-- ) nFactor *= 10; @@ -972,7 +972,7 @@ public: void translate( double tx, double ty ); void invert(); - void append( PDFWriterImpl::PDFPage& rPage, OStringBuffer& rBuffer, Point* pBack = nullptr ); + void append( PDFWriterImpl::PDFPage& rPage, OStringBuffer& rBuffer ); Point transform( const Point& rPoint ) const; }; @@ -1076,7 +1076,7 @@ void Matrix3::invert() set( fn ); } -void Matrix3::append( PDFWriterImpl::PDFPage& rPage, OStringBuffer& rBuffer, Point* pBack ) +void Matrix3::append( PDFWriterImpl::PDFPage& rPage, OStringBuffer& rBuffer ) { appendDouble( f[0], rBuffer ); rBuffer.append( ' ' ); @@ -1086,7 +1086,7 @@ void Matrix3::append( PDFWriterImpl::PDFPage& rPage, OStringBuffer& rBuffer, Poi rBuffer.append( ' ' ); appendDouble( f[3], rBuffer ); rBuffer.append( ' ' ); - rPage.appendPoint( Point( (long)f[4], (long)f[5] ), rBuffer, false, pBack ); + rPage.appendPoint( Point( (long)f[4], (long)f[5] ), rBuffer ); } static void appendResourceMap( OStringBuffer& rBuf, const char* pPrefix, const PDFWriterImpl::ResourceMap& rList ) @@ -1580,18 +1580,18 @@ void PDFWriterImpl::PDFPage::appendPolygon( const basegfx::B2DPolygon& rPoly, OS } } -void PDFWriterImpl::PDFPage::appendPolyPolygon( const tools::PolyPolygon& rPolyPoly, OStringBuffer& rBuffer, bool bClose ) const +void PDFWriterImpl::PDFPage::appendPolyPolygon( const tools::PolyPolygon& rPolyPoly, OStringBuffer& rBuffer ) const { sal_uInt16 nPolygons = rPolyPoly.Count(); for( sal_uInt16 n = 0; n < nPolygons; n++ ) - appendPolygon( rPolyPoly[n], rBuffer, bClose ); + appendPolygon( rPolyPoly[n], rBuffer ); } -void PDFWriterImpl::PDFPage::appendPolyPolygon( const basegfx::B2DPolyPolygon& rPolyPoly, OStringBuffer& rBuffer, bool bClose ) const +void PDFWriterImpl::PDFPage::appendPolyPolygon( const basegfx::B2DPolyPolygon& rPolyPoly, OStringBuffer& rBuffer ) const { sal_uInt32 nPolygons = rPolyPoly.count(); for( sal_uInt32 n = 0; n < nPolygons; n++ ) - appendPolygon( rPolyPoly.getB2DPolygon( n ), rBuffer, bClose ); + appendPolygon( rPolyPoly.getB2DPolygon( n ), rBuffer ); } void PDFWriterImpl::PDFPage::appendMappedLength( sal_Int32 nLength, OStringBuffer& rBuffer, bool bVertical, sal_Int32* pOutLength ) const @@ -9263,7 +9263,7 @@ void PDFWriterImpl::drawText( const Point& rPos, const OUString& rText, sal_Int3 } } -void PDFWriterImpl::drawTextArray( const Point& rPos, const OUString& rText, const long* pDXArray, sal_Int32 nIndex, sal_Int32 nLen, bool bTextLines ) +void PDFWriterImpl::drawTextArray( const Point& rPos, const OUString& rText, const long* pDXArray, sal_Int32 nIndex, sal_Int32 nLen ) { MARK( "drawText with array" ); @@ -9274,12 +9274,12 @@ void PDFWriterImpl::drawTextArray( const Point& rPos, const OUString& rText, con SalLayout* pLayout = m_pReferenceDevice->ImplLayout( rText, nIndex, nLen, rPos, 0, pDXArray ); if( pLayout ) { - drawLayout( *pLayout, rText, bTextLines ); + drawLayout( *pLayout, rText, true ); pLayout->Release(); } } -void PDFWriterImpl::drawStretchText( const Point& rPos, sal_uLong nWidth, const OUString& rText, sal_Int32 nIndex, sal_Int32 nLen, bool bTextLines ) +void PDFWriterImpl::drawStretchText( const Point& rPos, sal_uLong nWidth, const OUString& rText, sal_Int32 nIndex, sal_Int32 nLen ) { MARK( "drawStretchText" ); @@ -9290,12 +9290,12 @@ void PDFWriterImpl::drawStretchText( const Point& rPos, sal_uLong nWidth, const SalLayout* pLayout = m_pReferenceDevice->ImplLayout( rText, nIndex, nLen, rPos, nWidth ); if( pLayout ) { - drawLayout( *pLayout, rText, bTextLines ); + drawLayout( *pLayout, rText, true ); pLayout->Release(); } } -void PDFWriterImpl::drawText( const Rectangle& rRect, const OUString& rOrigStr, DrawTextFlags nStyle, bool bTextLines ) +void PDFWriterImpl::drawText( const Rectangle& rRect, const OUString& rOrigStr, DrawTextFlags nStyle ) { long nWidth = rRect.GetWidth(); long nHeight = rRect.GetHeight(); @@ -9376,7 +9376,7 @@ void PDFWriterImpl::drawText( const Rectangle& rRect, const OUString& rOrigStr, aPos.X() += (nWidth-pLineInfo->GetWidth())/2; sal_Int32 nIndex = pLineInfo->GetIndex(); sal_Int32 nLineLen = pLineInfo->GetLen(); - drawText( aPos, aStr, nIndex, nLineLen, bTextLines ); + drawText( aPos, aStr, nIndex, nLineLen ); // mnemonics should not appear in documents, // if the need arises, put them in here aPos.Y() += nTextHeight; @@ -9385,7 +9385,7 @@ void PDFWriterImpl::drawText( const Rectangle& rRect, const OUString& rOrigStr, // output last line left adjusted since it was shortened if (!aLastLine.isEmpty()) - drawText( aPos, aLastLine, 0, aLastLine.getLength(), bTextLines ); + drawText( aPos, aLastLine, 0, aLastLine.getLength() ); } } else @@ -9418,7 +9418,7 @@ void PDFWriterImpl::drawText( const Rectangle& rRect, const OUString& rOrigStr, // mnemonics should be inserted here if the need arises // draw the actual text - drawText( aPos, aStr, 0, aStr.getLength(), bTextLines ); + drawText( aPos, aStr, 0, aStr.getLength() ); } // reset clip region to original value @@ -11563,7 +11563,7 @@ void PDFWriterImpl::drawBitmap( const Point& rDestPoint, const Size& rDestSize, writeBuffer( aLine.getStr(), aLine.getLength() ); } -const PDFWriterImpl::BitmapEmit& PDFWriterImpl::createBitmapEmit( const BitmapEx& i_rBitmap, bool bDrawMask ) +const PDFWriterImpl::BitmapEmit& PDFWriterImpl::createBitmapEmit( const BitmapEx& i_rBitmap ) { BitmapEx aBitmap( i_rBitmap ); if( m_aContext.ColorMode == PDFWriter::DrawGreyscale ) @@ -11600,7 +11600,7 @@ const PDFWriterImpl::BitmapEmit& PDFWriterImpl::createBitmapEmit( const BitmapEx m_aBitmaps.front().m_aID = aID; m_aBitmaps.front().m_aBitmap = aBitmap; m_aBitmaps.front().m_nObject = createObject(); - m_aBitmaps.front().m_bDrawMask = bDrawMask; + m_aBitmaps.front().m_bDrawMask = false; it = m_aBitmaps.begin(); } diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx index b8c8bf92e321..d0817a124111 100644 --- a/vcl/source/gdi/pdfwriter_impl.hxx +++ b/vcl/source/gdi/pdfwriter_impl.hxx @@ -151,9 +151,9 @@ public: // appends a polygon optionally closing it void appendPolygon( const basegfx::B2DPolygon& rPoly, OStringBuffer& rBuffer, bool bClose = true ) const; // appends a polypolygon optionally closing the subpaths - void appendPolyPolygon( const tools::PolyPolygon& rPolyPoly, OStringBuffer& rBuffer, bool bClose = true ) const; + void appendPolyPolygon( const tools::PolyPolygon& rPolyPoly, OStringBuffer& rBuffer ) const; // appends a polypolygon optionally closing the subpaths - void appendPolyPolygon( const basegfx::B2DPolyPolygon& rPolyPoly, OStringBuffer& rBuffer, bool bClose = true ) const; + void appendPolyPolygon( const basegfx::B2DPolyPolygon& rPolyPoly, OStringBuffer& rBuffer ) const; // converts a length (either vertical or horizontal; this // can be important if the source MapMode is not // symmetrical) to page length and appends it to the buffer @@ -818,7 +818,7 @@ i12626 /* tries to find the bitmap by its id and returns its emit data if exists, else creates a new emit data block */ - const BitmapEmit& createBitmapEmit( const BitmapEx& rBitmapEx, bool bDrawMask = false ); + const BitmapEmit& createBitmapEmit( const BitmapEx& rBitmapEx ); /* writes the Do operation inside the content stream */ void drawBitmap( const Point& rDestPt, const Size& rDestSize, const BitmapEmit& rBitmap, const Color& rFillColor ); @@ -1153,11 +1153,10 @@ public: /* actual drawing functions */ void drawText( const Point& rPos, const OUString& rText, sal_Int32 nIndex, sal_Int32 nLen, bool bTextLines = true ); - void drawTextArray( const Point& rPos, const OUString& rText, const long* pDXArray, sal_Int32 nIndex, sal_Int32 nLen, bool bTextLines = true ); + void drawTextArray( const Point& rPos, const OUString& rText, const long* pDXArray, sal_Int32 nIndex, sal_Int32 nLen ); void drawStretchText( const Point& rPos, sal_uLong nWidth, const OUString& rText, - sal_Int32 nIndex, sal_Int32 nLen, - bool bTextLines = true ); - void drawText( const Rectangle& rRect, const OUString& rOrigStr, DrawTextFlags nStyle, bool bTextLines = true ); + sal_Int32 nIndex, sal_Int32 nLen ); + void drawText( const Rectangle& rRect, const OUString& rOrigStr, DrawTextFlags nStyle ); void drawTextLine( const Point& rPos, long nWidth, FontStrikeout eStrikeout, FontLineStyle eUnderline, FontLineStyle eOverline, bool bUnderlineAbove ); void drawWaveTextLine( OStringBuffer& aLine, long nWidth, FontLineStyle eTextLine, Color aColor, bool bIsAbove ); void drawStraightTextLine( OStringBuffer& aLine, long nWidth, FontLineStyle eTextLine, Color aColor, bool bIsAbove ); diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx index 7506b9e01d00..13c8a1514b34 100644 --- a/vcl/source/gdi/salgdilayout.cxx +++ b/vcl/source/gdi/salgdilayout.cxx @@ -71,7 +71,7 @@ bool SalGraphics::drawTransformedBitmap( return false; } -void SalGraphics::mirror( long& x, const OutputDevice *pOutDev, bool bBack ) const +void SalGraphics::mirror( long& x, const OutputDevice *pOutDev ) const { long w; if( pOutDev && pOutDev->GetOutDevType() == OUTDEV_VIRDEV ) @@ -88,18 +88,12 @@ void SalGraphics::mirror( long& x, const OutputDevice *pOutDev, bool bBack ) con if( (m_nLayout & SalLayoutFlags::BiDiRtl) ) { long devX = w-pOutDevRef->GetOutputWidthPixel()-pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX - if( bBack ) - x = x - devX + pOutDevRef->GetOutOffXPixel(); - else - x = devX + (x - pOutDevRef->GetOutOffXPixel()); + x = devX + (x - pOutDevRef->GetOutOffXPixel()); } else { long devX = pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX - if( bBack ) - x = devX + (pOutDevRef->GetOutputWidthPixel() + devX) - (x + 1); - else - x = pOutDevRef->GetOutputWidthPixel() - (x - devX) + pOutDevRef->GetOutOffXPixel() - 1; + x = pOutDevRef->GetOutputWidthPixel() - (x - devX) + pOutDevRef->GetOutOffXPixel() - 1; } } else if( (m_nLayout & SalLayoutFlags::BiDiRtl) ) @@ -144,7 +138,7 @@ void SalGraphics::mirror( long& x, long& nWidth, const OutputDevice *pOutDev, bo } } -bool SalGraphics::mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *pPtAry2, const OutputDevice *pOutDev, bool bBack ) const +bool SalGraphics::mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *pPtAry2, const OutputDevice *pOutDev ) const { long w; if( pOutDev && pOutDev->GetOutDevType() == OUTDEV_VIRDEV ) @@ -163,49 +157,19 @@ bool SalGraphics::mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint * if( (m_nLayout & SalLayoutFlags::BiDiRtl) ) { long devX = w-pOutDevRef->GetOutputWidthPixel()-pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX - if( bBack ) + for( i=0, j=nPoints-1; i<nPoints; i++,j-- ) { - for( i=0, j=nPoints-1; i<nPoints; i++,j-- ) - { - //long x = w-1-pPtAry[i].mnX; - //pPtAry2[j].mnX = devX + ( pOutDevRef->mnOutWidth - 1 - (x - devX) ); - pPtAry2[j].mnX = pOutDevRef->GetOutOffXPixel() + (pPtAry[i].mnX - devX); - pPtAry2[j].mnY = pPtAry[i].mnY; - } - } - else - { - for( i=0, j=nPoints-1; i<nPoints; i++,j-- ) - { - //long x = w-1-pPtAry[i].mnX; - //pPtAry2[j].mnX = devX + ( pOutDevRef->mnOutWidth - 1 - (x - devX) ); - pPtAry2[j].mnX = devX + (pPtAry[i].mnX - pOutDevRef->GetOutOffXPixel()); - pPtAry2[j].mnY = pPtAry[i].mnY; - } + pPtAry2[j].mnX = devX + (pPtAry[i].mnX - pOutDevRef->GetOutOffXPixel()); + pPtAry2[j].mnY = pPtAry[i].mnY; } } else { long devX = pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX - if( bBack ) - { - for( i=0, j=nPoints-1; i<nPoints; i++,j-- ) - { - //long x = w-1-pPtAry[i].mnX; - //pPtAry2[j].mnX = devX + ( pOutDevRef->mnOutWidth - 1 - (x - devX) ); - pPtAry2[j].mnX = pPtAry[i].mnX - pOutDevRef->GetOutputWidthPixel() + devX - pOutDevRef->GetOutOffXPixel() + 1; - pPtAry2[j].mnY = pPtAry[i].mnY; - } - } - else + for( i=0, j=nPoints-1; i<nPoints; i++,j-- ) { - for( i=0, j=nPoints-1; i<nPoints; i++,j-- ) - { - //long x = w-1-pPtAry[i].mnX; - //pPtAry2[j].mnX = devX + ( pOutDevRef->mnOutWidth - 1 - (x - devX) ); - pPtAry2[j].mnX = pOutDevRef->GetOutputWidthPixel() - (pPtAry[i].mnX - devX) + pOutDevRef->GetOutOffXPixel() - 1; - pPtAry2[j].mnY = pPtAry[i].mnY; - } + pPtAry2[j].mnX = pOutDevRef->GetOutputWidthPixel() - (pPtAry[i].mnX - devX) + pOutDevRef->GetOutOffXPixel() - 1; + pPtAry2[j].mnY = pPtAry[i].mnY; } } } @@ -223,11 +187,11 @@ bool SalGraphics::mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint * return false; } -void SalGraphics::mirror( vcl::Region& rRgn, const OutputDevice *pOutDev, bool bBack ) const +void SalGraphics::mirror( vcl::Region& rRgn, const OutputDevice *pOutDev ) const { if( rRgn.HasPolyPolygonOrB2DPolyPolygon() ) { - const basegfx::B2DPolyPolygon aPolyPoly(mirror(rRgn.GetAsB2DPolyPolygon(), pOutDev, bBack)); + const basegfx::B2DPolyPolygon aPolyPoly(mirror(rRgn.GetAsB2DPolyPolygon(), pOutDev)); rRgn = vcl::Region(aPolyPoly); } @@ -239,7 +203,7 @@ void SalGraphics::mirror( vcl::Region& rRgn, const OutputDevice *pOutDev, bool b for(RectangleVector::iterator aRectIter(aRectangles.begin()); aRectIter != aRectangles.end(); ++aRectIter) { - mirror(*aRectIter, pOutDev, bBack); + mirror(*aRectIter, pOutDev); rRgn.Union(*aRectIter); } @@ -660,36 +624,36 @@ bool SalGraphics::HitTestNativeControl( ControlType nType, ControlPart nPart, co return hitTestNativeControl( nType, nPart, rControlRegion, aPos, rIsInside ); } -void SalGraphics::mirror( ImplControlValue& rVal, const OutputDevice* pOutDev, bool bBack ) const +void SalGraphics::mirror( ImplControlValue& rVal, const OutputDevice* pOutDev ) const { switch( rVal.getType() ) { case CTRL_SLIDER: { SliderValue* pSlVal = static_cast<SliderValue*>(&rVal); - mirror(pSlVal->maThumbRect,pOutDev,bBack); + mirror(pSlVal->maThumbRect,pOutDev); } break; case CTRL_SCROLLBAR: { ScrollbarValue* pScVal = static_cast<ScrollbarValue*>(&rVal); - mirror(pScVal->maThumbRect,pOutDev,bBack); - mirror(pScVal->maButton1Rect,pOutDev,bBack); - mirror(pScVal->maButton2Rect,pOutDev,bBack); + mirror(pScVal->maThumbRect,pOutDev); + mirror(pScVal->maButton1Rect,pOutDev); + mirror(pScVal->maButton2Rect,pOutDev); } break; case CTRL_SPINBOX: case CTRL_SPINBUTTONS: { SpinbuttonValue* pSpVal = static_cast<SpinbuttonValue*>(&rVal); - mirror(pSpVal->maUpperRect,pOutDev,bBack); - mirror(pSpVal->maLowerRect,pOutDev,bBack); + mirror(pSpVal->maUpperRect,pOutDev); + mirror(pSpVal->maLowerRect,pOutDev); } break; case CTRL_TOOLBAR: { ToolbarValue* pTVal = static_cast<ToolbarValue*>(&rVal); - mirror(pTVal->maGripRect,pOutDev,bBack); + mirror(pTVal->maGripRect,pOutDev); } break; } |