[Libreoffice-commits] .: 7 commits - editeng/source filter/source oox/source

Tor Lillqvist tml at kemper.freedesktop.org
Fri Mar 2 15:17:12 PST 2012


 editeng/source/editeng/impedit3.cxx |    2 +-
 filter/source/msfilter/msdffimp.cxx |    4 ++--
 filter/source/msfilter/svdfppt.cxx  |    2 +-
 oox/source/export/chartexport.cxx   |    2 +-
 oox/source/export/drawingml.cxx     |   10 +++++-----
 oox/source/xls/stylesbuffer.cxx     |   24 ------------------------
 6 files changed, 10 insertions(+), 34 deletions(-)

New commits:
commit 947a51f5fe4450c5da8c1f784eccb756e9320e32
Author: Tor Lillqvist <tml at iki.fi>
Date:   Sat Mar 3 01:04:59 2012 +0200

    WaE: equality comparison with extraneous parentheses

diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 350a5d1..d37d8d9 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -305,7 +305,7 @@ void ImpEditEngine::UpdateViews( EditView* pCurView )
             // convert to window coordinates ....
             aClipRec = pView->pImpEditView->GetWindowPos( aClipRec );
 
-            if ( ( pView == pCurView )  )
+            if ( pView == pCurView )
                 Paint( pView->pImpEditView, aClipRec, sal_True );
             else
                 pView->GetWindow()->Invalidate( aClipRec );
commit e1b4c4d4778737b83a383d55da127bdb0592d79a
Author: Tor Lillqvist <tml at iki.fi>
Date:   Sat Mar 3 00:52:41 2012 +0200

    WaE: equality comparison with extraneous parentheses

diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 50ce3e7..1df7ffb 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -978,7 +978,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
                 }
 
                 sal_uInt32 nDestinationInstance = aTextObj.GetInstance();
-                if ( ( rPersistEntry.ePageKind == PPT_MASTERPAGE ) )
+                if ( rPersistEntry.ePageKind == PPT_MASTERPAGE )
                 {
                     if ( !rPersistEntry.pPresentationObjects )
                     {
commit 43b92f0940059aea04da134f70579b76ecc8480f
Author: Tor Lillqvist <tml at iki.fi>
Date:   Sat Mar 3 00:48:58 2012 +0200

    WaE: expression result unused
    
    A right parenthesis was apparently misplaced, leading to the code
    actually containing a bogus comma expression. The GetPropertyValue()
    call's result was ignored and the subexpression after the comma, zero,
    was used instead.

diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 471020a..176d630 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -2008,7 +2008,7 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt
         {
             const rtl::OUString sDepth( RTL_CONSTASCII_USTRINGPARAM ( "Depth" ) );
             double fBackDepth = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DExtrudeBackward, 1270 * 360 )) / 360.0;
-            double fForeDepth = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DExtrudeForward ), 0 ) / 360.0;
+            double fForeDepth = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DExtrudeForward, 0 )) / 360.0;
             double fDepth = fBackDepth + fForeDepth;
             double fFraction = fDepth != 0.0 ? fForeDepth / fDepth : 0;
             EnhancedCustomShapeParameterPair aDepthParaPair;
commit 8da131e21d44ca21c8bf494cf06a87ab2ea27292
Author: Tor Lillqvist <tml at iki.fi>
Date:   Sat Mar 3 00:44:14 2012 +0200

    WaE: use of unary operator that may be intended as compound assignment (-=)

diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index af17c92..471020a 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -1662,7 +1662,7 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, co
 
             if ( nFocus < 0 )       // Bei negativem Focus sind die Farben zu tauschen
             {
-                nFocus =- nFocus;
+                nFocus = -nFocus;
                 nChgColors ^= 1;
             }
             if( nFocus > 40 && nFocus < 60 )
commit c492c10348625cb757e97d3a4ea809ee28e54a53
Author: Tor Lillqvist <tml at iki.fi>
Date:   Sat Mar 3 00:22:39 2012 +0200

    WaE: two unused functions

diff --git a/oox/source/xls/stylesbuffer.cxx b/oox/source/xls/stylesbuffer.cxx
index d336a5a..6c9c76f 100644
--- a/oox/source/xls/stylesbuffer.cxx
+++ b/oox/source/xls/stylesbuffer.cxx
@@ -1583,25 +1583,6 @@ bool operator==( const BorderLine& rLeft, const BorderLine& rRight )
         (rLeft.LineDistance   == rRight.LineDistance);
 }
 
