[Libreoffice-commits] core.git: filter/source

Noel Grandin noel at peralex.com
Tue Jun 28 06:25:37 UTC 2016


 filter/source/graphicfilter/eps/eps.cxx      |   14 +-------------
 filter/source/graphicfilter/icgm/actimpr.cxx |    2 --
 filter/source/graphicfilter/icgm/bitmap.hxx  |    2 --
 filter/source/graphicfilter/ipcd/ipcd.cxx    |    4 ----
 filter/source/graphicfilter/itiff/itiff.cxx  |    3 ---
 filter/source/msfilter/eschesdo.cxx          |   18 ++----------------
 filter/source/msfilter/eschesdo.hxx          |   10 ----------
 filter/source/pdf/pdfexport.cxx              |    3 +--
 filter/source/pdf/pdfexport.hxx              |    1 -
 filter/source/svg/svgwriter.cxx              |    6 ------
 filter/source/svg/svgwriter.hxx              |    3 +--
 11 files changed, 5 insertions(+), 61 deletions(-)

New commits:
commit 2a4c68a6ffa46eb7b6d7fafdf5e9c19970cdd6a5
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Jun 27 15:11:15 2016 +0200

    loplugin:singlevalfields in filter
    
    Change-Id: I6f7220e54178ba9e2c25adda2c1e048d3a222d43
    Reviewed-on: https://gerrit.libreoffice.org/26709
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index 14a3c87..4ab22f2 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -96,7 +96,6 @@ class PSWriter
 private:
     bool                mbStatus;
     sal_uLong           mnLevelWarning;     // number of embedded eps files which was not exported
-    sal_uLong           mnLastPercent;      // the number with which pCallback was called the last time
     sal_uInt32          mnLatestPush;       // offset to streamposition, where last push was done
 
     long                mnLevel;            // dialog options
@@ -111,7 +110,6 @@ private:
     ScopedVclPtrInstance<VirtualDevice> pVDev;
 
     double              nBoundingX1;        // this represents the bounding box
-    double              nBoundingY1;
     double              nBoundingX2;
     double              nBoundingY2;
 
@@ -126,7 +124,6 @@ private:
     bool                bTextFillColor;
     Color               aTextFillColor;
     Color               aBackgroundColor;
-    bool                bRegionChanged;
     TextAlign           eTextAlign;
 
     double                      fLineWidth;
@@ -137,7 +134,6 @@ private:
 
     vcl::Font           maFont;
     vcl::Font           maLastFont;
-    sal_uInt8           nChrSet;
     sal_uInt8           nNextChrSetId;      // first unused ChrSet-Id
 
     PSLZWCTreeNode*     pTable;             // LZW compression data
@@ -236,7 +232,6 @@ public:
 PSWriter::PSWriter()
     : mbStatus(false)
     , mnLevelWarning(0)
-    , mnLastPercent(0)
     , mnLatestPush(0)
     , mnLevel(0)
     , mbGrayScale(false)
@@ -248,7 +243,6 @@ PSWriter::PSWriter()
     , pAMTF(nullptr)
     , pVDev()
     , nBoundingX1(0)
-    , nBoundingY1(0)
     , nBoundingX2(0)
     , nBoundingY2(0)
     , pGDIStack(nullptr)
@@ -262,7 +256,6 @@ PSWriter::PSWriter()
     , bTextFillColor(false)
     , aTextFillColor()
     , aBackgroundColor()
-    , bRegionChanged(false)
     , eTextAlign()
     , fLineWidth(0)
     , fMiterLimit(0)
@@ -271,7 +264,6 @@ PSWriter::PSWriter()
     , aDashArray()
     , maFont()
     , maLastFont()
-    , nChrSet(0)
     , nNextChrSetId(0)
     , pTable(nullptr)
     , pPrefix(nullptr)
@@ -299,7 +291,6 @@ bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Filter
     mbStatus = true;
     mnPreview = 0;
     mnLevelWarning = 0;
-    mnLastPercent = 0;
     mnLatestPush = 0xEFFFFFFE;
 
     if ( pFilterConfigItem )
