Kaydet (Commit) ac991693 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

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

üst 62a85c8b
......@@ -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 ();
......
......@@ -73,6 +73,8 @@
#include "chartlis.hxx"
#include "rangeutl.hxx"
#include "formula/grammar.hxx"
#include "dragdata.hxx"
#include "clipdata.hxx"
// #108584#
#include "scitems.hxx"
......
......@@ -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()
......
......@@ -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>
......
......@@ -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>
......
......@@ -48,7 +48,7 @@
#include "globstr.hrc"
#include "transobj.hxx"
#include "clipparam.hxx"
#include "dragdata.hxx"
// STATIC DATA -----------------------------------------------------------
......
......@@ -61,6 +61,7 @@
#include "docuno.hxx"
#include "docsh.hxx"
#include "convuno.hxx"
#include "dragdata.hxx"
extern Point aDragStartDiff;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment