From ba0100be03c6bbc5ae10201bae340b3f7b7c4500 Mon Sep 17 00:00:00 2001 From: Heiko Tietze Date: Tue, 18 Jan 2022 12:20:57 +0100 Subject: Resolves tdf#128258 - Draw a dotted line before hidden columns/rows Color and on/off configurable via Tools > Options > Application Colors Change-Id: Ia4b1e1c86f36d1b0f508a5b3e866a79418f16c5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128553 Tested-by: Jenkins Reviewed-by: Heiko Tietze --- sc/source/ui/inc/gridwin.hxx | 1 + sc/source/ui/view/gridwin4.cxx | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) (limited to 'sc') diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index 183705db2326..e1ab39eb2446 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -274,6 +274,7 @@ class SAL_DLLPUBLIC_RTTI ScGridWindow : public vcl::Window, public DropTargetHel void DrawAfterScroll(); tools::Rectangle GetListValButtonRect( const ScAddress& rButtonPos ); + void DrawHiddenIndicator( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, vcl::RenderContext& rRenderContext); void DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, vcl::RenderContext& rRenderContext); bool GetEditUrl( const Point& rPos, diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 8c9e4e01507c..1dc1bab5e5f7 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -43,6 +43,8 @@ #include #include #include +#include +#include #include #include @@ -851,6 +853,9 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI pContentDev->SetMapMode(MapMode(MapUnit::MapPixel)); + //tdf#128258 - draw a dotted line before hidden columns/rows + DrawHiddenIndicator(nX1,nY1,nX2,nY2, *pContentDev); + if ( bPageMode ) { // DrawPagePreview draws complete lines/page numbers, must always be clipped @@ -1691,6 +1696,39 @@ void ScGridWindow::CheckNeedsRepaint() rBindings.Invalidate( SID_TABLE_CELL ); } +void ScGridWindow::DrawHiddenIndicator( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, vcl::RenderContext& rRenderContext) +{ + ScDocument& rDoc = mrViewData.GetDocument(); + SCTAB nTab = mrViewData.GetTabNo(); + const svtools::ColorConfig& rColorCfg = SC_MOD()->GetColorConfig(); + const svtools::ColorConfigValue aColorValue = rColorCfg.GetColorValue(svtools::CALCHIDDENROWCOL); + if (aColorValue.bIsVisible) { + rRenderContext.SetLineColor(aColorValue.nColor); + LineInfo aLineInfo(LineStyle::Dash, 2); + aLineInfo.SetDashCount(0); + aLineInfo.SetDotCount(1); + aLineInfo.SetDistance(15); + //round caps except when running VCL_PLUGIN=gen + if (mrViewData.GetActiveWin()->GetSystemData()->toolkit != SystemEnvData::Toolkit::Gen) + aLineInfo.SetLineCap(css::drawing::LineCap_ROUND); + aLineInfo.SetDotLen(1); + for (int i=nX1; iGetPageBreakData(); -- cgit