diff options
92 files changed, 188 insertions, 208 deletions
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx index 43391664cfc0..98a9f62bf642 100644 --- a/basctl/source/basicide/bastypes.cxx +++ b/basctl/source/basicide/bastypes.cxx @@ -684,8 +684,8 @@ void CutLines( OUString& rStr, sal_Int32 nStartLine, sal_Int32 nLines, bool bEra { sal_Int32 n = nStartPos; sal_Int32 nLen = rStr.getLength(); - while ( ( n < nLen ) && ( rStr.getStr()[ n ] == LINE_SEP || - rStr.getStr()[ n ] == LINE_SEP_CR ) ) + while ( ( n < nLen ) && ( rStr[ n ] == LINE_SEP || + rStr[ n ] == LINE_SEP_CR ) ) { n++; } diff --git a/basctl/source/basicide/localizationmgr.cxx b/basctl/source/basicide/localizationmgr.cxx index dfbbfaaa6ef6..28123870d47a 100644 --- a/basctl/source/basicide/localizationmgr.cxx +++ b/basctl/source/basicide/localizationmgr.cxx @@ -235,7 +235,7 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties // Replace string by id, add id+string to StringResource if( eMode == SET_IDS ) { - bool bEscAlreadyExisting = (!aPropStr.isEmpty() && aPropStr.getStr()[0] == '&' ); + bool bEscAlreadyExisting = aPropStr.startsWith("&"); if( bEscAlreadyExisting ) continue; @@ -425,7 +425,7 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties for ( i = 0; i < nPropStringCount; ++i ) { OUString aPropStr = pPropStrings[i]; - bool bEscAlreadyExisting = (!aPropStr.isEmpty() && aPropStr.getStr()[0] == '&' ); + bool bEscAlreadyExisting = aPropStr.startsWith("&"); if( bEscAlreadyExisting ) { pIdStrings[i] = aPropStr; diff --git a/codemaker/source/codemaker/global.cxx b/codemaker/source/codemaker/global.cxx index bfe77c452af8..d6c5a0fae942 100644 --- a/codemaker/source/codemaker/global.cxx +++ b/codemaker/source/codemaker/global.cxx @@ -87,10 +87,10 @@ OString createFileNameFromType( const OString& destination, length += prefix.getLength() + type.getLength() + postfix.getLength(); sal_Bool withSeparator = sal_False; - if (destination.getStr()[destination.getLength()] != '\\' && - destination.getStr()[destination.getLength()] != '/' && - type.getStr()[0] != '\\' && - type.getStr()[0] != '/') + if (destination[destination.getLength()] != '\\' && + destination[destination.getLength()] != '/' && + type[0] != '\\' && + type[0] != '/') { length++; withSeparator = sal_True; diff --git a/comphelper/source/misc/accessibletexthelper.cxx b/comphelper/source/misc/accessibletexthelper.cxx index a724fdfe185e..224a81ac6774 100644 --- a/comphelper/source/misc/accessibletexthelper.cxx +++ b/comphelper/source/misc/accessibletexthelper.cxx @@ -241,7 +241,7 @@ namespace comphelper if ( !implIsValidIndex( nIndex, sText.getLength() ) ) throw IndexOutOfBoundsException(); - return sText.getStr()[nIndex]; + return sText[nIndex]; } // ----------------------------------------------------------------------------- diff --git a/comphelper/source/misc/docpasswordhelper.cxx b/comphelper/source/misc/docpasswordhelper.cxx index 1cf977547d66..6f177e68bf2a 100644 --- a/comphelper/source/misc/docpasswordhelper.cxx +++ b/comphelper/source/misc/docpasswordhelper.cxx @@ -222,7 +222,7 @@ sal_uInt16 DocPasswordHelper::GetXLHashAsUINT16( for ( sal_Int32 nInd = aString.getLength() - 1; nInd >= 0; nInd-- ) { nResult = ( ( nResult >> 14 ) & 0x01 ) | ( ( nResult << 1 ) & 0x7FFF ); - nResult ^= aString.getStr()[nInd]; + nResult ^= aString[nInd]; } nResult = ( ( nResult >> 14 ) & 0x01 ) | ( ( nResult << 1 ) & 0x7FFF ); diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx index 1b371487ad31..a4f36e8db0b0 100644 --- a/comphelper/source/misc/storagehelper.cxx +++ b/comphelper/source/misc/storagehelper.cxx @@ -490,7 +490,7 @@ sal_Bool OStorageHelper::PathHasSegment( const OUString& aPath, const OUString& if ( !bResult && !aPath.compareTo( aSegment, nSegLen ) ) { - if ( nPathLen == nSegLen || aPath.getStr()[nSegLen] == (sal_Unicode)'/' ) + if ( nPathLen == nSegLen || aPath[nSegLen] == '/' ) bResult = sal_True; } diff --git a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx index e5962c7c3973..d4867693fd13 100644 --- a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx +++ b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx @@ -67,9 +67,7 @@ static bool makeCanonicalFileURL( OUString & rURL ) if ( !aNormalizedURL.isEmpty() ) { - if ( aNormalizedURL - .getStr()[ aNormalizedURL.getLength() - 1 ] - != sal_Unicode( '/' ) ) + if ( !aNormalizedURL.endsWith("/") ) rURL = aNormalizedURL; else rURL = aNormalizedURL diff --git a/connectivity/source/commontools/predicateinput.cxx b/connectivity/source/commontools/predicateinput.cxx index 82d170266684..f27bc142da55 100644 --- a/connectivity/source/commontools/predicateinput.cxx +++ b/connectivity/source/commontools/predicateinput.cxx @@ -67,7 +67,7 @@ namespace dbtools sal_Unicode nReturn( _nFallback ); if ( !_rSeparator.isEmpty() ) - nReturn = static_cast< sal_Char >( _rSeparator.getStr()[0] ); + nReturn = static_cast< sal_Char >( _rSeparator[0] ); return nReturn; } @@ -150,8 +150,8 @@ namespace dbtools { // yes -> force a quoted text and try again OUString sQuoted( _rStatement ); if ( !sQuoted.isEmpty() - && ( (sQuoted.getStr()[0] != '\'') - || (sQuoted.getStr()[ sQuoted.getLength() - 1 ] != '\'' ) + && ( !sQuoted.startsWith("'") + || !sQuoted.endsWith("'") ) ) { @@ -296,9 +296,7 @@ namespace dbtools // '-characters to the text. If we would give this to predicateTree this would add // two additional '-characters which we don't want. So check the field format. // FS - 06.01.00 - 71532 - sal_Bool bValidQuotedText = ( sValue.getLength() >= 2 ) - && ( sValue.getStr()[0] == '\'' ) - && ( sValue.getStr()[ sValue.getLength() - 1 ] == '\'' ); + sal_Bool bValidQuotedText = sValue.startsWith("'") && sValue.endsWith("'"); // again : as normalizePredicateString always did a conversion on the value text, // bValidQuotedText == sal_True implies that we have a text field, as no other field // values will be formatted with the quote characters diff --git a/connectivity/source/drivers/file/FDatabaseMetaData.cxx b/connectivity/source/drivers/file/FDatabaseMetaData.cxx index 3e26231dc936..a70e58814d20 100644 --- a/connectivity/source/drivers/file/FDatabaseMetaData.cxx +++ b/connectivity/source/drivers/file/FDatabaseMetaData.cxx @@ -290,7 +290,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables( { if (aURL.getExtension().isEmpty()) { - sal_Unicode nChar = aURL.getBase().getStr()[0]; + sal_Unicode nChar = aURL.getBase()[0]; if(match(tableNamePattern,aURL.getBase(),'\0') && ( !bCheckEnabled || ( bCheckEnabled && ((nChar < '0' || nChar > '9')))) ) { aRow.push_back(new ORowSetValueDecorator(OUString(aURL.getBase()))); diff --git a/connectivity/source/drivers/file/FStringFunctions.cxx b/connectivity/source/drivers/file/FStringFunctions.cxx index acac9ac82a93..a5cf7ce486ce 100644 --- a/connectivity/source/drivers/file/FStringFunctions.cxx +++ b/connectivity/source/drivers/file/FStringFunctions.cxx @@ -160,7 +160,7 @@ ORowSetValue OOp_RTrim::operate(const ORowSetValue& lhs) const OUString sRet = lhs; OUString sNew = sRet.trim(); - return sRet.copy(0,sRet.lastIndexOf(sNew.getStr()[sNew.getLength()-1])+1); + return sRet.copy(0,sRet.lastIndexOf(sNew[sNew.getLength()-1])+1); } //------------------------------------------------------------------ ORowSetValue OOp_Space::operate(const ORowSetValue& lhs) const diff --git a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx index d4c9ea1a5494..295784fb0f4c 100644 --- a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx +++ b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx @@ -1807,7 +1807,7 @@ static void columnMetaData2DatabaseTypeDescription( i++; int start = i; while( array[i] && array[i] != '}' && array[i] != ',' ) i++; - row[3] <<= OUString( &array.getStr()[start], i - start ); + row[3] <<= array.copy(start, i - start ); vec.push_back( row ); } } diff --git a/connectivity/source/drivers/postgresql/pq_tools.cxx b/connectivity/source/drivers/postgresql/pq_tools.cxx index 79f383cd027f..ed7e514073c8 100644 --- a/connectivity/source/drivers/postgresql/pq_tools.cxx +++ b/connectivity/source/drivers/postgresql/pq_tools.cxx @@ -363,7 +363,7 @@ OUString extractTableFromInsert( const OUString & sql ) } } } - ret = OUString( &sql.getStr()[start], i - start ).trim(); + ret = sql.copy(start, i - start ).trim(); // printf( "pq_statement: parsed table name %s from insert\n" , // OUStringToOString( ret, RTL_TEXTENCODING_ASCII_US).getStr() ); } diff --git a/cppuhelper/source/unourl.cxx b/cppuhelper/source/unourl.cxx index c5981f9a4264..a9aa133f7fdc 100644 --- a/cppuhelper/source/unourl.cxx +++ b/cppuhelper/source/unourl.cxx @@ -72,7 +72,7 @@ inline UnoUrlDescriptor::Impl::Impl(rtl::OUString const & rDescriptor) for (sal_Int32 i = 0;; ++i) { bool bEnd = i == rDescriptor.getLength(); - sal_Unicode c = bEnd ? 0 : rDescriptor.getStr()[i]; + sal_Unicode c = bEnd ? 0 : rDescriptor[i]; switch (eState) { case STATE_NAME0: @@ -236,7 +236,7 @@ inline UnoUrl::Impl * UnoUrl::Impl::create(rtl::OUString const & rUrl) rtl::OUString("UNO URL contains empty ObjectName")); for (j = i; j < rUrl.getLength(); ++j) { - sal_Unicode c = rUrl.getStr()[j]; + sal_Unicode c = rUrl[j]; if (!isAlphanum(c) && c != 0x21 && c != 0x24 // '!', '$' && c != 0x26 && c != 0x27 && c != 0x28 // '&', ''', '(' && c != 0x28 && c != 0x2A && c != 0x2B // ')', '*', '+' diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx index 6157c749c414..6ae616a43586 100644 --- a/cui/source/dialogs/thesdlg.cxx +++ b/cui/source/dialogs/thesdlg.cxx @@ -271,8 +271,7 @@ uno::Sequence< uno::Reference< linguistic2::XMeaning > > SvxThesaurusDialog::que xThesaurus->queryMeanings( rTerm, rLocale, rProperties ) ); // text with '.' at the end? - if ( 0 == aMeanings.getLength() && !rTerm.isEmpty() && - rTerm.getStr()[ rTerm.getLength() - 1 ] == '.') + if ( 0 == aMeanings.getLength() && rTerm.endsWith(".") ) { // try again without trailing '.' chars. It may be a word at the // end of a sentence and not an abbreviation... diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index 6b21a99a2a57..d646da233c10 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -320,8 +320,8 @@ IMPL_LINK_NOARG(SvxSingleNumPickTabPage, NumSelectHdl_Impl) return 0; SvxNumSettings_Impl* _pSet = &aNumSettingsArr[nIdx]; sal_Int16 eNewType = _pSet->nNumberType; - const sal_Unicode cLocalPrefix = !_pSet->sPrefix.isEmpty() ? _pSet->sPrefix.getStr()[0] : 0; - const sal_Unicode cLocalSuffix = !_pSet->sSuffix.isEmpty() ? _pSet->sSuffix.getStr()[0] : 0; + const sal_Unicode cLocalPrefix = !_pSet->sPrefix.isEmpty() ? _pSet->sPrefix[0] : 0; + const sal_Unicode cLocalSuffix = !_pSet->sSuffix.isEmpty() ? _pSet->sSuffix[0] : 0; sal_uInt16 nMask = 1; for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) @@ -730,7 +730,7 @@ IMPL_LINK_NOARG(SvxNumPickTabPage, NumSelectHdl_Impl) aFmt.SetBulletFont( &rActBulletFont ); aFmt.SetBulletChar( !pLevelSettings->sBulletChar.isEmpty() - ? pLevelSettings->sBulletChar.getStr()[0] + ? pLevelSettings->sBulletChar[0] : 0 ); aFmt.SetCharFmtName( sBulletCharFmtName ); // #62069# // #92724# diff --git a/dbaccess/source/core/recovery/dbdocrecovery.cxx b/dbaccess/source/core/recovery/dbdocrecovery.cxx index 312a6862fc18..f3de5ebba01b 100644 --- a/dbaccess/source/core/recovery/dbdocrecovery.cxx +++ b/dbaccess/source/core/recovery/dbdocrecovery.cxx @@ -102,7 +102,7 @@ namespace dbaccess return false; } o_rCompDesc.sName = i_rIniLine.copy( nEqualSignPos + 1, nCommaPos - nEqualSignPos - 1 ); - o_rCompDesc.bForEditing = ( i_rIniLine.getStr()[ nCommaPos + 1 ] == '1' ); + o_rCompDesc.bForEditing = ( i_rIniLine[ nCommaPos + 1 ] == '1' ); return true; } @@ -152,7 +152,7 @@ namespace dbaccess static bool lcl_isSectionStart( const OUString& i_rIniLine, OUString& o_rSectionName ) { const sal_Int32 nLen = i_rIniLine.getLength(); - if ( ( nLen > 0 ) && ( i_rIniLine.getStr()[0] == '[' ) && ( i_rIniLine.getStr()[ nLen - 1 ] == ']' ) ) + if ( i_rIniLine.startsWith("[") && i_rIniLine.endsWith("]") ) { o_rSectionName = i_rIniLine.copy( 1, nLen -2 ); return true; @@ -163,7 +163,7 @@ namespace dbaccess static void lcl_stripTrailingLineFeed( OUString& io_rLine ) { const sal_Int32 nLen = io_rLine.getLength(); - if ( ( nLen > 0 ) && ( io_rLine.getStr()[ nLen - 1 ] == '\n' ) ) + if ( io_rLine.endsWith("\n") ) io_rLine = io_rLine.copy( 0, nLen - 1 ); } diff --git a/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx b/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx index 24f5795d9777..126dbe865552 100644 --- a/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx +++ b/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx @@ -73,7 +73,7 @@ OXMLFileBasedDatabase::OXMLFileBasedDatabase( ODBFilter& rImport, if ( sValue == sFileName ) { const sal_Int32 nFileNameLength = sFileName.getLength(); - if ( ( nFileNameLength > 0 ) && ( sFileName.getStr()[ nFileNameLength - 1 ] == '/' ) ) + if ( sFileName.endsWith("/") ) sFileName = sFileName.copy( 0, nFileNameLength - 1 ); sLocation = ::svt::OFileNotation( rImport.GetAbsoluteReference( sFileName ) ).get( ::svt::OFileNotation::N_SYSTEM ); diff --git a/editeng/source/editeng/textconv.cxx b/editeng/source/editeng/textconv.cxx index 00ba1e6c4cd0..1fb5848026ba 100644 --- a/editeng/source/editeng/textconv.cxx +++ b/editeng/source/editeng/textconv.cxx @@ -483,7 +483,7 @@ void TextConvWrapper::ChangeText( const OUString &rNewText, nIndex = static_cast< xub_StrLen >( rOrigText.getLength() ); } - if (rOrigText.getStr()[nIndex] == rNewText[nPos] || + if (rOrigText[nIndex] == rNewText[nPos] || nPos == nConvTextLen /* end of string also terminates non-matching char sequence */) { // substring that needs to be replaced found? diff --git a/extensions/source/plugin/base/nfuncs.cxx b/extensions/source/plugin/base/nfuncs.cxx index f827026095f4..d56e02a9b7f5 100644 --- a/extensions/source/plugin/base/nfuncs.cxx +++ b/extensions/source/plugin/base/nfuncs.cxx @@ -146,13 +146,13 @@ static OString normalizeURL( XPlugin_Impl* plugin, const OString& url ) int nPos; if( ( nPos = aLoadURL.indexOf( "://" ) ) != -1 ) { - if( !url.isEmpty() && (url.getStr()[ 0 ] == '/' || url.indexOf( '/' ) != -1) ) + if( url.indexOf( '/' ) != -1 ) { // this means same server but new path nPos = aLoadURL.indexOf( '/', nPos+3 ); if( nPos != -1 ) - aLoadURL = aLoadURL.copy( 0, url.getStr()[0] == '/' ? nPos : nPos+1 ); + aLoadURL = aLoadURL.copy( 0, url.startsWith("/") ? nPos : nPos+1 ); } else { diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx index 61c2c0e7496f..395b564291be 100644 --- a/extensions/source/propctrlr/standardcontrol.cxx +++ b/extensions/source/propctrlr/standardcontrol.cxx @@ -204,7 +204,7 @@ namespace pcr if ( m_bIsPassword ) { if ( !sText.isEmpty() ) - aPropValue <<= (sal_Int16)sText.getStr()[0]; + aPropValue <<= (sal_Int16)sText[0]; } else aPropValue <<= sText; diff --git a/filter/source/msfilter/rtfutil.cxx b/filter/source/msfilter/rtfutil.cxx index 4c21c3a18ff9..54714567337b 100644 --- a/filter/source/msfilter/rtfutil.cxx +++ b/filter/source/msfilter/rtfutil.cxx @@ -97,7 +97,7 @@ OString OutChar(sal_Unicode c, int *pUCMode, rtl_TextEncoding eDestEnc, bool* pS for (sal_Int32 nI = 0; nI < nLen; ++nI) { aBuf.append("\\'"); - aBuf.append(OutHex(sConverted.getStr()[nI], 2)); + aBuf.append(OutHex(sConverted[nI], 2)); } } } diff --git a/filter/source/placeware/tempfile.cxx b/filter/source/placeware/tempfile.cxx index faa8b5658e06..1a40047a9659 100644 --- a/filter/source/placeware/tempfile.cxx +++ b/filter/source/placeware/tempfile.cxx @@ -141,7 +141,7 @@ OUString PlaceWareTempFile::createTempFileURL() { u %= (nRadix*nRadix*nRadix); OUString aTmp( aTempDirURL ); - if( aTmp.getStr()[ aTmp.getLength() - 1 ] != sal_Unicode( '/' ) ) + if( !aTmp.endsWith("/") ) aTmp += "/"; aTmp += OUString::number( (unsigned) u, nRadix ); aTmp += ".tmp"; diff --git a/forms/source/component/clickableimage.cxx b/forms/source/component/clickableimage.cxx index df1dd0114017..63bf2d70ee1b 100644 --- a/forms/source/component/clickableimage.cxx +++ b/forms/source/component/clickableimage.cxx @@ -271,7 +271,7 @@ namespace frm aURL.Complete = getString(xSet->getPropertyValue(PROPERTY_TARGET_URL)); - if (!aURL.Complete.isEmpty() && (LOCAL_URL_PREFIX == aURL.Complete.getStr()[0])) + if (!aURL.Complete.isEmpty() && (LOCAL_URL_PREFIX == aURL.Complete[0])) { // the URL contains a local URL only. Since the URLTransformer does not handle this case correctly // (it can't: it does not know the document URL), we have to take care for this ourself. // The real solution would be to not allow such relative URLs (there is a rule that at runtime, all diff --git a/framework/source/xml/imagesdocumenthandler.cxx b/framework/source/xml/imagesdocumenthandler.cxx index 2280126b22ee..ec14d8f109ec 100644 --- a/framework/source/xml/imagesdocumenthandler.cxx +++ b/framework/source/xml/imagesdocumenthandler.cxx @@ -227,15 +227,12 @@ throw( SAXException, RuntimeException ) { OUString aColor = xAttribs->getValueByIndex( n ); - if ( !aColor.isEmpty() ) + if ( aColor.startsWith("#") ) { - if ( aColor.getStr()[0] == '#' ) - { - // the color value is given as #rrggbb and used the hexadecimal system!! - sal_uInt32 nColor = aColor.copy( 1 ).toUInt32( 16 ); + // the color value is given as #rrggbb and used the hexadecimal system!! + sal_uInt32 nColor = aColor.copy( 1 ).toUInt32( 16 ); - m_pImages->aMaskColor = Color( COLORDATA_RGB( nColor ) ); - } + m_pImages->aMaskColor = Color( COLORDATA_RGB( nColor ) ); } } break; diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx b/i18npool/qa/cppunit/test_breakiterator.cxx index 6e8b288174de..59b6d4cf68af 100644 --- a/i18npool/qa/cppunit/test_breakiterator.cxx +++ b/i18npool/qa/cppunit/test_breakiterator.cxx @@ -739,7 +739,7 @@ void TestBreakIterator::testWeak() sal_Int16 nScript = m_xBreak->getScriptType(aWeaks, i); OStringBuffer aMsg; aMsg.append(RTL_CONSTASCII_STRINGPARAM("Char 0x")); - aMsg.append(static_cast<sal_Int32>(aWeaks.getStr()[i]), 16); + aMsg.append(static_cast<sal_Int32>(aWeaks[i]), 16); aMsg.append(RTL_CONSTASCII_STRINGPARAM(" should have been weak")); CPPUNIT_ASSERT_MESSAGE(aMsg.getStr(), nScript == i18n::ScriptType::WEAK); @@ -778,7 +778,7 @@ void TestBreakIterator::testAsian() sal_Int16 nScript = m_xBreak->getScriptType(aAsians, i); OStringBuffer aMsg; aMsg.append(RTL_CONSTASCII_STRINGPARAM("Char 0x")); - aMsg.append(static_cast<sal_Int32>(aAsians.getStr()[i]), 16); + aMsg.append(static_cast<sal_Int32>(aAsians[i]), 16); aMsg.append(RTL_CONSTASCII_STRINGPARAM(" should have been asian")); CPPUNIT_ASSERT_MESSAGE(aMsg.getStr(), nScript == i18n::ScriptType::ASIAN); diff --git a/i18npool/source/characterclassification/cclass_unicode_parser.cxx b/i18npool/source/characterclassification/cclass_unicode_parser.cxx index adf9737a09b6..2c372eb01f80 100644 --- a/i18npool/source/characterclassification/cclass_unicode_parser.cxx +++ b/i18npool/source/characterclassification/cclass_unicode_parser.cxx @@ -458,8 +458,8 @@ void cclass_Unicode::initParserTable( const Locale& rLocale, sal_Int32 startChar mxLocaleData->getLocaleItem( aParserLocale ); //!TODO: theoretically separators may be a string, adjustment would have to be //! done here and in parsing and in ::rtl::math::stringToDouble() - cGroupSep = aItem.thousandSeparator.getStr()[0]; - cDecimalSep = aItem.decimalSeparator.getStr()[0]; + cGroupSep = aItem.thousandSeparator[0]; + cDecimalSep = aItem.decimalSeparator[0]; } if ( cGroupSep < nDefCnt ) diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx index 2b1fed680665..46696770d5e0 100644 --- a/i18npool/source/localedata/LocaleNode.cxx +++ b/i18npool/source/localedata/LocaleNode.cxx @@ -419,14 +419,14 @@ void LCCTYPENode::generateCode (const OFileWriter &of) const sepNode = findNode("LongDateDayOfWeekSeparator"); aLDS = sepNode->getValue(); of.writeParameter("LongDateDayOfWeekSeparator", aLDS); - if (aLDS.getLength() == 1 && aLDS.getStr()[0] == ',') + if (aLDS == ",") fprintf( stderr, "Warning: %s\n", "LongDateDayOfWeekSeparator is only a comma not followed by a space. Usually this is not the case and may lead to concatenated display names like \"Wednesday,May 9, 2007\"."); sepNode = findNode("LongDateDaySeparator"); aLDS = sepNode->getValue(); of.writeParameter("LongDateDaySeparator", aLDS); - if (aLDS.getLength() == 1 && (aLDS.getStr()[0] == ',' || aLDS.getStr()[0] == '.')) + if (aLDS == "," || aLDS == ".") fprintf( stderr, "Warning: %s\n", "LongDateDaySeparator is only a comma or dot not followed by a space. Usually this is not the case and may lead to concatenated display names like \"Wednesday, May 9,2007\"."); @@ -459,7 +459,7 @@ void LCCTYPENode::generateCode (const OFileWriter &of) const if (aListSep == aThoSep) fprintf( stderr, "Warning: %s\n", "ListSeparator equals ThousandSeparator."); - if (aListSep.getLength() != 1 || aListSep.getStr()[0] != ';') + if (aListSep.getLength() != 1 || aListSep[0] != ';') { incError( "ListSeparator not ';' semicolon. Strongly recommended. Currently required."); ++nSavErr; // format codes not affected diff --git a/idlc/source/idlcmain.cxx b/idlc/source/idlcmain.cxx index 1bff70824b00..89b770bfe7c3 100644 --- a/idlc/source/idlcmain.cxx +++ b/idlc/source/idlcmain.cxx @@ -126,8 +126,8 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) OString depFileUrl; if (options.isValid("-M")) { depFileUrl = convertToFileUrl(options.getOption("-M")); - if ('/' != depFileUrl.getStr()[depFileUrl.getLength()-1]) { - depFileUrl += OString('/'); + if (!depFileUrl.endsWith("/")) { + depFileUrl += "/"; } depFileUrl += strippedFileName.replaceAt( strippedFileName.getLength() -3 , 3, "d"); diff --git a/include/rtl/ustrbuf.hxx b/include/rtl/ustrbuf.hxx index f7d640c0e415..baf6daf014b8 100644 --- a/include/rtl/ustrbuf.hxx +++ b/include/rtl/ustrbuf.hxx @@ -384,6 +384,21 @@ public: } /** + Access to individual characters. + + @param index must be non-negative and less than length. + + @return a reference to the character at the given index. + + @since LibreOffice 4.2 + */ + const sal_Unicode & operator [](sal_Int32 index) const + { + assert(index >= 0 && index < pData->length); + return pData->buffer[index]; + } + + /** Return a OUString instance reflecting the current content of this OUStringBuffer. */ diff --git a/linguistic/source/hhconvdic.cxx b/linguistic/source/hhconvdic.cxx index 7616f64d6e23..c26353fb2f55 100644 --- a/linguistic/source/hhconvdic.cxx +++ b/linguistic/source/hhconvdic.cxx @@ -76,7 +76,7 @@ sal_Bool TextIsAllScriptType( const OUString &rTxt, sal_Int16 nScriptType ) sal_Bool bIsAll = sal_True; for (sal_Int32 i = 0; i < rTxt.getLength() && bIsAll; ++i) { - if (checkScriptType( rTxt.getStr()[i]) != nScriptType) + if (checkScriptType( rTxt[i]) != nScriptType) bIsAll = sal_False; } return bIsAll; diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx index 1a7f61763db9..d979d531969e 100644 --- a/linguistic/source/misc.cxx +++ b/linguistic/source/misc.cxx @@ -178,8 +178,8 @@ sal_Int32 LevDistance( const OUString &rTxt1, const OUString &rTxt2 ) { for (k = 1; k <= nLen2; ++k) { - sal_Unicode c1i = rTxt1.getStr()[i - 1]; - sal_Unicode c2k = rTxt2.getStr()[k - 1]; + sal_Unicode c1i = rTxt1[i - 1]; + sal_Unicode c2k = rTxt2[k - 1]; sal_Int32 nCost = c1i == c2k ? 0 : 1; sal_Int32 nNew = Minimum( aData.Value(i-1, k ) + 1, aData.Value(i , k-1) + 1, @@ -188,9 +188,9 @@ sal_Int32 LevDistance( const OUString &rTxt1, const OUString &rTxt2 ) if (2 < i && 2 < k) { int nT = aData.Value(i-2, k-2) + 1; - if (rTxt1.getStr()[i - 2] != c1i) + if (rTxt1[i - 2] != c1i) ++nT; - if (rTxt2.getStr()[k - 2] != c2k) + if (rTxt2[k - 2] != c2k) ++nT; if (nT < nNew) nNew = nT; diff --git a/package/source/manifest/ManifestImport.cxx b/package/source/manifest/ManifestImport.cxx index d14fdc60281e..00829a535f22 100644 --- a/package/source/manifest/ManifestImport.cxx +++ b/package/source/manifest/ManifestImport.cxx @@ -396,7 +396,7 @@ OUString ManifestImport::PushNameAndNamespaces( const OUString& aName, const uno OUString aAttrValue = xAttribs->getValueByIndex( nInd ); if ( aAttrName.getLength() >= 5 && aAttrName.startsWith("xmlns") - && ( aAttrName.getLength() == 5 || aAttrName.getStr()[5] == ( sal_Unicode )':' ) ) + && ( aAttrName.getLength() == 5 || aAttrName[5] == ':' ) ) { // this is a namespace declaration OUString aNsName( ( aAttrName.getLength() == 5 ) ? OUString() : aAttrName.copy( 6 ) ); diff --git a/reportdesign/source/core/misc/conditionalexpression.cxx b/reportdesign/source/core/misc/conditionalexpression.cxx index 2a278a9a13fd..08c1fcf6bd69 100644 --- a/reportdesign/source/core/misc/conditionalexpression.cxx +++ b/reportdesign/source/core/misc/conditionalexpression.cxx @@ -39,7 +39,7 @@ namespace rptui while ( nPatternIndex > -1 ) { const OUString* pReplace = NULL; - switch ( sExpression.getStr()[ nPatternIndex + 1 ] ) + switch ( sExpression[ nPatternIndex + 1 ] ) { case '$': pReplace = &_rFieldDataSource; break; case '1': pReplace = &_rLHS; break; diff --git a/reportdesign/source/core/sdr/formatnormalizer.cxx b/reportdesign/source/core/sdr/formatnormalizer.cxx index 97168a5213b9..0532817442a2 100644 --- a/reportdesign/source/core/sdr/formatnormalizer.cxx +++ b/reportdesign/source/core/sdr/formatnormalizer.cxx @@ -227,7 +227,7 @@ namespace rptui // not bound to a table field // TODO: we might also do this kind of thing for functions and expressions ... return; - if ( sDataField.getStr()[ sDataField.getLength() - 1 ] != ']' ) + if ( !sDataField.endsWith("]") ) { // last character is not the closing brace OSL_FAIL( "FormatNormalizer::impl_adjustFormatToDataFieldType_nothrow: suspicious data field value!" ); diff --git a/sal/osl/unx/uunxapi.cxx b/sal/osl/unx/uunxapi.cxx index d4116456b083..a9f3c5ff6d2a 100644 --- a/sal/osl/unx/uunxapi.cxx +++ b/sal/osl/unx/uunxapi.cxx @@ -128,9 +128,9 @@ int access_u(const rtl_uString* pustrPath, int mode) { rtl::OString fn = OUStringToOString(pustrPath); #ifdef ANDROID - if (strncmp(fn.getStr(), "/assets", sizeof("/assets")-1) == 0 && - (fn.getStr()[sizeof("/assets")-1] == '\0' || - fn.getStr()[sizeof("/assets")-1] == '/')) + if (fn.startsWith("/assets") && + (fn[sizeof("/assets")-1] == '\0' || + fn[sizeof("/assets")-1] == '/')) { struct stat stat; if (lo_apk_lstat(fn.getStr(), &stat) == -1) @@ -161,9 +161,9 @@ sal_Bool realpath_u(const rtl_uString* pustrFileName, rtl_uString** ppustrResolv { rtl::OString fn = OUStringToOString(pustrFileName); #ifdef ANDROID - if (strncmp(fn.getStr(), "/assets", sizeof("/assets")-1) == 0 && - (fn.getStr()[sizeof("/assets")-1] == '\0' || - fn.getStr()[sizeof("/assets")-1] == '/')) + if (fn.startsWith("/assets") && + (fn[sizeof("/assets")-1] == '\0' || + fn[sizeof("/assets")-1] == '/')) { if (access_u(pustrFileName, F_OK) == -1) return sal_False; diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 685a8df95206..991039c1e19b 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -1596,8 +1596,8 @@ bool ScColumn::ParseString( if (rDecSep.getLength() != 1 || rGroupSep.getLength() != 1) break; - sal_Unicode dsep = rDecSep.getStr()[0]; - sal_Unicode gsep = rGroupSep.getStr()[0]; + sal_Unicode dsep = rDecSep[0]; + sal_Unicode gsep = rGroupSep[0]; if (!ScStringUtil::parseSimpleNumber(rString, dsep, gsep, nVal)) break; diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx index fa0e0aab5c09..b5a2e3c38093 100644 --- a/sc/source/core/tool/chgtrack.cxx +++ b/sc/source/core/tool/chgtrack.cxx @@ -1421,7 +1421,7 @@ void ScChangeActionContent::SetValueString( OUString& rValue, ScCellValue& rCell, const OUString& rStr, ScDocument* pDoc ) { rCell.clear(); - if ( rStr.getLength() > 1 && rStr.getStr()[0] == '=' ) + if ( rStr.getLength() > 1 && rStr[0] == '=' ) { rValue = EMPTY_OUSTRING; rCell.meType = CELLTYPE_FORMULA; diff --git a/sc/source/core/tool/formulaopt.cxx b/sc/source/core/tool/formulaopt.cxx index 5580c23df13b..16ad17f1ff32 100644 --- a/sc/source/core/tool/formulaopt.cxx +++ b/sc/source/core/tool/formulaopt.cxx @@ -86,8 +86,8 @@ void ScFormulaOptions::GetDefaultFormulaSeparators( // Something is wrong. Stick with the default separators. return; - sal_Unicode cDecSep = rDecSep.getStr()[0]; - sal_Unicode cListSep = rListSep.getStr()[0]; + sal_Unicode cDecSep = rDecSep[0]; + sal_Unicode cListSep = rListSep[0]; // Excel by default uses system's list separator as the parameter // separator, which in English locales is a comma. However, OOo's list diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index b53700951a06..fd2fad955cab 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -904,8 +904,8 @@ OUString lclEncodeDosUrl( else if ( aOldUrl.getLength() > 2 && aOldUrl.copy(1,2) == ":\\" ) { // drive letter - sal_Unicode cThisDrive = rBase.isEmpty() ? ' ' : rBase.getStr()[0]; - sal_Unicode cDrive = aOldUrl.getStr()[0]; + sal_Unicode cThisDrive = rBase.isEmpty() ? ' ' : rBase[0]; + sal_Unicode cDrive = aOldUrl[0]; if (cThisDrive == cDrive) // This document and the referenced document are under the same drive. aBuf.append(EXC_URL_DRIVEROOT); diff --git a/sc/source/filter/excel/xeroot.cxx b/sc/source/filter/excel/xeroot.cxx index 9042cbaae8ce..be02afc9b425 100644 --- a/sc/source/filter/excel/xeroot.cxx +++ b/sc/source/filter/excel/xeroot.cxx @@ -321,7 +321,7 @@ uno::Sequence< beans::NamedValue > XclExpRoot::GenerateEncryptionData( const OUS sal_uInt16 pnPasswd[16]; memset( pnPasswd, 0, sizeof( pnPasswd ) ); for (xub_StrLen nChar = 0; nChar < aPass.getLength(); ++nChar ) - pnPasswd[nChar] = aPass.getStr()[nChar]; + pnPasswd[nChar] = aPass[nChar]; ::msfilter::MSCodec_Std97 aCodec; aCodec.InitKey( pnPasswd, pnDocId ); diff --git a/sc/source/filter/excel/xistream.cxx b/sc/source/filter/excel/xistream.cxx index d4cb870ebf42..5dd944ee3556 100644 --- a/sc/source/filter/excel/xistream.cxx +++ b/sc/source/filter/excel/xistream.cxx @@ -150,7 +150,7 @@ uno::Sequence< beans::NamedValue > XclImpBiff5Decrypter::OnVerifyPassword( const ::std::vector< sal_uInt16 > aPassVect( 16 ); ::std::vector< sal_uInt16 >::iterator aIt = aPassVect.begin(); for( sal_Int32 nInd = 0; nInd < nLen; ++nInd, ++aIt ) - *aIt = static_cast< sal_uInt16 >( rPassword.getStr()[nInd] ); + *aIt = static_cast< sal_uInt16 >( rPassword[nInd] ); uno::Sequence< sal_Int8 > aDocId = ::comphelper::DocPasswordHelper::GenerateRandomByteSequence( 16 ); OSL_ENSURE( aDocId.getLength() == 16, "Unexpected length of the senquence!" ); diff --git a/sc/source/filter/excel/xltools.cxx b/sc/source/filter/excel/xltools.cxx index 51b4278a14cd..e0713e4902b0 100644 --- a/sc/source/filter/excel/xltools.cxx +++ b/sc/source/filter/excel/xltools.cxx @@ -513,7 +513,7 @@ sal_Unicode XclTools::GetBuiltInDefNameIndex( const OUString& rDefName ) { // name can be followed by underline or space character xub_StrLen nNextCharPos = nPrefixLen + nBuiltInLen; - sal_Unicode cNextChar = (rDefName.getLength() > nNextCharPos) ? rDefName.getStr()[nNextCharPos] : '\0'; + sal_Unicode cNextChar = (rDefName.getLength() > nNextCharPos) ? rDefName[nNextCharPos] : '\0'; if( (cNextChar == '\0') || (cNextChar == ' ') || (cNextChar == '_') ) return cBuiltIn; } diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index eaa05a1de713..7aef609897b5 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -876,7 +876,7 @@ void ScInputHandler::ShowTipCursor() { for (sal_Int32 i = 0; i < aNew.getLength(); ++i) { - sal_Unicode cNext = aNew.getStr()[i]; + sal_Unicode cNext = aNew[i]; if( cNext == '(' ) { nStartPosition = i+1; @@ -888,7 +888,7 @@ void ScInputHandler::ShowTipCursor() sal_uInt16 nCount = 0; for (sal_Int32 i = 0; i < aNew.getLength(); ++i) { - sal_Unicode cNext = aNew.getStr()[i]; + sal_Unicode cNext = aNew[i]; if( cNext == '(' ) { nStartPosition = i+1; @@ -910,7 +910,7 @@ void ScInputHandler::ShowTipCursor() sal_uInt16 nCount = 0; for (sal_Int32 i = 0; i < aNew.getLength(); ++i) { - sal_Unicode cNext = aNew.getStr()[i]; + sal_Unicode cNext = aNew[i]; if( cNext == '(' ) { nStartPosition = i+1; @@ -1128,7 +1128,7 @@ void ScInputHandler::UseFormulaData() { for (sal_Int32 i = 0; i < aNew.getLength(); ++i) { - sal_Unicode cNext = aNew.getStr()[i]; + sal_Unicode cNext = aNew[i]; if( cNext == '(' ) { nStartPosition = i+1; @@ -1140,7 +1140,7 @@ void ScInputHandler::UseFormulaData() sal_uInt16 nCount = 0; for (sal_Int32 i = 0; i < aNew.getLength(); ++i) { - sal_Unicode cNext = aNew.getStr()[i]; + sal_Unicode cNext = aNew[i]; if( cNext == '(' ) { nStartPosition = i+1; @@ -1162,7 +1162,7 @@ void ScInputHandler::UseFormulaData() sal_uInt16 nCount = 0; for (sal_Int32 i = 0; i < aNew.getLength(); ++i) { - sal_Unicode cNext = aNew.getStr()[i]; + sal_Unicode cNext = aNew[i]; if( cNext == '(' ) { nStartPosition = i+1; @@ -2746,7 +2746,7 @@ void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode ) { // keine typographische Anfuehrungszeichen in Formeln - if (aString.getStr()[0] == '=') + if (aString[0] == '=') { SvxAutoCorrect* pAuto = SvxAutoCorrCfg::Get().GetAutoCorrect(); if ( pAuto ) diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx index 8e9961c5d53f..084060ba1313 100644 --- a/sc/source/ui/optdlg/tpformula.cxx +++ b/sc/source/ui/optdlg/tpformula.cxx @@ -143,7 +143,7 @@ bool ScTpFormulaOptions::IsValidSeparator(const OUString& rSep) const if (rSep.compareToAscii("A") >= 0 && rSep.compareToAscii("Z") <= 0) return false; - sal_Unicode c = rSep.getStr()[0]; + sal_Unicode c = rSep[0]; switch (c) { case '+': diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index cf0a8295818e..d1333050b685 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -626,7 +626,7 @@ void ScDrawStringsVars::SetTextToWidthOrHash( ScRefCellValue& rCell, long nWidth } sal_uInt8 nSignCount = 0, nDecimalCount = 0, nExpCount = 0; sal_Int32 nLen = aString.getLength(); - sal_Unicode cDecSep = ScGlobal::GetpLocaleData()->getLocaleItem().decimalSeparator.getStr()[0]; + sal_Unicode cDecSep = ScGlobal::GetpLocaleData()->getLocaleItem().decimalSeparator[0]; for (xub_StrLen i = 0; i < nLen; ++i) { sal_Unicode c = aString[i]; diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx index cc0c611e2c2d..69c5df0f798a 100644 --- a/scripting/source/stringresource/stringresource.cxx +++ b/scripting/source/stringresource/stringresource.cxx @@ -1672,7 +1672,7 @@ bool checkNamingSceme( const OUString& aName, const OUString& aNameBase, // Name has to start with NameBase followed // by a '_' and at least one more character if( aName.startsWith( aNameBase ) && nNameBaseLen < nNameLen-1 && - aName.getStr()[nNameBaseLen] == '_' ) + aName[nNameBaseLen] == '_' ) { bSuccess = true; @@ -2671,8 +2671,8 @@ void StringResourceWithLocationImpl::initialize( const Sequence< Any >& aArgumen } else { - if( m_aLocation.getStr()[nLen - 1] != '/' ) - m_aLocation += OUString("/"); + if( m_aLocation[nLen - 1] != '/' ) + m_aLocation += "/"; } if( !bOk ) diff --git a/sd/source/filter/eppt/pptexanimations.cxx b/sd/source/filter/eppt/pptexanimations.cxx index 951b2cf44744..355877ce9e0b 100644 --- a/sd/source/filter/eppt/pptexanimations.cxx +++ b/sd/source/filter/eppt/pptexanimations.cxx @@ -128,7 +128,7 @@ void ImplTranslateAttribute( OUString& rString, const TranslateMode eTranslateMo while( (nIndex = rString.indexOf( aSearch, nIndex )) != -1 ) { sal_Int32 nLength = aSearch.getLength(); - if( nIndex && (rString.getStr()[nIndex-1] == '#' ) ) + if( nIndex && ( rString[nIndex-1] == '#' ) ) { nIndex--; nLength++; diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx index 8dfd43ae49b2..03e8110da2f8 100644 --- a/sd/source/filter/ppt/pptinanimations.cxx +++ b/sd/source/filter/ppt/pptinanimations.cxx @@ -139,7 +139,7 @@ static bool convertMeasure( OUString& rString ) while( (nIndex = rString.indexOf( aSearch, nIndex )) != -1 ) { sal_Int32 nLength = aSearch.getLength(); - if( nIndex && (rString.getStr()[nIndex-1] == '#' ) ) + if( nIndex && (rString[nIndex-1] == '#' ) ) { nIndex--; nLength++; diff --git a/sd/source/ui/unoidl/unosrch.cxx b/sd/source/ui/unoidl/unosrch.cxx index 17c743963a44..50198a3d7bc3 100644 --- a/sd/source/ui/unoidl/unosrch.cxx +++ b/sd/source/ui/unoidl/unosrch.cxx @@ -646,8 +646,8 @@ sal_Bool SdUnoSearchReplaceShape::Search( const OUString& rText, sal_Int32& nSta if(pDescr->IsWords()) { - if( (nStartPos > 0 && aText.getStr()[nStartPos-1] > ' ') || - (nEndPos < aText.getLength() && aText.getStr()[nEndPos] > ' ') ) + if( (nStartPos > 0 && aText[nStartPos-1] > ' ') || + (nEndPos < aText.getLength() && aText[nEndPos] > ' ') ) { nStartPos++; return Search( aText, nStartPos, nEndPos, pDescr ); diff --git a/sdext/source/pdfimport/pdfparse/pdfentries.cxx b/sdext/source/pdfimport/pdfparse/pdfentries.cxx index 66804ff3b9f1..c1343d9c891b 100644 --- a/sdext/source/pdfimport/pdfparse/pdfentries.cxx +++ b/sdext/source/pdfimport/pdfparse/pdfentries.cxx @@ -1311,7 +1311,7 @@ PDFFileImplData* PDFFile::impl_getData() const #if OSL_DEBUG_LEVEL > 1 OUString aTmp; for( int i = 0; i < m_pData->m_aDocID.getLength(); i++ ) - aTmp += OUString::number((unsigned int)sal_uInt8(m_pData->m_aDocID.getStr()[i]), 16); + aTmp += OUString::number((unsigned int)sal_uInt8(m_pData->m_aDocID[i]), 16); SAL_INFO("sdext.pdfimport.pdfparse", "DocId is <" << OUStringToOString(aTmp, RTL_TEXTENCODING_UTF8).getStr() << ">"); #endif } @@ -1375,7 +1375,7 @@ PDFFileImplData* PDFFile::impl_getData() const { OUString aTmp; for( int i = 0; i < aEnt.getLength(); i++ ) - aTmp += " " + OUString::number((unsigned int)sal_uInt8(aEnt.getStr()[i]), 16); + aTmp += " " + OUString::number((unsigned int)sal_uInt8(aEnt[i]), 16); SAL_WARN("sdext.pdfimport.pdfparse", "O entry has length " << (int)aEnt.getLength() << ", should be 32 <" << OUStringToOString(aTmp, RTL_TEXTENCODING_UTF8).getStr() << ">" ); } @@ -1395,7 +1395,7 @@ PDFFileImplData* PDFFile::impl_getData() const { OUString aTmp; for( int i = 0; i < aEnt.getLength(); i++ ) - aTmp += " " + OUString::number((unsigned int)sal_uInt8(aEnt.getStr()[i]), 16); + aTmp += " " + OUString::number((unsigned int)sal_uInt8(aEnt[i]), 16); SAL_WARN("sdext.pdfimport.pdfparse", "U entry has length " << (int)aEnt.getLength() << ", should be 32 <" << OUStringToOString(aTmp, RTL_TEXTENCODING_UTF8).getStr() << ">" ); } diff --git a/sdext/source/presenter/PresenterTextView.cxx b/sdext/source/presenter/PresenterTextView.cxx index 4463ea236c10..8073190a39d3 100644 --- a/sdext/source/presenter/PresenterTextView.cxx +++ b/sdext/source/presenter/PresenterTextView.cxx @@ -788,7 +788,7 @@ sal_Unicode PresenterTextParagraph::GetCharacter ( } else { - return msParagraphText.getStr()[nGlobalCharacterIndex - mnCharacterOffset]; + return msParagraphText[nGlobalCharacterIndex - mnCharacterOffset]; } } diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 8fa2e2335ee5..6d7b016b7f66 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -2564,7 +2564,7 @@ void CutLines( OUString& rStr, sal_Int32 nStartLine, sal_Int32 nLines, sal_Bool { sal_Int32 n = nStartPos; sal_Int32 nLen = rStr.getLength(); - while ( ( n < nLen ) && ( rStr.getStr()[ n ] == LINE_SEP ) ) + while ( ( n < nLen ) && ( rStr[ n ] == LINE_SEP ) ) n++; if ( n > nStartPos ) diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx index ad99f8bb19bc..d16702109883 100644 --- a/svl/source/passwordcontainer/passwordcontainer.cxx +++ b/svl/source/passwordcontainer/passwordcontainer.cxx @@ -169,7 +169,7 @@ static ::rtl::ByteSequence getBufFromAsciiLine( OUString line ) for( int ind = 0; ind < tmpLine.getLength()/2; ind++ ) { - aResult[ind] = ( (sal_uInt8)( tmpLine.getStr()[ind*2] - 'a' ) << 4 ) | (sal_uInt8)( tmpLine.getStr()[ind*2+1] - 'a' ); + aResult[ind] = ( (sal_uInt8)( tmpLine[ind*2] - 'a' ) << 4 ) | (sal_uInt8)( tmpLine[ind*2+1] - 'a' ); } return aResult; diff --git a/svtools/source/svrtf/rtfout.cxx b/svtools/source/svrtf/rtfout.cxx index 703a24c82d5b..5727a4b812fe 100644 --- a/svtools/source/svrtf/rtfout.cxx +++ b/svtools/source/svrtf/rtfout.cxx @@ -133,7 +133,7 @@ SvStream& RTFOutFuncs::Out_Char(SvStream& rStream, sal_Unicode c, for (sal_Int32 nI = 0; nI < nLen; ++nI) { rStream << "\\'"; - Out_Hex(rStream, sConverted.getStr()[nI], 2); + Out_Hex(rStream, sConverted[nI], 2); } } break; diff --git a/svx/source/dialog/svxbmpnumvalueset.cxx b/svx/source/dialog/svxbmpnumvalueset.cxx index b620965eef9a..31e83a00b582 100644 --- a/svx/source/dialog/svxbmpnumvalueset.cxx +++ b/svx/source/dialog/svxbmpnumvalueset.cxx @@ -316,8 +316,7 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt ) aLeft.Y() -= (pDev->GetTextHeight()/2); if(!sPrefixes[i].isEmpty() && - sPrefixes[i] != " " && - sPrefixes[i].getStr()[0] != 0) + sPrefixes[i] != " ") { pVDev->SetFont(aFont); pVDev->DrawText(aLeft, sPrefixes[i]); @@ -349,9 +348,8 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt ) aLeft, aRuleFont, aFont); - if(!sSuffixes[i].isEmpty()&& - !sSuffixes[i].equalsAsciiL(" ", 1) && - sSuffixes[i].getStr()[0] != 0) + if(!sSuffixes[i].isEmpty() && + !sSuffixes[i].startsWith(" ")) { pVDev->SetFont(aFont); pVDev->DrawText(aLeft, sSuffixes[i]); diff --git a/svx/source/fmcomp/dbaexchange.cxx b/svx/source/fmcomp/dbaexchange.cxx index dc9454ac034d..e5a974d7023f 100644 --- a/svx/source/fmcomp/dbaexchange.cxx +++ b/svx/source/fmcomp/dbaexchange.cxx @@ -467,7 +467,7 @@ namespace svx sal_Int32 nDescriptorLen = m_sCompatibleObjectDescription.getLength(); if (nDescriptorLen) { - if (m_sCompatibleObjectDescription.getStr()[nDescriptorLen] == 11) + if (m_sCompatibleObjectDescription[nDescriptorLen] == 11) m_sCompatibleObjectDescription = m_sCompatibleObjectDescription.copy(0, nDescriptorLen - 1); if (nDescriptorLen) diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx index 3349c8e987d9..77ee1f57d256 100644 --- a/svx/source/sidebar/nbdtmg.cxx +++ b/svx/source/sidebar/nbdtmg.cxx @@ -127,8 +127,8 @@ NumSettings_ImplPtr lcl_CreateNumberingSettingsPtr(const Sequence<PropertyValue> else if(pValues[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sBulletFontName))) pValues[j].Value >>= pNew->sBulletFont; } - const sal_Unicode cLocalPrefix = pNew->sPrefix.getLength() ? pNew->sPrefix.getStr()[0] : 0; - const sal_Unicode cLocalSuffix = pNew->sSuffix.getLength() ? pNew->sSuffix.getStr()[0] : 0; + const sal_Unicode cLocalPrefix = pNew->sPrefix.getLength() ? pNew->sPrefix[0] : 0; + const sal_Unicode cLocalSuffix = pNew->sSuffix.getLength() ? pNew->sSuffix[0] : 0; OUString aEmptyStr; if( cLocalPrefix == ' ') pNew->sPrefix=aEmptyStr; if( cLocalSuffix == ' ') pNew->sSuffix=aEmptyStr; @@ -1407,8 +1407,8 @@ sal_uInt16 NumberingTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 m return (sal_uInt16)0xFFFF; SvxNumberFormat aFmt(aNum.GetLevel(nActLv)); - //sal_Unicode cPrefix = rtl::OUString(aFmt.GetPrefix()).getStr()[0]; - //sal_Unicode cSuffix = rtl::OUString(aFmt.GetSuffix()).getStr()[0]; + //sal_Unicode cPrefix = rtl::OUString(aFmt.GetPrefix())[0]; + //sal_Unicode cSuffix = rtl::OUString(aFmt.GetSuffix())[0]; OUString sPreFix = aFmt.GetPrefix(); OUString sLclSuffix = aFmt.GetSuffix(); sal_Int16 eNumType = aFmt.GetNumberingType(); @@ -1446,8 +1446,8 @@ sal_Bool NumberingTypeMgr::RelplaceNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sa return sal_False; SvxNumberFormat aFmt(aNum.GetLevel(nActLv)); - //sal_Unicode cPrefix = rtl::OUString(aFmt.GetPrefix()).getStr()[0]; - //sal_Unicode cSuffix = rtl::OUString(aFmt.GetSuffix()).getStr()[0]; + //sal_Unicode cPrefix = rtl::OUString(aFmt.GetPrefix())[0]; + //sal_Unicode cSuffix = rtl::OUString(aFmt.GetSuffix())[0]; sal_Int16 eNumType = aFmt.GetNumberingType(); sal_uInt16 nCount = pNumberSettingsArr->size(); @@ -1641,7 +1641,7 @@ sal_uInt16 OutlineTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 /*m { sal_Unicode cChar = aFmt.GetBulletChar(); //const Font* pFont = aFmt.GetBulletFont(); - sal_Unicode ccChar = _pSet->sBulletChar.getStr()[0]; + sal_Unicode ccChar = _pSet->sBulletChar[0]; // rtl::OUString sFont = _pSet->sBulletFont; if ( !((cChar == ccChar) && //pFont && sFont.compareTo(pFont->GetName()) && _pSet->eLabelFollowedBy == aFmt.GetLabelFollowedBy() && @@ -1710,8 +1710,8 @@ sal_Bool OutlineTypeMgr::RelplaceNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_ for (sal_uInt16 iLevel=0;iLevel < nCount;iLevel++) { SvxNumberFormat aFmt(aNum.GetLevel(iLevel)); - //sal_Unicode cPrefix = rtl::OUString(aFmt.GetPrefix()).getStr()[0]; - //sal_Unicode cSuffix = rtl::OUString(aFmt.GetSuffix()).getStr()[0]; + //sal_Unicode cPrefix = rtl::OUString(aFmt.GetPrefix())[0]; + //sal_Unicode cSuffix = rtl::OUString(aFmt.GetSuffix())[0]; sal_Int16 eNumType = aFmt.GetNumberingType(); NumSettings_ImplPtr _pSet = (*pItemArr->pNumSettingsArr)[iLevel].get(); diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index 6070f3040a3a..33e782b6c80d 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -1140,7 +1140,7 @@ sal_Unicode SwAccessibleParagraph::getCharacter( sal_Int32 nIndex ) // return character (if valid) if( IsValidChar(nIndex, sText.getLength() ) ) { - return sText.getStr()[nIndex]; + return sText[nIndex]; } else throw lang::IndexOutOfBoundsException(); diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx index d6fc8e4ade16..4bedfca89b60 100644 --- a/sw/source/core/access/accportions.cxx +++ b/sw/source/core/access/accportions.cxx @@ -584,7 +584,7 @@ sal_uInt16 SwAccessiblePortionData::FillSpecialPos( // if we have anything except plain text, compute nExtend + nRefPos if( (nModelEndPos - nModelPos == 1) && - (pTxtNode->GetTxt()[nModelPos] != sAccessibleString.getStr()[nPos])) + (pTxtNode->GetTxt()[nModelPos] != sAccessibleString[nPos])) { // case 1: a one-character, non-text portion // reference position is the first accessibilty for our diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index 7644261ba126..0b07b547430b 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -2795,12 +2795,12 @@ sal_Bool SwUnoCursorHelper::ConvertSortProperties( bRet = sal_False; } } - else if (rPropName.matchAsciiL("CollatorAlgorithm", 17) && + else if (rPropName.startsWith("CollatorAlgorithm") && rPropName.getLength() == 18 && - (rPropName.getStr()[17] >= '0' && rPropName.getStr()[17] <= '9')) + (rPropName[17] >= '0' && rPropName[17] <= '9')) { bOldSortdescriptor = sal_True; - sal_uInt16 nIndex = rPropName.getStr()[17]; + sal_uInt16 nIndex = rPropName[17]; nIndex -= '0'; OUString aTxt; if ((aValue >>= aTxt) && nIndex < 3) @@ -2812,12 +2812,12 @@ sal_Bool SwUnoCursorHelper::ConvertSortProperties( bRet = sal_False; } } - else if (rPropName.matchAsciiL("SortRowOrColumnNo", 17) && + else if (rPropName.startsWith("SortRowOrColumnNo") && rPropName.getLength() == 18 && - (rPropName.getStr()[17] >= '0' && rPropName.getStr()[17] <= '9')) + (rPropName[17] >= '0' && rPropName[17] <= '9')) { bOldSortdescriptor = sal_True; - sal_uInt16 nIndex = rPropName.getStr()[17]; + sal_uInt16 nIndex = rPropName[17]; nIndex -= '0'; sal_Int16 nCol = -1; if (aValue.getValueType() == ::getCppuType((const sal_Int16*)0) @@ -2836,10 +2836,10 @@ sal_Bool SwUnoCursorHelper::ConvertSortProperties( } else if (rPropName.startsWith("IsSortNumeric") && rPropName.getLength() == 14 && - (rPropName.getStr()[13] >= '0' && rPropName.getStr()[13] <= '9')) + (rPropName[13] >= '0' && rPropName[13] <= '9')) { bOldSortdescriptor = sal_True; - sal_uInt16 nIndex = rPropName.getStr()[13]; + sal_uInt16 nIndex = rPropName[13]; nIndex = nIndex - '0'; if (aValue.getValueType() == ::getBooleanCppuType() && nIndex < 3) { @@ -2853,10 +2853,10 @@ sal_Bool SwUnoCursorHelper::ConvertSortProperties( } else if (rPropName.startsWith("IsSortAscending") && rPropName.getLength() == 16 && - (rPropName.getStr()[15] >= '0' && rPropName.getStr()[15] <= '9')) + (rPropName[15] >= '0' && rPropName[15] <= '9')) { bOldSortdescriptor = sal_True; - sal_uInt16 nIndex = rPropName.getStr()[15]; + sal_uInt16 nIndex = rPropName[15]; nIndex -= '0'; if (aValue.getValueType() == ::getBooleanCppuType() && nIndex < 3) { diff --git a/sw/source/ui/lingu/hhcwrp.cxx b/sw/source/ui/lingu/hhcwrp.cxx index 4f5de524200a..042f3b31f9c5 100644 --- a/sw/source/ui/lingu/hhcwrp.cxx +++ b/sw/source/ui/lingu/hhcwrp.cxx @@ -272,7 +272,7 @@ void SwHHCWrapper::ChangeText( const OUString &rNewText, nIndex = static_cast< xub_StrLen >( rOrigText.getLength() ); } - if (rOrigText.getStr()[nIndex] == rNewText[nPos] || + if (rOrigText[nIndex] == rNewText[nPos] || nPos == nConvTextLen /* end of string also terminates non-matching char sequence */) { // substring that needs to be replaced found? diff --git a/toolkit/source/helper/formpdfexport.cxx b/toolkit/source/helper/formpdfexport.cxx index 516fbb788231..2ad6900cfc8e 100644 --- a/toolkit/source/helper/formpdfexport.cxx +++ b/toolkit/source/helper/formpdfexport.cxx @@ -484,7 +484,7 @@ namespace toolkitform { OUString sURL; OSL_VERIFY( xModelProps->getPropertyValue( FM_PROP_TARGET_URL ) >>= sURL ); - const bool bDocumentLocalTarget = !sURL.isEmpty() && ( sURL.getStr()[0] == '#' ); + const bool bDocumentLocalTarget = sURL.startsWith("#"); if ( bDocumentLocalTarget ) { // Register the destination for for future handling ... diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index c1bb3cc60127..56173663b68c 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -2248,8 +2248,7 @@ sal_Int32 INetURLObject::getAuthorityBegin() const else nBegin = m_aPath.getBegin(); nBegin -= RTL_CONSTASCII_LENGTH("//"); - DBG_ASSERT(m_aAbsURIRef.getStr()[nBegin] == '/' - && m_aAbsURIRef.getStr()[nBegin + 1] == '/', + DBG_ASSERT(m_aAbsURIRef[nBegin] == '/' && m_aAbsURIRef[nBegin + 1] == '/', "INetURLObject::getAuthority(): Bad authority"); return nBegin; } @@ -3943,7 +3942,7 @@ bool INetURLObject::operator ==(INetURLObject const & rObject) const switch (nLength - aPath2.getLength()) { case -1: - if (aPath2.getStr()[nLength] != '/') + if (aPath2[nLength] != '/') return false; break; @@ -3951,7 +3950,7 @@ bool INetURLObject::operator ==(INetURLObject const & rObject) const break; case 1: - if (aPath1.getStr()[--nLength] != '/') + if (aPath1[--nLength] != '/') return false; break; diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx index 45cdb42e1028..3d0e7d77e718 100644 --- a/ucb/source/core/ucb.cxx +++ b/ucb/source/core/ucb.cxx @@ -138,7 +138,7 @@ void makeAndAppendXMLName( sal_Int32 nCount = rIn.getLength(); for ( sal_Int32 n = 0; n < nCount; ++n ) { - const sal_Unicode c = rIn.getStr()[ n ]; + const sal_Unicode c = rIn[ n ]; switch ( c ) { case '&': diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx index ee7030c15ff5..73b28354a93d 100644 --- a/ucb/source/core/ucbstore.cxx +++ b/ucb/source/core/ucbstore.cxx @@ -58,7 +58,7 @@ OUString makeHierarchalNameSegment( const OUString & rIn ) sal_Int32 nCount = rIn.getLength(); for ( sal_Int32 n = 0; n < nCount; ++n ) { - const sal_Unicode c = rIn.getStr()[ n ]; + const sal_Unicode c = rIn[ n ]; switch ( c ) { case '&': diff --git a/ucb/source/ucp/ext/ucpext_content.cxx b/ucb/source/ucp/ext/ucpext_content.cxx index 4ce4bf641021..37cbddf1c309 100644 --- a/ucb/source/ucp/ext/ucpext_content.cxx +++ b/ucb/source/ucp/ext/ucpext_content.cxx @@ -106,8 +106,8 @@ namespace ucb { namespace ucp { namespace ext ENSURE_OR_RETURN( !i_rBaseURL.isEmpty(), "illegal base URL", i_rRelativeURL ); OUStringBuffer aComposer( i_rBaseURL ); - if ( i_rBaseURL.getStr()[ i_rBaseURL.getLength() - 1 ] != '/' ) - aComposer.append( sal_Unicode( '/' ) ); + if ( !i_rBaseURL.endsWith("/") ) + aComposer.append( '/' ); aComposer.append( i_rRelativeURL ); return aComposer.makeStringAndClear(); } @@ -368,7 +368,7 @@ namespace ucb { namespace ucp { namespace ext break; } - if ( sRelativeURL.getStr()[ sRelativeURL.getLength() - 1 ] == '/' ) + if ( sRelativeURL.endsWith("/") ) sRelativeURL = sRelativeURL.copy( 0, sRelativeURL.getLength() - 1 ); // remove the last segment diff --git a/ucb/source/ucp/ext/ucpext_datasupplier.cxx b/ucb/source/ucp/ext/ucpext_datasupplier.cxx index 20a73c80ae47..57704ff666b7 100644 --- a/ucb/source/ucp/ext/ucpext_datasupplier.cxx +++ b/ucb/source/ucp/ext/ucpext_datasupplier.cxx @@ -113,8 +113,8 @@ namespace ucb { namespace ucp { namespace ext ENSURE_OR_RETURN( !i_rBaseURL.isEmpty(), "illegal base URL", i_rRelativeURL ); OUStringBuffer aComposer( i_rBaseURL ); - if ( i_rBaseURL.getStr()[ i_rBaseURL.getLength() - 1 ] != '/' ) - aComposer.append( sal_Unicode( '/' ) ); + if ( !i_rBaseURL.endsWith("/") ) + aComposer.append( '/' ); aComposer.append( i_rRelativeURL ); return aComposer.makeStringAndClear(); } diff --git a/ucb/source/ucp/file/shell.cxx b/ucb/source/ucp/file/shell.cxx index a9cd7e44ad81..538e013bf1ac 100644 --- a/ucb/source/ucp/file/shell.cxx +++ b/ucb/source/ucp/file/shell.cxx @@ -1967,9 +1967,9 @@ sal_Bool SAL_CALL shell::getUnqFromUrl( const OUString& Url,OUString& Unq ) Unq = Url; sal_Int32 l = Unq.getLength()-1; - if( ! err && Unq.getStr()[ l ] == '/' && - Unq.indexOf( '/', RTL_CONSTASCII_LENGTH("//") ) < l ) - Unq = Unq.copy(0, Unq.getLength() - 1); + if( ! err && Unq.endsWith("/") && + Unq.indexOf( '/', RTL_CONSTASCII_LENGTH("//") ) != -1 ) + Unq = Unq.copy(0, l); return err; } diff --git a/ucb/source/ucp/hierarchy/hierarchydata.cxx b/ucb/source/ucp/hierarchy/hierarchydata.cxx index 05eb221b2ccb..25cfffe77061 100644 --- a/ucb/source/ucp/hierarchy/hierarchydata.cxx +++ b/ucb/source/ucp/hierarchy/hierarchydata.cxx @@ -63,7 +63,7 @@ void makeXMLName( const OUString & rIn, OUStringBuffer & rBuffer ) sal_Int32 nCount = rIn.getLength(); for ( sal_Int32 n = 0; n < nCount; ++n ) { - const sal_Unicode c = rIn.getStr()[ n ]; + const sal_Unicode c = rIn[ n ]; switch ( c ) { case '&': diff --git a/ucb/source/ucp/hierarchy/hierarchyuri.cxx b/ucb/source/ucp/hierarchy/hierarchyuri.cxx index 23e5d0d316d8..fdbf1a7b957d 100644 --- a/ucb/source/ucp/hierarchy/hierarchyuri.cxx +++ b/ucb/source/ucp/hierarchy/hierarchyuri.cxx @@ -82,8 +82,7 @@ void HierarchyUri::init() const } else if ( ( m_aUri.getLength() == HIERARCHY_URL_SCHEME_LENGTH + 2 ) && - ( m_aUri.getStr()[ HIERARCHY_URL_SCHEME_LENGTH + 1 ] - == sal_Unicode( '/' ) ) ) + ( m_aUri[ HIERARCHY_URL_SCHEME_LENGTH + 1 ] == '/' ) ) { // root folder URI without service specifier. m_aUri += OUString( "/" DEFAULT_DATA_SOURCE_SERVICE "/" ); @@ -93,8 +92,7 @@ void HierarchyUri::init() const } else if ( ( m_aUri.getLength() > HIERARCHY_URL_SCHEME_LENGTH + 2 ) && - ( m_aUri.getStr()[ HIERARCHY_URL_SCHEME_LENGTH + 2 ] - != sal_Unicode( '/' ) ) ) + ( m_aUri[ HIERARCHY_URL_SCHEME_LENGTH + 2 ] != '/' ) ) { // other (no root folder) URI without service specifier. m_aUri = m_aUri.replaceAt( diff --git a/ucb/source/ucp/package/pkguri.cxx b/ucb/source/ucp/package/pkguri.cxx index 29e9cd61c404..62300681b218 100644 --- a/ucb/source/ucp/package/pkguri.cxx +++ b/ucb/source/ucp/package/pkguri.cxx @@ -81,14 +81,11 @@ void PackageUri::init() const } // Scheme must be followed by '://' - if ( ( m_aUri.getStr()[ PACKAGE_URL_SCHEME_LENGTH ] - != sal_Unicode( ':' ) ) + if ( ( m_aUri[ PACKAGE_URL_SCHEME_LENGTH ] != ':' ) || - ( m_aUri.getStr()[ PACKAGE_URL_SCHEME_LENGTH + 1 ] - != sal_Unicode( '/' ) ) + ( m_aUri[ PACKAGE_URL_SCHEME_LENGTH + 1 ] != '/' ) || - ( m_aUri.getStr()[ PACKAGE_URL_SCHEME_LENGTH + 2 ] - != sal_Unicode( '/' ) ) ) + ( m_aUri[ PACKAGE_URL_SCHEME_LENGTH + 2 ] != '/' ) ) { // error, but remember that we did a init(). m_aPath = OUString( "/" ); @@ -135,8 +132,7 @@ void PackageUri::init() const } else if ( nEnd == ( aPureUri.getLength() - 1 ) ) { - if ( aPureUri.getStr()[ aPureUri.getLength() - 2 ] - == sal_Unicode( '/' ) ) + if ( aPureUri[ aPureUri.getLength() - 2 ] == '/' ) { // Only <scheme>://// or <scheme>://<something>// diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx b/ucb/source/ucp/tdoc/tdoc_content.cxx index a445ccd5ef2d..9f7c6e24fc46 100644 --- a/ucb/source/ucp/tdoc/tdoc_content.cxx +++ b/ucb/source/ucp/tdoc/tdoc_content.cxx @@ -1835,9 +1835,9 @@ Content::queryChildContent( const OUString & rRelativeChildUri ) const OUString aMyId = getIdentifier()->getContentIdentifier(); OUStringBuffer aBuf( aMyId ); - if ( aMyId.getStr()[ aMyId.getLength() - 1 ] != sal_Unicode( '/' ) ) + if ( !aMyId.endsWith("/") ) aBuf.appendAscii( "/" ); - if ( rRelativeChildUri.getStr()[ 0 ] != sal_Unicode( '/' ) ) + if ( !rRelativeChildUri.startsWith("/") ) aBuf.append( rRelativeChildUri ); else aBuf.append( rRelativeChildUri.copy( 1 ) ); diff --git a/ucb/source/ucp/tdoc/tdoc_storage.cxx b/ucb/source/ucp/tdoc/tdoc_storage.cxx index 7f250371e59a..916ccf81c8aa 100644 --- a/ucb/source/ucp/tdoc/tdoc_storage.cxx +++ b/ucb/source/ucp/tdoc/tdoc_storage.cxx @@ -114,7 +114,7 @@ StorageElementFactory::createStorage( const OUString & rUri, } OUString aUriKey - ( ( rUri.getStr()[ rUri.getLength() - 1 ] == sal_Unicode( '/' ) ) + ( rUri.endsWith("/") ? rUri.copy( 0, rUri.getLength() - 1 ) : rUri ); diff --git a/ucb/source/ucp/tdoc/tdoc_uri.cxx b/ucb/source/ucp/tdoc/tdoc_uri.cxx index 037d4d937cb2..24110bf8d755 100644 --- a/ucb/source/ucp/tdoc/tdoc_uri.cxx +++ b/ucb/source/ucp/tdoc/tdoc_uri.cxx @@ -65,15 +65,13 @@ void Uri::init() const // Remember normalized scheme string. m_aUri = m_aUri.replaceAt( 0, aScheme.getLength(), aScheme ); - if ( m_aUri.getStr()[ TDOC_URL_SCHEME_LENGTH ] - != sal_Unicode( ':' ) ) + if ( m_aUri[ TDOC_URL_SCHEME_LENGTH ] != ':' ) { // Invaild (no ':' after <scheme>). return; } - if ( m_aUri.getStr()[ TDOC_URL_SCHEME_LENGTH + 1 ] - != sal_Unicode( '/' ) ) + if ( m_aUri[ TDOC_URL_SCHEME_LENGTH + 1 ] != '/' ) { // Invaild (no '/' after <scheme>:). return; diff --git a/ucb/source/ucp/webdav-neon/ContentProperties.cxx b/ucb/source/ucp/webdav-neon/ContentProperties.cxx index 1439e0c7dc4d..b19cd24c19be 100644 --- a/ucb/source/ucp/webdav-neon/ContentProperties.cxx +++ b/ucb/source/ucp/webdav-neon/ContentProperties.cxx @@ -128,8 +128,7 @@ ContentProperties::ContentProperties( const DAVResource& rResource ) ++it; } - if ( rResource.uri.getStr()[ rResource.uri.getLength() - 1 ] - == sal_Unicode( '/' ) ) + if ( rResource.uri.endsWith("/") ) m_bTrailingSlash = sal_True; } diff --git a/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx b/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx index e84faf900146..64da40979533 100644 --- a/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx +++ b/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx @@ -392,8 +392,7 @@ sal_Bool DataSupplier::getData() m_pImpl->m_xContent->getResourceAccess().getURL() ); OUString aPath = aURI.GetPath(); - if ( aPath.getStr()[ aPath.getLength() - 1 ] - == sal_Unicode( '/' ) ) + if ( aPath.endsWith("/") ) aPath = aPath.copy( 0, aPath.getLength() - 1 ); aPath = NeonUri::unescape( aPath ); @@ -411,9 +410,7 @@ sal_Bool DataSupplier::getData() { NeonUri aCurrURI( rRes.uri ); OUString aCurrPath = aCurrURI.GetPath(); - if ( aCurrPath.getStr()[ - aCurrPath.getLength() - 1 ] - == sal_Unicode( '/' ) ) + if ( aCurrPath.endsWith("/") ) aCurrPath = aCurrPath.copy( 0, diff --git a/ucb/source/ucp/webdav-neon/webdavprovider.cxx b/ucb/source/ucp/webdav-neon/webdavprovider.cxx index 389b0c5d466f..616d1bd664e6 100644 --- a/ucb/source/ucp/webdav-neon/webdavprovider.cxx +++ b/ucb/source/ucp/webdav-neon/webdavprovider.cxx @@ -134,9 +134,7 @@ ContentProvider::queryContent( if ( aURL.getLength() < ( aScheme.getLength() + 3 ) ) throw ucb::IllegalIdentifierException(); - if ( ( aURL.getStr()[ aScheme.getLength() ] != sal_Unicode( ':' ) ) || - ( aURL.getStr()[ aScheme.getLength() + 1 ] != sal_Unicode( '/' ) ) || - ( aURL.getStr()[ aScheme.getLength() + 2 ] != sal_Unicode( '/' ) ) ) + if ( aURL.copy( aScheme.getLength(), 3 ) != "://" ) throw ucb::IllegalIdentifierException(); uno::Reference< ucb::XContentIdentifier > xCanonicId; diff --git a/ucb/source/ucp/webdav/ContentProperties.cxx b/ucb/source/ucp/webdav/ContentProperties.cxx index a1e78288cd56..e8416a212586 100644 --- a/ucb/source/ucp/webdav/ContentProperties.cxx +++ b/ucb/source/ucp/webdav/ContentProperties.cxx @@ -112,8 +112,7 @@ ContentProperties::ContentProperties( const DAVResource& rResource ) ++it; } - if ( rResource.uri.getStr()[ rResource.uri.getLength() - 1 ] - == sal_Unicode( '/' ) ) + if ( rResource.uri.endsWith("/") ) m_bTrailingSlash = sal_True; } diff --git a/ucb/source/ucp/webdav/webdavdatasupplier.cxx b/ucb/source/ucp/webdav/webdavdatasupplier.cxx index a50bb7e312bf..6834734f0e5a 100644 --- a/ucb/source/ucp/webdav/webdavdatasupplier.cxx +++ b/ucb/source/ucp/webdav/webdavdatasupplier.cxx @@ -391,8 +391,7 @@ sal_Bool DataSupplier::getData() m_pImpl->m_xContent->getResourceAccess().getURL() ); OUString aPath = aURI.GetPath(); - if ( aPath.getStr()[ aPath.getLength() - 1 ] - == sal_Unicode( '/' ) ) + if ( aPath.endsWith("/") ) aPath = aPath.copy( 0, aPath.getLength() - 1 ); aPath = SerfUri::unescape( aPath ); @@ -410,9 +409,7 @@ sal_Bool DataSupplier::getData() { SerfUri aCurrURI( rRes.uri ); OUString aCurrPath = aCurrURI.GetPath(); - if ( aCurrPath.getStr()[ - aCurrPath.getLength() - 1 ] - == sal_Unicode( '/' ) ) + if ( aCurrPath.endsWith("/") ) aCurrPath = aCurrPath.copy( 0, diff --git a/ucb/source/ucp/webdav/webdavprovider.cxx b/ucb/source/ucp/webdav/webdavprovider.cxx index b782b048f941..cb2dc41232fe 100644 --- a/ucb/source/ucp/webdav/webdavprovider.cxx +++ b/ucb/source/ucp/webdav/webdavprovider.cxx @@ -197,9 +197,7 @@ ContentProvider::queryContent( if ( aURL.getLength() < ( aScheme.getLength() + 3 ) ) throw ucb::IllegalIdentifierException(); - if ( ( aURL.getStr()[ aScheme.getLength() ] != sal_Unicode( ':' ) ) || - ( aURL.getStr()[ aScheme.getLength() + 1 ] != sal_Unicode( '/' ) ) || - ( aURL.getStr()[ aScheme.getLength() + 2 ] != sal_Unicode( '/' ) ) ) + if ( aURL.copy( aScheme.getLength(), 3 ) != "://" ) throw ucb::IllegalIdentifierException(); uno::Reference< ucb::XContentIdentifier > xCanonicId; diff --git a/unotest/source/cpp/filters-test.cxx b/unotest/source/cpp/filters-test.cxx index a14fa6761de3..9d38a09b91d9 100644 --- a/unotest/source/cpp/filters-test.cxx +++ b/unotest/source/cpp/filters-test.cxx @@ -79,7 +79,7 @@ void FiltersTest::recursiveScan(filterStatus nExpected, if ((nLastSlash != -1) && (nLastSlash+1 < sURL.getLength())) { //ignore .files - if (sURL.getStr()[nLastSlash+1] == '.') + if (sURL[nLastSlash+1] == '.') continue; if ( diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index 6b16f8a9ea60..74568bcac699 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -266,10 +266,9 @@ UUIInteractionHelper::replaceMessageWithArguments( if (i == -1) break; if (aMessage.getLength() - i >= RTL_CONSTASCII_LENGTH("$(ARGx)") - && aMessage.getStr()[i + RTL_CONSTASCII_LENGTH("$(ARGx")] == ')') + && aMessage[i + RTL_CONSTASCII_LENGTH("$(ARGx")] == ')') { - sal_Unicode c - = aMessage.getStr()[i + RTL_CONSTASCII_LENGTH("$(ARG")]; + sal_Unicode c = aMessage[i + RTL_CONSTASCII_LENGTH("$(ARG")]; if (c >= '1' && c <= '2') { std::vector< OUString >::size_type nIndex diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx index 636528a6eff6..945899763f21 100644 --- a/vcl/generic/fontmanager/fontmanager.cxx +++ b/vcl/generic/fontmanager/fontmanager.cxx @@ -451,8 +451,7 @@ bool PrintFontManager::PrintFont::readAfmMetrics( MultiAtomProvider* pProvider, { int nLen = aFamily.getLength(); if( nLen > 2 && - aFamily.getStr()[ nLen-2 ] == 'G' && - aFamily.getStr()[ nLen-1 ] == 'B' && + aFamily.endsWith("GB") && pInfo->numOfChars > 255 ) { m_aEncoding = RTL_TEXTENCODING_GBK; diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 97d92bad15db..7089abccd057 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -1303,7 +1303,7 @@ void PDFWriterImpl::padPassword( const OUString& i_rPassword, sal_uInt8* o_pPadd sal_Int32 nCurrentChar; for( nCurrentChar = 0; nCurrentChar < nToCopy; nCurrentChar++ ) - o_pPaddedPW[nCurrentChar] = (sal_uInt8)( aString.getStr()[nCurrentChar] ); + o_pPaddedPW[nCurrentChar] = (sal_uInt8)( aString[nCurrentChar] ); //pad it with standard byte string sal_Int32 i,y; diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx index 2d1636b026e1..0ec20554b178 100644 --- a/vcl/unx/generic/printer/ppdparser.cxx +++ b/vcl/unx/generic/printer/ppdparser.cxx @@ -141,7 +141,7 @@ namespace psp OString aStr( pEnvLocale ); sal_Int32 nLen = aStr.getLength(); aLoc.Language = OStringToOUString( aStr.copy( 0, nLen > 2 ? 2 : nLen ), RTL_TEXTENCODING_MS_1252 ); - if( nLen >=5 && aStr.getStr()[2] == '_' ) + if( nLen >=5 && aStr[2] == '_' ) aLoc.Country = OStringToOUString( aStr.copy( 3, 2 ), RTL_TEXTENCODING_MS_1252 ); else aLoc.Country = OUString(); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 289b83cfb46a..e2f6d7ebbf92 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -2019,8 +2019,8 @@ OUString lcl_ExctractAskVariableAndHint( const OUString& rCommand, OUString& rHi // the text after the variable and before a '\' is the hint // if no hint is set the variable is used as hint // the quotes of the hint have to be removed - sal_Int32 nIndex = rCommand.indexOf( ' ', 2);//find last space after 'ASK' - while(rCommand.getStr()[nIndex] == ' ') + sal_Int32 nIndex = rCommand.indexOf( ' ', 2); //find last space after 'ASK' + while(rCommand[nIndex] == ' ') ++nIndex; OUString sShortCommand( rCommand.copy( nIndex ) ); //cut off the " ASK " @@ -2212,7 +2212,7 @@ void FieldContext::AppendCommand(const OUString& rPart) if (sToken.isEmpty()) continue; - if (sToken.getStr()[0] == '"') + if (sToken[0] == '"') { bInStringNext = true; sToken = sToken.copy(1); diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx index 917abb23c356..7a1787c49358 100644 --- a/writerfilter/source/dmapper/NumberingManager.cxx +++ b/writerfilter/source/dmapper/NumberingManager.cxx @@ -185,7 +185,7 @@ sal_Int16 ListLevel::GetParentNumbering( OUString sText, sal_Int16 nLevel, { if( sLevelText.getLength() > 1 ) { - sal_Unicode cLevel = sLevelText.getStr()[1]; + sal_Unicode cLevel = sLevelText[1]; if( cLevel >= '1' && cLevel <= '9' ) { if( cLevel - '1' < nMinLevel ) diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 2e288d1e7d2c..c0f14e40a595 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -1005,7 +1005,7 @@ void RTFDocumentImpl::text(OUString& rString) if (rString.getLength() == 1 && m_aStates.top().nDestinationState != DESTINATION_DOCCOMM) { // No cheating! Tokenizer ignores bare \r and \n, their hex \'0d / \'0a form doesn't count, either. - sal_Unicode ch = rString.getStr()[0]; + sal_Unicode ch = rString[0]; if (ch == 0x0d || ch == 0x0a) return; } diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 43c3d4dd2576..5d4fc0d9a325 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -2211,7 +2211,7 @@ OUString SvXMLExport::GetRelativeReference(const OUString& rValue) // #i65474# handling of fragment URLs ("#....") is undefined // they are stored 'as is' uno::Reference< uri::XUriReference > xUriRef; - if(!sValue.isEmpty() && sValue.getStr()[0] != '#') + if(!sValue.isEmpty() && sValue[0] != '#') { try { diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx index 4aa64f3d6dcd..834da3d6fdd8 100644 --- a/xmloff/source/forms/elementimport.cxx +++ b/xmloff/source/forms/elementimport.cxx @@ -1225,7 +1225,7 @@ namespace xmloff OSL_ENSURE(_rValue.getLength() == 1, "OPasswordImport::handleAttribute: invalid echo char attribute!"); // we ourself should not have written values other than of length 1 if (_rValue.getLength() >= 1) - aEchoChar.Value <<= (sal_Int16)_rValue.getStr()[0]; + aEchoChar.Value <<= (sal_Int16)_rValue[0]; else aEchoChar.Value <<= (sal_Int16)0; implPushBackPropertyValue(aEchoChar); @@ -2015,9 +2015,7 @@ namespace xmloff nElementLength = sElement.getLength(); // when writing the sequence, we quoted the single elements with " characters - OSL_ENSURE( (nElementLength >= 2) - && (sElement.getStr()[0] == '"') - && (sElement.getStr()[nElementLength - 1] == '"'), + OSL_ENSURE( sElement.startsWith("\"") && sElement.endsWith("\""), "OFormImport::implTranslateStringListProperty: invalid quoted element name."); sElement = sElement.copy(1, nElementLength - 2); diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx index 74bcc18dcde0..bcfc3db5a3b8 100644 --- a/xmloff/source/text/txtfldi.cxx +++ b/xmloff/source/text/txtfldi.cxx @@ -3826,7 +3826,7 @@ void XMLAnnotationImportContext::PrepareField( if ( sBuffer.getLength() ) { // delete last paragraph mark (if necessary) - if (sal_Char(0x0a) == sBuffer.getStr()[sBuffer.getLength()-1]) + if (sal_Char(0x0a) == sBuffer[sBuffer.getLength()-1]) sBuffer = sBuffer.copy(0, sBuffer.getLength()-1); xPropertySet->setPropertyValue(sPropertyContent, makeAny(sBuffer)); } diff --git a/xmloff/source/xforms/XFormsBindContext.cxx b/xmloff/source/xforms/XFormsBindContext.cxx index 1236cadb1d81..2a9f0213092e 100644 --- a/xmloff/source/xforms/XFormsBindContext.cxx +++ b/xmloff/source/xforms/XFormsBindContext.cxx @@ -162,7 +162,7 @@ static void lcl_fillNamespaceContainer( // as a hack, we will ignore our own 'default' namespaces DBG_ASSERT( !sPrefix.isEmpty(), "no prefix?" ); - if( sPrefix.getStr()[0] != sal_Unicode( '_' ) && + if( !sPrefix.startsWith("_") && nKeyIter >= XML_OLD_NAMESPACE_META_IDX ) { // insert prefix (use replace if already known) |