sc/source/ui/view/viewfun2.cxx |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 0baeea95f38a5cdb19936290c69d33541274ad41
Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net>
Date:   Wed Jul 20 20:27:23 2016 +0200

    tdf#90943 Don't ask to move cells if they are empty
    
    During merge of cells, test of empty cells was wrong.
    Test of first column should not be done if there is only 1 row
    
    Change-Id: If8011f3e6d6e9006d242a8c2ef0fcb2ce12180ad
    Reviewed-on: https://gerrit.libreoffice.org/27354
    Reviewed-by: Eike Rathke <er...@redhat.com>
    Tested-by: Eike Rathke <er...@redhat.com>

diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 889c7f2..1970e04 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -1063,9 +1063,15 @@ bool ScViewFunc::MergeCells( bool bApi, bool& 
rDoContents, bool bCenter )
         SCTAB i = *itr;
         aMergeOption.maTabs.insert(i);
 
-        if (!rDoc.IsBlockEmpty(i, nStartCol, nStartRow+1, nStartCol, nEndRow) 
||
-            !rDoc.IsBlockEmpty(i, nStartCol+1, nStartRow, nEndCol, nEndRow))
-            bAskDialog = true;
+        if ( nEndRow == nStartRow )
+        {
+            if (!rDoc.IsBlockEmpty(i, nStartCol+1, nStartRow, nEndCol, 
nEndRow))
+                bAskDialog = true;
+        }
+        else
+            if (!rDoc.IsBlockEmpty(i, nStartCol, nStartRow+1, nStartCol, 
nEndRow) ||
+                !rDoc.IsBlockEmpty(i, nStartCol+1, nStartRow, nEndCol, 
nEndRow))
+                bAskDialog = true;
     }
 
     bool bOk = true;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to