[Libreoffice-commits] .: sc/inc sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Mon Aug 29 17:40:49 PDT 2011


 sc/inc/scmod.hxx               |   58 ++++++++++++-----------------------------
 sc/source/ui/app/drwtrans.cxx  |    2 +
 sc/source/ui/app/scmod.cxx     |   54 +++++++++++++++++++++++---------------
 sc/source/ui/app/transobj.cxx  |    2 +
 sc/source/ui/view/gridwin.cxx  |    3 +-
 sc/source/ui/view/tabcont.cxx  |    2 -
 sc/source/ui/view/viewfun7.cxx |    1 
 7 files changed, 58 insertions(+), 64 deletions(-)

New commits:
commit ac991693db02ec6ede3585ca6ae22f087fe7d48d
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date:   Mon Aug 29 20:40:42 2011 -0400

    Hide ScDragData and ScClipData from scmod.hxx, clean up ScModule a bit.

diff --git a/sc/inc/scmod.hxx b/sc/inc/scmod.hxx
index 1915f5d..7b8197a 100644
--- a/sc/inc/scmod.hxx
+++ b/sc/inc/scmod.hxx
@@ -71,19 +71,16 @@ class ScPrintOptions;
 class ScInputHandler;
 class ScInputWindow;
 class ScTabViewShell;
-class ScFunctionDlg;
-class ScArgDlgBase;
-class ScEditFunctionDlg;
 class ScMessagePool;
 class EditFieldInfo;
 class ScNavipiCfg;
 class ScAddInCfg;
-
 class ScTransferObj;
 class ScDrawTransferObj;
 class ScSelectionTransferObj;
-
 class ScFormEditData;
+class ScDragData;
+class ScClipData;
 
 //==================================================================
 
@@ -92,34 +89,14 @@ class ScFormEditData;
 #define SC_DROP_NAVIGATOR       1
 #define SC_DROP_TABLE           2
 
-struct ScDragData
-{
-    ScTransferObj*      pCellTransfer;
-    ScDrawTransferObj*  pDrawTransfer;
-
-    String              aLinkDoc;
-    String              aLinkTable;
-    String              aLinkArea;
-    ScDocument*         pJumpLocalDoc;
-    String              aJumpTarget;
-    String              aJumpText;
-};
-
-struct ScClipData
-{
-    ScTransferObj*      pCellClipboard;
-    ScDrawTransferObj*  pDrawClipboard;
-};
-
 //==================================================================
 
-
 class ScModule: public SfxModule, public SfxListener, utl::ConfigurationListener
 {
     Timer               aIdleTimer;
     Timer               aSpellTimer;
-    ScDragData          aDragData;
-    ScClipData          aClipData;
+    ScDragData*         mpDragData;
+    ScClipData*         mpClipData;
     ScSelectionTransferObj* pSelTransfer;
     ScMessagePool*      pMessagePool;
     // there is no global InputHandler anymore, each View has it's own
@@ -136,14 +113,13 @@ class ScModule: public SfxModule, public SfxListener, utl::ConfigurationListener
     SvtCTLOptions*      pCTLOptions;
     SvtUserOptions*     pUserOptions;
     SfxErrorHandler*    pErrorHdl;
-    SvxErrorHandler*    pSvxErrorHdl;
     ScFormEditData*     pFormEditData;
     sal_uInt16              nCurRefDlgId;
-    sal_Bool                bIsWaterCan;
-    sal_Bool                bIsInEditCommand;
-    sal_Bool                bIsInExecuteDrop;
-    bool                mbIsInSharedDocLoading;
-    bool                mbIsInSharedDocSaving;
+    bool                bIsWaterCan:1;
+    bool                bIsInEditCommand:1;
+    bool                bIsInExecuteDrop:1;
+    bool                mbIsInSharedDocLoading:1;
+    bool                mbIsInSharedDocSaving:1;
 
     std::map<sal_uInt16, std::list<Window*> > m_mapRefWindow;
 public:
@@ -169,7 +145,7 @@ public:
     void                AnythingChanged();
 
     //  Drag & Drop:
-    const ScDragData&   GetDragData() const     { return aDragData; }
+    const ScDragData&   GetDragData() const;
     void                SetDragObject( ScTransferObj* pCellObj, ScDrawTransferObj* pDrawObj );
     void                ResetDragObject();
     void                SetDragLink( const String& rDoc, const String& rTab, const String& rArea );
@@ -177,7 +153,7 @@ public:
                                     const String& rTarget, const String& rText );
 
     //  clipboard:
