diff options
author | Issa Alkurtass <ialkurtass@kacst.edu.sa> | 2012-09-04 13:22:26 +0300 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-09-11 19:02:51 +0000 |
commit | f49db879b7e6362a12450c87352f6ba72823c45e (patch) | |
tree | 684b8b10e56b0d517cce13329bc81e0dd74799cb /sw | |
parent | 6d0906c7fdde82b2c02b1839b9ca93be5e2084a6 (diff) |
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@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/view/pagepreviewlayout.cxx | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx index 22f9fce0db4b..03fd5297a12d 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 ) { |