[Libreoffice-commits] .: vcl/inc vcl/source
David Tardon
dtardon at kemper.freedesktop.org
Wed Dec 7 04:44:45 PST 2011
vcl/inc/vcl/pdfwriter.hxx | 5 +
vcl/source/gdi/pdfwriter.cxx | 159 +++++++++++++++++++++----------------------
2 files changed, 83 insertions(+), 81 deletions(-)
New commits:
commit d36f276728abffee1a9d53c87d56526e16a4968d
Author: David Tardon <dtardon at redhat.com>
Date: Wed Dec 7 13:42:15 2011 +0100
avoid casting from void*
diff --git a/vcl/inc/vcl/pdfwriter.hxx b/vcl/inc/vcl/pdfwriter.hxx
index 58dd7e1..816518b 100644
--- a/vcl/inc/vcl/pdfwriter.hxx
+++ b/vcl/inc/vcl/pdfwriter.hxx
@@ -42,6 +42,8 @@
#include "com/sun/star/io/XOutputStream.hpp"
#include "com/sun/star/beans/XMaterialHolder.hpp"
+#include <boost/scoped_ptr.hpp>
+
#include <list>
#include <vector>
#include <set>
@@ -65,6 +67,7 @@ namespace vcl
{
class PDFExtOutDevData;
+class PDFWriterImpl;
struct PDFNote
{
@@ -81,7 +84,7 @@ class VCL_DLLPUBLIC PDFOutputStream
class VCL_DLLPUBLIC PDFWriter
{
- void* pImplementation;
+ boost::scoped_ptr<PDFWriterImpl> pImplementation;
public:
// extended line info
enum CapType { capButt, capRound, capSquare };
diff --git a/vcl/source/gdi/pdfwriter.cxx b/vcl/source/gdi/pdfwriter.cxx
index 68d1218..41b8b95 100644
--- a/vcl/source/gdi/pdfwriter.cxx
+++ b/vcl/source/gdi/pdfwriter.cxx
@@ -45,37 +45,36 @@ PDFWriter::PDFWriter( const PDFWriter::PDFWriterContext& rContext, const com::su
PDFWriter::~PDFWriter()
{
- delete (PDFWriterImpl*)pImplementation;
}
OutputDevice* PDFWriter::GetReferenceDevice()
{
- return ((PDFWriterImpl*)pImplementation)->getReferenceDevice();
+ return pImplementation->getReferenceDevice();
}
sal_Int32 PDFWriter::NewPage( sal_Int32 nPageWidth, sal_Int32 nPageHeight, Orientation eOrientation )
{
- return ((PDFWriterImpl*)pImplementation)->newPage( nPageWidth, nPageHeight, eOrientation );
+ return pImplementation->newPage( nPageWidth, nPageHeight, eOrientation );
}
bool PDFWriter::Emit()
{
- return ((PDFWriterImpl*)pImplementation)->emit();
+ return pImplementation->emit();
}
void PDFWriter::SetDocumentLocale( const com::sun::star::lang::Locale& rLoc )
{
- ((PDFWriterImpl*)pImplementation)->setDocumentLocale( rLoc );
+ pImplementation->setDocumentLocale( rLoc );
}
void PDFWriter::SetFont( const Font& rFont )
{
- ((PDFWriterImpl*)pImplementation)->setFont( rFont );
+ pImplementation->setFont( rFont );
}
void PDFWriter::DrawText( const Point& rPos, const String& rText )
{
- ((PDFWriterImpl*)pImplementation)->drawText( rPos, rText );
+ pImplementation->drawText( rPos, rText );
}
void PDFWriter::DrawTextLine(
@@ -86,7 +85,7 @@ void PDFWriter::DrawTextLine(
FontUnderline eOverline,
sal_Bool bUnderlineAbove )
{
- ((PDFWriterImpl*)pImplementation)->drawTextLine( rPos, nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove );
+ pImplementation->drawTextLine( rPos, nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove );
}
void PDFWriter::DrawTextArray(
@@ -96,7 +95,7 @@ void PDFWriter::DrawTextArray(
xub_StrLen nIndex,
xub_StrLen nLen )
{
- ((PDFWriterImpl*)pImplementation)->drawTextArray( rStartPt, rStr, pDXAry, nIndex, nLen );
+ pImplementation->drawTextArray( rStartPt, rStr, pDXAry, nIndex, nLen );
}
void PDFWriter::DrawStretchText(
@@ -106,7 +105,7 @@ void PDFWriter::DrawStretchText(
xub_StrLen nIndex,
xub_StrLen nLen )
{
- ((PDFWriterImpl*)pImplementation)->drawStretchText( rStartPt, nWidth, rStr, nIndex, nLen );
+ pImplementation->drawStretchText( rStartPt, nWidth, rStr, nIndex, nLen );
}
void PDFWriter::DrawText(
@@ -114,335 +113,335 @@ void PDFWriter::DrawText(
const XubString& rStr,
sal_uInt16 nStyle )
{
- ((PDFWriterImpl*)pImplementation)->drawText( rRect, rStr, nStyle );
+ pImplementation->drawText( rRect, rStr, nStyle );
}
void PDFWriter::DrawLine( const Point& rStart, const Point& rStop )
{
- ((PDFWriterImpl*)pImplementation)->drawLine( rStart, rStop );
+ pImplementation->drawLine( rStart, rStop );
}
void PDFWriter::DrawLine( const Point& rStart, const Point& rStop, const LineInfo& rInfo )
{
- ((PDFWriterImpl*)pImplementation)->drawLine( rStart, rStop, rInfo );
+ pImplementation->drawLine( rStart, rStop, rInfo );
}
void PDFWriter::DrawPolygon( const Polygon& rPoly )
{
- ((PDFWriterImpl*)pImplementation)->drawPolygon( rPoly );
+ pImplementation->drawPolygon( rPoly );
}
void PDFWriter::DrawPolyLine( const Polygon& rPoly )
{
- ((PDFWriterImpl*)pImplementation)->drawPolyLine( rPoly );
+ pImplementation->drawPolyLine( rPoly );
}
void PDFWriter::DrawRect( const Rectangle& rRect )
{
- ((PDFWriterImpl*)pImplementation)->drawRectangle( rRect );
+ pImplementation->drawRectangle( rRect );
}
void PDFWriter::DrawRect( const Rectangle& rRect, sal_uLong nHorzRound, sal_uLong nVertRound )
{
- ((PDFWriterImpl*)pImplementation)->drawRectangle( rRect, nHorzRound, nVertRound );
+ pImplementation->drawRectangle( rRect, nHorzRound, nVertRound );
}
void PDFWriter::DrawEllipse( const Rectangle& rRect )
{
- ((PDFWriterImpl*)pImplementation)->drawEllipse( rRect );
+ pImplementation->drawEllipse( rRect );
}
void PDFWriter::DrawArc( const Rectangle& rRect, const Point& rStart, const Point& rStop )
{
- ((PDFWriterImpl*)pImplementation)->drawArc( rRect, rStart, rStop, false, false );
+ pImplementation->drawArc( rRect, rStart, rStop, false, false );
}
void PDFWriter::DrawPie( const Rectangle& rRect, const Point& rStart, const Point& rStop )
{
- ((PDFWriterImpl*)pImplementation)->drawArc( rRect, rStart, rStop, true, false );
+ pImplementation->drawArc( rRect, rStart, rStop, true, false );
}
void PDFWriter::DrawChord( const Rectangle& rRect, const Point& rStart, const Point& rStop )
{
- ((PDFWriterImpl*)pImplementation)->drawArc( rRect, rStart, rStop, false, true );
+ pImplementation->drawArc( rRect, rStart, rStop, false, true );
}
void PDFWriter::DrawPolyLine( const Polygon& rPoly, const LineInfo& rInfo )
{
- ((PDFWriterImpl*)pImplementation)->drawPolyLine( rPoly, rInfo );
+ pImplementation->drawPolyLine( rPoly, rInfo );
}
void PDFWriter::DrawPolyLine( const Polygon& rPoly, const ExtLineInfo& rInfo )
{
- ((PDFWriterImpl*)pImplementation)->drawPolyLine( rPoly, rInfo );
+ pImplementation->drawPolyLine( rPoly, rInfo );
}
void PDFWriter::DrawPolyPolygon( const PolyPolygon& rPolyPoly )
{
- ((PDFWriterImpl*)pImplementation)->drawPolyPolygon( rPolyPoly );
+ pImplementation->drawPolyPolygon( rPolyPoly );
}
void PDFWriter::DrawPixel( const Point& rPos, const Color& rColor )
{
- ((PDFWriterImpl*)pImplementation)->drawPixel( rPos, rColor );
+ pImplementation->drawPixel( rPos, rColor );
}
void PDFWriter::DrawPixel( const Polygon& rPts, const Color* pColors )
{
- ((PDFWriterImpl*)pImplementation)->drawPixel( rPts, pColors );
+ pImplementation->drawPixel( rPts, pColors );
}
void PDFWriter::DrawBitmap( const Point& rDestPt, const Size& rDestSize, const Bitmap& rBitmap )
{
- ((PDFWriterImpl*)pImplementation)->drawBitmap( rDestPt, rDestSize, rBitmap );
+ pImplementation->drawBitmap( rDestPt, rDestSize, rBitmap );
}
void PDFWriter::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize, const BitmapEx& rBitmap )
{
- ((PDFWriterImpl*)pImplementation)->drawBitmap( rDestPt, rDestSize, rBitmap );
+ pImplementation->drawBitmap( rDestPt, rDestSize, rBitmap );
}
void PDFWriter::DrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch )
{
- ((PDFWriterImpl*)pImplementation)->drawHatch( rPolyPoly, rHatch );
+ pImplementation->drawHatch( rPolyPoly, rHatch );
}
void PDFWriter::DrawWallpaper( const Rectangle& rRect, const Wallpaper& rWallpaper )
{
- ((PDFWriterImpl*)pImplementation)->drawWallpaper( rRect, rWallpaper );
+ pImplementation->drawWallpaper( rRect, rWallpaper );
}
void PDFWriter::DrawTransparent( const PolyPolygon& rPolyPoly, sal_uInt16 nTransparencePercent )
{
- ((PDFWriterImpl*)pImplementation)->drawTransparent( rPolyPoly, nTransparencePercent );
+ pImplementation->drawTransparent( rPolyPoly, nTransparencePercent );
}
void PDFWriter::BeginTransparencyGroup()
{
- ((PDFWriterImpl*)pImplementation)->beginTransparencyGroup();
+ pImplementation->beginTransparencyGroup();
}
void PDFWriter::EndTransparencyGroup( const Rectangle& rRect, sal_uInt16 nTransparentPercent )
{
- ((PDFWriterImpl*)pImplementation)->endTransparencyGroup( rRect, nTransparentPercent );
+ pImplementation->endTransparencyGroup( rRect, nTransparentPercent );
}
void PDFWriter::Push( sal_uInt16 nFlags )
{
- ((PDFWriterImpl*)pImplementation)->push( nFlags );
+ pImplementation->push( nFlags );
}
void PDFWriter::Pop()
{
- ((PDFWriterImpl*)pImplementation)->pop();
+ pImplementation->pop();
}
void PDFWriter::SetMapMode( const MapMode& rMapMode )
{
- ((PDFWriterImpl*)pImplementation)->setMapMode( rMapMode );
+ pImplementation->setMapMode( rMapMode );
}
void PDFWriter::SetLineColor( const Color& rColor )
{
- ((PDFWriterImpl*)pImplementation)->setLineColor( rColor );
+ pImplementation->setLineColor( rColor );
}
void PDFWriter::SetFillColor( const Color& rColor )
{
- ((PDFWriterImpl*)pImplementation)->setFillColor( rColor );
+ pImplementation->setFillColor( rColor );
}
void PDFWriter::SetClipRegion()
{
- ((PDFWriterImpl*)pImplementation)->clearClipRegion();
+ pImplementation->clearClipRegion();
}
void PDFWriter::SetClipRegion( const basegfx::B2DPolyPolygon& rRegion )
{
- ((PDFWriterImpl*)pImplementation)->setClipRegion( rRegion );
+ pImplementation->setClipRegion( rRegion );
}
void PDFWriter::MoveClipRegion( long nHorzMove, long nVertMove )
{
- ((PDFWriterImpl*)pImplementation)->moveClipRegion( nHorzMove, nVertMove );
+ pImplementation->moveClipRegion( nHorzMove, nVertMove );
}
void PDFWriter::IntersectClipRegion( const basegfx::B2DPolyPolygon& rRegion )
{
- ((PDFWriterImpl*)pImplementation)->intersectClipRegion( rRegion );
+ pImplementation->intersectClipRegion( rRegion );
}
void PDFWriter::IntersectClipRegion( const Rectangle& rRect )
{
- ((PDFWriterImpl*)pImplementation)->intersectClipRegion( rRect );
+ pImplementation->intersectClipRegion( rRect );
}
void PDFWriter::SetLayoutMode( sal_uLong nMode )
{
- ((PDFWriterImpl*)pImplementation)->setLayoutMode( (sal_Int32)nMode );
+ pImplementation->setLayoutMode( (sal_Int32)nMode );
}
void PDFWriter::SetDigitLanguage( LanguageType eLang )
{
- ((PDFWriterImpl*)pImplementation)->setDigitLanguage( eLang );
+ pImplementation->setDigitLanguage( eLang );
}
void PDFWriter::SetTextColor( const Color& rColor )
{
- ((PDFWriterImpl*)pImplementation)->setTextColor( rColor );
+ pImplementation->setTextColor( rColor );
}
void PDFWriter::SetTextFillColor()
{
- ((PDFWriterImpl*)pImplementation)->setTextFillColor();
+ pImplementation->setTextFillColor();
}
void PDFWriter::SetTextFillColor( const Color& rColor )
{
- ((PDFWriterImpl*)pImplementation)->setTextFillColor( rColor );
+ pImplementation->setTextFillColor( rColor );
}
void PDFWriter::SetTextLineColor()
{
- ((PDFWriterImpl*)pImplementation)->setTextLineColor();
+ pImplementation->setTextLineColor();
}
void PDFWriter::SetTextLineColor( const Color& rColor )
{
- ((PDFWriterImpl*)pImplementation)->setTextLineColor( rColor );
+ pImplementation->setTextLineColor( rColor );
}
void PDFWriter::SetOverlineColor()
{
- ((PDFWriterImpl*)pImplementation)->setOverlineColor();
+ pImplementation->setOverlineColor();
}
void PDFWriter::SetOverlineColor( const Color& rColor )
{
- ((PDFWriterImpl*)pImplementation)->setOverlineColor( rColor );
+ pImplementation->setOverlineColor( rColor );
}
void PDFWriter::SetTextAlign( ::TextAlign eAlign )
{
- ((PDFWriterImpl*)pImplementation)->setTextAlign( eAlign );
+ pImplementation->setTextAlign( eAlign );
}
void PDFWriter::DrawJPGBitmap( SvStream& rStreamData, bool bIsTrueColor, const Size& rSrcSizePixel, const Rectangle& rTargetArea, const Bitmap& rMask )
{
- ((PDFWriterImpl*)pImplementation)->drawJPGBitmap( rStreamData, bIsTrueColor, rSrcSizePixel, rTargetArea, rMask );
+ pImplementation->drawJPGBitmap( rStreamData, bIsTrueColor, rSrcSizePixel, rTargetArea, rMask );
}
sal_Int32 PDFWriter::CreateLink( const Rectangle& rRect, sal_Int32 nPageNr )
{
- return ((PDFWriterImpl*)pImplementation)->createLink( rRect, nPageNr );
+ return pImplementation->createLink( rRect, nPageNr );
}
sal_Int32 PDFWriter::RegisterDestReference( sal_Int32 nDestId, const Rectangle& rRect, sal_Int32 nPageNr, DestAreaType eType )
{
- return ((PDFWriterImpl*)pImplementation)->registerDestReference( nDestId, rRect, nPageNr, eType );
+ return pImplementation->registerDestReference( nDestId, rRect, nPageNr, eType );
}
//--->i56629
sal_Int32 PDFWriter::CreateNamedDest( const rtl::OUString& sDestName, const Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType )
{
- return ((PDFWriterImpl*)pImplementation)->createNamedDest( sDestName, rRect, nPageNr, eType );
+ return pImplementation->createNamedDest( sDestName, rRect, nPageNr, eType );
}
sal_Int32 PDFWriter::CreateDest( const Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType )
{
- return ((PDFWriterImpl*)pImplementation)->createDest( rRect, nPageNr, eType );
+ return pImplementation->createDest( rRect, nPageNr, eType );
}
sal_Int32 PDFWriter::SetLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId )
{
- return ((PDFWriterImpl*)pImplementation)->setLinkDest( nLinkId, nDestId );
+ return pImplementation->setLinkDest( nLinkId, nDestId );
}
sal_Int32 PDFWriter::SetLinkURL( sal_Int32 nLinkId, const rtl::OUString& rURL )
{
- return ((PDFWriterImpl*)pImplementation)->setLinkURL( nLinkId, rURL );
+ return pImplementation->setLinkURL( nLinkId, rURL );
}
void PDFWriter::SetLinkPropertyID( sal_Int32 nLinkId, sal_Int32 nPropertyId )
{
- ((PDFWriterImpl*)pImplementation)->setLinkPropertyId( nLinkId, nPropertyId );
+ pImplementation->setLinkPropertyId( nLinkId, nPropertyId );
}
sal_Int32 PDFWriter::CreateOutlineItem( sal_Int32 nParent, const rtl::OUString& rText, sal_Int32 nDestID )
{
- return ((PDFWriterImpl*)pImplementation)->createOutlineItem( nParent, rText, nDestID );
+ return pImplementation->createOutlineItem( nParent, rText, nDestID );
}
sal_Int32 PDFWriter::SetOutlineItemParent( sal_Int32 nItem, sal_Int32 nNewParent )
{
- return ((PDFWriterImpl*)pImplementation)->setOutlineItemParent( nItem, nNewParent );
+ return pImplementation->setOutlineItemParent( nItem, nNewParent );
}
sal_Int32 PDFWriter::SetOutlineItemText( sal_Int32 nItem, const rtl::OUString& rText )
{
- return ((PDFWriterImpl*)pImplementation)->setOutlineItemText( nItem, rText );
+ return pImplementation->setOutlineItemText( nItem, rText );
}
sal_Int32 PDFWriter::SetOutlineItemDest( sal_Int32 nItem, sal_Int32 nDest )
{
- return ((PDFWriterImpl*)pImplementation)->setOutlineItemDest( nItem, nDest );
+ return pImplementation->setOutlineItemDest( nItem, nDest );
}
void PDFWriter::CreateNote( const Rectangle& rRect, const PDFNote& rNote, sal_Int32 nPageNr )
{
- ((PDFWriterImpl*)pImplementation)->createNote( rRect, rNote, nPageNr );
+ pImplementation->createNote( rRect, rNote, nPageNr );
}
sal_Int32 PDFWriter::BeginStructureElement( PDFWriter::StructElement eType, const rtl::OUString& rAlias )
{
- return ((PDFWriterImpl*)pImplementation)->beginStructureElement( eType, rAlias );
+ return pImplementation->beginStructureElement( eType, rAlias );
}
void PDFWriter::EndStructureElement()
{
- ((PDFWriterImpl*)pImplementation)->endStructureElement();
+ pImplementation->endStructureElement();
}
bool PDFWriter::SetCurrentStructureElement( sal_Int32 nID )
{
- return ((PDFWriterImpl*)pImplementation)->setCurrentStructureElement( nID );
+ return pImplementation->setCurrentStructureElement( nID );
}
bool PDFWriter::SetStructureAttribute( enum StructAttribute eAttr, enum StructAttributeValue eVal )
{
- return ((PDFWriterImpl*)pImplementation)->setStructureAttribute( eAttr, eVal );
+ return pImplementation->setStructureAttribute( eAttr, eVal );
}
bool PDFWriter::SetStructureAttributeNumerical( enum StructAttribute eAttr, sal_Int32 nValue )
{
- return ((PDFWriterImpl*)pImplementation)->setStructureAttributeNumerical( eAttr, nValue );
+ return pImplementation->setStructureAttributeNumerical( eAttr, nValue );
}
void PDFWriter::SetStructureBoundingBox( const Rectangle& rRect )
{
- ((PDFWriterImpl*)pImplementation)->setStructureBoundingBox( rRect );
+ pImplementation->setStructureBoundingBox( rRect );
}
void PDFWriter::SetActualText( const String& rText )
{
- ((PDFWriterImpl*)pImplementation)->setActualText( rText );
+ pImplementation->setActualText( rText );
}
void PDFWriter::SetAlternateText( const String& rText )
{
- ((PDFWriterImpl*)pImplementation)->setAlternateText( rText );
+ pImplementation->setAlternateText( rText );
}
void PDFWriter::SetAutoAdvanceTime( sal_uInt32 nSeconds, sal_Int32 nPageNr )
{
- ((PDFWriterImpl*)pImplementation)->setAutoAdvanceTime( nSeconds, nPageNr );
+ pImplementation->setAutoAdvanceTime( nSeconds, nPageNr );
}
void PDFWriter::SetPageTransition( PDFWriter::PageTransition eType, sal_uInt32 nMilliSec, sal_Int32 nPageNr )
{
- ((PDFWriterImpl*)pImplementation)->setPageTransition( eType, nMilliSec, nPageNr );
+ pImplementation->setPageTransition( eType, nMilliSec, nPageNr );
}
sal_Int32 PDFWriter::CreateControl( const PDFWriter::AnyWidget& rControl, sal_Int32 nPageNr )
{
- return ((PDFWriterImpl*)pImplementation)->createControl( rControl, nPageNr );
+ return pImplementation->createControl( rControl, nPageNr );
}
PDFOutputStream::~PDFOutputStream()
@@ -451,12 +450,12 @@ PDFOutputStream::~PDFOutputStream()
void PDFWriter::AddStream( const String& rMimeType, PDFOutputStream* pStream, bool bCompress )
{
- ((PDFWriterImpl*)pImplementation)->addStream( rMimeType, pStream, bCompress );
+ pImplementation->addStream( rMimeType, pStream, bCompress );
}
std::set< PDFWriter::ErrorCode > PDFWriter::GetErrors()
{
- return ((PDFWriterImpl*)pImplementation)->getErrors();
+ return pImplementation->getErrors();
}
com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >
@@ -470,7 +469,7 @@ PDFWriter::InitEncryption( const rtl::OUString& i_rOwnerPassword,
void PDFWriter::PlayMetafile( const GDIMetaFile& i_rMTF, const vcl::PDFWriter::PlayMetafileContext& i_rPlayContext, PDFExtOutDevData* i_pData )
{
- ((PDFWriterImpl*)pImplementation)->playMetafile( i_rMTF, i_pData, i_rPlayContext, NULL);
+ pImplementation->playMetafile( i_rMTF, i_pData, i_rPlayContext, NULL);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list