Index: inc/pagepreviewlayout.hxx =================================================================== RCS file: /cvs/sw/sw/inc/pagepreviewlayout.hxx,v retrieving revision 1.9 diff -w -u -r1.9 pagepreviewlayout.hxx --- inc/pagepreviewlayout.hxx 14 Aug 2006 15:28:53 -0000 1.9 +++ inc/pagepreviewlayout.hxx 10 Sep 2007 10:27:22 -0000 @@ -56,6 +56,11 @@ // the print preview document. bool mbPaintInfoValid; + // --> OD 2007-09-10 #i80209# - patch by ayaniger + // boolean indication, if the layout direction is right-to-left + bool mbRTL; + // <-- + Size maWinSize; sal_uInt16 mnCols; sal_uInt16 mnRows; @@ -468,7 +473,7 @@ @return boolean - indicating, that move was sucessful. */ - bool CalcStartValuesForSelectedPageMove( const sal_Int16 _nHoriMove, + bool CalcStartValuesForSelectedPageMove( sal_Int16 _nHoriMove, const sal_Int16 _nVertMove, sal_uInt16& _orNewSelectedPage, sal_uInt16& _orNewStartPage, Index: source/core/view/pagepreviewlayout.cxx =================================================================== RCS file: /cvs/sw/sw/source/core/view/pagepreviewlayout.cxx,v retrieving revision 1.11 diff -w -u -r1.11 pagepreviewlayout.cxx --- source/core/view/pagepreviewlayout.cxx 16 Sep 2006 22:02:05 -0000 1.11 +++ source/core/view/pagepreviewlayout.cxx 10 Sep 2007 10:27:22 -0000 @@ -83,6 +83,12 @@ #include +// --> OD 2007-09-10 #i80209# - patch by ayaniger +#ifndef _SVX_FRMDIRITEM_HXX +#include +#endif +#include "frmfmt.hxx" + // OD 20.02.2003 #107369# - method to update statics for paint // Note: method defined in '/sw/source/core/layout/paintfrm.cxx' extern void SwCalcPixStatics( OutputDevice *pOut ); @@ -105,6 +111,16 @@ const SwPrintData* pPrintData = mrParentViewShell.getIDocumentDeviceAccess()->getPrintData(); mbPrintEmptyPages = pPrintData ? pPrintData->IsPrintEmptyPages() : true; + + // --> OD 2007-09-10 #i80209# - patch by ayaniger + // Reverse column order for RTL + // Layout direction determined by layout direction of the first page. + { + const SwPageFrm* pPage = dynamic_cast(mrLayoutRootFrm.Lower()); + const UINT16 nDir = ((SvxFrameDirectionItem&)pPage->GetFmt()->GetAttr( RES_FRAMEDIR )).GetValue(); + mbRTL = (nDir == FRMDIR_HORI_RIGHT_TOP); + } + // <-- } void SwPagePreviewLayout::_Clear() @@ -637,6 +653,12 @@ sal_uInt16 nCurrCol = mnPaintStartCol; sal_uInt16 nConsideredRows = 0; Point aCurrPaintOffset = aInitialPaintOffset; + // --> OD 2007-09-10 #i80209# - patch by ayaniger + if ( mbRTL ) + { + aCurrPaintOffset.X() += (mnCols - 1) * mnColWidth; + } + // <-- // loop on pages to determine preview background retangles while ( pPage && (!mbDoesLayoutRowsFitIntoWindow || nConsideredRows < mnRows) && @@ -666,7 +688,14 @@ ++nCurrCol; continue; } - if ( aCurrPaintOffset.X() < maWinSize.Width() ) + + // --> OD 2007-09-10 #i80209# - patch by ayaniger +// if ( aCurrPaintOffset.X() < maWinSize.Width() ) + const bool bInside = mbRTL + ? aCurrPaintOffset.X() >= aInitialPaintOffset.X() + : aCurrPaintOffset.X() < maWinSize.Width(); + if ( bInside ) + // <-- { // OD 19.02.2003 #107369# - leaving left-top-corner blank is // controlled by . @@ -675,7 +704,13 @@ { // first page in 2nd column // --> continue with increased paint offset and next column + // --> OD 2007-09-10 #i80209# - patch by ayaniger +// aCurrPaintOffset.X() += mnColWidth; + if ( mbRTL ) + aCurrPaintOffset.X() -= mnColWidth; + else aCurrPaintOffset.X() += mnColWidth; + // <-- ++nCurrCol; continue; } @@ -698,12 +733,23 @@ // prepare data for next loop pPage = static_cast(pPage->GetNext()); + // --> OD 2007-09-10 #i80209# - patch by ayaniger +// aCurrPaintOffset.X() += mnColWidth; + if ( mbRTL ) + aCurrPaintOffset.X() -= mnColWidth; + else aCurrPaintOffset.X() += mnColWidth; + // <-- ++nCurrCol; if ( nCurrCol > mnCols ) { ++nConsideredRows; aCurrPaintOffset.X() = aInitialPaintOffset.X(); + if ( mbRTL ) + { + aCurrPaintOffset.X() += (mnCols - 1) * mnColWidth; + } + // <-- nCurrCol = 1; aCurrPaintOffset.Y() += mnRowHeight; } @@ -879,12 +925,16 @@ @author OD, IN/OUT parameters are absolute page numbers!!! */ bool SwPagePreviewLayout::CalcStartValuesForSelectedPageMove( - const sal_Int16 _nHoriMove, + sal_Int16 _nHoriMove, const sal_Int16 _nVertMove, sal_uInt16& _orNewSelectedPage, sal_uInt16& _orNewStartPage, Point& _orNewStartPos ) const { + // --> OD 2007-09-10 #i80209# - patch by ayaniger + if ( mbRTL ) + _nHoriMove = -_nHoriMove; + // <-- // determine position of current selected page sal_uInt16 nTmpRelSelPageNum = ConvertAbsoluteToRelativePageNum( mnSelectedPageNum ); sal_uInt16 nNewRelSelectedPageNum = nTmpRelSelPageNum;