1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <sal/config.h>
22 #include <sal/log.hxx>
23 #include <unotools/saveopt.hxx>
24 #include <rtl/instance.hxx>
25 #include <unotools/configmgr.hxx>
26 #include <unotools/configitem.hxx>
27 #include <tools/debug.hxx>
28 #include <com/sun/star/uno/Any.hxx>
29 #include <com/sun/star/uno/Sequence.hxx>
31 #include <osl/diagnose.h>
32 #include <osl/mutex.hxx>
33 #include <officecfg/Office/Recovery.hxx>
36 using namespace com::sun::star::uno
;
38 class SvtSaveOptions_Impl
;
39 class SvtLoadOptions_Impl
;
41 #define CFG_READONLY_DEFAULT false
43 struct SvtLoadSaveOptions_Impl
45 std::unique_ptr
<SvtSaveOptions_Impl
> pSaveOpt
;
46 std::unique_ptr
<SvtLoadOptions_Impl
> pLoadOpt
;
49 static std::unique_ptr
<SvtLoadSaveOptions_Impl
> pOptions
;
50 static sal_Int32 nRefCount
= 0;
52 class SvtSaveOptions_Impl
: public utl::ConfigItem
54 sal_Int32 nAutoSaveTime
;
69 SvtSaveOptions::ODFDefaultVersion eODFDefaultVersion
;
87 virtual void ImplCommit() override
;
90 SvtSaveOptions_Impl();
92 virtual void Notify( const css::uno::Sequence
< OUString
>& aPropertyNames
) override
;
94 sal_Int32
GetAutoSaveTime() const { return nAutoSaveTime
; }
95 bool IsUseUserData() const { return bUseUserData
; }
96 bool IsBackup() const { return bBackup
; }
97 bool IsAutoSave() const { return bAutoSave
; }
98 bool IsAutoSavePrompt() const { return bAutoSavePrompt
; }
99 bool IsUserAutoSave() const { return bUserAutoSave
; }
100 bool IsDocInfoSave() const { return bDocInfSave
; }
101 bool IsSaveWorkingSet() const { return bSaveWorkingSet
; }
102 bool IsSaveDocView() const { return bSaveDocView
; }
103 bool IsSaveRelINet() const { return bSaveRelINet
; }
104 bool IsSaveRelFSys() const { return bSaveRelFSys
; }
105 bool IsPrettyPrintingEnabled( ) const { return bDoPrettyPrinting
; }
106 bool IsWarnAlienFormat() const { return bWarnAlienFormat
; }
107 bool IsLoadDocPrinter() const { return bLoadDocPrinter
; }
109 SvtSaveOptions::ODFDefaultVersion
110 GetODFDefaultVersion() const { return eODFDefaultVersion
; }
112 void SetAutoSaveTime( sal_Int32 n
);
113 void SetUseUserData( bool b
);
114 void SetBackup( bool b
);
115 void SetAutoSave( bool b
);
116 void SetAutoSavePrompt( bool b
);
117 void SetUserAutoSave( bool b
);
118 void SetDocInfoSave( bool b
);
119 void SetSaveWorkingSet( bool b
);
120 void SetSaveDocView( bool b
);
121 void SetSaveRelINet( bool b
);
122 void SetSaveRelFSys( bool b
);
123 void EnablePrettyPrinting( bool _bDoPP
);
124 void SetWarnAlienFormat( bool _bDoPP
);
125 void SetLoadDocPrinter( bool bNew
);
126 void SetODFDefaultVersion( SvtSaveOptions::ODFDefaultVersion eNew
);
128 bool IsReadOnly( SvtSaveOptions::EOption eOption
) const;
131 void SvtSaveOptions_Impl::SetAutoSaveTime( sal_Int32 n
)
133 if (!bROAutoSaveTime
&& nAutoSaveTime
!=n
)
141 void SvtSaveOptions_Impl::SetUseUserData( bool b
)
143 if (!bROUseUserData
&& bUseUserData
!=b
)
150 void SvtSaveOptions_Impl::SetBackup( bool b
)
152 if (!bROBackup
&& bBackup
!=b
)
159 void SvtSaveOptions_Impl::SetAutoSave( bool b
)
161 if (!bROAutoSave
&& bAutoSave
!=b
)
169 void SvtSaveOptions_Impl::SetAutoSavePrompt( bool b
)
171 if (!bROAutoSavePrompt
&& bAutoSavePrompt
!=b
)
178 void SvtSaveOptions_Impl::SetUserAutoSave( bool b
)
180 if (!bROUserAutoSave
&& bUserAutoSave
!=b
)
188 void SvtSaveOptions_Impl::SetDocInfoSave(bool b
)
190 if (!bRODocInfSave
&& bDocInfSave
!=b
)
197 void SvtSaveOptions_Impl::SetSaveWorkingSet( bool b
)
199 if (!bROSaveWorkingSet
&& bSaveWorkingSet
!=b
)
206 void SvtSaveOptions_Impl::SetSaveDocView( bool b
)
208 if (!bROSaveDocView
&& bSaveDocView
!=b
)
215 void SvtSaveOptions_Impl::SetSaveRelINet( bool b
)
217 if (!bROSaveRelINet
&& bSaveRelINet
!=b
)
224 void SvtSaveOptions_Impl::SetSaveRelFSys( bool b
)
226 if (!bROSaveRelFSys
&& bSaveRelFSys
!=b
)
233 void SvtSaveOptions_Impl::EnablePrettyPrinting( bool _bDoPP
)
235 if (!bRODoPrettyPrinting
&& bDoPrettyPrinting
!=_bDoPP
)
237 bDoPrettyPrinting
= _bDoPP
;
242 void SvtSaveOptions_Impl::SetWarnAlienFormat( bool _bDoPP
)
244 if (!bROWarnAlienFormat
&& bWarnAlienFormat
!=_bDoPP
)
246 bWarnAlienFormat
= _bDoPP
;
251 void SvtSaveOptions_Impl::SetLoadDocPrinter( bool bNew
)
253 if ( !bROLoadDocPrinter
&& bLoadDocPrinter
!= bNew
)
255 bLoadDocPrinter
= bNew
;
260 void SvtSaveOptions_Impl::SetODFDefaultVersion( SvtSaveOptions::ODFDefaultVersion eNew
)
262 if ( !bROODFDefaultVersion
&& eODFDefaultVersion
!= eNew
)
264 eODFDefaultVersion
= eNew
;
269 bool SvtSaveOptions_Impl::IsReadOnly( SvtSaveOptions::EOption eOption
) const
271 bool bReadOnly
= CFG_READONLY_DEFAULT
;
274 case SvtSaveOptions::EOption::AutoSaveTime
:
275 bReadOnly
= bROAutoSaveTime
;
277 case SvtSaveOptions::EOption::UseUserData
:
278 bReadOnly
= bROUseUserData
;
280 case SvtSaveOptions::EOption::Backup
:
281 bReadOnly
= bROBackup
;
283 case SvtSaveOptions::EOption::AutoSave
:
284 bReadOnly
= bROAutoSave
;
286 case SvtSaveOptions::EOption::AutoSavePrompt
:
287 bReadOnly
= bROAutoSavePrompt
;
289 case SvtSaveOptions::EOption::UserAutoSave
:
290 bReadOnly
= bROUserAutoSave
;
292 case SvtSaveOptions::EOption::DocInfSave
:
293 bReadOnly
= bRODocInfSave
;
295 case SvtSaveOptions::EOption::SaveWorkingSet
:
296 bReadOnly
= bROSaveWorkingSet
;
298 case SvtSaveOptions::EOption::SaveDocView
:
299 bReadOnly
= bROSaveDocView
;
301 case SvtSaveOptions::EOption::SaveRelInet
:
302 bReadOnly
= bROSaveRelINet
;
304 case SvtSaveOptions::EOption::SaveRelFsys
:
305 bReadOnly
= bROSaveRelFSys
;
307 case SvtSaveOptions::EOption::DoPrettyPrinting
:
308 bReadOnly
= bRODoPrettyPrinting
;
310 case SvtSaveOptions::EOption::WarnAlienFormat
:
311 bReadOnly
= bROWarnAlienFormat
;
313 case SvtSaveOptions::EOption::LoadDocPrinter
:
314 bReadOnly
= bROLoadDocPrinter
;
316 case SvtSaveOptions::EOption::OdfDefaultVersion
:
317 bReadOnly
= bROLoadDocPrinter
;
324 #define TIMEINTERVALL 1
325 #define USEUSERDATA 2
326 #define CREATEBACKUP 3
329 #define EDITPROPERTY 6
330 #define SAVEVIEWINFO 7
331 #define PRETTYPRINTING 8
332 #define WARNALIENFORMAT 9
333 #define LOADDOCPRINTER 10
334 #define FILESYSTEM 11
336 #define SAVEWORKINGSET 13
337 #define ODFDEFAULTVERSION 14
339 static Sequence
< OUString
> GetPropertyNames()
341 static const char* aPropNames
[] =
344 "Document/AutoSaveTimeIntervall",
345 "Document/UseUserData",
346 "Document/CreateBackup",
348 "Document/AutoSavePrompt",
349 "Document/EditProperty",
351 "Document/PrettyPrinting",
352 "Document/WarnAlienFormat",
353 "Document/LoadPrinter",
360 const int nCount
= SAL_N_ELEMENTS( aPropNames
);
361 Sequence
< OUString
> aNames( nCount
);
362 OUString
* pNames
= aNames
.getArray();
363 for ( int i
= 0; i
< nCount
; i
++ )
364 pNames
[i
] = OUString::createFromAscii( aPropNames
[i
] );
369 SvtSaveOptions_Impl::SvtSaveOptions_Impl()
370 : ConfigItem( "Office.Common/Save" )
372 , bUseUserData( false )
375 , bAutoSavePrompt( false )
376 , bUserAutoSave( false )
377 , bDocInfSave( false )
378 , bSaveWorkingSet( false )
379 , bSaveDocView( false )
380 , bSaveRelINet( false )
381 , bSaveRelFSys( false )
382 , bDoPrettyPrinting( false )
383 , bWarnAlienFormat( true )
384 , bLoadDocPrinter( true )
385 , eODFDefaultVersion( SvtSaveOptions::ODFVER_LATEST
)
386 , bROAutoSaveTime( CFG_READONLY_DEFAULT
)
387 , bROUseUserData( CFG_READONLY_DEFAULT
)
388 , bROBackup( CFG_READONLY_DEFAULT
)
389 , bROAutoSave( CFG_READONLY_DEFAULT
)
390 , bROAutoSavePrompt( CFG_READONLY_DEFAULT
)
391 , bROUserAutoSave( CFG_READONLY_DEFAULT
)
392 , bRODocInfSave( CFG_READONLY_DEFAULT
)
393 , bROSaveWorkingSet( CFG_READONLY_DEFAULT
)
394 , bROSaveDocView( CFG_READONLY_DEFAULT
)
395 , bROSaveRelINet( CFG_READONLY_DEFAULT
)
396 , bROSaveRelFSys( CFG_READONLY_DEFAULT
)
397 , bROWarnAlienFormat( CFG_READONLY_DEFAULT
)
398 , bRODoPrettyPrinting( CFG_READONLY_DEFAULT
)
399 , bROLoadDocPrinter( CFG_READONLY_DEFAULT
)
400 , bROODFDefaultVersion( CFG_READONLY_DEFAULT
)
402 Sequence
< OUString
> aNames
= GetPropertyNames();
403 Sequence
< Any
> aValues
= GetProperties( aNames
);
404 Sequence
< sal_Bool
> aROStates
= GetReadOnlyStates( aNames
);
405 EnableNotification( aNames
);
406 const Any
* pValues
= aValues
.getConstArray();
407 const sal_Bool
* pROStates
= aROStates
.getConstArray();
408 DBG_ASSERT( aValues
.getLength() == aNames
.getLength(), "GetProperties failed" );
409 DBG_ASSERT( aROStates
.getLength() == aNames
.getLength(), "GetReadOnlyStates failed" );
410 if ( aValues
.getLength() == aNames
.getLength() && aROStates
.getLength() == aNames
.getLength() )
412 for ( int nProp
= 0; nProp
< aNames
.getLength(); nProp
++ )
414 if ( pValues
[nProp
].hasValue() )
420 // not supported anymore
424 if ( pValues
[nProp
] >>= nTemp
)
425 nAutoSaveTime
= nTemp
;
427 OSL_FAIL( "Wrong Type!" );
429 bROAutoSaveTime
= pROStates
[nProp
];
432 case ODFDEFAULTVERSION
:
435 if ( pValues
[nProp
] >>= nTmp
)
438 eODFDefaultVersion
= SvtSaveOptions::ODFVER_LATEST
;
440 eODFDefaultVersion
= SvtSaveOptions::ODFDefaultVersion( nTmp
);
443 SAL_WARN( "unotools.config", "SvtSaveOptions_Impl::SvtSaveOptions_Impl(): Wrong Type!" );
445 bROODFDefaultVersion
= pROStates
[nProp
];
452 if ( pValues
[nProp
] >>= bTemp
)
457 bUseUserData
= bTemp
;
458 bROUseUserData
= pROStates
[nProp
];
462 bROBackup
= pROStates
[nProp
];
466 bROAutoSave
= pROStates
[nProp
];
469 bAutoSavePrompt
= bTemp
;
470 bROAutoSavePrompt
= pROStates
[nProp
];
474 bRODocInfSave
= pROStates
[nProp
];
476 case SAVEWORKINGSET
:
477 bSaveWorkingSet
= bTemp
;
478 bROSaveWorkingSet
= pROStates
[nProp
];
481 bSaveDocView
= bTemp
;
482 bROSaveDocView
= pROStates
[nProp
];
485 bSaveRelFSys
= bTemp
;
486 bROSaveRelFSys
= pROStates
[nProp
];
489 bSaveRelINet
= bTemp
;
490 bROSaveRelINet
= pROStates
[nProp
];
494 bDoPrettyPrinting
= bTemp
;
495 bRODoPrettyPrinting
= pROStates
[nProp
];
498 case WARNALIENFORMAT
:
499 bWarnAlienFormat
= bTemp
;
500 bROWarnAlienFormat
= pROStates
[nProp
];
504 bLoadDocPrinter
= bTemp
;
505 bROLoadDocPrinter
= pROStates
[nProp
];
509 SAL_WARN( "unotools.config", "invalid index to load a path" );
514 OSL_FAIL( "Wrong Type!" );
522 if (!utl::ConfigManager::IsFuzzing())
524 bAutoSave
= officecfg::Office::Recovery::AutoSave::Enabled::get();
525 nAutoSaveTime
= officecfg::Office::Recovery::AutoSave::TimeIntervall::get();
526 bUserAutoSave
= officecfg::Office::Recovery::AutoSave::UserAutoSaveEnabled::get();
532 bUserAutoSave
= false;
536 void SvtSaveOptions_Impl::ImplCommit()
538 Sequence
< OUString
> aOrgNames
= GetPropertyNames();
539 OUString
* pOrgNames
= aOrgNames
.getArray();
540 sal_Int32 nOrgCount
= aOrgNames
.getLength();
542 Sequence
< OUString
> aNames( nOrgCount
);
543 Sequence
< Any
> aValues( nOrgCount
);
544 OUString
* pNames
= aNames
.getArray();
545 Any
* pValues
= aValues
.getArray();
546 sal_Int32 nRealCount
= 0;
548 for (sal_Int32 i
=0; i
<nOrgCount
; ++i
)
553 // not supported anymore
556 if (!bROAutoSaveTime
)
558 pValues
[nRealCount
] <<= nAutoSaveTime
;
559 pNames
[nRealCount
] = pOrgNames
[i
];
566 pValues
[nRealCount
] <<= bUseUserData
;
567 pNames
[nRealCount
] = pOrgNames
[i
];
574 pValues
[nRealCount
] <<= bBackup
;
575 pNames
[nRealCount
] = pOrgNames
[i
];
582 pValues
[nRealCount
] <<= bAutoSave
;
583 pNames
[nRealCount
] = pOrgNames
[i
];
588 if (!bROAutoSavePrompt
)
590 pValues
[nRealCount
] <<= bAutoSavePrompt
;
591 pNames
[nRealCount
] = pOrgNames
[i
];
598 pValues
[nRealCount
] <<= bDocInfSave
;
599 pNames
[nRealCount
] = pOrgNames
[i
];
603 case SAVEWORKINGSET
:
604 if (!bROSaveWorkingSet
)
606 pValues
[nRealCount
] <<= bSaveWorkingSet
;
607 pNames
[nRealCount
] = pOrgNames
[i
];
614 pValues
[nRealCount
] <<= bSaveDocView
;
615 pNames
[nRealCount
] = pOrgNames
[i
];
622 pValues
[nRealCount
] <<= bSaveRelFSys
;
623 pNames
[nRealCount
] = pOrgNames
[i
];
630 pValues
[nRealCount
] <<= bSaveRelINet
;
631 pNames
[nRealCount
] = pOrgNames
[i
];
636 if (!bRODoPrettyPrinting
)
638 pValues
[nRealCount
] <<= bDoPrettyPrinting
;
639 pNames
[nRealCount
] = pOrgNames
[i
];
643 case WARNALIENFORMAT
:
644 if (!bROWarnAlienFormat
)
646 pValues
[nRealCount
] <<= bWarnAlienFormat
;
647 pNames
[nRealCount
] = pOrgNames
[i
];
652 if (!bROLoadDocPrinter
)
654 pValues
[nRealCount
] <<= bLoadDocPrinter
;
655 pNames
[nRealCount
] = pOrgNames
[i
];
659 case ODFDEFAULTVERSION
:
660 if (!bROODFDefaultVersion
)
662 pValues
[nRealCount
] <<= (eODFDefaultVersion
== SvtSaveOptions::ODFVER_LATEST
) ? sal_Int16( 3 ) : sal_Int16( eODFDefaultVersion
);
663 pNames
[nRealCount
] = pOrgNames
[i
];
669 SAL_WARN( "unotools.config", "invalid index to save a path" );
673 aNames
.realloc(nRealCount
);
674 aValues
.realloc(nRealCount
);
675 PutProperties( aNames
, aValues
);
677 std::shared_ptr
< comphelper::ConfigurationChanges
> batch(
678 comphelper::ConfigurationChanges::create());
679 officecfg::Office::Recovery::AutoSave::TimeIntervall::set(nAutoSaveTime
, batch
);
680 officecfg::Office::Recovery::AutoSave::Enabled::set(bAutoSave
, batch
);
681 officecfg::Office::Recovery::AutoSave::UserAutoSaveEnabled::set(bUserAutoSave
, batch
);
685 void SvtSaveOptions_Impl::Notify( const Sequence
<OUString
>& )
689 class SvtLoadOptions_Impl
: public utl::ConfigItem
692 bool bLoadUserDefinedSettings
;
694 virtual void ImplCommit() override
;
697 SvtLoadOptions_Impl();
699 virtual void Notify( const css::uno::Sequence
< OUString
>& aPropertyNames
) override
;
701 void SetLoadUserSettings(bool b
){bLoadUserDefinedSettings
= b
; SetModified();}
702 bool IsLoadUserSettings() const {return bLoadUserDefinedSettings
;}
705 const sal_Char cUserDefinedSettings
[] = "UserDefinedSettings";
707 SvtLoadOptions_Impl::SvtLoadOptions_Impl()
708 : ConfigItem( "Office.Common/Load" )
709 , bLoadUserDefinedSettings( false )
711 Sequence
< OUString
> aNames
{ cUserDefinedSettings
};
712 Sequence
< Any
> aValues
= GetProperties( aNames
);
713 EnableNotification( aNames
);
714 const Any
* pValues
= aValues
.getConstArray();
715 DBG_ASSERT( aValues
.getLength() == aNames
.getLength(), "GetProperties failed" );
716 pValues
[0] >>= bLoadUserDefinedSettings
;
719 void SvtLoadOptions_Impl::ImplCommit()
722 {cUserDefinedSettings
}, {css::uno::Any(bLoadUserDefinedSettings
)});
725 void SvtLoadOptions_Impl::Notify( const Sequence
<OUString
>& )
727 SAL_WARN( "unotools.config", "properties have been changed" );
732 class LocalSingleton
: public rtl::Static
< osl::Mutex
, LocalSingleton
>
737 SvtSaveOptions::SvtSaveOptions()
739 // Global access, must be guarded (multithreading)
740 ::osl::MutexGuard
aGuard( LocalSingleton::get() );
743 pOptions
.reset(new SvtLoadSaveOptions_Impl
);
744 pOptions
->pSaveOpt
.reset(new SvtSaveOptions_Impl
);
745 pOptions
->pLoadOpt
.reset( new SvtLoadOptions_Impl
);
748 pImp
= pOptions
.get();
751 SvtSaveOptions::~SvtSaveOptions()
753 // Global access, must be guarded (multithreading)
754 ::osl::MutexGuard
aGuard( LocalSingleton::get() );
757 if ( pOptions
->pSaveOpt
->IsModified() )
758 pOptions
->pSaveOpt
->Commit();
759 if ( pOptions
->pLoadOpt
->IsModified() )
760 pOptions
->pLoadOpt
->Commit();
766 void SvtSaveOptions::SetAutoSaveTime( sal_Int32 n
)
768 pImp
->pSaveOpt
->SetAutoSaveTime( n
);
771 sal_Int32
SvtSaveOptions::GetAutoSaveTime() const
773 return pImp
->pSaveOpt
->GetAutoSaveTime();
776 void SvtSaveOptions::SetUseUserData( bool b
)
778 pImp
->pSaveOpt
->SetUseUserData( b
);
781 bool SvtSaveOptions::IsUseUserData() const
783 return pImp
->pSaveOpt
->IsUseUserData();
786 void SvtSaveOptions::SetBackup( bool b
)
788 pImp
->pSaveOpt
->SetBackup( b
);
791 bool SvtSaveOptions::IsBackup() const
793 return pImp
->pSaveOpt
->IsBackup();
796 void SvtSaveOptions::SetAutoSave( bool b
)
798 pImp
->pSaveOpt
->SetAutoSave( b
);
801 bool SvtSaveOptions::IsAutoSave() const
803 return pImp
->pSaveOpt
->IsAutoSave();
806 void SvtSaveOptions::SetAutoSavePrompt( bool b
)
808 pImp
->pSaveOpt
->SetAutoSavePrompt( b
);
811 bool SvtSaveOptions::IsAutoSavePrompt() const
813 return pImp
->pSaveOpt
->IsAutoSavePrompt();
816 void SvtSaveOptions::SetUserAutoSave( bool b
)
818 pImp
->pSaveOpt
->SetUserAutoSave( b
);
821 bool SvtSaveOptions::IsUserAutoSave() const
823 return pImp
->pSaveOpt
->IsUserAutoSave();
826 void SvtSaveOptions::SetDocInfoSave(bool b
)
828 pImp
->pSaveOpt
->SetDocInfoSave( b
);
831 bool SvtSaveOptions::IsDocInfoSave() const
833 return pImp
->pSaveOpt
->IsDocInfoSave();
836 void SvtSaveOptions::SetSaveWorkingSet( bool b
)
838 pImp
->pSaveOpt
->SetSaveWorkingSet( b
);
841 bool SvtSaveOptions::IsSaveWorkingSet() const
843 return pImp
->pSaveOpt
->IsSaveWorkingSet();
846 void SvtSaveOptions::SetSaveDocView( bool b
)
848 pImp
->pSaveOpt
->SetSaveDocView( b
);
851 bool SvtSaveOptions::IsSaveDocView() const
853 return pImp
->pSaveOpt
->IsSaveDocView();
856 void SvtSaveOptions::SetSaveRelINet( bool b
)
858 pImp
->pSaveOpt
->SetSaveRelINet( b
);
861 bool SvtSaveOptions::IsSaveRelINet() const
863 return pImp
->pSaveOpt
->IsSaveRelINet();
866 void SvtSaveOptions::SetSaveRelFSys( bool b
)
868 pImp
->pSaveOpt
->SetSaveRelFSys( b
);
871 bool SvtSaveOptions::IsSaveRelFSys() const
873 return pImp
->pSaveOpt
->IsSaveRelFSys();
876 void SvtSaveOptions::SetLoadUserSettings(bool b
)
878 pImp
->pLoadOpt
->SetLoadUserSettings(b
);
881 bool SvtSaveOptions::IsLoadUserSettings() const
883 return pImp
->pLoadOpt
->IsLoadUserSettings();
886 void SvtSaveOptions::SetPrettyPrinting( bool _bEnable
)
888 pImp
->pSaveOpt
->EnablePrettyPrinting( _bEnable
);
891 bool SvtSaveOptions::IsPrettyPrinting() const
893 return pImp
->pSaveOpt
->IsPrettyPrintingEnabled();
896 void SvtSaveOptions::SetWarnAlienFormat( bool _bEnable
)
898 pImp
->pSaveOpt
->SetWarnAlienFormat( _bEnable
);
901 bool SvtSaveOptions::IsWarnAlienFormat() const
903 return pImp
->pSaveOpt
->IsWarnAlienFormat();
906 void SvtSaveOptions::SetLoadDocumentPrinter( bool _bEnable
)
908 pImp
->pSaveOpt
->SetLoadDocPrinter( _bEnable
);
911 bool SvtSaveOptions::IsLoadDocumentPrinter() const
913 return pImp
->pSaveOpt
->IsLoadDocPrinter();
916 void SvtSaveOptions::SetODFDefaultVersion( SvtSaveOptions::ODFDefaultVersion eVersion
)
918 pImp
->pSaveOpt
->SetODFDefaultVersion( eVersion
);
921 SvtSaveOptions::ODFDefaultVersion
SvtSaveOptions::GetODFDefaultVersion() const
923 return pImp
->pSaveOpt
->GetODFDefaultVersion();
926 SvtSaveOptions::ODFSaneDefaultVersion
SvtSaveOptions::GetODFSaneDefaultVersion() const
928 switch (pImp
->pSaveOpt
->GetODFDefaultVersion())
931 assert(!"map new ODFDefaultVersion to ODFSaneDefaultVersion");
935 return ODFSVER_LATEST_EXTENDED
;
942 case ODFVER_012_EXT_COMPAT
:
943 return ODFSVER_012_EXT_COMPAT
;
945 return ODFSVER_LATEST_EXTENDED
;
948 bool SvtSaveOptions::IsReadOnly( SvtSaveOptions::EOption eOption
) const
950 return pImp
->pSaveOpt
->IsReadOnly(eOption
);
953 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */