summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-03-14 13:27:56 +0100
committerStephan Bergmann <sbergman@redhat.com>2012-03-14 13:32:02 +0100
commit6e67c03dc0225fc66343546b14e902b9d238b1a3 (patch)
tree6e078783d65e280a721b4e46f0ae0ca6b950f121 /sw
parentfe4be5047988782f3143a1af505c5eecb3f2af5a (diff)
Enable -Wnon-virtual-dtor for GCC 4.6
...which has the necessary features to support it. Change a lot of classes to either contain a protected non-virtual dtor (which is backwards compatible, so even works for cppumaker-generated UNO headers) or a public virtual one. cppuhelper/propertysetmixin.hxx still needs to disable the warning, as the relevant class has a non-virtual dtor but friends, which would still cause GCC to warn. Includes a patch for libcmis, intended to be upstreamed.
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/TextCursorHelper.hxx3
-rw-r--r--sw/inc/swabstdlg.hxx3
-rw-r--r--sw/inc/swcrsr.hxx3
-rw-r--r--sw/inc/unocoll.hxx2
-rw-r--r--sw/source/core/access/acctable.cxx5
-rw-r--r--sw/source/core/crsr/findcoll.cxx1
-rw-r--r--sw/source/core/layout/dbg_lay.cxx4
-rw-r--r--sw/source/core/txtnode/fntcap.cxx9
-rw-r--r--sw/source/ui/dbui/mmgreetingspage.hxx5
-rw-r--r--sw/source/ui/dialog/swdlgfact.hxx2
10 files changed, 34 insertions, 3 deletions
diff --git a/sw/inc/TextCursorHelper.hxx b/sw/inc/TextCursorHelper.hxx
index 731cccf33c58..4269a8de4f98 100644
--- a/sw/inc/TextCursorHelper.hxx
+++ b/sw/inc/TextCursorHelper.hxx
@@ -48,6 +48,9 @@ public:
virtual SwPaM* GetPaM() = 0;
virtual const SwDoc* GetDoc() const = 0;
virtual SwDoc* GetDoc() = 0;
+
+protected:
+ ~OTextCursorHelper() {}
};
#endif // _SW_TEXTCURSORHELPER_HXX
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index 22d780f5e128..ab6e8a593372 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -503,6 +503,9 @@ public:
// for tabpage
virtual CreateTabPage GetTabPageCreatorFunc( sal_uInt16 nId ) = 0;
virtual GetTabPageRanges GetTabPageRangesFunc( sal_uInt16 nId ) = 0;
+
+protected:
+ ~SwAbstractDialogFactory() {}
};
#endif
diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx
index 9bb433a272c3..d42de518d0ed 100644
--- a/sw/inc/swcrsr.hxx
+++ b/sw/inc/swcrsr.hxx
@@ -52,6 +52,9 @@ struct SwFindParas
{
virtual int Find( SwPaM*, SwMoveFn, const SwPaM*, sal_Bool ) = 0;
virtual int IsReplaceMode() const = 0;
+
+protected:
+ ~SwFindParas() {}
};
typedef sal_uInt16 SwCursorSelOverFlags;
diff --git a/sw/inc/unocoll.hxx b/sw/inc/unocoll.hxx
index 07596e018c5c..2554ca6bd89f 100644
--- a/sw/inc/unocoll.hxx
+++ b/sw/inc/unocoll.hxx
@@ -73,6 +73,8 @@ class SwUnoCollection
pDoc(p),
bObjectValid(sal_True){}
+ virtual ~SwUnoCollection() {}
+
virtual void Invalidate();
sal_Bool IsValid() const {return bObjectValid;}
diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx
index 96c0b7b68f62..89fc739a377d 100644
--- a/sw/source/core/access/acctable.cxx
+++ b/sw/source/core/access/acctable.cxx
@@ -74,6 +74,9 @@ class SwAccTableSelHander_Impl
{
public:
virtual void Unselect( sal_Int32 nRowOrCol, sal_Int32 nExt ) = 0;
+
+protected:
+ ~SwAccTableSelHander_Impl() {}
};
@@ -507,6 +510,8 @@ public:
inline SwAccSingleTableSelHander_Impl();
+ virtual ~SwAccSingleTableSelHander_Impl() {}
+
inline sal_Bool IsSelected() const { return bSelected; }
virtual void Unselect( sal_Int32, sal_Int32 );
diff --git a/sw/source/core/crsr/findcoll.cxx b/sw/source/core/crsr/findcoll.cxx
index 6900ad279213..2dfb63b0f2be 100644
--- a/sw/source/core/crsr/findcoll.cxx
+++ b/sw/source/core/crsr/findcoll.cxx
@@ -48,6 +48,7 @@ struct SwFindParaFmtColl : public SwFindParas
const SwTxtFmtColl* pRpColl, SwCursor& rCrsr )
: pFmtColl( &rFmtColl ), pReplColl( pRpColl ), rCursor( rCrsr )
{}
+ virtual ~SwFindParaFmtColl() {}
virtual int Find( SwPaM* , SwMoveFn , const SwPaM*, sal_Bool bInReadOnly );
virtual int IsReplaceMode() const;
};
diff --git a/sw/source/core/layout/dbg_lay.cxx b/sw/source/core/layout/dbg_lay.cxx
index 69cdfeb5b1ff..660133328e65 100644
--- a/sw/source/core/layout/dbg_lay.cxx
+++ b/sw/source/core/layout/dbg_lay.cxx
@@ -236,6 +236,7 @@ protected:
public:
SwImplEnterLeave( const SwFrm* pF, sal_uLong nFunct, sal_uLong nAct, void* pPar )
: pFrm( pF ), nFunction( nFunct ), nAction( nAct ), pParam( pPar ) {}
+ virtual ~SwImplEnterLeave() {}
virtual void Enter(); // message when entering
virtual void Leave(); // message when leaving
};
@@ -246,6 +247,7 @@ class SwSizeEnterLeave : public SwImplEnterLeave
public:
SwSizeEnterLeave( const SwFrm* pF, sal_uLong nFunct, sal_uLong nAct, void* pPar )
: SwImplEnterLeave( pF, nFunct, nAct, pPar ), nFrmHeight( pF->Frm().Height() ) {}
+ virtual ~SwSizeEnterLeave() {}
virtual void Leave(); // resize message
};
@@ -255,6 +257,7 @@ class SwUpperEnterLeave : public SwImplEnterLeave
public:
SwUpperEnterLeave( const SwFrm* pF, sal_uLong nFunct, sal_uLong nAct, void* pPar )
: SwImplEnterLeave( pF, nFunct, nAct, pPar ), nFrmId( 0 ) {}
+ virtual ~SwUpperEnterLeave() {}
virtual void Enter(); // message
virtual void Leave(); // message of FrmId from upper
};
@@ -265,6 +268,7 @@ class SwFrmChangesLeave : public SwImplEnterLeave
public:
SwFrmChangesLeave( const SwFrm* pF, sal_uLong nFunct, sal_uLong nAct, void* pPar )
: SwImplEnterLeave( pF, nFunct, nAct, pPar ), aFrm( pF->Frm() ) {}
+ virtual ~SwFrmChangesLeave() {}
virtual void Enter(); // no message
virtual void Leave(); // message when resizing the Frm area
};
diff --git a/sw/source/core/txtnode/fntcap.cxx b/sw/source/core/txtnode/fntcap.cxx
index dce161822d58..aaac7060d6d8 100644
--- a/sw/source/core/txtnode/fntcap.cxx
+++ b/sw/source/core/txtnode/fntcap.cxx
@@ -118,8 +118,9 @@ protected:
SwDrawTextInfo &rInf;
SwCapitalInfo* pCapInf; // referes to additional information
// required by the ::Do function
-public:
SwDoCapitals ( SwDrawTextInfo &rInfo ) : rInf( rInfo ), pCapInf( 0 ) { }
+ ~SwDoCapitals() {}
+public:
virtual void Init( SwFntObj *pUpperFont, SwFntObj *pLowerFont ) = 0;
virtual void Do() = 0;
inline OutputDevice& GetOut() { return rInf.GetOut(); }
@@ -138,6 +139,7 @@ protected:
Size aTxtSize;
public:
SwDoGetCapitalSize( SwDrawTextInfo &rInfo ) : SwDoCapitals ( rInfo ) { }
+ virtual ~SwDoGetCapitalSize() {}
virtual void Init( SwFntObj *pUpperFont, SwFntObj *pLowerFont );
virtual void Do();
const Size &GetSize() const { return aTxtSize; }
@@ -198,6 +200,7 @@ public:
: SwDoCapitals ( rInfo ), pExtraPos( pExtra ), nTxtWidth( nWidth ),
nBreak( STRING_LEN )
{ }
+ virtual ~SwDoGetCapitalBreak() {}
virtual void Init( SwFntObj *pUpperFont, SwFntObj *pLowerFont );
virtual void Do();
xub_StrLen GetBreak() const { return nBreak; }
@@ -288,6 +291,7 @@ public:
SwDoDrawCapital( SwDrawTextInfo &rInfo ) :
SwDoCapitals( rInfo ), pUpperFnt(0), pLowerFnt(0)
{ }
+ virtual ~SwDoDrawCapital() {}
virtual void Init( SwFntObj *pUpperFont, SwFntObj *pLowerFont );
virtual void Do();
void DrawSpace( Point &rPos );
@@ -386,6 +390,7 @@ public:
SwDoCapitalCrsrOfst( SwDrawTextInfo &rInfo, const sal_uInt16 nOfs ) :
SwDoCapitals( rInfo ), pUpperFnt(0), pLowerFnt(0), nCrsr( 0 ), nOfst( nOfs )
{ }
+ virtual ~SwDoCapitalCrsrOfst() {}
virtual void Init( SwFntObj *pUpperFont, SwFntObj *pLowerFont );
virtual void Do();
@@ -471,6 +476,8 @@ public:
nCapWidth( nCapitalWidth ),
nOrgWidth( rInfo.GetWidth() )
{ }
+
+ virtual ~SwDoDrawStretchCapital() {}
};
/*************************************************************************
diff --git a/sw/source/ui/dbui/mmgreetingspage.hxx b/sw/source/ui/dbui/mmgreetingspage.hxx
index 37cbc6d2db0e..a84c89564ac4 100644
--- a/sw/source/ui/dbui/mmgreetingspage.hxx
+++ b/sw/source/ui/dbui/mmgreetingspage.hxx
@@ -41,8 +41,7 @@ class SwMailMergeWizard;
class SwGreetingsHandler
{
- friend class SwMailBodyDialog;
- friend class SwMailMergeGreetingsPage;
+protected:
CheckBox* m_pGreetingLineCB;
CheckBox* m_pPersonalizedCB;
@@ -68,6 +67,8 @@ class SwGreetingsHandler
SwMailMergeWizard* m_pWizard;
+ ~SwGreetingsHandler() {}
+
DECL_LINK(IndividualHdl_Impl, void *);
DECL_LINK(GreetingHdl_Impl, PushButton*);
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index 94849005d097..23384128592e 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -433,6 +433,8 @@ class SwAbstractDialogFactory_Impl : public SwAbstractDialogFactory
{
public:
+ virtual ~SwAbstractDialogFactory_Impl() {}
+
virtual SfxAbstractDialog* CreateSfxDialog( Window* pParent, //add for SvxMeasureDialog & SvxConnectionDialog
const SfxItemSet& rAttr,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame,