Re: [Libreoffice] [REVIEW] fdo#43932: try to fix paper tray settings

2012-01-24 Thread Ivan Timofeev

17.01.2012 16:05, Caolán McNamara пишет:

On Fri, 2012-01-13 at 22:22 +0400, Ivan Timofeev wrote:

Hi there,

https://bugs.freedesktop.org/show_bug.cgi?id=43932

this patch partially reverts
http://cgit.freedesktop.org/libreoffice/core/commit/?id=4cc5448ed82f13bb107695b65f39589df1e46cb9
because the following change made the option
[ ] Use only paper tray from printer preferences useless:


...


1. I haven't got a multitray printer to test this.


caolanm-dtardon: is there any multitray printers over where you are to
give this a quick sanity test ?

C.



*cough* (very bashfully) So what? :)
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] [REVIEW] fdo#43932: try to fix paper tray settings

2012-01-24 Thread David Tardon
On Tue, Jan 24, 2012 at 03:36:23PM +0400, Ivan Timofeev wrote:
 17.01.2012 16:05, Caolán McNamara пишет:
 On Fri, 2012-01-13 at 22:22 +0400, Ivan Timofeev wrote:
 Hi there,
 
 https://bugs.freedesktop.org/show_bug.cgi?id=43932
 
 this patch partially reverts
 http://cgit.freedesktop.org/libreoffice/core/commit/?id=4cc5448ed82f13bb107695b65f39589df1e46cb9
 because the following change made the option
 [ ] Use only paper tray from printer preferences useless:
 
 ...
 
 1. I haven't got a multitray printer to test this.
 
 caolanm-dtardon: is there any multitray printers over where you are to
 give this a quick sanity test ?
 
 C.
 
 
 *cough* (very bashfully) So what? :)

Oops, sorry... It seems it does not work: the tray setting is always
reset to 'Auto' again.

D.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] [REVIEW] fdo#43932: try to fix paper tray settings

2012-01-17 Thread Caolán McNamara
On Fri, 2012-01-13 at 22:22 +0400, Ivan Timofeev wrote:
 Hi there,
 
 https://bugs.freedesktop.org/show_bug.cgi?id=43932
 
 this patch partially reverts
 http://cgit.freedesktop.org/libreoffice/core/commit/?id=4cc5448ed82f13bb107695b65f39589df1e46cb9
 because the following change made the option
 [ ] Use only paper tray from printer preferences useless:

...

 1. I haven't got a multitray printer to test this. 

caolanm-dtardon: is there any multitray printers over where you are to
give this a quick sanity test ?

C.

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] [REVIEW] fdo#43932: try to fix paper tray settings

2012-01-13 Thread Ivan Timofeev

forgot to attach the patch.
From bae6b73a56cf4fcfffe21aa9f3f9ccce87e890cd Mon Sep 17 00:00:00 2001
From: Ivan Timofeev timofeev@gmail.com
Date: Fri, 13 Jan 2012 21:50:55 +0400
Subject: [PATCH] fdo#43932: try to fix paper tray settings

---
 vcl/source/gdi/print3.cxx |   25 ++---
 1 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index d85321b..3dbee8b 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -172,8 +172,7 @@ public:
 // set by user through printer config dialog
 // if set, pages are centered and trimmed onto the fixed page
 SizemaFixedPageSize;
-sal_Int32   mnDefaultPaperBin;
-sal_Int32   mnFixedPaperBin;
+sal_Int32   mnPaperBin;
 
 ImplPrinterControllerData() :
 mbFirstPage( sal_True ),
@@ -181,8 +180,7 @@ public:
 mbReversePageOrder( sal_False ),
 meJobState( view::PrintableState_JOB_STARTED ),
 mpProgress( NULL ),
-mnDefaultPaperBin( -1 ),
-mnFixedPaperBin( -1 )
+mnPaperBin( -1 )
 {}
 ~ImplPrinterControllerData() { delete mpProgress; }
 