@@ -410,7 +401,7 @@ bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Filter
         pMTF = pAMTF;
     }
     pVDev->SetMapMode( pMTF->GetPrefMapMode() );
-    nBoundingX1 = nBoundingY1 = 0;
+    nBoundingX1 = 0;
     nBoundingX2 = pMTF->GetPrefSize().Width();
     nBoundingY2 = pMTF->GetPrefSize().Height();
 
@@ -428,9 +419,7 @@ bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Filter
     eJoinType = SvtGraphicStroke::joinMiter;
     aBackgroundColor = Color( COL_WHITE );
     eTextAlign = ALIGN_BASELINE;
-    bRegionChanged = false;
 
-    nChrSet = 0x00;
     nNextChrSetId = 1;
 
     if( pMTF->GetActionSize() )
@@ -1073,7 +1062,6 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev )
                 pGS->bTextFillCol = bTextFillColor;
                 pGS->aTextFillCol = aTextFillColor;
                 pGS->aBackgroundCol = aBackgroundColor;
-                bRegionChanged = false;
                 pGS->aFont = maFont;
                 mnLatestPush = mpPS->Tell();
                 ImplWriteLine( "gs" );
diff --git a/filter/source/graphicfilter/icgm/actimpr.cxx b/filter/source/graphicfilter/icgm/actimpr.cxx
index c260568..f7d053b 100644
--- a/filter/source/graphicfilter/icgm/actimpr.cxx
+++ b/filter/source/graphicfilter/icgm/actimpr.cxx
@@ -537,8 +537,6 @@ void CGMImpressOutAct::DrawBitmap( CGMBitmapDescriptor* pBmpDesc )
         BmpMirrorFlags nMirr = BmpMirrorFlags::NONE;
         if ( pBmpDesc->mbVMirror )
             nMirr |= BmpMirrorFlags::Vertical;
-        if ( pBmpDesc->mbHMirror )
-            nMirr |= BmpMirrorFlags::Horizontal;
         if ( nMirr != BmpMirrorFlags::NONE )
             pBmpDesc->mpBitmap->Mirror( nMirr );
 
diff --git a/filter/source/graphicfilter/icgm/bitmap.hxx b/filter/source/graphicfilter/icgm/bitmap.hxx
index 6614a0e..5fba2d7 100644
--- a/filter/source/graphicfilter/icgm/bitmap.hxx
+++ b/filter/source/graphicfilter/icgm/bitmap.hxx
@@ -33,7 +33,6 @@ class CGMBitmapDescriptor
         BitmapWriteAccess*      mpAcc;
         bool                mbStatus;
         bool                mbVMirror;
-        bool                mbHMirror;
         sal_uInt32              mnDstBitsPerPixel;
         sal_uInt32              mnScanSize;         // bytes per line
         FloatPoint              mnP, mnQ, mnR;
@@ -52,7 +51,6 @@ class CGMBitmapDescriptor
             , mpAcc(nullptr)
             , mbStatus(false)
             , mbVMirror(false)
-            , mbHMirror(false)
             , mnDstBitsPerPixel(0)
             , mnScanSize(0)
             , mndx(0.0)
diff --git a/filter/source/graphicfilter/ipcd/ipcd.cxx b/filter/source/graphicfilter/ipcd/ipcd.cxx
index 7ae9f32..c78101e 100644
--- a/filter/source/graphicfilter/ipcd/ipcd.cxx
+++ b/filter/source/graphicfilter/ipcd/ipcd.cxx
@@ -45,8 +45,6 @@ private:
 
     bool bStatus;
 
-    sal_uLong               nLastPercent;
-
     SvStream &m_rPCD;
     BitmapWriteAccess*  mpAcc;
 
@@ -78,7 +76,6 @@ public:
 
     explicit PCDReader(SvStream &rStream)
         : bStatus(false)
-        , nLastPercent(0)
         , m_rPCD(rStream)
         , mpAcc(nullptr)
         , nOrientation(0)
