summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2011-11-27 19:36:27 +0100
committerEike Rathke <erack@redhat.com>2011-11-28 15:25:25 +0100
commitff75bad6ae119e0532f2e6a653b8272184b2572e (patch)
tree49288efc7590b31f93ce99ee8c6f9b3f7ac68a28 /sc
parent790d758d561502b4d81a86308677fb198d16fce7 (diff)
dr78: #i26822# remove draw shell if selected object is removed by undo
# HG changeset patch # User Niklas Nebel <nn@openoffice.org> # Date 1289998839 -3600 # Node ID 13ee1d09d967db01adbd4f68ca3200e1d3b30cca # Parent 8e91176b3b0e8dc609e0fb73ab7c9ee3ff23e115
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/drawfunc/drawsh5.cxx9
-rw-r--r--sc/source/ui/drawfunc/drtxtob2.cxx3
-rw-r--r--sc/source/ui/inc/tabvwsh.hxx2
-rw-r--r--sc/source/ui/inc/undodraw.hxx2
-rw-r--r--sc/source/ui/undo/undodraw.cxx67
-rw-r--r--sc/source/ui/view/tabvwsh4.cxx9
6 files changed, 27 insertions, 65 deletions
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx
index e714fb683732..d72d5295aa85 100644
--- a/sc/source/ui/drawfunc/drawsh5.cxx
+++ b/sc/source/ui/drawfunc/drawsh5.cxx
@@ -288,8 +288,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
rBindings.Invalidate(SID_OBJECT_HEAVEN);
rBindings.Invalidate(SID_OBJECT_HELL);
// leave draw shell if nothing selected (layer may be locked)
- if ( pView->GetMarkedObjectList().GetMarkCount() == 0 )
- pViewData->GetViewShell()->SetDrawShell( false );
+ pViewData->GetViewShell()->UpdateDrawShell();
break;
case SID_FRAME_TO_TOP:
@@ -359,14 +358,12 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
case SID_DELETE:
case SID_DELETE_CONTENTS:
pView->DeleteMarked();
- if (!pTabView->IsDrawSelMode())
- pViewData->GetViewShell()->SetDrawShell( false );
+ pViewData->GetViewShell()->UpdateDrawShell();
break;
case SID_CUT:
pView->DoCut();
- if (!pTabView->IsDrawSelMode())
- pViewData->GetViewShell()->SetDrawShell( false );
+ pViewData->GetViewShell()->UpdateDrawShell();
break;
case SID_COPY:
diff --git a/sc/source/ui/drawfunc/drtxtob2.cxx b/sc/source/ui/drawfunc/drtxtob2.cxx
index c6b5ad567f55..b9bbfd7e45f9 100644
--- a/sc/source/ui/drawfunc/drtxtob2.cxx
+++ b/sc/source/ui/drawfunc/drtxtob2.cxx
@@ -82,8 +82,7 @@ void ScDrawTextObjectBar::ExecuteGlobal( SfxRequest &rReq )
case SID_CUT:
pView->DoCut();
- if (!pTabView->IsDrawSelMode())
- pViewData->GetViewShell()->SetDrawShell( false );
+ pViewData->GetViewShell()->UpdateDrawShell();
break;
case SID_PASTE:
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index c39d9a42a206..e03ab7a36420 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -303,7 +303,7 @@ public:
void ExecDrawOpt(SfxRequest& rReq);
void GetDrawOptState(SfxItemSet &rSet);
-
+ void UpdateDrawShell();
void SetDrawShell( sal_Bool bActive );
void SetDrawTextShell( sal_Bool bActive );
diff --git a/sc/source/ui/inc/undodraw.hxx b/sc/source/ui/inc/undodraw.hxx
index f8f633a2dc7c..95b2dc63c2b8 100644
--- a/sc/source/ui/inc/undodraw.hxx
+++ b/sc/source/ui/inc/undodraw.hxx
@@ -38,6 +38,8 @@ class ScUndoDraw: public SfxUndoAction
SfxUndoAction* pDrawUndo;
ScDocShell* pDocShell;
+ void UpdateSubShell();
+
public:
TYPEINFO();
ScUndoDraw( SfxUndoAction* pUndo, ScDocShell* pDocSh );
diff --git a/sc/source/ui/undo/undodraw.cxx b/sc/source/ui/undo/undodraw.cxx
index a6fc02d20481..8bc0c1c7922f 100644
--- a/sc/source/ui/undo/undodraw.cxx
+++ b/sc/source/ui/undo/undodraw.cxx
@@ -27,68 +27,13 @@
************************************************************************/
-
-
-//------------------------------------------------------------------
-
-// TOOLS
-#define _BIGINT_HXX
-#define _SFXMULTISEL_HXX
-#define _STACK_HXX
-#define _QUEUE_HXX
-#define _DYNARR_HXX
-#define _TREELIST_HXX
-#define _CACHESTR_HXX
-#define _NEW_HXX
-#define _DYNARY_HXX
-#define _SVMEMPOOL_HXX
-#define _CACHESTR_HXX
-#define _SV_MULTISEL_HXX
-
-//SV
-#define _CONFIG_HXX
-#define _CURSOR_HXX
-#define _FONTDLG_HXX
-#define _PRVWIN_HXX
-#define _HELP_HXX
-#define _MDIWIN_HXX
-#define _SPIN_HXX
-#define _FILDLG_HXX
-#define _COLDLG_HXX
-#define _SOUND_HXX
-
-
-#define SI_NOITEMS
-#define _SI_NOSBXCONTROLS
-#define _SI_NOOTHERFORMS
-#define _SI_NOCONTROL
-#define _SI_NOSBXCONTROLS
-#define _SIDLL_HXX
-
-// SFX
-#define _SFXAPPWIN_HXX
-#define _SFX_SAVEOPT_HXX
-#define _SFXPRNMON_HXX
-#define _INTRO_HXX
-#define _SFXMSGDESCR_HXX
-#define _SFXMSGPOOL_HXX
-#define _SFXFILEDLG_HXX
-#define _PASSWD_HXX
-#define _SFXTBXCTRL_HXX
-#define _SFXSTBITEM_HXX
-#define _SFXMNUITEM_HXX
-#define _SFXIMGMGR_HXX
-#define _SFXTBXMGR_HXX
-#define _SFXSTBMGR_HXX
-#define _SFX_MINFITEM_HXX
-#define _SFXEVENT_HXX
-
// INCLUDE ---------------------------------------------------------------
#include <svx/svdundo.hxx>
#include "undodraw.hxx"
#include "docsh.hxx"
+#include "tabvwsh.hxx"
// -----------------------------------------------------------------------
@@ -159,12 +104,21 @@ sal_Bool ScUndoDraw::Merge( SfxUndoAction* pNextAction )
return false;
}
+void ScUndoDraw::UpdateSubShell()
+{
+ // #i26822# remove the draw shell if the selected object has been removed
+ ScTabViewShell* pViewShell = pDocShell->GetBestViewShell();
+ if (pViewShell)
+ pViewShell->UpdateDrawShell();
+}
+
void ScUndoDraw::Undo()
{
if (pDrawUndo)
{
pDrawUndo->Undo();
pDocShell->SetDrawModified();
+ UpdateSubShell();
}
}
@@ -174,6 +128,7 @@ void ScUndoDraw::Redo()
{
pDrawUndo->Redo();
pDocShell->SetDrawModified();
+ UpdateSubShell();
}
}
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 2a4d8e58581d..e6f7946519a6 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -603,6 +603,15 @@ void ScTabViewShell::DoReadUserData( const String& rData )
//------------------------------------------------------------------
+void ScTabViewShell::UpdateDrawShell()
+{
+ // Called after user interaction that may delete the selected drawing object.
+ // Remove DrawShell if nothing is selected.
+
+ SdrView* pDrView = GetSdrView();
+ if ( pDrView && !pDrView->AreObjectsMarked() && !IsDrawSelMode() )
+ SetDrawShell( false );
+}
void ScTabViewShell::SetDrawShellOrSub()
{