[Libreoffice-commits] .: sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Sep 11 12:03:10 PDT 2012
sw/source/core/view/pagepreviewlayout.cxx | 29 +++++++++++++++++++++++------
1 file changed, 23 insertions(+), 6 deletions(-)
New commits:
commit f49db879b7e6362a12450c87352f6ba72823c45e
Author: Issa Alkurtass <ialkurtass at kacst.edu.sa>
Date: Tue Sep 4 13:22:26 2012 +0300
fdo#43210 Corrected page preview direction for RTL interface
Change-Id: I412510bc17a29873310689e3141c75d32b261e37
Reviewed-on: https://gerrit.libreoffice.org/557
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx
index 22f9fce..03fd529 100644
--- a/sw/source/core/view/pagepreviewlayout.cxx
+++ b/sw/source/core/view/pagepreviewlayout.cxx
@@ -26,6 +26,8 @@
*
************************************************************************/
+#include "vcl/svapp.hxx"
+
#include <pagepreviewlayout.hxx>
#include <prevwpage.hxx>
@@ -586,10 +588,19 @@ void SwPagePreviewLayout::_CalcPreviewPages()
// calculate initial paint offset
Point aInitialPaintOffset;
- if ( maPaintStartPageOffset != Point( -1, -1 ) )
- aInitialPaintOffset = Point(0,0) - maPaintStartPageOffset;
- else
- aInitialPaintOffset = Point( mnXFree, mnYFree );
+ /// check whether RTL interface or not
+ if(!Application::GetSettings().GetLayoutRTL()){
+ if ( maPaintStartPageOffset != Point( -1, -1 ) )
+ aInitialPaintOffset = Point(0,0) - maPaintStartPageOffset;
+ else
+ aInitialPaintOffset = Point( mnXFree, mnYFree );
+ }
+ else {
+ if ( maPaintStartPageOffset != Point( -1, -1 ) )
+ aInitialPaintOffset = Point(0 + ((SwPagePreviewLayout::mnCols-1)*mnColWidth),0) - maPaintStartPageOffset;
+ else
+ aInitialPaintOffset = Point( mnXFree + ((SwPagePreviewLayout::mnCols-1)*mnColWidth), mnYFree );
+ }
aInitialPaintOffset += maAdditionalPaintOffset;
// prepare loop data
@@ -635,7 +646,10 @@ void SwPagePreviewLayout::_CalcPreviewPages()
{
// first page in 2nd column
// --> continue with increased paint offset and next column
- aCurrPaintOffset.X() += mnColWidth;
+ /// check whether RTL interface or not
+ if(!Application::GetSettings().GetLayoutRTL())
+ aCurrPaintOffset.X() += mnColWidth;
+ else aCurrPaintOffset.X() -= mnColWidth;
++nCurrCol;
continue;
}
@@ -658,7 +672,10 @@ void SwPagePreviewLayout::_CalcPreviewPages()
// prepare data for next loop
pPage = static_cast<const SwPageFrm*>(pPage->GetNext());
- aCurrPaintOffset.X() += mnColWidth;
+ /// check whether RTL interface or not
+ if(!Application::GetSettings().GetLayoutRTL())
+ aCurrPaintOffset.X() += mnColWidth;
+ else aCurrPaintOffset.X() -= mnColWidth;
++nCurrCol;
if ( nCurrCol > mnCols )
{
More information about the Libreoffice-commits
mailing list