xref: /AOO41X/main/editeng/source/misc/acorrcfg.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_editeng.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include <editeng/acorrcfg.hxx>
32*cdf0e10cSrcweir #include <tools/debug.hxx>
33*cdf0e10cSrcweir #include <tools/urlobj.hxx>
34*cdf0e10cSrcweir #include <unotools/pathoptions.hxx>
35*cdf0e10cSrcweir #include <svl/urihelper.hxx>
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir #include <editeng/svxacorr.hxx>
38*cdf0e10cSrcweir #include <com/sun/star/uno/Any.hxx>
39*cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx>
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir using namespace utl;
42*cdf0e10cSrcweir using namespace rtl;
43*cdf0e10cSrcweir using namespace com::sun::star::uno;
44*cdf0e10cSrcweir 
45*cdf0e10cSrcweir #define C2U(cChar) OUString::createFromAscii(cChar)
46*cdf0e10cSrcweir 
47*cdf0e10cSrcweir static SvxAutoCorrCfg* pAutoCorrCfg = 0;
48*cdf0e10cSrcweir 
49*cdf0e10cSrcweir /*--------------------------------------------------------------------
50*cdf0e10cSrcweir 	Beschreibung:	Ctor Dtor
51*cdf0e10cSrcweir  --------------------------------------------------------------------*/
52*cdf0e10cSrcweir 
53*cdf0e10cSrcweir SvxAutoCorrCfg::SvxAutoCorrCfg() :
54*cdf0e10cSrcweir 	aBaseConfig(*this),
55*cdf0e10cSrcweir 	aSwConfig(*this),
56*cdf0e10cSrcweir 	bFileRel(sal_True),
57*cdf0e10cSrcweir 	bNetRel(sal_True),
58*cdf0e10cSrcweir 	bAutoTextTip(sal_True),
59*cdf0e10cSrcweir 	bAutoTextPreview(sal_False),
60*cdf0e10cSrcweir     bAutoFmtByInput(sal_True),
61*cdf0e10cSrcweir     bSearchInAllCategories(sal_False)
62*cdf0e10cSrcweir {
63*cdf0e10cSrcweir 	SvtPathOptions aPathOpt;
64*cdf0e10cSrcweir 	String sSharePath, sUserPath, sAutoPath( aPathOpt.GetAutoCorrectPath() );
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir 	String* pS = &sSharePath;
67*cdf0e10cSrcweir 	for( sal_uInt16 n = 0; n < 2; ++n, pS = &sUserPath )
68*cdf0e10cSrcweir 	{
69*cdf0e10cSrcweir     	*pS = sAutoPath.GetToken( n, ';' );
70*cdf0e10cSrcweir         INetURLObject aPath( *pS );
71*cdf0e10cSrcweir     	aPath.insertName( String::CreateFromAscii("acor") );
72*cdf0e10cSrcweir 		*pS = aPath.GetMainURL(INetURLObject::DECODE_TO_IURI);
73*cdf0e10cSrcweir 	}
74*cdf0e10cSrcweir     pAutoCorrect = new SvxAutoCorrect( sSharePath, sUserPath );
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir 	aBaseConfig.Load(sal_True);
77*cdf0e10cSrcweir 	aSwConfig.Load(sal_True);
78*cdf0e10cSrcweir }
79*cdf0e10cSrcweir 
80*cdf0e10cSrcweir SvxAutoCorrCfg::~SvxAutoCorrCfg()
81*cdf0e10cSrcweir {
82*cdf0e10cSrcweir 	delete pAutoCorrect;
83*cdf0e10cSrcweir }
84*cdf0e10cSrcweir 
85*cdf0e10cSrcweir void SvxAutoCorrCfg::SetAutoCorrect( SvxAutoCorrect* pNew )
86*cdf0e10cSrcweir {
87*cdf0e10cSrcweir 	if( pNew && pNew != pAutoCorrect )
88*cdf0e10cSrcweir 	{
89*cdf0e10cSrcweir 		if( pAutoCorrect->GetFlags() != pNew->GetFlags() )
90*cdf0e10cSrcweir 		{
91*cdf0e10cSrcweir 			aBaseConfig.SetModified();
92*cdf0e10cSrcweir 			aSwConfig.SetModified();
93*cdf0e10cSrcweir 		}
94*cdf0e10cSrcweir 		delete pAutoCorrect;
95*cdf0e10cSrcweir 		pAutoCorrect = pNew;
96*cdf0e10cSrcweir 	}
97*cdf0e10cSrcweir }
98*cdf0e10cSrcweir /*-- 12.10.00 11:44:17---------------------------------------------------
99*cdf0e10cSrcweir 
100*cdf0e10cSrcweir   -----------------------------------------------------------------------*/
101*cdf0e10cSrcweir Sequence<OUString> 	SvxBaseAutoCorrCfg::GetPropertyNames()
102*cdf0e10cSrcweir {
103*cdf0e10cSrcweir 	static const char* aPropNames[] =
104*cdf0e10cSrcweir 	{
105*cdf0e10cSrcweir 		"Exceptions/TwoCapitalsAtStart",		//  0
106*cdf0e10cSrcweir 		"Exceptions/CapitalAtStartSentence",	//  1
107*cdf0e10cSrcweir 		"UseReplacementTable",					//  2
108*cdf0e10cSrcweir 		"TwoCapitalsAtStart",					//  3
109*cdf0e10cSrcweir 		"CapitalAtStartSentence",				//  4
110*cdf0e10cSrcweir 		"ChangeUnderlineWeight",				//  5
111*cdf0e10cSrcweir 		"SetInetAttribute",						//  6
112*cdf0e10cSrcweir 		"ChangeOrdinalNumber",					//  7
113*cdf0e10cSrcweir         "AddNonBreakingSpace",                  //  8
114*cdf0e10cSrcweir 		"ChangeDash",							//  9
115*cdf0e10cSrcweir 		"RemoveDoubleSpaces",					// 10
116*cdf0e10cSrcweir 		"ReplaceSingleQuote",					// 11
117*cdf0e10cSrcweir 		"SingleQuoteAtStart",					// 12
118*cdf0e10cSrcweir 		"SingleQuoteAtEnd",						// 13
119*cdf0e10cSrcweir 		"ReplaceDoubleQuote",					// 14
120*cdf0e10cSrcweir 		"DoubleQuoteAtStart",					// 15
121*cdf0e10cSrcweir 		"DoubleQuoteAtEnd"						// 16
122*cdf0e10cSrcweir 	};
123*cdf0e10cSrcweir 	const int nCount = 17;
124*cdf0e10cSrcweir 	Sequence<OUString> aNames(nCount);
125*cdf0e10cSrcweir 	OUString* pNames = aNames.getArray();
126*cdf0e10cSrcweir 	for(int i = 0; i < nCount; i++)
127*cdf0e10cSrcweir 		pNames[i] = OUString::createFromAscii(aPropNames[i]);
128*cdf0e10cSrcweir 	return aNames;
129*cdf0e10cSrcweir }
130*cdf0e10cSrcweir /*-- 12.10.00 11:44:18---------------------------------------------------
131*cdf0e10cSrcweir 
132*cdf0e10cSrcweir   -----------------------------------------------------------------------*/
133*cdf0e10cSrcweir void SvxBaseAutoCorrCfg::Load(sal_Bool bInit)
134*cdf0e10cSrcweir {
135*cdf0e10cSrcweir 	Sequence<OUString> aNames = GetPropertyNames();
136*cdf0e10cSrcweir 	Sequence<Any> aValues = GetProperties(aNames);
137*cdf0e10cSrcweir 	if(bInit)
138*cdf0e10cSrcweir 		EnableNotification(aNames);
139*cdf0e10cSrcweir 	const Any* pValues = aValues.getConstArray();
140*cdf0e10cSrcweir 	DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
141*cdf0e10cSrcweir 	if(aValues.getLength() == aNames.getLength())
142*cdf0e10cSrcweir 	{
143*cdf0e10cSrcweir 		long nFlags = 0;		// default alles aus
144*cdf0e10cSrcweir 		sal_Int32 nTemp = 0;
145*cdf0e10cSrcweir 		for(int nProp = 0; nProp < aNames.getLength(); nProp++)
146*cdf0e10cSrcweir 		{
147*cdf0e10cSrcweir 			if(pValues[nProp].hasValue())
148*cdf0e10cSrcweir 			{
149*cdf0e10cSrcweir 				switch(nProp)
150*cdf0e10cSrcweir 				{
151*cdf0e10cSrcweir 					case  0:
152*cdf0e10cSrcweir 						if(*(sal_Bool*)pValues[nProp].getValue())
153*cdf0e10cSrcweir 							nFlags |= SaveWordCplSttLst;
154*cdf0e10cSrcweir 					break;//"Exceptions/TwoCapitalsAtStart",
155*cdf0e10cSrcweir 					case  1:
156*cdf0e10cSrcweir 						if(*(sal_Bool*)pValues[nProp].getValue())
157*cdf0e10cSrcweir 							nFlags |= SaveWordWrdSttLst;
158*cdf0e10cSrcweir 					break;//"Exceptions/CapitalAtStartSentence",
159*cdf0e10cSrcweir 					case  2:
160*cdf0e10cSrcweir 						if(*(sal_Bool*)pValues[nProp].getValue())
161*cdf0e10cSrcweir 							nFlags |= Autocorrect;
162*cdf0e10cSrcweir 					break;//"UseReplacementTable",
163*cdf0e10cSrcweir 					case  3:
164*cdf0e10cSrcweir 						if(*(sal_Bool*)pValues[nProp].getValue())
165*cdf0e10cSrcweir 							nFlags |= CptlSttWrd;
166*cdf0e10cSrcweir 					break;//"TwoCapitalsAtStart",
167*cdf0e10cSrcweir 					case  4:
168*cdf0e10cSrcweir 						if(*(sal_Bool*)pValues[nProp].getValue())
169*cdf0e10cSrcweir 							nFlags |= CptlSttSntnc;
170*cdf0e10cSrcweir 					break;//"CapitalAtStartSentence",
171*cdf0e10cSrcweir 					case  5:
172*cdf0e10cSrcweir 						if(*(sal_Bool*)pValues[nProp].getValue())
173*cdf0e10cSrcweir 							nFlags |= ChgWeightUnderl;
174*cdf0e10cSrcweir 					break;//"ChangeUnderlineWeight",
175*cdf0e10cSrcweir 					case  6:
176*cdf0e10cSrcweir 						if(*(sal_Bool*)pValues[nProp].getValue())
177*cdf0e10cSrcweir 							nFlags |= SetINetAttr;
178*cdf0e10cSrcweir 					break;//"SetInetAttribute",
179*cdf0e10cSrcweir 					case  7:
180*cdf0e10cSrcweir 						if(*(sal_Bool*)pValues[nProp].getValue())
181*cdf0e10cSrcweir 							nFlags |= ChgOrdinalNumber;
182*cdf0e10cSrcweir 					break;//"ChangeOrdinalNumber",
183*cdf0e10cSrcweir                     case 8:
184*cdf0e10cSrcweir                         if(*(sal_Bool*)pValues[nProp].getValue())
185*cdf0e10cSrcweir                              nFlags |= AddNonBrkSpace;
186*cdf0e10cSrcweir                     break;//"AddNonBreakingSpace"
187*cdf0e10cSrcweir 					case  9:
188*cdf0e10cSrcweir 						if(*(sal_Bool*)pValues[nProp].getValue())
189*cdf0e10cSrcweir 							nFlags |= ChgToEnEmDash;
190*cdf0e10cSrcweir 					break;//"ChangeDash",
191*cdf0e10cSrcweir 					case 10:
192*cdf0e10cSrcweir 						if(*(sal_Bool*)pValues[nProp].getValue())
193*cdf0e10cSrcweir 							nFlags |= IgnoreDoubleSpace;
194*cdf0e10cSrcweir 					break;//"RemoveDoubleSpaces",
195*cdf0e10cSrcweir 					case 11:
196*cdf0e10cSrcweir 						if(*(sal_Bool*)pValues[nProp].getValue())
197*cdf0e10cSrcweir 							nFlags |= ChgSglQuotes;
198*cdf0e10cSrcweir 					break;//"ReplaceSingleQuote",
199*cdf0e10cSrcweir 					case 12:
200*cdf0e10cSrcweir 						pValues[nProp] >>= nTemp;
201*cdf0e10cSrcweir 						rParent.pAutoCorrect->SetStartSingleQuote(
202*cdf0e10cSrcweir                             sal::static_int_cast< sal_Unicode >( nTemp ) );
203*cdf0e10cSrcweir 					break;//"SingleQuoteAtStart",
204*cdf0e10cSrcweir 					case 13:
205*cdf0e10cSrcweir 						pValues[nProp] >>= nTemp;
206*cdf0e10cSrcweir 						rParent.pAutoCorrect->SetEndSingleQuote(
207*cdf0e10cSrcweir                             sal::static_int_cast< sal_Unicode >( nTemp ) );
208*cdf0e10cSrcweir 					break;//"SingleQuoteAtEnd",
209*cdf0e10cSrcweir 					case 14:
210*cdf0e10cSrcweir 						if(*(sal_Bool*)pValues[nProp].getValue())
211*cdf0e10cSrcweir 							nFlags |= ChgQuotes;
212*cdf0e10cSrcweir 					break;//"ReplaceDoubleQuote",
213*cdf0e10cSrcweir 					case 15:
214*cdf0e10cSrcweir 						pValues[nProp] >>= nTemp;
215*cdf0e10cSrcweir 						rParent.pAutoCorrect->SetStartDoubleQuote(
216*cdf0e10cSrcweir                             sal::static_int_cast< sal_Unicode >( nTemp ) );
217*cdf0e10cSrcweir 					break;//"DoubleQuoteAtStart",
218*cdf0e10cSrcweir 					case 16:
219*cdf0e10cSrcweir 						pValues[nProp] >>= nTemp;
220*cdf0e10cSrcweir 						rParent.pAutoCorrect->SetEndDoubleQuote(
221*cdf0e10cSrcweir                             sal::static_int_cast< sal_Unicode >( nTemp ) );
222*cdf0e10cSrcweir 					break;//"DoubleQuoteAtEnd"
223*cdf0e10cSrcweir 				}
224*cdf0e10cSrcweir 			}
225*cdf0e10cSrcweir 		}
226*cdf0e10cSrcweir 		if( nFlags )
227*cdf0e10cSrcweir 			rParent.pAutoCorrect->SetAutoCorrFlag( nFlags, sal_True );
228*cdf0e10cSrcweir 		rParent.pAutoCorrect->SetAutoCorrFlag( ( 0xffff & ~nFlags ), sal_False );
229*cdf0e10cSrcweir 
230*cdf0e10cSrcweir 	}
231*cdf0e10cSrcweir }
232*cdf0e10cSrcweir /*-- 12.10.00 11:44:19---------------------------------------------------
233*cdf0e10cSrcweir 
234*cdf0e10cSrcweir   -----------------------------------------------------------------------*/
235*cdf0e10cSrcweir SvxBaseAutoCorrCfg::SvxBaseAutoCorrCfg(SvxAutoCorrCfg& rPar) :
236*cdf0e10cSrcweir 	utl::ConfigItem(C2U("Office.Common/AutoCorrect")),
237*cdf0e10cSrcweir 	rParent(rPar)
238*cdf0e10cSrcweir {
239*cdf0e10cSrcweir }
240*cdf0e10cSrcweir /*-- 12.10.00 11:44:19---------------------------------------------------
241*cdf0e10cSrcweir 
242*cdf0e10cSrcweir   -----------------------------------------------------------------------*/
243*cdf0e10cSrcweir SvxBaseAutoCorrCfg::~SvxBaseAutoCorrCfg()
244*cdf0e10cSrcweir {
245*cdf0e10cSrcweir }
246*cdf0e10cSrcweir /*-- 12.10.00 11:44:20---------------------------------------------------
247*cdf0e10cSrcweir 
248*cdf0e10cSrcweir   -----------------------------------------------------------------------*/
249*cdf0e10cSrcweir void SvxBaseAutoCorrCfg::Commit()
250*cdf0e10cSrcweir {
251*cdf0e10cSrcweir 	Sequence<OUString> aNames( GetPropertyNames() );
252*cdf0e10cSrcweir 
253*cdf0e10cSrcweir 	Sequence<Any> aValues(aNames.getLength());
254*cdf0e10cSrcweir 	Any* pValues = aValues.getArray();
255*cdf0e10cSrcweir 
256*cdf0e10cSrcweir 	const Type& rType = ::getBooleanCppuType();
257*cdf0e10cSrcweir 	sal_Bool bVal;
258*cdf0e10cSrcweir 	const long nFlags = rParent.pAutoCorrect->GetFlags();
259*cdf0e10cSrcweir 	for(int nProp = 0; nProp < aNames.getLength(); nProp++)
260*cdf0e10cSrcweir 	{
261*cdf0e10cSrcweir 		switch(nProp)
262*cdf0e10cSrcweir 		{
263*cdf0e10cSrcweir 			case  0:
264*cdf0e10cSrcweir                 bVal = 0 != (nFlags & SaveWordCplSttLst);
265*cdf0e10cSrcweir 				pValues[nProp].setValue(&bVal, rType);
266*cdf0e10cSrcweir 			break;//"Exceptions/TwoCapitalsAtStart",
267*cdf0e10cSrcweir 			case  1:
268*cdf0e10cSrcweir                 bVal = 0 != (nFlags & SaveWordWrdSttLst);
269*cdf0e10cSrcweir 				pValues[nProp].setValue(&bVal, rType);
270*cdf0e10cSrcweir 			break;//"Exceptions/CapitalAtStartSentence",
271*cdf0e10cSrcweir 			case  2:
272*cdf0e10cSrcweir                 bVal = 0 != (nFlags & Autocorrect);
273*cdf0e10cSrcweir 				pValues[nProp].setValue(&bVal, rType);
274*cdf0e10cSrcweir 			break;//"UseReplacementTable",
275*cdf0e10cSrcweir 			case  3:
276*cdf0e10cSrcweir                 bVal = 0 != (nFlags & CptlSttWrd);
277*cdf0e10cSrcweir 				pValues[nProp].setValue(&bVal, rType);
278*cdf0e10cSrcweir 			break;//"TwoCapitalsAtStart",
279*cdf0e10cSrcweir 			case  4:
280*cdf0e10cSrcweir                 bVal = 0 != (nFlags & CptlSttSntnc);
281*cdf0e10cSrcweir 				pValues[nProp].setValue(&bVal, rType);
282*cdf0e10cSrcweir 			break;//"CapitalAtStartSentence",
283*cdf0e10cSrcweir 			case  5:
284*cdf0e10cSrcweir                 bVal = 0 != (nFlags & ChgWeightUnderl);
285*cdf0e10cSrcweir 				pValues[nProp].setValue(&bVal, rType);
286*cdf0e10cSrcweir 			break;//"ChangeUnderlineWeight",
287*cdf0e10cSrcweir 			case  6:
288*cdf0e10cSrcweir                 bVal = 0 != (nFlags & SetINetAttr);
289*cdf0e10cSrcweir 				pValues[nProp].setValue(&bVal, rType);
290*cdf0e10cSrcweir 			break;//"SetInetAttribute",
291*cdf0e10cSrcweir 			case  7:
292*cdf0e10cSrcweir                 bVal = 0 != (nFlags & ChgOrdinalNumber);
293*cdf0e10cSrcweir 				pValues[nProp].setValue(&bVal, rType);
294*cdf0e10cSrcweir 			break;//"ChangeOrdinalNumber",
295*cdf0e10cSrcweir 			case 8:
296*cdf0e10cSrcweir                 bVal = 0 != (nFlags & AddNonBrkSpace);
297*cdf0e10cSrcweir                 pValues[nProp].setValue(&bVal, rType);
298*cdf0e10cSrcweir 			break;//"AddNonBreakingSpace"
299*cdf0e10cSrcweir 			case  9:
300*cdf0e10cSrcweir                 bVal = 0 != (nFlags & ChgToEnEmDash);
301*cdf0e10cSrcweir 				pValues[nProp].setValue(&bVal, rType);
302*cdf0e10cSrcweir 			break;//"ChangeDash",
303*cdf0e10cSrcweir 			case 10:
304*cdf0e10cSrcweir                 bVal = 0 != (nFlags & IgnoreDoubleSpace);
305*cdf0e10cSrcweir 				pValues[nProp].setValue(&bVal, rType);
306*cdf0e10cSrcweir 			break;//"RemoveDoubleSpaces",
307*cdf0e10cSrcweir 			case 11:
308*cdf0e10cSrcweir                 bVal = 0 != (nFlags & ChgSglQuotes);
309*cdf0e10cSrcweir 				pValues[nProp].setValue(&bVal, rType);
310*cdf0e10cSrcweir 			break;//"ReplaceSingleQuote",
311*cdf0e10cSrcweir 			case 12:
312*cdf0e10cSrcweir 				pValues[nProp] <<= (sal_Int32)rParent.pAutoCorrect->GetStartSingleQuote();
313*cdf0e10cSrcweir 			break;//"SingleQuoteAtStart",
314*cdf0e10cSrcweir 			case 13:
315*cdf0e10cSrcweir 				pValues[nProp] <<= (sal_Int32) rParent.pAutoCorrect->GetEndSingleQuote();
316*cdf0e10cSrcweir 			break;//"SingleQuoteAtEnd",
317*cdf0e10cSrcweir 			case 14:
318*cdf0e10cSrcweir                 bVal = 0 != (nFlags & ChgQuotes);
319*cdf0e10cSrcweir 				pValues[nProp].setValue(&bVal, rType);
320*cdf0e10cSrcweir 			break;//"ReplaceDoubleQuote",
321*cdf0e10cSrcweir 			case 15:
322*cdf0e10cSrcweir 				pValues[nProp] <<= (sal_Int32) rParent.pAutoCorrect->GetStartDoubleQuote();
323*cdf0e10cSrcweir 			break;//"DoubleQuoteAtStart",
324*cdf0e10cSrcweir 			case 16:
325*cdf0e10cSrcweir 				pValues[nProp] <<= (sal_Int32) rParent.pAutoCorrect->GetEndDoubleQuote();
326*cdf0e10cSrcweir 			break;//"DoubleQuoteAtEnd"
327*cdf0e10cSrcweir 		}
328*cdf0e10cSrcweir 	}
329*cdf0e10cSrcweir 	PutProperties(aNames, aValues);
330*cdf0e10cSrcweir }
331*cdf0e10cSrcweir /*-- 12.10.00 11:44:21---------------------------------------------------
332*cdf0e10cSrcweir 
333*cdf0e10cSrcweir   -----------------------------------------------------------------------*/
334*cdf0e10cSrcweir void SvxBaseAutoCorrCfg::Notify( const Sequence<OUString>& /* aPropertyNames */)
335*cdf0e10cSrcweir {
336*cdf0e10cSrcweir 	Load(sal_False);
337*cdf0e10cSrcweir }
338*cdf0e10cSrcweir /*-- 12.10.00 11:51:48---------------------------------------------------
339*cdf0e10cSrcweir 
340*cdf0e10cSrcweir   -----------------------------------------------------------------------*/
341*cdf0e10cSrcweir Sequence<OUString> 	SvxSwAutoCorrCfg::GetPropertyNames()
342*cdf0e10cSrcweir {
343*cdf0e10cSrcweir 	static const char* aPropNames[] =
344*cdf0e10cSrcweir 	{
345*cdf0e10cSrcweir 		"Text/FileLinks",							  // 0
346*cdf0e10cSrcweir 		"Text/InternetLinks",						  // 1
347*cdf0e10cSrcweir 		"Text/ShowPreview",							  // 2
348*cdf0e10cSrcweir 		"Text/ShowToolTip",							  // 3
349*cdf0e10cSrcweir         "Text/SearchInAllCategories",                                   // 4
350*cdf0e10cSrcweir         "Format/Option/UseReplacementTable",                            // 5
351*cdf0e10cSrcweir         "Format/Option/TwoCapitalsAtStart",                             // 6
352*cdf0e10cSrcweir         "Format/Option/CapitalAtStartSentence",                         // 7
353*cdf0e10cSrcweir         "Format/Option/ChangeUnderlineWeight",                          // 8
354*cdf0e10cSrcweir         "Format/Option/SetInetAttribute",                               // 9
355*cdf0e10cSrcweir         "Format/Option/ChangeOrdinalNumber",                            //10
356*cdf0e10cSrcweir         "Format/Option/AddNonBreakingSpace",                            //11
357*cdf0e10cSrcweir         "Format/Option/ChangeDash",                                     //12
358*cdf0e10cSrcweir         "Format/Option/DelEmptyParagraphs",                             //13
359*cdf0e10cSrcweir         "Format/Option/ReplaceUserStyle",                               //14
360*cdf0e10cSrcweir         "Format/Option/ChangeToBullets/Enable",                         //15
361*cdf0e10cSrcweir         "Format/Option/ChangeToBullets/SpecialCharacter/Char",          //16
362*cdf0e10cSrcweir         "Format/Option/ChangeToBullets/SpecialCharacter/Font",          //17
363*cdf0e10cSrcweir         "Format/Option/ChangeToBullets/SpecialCharacter/FontFamily",    //18
364*cdf0e10cSrcweir         "Format/Option/ChangeToBullets/SpecialCharacter/FontCharset",   //19
365*cdf0e10cSrcweir         "Format/Option/ChangeToBullets/SpecialCharacter/FontPitch",     //20
366*cdf0e10cSrcweir         "Format/Option/CombineParagraphs",                              //21
367*cdf0e10cSrcweir         "Format/Option/CombineValue",                                   //22
368*cdf0e10cSrcweir         "Format/Option/DelSpacesAtStartEnd",                            //23
369*cdf0e10cSrcweir         "Format/Option/DelSpacesBetween",                               //24
370*cdf0e10cSrcweir         "Format/ByInput/Enable",                                        //25
371*cdf0e10cSrcweir         "Format/ByInput/ChangeDash",                                    //26
372*cdf0e10cSrcweir         "Format/ByInput/ApplyNumbering/Enable",                         //27
373*cdf0e10cSrcweir         "Format/ByInput/ChangeToBorders",                               //28
374*cdf0e10cSrcweir         "Format/ByInput/ChangeToTable",                                 //29
375*cdf0e10cSrcweir         "Format/ByInput/ReplaceStyle",                                  //30
376*cdf0e10cSrcweir         "Format/ByInput/DelSpacesAtStartEnd",                           //31
377*cdf0e10cSrcweir         "Format/ByInput/DelSpacesBetween",                              //32
378*cdf0e10cSrcweir         "Completion/Enable",                                            //33
379*cdf0e10cSrcweir         "Completion/MinWordLen",                                        //34
380*cdf0e10cSrcweir         "Completion/MaxListLen",                                        //35
381*cdf0e10cSrcweir         "Completion/CollectWords",                                      //36
382*cdf0e10cSrcweir         "Completion/EndlessList",                                       //37
383*cdf0e10cSrcweir         "Completion/AppendBlank",                                       //38
384*cdf0e10cSrcweir         "Completion/ShowAsTip",                                         //39
385*cdf0e10cSrcweir         "Completion/AcceptKey",                                         //40
386*cdf0e10cSrcweir         "Completion/KeepList",                                          //41
387*cdf0e10cSrcweir         "Format/ByInput/ApplyNumbering/SpecialCharacter/Char",          //42
388*cdf0e10cSrcweir         "Format/ByInput/ApplyNumbering/SpecialCharacter/Font",          //43
389*cdf0e10cSrcweir         "Format/ByInput/ApplyNumbering/SpecialCharacter/FontFamily",    //44
390*cdf0e10cSrcweir         "Format/ByInput/ApplyNumbering/SpecialCharacter/FontCharset",   //45
391*cdf0e10cSrcweir         "Format/ByInput/ApplyNumbering/SpecialCharacter/FontPitch"      //46
392*cdf0e10cSrcweir 	};
393*cdf0e10cSrcweir     const int nCount = 47;
394*cdf0e10cSrcweir 	Sequence<OUString> aNames(nCount);
395*cdf0e10cSrcweir 	OUString* pNames = aNames.getArray();
396*cdf0e10cSrcweir 	for(int i = 0; i < nCount; i++)
397*cdf0e10cSrcweir 		pNames[i] = OUString::createFromAscii(aPropNames[i]);
398*cdf0e10cSrcweir 	return aNames;
399*cdf0e10cSrcweir }
400*cdf0e10cSrcweir /*-- 12.10.00 11:51:48---------------------------------------------------
401*cdf0e10cSrcweir 
402*cdf0e10cSrcweir   -----------------------------------------------------------------------*/
403*cdf0e10cSrcweir void SvxSwAutoCorrCfg::Load(sal_Bool bInit)
404*cdf0e10cSrcweir {
405*cdf0e10cSrcweir 	Sequence<OUString> aNames = GetPropertyNames();
406*cdf0e10cSrcweir 	Sequence<Any> aValues = GetProperties(aNames);
407*cdf0e10cSrcweir 	if(bInit)
408*cdf0e10cSrcweir 		EnableNotification(aNames);
409*cdf0e10cSrcweir 	const Any* pValues = aValues.getConstArray();
410*cdf0e10cSrcweir 	DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
411*cdf0e10cSrcweir 	if(aValues.getLength() == aNames.getLength())
412*cdf0e10cSrcweir 	{
413*cdf0e10cSrcweir 		SvxSwAutoFmtFlags& rSwFlags = rParent.pAutoCorrect->GetSwFlags();
414*cdf0e10cSrcweir 		for(int nProp = 0; nProp < aNames.getLength(); nProp++)
415*cdf0e10cSrcweir 		{
416*cdf0e10cSrcweir 			if(pValues[nProp].hasValue())
417*cdf0e10cSrcweir 			{
418*cdf0e10cSrcweir 				switch(nProp)
419*cdf0e10cSrcweir 				{
420*cdf0e10cSrcweir 					case   0: rParent.bFileRel = *(sal_Bool*)pValues[nProp].getValue(); break; // "Text/FileLinks",
421*cdf0e10cSrcweir 					case   1: rParent.bNetRel = *(sal_Bool*)pValues[nProp].getValue();  break; // "Text/InternetLinks",
422*cdf0e10cSrcweir 					case   2: rParent.bAutoTextPreview = *(sal_Bool*)pValues[nProp].getValue(); break; // "Text/ShowPreview",
423*cdf0e10cSrcweir 					case   3: rParent.bAutoTextTip = *(sal_Bool*)pValues[nProp].getValue();  break; // "Text/ShowToolTip",
424*cdf0e10cSrcweir                     case   4: rParent.bSearchInAllCategories = *(sal_Bool*)pValues[nProp].getValue();  break; //"Text/SearchInAllCategories"
425*cdf0e10cSrcweir                     case   5: rSwFlags.bAutoCorrect = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/Option/UseReplacementTable",
426*cdf0e10cSrcweir                     case   6: rSwFlags.bCptlSttSntnc = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/Option/TwoCapitalsAtStart",
427*cdf0e10cSrcweir                     case   7: rSwFlags.bCptlSttWrd = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/Option/CapitalAtStartSentence",
428*cdf0e10cSrcweir                     case   8: rSwFlags.bChgWeightUnderl = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/Option/ChangeUnderlineWeight",
429*cdf0e10cSrcweir                     case   9: rSwFlags.bSetINetAttr = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/Option/SetInetAttribute",
430*cdf0e10cSrcweir                     case  10: rSwFlags.bChgOrdinalNumber = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/Option/ChangeOrdinalNumber",
431*cdf0e10cSrcweir                     case  11: rSwFlags.bAddNonBrkSpace = *(sal_Bool*)pValues[nProp].getValue( ); break; // "Format/Option/AddNonBreakingSpace",
432*cdf0e10cSrcweir // it doesn't exist here - the common flags are used for that -> LM
433*cdf0e10cSrcweir //                  case  12: rSwFlags.bChgToEnEmDash = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/Option/ChangeDash",
434*cdf0e10cSrcweir                     case  13: rSwFlags.bDelEmptyNode = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/Option/DelEmptyParagraphs",
435*cdf0e10cSrcweir                     case  14: rSwFlags.bChgUserColl = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/Option/ReplaceUserStyle",
436*cdf0e10cSrcweir                     case  15: rSwFlags.bChgEnumNum = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/Option/ChangeToBullets/Enable",
437*cdf0e10cSrcweir                     case  16:
438*cdf0e10cSrcweir 					{
439*cdf0e10cSrcweir 						sal_Int32 nVal = 0; pValues[nProp] >>= nVal;
440*cdf0e10cSrcweir 						rSwFlags.cBullet =
441*cdf0e10cSrcweir                             sal::static_int_cast< sal_Unicode >(nVal);
442*cdf0e10cSrcweir 					}
443*cdf0e10cSrcweir 					break; // "Format/Option/ChangeToBullets/SpecialCharacter/Char",
444*cdf0e10cSrcweir                     case  17:
445*cdf0e10cSrcweir 					{
446*cdf0e10cSrcweir 						OUString sTemp; pValues[nProp] >>= sTemp;
447*cdf0e10cSrcweir 						rSwFlags.aBulletFont.SetName(sTemp);
448*cdf0e10cSrcweir 					}
449*cdf0e10cSrcweir 					break; // "Format/Option/ChangeToBullets/SpecialCharacter/Font",
450*cdf0e10cSrcweir                     case  18:
451*cdf0e10cSrcweir 					{
452*cdf0e10cSrcweir 						sal_Int32 nVal = 0; pValues[nProp] >>= nVal;
453*cdf0e10cSrcweir 						rSwFlags.aBulletFont.SetFamily(FontFamily(nVal));
454*cdf0e10cSrcweir 					}
455*cdf0e10cSrcweir 					break; // "Format/Option/ChangeToBullets/SpecialCharacter/FontFamily",
456*cdf0e10cSrcweir                     case  19:
457*cdf0e10cSrcweir 					{
458*cdf0e10cSrcweir 						sal_Int32 nVal = 0; pValues[nProp] >>= nVal;
459*cdf0e10cSrcweir 						rSwFlags.aBulletFont.SetCharSet(CharSet(nVal));
460*cdf0e10cSrcweir 					}
461*cdf0e10cSrcweir 					break; // "Format/Option/ChangeToBullets/SpecialCharacter/FontCharset",
462*cdf0e10cSrcweir                     case  20:
463*cdf0e10cSrcweir 					{
464*cdf0e10cSrcweir                                             sal_Int32 nVal = 0; pValues[nProp] >>= nVal;
465*cdf0e10cSrcweir 						rSwFlags.aBulletFont.SetPitch(FontPitch(nVal));
466*cdf0e10cSrcweir 					}
467*cdf0e10cSrcweir 					break; // "Format/Option/ChangeToBullets/SpecialCharacter/FontPitch",
468*cdf0e10cSrcweir                     case  21: rSwFlags.bRightMargin = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/Option/CombineParagraphs",
469*cdf0e10cSrcweir                     case  22:
470*cdf0e10cSrcweir 					{
471*cdf0e10cSrcweir 						sal_Int32 nVal = 0; pValues[nProp] >>= nVal;
472*cdf0e10cSrcweir 						rSwFlags.nRightMargin =
473*cdf0e10cSrcweir                             sal::static_int_cast< sal_uInt8 >(nVal);
474*cdf0e10cSrcweir 					}
475*cdf0e10cSrcweir 					break; // "Format/Option/CombineValue",
476*cdf0e10cSrcweir                     case  23: rSwFlags.bAFmtDelSpacesAtSttEnd =  *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/Option/DelSpacesAtStartEnd",
477*cdf0e10cSrcweir                     case  24: rSwFlags.bAFmtDelSpacesBetweenLines = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/Option/DelSpacesBetween",
478*cdf0e10cSrcweir                     case  25: rParent.bAutoFmtByInput = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/ByInput/Enable",
479*cdf0e10cSrcweir                     case  26: rSwFlags.bChgToEnEmDash = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/ByInput/ChangeDash",
480*cdf0e10cSrcweir                     case  27: rSwFlags.bSetNumRule = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/ByInput/ApplyNumbering/Enable",
481*cdf0e10cSrcweir                     case  28: rSwFlags.bSetBorder = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/ByInput/ChangeToBorders",
482*cdf0e10cSrcweir                     case  29: rSwFlags.bCreateTable = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/ByInput/ChangeToTable",
483*cdf0e10cSrcweir                     case  30: rSwFlags.bReplaceStyles =  *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/ByInput/ReplaceStyle",
484*cdf0e10cSrcweir                     case  31: rSwFlags.bAFmtByInpDelSpacesAtSttEnd =  *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/ByInput/DelSpacesAtStartEnd",
485*cdf0e10cSrcweir                     case  32: rSwFlags.bAFmtByInpDelSpacesBetweenLines = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/ByInput/DelSpacesBetween",
486*cdf0e10cSrcweir                     case  33: rSwFlags.bAutoCompleteWords = *(sal_Bool*)pValues[nProp].getValue(); break; // "Completion/Enable",
487*cdf0e10cSrcweir                     case  34:
488*cdf0e10cSrcweir 					{
489*cdf0e10cSrcweir 						sal_Int32 nVal = 0; pValues[nProp] >>= nVal;
490*cdf0e10cSrcweir 						rSwFlags.nAutoCmpltWordLen =
491*cdf0e10cSrcweir                             sal::static_int_cast< sal_uInt16 >(nVal);
492*cdf0e10cSrcweir 					}
493*cdf0e10cSrcweir 					break; // "Completion/MinWordLen",
494*cdf0e10cSrcweir                     case  35:
495*cdf0e10cSrcweir 					{
496*cdf0e10cSrcweir 						sal_Int32 nVal = 0; pValues[nProp] >>= nVal;
497*cdf0e10cSrcweir 						rSwFlags.nAutoCmpltListLen =
498*cdf0e10cSrcweir                             sal::static_int_cast< sal_uInt16 >(nVal);
499*cdf0e10cSrcweir 					}
500*cdf0e10cSrcweir 					break; // "Completion/MaxListLen",
501*cdf0e10cSrcweir                     case  36: rSwFlags.bAutoCmpltCollectWords = *(sal_Bool*)pValues[nProp].getValue(); break; // "Completion/CollectWords",
502*cdf0e10cSrcweir                     case  37: rSwFlags.bAutoCmpltEndless = *(sal_Bool*)pValues[nProp].getValue(); break; // "Completion/EndlessList",
503*cdf0e10cSrcweir                     case  38: rSwFlags.bAutoCmpltAppendBlanc = *(sal_Bool*)pValues[nProp].getValue(); break; // "Completion/AppendBlank",
504*cdf0e10cSrcweir                     case  39: rSwFlags.bAutoCmpltShowAsTip = *(sal_Bool*)pValues[nProp].getValue(); break; // "Completion/ShowAsTip",
505*cdf0e10cSrcweir                     case  40:
506*cdf0e10cSrcweir 					{
507*cdf0e10cSrcweir 						sal_Int32 nVal = 0; pValues[nProp] >>= nVal;
508*cdf0e10cSrcweir 						rSwFlags.nAutoCmpltExpandKey =
509*cdf0e10cSrcweir                             sal::static_int_cast< sal_uInt16 >(nVal);
510*cdf0e10cSrcweir 					}
511*cdf0e10cSrcweir 					break; // "Completion/AcceptKey"
512*cdf0e10cSrcweir                     case 41 :rSwFlags.bAutoCmpltKeepList = *(sal_Bool*)pValues[nProp].getValue(); break;//"Completion/KeepList"
513*cdf0e10cSrcweir                     case 42 :
514*cdf0e10cSrcweir 					{
515*cdf0e10cSrcweir 						sal_Int32 nVal = 0; pValues[nProp] >>= nVal;
516*cdf0e10cSrcweir 						rSwFlags.cByInputBullet =
517*cdf0e10cSrcweir                             sal::static_int_cast< sal_Unicode >(nVal);
518*cdf0e10cSrcweir 					}
519*cdf0e10cSrcweir 					break;// "Format/ByInput/ApplyNumbering/SpecialCharacter/Char",
520*cdf0e10cSrcweir                     case 43 :
521*cdf0e10cSrcweir 					{
522*cdf0e10cSrcweir 						OUString sTemp; pValues[nProp] >>= sTemp;
523*cdf0e10cSrcweir 						rSwFlags.aByInputBulletFont.SetName(sTemp);
524*cdf0e10cSrcweir 					}
525*cdf0e10cSrcweir 					break;// "Format/ByInput/ApplyNumbering/SpecialCharacter/Font",
526*cdf0e10cSrcweir                     case 44 :
527*cdf0e10cSrcweir 					{
528*cdf0e10cSrcweir 						sal_Int32 nVal = 0; pValues[nProp] >>= nVal;
529*cdf0e10cSrcweir 						rSwFlags.aByInputBulletFont.SetFamily(FontFamily(nVal));
530*cdf0e10cSrcweir 					}
531*cdf0e10cSrcweir 					break;// "Format/ByInput/ApplyNumbering/SpecialCharacter/FontFamily",
532*cdf0e10cSrcweir                     case 45 :
533*cdf0e10cSrcweir 					{
534*cdf0e10cSrcweir 						sal_Int32 nVal = 0; pValues[nProp] >>= nVal;
535*cdf0e10cSrcweir 						rSwFlags.aByInputBulletFont.SetCharSet(CharSet(nVal));
536*cdf0e10cSrcweir 					}
537*cdf0e10cSrcweir 					break;// "Format/ByInput/ApplyNumbering/SpecialCharacter/FontCharset",
538*cdf0e10cSrcweir                     case 46 :
539*cdf0e10cSrcweir 					{
540*cdf0e10cSrcweir 						sal_Int32 nVal = 0; pValues[nProp] >>= nVal;
541*cdf0e10cSrcweir 						rSwFlags.aByInputBulletFont.SetPitch(FontPitch(nVal));
542*cdf0e10cSrcweir 					}
543*cdf0e10cSrcweir 					break;// "Format/ByInput/ApplyNumbering/SpecialCharacter/FontPitch",
544*cdf0e10cSrcweir 				}
545*cdf0e10cSrcweir 			}
546*cdf0e10cSrcweir 		}
547*cdf0e10cSrcweir 	}
548*cdf0e10cSrcweir }
549*cdf0e10cSrcweir /*-- 12.10.00 11:51:48---------------------------------------------------
550*cdf0e10cSrcweir 
551*cdf0e10cSrcweir   -----------------------------------------------------------------------*/
552*cdf0e10cSrcweir SvxSwAutoCorrCfg::SvxSwAutoCorrCfg(SvxAutoCorrCfg& rPar) :
553*cdf0e10cSrcweir 	utl::ConfigItem(C2U("Office.Writer/AutoFunction")),
554*cdf0e10cSrcweir 	rParent(rPar)
555*cdf0e10cSrcweir {
556*cdf0e10cSrcweir }
557*cdf0e10cSrcweir /*-- 12.10.00 11:51:48---------------------------------------------------
558*cdf0e10cSrcweir 
559*cdf0e10cSrcweir   -----------------------------------------------------------------------*/
560*cdf0e10cSrcweir SvxSwAutoCorrCfg::~SvxSwAutoCorrCfg()
561*cdf0e10cSrcweir {
562*cdf0e10cSrcweir }
563*cdf0e10cSrcweir /*-- 12.10.00 11:51:48---------------------------------------------------
564*cdf0e10cSrcweir 
565*cdf0e10cSrcweir   -----------------------------------------------------------------------*/
566*cdf0e10cSrcweir void SvxSwAutoCorrCfg::Commit()
567*cdf0e10cSrcweir {
568*cdf0e10cSrcweir 	Sequence<OUString> aNames = GetPropertyNames();
569*cdf0e10cSrcweir 
570*cdf0e10cSrcweir 	Sequence<Any> aValues(aNames.getLength());
571*cdf0e10cSrcweir 	Any* pValues = aValues.getArray();
572*cdf0e10cSrcweir 
573*cdf0e10cSrcweir 	const Type& rType = ::getBooleanCppuType();
574*cdf0e10cSrcweir 	sal_Bool bVal;
575*cdf0e10cSrcweir 	SvxSwAutoFmtFlags& rSwFlags = rParent.pAutoCorrect->GetSwFlags();
576*cdf0e10cSrcweir 	for(int nProp = 0; nProp < aNames.getLength(); nProp++)
577*cdf0e10cSrcweir 	{
578*cdf0e10cSrcweir 		switch(nProp)
579*cdf0e10cSrcweir 		{
580*cdf0e10cSrcweir 			case   0: pValues[nProp].setValue(&rParent.bFileRel, rType); break; // "Text/FileLinks",
581*cdf0e10cSrcweir 			case   1: pValues[nProp].setValue(&rParent.bNetRel, rType);   break; // "Text/InternetLinks",
582*cdf0e10cSrcweir 			case   2: pValues[nProp].setValue(&rParent.bAutoTextPreview, rType); break; // "Text/ShowPreview",
583*cdf0e10cSrcweir 			case   3: pValues[nProp].setValue(&rParent.bAutoTextTip, rType); break; // "Text/ShowToolTip",
584*cdf0e10cSrcweir             case   4: pValues[nProp].setValue(&rParent.bSearchInAllCategories, rType );break; //"Text/SearchInAllCategories"
585*cdf0e10cSrcweir             case   5: bVal = rSwFlags.bAutoCorrect; pValues[nProp].setValue(&bVal, rType); break; // "Format/Option/UseReplacementTable",
586*cdf0e10cSrcweir             case   6: bVal = rSwFlags.bCptlSttSntnc; pValues[nProp].setValue(&bVal, rType); break; // "Format/Option/TwoCapitalsAtStart",
587*cdf0e10cSrcweir             case   7: bVal = rSwFlags.bCptlSttWrd; pValues[nProp].setValue(&bVal, rType); break; // "Format/Option/CapitalAtStartSentence",
588*cdf0e10cSrcweir             case   8: bVal = rSwFlags.bChgWeightUnderl; pValues[nProp].setValue(&bVal, rType); break; // "Format/Option/ChangeUnderlineWeight",
589*cdf0e10cSrcweir             case   9: bVal = rSwFlags.bSetINetAttr; pValues[nProp].setValue(&bVal, rType); break; // "Format/Option/SetInetAttribute",
590*cdf0e10cSrcweir             case  10: bVal = rSwFlags.bChgOrdinalNumber; pValues[nProp].setValue(&bVal, rType); break; // "Format/Option/ChangeOrdinalNumber",
591*cdf0e10cSrcweir             case  11: bVal = rSwFlags.bAddNonBrkSpace;  pValues[nProp].setValue(&bVal, rType); break; // "Format/Option/AddNonBreakingSpace",
592*cdf0e10cSrcweir // it doesn't exist here - the common flags are used for that -> LM
593*cdf0e10cSrcweir             case  12:
594*cdf0e10cSrcweir 				bVal = sal_True;  pValues[nProp].setValue(&bVal, rType);
595*cdf0e10cSrcweir 			break; // "Format/Option/ChangeDash",
596*cdf0e10cSrcweir             case  13: bVal = rSwFlags.bDelEmptyNode; pValues[nProp].setValue(&bVal, rType); break; // "Format/Option/DelEmptyParagraphs",
597*cdf0e10cSrcweir             case  14: bVal = rSwFlags.bChgUserColl; pValues[nProp].setValue(&bVal, rType); break; // "Format/Option/ReplaceUserStyle",
598*cdf0e10cSrcweir             case  15: bVal = rSwFlags.bChgEnumNum; pValues[nProp].setValue(&bVal, rType); break; // "Format/Option/ChangeToBullets/Enable",
599*cdf0e10cSrcweir             case  16:
600*cdf0e10cSrcweir 				pValues[nProp] <<= (sal_Int32)rSwFlags.cBullet;
601*cdf0e10cSrcweir 			break; // "Format/Option/ChangeToBullets/SpecialCharacter/Char",
602*cdf0e10cSrcweir             case  17:
603*cdf0e10cSrcweir 				pValues[nProp] <<= OUString(rSwFlags.aBulletFont.GetName());
604*cdf0e10cSrcweir 			break; // "Format/Option/ChangeToBullets/SpecialCharacter/Font",
605*cdf0e10cSrcweir             case  18:
606*cdf0e10cSrcweir 				pValues[nProp] <<= (sal_Int32)rSwFlags.aBulletFont.GetFamily();
607*cdf0e10cSrcweir 			break; // "Format/Option/ChangeToBullets/SpecialCharacter/FontFamily",
608*cdf0e10cSrcweir             case  19:
609*cdf0e10cSrcweir 				pValues[nProp] <<= (sal_Int32)rSwFlags.aBulletFont.GetCharSet();
610*cdf0e10cSrcweir 			break; // "Format/Option/ChangeToBullets/SpecialCharacter/FontCharset",
611*cdf0e10cSrcweir             case  20:
612*cdf0e10cSrcweir 				pValues[nProp] <<= (sal_Int32)rSwFlags.aBulletFont.GetPitch();
613*cdf0e10cSrcweir 			break; // "Format/Option/ChangeToBullets/SpecialCharacter/FontPitch",
614*cdf0e10cSrcweir             case  21: bVal = rSwFlags.bRightMargin; pValues[nProp].setValue(&bVal, rType); break; // "Format/Option/CombineParagraphs",
615*cdf0e10cSrcweir             case  22:
616*cdf0e10cSrcweir 				pValues[nProp] <<= (sal_Int32)rSwFlags.nRightMargin;
617*cdf0e10cSrcweir 			break; // "Format/Option/CombineValue",
618*cdf0e10cSrcweir             case  23: bVal = rSwFlags.bAFmtDelSpacesAtSttEnd; pValues[nProp].setValue(&bVal, rType); break; // "Format/Option/DelSpacesAtStartEnd",
619*cdf0e10cSrcweir             case  24: bVal = rSwFlags.bAFmtDelSpacesBetweenLines; pValues[nProp].setValue(&bVal, rType); break; // "Format/Option/DelSpacesBetween",
620*cdf0e10cSrcweir             case  25: bVal = rParent.bAutoFmtByInput; pValues[nProp].setValue(&bVal, rType); break; // "Format/ByInput/Enable",
621*cdf0e10cSrcweir             case  26: bVal = rSwFlags.bChgToEnEmDash; pValues[nProp].setValue(&bVal, rType); break; // "Format/ByInput/ChangeDash",
622*cdf0e10cSrcweir             case  27: bVal = rSwFlags.bSetNumRule; pValues[nProp].setValue(&bVal, rType); break; // "Format/ByInput/ApplyNumbering/Enable",
623*cdf0e10cSrcweir             case  28: bVal = rSwFlags.bSetBorder; pValues[nProp].setValue(&bVal, rType); break; // "Format/ByInput/ChangeToBorders",
624*cdf0e10cSrcweir             case  29: bVal = rSwFlags.bCreateTable; pValues[nProp].setValue(&bVal, rType); break; // "Format/ByInput/ChangeToTable",
625*cdf0e10cSrcweir             case  30: bVal = rSwFlags.bReplaceStyles; pValues[nProp].setValue(&bVal, rType); break; // "Format/ByInput/ReplaceStyle",
626*cdf0e10cSrcweir             case  31: bVal = rSwFlags.bAFmtByInpDelSpacesAtSttEnd; pValues[nProp].setValue(&bVal, rType); break; // "Format/ByInput/DelSpacesAtStartEnd",
627*cdf0e10cSrcweir             case  32: bVal = rSwFlags.bAFmtByInpDelSpacesBetweenLines; pValues[nProp].setValue(&bVal, rType); break; // "Format/ByInput/DelSpacesBetween",
628*cdf0e10cSrcweir             case  33: bVal = rSwFlags.bAutoCompleteWords; pValues[nProp].setValue(&bVal, rType); break; // "Completion/Enable",
629*cdf0e10cSrcweir             case  34:
630*cdf0e10cSrcweir 				pValues[nProp] <<= (sal_Int32)rSwFlags.nAutoCmpltWordLen;
631*cdf0e10cSrcweir 			break; // "Completion/MinWordLen",
632*cdf0e10cSrcweir             case  35:
633*cdf0e10cSrcweir 				pValues[nProp] <<= (sal_Int32)rSwFlags.nAutoCmpltListLen;
634*cdf0e10cSrcweir 			break; // "Completion/MaxListLen",
635*cdf0e10cSrcweir             case  36: bVal = rSwFlags.bAutoCmpltCollectWords; pValues[nProp].setValue(&bVal, rType); break; // "Completion/CollectWords",
636*cdf0e10cSrcweir             case  37: bVal = rSwFlags.bAutoCmpltEndless; pValues[nProp].setValue(&bVal, rType); break; // "Completion/EndlessList",
637*cdf0e10cSrcweir             case  38: bVal = rSwFlags.bAutoCmpltAppendBlanc; pValues[nProp].setValue(&bVal, rType); break; // "Completion/AppendBlank",
638*cdf0e10cSrcweir             case  39: bVal = rSwFlags.bAutoCmpltShowAsTip; pValues[nProp].setValue(&bVal, rType); break; // "Completion/ShowAsTip",
639*cdf0e10cSrcweir             case  40:
640*cdf0e10cSrcweir 				pValues[nProp] <<= (sal_Int32)rSwFlags.nAutoCmpltExpandKey;
641*cdf0e10cSrcweir 			break; // "Completion/AcceptKey"
642*cdf0e10cSrcweir             case 41 :bVal = rSwFlags.bAutoCmpltKeepList; pValues[nProp].setValue(&bVal, rType); break;// "Completion/KeepList"
643*cdf0e10cSrcweir             case 42 :
644*cdf0e10cSrcweir 				pValues[nProp] <<= (sal_Int32)rSwFlags.cByInputBullet;
645*cdf0e10cSrcweir 			break;// "Format/ByInput/ApplyNumbering/SpecialCharacter/Char",
646*cdf0e10cSrcweir             case 43 :
647*cdf0e10cSrcweir 				pValues[nProp] <<= OUString(rSwFlags.aByInputBulletFont.GetName());
648*cdf0e10cSrcweir 			break;// "Format/ByInput/ApplyNumbering/SpecialCharacter/Font",
649*cdf0e10cSrcweir             case 44 :
650*cdf0e10cSrcweir 				pValues[nProp] <<= (sal_Int32)rSwFlags.aByInputBulletFont.GetFamily();
651*cdf0e10cSrcweir 			break;// "Format/ByInput/ApplyNumbering/SpecialCharacter/FontFamily",
652*cdf0e10cSrcweir             case 45 :
653*cdf0e10cSrcweir 				pValues[nProp] <<= (sal_Int32)rSwFlags.aByInputBulletFont.GetCharSet();
654*cdf0e10cSrcweir 			break;// "Format/ByInput/ApplyNumbering/SpecialCharacter/FontCharset",
655*cdf0e10cSrcweir             case 46 :
656*cdf0e10cSrcweir 				pValues[nProp] <<= (sal_Int32)rSwFlags.aByInputBulletFont.GetPitch();
657*cdf0e10cSrcweir 			break;// "Format/ByInput/ApplyNumbering/SpecialCharacter/FontPitch",
658*cdf0e10cSrcweir 		}
659*cdf0e10cSrcweir 	}
660*cdf0e10cSrcweir 	PutProperties(aNames, aValues);
661*cdf0e10cSrcweir }
662*cdf0e10cSrcweir /*-- 12.10.00 11:51:49---------------------------------------------------
663*cdf0e10cSrcweir 
664*cdf0e10cSrcweir   -----------------------------------------------------------------------*/
665*cdf0e10cSrcweir void SvxSwAutoCorrCfg::Notify( const Sequence<OUString>& /* aPropertyNames */ )
666*cdf0e10cSrcweir {
667*cdf0e10cSrcweir 	Load(sal_False);
668*cdf0e10cSrcweir }
669*cdf0e10cSrcweir 
670*cdf0e10cSrcweir SvxAutoCorrCfg*	SvxAutoCorrCfg::Get()
671*cdf0e10cSrcweir {
672*cdf0e10cSrcweir 	if( !pAutoCorrCfg )
673*cdf0e10cSrcweir 		pAutoCorrCfg = new SvxAutoCorrCfg;
674*cdf0e10cSrcweir 	return pAutoCorrCfg;
675*cdf0e10cSrcweir }
676