summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-09-07 08:41:45 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-09-10 08:39:22 +0200
commit62cea174f4c73ed39e5ac29e2a44fd27b92054bd (patch)
treece1cb158248011f1b919ee2f2d053378db2de9c6 /dbaccess
parent9d30a59ee1f4b280d70d43e6ee3fc7472e8efa2a (diff)
convert EmbeddedMacros to scoped enum
Change-Id: I7e24b5ad53853ff7989f262a3b914b2082ac5ec4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139733 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/dataaccess/ModelImpl.cxx8
-rw-r--r--dbaccess/source/core/dataaccess/databasedocument.cxx2
-rw-r--r--dbaccess/source/core/dataaccess/documentdefinition.cxx4
-rw-r--r--dbaccess/source/core/inc/ModelImpl.hxx8
4 files changed, 11 insertions, 11 deletions
diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx
index 14d05bb53b35..3db610503313 100644
--- a/dbaccess/source/core/dataaccess/ModelImpl.cxx
+++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx
@@ -1323,17 +1323,17 @@ ODatabaseModelImpl::EmbeddedMacros ODatabaseModelImpl::determineEmbeddedMacros()
{
if ( ::sfx2::DocumentMacroMode::storageHasMacros( getOrCreateRootStorage() ) )
{
- m_aEmbeddedMacros = eDocumentWideMacros;
+ m_aEmbeddedMacros = EmbeddedMacros::DocumentWide;
}
else if ( lcl_hasObjectsWithMacros_nothrow( *this, ObjectType::Form )
|| lcl_hasObjectsWithMacros_nothrow( *this, ObjectType::Report )
)
{
- m_aEmbeddedMacros = eSubDocumentMacros;
+ m_aEmbeddedMacros = EmbeddedMacros::SubDocument;
}
else
{
- m_aEmbeddedMacros = eNoMacros;
+ m_aEmbeddedMacros = EmbeddedMacros::NONE;
}
}
return *m_aEmbeddedMacros;
@@ -1342,7 +1342,7 @@ ODatabaseModelImpl::EmbeddedMacros ODatabaseModelImpl::determineEmbeddedMacros()
bool ODatabaseModelImpl::documentStorageHasMacros() const
{
const_cast< ODatabaseModelImpl* >( this )->determineEmbeddedMacros();
- return ( *m_aEmbeddedMacros != eNoMacros );
+ return ( *m_aEmbeddedMacros != EmbeddedMacros::NONE );
}
bool ODatabaseModelImpl::macroCallsSeenWhileLoading() const
diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx
index 681966020696..fb4ed754380b 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -775,7 +775,7 @@ bool ODatabaseDocument::impl_attachResource( const OUString& i_rLogicalDocumentU
// determine whether the document as a whole, or sub documents, have macros. Especially the latter
// controls the availability of our XEmbeddedScripts and XScriptInvocationContext interfaces, and we
// should know this before anybody actually uses the object.
- m_bAllowDocumentScripting = ( m_pImpl->determineEmbeddedMacros() != ODatabaseModelImpl::eSubDocumentMacros );
+ m_bAllowDocumentScripting = ( m_pImpl->determineEmbeddedMacros() != ODatabaseModelImpl::EmbeddedMacros::SubDocument );
_rDocGuard.clear();
// <- SYNCHRONIZED
diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx
index 2c7bc4b871a7..dbbb7eb94ecc 100644
--- a/dbaccess/source/core/dataaccess/documentdefinition.cxx
+++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx
@@ -852,7 +852,7 @@ Any ODocumentDefinition::onCommandOpenSomething( const Any& _rOpenArgument, cons
// So, in such a case, and with 2. above, we would silently execute those macros,
// regardless of the global security settings - which would be a security issue, of
// course.
- if ( m_pImpl->m_pDataSource->determineEmbeddedMacros() == ODatabaseModelImpl::eNoMacros )
+ if ( m_pImpl->m_pDataSource->determineEmbeddedMacros() == ODatabaseModelImpl::EmbeddedMacros::NONE )
{
// this is case 2. from above
// So, pass a USE_CONFIG to the to-be-loaded document. This means that
@@ -1431,7 +1431,7 @@ namespace
bool ODocumentDefinition::objectSupportsEmbeddedScripts() const
{
bool bAllowDocumentMacros = !m_pImpl->m_pDataSource
- || ( m_pImpl->m_pDataSource->determineEmbeddedMacros() == ODatabaseModelImpl::eSubDocumentMacros );
+ || ( m_pImpl->m_pDataSource->determineEmbeddedMacros() == ODatabaseModelImpl::EmbeddedMacros::SubDocument );
// if *any* of the objects of the database document already has macros, we
// continue to allow it to have them, until the user does a migration.
diff --git a/dbaccess/source/core/inc/ModelImpl.hxx b/dbaccess/source/core/inc/ModelImpl.hxx
index 14c6d6a6ad91..fdaf89f1511d 100644
--- a/dbaccess/source/core/inc/ModelImpl.hxx
+++ b/dbaccess/source/core/inc/ModelImpl.hxx
@@ -109,14 +109,14 @@ public:
LAST = Table
};
- enum EmbeddedMacros
+ enum class EmbeddedMacros
{
// the database document (storage) itself contains macros
- eDocumentWideMacros,
+ DocumentWide,
// there are sub document( storage)s containing macros
- eSubDocumentMacros,
+ SubDocument,
// there are no known macro( storage)s
- eNoMacros
+ NONE
};
private: