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

Noel Grandin noel at peralex.com
Mon Feb 22 14:42:02 UTC 2016


 filter/source/flash/swfwriter1.cxx               |    3 -
 filter/source/graphicfilter/eps/eps.cxx          |    6 +-
 filter/source/graphicfilter/icgm/cgmtypes.hxx    |    2 
 filter/source/graphicfilter/ipbm/ipbm.cxx        |    3 -
 filter/source/graphicfilter/ipcd/ipcd.cxx        |    3 -
 filter/source/graphicfilter/itga/itga.cxx        |    5 +-
 filter/source/msfilter/escherex.cxx              |    3 -
 filter/source/msfilter/msdffimp.cxx              |   51 ++++++++++++++++++-----
 filter/source/msfilter/svdfppt.cxx               |   21 ++++++---
 filter/source/svg/svgexport.cxx                  |   18 +++++---
 filter/source/svg/svgwriter.cxx                  |    6 +-
 filter/source/xsltdialog/typedetectionexport.cxx |    6 +-
 12 files changed, 91 insertions(+), 36 deletions(-)

New commits:
commit bc9aa454ff63a7aa308b84c0170c48dc5267c040
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Feb 22 16:41:20 2016 +0200

    loplugin:commaoperator in filter/
    
    Change-Id: I88697862bfb160d4d7d257bf425507567deae837

diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx
index cdb956d..0bf5aca 100644
--- a/filter/source/flash/swfwriter1.cxx
+++ b/filter/source/flash/swfwriter1.cxx
@@ -1549,7 +1549,8 @@ void Writer::Impl_writeActions( const GDIMetaFile& rMtf )
                     aSrcPt.Y() = FRound( aSrcPt.Y() * fScaleY );
                 }
 
-                nMoveX = aDestPt.X() - aSrcPt.X(), nMoveY = aDestPt.Y() - aSrcPt.Y();
+                nMoveX = aDestPt.X() - aSrcPt.X();
+                nMoveY = aDestPt.Y() - aSrcPt.Y();
 
                 if( nMoveX || nMoveY )
                     aTmpMtf.Move( nMoveX, nMoveY );
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index aaa5fd0..0704a13 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -1208,10 +1208,12 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev )
                 if( fScaleX != 1.0 || fScaleY != 1.0 )
                 {
                     aTmpMtf.Scale( fScaleX, fScaleY );
-                    aSrcPt.X() = FRound( aSrcPt.X() * fScaleX ), aSrcPt.Y() = FRound( aSrcPt.Y() * fScaleY );
+                    aSrcPt.X() = FRound( aSrcPt.X() * fScaleX );
+                    aSrcPt.Y() = FRound( aSrcPt.Y() * fScaleY );
                 }
 
-                nMoveX = aDestPt.X() - aSrcPt.X(), nMoveY = aDestPt.Y() - aSrcPt.Y();
+                nMoveX = aDestPt.X() - aSrcPt.X();
+                nMoveY = aDestPt.Y() - aSrcPt.Y();
 
                 if( nMoveX || nMoveY )
                     aTmpMtf.Move( nMoveX, nMoveY );
diff --git a/filter/source/graphicfilter/icgm/cgmtypes.hxx b/filter/source/graphicfilter/icgm/cgmtypes.hxx
index b551788..ef560ed 100644
--- a/filter/source/graphicfilter/icgm/cgmtypes.hxx
+++ b/filter/source/graphicfilter/icgm/cgmtypes.hxx
@@ -25,7 +25,7 @@ struct FloatPoint
         double          X;
         double          Y;
         FloatPoint():X(0), Y(0){};
-        FloatPoint( const double& rX, const double& rY ) { X = rX, Y = rY; };
+        FloatPoint( const double& rX, const double& rY ) { X = rX; Y = rY; };
 };
 
 struct FloatRect
diff --git a/filter/source/graphicfilter/ipbm/ipbm.cxx b/filter/source/graphicfilter/ipbm/ipbm.cxx
index f77499e..58d376e 100644
--- a/filter/source/graphicfilter/ipbm/ipbm.cxx
+++ b/filter/source/graphicfilter/ipbm/ipbm.cxx
@@ -132,7 +132,8 @@ bool PBMReader::ReadPBM(Graphic & rGraphic )
 
     if ( mpAcc )
     {
-        Bitmap::ReleaseAccess( mpAcc ), mpAcc = nullptr;
+        Bitmap::ReleaseAccess( mpAcc );
+        mpAcc = nullptr;
     }
     if ( mbStatus )
         rGraphic = maBmp;
