ooo-build r11660 - in trunk: . patches/src680



Author: jonp
Date: Thu Feb 21 13:16:08 2008
New Revision: 11660
URL: http://svn.gnome.org/viewvc/ooo-build?rev=11660&view=rev

Log:
	* patches/src680/sc-paste-on-enter.diff: Fix SIGSEGV's that result from
	  pasting over the source cell, remove the "do you want to overwrite"
	  dialog, and cancel paste mode if alphanumeric data is entered into a cell.


Modified:
   trunk/ChangeLog
   trunk/patches/src680/sc-paste-on-enter.diff

Modified: trunk/patches/src680/sc-paste-on-enter.diff
==============================================================================
--- trunk/patches/src680/sc-paste-on-enter.diff	(original)
+++ trunk/patches/src680/sc-paste-on-enter.diff	Thu Feb 21 13:16:08 2008
@@ -1,10 +1,25 @@
+Index: sc/inc/global.hxx
+===================================================================
+RCS file: /cvs/sc/sc/inc/global.hxx,v
+retrieving revision 1.51
+diff -u -p -r1.51 global.hxx
+--- sc/inc/global.hxx	26 Nov 2007 14:40:56 -0000	1.51
++++ sc/inc/global.hxx	21 Feb 2008 02:17:32 -0000
+@@ -236,6 +236,7 @@ const BYTE   CR_MANUALSIZE  = 32;
+ #define CR_SAVEMASK		( ~CR_PAGEBREAK )
+ 
+ 									// Insert-/Delete-Flags
++#define IDF_SPECIAL_NOMARKAREA  0x2000
+ #define IDF_VALUE			0x0001
+ #define IDF_DATETIME		0x0002
+ #define IDF_STRING			0x0004
 Index: sc/source/ui/inc/cellsh.hxx
 ===================================================================
 RCS file: /cvs/sc/sc/source/ui/inc/cellsh.hxx,v
 retrieving revision 1.8
 diff -u -p -r1.8 cellsh.hxx
 --- sc/source/ui/inc/cellsh.hxx	27 Feb 2007 13:20:11 -0000	1.8
-+++ sc/source/ui/inc/cellsh.hxx	7 Feb 2008 05:20:59 -0000
++++ sc/source/ui/inc/cellsh.hxx	21 Feb 2008 01:29:22 -0000
 @@ -60,6 +60,7 @@ class SvxClipboardFmtItem;
  class TransferableDataHelper;
  class TransferableClipboardListener;
@@ -17,7 +32,7 @@
  	void		ExecuteMove( SfxRequest& rReq );
  	void		GetStateCursor( SfxItemSet& rSet );
  
-+	static void PasteFromClipboard( ScViewData* pViewData, ScTabViewShell* pTabViewShell );
++	static void PasteFromClipboard( ScViewData* pViewData, ScTabViewShell* pTabViewShell, USHORT nExtraFlags, BOOL bShowDialog );
  };
  
  #endif
@@ -27,7 +42,7 @@
 retrieving revision 1.21
 diff -u -p -r1.21 viewdata.hxx
 --- sc/source/ui/inc/viewdata.hxx	21 Nov 2007 19:10:07 -0000	1.21
-+++ sc/source/ui/inc/viewdata.hxx	7 Feb 2008 05:20:59 -0000
++++ sc/source/ui/inc/viewdata.hxx	21 Feb 2008 01:29:22 -0000
 @@ -208,6 +212,7 @@ private:
  	BOOL				bDelMarkValid;				// nur gueltig bei SC_REFTYPE_FILL
  	BYTE				nFillMode;					// Modus
@@ -58,7 +73,7 @@
 retrieving revision 1.48
 diff -u -p -r1.48 cellsh1.cxx
 --- sc/source/ui/view/cellsh1.cxx	26 Nov 2007 15:20:42 -0000	1.48
-+++ sc/source/ui/view/cellsh1.cxx	7 Feb 2008 05:21:00 -0000
++++ sc/source/ui/view/cellsh1.cxx	21 Feb 2008 01:29:30 -0000
 @@ -1176,6 +1184,7 @@ void ScCellShell::ExecuteEdit( SfxReques
  				WaitObject aWait( GetViewData()->GetDialogParent() );
  				pTabViewShell->CopyToClip( NULL, FALSE, FALSE, TRUE );
@@ -109,18 +124,18 @@
 -                    WaitObject aWait( GetViewData()->GetDialogParent() );
 -                    pTabViewShell->PasteFromSystem();
 -                }
-+				PasteFromClipboard ( GetViewData(), pTabViewShell );
++				PasteFromClipboard ( GetViewData(), pTabViewShell, 0, TRUE );
  				rReq.Done();
  			}
 -			pTabViewShell->CellContentChanged();		// => PasteFromSystem() ???
  			break;
  
  		case SID_CLIPBOARD_FORMAT_ITEMS:
