View | Details | Raw Unified | Return to issue 80209
Collapse All | Expand All

(-)inc/pagepreviewlayout.hxx (-1 / +6 lines)
Lines 56-61 Link Here
56
    //   the print preview document.
56
    //   the print preview document.
57
    bool        mbPaintInfoValid;
57
    bool        mbPaintInfoValid;
58
58
59
    // --> OD 2007-09-10 #i80209# - patch by ayaniger
60
    // boolean indication, if the layout direction is right-to-left
61
    bool        mbRTL;
62
    // <--
63
59
    Size        maWinSize;
64
    Size        maWinSize;
60
    sal_uInt16  mnCols;
65
    sal_uInt16  mnCols;
61
    sal_uInt16  mnRows;
66
    sal_uInt16  mnRows;
Lines 468-474 Link Here
468
473
469
        @return boolean - indicating, that move was sucessful.
474
        @return boolean - indicating, that move was sucessful.
470
    */
475
    */
471
    bool CalcStartValuesForSelectedPageMove( const sal_Int16  _nHoriMove,
476
    bool CalcStartValuesForSelectedPageMove( sal_Int16  _nHoriMove,
472
                                             const sal_Int16  _nVertMove,
477
                                             const sal_Int16  _nVertMove,
473
                                             sal_uInt16&      _orNewSelectedPage,
478
                                             sal_uInt16&      _orNewSelectedPage,
474
                                             sal_uInt16&      _orNewStartPage,
479
                                             sal_uInt16&      _orNewStartPage,
(-)source/core/view/pagepreviewlayout.cxx (-3 / +54 lines)
Lines 83-88 Link Here
83
83
84
#include <IDocumentDeviceAccess.hxx>
84
#include <IDocumentDeviceAccess.hxx>
85
85
86
// --> OD 2007-09-10 #i80209# - patch by ayaniger
87
#ifndef _SVX_FRMDIRITEM_HXX
88
#include <svx/frmdiritem.hxx>
89
#endif
90
#include "frmfmt.hxx"
91
86
// OD 20.02.2003 #107369# - method to update statics for paint
92
// OD 20.02.2003 #107369# - method to update statics for paint
87
// Note: method defined in '/sw/source/core/layout/paintfrm.cxx'
93
// Note: method defined in '/sw/source/core/layout/paintfrm.cxx'
88
extern void SwCalcPixStatics( OutputDevice *pOut );
94
extern void SwCalcPixStatics( OutputDevice *pOut );
Lines 105-110 Link Here
105
111
106
    const SwPrintData* pPrintData = mrParentViewShell.getIDocumentDeviceAccess()->getPrintData();
112
    const SwPrintData* pPrintData = mrParentViewShell.getIDocumentDeviceAccess()->getPrintData();
107
    mbPrintEmptyPages = pPrintData ? pPrintData->IsPrintEmptyPages() : true;
113
    mbPrintEmptyPages = pPrintData ? pPrintData->IsPrintEmptyPages() : true;
114
115
    // --> OD 2007-09-10 #i80209# - patch by ayaniger
116
    // Reverse column order for RTL
117
    // Layout direction determined by layout direction of the first page.
118
    {
119
        const SwPageFrm* pPage = dynamic_cast<const SwPageFrm*>(mrLayoutRootFrm.Lower());
120
        const UINT16 nDir = ((SvxFrameDirectionItem&)pPage->GetFmt()->GetAttr( RES_FRAMEDIR )).GetValue();
121
        mbRTL = (nDir == FRMDIR_HORI_RIGHT_TOP);
122
    }
123
    // <--
108
}
124
}
109
125
110
void SwPagePreviewLayout::_Clear()
126
void SwPagePreviewLayout::_Clear()
Lines 637-642 Link Here
637
    sal_uInt16 nCurrCol = mnPaintStartCol;
653
    sal_uInt16 nCurrCol = mnPaintStartCol;
638
    sal_uInt16 nConsideredRows = 0;
654
    sal_uInt16 nConsideredRows = 0;
639
    Point aCurrPaintOffset = aInitialPaintOffset;
655
    Point aCurrPaintOffset = aInitialPaintOffset;
656
    // --> OD 2007-09-10 #i80209# - patch by ayaniger
657
    if ( mbRTL )
658
    {
659
       aCurrPaintOffset.X() = maWinSize.Width() - mnColWidth - aCurrPaintOffset.X();
660
    }
661
    // <--
640
    // loop on pages to determine preview background retangles
662
    // loop on pages to determine preview background retangles
641
    while ( pPage &&
663
    while ( pPage &&
642
            (!mbDoesLayoutRowsFitIntoWindow || nConsideredRows < mnRows) &&
664
            (!mbDoesLayoutRowsFitIntoWindow || nConsideredRows < mnRows) &&
Lines 666-672 Link Here
666
            ++nCurrCol;
688
            ++nCurrCol;
667
            continue;
689
            continue;
668
        }
690
        }
