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