Hi,

A patch for EasyHack "Leftover data after Undo operation" (qa issue
#106711).

Before pushing, please check if this patch:
- Does fix the problem.
- Do not introduce new issues. (Not fixing a problem and generated new
ones.)

MPL 1.1 / GPLv3+ / LGPLv3+, Joost Wezenbeek

Joost
From 7abfa9d9d1f21fa58110f533db99be4e302505ff Mon Sep 17 00:00:00 2001
From: Joost Wezenbeek <joost.eekho...@gmail.com>
Date: Mon, 20 Dec 2010 23:02:07 +0100
Subject: [PATCH] Leftover data after Undo operation

qa issue #106711
---
 sc/source/ui/view/viewfun3.cxx |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 42f75c6..10cea3a 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -1063,6 +1063,27 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
         }
         aFilteredMark.SetMarkArea( aMarkRange);
     }
+    else
+    {
+        // FIX for issue #106711 : leftover data after undo.
+        if (!bNoPaste )
+        {
+            ScRange rRange;
+            aFilteredMark.GetMarkArea( rRange );
+            if( (rRange.aEnd.Col() - rRange.aStart.Col()) < nDestSizeX )
+            {
+                nStartCol = rRange.aStart.Col();
+                nStartRow = rRange.aStart.Row();
+                nStartTab = rRange.aStart.Tab();
+                nEndCol = nStartCol + nDestSizeX;
+                nEndRow = rRange.aEnd.Row();
+                nEndTab = rRange.aEnd.Tab();
+                aMarkRange = ScRange( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab);
+                aFilteredMark.SetMarkArea( aMarkRange);
+            }
+        }
+    }
+
     if (bNoPaste)
     {
         ErrorMessage(STR_MSSG_PASTEFROMCLIP_0);
-- 
1.7.1

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to