[Libreoffice-commits] core.git: 2 commits - sc/source

Caolán McNamara caolanm at redhat.com
Fri Dec 19 02:17:36 PST 2014


 sc/source/filter/excel/excform.cxx   |   12 ++++--------
 sc/source/filter/excel/impop.cxx     |   11 ++---------
 sc/source/filter/excel/xicontent.cxx |   17 ++++++-----------
 sc/source/filter/excel/xiescher.cxx  |    8 +++-----
 sc/source/filter/excel/xiname.cxx    |    8 ++++----
 sc/source/filter/excel/xistring.cxx  |   15 ++++++---------
 sc/source/filter/excel/xistyle.cxx   |   22 +++++++++-------------
 sc/source/filter/excel/xltools.cxx   |    9 ++++-----
 8 files changed, 38 insertions(+), 64 deletions(-)

New commits:
commit 37639870152a666310654205c4def38867e50029
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Dec 19 10:06:50 2014 +0000

    WaE: -Werror=unused-but-set-variable
    
    Change-Id: I2c1dd24fa2215300255ae4e7d50b6cf990b6e843

diff --git a/sc/source/filter/excel/excform.cxx b/sc/source/filter/excel/excform.cxx
index 79c3373..11fd498 100644
--- a/sc/source/filter/excel/excform.cxx
+++ b/sc/source/filter/excel/excform.cxx
@@ -84,16 +84,12 @@ void ImportExcel::Formula3()
 void ImportExcel::Formula4()
 {
     XclAddress aXclPos;
-    sal_uInt16  nXF, nFormLen;
-    double  fCurVal;
-    sal_uInt8   nFlag0;
 
     aIn >> aXclPos;
-    nXF = aIn.ReaduInt16();
-    fCurVal = aIn.ReadDouble();
-    nFlag0 = aIn.ReaduInt8();
-    aIn.Ignore( 1 );
-    nFormLen = aIn.ReaduInt16();
+    sal_uInt16 nXF = aIn.ReaduInt16();
+    double fCurVal = aIn.ReadDouble();
+    aIn.Ignore( 2 );
+    sal_uInt16 nFormLen = aIn.ReaduInt16();
 
     Formula( aXclPos, nXF, nFormLen, fCurVal, false );
 }
diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx
index 667c88a..b000fa0 100644
--- a/sc/source/filter/excel/impop.cxx
+++ b/sc/source/filter/excel/impop.cxx
@@ -835,15 +835,8 @@ void ImportExcel::Shrfmla( void )
         // The last FORMULA record should have left this data.
         return;
 
-    sal_uInt16              nFirstRow, nLastRow, nLenExpr;
-    sal_uInt8               nFirstCol, nLastCol;
-
-    nFirstRow = aIn.ReaduInt16();
-    nLastRow = aIn.ReaduInt16();
-    nFirstCol = aIn.ReaduInt8();
-    nLastCol = aIn.ReaduInt8();
-    aIn.Ignore( 2 );
-    nLenExpr = aIn.ReaduInt16();
+    aIn.Ignore( 8 );
+    sal_uInt16 nLenExpr = aIn.ReaduInt16();
 
     // read mark is now on the formula
 
diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx
index 51e2f18..247e897 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -507,17 +507,12 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm )
     if( maRanges.empty() )
         return;
 
