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