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

Caolán McNamara caolanm at redhat.com
Wed Apr 15 02:11:03 PDT 2015


 include/svx/camera3d.hxx              |    2 +-
 include/svx/charmap.hxx               |    2 +-
 include/svx/charthelper.hxx           |    4 +---
 include/svx/checklbx.hxx              |    3 +--
 include/svx/chrtitem.hxx              |   32 ++++++++------------------------
 include/svx/clipboardctl.hxx          |    4 +---
 include/svx/clipfmtitem.hxx           |    3 +--
 include/svx/colrctrl.hxx              |    6 +++---
 include/svx/compressgraphicdialog.hxx |    2 +-
 include/svx/connctrl.hxx              |    3 +--
 include/svx/contdlg.hxx               |    9 ++++-----
 include/svx/ctredlin.hxx              |   16 +++++++---------
 include/svx/cube3d.hxx                |    2 +-
 sc/source/filter/excel/xestyle.cxx    |   12 ++++++++----
 14 files changed, 39 insertions(+), 61 deletions(-)

New commits:
commit bf2fca48975c4ecdba2cc6fd2b92aaae166a088b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 15 10:06:21 2015 +0100

    add some SAL_WARN_UNUSED
    
    Change-Id: I208ce526ab09c118709e82b0930db4502d5c5b76

diff --git a/include/svx/camera3d.hxx b/include/svx/camera3d.hxx
index b758ea0..66133e6 100644
--- a/include/svx/camera3d.hxx
+++ b/include/svx/camera3d.hxx
@@ -29,7 +29,7 @@
 |*
 \************************************************************************/
 
