ooo-build r12737 - in trunk: . patches/dev300



Author: kyoshida
Date: Sat May 31 02:51:25 2008
New Revision: 12737
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12737&view=rev

Log:
2008-05-30  Kohei Yoshida  <kyoshida novell com>

	* patches/dev300/cws-scsheetprotection02-sc.diff: fixed nasty 
	indentation mismatch because of my use of cvs diff -b.


Modified:
   trunk/ChangeLog
   trunk/patches/dev300/cws-scsheetprotection02-sc.diff

Modified: trunk/patches/dev300/cws-scsheetprotection02-sc.diff
==============================================================================
--- trunk/patches/dev300/cws-scsheetprotection02-sc.diff	(original)
+++ trunk/patches/dev300/cws-scsheetprotection02-sc.diff	Sat May 31 02:51:25 2008
@@ -6928,10 +6928,14 @@
  		if (pDoc->IsHorOverlapped( nCurX, nCurY, nTab ))
  		{
  			aViewData.SetOldCursor( nCurX,nCurY );
-diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
-index feff307..346e809 100644
---- sc/source/ui/view/tabvwsh3.cxx
-+++ sc/source/ui/view/tabvwsh3.cxx
+Index: sc/source/ui/view/tabvwsh3.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/view/tabvwsh3.cxx,v
+retrieving revision 1.40
+retrieving revision 1.38.80.5
+diff -u -I $Revision.*$ -I $Author.*$ -r1.40 -r1.38.80.5
+--- sc/source/ui/view/tabvwsh3.cxx	14 May 2008 10:05:09 -0000	1.40
++++ sc/source/ui/view/tabvwsh3.cxx	31 May 2008 01:31:54 -0000	1.38.80.5
 @@ -75,6 +75,8 @@
  #include "autofmt.hxx"
  #include "dwfunctr.hxx"
@@ -6952,7 +6956,7 @@
  #define IS_EDITMODE() GetViewData()->HasEditView( GetViewData()->GetActivePart() )
  #define IS_AVAILABLE(WhichId,ppItem) \
      (pReqArgs->GetItemState((WhichId), TRUE, ppItem ) == SFX_ITEM_SET)
-@@ -964,12 +970,13 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
+@@ -972,12 +978,13 @@
                      }
                  }
  
