diff options
author | Thomas Benisch <tbe@openoffice.org> | 2001-02-05 11:24:09 +0000 |
---|---|---|
committer | Thomas Benisch <tbe@openoffice.org> | 2001-02-05 11:24:09 +0000 |
commit | 50c42e651b434336010ae49eca0c3949ee1b2b26 (patch) | |
tree | 4e0c7562a7c8c0f1dc68b1d0c992ab658f33b2e6 /extensions | |
parent | 1d314f5b5914e144e57dccbffdf63b14f76126bb (diff) |
get standard color table if SID_COLOR_TABLE item not available
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/propctrlr/standardcontrol.cxx | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx index 239cd720472a..b4928303c221 100644 --- a/extensions/source/propctrlr/standardcontrol.cxx +++ b/extensions/source/propctrlr/standardcontrol.cxx @@ -2,9 +2,9 @@ * * $RCSfile: standardcontrol.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2001-01-24 14:12:53 $ + * last change: $Author: tbe $ $Date: 2001-02-05 12:24:09 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -101,6 +101,10 @@ #endif //================================================================== +#ifndef _OFF_APP_HXX +#include <offmgr/app.hxx> +#endif + //............................................................................ namespace pcr { @@ -509,21 +513,27 @@ namespace pcr if (pDocSh) { + XColorTable* pColorTbl; const SfxPoolItem* pColorItem = pDocSh->GetItem( SID_COLOR_TABLE ); if (pColorItem) { DBG_ASSERT(pColorItem->ISA(SvxColorTableItem), "OColorControl::OColorControl: invalid color item!"); SvxColorTableItem aItem( *static_cast< const SvxColorTableItem*>( pColorItem ) ); - XColorTable* pColorTbl = aItem.GetColorTable(); - DBG_ASSERT(pColorTbl, "OColorControl::OColorControl: no color table!"); + pColorTbl = aItem.GetColorTable(); + } + else // BasicDocShell has no color item + { + pColorTbl = OFF_APP()->GetStdColorTable(); + } - if (pColorTbl) + DBG_ASSERT(pColorTbl, "OColorControl::OColorControl: no color table!"); + + if (pColorTbl) + { + for (sal_uInt16 i = 0; i < pColorTbl->Count(); ++i) { - for (sal_uInt16 i = 0; i < pColorTbl->Count(); ++i) - { - XColorEntry* pEntry = pColorTbl->Get( i ); - InsertEntry( pEntry->GetColor(), pEntry->GetName() ); - } + XColorEntry* pEntry = pColorTbl->Get( i ); + InsertEntry( pEntry->GetColor(), pEntry->GetName() ); } } } @@ -1236,6 +1246,9 @@ namespace pcr /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.2 2001/01/24 14:12:53 fs + * recognize and tolerate a missing SID_COLOR_TABLE item + * * Revision 1.1 2001/01/12 11:33:20 fs * initial checkin - outsourced the form property browser * |