summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2018-10-22 18:34:06 +0000
committerJan-Marek Glogowski <glogow@fbihome.de>2018-10-24 11:52:43 +0200
commitb85ff98383942360901b8242cf77366782400426 (patch)
tree7f895e035daaacdf0679dcb4236cdb188b70a034 /include
parent4b46826ec2219935ebcf86ed6e6db73910122e72 (diff)
Change PDFWriterImpl into an OutputDevice
It actually changes it into a VirtualDevice and should just be a refactoring. We get rid of the crude stuff in a follow up patch, While at it unfriend PDFWriterImpl from OutputDevice. Change-Id: Id43731ad076690292c30f9f3e05ff0dd58edc5e5 Reviewed-on: https://gerrit.libreoffice.org/62201 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'include')
-rw-r--r--include/vcl/outdev.hxx23
-rw-r--r--include/vcl/pdfwriter.hxx6
2 files changed, 16 insertions, 13 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 72d5ae57dca9..4980757a4b1a 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -328,7 +328,6 @@ class VCL_DLLPUBLIC OutputDevice : public virtual VclReferenceBase
friend class VirtualDevice;
friend class vcl::Window;
friend class WorkWindow;
- friend class vcl::PDFWriterImpl;
friend void ImplHandleResize( vcl::Window* pWindow, long nNewWidth, long nNewHeight );
private:
@@ -347,7 +346,7 @@ private:
std::unique_ptr<OutDevStateStack> mpOutDevStateStack;
std::unique_ptr<ImplOutDevData> mpOutDevData;
std::vector< VCLXGraphics* >* mpUnoGraphicsList;
- vcl::PDFWriterImpl* mpPDFWriter;
+ VclPtr<OutputDevice> mpPDFWriter;
vcl::ExtOutDevData* mpExtOutDevData;
// TEMP TEMP TEMP
@@ -550,7 +549,7 @@ public:
*/
bool SupportsOperation( OutDevSupportType ) const;
- vcl::PDFWriterImpl* GetPDFWriter() const { return mpPDFWriter; }
+ vcl::PDFWriterImpl* GetPDFWriter() const;
void SetExtOutDevData( vcl::ExtOutDevData* pExtOutDevData ) { mpExtOutDevData = pExtOutDevData; }
vcl::ExtOutDevData* GetExtOutDevData() const { return mpExtOutDevData; }
@@ -1181,12 +1180,13 @@ public:
vcl::TextLayoutCache const* = nullptr) const;
std::shared_ptr<vcl::TextLayoutCache> CreateTextLayoutCache(OUString const&) const;
-private:
- SAL_DLLPRIVATE void ImplInitTextColor();
-
+protected:
SAL_DLLPRIVATE void ImplInitTextLineSize();
SAL_DLLPRIVATE void ImplInitAboveTextLineSize();
-
+ static
+ SAL_DLLPRIVATE long ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, long nWidth, const OUString& rStr, DrawTextFlags nStyle, const vcl::ITextLayout& _rLayout );
+private:
+ SAL_DLLPRIVATE void ImplInitTextColor();
SAL_DLLPRIVATE void ImplDrawTextDirect( SalLayout&, bool bTextLines);
SAL_DLLPRIVATE void ImplDrawSpecialText( SalLayout& );
@@ -1202,8 +1202,6 @@ private:
SAL_DLLPRIVATE void ImplDrawMnemonicLine( long nX, long nY, long nWidth );
- static
- SAL_DLLPRIVATE long ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, long nWidth, const OUString& rStr, DrawTextFlags nStyle, const vcl::ITextLayout& _rLayout );
///@}
@@ -1289,12 +1287,15 @@ public:
SAL_DLLPRIVATE static void ImplUpdateAllFontData( bool bNewFontLists );
protected:
+ SAL_DLLPRIVATE const LogicalFontInstance* GetFontInstance() const;
+ SAL_DLLPRIVATE long GetEmphasisAscent() const { return mnEmphasisAscent; }
+ SAL_DLLPRIVATE long GetEmphasisDescent() const { return mnEmphasisDescent; }
+ SAL_DLLPRIVATE void SetPDFWriter(vcl::PDFWriterImpl* pPDFWriter);
virtual void InitFont() const;
virtual void SetFontOrientation( LogicalFontInstance* const pFontInstance ) const;
virtual long GetFontExtLeading() const;
-
private:
typedef void ( OutputDevice::* FontUpdateHandler_t )( bool );
@@ -1809,8 +1810,6 @@ public:
SAL_DLLPRIVATE DeviceCoordinate LogicWidthToDeviceCoordinate( long nWidth ) const;
-private:
-
/** Convert a logical X coordinate to a device pixel's X coordinate.
To get the device's X coordinate, it must calculate the mapping offset
diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx
index 04d3e472e649..751f698892f1 100644
--- a/include/vcl/pdfwriter.hxx
+++ b/include/vcl/pdfwriter.hxx
@@ -78,7 +78,11 @@ class VCL_DLLPUBLIC PDFOutputStream
class VCL_DLLPUBLIC PDFWriter
{
- std::unique_ptr<PDFWriterImpl> xImplementation;
+ VclPtr<PDFWriterImpl> xImplementation;
+
+ PDFWriter(const PDFWriter&) = delete;
+ PDFWriter& operator=(const PDFWriter&) = delete;
+
public:
// extended line info
enum CapType { capButt, capRound, capSquare };