Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 :
21 : #include <unotools/fltrcfg.hxx>
22 : #include <tools/debug.hxx>
23 :
24 : #include <rtl/logfile.hxx>
25 : #include <com/sun/star/uno/Any.hxx>
26 : #include <com/sun/star/uno/Sequence.hxx>
27 :
28 : using namespace utl;
29 : using namespace com::sun::star::uno;
30 :
31 : // -----------------------------------------------------------------------
32 : #define FILTERCFG_WORD_CODE 0x0001
33 : #define FILTERCFG_WORD_STORAGE 0x0002
34 : #define FILTERCFG_EXCEL_CODE 0x0004
35 : #define FILTERCFG_EXCEL_STORAGE 0x0008
36 : #define FILTERCFG_PPOINT_CODE 0x0010
37 : #define FILTERCFG_PPOINT_STORAGE 0x0020
38 : #define FILTERCFG_MATH_LOAD 0x0100
39 : #define FILTERCFG_MATH_SAVE 0x0200
40 : #define FILTERCFG_WRITER_LOAD 0x0400
41 : #define FILTERCFG_WRITER_SAVE 0x0800
42 : #define FILTERCFG_CALC_LOAD 0x1000
43 : #define FILTERCFG_CALC_SAVE 0x2000
44 : #define FILTERCFG_IMPRESS_LOAD 0x4000
45 : #define FILTERCFG_IMPRESS_SAVE 0x8000
46 : #define FILTERCFG_EXCEL_EXECTBL 0x10000
47 : #define FILTERCFG_ENABLE_PPT_PREVIEW 0x20000
48 : #define FILTERCFG_ENABLE_EXCEL_PREVIEW 0x40000
49 : #define FILTERCFG_ENABLE_WORD_PREVIEW 0x80000
50 : #define FILTERCFG_USE_ENHANCED_FIELDS 0x100000
51 : #define FILTERCFG_WORD_WBCTBL 0x200000
52 :
53 : class SvtAppFilterOptions_Impl : public utl::ConfigItem
54 : {
55 : sal_Bool bLoadVBA;
56 : sal_Bool bSaveVBA;
57 : public:
58 36 : SvtAppFilterOptions_Impl(const OUString& rRoot) :
59 : utl::ConfigItem(rRoot),
60 : bLoadVBA(sal_False),
61 36 : bSaveVBA(sal_False) {}
62 : ~SvtAppFilterOptions_Impl();
63 : virtual void Commit();
64 : virtual void Notify( const com::sun::star::uno::Sequence<OUString>& aPropertyNames);
65 : void Load();
66 :
67 34 : sal_Bool IsLoad() const {return bLoadVBA;}
68 0 : void SetLoad(sal_Bool bSet)
69 : {
70 0 : if(bSet != bLoadVBA)
71 0 : SetModified();
72 0 : bLoadVBA = bSet;
73 0 : }
74 3 : sal_Bool IsSave() const {return bSaveVBA;}
75 0 : void SetSave(sal_Bool bSet)
76 : {
77 0 : if(bSet != bSaveVBA)
78 0 : SetModified();
79 0 : bSaveVBA = bSet;
80 0 : }
81 : };
82 :
83 72 : SvtAppFilterOptions_Impl::~SvtAppFilterOptions_Impl()
84 : {
85 36 : if(IsModified())
86 0 : Commit();
87 36 : }
88 :
89 0 : void SvtAppFilterOptions_Impl::Commit()
90 : {
91 0 : Sequence<OUString> aNames(2);
92 0 : OUString* pNames = aNames.getArray();
93 0 : pNames[0] = "Load";
94 0 : pNames[1] = "Save";
95 0 : Sequence<Any> aValues(aNames.getLength());
96 0 : Any* pValues = aValues.getArray();
97 :
98 0 : const Type& rType = ::getBooleanCppuType();
99 0 : pValues[0].setValue(&bLoadVBA, rType);
100 0 : pValues[1].setValue(&bSaveVBA, rType);
101 :
102 0 : PutProperties(aNames, aValues);
103 0 : }
104 :
105 0 : void SvtAppFilterOptions_Impl::Notify( const Sequence< OUString >& )
106 : {
107 : // no listeners supported yet
108 0 : }
109 :
110 72 : void SvtAppFilterOptions_Impl::Load()
111 : {
112 72 : Sequence<OUString> aNames(2);
113 72 : OUString* pNames = aNames.getArray();
114 72 : pNames[0] = "Load";
115 72 : pNames[1] = "Save";
116 :
117 144 : Sequence<Any> aValues = GetProperties(aNames);
118 72 : const Any* pValues = aValues.getConstArray();
119 :
120 72 : if(pValues[0].hasValue())
121 72 : bLoadVBA = *(sal_Bool*)pValues[0].getValue();
122 72 : if(pValues[1].hasValue())
123 144 : bSaveVBA = *(sal_Bool*)pValues[1].getValue();
124 72 : }
125 :
126 : // -----------------------------------------------------------------------
127 12 : class SvtWriterFilterOptions_Impl : public SvtAppFilterOptions_Impl
128 : {
129 : sal_Bool bLoadExecutable;
130 : public:
131 12 : SvtWriterFilterOptions_Impl(const OUString& rRoot) :
132 : SvtAppFilterOptions_Impl(rRoot),
133 12 : bLoadExecutable(sal_False)
134 12 : {}
135 : virtual void Commit();
136 : void Load();
137 :
138 0 : sal_Bool IsLoadExecutable() const {return bLoadExecutable;}
139 0 : void SetLoadExecutable(sal_Bool bSet)
140 : {
141 0 : if(bSet != bLoadExecutable)
142 0 : SetModified();
143 0 : bLoadExecutable = bSet;
144 0 : }
145 : };
146 :
147 0 : void SvtWriterFilterOptions_Impl::Commit()
148 : {
149 0 : SvtAppFilterOptions_Impl::Commit();
150 :
151 0 : Sequence<OUString> aNames(1);
152 0 : aNames[0] = "Executable";
153 0 : Sequence<Any> aValues(1);
154 0 : aValues[0] <<= bLoadExecutable;
155 :
156 0 : PutProperties(aNames, aValues);
157 0 : }
158 :
159 24 : void SvtWriterFilterOptions_Impl::Load()
160 : {
161 24 : SvtAppFilterOptions_Impl::Load();
162 :
163 24 : Sequence<OUString> aNames(1);
164 24 : aNames[0] = "Executable";
165 :
166 48 : Sequence<Any> aValues = GetProperties(aNames);
167 24 : const Any* pValues = aValues.getConstArray();
168 24 : if(pValues[0].hasValue())
169 48 : bLoadExecutable = *(sal_Bool*)pValues[0].getValue();
170 24 : }
171 :
172 : // -----------------------------------------------------------------------
173 12 : class SvtCalcFilterOptions_Impl : public SvtAppFilterOptions_Impl
174 : {
175 : sal_Bool bLoadExecutable;
176 : public:
177 12 : SvtCalcFilterOptions_Impl(const OUString& rRoot) :
178 : SvtAppFilterOptions_Impl(rRoot),
179 12 : bLoadExecutable(sal_False)
180 12 : {}
181 : virtual void Commit();
182 : void Load();
183 :
184 27 : sal_Bool IsLoadExecutable() const {return bLoadExecutable;}
185 0 : void SetLoadExecutable(sal_Bool bSet)
186 : {
187 0 : if(bSet != bLoadExecutable)
188 0 : SetModified();
189 0 : bLoadExecutable = bSet;
190 0 : }
191 : };
192 :
193 0 : void SvtCalcFilterOptions_Impl::Commit()
194 : {
195 0 : SvtAppFilterOptions_Impl::Commit();
196 :
197 0 : Sequence<OUString> aNames(1);
198 0 : aNames[0] = "Executable";
199 0 : Sequence<Any> aValues(1);
200 0 : aValues[0] <<= bLoadExecutable;
201 :
202 0 : PutProperties(aNames, aValues);
203 0 : }
204 :
205 24 : void SvtCalcFilterOptions_Impl::Load()
206 : {
207 24 : SvtAppFilterOptions_Impl::Load();
208 :
209 24 : Sequence<OUString> aNames(1);
210 24 : aNames[0] = "Executable";
211 :
212 48 : Sequence<Any> aValues = GetProperties(aNames);
213 24 : const Any* pValues = aValues.getConstArray();
214 24 : if(pValues[0].hasValue())
215 48 : bLoadExecutable = *(sal_Bool*)pValues[0].getValue();
216 24 : }
217 :
218 12 : struct SvtFilterOptions_Impl
219 : {
220 : sal_uLong nFlags;
221 : SvtWriterFilterOptions_Impl aWriterCfg;
222 : SvtCalcFilterOptions_Impl aCalcCfg;
223 : SvtAppFilterOptions_Impl aImpressCfg;
224 :
225 12 : SvtFilterOptions_Impl() :
226 : aWriterCfg("Office.Writer/Filter/Import/VBA"),
227 : aCalcCfg("Office.Calc/Filter/Import/VBA"),
228 12 : aImpressCfg("Office.Impress/Filter/Import/VBA")
229 : {
230 : nFlags = FILTERCFG_WORD_CODE |
231 : FILTERCFG_WORD_STORAGE |
232 : FILTERCFG_EXCEL_CODE |
233 : FILTERCFG_EXCEL_STORAGE |
234 : FILTERCFG_PPOINT_CODE |
235 : FILTERCFG_PPOINT_STORAGE |
236 : FILTERCFG_MATH_LOAD |
237 : FILTERCFG_MATH_SAVE |
238 : FILTERCFG_WRITER_LOAD |
239 : FILTERCFG_WRITER_SAVE |
240 : FILTERCFG_CALC_LOAD |
241 : FILTERCFG_CALC_SAVE |
242 : FILTERCFG_IMPRESS_LOAD |
243 : FILTERCFG_IMPRESS_SAVE |
244 12 : FILTERCFG_USE_ENHANCED_FIELDS;
245 12 : Load();
246 12 : }
247 :
248 : void SetFlag( sal_uLong nFlag, sal_Bool bSet );
249 : sal_Bool IsFlag( sal_uLong nFlag ) const;
250 24 : void Load()
251 : {
252 24 : aWriterCfg.Load();
253 24 : aCalcCfg.Load();
254 24 : aImpressCfg.Load();
255 24 : }
256 : };
257 :
258 144 : void SvtFilterOptions_Impl::SetFlag( sal_uLong nFlag, sal_Bool bSet )
259 : {
260 144 : switch(nFlag)
261 : {
262 0 : case FILTERCFG_WORD_CODE: aWriterCfg.SetLoad(bSet);break;
263 0 : case FILTERCFG_WORD_STORAGE: aWriterCfg.SetSave(bSet);break;
264 0 : case FILTERCFG_WORD_WBCTBL: aWriterCfg.SetLoadExecutable(bSet);break;
265 0 : case FILTERCFG_EXCEL_CODE: aCalcCfg.SetLoad(bSet);break;
266 0 : case FILTERCFG_EXCEL_STORAGE: aCalcCfg.SetSave(bSet);break;
267 0 : case FILTERCFG_EXCEL_EXECTBL: aCalcCfg.SetLoadExecutable(bSet);break;
268 0 : case FILTERCFG_PPOINT_CODE: aImpressCfg.SetLoad(bSet);break;
269 0 : case FILTERCFG_PPOINT_STORAGE: aImpressCfg.SetSave(bSet);break;
270 : default:
271 144 : if( bSet )
272 120 : nFlags |= nFlag;
273 : else
274 24 : nFlags &= ~nFlag;
275 : }
276 144 : }
277 :
278 820 : sal_Bool SvtFilterOptions_Impl::IsFlag( sal_uLong nFlag ) const
279 : {
280 : sal_Bool bRet;
281 820 : switch(nFlag)
282 : {
283 0 : case FILTERCFG_WORD_CODE : bRet = aWriterCfg.IsLoad();break;
284 0 : case FILTERCFG_WORD_STORAGE : bRet = aWriterCfg.IsSave();break;
285 0 : case FILTERCFG_WORD_WBCTBL : bRet = aWriterCfg.IsLoadExecutable();break;
286 27 : case FILTERCFG_EXCEL_CODE : bRet = aCalcCfg.IsLoad();break;
287 3 : case FILTERCFG_EXCEL_STORAGE : bRet = aCalcCfg.IsSave();break;
288 27 : case FILTERCFG_EXCEL_EXECTBL : bRet = aCalcCfg.IsLoadExecutable();break;
289 7 : case FILTERCFG_PPOINT_CODE : bRet = aImpressCfg.IsLoad();break;
290 0 : case FILTERCFG_PPOINT_STORAGE : bRet = aImpressCfg.IsSave();break;
291 : default:
292 756 : bRet = 0 != (nFlags & nFlag );
293 : }
294 820 : return bRet;
295 : }
296 :
297 : // -----------------------------------------------------------------------
298 :
299 12 : SvtFilterOptions::SvtFilterOptions() :
300 : ConfigItem( "Office.Common/Filter/Microsoft" ),
301 12 : pImp(new SvtFilterOptions_Impl)
302 : {
303 : RTL_LOGFILE_CONTEXT(aLog, "unotools SvtFilterOptions::SvtFilterOptions()");
304 12 : EnableNotification(GetPropertyNames());
305 12 : Load();
306 12 : }
307 :
308 : // -----------------------------------------------------------------------
309 24 : SvtFilterOptions::~SvtFilterOptions()
310 : {
311 12 : delete pImp;
312 12 : }
313 :
314 24 : const Sequence<OUString>& SvtFilterOptions::GetPropertyNames()
315 : {
316 24 : static Sequence<OUString> aNames;
317 24 : if(!aNames.getLength())
318 : {
319 12 : int nCount = 12;
320 12 : aNames.realloc(nCount);
321 : static const char* aPropNames[] =
322 : {
323 : "Import/MathTypeToMath", // 0
324 : "Import/WinWordToWriter", // 1
325 : "Import/PowerPointToImpress", // 2
326 : "Import/ExcelToCalc", // 3
327 : "Export/MathToMathType", // 4
328 : "Export/WriterToWinWord", // 5
329 : "Export/ImpressToPowerPoint", // 6
330 : "Export/CalcToExcel", // 7
331 : "Export/EnablePowerPointPreview", // 8
332 : "Export/EnableExcelPreview", // 9
333 : "Export/EnableWordPreview", // 10
334 : "Import/ImportWWFieldsAsEnhancedFields" // 11
335 : };
336 12 : OUString* pNames = aNames.getArray();
337 156 : for(int i = 0; i < nCount; i++)
338 144 : pNames[i] = OUString::createFromAscii(aPropNames[i]);
339 : }
340 24 : return aNames;
341 : }
342 : //-----------------------------------------------------------------------
343 144 : static sal_uLong lcl_GetFlag(sal_Int32 nProp)
344 : {
345 144 : sal_uLong nFlag = 0;
346 144 : switch(nProp)
347 : {
348 12 : case 0: nFlag = FILTERCFG_MATH_LOAD; break;
349 12 : case 1: nFlag = FILTERCFG_WRITER_LOAD; break;
350 12 : case 2: nFlag = FILTERCFG_IMPRESS_LOAD; break;
351 12 : case 3: nFlag = FILTERCFG_CALC_LOAD; break;
352 12 : case 4: nFlag = FILTERCFG_MATH_SAVE; break;
353 12 : case 5: nFlag = FILTERCFG_WRITER_SAVE; break;
354 12 : case 6: nFlag = FILTERCFG_IMPRESS_SAVE; break;
355 12 : case 7: nFlag = FILTERCFG_CALC_SAVE; break;
356 12 : case 8: nFlag = FILTERCFG_ENABLE_PPT_PREVIEW; break;
357 12 : case 9: nFlag = FILTERCFG_ENABLE_EXCEL_PREVIEW; break;
358 12 : case 10: nFlag = FILTERCFG_ENABLE_WORD_PREVIEW; break;
359 12 : case 11: nFlag = FILTERCFG_USE_ENHANCED_FIELDS; break;
360 :
361 : default: OSL_FAIL("illegal value");
362 : }
363 144 : return nFlag;
364 : }
365 :
366 0 : void SvtFilterOptions::Notify( const Sequence<OUString>& )
367 : {
368 0 : Load();
369 0 : }
370 :
371 0 : void SvtFilterOptions::Commit()
372 : {
373 0 : const Sequence<OUString>& aNames = GetPropertyNames();
374 0 : Sequence<Any> aValues(aNames.getLength());
375 0 : Any* pValues = aValues.getArray();
376 :
377 0 : const Type& rType = ::getBooleanCppuType();
378 0 : for(int nProp = 0; nProp < aNames.getLength(); nProp++)
379 : {
380 0 : sal_uLong nFlag = lcl_GetFlag(nProp);
381 0 : sal_Bool bVal = pImp->IsFlag( nFlag);
382 0 : pValues[nProp].setValue(&bVal, rType);
383 :
384 : }
385 0 : PutProperties(aNames, aValues);
386 0 : }
387 :
388 12 : void SvtFilterOptions::Load()
389 : {
390 12 : pImp->Load();
391 12 : const Sequence<OUString>& rNames = GetPropertyNames();
392 12 : Sequence<Any> aValues = GetProperties(rNames);
393 12 : const Any* pValues = aValues.getConstArray();
394 : DBG_ASSERT(aValues.getLength() == rNames.getLength(), "GetProperties failed");
395 12 : if(aValues.getLength() == rNames.getLength())
396 : {
397 156 : for(int nProp = 0; nProp < rNames.getLength(); nProp++)
398 : {
399 144 : if(pValues[nProp].hasValue())
400 : {
401 144 : sal_Bool bVal = *(sal_Bool*)pValues[nProp].getValue();
402 144 : sal_uLong nFlag = lcl_GetFlag(nProp);
403 144 : pImp->SetFlag( nFlag, bVal);
404 : }
405 : }
406 12 : }
407 12 : }
408 : // -----------------------------------------------------------------------
409 :
410 0 : void SvtFilterOptions::SetLoadWordBasicCode( sal_Bool bFlag )
411 : {
412 0 : pImp->SetFlag( FILTERCFG_WORD_CODE, bFlag );
413 0 : SetModified();
414 0 : }
415 :
416 0 : sal_Bool SvtFilterOptions::IsLoadWordBasicCode() const
417 : {
418 0 : return pImp->IsFlag( FILTERCFG_WORD_CODE );
419 : }
420 :
421 0 : void SvtFilterOptions::SetLoadWordBasicExecutable( sal_Bool bFlag )
422 : {
423 0 : pImp->SetFlag( FILTERCFG_WORD_WBCTBL, bFlag );
424 0 : SetModified();
425 0 : }
426 :
427 0 : sal_Bool SvtFilterOptions::IsLoadWordBasicExecutable() const
428 : {
429 0 : return pImp->IsFlag( FILTERCFG_WORD_WBCTBL );
430 : }
431 :
432 0 : void SvtFilterOptions::SetLoadWordBasicStorage( sal_Bool bFlag )
433 : {
434 0 : pImp->SetFlag( FILTERCFG_WORD_STORAGE, bFlag );
435 0 : SetModified();
436 0 : }
437 :
438 0 : sal_Bool SvtFilterOptions::IsLoadWordBasicStorage() const
439 : {
440 0 : return pImp->IsFlag( FILTERCFG_WORD_STORAGE );
441 : }
442 :
443 : // -----------------------------------------------------------------------
444 :
445 0 : void SvtFilterOptions::SetLoadExcelBasicCode( sal_Bool bFlag )
446 : {
447 0 : pImp->SetFlag( FILTERCFG_EXCEL_CODE, bFlag );
448 0 : SetModified();
449 0 : }
450 :
451 27 : sal_Bool SvtFilterOptions::IsLoadExcelBasicCode() const
452 : {
453 27 : return pImp->IsFlag( FILTERCFG_EXCEL_CODE );
454 : }
455 :
456 0 : void SvtFilterOptions::SetLoadExcelBasicExecutable( sal_Bool bFlag )
457 : {
458 0 : pImp->SetFlag( FILTERCFG_EXCEL_EXECTBL, bFlag );
459 0 : SetModified();
460 0 : }
461 :
462 27 : sal_Bool SvtFilterOptions::IsLoadExcelBasicExecutable() const
463 : {
464 27 : return pImp->IsFlag( FILTERCFG_EXCEL_EXECTBL );
465 : }
466 :
467 0 : void SvtFilterOptions::SetLoadExcelBasicStorage( sal_Bool bFlag )
468 : {
469 0 : pImp->SetFlag( FILTERCFG_EXCEL_STORAGE, bFlag );
470 0 : SetModified();
471 0 : }
472 :
473 3 : sal_Bool SvtFilterOptions::IsLoadExcelBasicStorage() const
474 : {
475 3 : return pImp->IsFlag( FILTERCFG_EXCEL_STORAGE );
476 : }
477 :
478 : // -----------------------------------------------------------------------
479 :
480 0 : void SvtFilterOptions::SetLoadPPointBasicCode( sal_Bool bFlag )
481 : {
482 0 : pImp->SetFlag( FILTERCFG_PPOINT_CODE, bFlag );
483 0 : SetModified();
484 0 : }
485 :
486 7 : sal_Bool SvtFilterOptions::IsLoadPPointBasicCode() const
487 : {
488 7 : return pImp->IsFlag( FILTERCFG_PPOINT_CODE );
489 : }
490 :
491 0 : void SvtFilterOptions::SetLoadPPointBasicStorage( sal_Bool bFlag )
492 : {
493 0 : pImp->SetFlag( FILTERCFG_PPOINT_STORAGE, bFlag );
494 0 : SetModified();
495 0 : }
496 :
497 0 : sal_Bool SvtFilterOptions::IsLoadPPointBasicStorage() const
498 : {
499 0 : return pImp->IsFlag( FILTERCFG_PPOINT_STORAGE );
500 : }
501 :
502 : // -----------------------------------------------------------------------
503 :
504 67 : sal_Bool SvtFilterOptions::IsMathType2Math() const
505 : {
506 67 : return pImp->IsFlag( FILTERCFG_MATH_LOAD );
507 : }
508 :
509 0 : void SvtFilterOptions::SetMathType2Math( sal_Bool bFlag )
510 : {
511 0 : pImp->SetFlag( FILTERCFG_MATH_LOAD, bFlag );
512 0 : SetModified();
513 0 : }
514 :
515 97 : sal_Bool SvtFilterOptions::IsMath2MathType() const
516 : {
517 97 : return pImp->IsFlag( FILTERCFG_MATH_SAVE );
518 : }
519 :
520 0 : void SvtFilterOptions::SetMath2MathType( sal_Bool bFlag )
521 : {
522 0 : pImp->SetFlag( FILTERCFG_MATH_SAVE, bFlag );
523 0 : SetModified();
524 0 : }
525 :
526 :
527 : // -----------------------------------------------------------------------
528 67 : sal_Bool SvtFilterOptions::IsWinWord2Writer() const
529 : {
530 67 : return pImp->IsFlag( FILTERCFG_WRITER_LOAD );
531 : }
532 :
533 0 : void SvtFilterOptions::SetWinWord2Writer( sal_Bool bFlag )
534 : {
535 0 : pImp->SetFlag( FILTERCFG_WRITER_LOAD, bFlag );
536 0 : SetModified();
537 0 : }
538 :
539 97 : sal_Bool SvtFilterOptions::IsWriter2WinWord() const
540 : {
541 97 : return pImp->IsFlag( FILTERCFG_WRITER_SAVE );
542 : }
543 :
544 0 : void SvtFilterOptions::SetWriter2WinWord( sal_Bool bFlag )
545 : {
546 0 : pImp->SetFlag( FILTERCFG_WRITER_SAVE, bFlag );
547 0 : SetModified();
548 0 : }
549 :
550 118 : sal_Bool SvtFilterOptions::IsUseEnhancedFields() const
551 : {
552 118 : return pImp->IsFlag( FILTERCFG_USE_ENHANCED_FIELDS );
553 : }
554 :
555 : // -----------------------------------------------------------------------
556 38 : sal_Bool SvtFilterOptions::IsExcel2Calc() const
557 : {
558 38 : return pImp->IsFlag( FILTERCFG_CALC_LOAD );
559 : }
560 :
561 0 : void SvtFilterOptions::SetExcel2Calc( sal_Bool bFlag )
562 : {
563 0 : pImp->SetFlag( FILTERCFG_CALC_LOAD, bFlag );
564 0 : SetModified();
565 0 : }
566 :
567 97 : sal_Bool SvtFilterOptions::IsCalc2Excel() const
568 : {
569 97 : return pImp->IsFlag( FILTERCFG_CALC_SAVE );
570 : }
571 :
572 0 : void SvtFilterOptions::SetCalc2Excel( sal_Bool bFlag )
573 : {
574 0 : pImp->SetFlag( FILTERCFG_CALC_SAVE, bFlag );
575 0 : SetModified();
576 0 : }
577 :
578 :
579 : // -----------------------------------------------------------------------
580 67 : sal_Bool SvtFilterOptions::IsPowerPoint2Impress() const
581 : {
582 67 : return pImp->IsFlag( FILTERCFG_IMPRESS_LOAD );
583 : }
584 :
585 0 : void SvtFilterOptions::SetPowerPoint2Impress( sal_Bool bFlag )
586 : {
587 0 : pImp->SetFlag( FILTERCFG_IMPRESS_LOAD, bFlag );
588 0 : SetModified();
589 0 : }
590 :
591 97 : sal_Bool SvtFilterOptions::IsImpress2PowerPoint() const
592 : {
593 97 : return pImp->IsFlag( FILTERCFG_IMPRESS_SAVE );
594 : }
595 :
596 0 : void SvtFilterOptions::SetImpress2PowerPoint( sal_Bool bFlag )
597 : {
598 0 : pImp->SetFlag( FILTERCFG_IMPRESS_SAVE, bFlag );
599 0 : SetModified();
600 0 : }
601 :
602 : namespace
603 : {
604 : class theFilterOptions
605 : : public rtl::Static<SvtFilterOptions, theFilterOptions>
606 : {
607 : };
608 : }
609 :
610 323 : SvtFilterOptions& SvtFilterOptions::Get()
611 : {
612 323 : return theFilterOptions::get();
613 : }
614 :
615 : // -----------------------------------------------------------------------
616 :
617 0 : sal_Bool SvtFilterOptions::IsEnablePPTPreview() const
618 : {
619 0 : return pImp->IsFlag( FILTERCFG_ENABLE_PPT_PREVIEW );
620 : }
621 :
622 :
623 3 : sal_Bool SvtFilterOptions::IsEnableCalcPreview() const
624 : {
625 3 : return pImp->IsFlag( FILTERCFG_ENABLE_EXCEL_PREVIEW );
626 : }
627 :
628 :
629 8 : sal_Bool SvtFilterOptions::IsEnableWordPreview() const
630 : {
631 8 : return pImp->IsFlag( FILTERCFG_ENABLE_WORD_PREVIEW );
632 : }
633 :
634 :
635 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|