-@@ -2270,3 +2248,40 @@ IMPL_LINK( ScCellShell, DialogClosed, Ab
+@@ -2270,3 +2248,46 @@ IMPL_LINK( ScCellShell, DialogClosed, Ab
      return 0;
  }
  
-+void ScCellShell::PasteFromClipboard( ScViewData* pViewData, ScTabViewShell* pTabViewShell )
++void ScCellShell::PasteFromClipboard( ScViewData* pViewData, ScTabViewShell* pTabViewShell, USHORT nExtraFlags, BOOL bShowDialog )
 +{
 +    Window* pWin = pViewData->GetActiveWin();
 +    ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pWin );
@@ -152,7 +167,13 @@
 +    {
 +        // normal paste
 +        WaitObject aWait( pViewData->GetDialogParent() );
-+        pTabViewShell->PasteFromSystem();
++        if (!pOwnClip)
++            pTabViewShell->PasteFromSystem();
++        else {
++            pTabViewShell->PasteFromClip( IDF_ALL | nExtraFlags, pOwnClip->GetDocument(),
++                    PASTE_NOFUNC, FALSE, FALSE, FALSE, INS_NONE, IDF_NONE,
++                    bShowDialog );		// allow warning dialog
++        }
 +    }
 +    pTabViewShell->CellContentChanged();		// => PasteFromSystem() ???
 +}
@@ -163,7 +184,7 @@
 retrieving revision 1.61
 diff -u -p -r1.61 viewdata.cxx
 --- sc/source/ui/view/viewdata.cxx	12 Dec 2007 13:22:01 -0000	1.61
-+++ sc/source/ui/view/viewdata.cxx	7 Feb 2008 05:21:00 -0000
++++ sc/source/ui/view/viewdata.cxx	21 Feb 2008 01:29:34 -0000
 @@ -344,6 +327,7 @@ ScViewData::ScViewData( ScDocShell* pDoc
  		bDelMarkValid( FALSE ),
  		nFillMode	( SC_FILL_NONE ),
@@ -180,14 +201,33 @@
  	aLogicMode	= pRef->aLogicMode;
  
  	SetGridMode		( pRef->IsGridMode() );
+Index: sc/source/ui/view/viewfun3.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/view/viewfun3.cxx,v
+retrieving revision 1.37
+diff -u -p -r1.37 viewfun3.cxx
+--- sc/source/ui/view/viewfun3.cxx	23 Oct 2007 14:46:56 -0000	1.37
++++ sc/source/ui/view/viewfun3.cxx	21 Feb 2008 02:32:15 -0000
+@@ -1038,7 +1053,10 @@ BOOL ScViewFunc::PasteFromClip( USHORT n
+ 		DoneBlockMode();
+ 		InitOwnBlockMode();
+ 	}
+-	rMark.SetMarkArea( aUserRange );
++
++	if (!(nFlags & IDF_SPECIAL_NOMARKAREA)) {
++		rMark.SetMarkArea( aUserRange );
++	}
+ 
+ 	HideCursor();							// Cursor aendert sich !
+ 
 Index: sc/source/ui/view/gridwin.cxx
 ===================================================================
 RCS file: /cvs/sc/sc/source/ui/view/gridwin.cxx,v
 retrieving revision 1.88
 diff -u -p -r1.88 gridwin.cxx
 --- sc/source/ui/view/gridwin.cxx	12 Dec 2007 13:21:19 -0000	1.88
-+++ sc/source/ui/view/gridwin.cxx	7 Feb 2008 05:21:01 -0000
-@@ -142,6 +147,7 @@
++++ sc/source/ui/view/gridwin.cxx	21 Feb 2008 12:49:09 -0000
+@@ -142,6 +146,7 @@
  #include "userdat.hxx"
  #include "drwlayer.hxx"
  #include "attrib.hxx"
@@ -206,7 +246,7 @@
          if( !rKeyCode.GetModifier() && (rKeyCode.GetCode() == KEY_F2) )
          {
              SC_MOD()->EndReference();
-@@ -2961,6 +3006,18 @@ void __EXPORT ScGridWindow::KeyInput(con
+@@ -2961,9 +3006,31 @@ void __EXPORT ScGridWindow::KeyInput(con
              return;
          }
      }
@@ -214,14 +254,27 @@
 +	{
 +		ScTabViewShell* pTabViewShell = pViewData->GetViewShell();
 +
-+		ScCellShell::PasteFromClipboard( pViewData, pTabViewShell );
++		ScCellShell::PasteFromClipboard( pViewData, pTabViewShell, IDF_SPECIAL_NOMARKAREA, FALSE );
 +
-+		TransferableHelper::GetSystemClipboard()->setContents(
-+				uno::Reference<datatransfer::XTransferable>(),
-+				uno::Reference<datatransfer::clipboard::XClipboardOwner>());
++		uno::Reference<datatransfer::clipboard::XClipboard> xSystemClipboard = 
++			TransferableHelper::GetSystemClipboard();
++		if (xSystemClipboard.is())
++		{
++			xSystemClipboard->setContents(
++					uno::Reference<datatransfer::XTransferable>(),
++					uno::Reference<datatransfer::clipboard::XClipboardOwner>());
++		}
 +
 +		pViewData->SetPasteMode( FALSE );
++		return;
 +	}
  	// wenn semi-Modeless-SfxChildWindow-Dialog oben, keine KeyInputs:
      else if( !pViewData->IsAnyFillMode() )
  	{
++		USHORT nGroup = rKeyCode.GetGroup();
++		if (!rKeyCode.GetModifier() && 
++				(nGroup == KEYGROUP_NUM || nGroup == KEYGROUP_ALPHA))
++			pViewData->SetPasteMode( FALSE );
+ 		//	query for existing note marker before calling ViewShell's keyboard handling
+ 		//	which may remove the marker
+ 		BOOL bHadKeyMarker = ( pNoteMarker && pNoteMarker->IsByKeyboard() );



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