summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Balland-Poirier <laurent.balland-poirier@laposte.net>2016-07-20 20:27:23 +0200
committerEike Rathke <erack@redhat.com>2016-07-22 11:57:55 +0000
commit0baeea95f38a5cdb19936290c69d33541274ad41 (patch)
tree409c7fe9b21a090475441f7b0ae1f8f748220fb1
parentc4feea24c28b38c81205accbb7ae24a61f0b94e0 (diff)
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 <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/source/ui/view/viewfun2.cxx12
1 files 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;