1f6e50924SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3f6e50924SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4f6e50924SAndrew Rist * or more contributor license agreements. See the NOTICE file 5f6e50924SAndrew Rist * distributed with this work for additional information 6f6e50924SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7f6e50924SAndrew Rist * to you under the Apache License, Version 2.0 (the 8f6e50924SAndrew Rist * "License"); you may not use this file except in compliance 9f6e50924SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11f6e50924SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13f6e50924SAndrew Rist * Unless required by applicable law or agreed to in writing, 14f6e50924SAndrew Rist * software distributed under the License is distributed on an 15f6e50924SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16f6e50924SAndrew Rist * KIND, either express or implied. See the License for the 17f6e50924SAndrew Rist * specific language governing permissions and limitations 18f6e50924SAndrew Rist * under the License. 19cdf0e10cSrcweir * 20f6e50924SAndrew Rist *************************************************************/ 21f6e50924SAndrew Rist 22cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 23cdf0e10cSrcweir #include "precompiled_svx.hxx" 24cdf0e10cSrcweir 25cdf0e10cSrcweir #include <com/sun/star/container/XNameContainer.hpp> 26cdf0e10cSrcweir #include "svx/XPropertyTable.hxx" 27cdf0e10cSrcweir #include <unotools/ucbstreamhelper.hxx> 28cdf0e10cSrcweir #include <unotools/pathoptions.hxx> 29cdf0e10cSrcweir #include "xmlxtexp.hxx" 30cdf0e10cSrcweir #include "xmlxtimp.hxx" 31cdf0e10cSrcweir #include <sfx2/docfile.hxx> 32cdf0e10cSrcweir #include <tools/urlobj.hxx> 33cdf0e10cSrcweir #include <svx/dialogs.hrc> 34cdf0e10cSrcweir #include <svx/dialmgr.hxx> 35cdf0e10cSrcweir #include <svx/xtable.hxx> 36cdf0e10cSrcweir #include <svx/xpool.hxx> 37cdf0e10cSrcweir 38cdf0e10cSrcweir #define GLOBALOVERFLOW 39cdf0e10cSrcweir 40cdf0e10cSrcweir using namespace com::sun::star; 41cdf0e10cSrcweir using namespace rtl; 42cdf0e10cSrcweir 43cdf0e10cSrcweir sal_Unicode const pszExtColor[] = {'s','o','c'}; 44cdf0e10cSrcweir 45cdf0e10cSrcweir static char const aChckColor[] = { 0x04, 0x00, 'S','O','C','L'}; // < 5.2 46cdf0e10cSrcweir static char const aChckColor0[] = { 0x04, 0x00, 'S','O','C','0'}; // = 5.2 47cdf0e10cSrcweir static char const aChckXML[] = { '<', '?', 'x', 'm', 'l' }; // = 6.0 48cdf0e10cSrcweir 49cdf0e10cSrcweir /************************************************************************* 50cdf0e10cSrcweir |* 5197e8a929SArmin Le Grand |* XColorList::XColorList() 52cdf0e10cSrcweir |* 53cdf0e10cSrcweir *************************************************************************/ 54cdf0e10cSrcweir 55c7be74b1SArmin Le Grand static XColorListSharedPtr aStaticGlobalColorList; 5697e8a929SArmin Le Grand 57c7be74b1SArmin Le Grand XColorList::XColorList( const String& rPath ) : 58c7be74b1SArmin Le Grand XPropertyList( rPath ) 59cdf0e10cSrcweir { 60cdf0e10cSrcweir } 61cdf0e10cSrcweir 62cdf0e10cSrcweir /************************************************************************/ 63cdf0e10cSrcweir 6497e8a929SArmin Le Grand XColorList::~XColorList() 65cdf0e10cSrcweir { 66cdf0e10cSrcweir } 67cdf0e10cSrcweir 68cdf0e10cSrcweir /************************************************************************/ 69cdf0e10cSrcweir 7097e8a929SArmin Le Grand XColorEntry* XColorList::Replace(XColorEntry* pEntry, long nIndex ) 71cdf0e10cSrcweir { 7297e8a929SArmin Le Grand return (XColorEntry*) XPropertyList::Replace(pEntry, nIndex); 73cdf0e10cSrcweir } 74cdf0e10cSrcweir 75cdf0e10cSrcweir /************************************************************************/ 76cdf0e10cSrcweir 7797e8a929SArmin Le Grand XColorEntry* XColorList::Remove(long nIndex) 78cdf0e10cSrcweir { 79c7be74b1SArmin Le Grand return (XColorEntry*) XPropertyList::Remove(nIndex); 80cdf0e10cSrcweir } 81cdf0e10cSrcweir 82cdf0e10cSrcweir /************************************************************************/ 83cdf0e10cSrcweir 8497e8a929SArmin Le Grand XColorEntry* XColorList::GetColor(long nIndex) const 85cdf0e10cSrcweir { 86c7be74b1SArmin Le Grand return (XColorEntry*) XPropertyList::Get(nIndex); 87cdf0e10cSrcweir } 88cdf0e10cSrcweir 89cdf0e10cSrcweir /************************************************************************/ 90cdf0e10cSrcweir 9197e8a929SArmin Le Grand sal_Bool XColorList::Load() 92cdf0e10cSrcweir { 9397e8a929SArmin Le Grand if( mbListDirty ) 94cdf0e10cSrcweir { 9597e8a929SArmin Le Grand mbListDirty = false; 96cdf0e10cSrcweir 9797e8a929SArmin Le Grand INetURLObject aURL( maPath ); 98cdf0e10cSrcweir 99cdf0e10cSrcweir if( INET_PROT_NOT_VALID == aURL.GetProtocol() ) 100cdf0e10cSrcweir { 101*35726d9dSArmin Le Grand OSL_ENSURE( !maPath.Len(), "invalid URL" ); 102cdf0e10cSrcweir return sal_False; 103cdf0e10cSrcweir } 104cdf0e10cSrcweir 10597e8a929SArmin Le Grand aURL.Append( maName ); 106cdf0e10cSrcweir 107cdf0e10cSrcweir if( !aURL.getExtension().getLength() ) 108cdf0e10cSrcweir aURL.setExtension( rtl::OUString( pszExtColor, 3 ) ); 109cdf0e10cSrcweir 110cdf0e10cSrcweir uno::Reference< container::XNameContainer > xTable( SvxUnoXColorTable_createInstance( this ), uno::UNO_QUERY ); 111cdf0e10cSrcweir return SvxXMLXTableImport::load( aURL.GetMainURL( INetURLObject::NO_DECODE ), xTable ); 112cdf0e10cSrcweir } 113cdf0e10cSrcweir return( sal_False ); 114cdf0e10cSrcweir } 115cdf0e10cSrcweir 116cdf0e10cSrcweir /************************************************************************/ 117cdf0e10cSrcweir 11897e8a929SArmin Le Grand sal_Bool XColorList::Save() 119cdf0e10cSrcweir { 12097e8a929SArmin Le Grand INetURLObject aURL( maPath ); 121cdf0e10cSrcweir 122cdf0e10cSrcweir if( INET_PROT_NOT_VALID == aURL.GetProtocol() ) 123cdf0e10cSrcweir { 124*35726d9dSArmin Le Grand OSL_ENSURE( !maPath.Len(), "invalid URL" ); 125cdf0e10cSrcweir return sal_False; 126cdf0e10cSrcweir } 127cdf0e10cSrcweir 12897e8a929SArmin Le Grand aURL.Append( maName ); 129cdf0e10cSrcweir 130cdf0e10cSrcweir if( !aURL.getExtension().getLength() ) 131cdf0e10cSrcweir aURL.setExtension( rtl::OUString( pszExtColor, 3 ) ); 132cdf0e10cSrcweir 133cdf0e10cSrcweir uno::Reference< container::XNameContainer > xTable( SvxUnoXColorTable_createInstance( this ), uno::UNO_QUERY ); 134cdf0e10cSrcweir return SvxXMLXTableExportComponent::save( aURL.GetMainURL( INetURLObject::NO_DECODE ), xTable ); 135cdf0e10cSrcweir } 136cdf0e10cSrcweir 137cdf0e10cSrcweir /************************************************************************/ 138cdf0e10cSrcweir 13997e8a929SArmin Le Grand sal_Bool XColorList::Create() 140cdf0e10cSrcweir { 141cdf0e10cSrcweir XubString aStr; 142cdf0e10cSrcweir xub_StrLen nLen; 143cdf0e10cSrcweir ResMgr& rRes = DIALOG_MGR(); 144cdf0e10cSrcweir 145cdf0e10cSrcweir static sal_uInt16 __READONLY_DATA aResId[] = 146cdf0e10cSrcweir { 147cdf0e10cSrcweir RID_SVXSTR_BLACK, 148cdf0e10cSrcweir RID_SVXSTR_BLUE, 149cdf0e10cSrcweir RID_SVXSTR_GREEN, 150cdf0e10cSrcweir RID_SVXSTR_CYAN, 151cdf0e10cSrcweir RID_SVXSTR_RED, 152cdf0e10cSrcweir RID_SVXSTR_MAGENTA, 153cdf0e10cSrcweir RID_SVXSTR_BROWN, 154cdf0e10cSrcweir RID_SVXSTR_GREY, 155cdf0e10cSrcweir RID_SVXSTR_LIGHTGREY, 156cdf0e10cSrcweir RID_SVXSTR_LIGHTBLUE, 157cdf0e10cSrcweir RID_SVXSTR_LIGHTGREEN, 158cdf0e10cSrcweir RID_SVXSTR_LIGHTCYAN, 159cdf0e10cSrcweir RID_SVXSTR_LIGHTRED, 160cdf0e10cSrcweir RID_SVXSTR_LIGHTMAGENTA, 161cdf0e10cSrcweir RID_SVXSTR_YELLOW, 162cdf0e10cSrcweir RID_SVXSTR_WHITE 163cdf0e10cSrcweir }; 164cdf0e10cSrcweir 165cdf0e10cSrcweir // MT: COL_XXX ist in VCL kein enum mehr!!! 166cdf0e10cSrcweir // COL_WHITE ist seeeehr gross! ( => Zugriff ueber das obige Array hinweg ) 167cdf0e10cSrcweir // Mit der unteren Schleife gibt es keinen Absturtz, aber es ist 168cdf0e10cSrcweir // alles schwarz, weil alles kleine Werte. 169cdf0e10cSrcweir // Ausserdem ist die ganze Vorgehensweise laut MM sehr unperformant 170cdf0e10cSrcweir // => lieber gleich Stringlisten laden. 171cdf0e10cSrcweir 172cdf0e10cSrcweir // BM: ifndef VCL part removed (deprecated) 173cdf0e10cSrcweir 174cdf0e10cSrcweir static ColorData __READONLY_DATA aColTab[] = 175cdf0e10cSrcweir { 176cdf0e10cSrcweir COL_BLACK, 177cdf0e10cSrcweir COL_BLUE, 178cdf0e10cSrcweir COL_GREEN, 179cdf0e10cSrcweir COL_CYAN, 180cdf0e10cSrcweir COL_RED, 181cdf0e10cSrcweir COL_MAGENTA, 182cdf0e10cSrcweir COL_BROWN, 183cdf0e10cSrcweir COL_GRAY, 184cdf0e10cSrcweir COL_LIGHTGRAY, 185cdf0e10cSrcweir COL_LIGHTBLUE, 186cdf0e10cSrcweir COL_LIGHTGREEN, 187cdf0e10cSrcweir COL_LIGHTCYAN, 188cdf0e10cSrcweir COL_LIGHTRED, 189cdf0e10cSrcweir COL_LIGHTMAGENTA, 190cdf0e10cSrcweir COL_YELLOW, 191cdf0e10cSrcweir COL_WHITE 192cdf0e10cSrcweir }; 193cdf0e10cSrcweir 194cdf0e10cSrcweir for( sal_uInt16 n = 0; n < 16; ++n ) 195cdf0e10cSrcweir { 19697e8a929SArmin Le Grand Insert( new XColorEntry( Color( aColTab[n] ), String( ResId( aResId[ n ], rRes )) ), n ); 197cdf0e10cSrcweir } 198cdf0e10cSrcweir 199cdf0e10cSrcweir aStr = SVX_RESSTR( RID_SVXSTR_GREY ); 200cdf0e10cSrcweir aStr.AppendAscii(" 80%"); 201cdf0e10cSrcweir nLen = aStr.Len() - 3; 20297e8a929SArmin Le Grand Insert( new XColorEntry( Color( 51, 51, 51 ), aStr ) , 16); 203cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('7')); 20497e8a929SArmin Le Grand Insert( new XColorEntry( Color( 76, 76, 76 ), aStr ) , 17); 205cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('6')); 20697e8a929SArmin Le Grand Insert( new XColorEntry( Color(102,102,102 ), aStr ) , 18); 207cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('4')); 20897e8a929SArmin Le Grand Insert( new XColorEntry( Color(153,153,153 ), aStr ) , 19); 209cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('3')); 21097e8a929SArmin Le Grand Insert( new XColorEntry( Color(179,179,179 ), aStr ) , 20); 211cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('2')); 21297e8a929SArmin Le Grand Insert( new XColorEntry( Color(204,204,204 ), aStr ) , 21); 213cdf0e10cSrcweir // BM: new 15% 214cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('1')); 215cdf0e10cSrcweir aStr.SetChar(nLen + 1, sal_Unicode('5')); 21697e8a929SArmin Le Grand Insert( new XColorEntry( Color(217,217,217 ), aStr ) , 22); 217cdf0e10cSrcweir aStr.SetChar(nLen + 1, sal_Unicode('0')); 21897e8a929SArmin Le Grand Insert( new XColorEntry( Color(230,230,230 ), aStr ) , 23); 21997e8a929SArmin Le Grand Insert( new XColorEntry( Color(230,230,255 ), SVX_RESSTR( RID_SVXSTR_BLUEGREY ) ) , 24); 220cdf0e10cSrcweir 221cdf0e10cSrcweir aStr = SVX_RESSTR( RID_SVXSTR_RED ); 222cdf0e10cSrcweir aStr.AppendAscii(" 1"); 223cdf0e10cSrcweir nLen = aStr.Len() - 1; 22497e8a929SArmin Le Grand Insert( new XColorEntry( Color(255, 51,102 ), aStr ) , 25); 225cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('2')); 22697e8a929SArmin Le Grand Insert( new XColorEntry( Color(220, 35, 0 ), aStr ) , 26); 227cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('3')); 22897e8a929SArmin Le Grand Insert( new XColorEntry( Color(184, 71, 0 ), aStr ) , 27); 229cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('4')); 23097e8a929SArmin Le Grand Insert( new XColorEntry( Color(255, 51, 51 ), aStr ) , 28); 231cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('5')); 23297e8a929SArmin Le Grand Insert( new XColorEntry( Color(235, 97, 61 ), aStr ) , 29); 233cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('6')); 23497e8a929SArmin Le Grand Insert( new XColorEntry( Color(184, 71, 71 ), aStr ) , 30); 235cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('7')); 23697e8a929SArmin Le Grand Insert( new XColorEntry( Color(184, 0, 71 ), aStr ) , 31); 237cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('8')); 23897e8a929SArmin Le Grand Insert( new XColorEntry( Color(153, 40, 76 ), aStr ) , 32); 239cdf0e10cSrcweir 240cdf0e10cSrcweir aStr = SVX_RESSTR( RID_SVXSTR_MAGENTA ); 241cdf0e10cSrcweir aStr.AppendAscii(" 1"); 242cdf0e10cSrcweir nLen = aStr.Len() - 1; 24397e8a929SArmin Le Grand Insert( new XColorEntry( Color(148, 0,107 ), aStr ) , 33); 244cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('2')); 24597e8a929SArmin Le Grand Insert( new XColorEntry( Color(148, 71,107 ), aStr ) , 34); 246cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('3')); 24797e8a929SArmin Le Grand Insert( new XColorEntry( Color(148, 71,148 ), aStr ) , 35); 248cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('4')); 24997e8a929SArmin Le Grand Insert( new XColorEntry( Color(153,102,204 ), aStr ) , 36); 250cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('5')); 25197e8a929SArmin Le Grand Insert( new XColorEntry( Color(107, 71,148 ), aStr ) , 37); 252cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('6')); 25397e8a929SArmin Le Grand Insert( new XColorEntry( Color(107, 35,148 ), aStr ) , 38); 254cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('7')); 25597e8a929SArmin Le Grand Insert( new XColorEntry( Color(107, 0,148 ), aStr ) , 39); 256cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('8')); 25797e8a929SArmin Le Grand Insert( new XColorEntry( Color( 94, 17,166 ), aStr ) , 40); 258cdf0e10cSrcweir 259cdf0e10cSrcweir aStr = SVX_RESSTR( RID_SVXSTR_BLUE ); 260cdf0e10cSrcweir aStr.AppendAscii(" 1"); 261cdf0e10cSrcweir nLen = aStr.Len() - 1; 26297e8a929SArmin Le Grand Insert( new XColorEntry( Color( 40, 0,153 ), aStr ) , 41); 263cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('2')); 26497e8a929SArmin Le Grand Insert( new XColorEntry( Color( 71, 0,184 ), aStr ) , 42); 265cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('3')); 26697e8a929SArmin Le Grand Insert( new XColorEntry( Color( 35, 0,220 ), aStr ) , 43); 267cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('4')); 26897e8a929SArmin Le Grand Insert( new XColorEntry( Color( 35, 35,220 ), aStr ) , 44); 269cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('5')); 27097e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0, 71,255 ), aStr ) , 45); 271cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('6')); 27297e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0,153,255 ), aStr ) , 46); 273cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('7')); 27497e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0,184,255 ), aStr ) , 47); 275cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('8')); 27697e8a929SArmin Le Grand Insert( new XColorEntry( Color(153,204,255 ), aStr ) , 48); 277cdf0e10cSrcweir //Insert(48, new XColorEntry( Color( 46,215,255 ), aStr ) ); 278cdf0e10cSrcweir 279cdf0e10cSrcweir aStr = SVX_RESSTR( RID_SVXSTR_CYAN ); 280cdf0e10cSrcweir aStr.AppendAscii(" 1"); 281cdf0e10cSrcweir nLen = aStr.Len() - 1; 28297e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0,220,255 ), aStr ) , 49); 283cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('2')); 28497e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0,204,204 ), aStr ) , 50); 285cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('3')); 28697e8a929SArmin Le Grand Insert( new XColorEntry( Color( 35,184,220 ), aStr ) , 51); 287cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('4')); 28897e8a929SArmin Le Grand Insert( new XColorEntry( Color( 71,184,184 ), aStr ) , 52); 289cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('5')); 29097e8a929SArmin Le Grand Insert( new XColorEntry( Color( 51,163,163 ), aStr ) , 53); 291cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('6')); 29297e8a929SArmin Le Grand Insert( new XColorEntry( Color( 25,138,138 ), aStr ) , 54); 293cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('7')); 29497e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0,107,107 ), aStr ) , 55); 295cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('8')); 29697e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0, 74, 74 ), aStr ) , 56); 297cdf0e10cSrcweir 298cdf0e10cSrcweir aStr = SVX_RESSTR( RID_SVXSTR_GREEN ); 299cdf0e10cSrcweir aStr.AppendAscii(" 1"); 300cdf0e10cSrcweir nLen = aStr.Len() - 1; 30197e8a929SArmin Le Grand Insert( new XColorEntry( Color( 53, 94, 0 ), aStr ) , 57); 302cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('2')); 30397e8a929SArmin Le Grand Insert( new XColorEntry( Color( 92,133, 38 ), aStr ) , 58); 304cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('3')); 30597e8a929SArmin Le Grand Insert( new XColorEntry( Color(125,166, 71 ), aStr ) , 59); 306cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('4')); 30797e8a929SArmin Le Grand Insert( new XColorEntry( Color(148,189, 94 ), aStr ) , 60); 308cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('5')); 30997e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0,174, 0 ), aStr ) , 61); 310cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('6')); 31197e8a929SArmin Le Grand Insert( new XColorEntry( Color( 51,204,102 ), aStr ) , 62); 312cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('7')); 31397e8a929SArmin Le Grand Insert( new XColorEntry( Color( 61,235, 61 ), aStr ) , 63); 314cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('8')); 31597e8a929SArmin Le Grand Insert( new XColorEntry( Color( 35,255, 35 ), aStr ) , 64); 316cdf0e10cSrcweir 317cdf0e10cSrcweir aStr = SVX_RESSTR( RID_SVXSTR_YELLOW ); 318cdf0e10cSrcweir aStr.AppendAscii(" 1"); 319cdf0e10cSrcweir nLen = aStr.Len() - 1; 32097e8a929SArmin Le Grand Insert( new XColorEntry( Color(230,255, 0 ), aStr ) , 65); 321cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('2')); 32297e8a929SArmin Le Grand Insert( new XColorEntry( Color(255,255,153 ), aStr ) , 66); 323cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('3')); 32497e8a929SArmin Le Grand Insert( new XColorEntry( Color(255,255,102 ), aStr ) , 67); 325cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('4')); 32697e8a929SArmin Le Grand Insert( new XColorEntry( Color(230,230, 76 ), aStr ) , 68); 327cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('5')); 32897e8a929SArmin Le Grand Insert( new XColorEntry( Color(204,204, 0 ), aStr ) , 69); 329cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('6')); 33097e8a929SArmin Le Grand Insert( new XColorEntry( Color(179,179, 0 ), aStr ) , 70); 331cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('7')); 33297e8a929SArmin Le Grand Insert( new XColorEntry( Color(128,128, 25 ), aStr ) , 71); 333cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('8')); 33497e8a929SArmin Le Grand Insert( new XColorEntry( Color(102,102, 0 ), aStr ) , 72); 335cdf0e10cSrcweir 336cdf0e10cSrcweir aStr = SVX_RESSTR( RID_SVXSTR_BROWN ); 337cdf0e10cSrcweir aStr.AppendAscii(" 1"); 338cdf0e10cSrcweir nLen = aStr.Len() - 1; 33997e8a929SArmin Le Grand Insert( new XColorEntry( Color( 76, 25, 0 ), aStr ) , 73); 340cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('2')); 34197e8a929SArmin Le Grand Insert( new XColorEntry( Color(102, 51, 0 ), aStr ) , 74); 342cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('3')); 34397e8a929SArmin Le Grand Insert( new XColorEntry( Color(128, 76, 25 ), aStr ) , 75); 344cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('4')); 34597e8a929SArmin Le Grand Insert( new XColorEntry( Color(153,102, 51 ), aStr ) , 76); 346cdf0e10cSrcweir 347cdf0e10cSrcweir aStr = SVX_RESSTR( RID_SVXSTR_ORANGE ); 348cdf0e10cSrcweir aStr.AppendAscii(" 1"); 349cdf0e10cSrcweir nLen = aStr.Len() - 1; 35097e8a929SArmin Le Grand Insert( new XColorEntry( Color(204,102, 51 ), aStr ) , 77); 351cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('2')); 35297e8a929SArmin Le Grand Insert( new XColorEntry( Color(255,102, 51 ), aStr ) , 78); 353cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('3')); 35497e8a929SArmin Le Grand Insert( new XColorEntry( Color(255,153,102 ), aStr ) , 79); 355cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('4')); 35697e8a929SArmin Le Grand Insert( new XColorEntry( Color(255,204,153 ), aStr ) , 80); 357cdf0e10cSrcweir 358cdf0e10cSrcweir // new chart colors 359cdf0e10cSrcweir aStr = SVX_RESSTR( RID_SVXSTR_VIOLET ); 36097e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0x99, 0x99, 0xff ), aStr ) , 81); 361cdf0e10cSrcweir 362cdf0e10cSrcweir aStr = SVX_RESSTR( RID_SVXSTR_BORDEAUX ); 36397e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0x99, 0x33, 0x66 ), aStr ) , 82); 364cdf0e10cSrcweir 365cdf0e10cSrcweir aStr = SVX_RESSTR( RID_SVXSTR_PALE_YELLOW ); 36697e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0xff, 0xff, 0xcc ), aStr ) , 83); 367cdf0e10cSrcweir 368cdf0e10cSrcweir aStr = SVX_RESSTR( RID_SVXSTR_PALE_GREEN ); 36997e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0xcc, 0xff, 0xff ), aStr ) , 84); 370cdf0e10cSrcweir 371cdf0e10cSrcweir aStr = SVX_RESSTR( RID_SVXSTR_DKVIOLET ); 37297e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0x66, 0x00, 0x66 ), aStr ) , 85); 373cdf0e10cSrcweir 374cdf0e10cSrcweir aStr = SVX_RESSTR( RID_SVXSTR_SALMON ); 37597e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0xff, 0x80, 0x80 ), aStr ) , 86); 376cdf0e10cSrcweir 377cdf0e10cSrcweir aStr = SVX_RESSTR( RID_SVXSTR_SEABLUE ); 37897e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0x00, 0x66, 0xcc ), aStr ) , 87); 379cdf0e10cSrcweir 380cdf0e10cSrcweir // Sun colors 381cdf0e10cSrcweir aStr = SVX_RESSTR( RID_SVXSTR_COLOR_SUN ); 382cdf0e10cSrcweir aStr.AppendAscii(" 1"); 383cdf0e10cSrcweir nLen = aStr.Len() - 1; 38497e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0x33, 0x33, 0x66 ), aStr ) , 88); 385cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('2')); 38697e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0x66, 0x66, 0x99 ), aStr ) , 89); 387cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('3')); 38897e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0x99, 0x99, 0xcc ), aStr ) , 90); 389cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('4')); 39097e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0xcc, 0xcc, 0xff ), aStr ) , 91); 391cdf0e10cSrcweir 392cdf0e10cSrcweir // Chart default colors 393cdf0e10cSrcweir aStr = SVX_RESSTR( RID_SVXSTR_COLOR_CHART ); 394cdf0e10cSrcweir aStr.AppendAscii(" 1"); 395cdf0e10cSrcweir nLen = aStr.Len() - 1; 39697e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0x00, 0x45, 0x86 ), aStr ) , 92); 397cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('2')); 39897e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0xff, 0x42, 0x0e ), aStr ) , 93); 399cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('3')); 40097e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0xff, 0xd3, 0x20 ), aStr ) , 94); 401cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('4')); 40297e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0x57, 0x9d, 0x1c ), aStr ) , 95); 403cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('5')); 40497e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0x7e, 0x00, 0x21 ), aStr ) , 96); 405cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('6')); 40697e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0x83, 0xca, 0xff ), aStr ) , 97); 407cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('7')); 40897e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0x31, 0x40, 0x04 ), aStr ) , 98); 409cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('8')); 41097e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0xae, 0xcf, 0x00 ), aStr ) , 99); 411cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('9')); 41297e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0x4b, 0x1f, 0x6f ), aStr ) , 100); 413cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('1')); 414cdf0e10cSrcweir aStr.AppendAscii("0"); 415cdf0e10cSrcweir nLen = aStr.Len() - 1; 41697e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0xff, 0x95, 0x0e ), aStr ) , 101); 417cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('1')); 41897e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0xc5, 0x00, 0x0b ), aStr ) , 102); 419cdf0e10cSrcweir aStr.SetChar(nLen, sal_Unicode('2')); 42097e8a929SArmin Le Grand Insert( new XColorEntry( Color( 0x00, 0x84, 0xd1 ), aStr ) , 103); 421cdf0e10cSrcweir 422cdf0e10cSrcweir return( Count() == 104 ); 423cdf0e10cSrcweir } 424cdf0e10cSrcweir 425cdf0e10cSrcweir /************************************************************************/ 426cdf0e10cSrcweir 42797e8a929SArmin Le Grand Bitmap XColorList::CreateBitmapForUI( long /*nIndex*/ ) 428cdf0e10cSrcweir { 42997e8a929SArmin Le Grand return Bitmap(); 430cdf0e10cSrcweir } 431cdf0e10cSrcweir 432cdf0e10cSrcweir /************************************************************************/ 433cdf0e10cSrcweir 434c7be74b1SArmin Le Grand XColorListSharedPtr XColorList::GetStdColorList() 435cdf0e10cSrcweir { 436c7be74b1SArmin Le Grand if ( !aStaticGlobalColorList.get() ) 437c7be74b1SArmin Le Grand { 438c7be74b1SArmin Le Grand aStaticGlobalColorList = XPropertyListFactory::CreateSharedXColorList(SvtPathOptions().GetPalettePath()); 439c7be74b1SArmin Le Grand } 440c7be74b1SArmin Le Grand 441c7be74b1SArmin Le Grand return aStaticGlobalColorList; 442cdf0e10cSrcweir } 443cdf0e10cSrcweir 444cdf0e10cSrcweir // eof 445