diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2010-11-24 14:32:41 -0500 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2010-11-24 14:34:26 -0500 |
commit | 28c7911d2d0898f482e28251296d40c76b5cde39 (patch) | |
tree | 0ad5456f684363ff2570ef28094f8e02707492df /sc/source/ui/view/tabvwsh3.cxx | |
parent | d127768d9568a636665af407ec3ed7830b2d2bc5 (diff) |
Remove the preprocessor guard for sheet protection options.
This feature is now universally enabled, removing the unnecessary
guard.
Diffstat (limited to 'sc/source/ui/view/tabvwsh3.cxx')
-rw-r--r-- | sc/source/ui/view/tabvwsh3.cxx | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx index 7eb78c81d003..8bfb7b6bf9e5 100644 --- a/sc/source/ui/view/tabvwsh3.cxx +++ b/sc/source/ui/view/tabvwsh3.cxx @@ -1065,8 +1065,6 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) SCTAB nTab = GetViewData()->GetTabNo(); bool bOldProtection = pDoc->IsTabProtected(nTab); -#if ENABLE_SHEET_PROTECTION - if( pReqArgs ) { const SfxPoolItem* pItem; @@ -1134,85 +1132,6 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) } } } -#else - auto_ptr<SfxPasswordDialog> pDlg; - String aPassword; - BOOL bCancel = FALSE; - bool bNewProtection = ! bOldProtection; - - if( pReqArgs ) - { - const SfxPoolItem* pItem; - if( IS_AVAILABLE( FID_PROTECT_TABLE, &pItem ) ) - bNewProtection = ((const SfxBoolItem*)pItem)->GetValue(); - if( bNewProtection == bOldProtection ) - { - rReq.Ignore(); - break; - } - } - - if ( bOldProtection) - { - // Unprotect a protected sheet. - - ScTableProtection* pProtect = pDoc->GetTabProtection(nTab); - if (pProtect && pProtect->isProtectedWithPass()) - { - String aText( ScResId(SCSTR_PASSWORDOPT) ); - pDlg.reset(new SfxPasswordDialog(GetDialogParent(), &aText)); - pDlg->SetText( ScResId(SCSTR_UNPROTECTTAB) ); - pDlg->SetMinLen( 0 ); - pDlg->SetHelpId( FID_PROTECT_TABLE ); - pDlg->SetEditHelpId( HID_PASSWD_TABLE ); - - if (pDlg->Execute() == RET_OK) - aPassword = pDlg->GetPassword(); - else - bCancel = TRUE; - } - - if (!pReqArgs) - { - rReq.AppendItem( SfxBoolItem(FID_PROTECT_TABLE, false) ); - rReq.Done(); - } - } - else - { - String aText( ScResId(SCSTR_PASSWORDOPT) ); - - pDlg.reset(new SfxPasswordDialog(GetDialogParent(), &aText)); - pDlg->SetText( ScResId(SCSTR_PROTECTTAB) ); - pDlg->SetMinLen( 0 ); - pDlg->SetHelpId( FID_PROTECT_TABLE ); - pDlg->SetEditHelpId( HID_PASSWD_TABLE ); - pDlg->ShowExtras( SHOWEXTRAS_CONFIRM ); - - if (pDlg->Execute() == RET_OK) - aPassword = pDlg->GetPassword(); - else - bCancel = TRUE; - } - - if( !bCancel ) - { - if ( bOldProtection ) - Unprotect( nTab, aPassword ); - else - { - pScMod->InputEnterHandler(); - - Protect( nTab, aPassword ); - } - - if( !pReqArgs ) - { - rReq.AppendItem( SfxBoolItem( FID_PROTECT_TABLE, bNewProtection ) ); - rReq.Done(); - } - } -#endif TabChanged(); UpdateInputHandler(true); // damit sofort wieder eingegeben werden kann SelectionChanged(); |