-    sal_uInt8 nType(0), nOperator(0);
-    sal_uInt16 nFmlaSize1(0), nFmlaSize2(0);
-    sal_uInt32 nFlags(0);
-    sal_uInt16 nFlagsExtended(0);
-
-    nType = rStrm.ReaduInt8();
-    nOperator = rStrm.ReaduInt8();
-    nFmlaSize1 = rStrm.ReaduInt16();
-    nFmlaSize2 = rStrm.ReaduInt16();
-    nFlags = rStrm.ReaduInt32();
-    nFlagsExtended = rStrm.ReaduInt16();
+    sal_uInt8 nType = rStrm.ReaduInt8();
+    sal_uInt8 nOperator = rStrm.ReaduInt8();
+    sal_uInt16 nFmlaSize1 = rStrm.ReaduInt16();
+    sal_uInt16 nFmlaSize2 = rStrm.ReaduInt16();
+    sal_uInt32 nFlags = rStrm.ReaduInt32();
+    rStrm.Ignore( 2 ); //nFlagsExtended
 
     // *** mode and comparison operator ***
 
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index b990a11..594f28c 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -3818,11 +3818,9 @@ XclImpDrawing::~XclImpDrawing()
 Graphic XclImpDrawing::ReadImgData( const XclImpRoot& rRoot, XclImpStream& rStrm )
 {
     Graphic aGraphic;
-    sal_uInt16 nFormat, nEnv;
-    sal_uInt32 nDataSize;
-    nFormat = rStrm.ReaduInt16();
-    nEnv = rStrm.ReaduInt16();
-    nDataSize = rStrm.ReaduInt32();
+    sal_uInt16 nFormat = rStrm.ReaduInt16();
+    rStrm.Ignore( 2 );//nEnv
+    sal_uInt32 nDataSize = rStrm.ReaduInt32();
     if( nDataSize <= rStrm.GetRecLeft() )
     {
         switch( nFormat )
diff --git a/sc/source/filter/excel/xiname.cxx b/sc/source/filter/excel/xiname.cxx
index 3a69c09..c1bee5a 100644
--- a/sc/source/filter/excel/xiname.cxx
+++ b/sc/source/filter/excel/xiname.cxx
@@ -47,7 +47,7 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) :
     // 1) *** read data from stream *** ---------------------------------------
 
     sal_uInt16 nFlags = 0, nFmlaSize = 0, nExtSheet = EXC_NAME_GLOBAL;
-    sal_uInt8 nNameLen = 0, nShortCut;
+    sal_uInt8 nNameLen = 0;
 
     switch( GetBiff() )
     {
@@ -56,7 +56,7 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) :
             sal_uInt8 nFlagsBiff2;
             nFlagsBiff2 = rStrm.ReaduInt8();
             rStrm.Ignore( 1 );
-            nShortCut = rStrm.ReaduInt8();
+            rStrm.Ignore( 1 ); //nShortCut
             nNameLen = rStrm.ReaduInt8();
             nFmlaSize = rStrm.ReaduInt8();
             ::set_flag( nFlags, EXC_NAME_FUNC, ::get_flag( nFlagsBiff2, EXC_NAME2_FUNC ) );
@@ -67,7 +67,7 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) :
         case EXC_BIFF4:
         {
             nFlags = rStrm.ReaduInt16();
-            nShortCut = rStrm.ReaduInt8();
+            rStrm.Ignore( 1 ); //nShortCut
             nNameLen = rStrm.ReaduInt8();
             nFmlaSize = rStrm.ReaduInt16();
         }
