From 96cdfa532e72094b552e2b869b6876ee920b733b Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Thu, 10 May 2007 08:16:34 +0000 Subject: INTEGRATION: CWS impress120_SRC680 (1.15.216); FILE MERGED 2007/04/16 08:23:50 af 1.15.216.1: #i76018# Constructor of SvxColorDockingWindow takes doc shell from view shell. --- svx/source/tbxctrls/colrctrl.cxx | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'svx/source/tbxctrls/colrctrl.cxx') diff --git a/svx/source/tbxctrls/colrctrl.cxx b/svx/source/tbxctrls/colrctrl.cxx index b71f78e55579..9dcaa2f3f5c4 100644 --- a/svx/source/tbxctrls/colrctrl.cxx +++ b/svx/source/tbxctrls/colrctrl.cxx @@ -4,9 +4,9 @@ * * $RCSfile: colrctrl.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: rt $ $Date: 2007-04-26 07:52:38 $ + * last change: $Author: kz $ $Date: 2007-05-10 09:16:34 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -318,7 +318,24 @@ SvxColorDockingWindow::SvxColorDockingWindow aColorSet.SetStyle( aColorSet.GetStyle() | WB_ITEMBORDER ); aColorSet.SetSelectHdl( LINK( this, SvxColorDockingWindow, SelectHdl ) ); - SfxObjectShell* pDocSh = SfxObjectShell::Current(); + // Get the model from the view shell. Using SfxObjectShell::Current() + // is unreliable when called at the wrong times. + SfxObjectShell* pDocSh = NULL; + if (_pBindings != NULL) + { + SfxDispatcher* pDispatcher = _pBindings->GetDispatcher(); + if (pDispatcher != NULL) + { + SfxViewFrame* pFrame = pDispatcher->GetFrame(); + if (pFrame != NULL) + { + SfxViewShell* pViewShell = pFrame->GetViewShell(); + if (pViewShell != NULL) + pDocSh = pViewShell->GetObjectShell(); + } + } + } + if ( pDocSh ) { const SfxPoolItem* pItem = pDocSh->GetItem( SID_COLOR_TABLE ); -- cgit