summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/salgdilayout.cxx
diff options
context:
space:
mode:
authorIvan Timofeev <timofeev.i.s@gmail.com>2013-06-28 21:54:15 +0400
committerIvan Timofeev <timofeev.i.s@gmail.com>2013-06-28 22:35:48 +0400
commita08f579e3704fbd97590f9b050d250ae445725a7 (patch)
treef8a7adba4a65eb660273e4d33e4262d183ba61e0 /vcl/source/gdi/salgdilayout.cxx
parente3a801e2454eed2e61202bbacca01fe3fcc20c1d (diff)
fdo#63254: correct re-mirroring formula
This patch fixes horizontal scrollbar in Calc when a sheet is RTL and UI is LTR. When a particular window (horizontal scrollbar in this case) is RTL and a whole UI is LTR this code used for mirroring and re-mirroring back coordinates. AFAICS mirroring is correct, but re-mirroring is not. The used formula comes from commit 69b684b12e42bf1396bdffca88ca880ac3c2e00b, and the same formula appears in the other variant of overloaded function "mirror": mirror(sal_uInt32, const SalPoint*, SalPoint*, const OutputDevice*, bool), but it does not affect the bug. Change-Id: Iec9c53edce9d33be6b676d1094bed8bf92f2e435
Diffstat (limited to 'vcl/source/gdi/salgdilayout.cxx')
-rw-r--r--vcl/source/gdi/salgdilayout.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index 9d5457316f6a..3d34a5f0f066 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -119,7 +119,7 @@ void SalGraphics::mirror( long& x, const OutputDevice *pOutDev, bool bBack ) con
{
long devX = pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX
if( bBack )
- x = x - pOutDevRef->GetOutputWidthPixel() + devX - pOutDevRef->GetOutOffXPixel() + 1;
+ x = devX + (pOutDevRef->GetOutputWidthPixel() + devX) - (x + 1);
else
x = pOutDevRef->GetOutputWidthPixel() - (x - devX) + pOutDevRef->GetOutOffXPixel() - 1;
}
@@ -155,7 +155,7 @@ void SalGraphics::mirror( long& x, long& nWidth, const OutputDevice *pOutDev, bo
{
long devX = pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX
if( bBack )
- x = x - pOutDevRef->GetOutputWidthPixel() + devX - pOutDevRef->GetOutOffXPixel() + nWidth;
+ x = devX + (pOutDevRef->GetOutputWidthPixel() + devX) - (x + nWidth);
else
x = pOutDevRef->GetOutputWidthPixel() - (x - devX) + pOutDevRef->GetOutOffXPixel() - nWidth;
}