@@ -77,7 +77,7 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) :
         case EXC_BIFF8:
         {
             nFlags = rStrm.ReaduInt16();
-            nShortCut = rStrm.ReaduInt8();
+            rStrm.Ignore( 1 ); //nShortCut
             nNameLen = rStrm.ReaduInt8();
             nFmlaSize = rStrm.ReaduInt16();
             nExtSheet = rStrm.ReaduInt16();
diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index 8670051..5a3196a 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -267,22 +267,18 @@ void XclImpFont::ReadCFFontBlock( XclImpStream& rStrm )
     if( GetBiff() != EXC_BIFF8 )
         return;
 
-    sal_uInt32 nHeight, nStyle, nColor, nFontFlags1, nFontFlags2, nFontFlags3;
-    sal_uInt16 nWeight, nEscapem;
-    sal_uInt8 nUnderl;
-
     rStrm.Ignore( 64 );
-    nHeight = rStrm.ReaduInt32();
-    nStyle = rStrm.ReaduInt32();
-    nWeight = rStrm.ReaduInt16();
-    nEscapem = rStrm.ReaduInt16();
-    nUnderl = rStrm.ReaduInt8();
+    sal_uInt32 nHeight = rStrm.ReaduInt32();
+    sal_uInt32 nStyle = rStrm.ReaduInt32();
+    sal_uInt16 nWeight = rStrm.ReaduInt16();
+    rStrm.Ignore( 2 ); //nEscapem
+    sal_uInt8 nUnderl = rStrm.ReaduInt8();
     rStrm.Ignore( 3 );
-    nColor = rStrm.ReaduInt32();
+    sal_uInt32 nColor = rStrm.ReaduInt32();
     rStrm.Ignore( 4 );
-    nFontFlags1 = rStrm.ReaduInt32();
-    nFontFlags2 = rStrm.ReaduInt32();
-    nFontFlags3 = rStrm.ReaduInt32();
+    sal_uInt32 nFontFlags1 = rStrm.ReaduInt32();
+    rStrm.Ignore( 4 ); //nFontFlags2
+    sal_uInt32 nFontFlags3 = rStrm.ReaduInt32();
     rStrm.Ignore( 18 );
 
     if( (mbHeightUsed = (nHeight <= 0x7FFF)) == true )
diff --git a/sc/source/filter/excel/xltools.cxx b/sc/source/filter/excel/xltools.cxx
index 08b871f..b2bcc25 100644
--- a/sc/source/filter/excel/xltools.cxx
+++ b/sc/source/filter/excel/xltools.cxx
@@ -713,11 +713,10 @@ OUString XclTools::GetXclMacroName( const OUString& rSbMacroUrl )
 
 XclImpStream& operator>>( XclImpStream& rStrm, Color& rColor )
 {
-    sal_uInt8 nR, nG, nB, nD;
-    nR = rStrm.ReaduInt8();
-    nG = rStrm.ReaduInt8();
-    nB = rStrm.ReaduInt8();
-    nD = rStrm.ReaduInt8();
+    sal_uInt8 nR = rStrm.ReaduInt8();
+    sal_uInt8 nG = rStrm.ReaduInt8();
+    sal_uInt8 nB = rStrm.ReaduInt8();
+    rStrm.Ignore( 1 );//nD
     rColor.SetColor( RGB_COLORDATA( nR, nG, nB ) );
     return rStrm;
 }
commit 02aaf5138095f8a8436363d2bc687c32079a1864
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Dec 19 09:52:19 2014 +0000

    can move the decls to first use now
    
    Change-Id: If501dfd0a2bebac45d13110af739e1f22444b823

diff --git a/sc/source/filter/excel/xistring.cxx b/sc/source/filter/excel/xistring.cxx
index 2fafbbe..6475619 100644
--- a/sc/source/filter/excel/xistring.cxx
+++ b/sc/source/filter/excel/xistring.cxx
@@ -118,9 +118,8 @@ void XclImpString::ReadFormats( XclImpStream& rStrm, XclFormatRunVec& rFormats,
     {
         for( sal_uInt16 nIdx = 0; nIdx < nRunCount; ++nIdx )
         {
-            sal_uInt16 nChar, nFontIdx;
-            nChar = rStrm.ReaduInt16();
-            nFontIdx = rStrm.ReaduInt16();
+            sal_uInt16 nChar = rStrm.ReaduInt16();
+            sal_uInt16 nFontIdx = rStrm.ReaduInt16();
             AppendFormat( rFormats, nChar, nFontIdx );
         }
     }
@@ -128,9 +127,8 @@ void XclImpString::ReadFormats( XclImpStream& rStrm, XclFormatRunVec& rFormats,
     {
         for( sal_uInt16 nIdx = 0; nIdx < nRunCount; ++nIdx )
         {
-            sal_uInt8 nChar, nFontIdx;
-            nChar = rStrm.ReaduInt8();
-            nFontIdx = rStrm.ReaduInt8();
+            sal_uInt8 nChar = rStrm.ReaduInt8();
+            sal_uInt8 nFontIdx = rStrm.ReaduInt8();
             AppendFormat( rFormats, nChar, nFontIdx );
         }
     }
@@ -144,9 +142,8 @@ void XclImpString::ReadObjFormats( XclImpStream& rStrm, XclFormatRunVec& rFormat
     rFormats.reserve( nRunCount );
     for( sal_uInt16 nIdx = 0; nIdx < nRunCount; ++nIdx )
     {
-        sal_uInt16 nChar, nFontIdx;
-        nChar = rStrm.ReaduInt16();
-        nFontIdx = rStrm.ReaduInt16();
+        sal_uInt16 nChar = rStrm.ReaduInt16();
+        sal_uInt16 nFontIdx = rStrm.ReaduInt16();
         rStrm.Ignore( 4 );
         AppendFormat( rFormats, nChar, nFontIdx );
     }


More information about the Libreoffice-commits mailing list