[Libreoffice-commits] core.git: sc/source
Dennis Francis
dennisfrancis.in at gmail.com
Mon Dec 14 14:10:56 PST 2015
sc/source/core/data/document.cxx | 24 +++++++++++++++++++++++-
sc/source/ui/view/viewfunc.cxx | 11 +----------
2 files changed, 24 insertions(+), 11 deletions(-)
New commits:
commit e0d2acfa65d81da323cbe91e6451fca70e00bdd5
Author: Dennis Francis <dennisfrancis.in at gmail.com>
Date: Sat Dec 12 23:51:40 2015 +0530
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 at redhat.com>
Tested-by: Eike Rathke <erack at redhat.com>
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 8cb6bdb..9057fa9 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 cb140c8..57b9c3e 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 =
More information about the Libreoffice-commits
mailing list