summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Balland-Poirier <laurent.balland-poirier@laposte.net>2016-07-20 20:27:23 +0200
committerAndras Timar <andras.timar@collabora.com>2017-03-01 16:12:22 +0100
commit38903acb970cf5d6ef10b47b65f996dd266d6d72 (patch)
tree3f2a4383dfabc1fa32c710e2a2e62fc7da951c0f
parent0759c5973cf7be07789f21204540f62594224b86 (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> (cherry picked from commit 0baeea95f38a5cdb19936290c69d33541274ad41)
-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 273b2904a6c0..3e400987892e 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 bRecord, bool bC
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;