xref: /aoo41x/main/sw/source/ui/config/usrpref.cxx (revision a41e6500)
1efeef26fSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3efeef26fSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4efeef26fSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5efeef26fSAndrew Rist  * distributed with this work for additional information
6efeef26fSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7efeef26fSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8efeef26fSAndrew Rist  * "License"); you may not use this file except in compliance
9efeef26fSAndrew Rist  * with the License.  You may obtain a copy of the License at
10efeef26fSAndrew Rist  *
11efeef26fSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12efeef26fSAndrew Rist  *
13efeef26fSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14efeef26fSAndrew Rist  * software distributed under the License is distributed on an
15efeef26fSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16efeef26fSAndrew Rist  * KIND, either express or implied.  See the License for the
17efeef26fSAndrew Rist  * specific language governing permissions and limitations
18efeef26fSAndrew Rist  * under the License.
19efeef26fSAndrew Rist  *
20efeef26fSAndrew Rist  *************************************************************/
21efeef26fSAndrew Rist 
22efeef26fSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sw.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include <tools/stream.hxx>
29cdf0e10cSrcweir #include <unotools/syslocale.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #include "swtypes.hxx"
32cdf0e10cSrcweir #include "hintids.hxx"
33cdf0e10cSrcweir #include "uitool.hxx"
34cdf0e10cSrcweir #include "usrpref.hxx"
35cdf0e10cSrcweir #include "crstate.hxx"
36cdf0e10cSrcweir #include <linguistic/lngprops.hxx>
37cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
38cdf0e10cSrcweir #include <com/sun/star/uno/Any.hxx>
39cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx>
40cdf0e10cSrcweir #include <unotools/localedatawrapper.hxx>
41cdf0e10cSrcweir 
42cdf0e10cSrcweir #include <unomid.h>
43cdf0e10cSrcweir 
44cdf0e10cSrcweir using namespace utl;
45cdf0e10cSrcweir using namespace rtl;
46cdf0e10cSrcweir using namespace ::com::sun::star;
47cdf0e10cSrcweir using namespace ::com::sun::star::uno;
48cdf0e10cSrcweir 
49cdf0e10cSrcweir 
SetUsrPref(const SwViewOption & rCopy)50cdf0e10cSrcweir void SwMasterUsrPref::SetUsrPref(const SwViewOption &rCopy)
51cdf0e10cSrcweir {
52cdf0e10cSrcweir 	*((SwViewOption*)this) = rCopy;
53cdf0e10cSrcweir }
54cdf0e10cSrcweir 
SwMasterUsrPref(sal_Bool bWeb)55cdf0e10cSrcweir SwMasterUsrPref::SwMasterUsrPref(sal_Bool bWeb) :
56cdf0e10cSrcweir     eFldUpdateFlags(AUTOUPD_OFF),
57cdf0e10cSrcweir     nLinkUpdateMode(0),
58cdf0e10cSrcweir     bIsHScrollMetricSet(sal_False),
59cdf0e10cSrcweir     bIsVScrollMetricSet(sal_False),
60cdf0e10cSrcweir     nDefTab( MM50 * 4 ),
61cdf0e10cSrcweir     bIsSquaredPageMode(sal_False),
62cdf0e10cSrcweir     aContentConfig(bWeb, *this),
63cdf0e10cSrcweir     aLayoutConfig(bWeb, *this),
64cdf0e10cSrcweir     aGridConfig(bWeb, *this),
65cdf0e10cSrcweir     aCursorConfig(*this),
66cdf0e10cSrcweir     pWebColorConfig(bWeb ? new SwWebColorConfig(*this) : 0)
67cdf0e10cSrcweir {
68cdf0e10cSrcweir     MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum();
69cdf0e10cSrcweir     eUserMetric = MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH;
70cdf0e10cSrcweir     eHScrollMetric = eUserMetric;
71cdf0e10cSrcweir     eVScrollMetric = eUserMetric;
72cdf0e10cSrcweir 
73cdf0e10cSrcweir     aContentConfig.Load();
74cdf0e10cSrcweir 	aLayoutConfig.Load();
75cdf0e10cSrcweir 	aGridConfig.Load();
76cdf0e10cSrcweir 	aCursorConfig.Load();
77cdf0e10cSrcweir 	if(pWebColorConfig)
78cdf0e10cSrcweir 		pWebColorConfig->Load();
79cdf0e10cSrcweir }
80cdf0e10cSrcweir /* -----------------------------13.02.01 09:48--------------------------------
81cdf0e10cSrcweir 
82cdf0e10cSrcweir  ---------------------------------------------------------------------------*/
~SwMasterUsrPref()83cdf0e10cSrcweir SwMasterUsrPref::~SwMasterUsrPref()
84cdf0e10cSrcweir {
85cdf0e10cSrcweir 	delete pWebColorConfig;
86cdf0e10cSrcweir }
87cdf0e10cSrcweir /*-- 28.09.00 09:55:32---------------------------------------------------
88cdf0e10cSrcweir 
89cdf0e10cSrcweir   -----------------------------------------------------------------------*/
GetPropertyNames()90cdf0e10cSrcweir Sequence<OUString> SwContentViewConfig::GetPropertyNames()
91cdf0e10cSrcweir {
92cdf0e10cSrcweir 	static const char* aPropNames[] =
93cdf0e10cSrcweir 	{
94cdf0e10cSrcweir 		"Display/GraphicObject",   					// 	0
95cdf0e10cSrcweir 		"Display/Table",							//  1
96cdf0e10cSrcweir 		"Display/DrawingControl",  					//  2
97cdf0e10cSrcweir 		"Display/FieldCode",	   					//  3
98cdf0e10cSrcweir 		"Display/Note",								//  4
99ef785786SAriel Constenla-Haile         "Display/ShowContentTips",                      //  5
100cdf0e10cSrcweir         "NonprintingCharacter/MetaCharacters",     //   6
101cdf0e10cSrcweir         "NonprintingCharacter/ParagraphEnd",        //  7
102cdf0e10cSrcweir         "NonprintingCharacter/OptionalHyphen",      //  8
103cdf0e10cSrcweir         "NonprintingCharacter/Space",               //  9
104cdf0e10cSrcweir         "NonprintingCharacter/Break",               // 10
105cdf0e10cSrcweir         "NonprintingCharacter/ProtectedSpace",      // 11
106cdf0e10cSrcweir             "NonprintingCharacter/Tab",             // 12 //not in Writer/Web
107cdf0e10cSrcweir             "NonprintingCharacter/HiddenText",      // 13
108cdf0e10cSrcweir             "NonprintingCharacter/HiddenParagraph", // 14
109cdf0e10cSrcweir             "NonprintingCharacter/HiddenCharacter",      // 15
110cdf0e10cSrcweir             "Update/Link",                          // 16
111cdf0e10cSrcweir             "Update/Field",                         // 17
112cdf0e10cSrcweir             "Update/Chart"                          // 18
113cdf0e10cSrcweir 
114cdf0e10cSrcweir 
115cdf0e10cSrcweir 	};
116cdf0e10cSrcweir     const int nCount = bWeb ? 12 : 19;
117cdf0e10cSrcweir 	Sequence<OUString> aNames(nCount);
118cdf0e10cSrcweir 	OUString* pNames = aNames.getArray();
119cdf0e10cSrcweir 	for(int i = 0; i < nCount; i++)
120cdf0e10cSrcweir 	{
121cdf0e10cSrcweir 		pNames[i] = OUString::createFromAscii(aPropNames[i]);
122cdf0e10cSrcweir 	}
123cdf0e10cSrcweir 	return aNames;
124cdf0e10cSrcweir }
125cdf0e10cSrcweir /*-- 28.09.00 09:55:33---------------------------------------------------
126cdf0e10cSrcweir 
127cdf0e10cSrcweir   -----------------------------------------------------------------------*/
SwContentViewConfig(sal_Bool bIsWeb,SwMasterUsrPref & rPar)128cdf0e10cSrcweir SwContentViewConfig::SwContentViewConfig(sal_Bool bIsWeb, SwMasterUsrPref& rPar) :
129cdf0e10cSrcweir     ConfigItem(bIsWeb ? C2U("Office.WriterWeb/Content") :  C2U("Office.Writer/Content")),
130cdf0e10cSrcweir 	rParent(rPar),
131cdf0e10cSrcweir 	bWeb(bIsWeb)
132cdf0e10cSrcweir {
133cdf0e10cSrcweir 	Load();
134cdf0e10cSrcweir     EnableNotification( GetPropertyNames() );
135cdf0e10cSrcweir }
136cdf0e10cSrcweir /*-- 28.09.00 09:55:33---------------------------------------------------
137cdf0e10cSrcweir 
138cdf0e10cSrcweir   -----------------------------------------------------------------------*/
~SwContentViewConfig()139cdf0e10cSrcweir SwContentViewConfig::~SwContentViewConfig()
140cdf0e10cSrcweir {
141cdf0e10cSrcweir }
142cdf0e10cSrcweir /*-- 09.02.07 09:55:33---------------------------------------------------
143cdf0e10cSrcweir 
144cdf0e10cSrcweir   -----------------------------------------------------------------------*/
Notify(const Sequence<OUString> &)145cdf0e10cSrcweir void SwContentViewConfig::Notify( const Sequence< OUString > & /*rPropertyNames*/ )
146cdf0e10cSrcweir {
147cdf0e10cSrcweir     Load();
148cdf0e10cSrcweir }
149cdf0e10cSrcweir /*-- 28.09.00 09:55:33---------------------------------------------------
150cdf0e10cSrcweir 
151cdf0e10cSrcweir   -----------------------------------------------------------------------*/
Commit()152cdf0e10cSrcweir void SwContentViewConfig::Commit()
153cdf0e10cSrcweir {
154cdf0e10cSrcweir 	Sequence<OUString> aNames = GetPropertyNames();
155cdf0e10cSrcweir 
156cdf0e10cSrcweir 	Sequence<Any> aValues(aNames.getLength());
157cdf0e10cSrcweir 	Any* pValues = aValues.getArray();
158cdf0e10cSrcweir 
159cdf0e10cSrcweir 	for(int nProp = 0; nProp < aNames.getLength(); nProp++)
160cdf0e10cSrcweir 	{
161cdf0e10cSrcweir 		sal_Bool bVal = sal_False;
162cdf0e10cSrcweir 		switch(nProp)
163cdf0e10cSrcweir 		{
164cdf0e10cSrcweir 			case  0: bVal = rParent.IsGraphic();	break;// "Display/GraphicObject",
165cdf0e10cSrcweir 			case  1: bVal = rParent.IsTable();	break;// "Display/Table",
166cdf0e10cSrcweir 			case  2: bVal = rParent.IsDraw();    	break;// "Display/DrawingControl",
167cdf0e10cSrcweir 			case  3: bVal = rParent.IsFldName(); 	break;// "Display/FieldCode",
168cdf0e10cSrcweir 			case  4: bVal = rParent.IsPostIts(); 	break;// "Display/Note",
169ef785786SAriel Constenla-Haile             case  5: bVal = rParent.IsShowContentTips(); break; // "Display/ShowContentTips"
170cdf0e10cSrcweir             case  6: bVal = rParent.IsViewMetaChars(); break; //"NonprintingCharacter/MetaCharacters"
171cdf0e10cSrcweir             case  7: bVal = rParent.IsParagraph(sal_True); break;// "NonprintingCharacter/ParagraphEnd",
172cdf0e10cSrcweir             case  8: bVal = rParent.IsSoftHyph(); break;// "NonprintingCharacter/OptionalHyphen",
173cdf0e10cSrcweir             case  9: bVal = rParent.IsBlank(sal_True);  break;// "NonprintingCharacter/Space",
174cdf0e10cSrcweir             case 10: bVal = rParent.IsLineBreak(sal_True);break;// "NonprintingCharacter/Break",
175cdf0e10cSrcweir             case 11: bVal = rParent.IsHardBlank(); break;// "NonprintingCharacter/ProtectedSpace",
176cdf0e10cSrcweir             case 12: bVal = rParent.IsTab(sal_True);        break;// "NonprintingCharacter/Tab",
177cdf0e10cSrcweir             case 13: bVal = rParent.IsShowHiddenField(); break;// "NonprintingCharacter/Fields: HiddenText",
178cdf0e10cSrcweir             case 14: bVal = rParent.IsShowHiddenPara(); break;// "NonprintingCharacter/Fields: HiddenParagraph",
179cdf0e10cSrcweir             case 15: bVal = rParent.IsShowHiddenChar(sal_True);    break;// "NonprintingCharacter/HiddenCharacter",
180cdf0e10cSrcweir             case 16: pValues[nProp] <<= rParent.GetUpdateLinkMode();    break;// "Update/Link",
181cdf0e10cSrcweir             case 17: bVal = rParent.IsUpdateFields(); break;// "Update/Field",
182cdf0e10cSrcweir             case 18: bVal = rParent.IsUpdateCharts(); break;// "Update/Chart"
183cdf0e10cSrcweir         }
184cdf0e10cSrcweir         if(nProp != 16)
185cdf0e10cSrcweir 			pValues[nProp].setValue(&bVal, ::getBooleanCppuType());
186cdf0e10cSrcweir 	}
187cdf0e10cSrcweir 	PutProperties(aNames, aValues);
188cdf0e10cSrcweir }
189cdf0e10cSrcweir /*-- 28.09.00 09:55:34---------------------------------------------------
190cdf0e10cSrcweir 
191cdf0e10cSrcweir   -----------------------------------------------------------------------*/
Load()192cdf0e10cSrcweir void SwContentViewConfig::Load()
193cdf0e10cSrcweir {
194cdf0e10cSrcweir 	Sequence<OUString> aNames = GetPropertyNames();
195cdf0e10cSrcweir 	Sequence<Any> aValues = GetProperties(aNames);
196cdf0e10cSrcweir 	const Any* pValues = aValues.getConstArray();
197cdf0e10cSrcweir 	DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
198cdf0e10cSrcweir 	if(aValues.getLength() == aNames.getLength())
199cdf0e10cSrcweir 	{
200cdf0e10cSrcweir 		for(int nProp = 0; nProp < aNames.getLength(); nProp++)
201cdf0e10cSrcweir 		{
202cdf0e10cSrcweir 			if(pValues[nProp].hasValue())
203cdf0e10cSrcweir 			{
204cdf0e10cSrcweir                 sal_Bool bSet = nProp != 16 ? *(sal_Bool*)pValues[nProp].getValue() : sal_False;
205cdf0e10cSrcweir 				switch(nProp)
206cdf0e10cSrcweir 				{
207cdf0e10cSrcweir 					case  0: rParent.SetGraphic(bSet);	break;// "Display/GraphicObject",
208cdf0e10cSrcweir 					case  1: rParent.SetTable(bSet);	break;// "Display/Table",
209cdf0e10cSrcweir 					case  2: rParent.SetDraw(bSet);    	break;// "Display/DrawingControl",
210cdf0e10cSrcweir 					case  3: rParent.SetFldName(bSet); 	break;// "Display/FieldCode",
211cdf0e10cSrcweir 					case  4: rParent.SetPostIts(bSet); 	break;// "Display/Note",
212ef785786SAriel Constenla-Haile                     case  5: rParent.SetShowContentTips(bSet);  break;// "Display/ShowContentTips",
213cdf0e10cSrcweir                     case  6: rParent.SetViewMetaChars(bSet); break; //"NonprintingCharacter/MetaCharacters"
214cdf0e10cSrcweir                     case  7: rParent.SetParagraph(bSet); break;// "NonprintingCharacter/ParagraphEnd",
215cdf0e10cSrcweir                     case  8: rParent.SetSoftHyph(bSet); break;// "NonprintingCharacter/OptionalHyphen",
216cdf0e10cSrcweir                     case  9: rParent.SetBlank(bSet);    break;// "NonprintingCharacter/Space",
217cdf0e10cSrcweir                     case 10: rParent.SetLineBreak(bSet);break;// "NonprintingCharacter/Break",
218cdf0e10cSrcweir                     case 11: rParent.SetHardBlank(bSet); break;// "NonprintingCharacter/ProtectedSpace",
219cdf0e10cSrcweir                     case 12: rParent.SetTab(bSet);      break;// "NonprintingCharacter/Tab",
220cdf0e10cSrcweir                     case 13: rParent.SetShowHiddenField(bSet);   break;// "NonprintingCharacter/Fields: HiddenText",
221cdf0e10cSrcweir                     case 14: rParent.SetShowHiddenPara(bSet); break;// "NonprintingCharacter/Fields: HiddenParagraph",
222cdf0e10cSrcweir                     case 15: rParent.SetShowHiddenChar(bSet); break;// "NonprintingCharacter/HiddenCharacter",
223cdf0e10cSrcweir                     case 16:
224cdf0e10cSrcweir                     {
225cdf0e10cSrcweir 						sal_Int32 nSet = 0;
226cdf0e10cSrcweir 						pValues[nProp] >>= nSet;
227cdf0e10cSrcweir                         rParent.SetUpdateLinkMode(nSet, sal_True);
228cdf0e10cSrcweir 					}
229cdf0e10cSrcweir 					break;// "Update/Link",
230cdf0e10cSrcweir                     case 17: rParent.SetUpdateFields(bSet, sal_True); break;// "Update/Field",
231cdf0e10cSrcweir                     case 18: rParent.SetUpdateCharts(bSet, sal_True); break;// "Update/Chart"
232cdf0e10cSrcweir 				}
233cdf0e10cSrcweir 			}
234cdf0e10cSrcweir 		}
235cdf0e10cSrcweir 	}
236cdf0e10cSrcweir }
237cdf0e10cSrcweir /*-- 28.09.00 09:55:34---------------------------------------------------
238cdf0e10cSrcweir 
239cdf0e10cSrcweir   -----------------------------------------------------------------------*/
GetPropertyNames()240cdf0e10cSrcweir Sequence<OUString> SwLayoutViewConfig::GetPropertyNames()
241cdf0e10cSrcweir {
242cdf0e10cSrcweir 	static const char* aPropNames[] =
243cdf0e10cSrcweir 	{
244cdf0e10cSrcweir         "Line/Guide",                           // 0
245cdf0e10cSrcweir         "Line/SimpleControlPoint",              // 1
246cdf0e10cSrcweir         "Line/LargeControlPoint",               // 2
247cdf0e10cSrcweir         "Window/HorizontalScroll",              // 3
248cdf0e10cSrcweir         "Window/VerticalScroll",                // 4
249cdf0e10cSrcweir         "Window/ShowRulers",                    // 5
250cdf0e10cSrcweir         "Window/HorizontalRuler",               // 6
251cdf0e10cSrcweir         "Window/VerticalRuler",                 // 7
252cdf0e10cSrcweir         "Window/HorizontalRulerUnit",           // 8
253cdf0e10cSrcweir         "Window/VerticalRulerUnit",             // 9
254cdf0e10cSrcweir         "Window/SmoothScroll",                  //10
255cdf0e10cSrcweir         "Zoom/Value",                           //11
256cdf0e10cSrcweir         "Zoom/Type",                            //12
257cdf0e10cSrcweir         "Other/IsAlignMathObjectsToBaseline",   //13
258cdf0e10cSrcweir         "Other/MeasureUnit",                    //14
259cdf0e10cSrcweir         // below properties are not available in WriterWeb
260cdf0e10cSrcweir         "Other/TabStop",                        //15
261cdf0e10cSrcweir         "Window/IsVerticalRulerRight",          //16
262cdf0e10cSrcweir         "ViewLayout/Columns",                   //17
263cdf0e10cSrcweir         "ViewLayout/BookMode",                  //18
264*a41e6500SAriel Constenla-Haile         "Other/IsSquaredPageMode",              //19
265*a41e6500SAriel Constenla-Haile         "Window/ShowScrollBarTips"              //20
266cdf0e10cSrcweir     };
267*a41e6500SAriel Constenla-Haile     const int nCount = bWeb ? 15 : 21;
268cdf0e10cSrcweir     Sequence<OUString> aNames(nCount);
269cdf0e10cSrcweir 	OUString* pNames = aNames.getArray();
270cdf0e10cSrcweir 	for(int i = 0; i < nCount; i++)
271cdf0e10cSrcweir 	{
272cdf0e10cSrcweir 		pNames[i] = OUString::createFromAscii(aPropNames[i]);
273cdf0e10cSrcweir 	}
274cdf0e10cSrcweir 	return aNames;
275cdf0e10cSrcweir }
276cdf0e10cSrcweir /*-- 28.09.00 09:55:34---------------------------------------------------
277cdf0e10cSrcweir 
278cdf0e10cSrcweir   -----------------------------------------------------------------------*/
SwLayoutViewConfig(sal_Bool bIsWeb,SwMasterUsrPref & rPar)279cdf0e10cSrcweir SwLayoutViewConfig::SwLayoutViewConfig(sal_Bool bIsWeb, SwMasterUsrPref& rPar) :
280cdf0e10cSrcweir     ConfigItem(bIsWeb ? C2U("Office.WriterWeb/Layout") :  C2U("Office.Writer/Layout"),
281cdf0e10cSrcweir         CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE),
282cdf0e10cSrcweir 	rParent(rPar),
283cdf0e10cSrcweir 	bWeb(bIsWeb)
284cdf0e10cSrcweir {
285cdf0e10cSrcweir }
286cdf0e10cSrcweir /*-- 28.09.00 09:55:35---------------------------------------------------
287cdf0e10cSrcweir 
288cdf0e10cSrcweir   -----------------------------------------------------------------------*/
~SwLayoutViewConfig()289cdf0e10cSrcweir SwLayoutViewConfig::~SwLayoutViewConfig()
290cdf0e10cSrcweir {
291cdf0e10cSrcweir }
292cdf0e10cSrcweir /*-- 28.09.00 09:55:36---------------------------------------------------
293cdf0e10cSrcweir 
294cdf0e10cSrcweir   -----------------------------------------------------------------------*/
Commit()295cdf0e10cSrcweir void SwLayoutViewConfig::Commit()
296cdf0e10cSrcweir {
297cdf0e10cSrcweir 	Sequence<OUString> aNames = GetPropertyNames();
298cdf0e10cSrcweir 
299cdf0e10cSrcweir 	Sequence<Any> aValues(aNames.getLength());
300cdf0e10cSrcweir 	Any* pValues = aValues.getArray();
301cdf0e10cSrcweir 
302cdf0e10cSrcweir 	for(int nProp = 0; nProp < aNames.getLength(); nProp++)
303cdf0e10cSrcweir 	{
304cdf0e10cSrcweir         Any &rVal = pValues[nProp];
305cdf0e10cSrcweir 		switch(nProp)
306cdf0e10cSrcweir 		{
307cdf0e10cSrcweir             case  0: rVal <<= (sal_Bool) rParent.IsCrossHair(); break;              // "Line/Guide",
308cdf0e10cSrcweir             case  1: rVal <<= (sal_Bool) rParent.IsSolidMarkHdl(); break;           // "Line/SimpleControlPoint",
309cdf0e10cSrcweir             case  2: rVal <<= (sal_Bool) rParent.IsBigMarkHdl(); break;             // "Line/LargeControlPoint",
310cdf0e10cSrcweir             case  3: rVal <<= (sal_Bool) rParent.IsViewHScrollBar(); break;         // "Window/HorizontalScroll",
311cdf0e10cSrcweir             case  4: rVal <<= (sal_Bool) rParent.IsViewVScrollBar(); break;         // "Window/VerticalScroll",
312cdf0e10cSrcweir             case  5: rVal <<= (sal_Bool) rParent.IsViewAnyRuler(); break;           // "Window/ShowRulers"
313cdf0e10cSrcweir             // #i14593# use IsView*Ruler(sal_True) instead of IsView*Ruler()
314cdf0e10cSrcweir             // this preserves the single ruler states even if "Window/ShowRulers" is off
315cdf0e10cSrcweir             case  6: rVal <<= (sal_Bool) rParent.IsViewHRuler(sal_True); break;         // "Window/HorizontalRuler",
316cdf0e10cSrcweir             case  7: rVal <<= (sal_Bool) rParent.IsViewVRuler(sal_True); break;         // "Window/VerticalRuler",
317cdf0e10cSrcweir             case  8:
318cdf0e10cSrcweir                 if(rParent.bIsHScrollMetricSet)
319cdf0e10cSrcweir                     rVal <<= (sal_Int32)rParent.eHScrollMetric;                     // "Window/HorizontalRulerUnit"
320cdf0e10cSrcweir             break;
321cdf0e10cSrcweir             case  9:
322cdf0e10cSrcweir                 if(rParent.bIsVScrollMetricSet)
323cdf0e10cSrcweir                     rVal <<= (sal_Int32)rParent.eVScrollMetric;                     // "Window/VerticalRulerUnit"
324cdf0e10cSrcweir             break;
325cdf0e10cSrcweir             case 10: rVal <<= (sal_Bool) rParent.IsSmoothScroll(); break;           // "Window/SmoothScroll",
326cdf0e10cSrcweir             case 11: rVal <<= (sal_Int32)rParent.GetZoom(); break;                  // "Zoom/Value",
327cdf0e10cSrcweir             case 12: rVal <<= (sal_Int32)rParent.GetZoomType(); break;              // "Zoom/Type",
328cdf0e10cSrcweir             case 13: rVal <<= (sal_Bool) rParent.IsAlignMathObjectsToBaseline(); break;      // "Other/IsAlignMathObjectsToBaseline"
329cdf0e10cSrcweir             case 14: rVal <<= (sal_Int32)rParent.GetMetric(); break;                // "Other/MeasureUnit",
330cdf0e10cSrcweir             case 15: rVal <<= static_cast<sal_Int32>(TWIP_TO_MM100(rParent.GetDefTab())); break;// "Other/TabStop",
331cdf0e10cSrcweir             case 16: rVal <<= (sal_Bool) rParent.IsVRulerRight(); break;            // "Window/IsVerticalRulerRight",
332cdf0e10cSrcweir             case 17: rVal <<= (sal_Int32)rParent.GetViewLayoutColumns(); break;     // "ViewLayout/Columns",
333cdf0e10cSrcweir             case 18: rVal <<= (sal_Bool) rParent.IsViewLayoutBookMode(); break;     // "ViewLayout/BookMode",
334cdf0e10cSrcweir             case 19: rVal <<= (sal_Bool) rParent.IsSquaredPageMode(); break;        // "Other/IsSquaredPageMode",
335*a41e6500SAriel Constenla-Haile             case 20: rVal <<= (sal_Bool) rParent.IsShowScrollBarTips(); break;      // "Window/ShowScrollBarTips",
336cdf0e10cSrcweir         }
337cdf0e10cSrcweir 	}
338cdf0e10cSrcweir 	PutProperties(aNames, aValues);
339cdf0e10cSrcweir }
340cdf0e10cSrcweir /*-- 28.09.00 09:55:36---------------------------------------------------
341cdf0e10cSrcweir 
342cdf0e10cSrcweir   -----------------------------------------------------------------------*/
Load()343cdf0e10cSrcweir void SwLayoutViewConfig::Load()
344cdf0e10cSrcweir {
345cdf0e10cSrcweir 	Sequence<OUString> aNames = GetPropertyNames();
346cdf0e10cSrcweir 	Sequence<Any> aValues = GetProperties(aNames);
347cdf0e10cSrcweir 	const Any* pValues = aValues.getConstArray();
348cdf0e10cSrcweir 	DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
349cdf0e10cSrcweir 	if(aValues.getLength() == aNames.getLength())
350cdf0e10cSrcweir 	{
351cdf0e10cSrcweir 		for(int nProp = 0; nProp < aNames.getLength(); nProp++)
352cdf0e10cSrcweir 		{
353cdf0e10cSrcweir 			if(pValues[nProp].hasValue())
354cdf0e10cSrcweir 			{
355cdf0e10cSrcweir                 sal_Int32   nInt32Val   = 0;
356cdf0e10cSrcweir                 sal_Bool    bSet        = sal_False;
357cdf0e10cSrcweir                 pValues[nProp] >>= nInt32Val;
358cdf0e10cSrcweir                 pValues[nProp] >>= bSet;
359cdf0e10cSrcweir 
360cdf0e10cSrcweir                 switch(nProp)
361cdf0e10cSrcweir 				{
362cdf0e10cSrcweir                     case  0: rParent.SetCrossHair(bSet); break;// "Line/Guide",
363cdf0e10cSrcweir                     case  1: rParent.SetSolidMarkHdl(bSet); break;// "Line/SimpleControlPoint",
364cdf0e10cSrcweir                     case  2: rParent.SetBigMarkHdl(bSet); break;// "Line/LargeControlPoint",
365cdf0e10cSrcweir                     case  3: rParent.SetViewHScrollBar(bSet); break;// "Window/HorizontalScroll",
366cdf0e10cSrcweir                     case  4: rParent.SetViewVScrollBar(bSet); break;// "Window/VerticalScroll",
367cdf0e10cSrcweir                     case  5: rParent.SetViewAnyRuler(bSet);break; // "Window/ShowRulers"
368cdf0e10cSrcweir                     case  6: rParent.SetViewHRuler(bSet); break;// "Window/HorizontalRuler",
369cdf0e10cSrcweir                     case  7: rParent.SetViewVRuler(bSet); break;// "Window/VerticalRuler",
370cdf0e10cSrcweir                     case  8:
371cdf0e10cSrcweir                     {
372cdf0e10cSrcweir                         rParent.bIsHScrollMetricSet = sal_True;
373cdf0e10cSrcweir                         rParent.eHScrollMetric = ((FieldUnit)nInt32Val);  // "Window/HorizontalRulerUnit"
374cdf0e10cSrcweir                     }
375cdf0e10cSrcweir                     break;
376cdf0e10cSrcweir                     case  9:
377cdf0e10cSrcweir                     {
378cdf0e10cSrcweir                         rParent.bIsVScrollMetricSet = sal_True;
379cdf0e10cSrcweir                         rParent.eVScrollMetric = ((FieldUnit)nInt32Val); // "Window/VerticalRulerUnit"
380cdf0e10cSrcweir                     }
381cdf0e10cSrcweir                     break;
382cdf0e10cSrcweir                     case 10: rParent.SetSmoothScroll(bSet); break;// "Window/SmoothScroll",
383cdf0e10cSrcweir                     case 11: rParent.SetZoom( static_cast< sal_uInt16 >(nInt32Val) ); break;// "Zoom/Value",
384cdf0e10cSrcweir                     case 12: rParent.SetZoomType( static_cast< SvxZoomType >(nInt32Val) ); break;// "Zoom/Type",
385cdf0e10cSrcweir                     case 13: rParent.SetAlignMathObjectsToBaseline(bSet); break;// "Other/IsAlignMathObjectsToBaseline"
386cdf0e10cSrcweir                     case 14: rParent.SetMetric((FieldUnit)nInt32Val, sal_True); break;// "Other/MeasureUnit",
387cdf0e10cSrcweir                     case 15: rParent.SetDefTab(MM100_TO_TWIP(nInt32Val), sal_True); break;// "Other/TabStop",
388cdf0e10cSrcweir                     case 16: rParent.SetVRulerRight(bSet); break;// "Window/IsVerticalRulerRight",
389cdf0e10cSrcweir                     case 17: rParent.SetViewLayoutColumns( static_cast<sal_uInt16>(nInt32Val) ); break;// "ViewLayout/Columns",
390cdf0e10cSrcweir                     case 18: rParent.SetViewLayoutBookMode(bSet); break;// "ViewLayout/BookMode",
391cdf0e10cSrcweir                     case 19: rParent.SetDefaultPageMode(bSet,sal_True); break;// "Other/IsSquaredPageMode",
392*a41e6500SAriel Constenla-Haile                     case 20: rParent.SetShowScrollBarTips(bSet); break;// "Window/ShowScrollBarTips",
393cdf0e10cSrcweir                 }
394cdf0e10cSrcweir 			}
395cdf0e10cSrcweir 		}
396cdf0e10cSrcweir 	}
397cdf0e10cSrcweir }
398cdf0e10cSrcweir 
Notify(const::com::sun::star::uno::Sequence<rtl::OUString> &)399cdf0e10cSrcweir void SwLayoutViewConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
400cdf0e10cSrcweir 
401cdf0e10cSrcweir /* -----------------------------19.01.01 13:07--------------------------------
402cdf0e10cSrcweir 
403cdf0e10cSrcweir  ---------------------------------------------------------------------------*/
GetPropertyNames()404cdf0e10cSrcweir Sequence<OUString> SwGridConfig::GetPropertyNames()
405cdf0e10cSrcweir {
406cdf0e10cSrcweir 	static const char* aPropNames[] =
407cdf0e10cSrcweir 	{
408cdf0e10cSrcweir 		"Option/SnapToGrid",			// 0
409cdf0e10cSrcweir 		"Option/VisibleGrid",			// 1
410cdf0e10cSrcweir 		"Option/Synchronize",			// 2
411cdf0e10cSrcweir 		"Resolution/XAxis",				// 3
412cdf0e10cSrcweir 		"Resolution/YAxis",				// 4
413cdf0e10cSrcweir 		"Subdivision/XAxis",			// 5
414cdf0e10cSrcweir 		"Subdivision/YAxis"				// 6
415cdf0e10cSrcweir 	};
416cdf0e10cSrcweir 	const int nCount = 7;
417cdf0e10cSrcweir 	Sequence<OUString> aNames(nCount);
418cdf0e10cSrcweir 	OUString* pNames = aNames.getArray();
419cdf0e10cSrcweir 	for(int i = 0; i < nCount; i++)
420cdf0e10cSrcweir 	{
421cdf0e10cSrcweir 		pNames[i] = OUString::createFromAscii(aPropNames[i]);
422cdf0e10cSrcweir 	}
423cdf0e10cSrcweir 	return aNames;
424cdf0e10cSrcweir }
425cdf0e10cSrcweir /* -----------------------------19.01.01 13:07--------------------------------
426cdf0e10cSrcweir 
427cdf0e10cSrcweir  ---------------------------------------------------------------------------*/
SwGridConfig(sal_Bool bIsWeb,SwMasterUsrPref & rPar)428cdf0e10cSrcweir SwGridConfig::SwGridConfig(sal_Bool bIsWeb, SwMasterUsrPref& rPar) :
429cdf0e10cSrcweir     ConfigItem(bIsWeb ? C2U("Office.WriterWeb/Grid") :  C2U("Office.Writer/Grid"),
430cdf0e10cSrcweir         CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE),
431cdf0e10cSrcweir 	rParent(rPar),
432cdf0e10cSrcweir 	bWeb(bIsWeb)
433cdf0e10cSrcweir {
434cdf0e10cSrcweir }
435cdf0e10cSrcweir /* -----------------------------19.01.01 13:07--------------------------------
436cdf0e10cSrcweir 
437cdf0e10cSrcweir  ---------------------------------------------------------------------------*/
~SwGridConfig()438cdf0e10cSrcweir SwGridConfig::~SwGridConfig()
439cdf0e10cSrcweir {
440cdf0e10cSrcweir }
441cdf0e10cSrcweir /* -----------------------------19.01.01 13:07--------------------------------
442cdf0e10cSrcweir 
443cdf0e10cSrcweir  ---------------------------------------------------------------------------*/
Commit()444cdf0e10cSrcweir void SwGridConfig::Commit()
445cdf0e10cSrcweir {
446cdf0e10cSrcweir 	Sequence<OUString> aNames = GetPropertyNames();
447cdf0e10cSrcweir 
448cdf0e10cSrcweir 	Sequence<Any> aValues(aNames.getLength());
449cdf0e10cSrcweir 	Any* pValues = aValues.getArray();
450cdf0e10cSrcweir 
451cdf0e10cSrcweir 	for(int nProp = 0; nProp < aNames.getLength(); nProp++)
452cdf0e10cSrcweir 	{
453cdf0e10cSrcweir 		sal_Bool bSet;
454cdf0e10cSrcweir 		switch(nProp)
455cdf0e10cSrcweir 		{
456cdf0e10cSrcweir 			case  0: bSet = rParent.IsSnap(); break;// 		"Option/SnapToGrid",
457cdf0e10cSrcweir 			case  1: bSet = rParent.IsGridVisible(); break;//"Option/VisibleGrid",
458cdf0e10cSrcweir 			case  2: bSet = rParent.IsSynchronize(); break;//  "Option/Synchronize",
459cdf0e10cSrcweir 			case  3: pValues[nProp] <<= (sal_Int32)TWIP_TO_MM100(rParent.GetSnapSize().Width()); break;//      "Resolution/XAxis",
460cdf0e10cSrcweir 			case  4: pValues[nProp] <<= (sal_Int32)TWIP_TO_MM100(rParent.GetSnapSize().Height()); break;//      "Resolution/YAxis",
461cdf0e10cSrcweir 			case  5: pValues[nProp] <<= (sal_Int16)rParent.GetDivisionX(); break;//   "Subdivision/XAxis",
462cdf0e10cSrcweir 			case  6: pValues[nProp] <<= (sal_Int16)rParent.GetDivisionY(); break;//   "Subdivision/YAxis"
463cdf0e10cSrcweir 		}
464cdf0e10cSrcweir 		if(nProp < 3)
465cdf0e10cSrcweir   			pValues[nProp].setValue(&bSet, ::getBooleanCppuType());
466cdf0e10cSrcweir 	}
467cdf0e10cSrcweir 	PutProperties(aNames, aValues);
468cdf0e10cSrcweir }
469cdf0e10cSrcweir /* -----------------------------19.01.01 13:07--------------------------------
470cdf0e10cSrcweir 
471cdf0e10cSrcweir  ---------------------------------------------------------------------------*/
Load()472cdf0e10cSrcweir void SwGridConfig::Load()
473cdf0e10cSrcweir {
474cdf0e10cSrcweir 	Sequence<OUString> aNames = GetPropertyNames();
475cdf0e10cSrcweir 	Sequence<Any> aValues = GetProperties(aNames);
476cdf0e10cSrcweir 	const Any* pValues = aValues.getConstArray();
477cdf0e10cSrcweir 	DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
478cdf0e10cSrcweir 	if(aValues.getLength() == aNames.getLength())
479cdf0e10cSrcweir 	{
480cdf0e10cSrcweir 		Size aSnap(rParent.GetSnapSize());
481cdf0e10cSrcweir 		for(int nProp = 0; nProp < aNames.getLength(); nProp++)
482cdf0e10cSrcweir 		{
483cdf0e10cSrcweir 			if(pValues[nProp].hasValue())
484cdf0e10cSrcweir 			{
485cdf0e10cSrcweir 				sal_Bool bSet = nProp < 3 ? *(sal_Bool*)pValues[nProp].getValue() : sal_False;
486cdf0e10cSrcweir                 sal_Int32 nSet = 0;
487cdf0e10cSrcweir 				if(nProp >= 3)
488cdf0e10cSrcweir 					pValues[nProp] >>= nSet;
489cdf0e10cSrcweir 				switch(nProp)
490cdf0e10cSrcweir 				{
491cdf0e10cSrcweir 					case  0: rParent.SetSnap(bSet); break;// 		"Option/SnapToGrid",
492cdf0e10cSrcweir 					case  1: rParent.SetGridVisible(bSet); break;//"Option/VisibleGrid",
493cdf0e10cSrcweir 					case  2: rParent.SetSynchronize(bSet); break;//  "Option/Synchronize",
494cdf0e10cSrcweir 					case  3: aSnap.Width() = MM100_TO_TWIP(nSet); break;//      "Resolution/XAxis",
495cdf0e10cSrcweir 					case  4: aSnap.Height() = MM100_TO_TWIP(nSet); break;//      "Resolution/YAxis",
496cdf0e10cSrcweir                     case  5: rParent.SetDivisionX((short)nSet); break;//   "Subdivision/XAxis",
497cdf0e10cSrcweir                     case  6: rParent.SetDivisionY((short)nSet); break;//   "Subdivision/YAxis"
498cdf0e10cSrcweir 				}
499cdf0e10cSrcweir 			}
500cdf0e10cSrcweir 		}
501cdf0e10cSrcweir 		rParent.SetSnapSize(aSnap);
502cdf0e10cSrcweir 	}
503cdf0e10cSrcweir }
504cdf0e10cSrcweir 
Notify(const::com::sun::star::uno::Sequence<rtl::OUString> &)505cdf0e10cSrcweir void SwGridConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
506cdf0e10cSrcweir 
507cdf0e10cSrcweir /* -----------------------------19.01.01 13:07--------------------------------
508cdf0e10cSrcweir 
509cdf0e10cSrcweir  ---------------------------------------------------------------------------*/
GetPropertyNames()510cdf0e10cSrcweir Sequence<OUString> SwCursorConfig::GetPropertyNames()
511cdf0e10cSrcweir {
512cdf0e10cSrcweir 	static const char* aPropNames[] =
513cdf0e10cSrcweir 	{
514cdf0e10cSrcweir 		"DirectCursor/UseDirectCursor",	// 0
515cdf0e10cSrcweir 		"DirectCursor/Insert",			// 1
516cdf0e10cSrcweir         "Option/ProtectedArea"          // 2
517cdf0e10cSrcweir 	};
518cdf0e10cSrcweir     const int nCount = 3;
519cdf0e10cSrcweir 	Sequence<OUString> aNames(nCount);
520cdf0e10cSrcweir 	OUString* pNames = aNames.getArray();
521cdf0e10cSrcweir 	for(int i = 0; i < nCount; i++)
522cdf0e10cSrcweir 		pNames[i] = C2U(aPropNames[i]);
523cdf0e10cSrcweir 	return aNames;
524cdf0e10cSrcweir }
525cdf0e10cSrcweir /* -----------------------------19.01.01 13:07--------------------------------
526cdf0e10cSrcweir 
527cdf0e10cSrcweir  ---------------------------------------------------------------------------*/
SwCursorConfig(SwMasterUsrPref & rPar)528cdf0e10cSrcweir SwCursorConfig::SwCursorConfig(SwMasterUsrPref& rPar) :
529cdf0e10cSrcweir     ConfigItem(C2U("Office.Writer/Cursor"),
530cdf0e10cSrcweir         CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE),
531cdf0e10cSrcweir 	rParent(rPar)
532cdf0e10cSrcweir {
533cdf0e10cSrcweir }
534cdf0e10cSrcweir /* -----------------------------19.01.01 13:07--------------------------------
535cdf0e10cSrcweir 
536cdf0e10cSrcweir  ---------------------------------------------------------------------------*/
~SwCursorConfig()537cdf0e10cSrcweir SwCursorConfig::~SwCursorConfig()
538cdf0e10cSrcweir {
539cdf0e10cSrcweir }
540cdf0e10cSrcweir /* -----------------------------19.01.01 13:07--------------------------------
541cdf0e10cSrcweir 
542cdf0e10cSrcweir  ---------------------------------------------------------------------------*/
Commit()543cdf0e10cSrcweir void SwCursorConfig::Commit()
544cdf0e10cSrcweir {
545cdf0e10cSrcweir 	Sequence<OUString> aNames = GetPropertyNames();
546cdf0e10cSrcweir 
547cdf0e10cSrcweir 	Sequence<Any> aValues(aNames.getLength());
548cdf0e10cSrcweir 	Any* pValues = aValues.getArray();
549cdf0e10cSrcweir 
550cdf0e10cSrcweir 	for(int nProp = 0; nProp < aNames.getLength(); nProp++)
551cdf0e10cSrcweir 	{
552cdf0e10cSrcweir 		sal_Bool bSet;
553cdf0e10cSrcweir 		switch(nProp)
554cdf0e10cSrcweir 		{
555cdf0e10cSrcweir 			case  0: bSet = rParent.IsShadowCursor(); 		break;//  "DirectCursor/UseDirectCursor",
556cdf0e10cSrcweir 			case  1: pValues[nProp] <<= (sal_Int32)rParent.GetShdwCrsrFillMode(); 	break;//  "DirectCursor/Insert",
557cdf0e10cSrcweir             case  2: bSet = rParent.IsCursorInProtectedArea(); break;// "Option/ProtectedArea"
558cdf0e10cSrcweir 		}
559cdf0e10cSrcweir         if(nProp != 1 )
560cdf0e10cSrcweir   			pValues[nProp].setValue(&bSet, ::getBooleanCppuType());
561cdf0e10cSrcweir 	}
562cdf0e10cSrcweir 	PutProperties(aNames, aValues);
563cdf0e10cSrcweir }
564cdf0e10cSrcweir /* -----------------------------19.01.01 13:07--------------------------------
565cdf0e10cSrcweir 
566cdf0e10cSrcweir  ---------------------------------------------------------------------------*/
Load()567cdf0e10cSrcweir void SwCursorConfig::Load()
568cdf0e10cSrcweir {
569cdf0e10cSrcweir 	Sequence<OUString> aNames = GetPropertyNames();
570cdf0e10cSrcweir 	Sequence<Any> aValues = GetProperties(aNames);
571cdf0e10cSrcweir 	const Any* pValues = aValues.getConstArray();
572cdf0e10cSrcweir 	DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
573cdf0e10cSrcweir 	if(aValues.getLength() == aNames.getLength())
574cdf0e10cSrcweir 	{
575cdf0e10cSrcweir 
576cdf0e10cSrcweir 		for(int nProp = 0; nProp < aNames.getLength(); nProp++)
577cdf0e10cSrcweir 		{
578cdf0e10cSrcweir 			if(pValues[nProp].hasValue())
579cdf0e10cSrcweir 			{
580cdf0e10cSrcweir                 sal_Bool bSet = sal_False;
581cdf0e10cSrcweir                 sal_Int32 nSet = 0;
582cdf0e10cSrcweir                 if(nProp != 1 )
583cdf0e10cSrcweir 					bSet = *(sal_Bool*)pValues[nProp].getValue();
584cdf0e10cSrcweir 				else
585cdf0e10cSrcweir 					pValues[nProp] >>= nSet;
586cdf0e10cSrcweir 				switch(nProp)
587cdf0e10cSrcweir 				{
588cdf0e10cSrcweir 					case  0: rParent.SetShadowCursor(bSet); 		break;//  "DirectCursor/UseDirectCursor",
589cdf0e10cSrcweir                     case  1: rParent.SetShdwCrsrFillMode((sal_uInt8)nSet); break;//  "DirectCursor/Insert",
590cdf0e10cSrcweir                     case  2: rParent.SetCursorInProtectedArea(bSet); break;// "Option/ProtectedArea"
591cdf0e10cSrcweir 				}
592cdf0e10cSrcweir 			}
593cdf0e10cSrcweir 		}
594cdf0e10cSrcweir 
595cdf0e10cSrcweir 	}
596cdf0e10cSrcweir }
597cdf0e10cSrcweir 
Notify(const::com::sun::star::uno::Sequence<rtl::OUString> &)598cdf0e10cSrcweir void SwCursorConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
599cdf0e10cSrcweir 
600cdf0e10cSrcweir /*-- 28.09.00 09:55:33---------------------------------------------------
601cdf0e10cSrcweir 
602cdf0e10cSrcweir   -----------------------------------------------------------------------*/
SwWebColorConfig(SwMasterUsrPref & rPar)603cdf0e10cSrcweir SwWebColorConfig::SwWebColorConfig(SwMasterUsrPref& rPar) :
604cdf0e10cSrcweir     ConfigItem(C2U("Office.WriterWeb/Background"),
605cdf0e10cSrcweir         CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE),
606cdf0e10cSrcweir 	rParent(rPar),
607cdf0e10cSrcweir 	aPropNames(1)
608cdf0e10cSrcweir {
609cdf0e10cSrcweir 	aPropNames.getArray()[0] = C2U("Color");
610cdf0e10cSrcweir }
611cdf0e10cSrcweir /*-- 28.09.00 09:55:33---------------------------------------------------
612cdf0e10cSrcweir 
613cdf0e10cSrcweir   -----------------------------------------------------------------------*/
~SwWebColorConfig()614cdf0e10cSrcweir SwWebColorConfig::~SwWebColorConfig()
615cdf0e10cSrcweir {
616cdf0e10cSrcweir }
617cdf0e10cSrcweir /*-- 28.09.00 09:55:33---------------------------------------------------
618cdf0e10cSrcweir 
619cdf0e10cSrcweir   -----------------------------------------------------------------------*/
Commit()620cdf0e10cSrcweir void SwWebColorConfig::Commit()
621cdf0e10cSrcweir {
622cdf0e10cSrcweir 	Sequence<Any> aValues(aPropNames.getLength());
623cdf0e10cSrcweir 	Any* pValues = aValues.getArray();
624cdf0e10cSrcweir 	for(int nProp = 0; nProp < aPropNames.getLength(); nProp++)
625cdf0e10cSrcweir 	{
626cdf0e10cSrcweir 		switch(nProp)
627cdf0e10cSrcweir 		{
628cdf0e10cSrcweir 			case  0: pValues[nProp] <<= (sal_Int32)rParent.GetRetoucheColor().GetColor();	break;// "Color",
629cdf0e10cSrcweir 		}
630cdf0e10cSrcweir 	}
631cdf0e10cSrcweir 	PutProperties(aPropNames, aValues);
632cdf0e10cSrcweir }
633cdf0e10cSrcweir 
Notify(const::com::sun::star::uno::Sequence<rtl::OUString> &)634cdf0e10cSrcweir void SwWebColorConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
635cdf0e10cSrcweir 
636cdf0e10cSrcweir /*-- 28.09.00 09:55:34---------------------------------------------------
637cdf0e10cSrcweir 
638cdf0e10cSrcweir   -----------------------------------------------------------------------*/
Load()639cdf0e10cSrcweir void SwWebColorConfig::Load()
640cdf0e10cSrcweir {
641cdf0e10cSrcweir 	Sequence<Any> aValues = GetProperties(aPropNames);
642cdf0e10cSrcweir 	const Any* pValues = aValues.getConstArray();
643cdf0e10cSrcweir 	DBG_ASSERT(aValues.getLength() == aPropNames.getLength(), "GetProperties failed");
644cdf0e10cSrcweir 	if(aValues.getLength() == aPropNames.getLength())
645cdf0e10cSrcweir 	{
646cdf0e10cSrcweir 		for(int nProp = 0; nProp < aPropNames.getLength(); nProp++)
647cdf0e10cSrcweir 		{
648cdf0e10cSrcweir 			if(pValues[nProp].hasValue())
649cdf0e10cSrcweir 			{
650cdf0e10cSrcweir 				switch(nProp)
651cdf0e10cSrcweir 				{
652cdf0e10cSrcweir 					case  0:
653cdf0e10cSrcweir 						sal_Int32 nSet = 0;
654cdf0e10cSrcweir 						pValues[nProp] >>= nSet; rParent.SetRetoucheColor(nSet);
655cdf0e10cSrcweir 					break;// "Color",
656cdf0e10cSrcweir 				}
657cdf0e10cSrcweir 			}
658cdf0e10cSrcweir 		}
659cdf0e10cSrcweir 	}
660cdf0e10cSrcweir }
661cdf0e10cSrcweir 
662cdf0e10cSrcweir 
663