summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-03-24 17:52:38 +0000
committerMichael Meeks <michael.meeks@collabora.com>2015-04-10 13:07:52 +0100
commit7acf94a7cfca389e73016ec337708498bc12cc3c (patch)
treeea64b1dd7f8d30f90fbc5ce1049a47513630f381 /vcl
parentbaf676996b8187e5300672b8e381ab7f86ce6fd0 (diff)
vcl: remove curious self referential OutputDevice ptr.
No need to pay a per-instance cost for this, also avoid a self reference for every Window sub-class. Change-Id: I040a0ede9481229e43a39bc23297969e90b95f5e
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/window.cxx21
1 files changed, 16 insertions, 5 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index b04bad14da0f..89679bab4be1 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -581,6 +581,22 @@ Window::~Window()
disposeOnce();
}
+// We will eventually being removing the inheritance of OutputDevice
+// from Window. It will be replaced with a transient relationship such
+// that the OutputDevice is only live for the scope of the Paint method.
+// In the meantime this can help move us towards a Window use an
+// OutputDevice, not being one.
+
+::OutputDevice const* Window::GetOutDev() const
+{
+ return this;
+}
+
+::OutputDevice* Window::GetOutDev()
+{
+ return this;
+}
+
} /* namespace vcl */
WindowImpl::WindowImpl( WindowType nType )
@@ -1195,11 +1211,6 @@ void Window::ImplInitAppFontData( vcl::Window* pWindow )
void Window::ImplInitWindowData( WindowType nType )
{
- // We will eventually being removing the inheritance of OutputDevice from Window.
- // It will be replaced with a composition relationship. A Window will use an OutputDevice,
- // it will not *be* an OutputDevice
- mpOutputDevice = (OutputDevice*)this;
-
mnRefCnt = 0;
mpWindowImpl = new WindowImpl( nType );