-class SVX_DLLPUBLIC Camera3D : public Viewport3D
+class SVX_DLLPUBLIC SAL_WARN_UNUSED Camera3D : public Viewport3D
 {
  protected:
     basegfx::B3DPoint   aResetPos;
diff --git a/include/svx/charmap.hxx b/include/svx/charmap.hxx
index d27afb6..7df5d9a 100644
--- a/include/svx/charmap.hxx
+++ b/include/svx/charmap.hxx
@@ -39,7 +39,7 @@ namespace svx
 
 // class SvxShowCharSet --------------------------------------------------
 
-class SVX_DLLPUBLIC SvxShowCharSet : public Control
+class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxShowCharSet : public Control
 {
 public:
                     SvxShowCharSet( vcl::Window* pParent );
diff --git a/include/svx/charthelper.hxx b/include/svx/charthelper.hxx
index 56627cc..960e58c 100644
--- a/include/svx/charthelper.hxx
+++ b/include/svx/charthelper.hxx
@@ -28,7 +28,7 @@
 #include <com/sun/star/chart2/XDiagram.hpp>
 #include <com/sun/star/embed/XEmbeddedObject.hpp>
 
-class SVX_DLLPUBLIC ChartHelper
+class SVX_DLLPUBLIC SAL_WARN_UNUSED ChartHelper
 {
 public:
     /// Check that the XDiagram is a real 3D chart.
@@ -57,8 +57,6 @@ public:
         bool bNoLineStyle = true);
 };
 
-
-
 #endif // INCLUDED_SVX_CHARTHELPER_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/checklbx.hxx b/include/svx/checklbx.hxx
index eb587db..baeac1b 100644
--- a/include/svx/checklbx.hxx
+++ b/include/svx/checklbx.hxx
@@ -26,7 +26,7 @@
 
 // class SvxCheckListBox -------------------------------------------------
 
-class SVX_DLLPUBLIC SvxCheckListBox : public SvTreeListBox
+class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxCheckListBox : public SvTreeListBox
 {
     using Window::GetText;
 
@@ -71,7 +71,6 @@ public:
     virtual void    KeyInput            ( const KeyEvent& rKEvt ) SAL_OVERRIDE;
 };
 
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/chrtitem.hxx b/include/svx/chrtitem.hxx
index 9a19a18..4d51b03 100644
--- a/include/svx/chrtitem.hxx
+++ b/include/svx/chrtitem.hxx
@@ -22,8 +22,6 @@
 #include <svl/eitem.hxx>
 #include <svx/svxdllapi.h>
 
-
-
 enum SvxChartStyle
 {
     CHSTYLE_2D_LINE,
@@ -164,8 +162,7 @@ enum SvxChartRegress
 
 #define CHREGRESS_COUNT (CHREGRESS_UNKNOWN + 1)
 
-
-class SVX_DLLPUBLIC SvxChartStyleItem : public SfxEnumItem
+class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxChartStyleItem : public SfxEnumItem
 {
 public:
     TYPEINFO_OVERRIDE();
@@ -182,8 +179,7 @@ public:
 };
 
 
-
-class SVX_DLLPUBLIC SvxChartRegressItem : public SfxEnumItem
+class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxChartRegressItem : public SfxEnumItem
 {
 public:
     TYPEINFO_OVERRIDE();
@@ -200,9 +196,7 @@ public:
     sal_uInt16 GetVersion (sal_uInt16 nFileFormatVersion) const SAL_OVERRIDE;
 };
 
-
-
-class SVX_DLLPUBLIC SvxChartDataDescrItem : public SfxEnumItem
+class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxChartDataDescrItem : public SfxEnumItem
 {
 public:
     TYPEINFO_OVERRIDE();
@@ -217,9 +211,7 @@ public:
         { return (SvxChartDataDescr)SfxEnumItem::GetValue(); }
 };
 
-
-
-class SVX_DLLPUBLIC SvxChartTextOrderItem : public SfxEnumItem
+class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxChartTextOrderItem : public SfxEnumItem
 {
 public:
     TYPEINFO_OVERRIDE();
@@ -239,9 +231,7 @@ public:
         { return (SvxChartTextOrder)SfxEnumItem::GetValue(); }
 };
 
-
-
-class SVX_DLLPUBLIC SvxChartTextOrientItem : public SfxEnumItem
+class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxChartTextOrientItem : public SfxEnumItem
 {
 public:
     TYPEINFO_OVERRIDE();
@@ -256,9 +246,7 @@ public:
         { return (SvxChartTextOrient)SfxEnumItem::GetValue(); }
 };
 
-
-
-class SVX_DLLPUBLIC SvxChartKindErrorItem : public SfxEnumItem
+class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxChartKindErrorItem : public SfxEnumItem
 {
 public:
     TYPEINFO_OVERRIDE();
@@ -277,9 +265,7 @@ public:
     sal_uInt16 GetVersion (sal_uInt16 nFileFormatVersion) const SAL_OVERRIDE;
 };
 
-
-
-class SVX_DLLPUBLIC SvxChartIndicateItem : public SfxEnumItem
+class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxChartIndicateItem : public SfxEnumItem
 {
 public:
     TYPEINFO_OVERRIDE();
@@ -298,9 +284,7 @@ public:
     sal_uInt16 GetVersion (sal_uInt16 nFileFormatVersion) const SAL_OVERRIDE;
 };
 
-
-
-class SVX_DLLPUBLIC SvxDoubleItem : public SfxPoolItem
+class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxDoubleItem : public SfxPoolItem
 {
     double fVal;
 
diff --git a/include/svx/clipboardctl.hxx b/include/svx/clipboardctl.hxx
index 9faedb4..07c5bbb 100644
--- a/include/svx/clipboardctl.hxx
+++ b/include/svx/clipboardctl.hxx
@@ -30,8 +30,7 @@
 class PopupMenu;
 class SvxClipboardFmtItem;
 
-
-class SVX_DLLPUBLIC SvxClipBoardControl : public SfxToolBoxControl
+class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxClipBoardControl : public SfxToolBoxControl
 {
     SfxPoolItem*            pClipboardFmtItem;
     PopupMenu*              pPopup;
@@ -52,7 +51,6 @@ public:
                                               const SfxPoolItem* pState ) SAL_OVERRIDE;
 };
 
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/clipfmtitem.hxx b/include/svx/clipfmtitem.hxx
index 8119650..e8a9453 100644
--- a/include/svx/clipfmtitem.hxx
+++ b/include/svx/clipfmtitem.hxx
@@ -26,7 +26,7 @@
 
 struct SvxClipboardFmtItem_Impl;
 
-class SVX_DLLPUBLIC SvxClipboardFmtItem : public SfxPoolItem
+class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxClipboardFmtItem : public SfxPoolItem
 {
     SvxClipboardFmtItem_Impl* pImpl;
 protected:
@@ -52,7 +52,6 @@ public:
     const OUString GetClipbrdFormatName( sal_uInt16 nPos ) const;
 };
 
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/colrctrl.hxx b/include/svx/colrctrl.hxx
index 7de406d..3896ffe 100644
--- a/include/svx/colrctrl.hxx
+++ b/include/svx/colrctrl.hxx
@@ -35,7 +35,7 @@ class SvData;
 |*
 \************************************************************************/
 
-class SvxColorValueSet_docking : public SvxColorValueSet, public DragSourceHelper
+class SAL_WARN_UNUSED SvxColorValueSet_docking : public SvxColorValueSet, public DragSourceHelper
 {
 private:
     using SvxColorValueSet::StartDrag;
@@ -69,9 +69,9 @@ public:
 |*
 \************************************************************************/
 
-class SvxColorDockingWindow : public SfxDockingWindow, public SfxListener
+class SAL_WARN_UNUSED SvxColorDockingWindow : public SfxDockingWindow, public SfxListener
 {
- friend class SvxColorChildWindow;
+friend class SvxColorChildWindow;
 
 private:
     XColorListRef       pColorList;
diff --git a/include/svx/compressgraphicdialog.hxx b/include/svx/compressgraphicdialog.hxx
index b8dcf80..17aa10a 100644
--- a/include/svx/compressgraphicdialog.hxx
+++ b/include/svx/compressgraphicdialog.hxx
@@ -30,7 +30,7 @@
 
 class SdrGrafObj;
 
-class SVX_DLLPUBLIC CompressGraphicsDialog : public ModalDialog
+class SVX_DLLPUBLIC SAL_WARN_UNUSED CompressGraphicsDialog : public ModalDialog
 {
 private:
     FixedText*       m_pLabelGraphicType;
diff --git a/include/svx/connctrl.hxx b/include/svx/connctrl.hxx
index 6caac03..7febedf 100644
--- a/include/svx/connctrl.hxx
+++ b/include/svx/connctrl.hxx
@@ -32,7 +32,7 @@ class SdrObjList;
 |* SvxXConnectionPreview
 |*
 \************************************************************************/
-class SVX_DLLPUBLIC SvxXConnectionPreview : public Control
+class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxXConnectionPreview : public Control
 {
  friend class SvxConnectionPage;
 
@@ -61,7 +61,6 @@ public:
     virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
 };
 
-
 #endif // INCLUDED_SVX_CONNCTRL_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/contdlg.hxx b/include/svx/contdlg.hxx
index f1192de..11d6c88 100644
--- a/include/svx/contdlg.hxx
+++ b/include/svx/contdlg.hxx
@@ -33,10 +33,9 @@
 
 class Graphic;
 
-class SVX_DLLPUBLIC SvxContourDlgChildWindow : public SfxChildWindow
+class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxContourDlgChildWindow : public SfxChildWindow
 {
- public:
-
+public:
     SvxContourDlgChildWindow( vcl::Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo* );
 
     SFX_DECL_CHILDWINDOW_WITHID( SvxContourDlgChildWindow );
@@ -47,7 +46,7 @@ class SVX_DLLPUBLIC SvxContourDlgChildWindow : public SfxChildWindow
 
 class SvxSuperContourDlg;
 
-class SvxContourDlgItem : public SfxControllerItem
+class SAL_WARN_UNUSED SvxContourDlgItem : public SfxControllerItem
 {
     SvxSuperContourDlg& rDlg;
 
@@ -60,7 +59,7 @@ public:
                         SvxContourDlgItem( sal_uInt16 nId, SvxSuperContourDlg& rDlg, SfxBindings& rBindings );
 };
 
-class SVX_DLLPUBLIC SvxContourDlg : public SfxFloatingWindow
+class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxContourDlg : public SfxFloatingWindow
 {
     using Window::Update;
 
diff --git a/include/svx/ctredlin.hxx b/include/svx/ctredlin.hxx
index 9d8d3c7..160ef10 100644
--- a/include/svx/ctredlin.hxx
+++ b/include/svx/ctredlin.hxx
@@ -43,7 +43,7 @@
 #define FLT_DATE_SAVE       5
 
 /// Struct for sorting data.
-class SVX_DLLPUBLIC RedlinData
+class SVX_DLLPUBLIC SAL_WARN_UNUSED RedlinData
 {
 public:
                     RedlinData();
@@ -54,7 +54,7 @@ public:
 };
 
 /// Entries for list.
-class SvxRedlinEntry : public SvTreeListEntry
+class SAL_WARN_UNUSED SvxRedlinEntry : public SvTreeListEntry
 {
 public:
                     SvxRedlinEntry();
@@ -62,7 +62,7 @@ public:
 };
 
 /// Class for the representation of Strings depending on the font.
-class SvLBoxColorString : public SvLBoxString
+class SAL_WARN_UNUSED SvLBoxColorString : public SvLBoxString
 {
 private:
 
@@ -84,7 +84,7 @@ public:
     SvLBoxItem*     Create() const SAL_OVERRIDE;
 };
 
-class SVX_DLLPUBLIC SvxRedlinTable : public SvSimpleTable
+class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxRedlinTable : public SvSimpleTable
 {
     using SvTabListBox::InsertEntry;
 
@@ -167,7 +167,7 @@ public:
 };
 
 /// Tabpage with the filter text entries etc.
-class SVX_DLLPUBLIC SvxTPFilter: public TabPage
+class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxTPFilter: public TabPage
 {
 private:
 
@@ -294,7 +294,7 @@ public:
 };
 
 /// Tabpage with the redlining entries.
-class SVX_DLLPUBLIC SvxTPView: public TabPage
+class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxTPView : public TabPage
 {
 private:
 
@@ -364,9 +364,7 @@ public:
 
 
 //  Redlining - Control (Accept- Changes)
-
-
-class SVX_DLLPUBLIC SvxAcceptChgCtr
+class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxAcceptChgCtr
     : public TabControl
     , public VclBuilderContainer
 {
diff --git a/include/svx/cube3d.hxx b/include/svx/cube3d.hxx
index 37ae37e..7fcdd0b 100644
--- a/include/svx/cube3d.hxx
+++ b/include/svx/cube3d.hxx
@@ -41,7 +41,7 @@ enum { CUBE_BOTTOM = 0x0001, CUBE_BACK = 0x0002, CUBE_LEFT = 0x0004,
        CUBE_FULL = 0x003F, CUBE_OPEN_TB = 0x0036, CUBE_OPEN_LR = 0x002B,
        CUBE_OPEN_FB = 0x001D };
 
-class SVX_DLLPUBLIC E3dCubeObj : public E3dCompoundObject
+class SVX_DLLPUBLIC SAL_WARN_UNUSED E3dCubeObj : public E3dCompoundObject
 {
 private:
     // Parameter
commit 6c3b1361a97f5219f90bf2f09f3c3f2b70b8e30e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 15 10:04:05 2015 +0100

    fix crash on export of fdo68639-2.ods to xls with invalid mnLastIdx
    
    mnLastIdx doesn't get reset when the color list is reset, the code already
    acknowledges that mnLastIdx is the last set index but that it may not be a
    valid position, so only set rnIndex if mnLastIdx is valid and the data at that
    pos is the desired data.
    
    Change-Id: I57ce32fd1a13bfe9049ed94be34229c8c2808b8e

diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index 2a79374..078a0ef 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -510,18 +510,22 @@ const Color& XclExpPaletteImpl::GetOriginalColor( sal_uInt32 nColorId ) const
 
 XclListColor* XclExpPaletteImpl::SearchListEntry( const Color& rColor, sal_uInt32& rnIndex )
 {
-    rnIndex = mnLastIdx;
-    XclListColor* pEntry = NULL;
+    rnIndex = 0;
 
     if (mxColorList->empty())
         return NULL;
 
+    XclListColor* pEntry = NULL;
+
     // search optimization for equal-colored objects occurring repeatedly
-    if (rnIndex < mxColorList->size())
+    if (mnLastIdx < mxColorList->size())
     {
-        pEntry = &(*mxColorList)[rnIndex];
+        pEntry = &(*mxColorList)[mnLastIdx];
         if( pEntry->GetColor() == rColor )
+        {
+            rnIndex = mnLastIdx;
             return pEntry;
+        }
     }
 
     // binary search for color


More information about the Libreoffice-commits mailing list