@@ -723,8 +721,7 @@ void PrinterController::setPrinter( const boost::shared_ptrPrinter i_rPrinter
 mpImplData-mpPrinter = i_rPrinter;
 setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( Name ) ),
   makeAny( rtl::OUString( i_rPrinter-GetName() ) ) );
-mpImplData-mnDefaultPaperBin = mpImplData-mpPrinter-GetPaperBin();
-mpImplData-mnFixedPaperBin = -1;
+mpImplData-mnPaperBin = mpImplData-mpPrinter-GetPaperBin();
 }
 
 void PrinterController:: resetPrinterOptions( bool i_bFileOutput )
@@ -742,8 +739,9 @@ bool PrinterController::setupPrinter( Window* i_pParent )
 // get old data
 Size aPaperSize( mpImplData-mpPrinter-PixelToLogic(
 mpImplData-mpPrinter-GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) );
-sal_uInt16 nPaperBin = mpImplData-mpPrinter-GetPaperBin();
 
+// reset paper bin to the value that was set during the last setup call
+mpImplData-mpPrinter-SetPaperBin(mpImplData-mnPaperBin);
 // call driver setup
 bRet = mpImplData-mpPrinter-Setup( i_pParent );
 if( bRet )
@@ -752,7 +750,7 @@ bool PrinterController::setupPrinter( Window* i_pParent )
 Size aNewPaperSize( mpImplData-mpPrinter-PixelToLogic(
 mpImplData-mpPrinter-GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) );
 sal_uInt16 nNewPaperBin = mpImplData-mpPrinter-GetPaperBin();
-if( aNewPaperSize != aPaperSize || nNewPaperBin != nPaperBin )
+if( aNewPaperSize != aPaperSize || nNewPaperBin != mpImplData-mnPaperBin )
 {
 mpImplData-maFixedPageSize = aNewPaperSize;
 mpImplData-maPageCache.invalidate();
@@ -761,7 +759,7 @@ bool PrinterController::setupPrinter( Window* i_pParent )
 aOverrideSize.Height = aNewPaperSize.Height();
 setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OverridePageSize ) ),
   makeAny( aOverrideSize ) );
-mpImplData-mnFixedPaperBin = nNewPaperBin;
+mpImplData-mnPaperBin = nNewPaperBin;
 }
 }
 }
@@ -773,7 +771,7 @@ PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( cons
 PrinterController::PageSize aPageSize;
 aPageSize.aSize = mpPrinter-GetPaperSize();
 awt::Size aSetSize, aIsSize;
-sal_Int32 nPaperBin = mnDefaultPaperBin;
+sal_Int32 nPaperBin = mnPaperBin;
 for( sal_Int32 nProperty = 0, nPropertyCount = i_rProps.getLength(); nProperty  nPropertyCount; ++nProperty )
 {
 if( i_rProps[ nProperty ].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( PreferredPageSize ) ) )
@@ -1180,11 +1178,6 @@ void PrinterController::printFilteredPage( int i_nPage )
 mpImplData-mpPrinter-SetMapMode( MAP_100TH_MM );
 // aPageSize was filtered through mpImplData-getRealPaperSize already by getFilteredPageFile()
 mpImplData-mpPrinter-SetPaperSizeUser( aPageSize.aSize, ! mpImplData-isFixedPageSize() );
-if( mpImplData-mnFixedPaperBin != -1 
-mpImplData-mpPrinter-GetPaperBin() != mpImplData-mnFixedPaperBin )
-{
-mpImplData-mpPrinter-SetPaperBin( mpImplData-mnFixedPaperBin );
-}
 
 // if full paper is meant to be used, move the output to accomodate for pageoffset
 if( aPageSize.bFullPaper )
@@ -1199,6 +1192,7 @@ void PrinterController::printFilteredPage( int i_nPage )
 
 mpImplData-mpPrinter-EnableOutput( sal_True );
 
+printf(page %d, bin %d\n, i_nPage, mpImplData-mpPrinter-GetPaperBin());
 // actually print the page
 mpImplData-mpPrinter-ImplStartPage();
 
@@