[Libreoffice-commits] core.git: 9 commits - basctl/source compilerplugins/clang cui/source desktop/source framework/source include/tools include/ucbhelper include/unotools sfx2/source sot/source svl/source svtools/source sw/source tools/source ucbhelper/source ucb/source unotools/source
Noel Grandin
noel.grandin at collabora.co.uk
Fri Feb 10 06:10:22 UTC 2017
basctl/source/basicide/moduldl2.cxx | 4
compilerplugins/clang/unusedenumconstants.py | 1
cui/source/options/optsave.cxx | 22 +--
desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx | 2
desktop/source/deployment/manager/dp_manager.cxx | 4
desktop/source/deployment/registry/component/dp_component.cxx | 4
desktop/source/deployment/registry/dp_backend.cxx | 2
desktop/source/deployment/registry/package/dp_package.cxx | 4
framework/source/fwi/classes/protocolhandlercache.cxx | 2
framework/source/services/autorecovery.cxx | 2
include/tools/poly.hxx | 4
include/ucbhelper/content.hxx | 9 -
include/unotools/configitem.hxx | 8 -
include/unotools/itemholderbase.hxx | 71 ++++------
include/unotools/saveopt.hxx | 35 ++--
sfx2/source/appl/appcfg.cxx | 24 +--
sfx2/source/doc/docfile.cxx | 14 -
sfx2/source/doc/doctemplates.cxx | 4
sfx2/source/doc/printhelper.cxx | 2
sot/source/sdstor/ucbstorage.cxx | 2
svl/source/config/cjkoptions.cxx | 2
svl/source/config/ctloptions.cxx | 2
svl/source/config/itemholder2.cxx | 8 -
svl/source/fsstor/fsstorage.cxx | 2
svtools/source/config/accessibilityoptions.cxx | 2
svtools/source/config/colorcfg.cxx | 2
svtools/source/config/fontsubstconfig.cxx | 2
svtools/source/config/helpopt.cxx | 2
svtools/source/config/itemholder2.cxx | 22 ---
svtools/source/config/menuoptions.cxx | 2
svtools/source/config/miscopt.cxx | 2
svtools/source/config/printoptions.cxx | 4
sw/source/uibase/inc/unomod.hxx | 7
sw/source/uibase/uno/SwXDocumentSettings.cxx | 2
sw/source/uibase/uno/unomod.cxx | 16 --
tools/source/generic/poly2.cxx | 14 -
tools/source/inet/inetmime.cxx | 8 -
ucb/source/core/FileAccess.cxx | 4
ucb/source/ucp/ftp/ftpcontent.cxx | 8 -
ucb/source/ucp/ftp/ftpurl.hxx | 4
ucbhelper/source/client/content.cxx | 10 -
unotools/source/config/cmdoptions.cxx | 4
unotools/source/config/compatibility.cxx | 2
unotools/source/config/configitem.cxx | 53 -------
unotools/source/config/configvaluecontainer.cxx | 28 +--
unotools/source/config/defaultoptions.cxx | 2
unotools/source/config/dynamicmenuoptions.cxx | 2
unotools/source/config/eventcfg.cxx | 4
unotools/source/config/extendedsecurityoptions.cxx | 2
unotools/source/config/fontoptions.cxx | 2
unotools/source/config/historyoptions.cxx | 2
unotools/source/config/itemholder1.cxx | 52 +++----
unotools/source/config/lingucfg.cxx | 2
unotools/source/config/misccfg.cxx | 2
unotools/source/config/moduleoptions.cxx | 2
unotools/source/config/optionsdlg.cxx | 2
unotools/source/config/pathoptions.cxx | 2
unotools/source/config/printwarningoptions.cxx | 2
unotools/source/config/saveopt.cxx | 41 ++---
unotools/source/config/securityoptions.cxx | 2
unotools/source/config/syslocaleoptions.cxx | 2
unotools/source/config/useroptions.cxx | 2
unotools/source/config/viewoptions.cxx | 16 +-
63 files changed, 218 insertions(+), 355 deletions(-)
New commits:
commit 3b536279ed8131373a2c123873e07f45c36a8684
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Fri Feb 10 08:06:31 2017 +0200
convert SwXPrintSettingsType to scoped enum
and drop read-only PRINT_SETTINGS_WEB enumerator
Change-Id: I5260b92bca2d86082bbec37569e31be9525a300e
diff --git a/sw/source/uibase/inc/unomod.hxx b/sw/source/uibase/inc/unomod.hxx
index ad83a01..c3ef5a5 100644
--- a/sw/source/uibase/inc/unomod.hxx
+++ b/sw/source/uibase/inc/unomod.hxx
@@ -64,11 +64,10 @@ public:
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
};
-enum SwXPrintSettingsType
+enum class SwXPrintSettingsType
{
- PRINT_SETTINGS_MODULE,
- PRINT_SETTINGS_WEB,
- PRINT_SETTINGS_DOCUMENT
+ Module,
+ Document
};
class SwXPrintSettings : public comphelper::ChainableHelperNoState
diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx
index 8505a31..f207b3a 100644
--- a/sw/source/uibase/uno/SwXDocumentSettings.cxx
+++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx
@@ -242,7 +242,7 @@ SwXDocumentSettings::SwXDocumentSettings ( SwXTextDocument * pModel )
, mpDoc ( nullptr )
, mpPrinter( nullptr )
{
- registerSlave ( new SwXPrintSettings ( PRINT_SETTINGS_DOCUMENT, mpModel->GetDocShell()->GetDoc() ) );
+ registerSlave ( new SwXPrintSettings ( SwXPrintSettingsType::Document, mpModel->GetDocShell()->GetDoc() ) );
}
SwXDocumentSettings::~SwXDocumentSettings()
diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx
index 4632125..3d9af06 100644
--- a/sw/source/uibase/uno/unomod.cxx
+++ b/sw/source/uibase/uno/unomod.cxx
@@ -220,7 +220,7 @@ Reference< XPropertySet > SwXModule::getPrintSettings()
if(!mxPrintSettings.is())
{
OSL_FAIL("Web or Text?");
- mxPrintSettings = static_cast < HelperBaseNoState * > ( new SwXPrintSettings ( PRINT_SETTINGS_MODULE ) );
+ mxPrintSettings = static_cast < HelperBaseNoState * > ( new SwXPrintSettings ( SwXPrintSettingsType::Module ) );
}
return mxPrintSettings;
}
@@ -259,13 +259,10 @@ void SwXPrintSettings::_preSetValues ()
{
switch (meType)
{
- case PRINT_SETTINGS_MODULE:
+ case SwXPrintSettingsType::Module:
mpPrtOpt = SW_MOD()->GetPrtOptions( false );
break;
- case PRINT_SETTINGS_WEB:
- mpPrtOpt = SW_MOD()->GetPrtOptions( true );
- break;
- case PRINT_SETTINGS_DOCUMENT:
+ case SwXPrintSettingsType::Document:
{
if (!mpDoc)
throw IllegalArgumentException ();
@@ -411,13 +408,10 @@ void SwXPrintSettings::_preGetValues()
{
switch (meType)
{
- case PRINT_SETTINGS_MODULE:
+ case SwXPrintSettingsType::Module:
mpPrtOpt = SW_MOD()->GetPrtOptions( false );
break;
- case PRINT_SETTINGS_WEB:
- mpPrtOpt = SW_MOD()->GetPrtOptions( true );
- break;
- case PRINT_SETTINGS_DOCUMENT:
+ case SwXPrintSettingsType::Document:
{
if (!mpDoc)
throw IllegalArgumentException ();
commit 6e12729f715f142140d220dc7d3b28a4a0657016
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Thu Feb 9 16:30:15 2017 +0200
remove unused enumerator from EncodedWordState
Change-Id: I793276d2b13bdb966e18acb8f13b4c7e77516898
diff --git a/compilerplugins/clang/unusedenumconstants.py b/compilerplugins/clang/unusedenumconstants.py
index df7c885..3edf02c 100755
--- a/compilerplugins/clang/unusedenumconstants.py
+++ b/compilerplugins/clang/unusedenumconstants.py
@@ -106,6 +106,7 @@ for d in definitionSet:
"include/vcl/bitmapex.hxx", # TransparentType
"vcl/inc/sft.hxx", # CompositeFlags, WidthClass, WeightClass
"vcl/inc/CommonSalLayout.hxx", # VerticalOrientation
+ "include/tools/fontenum.hxx", # part of GDI file format
# unit test code
"cppu/source/uno/check.cxx",
# general weird nonsense going on
diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx
index 0eb29f5..79cd084 100644
--- a/tools/source/inet/inetmime.cxx
+++ b/tools/source/inet/inetmime.cxx
@@ -954,7 +954,7 @@ private:
enum Coding { CODING_NONE, CODING_ENCODED, CODING_ENCODED_TERMINATED };
enum EncodedWordState { STATE_INITIAL, STATE_FIRST_EQUALS,
- STATE_FIRST_QUESTION, STATE_CHARSET,
+ STATE_CHARSET,
STATE_SECOND_QUESTION, STATE_ENCODING,
STATE_THIRD_QUESTION, STATE_ENCODED_TEXT,
STATE_FOURTH_QUESTION, STATE_SECOND_EQUALS,
@@ -1411,12 +1411,6 @@ INetMIMEEncodedWordOutputSink::WriteUInt32(sal_uInt32 nChar)
m_eEncodedWordState = STATE_BAD;
break;
- case STATE_FIRST_QUESTION:
- if (isEncodedWordTokenChar(nChar))
- m_eEncodedWordState = STATE_CHARSET;
- else
- m_eEncodedWordState = STATE_BAD;
- break;
case STATE_CHARSET:
if (nChar == '?')
commit 486d636a4d614e420980487209e53e6891f493b5
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Thu Feb 9 14:50:09 2017 +0200
remove unused enumerators from PolyClipOp
Change-Id: I0988ebbbc5fe394eaa6fead0d2f909d4a931856c
diff --git a/include/tools/poly.hxx b/include/tools/poly.hxx
index 065eb6c..4f8a6d8 100644
--- a/include/tools/poly.hxx
+++ b/include/tools/poly.hxx
@@ -192,9 +192,7 @@ private:
enum class PolyClipOp {
INTERSECT,
- UNION,
- DIFF,
- XOR
+ UNION
};
TOOLS_DLLPRIVATE void ImplDoOperation( const tools::PolyPolygon& rPolyPoly, tools::PolyPolygon& rResult, PolyClipOp nOperation ) const;
diff --git a/tools/source/generic/poly2.cxx b/tools/source/generic/poly2.cxx
index df7c515..144fe9a 100644
--- a/tools/source/generic/poly2.cxx
+++ b/tools/source/generic/poly2.cxx
@@ -339,20 +339,6 @@ void PolyPolygon::ImplDoOperation( const tools::PolyPolygon& rPolyPoly, tools::P
break;
}
- case PolyClipOp::DIFF:
- {
- // subtract B from A (DIFF)
- aMergePolyPolygonA = basegfx::tools::solvePolygonOperationDiff(aMergePolyPolygonA, aMergePolyPolygonB);
- break;
- }
-
- case PolyClipOp::XOR:
- {
- // compute XOR between poly A and B
- aMergePolyPolygonA = basegfx::tools::solvePolygonOperationXor(aMergePolyPolygonA, aMergePolyPolygonB);
- break;
- }
-
default:
case PolyClipOp::INTERSECT:
{
commit fe3c2079117e541e38dc24319bd95d6ed1c622cc
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Thu Feb 9 14:48:46 2017 +0200
remove unused enumerators from FTPErrors enum
Change-Id: I30a2cc41d246b5048f2514eb38ee8e3bef0ed41c
diff --git a/ucb/source/ucp/ftp/ftpcontent.cxx b/ucb/source/ucp/ftp/ftpcontent.cxx
index b249c6c5..89c779b 100644
--- a/ucb/source/ucp/ftp/ftpcontent.cxx
+++ b/ucb/source/ucp/ftp/ftpcontent.cxx
@@ -715,13 +715,7 @@ void FTPContent::insert(const InsertCommandArgument& aInsertCommand,
} else if(m_aInfo.Type == FTP_FOLDER)
m_aFTPURL.mkdir(bReplace);
} catch(const curl_exception& e) {
- if(e.code() == FILE_EXIST_DURING_INSERT ||
- e.code() == FOLDER_EXIST_DURING_INSERT) {
- // Deprecated, not used anymore:
- NameClashException excep;
- excep.Name = m_aFTPURL.child();
- ucbhelper::cancelCommandExecution(Any(excep), Env);
- } else if(e.code() == FOLDER_MIGHT_EXIST_DURING_INSERT ||
+ if(e.code() == FOLDER_MIGHT_EXIST_DURING_INSERT ||
e.code() == FILE_MIGHT_EXIST_DURING_INSERT) {
// Interact
Reference<XInteractionHandler> xInt;
diff --git a/ucb/source/ucp/ftp/ftpurl.hxx b/ucb/source/ucp/ftp/ftpurl.hxx
index a0bdf0a..cb56f70 100644
--- a/ucb/source/ucp/ftp/ftpurl.hxx
+++ b/ucb/source/ucp/ftp/ftpurl.hxx
@@ -46,9 +46,7 @@ namespace ftp {
class FTPContentProvider;
- enum FTPErrors { FILE_EXIST_DURING_INSERT = CURL_LAST +1,
- FOLDER_EXIST_DURING_INSERT,
- FOLDER_MIGHT_EXIST_DURING_INSERT,
+ enum FTPErrors { FOLDER_MIGHT_EXIST_DURING_INSERT = CURL_LAST,
FILE_MIGHT_EXIST_DURING_INSERT };
class malformed_exception : public std::exception { };
commit d198a8221d4a1a08bb78ad083ff28136e3f65728
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Thu Feb 9 14:47:28 2017 +0200
convert InsertOperation to scoped enum
and drop unused LINK enumerator
Change-Id: I6c42424ae5a7503b3e14e5f04fcf7a49b595b416
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 200d845..d17f912 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -1239,7 +1239,7 @@ void LibPage::ExportAsPackage( const OUString& aLibName )
::ucbhelper::Content destFolderContent( destFolder, xCmdEnv, comphelper::getProcessComponentContext() );
destFolderContent.transferContent(
- sourceContent, ::ucbhelper::InsertOperation_COPY,
+ sourceContent, ::ucbhelper::InsertOperation::Copy,
OUString(), NameClash::OVERWRITE );
INetURLObject aMetaInfInetObj( aTmpPath );
@@ -1279,7 +1279,7 @@ void LibPage::ExportAsPackage( const OUString& aLibName )
::ucbhelper::Content MetaInfContent( aMetaInfFolder, xCmdEnv, comphelper::getProcessComponentContext() );
destFolderContent.transferContent(
- MetaInfContent, ::ucbhelper::InsertOperation_COPY,
+ MetaInfContent, ::ucbhelper::InsertOperation::Copy,
OUString(), NameClash::OVERWRITE );
if( xSFA->exists( aSourcePath ) )
diff --git a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx
index 35b6aa4..0254152 100644
--- a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx
@@ -604,7 +604,7 @@ bool UpdateInstallDialog::Thread::download(OUString const & sDownloadURL, Update
const OUString sTitle( StrTitle::getTitle( sourceContent ) );
if (destFolderContent.transferContent(
- sourceContent, ::ucbhelper::InsertOperation_COPY,
+ sourceContent, ::ucbhelper::InsertOperation::Copy,
sTitle, css::ucb::NameClash::OVERWRITE ))
{
//the user may have cancelled the dialog because downloading took to long
diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx
index 09ba8fe..8b9d184 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -636,7 +636,7 @@ OUString PackageManagerImpl::insertToActivationLayer(
buf.makeStringAndClear(), xCmdEnv, m_xComponentContext );
}
if (! destFolderContent.transferContent(
- sourceContent, ::ucbhelper::InsertOperation_COPY,
+ sourceContent, ::ucbhelper::InsertOperation::Copy,
title, NameClash::OVERWRITE ))
throw RuntimeException( "UCB transferContent() failed!", nullptr );
@@ -747,7 +747,7 @@ Reference<deployment::XPackage> PackageManagerImpl::addPackage(
create_folder( &docFolderContent, m_context, xCmdEnv );
// copy into document, first:
if (! docFolderContent.transferContent(
- sourceContent, ::ucbhelper::InsertOperation_COPY,
+ sourceContent, ::ucbhelper::InsertOperation::Copy,
OUString(),
NameClash::ASK /* xxx todo: ASK not needed? */))
throw RuntimeException("UCB transferContent() failed!", nullptr );
diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx
index bc0f751..f2c1708 100644
--- a/desktop/source/deployment/registry/component/dp_component.cxx
+++ b/desktop/source/deployment/registry/component/dp_component.cxx
@@ -430,7 +430,7 @@ void BackendImpl::initServiceRdbFiles()
if (oldRDB.get().is())
{
if (! cacheDir.transferContent(
- oldRDB, ::ucbhelper::InsertOperation_COPY,
+ oldRDB, ::ucbhelper::InsertOperation::Copy,
m_commonRDB, NameClash::OVERWRITE ))
{
@@ -451,7 +451,7 @@ void BackendImpl::initServiceRdbFiles()
if (oldRDB.get().is())
{
if (! cacheDir.transferContent(
- oldRDB, ::ucbhelper::InsertOperation_COPY,
+ oldRDB, ::ucbhelper::InsertOperation::Copy,
m_nativeRDB, NameClash::OVERWRITE ))
throw RuntimeException( "UCB transferContent() failed!", nullptr );
}
diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx
index 2ef737c..0ce1449 100644
--- a/desktop/source/deployment/registry/dp_backend.cxx
+++ b/desktop/source/deployment/registry/dp_backend.cxx
@@ -545,7 +545,7 @@ void Package::exportTo(
try
{
bOk = destFolder.transferContent(
- sourceContent, ::ucbhelper::InsertOperation_COPY,
+ sourceContent, ::ucbhelper::InsertOperation::Copy,
newTitle, nameClashAction);
}
catch (const css::ucb::ContentCreationException&)
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx
index e01901c..a487ec9 100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -1033,7 +1033,7 @@ void BackendImpl::PackageImpl::exportTo(
xResultSet, UNO_QUERY_THROW )->queryContent(),
xCmdEnv, getMyBackend()->getComponentContext() );
if (! destFolderContent.transferContent(
- subContent, ::ucbhelper::InsertOperation_COPY,
+ subContent, ::ucbhelper::InsertOperation::Copy,
OUString(), ucb::NameClash::OVERWRITE ))
throw RuntimeException( "UCB transferContent() failed!",
static_cast<OWeakObject *>(this) );
@@ -1141,7 +1141,7 @@ void BackendImpl::PackageImpl::exportTo(
}
if (metainfFolderContent.transferContent(
- manifestContent, ::ucbhelper::InsertOperation_COPY,
+ manifestContent, ::ucbhelper::InsertOperation::Copy,
OUString(), ucb::NameClash::OVERWRITE ))
{
bSuccess = true;
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index 70ac2b7..1a964e5f 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -3939,7 +3939,7 @@ AutoRecovery::EFailureSafeResult AutoRecovery::implts_copyFile(const OUString& s
bool bSuccess = ::ucbhelper::Content::create(sSource, xEnvironment, m_xContext, aSourceContent);
if (!bSuccess)
return AutoRecovery::E_ORIGINAL_FILE_MISSING;
- aTargetContent.transferContent(aSourceContent, ::ucbhelper::InsertOperation_COPY, sTargetName, nNameClash);
+ aTargetContent.transferContent(aSourceContent, ::ucbhelper::InsertOperation::Copy, sTargetName, nNameClash);
}
catch(const css::uno::Exception&)
{
diff --git a/include/ucbhelper/content.hxx b/include/ucbhelper/content.hxx
index 4943fce..90a2822 100644
--- a/include/ucbhelper/content.hxx
+++ b/include/ucbhelper/content.hxx
@@ -76,12 +76,11 @@ enum ResultSetInclude
* These are the possible values for the parameter eOperation of method
* ucbhelper::Content::insertNewContent.
*/
-enum InsertOperation
+enum class InsertOperation
{
- InsertOperation_COPY, // copy source data
- InsertOperation_MOVE, // move source data
- InsertOperation_LINK, // create a link to source
- InsertOperation_CHECKIN // check-in source data
+ Copy, // copy source data
+ Move, // move source data
+ Checkin // check-in source data
};
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 01da933..8b90a7a 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -2062,12 +2062,12 @@ void SfxMedium::Transfer_Impl()
try
{
OUString aMimeType = pImpl->getFilterMimeType();
- ::ucbhelper::InsertOperation eOperation = ::ucbhelper::InsertOperation_COPY;
+ ::ucbhelper::InsertOperation eOperation = ::ucbhelper::InsertOperation::Copy;
bool bMajor = false;
OUString sComment;
if ( IsInCheckIn( ) )
{
- eOperation = ::ucbhelper::InsertOperation_CHECKIN;
+ eOperation = ::ucbhelper::InsertOperation::Checkin;
const SfxBoolItem* pMajor = SfxItemSet::GetItem<SfxBoolItem>(GetItemSet(), SID_DOCINFO_MAJOR, false);
bMajor = pMajor && pMajor->GetValue( );
const SfxStringItem* pComments = SfxItemSet::GetItem<SfxStringItem>(GetItemSet(), SID_DOCINFO_COMMENTS, false);
@@ -2088,7 +2088,7 @@ void SfxMedium::Transfer_Impl()
{
if ( GetURLObject().isAnyKnownWebDAVScheme() &&
isTransferOK &&
- eOperation == ::ucbhelper::InsertOperation_COPY )
+ eOperation == ::ucbhelper::InsertOperation::Copy )
{
// tdf#95272 try to re-issue a lock command when a new file is created.
// This may be needed because some WebDAV servers fail to implement the
@@ -2171,7 +2171,7 @@ void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalCont
{
OUString sMimeType = pImpl->getFilterMimeType();
if( aBackupCont.transferContent( aOriginalContent,
- ::ucbhelper::InsertOperation_COPY,
+ ::ucbhelper::InsertOperation::Copy,
aBackupName,
NameClash::OVERWRITE,
sMimeType ) )
@@ -2260,7 +2260,7 @@ void SfxMedium::DoBackup_Impl()
// do the transfer ( copy source file to backup dir )
OUString sMimeType = pImpl->getFilterMimeType();
bSuccess = aContent.transferContent( aSourceContent,
- ::ucbhelper::InsertOperation_COPY,
+ ::ucbhelper::InsertOperation::Copy,
aFileName,
NameClash::OVERWRITE,
sMimeType );
@@ -3407,7 +3407,7 @@ void SfxMedium::CreateTempFile( bool bReplace )
{
::ucbhelper::Content aTargetContent( aTmpURLObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ), xComEnv, comphelper::getProcessComponentContext() );
OUString sMimeType = pImpl->getFilterMimeType();
- if ( aTargetContent.transferContent( pImpl->aContent, ::ucbhelper::InsertOperation_COPY, aFileName, NameClash::OVERWRITE, sMimeType ) )
+ if ( aTargetContent.transferContent( pImpl->aContent, ::ucbhelper::InsertOperation::Copy, aFileName, NameClash::OVERWRITE, sMimeType ) )
{
SetWritableForUserOnly( aTmpURL );
bTransferSuccess = true;
@@ -3698,7 +3698,7 @@ OUString SfxMedium::CreateTempCopyWithExt( const OUString& aURL )
::ucbhelper::Content aTargetContent( aDest.GetMainURL( INetURLObject::DecodeMechanism::NONE ), xComEnv, comphelper::getProcessComponentContext() );
::ucbhelper::Content aSourceContent( aSource.GetMainURL( INetURLObject::DecodeMechanism::NONE ), xComEnv, comphelper::getProcessComponentContext() );
if ( aTargetContent.transferContent( aSourceContent,
- ::ucbhelper::InsertOperation_COPY,
+ ::ucbhelper::InsertOperation::Copy,
aFileName,
NameClash::OVERWRITE ) )
{
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index ffe67b4..0dfd449 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -1340,7 +1340,7 @@ bool SfxDocTplService_Impl::WriteUINamesForTemplateDir_Impl( const OUString& aUs
Content aTargetContent( aUserPath, maCmdEnv, comphelper::getProcessComponentContext() );
Content aSourceContent( aTempURL, maCmdEnv, comphelper::getProcessComponentContext() );
aTargetContent.transferContent( aSourceContent,
- InsertOperation_COPY,
+ InsertOperation::Copy,
"groupuinames.xml",
ucb::NameClash::OVERWRITE,
"text/xml" );
@@ -1980,7 +1980,7 @@ bool SfxDocTplService_Impl::addTemplate( const OUString& rGroupName,
try
{
if( ! aTargetGroup.transferContent( aSourceContent,
- InsertOperation_COPY,
+ InsertOperation::Copy,
aNewTemplateTargetName,
NameClash::OVERWRITE,
aType ) )
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx
index c9dbf27e..f217aa7 100644
--- a/sfx2/source/doc/printhelper.cxx
+++ b/sfx2/source/doc/printhelper.cxx
@@ -550,7 +550,7 @@ class ImplUCBPrintWatcher : public ::osl::Thread
aTarget.transferContent(
aSource,
- ::ucbhelper::InsertOperation_COPY,
+ ::ucbhelper::InsertOperation::Copy,
OUString(sFileName),
css::ucb::NameClash::OVERWRITE);
}
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index 3be2e67..8f3e27a 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -2221,7 +2221,7 @@ sal_Int16 UCBStorage_Impl::Commit()
xWriter = nullptr;
xOutputStream = nullptr;
pTempFile.reset();
- aNewSubFolder.transferContent( aSource, InsertOperation_MOVE, "manifest.xml", NameClash::OVERWRITE );
+ aNewSubFolder.transferContent( aSource, InsertOperation::Move, "manifest.xml", NameClash::OVERWRITE );
}
}
else
diff --git a/svl/source/fsstor/fsstorage.cxx b/svl/source/fsstor/fsstorage.cxx
index 9bbedd2..999a5a5 100644
--- a/svl/source/fsstor/fsstorage.cxx
+++ b/svl/source/fsstor/fsstorage.cxx
@@ -729,7 +729,7 @@ void SAL_CALL FSStorage::renameElement( const OUString& aElementName, const OUSt
::ucbhelper::Content aSourceContent( aOldURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), xDummyEnv, comphelper::getProcessComponentContext() );
if ( !GetContent()->transferContent( aSourceContent,
- ::ucbhelper::InsertOperation_MOVE,
+ ::ucbhelper::InsertOperation::Move,
aNewName,
ucb::NameClash::ERROR ) )
throw io::IOException(); // TODO: error handling
diff --git a/ucb/source/core/FileAccess.cxx b/ucb/source/core/FileAccess.cxx
index 450bafc..5cd5171 100644
--- a/ucb/source/core/FileAccess.cxx
+++ b/ucb/source/core/FileAccess.cxx
@@ -263,8 +263,8 @@ void OFileAccess::transferImpl( const OUString& rSource,
{
(void)aDestPath.transferContent(aSrc,
bMoveData
- ? ucbhelper::InsertOperation_MOVE
- : ucbhelper::InsertOperation_COPY,
+ ? ucbhelper::InsertOperation::Move
+ : ucbhelper::InsertOperation::Copy,
aName,
css::ucb::NameClash::OVERWRITE);
}
diff --git a/ucbhelper/source/client/content.cxx b/ucbhelper/source/client/content.cxx
index 34d6124..f25f56d 100644
--- a/ucbhelper/source/client/content.cxx
+++ b/ucbhelper/source/client/content.cxx
@@ -956,19 +956,15 @@ bool Content::transferContent( const Content& rSourceContent,
bool bCheckIn = false;
switch ( eOperation )
{
- case InsertOperation_COPY:
+ case InsertOperation::Copy:
eTransOp = TransferCommandOperation_COPY;
break;
- case InsertOperation_MOVE:
+ case InsertOperation::Move:
eTransOp = TransferCommandOperation_MOVE;
break;
- case InsertOperation_LINK:
- eTransOp = TransferCommandOperation_LINK;
- break;
-
- case InsertOperation_CHECKIN:
+ case InsertOperation::Checkin:
eTransOp = TransferCommandOperation_COPY;
sCommand = "checkin";
bCheckIn = true;
commit 48d3f2505e0dfbd487a1041747f16f761e9c455e
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Thu Feb 9 13:52:28 2017 +0200
convert LocationType to scoped enum
and drop unused ltAnyInstance enumerator
Change-Id: Ic471470973542ebcd3c9d0123870e70b3de6b8bb
diff --git a/unotools/source/config/configvaluecontainer.cxx b/unotools/source/config/configvaluecontainer.cxx
index 3127510..60d0cfe0 100644
--- a/unotools/source/config/configvaluecontainer.cxx
+++ b/unotools/source/config/configvaluecontainer.cxx
@@ -34,18 +34,16 @@ namespace utl
//= NodeValueAccessor
- enum LocationType
+ enum class LocationType
{
- ltSimplyObjectInstance,
- ltAnyInstance,
-
- ltUnbound
+ SimplyObjectInstance,
+ Unbound
};
struct NodeValueAccessor
{
private:
- OUString sRelativePath; // the relative path of the node
+ OUString sRelativePath; // the relative path of the node
LocationType eLocationType; // the type of location where the value is stored
void* pLocation; // the pointer to the location
Type aDataType; // the type object pointed to by pLocation
@@ -55,7 +53,7 @@ namespace utl
void bind( void* _pLocation, const Type& _rType );
- bool isBound( ) const { return ( ltUnbound != eLocationType ) && ( nullptr != pLocation ); }
+ bool isBound( ) const { return ( LocationType::Unbound != eLocationType ) && ( nullptr != pLocation ); }
const OUString& getPath( ) const { return sRelativePath; }
LocationType getLocType( ) const { return eLocationType; }
void* getLocation( ) const { return pLocation; }
@@ -66,7 +64,7 @@ namespace utl
NodeValueAccessor::NodeValueAccessor( const OUString& _rNodePath )
:sRelativePath( _rNodePath )
- ,eLocationType( ltUnbound )
+ ,eLocationType( LocationType::Unbound )
,pLocation( nullptr )
{
}
@@ -82,7 +80,7 @@ namespace utl
{
SAL_WARN_IF(isBound(), "unotools.config", "NodeValueAccessor::bind: already bound!");
- eLocationType = ltSimplyObjectInstance;
+ eLocationType = LocationType::SimplyObjectInstance;
pLocation = _pLocation;
aDataType = _rType;
}
@@ -97,7 +95,7 @@ namespace utl
SAL_WARN_IF(!_rAccessor.isBound(), "unotools.config", "::utl::lcl_copyData: invalid accessor!");
switch ( _rAccessor.getLocType() )
{
- case ltSimplyObjectInstance:
+ case LocationType::SimplyObjectInstance:
{
if ( _rData.hasValue() )
{
@@ -115,10 +113,6 @@ namespace utl
}
}
break;
- case ltAnyInstance:
- // a simple assignment of an Any ...
- *static_cast< Any* >( _rAccessor.getLocation() ) = _rData;
- break;
default:
break;
}
@@ -134,15 +128,11 @@ namespace utl
SAL_WARN_IF(!_rAccessor.isBound(), "unotools.config", "::utl::lcl_copyData: invalid accessor!" );
switch ( _rAccessor.getLocType() )
{
- case ltSimplyObjectInstance:
+ case LocationType::SimplyObjectInstance:
// a simple setValue ....
_rData.setValue( _rAccessor.getLocation(), _rAccessor.getDataType() );
break;
- case ltAnyInstance:
- // a simple assignment of an Any ...
- _rData = *static_cast< Any* >( _rAccessor.getLocation() );
- break;
default:
break;
}
commit f4a9ba4b484480ddacc62a47f68b02e449d72880
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Thu Feb 9 13:50:39 2017 +0200
convert ConfigNameFormat to scoped enum
and drop unused constants
CONFIG_NAME_PLAINTEXT_NAME
CONFIG_NAME_FULL_PATH
Change-Id: Ibf7e88da0ae54516cb863b8efa995201f2a95268
diff --git a/framework/source/fwi/classes/protocolhandlercache.cxx b/framework/source/fwi/classes/protocolhandlercache.cxx
index dc7c3b4..0837083 100644
--- a/framework/source/fwi/classes/protocolhandlercache.cxx
+++ b/framework/source/fwi/classes/protocolhandlercache.cxx
@@ -201,7 +201,7 @@ void HandlerCFGAccess::read( HandlerHash** ppHandler ,
PatternHash** ppPattern )
{
// list of all uno implementation names without encoding
- css::uno::Sequence< OUString > lNames = GetNodeNames( SETNAME_HANDLER, ::utl::CONFIG_NAME_LOCAL_PATH );
+ css::uno::Sequence< OUString > lNames = GetNodeNames( SETNAME_HANDLER, ::utl::ConfigNameFormat::LocalPath );
sal_Int32 nSourceCount = lNames.getLength();
sal_Int32 nTargetCount = nSourceCount;
// list of all full qualified path names of configuration entries
diff --git a/include/unotools/configitem.hxx b/include/unotools/configitem.hxx
index 54a57d8..41c8b62 100644
--- a/include/unotools/configitem.hxx
+++ b/include/unotools/configitem.hxx
@@ -58,12 +58,10 @@ namespace o3tl
namespace utl
{
- enum ConfigNameFormat
+ enum class ConfigNameFormat
{
- CONFIG_NAME_PLAINTEXT_NAME, // unescaped local node name, for user display etc.
- CONFIG_NAME_LOCAL_NAME, // local node name, for use in XNameAccess etc. ("Item", "Q & A")
- CONFIG_NAME_LOCAL_PATH, // one-level relative path, for use when building paths etc. ("Item", "Typ['Q & A']")
- CONFIG_NAME_FULL_PATH // full absolute path. ("/org.openoffice.Sample/Group/Item", "/org.openoffice.Sample/Set/Typ['Q & A']")
+ LocalNode, // local node name, for use in XNameAccess etc. ("Item", "Q & A")
+ LocalPath, // one-level relative path, for use when building paths etc. ("Item", "Typ['Q & A']")
};
class ConfigChangeListener_Impl;
diff --git a/svtools/source/config/fontsubstconfig.cxx b/svtools/source/config/fontsubstconfig.cxx
index bb4533f..a9b42a6 100644
--- a/svtools/source/config/fontsubstconfig.cxx
+++ b/svtools/source/config/fontsubstconfig.cxx
@@ -59,7 +59,7 @@ SvtFontSubstConfig::SvtFontSubstConfig() :
bIsEnabled = *o3tl::doAccess<bool>(aValues.getConstArray()[0]);
OUString sPropPrefix(cFontPairs);
- Sequence<OUString> aNodeNames = GetNodeNames(sPropPrefix, CONFIG_NAME_LOCAL_PATH);
+ Sequence<OUString> aNodeNames = GetNodeNames(sPropPrefix, ConfigNameFormat::LocalPath);
const OUString* pNodeNames = aNodeNames.getConstArray();
Sequence<OUString> aPropNames(aNodeNames.getLength() * 4);
OUString* pNames = aPropNames.getArray();
diff --git a/unotools/source/config/cmdoptions.cxx b/unotools/source/config/cmdoptions.cxx
index ff2f644..b569e12 100644
--- a/unotools/source/config/cmdoptions.cxx
+++ b/unotools/source/config/cmdoptions.cxx
@@ -276,7 +276,7 @@ void SvtCommandOptions_Impl::EstablishFrameCallback(const css::uno::Reference< c
Sequence< OUString > SvtCommandOptions_Impl::impl_GetPropertyNames()
{
// First get ALL names of current existing list items in configuration!
- Sequence< OUString > lDisabledItems = GetNodeNames( SETNODE_DISABLED, utl::CONFIG_NAME_LOCAL_PATH );
+ Sequence< OUString > lDisabledItems = GetNodeNames( SETNODE_DISABLED, utl::ConfigNameFormat::LocalPath );
// Expand all keys
for (sal_Int32 i=0; i<lDisabledItems.getLength(); ++i )
diff --git a/unotools/source/config/configitem.cxx b/unotools/source/config/configitem.cxx
index ae468e7..1de221b 100644
--- a/unotools/source/config/configitem.cxx
+++ b/unotools/source/config/configitem.cxx
@@ -575,37 +575,11 @@ static void lcl_normalizeLocalNames(Sequence< OUString >& _rNames, ConfigNameFor
{
switch (_eFormat)
{
- case CONFIG_NAME_LOCAL_NAME:
+ case ConfigNameFormat::LocalNode:
// unaltered - this is our input format
break;
- case CONFIG_NAME_FULL_PATH:
- {
- Reference<XHierarchicalName> xFormatter(_xParentNode, UNO_QUERY);
- if (xFormatter.is())
- {
- OUString * pNames = _rNames.getArray();
- for(int i = 0; i<_rNames.getLength(); ++i)
- {
- try
- {
- pNames[i] = xFormatter->composeHierarchicalName(pNames[i]);
- }
- catch (css::uno::Exception & e)
- {
- SAL_WARN(
- "unotools.config",
- "Exception from composeHierarchicalName(): "
- << e.Message);
- }
- }
- break;
- }
- }
- OSL_FAIL("Cannot create absolute paths: missing interface");
- SAL_FALLTHROUGH; // make local paths instaed
-
- case CONFIG_NAME_LOCAL_PATH:
+ case ConfigNameFormat::LocalPath:
{
Reference<XTemplateContainer> xTypeContainer(_xParentNode, UNO_QUERY);
if (xTypeContainer.is())
@@ -634,33 +608,12 @@ static void lcl_normalizeLocalNames(Sequence< OUString >& _rNames, ConfigNameFor
}
break;
- case CONFIG_NAME_PLAINTEXT_NAME:
- {
- Reference<XStringEscape> xEscaper(_xParentNode, UNO_QUERY);
- if (xEscaper.is())
- {
- OUString * pNames = _rNames.getArray();
- for(int i = 0; i<_rNames.getLength(); ++i)
- try
- {
- pNames[i] = xEscaper->unescapeString(pNames[i]);
- }
- catch (css::uno::Exception & e)
- {
- SAL_WARN(
- "unotools.config",
- "Exception from unescapeString(): " << e.Message);
- }
- }
- }
- break;
-
}
}
Sequence< OUString > ConfigItem::GetNodeNames(const OUString& rNode)
{
- ConfigNameFormat const eDefaultFormat = CONFIG_NAME_LOCAL_NAME; // CONFIG_NAME_DEFAULT;
+ ConfigNameFormat const eDefaultFormat = ConfigNameFormat::LocalNode; // CONFIG_NAME_DEFAULT;
return GetNodeNames(rNode, eDefaultFormat);
}
diff --git a/unotools/source/config/eventcfg.cxx b/unotools/source/config/eventcfg.cxx
index 138df08..998c431 100644
--- a/unotools/source/config/eventcfg.cxx
+++ b/unotools/source/config/eventcfg.cxx
@@ -201,7 +201,7 @@ void GlobalEventConfig_Impl::ImplCommit()
void GlobalEventConfig_Impl::initBindingInfo()
{
// Get ALL names of current existing list items in configuration!
- Sequence< OUString > lEventNames = GetNodeNames( SETNODE_BINDINGS, utl::CONFIG_NAME_LOCAL_PATH );
+ Sequence< OUString > lEventNames = GetNodeNames( SETNODE_BINDINGS, utl::ConfigNameFormat::LocalPath );
OUString aSetNode( SETNODE_BINDINGS );
aSetNode += PATHDELIMITER;
commit cc96c1fdc1b62f8b61567f5df63e892953c87f10
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Thu Feb 9 12:36:22 2017 +0200
convert EItem to scoped enum
and drop read-only enumerators:
enum EItem E_APEARCFG
enum EItem E_FLTRCFG
enum EItem E_FONTSUBSTCONFIG
enum EItem E_LANGUAGEOPTIONS
enum EItem E_SEARCHOPT
Change-Id: Ie3baaecec3d1c30404b4fb0d948e25d4bb2f3f93
diff --git a/include/unotools/itemholderbase.hxx b/include/unotools/itemholderbase.hxx
index b8b075c..13a11f7 100644
--- a/include/unotools/itemholderbase.hxx
+++ b/include/unotools/itemholderbase.hxx
@@ -30,63 +30,58 @@ struct ItemHolderMutexBase
::osl::Mutex m_aLock;
};
-enum EItem
+enum class EItem
{
- E_ACCESSIBILITYOPTIONS , // 2
- E_APEARCFG , // 2
+ AccessibilityOptions , // 2
- E_CJKOPTIONS , // 2
- E_CMDOPTIONS ,
- E_COLORCFG , // 2
- E_COMPATIBILITY ,
- E_CTLOPTIONS , // 2
+ CJKOptions , // 2
+ CmdOptions ,
+ ColorConfig , // 2
+ Compatibility ,
+ CTLOptions , // 2
- E_DEFAULTOPTIONS ,
- E_DYNAMICMENUOPTIONS ,
+ DefaultOptions ,
+ DynamicMenuOptions ,
- E_EVENTCFG ,
- E_EXTENDEDSECURITYOPTIONS ,
+ EventConfig ,
+ ExtendedSecurityOptions ,
- E_FLTRCFG ,
- E_FONTOPTIONS ,
- E_FONTSUBSTCONFIG , // 2
+ FontOptions ,
- E_HELPOPTIONS , // 2
- E_HISTORYOPTIONS ,
+ HelpOptions , // 2
+ HistoryOptions ,
- E_LANGUAGEOPTIONS , // 2
- E_LINGUCFG ,
+ LinguConfig ,
- E_MENUOPTIONS ,
- E_MISCCFG , // 2
- E_MISCOPTIONS ,
- E_MODULEOPTIONS ,
+ MenuOptions ,
+ MiscConfig , // 2
+ MiscOptions ,
+ ModuleOptions ,
- E_OPTIONSDLGOPTIONS ,
+ OptionsDialogOptions ,
- E_PATHOPTIONS ,
- E_PRINTOPTIONS , // 2
- E_PRINTFILEOPTIONS , // 2
- E_PRINTWARNINGOPTIONS ,
+ PathOptions ,
+ PrintOptions , // 2
+ PrintFileOptions , // 2
+ PrintWarningOptions ,
- E_SAVEOPTIONS ,
- E_SEARCHOPT ,
- E_SECURITYOPTIONS ,
- E_SYSLOCALEOPTIONS , // 2
+ SaveOptions ,
+ SecurityOptions ,
+ SysLocaleOptions , // 2
- E_USEROPTIONS , // 2
+ UserOptions , // 2
- E_VIEWOPTIONS_DIALOG ,
- E_VIEWOPTIONS_TABDIALOG ,
- E_VIEWOPTIONS_TABPAGE ,
- E_VIEWOPTIONS_WINDOW
+ ViewOptionsDialog ,
+ ViewOptionsTabDialog ,
+ ViewOptionsTabPage ,
+ ViewOptionsWindow
};
struct TItemInfo
{
TItemInfo()
: pItem(nullptr)
- , eItem(E_USEROPTIONS)
+ , eItem(EItem::UserOptions)
{
}
diff --git a/svl/source/config/cjkoptions.cxx b/svl/source/config/cjkoptions.cxx
index c1dede9..405e8b9 100644
--- a/svl/source/config/cjkoptions.cxx
+++ b/svl/source/config/cjkoptions.cxx
@@ -389,7 +389,7 @@ SvtCJKOptions::SvtCJKOptions(bool bDontLoad)
{
pImpl = std::make_shared<SvtCJKOptions_Impl>();
g_pCJKOptions = pImpl;
- ItemHolder2::holdConfigItem(E_CJKOPTIONS);
+ ItemHolder2::holdConfigItem(EItem::CJKOptions);
}
if( !bDontLoad && !pImpl->IsLoaded())
diff --git a/svl/source/config/ctloptions.cxx b/svl/source/config/ctloptions.cxx
index 3160af3..c4fffc50 100644
--- a/svl/source/config/ctloptions.cxx
+++ b/svl/source/config/ctloptions.cxx
@@ -354,7 +354,7 @@ SvtCTLOptions::SvtCTLOptions( bool bDontLoad )
{
m_pImpl = std::make_shared<SvtCTLOptions_Impl>();
g_pCTLOptions = m_pImpl;
- ItemHolder2::holdConfigItem(E_CTLOPTIONS);
+ ItemHolder2::holdConfigItem(EItem::CTLOptions);
}
if( !bDontLoad && !m_pImpl->IsLoaded() )
diff --git a/svl/source/config/itemholder2.cxx b/svl/source/config/itemholder2.cxx
index 27344aa..fc12e76 100644
--- a/svl/source/config/itemholder2.cxx
+++ b/svl/source/config/itemholder2.cxx
@@ -118,18 +118,14 @@ void ItemHolder2::impl_newItem(TItemInfo& rItem)
{
switch(rItem.eItem)
{
- case E_CJKOPTIONS :
+ case EItem::CJKOptions :
rItem.pItem = new SvtCJKOptions();
break;
- case E_CTLOPTIONS :
+ case EItem::CTLOptions :
rItem.pItem = new SvtCTLOptions();
break;
- case E_LANGUAGEOPTIONS :
-// capsulate CTL and CJL options ! rItem.pItem = new SvtLanguageOptions();
- break;
-
default:
OSL_ASSERT(false);
break;
diff --git a/svtools/source/config/accessibilityoptions.cxx b/svtools/source/config/accessibilityoptions.cxx
index 5c2fc33..3b9873d 100644
--- a/svtools/source/config/accessibilityoptions.cxx
+++ b/svtools/source/config/accessibilityoptions.cxx
@@ -363,7 +363,7 @@ SvtAccessibilityOptions::SvtAccessibilityOptions()
if(!sm_pSingleImplConfig)
{
sm_pSingleImplConfig = new SvtAccessibilityOptions_Impl;
- svtools::ItemHolder2::holdConfigItem(E_ACCESSIBILITYOPTIONS);
+ svtools::ItemHolder2::holdConfigItem(EItem::AccessibilityOptions);
}
++sm_nAccessibilityRefCount;
}
diff --git a/svtools/source/config/colorcfg.cxx b/svtools/source/config/colorcfg.cxx
index 73a7339..02389dd 100644
--- a/svtools/source/config/colorcfg.cxx
+++ b/svtools/source/config/colorcfg.cxx
@@ -376,7 +376,7 @@ ColorConfig::ColorConfig()
if ( !m_pImpl )
{
m_pImpl = new ColorConfig_Impl;
- svtools::ItemHolder2::holdConfigItem(E_COLORCFG);
+ svtools::ItemHolder2::holdConfigItem(EItem::ColorConfig);
}
++nColorRefCount_Impl;
m_pImpl->AddListener(this);
diff --git a/svtools/source/config/helpopt.cxx b/svtools/source/config/helpopt.cxx
index b3d9384..3f34fa1 100644
--- a/svtools/source/config/helpopt.cxx
+++ b/svtools/source/config/helpopt.cxx
@@ -266,7 +266,7 @@ SvtHelpOptions::SvtHelpOptions()
{
pImpl = std::make_shared<SvtHelpOptions_Impl>();
g_pHelpOptions = pImpl;
- svtools::ItemHolder2::holdConfigItem(E_HELPOPTIONS);
+ svtools::ItemHolder2::holdConfigItem(EItem::HelpOptions);
}
}
diff --git a/svtools/source/config/itemholder2.cxx b/svtools/source/config/itemholder2.cxx
index 81cc656..638120c 100644
--- a/svtools/source/config/itemholder2.cxx
+++ b/svtools/source/config/itemholder2.cxx
@@ -133,39 +133,31 @@ void ItemHolder2::impl_newItem(TItemInfo& rItem)
{
switch(rItem.eItem)
{
- case E_ACCESSIBILITYOPTIONS :
+ case EItem::AccessibilityOptions :
rItem.pItem = new SvtAccessibilityOptions();
break;
- case E_APEARCFG :
-// no ref count rItem.pItem = new SvtTabAppearanceCfg();
- break;
-
- case E_COLORCFG :
+ case EItem::ColorConfig :
rItem.pItem = new ::svtools::ColorConfig();
break;
- case E_FONTSUBSTCONFIG :
-// no ref count rItem.pItem = new SvtFontSubstConfig();
- break;
-
- case E_HELPOPTIONS :
+ case EItem::HelpOptions :
rItem.pItem = new SvtHelpOptions();
break;
- case E_MENUOPTIONS :
+ case EItem::MenuOptions :
rItem.pItem = new SvtMenuOptions();
break;
- case E_PRINTOPTIONS :
+ case EItem::PrintOptions :
rItem.pItem = new SvtPrinterOptions();
break;
- case E_PRINTFILEOPTIONS :
+ case EItem::PrintFileOptions :
rItem.pItem = new SvtPrintFileOptions();
break;
- case E_MISCOPTIONS :
+ case EItem::MiscOptions :
rItem.pItem = new SvtMiscOptions();
break;
diff --git a/svtools/source/config/menuoptions.cxx b/svtools/source/config/menuoptions.cxx
index d006325..cc8b64b 100644
--- a/svtools/source/config/menuoptions.cxx
+++ b/svtools/source/config/menuoptions.cxx
@@ -358,7 +358,7 @@ SvtMenuOptions::SvtMenuOptions()
{
m_pImpl = std::make_shared<SvtMenuOptions_Impl>();
g_pMenuOptions = m_pImpl;
- svtools::ItemHolder2::holdConfigItem(E_MENUOPTIONS);
+ svtools::ItemHolder2::holdConfigItem(EItem::MenuOptions);
}
}
diff --git a/svtools/source/config/miscopt.cxx b/svtools/source/config/miscopt.cxx
index e0cc26f..f7e4e98 100644
--- a/svtools/source/config/miscopt.cxx
+++ b/svtools/source/config/miscopt.cxx
@@ -754,7 +754,7 @@ SvtMiscOptions::SvtMiscOptions()
{
m_pImpl = std::make_shared<SvtMiscOptions_Impl>();
g_pMiscOptions = m_pImpl;
- svtools::ItemHolder2::holdConfigItem(E_MISCOPTIONS);
+ svtools::ItemHolder2::holdConfigItem(EItem::MiscOptions);
}
}
diff --git a/svtools/source/config/printoptions.cxx b/svtools/source/config/printoptions.cxx
index 34f2bb9..be4a736 100644
--- a/svtools/source/config/printoptions.cxx
+++ b/svtools/source/config/printoptions.cxx
@@ -721,7 +721,7 @@ SvtPrinterOptions::SvtPrinterOptions()
OUString aRootPath( ROOTNODE_START );
m_pStaticDataContainer = new SvtPrintOptions_Impl( aRootPath += "/Printer" );
pPrinterOptionsDataContainer = m_pStaticDataContainer;
- svtools::ItemHolder2::holdConfigItem(E_PRINTOPTIONS);
+ svtools::ItemHolder2::holdConfigItem(EItem::PrintOptions);
}
SetDataContainer( m_pStaticDataContainer );
@@ -756,7 +756,7 @@ SvtPrintFileOptions::SvtPrintFileOptions()
m_pStaticDataContainer = new SvtPrintOptions_Impl( aRootPath += "/File" );
pPrintFileOptionsDataContainer = m_pStaticDataContainer;
- svtools::ItemHolder2::holdConfigItem(E_PRINTFILEOPTIONS);
+ svtools::ItemHolder2::holdConfigItem(EItem::PrintFileOptions);
}
SetDataContainer( m_pStaticDataContainer );
diff --git a/unotools/source/config/cmdoptions.cxx b/unotools/source/config/cmdoptions.cxx
index 91b62a5..ff2f644 100644
--- a/unotools/source/config/cmdoptions.cxx
+++ b/unotools/source/config/cmdoptions.cxx
@@ -305,7 +305,7 @@ SvtCommandOptions::SvtCommandOptions()
{
m_pImpl = std::make_shared<SvtCommandOptions_Impl>();
g_pCommandOptions = m_pImpl;
- ItemHolder1::holdConfigItem(E_CMDOPTIONS);
+ ItemHolder1::holdConfigItem(EItem::CmdOptions);
}
}
diff --git a/unotools/source/config/compatibility.cxx b/unotools/source/config/compatibility.cxx
index f576790..d96947c 100644
--- a/unotools/source/config/compatibility.cxx
+++ b/unotools/source/config/compatibility.cxx
@@ -321,7 +321,7 @@ SvtCompatibilityOptions::SvtCompatibilityOptions()
{
m_pImpl = std::make_shared<SvtCompatibilityOptions_Impl>();
theOptions = m_pImpl;
- ItemHolder1::holdConfigItem( E_COMPATIBILITY );
+ ItemHolder1::holdConfigItem( EItem::Compatibility );
}
}
diff --git a/unotools/source/config/defaultoptions.cxx b/unotools/source/config/defaultoptions.cxx
index 160df5f..47f1ce5 100644
--- a/unotools/source/config/defaultoptions.cxx
+++ b/unotools/source/config/defaultoptions.cxx
@@ -335,7 +335,7 @@ SvtDefaultOptions::SvtDefaultOptions()
{
pImpl = std::make_shared<SvtDefaultOptions_Impl>();
g_pOptions = pImpl;
- ItemHolder1::holdConfigItem(E_DEFAULTOPTIONS);
+ ItemHolder1::holdConfigItem(EItem::DefaultOptions);
}
}
diff --git a/unotools/source/config/dynamicmenuoptions.cxx b/unotools/source/config/dynamicmenuoptions.cxx
index fefc920..f0337ad 100644
--- a/unotools/source/config/dynamicmenuoptions.cxx
+++ b/unotools/source/config/dynamicmenuoptions.cxx
@@ -581,7 +581,7 @@ SvtDynamicMenuOptions::SvtDynamicMenuOptions()
{
m_pImpl = std::make_shared<SvtDynamicMenuOptions_Impl>();
g_pDynamicMenuOptions = m_pImpl;
- ItemHolder1::holdConfigItem(E_DYNAMICMENUOPTIONS);
+ ItemHolder1::holdConfigItem(EItem::DynamicMenuOptions);
}
}
diff --git a/unotools/source/config/eventcfg.cxx b/unotools/source/config/eventcfg.cxx
index 0965269..138df08 100644
--- a/unotools/source/config/eventcfg.cxx
+++ b/unotools/source/config/eventcfg.cxx
@@ -328,7 +328,7 @@ GlobalEventConfig::GlobalEventConfig()
if( m_pImpl == nullptr )
{
m_pImpl = new GlobalEventConfig_Impl;
- ItemHolder1::holdConfigItem(E_EVENTCFG);
+ ItemHolder1::holdConfigItem(EItem::EventConfig);
}
}
diff --git a/unotools/source/config/extendedsecurityoptions.cxx b/unotools/source/config/extendedsecurityoptions.cxx
index 1e3b823..fccc785 100644
--- a/unotools/source/config/extendedsecurityoptions.cxx
+++ b/unotools/source/config/extendedsecurityoptions.cxx
@@ -255,7 +255,7 @@ SvtExtendedSecurityOptions::SvtExtendedSecurityOptions()
{
m_pImpl = std::make_shared<SvtExtendedSecurityOptions_Impl>();
g_pExtendedSecurityOptions = m_pImpl;
- ItemHolder1::holdConfigItem(E_EXTENDEDSECURITYOPTIONS);
+ ItemHolder1::holdConfigItem(EItem::ExtendedSecurityOptions);
}
}
diff --git a/unotools/source/config/fontoptions.cxx b/unotools/source/config/fontoptions.cxx
index fef4dde..194dff8 100644
--- a/unotools/source/config/fontoptions.cxx
+++ b/unotools/source/config/fontoptions.cxx
@@ -259,7 +259,7 @@ SvtFontOptions::SvtFontOptions()
{
m_pImpl = std::make_shared<SvtFontOptions_Impl>();
g_pFontOptions = m_pImpl;
- ItemHolder1::holdConfigItem(E_FONTOPTIONS);
+ ItemHolder1::holdConfigItem(EItem::FontOptions);
}
}
diff --git a/unotools/source/config/historyoptions.cxx b/unotools/source/config/historyoptions.cxx
index 759e7b4..45cce2a 100644
--- a/unotools/source/config/historyoptions.cxx
+++ b/unotools/source/config/historyoptions.cxx
@@ -527,7 +527,7 @@ SvtHistoryOptions::SvtHistoryOptions()
{
m_pImpl = std::make_shared<SvtHistoryOptions_Impl>();
g_pHistoryOptions = m_pImpl;
- ItemHolder1::holdConfigItem(E_HISTORYOPTIONS);
+ ItemHolder1::holdConfigItem(EItem::HistoryOptions);
}
}
diff --git a/unotools/source/config/itemholder1.cxx b/unotools/source/config/itemholder1.cxx
index 76e0643..d8c9af0 100644
--- a/unotools/source/config/itemholder1.cxx
+++ b/unotools/source/config/itemholder1.cxx
@@ -133,99 +133,91 @@ void ItemHolder1::impl_newItem(TItemInfo& rItem)
{
switch(rItem.eItem)
{
- case E_CMDOPTIONS :
+ case EItem::CmdOptions :
rItem.pItem = new SvtCommandOptions();
break;
- case E_COMPATIBILITY :
+ case EItem::Compatibility :
rItem.pItem = new SvtCompatibilityOptions();
break;
- case E_DEFAULTOPTIONS :
+ case EItem::DefaultOptions :
rItem.pItem = new SvtDefaultOptions();
break;
- case E_DYNAMICMENUOPTIONS :
+ case EItem::DynamicMenuOptions :
rItem.pItem = new SvtDynamicMenuOptions();
break;
- case E_EVENTCFG :
+ case EItem::EventConfig :
//rItem.pItem = new GlobalEventConfig();
break;
- case E_EXTENDEDSECURITYOPTIONS :
+ case EItem::ExtendedSecurityOptions :
rItem.pItem = new SvtExtendedSecurityOptions();
break;
- case E_FLTRCFG :
-// no ref count rItem.pItem = new SvtFilterOptions();
- break;
-
- case E_FONTOPTIONS :
+ case EItem::FontOptions :
rItem.pItem = new SvtFontOptions();
break;
- case E_HISTORYOPTIONS :
+ case EItem::HistoryOptions :
rItem.pItem = new SvtHistoryOptions();
break;
- case E_LINGUCFG :
+ case EItem::LinguConfig :
rItem.pItem = new SvtLinguConfig();
break;
- case E_MODULEOPTIONS :
+ case EItem::ModuleOptions :
rItem.pItem = new SvtModuleOptions();
break;
- case E_OPTIONSDLGOPTIONS :
+ case EItem::OptionsDialogOptions :
rItem.pItem = new SvtOptionsDialogOptions();
break;
- case E_PATHOPTIONS :
+ case EItem::PathOptions :
rItem.pItem = new SvtPathOptions();
break;
- case E_PRINTWARNINGOPTIONS :
+ case EItem::PrintWarningOptions :
rItem.pItem = new SvtPrintWarningOptions();
break;
- case E_MISCCFG :
+ case EItem::MiscConfig :
rItem.pItem = new ::utl::MiscCfg();
break;
- case E_SAVEOPTIONS :
+ case EItem::SaveOptions :
rItem.pItem = new SvtSaveOptions();
break;
- case E_SEARCHOPT :
-// no ref count rItem.pItem = new SvtSearchOptions();
- break;
-
- case E_SECURITYOPTIONS :
+ case EItem::SecurityOptions :
rItem.pItem = new SvtSecurityOptions();
break;
- case E_VIEWOPTIONS_DIALOG :
+ case EItem::ViewOptionsDialog :
rItem.pItem = new SvtViewOptions(E_DIALOG, OUString());
break;
- case E_VIEWOPTIONS_TABDIALOG :
+ case EItem::ViewOptionsTabDialog :
rItem.pItem = new SvtViewOptions(E_TABDIALOG, OUString());
break;
- case E_VIEWOPTIONS_TABPAGE :
+ case EItem::ViewOptionsTabPage :
rItem.pItem = new SvtViewOptions(E_TABPAGE, OUString());
break;
- case E_VIEWOPTIONS_WINDOW :
+ case EItem::ViewOptionsWindow :
rItem.pItem = new SvtViewOptions(E_WINDOW, OUString());
break;
- case E_USEROPTIONS :
+ case EItem::UserOptions :
rItem.pItem = new SvtUserOptions();
break;
- case E_SYSLOCALEOPTIONS :
+ case EItem::SysLocaleOptions :
rItem.pItem = new SvtSysLocaleOptions();
break;
diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx
index f89ae28..95f64c1 100644
--- a/unotools/source/config/lingucfg.cxx
+++ b/unotools/source/config/lingucfg.cxx
@@ -809,7 +809,7 @@ SvtLinguConfigItem & SvtLinguConfig::GetConfigItem()
if (!pCfgItem)
{
pCfgItem = new SvtLinguConfigItem;
- ItemHolder1::holdConfigItem(E_LINGUCFG);
+ ItemHolder1::holdConfigItem(EItem::LinguConfig);
}
return *pCfgItem;
}
diff --git a/unotools/source/config/misccfg.cxx b/unotools/source/config/misccfg.cxx
index c36630c..b11b9c4 100644
--- a/unotools/source/config/misccfg.cxx
+++ b/unotools/source/config/misccfg.cxx
@@ -194,7 +194,7 @@ MiscCfg::MiscCfg( )
{
m_pImpl = std::make_shared<SfxMiscCfg>();
g_pOptions = m_pImpl;
- ItemHolder1::holdConfigItem(E_MISCCFG);
+ ItemHolder1::holdConfigItem(EItem::MiscConfig);
}
m_pImpl->AddListener(this);
diff --git a/unotools/source/config/moduleoptions.cxx b/unotools/source/config/moduleoptions.cxx
index 525523c..0c759de 100644
--- a/unotools/source/config/moduleoptions.cxx
+++ b/unotools/source/config/moduleoptions.cxx
@@ -801,7 +801,7 @@ SvtModuleOptions::SvtModuleOptions()
{
m_pImpl = std::make_shared<SvtModuleOptions_Impl>();
g_pModuleOptions = m_pImpl;
- ItemHolder1::holdConfigItem(E_MODULEOPTIONS);
+ ItemHolder1::holdConfigItem(EItem::ModuleOptions);
}
}
diff --git a/unotools/source/config/optionsdlg.cxx b/unotools/source/config/optionsdlg.cxx
index 0b81911..7d1f184 100644
--- a/unotools/source/config/optionsdlg.cxx
+++ b/unotools/source/config/optionsdlg.cxx
@@ -208,7 +208,7 @@ SvtOptionsDialogOptions::SvtOptionsDialogOptions()
{
pOptions = new SvtOptionsDlgOptions_Impl;
- ItemHolder1::holdConfigItem( E_OPTIONSDLGOPTIONS );
+ ItemHolder1::holdConfigItem( EItem::OptionsDialogOptions );
}
m_pImp = pOptions;
}
diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx
index 5accec7..6bdf6e0 100644
--- a/unotools/source/config/pathoptions.cxx
+++ b/unotools/source/config/pathoptions.cxx
@@ -459,7 +459,7 @@ SvtPathOptions::SvtPathOptions()
{
pImpl = std::make_shared<SvtPathOptions_Impl>();
g_pOptions = pImpl;
- ItemHolder1::holdConfigItem(E_PATHOPTIONS);
+ ItemHolder1::holdConfigItem(EItem::PathOptions);
}
}
diff --git a/unotools/source/config/printwarningoptions.cxx b/unotools/source/config/printwarningoptions.cxx
index 49363aa..885e588 100644
--- a/unotools/source/config/printwarningoptions.cxx
+++ b/unotools/source/config/printwarningoptions.cxx
@@ -233,7 +233,7 @@ SvtPrintWarningOptions::SvtPrintWarningOptions()
{
m_pImpl = std::make_shared<SvtPrintWarningOptions_Impl>();
g_pPrintWarningOptions = m_pImpl;
- ItemHolder1::holdConfigItem(E_PRINTWARNINGOPTIONS);
+ ItemHolder1::holdConfigItem(EItem::PrintWarningOptions);
}
}
diff --git a/unotools/source/config/saveopt.cxx b/unotools/source/config/saveopt.cxx
index 64db684..1dff44c 100644
--- a/unotools/source/config/saveopt.cxx
+++ b/unotools/source/config/saveopt.cxx
@@ -806,7 +806,7 @@ SvtSaveOptions::SvtSaveOptions()
pOptions->pSaveOpt = new SvtSaveOptions_Impl;
pOptions->pLoadOpt = new SvtLoadOptions_Impl;
- ItemHolder1::holdConfigItem(E_SAVEOPTIONS);
+ ItemHolder1::holdConfigItem(EItem::SaveOptions);
}
++nRefCount;
pImp = pOptions;
diff --git a/unotools/source/config/securityoptions.cxx b/unotools/source/config/securityoptions.cxx
index f2b57ed..7c51561 100644
--- a/unotools/source/config/securityoptions.cxx
+++ b/unotools/source/config/securityoptions.cxx
@@ -944,7 +944,7 @@ SvtSecurityOptions::SvtSecurityOptions()
m_pImpl = std::make_shared<SvtSecurityOptions_Impl>();
g_pSecurityOptions = m_pImpl;
- ItemHolder1::holdConfigItem(E_SECURITYOPTIONS);
+ ItemHolder1::holdConfigItem(EItem::SecurityOptions);
}
}
diff --git a/unotools/source/config/syslocaleoptions.cxx b/unotools/source/config/syslocaleoptions.cxx
index 08a1e7b..30ddad1 100644
--- a/unotools/source/config/syslocaleoptions.cxx
+++ b/unotools/source/config/syslocaleoptions.cxx
@@ -513,7 +513,7 @@ SvtSysLocaleOptions::SvtSysLocaleOptions()
pImpl = std::make_shared<SvtSysLocaleOptions_Impl>();
g_pSysLocaleOptions = pImpl;
if (!utl::ConfigManager::IsAvoidConfig())
- ItemHolder1::holdConfigItem(E_SYSLOCALEOPTIONS);
+ ItemHolder1::holdConfigItem(EItem::SysLocaleOptions);
}
pImpl->AddListener(this);
}
diff --git a/unotools/source/config/useroptions.cxx b/unotools/source/config/useroptions.cxx
index 6459495..e9c20cf 100644
--- a/unotools/source/config/useroptions.cxx
+++ b/unotools/source/config/useroptions.cxx
@@ -238,7 +238,7 @@ SvtUserOptions::SvtUserOptions ()
{
xImpl.reset(new Impl);
xSharedImpl = xImpl;
- ItemHolder1::holdConfigItem(E_USEROPTIONS);
+ ItemHolder1::holdConfigItem(EItem::UserOptions);
}
xImpl = xSharedImpl.lock();
xImpl->AddListener(this);
diff --git a/unotools/source/config/viewoptions.cxx b/unotools/source/config/viewoptions.cxx
index 2b1c845..e37d98d 100644
--- a/unotools/source/config/viewoptions.cxx
+++ b/unotools/source/config/viewoptions.cxx
@@ -589,7 +589,7 @@ SvtViewOptions::SvtViewOptions( EViewType eType ,
{
//m_pDataContainer_Dialogs = new SvtViewDialogOptions_Impl( LIST_DIALOGS );
m_pDataContainer_Dialogs = new SvtViewOptionsBase_Impl( LIST_DIALOGS );
- ItemHolder1::holdConfigItem(E_VIEWOPTIONS_DIALOG);
+ ItemHolder1::holdConfigItem(EItem::ViewOptionsDialog);
}
}
break;
@@ -600,7 +600,7 @@ SvtViewOptions::SvtViewOptions( EViewType eType ,
if( m_nRefCount_TabDialogs == 1 )
{
m_pDataContainer_TabDialogs = new SvtViewOptionsBase_Impl( LIST_TABDIALOGS );
- ItemHolder1::holdConfigItem(E_VIEWOPTIONS_TABDIALOG);
+ ItemHolder1::holdConfigItem(EItem::ViewOptionsTabDialog);
}
}
break;
@@ -611,7 +611,7 @@ SvtViewOptions::SvtViewOptions( EViewType eType ,
if( m_nRefCount_TabPages == 1 )
{
m_pDataContainer_TabPages = new SvtViewOptionsBase_Impl( LIST_TABPAGES );
- ItemHolder1::holdConfigItem(E_VIEWOPTIONS_TABPAGE);
+ ItemHolder1::holdConfigItem(EItem::ViewOptionsTabPage);
}
}
break;
@@ -622,7 +622,7 @@ SvtViewOptions::SvtViewOptions( EViewType eType ,
if( m_nRefCount_Windows == 1 )
{
m_pDataContainer_Windows = new SvtViewOptionsBase_Impl( LIST_WINDOWS );
- ItemHolder1::holdConfigItem(E_VIEWOPTIONS_WINDOW);
+ ItemHolder1::holdConfigItem(EItem::ViewOptionsWindow);
}
}
break;
@@ -1005,22 +1005,22 @@ void SvtViewOptions::AcquireOptions()
if( ++m_nRefCount_Dialogs == 1 )
{
m_pDataContainer_Dialogs = new SvtViewOptionsBase_Impl( LIST_DIALOGS );
- ItemHolder1::holdConfigItem(E_VIEWOPTIONS_DIALOG);
+ ItemHolder1::holdConfigItem(EItem::ViewOptionsDialog);
}
if( ++m_nRefCount_TabDialogs == 1 )
{
m_pDataContainer_TabDialogs = new SvtViewOptionsBase_Impl( LIST_TABDIALOGS );
- ItemHolder1::holdConfigItem(E_VIEWOPTIONS_TABDIALOG);
+ ItemHolder1::holdConfigItem(EItem::ViewOptionsTabDialog);
}
if( ++m_nRefCount_TabPages == 1 )
{
m_pDataContainer_TabPages = new SvtViewOptionsBase_Impl( LIST_TABPAGES );
- ItemHolder1::holdConfigItem(E_VIEWOPTIONS_TABPAGE);
+ ItemHolder1::holdConfigItem(EItem::ViewOptionsTabPage);
}
if( ++m_nRefCount_Windows == 1 )
{
m_pDataContainer_Windows = new SvtViewOptionsBase_Impl( LIST_WINDOWS );
- ItemHolder1::holdConfigItem(E_VIEWOPTIONS_WINDOW);
+ ItemHolder1::holdConfigItem(EItem::ViewOptionsWindow);
}
}
commit aef704d8077226b13a28e664db59d27017241afe
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Thu Feb 9 11:53:32 2017 +0200
convert SvtSaveOptions::EOption to scoped enum
and remove unused
E_SAVEUNPACKED, E_USESHA1INODF12, E_USEBLOWFISHINODF12
enumerators
Change-Id: I7c384e0c30af5091a22beeda1c77e4b71fdde55e
diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index 44f2a9e..24c56f4 100644
--- a/cui/source/options/optsave.cxx
+++ b/cui/source/options/optsave.cxx
@@ -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 );
diff --git a/include/unotools/saveopt.hxx b/include/unotools/saveopt.hxx
index 22d8167..9b8a361 100644
--- a/include/unotools/saveopt.hxx
+++ b/include/unotools/saveopt.hxx
@@ -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
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index 61593bb..03ae9db 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -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;
}
diff --git a/unotools/source/config/saveopt.cxx b/unotools/source/config/saveopt.cxx
index 18e3e39..64db684 100644
--- a/unotools/source/config/saveopt.cxx
+++ b/unotools/source/config/saveopt.cxx
@@ -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;
}
More information about the Libreoffice-commits
mailing list