summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/pdfextoutdevdata.hxx2
-rw-r--r--vcl/source/gdi/pdfextoutdevdata.cxx14
-rw-r--r--vcl/source/gdi/pdfwriter_impl.hxx2
-rw-r--r--vcl/source/gdi/pdfwriter_impl2.cxx32
4 files changed, 25 insertions, 25 deletions
diff --git a/include/vcl/pdfextoutdevdata.hxx b/include/vcl/pdfextoutdevdata.hxx
index ca430711d418..3c3d49a88522 100644
--- a/include/vcl/pdfextoutdevdata.hxx
+++ b/include/vcl/pdfextoutdevdata.hxx
@@ -152,7 +152,7 @@ public:
std::vector< PDFExtOutDevBookmarkEntry >& GetBookmarks() { return maBookmarks;}
- const Graphic* GetCurrentGraphic() const;
+ Graphic GetCurrentGraphic() const;
/** Start a new group of render output
diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx b/vcl/source/gdi/pdfextoutdevdata.cxx
index f62fff043620..488278a81739 100644
--- a/vcl/source/gdi/pdfextoutdevdata.cxx
+++ b/vcl/source/gdi/pdfextoutdevdata.cxx
@@ -294,7 +294,7 @@ struct PageSyncData
std::deque< PDFWriter::StructAttribute > mParaStructAttributes;
std::deque< PDFWriter::StructAttributeValue > mParaStructAttributeValues;
std::deque< Graphic > mGraphics;
- Graphic* mpCurrentGraphic;
+ Graphic mCurrentGraphic;
std::deque< std::shared_ptr< PDFWriter::AnyWidget > >
mControls;
GlobalSyncData* mpGlobalData;
@@ -303,8 +303,7 @@ struct PageSyncData
explicit PageSyncData( GlobalSyncData* pGlobal )
- : mpCurrentGraphic ( nullptr )
- , mbGroupIgnoreGDIMtfActions ( false )
+ : mbGroupIgnoreGDIMtfActions ( false )
{ mpGlobalData = pGlobal; }
void PushAction( const OutputDevice& rOutDev, const PDFExtOutDevDataSync::Action eAct );
@@ -417,7 +416,8 @@ bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIMtfAc
mbGroupIgnoreGDIMtfActions =
rOutDevData.HasAdequateCompression(
rGraphic, mParaRects[0], mParaRects[1]);
- mpCurrentGraphic = mbGroupIgnoreGDIMtfActions ? nullptr : &rGraphic;
+ if ( !mbGroupIgnoreGDIMtfActions )
+ mCurrentGraphic = rGraphic;
}
break;
}
@@ -474,7 +474,7 @@ bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIMtfAc
}
else
{
- mpCurrentGraphic = nullptr;
+ mCurrentGraphic.Clear();
}
}
break;
@@ -530,9 +530,9 @@ PDFExtOutDevData::~PDFExtOutDevData()
delete mpGlobalSyncData;
}
-const Graphic* PDFExtOutDevData::GetCurrentGraphic() const
+Graphic PDFExtOutDevData::GetCurrentGraphic() const
{
- return mpPageSyncData->mpCurrentGraphic;
+ return mpPageSyncData->mCurrentGraphic;
}
void PDFExtOutDevData::SetDocumentLocale( const css::lang::Locale& rLoc )
diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx
index 0e4980ecd8eb..8fa8903a7449 100644
--- a/vcl/source/gdi/pdfwriter_impl.hxx
+++ b/vcl/source/gdi/pdfwriter_impl.hxx
@@ -1012,7 +1012,7 @@ i12626
// helper for playMetafile
void implWriteGradient( const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient,
VirtualDevice* pDummyVDev, const vcl::PDFWriter::PlayMetafileContext& );
- void implWriteBitmapEx( const Point& rPoint, const Size& rSize, const BitmapEx& rBitmapEx, const Graphic* i_pGraphic,
+ void implWriteBitmapEx( const Point& rPoint, const Size& rSize, const BitmapEx& rBitmapEx, Graphic i_pGraphic,
VirtualDevice* pDummyVDev, const vcl::PDFWriter::PlayMetafileContext& );
// helpers for CCITT 1bit bitmap stream
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index db6b14d54883..3cc7b255343e 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -65,7 +65,7 @@ void PDFWriterImpl::implWriteGradient( const tools::PolyPolygon& i_rPolyPoly, co
m_rOuterFace.Pop();
}
-void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSize, const BitmapEx& i_rBitmapEx, const Graphic* i_pGraphic,
+void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSize, const BitmapEx& i_rBitmapEx, Graphic i_Graphic,
VirtualDevice* i_pDummyVDev, const vcl::PDFWriter::PlayMetafileContext& i_rContext )
{
if ( !i_rBitmapEx.IsEmpty() && i_rSize.Width() && i_rSize.Height() )
@@ -96,7 +96,7 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz
aBitmapEx.Mirror( nMirrorFlags );
}
- bool bIsJpeg = i_pGraphic && (i_pGraphic->GetBitmapEx() == aBitmapEx);
+ bool bIsJpeg = (i_Graphic.GetType() != GRAPHIC_NONE) && (i_Graphic.GetBitmapEx() == aBitmapEx);
if( i_rContext.m_nMaxImageResolution > 50 )
{
@@ -487,8 +487,8 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa
xVDev->EnableMapMode( false );
xVDev->DrawMask( aPoint, aDstSizePixel, aMask, Color( COL_WHITE ) );
aAlpha = xVDev->GetBitmap( aPoint, aDstSizePixel );
- const Graphic* pGraphic = i_pOutDevData->GetCurrentGraphic();
- implWriteBitmapEx( rPos, rSize, BitmapEx( aPaint, aAlpha ), pGraphic,pDummyVDev, i_rContext );
+ const Graphic& rGraphic = i_pOutDevData->GetCurrentGraphic();
+ implWriteBitmapEx( rPos, rSize, BitmapEx( aPaint, aAlpha ), rGraphic,pDummyVDev, i_rContext );
}
}
}
@@ -788,16 +788,16 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa
if( ! ( aSize.Width() && aSize.Height() ) )
aSize = pDummyVDev->PixelToLogic( aBitmapEx.GetSizePixel() );
- const Graphic* pGraphic = i_pOutDevData->GetCurrentGraphic();
- implWriteBitmapEx( pA->GetPoint(), aSize, aBitmapEx, pGraphic, pDummyVDev, i_rContext );
+ const Graphic& rGraphic = i_pOutDevData->GetCurrentGraphic();
+ implWriteBitmapEx( pA->GetPoint(), aSize, aBitmapEx, rGraphic, pDummyVDev, i_rContext );
}
break;
case( MetaActionType::BMPSCALE ):
{
const MetaBmpScaleAction* pA = static_cast<const MetaBmpScaleAction*>(pAction);
- const Graphic* pGraphic = i_pOutDevData->GetCurrentGraphic();
- implWriteBitmapEx( pA->GetPoint(), pA->GetSize(), BitmapEx( pA->GetBitmap() ), pGraphic, pDummyVDev, i_rContext );
+ const Graphic& rGraphic = i_pOutDevData->GetCurrentGraphic();
+ implWriteBitmapEx( pA->GetPoint(), pA->GetSize(), BitmapEx( pA->GetBitmap() ), rGraphic, pDummyVDev, i_rContext );
}
break;
@@ -806,8 +806,8 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa
const MetaBmpScalePartAction* pA = static_cast<const MetaBmpScalePartAction*>(pAction);
BitmapEx aBitmapEx( pA->GetBitmap() );
aBitmapEx.Crop( Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) );
- const Graphic* pGraphic = i_pOutDevData->GetCurrentGraphic();
- implWriteBitmapEx( pA->GetDestPoint(), pA->GetDestSize(), aBitmapEx, pGraphic, pDummyVDev, i_rContext );
+ const Graphic& rGraphic = i_pOutDevData->GetCurrentGraphic();
+ implWriteBitmapEx( pA->GetDestPoint(), pA->GetDestSize(), aBitmapEx, rGraphic, pDummyVDev, i_rContext );
}
break;
@@ -817,16 +817,16 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa
BitmapEx aBitmapEx( pA->GetBitmapEx() );
Size aSize( OutputDevice::LogicToLogic( aBitmapEx.GetPrefSize(),
aBitmapEx.GetPrefMapMode(), pDummyVDev->GetMapMode() ) );
- const Graphic* pGraphic = i_pOutDevData->GetCurrentGraphic();
- implWriteBitmapEx( pA->GetPoint(), aSize, aBitmapEx, pGraphic, pDummyVDev, i_rContext );
+ const Graphic& rGraphic = i_pOutDevData->GetCurrentGraphic();
+ implWriteBitmapEx( pA->GetPoint(), aSize, aBitmapEx, rGraphic, pDummyVDev, i_rContext );
}
break;
case( MetaActionType::BMPEXSCALE ):
{
const MetaBmpExScaleAction* pA = static_cast<const MetaBmpExScaleAction*>(pAction);
- const Graphic* pGraphic = i_pOutDevData->GetCurrentGraphic();
- implWriteBitmapEx( pA->GetPoint(), pA->GetSize(), pA->GetBitmapEx(), pGraphic, pDummyVDev, i_rContext );
+ const Graphic& rGraphic = i_pOutDevData->GetCurrentGraphic();
+ implWriteBitmapEx( pA->GetPoint(), pA->GetSize(), pA->GetBitmapEx(), rGraphic, pDummyVDev, i_rContext );
}
break;
@@ -835,8 +835,8 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa
const MetaBmpExScalePartAction* pA = static_cast<const MetaBmpExScalePartAction*>(pAction);
BitmapEx aBitmapEx( pA->GetBitmapEx() );
aBitmapEx.Crop( Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) );
- const Graphic* pGraphic = i_pOutDevData->GetCurrentGraphic();
- implWriteBitmapEx( pA->GetDestPoint(), pA->GetDestSize(), aBitmapEx, pGraphic, pDummyVDev, i_rContext );
+ const Graphic& rGraphic = i_pOutDevData->GetCurrentGraphic();
+ implWriteBitmapEx( pA->GetDestPoint(), pA->GetDestSize(), aBitmapEx, rGraphic, pDummyVDev, i_rContext );
}
break;