summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/tabview3.cxx
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2019-06-17 20:13:36 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2019-11-07 14:15:29 +0100
commite9131e7abde6ec8e9fc19ebace193c6a25bd607e (patch)
treef226644218eabdee1ad5eeb24adc7cef00cef02a /sc/source/ui/view/tabview3.cxx
parent72fad7a18d9967d35a68ee9f64f469f438a68882 (diff)
Show highlight ranges when chart is selected
Change-Id: Ibb9a085699065869a7f122f37a36c5873b934271 Reviewed-on: https://gerrit.libreoffice.org/82138 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/82140 Tested-by: Jenkins
Diffstat (limited to 'sc/source/ui/view/tabview3.cxx')
-rw-r--r--sc/source/ui/view/tabview3.cxx38
1 files changed, 35 insertions, 3 deletions
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)