Author: alg
Date: Wed Mar 19 12:34:44 2014
New Revision: 1579210

URL: http://svn.apache.org/r1579210
Log:
i122984 Avoid too many Print JobSetups, be more tolerant with last line TIFF 
imports

Modified:
    openoffice/trunk/main/filter/source/graphicfilter/itiff/ccidecom.cxx
    openoffice/trunk/main/filter/source/graphicfilter/itiff/ccidecom.hxx
    openoffice/trunk/main/filter/source/graphicfilter/itiff/itiff.cxx
    openoffice/trunk/main/vcl/source/gdi/print.cxx

Modified: openoffice/trunk/main/filter/source/graphicfilter/itiff/ccidecom.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/filter/source/graphicfilter/itiff/ccidecom.cxx?rev=1579210&r1=1579209&r2=1579210&view=diff
==============================================================================
--- openoffice/trunk/main/filter/source/graphicfilter/itiff/ccidecom.cxx 
(original)
+++ openoffice/trunk/main/filter/source/graphicfilter/itiff/ccidecom.cxx Wed 
Mar 19 12:34:44 2014
@@ -629,7 +629,7 @@ void CCIDecompressor::StartDecompression
 }
 
 
-sal_Bool CCIDecompressor::DecompressScanline( sal_uInt8 * pTarget, sal_uLong 
nTargetBits )
+sal_Bool CCIDecompressor::DecompressScanline( sal_uInt8 * pTarget, sal_uLong 
nTargetBits, bool bLastLine )
 {
        sal_uInt16 i;
        sal_uInt8 * pSrc,* pDst;
@@ -714,6 +714,12 @@ sal_Bool CCIDecompressor::DecompressScan
                for ( i = 0; i < nLastLineSize; i++ ) *(pDst++)=*(pSrc++);
        }
 
+    // #122984#
+    if( !bStatus && bLastLine )
+    {
+        bStatus = sal_True;
+    }
+
        if ( pIStream->GetError() )
                bStatus = sal_False;
 

Modified: openoffice/trunk/main/filter/source/graphicfilter/itiff/ccidecom.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/filter/source/graphicfilter/itiff/ccidecom.hxx?rev=1579210&r1=1579209&r2=1579210&view=diff
==============================================================================
--- openoffice/trunk/main/filter/source/graphicfilter/itiff/ccidecom.hxx 
(original)
+++ openoffice/trunk/main/filter/source/graphicfilter/itiff/ccidecom.hxx Wed 
Mar 19 12:34:44 2014
@@ -58,7 +58,7 @@ public:
 
        void StartDecompression( SvStream & rIStream );
 
-       sal_Bool DecompressScanline(sal_uInt8 * pTarget, sal_uLong nTargetBits 
);
+       sal_Bool DecompressScanline(sal_uInt8 * pTarget, sal_uLong nTargetBits, 
bool bLastLine );
 
 private:
 

Modified: openoffice/trunk/main/filter/source/graphicfilter/itiff/itiff.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/filter/source/graphicfilter/itiff/itiff.cxx?rev=1579210&r1=1579209&r2=1579210&view=diff
==============================================================================
--- openoffice/trunk/main/filter/source/graphicfilter/itiff/itiff.cxx (original)
+++ openoffice/trunk/main/filter/source/graphicfilter/itiff/itiff.cxx Wed Mar 
19 12:34:44 2014
@@ -564,7 +564,7 @@ sal_Bool TIFFReader::ReadMap( sal_uLong 
                                        pTIFF->Seek( pStripOffsets[ nStrip ] );
                                        aCCIDecom.StartDecompression( *pTIFF );
                                }
-                               if ( aCCIDecom.DecompressScanline( pMap[ np ], 
nImageWidth * nBitsPerSample * nSamplesPerPixel / nPlanes ) == sal_False )
+                               if ( aCCIDecom.DecompressScanline( pMap[ np ], 
nImageWidth * nBitsPerSample * nSamplesPerPixel / nPlanes, np + 1 == nPlanes ) 
== sal_False )
                                        return sal_False;
                                if ( pTIFF->GetError() )
                                        return sal_False;

Modified: openoffice/trunk/main/vcl/source/gdi/print.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/source/gdi/print.cxx?rev=1579210&r1=1579209&r2=1579210&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/source/gdi/print.cxx (original)
+++ openoffice/trunk/main/vcl/source/gdi/print.cxx Wed Mar 19 12:34:44 2014
@@ -1224,11 +1224,25 @@ sal_Bool Printer::SetPaperSizeUser( cons
        if ( mbInPrintPage )
                return sal_False;
 
-       Size    aPixSize = LogicToPixel( rSize );
-       Size    aPageSize = PixelToLogic( aPixSize, MAP_100TH_MM );
-       if ( (maJobSetup.ImplGetConstData()->mePaperFormat != PAPER_USER)       
        ||
-                (maJobSetup.ImplGetConstData()->mnPaperWidth  != 
aPageSize.Width()) ||
-                (maJobSetup.ImplGetConstData()->mnPaperHeight != 
aPageSize.Height()) )
+    const Size aPixSize = LogicToPixel( rSize );
+    const Size aPageSize = PixelToLogic( aPixSize, MAP_100TH_MM );
+    bool bNeedToChange(maJobSetup.ImplGetConstData()->mnPaperWidth != 
aPageSize.Width() ||
+        maJobSetup.ImplGetConstData()->mnPaperHeight != aPageSize.Height());
+
+    if(!bNeedToChange)
+    {
+        // #122984# only need to change when Paper is different from 
PAPER_USER and
+        // the mapped Paper which will created below in the call to 
ImplFindPaperFormatForUserSize
+        // and will replace maJobSetup.ImplGetConstData()->mePaperFormat. This 
leads to
+        // unnecessary JobSetups, e.g. when printing a multi-page fax, but 
also with
+        // normal print
+        const Paper aPaper = ImplGetPaperFormat(aPageSize.Width(), 
aPageSize.Height());
+
+        bNeedToChange = maJobSetup.ImplGetConstData()->mePaperFormat != 
PAPER_USER &&
+            maJobSetup.ImplGetConstData()->mePaperFormat != aPaper;
+    }
+
+    if(bNeedToChange)
        {
                JobSetup                aJobSetup = maJobSetup;
                ImplJobSetup*   pSetupData = aJobSetup.ImplGetData();


Reply via email to