[Libreoffice-commits] core.git: Branch 'aoo/trunk' - 2 commits - filter/source oox/source vcl/source
Jürgen Schmidt
jsc at apache.org
Wed Mar 19 07:07:48 PDT 2014
filter/source/graphicfilter/itiff/ccidecom.cxx | 8 +++++++-
filter/source/graphicfilter/itiff/ccidecom.hxx | 2 +-
filter/source/graphicfilter/itiff/itiff.cxx | 2 +-
oox/source/ppt/presentationfragmenthandler.cxx | 3 +++
oox/source/ppt/slidefragmenthandler.cxx | 11 ++++++++---
vcl/source/gdi/print.cxx | 24 +++++++++++++++++++-----
6 files changed, 39 insertions(+), 11 deletions(-)
New commits:
commit 13f70473b4a341ec513a5a070a0828b3f85c0c84
Author: Jürgen Schmidt <jsc at apache.org>
Date: Wed Mar 19 12:47:53 2014 +0000
#124456# merge from aoo410 branch, add null pointer check to avoid usage of not initialzed theme, add comment for missing theme support in notes page
diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx
index 609b960..401b01e 100644
--- a/oox/source/ppt/presentationfragmenthandler.cxx
+++ b/oox/source/ppt/presentationfragmenthandler.cxx
@@ -273,6 +273,9 @@ void PresentationFragmentHandler::endDocument() throw (SAXException, RuntimeExce
SlidePersistPtr pNotesMasterPersistPtr( new SlidePersist( rFilter, sal_True/*sal_False*/, sal_True, xNotesPage,
ShapePtr( new PPTShape( Slide, "com.sun.star.drawing.GroupShape" ) ), mpTextListStyle ) );
FragmentHandlerRef xNotesMasterFragmentHandler( new SlideFragmentHandler( getFilter(), aNotesMasterFragmentPath, pNotesMasterPersistPtr, Slide ) );
+
+ // TODO: Theme support is missing, theme pointer in SlidePersist is null and used later
+
importSlide( xNotesMasterFragmentHandler, pNotesMasterPersistPtr );
pNotesMasterPersistPtr->createXShapes( rFilter );
pNotesPersistPtr->setMasterPersist(pNotesMasterPersistPtr);
diff --git a/oox/source/ppt/slidefragmenthandler.cxx b/oox/source/ppt/slidefragmenthandler.cxx
index 2992880..0f2ab8d 100644
--- a/oox/source/ppt/slidefragmenthandler.cxx
+++ b/oox/source/ppt/slidefragmenthandler.cxx
@@ -141,10 +141,15 @@ Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( s
case PPT_TOKEN( bgRef ): // a:CT_StyleMatrixReference
{
- FillPropertiesPtr pFillPropertiesPtr( new FillProperties(
- *mpSlidePersistPtr->getTheme()->getFillStyle( xAttribs->getOptionalValue( XML_idx ).toInt32() ) ) );
+ oox::drawingml::ThemePtr pTheme = mpSlidePersistPtr->getTheme();
+ if (pTheme)
+ {
+ FillPropertiesPtr pFillPropertiesPtr( new FillProperties(
+ *pTheme->getFillStyle( xAttribs->getOptionalValue( XML_idx ).toInt32() ) ) );
+ mpSlidePersistPtr->setBackgroundProperties( pFillPropertiesPtr );
+ }
xRet.set( new ColorContext( *this, mpSlidePersistPtr->getBackgroundColor() ) );
- mpSlidePersistPtr->setBackgroundProperties( pFillPropertiesPtr );
+
}
break;
commit 0ab284f5064f66a11741fa4aa2e2774c1d7e5f14
Author: Armin Le Grand <alg at apache.org>
Date: Wed Mar 19 12:34:44 2014 +0000
i122984 Avoid too many Print JobSetups, be more tolerant with last line TIFF imports
diff --git a/filter/source/graphicfilter/itiff/ccidecom.cxx b/filter/source/graphicfilter/itiff/ccidecom.cxx
index 92dbd31..77b856e 100644
--- a/filter/source/graphicfilter/itiff/ccidecom.cxx
+++ b/filter/source/graphicfilter/itiff/ccidecom.cxx
@@ -629,7 +629,7 @@ void CCIDecompressor::StartDecompression( SvStream & rIStream )
}
-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::DecompressScanline( sal_uInt8 * pTarget, sal_uLong nTa
for ( i = 0; i < nLastLineSize; i++ ) *(pDst++)=*(pSrc++);
}
+ // #122984#
+ if( !bStatus && bLastLine )
+ {
+ bStatus = sal_True;
+ }
+
if ( pIStream->GetError() )
bStatus = sal_False;
diff --git a/filter/source/graphicfilter/itiff/ccidecom.hxx b/filter/source/graphicfilter/itiff/ccidecom.hxx
index ac75d2b..d021a84 100644
--- a/filter/source/graphicfilter/itiff/ccidecom.hxx
+++ b/filter/source/graphicfilter/itiff/ccidecom.hxx
@@ -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:
diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx
index 4cb6400..e31ed00 100644
--- a/filter/source/graphicfilter/itiff/itiff.cxx
+++ b/filter/source/graphicfilter/itiff/itiff.cxx
@@ -564,7 +564,7 @@ sal_Bool TIFFReader::ReadMap( sal_uLong nMinPercent, sal_uLong nMaxPercent )
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;
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index d6503b5..76e1642 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -1224,11 +1224,25 @@ sal_Bool Printer::SetPaperSizeUser( const Size& rSize, bool bMatchNearest )
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();
More information about the Libreoffice-commits
mailing list