Kaydet (Commit) 9881bea8 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Noel Grandin

remove unnecessary use of OUString::getStr

Change-Id: I3d13e1c0bb6aa4a7aacc463198747c1368ebc9b4
Reviewed-on: https://gerrit.libreoffice.org/38114Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst ec4034c4
......@@ -1201,7 +1201,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property const * pUn
{
Reference< XInterface > xRef;
OUString aClassName = xIdlTargetClass->getName();
Type aClassType( xIdlTargetClass->getTypeClass(), aClassName.getStr() );
Type aClassType( xIdlTargetClass->getTypeClass(), aClassName );
aRetVal.setValue( &xRef, aClassType );
}
else
......@@ -1271,7 +1271,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property const * pUn
if( xIdlClass.is() )
{
OUString aClassName = xIdlClass->getName();
Type aType( xIdlClass->getTypeClass(), aClassName.getStr() );
Type aType( xIdlClass->getTypeClass(), aClassName );
aRetVal <<= aType;
}
}
......@@ -1550,7 +1550,7 @@ OUString Impl_GetInterfaceInfo( const Reference< XInterface >& x, const Referenc
aRetStr.append( " " );
aRetStr.append( xClass->getName() );
OUString aClassName = xClass->getName();
Type aClassType( xClass->getTypeClass(), aClassName.getStr() );
Type aClassType( xClass->getTypeClass(), aClassName );
// checking if the interface is really supported
if( !x->queryInterface( aClassType ).hasValue() )
......@@ -3076,7 +3076,7 @@ void RTL_Impl_HasInterfaces( SbxArray& rPar )
}
// check if the interface will be supported
OUString aClassName = xClass->getName();
Type aClassType( xClass->getTypeClass(), aClassName.getStr() );
Type aClassType( xClass->getTypeClass(), aClassName );
if( !(*x)->queryInterface( aClassType ).hasValue() )
{
return;
......@@ -4053,7 +4053,7 @@ void SbRtl_CreateUnoListener(StarBASIC * pBasic, SbxArray & rPar, bool)
return;
OUString aClassName = xClass->getName();
Type aClassType( xClass->getTypeClass(), aClassName.getStr() );
Type aClassType( xClass->getTypeClass(), aClassName );
aTmp = xLst->queryInterface( aClassType );
if( !aTmp.hasValue() )
return;
......
......@@ -3520,9 +3520,7 @@ void SbRtl_Shell(StarBASIC *, SbxArray & rPar, bool)
// #72471 work parameter(s) up
std::list<OUString>::const_iterator iter = aTokenList.begin();
const OUString& rStr = *iter;
OUString aOUStrProg( rStr.getStr(), rStr.getLength() );
OUString aOUStrProgURL = getFullPath( aOUStrProg );
OUString aOUStrProgURL = getFullPath( *iter );
++iter;
......@@ -3534,9 +3532,8 @@ void SbRtl_Shell(StarBASIC *, SbxArray & rPar, bool)
for(int iList = 0; iter != aTokenList.end(); ++iList, ++iter)
{
const OUString& rParamStr = (*iter);
const OUString aTempStr( rParamStr.getStr(), rParamStr.getLength());
pParamList[iList] = nullptr;
rtl_uString_assign(&(pParamList[iList]), aTempStr.pData);
rtl_uString_assign(&(pParamList[iList]), rParamStr.pData);
}
}
......
......@@ -567,8 +567,7 @@ OUString ObjectNameProvider::getHelpText( const OUString& rObjectCID, const Refe
OUString aXName ("x"), aYName ("f(x)");
const LocaleDataWrapper& rLocaleDataWrapper = Application::GetSettings().GetLocaleDataWrapper();
const OUString& aNumDecimalSep = rLocaleDataWrapper.getNumDecimalSep();
assert(aNumDecimalSep.getLength() > 0);
sal_Unicode cDecSeparator = aNumDecimalSep.getStr()[0];
sal_Unicode cDecSeparator = aNumDecimalSep[0];
uno::Reference< beans::XPropertySet > xProperties( xCurve, uno::UNO_QUERY );
if ( xProperties.is())
......@@ -668,8 +667,7 @@ OUString ObjectNameProvider::getHelpText( const OUString& rObjectCID, const Refe
const LocaleDataWrapper& rLocaleDataWrapper = Application::GetSettings().GetLocaleDataWrapper();
const OUString& aNumDecimalSep = rLocaleDataWrapper.getNumDecimalSep();
assert(aNumDecimalSep.getLength() > 0);
sal_Unicode cDecSeparator = aNumDecimalSep.getStr()[0];
sal_Unicode cDecSeparator = aNumDecimalSep[0];
OUString aWildcard( "%AVERAGE_VALUE" );
sal_Int32 nIndex = aRet.indexOf( aWildcard );
......
......@@ -396,7 +396,7 @@ OUString VSeriesPlotter::getLabelTextForValue( VDataSeries const & rDataSeries
const LocaleDataWrapper& rLocaleDataWrapper = Application::GetSettings().GetLocaleDataWrapper();
const OUString& aNumDecimalSep = rLocaleDataWrapper.getNumDecimalSep();
assert(aNumDecimalSep.getLength() > 0);
sal_Unicode cDecSeparator = aNumDecimalSep.getStr()[0];
sal_Unicode cDecSeparator = aNumDecimalSep[0];
aNumber = ::rtl::math::doubleToUString( fValue, rtl_math_StringFormat_G /*rtl_math_StringFormat*/
, 3/*DecPlaces*/ , cDecSeparator );
}
......@@ -1286,8 +1286,7 @@ void VSeriesPlotter::createRegressionCurveEquationShapes(
{
const LocaleDataWrapper& rLocaleDataWrapper = Application::GetSettings().GetLocaleDataWrapper();
const OUString& aNumDecimalSep = rLocaleDataWrapper.getNumDecimalSep();
assert(aNumDecimalSep.getLength() > 0);
sal_Unicode aDecimalSep = aNumDecimalSep.getStr()[0];
sal_Unicode aDecimalSep = aNumDecimalSep[0];
aFormula.append( ::rtl::math::doubleToUString(
fR*fR, rtl_math_StringFormat_G, 4, aDecimalSep, true ));
}
......
......@@ -181,13 +181,12 @@ sal_uInt32 DocPasswordHelper::GetWordHashAsUINT32(
sal_uInt16 nHighResult = pInitialCode[nLen - 1];
sal_uInt16 nLowResult = 0;
const sal_Unicode* pStr = aUString.getStr();
for ( sal_uInt32 nInd = 0; nInd < nLen; nInd++ )
{
// NO Encoding during conversion!
// The specification says that the low byte should be used in case it is not NULL
char nHighChar = (char)( pStr[nInd] >> 8 );
char nLowChar = (char)( pStr[nInd] & 0xFF );
char nHighChar = (char)( aUString[nInd] >> 8 );
char nLowChar = (char)( aUString[nInd] & 0xFF );
char nChar = nLowChar ? nLowChar : nHighChar;
for ( int nMatrixInd = 0; nMatrixInd < 7; ++nMatrixInd )
......
......@@ -459,7 +459,6 @@ OUString removeAny(OUString const& rIn,
OUString setToken(const OUString& rIn, sal_Int32 nToken, sal_Unicode cTok,
const OUString& rNewToken)
{
const sal_Unicode* pStr = rIn.getStr();
sal_Int32 nLen = rIn.getLength();
sal_Int32 nTok = 0;
sal_Int32 nFirstChar = 0;
......@@ -469,7 +468,7 @@ OUString setToken(const OUString& rIn, sal_Int32 nToken, sal_Unicode cTok,
while ( i < nLen )
{
// Increase token count if match
if (*pStr == cTok)
if (rIn[i] == cTok)
{
++nTok;
......@@ -479,7 +478,6 @@ OUString setToken(const OUString& rIn, sal_Int32 nToken, sal_Unicode cTok,
break;
}
++pStr;
++i;
}
......
......@@ -1867,8 +1867,8 @@ Sequence<sal_Int8> ORowSetValue::getSequence() const
case DataType::VARCHAR:
case DataType::LONGVARCHAR:
{
OUString sVal(m_aValue.m_pString);
aSeq = Sequence<sal_Int8>(reinterpret_cast<const sal_Int8*>(sVal.getStr()),sizeof(sal_Unicode)*sVal.getLength());
aSeq = Sequence<sal_Int8>(reinterpret_cast<const sal_Int8*>(m_aValue.m_pString->buffer),
sizeof(sal_Unicode) * m_aValue.m_pString->length);
}
break;
case DataType::BINARY:
......
......@@ -1006,7 +1006,7 @@ bool ODbaseTable::CreateImpl()
if ( aIdent.lastIndexOf('/') != (aIdent.getLength()-1) )
aIdent += "/";
aIdent += m_Name;
aName = aIdent.getStr();
aName = aIdent;
}
aURL.SetURL(aName);
......
......@@ -297,7 +297,7 @@ OUString SAL_CALL OConnection::nativeSQL( const OUString& sql )
{
::osl::MutexGuard aGuard( m_aMutex );
OString aSql(OUStringToOString(sql.getStr(),getTextEncoding()));
OString aSql(OUStringToOString(sql,getTextEncoding()));
char pOut[2048];
SQLINTEGER nOutLen;
OTools::ThrowException(this,N3SQLNativeSql(m_aConnectionHandle,reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(aSql.getStr())),aSql.getLength(),reinterpret_cast<SDB_ODBC_CHAR*>(pOut),sizeof pOut - 1,&nOutLen),m_aConnectionHandle,SQL_HANDLE_DBC,*this);
......@@ -391,7 +391,7 @@ void SAL_CALL OConnection::setCatalog( const OUString& catalog )
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
OString aCat(OUStringToOString(catalog.getStr(),getTextEncoding()));
OString aCat(OUStringToOString(catalog,getTextEncoding()));
OTools::ThrowException(this,
N3SQLSetConnectAttr(m_aConnectionHandle,SQL_ATTR_CURRENT_CATALOG,const_cast<char *>(aCat.getStr()),SQL_NTS),
m_aConnectionHandle,SQL_HANDLE_DBC,*this);
......
......@@ -252,7 +252,7 @@ Sequence< sal_Int8 > SAL_CALL ODatabaseMetaDataResultSet::getBytes( sal_Int32 co
case DataType::VARCHAR:
case DataType::LONGVARCHAR:
{
OUString aRet = OTools::getStringValue(m_pConnection.get(),m_aStatementHandle,columnIndex,SQL_C_BINARY,m_bWasNull,**this,m_nTextEncoding);
OUString const & aRet = OTools::getStringValue(m_pConnection.get(),m_aStatementHandle,columnIndex,SQL_C_BINARY,m_bWasNull,**this,m_nTextEncoding);
return Sequence<sal_Int8>(reinterpret_cast<const sal_Int8*>(aRet.getStr()),sizeof(sal_Unicode)*aRet.getLength());
}
}
......
......@@ -481,8 +481,7 @@ Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes( sal_Int32 columnIndex )
break;
default:
{
OUString sRet;
sRet = m_aRow[columnIndex].getString();
OUString const & sRet = m_aRow[columnIndex].getString();
nRet = Sequence<sal_Int8>(reinterpret_cast<const sal_Int8*>(sRet.getStr()),sizeof(sal_Unicode)*sRet.getLength());
}
}
......@@ -501,7 +500,7 @@ Sequence< sal_Int8 > OResultSet::impl_getBytes( sal_Int32 columnIndex )
case SQL_CHAR:
case SQL_LONGVARCHAR:
{
OUString aRet = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,nColumnType,m_bWasNull,**this,m_nTextEncoding);
OUString const & aRet = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,nColumnType,m_bWasNull,**this,m_nTextEncoding);
return Sequence<sal_Int8>(reinterpret_cast<const sal_Int8*>(aRet.getStr()),sizeof(sal_Unicode)*aRet.getLength());
}
default:
......@@ -1787,8 +1786,7 @@ void OResultSet::fillNeededData(SQLRETURN _nRet)
break;
case SQL_WLONGVARCHAR:
{
OUString sRet;
sRet = m_aRow[nColumnIndex].getString();
OUString const & sRet = m_aRow[nColumnIndex].getString();
N3SQLPutData (m_aStatementHandle, static_cast<SQLPOINTER>(const_cast<sal_Unicode *>(sRet.getStr())), sizeof(sal_Unicode)*sRet.getLength());
break;
}
......
......@@ -700,9 +700,8 @@ Reference< XInterface > ORegistryFactoryHelper::createModuleFactory()
{
aActivatorUrl = xActivatorKey->getAsciiValue();
OUString tmpActivator(aActivatorUrl.getStr());
sal_Int32 nIndex = 0;
aActivatorName = tmpActivator.getToken(0, ':', nIndex );
aActivatorName = aActivatorUrl.getToken(0, ':', nIndex );
Reference<XRegistryKey > xLocationKey = xImplementationKey->openKey(
"/UNO/LOCATION" );
......
......@@ -842,7 +842,7 @@ Any ODbDataSourceAdministrationHelper::implTranslateProperty(const SfxPoolItem*
if ( pStringItem )
{
aValue <<= OUString( pStringItem->GetValue().getStr() );
aValue <<= pStringItem->GetValue();
}
else if ( pBoolItem )
{
......
......@@ -165,7 +165,7 @@ namespace dbaui
if (xMeta.is())
qualifiedNameComponents(xMeta, pIncludeTable->getStr(), sCatalog, sSchema, sName,::dbtools::EComposeRule::InDataManipulation);
else
sName = pIncludeTable->getStr();
sName = *pIncludeTable;
bool bAllTables = (1 == sName.getLength()) && ('%' == sName[0]);
bool bAllSchemas = (1 == sSchema.getLength()) && ('%' == sSchema[0]);
......
......@@ -2068,7 +2068,7 @@ namespace accessibility
if( nIndex <= aBoundary.endPos )
{
nextWord = aBoundary.endPos;
if( sText.getStr()[nextWord] == u' ' ) nextWord++;
if( sText[nextWord] == u' ' ) nextWord++;
bWord = implGetWordBoundary( aBoundary, nextWord );
}
......
......@@ -959,13 +959,11 @@ EditPaM ImpEditEngine::CursorVisualStartEnd( EditView const * pEditView, const E
{
OUString aLine = aPaM.GetNode()->GetString().copy(rLine.GetStart(), rLine.GetEnd() - rLine.GetStart());
const sal_Unicode* pLineString = aLine.getStr();
UErrorCode nError = U_ZERO_ERROR;
UBiDi* pBidi = ubidi_openSized( aLine.getLength(), 0, &nError );
const UBiDiLevel nBidiLevel = IsRightToLeft( nPara ) ? 1 /*RTL*/ : 0 /*LTR*/;
ubidi_setPara( pBidi, reinterpret_cast<const UChar *>(pLineString), aLine.getLength(), nBidiLevel, nullptr, &nError );
ubidi_setPara( pBidi, reinterpret_cast<const UChar *>(aLine.getStr()), aLine.getLength(), nBidiLevel, nullptr, &nError );
sal_Int32 nVisPos = bStart ? 0 : aLine.getLength()-1;
const sal_Int32 nLogPos = ubidi_getLogicalIndex( pBidi, nVisPos, &nError );
......@@ -1080,13 +1078,11 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView const * pEditView, const
OUString aLine = aPaM.GetNode()->GetString().copy(rLine.GetStart(), rLine.GetEnd() - rLine.GetStart());
const sal_Int32 nPosInLine = aPaM.GetIndex() - rLine.GetStart();
const sal_Unicode* pLineString = aLine.getStr();
UErrorCode nError = U_ZERO_ERROR;
UBiDi* pBidi = ubidi_openSized( aLine.getLength(), 0, &nError );
const UBiDiLevel nBidiLevel = IsRightToLeft( nPara ) ? 1 /*RTL*/ : 0 /*LTR*/;
ubidi_setPara( pBidi, reinterpret_cast<const UChar *>(pLineString), aLine.getLength(), nBidiLevel, nullptr, &nError );
ubidi_setPara( pBidi, reinterpret_cast<const UChar *>(aLine.getStr()), aLine.getLength(), nBidiLevel, nullptr, &nError );
if ( !pEditView->IsInsertMode() )
{
......@@ -1931,10 +1927,8 @@ void ImpEditEngine::InitWritingDirections( sal_Int32 nPara )
const UBiDiLevel nBidiLevel = IsRightToLeft( nPara ) ? 1 /*RTL*/ : 0 /*LTR*/;
if ( ( bCTL || ( nBidiLevel == 1 /*RTL*/ ) ) && pParaPortion->GetNode()->Len() )
{
OUString aText = pParaPortion->GetNode()->GetString();
// Bidi functions from icu 2.0
UErrorCode nError = U_ZERO_ERROR;
......
......@@ -214,7 +214,7 @@ namespace dbp
{
SAL_WARN( "extensions.dbpilots", "OGridWizard::implApplySettings: "
"unexpected exception while creating the grid column for field " <<
pFormFieldName->getStr() << "!" );
*pFormFieldName );
}
}
}
......
......@@ -216,11 +216,7 @@ namespace pcr
OUString lcl_getEventPropertyName( const OUString& _rListenerClassName, const OUString& _rMethodName )
{
OUStringBuffer aPropertyName;
aPropertyName.append( _rListenerClassName );
aPropertyName.append( ';' );
aPropertyName.append( _rMethodName.getStr() );
return aPropertyName.makeStringAndClear();
return _rListenerClassName + OUStringLiteral1(';') + _rMethodName;
}
ScriptEventDescriptor lcl_getAssignedScriptEvent( const EventDescription& _rEvent, const std::vector< ScriptEventDescriptor >& _rAllAssignedMacros )
......
......@@ -53,7 +53,7 @@ namespace pcr
INetURLObject aHID( aTmp );
if ( aHID.GetProtocol() == INetProtocol::NotValid )
aBuffer.append( INET_HID_SCHEME );
aBuffer.append( aTmp.getStr() );
aBuffer.append( aTmp );
return aBuffer.makeStringAndClear();
}
......
......@@ -187,7 +187,7 @@ namespace pcr
if (!::comphelper::hasProperty(PROPERTY_NAME, xAsSet))
// we need at least a name for displaying ...
continue;
sName = ::comphelper::getString(xAsSet->getPropertyValue(PROPERTY_NAME)).getStr();
sName = ::comphelper::getString(xAsSet->getPropertyValue(PROPERTY_NAME));
// we need to check if the control model supports the required service
Reference< XServiceInfo > xInfo(xAsSet, UNO_QUERY);
......
......@@ -357,13 +357,13 @@ void SAL_CALL DispatchRecorder::implts_recordMacro( const OUString& aURL,
if(bAsComment)
aScriptBuffer.append(REM_AS_COMMENT);
aScriptBuffer.append("dispatcher.executeDispatch(document, \"");
aScriptBuffer.append (aURL);
aScriptBuffer.append(aURL);
aScriptBuffer.append("\", \"\", 0, ");
if(nValidArgs<1)
aScriptBuffer.append("Array()");
else
{
aScriptBuffer.append( sArrayName.getStr() );
aScriptBuffer.append( sArrayName );
aScriptBuffer.append("()");
}
aScriptBuffer.append(")\n\n");
......
......@@ -121,7 +121,6 @@ static inline void printDataArea(FILE *dictionary_fp, FILE *source_fp, vector<sa
// input file is in UTF-8 encoding
// don't convert last new line character to Ostr.
OUString Ostr(str, strlen(str) - 1, RTL_TEXTENCODING_UTF8);
const sal_Unicode *u = Ostr.getStr();
const sal_Int32 len = Ostr.getLength();
......@@ -130,24 +129,24 @@ static inline void printDataArea(FILE *dictionary_fp, FILE *source_fp, vector<sa
if (len == i)
continue; // skip one character word
if (u[0] != current) {
OSL_ENSURE( (u[0] > current), "Dictionary file should be sorted");
current = u[0];
if (Ostr[0] != current) {
OSL_ENSURE( (Ostr[0] > current), "Dictionary file should be sorted");
current = Ostr[0];
charArray[current] = lenArray.size();
}
lenArray.push_back(lenArrayCurr);
set_exists(u[0]);
set_exists(Ostr[0]);
// first character is stored in charArray, so start from second
for (i = 1; i < len; i++, lenArrayCurr++) {
set_exists(u[i]);
set_exists(Ostr[i]);
#ifndef DICT_JA_ZH_IN_DATAFILE
fprintf(source_fp, "0x%04x, ", u[i]);
fprintf(source_fp, "0x%04x, ", Ostr[i]);
if ((lenArrayCurr & 0x0f) == 0x0f)
fputs("\n\t", source_fp);
#else
fwrite(&u[i], sizeof(u[i]), 1, source_fp);
fwrite(&Ostr[i], sizeof(Ostr[i]), 1, source_fp);
#endif
}
}
......
......@@ -119,7 +119,6 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
fprintf(fp, "\n};\n\n");
sal_Int32 len=result.getLength();
const sal_Unicode *ustr=result.getStr();
fprintf(fp, "\nstatic const sal_uInt16 idx2[] = {");
for (i = k = 0; i <= max_index; i++) {
if (index[i] != 0xFFFF) {
......@@ -129,7 +128,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
fprintf(
fp, "0x%04lx, ",
sal::static_int_cast< unsigned long >(
ad == -1 ? 0 : max == 2 ? ustr[ad] : ad));
ad == -1 ? 0 : max == 2 ? result[ad] : ad));
}
fprintf(fp, "\n\t");
}
......@@ -142,7 +141,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
fprintf(fp, "\nstatic const sal_uInt16 idx3[] = {");
for (i = k = 0; i < len; i++) {
if (k++ % 16 == 0) fprintf(fp, "\n\t");
fprintf(fp, "0x%04x, ", (sep.toChar() == ustr[i]) ? 0 : ustr[i]);
fprintf(fp, "0x%04x, ", (sep.toChar() == result[i]) ? 0 : result[i]);
}
fprintf(fp, "\n};\n\n");
}
......
......@@ -101,19 +101,18 @@ void make_hhc_char(FILE *sfp, FILE *cfp)
// input file is in UTF-8 encoding (Hangul:Hanja)
// don't convert last new line character to Ostr.
OUString Ostr(Cstr, strlen(Cstr) - 1, RTL_TEXTENCODING_UTF8);
const sal_Unicode *Ustr = Ostr.getStr();
sal_Int32 len = Ostr.getLength();
Hangul2HanjaData[count][0] = Ustr[0];
Hangul2HanjaData[count][0] = Ostr[0];
Hangul2HanjaData[count][1] = sal::static_int_cast<sal_uInt16>( address );
Hangul2HanjaData[count][2] = sal::static_int_cast<sal_uInt16>( len - 2 );
count++;
for (i = 2; i < len; i++) {
Hanja2HangulData[Ustr[i]] = Ustr[0];
Hanja2HangulData[Ostr[i]] = Ostr[0];
if (address++ % 16 == 0)
fprintf(cfp, "\n\t");
fprintf(cfp, "0x%04x, ", Ustr[i]);
fprintf(cfp, "0x%04x, ", Ostr[i]);
}
}
fprintf(cfp, "\n};\n");
......@@ -189,17 +188,16 @@ void make_stc_char(FILE *sfp, FILE *cfp)
// input file is in UTF-8 encoding (SChinese:TChinese)
// don't convert last new line character to Ostr.
OUString Ostr(Cstr, strlen(Cstr) - 1, RTL_TEXTENCODING_UTF8);
const sal_Unicode *Ustr = Ostr.getStr();
sal_Int32 len = Ostr.getLength();
if (Ustr[1] == 'v')
SChinese2VChineseData[Ustr[0]] = Ustr[2];
if (Ostr[1] == 'v')
SChinese2VChineseData[Ostr[0]] = Ostr[2];
else {
SChinese2TChineseData[Ustr[0]] = Ustr[2];
if (SChinese2VChineseData[Ustr[0]] == 0)
SChinese2VChineseData[Ustr[0]] = Ustr[2];
SChinese2TChineseData[Ostr[0]] = Ostr[2];
if (SChinese2VChineseData[Ostr[0]] == 0)
SChinese2VChineseData[Ostr[0]] = Ostr[2];
}
for (i = 2; i < len; i++)
TChinese2SChineseData[Ustr[i]] = Ustr[0];
TChinese2SChineseData[Ostr[i]] = Ostr[0];
}
fprintf(cfp, "\nstatic const sal_uInt16 STC_CharIndex_S2T[] = {");
......
......@@ -42,9 +42,9 @@ public:
bool operator() (const OUString& x, const OUString& y) const
{
if (m_bCaseSensitive)
return rtl_ustr_compare(x.getStr(), y.getStr()) < 0;
return x.compareTo(y) < 0;
else
return rtl_ustr_compareIgnoreAsciiCase(x.getStr(), y.getStr()) < 0;
return x.compareToIgnoreAsciiCase(y) < 0;
}
bool isCaseSensitive() const {return m_bCaseSensitive;}
......
......@@ -181,7 +181,7 @@ public:
parameters will be modified.
*/
static sal_Unicode const * scanContentType(
sal_Unicode const *pBegin, sal_Unicode const * pEnd,
OUString const & rStr,
OUString * pType = nullptr, OUString * pSubType = nullptr,
INetContentTypeParameterList * pParameters = nullptr);
......
......@@ -774,7 +774,7 @@ void addJREInfoFromBinPath(
else
{
// jre/bin/jre -> jre/bin
OUString sMapPath(i->getStr(), index);
OUString sMapPath = i->copy(0, index);
index = sBinPath.lastIndexOf(sMapPath);
if (index != -1
&& (index + sMapPath.getLength() == sBinPath.getLength())
......
......@@ -175,8 +175,8 @@ rtl::ByteSequence decodeBase16(const rtl::ByteSequence& data)
OUString getDirFromFile(const OUString& usFilePath)
{
sal_Int32 index= usFilePath.lastIndexOf('/');
return OUString(usFilePath.getStr(), index);
sal_Int32 index = usFilePath.lastIndexOf('/');
return usFilePath.copy(0, index);
}
OUString getLibraryLocation()
......
......@@ -321,7 +321,7 @@ void DicList::SearchForDictionaries(
size_t nCount = rDicList.size();
for(j = 0; j < nCount; j++)
{
aTmp2 = rDicList[j]->getName().getStr();
aTmp2 = rDicList[j]->getName();
aTmp2 = ToLower( aTmp2, nSystemLanguage );
if(aTmp1 == aTmp2)
break;
......
......@@ -212,7 +212,7 @@ OUString getLibDir()
if( Module::getUrlFromAddress(
reinterpret_cast< oslGenericFunction >(getLibDir), libDir ) )
{
libDir = OUString( libDir.getStr(), libDir.lastIndexOf('/' ) );
libDir = libDir.copy( 0, libDir.lastIndexOf('/') );
OUString name ( "PYUNOLIBDIR" );
rtl_bootstrap_set( name.pData, libDir.pData );
}
......
......@@ -1036,7 +1036,7 @@ OUString ORegKey::getFullPath(OUString const & path) const {
OUStringBuffer b(m_name);
if (!b.isEmpty() && b[b.getLength() - 1] == '/') {
if (path[0] == '/') {
b.append(path.getStr() + 1, path.getLength() - 1);
b.append(path.copy(1));
} else {
b.append(path);
}
......
......@@ -357,7 +357,7 @@ void OAddFieldWindow::Update()
lcl_addToList( *m_pListBox, aParamNames );
// set title
aTitle += " " + OUString( m_aCommandName.getStr() );
aTitle += " " + m_aCommandName;
SetText( aTitle );
if ( !m_aCommandName.isEmpty() )
{
......
......@@ -218,7 +218,7 @@ void FormulaDialog::ToggleCollapsed( RefEdit* _pEdit, RefButton* _pButton)
SvtViewOptions aDlgOpt( EViewType::Window, HID_RPT_FIELD_SEL_WIN );
if ( aDlgOpt.Exists() )
{
m_pAddField->SetWindowState(OUStringToOString(aDlgOpt.GetWindowState().getStr(), RTL_TEXTENCODING_ASCII_US));
m_pAddField->SetWindowState(OUStringToOString(aDlgOpt.GetWindowState(), RTL_TEXTENCODING_ASCII_US));
}
......
......@@ -33,12 +33,9 @@ namespace rptui
{
OUString HelpIdUrl::getHelpURL( const OString& sHelpId )
{
OUStringBuffer aBuffer;
OUString aTmp( OStringToOUString(sHelpId, RTL_TEXTENCODING_UTF8) );
DBG_ASSERT( INetURLObject( aTmp ).GetProtocol() == INetProtocol::NotValid, "Wrong HelpId!" );
aBuffer.append( INET_HID_SCHEME );
aBuffer.append( aTmp.getStr() );
return aBuffer.makeStringAndClear();
return INET_HID_SCHEME + aTmp;
}
using namespace com::sun::star::uno;
......
......@@ -114,11 +114,11 @@ void SAL_CALL osl_systemPathGetFileNameOrLastDirectoryPart(
rtl::OUString last_part;
if (path.getLength() > 1 || (path.getLength() == 1 && *path.getStr() != FPH_CHAR_PATH_SEPARATOR))
if (path.getLength() > 1 || (path.getLength() == 1 && path[0] != FPH_CHAR_PATH_SEPARATOR))
{
sal_Int32 idx_ps = path.lastIndexOf(FPH_CHAR_PATH_SEPARATOR);
idx_ps++; // always right to increment by one even if idx_ps == -1!
last_part = rtl::OUString(path.getStr() + idx_ps);
last_part = path.copy(idx_ps);
}
rtl_uString_assign(ppustrFileNameOrLastDirPart, last_part.pData);
}
......
......@@ -791,13 +791,15 @@ inline bool SaxWriterHelper::comment(const OUString& rComment)
return bRet;
}
inline sal_Int32 calcXMLByteLength( const sal_Unicode *pStr, sal_Int32 nStrLen,
inline sal_Int32 calcXMLByteLength( const OUString& rStr,
bool bDoNormalization,
bool bNormalizeWhitespace )
{
sal_Int32 nOutputLength = 0;
sal_uInt32 nSurrogate = 0;
const sal_Unicode *pStr = rStr.getStr();
sal_Int32 nStrLen = rStr.getLength();
for( sal_Int32 i = 0 ; i < nStrLen ; i++ )
{
sal_uInt16 c = pStr[i];
......@@ -1075,21 +1077,20 @@ void SAXWriter::startElement(const OUString& aName, const Reference< XAttributeL
sal_Int32 nAttribCount = xAttribs.is() ? xAttribs->getLength() : 0;
nLength ++; // "<"
nLength += calcXMLByteLength( aName.getStr() , aName.getLength(),
false, false ); // the tag name
nLength += calcXMLByteLength( aName, false, false ); // the tag name
sal_Int16 n;
for( n = 0 ; n < static_cast<sal_Int16>(nAttribCount) ; n ++ ) {
nLength ++; // " "
OUString tmp = xAttribs->getNameByIndex( n );
nLength += calcXMLByteLength( tmp.getStr() , tmp.getLength() , false, false );
nLength += calcXMLByteLength( tmp, false, false );
nLength += 2; // ="
tmp = xAttribs->getValueByIndex( n );