diff options
author | Heiko Tietze <tietze.heiko@gmail.com> | 2022-01-18 12:20:57 +0100 |
---|---|---|
committer | Heiko Tietze <heiko.tietze@documentfoundation.org> | 2022-01-27 10:31:52 +0100 |
commit | ba0100be03c6bbc5ae10201bae340b3f7b7c4500 (patch) | |
tree | 84209c09485985c7a2639ad734a6ab099e256941 /sc | |
parent | 2f4f4cbeb8e50081d607b86b0475b93971c40ab8 (diff) |
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 <heiko.tietze@documentfoundation.org>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/inc/gridwin.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 38 |
2 files changed, 39 insertions, 0 deletions
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 <svx/sdr/contact/viewobjectcontact.hxx> #include <svx/sdr/contact/viewcontact.hxx> #include <tabvwsh.hxx> +#include <vcl/lineinfo.hxx> +#include <vcl/sysdata.hxx> #include <gridwin.hxx> #include <viewdata.hxx> @@ -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; i<nX2; i++) { + if (rDoc.ColHidden(i,nTab) && (i<MAXCOL ? !rDoc.ColHidden(i+1,nTab) : true)) { + Point aStart = mrViewData.GetScrPos(i, nY1, eWhich, true ); + Point aEnd = mrViewData.GetScrPos(i, nY2, eWhich, true ); + rRenderContext.DrawLine(aStart,aEnd,aLineInfo); + } + } + for (int i=nY1; i<nY2; i++) { + if (rDoc.RowHidden(i,nTab) && (i<MAXROW ? !rDoc.RowHidden(i+1,nTab) : true)) { + Point aStart = mrViewData.GetScrPos(nX1, i, eWhich, true ); + Point aEnd = mrViewData.GetScrPos(nX2, i, eWhich, true ); + rRenderContext.DrawLine(aStart,aEnd,aLineInfo); + } + } + } //visible +} + void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, vcl::RenderContext& rRenderContext) { ScPageBreakData* pPageData = mrViewData.GetView()->GetPageBreakData(); |