diff options
author | Olivier Hallot <olivier.hallot@documentfoundation.org> | 2012-01-02 15:58:10 -0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-01-02 19:17:17 +0100 |
commit | 85d1ce27ad9ce7a3740bd8bbbaf1d3abe643ba10 (patch) | |
tree | 9c27a22d1d2ccb1bd78658ee4152c30ea4a70137 /registry | |
parent | 829db12d7e3e93b4a44f79b39a0a9f0630439109 (diff) |
Fix for fdo43460 Part XXVII getLength() to isEmpty()
Please find attached a partial fix for Easy Hack FDO43460
Part XXVII
Modules
padmin, pyuno, rdbmaker, regexp, registry, rsc, sal
Diffstat (limited to 'registry')
-rw-r--r-- | registry/source/keyimpl.cxx | 14 | ||||
-rw-r--r-- | registry/source/reflwrit.cxx | 28 | ||||
-rw-r--r-- | registry/source/regimpl.cxx | 18 | ||||
-rw-r--r-- | registry/tools/checksingleton.cxx | 2 | ||||
-rw-r--r-- | registry/tools/regcompare.cxx | 28 |
5 files changed, 45 insertions, 45 deletions
diff --git a/registry/source/keyimpl.cxx b/registry/source/keyimpl.cxx index 6657cb3f5fb7..c48ae9c8680a 100644 --- a/registry/source/keyimpl.cxx +++ b/registry/source/keyimpl.cxx @@ -105,7 +105,7 @@ RegError ORegKey::openSubKeys(const OUString& keyName, RegKeyHandle** phOpenSubK *pnSubKeys = 0; ORegKey* pKey = this; - if ( keyName.getLength() ) + if ( !keyName.isEmpty() ) { _ret = openKey(keyName, (RegKeyHandle*)&pKey); if (_ret != REG_NO_ERROR) @@ -148,7 +148,7 @@ RegError ORegKey::openSubKeys(const OUString& keyName, RegKeyHandle** phOpenSubK } *phOpenSubKeys = (RegKeyHandle*)pSubKeys; - if (keyName.getLength()) + if (!keyName.isEmpty()) { (void) releaseKey(pKey); } @@ -169,7 +169,7 @@ RegError ORegKey::getKeyNames(const OUString& keyName, *pnSubKeys = 0; ORegKey* pKey = this; - if (keyName.getLength()) + if (!keyName.isEmpty()) { _ret = openKey(keyName, (RegKeyHandle*)&pKey); if (_ret != REG_NO_ERROR) @@ -208,7 +208,7 @@ RegError ORegKey::getKeyNames(const OUString& keyName, } *pSubKeyNames = pSubKeys; - if (keyName.getLength()) + if (!keyName.isEmpty()) { releaseKey(pKey); } @@ -982,7 +982,7 @@ RegError ORegKey::getKeyType(const OUString& name, RegKeyType* pKeyType) const REG_GUARD(m_pRegistry->m_mutex); - if ( name.getLength() ) + if ( !name.isEmpty() ) { ORegKey* pThis = const_cast< ORegKey* >(this); @@ -999,7 +999,7 @@ RegError ORegKey::getKeyType(const OUString& name, RegKeyType* pKeyType) const RegError ORegKey::getResolvedKeyName(const OUString& keyName, OUString& resolvedName) { - if (keyName.getLength() == 0) + if (keyName.isEmpty()) return REG_INVALID_KEYNAME; resolvedName = getFullPath(keyName); @@ -1059,7 +1059,7 @@ OStoreDirectory ORegKey::getStoreDir() } OUString ORegKey::getFullPath(OUString const & path) const { - OSL_ASSERT(m_name.getLength() != 0 && path.getLength() != 0); + OSL_ASSERT(!m_name.isEmpty() && !path.isEmpty()); OUStringBuffer b(m_name); if (b.getLength() > 0 && b[b.getLength() - 1] == '/') { if (path[0] == '/') { diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx index 3f19d00c349e..9fb415aa2277 100644 --- a/registry/source/reflwrit.cxx +++ b/registry/source/reflwrit.cxx @@ -838,7 +838,7 @@ void TypeWriter::createBlop() } // create CP entry for doku - if (m_doku.getLength()) + if (!m_doku.isEmpty()) { pInfo = new CPInfo(CP_TAG_UTF8_NAME, pInfo); pInfo->m_value.aUtf8 = m_doku.getStr(); @@ -846,7 +846,7 @@ void TypeWriter::createBlop() } // create CP entry for idl source filename - if (m_fileName.getLength()) + if (!m_fileName.isEmpty()) { pInfo = new CPInfo(CP_TAG_UTF8_NAME, pInfo); pInfo->m_value.aUtf8 = m_fileName.getStr(); @@ -884,7 +884,7 @@ void TypeWriter::createBlop() pBuffer += writeUINT16(pBuffer, m_fields[i].m_access); - if (m_fields[i].m_name.getLength()) + if (!m_fields[i].m_name.isEmpty()) { pInfo = new CPInfo(CP_TAG_UTF8_NAME, pInfo); pInfo->m_value.aUtf8 = m_fields[i].m_name.getStr(); @@ -892,7 +892,7 @@ void TypeWriter::createBlop() } pBuffer += writeUINT16(pBuffer, cpIndexName); - if (m_fields[i].m_typeName.getLength()) + if (!m_fields[i].m_typeName.isEmpty()) { pInfo = new CPInfo(CP_TAG_UTF8_NAME, pInfo); pInfo->m_value.aUtf8 = m_fields[i].m_typeName.getStr(); @@ -908,7 +908,7 @@ void TypeWriter::createBlop() } pBuffer += writeUINT16(pBuffer, cpIndexValue); - if (m_fields[i].m_doku.getLength()) + if (!m_fields[i].m_doku.isEmpty()) { pInfo = new CPInfo(CP_TAG_UTF8_NAME, pInfo); pInfo->m_value.aUtf8 = m_fields[i].m_doku.getStr(); @@ -916,7 +916,7 @@ void TypeWriter::createBlop() } pBuffer += writeUINT16(pBuffer, cpIndexDoku2); - if (m_fields[i].m_fileName.getLength()) + if (!m_fields[i].m_fileName.isEmpty()) { pInfo = new CPInfo(CP_TAG_UTF8_NAME, pInfo); pInfo->m_value.aUtf8 = m_fields[i].m_fileName.getStr(); @@ -970,7 +970,7 @@ void TypeWriter::createBlop() pBuffer, sal::static_int_cast< sal_uInt16 >(m_methods[i].m_mode)); - if (m_methods[i].m_name.getLength()) + if (!m_methods[i].m_name.isEmpty()) { pInfo = new CPInfo(CP_TAG_UTF8_NAME, pInfo); pInfo->m_value.aUtf8 = m_methods[i].m_name.getStr(); @@ -979,7 +979,7 @@ void TypeWriter::createBlop() pBuffer += writeUINT16(pBuffer, cpIndexName); cpIndexName = 0; - if (m_methods[i].m_returnTypeName.getLength()) + if (!m_methods[i].m_returnTypeName.isEmpty()) { pInfo = new CPInfo(CP_TAG_UTF8_NAME, pInfo); pInfo->m_value.aUtf8 = m_methods[i].m_returnTypeName.getStr(); @@ -987,7 +987,7 @@ void TypeWriter::createBlop() } pBuffer += writeUINT16(pBuffer, cpIndexReturn); - if (m_methods[i].m_doku.getLength()) + if (!m_methods[i].m_doku.isEmpty()) { pInfo = new CPInfo(CP_TAG_UTF8_NAME, pInfo); pInfo->m_value.aUtf8 = m_methods[i].m_doku.getStr(); @@ -1001,7 +1001,7 @@ void TypeWriter::createBlop() for (j = 0; j < m_methods[i].m_paramCount; j++) { - if (m_methods[i].m_params[j].m_typeName.getLength()) + if (!m_methods[i].m_params[j].m_typeName.isEmpty()) { pInfo = new CPInfo(CP_TAG_UTF8_NAME, pInfo); pInfo->m_value.aUtf8 = m_methods[i].m_params[j].m_typeName.getStr(); @@ -1015,7 +1015,7 @@ void TypeWriter::createBlop() sal::static_int_cast< sal_uInt16 >( m_methods[i].m_params[j].m_mode)); - if (m_methods[i].m_params[j].m_name.getLength()) + if (!m_methods[i].m_params[j].m_name.isEmpty()) { pInfo = new CPInfo(CP_TAG_UTF8_NAME, pInfo); pInfo->m_value.aUtf8 = m_methods[i].m_params[j].m_name.getStr(); @@ -1029,7 +1029,7 @@ void TypeWriter::createBlop() for (j = 0; j < m_methods[i].m_excCount; j++) { - if (m_methods[i].m_excNames[j].getLength()) + if (!m_methods[i].m_excNames[j].isEmpty()) { pInfo = new CPInfo(CP_TAG_UTF8_NAME, pInfo); pInfo->m_value.aUtf8 = m_methods[i].m_excNames[j].getStr(); @@ -1070,7 +1070,7 @@ void TypeWriter::createBlop() cpIndexName = 0; cpIndexDoku2 = 0; - if (m_references[i].m_name.getLength()) + if (!m_references[i].m_name.isEmpty()) { pInfo = new CPInfo(CP_TAG_UTF8_NAME, pInfo); pInfo->m_value.aUtf8 = m_references[i].m_name.getStr(); @@ -1078,7 +1078,7 @@ void TypeWriter::createBlop() } pBuffer += writeUINT16(pBuffer, cpIndexName); - if (m_references[i].m_doku.getLength()) + if (!m_references[i].m_doku.isEmpty()) { pInfo = new CPInfo(CP_TAG_UTF8_NAME, pInfo); pInfo->m_value.aUtf8 = m_references[i].m_doku.getStr(); diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx index 027f6c2a7612..5eb88c7c36d8 100644 --- a/registry/source/regimpl.cxx +++ b/registry/source/regimpl.cxx @@ -481,7 +481,7 @@ RegError ORegistry::initRegistry(const OUString& regName, RegAccessMode accessMo m_readOnly = sal_True; } - if (0 == regName.getLength() && + if (regName.isEmpty() && store_AccessCreate == sAccessMode) { errCode = rRegFile.createInMemory(); @@ -555,7 +555,7 @@ RegError ORegistry::destroyRegistry(const OUString& regName) { REG_GUARD(m_mutex); - if (regName.getLength()) + if (!regName.isEmpty()) { ORegistry* pReg = new ORegistry(); @@ -589,7 +589,7 @@ RegError ORegistry::destroyRegistry(const OUString& regName) m_file.close(); m_isOpen = sal_False; - if (m_name.getLength()) + if (!m_name.isEmpty()) { OUString systemName; if ( FileBase::getSystemPathFromFileURL(m_name, systemName) != FileBase::E_None ) @@ -653,7 +653,7 @@ RegError ORegistry::createKey(RegKeyHandle hKey, const OUString& keyName, *phNewKey = NULL; - if ( !keyName.getLength() ) + if ( keyName.isEmpty() ) return REG_INVALID_KEYNAME; REG_GUARD(m_mutex); @@ -683,7 +683,7 @@ RegError ORegistry::createKey(RegKeyHandle hKey, const OUString& keyName, do { token = sFullKeyName.getToken( 0, '/', nIndex ); - if (token.getLength()) + if (!token.isEmpty()) { if (rStoreDir.create(pKey->getStoreFile(), sFullPath.getStr(), token, KEY_MODE_CREATE)) { @@ -714,7 +714,7 @@ RegError ORegistry::openKey(RegKeyHandle hKey, const OUString& keyName, *phOpenKey = NULL; - if ( !keyName.getLength() ) + if ( keyName.isEmpty() ) { return REG_INVALID_KEYNAME; } @@ -795,7 +795,7 @@ RegError ORegistry::closeKey(RegKeyHandle hKey) RegError ORegistry::deleteKey(RegKeyHandle hKey, const OUString& keyName) { ORegKey* pKey = static_cast< ORegKey* >(hKey); - if ( !keyName.getLength() ) + if ( keyName.isEmpty() ) return REG_INVALID_KEYNAME; REG_GUARD(m_mutex); @@ -811,7 +811,7 @@ RegError ORegistry::eraseKey(ORegKey* pKey, const OUString& keyName) { RegError _ret = REG_NO_ERROR; - if ( !keyName.getLength() ) + if ( keyName.isEmpty() ) { return REG_INVALID_KEYNAME; } @@ -1361,7 +1361,7 @@ RegError ORegistry::loadAndSaveKeys(ORegKey* pTargetKey, if(pTargetKey->getName().getLength() > 1) sFullPath += pTargetKey->getName(); sFullPath += sRelPath; - if (sRelPath.getLength() > 1 || sFullPath.getLength() == 0) + if (sRelPath.getLength() > 1 || sFullPath.isEmpty()) sFullPath += ROOT; OUString sFullKeyName = sFullPath; diff --git a/registry/tools/checksingleton.cxx b/registry/tools/checksingleton.cxx index ed5924beca71..998bc625de0a 100644 --- a/registry/tools/checksingleton.cxx +++ b/registry/tools/checksingleton.cxx @@ -61,7 +61,7 @@ public: std::string const & getTypeReg() const { return m_typeRegName; } bool hasBase() const - { return (m_base.getLength() > 0); } + { return (!m_base.isEmpty()); } const OString & getBase() const { return m_base; } bool forceOutput() const diff --git a/registry/tools/regcompare.cxx b/registry/tools/regcompare.cxx index f3dfe6b12fbe..c12e1c1f200f 100644 --- a/registry/tools/regcompare.cxx +++ b/registry/tools/regcompare.cxx @@ -62,7 +62,7 @@ public: std::string const & getRegName1() const { return m_regName1; } std::string const & getRegName2() const { return m_regName2; } - bool isStartKeyValid() const { return (m_startKey.getLength() > 0); } + bool isStartKeyValid() const { return (!m_startKey.isEmpty()); } OUString const & getStartKey() const { return m_startKey; } bool matchedWithExcludeKey( const OUString& keyName) const; @@ -323,55 +323,55 @@ static OString getFieldAccess(RTFieldAccess fieldAccess) } if ( (fieldAccess & RT_ACCESS_READONLY) == RT_ACCESS_READONLY ) { - ret += OString(ret.getLength() > 0 ? ",READONLY" : "READONLY"); + ret += OString(ret.isEmpty() ? "READONLY" : ",READONLY"); } if ( (fieldAccess & RT_ACCESS_OPTIONAL) == RT_ACCESS_OPTIONAL ) { - ret += OString(ret.getLength() > 0 ? ",OPTIONAL" : "OPTIONAL"); + ret += OString(ret.isEmpty() ? "OPTIONAL" : ",OPTIONAL"); } if ( (fieldAccess & RT_ACCESS_MAYBEVOID) == RT_ACCESS_MAYBEVOID ) { - ret += OString(ret.getLength() > 0 ? ",MAYBEVOID" : "MAYBEVOID"); + ret += OString(ret.isEmpty() ? "MAYBEVOID" : ",MAYBEVOID"); } if ( (fieldAccess & RT_ACCESS_BOUND) == RT_ACCESS_BOUND ) { - ret += OString(ret.getLength() > 0 ? ",BOUND" : "BOUND"); + ret += OString(ret.isEmpty() ? "BOUND" : ",BOUND"); } if ( (fieldAccess & RT_ACCESS_CONSTRAINED) == RT_ACCESS_CONSTRAINED ) { - ret += OString(ret.getLength() > 0 ? ",CONSTRAINED" : "CONSTRAINED"); + ret += OString(ret.isEmpty() ? "CONSTRAINED" : ",CONSTRAINED"); } if ( (fieldAccess & RT_ACCESS_TRANSIENT) == RT_ACCESS_TRANSIENT ) { - ret += OString(ret.getLength() > 0 ? ",TRANSIENT" : "TRANSIENT"); + ret += OString(ret.isEmpty() ? "TRANSIENT" : ",TRANSIENT"); } if ( (fieldAccess & RT_ACCESS_MAYBEAMBIGUOUS) == RT_ACCESS_MAYBEAMBIGUOUS ) { - ret += OString(ret.getLength() > 0 ? ",MAYBEAMBIGUOUS" : "MAYBEAMBIGUOUS"); + ret += OString(ret.isEmpty() ? "MAYBEAMBIGUOUS" : ",MAYBEAMBIGUOUS"); } if ( (fieldAccess & RT_ACCESS_MAYBEDEFAULT) == RT_ACCESS_MAYBEDEFAULT ) { - ret += OString(ret.getLength() > 0 ? ",MAYBEDEFAULT" : "MAYBEDEFAULT"); + ret += OString(ret.isEmpty() ? "MAYBEDEFAULT" : ",MAYBEDEFAULT"); } if ( (fieldAccess & RT_ACCESS_REMOVEABLE) == RT_ACCESS_REMOVEABLE ) { - ret += OString(ret.getLength() > 0 ? ",REMOVEABLE" : "REMOVEABLE"); + ret += OString(ret.isEmpty() ? "REMOVEABLE" : ",REMOVEABLE"); } if ( (fieldAccess & RT_ACCESS_ATTRIBUTE) == RT_ACCESS_ATTRIBUTE ) { - ret += OString(ret.getLength() > 0 ? ",ATTRIBUTE" : "ATTRIBUTE"); + ret += OString(ret.isEmpty() ? "ATTRIBUTE" : ",ATTRIBUTE"); } if ( (fieldAccess & RT_ACCESS_PROPERTY) == RT_ACCESS_PROPERTY ) { - ret += OString(ret.getLength() > 0 ? ",PROPERTY" : "PROPERTY"); + ret += OString(ret.isEmpty() ? "PROPERTY" : ",PROPERTY"); } if ( (fieldAccess & RT_ACCESS_CONST) == RT_ACCESS_CONST ) { - ret += OString(ret.getLength() > 0 ? ",CONST" : "CONST"); + ret += OString(ret.isEmpty() ? "CONST" : ",CONST"); } if ( (fieldAccess & RT_ACCESS_READWRITE) == RT_ACCESS_READWRITE ) { - ret += OString(ret.getLength() > 0 ? ",READWRITE" : "READWRITE"); + ret += OString(ret.isEmpty() ? "READWRITE" : ",READWRITE"); } return ret; } |