diff --git a/filter/source/graphicfilter/ipcd/ipcd.cxx b/filter/source/graphicfilter/ipcd/ipcd.cxx
index d4568d0..42861de 100644
--- a/filter/source/graphicfilter/ipcd/ipcd.cxx
+++ b/filter/source/graphicfilter/ipcd/ipcd.cxx
@@ -161,7 +161,8 @@ bool PCDReader::ReadPCD( Graphic & rGraphic, FilterConfigItem* pConfigItem )
 
         ReadImage();
 
-        Bitmap::ReleaseAccess( mpAcc ), mpAcc = nullptr;
+        Bitmap::ReleaseAccess( mpAcc );
+        mpAcc = nullptr;
         rGraphic = aBmp;
     }
     return bStatus;
diff --git a/filter/source/graphicfilter/itga/itga.cxx b/filter/source/graphicfilter/itga/itga.cxx
index 571421d..20a9006 100644
--- a/filter/source/graphicfilter/itga/itga.cxx
+++ b/filter/source/graphicfilter/itga/itga.cxx
@@ -159,7 +159,10 @@ bool TGAReader::ReadTGA(Graphic & rGraphic)
                 mbStatus = false;
 
             if ( mpAcc )
-                Bitmap::ReleaseAccess ( mpAcc), mpAcc = nullptr;
+            {
+                Bitmap::ReleaseAccess ( mpAcc);
+                mpAcc = nullptr;
+            }
 
             if ( mbStatus )
                 rGraphic = aBitmap;
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 79108f71b..0dbec5d 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -4453,7 +4453,8 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const OStrin
                 rPicOutStrm.WriteUInt32( nPos - nAtomSize );
                 rPicOutStrm.Seek( nPos );
             }
-            nBlibId = ImplInsertBlib( p_EscherBlibEntry ), p_EscherBlibEntry = nullptr;
+            nBlibId = ImplInsertBlib( p_EscherBlibEntry );
+            p_EscherBlibEntry = nullptr;
         }
     }
     delete p_EscherBlibEntry;
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index b80374e..2806895 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -1135,16 +1135,28 @@ void ApplyRectangularGradientAsBitmap( const SvxMSDffManager& rManager, SvStream
                         if ( fY < fFocusY )
                         {
                             if ( fX > fY )
-                                fDist = fY, fD = fFocusY;
+                            {
+                                fDist = fY;
+                                fD = fFocusY;
+                            }
                             else
-                                fDist = fX, fD = fFocusX;
+                            {
+                                fDist = fX;
+                                fD = fFocusX;
+                            }
                         }
                         else
                         {
                             if ( fX > ( 1 - fY ) )
-                                fDist = ( 1 - fY ), fD = 1 - fFocusY;
+                            {
+                                fDist = 1 - fY;
+                                fD = 1 - fFocusY;
+                            }
                             else
-                                fDist = fX, fD = fFocusX;
+                            {
+                                fDist = fX;
+                                fD = fFocusX;
+                            }
                         }
                     }
                     else
@@ -1152,16 +1164,28 @@ void ApplyRectangularGradientAsBitmap( const SvxMSDffManager& rManager, SvStream
                         if ( fY < fFocusY )
                         {
                             if ( ( 1 - fX ) > fY )
-                                fDist = fY, fD = fFocusY;
+                            {
+                                fDist = fY;
+                                fD = fFocusY;
+                            }
                             else
-                                fDist = ( 1 - fX ), fD = 1 - fFocusX;
+                            {
+                                fDist = 1 - fX;
+                                fD = 1 - fFocusX;
+                            }
                         }
                         else
                         {
                             if ( ( 1 - fX ) > ( 1 - fY ) )
-                                fDist = ( 1 - fY ), fD = 1 - fFocusY;
+                            {
+                                fDist = 1 - fY;
+                                fD = 1 - fFocusY;
+                            }
                             else
-                                fDist = ( 1 - fX ), fD = 1 - fFocusX;
+                            {
+                                fDist = 1 - fX;
+                                fD = 1 - fFocusX;
+                            }
                         }
                     }
                     if ( fD != 0.0 )
