diff options
-rw-r--r-- | filter/source/pdf/pdfexport.cxx | 8 | ||||
-rw-r--r-- | include/vcl/pdfwriter.hxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.hxx | 10 |
5 files changed, 14 insertions, 12 deletions
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index 2c4849fd9928..4fdd7a450626 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -1009,12 +1009,14 @@ void PDFExport::showErrors( const std::set< vcl::PDFWriter::ErrorCode >& rErrors bool PDFExport::ImplExportPage( vcl::PDFWriter& rWriter, vcl::PDFExtOutDevData& rPDFExtOutDevData, const GDIMetaFile& rMtf ) { - const Size aSizePDF( OutputDevice::LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MapUnit::MapPoint ) ); + basegfx::B2DPolygon aSize(tools::Polygon(tools::Rectangle(Point(0, 0), rMtf.GetPrefSize())).getB2DPolygon()); + basegfx::B2DPolygon aSizePDF(OutputDevice::LogicToLogic(aSize, rMtf.GetPrefMapMode(), MapUnit::MapPoint)); + basegfx::B2DRange aRangePDF(aSizePDF.getB2DRange()); Point aOrigin; tools::Rectangle aPageRect( aOrigin, rMtf.GetPrefSize() ); bool bRet = true; - rWriter.NewPage( aSizePDF.Width(), aSizePDF.Height() ); + rWriter.NewPage( aRangePDF.getWidth(), aRangePDF.getHeight() ); rWriter.SetMapMode( rMtf.GetPrefMapMode() ); vcl::PDFWriter::PlayMetafileContext aCtx; @@ -1042,7 +1044,7 @@ bool PDFExport::ImplExportPage( vcl::PDFWriter& rWriter, vcl::PDFExtOutDevData& rPDFExtOutDevData.ResetSyncData(); if (!msWatermark.isEmpty()) - ImplWriteWatermark( rWriter, aSizePDF ); + ImplWriteWatermark( rWriter, Size(aRangePDF.getWidth(), aRangePDF.getHeight()) ); return bRet; } diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx index bc2608444714..78a28231ea10 100644 --- a/include/vcl/pdfwriter.hxx +++ b/include/vcl/pdfwriter.hxx @@ -689,7 +689,7 @@ The following structure describes the permissions used in PDF security Colors and other state information MUST be set again or are undefined. */ - void NewPage( sal_Int32 nPageWidth, sal_Int32 nPageHeight, Orientation eOrientation = Orientation::Inherit ); + void NewPage( double nPageWidth, double nPageHeight, Orientation eOrientation = Orientation::Inherit ); /** Play a metafile like an outputdevice would do */ struct PlayMetafileContext diff --git a/vcl/source/gdi/pdfwriter.cxx b/vcl/source/gdi/pdfwriter.cxx index ec612820e15d..28a176ba3c51 100644 --- a/vcl/source/gdi/pdfwriter.cxx +++ b/vcl/source/gdi/pdfwriter.cxx @@ -53,7 +53,7 @@ OutputDevice* PDFWriter::GetReferenceDevice() return xImplementation->getReferenceDevice(); } -void PDFWriter::NewPage( sal_Int32 nPageWidth, sal_Int32 nPageHeight, Orientation eOrientation ) +void PDFWriter::NewPage( double nPageWidth, double nPageHeight, Orientation eOrientation ) { xImplementation->newPage( nPageWidth, nPageHeight, eOrientation ); } diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index be614657c57b..a4a7ed68ac34 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -1126,7 +1126,7 @@ void PDFWriterImpl::ResourceDict::append( OStringBuffer& rBuf, sal_Int32 nFontDi rBuf.append( "]\n>>\n" ); }; -PDFWriterImpl::PDFPage::PDFPage( PDFWriterImpl* pWriter, sal_Int32 nPageWidth, sal_Int32 nPageHeight, PDFWriter::Orientation eOrientation ) +PDFWriterImpl::PDFPage::PDFPage( PDFWriterImpl* pWriter, double nPageWidth, double nPageHeight, PDFWriter::Orientation eOrientation ) : m_pWriter( pWriter ), m_nPageWidth( nPageWidth ), @@ -2258,7 +2258,7 @@ LogicalFontInstance* PdfBuiltinFontFace::CreateFontInstance( FontSelectPattern& } -void PDFWriterImpl::newPage( sal_Int32 nPageWidth, sal_Int32 nPageHeight, PDFWriter::Orientation eOrientation ) +void PDFWriterImpl::newPage( double nPageWidth, double nPageHeight, PDFWriter::Orientation eOrientation ) { endPage(); m_nCurrentPage = m_aPages.size(); diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx index c65e24075e0b..0132897f71ee 100644 --- a/vcl/source/gdi/pdfwriter_impl.hxx +++ b/vcl/source/gdi/pdfwriter_impl.hxx @@ -135,8 +135,8 @@ public: struct PDFPage { PDFWriterImpl* m_pWriter; - sal_Int32 m_nPageWidth; // in inch/72 - sal_Int32 m_nPageHeight; // in inch/72 + double m_nPageWidth; // in inch/72 + double m_nPageHeight; // in inch/72 PDFWriter::Orientation m_eOrientation; sal_Int32 m_nPageObject; sal_Int32 m_nPageIndex; @@ -150,7 +150,7 @@ public: sal_uInt32 m_nDuration; bool m_bHasWidgets; - PDFPage( PDFWriterImpl* pWriter, sal_Int32 nPageWidth, sal_Int32 nPageHeight, PDFWriter::Orientation eOrientation ); + PDFPage( PDFWriterImpl* pWriter, double nPageWidth, double nPageHeight, PDFWriter::Orientation eOrientation ); ~PDFPage(); void beginStream(); @@ -191,7 +191,7 @@ public: // appends a horizontal waveline with vertical offset (helper for drawWaveLine) void appendWaveLine( sal_Int32 nLength, sal_Int32 nYOffset, sal_Int32 nDelta, OStringBuffer& rBuffer ) const; - sal_Int32 getHeight() const { return m_nPageHeight ? m_nPageHeight : m_pWriter->m_nInheritedPageHeight; } + double getHeight() const { return m_nPageHeight ? m_nPageHeight : m_pWriter->m_nInheritedPageHeight; } }; friend struct PDFPage; @@ -1079,7 +1079,7 @@ public: OutputDevice* getReferenceDevice(); /* document structure */ - void newPage( sal_Int32 nPageWidth , sal_Int32 nPageHeight, PDFWriter::Orientation eOrientation ); + void newPage( double nPageWidth , double nPageHeight, PDFWriter::Orientation eOrientation ); bool emit(); const std::set< PDFWriter::ErrorCode > & getErrors() const { return m_aErrors;} void insertError( PDFWriter::ErrorCode eErr ) { m_aErrors.insert( eErr ); } |