diff options
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/app/inputhdl.cxx | 13 | ||||
-rw-r--r-- | sc/source/ui/inc/inputhdl.hxx | 5 | ||||
-rw-r--r-- | sc/source/ui/inc/output.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/output.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/view/tabview3.cxx | 38 |
5 files changed, 49 insertions, 15 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 82542d243623..7556ef49d1ac 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -425,9 +425,9 @@ handle_r1c1: } } -static ReferenceMark lcl_GetReferenceMark( const ScViewData& rViewData, ScDocShell* pDocSh, - long nX1, long nX2, long nY1, long nY2, - long nTab, const Color& rColor ) +ReferenceMark ScInputHandler::GetReferenceMark( ScViewData& rViewData, ScDocShell* pDocSh, + long nX1, long nX2, long nY1, long nY2, + long nTab, const Color& rColor ) { ScSplitPos eWhich = rViewData.GetActivePart(); @@ -486,7 +486,7 @@ void ScInputHandler::UpdateLokReferenceMarks() PutInOrder(nX1, nX2); PutInOrder(nY1, nY2); - aReferenceMarks[0] = lcl_GetReferenceMark( rViewData, pDocSh, + aReferenceMarks[0] = ScInputHandler::GetReferenceMark( rViewData, pDocSh, nX1, nX2, nY1, nY2, nTab, aRefColor ); } @@ -510,8 +510,9 @@ void ScInputHandler::UpdateLokReferenceMarks() long nY2 = aRef.aEnd.Row(); long nTab = aRef.aStart.Tab(); - aReferenceMarks[i + nAdditionalMarks] = lcl_GetReferenceMark( - rViewData, pDocSh, nX1, nX2, nY1, nY2, nTab, rData.nColor ); + aReferenceMarks[i + nAdditionalMarks] = ScInputHandler::GetReferenceMark( rViewData, pDocSh, + nX1, nX2, nY1, nY2, + nTab, rData.nColor ); ScInputHandler::SendReferenceMarks( pActiveViewSh, aReferenceMarks ); } diff --git a/sc/source/ui/inc/inputhdl.hxx b/sc/source/ui/inc/inputhdl.hxx index ecb394b5f809..ff60dcdbb4c3 100644 --- a/sc/source/ui/inc/inputhdl.hxx +++ b/sc/source/ui/inc/inputhdl.hxx @@ -30,6 +30,7 @@ #include <tools/link.hxx> #include <vcl/vclptr.hxx> #include <editeng/svxenum.hxx> +#include "viewdata.hxx" #include <set> #include <memory> @@ -282,6 +283,10 @@ public: void SetDocumentDisposing( bool b ); static void SetAutoComplete(bool bSet) { bAutoComplete = bSet; } + + static ReferenceMark GetReferenceMark( ScViewData& rViewData, ScDocShell* pDocSh, + long nX1, long nX2, long nY1, long nY2, + long nTab, const Color& rColor ); }; // ScInputHdlState diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx index 68b138c627de..fbdd991962cc 100644 --- a/sc/source/ui/inc/output.hxx +++ b/sc/source/ui/inc/output.hxx @@ -366,7 +366,7 @@ public: void FindChanged(); void SetPagebreakMode( ScPageBreakData* pPageData ); /// Draws reference mark and returns its properties - ReferenceMark DrawRefMark( SCCOL nRefStartX, SCROW nRefStartY, + void DrawRefMark( SCCOL nRefStartX, SCROW nRefStartY, SCCOL nRefEndX, SCROW nRefEndY, const Color& rColor, bool bHandle ); ReferenceMark FillReferenceMark( SCCOL nRefStartX, SCROW nRefStartY, diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 53c510eaa707..e14647bd7954 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -1970,12 +1970,10 @@ ReferenceMark ScOutputData::FillReferenceMark( SCCOL nRefStartX, SCROW nRefStart return aResult; } -ReferenceMark ScOutputData::DrawRefMark( SCCOL nRefStartX, SCROW nRefStartY, +void ScOutputData::DrawRefMark( SCCOL nRefStartX, SCROW nRefStartY, SCCOL nRefEndX, SCROW nRefEndY, const Color& rColor, bool bHandle ) { - ReferenceMark aResult; - PutInOrder( nRefStartX, nRefEndX ); PutInOrder( nRefStartY, nRefEndY ); @@ -2098,8 +2096,6 @@ ReferenceMark ScOutputData::DrawRefMark( SCCOL nRefStartX, SCROW nRefStartY, } } } - - return aResult; } void ScOutputData::DrawOneChange( SCCOL nRefStartX, SCROW nRefStartY, diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index 8c3fbf80d7ec..dbe93c9e9f18 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -62,6 +62,7 @@ #include <formula/FormulaCompiler.hxx> #include <comphelper/lok.hxx> #include <LibreOfficeKit/LibreOfficeKitEnums.h> +#include <output.hxx> #include <com/sun/star/chart2/data/HighlightedRange.hpp> @@ -2531,6 +2532,9 @@ void ScTabView::DoChartSelection( { ClearHighlightRanges(); const sal_Unicode sep = ::formula::FormulaCompiler::GetNativeSymbolChar(ocSep); + size_t nSize = 0; + size_t nIndex = 0; + std::vector<ReferenceMark> aReferenceMarks( nSize ); for (chart2::data::HighlightedRange const & rHighlightedRange : rHilightRanges) { @@ -2541,16 +2545,44 @@ void ScTabView::DoChartSelection( aRangeList, rHighlightedRange.RangeRepresentation, &rDoc, rDoc.GetAddressConvention(), sep )) { size_t nListSize = aRangeList.size(); + nSize += nListSize; + aReferenceMarks.resize(nSize); + for ( size_t j = 0; j < nListSize; ++j ) { - ScRange const & r = aRangeList[j]; + ScRange& p = aRangeList[j]; + ScRange aTargetRange; if( rHighlightedRange.Index == - 1 ) - AddHighlightRange( r, aSelColor ); + { + aTargetRange = p; + AddHighlightRange( aTargetRange, aSelColor ); + } else - AddHighlightRange( lcl_getSubRangeByIndex( r, rHighlightedRange.Index ), aSelColor ); + { + aTargetRange = lcl_getSubRangeByIndex( p, rHighlightedRange.Index ); + AddHighlightRange( aTargetRange, aSelColor ); + } + + if ( comphelper::LibreOfficeKit::isActive() && aViewData.GetViewShell() ) + { + aTargetRange.PutInOrder(); + + long nX1 = aTargetRange.aStart.Col(); + long nX2 = aTargetRange.aEnd.Col(); + long nY1 = aTargetRange.aStart.Row(); + long nY2 = aTargetRange.aEnd.Row(); + long nTab = aTargetRange.aStart.Tab(); + + aReferenceMarks[nIndex++] = ScInputHandler::GetReferenceMark( aViewData, aViewData.GetDocShell(), + nX1, nX2, nY1, nY2, + nTab, aSelColor ); + } } } } + + if ( comphelper::LibreOfficeKit::isActive() && aViewData.GetViewShell() ) + ScInputHandler::SendReferenceMarks( aViewData.GetViewShell(), aReferenceMarks ); } void ScTabView::DoDPFieldPopup(OUString const & rPivotTableName, sal_Int32 nDimensionIndex, Point aPoint, Size aSize) |