summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--connectivity/source/drivers/file/fcode.cxx7
-rw-r--r--connectivity/source/drivers/postgresql/pq_tools.cxx16
-rw-r--r--sal/osl/all/debugbase.cxx3
-rw-r--r--sal/osl/unx/file_stat.cxx4
-rw-r--r--sal/osl/w32/file_dirvol.cxx4
-rw-r--r--sc/source/filter/oox/workbookhelper.cxx5
-rw-r--r--stoc/source/security/permissions.cxx6
-rw-r--r--ucb/source/ucp/file/prov.cxx2
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx15
9 files changed, 18 insertions, 44 deletions
diff --git a/connectivity/source/drivers/file/fcode.cxx b/connectivity/source/drivers/file/fcode.cxx
index 96793912a33e..e4c14261fa2d 100644
--- a/connectivity/source/drivers/file/fcode.cxx
+++ b/connectivity/source/drivers/file/fcode.cxx
@@ -305,12 +305,7 @@ bool OOp_COMPARE::operate(const OOperand* pLeft, const OOperand* pRight) const
case DataType::LONGVARCHAR:
{
OUString sLH = aLH, sRH = aRH;
- sal_Int32 nRes = rtl_ustr_compareIgnoreAsciiCase_WithLength
- (
- sLH.pData->buffer,
- sLH.pData->length,
- sRH.pData->buffer,
- sRH.pData->length );
+ sal_Int32 nRes = sLH.compareToIgnoreAsciiCase(sRH);
switch(aPredicateType)
{
case SQLFilterOperator::EQUAL: bResult = (nRes == 0); break;
diff --git a/connectivity/source/drivers/postgresql/pq_tools.cxx b/connectivity/source/drivers/postgresql/pq_tools.cxx
index 4d75e8c3bc57..ae9b304ad2af 100644
--- a/connectivity/source/drivers/postgresql/pq_tools.cxx
+++ b/connectivity/source/drivers/postgresql/pq_tools.cxx
@@ -769,9 +769,7 @@ OString extractSingleTableFromSelect( const OStringVector &vec )
token ++;
}
- if( token < vec.size() && rtl_str_compare_WithLength(
- vec[token].getStr(), vec[token].getLength(),
- RTL_CONSTASCII_STRINGPARAM("(") ) )
+ if( token < vec.size() && vec[token] == "(" )
{
// it is a table or a function name
OStringBuffer buf(128);
@@ -783,9 +781,7 @@ OString extractSingleTableFromSelect( const OStringVector &vec )
if( token < vec.size() )
{
- if( rtl_str_compare_WithLength(
- vec[token].getStr(), vec[token].getLength(),
- RTL_CONSTASCII_STRINGPARAM( "." ) ) == 0 )
+ if( vec[token] == "." )
{
buf.append( vec[token] );
token ++;
@@ -803,9 +799,7 @@ OString extractSingleTableFromSelect( const OStringVector &vec )
ret = buf.makeStringAndClear();
// now got my table candidate
- if( token < vec.size() && rtl_str_compare_WithLength(
- vec[token].getStr(), vec[token].getLength(),
- RTL_CONSTASCII_STRINGPARAM( "(" ) ) == 0 )
+ if( token < vec.size() && vec[token] == "(" )
{
// whoops, it is a function
ret.clear();
@@ -823,9 +817,7 @@ OString extractSingleTableFromSelect( const OStringVector &vec )
if( token < vec.size() )
{
- if( rtl_str_compare_WithLength(
- vec[token].getStr(), vec[token].getLength(),
- RTL_CONSTASCII_STRINGPARAM( "," ) ) == 0 )
+ if( vec[token] == "," )
{
// whoops, multiple tables are used
ret.clear();
diff --git a/sal/osl/all/debugbase.cxx b/sal/osl/all/debugbase.cxx
index ae097ee891b1..0f233f8b637b 100644
--- a/sal/osl/all/debugbase.cxx
+++ b/sal/osl/all/debugbase.cxx
@@ -91,8 +91,7 @@ bool SAL_CALL osl_detail_ObjectRegistry_storeAddresses( char const* pName )
return false;
// check for "all":
rtl::OString const& rFirst = rVec[0];
- if (rtl_str_compare_WithLength( rFirst.getStr(), rFirst.getLength(),
- RTL_CONSTASCII_STRINGPARAM("all") ) == 0)
+ if ( rFirst == "all" )
return true;
OStringVec::const_iterator const iEnd( rVec.end() );
return std::find_if( rVec.begin(), iEnd,
diff --git a/sal/osl/unx/file_stat.cxx b/sal/osl/unx/file_stat.cxx
index 7818282893b9..72d64f145501 100644
--- a/sal/osl/unx/file_stat.cxx
+++ b/sal/osl/unx/file_stat.cxx
@@ -427,9 +427,7 @@ SAL_CALL osl_identicalDirectoryItem( oslDirectoryItem a, oslDirectoryItem b)
if (a == b)
return sal_True;
/* same name => same item, unless renaming / moving madness has occurred */
- if (rtl_ustr_compare_WithLength(
- pA->m_ustrFilePath->buffer, pA->m_ustrFilePath->length,
- pB->m_ustrFilePath->buffer, pB->m_ustrFilePath->length ) == 0)
+ if (pA->m_ustrFilePath == pB->m_ustrFilePath)
return sal_True;
struct stat a_stat, b_stat;
diff --git a/sal/osl/w32/file_dirvol.cxx b/sal/osl/w32/file_dirvol.cxx
index bd5bb0272c93..5f8aef4c32fb 100644
--- a/sal/osl/w32/file_dirvol.cxx
+++ b/sal/osl/w32/file_dirvol.cxx
@@ -1151,9 +1151,7 @@ SAL_CALL osl_identicalDirectoryItem( oslDirectoryItem a, oslDirectoryItem b)
if (a == b)
return sal_True;
/* same name => same item, unless renaming / moving madness has occurred */
- if (rtl_ustr_compare_WithLength(
- pA->m_pFullPath->buffer, pA->m_pFullPath->length,
- pB->m_pFullPath->buffer, pB->m_pFullPath->length ) == 0)
+ if (pA->m_pFullPath == pB->m_pFullPath)
return sal_True;
// FIXME: as/when/if this is used in anger on Windows we could
diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index d264e5621d6c..1ced0d0b2c67 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -106,9 +106,8 @@ using ::oox::core::XmlFilterBase;
bool IgnoreCaseCompare::operator()( const OUString& rName1, const OUString& rName2 ) const
{
- // there is no wrapper in OUString, TODO: compare with collator
- return ::rtl_ustr_compareIgnoreAsciiCase_WithLength(
- rName1.getStr(), rName1.getLength(), rName2.getStr(), rName2.getLength() ) < 0;
+ // TODO: compare with collator
+ return rName1.compareToIgnoreAsciiCase(rName2 ) < 0;
}
class WorkbookGlobals : boost::noncopyable
diff --git a/stoc/source/security/permissions.cxx b/stoc/source/security/permissions.cxx
index d6f0f793ef9a..21397f9a5b34 100644
--- a/stoc/source/security/permissions.cxx
+++ b/stoc/source/security/permissions.cxx
@@ -380,8 +380,7 @@ bool FilePermission::implies( Permission const & perm ) const
if (m_url.getLength() > demanded.m_url.getLength())
return false;
// check /- wildcard: all files and recursive in that path
- if (1 < m_url.getLength() &&
- 0 == ::rtl_ustr_ascii_compare_WithLength( m_url.getStr() + m_url.getLength() - 2, 2, "/-" ))
+ if (m_url.endsWith("/-"))
{
// demanded url must start with granted path (including path trailing path sep)
sal_Int32 len = m_url.getLength() -1;
@@ -394,8 +393,7 @@ bool FilePermission::implies( Permission const & perm ) const
#endif
}
// check /* wildcard: all files in that path (not recursive!)
- if (1 < m_url.getLength() &&
- 0 == ::rtl_ustr_ascii_compare_WithLength( m_url.getStr() + m_url.getLength() - 2, 2, "/*" ))
+ if (m_url.endsWith("/*"))
{
// demanded url must start with granted path (including path trailing path sep)
sal_Int32 len = m_url.getLength() -1;
diff --git a/ucb/source/ucp/file/prov.cxx b/ucb/source/ucp/file/prov.cxx
index 6f14d0561414..e0159ad6499e 100644
--- a/ucb/source/ucp/file/prov.cxx
+++ b/ucb/source/ucp/file/prov.cxx
@@ -259,7 +259,7 @@ FileProvider::compareContentIds(
error = osl::FileBase::getSystemPathFromFileURL( aStatus2.getFileURL(), aPath2 );
if ( error == osl::FileBase::E_None )
- iComp = rtl_ustr_compareIgnoreAsciiCase( aPath1.getStr(), aPath2.getStr() );
+ iComp = aPath1.compareToIgnoreAsciiCase( aPath2 );
}
#endif
}
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index e28953866798..3a30cf3d6afe 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -484,27 +484,22 @@ SectionPropertyMap::~SectionPropertyMap()
OUString lcl_FindUnusedPageStyleName(const uno::Sequence< OUString >& rPageStyleNames)
{
- static const sal_Char cDefaultStyle[] = "Converted";
- //find the hightest number x in each style with the name "cDefaultStyle+x" and
+ static const char DEFAULT_STYLE[] = "Converted";
+ //find the highest number x in each style with the name "DEFAULT_STYLE+x" and
//return an incremented name
sal_Int32 nMaxIndex = 0;
- const sal_Int32 nDefaultLength = sizeof(cDefaultStyle)/sizeof(sal_Char) - 1;
- const OUString sDefaultStyle( cDefaultStyle, nDefaultLength, RTL_TEXTENCODING_ASCII_US );
const OUString* pStyleNames = rPageStyleNames.getConstArray();
for( sal_Int32 nStyle = 0; nStyle < rPageStyleNames.getLength(); ++nStyle)
{
- if( pStyleNames[nStyle].getLength() > nDefaultLength &&
- !rtl_ustr_compare_WithLength( sDefaultStyle.getStr(), nDefaultLength, pStyleNames[nStyle].getStr(), nDefaultLength))
+ if( pStyleNames[nStyle].startsWith(DEFAULT_STYLE) )
{
- sal_Int32 nIndex = pStyleNames[nStyle].copy( nDefaultLength ).toInt32();
+ sal_Int32 nIndex = pStyleNames[nStyle].copy( strlen(DEFAULT_STYLE) ).toInt32();
if( nIndex > nMaxIndex)
nMaxIndex = nIndex;
}
}
- OUString sRet( sDefaultStyle );
- sRet += OUString::number( nMaxIndex + 1);
- return sRet;
+ return DEFAULT_STYLE + OUString::number( nMaxIndex + 1);
}