From 0baeea95f38a5cdb19936290c69d33541274ad41 Mon Sep 17 00:00:00 2001 From: Laurent Balland-Poirier Date: Wed, 20 Jul 2016 20:27:23 +0200 Subject: 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 Tested-by: Eike Rathke --- sc/source/ui/view/viewfun2.cxx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index 889c7f2fea37..1970e04ad357 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; -- cgit