[Libreoffice-commits] .: 4 commits - binfilter/bf_starmath filter/source

Caolán McNamara caolan at kemper.freedesktop.org
Thu Dec 9 13:12:37 PST 2010


 binfilter/bf_starmath/source/starmath_document.cxx |    5 --
 filter/source/flash/swfwriter.cxx                  |    4 -
 filter/source/graphicfilter/ipcd/ipcd.cxx          |   44 ++++++++++-----------
 3 files changed, 25 insertions(+), 28 deletions(-)

New commits:
commit 8ae5c6ad27d3ace48c8f3b5d94c72e2e77ab650d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 9 17:28:29 2010 +0000

    cppcheck: unused variable

diff --git a/binfilter/bf_starmath/source/starmath_document.cxx b/binfilter/bf_starmath/source/starmath_document.cxx
index 588f7b3..7489f3b 100644
--- a/binfilter/bf_starmath/source/starmath_document.cxx
+++ b/binfilter/bf_starmath/source/starmath_document.cxx
@@ -771,7 +771,6 @@ BOOL SmDocShell::Try2x (SvStorage *pStor,
         UINT32       lDataSize;
         String       aBuffer;
         ByteString   aByteStr;
-        SmSymSet    *pSymbolSet;
 
         *pSvStream >> lDataSize >> lIdent >> lVersion;
 
@@ -812,10 +811,6 @@ BOOL SmDocShell::Try2x (SvStorage *pStor,
 
                     case 'S':
                     {
-                        // not sure about this...
-                        /* ??? pSymbolSet = new SmSymSet();
-                        ReadSM20SymSet(pSvStream, pSymbolSet);
-                        delete pSymbolSet; */
                         String      aTmp;
                         USHORT      n;
                         pSvStream->ReadByteString(aTmp, eEnc);
commit 38ea8d367473c0e2115b80e4970b3e3fb57da1c5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 9 17:23:08 2010 +0000

    clean this up and just use references

diff --git a/filter/source/graphicfilter/ipcd/ipcd.cxx b/filter/source/graphicfilter/ipcd/ipcd.cxx
index 6ec8509..07bd69c 100644
--- a/filter/source/graphicfilter/ipcd/ipcd.cxx
+++ b/filter/source/graphicfilter/ipcd/ipcd.cxx
@@ -58,7 +58,7 @@ private:
 
     ULONG				nLastPercent;
 
-    SvStream*			pPCD;
+    SvStream &m_rPCD;
     BitmapWriteAccess*	mpAcc;
 
     BYTE				nOrientation;	// Ausrichtung des Bildes in der PCD-Datei:
@@ -89,21 +89,23 @@ private:
 
 public:
 
-    PCDReader() {}
+    PCDReader(SvStream &rStream)
+        : m_rPCD(rStream)
+    {
+    }
     ~PCDReader() {}
 
-    BOOL ReadPCD( SvStream & rPCD, Graphic & rGraphic, FilterConfigItem* pConfigItem );
+    BOOL ReadPCD( Graphic & rGraphic, FilterConfigItem* pConfigItem );
 };
 
 //=================== Methoden von PCDReader ==============================
 
-BOOL PCDReader::ReadPCD( SvStream & rPCD, Graphic & rGraphic, FilterConfigItem* pConfigItem )
+BOOL PCDReader::ReadPCD( Graphic & rGraphic, FilterConfigItem* pConfigItem )
 {
     Bitmap		 aBmp;
 
     bStatus      = TRUE;
     nLastPercent = 0;
-    pPCD         = &rPCD;
 
     MayCallback( 0 );
 
@@ -194,8 +196,8 @@ void PCDReader::CheckPCDImagePacFile()
 {
     char Buf[ 8 ];
 
-    pPCD->Seek( 2048 );
-    pPCD->Read( Buf, 7 );
+    m_rPCD.Seek( 2048 );
+    m_rPCD.Read( Buf, 7 );
     Buf[ 7 ] = 0;
     if ( ByteString( Buf ).CompareTo( "PCD_IPI" ) != COMPARE_EQUAL )
         bStatus = FALSE;
@@ -207,8 +209,8 @@ void PCDReader::ReadOrientation()
 {
     if ( bStatus == FALSE )
         return;
-    pPCD->Seek( 194635 );
-    *pPCD >> nOrientation;
+    m_rPCD.Seek( 194635 );
+    m_rPCD >> nOrientation;
     nOrientation &= 0x03;
 }
 
@@ -255,13 +257,13 @@ void PCDReader::ReadImage(ULONG nMinPercent, ULONG nMaxPercent)
         return;
     }
 
-    pPCD->Seek( nImagePos );
+    m_rPCD.Seek( nImagePos );
 
     // naechstes Zeilen-Paar := erstes Zeile-Paar:
-    pPCD->Read( pL0N, nWidth );
-    pPCD->Read( pL1N, nWidth );
-    pPCD->Read( pCbN, nW2 );
-    pPCD->Read( pCrN, nW2 );
+    m_rPCD.Read( pL0N, nWidth );
+    m_rPCD.Read( pL1N, nWidth );
+    m_rPCD.Read( pCbN, nW2 );
+    m_rPCD.Read( pCrN, nW2 );
     pCbN[ nW2 ] = pCbN[ nW2 - 1 ];
     pCrN[ nW2 ] = pCrN[ nW2 - 1 ];
 
@@ -276,10 +278,10 @@ void PCDReader::ReadImage(ULONG nMinPercent, ULONG nMaxPercent)
         // naechstes Zeilen-Paar holen:
         if ( nYPair < nH2 - 1 )
         {
-            pPCD->Read( pL0N, nWidth );
-            pPCD->Read( pL1N, nWidth );
-            pPCD->Read( pCbN, nW2 );
-            pPCD->Read( pCrN, nW2 );
+            m_rPCD.Read( pL0N, nWidth );
+            m_rPCD.Read( pL1N, nWidth );
+            m_rPCD.Read( pCbN, nW2 );
+            m_rPCD.Read( pCrN, nW2 );
             pCbN[nW2]=pCbN[ nW2 - 1 ];
             pCrN[nW2]=pCrN[ nW2 - 1 ];
         }
@@ -369,7 +371,7 @@ void PCDReader::ReadImage(ULONG nMinPercent, ULONG nMaxPercent)
             }
         }
 
-        if ( pPCD->GetError() )
+        if ( m_rPCD.GetError() )
             bStatus = FALSE;
         MayCallback( nMinPercent + ( nMaxPercent - nMinPercent ) * nYPair / nH2 );
         if ( bStatus == FALSE )
@@ -389,8 +391,8 @@ void PCDReader::ReadImage(ULONG nMinPercent, ULONG nMaxPercent)
 
 extern "C" BOOL __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem* pConfigItem, BOOL )
 {
-    PCDReader aPCDReader;
-    return aPCDReader.ReadPCD( rStream, rGraphic, pConfigItem );
+    PCDReader aPCDReader(rStream);
+    return aPCDReader.ReadPCD(rGraphic, pConfigItem);
 }
 
 //============================= fuer Windows ==================================