-    const ScClipData&   GetClipData() const     { return aClipData; }
+    const ScClipData&   GetClipData() const;
     void                SetClipObject( ScTransferObj* pCellObj, ScDrawTransferObj* pDrawObj );
 
     ScDocument*         GetClipDoc();       // called from document - should be removed later
@@ -186,14 +162,14 @@ public:
     ScSelectionTransferObj* GetSelectionTransfer() const    { return pSelTransfer; }
     void                SetSelectionTransfer( ScSelectionTransferObj* pNew );
 
-    void                SetWaterCan( sal_Bool bNew )    { bIsWaterCan = bNew; }
-    sal_Bool                GetIsWaterCan() const       { return bIsWaterCan; }
+    void                SetWaterCan( bool bNew )    { bIsWaterCan = bNew; }
+    bool                GetIsWaterCan() const       { return bIsWaterCan; }
 
-    void                SetInEditCommand( sal_Bool bNew )   { bIsInEditCommand = bNew; }
-    sal_Bool                IsInEditCommand() const         { return bIsInEditCommand; }
+    void                SetInEditCommand( bool bNew )   { bIsInEditCommand = bNew; }
+    bool                IsInEditCommand() const         { return bIsInEditCommand; }
 
-    void                SetInExecuteDrop( sal_Bool bNew )   { bIsInExecuteDrop = bNew; }
-    sal_Bool                IsInExecuteDrop() const         { return bIsInExecuteDrop; }
+    void                SetInExecuteDrop( bool bNew )   { bIsInExecuteDrop = bNew; }
+    bool                IsInExecuteDrop() const         { return bIsInExecuteDrop; }
 
     // Options:
     const ScViewOptions&    GetViewOptions  ();
diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx
index 19e3cd7..2aa088d 100644
--- a/sc/source/ui/app/drwtrans.cxx
+++ b/sc/source/ui/app/drwtrans.cxx
@@ -73,6 +73,8 @@
 #include "chartlis.hxx"
 #include "rangeutl.hxx"
 #include "formula/grammar.hxx"
+#include "dragdata.hxx"
+#include "clipdata.hxx"
 
 // #108584#
 #include "scitems.hxx"
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index 30ff528..9b11fac 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -104,6 +104,8 @@
 #include "transobj.hxx"
 #include "detfunc.hxx"
 #include "preview.hxx"
+#include "dragdata.hxx"
+#include "clipdata.hxx"
 
 #include <svx/xmlsecctrl.hxx>
 
@@ -132,6 +134,8 @@ SFX_IMPL_INTERFACE( ScModule, SfxShell, ScResId(RID_APPTITLE) )
 
 ScModule::ScModule( SfxObjectFactory* pFact ) :
     SfxModule( SfxApplication::CreateResManager( "sc" ), false, pFact, NULL ),
+    mpDragData(new ScDragData),
+    mpClipData(new ScClipData),
     pSelTransfer( NULL ),
     pMessagePool( NULL ),
     pRefInputHandler( NULL ),
@@ -147,7 +151,6 @@ ScModule::ScModule( SfxObjectFactory* pFact ) :
     pCTLOptions( NULL ),
     pUserOptions( NULL ),
     pErrorHdl( NULL ),
-    pSvxErrorHdl( NULL ),
     pFormEditData( NULL ),
     nCurRefDlgId( 0 ),
     bIsWaterCan( false ),
@@ -197,8 +200,9 @@ ScModule::~ScModule()
 
     DELETEZ( pFormEditData );
 
+    delete mpDragData;
+    delete mpClipData;
     delete pErrorHdl;
-//  delete pSvxErrorHdl;
 
     ScGlobal::Clear();      // ruft auch ScDocumentPool::DeleteVersionMaps();
 
