summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFaisal M. Al-Otaibi <fmalotaibi@kacst.edu.sa>2013-05-15 08:51:26 +0300
committerLior Kaplan <kaplanlior@gmail.com>2013-05-22 02:01:51 +0300
commit8adeb170d695ff61af81f31ad5392e5543a12d39 (patch)
treebaaedfd87b32d365bad5051141d6bfd1f1b7f301
parent6aae162ce83f61b11aab3fcd74a8274657bb474f (diff)
fdo#64011 fix the position and the drawing from left to right in RTL sheet
this will fix the start position for drawing and you can draw shapes from left to right when the Sheet are RTL Change-Id: I5cc8eabf474918968bea026dba9c5add2bb4f28e Reviewed-on: https://gerrit.libreoffice.org/3912 Reviewed-by: Ahmad Harthi <aalharthi@kacst.edu.sa> Tested-by: Ahmad Harthi <aalharthi@kacst.edu.sa> (cherry picked from commit 3661c3eb0124d6f4799fe7c4393d4576e1613bfb)
-rw-r--r--sc/source/ui/drawfunc/fuconstr.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/sc/source/ui/drawfunc/fuconstr.cxx b/sc/source/ui/drawfunc/fuconstr.cxx
index c566dfb4dd4e..0eed42835d7c 100644
--- a/sc/source/ui/drawfunc/fuconstr.cxx
+++ b/sc/source/ui/drawfunc/fuconstr.cxx
@@ -83,6 +83,7 @@ Point FuConstruct::CurrentGridSyncOffsetAndPos( Point& rInOutPos )
// involved. Lets calculate where aPos would be at 100% zoom
// that's the actual correct position for the object ( when you
// restore the zoom.
+ sal_Bool bNegative = pDoc->IsNegativePage(pView->GetTab());
Rectangle aObjRect( rInOutPos, rInOutPos );
ScRange aRange = pDoc->GetRange( pView->GetTab(), aObjRect );
ScAddress aOldStt = aRange.aStart;
@@ -98,6 +99,12 @@ Point FuConstruct::CurrentGridSyncOffsetAndPos( Point& rInOutPos )
Point aOff = ( rInOutPos - aCurPosHmm );
rInOutPos = aOldPos + aOff;
aRetGridOff = aCurPosHmm - aOldPos;
+ // fdo#64011 fix the X position when the sheet are RTL
+ if ( bNegative )
+ {
+ aRetGridOff.setX( aCurPosHmm.getX() + aOldPos.getX() );
+ rInOutPos.setX( aOff.getX() - aOldPos.getX() );
+ }
}
return aRetGridOff;
}