[Libreoffice-commits] core.git: include/unotools unotools/source
Noel Grandin
noel at peralex.com
Mon Apr 4 12:04:13 UTC 2016
include/unotools/atom.hxx | 2 +-
include/unotools/configvaluecontainer.hxx | 1 -
unotools/source/config/configvaluecontainer.cxx | 8 +++-----
unotools/source/misc/atom.cxx | 8 +++-----
4 files changed, 7 insertions(+), 12 deletions(-)
New commits:
commit 17b1852133427e6c0b4266ccb63e24980aff94f0
Author: Noel Grandin <noel at peralex.com>
Date: Fri Apr 1 15:51:24 2016 +0200
loplugin:constantparam in unotools
Change-Id: I0501e6e7eadd735b1666a8ecb2c5e6da73ce7e67
Reviewed-on: https://gerrit.libreoffice.org/23728
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/include/unotools/atom.hxx b/include/unotools/atom.hxx
index a60ae00..c91dc87 100644
--- a/include/unotools/atom.hxx
+++ b/include/unotools/atom.hxx
@@ -40,7 +40,7 @@ namespace utl {
AtomProvider();
~AtomProvider();
- int getAtom( const OUString&, bool bCreate = false );
+ int getAtom( const OUString& );
const OUString& getString( int ) const;
};
diff --git a/include/unotools/configvaluecontainer.hxx b/include/unotools/configvaluecontainer.hxx
index 7cbe897..970bc18 100644
--- a/include/unotools/configvaluecontainer.hxx
+++ b/include/unotools/configvaluecontainer.hxx
@@ -167,7 +167,6 @@ namespace utl
/// implements the ctors
void implConstruct(
const OUString& _rConfigLocation,
- const CVCFlags _nAccessFlags,
const sal_Int32 _nLevels
);
diff --git a/unotools/source/config/configvaluecontainer.cxx b/unotools/source/config/configvaluecontainer.cxx
index 7880722..a13b52a 100644
--- a/unotools/source/config/configvaluecontainer.cxx
+++ b/unotools/source/config/configvaluecontainer.cxx
@@ -215,7 +215,7 @@ namespace utl
const sal_Char* _pConfigLocation, const sal_Int32 _nLevels )
:m_pImpl( new OConfigurationValueContainerImpl( _rxORB, _rAccessSafety ) )
{
- implConstruct( OUString::createFromAscii( _pConfigLocation ), CVCFlags::UPDATE_ACCESS, _nLevels );
+ implConstruct( OUString::createFromAscii( _pConfigLocation ), _nLevels );
}
OConfigurationValueContainer::~OConfigurationValueContainer()
@@ -224,7 +224,7 @@ namespace utl
}
void OConfigurationValueContainer::implConstruct( const OUString& _rConfigLocation,
- const CVCFlags _nAccessFlags, const sal_Int32 _nLevels )
+ const sal_Int32 _nLevels )
{
SAL_WARN_IF(m_pImpl->aConfigRoot.isValid(), "unotools.config", "OConfigurationValueContainer::implConstruct: already initialized!");
@@ -232,9 +232,7 @@ namespace utl
m_pImpl->aConfigRoot = OConfigurationTreeRoot::createWithComponentContext(
m_pImpl->xORB,
_rConfigLocation,
- _nLevels,
- ( _nAccessFlags & CVCFlags::UPDATE_ACCESS ) ? OConfigurationTreeRoot::CM_UPDATABLE : OConfigurationTreeRoot::CM_READONLY,
- !bool( _nAccessFlags & CVCFlags::IMMEDIATE_UPDATE )
+ _nLevels
);
SAL_WARN_IF(!m_pImpl->aConfigRoot.isValid(), "unotools.config",
"Could not access the configuration node located at " << _rConfigLocation);
diff --git a/unotools/source/misc/atom.cxx b/unotools/source/misc/atom.cxx
index 3ea6650..84c2de0 100644
--- a/unotools/source/misc/atom.cxx
+++ b/unotools/source/misc/atom.cxx
@@ -32,13 +32,11 @@ AtomProvider::~AtomProvider()
{
}
-int AtomProvider::getAtom( const OUString& rString, bool bCreate )
+int AtomProvider::getAtom( const OUString& rString )
{
std::unordered_map< OUString, int, OUStringHash >::iterator it = m_aAtomMap.find( rString );
if( it != m_aAtomMap.end() )
return it->second;
- if( ! bCreate )
- return INVALID_ATOM;
m_aAtomMap[ rString ] = m_nAtoms;
m_aStringMap[ m_nAtoms ] = rString;
m_nAtoms++;
@@ -68,11 +66,11 @@ int MultiAtomProvider::getAtom( int atomClass, const OUString& rString )
std::unordered_map<int, AtomProvider*>::iterator it =
m_aAtomLists.find( atomClass );
if( it != m_aAtomLists.end() )
- return it->second->getAtom( rString, true/*bCreate*/ );
+ return it->second->getAtom( rString );
AtomProvider* pNewClass;
m_aAtomLists[ atomClass ] = pNewClass = new AtomProvider();
- return pNewClass->getAtom( rString, true/*bCreate*/ );
+ return pNewClass->getAtom( rString );
}
const OUString& MultiAtomProvider::getString( int atomClass, int atom ) const
More information about the Libreoffice-commits
mailing list