summaryrefslogtreecommitdiff
path: root/svx/source/tbxctrls/colrctrl.cxx
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2007-05-10 08:16:34 +0000
committerKurt Zenker <kz@openoffice.org>2007-05-10 08:16:34 +0000
commit96cdfa532e72094b552e2b869b6876ee920b733b (patch)
tree7a21eb359c1c01fbbe9821eb0d5a5d0175d5c16f /svx/source/tbxctrls/colrctrl.cxx
parent722d215512062f45ca868132d4dd9ec1374dad4c (diff)
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.
Diffstat (limited to 'svx/source/tbxctrls/colrctrl.cxx')
-rw-r--r--svx/source/tbxctrls/colrctrl.cxx23
1 files changed, 20 insertions, 3 deletions
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 );