@@ -101,7 +98,6 @@ bool PCDReader::ReadPCD( Graphic & rGraphic, FilterConfigItem* pConfigItem )
     Bitmap       aBmp;
 
     bStatus      = true;
-    nLastPercent = 0;
 
     // is it a PCD file with a picture? ( sets bStatus == sal_False, if that's not the case):
     CheckPCDImagePacFile();
diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx
index 609786a..39f7336 100644
--- a/filter/source/graphicfilter/itiff/itiff.cxx
+++ b/filter/source/graphicfilter/itiff/itiff.cxx
@@ -47,7 +47,6 @@ private:
 
     bool                bStatus;                    // Whether until now no error occurred
     Animation               aAnimation;
-    sal_uLong               nLastPercent;
 
     SvStream*               pTIFF;                      // the TIFF file that should be read
     Bitmap                  aBitmap;
@@ -125,7 +124,6 @@ public:
 
     TIFFReader()
         : bStatus(false)
-        , nLastPercent(0)
         , pTIFF(nullptr)
         , pAcc(nullptr)
         , nDstBitsPerPixel(0)
@@ -1177,7 +1175,6 @@ bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic )
     sal_uInt32 nFirstIfd(0), nDataLen;
 
     bStatus = true;
-    nLastPercent = 0;
 
     pTIFF = &rTIFF;
     nMaxPos = nOrigPos = pTIFF->Tell();
diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx
index 1cbb28a8..50df810 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -69,13 +69,7 @@ ImplEESdrWriter::ImplEESdrWriter( EscherEx& rEx )
     , mpPicStrm(nullptr)
     , mpHostAppData(nullptr)
     , mnPagesWritten(0)
-    , mnShapeMasterBody(0)
-    , mnIndices(0)
-    , mnOutlinerCount(0)
-    , mnStatMaxValue(0)
-    , mnEffectCount(0)
     , mbIsTitlePossible(false)
-    , mbStatusIndicator(false)
 {
 }
 
@@ -526,7 +520,7 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
                 aPropOpt.AddOpt( ESCHER_Prop_lTxid, nTxtBxId );
                 aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x10001 );
                 aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x10001 );
-                aPropOpt.AddOpt( ESCHER_Prop_hspMaster, mnShapeMasterBody );
+                aPropOpt.AddOpt( ESCHER_Prop_hspMaster, 0 );
             }
             else
             {
@@ -592,7 +586,7 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
                 aPropOpt.AddOpt( ESCHER_Prop_lTxid, nTxtBxId );
                 aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x10001 );
                 aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x10001 );