669
        if ( aCurrPaintOffset.X() < maWinSize.Width() )
691
692
        // --> OD 2007-09-10 #i80209# - patch by ayaniger
693
//        if ( aCurrPaintOffset.X() < maWinSize.Width() )
694
        bool bInside = mbRTL
695
                             ? ((aCurrPaintOffset.X() < maWinSize.Width()) &&
696
                                (aCurrPaintOffset.X() > -mnColWidth))
697
                             : aCurrPaintOffset.X() < maWinSize.Width();
698
        if ( bInside )
699
        // <--
670
        {
700
        {
671
            // OD 19.02.2003 #107369# - leaving left-top-corner blank is
701
            // OD 19.02.2003 #107369# - leaving left-top-corner blank is
672
            // controlled by <mbBookPreview>.
702
            // controlled by <mbBookPreview>.
Lines 675-681 Link Here
675
            {
705
            {
676
                // first page in 2nd column
706
                // first page in 2nd column
677
                // --> continue with increased paint offset and next column
707
                // --> continue with increased paint offset and next column
708
                // --> OD 2007-09-10 #i80209# - patch by ayaniger
709
//                aCurrPaintOffset.X() += mnColWidth;
710
                if ( mbRTL )
711
                    aCurrPaintOffset.X() -= mnColWidth;
712
                else
678
                aCurrPaintOffset.X() += mnColWidth;
713
                aCurrPaintOffset.X() += mnColWidth;
714
                // <--
679
                ++nCurrCol;
715
                ++nCurrCol;
680
                continue;
716
                continue;
681
            }
717
            }
Lines 698-709 Link Here
698
        // prepare data for next loop
734
        // prepare data for next loop
699
        pPage = static_cast<const SwPageFrm*>(pPage->GetNext());
735
        pPage = static_cast<const SwPageFrm*>(pPage->GetNext());
700
736
701
        aCurrPaintOffset.X() += mnColWidth;
737
        // --> OD 2007-09-10 #i80209# - patch by ayaniger
738
//        aCurrPaintOffset.X() += mnColWidth;
739
        if ( mbRTL )
740
            	aCurrPaintOffset.X() -= mnColWidth;
741
        else
742
        	aCurrPaintOffset.X() += mnColWidth;
743
        // <--
702
        ++nCurrCol;
744
        ++nCurrCol;
703
        if ( nCurrCol > mnCols )
745
        if ( nCurrCol > mnCols )
704
        {
746
        {
705
            ++nConsideredRows;
747
            ++nConsideredRows;
706
            aCurrPaintOffset.X() = aInitialPaintOffset.X();
748
            aCurrPaintOffset.X() = aInitialPaintOffset.X();
749
            if ( mbRTL )
750
            {
751
       		aCurrPaintOffset.X() = maWinSize.Width() - mnColWidth - aCurrPaintOffset.X();
752
            }
753
            // <--
707
            nCurrCol = 1;
754
            nCurrCol = 1;
708
            aCurrPaintOffset.Y() += mnRowHeight;
755
            aCurrPaintOffset.Y() += mnRowHeight;
709
        }
756
        }
Lines 879-890 Link Here
879
    @author OD, IN/OUT parameters are absolute page numbers!!!
926
    @author OD, IN/OUT parameters are absolute page numbers!!!
880
*/
927
*/
881
bool SwPagePreviewLayout::CalcStartValuesForSelectedPageMove(
928
bool SwPagePreviewLayout::CalcStartValuesForSelectedPageMove(
882
                                const sal_Int16  _nHoriMove,
929
                                sal_Int16  _nHoriMove,
883
                                const sal_Int16  _nVertMove,
930
                                const sal_Int16  _nVertMove,
884
                                sal_uInt16&      _orNewSelectedPage,
931
                                sal_uInt16&      _orNewSelectedPage,
885
                                sal_uInt16&      _orNewStartPage,
932
                                sal_uInt16&      _orNewStartPage,
886
                                Point&           _orNewStartPos ) const
933
                                Point&           _orNewStartPos ) const
887
{
934
{
935
    // --> OD 2007-09-10 #i80209# - patch by ayaniger
936
    if ( mbRTL )
937
        _nHoriMove = -_nHoriMove;
938
    // <--
888
    // determine position of current selected page
939
    // determine position of current selected page
889
    sal_uInt16 nTmpRelSelPageNum = ConvertAbsoluteToRelativePageNum( mnSelectedPageNum );
940
    sal_uInt16 nTmpRelSelPageNum = ConvertAbsoluteToRelativePageNum( mnSelectedPageNum );
890
    sal_uInt16 nNewRelSelectedPageNum = nTmpRelSelPageNum;
941
    sal_uInt16 nNewRelSelectedPageNum = nTmpRelSelPageNum;

Return to issue 80209