convert SvtSaveOptions::EOption to scoped enum
and remove unused E_SAVEUNPACKED, E_USESHA1INODF12, E_USEBLOWFISHINODF12 enumerators Change-Id: I7c384e0c30af5091a22beeda1c77e4b71fdde55e
This commit is contained in:
@@ -392,10 +392,10 @@ void SvxSaveTabPage::Reset( const SfxItemSet* )
|
||||
SvtSaveOptions aSaveOpt;
|
||||
aLoadUserSettingsCB->Check(aSaveOpt.IsLoadUserSettings());
|
||||
aLoadUserSettingsCB->SaveValue();
|
||||
aLoadUserSettingsCB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_USEUSERDATA));
|
||||
aLoadUserSettingsCB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::EOption::UseUserData));
|
||||
aLoadDocPrinterCB->Check( aSaveOpt.IsLoadDocumentPrinter() );
|
||||
aLoadDocPrinterCB->SaveValue();
|
||||
aLoadDocPrinterCB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_LOADDOCPRINTER));
|
||||
aLoadDocPrinterCB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::EOption::LoadDocPrinter));
|
||||
|
||||
if ( !pImpl->bInitialized )
|
||||
{
|
||||
@@ -468,33 +468,33 @@ void SvxSaveTabPage::Reset( const SfxItemSet* )
|
||||
}
|
||||
|
||||
aDocInfoCB->Check(aSaveOpt.IsDocInfoSave());
|
||||
aDocInfoCB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_DOCINFSAVE));
|
||||
aDocInfoCB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::EOption::DocInfSave));
|
||||
|
||||
aBackupCB->Check(aSaveOpt.IsBackup());
|
||||
aBackupCB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_BACKUP));
|
||||
aBackupCB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::EOption::Backup));
|
||||
|
||||
aAutoSaveCB->Check(aSaveOpt.IsAutoSave());
|
||||
aAutoSaveCB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_AUTOSAVE));
|
||||
aAutoSaveCB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::EOption::AutoSave));
|
||||
|
||||
aUserAutoSaveCB->Check(aSaveOpt.IsUserAutoSave());
|
||||
aUserAutoSaveCB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_USERAUTOSAVE));
|
||||
aUserAutoSaveCB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::EOption::UserAutoSave));
|
||||
|
||||
aWarnAlienFormatCB->Check(aSaveOpt.IsWarnAlienFormat());
|
||||
aWarnAlienFormatCB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_WARNALIENFORMAT));
|
||||
aWarnAlienFormatCB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::EOption::WarnAlienFormat));
|
||||
|
||||
aAutoSaveEdit->SetValue(aSaveOpt.GetAutoSaveTime());
|
||||
aAutoSaveEdit->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_AUTOSAVETIME));
|
||||
aAutoSaveEdit->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::EOption::AutoSaveTime));
|
||||
|
||||
// save relatively
|
||||
aRelativeFsysCB->Check(aSaveOpt.IsSaveRelFSys());
|
||||
aRelativeFsysCB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_SAVERELFSYS));
|
||||
aRelativeFsysCB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::EOption::SaveRelFsys));
|
||||
|
||||
aRelativeInetCB->Check(aSaveOpt.IsSaveRelINet());
|
||||
aRelativeInetCB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_SAVERELINET));
|
||||
aRelativeInetCB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::EOption::SaveRelInet));
|
||||
|
||||
void* pDefaultVersion = reinterpret_cast<void*>( aSaveOpt.GetODFDefaultVersion() );
|
||||
aODFVersionLB->SelectEntryPos( aODFVersionLB->GetEntryPos( pDefaultVersion ) );
|
||||
aODFVersionLB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_ODFDEFAULTVERSION));
|
||||
aODFVersionLB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::EOption::OdfDefaultVersion));
|
||||
|
||||
AutoClickHdl_Impl( aAutoSaveCB );
|
||||
ODFVersionHdl_Impl( *aODFVersionLB );
|
||||
|
@@ -29,26 +29,23 @@ class UNOTOOLS_DLLPUBLIC SvtSaveOptions: public utl::detail::Options
|
||||
|
||||
public:
|
||||
|
||||
enum EOption
|
||||
enum class EOption
|
||||
{
|
||||
E_AUTOSAVETIME,
|
||||
E_USEUSERDATA,
|
||||
E_BACKUP,
|
||||
E_AUTOSAVE,
|
||||
E_AUTOSAVEPROMPT,
|
||||
E_DOCINFSAVE,
|
||||
E_SAVEWORKINGSET,
|
||||
E_SAVEDOCVIEW,
|
||||
E_SAVERELINET,
|
||||
E_SAVERELFSYS,
|
||||
E_SAVEUNPACKED,
|
||||
E_DOPRETTYPRINTING,
|
||||
E_WARNALIENFORMAT,
|
||||
E_LOADDOCPRINTER,
|
||||
E_ODFDEFAULTVERSION,
|
||||
E_USESHA1INODF12,
|
||||
E_USEBLOWFISHINODF12,
|
||||
E_USERAUTOSAVE,
|
||||
AutoSaveTime,
|
||||
UseUserData,
|
||||
Backup,
|
||||
AutoSave,
|
||||
AutoSavePrompt,
|
||||
DocInfSave,
|
||||
SaveWorkingSet,
|
||||
SaveDocView,
|
||||
SaveRelInet,
|
||||
SaveRelFsys,
|
||||
DoPrettyPrinting,
|
||||
WarnAlienFormat,
|
||||
LoadDocPrinter,
|
||||
OdfDefaultVersion,
|
||||
UserAutoSave,
|
||||
};
|
||||
|
||||
/** Keep enum values sorted that a less or greater compare maps to older
|
||||
|
@@ -158,7 +158,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
|
||||
case SID_ATTR_BACKUP :
|
||||
{
|
||||
bRet = true;
|
||||
if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_BACKUP))
|
||||
if (!aSaveOptions.IsReadOnly(SvtSaveOptions::EOption::Backup))
|
||||
if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_BACKUP ),aSaveOptions.IsBackup())))
|
||||
bRet = false;
|
||||
}
|
||||
@@ -166,7 +166,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
|
||||
case SID_ATTR_PRETTYPRINTING:
|
||||
{
|
||||
bRet = true;
|
||||
if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_DOPRETTYPRINTING))
|
||||
if (!aSaveOptions.IsReadOnly(SvtSaveOptions::EOption::DoPrettyPrinting))
|
||||
if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_PRETTYPRINTING ), aSaveOptions.IsPrettyPrinting())))
|
||||
bRet = false;
|
||||
}
|
||||
@@ -174,7 +174,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
|
||||
case SID_ATTR_WARNALIENFORMAT:
|
||||
{
|
||||
bRet = true;
|
||||
if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_WARNALIENFORMAT))
|
||||
if (!aSaveOptions.IsReadOnly(SvtSaveOptions::EOption::WarnAlienFormat))
|
||||
if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_WARNALIENFORMAT ), aSaveOptions.IsWarnAlienFormat())))
|
||||
bRet = false;
|
||||
}
|
||||
@@ -182,7 +182,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
|
||||
case SID_ATTR_AUTOSAVE :
|
||||
{
|
||||
bRet = true;
|
||||
if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_AUTOSAVE))
|
||||
if (!aSaveOptions.IsReadOnly(SvtSaveOptions::EOption::AutoSave))
|
||||
if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_AUTOSAVE ), aSaveOptions.IsAutoSave())))
|
||||
bRet = false;
|
||||
}
|
||||
@@ -190,7 +190,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
|
||||
case SID_ATTR_AUTOSAVEPROMPT :
|
||||
{
|
||||
bRet = true;
|
||||
if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_AUTOSAVEPROMPT))
|
||||
if (!aSaveOptions.IsReadOnly(SvtSaveOptions::EOption::AutoSavePrompt))
|
||||
if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_AUTOSAVEPROMPT ), aSaveOptions.IsAutoSavePrompt())))
|
||||
bRet = false;
|
||||
}
|
||||
@@ -198,7 +198,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
|
||||
case SID_ATTR_AUTOSAVEMINUTE :
|
||||
{
|
||||
bRet = true;
|
||||
if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_AUTOSAVETIME))
|
||||
if (!aSaveOptions.IsReadOnly(SvtSaveOptions::EOption::AutoSaveTime))
|
||||
if (!rSet.Put( SfxUInt16Item( rPool.GetWhich( SID_ATTR_AUTOSAVEMINUTE ), (sal_uInt16)aSaveOptions.GetAutoSaveTime())))
|
||||
bRet = false;
|
||||
}
|
||||
@@ -206,7 +206,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
|
||||
case SID_ATTR_USERAUTOSAVE :
|
||||
{
|
||||
bRet = true;
|
||||
if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_USERAUTOSAVE))
|
||||
if (!aSaveOptions.IsReadOnly(SvtSaveOptions::EOption::UserAutoSave))
|
||||
if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_USERAUTOSAVE ), aSaveOptions.IsUserAutoSave())))
|
||||
bRet = false;
|
||||
}
|
||||
@@ -214,7 +214,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
|
||||
case SID_ATTR_DOCINFO :
|
||||
{
|
||||
bRet = true;
|
||||
if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_DOCINFSAVE))
|
||||
if (!aSaveOptions.IsReadOnly(SvtSaveOptions::EOption::DocInfSave))
|
||||
if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_DOCINFO ), aSaveOptions.IsDocInfoSave())))
|
||||
bRet = false;
|
||||
}
|
||||
@@ -222,7 +222,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
|
||||
case SID_ATTR_WORKINGSET :
|
||||
{
|
||||
bRet = true;
|
||||
if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_SAVEWORKINGSET))
|
||||
if (!aSaveOptions.IsReadOnly(SvtSaveOptions::EOption::SaveWorkingSet))
|
||||
if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_WORKINGSET ), aSaveOptions.IsSaveWorkingSet())))
|
||||
bRet = false;
|
||||
}
|
||||
@@ -230,7 +230,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
|
||||
case SID_ATTR_SAVEDOCVIEW :
|
||||
{
|
||||
bRet = true;
|
||||
if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_SAVEDOCVIEW))
|
||||
if (!aSaveOptions.IsReadOnly(SvtSaveOptions::EOption::SaveDocView))
|
||||
if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_SAVEDOCVIEW ), aSaveOptions.IsSaveDocView())))
|
||||
bRet = false;
|
||||
}
|
||||
@@ -284,7 +284,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
|
||||
case SID_SAVEREL_INET :
|
||||
{
|
||||
bRet = true;
|
||||
if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_SAVERELINET))
|
||||
if (!aSaveOptions.IsReadOnly(SvtSaveOptions::EOption::SaveRelInet))
|
||||
if (!rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_SAVEREL_INET ), aSaveOptions.IsSaveRelINet() )))
|
||||
bRet = false;
|
||||
}
|
||||
@@ -292,7 +292,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
|
||||
case SID_SAVEREL_FSYS :
|
||||
{
|
||||
bRet = true;
|
||||
if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_SAVERELFSYS))
|
||||
if (!aSaveOptions.IsReadOnly(SvtSaveOptions::EOption::SaveRelFsys))
|
||||
if (!rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_SAVEREL_FSYS ), aSaveOptions.IsSaveRelFSys() )))
|
||||
bRet = false;
|
||||
}
|
||||
|
@@ -283,60 +283,51 @@ bool SvtSaveOptions_Impl::IsReadOnly( SvtSaveOptions::EOption eOption ) const
|
||||
bool bReadOnly = CFG_READONLY_DEFAULT;
|
||||
switch(eOption)
|
||||
{
|
||||
case SvtSaveOptions::E_AUTOSAVETIME :
|
||||
case SvtSaveOptions::EOption::AutoSaveTime :
|
||||
bReadOnly = bROAutoSaveTime;
|
||||
break;
|
||||
case SvtSaveOptions::E_USEUSERDATA :
|
||||
case SvtSaveOptions::EOption::UseUserData :
|
||||
bReadOnly = bROUseUserData;
|
||||
break;
|
||||
case SvtSaveOptions::E_BACKUP :
|
||||
case SvtSaveOptions::EOption::Backup :
|
||||
bReadOnly = bROBackup;
|
||||
break;
|
||||
case SvtSaveOptions::E_AUTOSAVE :
|
||||
case SvtSaveOptions::EOption::AutoSave :
|
||||
bReadOnly = bROAutoSave;
|
||||
break;
|
||||
case SvtSaveOptions::E_AUTOSAVEPROMPT :
|
||||
case SvtSaveOptions::EOption::AutoSavePrompt :
|
||||
bReadOnly = bROAutoSavePrompt;
|
||||
break;
|
||||
case SvtSaveOptions::E_USERAUTOSAVE :
|
||||
case SvtSaveOptions::EOption::UserAutoSave :
|
||||
bReadOnly = bROUserAutoSave;
|
||||
break;
|
||||
case SvtSaveOptions::E_DOCINFSAVE :
|
||||
case SvtSaveOptions::EOption::DocInfSave :
|
||||
bReadOnly = bRODocInfSave;
|
||||
break;
|
||||
case SvtSaveOptions::E_SAVEWORKINGSET :
|
||||
case SvtSaveOptions::EOption::SaveWorkingSet :
|
||||
bReadOnly = bROSaveWorkingSet;
|
||||
break;
|
||||
case SvtSaveOptions::E_SAVEDOCVIEW :
|
||||
case SvtSaveOptions::EOption::SaveDocView :
|
||||
bReadOnly = bROSaveDocView;
|
||||
break;
|
||||
case SvtSaveOptions::E_SAVERELINET :
|
||||
case SvtSaveOptions::EOption::SaveRelInet :
|
||||
bReadOnly = bROSaveRelINet;
|
||||
break;
|
||||
case SvtSaveOptions::E_SAVERELFSYS :
|
||||
case SvtSaveOptions::EOption::SaveRelFsys :
|
||||
bReadOnly = bROSaveRelFSys;
|
||||
break;
|
||||
case SvtSaveOptions::E_SAVEUNPACKED :
|
||||
bReadOnly = bROSaveUnpacked;
|
||||
break;
|
||||
case SvtSaveOptions::E_DOPRETTYPRINTING :
|
||||
case SvtSaveOptions::EOption::DoPrettyPrinting :
|
||||
bReadOnly = bRODoPrettyPrinting;
|
||||
break;
|
||||
case SvtSaveOptions::E_WARNALIENFORMAT :
|
||||
case SvtSaveOptions::EOption::WarnAlienFormat :
|
||||
bReadOnly = bROWarnAlienFormat;
|
||||
break;
|
||||
case SvtSaveOptions::E_LOADDOCPRINTER :
|
||||
case SvtSaveOptions::EOption::LoadDocPrinter :
|
||||
bReadOnly = bROLoadDocPrinter;
|
||||
break;
|
||||
case SvtSaveOptions::E_ODFDEFAULTVERSION :
|
||||
case SvtSaveOptions::EOption::OdfDefaultVersion :
|
||||
bReadOnly = bROLoadDocPrinter;
|
||||
break;
|
||||
case SvtSaveOptions::E_USESHA1INODF12:
|
||||
bReadOnly = bROUseSHA1InODF12;
|
||||
break;
|
||||
case SvtSaveOptions::E_USEBLOWFISHINODF12:
|
||||
bReadOnly = bROUseBlowfishInODF12;
|
||||
break;
|
||||
}
|
||||
return bReadOnly;
|
||||
}
|
||||
|
Reference in New Issue
Block a user