diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2008-04-15 13:15:22 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2008-04-15 13:15:22 +0000 |
commit | 7084ca88ace923aad993393c66dd0dd2d157a660 (patch) | |
tree | 3eb3e505237592b79b8ad58e174526c2a0827071 /sc/source/ui/view/tabvwsha.cxx | |
parent | e0ad9146662b4316f487718bf6f7144d095e2816 (diff) |
INTEGRATION: CWS calcshare2 (1.23.8); FILE MERGED
2008/03/21 08:53:09 tbe 1.23.8.1: #i87315# [Collboration] Disable UI for actions which are not recorded by change tracking
Diffstat (limited to 'sc/source/ui/view/tabvwsha.cxx')
-rw-r--r-- | sc/source/ui/view/tabvwsha.cxx | 48 |
1 files changed, 41 insertions, 7 deletions
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx index 5e42b5170b14..781a79030bcb 100644 --- a/sc/source/ui/view/tabvwsha.cxx +++ b/sc/source/ui/view/tabvwsha.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: tabvwsha.cxx,v $ - * $Revision: 1.24 $ + * $Revision: 1.25 $ * * This file is part of OpenOffice.org. * @@ -150,6 +150,7 @@ void __EXPORT ScTabViewShell::GetState( SfxItemSet& rSet ) { ScViewData* pViewData = GetViewData(); ScDocument* pDoc = pViewData->GetDocument(); + ScDocShell* pDocShell = pViewData->GetDocShell(); ScMarkData& rMark = pViewData->GetMarkData(); SCCOL nPosX = pViewData->GetCurX(); SCROW nPosY = pViewData->GetCurY(); @@ -178,6 +179,17 @@ void __EXPORT ScTabViewShell::GetState( SfxItemSet& rSet ) } break; + case SID_OPENDLG_EDIT_PRINTAREA: + case SID_ADD_PRINTAREA: + case SID_DEFINE_PRINTAREA: + { + if ( pDocShell && pDocShell->IsDocShared() ) + { + rSet.DisableItem( nWhich ); + } + } + break; + case SID_DELETE_PRINTAREA: if ( nTabSelCount > 1 ) { @@ -190,6 +202,10 @@ void __EXPORT ScTabViewShell::GetState( SfxItemSet& rSet ) } else if ( !pDoc->GetPrintRangeCount( nTab ) && !pDoc->IsPrintEntireSheet( nTab ) ) rSet.DisableItem( nWhich ); + if ( pDocShell && pDocShell->IsDocShared() ) + { + rSet.DisableItem( nWhich ); + } break; case SID_STATUS_PAGESTYLE: @@ -322,11 +338,29 @@ void __EXPORT ScTabViewShell::GetState( SfxItemSet& rSet ) break; case FID_PROTECT_DOC: - rSet.Put(SfxBoolItem(nWhich, pDoc->IsDocProtected())); + { + if ( pDocShell && pDocShell->IsDocShared() ) + { + rSet.DisableItem( nWhich ); + } + else + { + rSet.Put( SfxBoolItem( nWhich, pDoc->IsDocProtected() ) ); + } + } break; case FID_PROTECT_TABLE: - rSet.Put(SfxBoolItem(nWhich, pDoc->IsTabProtected(nTab))); + { + if ( pDocShell && pDocShell->IsDocShared() ) + { + rSet.DisableItem( nWhich ); + } + else + { + rSet.Put( SfxBoolItem( nWhich, pDoc->IsTabProtected( nTab ) ) ); + } + } break; case SID_AUTO_OUTLINE: @@ -361,8 +395,8 @@ void __EXPORT ScTabViewShell::GetState( SfxItemSet& rSet ) case FID_CHG_SHOW: { - if(pDoc->GetChangeTrack()==NULL || GetViewData()->GetDocShell()->IsDocShared()) - rSet.DisableItem( nWhich); + if ( pDoc->GetChangeTrack() == NULL || ( pDocShell && pDocShell->IsDocShared() ) ) + rSet.DisableItem( nWhich ); } break; case FID_CHG_ACCEPT: @@ -376,7 +410,7 @@ void __EXPORT ScTabViewShell::GetState( SfxItemSet& rSet ) rSet.DisableItem( nWhich); } } - if ( GetViewData()->GetDocShell()->IsDocShared() ) + if ( pDocShell && pDocShell->IsDocShared() ) { rSet.DisableItem( nWhich ); } @@ -385,7 +419,7 @@ void __EXPORT ScTabViewShell::GetState( SfxItemSet& rSet ) case SID_FORMATPAGE: //! bei geschuetzten Tabellen ??? - if (GetViewData()->GetDocShell()->IsReadOnly()) + if ( pDocShell && ( pDocShell->IsReadOnly() || pDocShell->IsDocShared() ) ) rSet.DisableItem( nWhich ); break; |