-                aPropOpt.AddOpt( ESCHER_Prop_hspMaster, mnShapeMasterBody );
+                aPropOpt.AddOpt( ESCHER_Prop_hspMaster, 0 );
             }
             else
             {
@@ -812,9 +806,6 @@ sal_uInt32 ImplEESdrWriter::ImplEnterAdditionalTextGroup( const Reference< XShap
 
 bool ImplEESdrWriter::ImplInitPageValues()
 {
-    mnIndices = 0;
-    mnOutlinerCount = 0;                // die outline objects must be in accordance with the layout.
-    mnEffectCount = 0;
     mbIsTitlePossible = true;       // With more than one title PowerPoint will fail.
 
     return true;
@@ -832,11 +823,6 @@ void ImplEESdrWriter::ImplWritePage(
         if( nPer != nLastPer )
         {
             nLastPer = nPer;
-            sal_uInt32 nValue = mnPagesWritten * 5 + nPer;
-            if( nValue > mnStatMaxValue )
-                nValue = mnStatMaxValue;
-            if( mbStatusIndicator )
-                mXStatusIndicator->setValue( nValue );
         }
 
         ImplEESdrObject aObj( *this, *o3tl::doAccess<Reference<XShape>>(
diff --git a/filter/source/msfilter/eschesdo.hxx b/filter/source/msfilter/eschesdo.hxx
index 13e37ed..f583761 100644
--- a/filter/source/msfilter/eschesdo.hxx
+++ b/filter/source/msfilter/eschesdo.hxx
@@ -123,17 +123,7 @@ protected:
 
     sal_uInt32              mnPagesWritten;
 
-    sal_uInt32              mnShapeMasterBody;
-
-    // per page values
-    sal_uInt32              mnIndices;
-    sal_uInt32              mnOutlinerCount;
-    sal_uInt32              mnStatMaxValue;
-
-    sal_uInt16              mnEffectCount;
-
     bool                    mbIsTitlePossible;
-    bool                    mbStatusIndicator;
 
 
     explicit ImplEESdrWriter( EscherEx& rEx );
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index c98b072..6e4d644 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -125,7 +125,6 @@ PDFExport::PDFExport( const Reference< XComponent >& rxSrcDoc,
     mnZoom                      ( 100 ),
     mnInitialPage               ( 1 ),
     mnPDFPageLayout             ( 0 ),
-    mbFirstPageLeft             ( false ),
 
     mbEncrypt                   ( false ),
     mbRestrictPermissions       ( false ),
@@ -646,7 +645,7 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >&
                     break;
             }
 
-            aContext.FirstPageLeft = mbFirstPageLeft;
+            aContext.FirstPageLeft = false;
 
             // check if PDF/A, which does not allow encryption
             if( aContext.Version != vcl::PDFWriter::PDF_A_1 )
diff --git a/filter/source/pdf/pdfexport.hxx b/filter/source/pdf/pdfexport.hxx
index c4c021f..5b9391a 100644
--- a/filter/source/pdf/pdfexport.hxx
+++ b/filter/source/pdf/pdfexport.hxx
@@ -81,7 +81,6 @@ private:
     sal_Int32           mnZoom;
     sal_Int32           mnInitialPage;
     sal_Int32           mnPDFPageLayout;
-    bool                mbFirstPageLeft;
 
     bool                mbEncrypt;
     bool                mbRestrictPermissions;
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 902cd31..3fb3f4cd 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -439,7 +439,6 @@ SVGTextWriter::SVGTextWriter( SVGExport& rExport )
   mbIsURLField( false ),
   msUrl(),
   mbIsPlaceholderShape( false ),
-  mbIWS( false ),
   maCurrentFont(),
   maParentFont()
 {
@@ -1699,7 +1698,6 @@ SVGActionWriter::SVGActionWriter( SVGExport& rExport, SVGFontExport& rFontExport
     mrFontExport( rFontExport ),
     mpContext( nullptr ),
     maTextWriter( rExport ),
-    mnInnerMtfCount( 0 ),
     mbClipAttrChanged( false ),
     mbIsPlaceholderShape( false )
 {
@@ -2688,10 +2686,6 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf,
     // generation
     sal_Int32 nEntryCount(0);
 
-    if( mnInnerMtfCount )
-        nWriteFlags |= SVGWRITER_NO_SHAPE_COMMENTS;
-
-
 #if OSL_DEBUG_LEVEL > 0
     bool bIsTextShape = false;
     if( !mrExport.IsUsePositionedCharacters() && pxShape
diff --git a/filter/source/svg/svgwriter.hxx b/filter/source/svg/svgwriter.hxx
index e264275..38eedc0 100644
--- a/filter/source/svg/svgwriter.hxx
+++ b/filter/source/svg/svgwriter.hxx
@@ -183,7 +183,7 @@ class SVGTextWriter
     OUString                                    msUrl;
     OUString                                    msHyperlinkIdList;
     bool                                        mbIsPlaceholderShape;
-    bool                                        mbIWS;
+    static const bool                           mbIWS = false;
     vcl::Font                                   maCurrentFont;
     vcl::Font                                   maParentFont;
 
@@ -268,7 +268,6 @@ private:
     SVGTextWriter                               maTextWriter;
     VclPtr<VirtualDevice>                       mpVDev;
     MapMode                                     maTargetMapMode;
-    sal_uInt32                                  mnInnerMtfCount;
     bool                                    mbClipAttrChanged;
     bool                                    mbIsPlaceholderShape;
 


More information about the Libreoffice-commits mailing list