1*5900e8ecSAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*5900e8ecSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*5900e8ecSAndrew Rist * or more contributor license agreements. See the NOTICE file
5*5900e8ecSAndrew Rist * distributed with this work for additional information
6*5900e8ecSAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*5900e8ecSAndrew Rist * to you under the Apache License, Version 2.0 (the
8*5900e8ecSAndrew Rist * "License"); you may not use this file except in compliance
9*5900e8ecSAndrew Rist * with the License. You may obtain a copy of the License at
10cdf0e10cSrcweir *
11*5900e8ecSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir *
13*5900e8ecSAndrew Rist * Unless required by applicable law or agreed to in writing,
14*5900e8ecSAndrew Rist * software distributed under the License is distributed on an
15*5900e8ecSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*5900e8ecSAndrew Rist * KIND, either express or implied. See the License for the
17*5900e8ecSAndrew Rist * specific language governing permissions and limitations
18*5900e8ecSAndrew Rist * under the License.
19cdf0e10cSrcweir *
20*5900e8ecSAndrew Rist *************************************************************/
21*5900e8ecSAndrew Rist
22*5900e8ecSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_svtools.hxx"
26cdf0e10cSrcweir
27cdf0e10cSrcweir #include <svtools/colorcfg.hxx>
28cdf0e10cSrcweir #include <com/sun/star/uno/Any.hxx>
29cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx>
30cdf0e10cSrcweir #include <com/sun/star/lang/Locale.hpp>
31cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp>
32cdf0e10cSrcweir #include <tools/color.hxx>
33cdf0e10cSrcweir #include <tools/debug.hxx>
34cdf0e10cSrcweir #include <unotools/configitem.hxx>
35cdf0e10cSrcweir #include <unotools/configpathes.hxx>
36cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.h>
37cdf0e10cSrcweir #include <svl/poolitem.hxx> //Any2Bool
38cdf0e10cSrcweir #include <svl/smplhint.hxx>
39cdf0e10cSrcweir #include <vos/mutex.hxx>
40cdf0e10cSrcweir
41cdf0e10cSrcweir #include <itemholder2.hxx>
42cdf0e10cSrcweir
43cdf0e10cSrcweir /* #100822# ----
44cdf0e10cSrcweir #include <vcl/wrkwin.hxx>
45cdf0e10cSrcweir ------------- */
46cdf0e10cSrcweir #include <vcl/svapp.hxx>
47cdf0e10cSrcweir #include <vcl/event.hxx>
48cdf0e10cSrcweir #include <rtl/instance.hxx>
49cdf0e10cSrcweir
50cdf0e10cSrcweir //-----------------------------------------------------------------------------
51cdf0e10cSrcweir using namespace utl;
52cdf0e10cSrcweir using namespace rtl;
53cdf0e10cSrcweir using namespace com::sun::star;
54cdf0e10cSrcweir
55cdf0e10cSrcweir namespace svtools
56cdf0e10cSrcweir {
57cdf0e10cSrcweir
58cdf0e10cSrcweir #define C2U(cChar) OUString::createFromAscii(cChar)
59cdf0e10cSrcweir static const sal_Char cColor[] = "/Color";
60cdf0e10cSrcweir static const sal_Char cColorSchemes[] = "ColorSchemes/";
61cdf0e10cSrcweir sal_Int32 nColorRefCount_Impl = 0;
62cdf0e10cSrcweir namespace
63cdf0e10cSrcweir {
64cdf0e10cSrcweir struct ColorMutex_Impl
65cdf0e10cSrcweir : public rtl::Static< ::osl::Mutex, ColorMutex_Impl > {};
66cdf0e10cSrcweir }
67cdf0e10cSrcweir
68cdf0e10cSrcweir ColorConfig_Impl* ColorConfig::m_pImpl = NULL;
69cdf0e10cSrcweir
70cdf0e10cSrcweir /* -----------------------------16.01.01 15:36--------------------------------
71cdf0e10cSrcweir ---------------------------------------------------------------------------*/
72cdf0e10cSrcweir class ColorConfig_Impl : public utl::ConfigItem
73cdf0e10cSrcweir {
74cdf0e10cSrcweir ColorConfigValue m_aConfigValues[ColorConfigEntryCount];
75cdf0e10cSrcweir sal_Bool m_bEditMode;
76cdf0e10cSrcweir rtl::OUString m_sIsVisible;
77cdf0e10cSrcweir rtl::OUString m_sLoadedScheme;
78cdf0e10cSrcweir
79cdf0e10cSrcweir uno::Sequence< ::rtl::OUString> GetPropertyNames(const rtl::OUString& rScheme);
80cdf0e10cSrcweir public:
81cdf0e10cSrcweir ColorConfig_Impl(sal_Bool bEditMode = sal_False);
82cdf0e10cSrcweir virtual ~ColorConfig_Impl();
83cdf0e10cSrcweir
84cdf0e10cSrcweir void Load(const rtl::OUString& rScheme);
85cdf0e10cSrcweir void CommitCurrentSchemeName();
86cdf0e10cSrcweir //changes the name of the current scheme but doesn't load it!
SetCurrentSchemeName(const rtl::OUString & rSchemeName)87cdf0e10cSrcweir void SetCurrentSchemeName(const rtl::OUString& rSchemeName) {m_sLoadedScheme = rSchemeName;}
88cdf0e10cSrcweir virtual void Commit();
89cdf0e10cSrcweir virtual void Notify( const uno::Sequence<rtl::OUString>& aPropertyNames);
90cdf0e10cSrcweir
GetColorConfigValue(ColorConfigEntry eValue)91cdf0e10cSrcweir const ColorConfigValue& GetColorConfigValue(ColorConfigEntry eValue)
92cdf0e10cSrcweir {return m_aConfigValues[eValue];}
93cdf0e10cSrcweir void SetColorConfigValue(ColorConfigEntry eValue,
94cdf0e10cSrcweir const ColorConfigValue& rValue );
95cdf0e10cSrcweir
GetLoadedScheme() const96cdf0e10cSrcweir const rtl::OUString& GetLoadedScheme() const {return m_sLoadedScheme;}
97cdf0e10cSrcweir
98cdf0e10cSrcweir uno::Sequence< ::rtl::OUString> GetSchemeNames();
99cdf0e10cSrcweir
100cdf0e10cSrcweir sal_Bool AddScheme(const rtl::OUString& rNode);
101cdf0e10cSrcweir sal_Bool RemoveScheme(const rtl::OUString& rNode);
SetModified()102cdf0e10cSrcweir void SetModified(){ConfigItem::SetModified();}
ClearModified()103cdf0e10cSrcweir void ClearModified(){ConfigItem::ClearModified();}
104cdf0e10cSrcweir void SettingsChanged();
105cdf0e10cSrcweir
106cdf0e10cSrcweir // #100822#
107cdf0e10cSrcweir DECL_LINK( DataChangedEventListener, VclWindowEvent* );
108cdf0e10cSrcweir
109cdf0e10cSrcweir void ImplUpdateApplicationSettings();
110cdf0e10cSrcweir };
111cdf0e10cSrcweir
112cdf0e10cSrcweir /* -----------------------------16.01.01 15:36--------------------------------
113cdf0e10cSrcweir
114cdf0e10cSrcweir ---------------------------------------------------------------------------*/
GetPropertyNames(const rtl::OUString & rScheme)115cdf0e10cSrcweir uno::Sequence< OUString> ColorConfig_Impl::GetPropertyNames(const rtl::OUString& rScheme)
116cdf0e10cSrcweir {
117cdf0e10cSrcweir uno::Sequence<OUString> aNames(2 * ColorConfigEntryCount);
118cdf0e10cSrcweir OUString* pNames = aNames.getArray();
119cdf0e10cSrcweir struct ColorConfigEntryData_Impl
120cdf0e10cSrcweir {
121cdf0e10cSrcweir const sal_Char* cName;
122cdf0e10cSrcweir sal_Int32 nLength;
123cdf0e10cSrcweir rtl_TextEncoding eEncoding;
124cdf0e10cSrcweir sal_Bool bCanBeVisible;
125cdf0e10cSrcweir };
126cdf0e10cSrcweir static const ColorConfigEntryData_Impl cNames[] =
127cdf0e10cSrcweir {
128cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/DocColor") ,sal_False },
129cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/DocBoundaries") ,sal_True },
130cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/AppBackground") ,sal_False },
131cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/ObjectBoundaries"),sal_True },
132cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/TableBoundaries") ,sal_True },
133cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/FontColor") ,sal_False },
134cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/Links") ,sal_True },
135cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/LinksVisited") ,sal_True },
136cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/Anchor") ,sal_False },
137cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/Spell") ,sal_False },
138cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/SmartTags") ,sal_False },
139cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/WriterTextGrid") ,sal_False },
140cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/WriterFieldShadings"),sal_True },
141cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/WriterIdxShadings") ,sal_True },
142cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/WriterDirectCursor") ,sal_True },
143cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/WriterScriptIndicator") ,sal_False },
144cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/WriterSectionBoundaries") ,sal_True },
145cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/WriterPageBreaks") ,sal_False },
146cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/HTMLSGML") ,sal_False },
147cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/HTMLComment") ,sal_False },
148cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/HTMLKeyword") ,sal_False },
149cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/HTMLUnknown") ,sal_False },
150cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/CalcGrid") ,sal_False },
151cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/CalcPageBreak"), sal_False },
152cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/CalcPageBreakManual"), sal_False },
153cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/CalcPageBreakAutomatic"), sal_False },
154cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/CalcDetective") ,sal_False },
155cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/CalcDetectiveError") ,sal_False },
156cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/CalcReference") ,sal_False },
157cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/CalcNotesBackground") ,sal_False },
158cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/DrawGrid") ,sal_True },
159cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/DrawDrawing") ,sal_False },
160cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/DrawFill") ,sal_False },
161cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/BASICIdentifier"), sal_False },
162cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/BASICComment") , sal_False },
163cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/BASICNumber") , sal_False },
164cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/BASICString") , sal_False },
165cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/BASICOperator") , sal_False },
166cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/BASICKeyword") , sal_False },
167cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/BASICError"), sal_False },
168cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/SQLIdentifier"), sal_False },
169cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/SQLNumber"), sal_False },
170cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/SQLString"), sal_False },
171cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/SQLOperator"), sal_False },
172cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/SQLKeyword"), sal_False },
173cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/SQLParameter"), sal_False },
174cdf0e10cSrcweir { RTL_CONSTASCII_USTRINGPARAM("/SQLComment"), sal_False }
175cdf0e10cSrcweir };
176cdf0e10cSrcweir int nIndex = 0;
177cdf0e10cSrcweir OUString sColor = C2U(cColor);
178cdf0e10cSrcweir OUString sBase(C2U(cColorSchemes));
179cdf0e10cSrcweir sBase += utl::wrapConfigurationElementName(rScheme);
180cdf0e10cSrcweir const int nCount = ColorConfigEntryCount;
181cdf0e10cSrcweir for(sal_Int32 i = 0; i < 4 * nCount; i+= 4)
182cdf0e10cSrcweir {
183cdf0e10cSrcweir rtl::OUString sBaseName(sBase);
184cdf0e10cSrcweir sal_Int32 nPos = i / 4;
185cdf0e10cSrcweir sBaseName += OUString(cNames[nPos].cName, cNames[nPos].nLength, cNames[nPos].eEncoding);
186cdf0e10cSrcweir pNames[nIndex] += sBaseName;
187cdf0e10cSrcweir pNames[nIndex++] += sColor;
188cdf0e10cSrcweir if(cNames[nPos].bCanBeVisible)
189cdf0e10cSrcweir {
190cdf0e10cSrcweir pNames[nIndex] += sBaseName;
191cdf0e10cSrcweir pNames[nIndex++] += m_sIsVisible;
192cdf0e10cSrcweir }
193cdf0e10cSrcweir }
194cdf0e10cSrcweir aNames.realloc(nIndex);
195cdf0e10cSrcweir return aNames;
196cdf0e10cSrcweir }
197cdf0e10cSrcweir /* -----------------------------22.03.2002 14:37------------------------------
198cdf0e10cSrcweir
199cdf0e10cSrcweir ---------------------------------------------------------------------------*/
ColorConfig_Impl(sal_Bool bEditMode)200cdf0e10cSrcweir ColorConfig_Impl::ColorConfig_Impl(sal_Bool bEditMode) :
201cdf0e10cSrcweir ConfigItem(C2U("Office.UI/ColorScheme")),
202cdf0e10cSrcweir m_bEditMode(bEditMode),
203cdf0e10cSrcweir m_sIsVisible(C2U("/IsVisible"))
204cdf0e10cSrcweir {
205cdf0e10cSrcweir if(!m_bEditMode)
206cdf0e10cSrcweir {
207cdf0e10cSrcweir //try to register on the root node - if possible
208cdf0e10cSrcweir uno::Sequence < ::rtl::OUString > aNames(1);
209cdf0e10cSrcweir EnableNotification( aNames );
210cdf0e10cSrcweir }
211cdf0e10cSrcweir Load(::rtl::OUString());
212cdf0e10cSrcweir
213cdf0e10cSrcweir ImplUpdateApplicationSettings();
214cdf0e10cSrcweir
215cdf0e10cSrcweir // #100822#
216cdf0e10cSrcweir ::Application::AddEventListener( LINK(this, ColorConfig_Impl, DataChangedEventListener) );
217cdf0e10cSrcweir
218cdf0e10cSrcweir }
219cdf0e10cSrcweir /* -----------------------------25.03.2002 12:28------------------------------
220cdf0e10cSrcweir
221cdf0e10cSrcweir ---------------------------------------------------------------------------*/
~ColorConfig_Impl()222cdf0e10cSrcweir ColorConfig_Impl::~ColorConfig_Impl()
223cdf0e10cSrcweir {
224cdf0e10cSrcweir // #100822#
225cdf0e10cSrcweir ::Application::RemoveEventListener( LINK(this, ColorConfig_Impl, DataChangedEventListener) );
226cdf0e10cSrcweir }
227cdf0e10cSrcweir /* -----------------------------22.03.2002 14:38------------------------------
228cdf0e10cSrcweir
229cdf0e10cSrcweir ---------------------------------------------------------------------------*/
Load(const rtl::OUString & rScheme)230cdf0e10cSrcweir void ColorConfig_Impl::Load(const rtl::OUString& rScheme)
231cdf0e10cSrcweir {
232cdf0e10cSrcweir rtl::OUString sScheme(rScheme);
233cdf0e10cSrcweir if(!sScheme.getLength())
234cdf0e10cSrcweir {
235cdf0e10cSrcweir //detect current scheme name
236cdf0e10cSrcweir uno::Sequence < ::rtl::OUString > aCurrent(1);
237cdf0e10cSrcweir aCurrent.getArray()[0] = C2U("CurrentColorScheme");
238cdf0e10cSrcweir uno::Sequence< uno::Any > aCurrentVal = GetProperties( aCurrent );
239cdf0e10cSrcweir aCurrentVal.getConstArray()[0] >>= sScheme;
240cdf0e10cSrcweir }
241cdf0e10cSrcweir m_sLoadedScheme = sScheme;
242cdf0e10cSrcweir //
243cdf0e10cSrcweir uno::Sequence < ::rtl::OUString > aColorNames = GetPropertyNames(sScheme);
244cdf0e10cSrcweir uno::Sequence< uno::Any > aColors = GetProperties( aColorNames );
245cdf0e10cSrcweir const uno::Any* pColors = aColors.getConstArray();
246cdf0e10cSrcweir const ::rtl::OUString* pColorNames = aColorNames.getConstArray();
247cdf0e10cSrcweir sal_Int32 nIndex = 0;
248cdf0e10cSrcweir for(int i = 0; i < 2 * ColorConfigEntryCount && aColors.getLength() > nIndex; i+= 2)
249cdf0e10cSrcweir {
250cdf0e10cSrcweir if(pColors[nIndex].hasValue())
251cdf0e10cSrcweir pColors[nIndex] >>= m_aConfigValues[i / 2].nColor;
252cdf0e10cSrcweir else
253cdf0e10cSrcweir m_aConfigValues[i/2].nColor = COL_AUTO;
254cdf0e10cSrcweir nIndex++;
255cdf0e10cSrcweir if(nIndex >= aColors.getLength())
256cdf0e10cSrcweir break;
257cdf0e10cSrcweir //test for visibility property
258cdf0e10cSrcweir if(pColorNames[nIndex].match(m_sIsVisible, pColorNames[nIndex].getLength() - m_sIsVisible.getLength()))
259cdf0e10cSrcweir m_aConfigValues[i / 2].bIsVisible = Any2Bool(pColors[nIndex++]);
260cdf0e10cSrcweir }
261cdf0e10cSrcweir }
262cdf0e10cSrcweir /* -----------------------------22.03.2002 14:38------------------------------
263cdf0e10cSrcweir
264cdf0e10cSrcweir ---------------------------------------------------------------------------*/
Notify(const uno::Sequence<OUString> &)265cdf0e10cSrcweir void ColorConfig_Impl::Notify( const uno::Sequence<OUString>& )
266cdf0e10cSrcweir {
267cdf0e10cSrcweir //loading via notification always uses the default setting
268cdf0e10cSrcweir Load(::rtl::OUString());
269cdf0e10cSrcweir NotifyListeners(0);
270cdf0e10cSrcweir }
271cdf0e10cSrcweir /* -----------------------------22.03.2002 14:38------------------------------
272cdf0e10cSrcweir
273cdf0e10cSrcweir ---------------------------------------------------------------------------*/
Commit()274cdf0e10cSrcweir void ColorConfig_Impl::Commit()
275cdf0e10cSrcweir {
276cdf0e10cSrcweir uno::Sequence < ::rtl::OUString > aColorNames = GetPropertyNames(m_sLoadedScheme);
277cdf0e10cSrcweir uno::Sequence < beans::PropertyValue > aPropValues(aColorNames.getLength());
278cdf0e10cSrcweir beans::PropertyValue* pPropValues = aPropValues.getArray();
279cdf0e10cSrcweir const ::rtl::OUString* pColorNames = aColorNames.getConstArray();
280cdf0e10cSrcweir sal_Int32 nIndex = 0;
281cdf0e10cSrcweir const uno::Type& rBoolType = ::getBooleanCppuType();
282cdf0e10cSrcweir for(int i = 0; i < 2 * ColorConfigEntryCount && aColorNames.getLength() > nIndex; i+= 2)
283cdf0e10cSrcweir {
284cdf0e10cSrcweir pPropValues[nIndex].Name = pColorNames[nIndex];
285cdf0e10cSrcweir //save automatic colors as void value
286cdf0e10cSrcweir if(COL_AUTO != sal::static_int_cast<ColorData>(m_aConfigValues[i/2].nColor))
287cdf0e10cSrcweir pPropValues[nIndex].Value <<= m_aConfigValues[i/2].nColor;
288cdf0e10cSrcweir
289cdf0e10cSrcweir nIndex++;
290cdf0e10cSrcweir if(nIndex >= aColorNames.getLength())
291cdf0e10cSrcweir break;
292cdf0e10cSrcweir //test for visibility property
293cdf0e10cSrcweir if(pColorNames[nIndex].match(m_sIsVisible, pColorNames[nIndex].getLength() - m_sIsVisible.getLength()))
294cdf0e10cSrcweir {
295cdf0e10cSrcweir pPropValues[nIndex].Name = pColorNames[nIndex];
296cdf0e10cSrcweir pPropValues[nIndex].Value.setValue(&m_aConfigValues[i/2].bIsVisible, rBoolType);
297cdf0e10cSrcweir nIndex++;
298cdf0e10cSrcweir }
299cdf0e10cSrcweir }
300cdf0e10cSrcweir rtl::OUString sNode(C2U("ColorSchemes"));
301cdf0e10cSrcweir SetSetProperties(sNode, aPropValues);
302cdf0e10cSrcweir
303cdf0e10cSrcweir CommitCurrentSchemeName();
304cdf0e10cSrcweir }
305cdf0e10cSrcweir /* -----------------11.12.2002 10:42-----------------
306cdf0e10cSrcweir *
307cdf0e10cSrcweir * --------------------------------------------------*/
CommitCurrentSchemeName()308cdf0e10cSrcweir void ColorConfig_Impl::CommitCurrentSchemeName()
309cdf0e10cSrcweir {
310cdf0e10cSrcweir //save current scheme name
311cdf0e10cSrcweir uno::Sequence < ::rtl::OUString > aCurrent(1);
312cdf0e10cSrcweir aCurrent.getArray()[0] = C2U("CurrentColorScheme");
313cdf0e10cSrcweir uno::Sequence< uno::Any > aCurrentVal(1);
314cdf0e10cSrcweir aCurrentVal.getArray()[0] <<= m_sLoadedScheme;
315cdf0e10cSrcweir PutProperties(aCurrent, aCurrentVal);
316cdf0e10cSrcweir }
317cdf0e10cSrcweir /* -----------------------------25.03.2002 12:19------------------------------
318cdf0e10cSrcweir
319cdf0e10cSrcweir ---------------------------------------------------------------------------*/
SetColorConfigValue(ColorConfigEntry eValue,const ColorConfigValue & rValue)320cdf0e10cSrcweir void ColorConfig_Impl::SetColorConfigValue(ColorConfigEntry eValue, const ColorConfigValue& rValue )
321cdf0e10cSrcweir {
322cdf0e10cSrcweir if(rValue != m_aConfigValues[eValue])
323cdf0e10cSrcweir {
324cdf0e10cSrcweir m_aConfigValues[eValue] = rValue;
325cdf0e10cSrcweir SetModified();
326cdf0e10cSrcweir }
327cdf0e10cSrcweir }
328cdf0e10cSrcweir /* -----------------------------25.03.2002 15:22------------------------------
329cdf0e10cSrcweir
330cdf0e10cSrcweir ---------------------------------------------------------------------------*/
GetSchemeNames()331cdf0e10cSrcweir uno::Sequence< ::rtl::OUString> ColorConfig_Impl::GetSchemeNames()
332cdf0e10cSrcweir {
333cdf0e10cSrcweir return GetNodeNames(C2U("ColorSchemes"));
334cdf0e10cSrcweir }
335cdf0e10cSrcweir /* -----------------------------09.04.2002 17:19------------------------------
336cdf0e10cSrcweir
337cdf0e10cSrcweir ---------------------------------------------------------------------------*/
AddScheme(const rtl::OUString & rScheme)338cdf0e10cSrcweir sal_Bool ColorConfig_Impl::AddScheme(const rtl::OUString& rScheme)
339cdf0e10cSrcweir {
340cdf0e10cSrcweir if(ConfigItem::AddNode(C2U("ColorSchemes"), rScheme))
341cdf0e10cSrcweir {
342cdf0e10cSrcweir m_sLoadedScheme = rScheme;
343cdf0e10cSrcweir Commit();
344cdf0e10cSrcweir return sal_True;
345cdf0e10cSrcweir }
346cdf0e10cSrcweir return sal_False;
347cdf0e10cSrcweir }
348cdf0e10cSrcweir /* -----------------------------09.04.2002 17:19------------------------------
349cdf0e10cSrcweir
350cdf0e10cSrcweir ---------------------------------------------------------------------------*/
RemoveScheme(const rtl::OUString & rScheme)351cdf0e10cSrcweir sal_Bool ColorConfig_Impl::RemoveScheme(const rtl::OUString& rScheme)
352cdf0e10cSrcweir {
353cdf0e10cSrcweir uno::Sequence< rtl::OUString > aElements(1);
354cdf0e10cSrcweir aElements.getArray()[0] = rScheme;
355cdf0e10cSrcweir return ClearNodeElements(C2U("ColorSchemes"), aElements);
356cdf0e10cSrcweir }
357cdf0e10cSrcweir /* -----------------------------2002/06/20 13:03------------------------------
358cdf0e10cSrcweir
359cdf0e10cSrcweir ---------------------------------------------------------------------------*/
SettingsChanged()360cdf0e10cSrcweir void ColorConfig_Impl::SettingsChanged()
361cdf0e10cSrcweir {
362cdf0e10cSrcweir vos::OGuard aVclGuard( Application::GetSolarMutex() );
363cdf0e10cSrcweir
364cdf0e10cSrcweir ImplUpdateApplicationSettings();
365cdf0e10cSrcweir
366cdf0e10cSrcweir NotifyListeners(0);
367cdf0e10cSrcweir }
368cdf0e10cSrcweir /* -----------------------------2002/08/16 12:07 -----------------------------
369cdf0e10cSrcweir #100822#
370cdf0e10cSrcweir --------------------------------------------------------------------------- */
IMPL_LINK(ColorConfig_Impl,DataChangedEventListener,VclWindowEvent *,pEvent)371cdf0e10cSrcweir IMPL_LINK( ColorConfig_Impl, DataChangedEventListener, VclWindowEvent*, pEvent )
372cdf0e10cSrcweir {
373cdf0e10cSrcweir if ( pEvent->GetId() == VCLEVENT_APPLICATION_DATACHANGED )
374cdf0e10cSrcweir {
375cdf0e10cSrcweir DataChangedEvent* pData = (DataChangedEvent*)(pEvent->GetData());
376cdf0e10cSrcweir if ( (pData->GetType() == DATACHANGED_SETTINGS) &&
377cdf0e10cSrcweir (pData->GetFlags() & SETTINGS_STYLE) )
378cdf0e10cSrcweir {
379cdf0e10cSrcweir SettingsChanged();
380cdf0e10cSrcweir return 1L;
381cdf0e10cSrcweir } else
382cdf0e10cSrcweir return 0L;
383cdf0e10cSrcweir } else
384cdf0e10cSrcweir return 0L;
385cdf0e10cSrcweir }
386cdf0e10cSrcweir
387cdf0e10cSrcweir // ---------------------------------------------------------------------------
388cdf0e10cSrcweir
389cdf0e10cSrcweir /** updates the font color in the vcl window settings */
ImplUpdateApplicationSettings()390cdf0e10cSrcweir void ColorConfig_Impl::ImplUpdateApplicationSettings()
391cdf0e10cSrcweir {
392cdf0e10cSrcweir Application* pApp = GetpApp();
393cdf0e10cSrcweir if( pApp )
394cdf0e10cSrcweir {
395cdf0e10cSrcweir AllSettings aSettings = pApp->GetSettings();
396cdf0e10cSrcweir StyleSettings aStyleSettings( aSettings.GetStyleSettings() );
397cdf0e10cSrcweir
398cdf0e10cSrcweir ColorConfigValue aRet = GetColorConfigValue(svtools::FONTCOLOR);
399cdf0e10cSrcweir if(COL_AUTO == sal::static_int_cast<ColorData>(aRet.nColor))
400cdf0e10cSrcweir aRet.nColor = ColorConfig::GetDefaultColor(svtools::FONTCOLOR).GetColor();
401cdf0e10cSrcweir
402cdf0e10cSrcweir Color aFontColor(aRet.nColor);
403cdf0e10cSrcweir
404cdf0e10cSrcweir if( aStyleSettings.GetFontColor() != aFontColor )
405cdf0e10cSrcweir {
406cdf0e10cSrcweir aStyleSettings.SetFontColor( aFontColor );
407cdf0e10cSrcweir
408cdf0e10cSrcweir aSettings.SetStyleSettings( aStyleSettings );
409cdf0e10cSrcweir pApp->SetSettings( aSettings );
410cdf0e10cSrcweir }
411cdf0e10cSrcweir }
412cdf0e10cSrcweir }
413cdf0e10cSrcweir
414cdf0e10cSrcweir // ---------------------------------------------------------------------------
415cdf0e10cSrcweir
ColorConfig()416cdf0e10cSrcweir ColorConfig::ColorConfig()
417cdf0e10cSrcweir {
418cdf0e10cSrcweir ::osl::MutexGuard aGuard( ColorMutex_Impl::get() );
419cdf0e10cSrcweir if ( !m_pImpl )
420cdf0e10cSrcweir {
421cdf0e10cSrcweir m_pImpl = new ColorConfig_Impl;
422cdf0e10cSrcweir ItemHolder2::holdConfigItem(E_COLORCFG);
423cdf0e10cSrcweir }
424cdf0e10cSrcweir ++nColorRefCount_Impl;
425cdf0e10cSrcweir m_pImpl->AddListener(this);
426cdf0e10cSrcweir }
427cdf0e10cSrcweir /* -----------------------------16.01.01 15:36--------------------------------
428cdf0e10cSrcweir
429cdf0e10cSrcweir ---------------------------------------------------------------------------*/
~ColorConfig()430cdf0e10cSrcweir ColorConfig::~ColorConfig()
431cdf0e10cSrcweir {
432cdf0e10cSrcweir ::osl::MutexGuard aGuard( ColorMutex_Impl::get() );
433cdf0e10cSrcweir m_pImpl->RemoveListener(this);
434cdf0e10cSrcweir if(!--nColorRefCount_Impl)
435cdf0e10cSrcweir {
436cdf0e10cSrcweir delete m_pImpl;
437cdf0e10cSrcweir m_pImpl = 0;
438cdf0e10cSrcweir }
439cdf0e10cSrcweir }
440cdf0e10cSrcweir /* -----------------------------11.04.2002 11:49------------------------------
441cdf0e10cSrcweir
442cdf0e10cSrcweir ---------------------------------------------------------------------------*/
GetDefaultColor(ColorConfigEntry eEntry)443cdf0e10cSrcweir Color ColorConfig::GetDefaultColor(ColorConfigEntry eEntry)
444cdf0e10cSrcweir {
445cdf0e10cSrcweir static const sal_Int32 aAutoColors[] =
446cdf0e10cSrcweir {
447cdf0e10cSrcweir 0, // DOCCOLOR
448cdf0e10cSrcweir 0xc0c0c0, // DOCBOUNDARIES
449cdf0e10cSrcweir 0x808080, // APPBACKGROUND
450cdf0e10cSrcweir 0xc0c0c0, // OBJECTBOUNDARIES
451cdf0e10cSrcweir 0xc0c0c0, // TABLEBOUNDARIES
452cdf0e10cSrcweir 0, // FONTCOLOR
453cdf0e10cSrcweir 0xcc, // LINKS
454cdf0e10cSrcweir 0x80, // LINKSVISITED
455cdf0e10cSrcweir 0, // ANCHOR
456cdf0e10cSrcweir 0xff0000, // SPELL
457cdf0e10cSrcweir COL_LIGHTMAGENTA,// SMARTTAGS
458cdf0e10cSrcweir 0xc0c0c0, // WRITERTEXTGRID
459cdf0e10cSrcweir 0xc0c0c0, // WRITERFIELDSHADIN
460cdf0e10cSrcweir 0xc0c0c0, // WRITERIDXSHADINGS
461cdf0e10cSrcweir 0, // WRITERDIRECTCURSOR
462cdf0e10cSrcweir COL_GREEN, //WRITERSCRIPTINDICATOR
463cdf0e10cSrcweir 0xc0c0c0, //WRITERSECTIONBOUNDARIES
464cdf0e10cSrcweir COL_BLUE, //WRITERPAGEBREAKS,
465cdf0e10cSrcweir COL_LIGHTBLUE, // HTMLSGML
466cdf0e10cSrcweir COL_LIGHTGREEN, // HTMLCOMMENT
467cdf0e10cSrcweir COL_LIGHTRED, // HTMLKEYWORD
468cdf0e10cSrcweir COL_GRAY, // HTMLUNKNOWN
469cdf0e10cSrcweir COL_LIGHTGRAY, // CALCGRID
470cdf0e10cSrcweir COL_BLUE, //CALCPAGEBREAK
471cdf0e10cSrcweir 0x2300dc, //CALCPAGEBREAKMANUAL
472cdf0e10cSrcweir COL_GRAY, //CALCPAGEBREAKAUTOMATIC
473cdf0e10cSrcweir COL_LIGHTBLUE, // CALCDETECTIVE
474cdf0e10cSrcweir COL_LIGHTRED, // CALCDETECTIVEERROR
475cdf0e10cSrcweir COL_LIGHTRED, // CALCREFERENCE
476cdf0e10cSrcweir 0xffffc0, // CALCNOTESBACKGROUND
477cdf0e10cSrcweir 0xc0c0c0, // DRAWGRID
478cdf0e10cSrcweir 0, // DRAWDRAWING
479cdf0e10cSrcweir 0xb8ff, // DRAWFILL
480cdf0e10cSrcweir COL_GREEN, // BASICIDENTIFIER,
481cdf0e10cSrcweir COL_GRAY,// BASICCOMMENT ,
482cdf0e10cSrcweir COL_LIGHTRED,// BASICNUMBER ,
483cdf0e10cSrcweir COL_LIGHTRED,// BASICSTRING ,
484cdf0e10cSrcweir COL_BLUE, // BASICOPERATOR ,
485cdf0e10cSrcweir COL_BLUE, // BASICKEYWORD ,
486cdf0e10cSrcweir COL_RED, //BASICERROR
487cdf0e10cSrcweir 0x009900, // SQLIDENTIFIER
488cdf0e10cSrcweir 0x000000, // SQLNUMBER
489cdf0e10cSrcweir 0xCE7B00, // SQLSTRING
490cdf0e10cSrcweir 0x000000, // SQLOPERATOR
491cdf0e10cSrcweir 0x0000E6, // SQLKEYWORD
492cdf0e10cSrcweir 0x259D9D, // SQLPARAMTER
493cdf0e10cSrcweir 0x969696,// SQLCOMMENT
494cdf0e10cSrcweir };
495cdf0e10cSrcweir Color aRet;
496cdf0e10cSrcweir switch(eEntry)
497cdf0e10cSrcweir {
498cdf0e10cSrcweir case DOCCOLOR :
499cdf0e10cSrcweir aRet = Application::GetSettings().GetStyleSettings().GetWindowColor();
500cdf0e10cSrcweir break;
501cdf0e10cSrcweir
502cdf0e10cSrcweir case APPBACKGROUND :
503cdf0e10cSrcweir aRet = Application::GetSettings().GetStyleSettings().GetWorkspaceColor();
504cdf0e10cSrcweir break;
505cdf0e10cSrcweir
506cdf0e10cSrcweir case SPELL :
507cdf0e10cSrcweir case DRAWDRAWING :
508cdf0e10cSrcweir case SMARTTAGS :
509cdf0e10cSrcweir {
510cdf0e10cSrcweir const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
511cdf0e10cSrcweir aRet = rStyleSettings.GetHighContrastMode() ?
512cdf0e10cSrcweir rStyleSettings.GetDialogTextColor().GetColor() : aAutoColors[eEntry];
513cdf0e10cSrcweir }
514cdf0e10cSrcweir break;
515cdf0e10cSrcweir
516cdf0e10cSrcweir case DRAWFILL :
517cdf0e10cSrcweir aRet = /*rStyleSettings.GetHighContrastMode() ?
518cdf0e10cSrcweir rStyleSettings.OutlineMode??? : */ aAutoColors[eEntry];
519cdf0e10cSrcweir break;
520cdf0e10cSrcweir
521cdf0e10cSrcweir case FONTCOLOR :
522cdf0e10cSrcweir aRet = Application::GetSettings().GetStyleSettings().GetWindowTextColor();
523cdf0e10cSrcweir break;
524cdf0e10cSrcweir
525cdf0e10cSrcweir case LINKS :
526cdf0e10cSrcweir aRet = Application::GetSettings().GetStyleSettings().GetLinkColor();
527cdf0e10cSrcweir break;
528cdf0e10cSrcweir
529cdf0e10cSrcweir case LINKSVISITED :
530cdf0e10cSrcweir aRet = Application::GetSettings().GetStyleSettings().GetVisitedLinkColor();
531cdf0e10cSrcweir break;
532cdf0e10cSrcweir
533cdf0e10cSrcweir default:
534cdf0e10cSrcweir aRet = aAutoColors[eEntry];
535cdf0e10cSrcweir }
536cdf0e10cSrcweir return aRet;
537cdf0e10cSrcweir }
538cdf0e10cSrcweir /* -----------------------------11.04.2002 11:49------------------------------
539cdf0e10cSrcweir
540cdf0e10cSrcweir ---------------------------------------------------------------------------*/
GetColorValue(ColorConfigEntry eEntry,sal_Bool bSmart) const541cdf0e10cSrcweir ColorConfigValue ColorConfig::GetColorValue(ColorConfigEntry eEntry, sal_Bool bSmart)const
542cdf0e10cSrcweir {
543cdf0e10cSrcweir ColorConfigValue aRet = m_pImpl->GetColorConfigValue(eEntry);
544cdf0e10cSrcweir if(bSmart)
545cdf0e10cSrcweir {
546cdf0e10cSrcweir if(COL_AUTO == sal::static_int_cast<ColorData>(aRet.nColor))
547cdf0e10cSrcweir aRet.nColor = ColorConfig::GetDefaultColor(eEntry).GetColor();
548cdf0e10cSrcweir //#103495# don't allow grey between 40% and 60% as application background
549cdf0e10cSrcweir const sal_uInt8 nRed = COLORDATA_RED( aRet.nColor);
550cdf0e10cSrcweir if(eEntry == APPBACKGROUND &&
551cdf0e10cSrcweir (nRed == COLORDATA_GREEN( aRet.nColor)) &&
552cdf0e10cSrcweir (nRed == COLORDATA_BLUE( aRet.nColor)) &&
553cdf0e10cSrcweir nRed > 102 && nRed < 153 )
554cdf0e10cSrcweir {
555cdf0e10cSrcweir aRet.nColor = RGB_COLORDATA(153, 153, 153);
556cdf0e10cSrcweir }
557cdf0e10cSrcweir }
558cdf0e10cSrcweir
559cdf0e10cSrcweir return aRet;
560cdf0e10cSrcweir }
561cdf0e10cSrcweir /* -----------------------------25.03.2002 12:01------------------------------
562cdf0e10cSrcweir
563cdf0e10cSrcweir ---------------------------------------------------------------------------*/
EditableColorConfig()564cdf0e10cSrcweir EditableColorConfig::EditableColorConfig() :
565cdf0e10cSrcweir m_pImpl(new ColorConfig_Impl),
566cdf0e10cSrcweir m_bModified(sal_False)
567cdf0e10cSrcweir {
568cdf0e10cSrcweir m_pImpl->BlockBroadcasts(sal_True);
569cdf0e10cSrcweir }
570cdf0e10cSrcweir /*-- 25.03.2002 12:03:08---------------------------------------------------
571cdf0e10cSrcweir
572cdf0e10cSrcweir -----------------------------------------------------------------------*/
~EditableColorConfig()573cdf0e10cSrcweir EditableColorConfig::~EditableColorConfig()
574cdf0e10cSrcweir {
575cdf0e10cSrcweir m_pImpl->BlockBroadcasts(sal_False);
576cdf0e10cSrcweir if(m_bModified)
577cdf0e10cSrcweir m_pImpl->SetModified();
578cdf0e10cSrcweir if(m_pImpl->IsModified())
579cdf0e10cSrcweir m_pImpl->Commit();
580cdf0e10cSrcweir delete m_pImpl;
581cdf0e10cSrcweir }
582cdf0e10cSrcweir
583cdf0e10cSrcweir /*-- 25.03.2002 12:03:15---------------------------------------------------
584cdf0e10cSrcweir
585cdf0e10cSrcweir -----------------------------------------------------------------------*/
GetSchemeNames() const586cdf0e10cSrcweir uno::Sequence< ::rtl::OUString > EditableColorConfig::GetSchemeNames() const
587cdf0e10cSrcweir {
588cdf0e10cSrcweir return m_pImpl->GetSchemeNames();
589cdf0e10cSrcweir }
590cdf0e10cSrcweir /*-- 25.03.2002 12:03:16---------------------------------------------------
591cdf0e10cSrcweir
592cdf0e10cSrcweir -----------------------------------------------------------------------*/
DeleteScheme(const::rtl::OUString & rScheme)593cdf0e10cSrcweir void EditableColorConfig::DeleteScheme(const ::rtl::OUString& rScheme )
594cdf0e10cSrcweir {
595cdf0e10cSrcweir m_pImpl->RemoveScheme(rScheme);
596cdf0e10cSrcweir }
597cdf0e10cSrcweir /*-- 25.03.2002 12:03:16---------------------------------------------------
598cdf0e10cSrcweir
599cdf0e10cSrcweir -----------------------------------------------------------------------*/
AddScheme(const::rtl::OUString & rScheme)600cdf0e10cSrcweir void EditableColorConfig::AddScheme(const ::rtl::OUString& rScheme )
601cdf0e10cSrcweir {
602cdf0e10cSrcweir m_pImpl->AddScheme(rScheme);
603cdf0e10cSrcweir }
604cdf0e10cSrcweir /*-- 25.03.2002 12:03:16---------------------------------------------------
605cdf0e10cSrcweir
606cdf0e10cSrcweir -----------------------------------------------------------------------*/
LoadScheme(const::rtl::OUString & rScheme)607cdf0e10cSrcweir sal_Bool EditableColorConfig::LoadScheme(const ::rtl::OUString& rScheme )
608cdf0e10cSrcweir {
609cdf0e10cSrcweir if(m_bModified)
610cdf0e10cSrcweir m_pImpl->SetModified();
611cdf0e10cSrcweir if(m_pImpl->IsModified())
612cdf0e10cSrcweir m_pImpl->Commit();
613cdf0e10cSrcweir m_bModified = sal_False;
614cdf0e10cSrcweir m_pImpl->Load(rScheme);
615cdf0e10cSrcweir //the name of the loaded scheme has to be committed separately
616cdf0e10cSrcweir m_pImpl->CommitCurrentSchemeName();
617cdf0e10cSrcweir return sal_True;
618cdf0e10cSrcweir }
619cdf0e10cSrcweir /*-- 25.03.2002 12:03:16---------------------------------------------------
620cdf0e10cSrcweir
621cdf0e10cSrcweir -----------------------------------------------------------------------*/
GetCurrentSchemeName() const622cdf0e10cSrcweir const ::rtl::OUString& EditableColorConfig::GetCurrentSchemeName()const
623cdf0e10cSrcweir {
624cdf0e10cSrcweir return m_pImpl->GetLoadedScheme();
625cdf0e10cSrcweir }
626cdf0e10cSrcweir /* -----------------11.12.2002 10:56-----------------
627cdf0e10cSrcweir * changes the name of the current scheme but doesn't load it!
628cdf0e10cSrcweir * --------------------------------------------------*/
SetCurrentSchemeName(const::rtl::OUString & rScheme)629cdf0e10cSrcweir void EditableColorConfig::SetCurrentSchemeName(const ::rtl::OUString& rScheme)
630cdf0e10cSrcweir {
631cdf0e10cSrcweir m_pImpl->SetCurrentSchemeName(rScheme);
632cdf0e10cSrcweir m_pImpl->CommitCurrentSchemeName();
633cdf0e10cSrcweir }
634cdf0e10cSrcweir /*-- 25.03.2002 12:03:17---------------------------------------------------
635cdf0e10cSrcweir
636cdf0e10cSrcweir -----------------------------------------------------------------------*/
GetColorValue(ColorConfigEntry eEntry) const637cdf0e10cSrcweir const ColorConfigValue& EditableColorConfig::GetColorValue(
638cdf0e10cSrcweir ColorConfigEntry eEntry)const
639cdf0e10cSrcweir {
640cdf0e10cSrcweir return m_pImpl->GetColorConfigValue(eEntry);
641cdf0e10cSrcweir }
642cdf0e10cSrcweir /*-- 25.03.2002 12:03:17---------------------------------------------------
643cdf0e10cSrcweir
644cdf0e10cSrcweir -----------------------------------------------------------------------*/
SetColorValue(ColorConfigEntry eEntry,const ColorConfigValue & rValue)645cdf0e10cSrcweir void EditableColorConfig::SetColorValue(
646cdf0e10cSrcweir ColorConfigEntry eEntry, const ColorConfigValue& rValue)
647cdf0e10cSrcweir {
648cdf0e10cSrcweir m_pImpl->SetColorConfigValue(eEntry, rValue);
649cdf0e10cSrcweir m_pImpl->ClearModified();
650cdf0e10cSrcweir m_bModified = sal_True;
651cdf0e10cSrcweir }
652cdf0e10cSrcweir /* -----------------------------10.04.2002 13:22------------------------------
653cdf0e10cSrcweir
654cdf0e10cSrcweir ---------------------------------------------------------------------------*/
SetModified()655cdf0e10cSrcweir void EditableColorConfig::SetModified()
656cdf0e10cSrcweir {
657cdf0e10cSrcweir m_bModified = sal_True;
658cdf0e10cSrcweir }
659cdf0e10cSrcweir /* -----------------15.10.2002 14:51-----------------
660cdf0e10cSrcweir *
661cdf0e10cSrcweir * --------------------------------------------------*/
Commit()662cdf0e10cSrcweir void EditableColorConfig::Commit()
663cdf0e10cSrcweir {
664cdf0e10cSrcweir if(m_bModified)
665cdf0e10cSrcweir m_pImpl->SetModified();
666cdf0e10cSrcweir if(m_pImpl->IsModified())
667cdf0e10cSrcweir m_pImpl->Commit();
668cdf0e10cSrcweir m_bModified = sal_False;
669cdf0e10cSrcweir }
670cdf0e10cSrcweir // -----------------------------------------------------------------------------
DisableBroadcast()671cdf0e10cSrcweir void EditableColorConfig::DisableBroadcast()
672cdf0e10cSrcweir {
673cdf0e10cSrcweir m_pImpl->BlockBroadcasts(sal_True);
674cdf0e10cSrcweir }
675cdf0e10cSrcweir // -----------------------------------------------------------------------------
EnableBroadcast()676cdf0e10cSrcweir void EditableColorConfig::EnableBroadcast()
677cdf0e10cSrcweir {
678cdf0e10cSrcweir m_pImpl->BlockBroadcasts(sal_False);
679cdf0e10cSrcweir }
680cdf0e10cSrcweir // -----------------------------------------------------------------------------
681cdf0e10cSrcweir
682cdf0e10cSrcweir }//namespace svtools
683