xref: /trunk/main/svx/source/xoutdev/xtabcolr.cxx (revision c7be74b172cff98608900673693e02cf2b814c3c)
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 
22f6e50924SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_svx.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #ifndef SVX_LIGHT
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #include <com/sun/star/container/XNameContainer.hpp>
30cdf0e10cSrcweir #include "svx/XPropertyTable.hxx"
31cdf0e10cSrcweir #include <unotools/ucbstreamhelper.hxx>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir #include <unotools/pathoptions.hxx>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir #include "xmlxtexp.hxx"
36cdf0e10cSrcweir #include "xmlxtimp.hxx"
37cdf0e10cSrcweir 
38cdf0e10cSrcweir #endif
39cdf0e10cSrcweir 
40cdf0e10cSrcweir #include <sfx2/docfile.hxx>
41cdf0e10cSrcweir #include <tools/urlobj.hxx>
42cdf0e10cSrcweir #include <svx/dialogs.hrc>
43cdf0e10cSrcweir #include <svx/dialmgr.hxx>
44cdf0e10cSrcweir #include <svx/xtable.hxx>
45cdf0e10cSrcweir #include <svx/xpool.hxx>
46cdf0e10cSrcweir 
47cdf0e10cSrcweir #define GLOBALOVERFLOW
48cdf0e10cSrcweir 
49cdf0e10cSrcweir using namespace com::sun::star;
50cdf0e10cSrcweir using namespace rtl;
51cdf0e10cSrcweir 
52cdf0e10cSrcweir sal_Unicode const pszExtColor[]  = {'s','o','c'};
53cdf0e10cSrcweir 
54cdf0e10cSrcweir static char const aChckColor[]  = { 0x04, 0x00, 'S','O','C','L'};   // < 5.2
55cdf0e10cSrcweir static char const aChckColor0[] = { 0x04, 0x00, 'S','O','C','0'};   // = 5.2
56cdf0e10cSrcweir static char const aChckXML[]    = { '<', '?', 'x', 'm', 'l' };      // = 6.0
57cdf0e10cSrcweir 
58cdf0e10cSrcweir /*************************************************************************
59cdf0e10cSrcweir |*
6097e8a929SArmin Le Grand |* XColorList::XColorList()
61cdf0e10cSrcweir |*
62cdf0e10cSrcweir *************************************************************************/
63cdf0e10cSrcweir 
64*c7be74b1SArmin Le Grand static XColorListSharedPtr aStaticGlobalColorList;
6597e8a929SArmin Le Grand 
66*c7be74b1SArmin Le Grand XColorList::XColorList( const String& rPath ) :
67*c7be74b1SArmin Le Grand                 XPropertyList( rPath )
68cdf0e10cSrcweir {
69cdf0e10cSrcweir }
70cdf0e10cSrcweir 
71cdf0e10cSrcweir /************************************************************************/
72cdf0e10cSrcweir 
7397e8a929SArmin Le Grand XColorList::~XColorList()
74cdf0e10cSrcweir {
75cdf0e10cSrcweir }
76cdf0e10cSrcweir 
77cdf0e10cSrcweir /************************************************************************/
78cdf0e10cSrcweir 
7997e8a929SArmin Le Grand XColorEntry* XColorList::Replace(XColorEntry* pEntry, long nIndex )
80cdf0e10cSrcweir {
8197e8a929SArmin Le Grand     return (XColorEntry*) XPropertyList::Replace(pEntry, nIndex);
82cdf0e10cSrcweir }
83cdf0e10cSrcweir 
84cdf0e10cSrcweir /************************************************************************/
85cdf0e10cSrcweir 
8697e8a929SArmin Le Grand XColorEntry* XColorList::Remove(long nIndex)
87cdf0e10cSrcweir {
88*c7be74b1SArmin Le Grand     return (XColorEntry*) XPropertyList::Remove(nIndex);
89cdf0e10cSrcweir }
90cdf0e10cSrcweir 
91cdf0e10cSrcweir /************************************************************************/
92cdf0e10cSrcweir 
9397e8a929SArmin Le Grand XColorEntry* XColorList::GetColor(long nIndex) const
94cdf0e10cSrcweir {
95*c7be74b1SArmin Le Grand     return (XColorEntry*) XPropertyList::Get(nIndex);
96cdf0e10cSrcweir }
97cdf0e10cSrcweir 
98cdf0e10cSrcweir /************************************************************************/
99cdf0e10cSrcweir 
10097e8a929SArmin Le Grand sal_Bool XColorList::Load()
101cdf0e10cSrcweir {
10297e8a929SArmin Le Grand     if( mbListDirty )
103cdf0e10cSrcweir     {
10497e8a929SArmin Le Grand         mbListDirty = false;
105cdf0e10cSrcweir 
10697e8a929SArmin Le Grand         INetURLObject aURL( maPath );
107cdf0e10cSrcweir 
108cdf0e10cSrcweir         if( INET_PROT_NOT_VALID == aURL.GetProtocol() )
109cdf0e10cSrcweir         {
11097e8a929SArmin Le Grand             DBG_ASSERT( !maPath.Len(), "invalid URL" );
111cdf0e10cSrcweir             return sal_False;
112cdf0e10cSrcweir         }
113cdf0e10cSrcweir 
11497e8a929SArmin Le Grand         aURL.Append( maName );
115cdf0e10cSrcweir 
116cdf0e10cSrcweir         if( !aURL.getExtension().getLength() )
117cdf0e10cSrcweir             aURL.setExtension( rtl::OUString( pszExtColor, 3 ) );
118cdf0e10cSrcweir 
119cdf0e10cSrcweir         uno::Reference< container::XNameContainer > xTable( SvxUnoXColorTable_createInstance( this ), uno::UNO_QUERY );
120cdf0e10cSrcweir         return SvxXMLXTableImport::load( aURL.GetMainURL( INetURLObject::NO_DECODE ), xTable );
121cdf0e10cSrcweir     }
122cdf0e10cSrcweir     return( sal_False );
123cdf0e10cSrcweir }
124cdf0e10cSrcweir 
125cdf0e10cSrcweir /************************************************************************/
126cdf0e10cSrcweir 
12797e8a929SArmin Le Grand sal_Bool XColorList::Save()
128cdf0e10cSrcweir {
12997e8a929SArmin Le Grand     INetURLObject aURL( maPath );
130cdf0e10cSrcweir 
131cdf0e10cSrcweir     if( INET_PROT_NOT_VALID == aURL.GetProtocol() )
132cdf0e10cSrcweir     {
13397e8a929SArmin Le Grand         DBG_ASSERT( !maPath.Len(), "invalid URL" );
134cdf0e10cSrcweir         return sal_False;
135cdf0e10cSrcweir     }
136cdf0e10cSrcweir 
13797e8a929SArmin Le Grand     aURL.Append( maName );
138cdf0e10cSrcweir 
139cdf0e10cSrcweir     if( !aURL.getExtension().getLength() )
140cdf0e10cSrcweir         aURL.setExtension( rtl::OUString( pszExtColor, 3 ) );
141cdf0e10cSrcweir 
142cdf0e10cSrcweir     uno::Reference< container::XNameContainer > xTable( SvxUnoXColorTable_createInstance( this ), uno::UNO_QUERY );
143cdf0e10cSrcweir     return SvxXMLXTableExportComponent::save( aURL.GetMainURL( INetURLObject::NO_DECODE ), xTable );
144cdf0e10cSrcweir }
145cdf0e10cSrcweir 
146cdf0e10cSrcweir /************************************************************************/
147cdf0e10cSrcweir 
14897e8a929SArmin Le Grand sal_Bool XColorList::Create()
149cdf0e10cSrcweir {
150cdf0e10cSrcweir     XubString aStr;
151cdf0e10cSrcweir     xub_StrLen nLen;
152cdf0e10cSrcweir     ResMgr& rRes = DIALOG_MGR();
153cdf0e10cSrcweir 
154cdf0e10cSrcweir     static sal_uInt16 __READONLY_DATA aResId[] =
155cdf0e10cSrcweir     {
156cdf0e10cSrcweir         RID_SVXSTR_BLACK,
157cdf0e10cSrcweir         RID_SVXSTR_BLUE,
158cdf0e10cSrcweir         RID_SVXSTR_GREEN,
159cdf0e10cSrcweir         RID_SVXSTR_CYAN,
160cdf0e10cSrcweir         RID_SVXSTR_RED,
161cdf0e10cSrcweir         RID_SVXSTR_MAGENTA,
162cdf0e10cSrcweir         RID_SVXSTR_BROWN,
163cdf0e10cSrcweir         RID_SVXSTR_GREY,
164cdf0e10cSrcweir         RID_SVXSTR_LIGHTGREY,
165cdf0e10cSrcweir         RID_SVXSTR_LIGHTBLUE,
166cdf0e10cSrcweir         RID_SVXSTR_LIGHTGREEN,
167cdf0e10cSrcweir         RID_SVXSTR_LIGHTCYAN,
168cdf0e10cSrcweir         RID_SVXSTR_LIGHTRED,
169cdf0e10cSrcweir         RID_SVXSTR_LIGHTMAGENTA,
170cdf0e10cSrcweir         RID_SVXSTR_YELLOW,
171cdf0e10cSrcweir         RID_SVXSTR_WHITE
172cdf0e10cSrcweir     };
173cdf0e10cSrcweir 
174cdf0e10cSrcweir     // MT: COL_XXX ist in VCL kein enum mehr!!!
175cdf0e10cSrcweir     // COL_WHITE ist seeeehr gross! ( => Zugriff ueber das obige Array hinweg )
176cdf0e10cSrcweir     // Mit der unteren Schleife gibt es keinen Absturtz, aber es ist
177cdf0e10cSrcweir     // alles schwarz, weil alles kleine Werte.
178cdf0e10cSrcweir     // Ausserdem ist die ganze Vorgehensweise laut MM sehr unperformant
179cdf0e10cSrcweir     // => lieber gleich Stringlisten laden.
180cdf0e10cSrcweir 
181cdf0e10cSrcweir     // BM: ifndef VCL part removed (deprecated)
182cdf0e10cSrcweir 
183cdf0e10cSrcweir     static ColorData __READONLY_DATA aColTab[] =
184cdf0e10cSrcweir     {
185cdf0e10cSrcweir         COL_BLACK,
186cdf0e10cSrcweir         COL_BLUE,
187cdf0e10cSrcweir         COL_GREEN,
188cdf0e10cSrcweir         COL_CYAN,
189cdf0e10cSrcweir         COL_RED,
190cdf0e10cSrcweir         COL_MAGENTA,
191cdf0e10cSrcweir         COL_BROWN,
192cdf0e10cSrcweir         COL_GRAY,
193cdf0e10cSrcweir         COL_LIGHTGRAY,
194cdf0e10cSrcweir         COL_LIGHTBLUE,
195cdf0e10cSrcweir         COL_LIGHTGREEN,
196cdf0e10cSrcweir         COL_LIGHTCYAN,
197cdf0e10cSrcweir         COL_LIGHTRED,
198cdf0e10cSrcweir         COL_LIGHTMAGENTA,
199cdf0e10cSrcweir         COL_YELLOW,
200cdf0e10cSrcweir         COL_WHITE
201cdf0e10cSrcweir     };
202cdf0e10cSrcweir 
203cdf0e10cSrcweir     for( sal_uInt16 n = 0; n < 16; ++n )
204cdf0e10cSrcweir     {
20597e8a929SArmin Le Grand         Insert( new XColorEntry( Color( aColTab[n] ), String( ResId( aResId[ n ], rRes )) ), n );
206cdf0e10cSrcweir     }
207cdf0e10cSrcweir 
208cdf0e10cSrcweir     aStr = SVX_RESSTR( RID_SVXSTR_GREY );
209cdf0e10cSrcweir     aStr.AppendAscii(" 80%");
210cdf0e10cSrcweir     nLen = aStr.Len() - 3;
21197e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 51, 51, 51 ), aStr ) , 16);
212cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('7'));
21397e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 76, 76, 76 ), aStr ) , 17);
214cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('6'));
21597e8a929SArmin Le Grand     Insert( new XColorEntry( Color(102,102,102 ), aStr ) , 18);
216cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('4'));
21797e8a929SArmin Le Grand     Insert( new XColorEntry( Color(153,153,153 ), aStr ) , 19);
218cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('3'));
21997e8a929SArmin Le Grand     Insert( new XColorEntry( Color(179,179,179 ), aStr ) , 20);
220cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('2'));
22197e8a929SArmin Le Grand     Insert( new XColorEntry( Color(204,204,204 ), aStr ) , 21);
222cdf0e10cSrcweir     // BM: new 15%
223cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('1'));
224cdf0e10cSrcweir     aStr.SetChar(nLen + 1, sal_Unicode('5'));
22597e8a929SArmin Le Grand     Insert( new XColorEntry( Color(217,217,217 ), aStr ) , 22);
226cdf0e10cSrcweir     aStr.SetChar(nLen + 1, sal_Unicode('0'));
22797e8a929SArmin Le Grand     Insert( new XColorEntry( Color(230,230,230 ), aStr ) , 23);
22897e8a929SArmin Le Grand     Insert( new XColorEntry( Color(230,230,255 ), SVX_RESSTR( RID_SVXSTR_BLUEGREY ) ) , 24);
229cdf0e10cSrcweir 
230cdf0e10cSrcweir     aStr = SVX_RESSTR( RID_SVXSTR_RED );
231cdf0e10cSrcweir     aStr.AppendAscii(" 1");
232cdf0e10cSrcweir     nLen = aStr.Len() - 1;
23397e8a929SArmin Le Grand     Insert( new XColorEntry( Color(255, 51,102 ), aStr ) , 25);
234cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('2'));
23597e8a929SArmin Le Grand     Insert( new XColorEntry( Color(220, 35,  0 ), aStr ) , 26);
236cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('3'));
23797e8a929SArmin Le Grand     Insert( new XColorEntry( Color(184, 71,  0 ), aStr ) , 27);
238cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('4'));
23997e8a929SArmin Le Grand     Insert( new XColorEntry( Color(255, 51, 51 ), aStr ) , 28);
240cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('5'));
24197e8a929SArmin Le Grand     Insert( new XColorEntry( Color(235, 97, 61 ), aStr ) , 29);
242cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('6'));
24397e8a929SArmin Le Grand     Insert( new XColorEntry( Color(184, 71, 71 ), aStr ) , 30);
244cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('7'));
24597e8a929SArmin Le Grand     Insert( new XColorEntry( Color(184,  0, 71 ), aStr ) , 31);
246cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('8'));
24797e8a929SArmin Le Grand     Insert( new XColorEntry( Color(153, 40, 76 ), aStr ) , 32);
248cdf0e10cSrcweir 
249cdf0e10cSrcweir     aStr = SVX_RESSTR( RID_SVXSTR_MAGENTA );
250cdf0e10cSrcweir     aStr.AppendAscii(" 1");
251cdf0e10cSrcweir     nLen = aStr.Len() - 1;
25297e8a929SArmin Le Grand     Insert( new XColorEntry( Color(148,  0,107 ), aStr ) , 33);
253cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('2'));
25497e8a929SArmin Le Grand     Insert( new XColorEntry( Color(148, 71,107 ), aStr ) , 34);
255cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('3'));
25697e8a929SArmin Le Grand     Insert( new XColorEntry( Color(148, 71,148 ), aStr ) , 35);
257cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('4'));
25897e8a929SArmin Le Grand     Insert( new XColorEntry( Color(153,102,204 ), aStr ) , 36);
259cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('5'));
26097e8a929SArmin Le Grand     Insert( new XColorEntry( Color(107, 71,148 ), aStr ) , 37);
261cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('6'));
26297e8a929SArmin Le Grand     Insert( new XColorEntry( Color(107, 35,148 ), aStr ) , 38);
263cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('7'));
26497e8a929SArmin Le Grand     Insert( new XColorEntry( Color(107,  0,148 ), aStr ) , 39);
265cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('8'));
26697e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 94, 17,166 ), aStr ) , 40);
267cdf0e10cSrcweir 
268cdf0e10cSrcweir     aStr = SVX_RESSTR( RID_SVXSTR_BLUE );
269cdf0e10cSrcweir     aStr.AppendAscii(" 1");
270cdf0e10cSrcweir     nLen = aStr.Len() - 1;
27197e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 40,  0,153 ), aStr ) , 41);
272cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('2'));
27397e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 71,  0,184 ), aStr ) , 42);
274cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('3'));
27597e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 35,  0,220 ), aStr ) , 43);
276cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('4'));
27797e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 35, 35,220 ), aStr ) , 44);
278cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('5'));
27997e8a929SArmin Le Grand     Insert( new XColorEntry( Color(  0, 71,255 ), aStr ) , 45);
280cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('6'));
28197e8a929SArmin Le Grand     Insert( new XColorEntry( Color(  0,153,255 ), aStr ) , 46);
282cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('7'));
28397e8a929SArmin Le Grand     Insert( new XColorEntry( Color(  0,184,255 ), aStr ) , 47);
284cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('8'));
28597e8a929SArmin Le Grand     Insert( new XColorEntry( Color(153,204,255 ), aStr ) , 48);
286cdf0e10cSrcweir     //Insert(48, new XColorEntry( Color( 46,215,255 ), aStr ) );
287cdf0e10cSrcweir 
288cdf0e10cSrcweir     aStr = SVX_RESSTR( RID_SVXSTR_CYAN );
289cdf0e10cSrcweir     aStr.AppendAscii(" 1");
290cdf0e10cSrcweir     nLen = aStr.Len() - 1;
29197e8a929SArmin Le Grand     Insert( new XColorEntry( Color(  0,220,255 ), aStr ) , 49);
292cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('2'));
29397e8a929SArmin Le Grand     Insert( new XColorEntry( Color(  0,204,204 ), aStr ) , 50);
294cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('3'));
29597e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 35,184,220 ), aStr ) , 51);
296cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('4'));
29797e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 71,184,184 ), aStr ) , 52);
298cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('5'));
29997e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 51,163,163 ), aStr ) , 53);
300cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('6'));
30197e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 25,138,138 ), aStr ) , 54);
302cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('7'));
30397e8a929SArmin Le Grand     Insert( new XColorEntry( Color(  0,107,107 ), aStr ) , 55);
304cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('8'));
30597e8a929SArmin Le Grand     Insert( new XColorEntry( Color(  0, 74, 74 ), aStr ) , 56);
306cdf0e10cSrcweir 
307cdf0e10cSrcweir     aStr = SVX_RESSTR( RID_SVXSTR_GREEN );
308cdf0e10cSrcweir     aStr.AppendAscii(" 1");
309cdf0e10cSrcweir     nLen = aStr.Len() - 1;
31097e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 53, 94,  0 ), aStr ) , 57);
311cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('2'));
31297e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 92,133, 38 ), aStr ) , 58);
313cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('3'));
31497e8a929SArmin Le Grand     Insert( new XColorEntry( Color(125,166, 71 ), aStr ) , 59);
315cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('4'));
31697e8a929SArmin Le Grand     Insert( new XColorEntry( Color(148,189, 94 ), aStr ) , 60);
317cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('5'));
31897e8a929SArmin Le Grand     Insert( new XColorEntry( Color(  0,174,  0 ), aStr ) , 61);
319cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('6'));
32097e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 51,204,102 ), aStr ) , 62);
321cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('7'));
32297e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 61,235, 61 ), aStr ) , 63);
323cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('8'));
32497e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 35,255, 35 ), aStr ) , 64);
325cdf0e10cSrcweir 
326cdf0e10cSrcweir     aStr = SVX_RESSTR( RID_SVXSTR_YELLOW );
327cdf0e10cSrcweir     aStr.AppendAscii(" 1");
328cdf0e10cSrcweir     nLen = aStr.Len() - 1;
32997e8a929SArmin Le Grand     Insert( new XColorEntry( Color(230,255,  0 ), aStr ) , 65);
330cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('2'));
33197e8a929SArmin Le Grand     Insert( new XColorEntry( Color(255,255,153 ), aStr ) , 66);
332cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('3'));
33397e8a929SArmin Le Grand     Insert( new XColorEntry( Color(255,255,102 ), aStr ) , 67);
334cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('4'));
33597e8a929SArmin Le Grand     Insert( new XColorEntry( Color(230,230, 76 ), aStr ) , 68);
336cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('5'));
33797e8a929SArmin Le Grand     Insert( new XColorEntry( Color(204,204,  0 ), aStr ) , 69);
338cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('6'));
33997e8a929SArmin Le Grand     Insert( new XColorEntry( Color(179,179,  0 ), aStr ) , 70);
340cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('7'));
34197e8a929SArmin Le Grand     Insert( new XColorEntry( Color(128,128, 25 ), aStr ) , 71);
342cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('8'));
34397e8a929SArmin Le Grand     Insert( new XColorEntry( Color(102,102,  0 ), aStr ) , 72);
344cdf0e10cSrcweir 
345cdf0e10cSrcweir     aStr = SVX_RESSTR( RID_SVXSTR_BROWN );
346cdf0e10cSrcweir     aStr.AppendAscii(" 1");
347cdf0e10cSrcweir     nLen = aStr.Len() - 1;
34897e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 76, 25,  0 ), aStr ) , 73);
349cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('2'));
35097e8a929SArmin Le Grand     Insert( new XColorEntry( Color(102, 51,  0 ), aStr ) , 74);
351cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('3'));
35297e8a929SArmin Le Grand     Insert( new XColorEntry( Color(128, 76, 25 ), aStr ) , 75);
353cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('4'));
35497e8a929SArmin Le Grand     Insert( new XColorEntry( Color(153,102, 51 ), aStr ) , 76);
355cdf0e10cSrcweir 
356cdf0e10cSrcweir     aStr = SVX_RESSTR( RID_SVXSTR_ORANGE );
357cdf0e10cSrcweir     aStr.AppendAscii(" 1");
358cdf0e10cSrcweir     nLen = aStr.Len() - 1;
35997e8a929SArmin Le Grand     Insert( new XColorEntry( Color(204,102, 51 ), aStr ) , 77);
360cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('2'));
36197e8a929SArmin Le Grand     Insert( new XColorEntry( Color(255,102, 51 ), aStr ) , 78);
362cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('3'));
36397e8a929SArmin Le Grand     Insert( new XColorEntry( Color(255,153,102 ), aStr ) , 79);
364cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('4'));
36597e8a929SArmin Le Grand     Insert( new XColorEntry( Color(255,204,153 ), aStr ) , 80);
366cdf0e10cSrcweir 
367cdf0e10cSrcweir     // new chart colors
368cdf0e10cSrcweir     aStr = SVX_RESSTR( RID_SVXSTR_VIOLET );
36997e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 0x99, 0x99, 0xff ), aStr ) , 81);
370cdf0e10cSrcweir 
371cdf0e10cSrcweir     aStr = SVX_RESSTR( RID_SVXSTR_BORDEAUX );
37297e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 0x99, 0x33, 0x66 ), aStr ) , 82);
373cdf0e10cSrcweir 
374cdf0e10cSrcweir     aStr = SVX_RESSTR( RID_SVXSTR_PALE_YELLOW );
37597e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 0xff, 0xff, 0xcc ), aStr ) , 83);
376cdf0e10cSrcweir 
377cdf0e10cSrcweir     aStr = SVX_RESSTR( RID_SVXSTR_PALE_GREEN );
37897e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 0xcc, 0xff, 0xff ), aStr ) , 84);
379cdf0e10cSrcweir 
380cdf0e10cSrcweir     aStr = SVX_RESSTR( RID_SVXSTR_DKVIOLET );
38197e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 0x66, 0x00, 0x66 ), aStr ) , 85);
382cdf0e10cSrcweir 
383cdf0e10cSrcweir     aStr = SVX_RESSTR( RID_SVXSTR_SALMON );
38497e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 0xff, 0x80, 0x80 ), aStr ) , 86);
385cdf0e10cSrcweir 
386cdf0e10cSrcweir     aStr = SVX_RESSTR( RID_SVXSTR_SEABLUE );
38797e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 0x00, 0x66, 0xcc ), aStr ) , 87);
388cdf0e10cSrcweir 
389cdf0e10cSrcweir     // Sun colors
390cdf0e10cSrcweir     aStr = SVX_RESSTR( RID_SVXSTR_COLOR_SUN );
391cdf0e10cSrcweir     aStr.AppendAscii(" 1");
392cdf0e10cSrcweir     nLen = aStr.Len() - 1;
39397e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 0x33, 0x33, 0x66 ), aStr ) , 88);
394cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('2'));
39597e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 0x66, 0x66, 0x99 ), aStr ) , 89);
396cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('3'));
39797e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 0x99, 0x99, 0xcc ), aStr ) , 90);
398cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('4'));
39997e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 0xcc, 0xcc, 0xff ), aStr ) , 91);
400cdf0e10cSrcweir 
401cdf0e10cSrcweir     // Chart default colors
402cdf0e10cSrcweir     aStr = SVX_RESSTR( RID_SVXSTR_COLOR_CHART );
403cdf0e10cSrcweir     aStr.AppendAscii(" 1");
404cdf0e10cSrcweir     nLen = aStr.Len() - 1;
40597e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 0x00, 0x45, 0x86 ), aStr ) , 92);
406cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('2'));
40797e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 0xff, 0x42, 0x0e ), aStr ) , 93);
408cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('3'));
40997e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 0xff, 0xd3, 0x20 ), aStr ) , 94);
410cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('4'));
41197e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 0x57, 0x9d, 0x1c ), aStr ) , 95);
412cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('5'));
41397e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 0x7e, 0x00, 0x21 ), aStr ) , 96);
414cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('6'));
41597e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 0x83, 0xca, 0xff ), aStr ) , 97);
416cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('7'));
41797e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 0x31, 0x40, 0x04 ), aStr ) , 98);
418cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('8'));
41997e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 0xae, 0xcf, 0x00 ), aStr ) , 99);
420cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('9'));
42197e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 0x4b, 0x1f, 0x6f ), aStr ) , 100);
422cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('1'));
423cdf0e10cSrcweir     aStr.AppendAscii("0");
424cdf0e10cSrcweir     nLen = aStr.Len() - 1;
42597e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 0xff, 0x95, 0x0e ), aStr ) , 101);
426cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('1'));
42797e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 0xc5, 0x00, 0x0b ), aStr ) , 102);
428cdf0e10cSrcweir     aStr.SetChar(nLen, sal_Unicode('2'));
42997e8a929SArmin Le Grand     Insert( new XColorEntry( Color( 0x00, 0x84, 0xd1 ), aStr ) , 103);
430cdf0e10cSrcweir 
431cdf0e10cSrcweir     return( Count() == 104 );
432cdf0e10cSrcweir }
433cdf0e10cSrcweir 
434cdf0e10cSrcweir /************************************************************************/
435cdf0e10cSrcweir 
43697e8a929SArmin Le Grand Bitmap XColorList::CreateBitmapForUI( long /*nIndex*/ )
437cdf0e10cSrcweir {
43897e8a929SArmin Le Grand     return Bitmap();
439cdf0e10cSrcweir }
440cdf0e10cSrcweir 
441cdf0e10cSrcweir /************************************************************************/
442cdf0e10cSrcweir 
443*c7be74b1SArmin Le Grand XColorListSharedPtr XColorList::GetStdColorList()
444cdf0e10cSrcweir {
445*c7be74b1SArmin Le Grand     if ( !aStaticGlobalColorList.get() )
446*c7be74b1SArmin Le Grand     {
447*c7be74b1SArmin Le Grand         aStaticGlobalColorList = XPropertyListFactory::CreateSharedXColorList(SvtPathOptions().GetPalettePath());
448*c7be74b1SArmin Le Grand     }
449*c7be74b1SArmin Le Grand 
450*c7be74b1SArmin Le Grand     return aStaticGlobalColorList;
451cdf0e10cSrcweir }
452cdf0e10cSrcweir 
453cdf0e10cSrcweir // eof
454