Hi!
I removed some unused code from modules svl, svltools and sfx2 according to unusedcode.easy.
Removed functions:
SfxAppMenuControl_Impl::RegisterControl(unsigned short, SfxModule*)
SfxApplication::Main()
SfxBrushItemLink::Set(SfxBrushItemLink*)
SfxHintPoster::RegisterEvent()
SfxProgress::Lock()
SfxRangeItem::SfxRangeItem(unsigned short, SvStream&)
SfxULongRanges::Contains(unsigned long) const
SfxULongRanges::Intersects(SfxULongRanges const&) const
Ps.: if it's ok, update unusedcode.easy accordingly, i think they're still in it. Forgot to delete
them :$
From 41d2d08ef1228fb658e11e89951837297320ea3c Mon Sep 17 00:00:00 2001
From: Szabolcs Dezsi <dezsiszabi@hotmail.com>
Date: Thu, 16 Feb 2012 14:00:48 +0100
Subject: [PATCH] Removed unused code from svl and sfx2
---
sfx2/inc/sfx2/app.hxx | 1 -
sfx2/inc/sfx2/childwin.hxx | 2 +-
sfx2/inc/sfx2/hintpost.hxx | 1 -
sfx2/inc/sfx2/mnuitem.hxx | 1 -
sfx2/inc/sfx2/progress.hxx | 1 -
sfx2/source/appl/appmain.cxx | 4 --
sfx2/source/bastyp/progress.cxx | 39 ------------------------
sfx2/source/menu/mnuitem.cxx | 8 -----
sfx2/source/notify/hintpost.cxx | 6 ----
svl/inc/svl/nranges.hxx | 2 -
svl/inc/svl/rngitem.hxx | 1 -
svl/source/items/nranges.cxx | 61 --------------------------------------
svl/source/items/rngitem_inc.cxx | 10 ------
svtools/inc/svtools/wallitem.hxx | 2 +-
svtools/source/misc/wallitem.cxx | 4 +-
unusedcode.easy | 16 +++++-----
16 files changed, 12 insertions(+), 147 deletions(-)
diff --git a/sfx2/inc/sfx2/app.hxx b/sfx2/inc/sfx2/app.hxx
index c255035..ea9dbc2 100644
--- a/sfx2/inc/sfx2/app.hxx
+++ b/sfx2/inc/sfx2/app.hxx
@@ -147,7 +147,6 @@ class SFX2_DLLPUBLIC SfxApplication: public SfxShell
void Init();
void Exit();
void SettingsChange( sal_uInt16, const AppSettings & );
- void Main( );
void PreInit( );
void Quit();
void Deinitialize();
diff --git a/sfx2/inc/sfx2/childwin.hxx b/sfx2/inc/sfx2/childwin.hxx
index fc7cf83..c96d1a6 100644
--- a/sfx2/inc/sfx2/childwin.hxx
+++ b/sfx2/inc/sfx2/childwin.hxx
@@ -307,7 +307,7 @@ public:
return pWin; \
} \
sal_uInt16 Class::GetChildWindowId () \
- { return MyID; } \
+ { return MyID; } \
void Class::RegisterChildWindow (sal_Bool bVis, SfxModule *pMod, sal_uInt16 nFlags) \
{ \
SfxChildWinFactory *pFact = new SfxChildWinFactory( \
diff --git a/sfx2/inc/sfx2/hintpost.hxx b/sfx2/inc/sfx2/hintpost.hxx
index f455d84..0f8eae2 100644
--- a/sfx2/inc/sfx2/hintpost.hxx
+++ b/sfx2/inc/sfx2/hintpost.hxx
@@ -56,7 +56,6 @@ class SfxHintPoster: public SvRefBase
GenLink aLink;
private:
- void RegisterEvent();
DECL_LINK( DoEvent_Impl, SfxHint * );
protected:
diff --git a/sfx2/inc/sfx2/mnuitem.hxx b/sfx2/inc/sfx2/mnuitem.hxx
index 62ebce6..08acfa6 100644
--- a/sfx2/inc/sfx2/mnuitem.hxx
+++ b/sfx2/inc/sfx2/mnuitem.hxx
@@ -56,7 +56,6 @@ public:
SfxMenuControl( sal_uInt16, SfxBindings&);
static SfxMenuControl* CreateImpl( sal_uInt16 nId, Menu &rMenu, SfxBindings &rBindings );
- static void RegisterControl( sal_uInt16 nSlotId = 0, SfxModule *pMod=NULL );
~SfxMenuControl();
diff --git a/sfx2/inc/sfx2/progress.hxx b/sfx2/inc/sfx2/progress.hxx
index 6dbdcfa..2f397c3 100644
--- a/sfx2/inc/sfx2/progress.hxx
+++ b/sfx2/inc/sfx2/progress.hxx
@@ -66,7 +66,6 @@ public:
void Suspend();
sal_Bool IsSuspended() const { return bSuspended; }
- void Lock();
void UnLock();
void Reschedule();
diff --git a/sfx2/source/appl/appmain.cxx b/sfx2/source/appl/appmain.cxx
index 3a16624..fbc6c77 100644
--- a/sfx2/source/appl/appmain.cxx
+++ b/sfx2/source/appl/appmain.cxx
@@ -118,10 +118,6 @@ void SfxApplication::PreInit( )
{
}
-void SfxApplication::Main( )
-{
-}
-
//-------------------------------------------------------------------------
SfxFilterMatcher& SfxApplication::GetFilterMatcher()
diff --git a/sfx2/source/bastyp/progress.cxx b/sfx2/source/bastyp/progress.cxx
index d6fb779..22025a6 100644
--- a/sfx2/source/bastyp/progress.cxx
+++ b/sfx2/source/bastyp/progress.cxx
@@ -461,45 +461,6 @@ void SfxProgress::Suspend()
// -----------------------------------------------------------------------
-void SfxProgress::Lock()
-{
- if( pImp->pActiveProgress ) return;
- // No Reschedule for Embedded-Objects,
- // because we are defenseless against the OLE protocol
- if ( !pImp->xObjSh.Is() )
- {
- for ( SfxObjectShell *pDocSh = SfxObjectShell::GetFirst();
- pDocSh;
- pDocSh = SfxObjectShell::GetNext(*pDocSh) )
- {
- SfxObjectCreateMode eMode = pDocSh->GetCreateMode();
- if ( ( eMode == SFX_CREATE_MODE_EMBEDDED ) ||
- ( eMode == SFX_CREATE_MODE_PREVIEW ) )
- {
- DBG( DbgOutf( "SfxProgress: not locked because EMBEDDED/PREVIEW found" ) );
- pImp->bAllowRescheduling = sal_False;
- }
- }
- }
- else
- {
- SfxObjectCreateMode eMode = pImp->xObjSh->GetCreateMode();
- if ( ( eMode == SFX_CREATE_MODE_EMBEDDED ) ||
- ( eMode == SFX_CREATE_MODE_PREVIEW ) )
- {
- DBG( DbgOutf( "SfxProgress: not locked because ObjectShell is EMBEDDED/PREVIEW" ) );
- pImp->bAllowRescheduling = sal_False;
- }
- }
-
- pImp->Enable_Impl( sal_False );
-
- DBG( DbgOutf( "SfxProgress: locked" ) );
- pImp->bLocked = sal_True;
-}
-
-// -----------------------------------------------------------------------
-
void SfxProgress::UnLock()
{
if( pImp->pActiveProgress ) return;
diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx
index 9e95857..32b173e 100644
--- a/sfx2/source/menu/mnuitem.cxx
+++ b/sfx2/source/menu/mnuitem.cxx
@@ -247,14 +247,6 @@ SfxMenuControl* SfxMenuControl::CreateImpl( sal_uInt16 /*nId*/, Menu&
/*rMenu*/,
}
//--------------------------------------------------------------------
-
-void SfxMenuControl::RegisterControl( sal_uInt16 nSlotId, SfxModule *pMod )
-{
- RegisterMenuControl( pMod, new SfxMenuCtrlFactory(
- SfxMenuControl::CreateImpl, TYPE(SfxStringItem), nSlotId ) );
-}
-
-//--------------------------------------------------------------------
void SfxMenuControl::RegisterMenuControl(SfxModule* pMod, SfxMenuCtrlFactory* pFact)
{
SFX_APP()->RegisterMenuControl_Impl( pMod, pFact );
diff --git a/sfx2/source/notify/hintpost.cxx b/sfx2/source/notify/hintpost.cxx
index 3c849c5..ad6e85e 100644
--- a/sfx2/source/notify/hintpost.cxx
+++ b/sfx2/source/notify/hintpost.cxx
@@ -32,12 +32,6 @@
#include <sfx2/app.hxx>
#include "sfxtypes.hxx"
-//====================================================================
-
-void SfxHintPoster::RegisterEvent()
-{
-}
-
//--------------------------------------------------------------------
SfxHintPoster::SfxHintPoster( const GenLink& rLink ):
diff --git a/svl/inc/svl/nranges.hxx b/svl/inc/svl/nranges.hxx
index 2654a21..badb3e9 100644
--- a/svl/inc/svl/nranges.hxx
+++ b/svl/inc/svl/nranges.hxx
@@ -80,8 +80,6 @@ public:
NUMTYPE Count() const;
sal_Bool IsEmpty() const
{ return !_pRanges || 0 == *_pRanges; }
- sal_Bool Contains( NUMTYPE n ) const;
- sal_Bool Intersects( const SfxNumRanges & ) const;
operator const NUMTYPE* () const
{ return _pRanges; }
diff --git a/svl/inc/svl/rngitem.hxx b/svl/inc/svl/rngitem.hxx
index 0a90af8..02eeb06 100644
--- a/svl/inc/svl/rngitem.hxx
+++ b/svl/inc/svl/rngitem.hxx
@@ -67,7 +67,6 @@ public:
TYPEINFO();
SfxXRangeItem();
SfxXRangeItem( sal_uInt16 nWID, NUMTYPE nFrom, NUMTYPE nTo );
- SfxXRangeItem( sal_uInt16 nWID, SvStream &rStream );
SfxXRangeItem( const SfxXRangeItem& rItem );
virtual int operator==( const SfxPoolItem& ) const;
virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
diff --git a/svl/source/items/nranges.cxx b/svl/source/items/nranges.cxx
index 5d7c034..c3d89d8 100644
--- a/svl/source/items/nranges.cxx
+++ b/svl/source/items/nranges.cxx
@@ -720,50 +720,6 @@ SfxNumRanges& SfxNumRanges::operator /=
//------------------------------------------------------------------------
-sal_Bool SfxNumRanges::Intersects( const SfxNumRanges &rRanges ) const
-
-/** <H3>Description</H3>
-
- Determines if at least one range in 'rRanges' intersects with one
- range in '*this'.
-
- sal_True, if there is at least one with:
- this->Contains( n ) && rRanges.Contains( n )
-*/
-
-{
- // special cases: one is empty
- if ( rRanges.IsEmpty() || IsEmpty() )
- return sal_False;
-
- // find at least one intersecting range
- const NUMTYPE *pRange1 = _pRanges;
- const NUMTYPE *pRange2 = rRanges._pRanges;
-
- do
- {
- // 1st range is smaller than 2nd range?
- if ( pRange1[1] < pRange2[0] )
- // => keep 1st range
- pRange1 += 2;
-
- // 2nd range is smaller than 1st range?
- else if ( pRange2[1] < pRange1[0] )
- // => skip 2nd range
- pRange2 += 2;
-
- // the ranges are overlappung
- else
- return sal_True;
- }
- while ( *pRange2 );
-
- // no intersection found
- return sal_False;
-}
-
-//------------------------------------------------------------------------
-
NUMTYPE SfxNumRanges::Count() const
/** <H3>Description</H3>
@@ -776,21 +732,4 @@ NUMTYPE SfxNumRanges::Count() const
return Capacity_Impl( _pRanges );
}
-//------------------------------------------------------------------------
-
-sal_Bool SfxNumRanges::Contains( NUMTYPE n ) const
-
-/** <H3>Description</H3>
-
- Determines if '*this' contains 'n'.
-*/
-
-{
- for ( NUMTYPE *pRange = _pRanges; *pRange && *pRange <= n; pRange += 2 )
- if ( pRange[0] <= n && n <= pRange[1] )
- return sal_True;
- return sal_False;
-
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/items/rngitem_inc.cxx b/svl/source/items/rngitem_inc.cxx
index 5be6228..b1c21c3 100644
--- a/svl/source/items/rngitem_inc.cxx
+++ b/svl/source/items/rngitem_inc.cxx
@@ -60,16 +60,6 @@ SfxXRangeItem::SfxXRangeItem( sal_uInt16 which, NUMTYPE from, NUMTYPE to ):
{
}
-
-// -----------------------------------------------------------------------
-
-SfxXRangeItem::SfxXRangeItem( sal_uInt16 nW, SvStream &rStream ) :
- SfxPoolItem( nW )
-{
- rStream >> nFrom;
- rStream >> nTo;
-}
-
// -----------------------------------------------------------------------
SfxXRangeItem::SfxXRangeItem( const SfxXRangeItem& rItem ) :
diff --git a/svtools/inc/svtools/wallitem.hxx b/svtools/inc/svtools/wallitem.hxx
index a27dd11..feaec1c 100644
--- a/svtools/inc/svtools/wallitem.hxx
+++ b/svtools/inc/svtools/wallitem.hxx
@@ -57,7 +57,7 @@ public:
virtual CreateSvxBrushTabPage GetBackgroundTabpageCreateFunc() = 0;
virtual GetSvxBrushTabPageRanges GetBackgroundTabpageRanges() = 0;
static SfxBrushItemLink* Get() { return *(SfxBrushItemLink**)GetAppData(SHL_BRUSHITEM); }
- static void Set( SfxBrushItemLink* pLink );
+ //static void Set( SfxBrushItemLink* pLink );
};
#endif // _SFX_BRUSHITEMLINK_DECLARED
diff --git a/svtools/source/misc/wallitem.cxx b/svtools/source/misc/wallitem.cxx
index a348945..2834d64 100644
--- a/svtools/source/misc/wallitem.cxx
+++ b/svtools/source/misc/wallitem.cxx
@@ -50,13 +50,13 @@ SfxBrushItemLink::~SfxBrushItemLink()
}
//static
-void SfxBrushItemLink::Set( SfxBrushItemLink* pLink )
+/*void SfxBrushItemLink::Set( SfxBrushItemLink* pLink )
{
SfxBrushItemLink** ppLink = (SfxBrushItemLink**)GetAppData(SHL_BRUSHITEM);
if( !*ppLink )
*ppLink = pLink;
else
delete pLink;
-}
+}*/
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unusedcode.easy b/unusedcode.easy
index 9a40c2f..db5bcc6 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -191,9 +191,9 @@ SectReprArr::Insert(SectReprArr const*, unsigned short, unsigned short)
SectReprArr::Remove(SectRepr* const&, unsigned short)
SectReprArr::Remove(unsigned short, unsigned short)
SecurityEnvironment_NssImpl::getImplementation(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>)
-SfxAppMenuControl_Impl::RegisterControl(unsigned short, SfxModule*)
-SfxApplication::Main()
-SfxBrushItemLink::Set(SfxBrushItemLink*)
+//SfxAppMenuControl_Impl::RegisterControl(unsigned short, SfxModule*)
+//SfxApplication::Main()
+//SfxBrushItemLink::Set(SfxBrushItemLink*)
SfxDockingWrapper::GetChildWindowId()
SfxFilterPtrArr::DeleteAndDestroy(unsigned short, unsigned short)
SfxFoundCacheArr_Impl::Insert(SfxFoundCacheArr_Impl const*, unsigned short, unsigned short)
@@ -201,15 +201,15 @@ SfxFoundCacheArr_Impl::Insert(SfxFoundCache_Impl const*&, unsigned short&)
SfxFoundCacheArr_Impl::Insert(SfxFoundCache_Impl const**, unsigned short)
SfxFoundCacheArr_Impl::Remove(SfxFoundCache_Impl const*&, unsigned short)
SfxFoundCacheArr_Impl::Remove(unsigned short, unsigned short)
-SfxHintPoster::RegisterEvent()
+//SfxHintPoster::RegisterEvent()
SfxMedium::GetHdl()
SfxModuleArr_Impl::DeleteAndDestroy(unsigned short, unsigned short)
SfxNavigatorWrapper::GetChildWindowId()
SfxOleStringPropertyBase::SfxOleStringPropertyBase(int, int, unsigned short, String const&)
SfxPartChildWnd_Impl::GetChildWindowId()
SfxPopupWindow::LinkStubDelete(void*, void*)
-SfxProgress::Lock()
-SfxRangeItem::SfxRangeItem(unsigned short, SvStream&)
+//SfxProgress::Lock()
+//SfxRangeItem::SfxRangeItem(unsigned short, SvStream&)
SfxRecordingFloatWrapper_Impl::GetChildWindowId()
SfxThesSubMenuControl::RegisterControl(unsigned short, SfxModule*)
SfxUINT32s::Insert(SfxUINT32s const*, unsigned short, unsigned short, unsigned short)
@@ -218,8 +218,8 @@ SfxUINT32s::Replace(unsigned int const&, unsigned short)
SfxUINT32s::Replace(unsigned int const*, unsigned short, unsigned short)
SfxUINT32s::_ForEach(unsigned short, unsigned short, unsigned char (*)(unsigned int const&,
void*), void*)
SfxULongRangeItem::SfxULongRangeItem(unsigned short, SvStream&)
-SfxULongRanges::Contains(unsigned long) const
-SfxULongRanges::Intersects(SfxULongRanges const&) const
+//SfxULongRanges::Contains(unsigned long) const
+//SfxULongRanges::Intersects(SfxULongRanges const&) const
SfxULongRanges::SfxULongRanges(int, int, int, ...)
SfxULongRanges::SfxULongRanges(unsigned long const*)
SfxULongRanges::SfxULongRanges(unsigned long, unsigned long)
--
1.7.7
Context
- [PATCH] Removed unused code from svl, svtools and sfx2 · Dézsi Szabolcs
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.