[Libreoffice-commits] .: sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Tue Dec 21 10:18:34 PST 2010


 sc/source/ui/view/viewfun3.cxx |   72 +++++++++++++++++++++--------------------
 1 file changed, 37 insertions(+), 35 deletions(-)

New commits:
commit 8b7d7543b6f94602b468c888cf19753f4c26383a
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Tue Dec 21 13:18:13 2010 -0500

    Oops.  We can't bail out earlier than that, it seems.

diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 426e6b3..e5acd21 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -1042,46 +1042,48 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
     bool bNoPaste = ((eMarkType != SC_MARK_SIMPLE && !bMarkIsFiltered) ||
             (bMarkIsFiltered && (eMoveMode != INS_NONE || bAsLink)));
 
-    if (bNoPaste)
+    if (!bNoPaste)
     {
-        // Exit early when we don't want to perform pasting.
-        ErrorMessage(STR_MSSG_PASTEFROMCLIP_0);
-        return FALSE;
-    }
-
-    if (!rMark.IsMarked())
-    {
-        // Create a selection with clipboard row count and check that for
-        // filtered.
-        nStartCol = GetViewData()->GetCurX();
-        nStartRow = GetViewData()->GetCurY();
-        nStartTab = GetViewData()->GetTabNo();
-        nEndCol = nStartCol + nDestSizeX;
-        nEndRow = nStartRow + nDestSizeY;
-        nEndTab = nStartTab;
-        aMarkRange = ScRange( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab);
-        if (ScViewUtil::HasFiltered( aMarkRange, pDoc))
+        if (!rMark.IsMarked())
+        {
+            // Create a selection with clipboard row count and check that for
+            // filtered.
+            nStartCol = GetViewData()->GetCurX();
+            nStartRow = GetViewData()->GetCurY();
+            nStartTab = GetViewData()->GetTabNo();
+            nEndCol = nStartCol + nDestSizeX;
+            nEndRow = nStartRow + nDestSizeY;
+            nEndTab = nStartTab;
+            aMarkRange = ScRange( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab);
+            if (ScViewUtil::HasFiltered( aMarkRange, pDoc))
+            {
+                bMarkIsFiltered = true;
+                // Fit to clipboard's row count unfiltered rows. If there is no
+                // fit assume that pasting is not possible. Note that nDestSizeY is
+                // size-1 (difference).
+                if (!ScViewUtil::FitToUnfilteredRows( aMarkRange, pDoc, nDestSizeY+1))
+                    bNoPaste = true;
+            }
+            aFilteredMark.SetMarkArea( aMarkRange);
+        }
+        else
         {
-            bMarkIsFiltered = true;
-            // Fit to clipboard's row count unfiltered rows. If there is no
-            // fit assume that pasting is not possible. Note that nDestSizeY is
-            // size-1 (difference).
-            if (!ScViewUtil::FitToUnfilteredRows( aMarkRange, pDoc, nDestSizeY+1))
-                bNoPaste = true;
+            // Expand the marked area when the destination area is larger than the
+            // current selection, to get the undo do the right thing. (i#106711)
+            ScRange aRange;
+            aFilteredMark.GetMarkArea( aRange );
+            if( (aRange.aEnd.Col() - aRange.aStart.Col()) < nDestSizeX )
+            {
+                aRange.aEnd.SetCol(aRange.aStart.Col() + nDestSizeX);
+                aFilteredMark.SetMarkArea(aRange);
+            }
         }
-        aFilteredMark.SetMarkArea( aMarkRange);
     }
-    else
+
+    if (bNoPaste)
     {
-        // Expand the marked area when the destination area is larger than the
-        // current selection, to get the undo do the right thing. (i#106711)
-        ScRange aRange;
-        aFilteredMark.GetMarkArea( aRange );
-        if( (aRange.aEnd.Col() - aRange.aStart.Col()) < nDestSizeX )
-        {
-            aRange.aEnd.SetCol(aRange.aStart.Col() + nDestSizeX);
-            aFilteredMark.SetMarkArea(aRange);
-        }
+        ErrorMessage(STR_MSSG_PASTEFROMCLIP_0);
+        return FALSE;
     }
 
     SCROW nUnfilteredRows = aMarkRange.aEnd.Row() - aMarkRange.aStart.Row() + 1;


More information about the Libreoffice-commits mailing list