commit a0f99d26d33b725fd4c4e44bf2b3c6ad424918a5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 9 17:17:56 2010 +0000

    cppcheck: unused variable

diff --git a/filter/source/flash/swfwriter.cxx b/filter/source/flash/swfwriter.cxx
index 0452e16..0fa0268 100644
--- a/filter/source/flash/swfwriter.cxx
+++ b/filter/source/flash/swfwriter.cxx
@@ -596,7 +596,7 @@ sal_Bool Writer::streamSound( const char * filename )
         delete[] mp3buffer;
 
         delete[] sample_buff;
-        int err = sf_close(sf);
+        sf_close(sf);
 
         // 8. free the internal data structures.
         lame_close(m_lame_flags);
commit 6d807dcec59942ed73b8c057de33710c2b0d7827
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 9 17:17:01 2010 +0000

    cppcheck: the scope of these variables can be reduced

diff --git a/filter/source/flash/swfwriter.cxx b/filter/source/flash/swfwriter.cxx
index fa7dd63..0452e16 100644
--- a/filter/source/flash/swfwriter.cxx
+++ b/filter/source/flash/swfwriter.cxx
@@ -355,7 +355,6 @@ sal_uInt16 Writer::defineShape( const GDIMetaFile& rMtf, sal_Int16 x, sal_Int16
     Impl_writeActions( rMtf );
     
     sal_uInt16 nId = 0;
-    sal_uInt16 iDepth = 1;
     {
         CharacterIdVector::iterator aIter( maShapeIds.begin() );
         const CharacterIdVector::iterator aEnd( maShapeIds.end() );
@@ -366,6 +365,7 @@ sal_uInt16 Writer::defineShape( const GDIMetaFile& rMtf, sal_Int16 x, sal_Int16
         {
             nId = startSprite();
 
+            sal_uInt16 iDepth = 1;
             while( aIter != aEnd )
             {
                 placeShape( *aIter, iDepth++, x, y );


More information about the Libreoffice-commits mailing list