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
This commit is contained in:
@@ -425,9 +425,9 @@ handle_r1c1:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static ReferenceMark lcl_GetReferenceMark( const ScViewData& rViewData, ScDocShell* pDocSh,
|
ReferenceMark ScInputHandler::GetReferenceMark( ScViewData& rViewData, ScDocShell* pDocSh,
|
||||||
long nX1, long nX2, long nY1, long nY2,
|
long nX1, long nX2, long nY1, long nY2,
|
||||||
long nTab, const Color& rColor )
|
long nTab, const Color& rColor )
|
||||||
{
|
{
|
||||||
ScSplitPos eWhich = rViewData.GetActivePart();
|
ScSplitPos eWhich = rViewData.GetActivePart();
|
||||||
|
|
||||||
@@ -486,7 +486,7 @@ void ScInputHandler::UpdateLokReferenceMarks()
|
|||||||
PutInOrder(nX1, nX2);
|
PutInOrder(nX1, nX2);
|
||||||
PutInOrder(nY1, nY2);
|
PutInOrder(nY1, nY2);
|
||||||
|
|
||||||
aReferenceMarks[0] = lcl_GetReferenceMark( rViewData, pDocSh,
|
aReferenceMarks[0] = ScInputHandler::GetReferenceMark( rViewData, pDocSh,
|
||||||
nX1, nX2, nY1, nY2,
|
nX1, nX2, nY1, nY2,
|
||||||
nTab, aRefColor );
|
nTab, aRefColor );
|
||||||
}
|
}
|
||||||
@@ -510,8 +510,9 @@ void ScInputHandler::UpdateLokReferenceMarks()
|
|||||||
long nY2 = aRef.aEnd.Row();
|
long nY2 = aRef.aEnd.Row();
|
||||||
long nTab = aRef.aStart.Tab();
|
long nTab = aRef.aStart.Tab();
|
||||||
|
|
||||||
aReferenceMarks[i + nAdditionalMarks] = lcl_GetReferenceMark(
|
aReferenceMarks[i + nAdditionalMarks] = ScInputHandler::GetReferenceMark( rViewData, pDocSh,
|
||||||
rViewData, pDocSh, nX1, nX2, nY1, nY2, nTab, rData.nColor );
|
nX1, nX2, nY1, nY2,
|
||||||
|
nTab, rData.nColor );
|
||||||
|
|
||||||
ScInputHandler::SendReferenceMarks( pActiveViewSh, aReferenceMarks );
|
ScInputHandler::SendReferenceMarks( pActiveViewSh, aReferenceMarks );
|
||||||
}
|
}
|
||||||
|
@@ -30,6 +30,7 @@
|
|||||||
#include <tools/link.hxx>
|
#include <tools/link.hxx>
|
||||||
#include <vcl/vclptr.hxx>
|
#include <vcl/vclptr.hxx>
|
||||||
#include <editeng/svxenum.hxx>
|
#include <editeng/svxenum.hxx>
|
||||||
|
#include "viewdata.hxx"
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@@ -282,6 +283,10 @@ public:
|
|||||||
void SetDocumentDisposing( bool b );
|
void SetDocumentDisposing( bool b );
|
||||||
|
|
||||||
static void SetAutoComplete(bool bSet) { bAutoComplete = bSet; }
|
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
|
// ScInputHdlState
|
||||||
|
@@ -366,7 +366,7 @@ public:
|
|||||||
void FindChanged();
|
void FindChanged();
|
||||||
void SetPagebreakMode( ScPageBreakData* pPageData );
|
void SetPagebreakMode( ScPageBreakData* pPageData );
|
||||||
/// Draws reference mark and returns its properties
|
/// Draws reference mark and returns its properties
|
||||||
ReferenceMark DrawRefMark( SCCOL nRefStartX, SCROW nRefStartY,
|
void DrawRefMark( SCCOL nRefStartX, SCROW nRefStartY,
|
||||||
SCCOL nRefEndX, SCROW nRefEndY,
|
SCCOL nRefEndX, SCROW nRefEndY,
|
||||||
const Color& rColor, bool bHandle );
|
const Color& rColor, bool bHandle );
|
||||||
ReferenceMark FillReferenceMark( SCCOL nRefStartX, SCROW nRefStartY,
|
ReferenceMark FillReferenceMark( SCCOL nRefStartX, SCROW nRefStartY,
|
||||||
|
@@ -1970,12 +1970,10 @@ ReferenceMark ScOutputData::FillReferenceMark( SCCOL nRefStartX, SCROW nRefStart
|
|||||||
return aResult;
|
return aResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReferenceMark ScOutputData::DrawRefMark( SCCOL nRefStartX, SCROW nRefStartY,
|
void ScOutputData::DrawRefMark( SCCOL nRefStartX, SCROW nRefStartY,
|
||||||
SCCOL nRefEndX, SCROW nRefEndY,
|
SCCOL nRefEndX, SCROW nRefEndY,
|
||||||
const Color& rColor, bool bHandle )
|
const Color& rColor, bool bHandle )
|
||||||
{
|
{
|
||||||
ReferenceMark aResult;
|
|
||||||
|
|
||||||
PutInOrder( nRefStartX, nRefEndX );
|
PutInOrder( nRefStartX, nRefEndX );
|
||||||
PutInOrder( nRefStartY, nRefEndY );
|
PutInOrder( nRefStartY, nRefEndY );
|
||||||
|
|
||||||
@@ -2098,8 +2096,6 @@ ReferenceMark ScOutputData::DrawRefMark( SCCOL nRefStartX, SCROW nRefStartY,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return aResult;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScOutputData::DrawOneChange( SCCOL nRefStartX, SCROW nRefStartY,
|
void ScOutputData::DrawOneChange( SCCOL nRefStartX, SCROW nRefStartY,
|
||||||
|
@@ -62,6 +62,7 @@
|
|||||||
#include <formula/FormulaCompiler.hxx>
|
#include <formula/FormulaCompiler.hxx>
|
||||||
#include <comphelper/lok.hxx>
|
#include <comphelper/lok.hxx>
|
||||||
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
|
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
|
||||||
|
#include <output.hxx>
|
||||||
|
|
||||||
#include <com/sun/star/chart2/data/HighlightedRange.hpp>
|
#include <com/sun/star/chart2/data/HighlightedRange.hpp>
|
||||||
|
|
||||||
@@ -2531,6 +2532,9 @@ void ScTabView::DoChartSelection(
|
|||||||
{
|
{
|
||||||
ClearHighlightRanges();
|
ClearHighlightRanges();
|
||||||
const sal_Unicode sep = ::formula::FormulaCompiler::GetNativeSymbolChar(ocSep);
|
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)
|
for (chart2::data::HighlightedRange const & rHighlightedRange : rHilightRanges)
|
||||||
{
|
{
|
||||||
@@ -2541,16 +2545,44 @@ void ScTabView::DoChartSelection(
|
|||||||
aRangeList, rHighlightedRange.RangeRepresentation, &rDoc, rDoc.GetAddressConvention(), sep ))
|
aRangeList, rHighlightedRange.RangeRepresentation, &rDoc, rDoc.GetAddressConvention(), sep ))
|
||||||
{
|
{
|
||||||
size_t nListSize = aRangeList.size();
|
size_t nListSize = aRangeList.size();
|
||||||
|
nSize += nListSize;
|
||||||
|
aReferenceMarks.resize(nSize);
|
||||||
|
|
||||||
for ( size_t j = 0; j < nListSize; ++j )
|
for ( size_t j = 0; j < nListSize; ++j )
|
||||||
{
|
{
|
||||||
ScRange const & r = aRangeList[j];
|
ScRange& p = aRangeList[j];
|
||||||
|
ScRange aTargetRange;
|
||||||
if( rHighlightedRange.Index == - 1 )
|
if( rHighlightedRange.Index == - 1 )
|
||||||
AddHighlightRange( r, aSelColor );
|
{
|
||||||
|
aTargetRange = p;
|
||||||
|
AddHighlightRange( aTargetRange, aSelColor );
|
||||||
|
}
|
||||||
else
|
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)
|
void ScTabView::DoDPFieldPopup(OUString const & rPivotTableName, sal_Int32 nDimensionIndex, Point aPoint, Size aSize)
|
||||||
|
Reference in New Issue
Block a user