@@ -652,50 +656,58 @@ void ScModule::HideDisabledSlots( SfxItemSet& rSet )
 
 void ScModule::ResetDragObject()
 {
-    aDragData.pCellTransfer = NULL;
-    aDragData.pDrawTransfer = NULL;
+    mpDragData->pCellTransfer = NULL;
+    mpDragData->pDrawTransfer = NULL;
 
-    aDragData.aLinkDoc.Erase();
-    aDragData.aLinkTable.Erase();
-    aDragData.aLinkArea.Erase();
-    aDragData.pJumpLocalDoc = NULL;
-    aDragData.aJumpTarget.Erase();
-    aDragData.aJumpText.Erase();
+    mpDragData->aLinkDoc.Erase();
+    mpDragData->aLinkTable.Erase();
+    mpDragData->aLinkArea.Erase();
+    mpDragData->pJumpLocalDoc = NULL;
+    mpDragData->aJumpTarget.Erase();
+    mpDragData->aJumpText.Erase();
+}
+
+const ScDragData& ScModule::GetDragData() const
+{
+    return *mpDragData;
 }
 
 void ScModule::SetDragObject( ScTransferObj* pCellObj, ScDrawTransferObj* pDrawObj )
 {
     ResetDragObject();
-    aDragData.pCellTransfer = pCellObj;
-    aDragData.pDrawTransfer = pDrawObj;
+    mpDragData->pCellTransfer = pCellObj;
+    mpDragData->pDrawTransfer = pDrawObj;
 }
 
 void ScModule::SetDragLink( const String& rDoc, const String& rTab, const String& rArea )
 {
     ResetDragObject();
 
-    aDragData.aLinkDoc   = rDoc;
-    aDragData.aLinkTable = rTab;
-    aDragData.aLinkArea  = rArea;
+    mpDragData->aLinkDoc   = rDoc;
+    mpDragData->aLinkTable = rTab;
+    mpDragData->aLinkArea  = rArea;
 }
 
 void ScModule::SetDragJump( ScDocument* pLocalDoc, const String& rTarget, const String& rText )
 {
     ResetDragObject();
 
-    aDragData.pJumpLocalDoc = pLocalDoc;
-    aDragData.aJumpTarget = rTarget;
-    aDragData.aJumpText = rText;
+    mpDragData->pJumpLocalDoc = pLocalDoc;
+    mpDragData->aJumpTarget = rTarget;
+    mpDragData->aJumpText = rText;
 }
 
-//------------------------------------------------------------------
+const ScClipData& ScModule::GetClipData() const
+{
+    return *mpClipData;
+}
 
 void ScModule::SetClipObject( ScTransferObj* pCellObj, ScDrawTransferObj* pDrawObj )
 {
     OSL_ENSURE( !pCellObj || !pDrawObj, "SetClipObject: not allowed to set both objects" );
 
-    aClipData.pCellClipboard = pCellObj;
-    aClipData.pDrawClipboard = pDrawObj;
+    mpClipData->pCellClipboard = pCellObj;
+    mpClipData->pDrawClipboard = pDrawObj;
 }
 
 ScDocument* ScModule::GetClipDoc()
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index 26d6bc4..1372dc6 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -61,6 +61,8 @@
 #include "printfun.hxx"
 #include "docfunc.hxx"
 #include "scmod.hxx"
+#include "dragdata.hxx"
+#include "clipdata.hxx"
 
 // for InitDocShell
 #include <editeng/paperinf.hxx>
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index bc05d5f..d87cc2e 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -128,8 +128,9 @@
 #include "cellsh.hxx"
 #include "overlayobject.hxx"
 #include "cellsuno.hxx"
-
 #include "drawview.hxx"
+#include "dragdata.hxx"
+
 #include <svx/sdrpagewindow.hxx>
 #include <svx/sdr/overlay/overlaymanager.hxx>
 #include <vcl/svapp.hxx>
diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx
index a42190e..676c806 100644
--- a/sc/source/ui/view/tabcont.cxx
+++ b/sc/source/ui/view/tabcont.cxx
@@ -48,7 +48,7 @@
 #include "globstr.hrc"
 #include "transobj.hxx"
 #include "clipparam.hxx"
-
+#include "dragdata.hxx"
 
 // STATIC DATA -----------------------------------------------------------
 
diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx
index 495b674..21129de 100644
--- a/sc/source/ui/view/viewfun7.cxx
+++ b/sc/source/ui/view/viewfun7.cxx
@@ -61,6 +61,7 @@
 #include "docuno.hxx"
 #include "docsh.hxx"
 #include "convuno.hxx"
+#include "dragdata.hxx"
 
 extern Point aDragStartDiff;
 


More information about the Libreoffice-commits mailing list