@@ -6968,79 +6972,109 @@
  					{
  						String	aText( ScResId(SCSTR_PASSWORD) );
  
-@@ -1022,15 +1029,12 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
- 			{
- 				ScDocument* 		pDoc = GetViewData()->GetDocument();
- 				SCTAB				nTab = GetViewData()->GetTabNo();
+@@ -1027,89 +1034,84 @@
+ 
+ 
+ 		case FID_PROTECT_TABLE:
+-			{
+-				ScDocument* 		pDoc = GetViewData()->GetDocument();
+-				SCTAB				nTab = GetViewData()->GetTabNo();
 -				SfxPasswordDialog*	pDlg;
 -				String				aPassword;
 -				BOOL				bCancel = FALSE;
 -				BOOL				bOldProtection = pDoc->IsTabProtected(nTab);
 -				BOOL				bNewProtection = ! bOldProtection;
++        {
++            ScDocument* pDoc = GetViewData()->GetDocument();
++            SCTAB		nTab = GetViewData()->GetTabNo();
 +            bool        bOldProtection = pDoc->IsTabProtected(nTab);
  
- 				if( pReqArgs )
- 				{
- 					const SfxPoolItem* pItem;
+-				if( pReqArgs )
+-				{
+-					const SfxPoolItem* pItem;
+-					if( IS_AVAILABLE( FID_PROTECT_TABLE, &pItem ) )
+-						bNewProtection = ((const SfxBoolItem*)pItem)->GetValue();
+-                    if( bNewProtection == bOldProtection )
++            if( pReqArgs )
++            {
++                const SfxPoolItem* pItem;
 +                bool bNewProtection = !bOldProtection;
- 					if( IS_AVAILABLE( FID_PROTECT_TABLE, &pItem ) )
- 						bNewProtection = ((const SfxBoolItem*)pItem)->GetValue();
-                     if( bNewProtection == bOldProtection )
-@@ -1048,65 +1052,63 @@
-                     }
-                 }
- 
--                    if ( bOldProtection)
++                if( IS_AVAILABLE( FID_PROTECT_TABLE, &pItem ) )
++                    bNewProtection = ((const SfxBoolItem*)pItem)->GetValue();
++                if( bNewProtection == bOldProtection )
++                {
++                    rReq.Ignore();
++                    break;
++                }
++            }
++
 +            if (bOldProtection)
-                     {
--                        if (pDoc->GetTabPassword(nTab).getLength())
--                        {
--                            String  aText( ScResId(SCSTR_PASSWORD) );
++            {
 +                // Unprotect a protected sheet.
- 
--                            pDlg = new SfxPasswordDialog( GetDialogParent(), &aText );
++
 +                ScTableProtection* pProtect = pDoc->GetTabProtection(nTab);
 +                if (pProtect && pProtect->isProtectedWithPass())
 +                {
 +                    String aText( ScResId(SCSTR_PASSWORDOPT) );
 +                    auto_ptr<SfxPasswordDialog> pDlg(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();
-+                    {
++                    pDlg->SetText( ScResId(SCSTR_UNPROTECTTAB) );
++                    pDlg->SetMinLen( 0 );
++                    pDlg->SetHelpId( FID_PROTECT_TABLE );
++                    pDlg->SetEditHelpId( HID_PASSWD_TABLE );
++
++                    if (pDlg->Execute() == RET_OK)
+                     {
+-                        rReq.Ignore();
+-                        break;
 +                        String aPassword = pDlg->GetPassword();
 +                        Unprotect(nTab, aPassword);
-+                    }
-+                }
-                             else
--                                bCancel = TRUE;
+                     }
+                 }
++                else
 +                    // this sheet is not password-protected.
 +                    Unprotect(nTab, String());
  
--                            delete pDlg;
+-                    if ( bOldProtection)
+-                    {
+-                        if (pDoc->GetTabPassword(nTab).getLength())
+-                        {
+-                            String  aText( ScResId(SCSTR_PASSWORD) );
+-
+-                            pDlg = 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) );
++                }
++            }
++            else
++            {
 +                // Protect a current sheet.
  
+-                            delete pDlg;
+-                        }
+-                    }
+-                    else
+-                    {
+-                        String aText( ScResId(SCSTR_PASSWORDOPT) );
++                auto_ptr<ScTableProtectionDlg> pDlg(new ScTableProtectionDlg(GetDialogParent()));
+ 
 -                        pDlg = 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 );
-+                auto_ptr<ScTableProtectionDlg> pDlg(new ScTableProtectionDlg(GetDialogParent()));
- 
+-
 -                        if (pDlg->Execute() == RET_OK)
 -                            aPassword = pDlg->GetPassword();
 -                        else
@@ -7051,38 +7085,49 @@
  
 -                        delete pDlg;
 -                    }
--
++                if (pDlg->Execute() == RET_OK)
++                {
++                    pScMod->InputEnterHandler();
+ 
 -                if( !bCancel )
 -				{
 -                    if ( bOldProtection )
 -						Unprotect( nTab, aPassword );
 -					else
-+                if (pDlg->Execute() == RET_OK)
-                     {
-                         pScMod->InputEnterHandler();
- 
--						Protect( nTab, aPassword );
--                    }
--
--                    if( !pReqArgs )
 +                    ScTableProtection aNewProtect;
 +                    pDlg->WriteData(aNewProtect);
 +                    ProtectSheet(nTab, aNewProtect);
 +                    if (!pReqArgs)
- 					{
--						rReq.AppendItem( SfxBoolItem( FID_PROTECT_TABLE, bNewProtection ) );
+                     {
+-                        pScMod->InputEnterHandler();
+-
+-						Protect( nTab, aPassword );
 +                        rReq.AppendItem( SfxBoolItem(FID_PROTECT_TABLE, true) );
- 						rReq.Done();
- 					}
- 				}
++                        rReq.Done();
+                     }
++                }
 +            }
  
- 				TabChanged();
+-                    if( !pReqArgs )
+-					{
+-						rReq.AppendItem( SfxBoolItem( FID_PROTECT_TABLE, bNewProtection ) );
+-						rReq.Done();
+-					}
+-				}
+-
+-				TabChanged();
 -				UpdateInputHandler(TRUE);	// damit sofort wieder eingegeben werden kann
+-				SelectionChanged();
+-			}
+-			break;
++            TabChanged();
 +            UpdateInputHandler(true);   // damit sofort wieder eingegeben werden kann
- 				SelectionChanged();
- 			}
- 			break;
++            SelectionChanged();
++        }
++        break;
+ 
+         case SID_OPT_LOCALE_CHANGED :
+             {   // locale changed, SYSTEM number formats changed => repaint cell contents
 diff --git a/sc/source/ui/view/tabvwshh.cxx b/sc/source/ui/view/tabvwshh.cxx
 index fb9408b..52c8fc4 100644
 --- sc/source/ui/view/tabvwshh.cxx



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]