@@ -2940,7 +2964,8 @@ void DffRecordManager::Consume( SvStream& rIn, bool bAppend, sal_uInt32 nStOfs )
 void DffRecordManager::Clear()
 {
     pCList = static_cast<DffRecordList*>(this);
-    delete pNext, pNext = nullptr;
+    delete pNext;
+    pNext = nullptr;
     nCurrent = 0;
     nCount = 0;
 }
@@ -4842,7 +4867,10 @@ Rectangle SvxMSDffManager::GetGlobalChildAnchor( const DffRecordHeader& rHd, SvS
                         {
                             sal_Int16 ls, ts, rs, bs;
                             rSt.ReadInt16( ts ).ReadInt16( ls ).ReadInt16( rs ).ReadInt16( bs ); // the order of coordinates is a bit strange...
-                            l = ls, t = ts, r = rs, b = bs;
+                            l = ls;
+                            t = ts;
+                            r = rs;
+                            b = bs;
                         }
                         Scale( l );
                         Scale( t );
@@ -6320,7 +6348,8 @@ bool SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData, Rect
                 aMtfSize100.Height() = height;
 
                 // scale to 1/100mm
-                aMtfSize100.Width() /= 360, aMtfSize100.Height() /= 360;
+                aMtfSize100.Width() /= 360;
+                aMtfSize100.Height() /= 360;
 
                 if ( pVisArea )     // seem that we currently are skipping the visarea position
                     *pVisArea = Rectangle( Point(), aMtfSize100 );
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index ab232e8..c778a0a 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -596,7 +596,10 @@ void SdrEscherImport::ProcessClientAnchor2( SvStream& rSt, DffRecordHeader& rHd,
     {
         sal_Int16 ls, ts, rs, bs;
         rSt.ReadInt16( ts ).ReadInt16( ls ).ReadInt16( rs ).ReadInt16( bs ); // the order of coordinates is a bit strange...
-        l = ls, t = ts, r = rs, b = bs;
+        l = ls;
+        t = ts;
+        r = rs;
+        b = bs;
     }
     Scale( l );
     Scale( t );
@@ -1972,7 +1975,10 @@ SvMemoryStream* SdrPowerPointImport::ImportExOleObjStg( sal_uInt32 nPersistPtr,
                 aZCodec.BeginCompression();
                 aZCodec.Decompress( rStCtrl, *pRet );
                 if ( !aZCodec.EndCompression() )
-                    delete pRet, pRet = nullptr;
+                {
+                    delete pRet;
+                    pRet = nullptr;
+                }
             }
         }
         rStCtrl.Seek( nOldPos );
@@ -6963,7 +6969,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
                                             if ( aString[nCount] == 0x2a )
                                             {
                                                 sal_uInt32 nBehind = aString.getLength() - ( nCount + 1 );
-                                                (pSet->maString).clear();
+                                                pSet->maString.clear();
                                                 if ( nBehind )
                                                 {
                                                     PPTCharPropSet* pNewCPS = new PPTCharPropSet( *pSet );
@@ -6973,7 +6979,8 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
                                                 if ( (*FE)->pField2 )
                                                 {
                                                     PPTCharPropSet* pNewCPS = new PPTCharPropSet( *pSet );
-                                                    pNewCPS->mpFieldItem = (*FE)->pField2, (*FE)->pField2 = nullptr;
+                                                    pNewCPS->mpFieldItem = (*FE)->pField2;
+                                                    (*FE)->pField2 = nullptr;
                                                     aCharPropList.insert( aCharPropList.begin() + n + 1, pNewCPS );
 
                                                     pNewCPS = new PPTCharPropSet( *pSet );
@@ -6988,7 +6995,8 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
                                                 }
                                                 if ( (*FE)->pField1 )
                                                 {
-                                                    pSet->mpFieldItem = (*FE)->pField1, (*FE)->pField1 = nullptr;
+                                                    pSet->mpFieldItem = (*FE)->pField1;
+                                                    (*FE)->pField1 = nullptr;
                                                 }
                                                 else if ( (*FE)->pString )
                                                     pSet->maString = *(*FE)->pString;
@@ -7067,7 +7075,8 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
                                                             }
                                                             nIdx++;
                                                         }
-                                                        delete (*FE)->pField1, (*FE)->pField1 = nullptr;
+                                                        delete (*FE)->pField1;
+                                                        (*FE)->pField1 = nullptr;
 
                                                         if ( pBefCPS )
                                                         {
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 1fcd970..d66c8aa 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -414,7 +414,8 @@ ObjectRepresentation& ObjectRepresentation::operator=( const ObjectRepresentatio
     if (this == &rPresentation)
         return *this;
     mxObject = rPresentation.mxObject;
-    delete mpMtf, ( mpMtf = rPresentation.mpMtf ? new GDIMetaFile( *rPresentation.mpMtf ) : nullptr );
+    delete mpMtf;
+    mpMtf = rPresentation.mpMtf ? new GDIMetaFile( *rPresentation.mpMtf ) : nullptr;
 
     return *this;
 }
@@ -604,7 +605,8 @@ bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
                 }
                 catch( ... )
                 {
-                    delete mpSVGDoc, mpSVGDoc = nullptr;
+                    delete mpSVGDoc;
+                    mpSVGDoc = nullptr;
                     OSL_FAIL( "Exception caught" );
                 }
 
@@ -624,10 +626,13 @@ bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
                     }
                 }
 
