diff options
author | Philipp Lohmann <pl@openoffice.org> | 2009-07-30 13:52:50 +0000 |
---|---|---|
committer | Philipp Lohmann <pl@openoffice.org> | 2009-07-30 13:52:50 +0000 |
commit | 20914171a71d95d9451c4e3743f2fcf62045418d (patch) | |
tree | e82d261471fc0e39d706c14af1d93b06bbef3268 /vcl/source/gdi | |
parent | 3d292304d4a5c8135558a76d1ff7e819326cff83 (diff) |
#i92518# n-up ordering
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r-- | vcl/source/gdi/print3.cxx | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index 64e7bf0c5576..27c326569bfb 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -689,6 +689,18 @@ Size PrinterController::getFilteredPageFile( int i_nFilteredPage, GDIMetaFile& o Size aPageSize = getPageFile( nPage, aPageFile, i_bMayUseCache ); if( aPageSize.Width() && aPageSize.Height() ) { + long nCellX = 0, nCellY = 0; + switch( rMPS.nOrder ) + { + case PrinterController::LRTB: + nCellX = (nSubPage % rMPS.nColumns); + nCellY = (nSubPage / rMPS.nColumns); + break; + case PrinterController::TBLR: + nCellX = (nSubPage / rMPS.nRows); + nCellY = (nSubPage % rMPS.nRows); + break; + } // scale the metafile down to a sub page size double fScaleX = double(aSubPageSize.Width())/double(aPageSize.Width()); double fScaleY = double(aSubPageSize.Height())/double(aPageSize.Height()); @@ -699,8 +711,8 @@ Size PrinterController::getFilteredPageFile( int i_nFilteredPage, GDIMetaFile& o // move the subpage so it is centered in its "cell" long nOffX = (aSubPageSize.Width() - long(double(aPageSize.Width()) * fScale)) / 2; long nOffY = (aSubPageSize.Height() - long(double(aPageSize.Height()) * fScale)) / 2; - long nX = rMPS.nLeftMargin + nOffX + nAdvX * (nSubPage % rMPS.nColumns); - long nY = rMPS.nTopMargin + nOffY + nAdvY * (nSubPage / rMPS.nColumns); + long nX = rMPS.nLeftMargin + nOffX + nAdvX * nCellX; + long nY = rMPS.nTopMargin + nOffY + nAdvY * nCellY; aPageFile.Move( nX, nY ); aPageFile.WindStart(); // calculate border rectangle |