diff options
-rw-r--r-- | sc/source/ui/view/viewfun2.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index 76d600a14828..ee8f6f7e854a 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -1011,8 +1011,11 @@ bool ScViewFunc::TestMergeCells() // pre-test (for menu) const ScMarkData& rMark = GetViewData().GetMarkData(); if ( rMark.IsMarked() || rMark.IsMultiMarked() ) { - ScRange aDummy; - return GetViewData().GetSimpleArea( aDummy) == SC_MARK_SIMPLE; + ScRange aRange; + bool bMergable = ( GetViewData().GetSimpleArea( aRange ) == SC_MARK_SIMPLE ); + bMergable = bMergable && ( aRange.aStart.Col() != aRange.aEnd.Col() || + aRange.aStart.Row() != aRange.aEnd.Row() ); + return bMergable; } else return false; |