summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2008-04-18 11:02:52 +0000
committerRüdiger Timm <rt@openoffice.org>2008-04-18 11:02:52 +0000
commit721363df22e0622bff2348687eebb5265af05d08 (patch)
treef575dfd26b383bf046e72f80b50277019a44b49d /sc
parent62be40378af60fa31aaf99f29b5fdf8fd51c8cf2 (diff)
INTEGRATION: CWS filteredrows (1.45.64); FILE MERGED
2008/03/28 16:54:27 er 1.45.64.4: #i33851# disable Insert.Names.Create for filtered 2008/03/28 15:46:54 er 1.45.64.3: re-enable paste slots 2008/03/20 16:19:13 er 1.45.64.2: #i33851# re-enable CopyToClip for filtered, using the existing mechanisms 2008/03/19 18:31:53 er 1.45.64.1: #i33851# first wave: treat filtered simple area selection as if it was a multi-selection, effectively disabling all operations that are not supported for a multi-selection
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/cellsh.cxx29
1 files changed, 22 insertions, 7 deletions
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index e76c8b3dd8b9..eeed366dca54 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: cellsh.cxx,v $
- * $Revision: 1.47 $
+ * $Revision: 1.48 $
*
* This file is part of OpenOffice.org.
*
@@ -120,7 +120,8 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet )
{
ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell();
ScRange aMarkRange;
- BOOL bSimpleArea = GetViewData()->GetSimpleArea( aMarkRange );
+ ScMarkType eMarkType = GetViewData()->GetSimpleArea( aMarkRange );
+ BOOL bSimpleArea = (eMarkType == SC_MARK_SIMPLE);
BOOL bOnlyNotBecauseOfMatrix;
BOOL bEditable = pTabViewShell->SelectionEditable( &bOnlyNotBecauseOfMatrix );
ScDocument* pDoc = GetViewData()->GetDocument();
@@ -205,7 +206,7 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet )
break;
case SID_COPY: // Kopieren
- bDisable = (!bSimpleArea);
+ bDisable = (!bSimpleArea && eMarkType != SC_MARK_SIMPLE_FILTERED);
// nur wegen Matrix nicht editierbar? Matrix nicht zerreissen
//! schlaegt nicht zu, wenn geschuetzt UND Matrix, aber damit
//! muss man leben.. wird in Copy-Routine abgefangen, sonst
@@ -480,7 +481,9 @@ void __EXPORT ScCellShell::GetClipState( SfxItemSet& rSet )
ScDocument* pDoc = GetViewData()->GetDocShell()->GetDocument();
if (!pDoc->IsBlockEditable( nTab, nCol,nRow, nCol,nRow ))
bDisable = TRUE;
- if (GetViewData()->IsMultiMarked())
+ ScRange aDummy;
+ ScMarkType eMarkType = GetViewData()->GetSimpleArea( aDummy);
+ if (eMarkType != SC_MARK_SIMPLE && eMarkType != SC_MARK_SIMPLE_FILTERED)
bDisable = TRUE;
}
@@ -548,7 +551,7 @@ void ScCellShell::GetState(SfxItemSet &rSet)
case SID_RANGE_ADDRESS:
{
ScRange aRange;
- if ( pData->GetSimpleArea( aRange ) )
+ if ( pData->GetSimpleArea( aRange ) == SC_MARK_SIMPLE )
{
String aStr;
USHORT nFlags = SCA_VALID | SCA_TAB_3D;
@@ -567,7 +570,7 @@ void ScCellShell::GetState(SfxItemSet &rSet)
// #43343# immer Cursorposition
#if 0
ScRange aRange;
- if (GetViewData()->GetSimpleArea(aRange,TRUE))
+ if (GetViewData()->GetSimpleArea(aRange,TRUE) == SC_MARK_SIMPLE)
{
nNoteCol = aRange.aStart.Col();
nNoteRow = aRange.aStart.Row();
@@ -984,9 +987,21 @@ void ScCellShell::GetState(SfxItemSet &rSet)
ScViewUtil::HideDisabledSlot( rSet, pData->GetBindings(), nWhich );
break;
+ case FID_USE_NAME:
+ {
+ if ( pDocSh && pDocSh->IsDocShared() )
+ rSet.DisableItem( nWhich );
+ else
+ {
+ ScRange aRange;
+ if ( pData->GetSimpleArea( aRange ) != SC_MARK_SIMPLE )
+ rSet.DisableItem( nWhich );
+ }
+ }
+ break;
+
case FID_DEFINE_NAME:
case FID_INSERT_NAME:
- case FID_USE_NAME:
case SID_DEFINE_COLROWNAMERANGES:
{
if ( pDocSh && pDocSh->IsDocShared() )