summaryrefslogtreecommitdiff
path: root/include/vcl
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2014-03-12 23:36:17 +1100
committerNorbert Thiebaud <nthiebaud@gmail.com>2014-03-21 19:10:30 +0000
commit143c059ff7f69a363b3cf736a9f0197a9f25cf9c (patch)
tree4042b695c3ea9676dad869ca9220c31b4e47fb62 /include/vcl
parent9dc4377c91b00585519abfd4fc1528393fe84e4a (diff)
fdo#74702 Moved ImplReleaseGraphics into correct classes
Made OutputDevice::ImplReleaseGraphics a pure virtual function, then implemented function in Printer, Window and VirtualDevice. The reason was that OutputDevice was checking to see if it was a Printer, Window or VirtualDevice that was calling on it in an if statement, very uncool :-) Now I let the classes themselves do the work. There is some common functionality, which is to release the fonts. I have put this into a protected OutputDevice function, ImplReleaseFonts. Change-Id: Id41db2119d4022ea2fc7855158ca9f610af3c85c Reviewed-on: https://gerrit.libreoffice.org/8548 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'include/vcl')
-rw-r--r--include/vcl/outdev.hxx6
-rw-r--r--include/vcl/print.hxx2
-rw-r--r--include/vcl/virdev.hxx1
-rw-r--r--include/vcl/window.hxx1
4 files changed, 9 insertions, 1 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index c53955650ad3..67b7a1f435e8 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -352,6 +352,10 @@ private:
mutable bool mbRefPoint : 1;
mutable bool mbEnableRTL : 1;
+
+protected:
+ virtual void ImplReleaseFonts();
+
public:
/** @name Initialization and accessor functions
*/
@@ -393,7 +397,7 @@ public:
@param bRelease Determines whether to release the fonts of the
physically released graphics device.
*/
- SAL_DLLPRIVATE void ImplReleaseGraphics( bool bRelease = true );
+ virtual void ImplReleaseGraphics( bool bRelease = true ) = 0;
/** Initialize the graphics device's data structures.
*/
diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx
index 2e8098d38376..0f5897d241c3 100644
--- a/include/vcl/print.hxx
+++ b/include/vcl/print.hxx
@@ -248,6 +248,8 @@ private:
Link maErrorHdl;
bool ImplInitGraphics() const;
+ void ImplReleaseGraphics( bool bRelease = true );
+ void ImplReleaseFonts();
SAL_DLLPRIVATE void ImplInitData();
SAL_DLLPRIVATE void ImplInit( SalPrinterQueueInfo* pInfo );
SAL_DLLPRIVATE void ImplInitDisplay( const Window* pWindow );
diff --git a/include/vcl/virdev.hxx b/include/vcl/virdev.hxx
index b78495d24e16..72cc3fe95e84 100644
--- a/include/vcl/virdev.hxx
+++ b/include/vcl/virdev.hxx
@@ -62,6 +62,7 @@ private:
{ return ((meRefDevMode & REFDEV_FORCE_ZERO_EXTLEAD) != 0); }
public:
bool ImplInitGraphics() const;
+ void ImplReleaseGraphics( bool bRelease = true );
public:
/** Create a virtual device of size 1x1
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 62aa5c8b3219..8d76850eb7fc 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -375,6 +375,7 @@ private:
public:
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSystemParentData );
bool ImplInitGraphics() const;
+ void ImplReleaseGraphics( bool bRelease = true );
SAL_DLLPRIVATE WinBits ImplInitRes( const ResId& rResId );
SAL_DLLPRIVATE WindowResHeader ImplLoadResHeader( const ResId& rResId );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );