diff options
author | Dennis Francis <dennisfrancis.in@gmail.com> | 2015-12-12 23:51:40 +0530 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-12-14 22:10:27 +0000 |
commit | e0d2acfa65d81da323cbe91e6451fca70e00bdd5 (patch) | |
tree | 4c55f64ed26da56e81866277085056a85329e49c /sc | |
parent | fd94964ad6611d7f20523272fe6752d38e3aec88 (diff) |
tdf#96447 : Show correct borders in border editor when multimarked
Change-Id: Icfa10e1662f6ac00110a8d301734a72dcacc1780
Reviewed-on: https://gerrit.libreoffice.org/20672
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/document.cxx | 24 | ||||
-rw-r--r-- | sc/source/ui/view/viewfunc.cxx | 11 |
2 files changed, 24 insertions, 11 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 8cb6bdb233b6..9057fa9be505 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -4940,7 +4940,29 @@ void ScDocument::GetSelectionFrame( const ScMarkData& rMark, ScLineFlags aFlags; - if (rMark.IsMarked()) + if( rMark.IsMultiMarked() ) + { + ScRangeList aRangeList; + rMark.FillRangeListWithMarks( &aRangeList, false ); + size_t nRangeCount = aRangeList.size(); + bool bMultipleRows = false, bMultipleCols = false; + for( size_t nRangeIdx = 0; nRangeIdx < nRangeCount; ++nRangeIdx ) + { + const ScRange* pRange = aRangeList[ nRangeIdx ]; + bMultipleRows = ( bMultipleRows || ( pRange->aStart.Row() != pRange->aEnd.Row() ) ); + bMultipleCols = ( bMultipleCols || ( pRange->aStart.Col() != pRange->aEnd.Col() ) ); + SCTAB nMax = static_cast<SCTAB>(maTabs.size()); + ScMarkData::const_iterator itr = rMark.begin(), itrEnd = rMark.end(); + for (; itr != itrEnd && *itr < nMax; ++itr) + if (maTabs[*itr]) + maTabs[*itr]->MergeBlockFrame( &rLineOuter, &rLineInner, aFlags, + pRange->aStart.Col(), pRange->aStart.Row(), + pRange->aEnd.Col(), pRange->aEnd.Row() ); + } + rLineInner.EnableHor( bMultipleRows ); + rLineInner.EnableVer( bMultipleCols ); + } + else if( rMark.IsMarked() ) { ScRange aRange; rMark.GetMarkArea(aRange); diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index cb140c8fca6c..57b9c3e89268 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -841,16 +841,7 @@ void ScViewFunc::GetSelectionFrame( SvxBoxItem& rLineOuter, const ScMarkData& rMark = GetViewData().GetMarkData(); if ( rMark.IsMarked() || rMark.IsMultiMarked() ) - { - if ( rMark.IsMultiMarked() ) - { - ScMarkData aNewMark( rMark ); // use local copy for MarkToSimple - aNewMark.MarkToSimple(); // simple block is needed for GetSelectionFrame - pDoc->GetSelectionFrame( aNewMark, rLineOuter, rLineInner ); - } - else - pDoc->GetSelectionFrame( rMark, rLineOuter, rLineInner ); - } + pDoc->GetSelectionFrame( rMark, rLineOuter, rLineInner ); else { const ScPatternAttr* pAttrs = |