summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/tabvwsh2.cxx
diff options
context:
space:
mode:
authorNiklas Nebel <nn@openoffice.org>2002-03-14 14:12:44 +0000
committerNiklas Nebel <nn@openoffice.org>2002-03-14 14:12:44 +0000
commiteff81e0d8a68d4a7a7cdf1793ced8eb37d8e16ab (patch)
treef0e7f7ecafd54c25575dd18c037117c8dcd98f68 /sc/source/ui/view/tabvwsh2.cxx
parent34b6458748606c29a238b8f09c0ef0fbe4dc9428 (diff)
#97016# select first object with CTRL-SID_OBJECT_SELECT
Diffstat (limited to 'sc/source/ui/view/tabvwsh2.cxx')
-rw-r--r--sc/source/ui/view/tabvwsh2.cxx31
1 files changed, 28 insertions, 3 deletions
diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx
index e7b13226c..96f72a001 100644
--- a/sc/source/ui/view/tabvwsh2.cxx
+++ b/sc/source/ui/view/tabvwsh2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: tabvwsh2.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: nn $ $Date: 2001-05-14 08:43:38 $
+ * last change: $Author: nn $ $Date: 2002-03-14 15:12:44 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -190,8 +190,18 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
if (nNewId == SID_INSERT_FRAME) // vom Tbx-Button
nNewId = SID_DRAW_TEXT;
+ // #97016# CTRL-SID_OBJECT_SELECT is used to select the first object,
+ // but not if SID_OBJECT_SELECT is the result of clicking a create function again,
+ // so this must be tested before changing nNewId below.
+ BOOL bSelectFirst = ( nNewId == SID_OBJECT_SELECT && (rReq.GetModifier() & KEY_MOD1) );
+
BOOL bEx = IsDrawSelMode();
- if ( nNewId == nDrawSfxId && ( nNewId != SID_FM_CREATE_CONTROL ||
+ if ( bSelectFirst )
+ {
+ // #97016# always allow keyboard selection also on background layer
+ bEx = TRUE;
+ }
+ else if ( nNewId == nDrawSfxId && ( nNewId != SID_FM_CREATE_CONTROL ||
nNewFormId == nFormSfxId || nNewFormId == 0 ) )
{
// SID_FM_CREATE_CONTROL mit nNewFormId==0 (ohne Parameter) kommt beim Deaktivieren
@@ -224,6 +234,21 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
if (pLayer)
pView->SetLayerLocked( pLayer->GetName(), !bEx );
+ if ( bSelectFirst )
+ {
+ // #97016# select first draw object if none is selected yet
+ if(!pView->HasMarkedObj())
+ {
+ // select first object
+ pView->UnmarkAllObj();
+ pView->MarkNextObj(TRUE);
+
+ // ...and make it visible
+ if(pView->HasMarkedObj())
+ pView->MakeVisible(pView->GetAllMarkedRect(), *pWin);
+ }
+ }
+
nDrawSfxId = nNewId;
if ( nNewId != SID_DRAW_CHART ) // Chart nicht mit DrawShell