[Libreoffice-commits] core.git: 8 commits - include/sfx2 include/svtools leak-suppress.txt sfx2/Library_sfx.mk sfx2/source svtools/Library_svt.mk svtools/source vcl/inc vcl/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Tue Aug 26 04:44:41 PDT 2014
include/sfx2/shell.hxx | 337 +++++++++++++++++++++--
include/svtools/itemdel.hxx | 30 --
leak-suppress.txt | 16 +
sfx2/Library_sfx.mk | 1
sfx2/source/control/bindings.cxx | 2
sfx2/source/control/itemdel.cxx | 85 ++++++
sfx2/source/control/querystatus.cxx | 2
sfx2/source/control/request.cxx | 2
sfx2/source/control/sfxstatuslistener.cxx | 2
sfx2/source/control/shell.cxx | 425 ------------------------------
sfx2/source/inc/itemdel.hxx | 28 +
svtools/Library_svt.mk | 1
svtools/source/misc/itemdel.cxx | 85 ------
vcl/inc/idlemgr.hxx | 1
vcl/source/app/idlemgr.cxx | 11
15 files changed, 449 insertions(+), 579 deletions(-)
New commits:
commit 2a93ed09240c6e9871593641dabbb7502af87986
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Aug 26 13:31:41 2014 +0200
also add libgdk to suppressed leaks
Change-Id: I2a276a6932ea1a36323f4c117e6caabaff9f0168
diff --git a/leak-suppress.txt b/leak-suppress.txt
index acc9a94..b4fb50a 100644
--- a/leak-suppress.txt
+++ b/leak-suppress.txt
@@ -30,6 +30,10 @@ leak:RTTI::getRTTI
# glib not built with asan/lsan
leak:libglib
+# ignore gdk reported leaks, most likely false positives
+# gdk not built with asan/lsan
+leak:libgdk
+
# ignore fontconfig reported leaks, most likely false positives
# fontconfig not built with asan/lsan
leak:libfontconfig.so
commit cf884b5c4e31aeb7d2393a3efabcd4abda58a8e1
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Aug 26 13:09:25 2014 +0200
add external libs to the suppression file
These are not built with Asan/Lsan and therefore are most likely false
positives.
Change-Id: I76ae7e4d023ab6401a34b61dbc9a05bc75327253
diff --git a/leak-suppress.txt b/leak-suppress.txt
index 5c04b7c..acc9a94 100644
--- a/leak-suppress.txt
+++ b/leak-suppress.txt
@@ -25,3 +25,15 @@ leak:ResMgr::CreateResMgr
# bridge's RTTI information, leaked knowingly
leak:RTTI::getRTTI
+
+# ignore glib reported leaks, most likely false positives
+# glib not built with asan/lsan
+leak:libglib
+
+# ignore fontconfig reported leaks, most likely false positives
+# fontconfig not built with asan/lsan
+leak:libfontconfig.so
+
+# ignore libGL related leaks, most likely false positives
+# libGL is not built with asan/lsan
+leak:libGL.so
commit 6b50f11fafad9b934bef24259ebf90fbfb1d0a30
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Aug 25 22:15:09 2014 +0200
fix nasty memory leak on shutdown
This makes the output of Lsan so much more useful.
Change-Id: I6c7624d4f6f767454c125c00ce037f5d2ec3cd61
diff --git a/vcl/inc/idlemgr.hxx b/vcl/inc/idlemgr.hxx
index 02fc85e..4e0a639 100644
--- a/vcl/inc/idlemgr.hxx
+++ b/vcl/inc/idlemgr.hxx
@@ -31,6 +31,7 @@ class ImplIdleMgr
private:
ImplIdleList* mpIdleList;
AutoTimer maTimer;
+ bool mbInDestruction;
public:
ImplIdleMgr();
diff --git a/vcl/source/app/idlemgr.cxx b/vcl/source/app/idlemgr.cxx
index cd41d12..fbbd141 100644
--- a/vcl/source/app/idlemgr.cxx
+++ b/vcl/source/app/idlemgr.cxx
@@ -30,7 +30,8 @@ struct ImplIdleData
#define IMPL_IDLETIMEOUT 350
-ImplIdleMgr::ImplIdleMgr()
+ImplIdleMgr::ImplIdleMgr():
+ mbInDestruction(false)
{
mpIdleList = new ImplIdleList();
@@ -40,9 +41,12 @@ ImplIdleMgr::ImplIdleMgr()
ImplIdleMgr::~ImplIdleMgr()
{
+ mbInDestruction = true;
// Liste loeschen
for ( size_t i = 0, n = mpIdleList->size(); i < n; ++i ) {
- delete (*mpIdleList)[ i ];
+ ImplIdleData* pIdleData = (*mpIdleList)[ i ];
+ pIdleData->maIdleHdl.Call( GetpApp() );
+ delete pIdleData;
}
mpIdleList->clear();
delete mpIdleList;
@@ -84,6 +88,9 @@ bool ImplIdleMgr::InsertIdleHdl( const Link& rLink, sal_uInt16 nPriority )
void ImplIdleMgr::RemoveIdleHdl( const Link& rLink )
{
+ if (mbInDestruction)
+ return;
+
for ( ImplIdleList::iterator it = mpIdleList->begin(); it != mpIdleList->end(); ++it ) {
if ( (*it)->maIdleHdl == rLink ) {
delete *it;
commit f6c0803e9984e716f5ba86a0271ecad7e0ed61d8
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Aug 25 16:40:47 2014 +0200
itemdel.[ch]xx is only used in sfx2
Change-Id: I240f15f87e27ba8a52bab244f8c784d527bff179
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index 249cdd8..8ce0196 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -133,6 +133,7 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/config/evntconf \
sfx2/source/control/bindings \
sfx2/source/control/ctrlitem \
+ sfx2/source/control/itemdel \
sfx2/source/control/minfitem \
sfx2/source/control/msg \
sfx2/source/control/msgpool \
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index afa3d1c..ad43c5b 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -42,7 +42,7 @@
#include <com/sun/star/frame/DispatchDescriptor.hpp>
#include <com/sun/star/frame/XController.hpp>
#include <comphelper/processfactory.hxx>
-#include <svtools/itemdel.hxx>
+#include "itemdel.hxx"
//Includes below due to nInReschedule
#include "appdata.hxx"
diff --git a/svtools/source/misc/itemdel.cxx b/sfx2/source/control/itemdel.cxx
similarity index 98%
rename from svtools/source/misc/itemdel.cxx
rename to sfx2/source/control/itemdel.cxx
index 7645089..7ff4d38 100644
--- a/svtools/source/misc/itemdel.cxx
+++ b/sfx2/source/control/itemdel.cxx
@@ -20,7 +20,7 @@
#include <sal/config.h>
#include <boost/noncopyable.hpp>
-#include <svtools/itemdel.hxx>
+#include "itemdel.hxx"
#include <vcl/svapp.hxx>
#include <tools/errcode.hxx>
#include <limits.h>
diff --git a/sfx2/source/control/querystatus.cxx b/sfx2/source/control/querystatus.cxx
index 64c1c0e..ba45538 100644
--- a/sfx2/source/control/querystatus.cxx
+++ b/sfx2/source/control/querystatus.cxx
@@ -26,7 +26,7 @@
#include <svl/stritem.hxx>
#include <svl/intitem.hxx>
#include <svl/itemset.hxx>
-#include <svtools/itemdel.hxx>
+#include "itemdel.hxx"
#include <svl/visitem.hxx>
#include <cppuhelper/implbase1.hxx>
#include <comphelper/processfactory.hxx>
diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx
index 083d5ea..a98302b 100644
--- a/sfx2/source/control/request.cxx
+++ b/sfx2/source/control/request.cxx
@@ -28,7 +28,7 @@
#include <svl/itemiter.hxx>
#include <svl/itempool.hxx>
-#include <svtools/itemdel.hxx>
+#include "itemdel.hxx"
#include <comphelper/processfactory.hxx>
diff --git a/sfx2/source/control/sfxstatuslistener.cxx b/sfx2/source/control/sfxstatuslistener.cxx
index 703ad90..543bf3d 100644
--- a/sfx2/source/control/sfxstatuslistener.cxx
+++ b/sfx2/source/control/sfxstatuslistener.cxx
@@ -23,7 +23,7 @@
#include <svl/stritem.hxx>
#include <svl/intitem.hxx>
#include <svl/itemset.hxx>
-#include <svtools/itemdel.hxx>
+#include "itemdel.hxx"
#include <svl/visitem.hxx>
#include <cppuhelper/weak.hxx>
#include <comphelper/processfactory.hxx>
diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx
index 594363e..fbe76d2 100644
--- a/sfx2/source/control/shell.cxx
+++ b/sfx2/source/control/shell.cxx
@@ -25,7 +25,7 @@
#include <sal/log.hxx>
#include <svl/itempool.hxx>
#include <svl/undo.hxx>
-#include <svtools/itemdel.hxx>
+#include "itemdel.hxx"
#include <svtools/asynclink.hxx>
#include <basic/sbx.hxx>
diff --git a/include/svtools/itemdel.hxx b/sfx2/source/inc/itemdel.hxx
similarity index 85%
rename from include/svtools/itemdel.hxx
rename to sfx2/source/inc/itemdel.hxx
index da68f2f..cd5d14d 100644
--- a/include/svtools/itemdel.hxx
+++ b/sfx2/source/inc/itemdel.hxx
@@ -16,14 +16,12 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_SVTOOLS_ITEMDEL_HXX
-#define INCLUDED_SVTOOLS_ITEMDEL_HXX
-
-#include <svtools/svtdllapi.h>
+#ifndef INCLUDED_SFX2_ITEMDEL_HXX
+#define INCLUDED_SFX2_ITEMDEL_HXX
class SfxPoolItem;
-SVT_DLLPUBLIC void DeleteItemOnIdle( SfxPoolItem* pItem );
+void DeleteItemOnIdle( SfxPoolItem* pItem );
#endif
diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk
index ea5e953..07dc321 100644
--- a/svtools/Library_svt.mk
+++ b/svtools/Library_svt.mk
@@ -181,7 +181,6 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
svtools/source/misc/imap \
svtools/source/misc/imap2 \
svtools/source/misc/imap3 \
- svtools/source/misc/itemdel \
svtools/source/misc/langtab \
svtools/source/misc/langhelp \
svtools/source/misc/openfiledroptargetlistener \
commit ed4142f19a277cd982fd4f9ea19d64282f4d105e
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Aug 25 16:16:34 2014 +0200
turn method documentation into doxygen comments
Change-Id: I38a10833b1d0b17c70298b6ed7a850cb9b728813
diff --git a/include/sfx2/shell.hxx b/include/sfx2/shell.hxx
index 629826c..b79fd2d 100644
--- a/include/sfx2/shell.hxx
+++ b/include/sfx2/shell.hxx
@@ -60,8 +60,7 @@ namespace svl
class IUndoManager;
}
-/* [Description]
-
+/**
Id for <SfxInterface>s, gives a quasi-static access to the interface
through an array to <SfxApplication>.
*/
@@ -121,8 +120,7 @@ enum SfxInterfaceId
typedef void (*SfxExecFunc)(SfxShell *, SfxRequest &rReq);
typedef void (*SfxStateFunc)(SfxShell *, SfxItemSet &rSet);
-/* [Description]
-
+/**
The class SfxShell is the base class for all classes, which provide
the functionality of the form <Slot>s.
@@ -148,20 +146,18 @@ private:
SfxShell& operator = ( const SfxShell & ); // internal
protected:
- /* [Description]
-
+ /**
The constructor of the SfxShell class initializes only simple types,
the corresponding SbxObject is only created on-demand. Therefore,
the application of a SfxShell instance is very cheap.
*/
SfxShell();
-/* [Description]
-
- The constructor of the SfxShell class initializes only simple types,
- the corresponding SbxObject is only created on-demand. Therefore,
- the application of a SfxShell instance is very cheap.
-*/
+ /**
+ The constructor of the SfxShell class initializes only simple types,
+ the corresponding SbxObject is only created on-demand. Therefore,
+ the application of a SfxShell instance is very cheap.
+ */
SfxShell( SfxViewShell *pViewSh );
SAL_DLLPRIVATE void SetViewShell_Impl( SfxViewShell* pView );
@@ -172,16 +168,14 @@ protected:
public:
TYPEINFO_OVERRIDE();
- /* [Description]
-
+ /**
The connection to a possible corresponding SbxObject is dissolved.
The SbxObject may continoue to exist, but can not any longer perform
any functions and can not provide any properties.
*/
virtual ~SfxShell();
- /* [Description]
-
+ /**
With this virtual method, which is automatically overloaded by each subclass
with its own slots through the macro <SFX_DECL_INTERFACE>, one can access
each of the <SfxInterface> instance beloning to the subclass.
@@ -192,22 +186,19 @@ public:
virtual SfxInterface* GetInterface() const;
static SfxInterface* GetStaticInterface() { return 0; }
- /* [Description]
-
+ /**
Sets the name of the Shell object. With this name, the SfxShell instance
of BASIC can be expressed.
*/
void SetName( const OUString &rName );
- /* [Description]
-
+ /**
Returns the name of the Shell object. With this name, the SfxShell instance
of BASIC can be expressed.
*/
const OUString& GetName() const;
- /* [Description]
-
+ /**
Returns the SfxViewShell in which they are located in the subshells.
Otherwise, and if not specified by the App developer, this method
returns NULL.
@@ -222,8 +213,7 @@ public:
static void EmptyExecStub(SfxShell *pShell, SfxRequest &);
static void EmptyStateStub(SfxShell *pShell, SfxItemSet &);
- /* [Description]
-
+ /**
This method returns the status of the slot with the specified slot ID
on the specified interface.
@@ -259,8 +249,7 @@ public:
*/
const SfxPoolItem* GetSlotState( sal_uInt16 nSlotId, const SfxInterface *pIF = 0, SfxItemSet *pStateSet = 0 );
- /* [Description]
-
+ /**
This method allows you to forward a <SfxRequest> to the specified
base <SfxShell>.
@@ -292,8 +281,7 @@ public:
*/
const SfxPoolItem* ExecuteSlot( SfxRequest &rReq, const SfxInterface *pIF = 0 );
- /* [Description]
-
+ /**
Asynchronous ExecuteSlot for the RELOAD
*/
const SfxPoolItem* ExecuteSlot( SfxRequest &rReq, bool bAsync );
@@ -302,8 +290,7 @@ public:
inline SfxItemPool& GetPool() const;
inline void SetPool( SfxItemPool *pNewPool ) ;
- /* [Description]
-
+ /**
Each Subclass of SfxShell can hava a <SfxUndoManager>. This can be set in
the derived class with <SfxShell:SetUndoManager()>.
@@ -312,8 +299,7 @@ public:
*/
virtual ::svl::IUndoManager* GetUndoManager();
- /* [Description]
-
+ /**
Sets a <SfxUndoManager> for this <SfxShell> Instance. For the undo
is only the undo-manager used for SfxShell at the top of the stack of each
<SfxDispatcher>.
@@ -326,8 +312,7 @@ public:
*/
void SetUndoManager( ::svl::IUndoManager *pNewUndoMgr );
- /* [Description]
-
+ /**
Returns a pointer to the <SfxRepeatTarget> instance that is used in
SID_REPEAT as repeat target when it is addressed from the <SfxUndoManager>
supplied by this SfxShell. The return value can be NULL.
@@ -340,8 +325,7 @@ public:
*/
SfxRepeatTarget* GetRepeatTarget() const;
- /* [Description]
-
+ /**
Sets the <SfxRepeatTarget> instance that is used in SID_REPEAT as
RepeatTarget, when the current supplied by this <SfxUndoManager> is
addressed. By 'pTarget==0' the SID_REPEAT is disabled for this SfxShell.
@@ -355,8 +339,7 @@ public:
*/
void SetRepeatTarget( SfxRepeatTarget *pTarget );
- /* [Description]
-
+ /**
With this method can the slots of the subclasses be invalidated through the
slot Id or alternatively through the Which ID. Slot IDs, which are
inherited by the subclass are also invalidert.
@@ -370,8 +353,7 @@ public:
bool IsActive() const;
- /* [Description]
-
+ /**
Virtual method that is called when enabling the SfxShell instance,
in order to give the Subclasses the opportunity to respond to the
to the enabling.
@@ -382,8 +364,7 @@ public:
*/
virtual void Activate(bool bMDI);
- /* [Description]
-
+ /**
Virtual method that is called when disabling the SfxShell instance,
to give the Subclasses the opportunity to respond to the disabling.
@@ -393,8 +374,7 @@ public:
*/
virtual void Deactivate(bool bMDI);
- /* [Description]
-
+ /**
A parent of the <SfxDispatcher> on which the SfxShell is located, has
become active, or the SfxShell instance was pushed on a <SfxDispatcher>,
which parent is active.
@@ -407,8 +387,7 @@ public:
*/
virtual void ParentActivate();
- /* [Description]
-
+ /**
The active parent of the <SfxDispatcher> on which the SfxShell is located,
has been disabled.
@@ -420,8 +399,7 @@ public:
*/
virtual void ParentDeactivate();
- /* [Description]
-
+ /**
This method returns a pointer to the <SfxDispatcher>, when the SfxShell
is currently <UI-active> or a NULL-pointer if it is not UI-active.
@@ -430,8 +408,7 @@ public:
*/
SfxDispatcher* GetDispatcher() const;
- /* [Description]
-
+ /**
This method returns a pointer to the <SfxViewFrame> to which this SfxShell
instance is associated or in which they currently is <UI-active>.
A NULL pointer is returned if this SfxShell instance is not UI-active at
@@ -452,8 +429,7 @@ public:
*/
SfxViewFrame* GetFrame() const;
- /* [Description]
-
+ /**
This method provides the ResMgr of the <Resource-DLL> that are used by
the SfxShell instance. If this is a NULL-pointer, then the current
resource manager is to be used.
@@ -463,8 +439,7 @@ public:
void UIFeatureChanged();
// Items
- /* [Description]
-
+ /**
With this method any objects of <SfxPoolItemu> subclasses can be accessed.
This exchange method is needed if, for example special <SfxToolBoxControl>
subclasses need access to certain data such as the <SfxObjectShell>.
@@ -479,8 +454,7 @@ public:
*/
const SfxPoolItem* GetItem( sal_uInt16 nSlotId ) const;
- /* [Description]
-
+ /**
With this method, any objects of subclasses of <SfxPoolItem> can be made
available. This exchange technology is needed if, for example, special
<SfxToolBoxControl> Subclasses need access to certain data such as the
@@ -530,14 +504,14 @@ public:
*/
bool SetContextBroadcasterEnabled (const bool bIsEnabled);
- /* [Description]
+ /**
This method determines by calling the status function whether 'rSlot'
can be executed currently.
*/
SAL_DLLPRIVATE bool CanExecuteSlot_Impl( const SfxSlot &rSlot );
- /* [Description]
+ /**
This method controls the activation of SfxShell instance. First, by calling
the virtual method <SfxShell::Activate(sal_Bool)> which gives the subclass the
@@ -549,7 +523,7 @@ public:
*/
SAL_DLLPRIVATE void DoActivate_Impl( SfxViewFrame *pFrame, bool bMDI);
- /* [Description]
+ /**
This method controls the deactivation of the SfxShell instance. When
bMDI == TRUE the SbxObject is first set to a status that only qualified
@@ -561,9 +535,7 @@ public:
SAL_DLLPRIVATE void DoDeactivate_Impl( SfxViewFrame *pFrame, bool bMDI);
};
-/*
- [Description]
-
+/**
Each Subclass of SfxShell must reference a pool. This is partly set by
SFx's own set of subclasses (eg <SfxViewShell>). In particular however
this must be set directly from one derived SfxShell class and ny
@@ -578,8 +550,7 @@ SfxItemPool& SfxShell::GetPool() const
return *pPool;
}
-/* [Description]
-
+/**
With this method, the subclasses register their special <SfxItemPool>
in the SfxShell. Each SfxShell instance must have access to a SfxItemPool.
Usually this is the SfxItemPool of the SfxDocumentShell. The SfxShell
commit fe9f8144c7a1a5e51544b4dacb8a2d7e70b321ee
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Aug 25 16:11:54 2014 +0200
move method documentation to the header file
Change-Id: I7d4f77c50a8b6b2b0d7c0868c73b0cb13f952421
diff --git a/include/sfx2/shell.hxx b/include/sfx2/shell.hxx
index c2f79a5..629826c 100644
--- a/include/sfx2/shell.hxx
+++ b/include/sfx2/shell.hxx
@@ -148,8 +148,21 @@ private:
SfxShell& operator = ( const SfxShell & ); // internal
protected:
- SfxShell();
- SfxShell( SfxViewShell *pViewSh );
+ /* [Description]
+
+ The constructor of the SfxShell class initializes only simple types,
+ the corresponding SbxObject is only created on-demand. Therefore,
+ the application of a SfxShell instance is very cheap.
+ */
+ SfxShell();
+
+/* [Description]
+
+ The constructor of the SfxShell class initializes only simple types,
+ the corresponding SbxObject is only created on-demand. Therefore,
+ the application of a SfxShell instance is very cheap.
+*/
+ SfxShell( SfxViewShell *pViewSh );
SAL_DLLPRIVATE void SetViewShell_Impl( SfxViewShell* pView );
SAL_DLLPRIVATE void Invalidate_Impl( SfxBindings& rBindings, sal_uInt16 nId );
@@ -157,15 +170,48 @@ protected:
SAL_DLLPRIVATE void SetShellObj_Impl( SfxShellObject* pObj );
public:
- TYPEINFO_OVERRIDE();
+ TYPEINFO_OVERRIDE();
+
+ /* [Description]
+
+ The connection to a possible corresponding SbxObject is dissolved.
+ The SbxObject may continoue to exist, but can not any longer perform
+ any functions and can not provide any properties.
+ */
virtual ~SfxShell();
+ /* [Description]
+
+ With this virtual method, which is automatically overloaded by each subclass
+ with its own slots through the macro <SFX_DECL_INTERFACE>, one can access
+ each of the <SfxInterface> instance beloning to the subclass.
+
+ The class SfxShell itself has no own SfxInterface (no slots), therefore a
+ NULL-pointer is returned.
+ */
virtual SfxInterface* GetInterface() const;
static SfxInterface* GetStaticInterface() { return 0; }
+ /* [Description]
+
+ Sets the name of the Shell object. With this name, the SfxShell instance
+ of BASIC can be expressed.
+ */
void SetName( const OUString &rName );
+
+ /* [Description]
+
+ Returns the name of the Shell object. With this name, the SfxShell instance
+ of BASIC can be expressed.
+ */
const OUString& GetName() const;
+ /* [Description]
+
+ Returns the SfxViewShell in which they are located in the subshells.
+ Otherwise, and if not specified by the App developer, this method
+ returns NULL.
+ */
SfxViewShell* GetViewShell() const;
void CallExec( SfxExecFunc pFunc, SfxRequest &rReq )
@@ -176,37 +222,277 @@ public:
static void EmptyExecStub(SfxShell *pShell, SfxRequest &);
static void EmptyStateStub(SfxShell *pShell, SfxItemSet &);
+ /* [Description]
+
+ This method returns the status of the slot with the specified slot ID
+ on the specified interface.
+
+ If the slot is disabled or in this SfxShell (and their parent shells) are
+ not known, a Null-pointer is returned.
+
+ If the slot does not have a Status, a SfxVoidItem is returned.
+
+ The status is set directly in this Set when pStateSet != 0 , so that
+ overloaded Slots of the <SfxShell> Subclasses and also in the Status
+ method of the base implementation can be called.
+
+ [Example]
+
+ In a derived class of SfxViewShell the SID_PRINTDOCDIRECT will be
+ intercepted. Under certain circumstances a query should appear before
+ you print, and the request will be aborted if necessary.
+
+ Also in the IDL of this subclass of the above slot is entered. The status
+ method will contain in outline:
+
+ void SubViewShell::PrintState( SfxItemSet &rState )
+ {
+ if ( rState.GetItemState( SID_PRINTDOCDIRECT ) != SFX_ITEM_UNKNOWN )
+ GetSlotState( SID_PRINTDOCDIRECT, SfxViewShell::GetInterface(),
+ &rState );
+ ...
+ }
+
+ [Cross-reference]
+
+ <SfxShell::ExecuteSlot(SfxRequest&)>
+ */
const SfxPoolItem* GetSlotState( sal_uInt16 nSlotId, const SfxInterface *pIF = 0, SfxItemSet *pStateSet = 0 );
+
+ /* [Description]
+
+ This method allows you to forward a <SfxRequest> to the specified
+ base <SfxShell>.
+
+ [Example]
+
+ In a derived class of SfxViewShell the SID_PRINTDOCDIRECT will be
+ intercepted. Under certain circumstances a query should appear before
+ you print, and the request will be aborted if necessary.
+
+ Also in the IDL of this subclass of the above slot is entered. The status
+ method will contain in outline:
+
+ void SubViewShell::Exec( SfxRequest &rReq )
+ {
+ if ( rReq.GetSlot() == SID_PRINTDOCDIRECT )
+ {
+ 'dialog'
+ if ( 'condition' )
+ ExecuteSlot( rReq, SfxViewShell::GetInterface() );
+ }
+ }
+
+ It usually takes no rReq.Done() to be called as that is already completed
+ in implementation of the SfxViewShell, for instance it has been canceled.
+
+ [Cross-reference]
+
+ <SfxShell::GetSlotState(sal_uInt16,const SfxInterface*,SfxItemSet*)>
+ */
const SfxPoolItem* ExecuteSlot( SfxRequest &rReq, const SfxInterface *pIF = 0 );
+
+ /* [Description]
+
+ Asynchronous ExecuteSlot for the RELOAD
+ */
const SfxPoolItem* ExecuteSlot( SfxRequest &rReq, bool bAsync );
sal_uIntPtr ExecuteSlot( sal_uInt16 nSlot, sal_uInt16 nMemberId, SbxVariable& rRet, SbxBase* pArgs = 0 );
inline SfxItemPool& GetPool() const;
inline void SetPool( SfxItemPool *pNewPool ) ;
- virtual ::svl::IUndoManager*
- GetUndoManager();
+ /* [Description]
+
+ Each Subclass of SfxShell can hava a <SfxUndoManager>. This can be set in
+ the derived class with <SfxShell:SetUndoManager()>.
+
+ The class SfxShell itself does not have a SfxUndoManager, a NULL-pointer
+ is therefore returned.
+ */
+ virtual ::svl::IUndoManager* GetUndoManager();
+
+ /* [Description]
+
+ Sets a <SfxUndoManager> for this <SfxShell> Instance. For the undo
+ is only the undo-manager used for SfxShell at the top of the stack of each
+ <SfxDispatcher>.
+
+ On the given <SfxUndoManager> is automatically the current
+ Max-Undo-Action-Count setting set form the options.
+
+ 'pNewUndoMgr' must exist until the Destuctor of SfxShell instance is called
+ or until the next 'SetUndoManager()'.
+ */
void SetUndoManager( ::svl::IUndoManager *pNewUndoMgr );
+ /* [Description]
+
+ Returns a pointer to the <SfxRepeatTarget> instance that is used in
+ SID_REPEAT as repeat target when it is addressed from the <SfxUndoManager>
+ supplied by this SfxShell. The return value can be NULL.
+
+ [Note]
+
+ A derivation of <SfxShell> or one of its subclasses of <SfxRepeatTarget>
+ is not recommended, as compiler errors are provoked.
+ (due to Call-to-Pointer-to-Member-Function to the subclass).
+ */
SfxRepeatTarget* GetRepeatTarget() const;
+
+ /* [Description]
+
+ Sets the <SfxRepeatTarget> instance that is used in SID_REPEAT as
+ RepeatTarget, when the current supplied by this <SfxUndoManager> is
+ addressed. By 'pTarget==0' the SID_REPEAT is disabled for this SfxShell.
+ The instance '*pTarget' must live as long as it is registered.
+
+ [Note]
+
+ A derivation of <SfxShell> or one of its subclasses of <SfxRepeatTarget>
+ is not recommended, as compiler errors are provoked.
+ (due to Call-to-Pointer-to-Member-Function to the subclass).
+ */
void SetRepeatTarget( SfxRepeatTarget *pTarget );
+ /* [Description]
+
+ With this method can the slots of the subclasses be invalidated through the
+ slot Id or alternatively through the Which ID. Slot IDs, which are
+ inherited by the subclass are also invalidert.
+
+ [Cross-reference]
+
+ <SfxBindings::Invalidate(sal_uInt16)>
+ <SfxBindings::InvalidateAll(sal_Bool)>
+ */
virtual void Invalidate(sal_uInt16 nId = 0);
bool IsActive() const;
+
+ /* [Description]
+
+ Virtual method that is called when enabling the SfxShell instance,
+ in order to give the Subclasses the opportunity to respond to the
+ to the enabling.
+
+ [Cross-reference]
+
+ StarView SystemWindow::Activate(bool)
+ */
virtual void Activate(bool bMDI);
+
+ /* [Description]
+
+ Virtual method that is called when disabling the SfxShell instance,
+ to give the Subclasses the opportunity to respond to the disabling.
+
+ [Cross-reference]
+
+ StarView SystemWindow::Dectivate(bool)
+ */
virtual void Deactivate(bool bMDI);
+
+ /* [Description]
+
+ A parent of the <SfxDispatcher> on which the SfxShell is located, has
+ become active, or the SfxShell instance was pushed on a <SfxDispatcher>,
+ which parent is active.
+
+ The base implementation is empty and does not need to be called.
+
+ [Cross-reference]
+
+ SfxShell::Activate()
+ */
virtual void ParentActivate();
+
+ /* [Description]
+
+ The active parent of the <SfxDispatcher> on which the SfxShell is located,
+ has been disabled.
+
+ The base implementation is empty and does not need to be called.
+
+ [Cross-reference]
+
+ SfxShell::Deactivate()
+ */
virtual void ParentDeactivate();
+ /* [Description]
+
+ This method returns a pointer to the <SfxDispatcher>, when the SfxShell
+ is currently <UI-active> or a NULL-pointer if it is not UI-active.
+
+ The returned pointer is only valid in the immediate context of the method
+ call.
+ */
SfxDispatcher* GetDispatcher() const;
+
+ /* [Description]
+
+ This method returns a pointer to the <SfxViewFrame> to which this SfxShell
+ instance is associated or in which they currently is <UI-active>.
+ A NULL pointer is returned if this SfxShell instance is not UI-active at
+ the moment and also no SfxViewFrame is permanently assigned.
+
+ The returned pointer is only valid in the immediate context of the method
+ call.
+
+ [Note]
+
+ Only instances of a subclass of SfxApplication and SfxObjectShell
+ should here provide a NULL-pointer. Otherwise, there is an error in the
+ application program (wrong constructor was called from SfxShell).
+
+ [Cross-reference]
+
+ <SfxViewShell::GetViewFrame()const>
+ */
SfxViewFrame* GetFrame() const;
+
+ /* [Description]
+
+ This method provides the ResMgr of the <Resource-DLL> that are used by
+ the SfxShell instance. If this is a NULL-pointer, then the current
+ resource manager is to be used.
+ */
ResMgr* GetResMgr() const;
virtual bool HasUIFeature( sal_uInt32 nFeature );
void UIFeatureChanged();
// Items
+ /* [Description]
+
+ With this method any objects of <SfxPoolItemu> subclasses can be accessed.
+ This exchange method is needed if, for example special <SfxToolBoxControl>
+ subclasses need access to certain data such as the <SfxObjectShell>.
+
+ The returned instance belongs to the particular SfxShell and may be
+ used only in the immediate context of the method call.
+
+ [Cross-reference]
+
+ <SfxShell::PutItem(const SfxPoolItem&)>
+ <SfxShell::RemoveItem(sal_uInt16)>
+ */
const SfxPoolItem* GetItem( sal_uInt16 nSlotId ) const;
+
+ /* [Description]
+
+ With this method, any objects of subclasses of <SfxPoolItem> can be made
+ available. This exchange technology is needed if, for example, special
+ <SfxToolBoxControl> Subclasses need access to certain data such as the
+ <SfxObjectShell>
+
+ If a SfxPoolItem exists with the same slot ID, it is deleted automatically.
+
+ [Cross-reference]
+
+ <SfxShell::RemoveItem(sal_uInt16)>
+ <SfxShell::GetItem(sal_uInt16)>
+ */
void PutItem( const SfxPoolItem& rItem );
// TODO/CLEANUP: still needed?!
@@ -244,8 +530,34 @@ public:
*/
bool SetContextBroadcasterEnabled (const bool bIsEnabled);
+ /* [Description]
+
+ This method determines by calling the status function whether 'rSlot'
+ can be executed currently.
+ */
SAL_DLLPRIVATE bool CanExecuteSlot_Impl( const SfxSlot &rSlot );
+
+ /* [Description]
+
+ This method controls the activation of SfxShell instance. First, by calling
+ the virtual method <SfxShell::Activate(sal_Bool)> which gives the subclass the
+ opportunity to respond to the event.
+
+ When bMDI == TRUE, the associated SbxObject is being 'armed', so that
+ unqualified methods of the object (without the name of the object)
+ from BASIC are found.
+ */
SAL_DLLPRIVATE void DoActivate_Impl( SfxViewFrame *pFrame, bool bMDI);
+
+ /* [Description]
+
+ This method controls the deactivation of the SfxShell instance. When
+ bMDI == TRUE the SbxObject is first set to a status that only qualified
+ BASIC methods can be called.
+
+ Then the subclass gets the opportunity in every case to respond to the
+ event by calling the virtual method <SfxShell::Deactivate(sal_Bool)>.
+ */
SAL_DLLPRIVATE void DoDeactivate_Impl( SfxViewFrame *pFrame, bool bMDI);
};
diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx
index cca9522..594363e 100644
--- a/sfx2/source/control/shell.cxx
+++ b/sfx2/source/control/shell.cxx
@@ -113,12 +113,6 @@ void SfxShell::EmptyStateStub(SfxShell *, SfxItemSet &)
{
}
-/* [Description]
-
- The constructor of the SfxShell class initializes only simple types,
- the corresponding SbxObject is only created on-demand. Therefore,
- the application of a SfxShell instance is very cheap.
-*/
SfxShell::SfxShell()
: pImp(0),
pPool(0),
@@ -127,12 +121,6 @@ SfxShell::SfxShell()
pImp = new SfxShell_Impl;
}
-/* [Description]
-
- The constructor of the SfxShell class initializes only simple types,
- the corresponding SbxObject is only created on-demand. Therefore,
- the application of a SfxShell instance is very cheap.
-*/
SfxShell::SfxShell( SfxViewShell *pViewSh )
: pImp(0),
pPool(0),
@@ -142,12 +130,6 @@ SfxShell::SfxShell( SfxViewShell *pViewSh )
pImp->pViewSh = pViewSh;
}
-/* [Description]
-
- The connection to a possible corresponding SbxObject is dissolved.
- The SbxObject may continoue to exist, but can not any longer perform
- any functions and can not provide any properties.
-*/
SfxShell::~SfxShell()
{
@@ -155,72 +137,27 @@ SfxShell::~SfxShell()
delete pImp;
}
-/* [Description]
-
- Sets the name of the Shell object. With this name, the SfxShell instance
- of BASIC can be expressed.
-*/
void SfxShell::SetName( const OUString &rName )
{
pImp->aObjectName = rName;
}
-/* [Description]
-
- Returns the name of the Shell object. With this name, the SfxShell instance
- of BASIC can be expressed.
-*/
const OUString& SfxShell::GetName() const
{
return pImp->aObjectName;
}
-/* [Description]
-
- This method returns a pointer to the <SfxDispatcher>, when the SfxShell
- is currently <UI-active> or a NULL-pointer if it is not UI-active.
-
- The returned pointer is only valid in the immediate context of the method
- call.
-*/
SfxDispatcher* SfxShell::GetDispatcher() const
{
return pImp->pFrame ? pImp->pFrame->GetDispatcher() : 0;
}
-/* [Description]
-
- Returns the SfxViewShell in which they are located in the subshells.
- Otherwise, and if not specified by the App developer, this method
- returns NULL.
-*/
SfxViewShell* SfxShell::GetViewShell() const
{
return pImp->pViewSh;
}
-/* [Description]
-
- This method returns a pointer to the <SfxViewFrame> to which this SfxShell
- instance is associated or in which they currently is <UI-active>.
- A NULL pointer is returned if this SfxShell instance is not UI-active at
- the moment and also no SfxViewFrame is permanently assigned.
-
- The returned pointer is only valid in the immediate context of the method
- call.
-
- [Note]
-
- Only instances of a subclass of SfxApplication and SfxObjectShell
- should here provide a NULL-pointer. Otherwise, there is an error in the
- application program (wrong constructor was called from SfxShell).
-
- [Cross-reference]
-
- <SfxViewShell::GetViewFrame()const>
-*/
SfxViewFrame* SfxShell::GetFrame() const
-
{
if ( pImp->pFrame )
return pImp->pFrame;
@@ -229,20 +166,6 @@ SfxViewFrame* SfxShell::GetFrame() const
return 0;
}
-/* [Description]
-
- With this method any objects of <SfxPoolItemu> subclasses can be accessed.
- This exchange method is needed if, for example special <SfxToolBoxControl>
- subclasses need access to certain data such as the <SfxObjectShell>.
-
- The returned instance belongs to the particular SfxShell and may be
- used only in the immediate context of the method call.
-
- [Cross-reference]
-
- <SfxShell::PutItem(const SfxPoolItem&)>
- <SfxShell::RemoveItem(sal_uInt16)>
-*/
const SfxPoolItem* SfxShell::GetItem
(
sal_uInt16 nSlotId // Slot-Id of the querying <SfxPoolItem>s
@@ -254,20 +177,6 @@ const SfxPoolItem* SfxShell::GetItem
return 0;
}
-/* [Description]
-
- With this method, any objects of subclasses of <SfxPoolItem> can be made
- available. This exchange technology is needed if, for example, special
- <SfxToolBoxControl> Subclasses need access to certain data such as the
- <SfxObjectShell>
-
- If a SfxPoolItem exists with the same slot ID, it is deleted automatically.
-
- [Cross-reference]
-
- <SfxShell::RemoveItem(sal_uInt16)>
- <SfxShell::GetItem(sal_uInt16)>
-*/
void SfxShell::PutItem
(
const SfxPoolItem& rItem /* Instance, of which a copy is created,
@@ -314,45 +223,16 @@ void SfxShell::PutItem
}
}
-/* [Description]
-
- With this virtual method, which is automatically overloaded by each subclass
- with its own slots through the macro <SFX_DECL_INTERFACE>, one can access
- each of the <SfxInterface> instance beloning to the subclass.
-
- The class SfxShell itself has no own SfxInterface (no slots), therefore a
- NULL-pointer is returned.
-*/
SfxInterface* SfxShell::GetInterface() const
{
return GetStaticInterface();
}
-/* [Description]
-
- Each Subclass of SfxShell can hava a <SfxUndoManager>. This can be set in
- the derived class with <SfxShell:SetUndoManager()>.
-
- The class SfxShell itself does not have a SfxUndoManager, a NULL-pointer
- is therefore returned.
-*/
::svl::IUndoManager* SfxShell::GetUndoManager()
{
return pUndoMgr;
}
-/* [Description]
-
- Sets a <SfxUndoManager> for this <SfxShell> Instance. For the undo
- is only the undo-manager used for SfxShell at the top of the stack of each
- <SfxDispatcher>.
-
- On the given <SfxUndoManager> is automatically the current
- Max-Undo-Action-Count setting set form the options.
-
- 'pNewUndoMgr' must exist until the Destuctor of SfxShell instance is called
- or until the next 'SetUndoManager()'.
-*/
void SfxShell::SetUndoManager( ::svl::IUndoManager *pNewUndoMgr )
{
OSL_ENSURE( ( pUndoMgr == NULL ) || ( pNewUndoMgr == NULL ) || ( pUndoMgr == pNewUndoMgr ),
@@ -367,52 +247,16 @@ void SfxShell::SetUndoManager( ::svl::IUndoManager *pNewUndoMgr )
officecfg::Office::Common::Undo::Steps::get());
}
-/* [Description]
-
- Returns a pointer to the <SfxRepeatTarget> instance that is used in
- SID_REPEAT as repeat target when it is addressed from the <SfxUndoManager>
- supplied by this SfxShell. The return value can be NULL.
-
- [Note]
-
- A derivation of <SfxShell> or one of its subclasses of <SfxRepeatTarget>
- is not recommended, as compiler errors are provoked.
- (due to Call-to-Pointer-to-Member-Function to the subclass).
-*/
SfxRepeatTarget* SfxShell::GetRepeatTarget() const
{
return pImp->pRepeatTarget;
}
-/* [Description]
-
- Sets the <SfxRepeatTarget> instance that is used in SID_REPEAT as
- RepeatTarget, when the current supplied by this <SfxUndoManager> is
- addressed. By 'pTarget==0' the SID_REPEAT is disabled for this SfxShell.
- The instance '*pTarget' must live as long as it is registered.
-
- [Note]
-
- A derivation of <SfxShell> or one of its subclasses of <SfxRepeatTarget>
- is not recommended, as compiler errors are provoked.
- (due to Call-to-Pointer-to-Member-Function to the subclass).
-*/
void SfxShell::SetRepeatTarget( SfxRepeatTarget *pTarget )
{
pImp->pRepeatTarget = pTarget;
}
-/* [Description]
-
- With this method can the slots of the subclasses be invalidated through the
- slot Id or alternatively through the Which ID. Slot IDs, which are
- inherited by the subclass are also invalidert.
-
- [Cross-reference]
-
- <SfxBindings::Invalidate(sal_uInt16)>
- <SfxBindings::InvalidateAll(sal_Bool)>
-*/
void SfxShell::Invalidate
(
sal_uInt16 nId /* Invalidated Slot-Id or Which-Id.
@@ -468,16 +312,6 @@ void SfxShell::Invalidate_Impl( SfxBindings& rBindings, sal_uInt16 nId )
}
}
-/* [Description]
-
- This method controls the activation of SfxShell instance. First, by calling
- the virtual method <SfxShell::Activate(sal_Bool)> which gives the subclass the
- opportunity to respond to the event.
-
- When bMDI == TRUE, the associated SbxObject is being 'armed', so that
- unqualified methods of the object (without the name of the object)
- from BASIC are found.
-*/
void SfxShell::DoActivate_Impl( SfxViewFrame *pFrame, bool bMDI )
{
#ifdef DBG_UTIL
@@ -501,15 +335,6 @@ void SfxShell::DoActivate_Impl( SfxViewFrame *pFrame, bool bMDI )
Activate(bMDI);
}
-/* [Description]
-
- This method controls the deactivation of the SfxShell instance. When
- bMDI == TRUE the SbxObject is first set to a status that only qualified
- BASIC methods can be called.
-
- Then the subclass gets the opportunity in every case to respond to the
- event by calling the virtual method <SfxShell::Deactivate(sal_Bool)>.
-*/
void SfxShell::DoDeactivate_Impl( SfxViewFrame *pFrame, bool bMDI )
{
#ifdef DBG_UTIL
@@ -540,16 +365,6 @@ bool SfxShell::IsActive() const
return pImp->bActive;
}
-/* [Description]
-
- Virtual method that is called when enabling the SfxShell instance,
- in order to give the Subclasses the opportunity to respond to the
- to the enabling.
-
- [Cross-reference]
-
- StarView SystemWindow::Activate(bool)
-*/
void SfxShell::Activate
(
bool /*bMDI*/ /* TRUE
@@ -567,15 +382,6 @@ void SfxShell::Activate
BroadcastContextForActivation(true);
}
-/* [Description]
-
- Virtual method that is called when disabling the SfxShell instance,
- to give the Subclasses the opportunity to respond to the disabling.
-
- [Cross-reference]
-
- StarView SystemWindow::Dectivate(bool)
-*/
void SfxShell::Deactivate
(
bool /*bMDI*/ /* TRUE
@@ -593,57 +399,23 @@ void SfxShell::Deactivate
BroadcastContextForActivation(false);
}
-/* [Description]
-
- A parent of the <SfxDispatcher> on which the SfxShell is located, has
- become active, or the SfxShell instance was pushed on a <SfxDispatcher>,
- which parent is active.
-
- The base implementation is empty and does not need to be called.
-
- [Cross-reference]
-
- SfxShell::Activate()
-*/
void SfxShell::ParentActivate
(
)
{
}
-/* [Description]
-
- The active parent of the <SfxDispatcher> on which the SfxShell is located,
- has been disabled.
-
- The base implementation is empty and does not need to be called.
-
- [Cross-reference]
-
- SfxShell::Deactivate()
-*/
void SfxShell::ParentDeactivate
(
)
{
}
-/* [Description]
-
- This method provides the ResMgr of the <Resource-DLL> that are used by
- the SfxShell instance. If this is a NULL-pointer, then the current
- resource manager is to be used.
-*/
ResMgr* SfxShell::GetResMgr() const
{
return GetInterface()->GetResMgr();
}
-/* [Description]
-
- This method determines by calling the status function whether 'rSlot'
- can be executed currently.
-*/
bool SfxShell::CanExecuteSlot_Impl( const SfxSlot &rSlot )
{
// Get Slot status
@@ -661,10 +433,6 @@ long ShellCall_Impl( void* pObj, void* pArg )
return 0;
}
-/* [Description]
-
- Asynchronous ExecuteSlot for the RELOAD
- */
const SfxPoolItem* SfxShell::ExecuteSlot( SfxRequest& rReq, bool bAsync )
{
if( !bAsync )
@@ -679,37 +447,6 @@ const SfxPoolItem* SfxShell::ExecuteSlot( SfxRequest& rReq, bool bAsync )
}
}
-/* [Description]
-
- This method allows you to forward a <SfxRequest> to the specified
- base <SfxShell>.
-
- [Example]
-
- In a derived class of SfxViewShell the SID_PRINTDOCDIRECT will be
- intercepted. Under certain circumstances a query should appear before
- you print, and the request will be aborted if necessary.
-
- Also in the IDL of this subclass of the above slot is entered. The status
- method will contain in outline:
-
- void SubViewShell::Exec( SfxRequest &rReq )
- {
- if ( rReq.GetSlot() == SID_PRINTDOCDIRECT )
- {
- 'dialog'
- if ( 'condition' )
- ExecuteSlot( rReq, SfxViewShell::GetInterface() );
- }
- }
-
- It usually takes no rReq.Done() to be called as that is already completed
- in implementation of the SfxViewShell, for instance it has been canceled.
-
- [Cross-reference]
-
- <SfxShell::GetSlotState(sal_uInt16,const SfxInterface*,SfxItemSet*)>
-*/
const SfxPoolItem* SfxShell::ExecuteSlot
(
SfxRequest &rReq, // the relayed <SfxRequest>
@@ -734,41 +471,6 @@ const SfxPoolItem* SfxShell::ExecuteSlot
return rReq.GetReturnValue();
}
-/* [Description]
-
- This method returns the status of the slot with the specified slot ID
- on the specified interface.
-
- If the slot is disabled or in this SfxShell (and their parent shells) are
- not known, a Null-pointer is returned.
-
- If the slot does not have a Status, a SfxVoidItem is returned.
-
- The status is set directly in this Set when pStateSet != 0 , so that
- overloaded Slots of the <SfxShell> Subclasses and also in the Status
- method of the base implementation can be called.
-
- [Example]
-
- In a derived class of SfxViewShell the SID_PRINTDOCDIRECT will be
- intercepted. Under certain circumstances a query should appear before
- you print, and the request will be aborted if necessary.
-
- Also in the IDL of this subclass of the above slot is entered. The status
- method will contain in outline:
-
- void SubViewShell::PrintState( SfxItemSet &rState )
- {
- if ( rState.GetItemState( SID_PRINTDOCDIRECT ) != SFX_ITEM_UNKNOWN )
- GetSlotState( SID_PRINTDOCDIRECT, SfxViewShell::GetInterface(),
- &rState );
- ...
- }
-
- [Cross-reference]
-
- <SfxShell::ExecuteSlot(SfxRequest&)>
-*/
const SfxPoolItem* SfxShell::GetSlotState
(
sal_uInt16 nSlotId, // Slot-Id to the Slots in question
commit 7b87415cdbce7162cf3bc8e02a2519623dfb5605
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Aug 25 16:00:05 2014 +0200
remove whitespace and put documentation before method/class
Change-Id: Ib88648d9ec049932520501ec997e2e82a55f63f3
diff --git a/include/sfx2/shell.hxx b/include/sfx2/shell.hxx
index 8b83df5..c2f79a5 100644
--- a/include/sfx2/shell.hxx
+++ b/include/sfx2/shell.hxx
@@ -60,16 +60,12 @@ namespace svl
class IUndoManager;
}
-
-
-enum SfxInterfaceId
-
/* [Description]
Id for <SfxInterface>s, gives a quasi-static access to the interface
through an array to <SfxApplication>.
*/
-
+enum SfxInterfaceId
{
SFX_INTERFACE_NONE,
SFX_INTERFACE_SFXAPP,
@@ -122,13 +118,9 @@ enum SfxInterfaceId
//TODO/CLEANUP: replace by UNO constant
#define SVVERB_SHOW -1
-
-
typedef void (*SfxExecFunc)(SfxShell *, SfxRequest &rReq);
typedef void (*SfxStateFunc)(SfxShell *, SfxItemSet &rSet);
-class SFX2_DLLPUBLIC SfxShell: public SfxBroadcaster
-
/* [Description]
The class SfxShell is the base class for all classes, which provide
@@ -143,7 +135,7 @@ class SFX2_DLLPUBLIC SfxShell: public SfxBroadcaster
the <SVIDL-Compiler>. For each SfxShell Subclass-File there is one
such IDL-file to write.
*/
-
+class SFX2_DLLPUBLIC SfxShell: public SfxBroadcaster
{
friend class SfxObjectItem;
@@ -257,8 +249,6 @@ public:
SAL_DLLPRIVATE void DoDeactivate_Impl( SfxViewFrame *pFrame, bool bMDI);
};
-
-SfxItemPool& SfxShell::GetPool() const
/*
[Description]
@@ -270,17 +260,12 @@ SfxItemPool& SfxShell::GetPool() const
The SfxShell class itself does not have any SfxItemPool, therfore a
null-pointer is returned.
*/
-
+SfxItemPool& SfxShell::GetPool() const
{
assert(pPool && "no pool");
return *pPool;
}
-inline void SfxShell::SetPool
-(
- SfxItemPool* pNewPool // Pointer to the new Pool or null
-)
-
/* [Description]
With this method, the subclasses register their special <SfxItemPool>
@@ -289,7 +274,10 @@ inline void SfxShell::SetPool
subclass does not take ownership of the orphaned pool. Before it is
deleted it has to be deregisted with SetPool(0).
*/
-
+inline void SfxShell::SetPool
+(
+ SfxItemPool* pNewPool // Pointer to the new Pool or null
+)
{
pPool = pNewPool;
}
commit 9970fb3cecddb6b2b506b3ef7200cf49659def98
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Aug 25 15:54:53 2014 +0200
remove whitespace and put comment before method
Change-Id: Ia3f22787a07628b1b531c61f21d345def5f6e99d
diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx
index 27f5a76..cca9522 100644
--- a/sfx2/source/control/shell.cxx
+++ b/sfx2/source/control/shell.cxx
@@ -71,8 +71,6 @@ public:
using namespace com::sun::star;
-// SfxShell_Impl
-
struct SfxShell_Impl: public SfxBroadcaster
{
OUString aObjectName; // Name of Sbx-Objects
@@ -107,9 +105,6 @@ struct SfxShell_Impl: public SfxBroadcaster
};
-// SfxShell
-
-
void SfxShell::EmptyExecStub(SfxShell *, SfxRequest &)
{
}
@@ -118,15 +113,13 @@ void SfxShell::EmptyStateStub(SfxShell *, SfxItemSet &)
{
}
-SfxShell::SfxShell()
-
/* [Description]
The constructor of the SfxShell class initializes only simple types,
the corresponding SbxObject is only created on-demand. Therefore,
the application of a SfxShell instance is very cheap.
*/
-
+SfxShell::SfxShell()
: pImp(0),
pPool(0),
pUndoMgr(0)
@@ -134,17 +127,13 @@ SfxShell::SfxShell()
pImp = new SfxShell_Impl;
}
-
-
-SfxShell::SfxShell( SfxViewShell *pViewSh )
-
/* [Description]
The constructor of the SfxShell class initializes only simple types,
the corresponding SbxObject is only created on-demand. Therefore,
the application of a SfxShell instance is very cheap.
*/
-
+SfxShell::SfxShell( SfxViewShell *pViewSh )
: pImp(0),
pPool(0),
pUndoMgr(0)
@@ -153,55 +142,39 @@ SfxShell::SfxShell( SfxViewShell *pViewSh )
pImp->pViewSh = pViewSh;
}
-
-
-SfxShell::~SfxShell()
-
/* [Description]
The connection to a possible corresponding SbxObject is dissolved.
The SbxObject may continoue to exist, but can not any longer perform
any functions and can not provide any properties.
*/
-
+SfxShell::~SfxShell()
{
delete pImp;
}
-
-
-void SfxShell::SetName( const OUString &rName )
-
/* [Description]
Sets the name of the Shell object. With this name, the SfxShell instance
of BASIC can be expressed.
*/
-
+void SfxShell::SetName( const OUString &rName )
{
pImp->aObjectName = rName;
}
-
-
-const OUString& SfxShell::GetName() const
-
/* [Description]
Returns the name of the Shell object. With this name, the SfxShell instance
of BASIC can be expressed.
*/
-
+const OUString& SfxShell::GetName() const
{
return pImp->aObjectName;
}
-
-
-SfxDispatcher* SfxShell::GetDispatcher() const
-
/* [Description]
This method returns a pointer to the <SfxDispatcher>, when the SfxShell
@@ -210,30 +183,22 @@ SfxDispatcher* SfxShell::GetDispatcher() const
The returned pointer is only valid in the immediate context of the method
call.
*/
-
+SfxDispatcher* SfxShell::GetDispatcher() const
{
return pImp->pFrame ? pImp->pFrame->GetDispatcher() : 0;
}
-
-
-SfxViewShell* SfxShell::GetViewShell() const
-
/* [Description]
Returns the SfxViewShell in which they are located in the subshells.
Otherwise, and if not specified by the App developer, this method
returns NULL.
*/
-
+SfxViewShell* SfxShell::GetViewShell() const
{
return pImp->pViewSh;
}
-
-
-SfxViewFrame* SfxShell::GetFrame() const
-
/* [Description]
This method returns a pointer to the <SfxViewFrame> to which this SfxShell
@@ -254,6 +219,7 @@ SfxViewFrame* SfxShell::GetFrame() const
<SfxViewShell::GetViewFrame()const>
*/
+SfxViewFrame* SfxShell::GetFrame() const
{
if ( pImp->pFrame )
@@ -263,13 +229,6 @@ SfxViewFrame* SfxShell::GetFrame() const
return 0;
}
-
-
-const SfxPoolItem* SfxShell::GetItem
-(
- sal_uInt16 nSlotId // Slot-Id of the querying <SfxPoolItem>s
-) const
-
/* [Description]
With this method any objects of <SfxPoolItemu> subclasses can be accessed.
@@ -284,7 +243,10 @@ const SfxPoolItem* SfxShell::GetItem
<SfxShell::PutItem(const SfxPoolItem&)>
<SfxShell::RemoveItem(sal_uInt16)>
*/
-
+const SfxPoolItem* SfxShell::GetItem
+(
+ sal_uInt16 nSlotId // Slot-Id of the querying <SfxPoolItem>s
+) const
{
SfxItemPtrMap::iterator it = pImp->aItems.find( nSlotId );
if( it != pImp->aItems.end() )
@@ -292,14 +254,6 @@ const SfxPoolItem* SfxShell::GetItem
return 0;
}
-
-
-void SfxShell::PutItem
-(
- const SfxPoolItem& rItem /* Instance, of which a copy is created,
- which is stored in the SfxShell in a list. */
-)
-
/* [Description]
With this method, any objects of subclasses of <SfxPoolItem> can be made
@@ -314,7 +268,11 @@ void SfxShell::PutItem
<SfxShell::RemoveItem(sal_uInt16)>
<SfxShell::GetItem(sal_uInt16)>
*/
-
+void SfxShell::PutItem
+(
+ const SfxPoolItem& rItem /* Instance, of which a copy is created,
+ which is stored in the SfxShell in a list. */
+)
{
DBG_ASSERT( !rItem.ISA(SfxSetItem), "SetItems aren't allowed here" );
DBG_ASSERT( SfxItemPool::IsSlot( rItem.Which() ),
@@ -356,10 +314,6 @@ void SfxShell::PutItem
}
}
-
-
-SfxInterface* SfxShell::GetInterface() const
-
/* [Description]
With this virtual method, which is automatically overloaded by each subclass
@@ -369,15 +323,11 @@ SfxInterface* SfxShell::GetInterface() const
The class SfxShell itself has no own SfxInterface (no slots), therefore a
NULL-pointer is returned.
*/
-
+SfxInterface* SfxShell::GetInterface() const
{
return GetStaticInterface();
}
-
-
-::svl::IUndoManager* SfxShell::GetUndoManager()
-
/* [Description]
Each Subclass of SfxShell can hava a <SfxUndoManager>. This can be set in
@@ -386,15 +336,11 @@ SfxInterface* SfxShell::GetInterface() const
The class SfxShell itself does not have a SfxUndoManager, a NULL-pointer
is therefore returned.
*/
-
+::svl::IUndoManager* SfxShell::GetUndoManager()
{
return pUndoMgr;
}
-
-
-void SfxShell::SetUndoManager( ::svl::IUndoManager *pNewUndoMgr )
-
/* [Description]
Sets a <SfxUndoManager> for this <SfxShell> Instance. For the undo
@@ -407,7 +353,7 @@ void SfxShell::SetUndoManager( ::svl::IUndoManager *pNewUndoMgr )
'pNewUndoMgr' must exist until the Destuctor of SfxShell instance is called
or until the next 'SetUndoManager()'.
*/
-
+void SfxShell::SetUndoManager( ::svl::IUndoManager *pNewUndoMgr )
{
OSL_ENSURE( ( pUndoMgr == NULL ) || ( pNewUndoMgr == NULL ) || ( pUndoMgr == pNewUndoMgr ),
"SfxShell::SetUndoManager: exchanging one non-NULL manager with another non-NULL manager? Suspicious!" );
@@ -421,10 +367,6 @@ void SfxShell::SetUndoManager( ::svl::IUndoManager *pNewUndoMgr )
officecfg::Office::Common::Undo::Steps::get());
}
-
-
-SfxRepeatTarget* SfxShell::GetRepeatTarget() const
-
/* [Description]
Returns a pointer to the <SfxRepeatTarget> instance that is used in
@@ -437,15 +379,11 @@ SfxRepeatTarget* SfxShell::GetRepeatTarget() const
is not recommended, as compiler errors are provoked.
(due to Call-to-Pointer-to-Member-Function to the subclass).
*/
-
+SfxRepeatTarget* SfxShell::GetRepeatTarget() const
{
return pImp->pRepeatTarget;
}
-
-
-void SfxShell::SetRepeatTarget( SfxRepeatTarget *pTarget )
-
/* [Description]
Sets the <SfxRepeatTarget> instance that is used in SID_REPEAT as
@@ -459,21 +397,11 @@ void SfxShell::SetRepeatTarget( SfxRepeatTarget *pTarget )
is not recommended, as compiler errors are provoked.
(due to Call-to-Pointer-to-Member-Function to the subclass).
*/
-
+void SfxShell::SetRepeatTarget( SfxRepeatTarget *pTarget )
{
pImp->pRepeatTarget = pTarget;
}
-
-
-void SfxShell::Invalidate
-(
- sal_uInt16 nId /* Invalidated Slot-Id or Which-Id.
- If these are 0 (default), then all
- by this Shell currently handled Slot-Ids are
- invalidated. */
-)
-
/* [Description]
With this method can the slots of the subclasses be invalidated through the
@@ -485,7 +413,13 @@ void SfxShell::Invalidate
<SfxBindings::Invalidate(sal_uInt16)>
<SfxBindings::InvalidateAll(sal_Bool)>
*/
-
+void SfxShell::Invalidate
+(
+ sal_uInt16 nId /* Invalidated Slot-Id or Which-Id.
+ If these are 0 (default), then all
+ by this Shell currently handled Slot-Ids are
+ invalidated. */
+)
{
if ( !GetViewShell() )
{
@@ -534,10 +468,6 @@ void SfxShell::Invalidate_Impl( SfxBindings& rBindings, sal_uInt16 nId )
}
}
-
-
-void SfxShell::DoActivate_Impl( SfxViewFrame *pFrame, bool bMDI )
-
/* [Description]
This method controls the activation of SfxShell instance. First, by calling
@@ -548,7 +478,7 @@ void SfxShell::DoActivate_Impl( SfxViewFrame *pFrame, bool bMDI )
unqualified methods of the object (without the name of the object)
from BASIC are found.
*/
-
+void SfxShell::DoActivate_Impl( SfxViewFrame *pFrame, bool bMDI )
{
#ifdef DBG_UTIL
const SfxInterface *p_IF = GetInterface();
@@ -571,10 +501,6 @@ void SfxShell::DoActivate_Impl( SfxViewFrame *pFrame, bool bMDI )
Activate(bMDI);
}
-
-
-void SfxShell::DoDeactivate_Impl( SfxViewFrame *pFrame, bool bMDI )
-
/* [Description]
This method controls the deactivation of the SfxShell instance. When
@@ -584,7 +510,7 @@ void SfxShell::DoDeactivate_Impl( SfxViewFrame *pFrame, bool bMDI )
Then the subclass gets the opportunity in every case to respond to the
event by calling the virtual method <SfxShell::Deactivate(sal_Bool)>.
*/
-
+void SfxShell::DoDeactivate_Impl( SfxViewFrame *pFrame, bool bMDI )
{
#ifdef DBG_UTIL
const SfxInterface *p_IF = GetInterface();
@@ -609,15 +535,21 @@ void SfxShell::DoDeactivate_Impl( SfxViewFrame *pFrame, bool bMDI )
Deactivate(bMDI);
}
-
-
bool SfxShell::IsActive() const
{
return pImp->bActive;
}
+/* [Description]
+
+ Virtual method that is called when enabling the SfxShell instance,
+ in order to give the Subclasses the opportunity to respond to the
+ to the enabling.
+ [Cross-reference]
+ StarView SystemWindow::Activate(bool)
+*/
void SfxShell::Activate
(
bool /*bMDI*/ /* TRUE
@@ -631,24 +563,19 @@ void SfxShell::Activate
the SfxShell instance is located, was
activated. (for example by a closing dialoge) */
)
+{
+ BroadcastContextForActivation(true);
+}
/* [Description]
- Virtual method that is called when enabling the SfxShell instance,
- in order to give the Subclasses the opportunity to respond to the
- to the enabling.
+ Virtual method that is called when disabling the SfxShell instance,
+ to give the Subclasses the opportunity to respond to the disabling.
[Cross-reference]
- StarView SystemWindow::Activate(bool)
+ StarView SystemWindow::Dectivate(bool)
*/
-
-{
- BroadcastContextForActivation(true);
-}
-
-
-
void SfxShell::Deactivate
(
bool /*bMDI*/ /* TRUE
@@ -661,28 +588,11 @@ void SfxShell::Deactivate
the <SfxViewFrame>, on which SfxDispatcher
the SfxShell instance is located, was
deactivated. (for example by a dialoge) */
-
)
-
-/* [Description]
-
- Virtual method that is called when disabling the SfxShell instance,
- to give the Subclasses the opportunity to respond to the disabling.
-
- [Cross-reference]
-
- StarView SystemWindow::Dectivate(bool)
-*/
-
{
BroadcastContextForActivation(false);
}
-
-void SfxShell::ParentActivate
-(
-)
-
/* [Description]
A parent of the <SfxDispatcher> on which the SfxShell is located, has
@@ -695,14 +605,11 @@ void SfxShell::ParentActivate
SfxShell::Activate()
*/
-{
-}
-
-
-
-void SfxShell::ParentDeactivate
+void SfxShell::ParentActivate
(
)
+{
+}
/* [Description]
@@ -715,33 +622,29 @@ void SfxShell::ParentDeactivate
SfxShell::Deactivate()
*/
+void SfxShell::ParentDeactivate
+(
+)
{
}
-
-
-ResMgr* SfxShell::GetResMgr() const
-
/* [Description]
This method provides the ResMgr of the <Resource-DLL> that are used by
the SfxShell instance. If this is a NULL-pointer, then the current
resource manager is to be used.
*/
-
+ResMgr* SfxShell::GetResMgr() const
{
return GetInterface()->GetResMgr();
}
-
-
-bool SfxShell::CanExecuteSlot_Impl( const SfxSlot &rSlot )
-
/* [Description]
This method determines by calling the status function whether 'rSlot'
can be executed currently.
*/
+bool SfxShell::CanExecuteSlot_Impl( const SfxSlot &rSlot )
{
// Get Slot status
SfxItemPool &rPool = GetPool();
@@ -752,8 +655,6 @@ bool SfxShell::CanExecuteSlot_Impl( const SfxSlot &rSlot )
return aSet.GetItemState(nId) != SFX_ITEM_DISABLED;
}
-
-
long ShellCall_Impl( void* pObj, void* pArg )
{
((SfxShell* )pObj)->ExecuteSlot( *(SfxRequest*)pArg, (SfxInterface*)0L );
@@ -764,8 +665,6 @@ long ShellCall_Impl( void* pObj, void* pArg )
Asynchronous ExecuteSlot for the RELOAD
*/
-
-
const SfxPoolItem* SfxShell::ExecuteSlot( SfxRequest& rReq, bool bAsync )
{
if( !bAsync )
@@ -780,12 +679,6 @@ const SfxPoolItem* SfxShell::ExecuteSlot( SfxRequest& rReq, bool bAsync )
}
}
-const SfxPoolItem* SfxShell::ExecuteSlot
-(
- SfxRequest &rReq, // the relayed <SfxRequest>
- const SfxInterface* pIF // default = 0 means get virtually
-)
-
/* [Description]
This method allows you to forward a <SfxRequest> to the specified
@@ -817,7 +710,11 @@ const SfxPoolItem* SfxShell::ExecuteSlot
<SfxShell::GetSlotState(sal_uInt16,const SfxInterface*,SfxItemSet*)>
*/
-
+const SfxPoolItem* SfxShell::ExecuteSlot
+(
+ SfxRequest &rReq, // the relayed <SfxRequest>
+ const SfxInterface* pIF // default = 0 means get virtually
+)
{
if ( !pIF )
pIF = GetInterface();
@@ -837,15 +734,6 @@ const SfxPoolItem* SfxShell::ExecuteSlot
return rReq.GetReturnValue();
}
-
-
-const SfxPoolItem* SfxShell::GetSlotState
-(
- sal_uInt16 nSlotId, // Slot-Id to the Slots in question
- const SfxInterface* pIF, // default = 0 means get virtually
- SfxItemSet* pStateSet // SfxItemSet of the Slot-State method
-)
-
/* [Description]
This method returns the status of the slot with the specified slot ID
@@ -881,7 +769,12 @@ const SfxPoolItem* SfxShell::GetSlotState
<SfxShell::ExecuteSlot(SfxRequest&)>
*/
-
+const SfxPoolItem* SfxShell::GetSlotState
+(
+ sal_uInt16 nSlotId, // Slot-Id to the Slots in question
+ const SfxInterface* pIF, // default = 0 means get virtually
+ SfxItemSet* pStateSet // SfxItemSet of the Slot-State method
+)
{
// Get Slot on the given Interface
if ( !pIF )
@@ -946,8 +839,6 @@ const SfxPoolItem* SfxShell::GetSlotState
return pRetItem;
}
-
-
SFX_EXEC_STUB(SfxShell, VerbExec)
SFX_STATE_STUB(SfxShell, VerbState)
@@ -1022,15 +913,11 @@ void SfxShell::SetVerbs(const com::sun::star::uno::Sequence < com::sun::star::em
}
}
-
-
const com::sun::star::uno::Sequence < com::sun::star::embed::VerbDescriptor >& SfxShell::GetVerbs() const
{
return pImp->aVerbList;
}
-
-
void SfxShell::VerbExec(SfxRequest& rReq)
{
sal_uInt16 nId = rReq.GetSlot();
@@ -1059,14 +946,10 @@ void SfxShell::VerbExec(SfxRequest& rReq)
}
}
-
-
void SfxShell::VerbState(SfxItemSet& )
{
}
-
-
const SfxSlot* SfxShell::GetVerbSlot_Impl(sal_uInt16 nId) const
{
com::sun::star::uno::Sequence < com::sun::star::embed::VerbDescriptor > rList = pImp->aVerbList;
@@ -1081,22 +964,16 @@ const SfxSlot* SfxShell::GetVerbSlot_Impl(sal_uInt16 nId) const
return 0;
}
-
-
void SfxShell::SetHelpId(sal_uIntPtr nId)
{
pImp->nHelpId = nId;
}
-
-
sal_uIntPtr SfxShell::GetHelpId() const
{
return pImp->nHelpId;
}
-
-
SfxObjectShell* SfxShell::GetObjectShell()
{
if ( GetViewShell() )
@@ -1105,8 +982,6 @@ SfxObjectShell* SfxShell::GetObjectShell()
return NULL;
}
-
-
bool SfxShell::HasUIFeature( sal_uInt32 )
{
return false;
More information about the Libreoffice-commits
mailing list