summaryrefslogtreecommitdiff
path: root/chart2/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-07-13 13:34:17 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-07-14 18:30:04 +0200
commit4ab8dc5628499b47a065ed2ba54cdd4a90ca43a0 (patch)
tree9c7783382bb55254e55e59b24add67cb1c9f4cd8 /chart2/source
parentb6f3129569c22d9d139ca712dcf0db6dc2041565 (diff)
simplify calculations in SeriesHeader::SetPos
Change-Id: I0a3afe10dec530a6d7ddc32cf7d96ec5095604c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154431 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source')
-rw-r--r--chart2/source/controller/dialogs/DataBrowser.cxx15
1 files changed, 5 insertions, 10 deletions
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx
index ab82a772ad02..30182b95eeb8 100644
--- a/chart2/source/controller/dialogs/DataBrowser.cxx
+++ b/chart2/source/controller/dialogs/DataBrowser.cxx
@@ -291,20 +291,15 @@ void SeriesHeader::SetPos()
// series name edit field
m_spSeriesName->set_margin_start(2);
- aSize.setWidth(nSymbolHeight);
- aSize.setHeight(12);
- aSize = m_xDevice->LogicToPixel(aSize, MapMode(MapUnit::MapAppFont));
- aSize.setWidth(m_nWidth - aSize.Width() - 2);
- m_spSeriesName->set_size_request(aSize.Width(), aSize.Height());
+ sal_Int32 nHeightPx = m_xDevice->LogicToPixel(Size(0, 12), MapMode(MapUnit::MapAppFont)).Height();
+ m_spSeriesName->set_size_request(m_nWidth - aSize.Width() - 2, nHeightPx);
// color bar
- aSize.setHeight(3);
- aSize = m_xDevice->LogicToPixel(aSize, MapMode(MapUnit::MapAppFont));
- aSize.setWidth(m_nWidth);
- m_spColorBar->set_size_request(aSize.Width(), aSize.Height());
+ nHeightPx = m_xDevice->LogicToPixel(Size(0, 3), MapMode(MapUnit::MapAppFont)).Height();
+ m_spColorBar->set_size_request(m_nWidth, nHeightPx);
ScopedVclPtr<VirtualDevice> xVirDev(m_spColorBar->create_virtual_device());
- xVirDev->SetOutputSizePixel(aSize);
+ xVirDev->SetOutputSizePixel(Size(m_nWidth, nHeightPx));
xVirDev->SetFillColor(m_aColor);
xVirDev->SetLineColor(m_aColor);
xVirDev->DrawRect(tools::Rectangle(Point(0, 0), aSize));