summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/gridwin4.cxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-02-18 18:44:49 +0600
committerMike Kaganski <mike.kaganski@collabora.com>2024-02-18 15:24:08 +0100
commit731c731190239780dbace32372daf2477101970a (patch)
treeaa86441346f2db33b68ddd071b2a85fdf4f4fa69 /sc/source/ui/view/gridwin4.cxx
parent63efbc8ad8aae12b54e649c1495d1233c1a9b33f (diff)
Simplify a bit
Change-Id: Ic48cb53f441b1505103d9bbdec67953528fd2525 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163552 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc/source/ui/view/gridwin4.cxx')
-rw-r--r--sc/source/ui/view/gridwin4.cxx14
1 files changed, 6 insertions, 8 deletions
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 55793ff1eb80..625a340747be 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -936,9 +936,8 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
{
// Tiled offset nScrX, nScrY
MapMode aMap( MapUnit::MapPixel );
- Point aOrigin = aOriginalMode.GetOrigin();
- aOrigin.setX(o3tl::convert(aOrigin.getX(), o3tl::Length::twip, o3tl::Length::px) + nScrX);
- aOrigin.setY(o3tl::convert(aOrigin.getY(), o3tl::Length::twip, o3tl::Length::px) + nScrY);
+ Point aOrigin(o3tl::convert(aOriginalMode.GetOrigin(), o3tl::Length::twip, o3tl::Length::px));
+ aOrigin.Move(nScrX, nScrY);
aMap.SetOrigin(aOrigin);
pContentDev->SetMapMode(aMap);
}
@@ -983,11 +982,10 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
const MapMode aOrig = pContentDev->GetMapMode();
if (bIsTiledRendering)
{
- Point aOrigin = aOriginalMode.GetOrigin();
- tools::Long nXOffset = bLayoutRTL ?
- (-o3tl::convert(aOrigin.getX(), o3tl::Length::twip, o3tl::Length::px) + aOutputData.GetScrW()) :
- o3tl::convert(aOrigin.getX(), o3tl::Length::twip, o3tl::Length::px);
- Size aPixelOffset(nXOffset, o3tl::convert(aOrigin.getY(), o3tl::Length::twip, o3tl::Length::px));
+ Point aOrigin(o3tl::convert(aOriginalMode.GetOrigin(), o3tl::Length::twip, o3tl::Length::px));
+ tools::Long nXOffset = bLayoutRTL ? -aOrigin.getX() + aOutputData.GetScrW()
+ : aOrigin.getX();
+ Size aPixelOffset(nXOffset, aOrigin.getY());
pContentDev->SetPixelOffset(aPixelOffset);
comphelper::LibreOfficeKit::setLocalRendering();
}