-                delete mpSVGWriter, mpSVGWriter = nullptr;
+                delete mpSVGWriter;
+                mpSVGWriter = nullptr;
                 mpSVGExport = nullptr; // pointed object is released by xSVGExport dtor at the end of this scope
-                delete mpSVGFontExport, mpSVGFontExport = nullptr;
-                delete mpObjects, mpObjects = nullptr;
+                delete mpSVGFontExport;
+                mpSVGFontExport = nullptr;
+                delete mpObjects;
+                mpObjects = nullptr;
                 mbPresentation = false;
             }
         }
@@ -887,7 +892,8 @@ bool SVGFilter::implExportDocument()
                 implGenerateScript();
             }
 
-            delete mpSVGDoc, mpSVGDoc = nullptr;
+            delete mpSVGDoc;
+            mpSVGDoc = nullptr;
             bRet = true;
         }
     }
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 6c6ff63b..2caae96 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -2349,10 +2349,12 @@ void SVGActionWriter::ImplWriteMask( GDIMetaFile& rMtf,
     if( fScaleX != 1.0 || fScaleY != 1.0 )
     {
         rMtf.Scale( fScaleX, fScaleY );
-        aSrcPt.X() = FRound( aSrcPt.X() * fScaleX ), aSrcPt.Y() = FRound( aSrcPt.Y() * fScaleY );
+        aSrcPt.X() = FRound( aSrcPt.X() * fScaleX );
+        aSrcPt.Y() = FRound( aSrcPt.Y() * fScaleY );
     }
 
-    nMoveX = rDestPt.X() - aSrcPt.X(), nMoveY = rDestPt.Y() - aSrcPt.Y();
+    nMoveX = rDestPt.X() - aSrcPt.X();
+    nMoveY = rDestPt.Y() - aSrcPt.Y();
 
     if( nMoveX || nMoveY )
         rMtf.Move( nMoveX, nMoveY );
diff --git a/filter/source/xsltdialog/typedetectionexport.cxx b/filter/source/xsltdialog/typedetectionexport.cxx
index eef44cf..bb307e1 100644
--- a/filter/source/xsltdialog/typedetectionexport.cxx
+++ b/filter/source/xsltdialog/typedetectionexport.cxx
@@ -169,11 +169,11 @@ void TypeDetectionExporter::doExport( Reference< XOutputStream > xOS,  const XML
                 OUString sValue("0");
                 sValue += sComma;
                 sValue += pFilter->maType;
-                sValue += sComma,
+                sValue += sComma;
                 sValue += pFilter->maDocumentService;
-                sValue += sComma,
+                sValue += sComma;
                 sValue += sFilterAdaptorService;
-                sValue += sComma,
+                sValue += sComma;
                 sValue += OUString::number( pFilter->maFlags );
                 sValue += sComma;
                 sValue += sXSLTFilterService;


More information about the Libreoffice-commits mailing list