diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2022-02-06 18:30:39 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2022-02-06 13:00:14 +0100 |
commit | d0a11f591a57754362bb86c4bb07869bc18e5f75 (patch) | |
tree | 34454ab6f96aa117c6a7909b783a144a08767390 /sc | |
parent | 67cf91ec83a5933b07a87bdeb6ddeb6e1f781dea (diff) |
sc: fix rendering of conditional formatting icon
The bWorksInPixels flag isn't needed as it means some rendering
information is in pixel instead of logic, but we render in logic,
not in pixels as it is falsely assumed. So don't take into account
the bWorksInPixels flag and just render in pixels when LOKit is
active.
Change-Id: I3703d459a2d1444c397f2d9e97af9f0d3010d544
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129546
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/output.cxx | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index bd630f531ed6..2f9674a1edae 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -908,7 +908,7 @@ const BitmapEx& getIcon(sc::IconSetBitmapMap & rIconSetBitmapMap, ScIconSetType } void drawIconSets(vcl::RenderContext& rRenderContext, const ScIconSetInfo* pOldIconSetInfo, const tools::Rectangle& rRect, tools::Long nOneX, tools::Long nOneY, - sc::IconSetBitmapMap & rIconSetBitmapMap, bool bWorksInPixels) + sc::IconSetBitmapMap & rIconSetBitmapMap) { ScIconSetType eType = pOldIconSetInfo->eIconSetType; sal_Int32 nIndex = pOldIconSetInfo->nIconIndex; @@ -918,16 +918,15 @@ void drawIconSets(vcl::RenderContext& rRenderContext, const ScIconSetInfo* pOldI if (pOldIconSetInfo->mnHeight) { - if (bWorksInPixels) + if (comphelper::LibreOfficeKit::isActive()) { aHeight = rRenderContext.LogicToPixel(Size(0, pOldIconSetInfo->mnHeight), MapMode(MapUnit::MapTwip)).Height(); - if (comphelper::LibreOfficeKit::isActive()) - { - aHeight *= comphelper::LibreOfficeKit::getDPIScale(); - } + aHeight *= comphelper::LibreOfficeKit::getDPIScale(); } else + { aHeight = o3tl::convert(pOldIconSetInfo->mnHeight, o3tl::Length::twip, o3tl::Length::mm100); + } } Size aSize = rIcon.GetSizePixel(); @@ -943,7 +942,7 @@ void drawIconSets(vcl::RenderContext& rRenderContext, const ScIconSetInfo* pOldI void drawCells(vcl::RenderContext& rRenderContext, std::optional<Color> const & pColor, const SvxBrushItem* pBackground, std::optional<Color>& pOldColor, const SvxBrushItem*& pOldBackground, tools::Rectangle& rRect, tools::Long nPosX, tools::Long nLayoutSign, tools::Long nOneX, tools::Long nOneY, const ScDataBarInfo* pDataBarInfo, const ScDataBarInfo*& pOldDataBarInfo, const ScIconSetInfo* pIconSetInfo, const ScIconSetInfo*& pOldIconSetInfo, - sc::IconSetBitmapMap & rIconSetBitmapMap, bool bWorksInPixels) + sc::IconSetBitmapMap & rIconSetBitmapMap) { tools::Long nSignedOneX = nOneX * nLayoutSign; // need to paint if old color scale has been used and now @@ -960,7 +959,7 @@ void drawCells(vcl::RenderContext& rRenderContext, std::optional<Color> const & if( pOldDataBarInfo ) drawDataBars(rRenderContext, pOldDataBarInfo, rRect, nOneX, nOneY); if( pOldIconSetInfo ) - drawIconSets(rRenderContext, pOldIconSetInfo, rRect, nOneX, nOneY, rIconSetBitmapMap, bWorksInPixels); + drawIconSets(rRenderContext, pOldIconSetInfo, rRect, nOneX, nOneY, rIconSetBitmapMap); rRect.SetLeft( nPosX - nSignedOneX ); } @@ -980,7 +979,7 @@ void drawCells(vcl::RenderContext& rRenderContext, std::optional<Color> const & if( pOldDataBarInfo ) drawDataBars(rRenderContext, pOldDataBarInfo, rRect, nOneX, nOneY); if( pOldIconSetInfo ) - drawIconSets(rRenderContext, pOldIconSetInfo, rRect, nOneX, nOneY, rIconSetBitmapMap, bWorksInPixels); + drawIconSets(rRenderContext, pOldIconSetInfo, rRect, nOneX, nOneY, rIconSetBitmapMap); rRect.SetLeft( nPosX - nSignedOneX ); } @@ -1143,7 +1142,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext) if (bWorksInPixels) nPosXLogic = rRenderContext.PixelToLogic(Point(nPosX, 0)).X(); - drawCells(rRenderContext, pColor, pBackground, pOldColor, pOldBackground, aRect, nPosXLogic, nLayoutSign, nOneXLogic, nOneYLogic, pDataBarInfo, pOldDataBarInfo, pIconSetInfo, pOldIconSetInfo, mpDoc->GetIconSetBitmapMap(), bWorksInPixels); + drawCells(rRenderContext, pColor, pBackground, pOldColor, pOldBackground, aRect, nPosXLogic, nLayoutSign, nOneXLogic, nOneYLogic, pDataBarInfo, pOldDataBarInfo, pIconSetInfo, pOldIconSetInfo, mpDoc->GetIconSetBitmapMap()); // extend for all merged cells nMergedCols = 1; @@ -1167,7 +1166,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext) if (bWorksInPixels) nPosXLogic = rRenderContext.PixelToLogic(Point(nPosX, 0)).X(); - drawCells(rRenderContext, std::optional<Color>(), nullptr, pOldColor, pOldBackground, aRect, nPosXLogic, nLayoutSign, nOneXLogic, nOneYLogic, nullptr, pOldDataBarInfo, nullptr, pOldIconSetInfo, mpDoc->GetIconSetBitmapMap(), bWorksInPixels); + drawCells(rRenderContext, std::optional<Color>(), nullptr, pOldColor, pOldBackground, aRect, nPosXLogic, nLayoutSign, nOneXLogic, nOneYLogic, nullptr, pOldDataBarInfo, nullptr, pOldIconSetInfo, mpDoc->GetIconSetBitmapMap()); nArrY += nSkip; } |