summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2011-09-27 12:37:00 +0100
committerMichael Meeks <michael.meeks@suse.com>2011-09-27 15:07:12 +0100
commit642553238cc531f39049150ff52cf4e152b5abe6 (patch)
tree01e757db902775fe32e3af3ec43f9df7f8dac138 /vcl
parentbc406a77b582ab799428b9fbf05afdbed75dbeb7 (diff)
add GetParentDialog to VCL's Window, and remove DLGWIN & cut/paste
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/vcl/window.hxx2
-rw-r--r--vcl/source/window/window2.cxx16
2 files changed, 18 insertions, 0 deletions
diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx
index bc93404d5c63..ba52258f9103 100644
--- a/vcl/inc/vcl/window.hxx
+++ b/vcl/inc/vcl/window.hxx
@@ -731,6 +731,8 @@ public:
void SetParent( Window* pNewParent );
Window* GetParent() const;
+ // return the dialog we are contained in or NULL if un-contained
+ Window* GetParentDialog() const;
void Show( sal_Bool bVisible = sal_True, sal_uInt16 nFlags = 0 );
void Hide( sal_uInt16 nFlags = 0 ) { Show( sal_False, nFlags ); }
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index ee607c4dbd27..47492db1c9fc 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -1478,6 +1478,22 @@ WindowType Window::GetType() const
{
return mpWindowImpl->mnType;
}
+
+Window* Window::GetParentDialog() const
+{
+ const Window *pWindow = this;
+
+ while( pWindow )
+ {
+ if( pWindow->IsDialog() )
+ break;
+
+ pWindow = pWindow->GetParent();
+ }
+
+ return const_cast<Window *>(pWindow);
+}
+
sal_Bool Window::IsSystemWindow() const
{
return mpWindowImpl->mbSysWin;