summaryrefslogtreecommitdiff
path: root/xmlhelp
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2016-06-05 15:26:54 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-06-06 07:02:26 +0000
commitbc1e738708c4b343a63c78bf024cc2df5160b207 (patch)
treea84fa5ebbe6e08579d2bab1f10b6d7961189d5a7 /xmlhelp
parent11b4a6ddce31f173f10b703eb63fde2c88c0bc70 (diff)
Convert IteratorState to scoped enum
Change-Id: I71850584a727261e9e7b2115bdfb488ba76b6d21 Reviewed-on: https://gerrit.libreoffice.org/25919 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'xmlhelp')
-rw-r--r--xmlhelp/source/cxxhelp/inc/tvread.hxx10
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.cxx74
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.hxx12
-rw-r--r--xmlhelp/source/treeview/tvread.cxx20
4 files changed, 58 insertions, 58 deletions
diff --git a/xmlhelp/source/cxxhelp/inc/tvread.hxx b/xmlhelp/source/cxxhelp/inc/tvread.hxx
index bb5868ed19a2..2a1b646fef94 100644
--- a/xmlhelp/source/cxxhelp/inc/tvread.hxx
+++ b/xmlhelp/source/cxxhelp/inc/tvread.hxx
@@ -272,12 +272,12 @@ namespace treeview {
}; // end class TVChildTarget
- enum IteratorState
+ enum class IteratorState
{
- USER_EXTENSIONS,
- SHARED_EXTENSIONS,
- BUNDLED_EXTENSIONS,
- END_REACHED
+ UserExtensions,
+ SharedExtensions,
+ BundledExtensions,
+ EndReached
};
class ExtensionIteratorBase
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index 53e5cb3a3c50..ea578559eb27 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -1144,7 +1144,7 @@ ExtensionIteratorBase::ExtensionIteratorBase( Reference< XComponentContext > xCo
Databases& rDatabases, const OUString& aInitialModule, const OUString& aLanguage )
: m_xContext( xContext )
, m_rDatabases( rDatabases )
- , m_eState( INITIAL_MODULE )
+ , m_eState( IteratorState::InitialModule )
, m_aInitialModule( aInitialModule )
, m_aLanguage( aLanguage )
{
@@ -1156,7 +1156,7 @@ ExtensionIteratorBase::ExtensionIteratorBase( Databases& rDatabases,
const OUString& aInitialModule, const OUString& aLanguage )
: m_xContext( comphelper::getProcessComponentContext() )
, m_rDatabases( rDatabases )
- , m_eState( INITIAL_MODULE )
+ , m_eState( IteratorState::InitialModule )
, m_aInitialModule( aInitialModule )
, m_aLanguage( aLanguage )
{
@@ -1254,7 +1254,7 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextUserHelpPack
if( m_iUserPackage == m_aUserPackagesSeq.getLength() )
{
- m_eState = SHARED_EXTENSIONS; // Later: SHARED_MODULE
+ m_eState = IteratorState::SharedExtensions; // Later: SHARED_MODULE
}
else
{
@@ -1282,7 +1282,7 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextSharedHelpPa
if( m_iSharedPackage == m_aSharedPackagesSeq.getLength() )
{
- m_eState = BUNDLED_EXTENSIONS;
+ m_eState = IteratorState::BundledExtensions;
}
else
{
@@ -1310,7 +1310,7 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextBundledHelpP
if( m_iBundledPackage == m_aBundledPackagesSeq.getLength() )
{
- m_eState = END_REACHED;
+ m_eState = IteratorState::EndReached;
}
else
{
@@ -1399,20 +1399,20 @@ helpdatafileproxy::Hdf* DataBaseIterator::nextHdf( OUString* o_pExtensionPath, O
{
helpdatafileproxy::Hdf* pRetHdf = nullptr;
- while( !pRetHdf && m_eState != END_REACHED )
+ while( !pRetHdf && m_eState != IteratorState::EndReached )
{
switch( m_eState )
{
- case INITIAL_MODULE:
+ case IteratorState::InitialModule:
pRetHdf = m_rDatabases.getHelpDataFile( m_aInitialModule, m_aLanguage, m_bHelpText );
- m_eState = USER_EXTENSIONS; // Later: SHARED_MODULE
+ m_eState = IteratorState::UserExtensions; // Later: SHARED_MODULE
break;
// Later:
//case SHARED_MODULE
- case USER_EXTENSIONS:
+ case IteratorState::UserExtensions:
{
Reference< deployment::XPackage > xParentPackageBundle;
Reference< deployment::XPackage > xHelpPackage = implGetNextUserHelpPackage( xParentPackageBundle );
@@ -1422,7 +1422,7 @@ helpdatafileproxy::Hdf* DataBaseIterator::nextHdf( OUString* o_pExtensionPath, O
break;
}
- case SHARED_EXTENSIONS:
+ case IteratorState::SharedExtensions:
{
Reference< deployment::XPackage > xParentPackageBundle;
Reference< deployment::XPackage > xHelpPackage = implGetNextSharedHelpPackage( xParentPackageBundle );
@@ -1433,7 +1433,7 @@ helpdatafileproxy::Hdf* DataBaseIterator::nextHdf( OUString* o_pExtensionPath, O
break;
}
- case BUNDLED_EXTENSIONS:
+ case IteratorState::BundledExtensions:
{
Reference< deployment::XPackage > xParentPackageBundle;
Reference< deployment::XPackage > xHelpPackage = implGetNextBundledHelpPackage( xParentPackageBundle );
@@ -1444,8 +1444,8 @@ helpdatafileproxy::Hdf* DataBaseIterator::nextHdf( OUString* o_pExtensionPath, O
break;
}
- case END_REACHED:
- OSL_FAIL( "DataBaseIterator::nextDb(): Invalid case END_REACHED" );
+ case IteratorState::EndReached:
+ OSL_FAIL( "DataBaseIterator::nextDb(): Invalid case IteratorState::EndReached" );
break;
}
}
@@ -1509,25 +1509,25 @@ OUString KeyDataBaseFileIterator::nextDbFile( bool& o_rbExtension )
{
OUString aRetFile;
- while( aRetFile.isEmpty() && m_eState != END_REACHED )
+ while( aRetFile.isEmpty() && m_eState != IteratorState::EndReached )
{
switch( m_eState )
{
- case INITIAL_MODULE:
+ case IteratorState::InitialModule:
aRetFile = OUStringBuffer(m_rDatabases.getInstallPathAsURL()).
append(m_rDatabases.processLang(m_aLanguage)).append('/').
append(m_aInitialModule).append(".key").makeStringAndClear();
o_rbExtension = false;
- m_eState = USER_EXTENSIONS; // Later: SHARED_MODULE
+ m_eState = IteratorState::UserExtensions; // Later: SHARED_MODULE
break;
// Later:
//case SHARED_MODULE
- case USER_EXTENSIONS:
+ case IteratorState::UserExtensions:
{
Reference< deployment::XPackage > xParentPackageBundle;
Reference< deployment::XPackage > xHelpPackage = implGetNextUserHelpPackage( xParentPackageBundle );
@@ -1539,7 +1539,7 @@ OUString KeyDataBaseFileIterator::nextDbFile( bool& o_rbExtension )
break;
}
- case SHARED_EXTENSIONS:
+ case IteratorState::SharedExtensions:
{
Reference< deployment::XPackage > xParentPackageBundle;
Reference< deployment::XPackage > xHelpPackage = implGetNextSharedHelpPackage( xParentPackageBundle );
@@ -1551,7 +1551,7 @@ OUString KeyDataBaseFileIterator::nextDbFile( bool& o_rbExtension )
break;
}
- case BUNDLED_EXTENSIONS:
+ case IteratorState::BundledExtensions:
{
Reference< deployment::XPackage > xParentPackageBundle;
Reference< deployment::XPackage > xHelpPackage = implGetNextBundledHelpPackage( xParentPackageBundle );
@@ -1563,8 +1563,8 @@ OUString KeyDataBaseFileIterator::nextDbFile( bool& o_rbExtension )
break;
}
- case END_REACHED:
- OSL_FAIL( "DataBaseIterator::nextDbFile(): Invalid case END_REACHED" );
+ case IteratorState::EndReached:
+ OSL_FAIL( "DataBaseIterator::nextDbFile(): Invalid case IteratorState::EndReached" );
break;
}
}
@@ -1590,20 +1590,20 @@ Reference< XHierarchicalNameAccess > JarFileIterator::nextJarFile
{
Reference< XHierarchicalNameAccess > xNA;
- while( !xNA.is() && m_eState != END_REACHED )
+ while( !xNA.is() && m_eState != IteratorState::EndReached )
{
switch( m_eState )
{
- case INITIAL_MODULE:
+ case IteratorState::InitialModule:
xNA = m_rDatabases.jarFile( m_aInitialModule, m_aLanguage );
- m_eState = USER_EXTENSIONS; // Later: SHARED_MODULE
+ m_eState = IteratorState::UserExtensions; // Later: SHARED_MODULE
break;
// Later:
//case SHARED_MODULE
- case USER_EXTENSIONS:
+ case IteratorState::UserExtensions:
{
Reference< deployment::XPackage > xHelpPackage = implGetNextUserHelpPackage( o_xParentPackageBundle );
if( !xHelpPackage.is() )
@@ -1613,7 +1613,7 @@ Reference< XHierarchicalNameAccess > JarFileIterator::nextJarFile
break;
}
- case SHARED_EXTENSIONS:
+ case IteratorState::SharedExtensions:
{
Reference< deployment::XPackage > xHelpPackage = implGetNextSharedHelpPackage( o_xParentPackageBundle );
if( !xHelpPackage.is() )
@@ -1623,7 +1623,7 @@ Reference< XHierarchicalNameAccess > JarFileIterator::nextJarFile
break;
}
- case BUNDLED_EXTENSIONS:
+ case IteratorState::BundledExtensions:
{
Reference< deployment::XPackage > xHelpPackage = implGetNextBundledHelpPackage( o_xParentPackageBundle );
if( !xHelpPackage.is() )
@@ -1633,8 +1633,8 @@ Reference< XHierarchicalNameAccess > JarFileIterator::nextJarFile
break;
}
- case END_REACHED:
- OSL_FAIL( "JarFileIterator::nextJarFile(): Invalid case END_REACHED" );
+ case IteratorState::EndReached:
+ OSL_FAIL( "JarFileIterator::nextJarFile(): Invalid case IteratorState::EndReached" );
break;
}
}
@@ -1707,11 +1707,11 @@ OUString IndexFolderIterator::nextIndexFolder( bool& o_rbExtension, bool& o_rbTe
{
OUString aIndexFolder;
- while( aIndexFolder.isEmpty() && m_eState != END_REACHED )
+ while( aIndexFolder.isEmpty() && m_eState != IteratorState::EndReached )
{
switch( m_eState )
{
- case INITIAL_MODULE:
+ case IteratorState::InitialModule:
aIndexFolder = m_rDatabases.getInstallPathAsURL()
+ m_rDatabases.processLang(m_aLanguage) + "/"
+ m_aInitialModule + ".idxl";
@@ -1719,14 +1719,14 @@ OUString IndexFolderIterator::nextIndexFolder( bool& o_rbExtension, bool& o_rbTe
o_rbTemporary = false;
o_rbExtension = false;
- m_eState = USER_EXTENSIONS; // Later: SHARED_MODULE
+ m_eState = IteratorState::UserExtensions; // Later: SHARED_MODULE
break;
// Later:
//case SHARED_MODULE
- case USER_EXTENSIONS:
+ case IteratorState::UserExtensions:
{
Reference< deployment::XPackage > xParentPackageBundle;
Reference< deployment::XPackage > xHelpPackage = implGetNextUserHelpPackage( xParentPackageBundle );
@@ -1738,7 +1738,7 @@ OUString IndexFolderIterator::nextIndexFolder( bool& o_rbExtension, bool& o_rbTe
break;
}
- case SHARED_EXTENSIONS:
+ case IteratorState::SharedExtensions:
{
Reference< deployment::XPackage > xParentPackageBundle;
Reference< deployment::XPackage > xHelpPackage = implGetNextSharedHelpPackage( xParentPackageBundle );
@@ -1750,7 +1750,7 @@ OUString IndexFolderIterator::nextIndexFolder( bool& o_rbExtension, bool& o_rbTe
break;
}
- case BUNDLED_EXTENSIONS:
+ case IteratorState::BundledExtensions:
{
Reference< deployment::XPackage > xParentPackageBundle;
Reference< deployment::XPackage > xHelpPackage = implGetNextBundledHelpPackage( xParentPackageBundle );
@@ -1762,8 +1762,8 @@ OUString IndexFolderIterator::nextIndexFolder( bool& o_rbExtension, bool& o_rbTe
break;
}
- case END_REACHED:
- OSL_FAIL( "IndexFolderIterator::nextIndexFolder(): Invalid case END_REACHED" );
+ case IteratorState::EndReached:
+ OSL_FAIL( "IndexFolderIterator::nextIndexFolder(): Invalid case IteratorState::EndReached" );
break;
}
}
diff --git a/xmlhelp/source/cxxhelp/provider/databases.hxx b/xmlhelp/source/cxxhelp/provider/databases.hxx
index 7976cccaa769..15111eae1c6f 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.hxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.hxx
@@ -305,14 +305,14 @@ namespace chelp {
}; // end class Databases
- enum IteratorState
+ enum class IteratorState
{
- INITIAL_MODULE,
+ InitialModule,
//SHARED_MODULE, // Later, avoids redundancies in help compiling
- USER_EXTENSIONS,
- SHARED_EXTENSIONS,
- BUNDLED_EXTENSIONS,
- END_REACHED
+ UserExtensions,
+ SharedExtensions,
+ BundledExtensions,
+ EndReached
};
// Hashtable to cache extension help status
diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx
index 28dafedf0583..c93e5b90b94a 100644
--- a/xmlhelp/source/treeview/tvread.cxx
+++ b/xmlhelp/source/treeview/tvread.cxx
@@ -865,7 +865,7 @@ void TVChildTarget::subst( OUString& instpath )
static const char aHelpMediaType[] = "application/vnd.sun.star.help";
ExtensionIteratorBase::ExtensionIteratorBase( const OUString& aLanguage )
- : m_eState( USER_EXTENSIONS )
+ : m_eState( IteratorState::UserExtensions )
, m_aLanguage( aLanguage )
{
init();
@@ -958,7 +958,7 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextUserHelpPack
if( m_iUserPackage == m_aUserPackagesSeq.getLength() )
{
- m_eState = SHARED_EXTENSIONS; // Later: SHARED_MODULE
+ m_eState = IteratorState::SharedExtensions; // Later: SHARED_MODULE
}
else
{
@@ -988,7 +988,7 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextSharedHelpPa
if( m_iSharedPackage == m_aSharedPackagesSeq.getLength() )
{
- m_eState = BUNDLED_EXTENSIONS;
+ m_eState = IteratorState::BundledExtensions;
}
else
{
@@ -1018,7 +1018,7 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextBundledHelpP
if( m_iBundledPackage == m_aBundledPackagesSeq.getLength() )
{
- m_eState = END_REACHED;
+ m_eState = IteratorState::EndReached;
}
else
{
@@ -1074,11 +1074,11 @@ OUString TreeFileIterator::nextTreeFile( sal_Int32& rnFileSize )
{
OUString aRetFile;
- while( aRetFile.isEmpty() && m_eState != END_REACHED )
+ while( aRetFile.isEmpty() && m_eState != IteratorState::EndReached )
{
switch( m_eState )
{
- case USER_EXTENSIONS:
+ case IteratorState::UserExtensions:
{
Reference< deployment::XPackage > xParentPackageBundle;
Reference< deployment::XPackage > xHelpPackage = implGetNextUserHelpPackage( xParentPackageBundle );
@@ -1089,7 +1089,7 @@ OUString TreeFileIterator::nextTreeFile( sal_Int32& rnFileSize )
break;
}
- case SHARED_EXTENSIONS:
+ case IteratorState::SharedExtensions:
{
Reference< deployment::XPackage > xParentPackageBundle;
Reference< deployment::XPackage > xHelpPackage = implGetNextSharedHelpPackage( xParentPackageBundle );
@@ -1099,7 +1099,7 @@ OUString TreeFileIterator::nextTreeFile( sal_Int32& rnFileSize )
aRetFile = implGetTreeFileFromPackage( rnFileSize, xHelpPackage );
break;
}
- case BUNDLED_EXTENSIONS:
+ case IteratorState::BundledExtensions:
{
Reference< deployment::XPackage > xParentPackageBundle;
Reference< deployment::XPackage > xHelpPackage = implGetNextBundledHelpPackage( xParentPackageBundle );
@@ -1110,8 +1110,8 @@ OUString TreeFileIterator::nextTreeFile( sal_Int32& rnFileSize )
break;
}
- case END_REACHED:
- OSL_FAIL( "DataBaseIterator::nextTreeFile(): Invalid case END_REACHED" );
+ case IteratorState::EndReached:
+ OSL_FAIL( "DataBaseIterator::nextTreeFile(): Invalid case IteratorState::EndReached" );
break;
}
}