-bool operator==( const TableBorder& rLeft, const TableBorder& rRight )
-{
-    return
-        (rLeft.TopLine               == rRight.TopLine) &&
-        (rLeft.IsTopLineValid        == rRight.IsTopLineValid) &&
-        (rLeft.BottomLine            == rRight.BottomLine) &&
-        (rLeft.IsBottomLineValid     == rRight.IsBottomLineValid) &&
-        (rLeft.LeftLine              == rRight.LeftLine) &&
-        (rLeft.IsLeftLineValid       == rRight.IsLeftLineValid) &&
-        (rLeft.RightLine             == rRight.RightLine) &&
-        (rLeft.IsRightLineValid      == rRight.IsRightLineValid) &&
-        (rLeft.HorizontalLine        == rRight.HorizontalLine) &&
-        (rLeft.IsHorizontalLineValid == rRight.IsHorizontalLineValid) &&
-        (rLeft.VerticalLine          == rRight.VerticalLine) &&
-        (rLeft.IsVerticalLineValid   == rRight.IsVerticalLineValid) &&
-        (rLeft.Distance              == rRight.Distance) &&
-        (rLeft.IsDistanceValid       == rRight.IsDistanceValid);
-}
-
 } // namespace
 
 bool operator==( const ApiBorderData& rLeft, const ApiBorderData& rRight )
@@ -1629,11 +1610,6 @@ inline void lclSetBorderLineWidth( BorderLine& rBorderLine,
     rBorderLine.InnerLineWidth = nInner;
 }
 
-inline sal_Int32 lclGetBorderLineWidth( const BorderLine& rBorderLine )
-{
-    return rBorderLine.OuterLineWidth + rBorderLine.LineDistance + rBorderLine.InnerLineWidth;
-}
-
 } // namespace
 
 // ----------------------------------------------------------------------------
commit 30313007a8bfc327f47d096f6d9e625f1193b14a
Author: Tor Lillqvist <tml at iki.fi>
Date:   Sat Mar 3 00:05:55 2012 +0200

    WaE: use of logical '&&' with constant operand
    
    Surely it's the bitwise operator & that is wanted here. The code makes
    no sense otherwise. We apparently have been generating UUIDs where
    every second hex digit is always a '1', like
    {x1x1x1x1-x1x1-x1x1-x1x1-x1x1x1x1x1x1} (where each x is a random hex
    digit).

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 119d970..b77318c 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -906,27 +906,27 @@ void DrawingML::GetUUID( OStringBuffer& rBuffer )
     rBuffer.append( '{' );
     for( i = 0; i < 4; i++ ) {
         rBuffer.append( cDigits[ aSeq[i] >> 4 ] );
-        rBuffer.append( cDigits[ aSeq[i] && 0xf ] );
+        rBuffer.append( cDigits[ aSeq[i] & 0xf ] );
     }
     rBuffer.append( '-' );
     for( ; i < 6; i++ ) {
         rBuffer.append( cDigits[ aSeq[i] >> 4 ] );
-        rBuffer.append( cDigits[ aSeq[i] && 0xf ] );
+        rBuffer.append( cDigits[ aSeq[i] & 0xf ] );
     }
     rBuffer.append( '-' );
     for( ; i < 8; i++ ) {
         rBuffer.append( cDigits[ aSeq[i] >> 4 ] );
-        rBuffer.append( cDigits[ aSeq[i] && 0xf ] );
+        rBuffer.append( cDigits[ aSeq[i] & 0xf ] );
     }
     rBuffer.append( '-' );
     for( ; i < 10; i++ ) {
         rBuffer.append( cDigits[ aSeq[i] >> 4 ] );
-        rBuffer.append( cDigits[ aSeq[i] && 0xf ] );
+        rBuffer.append( cDigits[ aSeq[i] & 0xf ] );
     }
     rBuffer.append( '-' );
     for( ; i < 16; i++ ) {
         rBuffer.append( cDigits[ aSeq[i] >> 4 ] );
-        rBuffer.append( cDigits[ aSeq[i] && 0xf ] );
+        rBuffer.append( cDigits[ aSeq[i] & 0xf ] );
     }
     rBuffer.append( '}' );
 }
commit b43bdd47fe7b6fccb4ca490b5b3a91d71113cd66
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Mar 2 23:58:16 2012 +0200

    WaE: expression result unused
    
    Remopve apparently accidentally leftover initializer parameter list
    that now was just a comma expression with no effect.

diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 4bdb9df..cc50ef9 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -2229,7 +2229,7 @@ void ChartExport::exportYAxis( AxisIdPair aAxisIdPair )
         xMajorGrid.set( xAxisYSupp->getYMainGrid(), uno::UNO_QUERY );
 
     // minor grid line
-    Reference< beans::XPropertySet > xMinorGrid;( xAxisYSupp->getYHelpGrid(), uno::UNO_QUERY );
+    Reference< beans::XPropertySet > xMinorGrid;
     if( bHasYAxisMinorGrid )
         xMinorGrid.set(  xAxisYSupp->getYHelpGrid(), uno::UNO_QUERY );
 


More information about the Libreoffice-commits mailing list