[Libreoffice-commits] .: 13 commits - sc/source sd/source svtools/source svx/source

Tor Lillqvist tml at kemper.freedesktop.org
Fri Mar 2 08:44:54 PST 2012


 sc/source/filter/excel/xestream.cxx                              |    4 
 sc/source/ui/inc/checklistmenu.hxx                               |    1 
 sd/source/filter/ppt/pptinanimations.cxx                         |    4 
 sd/source/ui/animations/SlideTransitionPane.cxx                  |    6 +
 sd/source/ui/func/futempl.cxx                                    |    3 
 sd/source/ui/slidesorter/cache/SlsBitmapCompressor.hxx           |    4 
 sd/source/ui/slidesorter/view/SlsLayouter.cxx                    |    8 -
 sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx           |   45 ----------
 sd/source/ui/toolpanel/controls/MasterPageContainerProviders.hxx |    3 
 svtools/source/toolpanel/paneltabbar.cxx                         |    2 
 svx/source/dialog/frmsel.cxx                                     |    7 -
 svx/source/dialog/hdft.cxx                                       |    2 
 svx/source/table/cell.cxx                                        |    2 
 svx/source/unodraw/unoshape.cxx                                  |    2 
 14 files changed, 25 insertions(+), 68 deletions(-)

New commits:
commit 470036efe4db4e9773825c1277a659f3b50c5b48
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Mar 2 17:51:50 2012 +0200

    WaE: is abstract but has non-virtual destructor

diff --git a/sc/source/ui/inc/checklistmenu.hxx b/sc/source/ui/inc/checklistmenu.hxx
index 799308a..f6bd1e1 100644
--- a/sc/source/ui/inc/checklistmenu.hxx
+++ b/sc/source/ui/inc/checklistmenu.hxx
@@ -60,6 +60,7 @@ public:
     class Action
     {
     public:
+        virtual ~Action() {}
         virtual void execute() = 0;
     };
 
commit 0a2a759a96a2c065066e44d56a0c6dc51c561bda
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Mar 2 17:49:47 2012 +0200

    WaE: has virtual functions but non-virtual destructor

