diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-03-10 23:42:13 +1100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-03-11 11:29:02 -0500 |
commit | e69615ccb016de1c64864bbc9cf1bbef9f50c1da (patch) | |
tree | dc46cc3bc0438bfc828b72a56d8d731e53d4addc /include/vcl/virdev.hxx | |
parent | 736420454a7ff46ffc298221e176443f06775634 (diff) |
fdo#74702 Moved ImplInitGraphics into correct classes
Currently we check to see what type of class is being used. This
really violates the Single Responsibility Principle, and tightly
couples the code to OutputDevice. The responsibility for initializing
graphics should be done by Printer, VirtualDevice and Window.
Please note: to get this working, I've had to make Printer a friend
class of VirtualDevice. I'm not entirely happy about this, I'll
need to revisit this later when I look at Printer in more detail.
For now, this is a hack to allow me to seperate out this function.
Change-Id: I9d5946c22fa70670a4f85bf338b4209499d0aa54
Reviewed-on: https://gerrit.libreoffice.org/8528
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/vcl/virdev.hxx')
-rw-r--r-- | include/vcl/virdev.hxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/vcl/virdev.hxx b/include/vcl/virdev.hxx index 3450509c96d8..25ef11c207a6 100644 --- a/include/vcl/virdev.hxx +++ b/include/vcl/virdev.hxx @@ -31,15 +31,16 @@ class VCL_DLLPUBLIC VirtualDevice : public OutputDevice { friend class Application; friend class OutputDevice; + friend class Printer; private: SalVirtualDevice* mpVirDev; VirtualDevice* mpPrev; VirtualDevice* mpNext; - sal_uInt16 mnBitCount; + sal_uInt16 mnBitCount; bool mbScreenComp; sal_Int8 mnAlphaDepth; - sal_uInt8 meRefDevMode; + sal_uInt8 meRefDevMode; SAL_DLLPRIVATE void ImplInitVirDev( const OutputDevice* pOutDev, long nDX, long nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData = NULL ); SAL_DLLPRIVATE bool InnerImplSetOutputSizePixel( const Size& rNewSize, bool bErase, const basebmp::RawMemorySharedArray &pBuffer ); @@ -60,6 +61,9 @@ private: SAL_DLLPRIVATE bool ForceZeroExtleadBug() const { return ((meRefDevMode & REFDEV_FORCE_ZERO_EXTLEAD) != 0); } public: + bool ImplInitGraphics() const; + +public: /** Create a virtual device of size 1x1 @param nBitCount |