diff --git a/sd/source/ui/toolpanel/controls/MasterPageContainerProviders.hxx b/sd/source/ui/toolpanel/controls/MasterPageContainerProviders.hxx
index 573448b..85a8cf7 100644
--- a/sd/source/ui/toolpanel/controls/MasterPageContainerProviders.hxx
+++ b/sd/source/ui/toolpanel/controls/MasterPageContainerProviders.hxx
@@ -111,6 +111,7 @@ class PagePreviewProvider : public PreviewProvider
 {
 public:
     PagePreviewProvider (void);
+    virtual ~PagePreviewProvider() {}
     virtual Image operator () (int nWidth, SdPage* pPage, ::sd::PreviewRenderer& rRenderer);
     virtual int GetCostIndex (void);
     virtual bool NeedsPageObject (void);
@@ -164,6 +165,7 @@ class DefaultPageObjectProvider : public PageObjectProvider
 {
 public:
     DefaultPageObjectProvider (void);
+    virtual ~DefaultPageObjectProvider() {}
     virtual SdPage* operator () (SdDrawDocument* pDocument);
     virtual int GetCostIndex (void);
     virtual bool operator== (const PageObjectProvider& rProvider);
@@ -178,6 +180,7 @@ class ExistingPageProvider : public ::sd::toolpanel::controls::PageObjectProvide
 {
 public:
     ExistingPageProvider (SdPage* pPage);
+    virtual ~ExistingPageProvider() {}
     virtual SdPage* operator() (SdDrawDocument* pDocument);
     virtual int GetCostIndex (void);
     virtual bool operator== (const PageObjectProvider& rProvider);
commit 5bdc988482db5c96997681a6d1bad1d9ae22f146
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Mar 2 17:45:45 2012 +0200

    WaE: unused functions

diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
index 8a2ae0b..430cbac 100644
--- a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
+++ b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
@@ -50,51 +50,6 @@ using namespace ::drawinglayer::primitive2d;
 
 namespace sd { namespace slidesorter { namespace view {
 
-namespace {
-
-sal_uInt8 Blend (
-    const sal_uInt8 nValue1,
-    const sal_uInt8 nValue2,
-    const double nWeight)
-{
-    const double nValue (nValue1*(1-nWeight) + nValue2 * nWeight);
-    if (nValue < 0)
-        return 0;
-    else if (nValue > 255)
-        return 255;
-    else
-        return (sal_uInt8)nValue;
-}
-
-sal_uInt8 ClampColorChannel (const double nValue)
-{
-    if (nValue <= 0)
-        return 0;
-    else if (nValue >= 255)
-        return 255;
-    else
-        return sal_uInt8(nValue);
-}
-
-sal_uInt8 CalculateColorChannel(
-    const double nColor1,
-    const double nColor2,
-    const double nAlpha1,
-    const double nAlpha2,
-    const double nAlpha0)
-{
-    if (nAlpha0 == 0)
-        return 0;
-
-    const double nColor0 ((nAlpha1*nColor1 + nAlpha1*nAlpha2*nColor1 + nAlpha2*nColor2) / nAlpha0);
-    return ClampColorChannel(255 * nColor0);
-}
-
-} // end of anonymous namespace
-
-
-
-
 //===== PageObjectPainter =====================================================
 
 PageObjectPainter::PageObjectPainter (
commit 2e40994558fe05b1ddd7df4a7b9ba772c10f127a
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Mar 2 17:44:05 2012 +0200

    WaE: unused function

diff --git a/sd/source/ui/slidesorter/view/SlsLayouter.cxx b/sd/source/ui/slidesorter/view/SlsLayouter.cxx
index 274009f..3543c36 100644
--- a/sd/source/ui/slidesorter/view/SlsLayouter.cxx
+++ b/sd/source/ui/slidesorter/view/SlsLayouter.cxx
@@ -34,14 +34,6 @@
 #include <rtl/math.hxx>
 #include <basegfx/numeric/ftools.hxx>
 
-namespace {
-    sal_Int32 RoundToInt (const double nValue)
-    {
-        return sal_Int32(::rtl::math::round(nValue));
-    }
-}
-
-
 namespace sd { namespace slidesorter { namespace view {
 
 class Layouter::Implementation
commit 21c82e9e6d7ea8bd1a4d89f79f1761fa37a549fe
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Mar 2 17:43:09 2012 +0200

    WaE: virtual functions but non-virtual destructor

diff --git a/sd/source/ui/slidesorter/cache/SlsBitmapCompressor.hxx b/sd/source/ui/slidesorter/cache/SlsBitmapCompressor.hxx
index f978c01..d1b67da 100644
--- a/sd/source/ui/slidesorter/cache/SlsBitmapCompressor.hxx
+++ b/sd/source/ui/slidesorter/cache/SlsBitmapCompressor.hxx
@@ -92,6 +92,7 @@ class NoBitmapCompression
 {
     class DummyReplacement;
 public:
+    virtual ~NoBitmapCompression() {}
     virtual ::boost::shared_ptr<BitmapReplacement> Compress (const Bitmap& rpBitmap) const;
     virtual Bitmap Decompress (const BitmapReplacement& rBitmapData) const;
     virtual bool IsLossless (void) const;
@@ -109,6 +110,7 @@ class CompressionByDeletion
     : public BitmapCompressor
 {
 public:
+    virtual ~CompressionByDeletion() {}
     virtual ::boost::shared_ptr<BitmapReplacement> Compress (const Bitmap& rBitmap) const;
     virtual Bitmap Decompress (const BitmapReplacement& rBitmapData) const;
     virtual bool IsLossless (void) const;
@@ -128,6 +130,7 @@ class ResolutionReduction
     class ResolutionReducedReplacement;
     static const sal_Int32 mnWidth = 100;
 public:
+    virtual ~ResolutionReduction() {}
     virtual ::boost::shared_ptr<BitmapReplacement> Compress (const Bitmap& rpBitmap) const;
     /** Scale the replacement bitmap up to the original size.
     */
@@ -146,6 +149,7 @@ class PngCompression
 {
     class PngReplacement;
 public:
+    virtual ~PngCompression() {}
     virtual ::boost::shared_ptr<BitmapReplacement> Compress (const Bitmap& rBitmap) const;
     virtual Bitmap Decompress (const BitmapReplacement& rBitmapData) const;
     virtual bool IsLossless (void) const;
commit 2289308415682ffd32f35f31ce785cc5ee62bcfc
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Mar 2 17:38:44 2012 +0200

    WaE: use of logical '&&' with constant operand

diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx
index 7ed1de1..3af544e 100644
--- a/sd/source/filter/ppt/pptinanimations.cxx
+++ b/sd/source/filter/ppt/pptinanimations.cxx
@@ -2176,7 +2176,7 @@ void AnimationImporter::importCommandContainer( const Atom* pAtom, const Referen
                 mrStCtrl >> nBits;
                 mrStCtrl >> nCommandType;
 
-                if( nBits && 1 )
+                if( nBits & 1 )
                 {
                     dump( " type=\"%s\"", (nCommandType == 0) ? "event" : ( nCommandType == 1) ? "call" : "verb" );
                 }
@@ -2187,7 +2187,7 @@ void AnimationImporter::importCommandContainer( const Atom* pAtom, const Referen
             {
                 if ( importAttributeValue( pChildAtom, aValue ) )
                 {
-                    if( nBits && 2 )
+                    if( nBits & 2 )
                     {
                         dump( " cmd=\"" );
                         dump( aValue );
commit 08773910b162ada57ad10310f294a8b68ddcd1b5
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Mar 2 17:35:01 2012 +0200

    WaE: use of logical '&&' with constant operand
    
    Presumably a bitwise '&' is intended, i.e. a normal flag bit test.

diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx
index 287a34a..21bffa7 100644
--- a/svx/source/dialog/hdft.cxx
+++ b/svx/source/dialog/hdft.cxx
@@ -431,7 +431,7 @@ void SvxHFPage::Reset( const SfxItemSet& rSet )
     {
         sal_uInt16 nHtmlMode = 0;
         nHtmlMode = ((SfxUInt16Item*)pItem)->GetValue();
-        if(nHtmlMode && HTMLMODE_ON)
+        if(nHtmlMode & HTMLMODE_ON)
         {
             aCntSharedBox.Hide();
             aBackgroundBtn.Hide();
commit 4de374a8b092a988a9022887a3b586336658a5fb
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Mar 2 17:31:23 2012 +0200

    WaE: unused function

diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx
index 597522a..4dfbea6 100644
--- a/svx/source/dialog/frmsel.cxx
+++ b/svx/source/dialog/frmsel.cxx
@@ -107,13 +107,6 @@ FrameSelFlags lclGetFlagFromType( FrameBorderType eBorder )
     return FRAMESEL_NONE;
 }
 
-/** Converts an SvxBorderLine line width (in twips) to a pixel line width. */
-inline sal_uInt16 lclGetPixel( sal_uInt16 nWidth )
-{
-    // convert all core styles expect 0 to a visible UI style (at least 1 pixel), map 1pt to 1pixel
-    return nWidth ? std::min< sal_uInt16 >( std::max< sal_uInt16 >( (nWidth + 5) / 20, 1 ), FRAMESEL_GEOM_WIDTH ) : 0;
-}
-
 /** Merges the rSource polypolygon into the rDest polypolygon. */
 inline void lclPolyPolyUnion( PolyPolygon& rDest, const PolyPolygon& rSource )
 {
commit 98e3c3421de24d4729f4099e4e6e12af0e7d787a
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Mar 2 17:28:05 2012 +0200

    WaE: equality comparison with extraneous parentheses

diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index bbe73f0..b47e974 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -1361,7 +1361,7 @@ PropertyState SAL_CALL Cell::getPropertyState( const OUString& PropertyName ) th
                 case XATTR_FILLFLOATTRANSPARENCE:
                     {
                         NameOrIndex* pItem = (NameOrIndex*)rSet.GetItem((sal_uInt16)pMap->nWID);
-                        if( ( pItem == NULL ) )
+                        if( pItem == NULL )
                             eState = PropertyState_DEFAULT_VALUE;
                     }
                     break;
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 988b076..6fb809e 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -2162,7 +2162,7 @@ beans::PropertyState SAL_CALL SvxShape::_getPropertyState( const OUString& Prope
             case XATTR_FILLFLOATTRANSPARENCE:
                 {
                     NameOrIndex* pItem = (NameOrIndex*)rSet.GetItem((sal_uInt16)pMap->nWID);
-                    if( ( pItem == NULL ) )
+                    if ( pItem == NULL )
                         eState = beans::PropertyState_DEFAULT_VALUE;
                 }
                 break;
commit 75902119c17f224c9387092b1e9c776419dfcde4
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Mar 2 17:02:21 2012 +0200

    WaE: explicitly assigning a variable to itself

diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index 5d064f3..5230ab8 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -659,11 +659,11 @@ void XclExpBiff8Encrypter::EncryptBytes( SvStream& rStrm, vector<sal_uInt8>& aBy
 
         bool bRet = maCodec.Encode(&aBytes[nPos], nEncBytes, &aBytes[nPos], nEncBytes);
         OSL_ENSURE(bRet, "XclExpBiff8Encrypter::EncryptBytes: encryption failed!!");
-        bRet = bRet; // to remove a silly compiler warning.
+        (void) bRet; // to remove a silly compiler warning.
 
         sal_Size nRet = rStrm.Write(&aBytes[nPos], nEncBytes);
         OSL_ENSURE(nRet == nEncBytes, "XclExpBiff8Encrypter::EncryptBytes: fail to write to stream!!");
-        nRet = nRet; // to remove a silly compiler warning.
+        (void) nRet; // to remove a silly compiler warning.
 
         nStrmPos = rStrm.Tell();
         nBlockOffset = GetOffsetInBlock(nStrmPos);
commit 81a74d404f42c13cf7dc5cc63b366cdb4ffe8282
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Mar 2 16:57:50 2012 +0200

    WaE: use of logical '||' with constant operand

diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx
index 0f0a796..8c5c4c6 100644
--- a/sd/source/ui/func/futempl.cxx
+++ b/sd/source/ui/func/futempl.cxx
@@ -203,7 +203,8 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
         {
             // Z.Z. geht immer noch der Dialog auf, um den Namen
             // der Vorlage einzugeben.
-            if( mpView->AreObjectsMarked() || sal_True )
+            mpView->AreObjectsMarked();
+            if( sal_True )
             {
                 SfxStyleSheetBase *p = pSSPool->Find(aStyleName, (SfxStyleFamily) nFamily, SFXSTYLEBIT_ALL );
                 if(p)
commit 627bee1307730dfe7cd55d3c88d44367ece0acdb
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Mar 2 16:50:11 2012 +0200

    WaE: expression result unused
    
    If-zero out a leftover isolated expression without effect.
    (Introduced in 2007 in CWS impress122.)

diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx
index ead2fb9..90fdab4 100644
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -208,7 +208,13 @@ struct TransitionEffect
         mbTimeAmbiguous = mbTimeAmbiguous || aOtherEffect.mbTimeAmbiguous || mnTime != aOtherEffect.mnTime;
         mbPresChangeAmbiguous = mbPresChangeAmbiguous || aOtherEffect.mbPresChangeAmbiguous || mePresChange != aOtherEffect.mePresChange;
         mbSoundAmbiguous = mbSoundAmbiguous || aOtherEffect.mbSoundAmbiguous || mbSoundOn != aOtherEffect.mbSoundOn;
+#if 0
+                        // Weird leftover isolated expression with no effect, introduced in 2007 in
+                        // CWS impress122. Ifdeffed out to avoid compiler warning, kept here in case
+                        // somebody who understands this code notices and understands what the
+                        // "right" thing to do might be.
                         (!mbStopSound && !aOtherEffect.mbStopSound && maSound != aOtherEffect.maSound) || (mbStopSound != aOtherEffect.mbStopSound);
+#endif
         mbLoopSoundAmbiguous = mbLoopSoundAmbiguous || aOtherEffect.mbLoopSoundAmbiguous || mbLoopSound != aOtherEffect.mbLoopSound;
     }
 
commit efe7517856b5682b0f595822b953bf3ae4233588
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Mar 2 16:43:18 2012 +0200

    WaE: has virtual functions but non-virtual destructor

diff --git a/svtools/source/toolpanel/paneltabbar.cxx b/svtools/source/toolpanel/paneltabbar.cxx
index 2723534..9baad58 100644
--- a/svtools/source/toolpanel/paneltabbar.cxx
+++ b/svtools/source/toolpanel/paneltabbar.cxx
@@ -113,6 +113,7 @@ namespace svt
             :m_rTargetDevice( i_rTargetDevice )
         {
         }
+        virtual ~VCLItemRenderer() {}
 
         // ITabBarRenderer
         virtual void        renderBackground() const;
@@ -187,6 +188,7 @@ namespace svt
             :m_rTargetDevice( i_rTargetDevice )
         {
         }
+        virtual ~NWFToolboxItemRenderer() {}
 
         // ITabBarRenderer
         virtual void        renderBackground() const;


More information about the Libreoffice-commits mailing list