binfilter/bf_forms/source/component/forms_DatabaseForm.cxx | 4 - binfilter/bf_sc/source/core/tool/sc_compiler.cxx | 6 - binfilter/bf_sc/source/filter/xml/sc_xmlconti.cxx | 2 binfilter/bf_sch/source/core/sch_memchrt.cxx | 30 ++++----- binfilter/bf_xmloff/source/core/xmloff_xmluconv.cxx | 34 ++++------ binfilter/bf_xmloff/source/forms/xmloff_elementimport.cxx | 18 ++--- binfilter/bf_xmloff/source/forms/xmloff_layerimport.cxx | 6 - binfilter/bf_xmloff/source/forms/xmloff_propertyexport.cxx | 6 - binfilter/bf_xmloff/source/forms/xmloff_propertyimport.cxx | 42 ++++++------- binfilter/bf_xmloff/source/meta/xmloff_xmlmetai.cxx | 2 binfilter/inc/bf_sch/memchrt.hxx | 2 11 files changed, 74 insertions(+), 78 deletions(-)
New commits: commit 34c2ec87db4b6962ded661157056c58163e39821 Author: Stephan Bergmann <sberg...@redhat.com> Date: Tue Sep 27 20:23:45 2011 +0200 Removed uses of rtl::O[U]String[Buffer]::operator sal_{char|Unicode} const *(). diff --git a/binfilter/bf_forms/source/component/forms_DatabaseForm.cxx b/binfilter/bf_forms/source/component/forms_DatabaseForm.cxx index 8e72ef0..55ac80e 100644 --- a/binfilter/bf_forms/source/component/forms_DatabaseForm.cxx +++ b/binfilter/bf_forms/source/component/forms_DatabaseForm.cxx @@ -1245,8 +1245,8 @@ bool ODatabaseForm::fillParameters(::osl::ResettableMutexGuard& _rClearForNotifi } catch( const Exception& ) { - OSL_FAIL( ::rtl::OString( "ODatabaseForm::fillParameters: master-detail parameter number " ) - += ::rtl::OString::valueOf( sal_Int32(aFind->second + 1) )); + OSL_FAIL( (::rtl::OString( "ODatabaseForm::fillParameters: master-detail parameter number " ) + += ::rtl::OString::valueOf( sal_Int32(aFind->second + 1) )).getStr() ); } ++aFind; } diff --git a/binfilter/bf_sc/source/core/tool/sc_compiler.cxx b/binfilter/bf_sc/source/core/tool/sc_compiler.cxx index 73d6ae7..dbb3a44 100644 --- a/binfilter/bf_sc/source/core/tool/sc_compiler.cxx +++ b/binfilter/bf_sc/source/core/tool/sc_compiler.cxx @@ -2992,7 +2992,7 @@ namespace binfilter { /*N*/ { /*N*/ ::rtl::OUStringBuffer aBuffer; /*N*/ ScToken* p = CreateStringFromToken( aBuffer, pInToken, bAllowArrAdvance ); -/*N*/ rFormula += aBuffer; +/*N*/ rFormula += aBuffer.makeStringAndClear(); /*N*/ return p; /*N*/ } @@ -3140,7 +3140,7 @@ namespace binfilter { /*?*/ break; /*?*/ } /*N*/ if ( aBuffer.getLength() ) -/*N*/ rBuffer.append(aBuffer); +/*N*/ rBuffer.append(aBuffer.makeStringAndClear()); /*N*/ else /*?*/ rBuffer.append(ScGlobal::GetRscString(STR_NO_NAME_REF)); /*N*/ break; @@ -3177,7 +3177,7 @@ namespace binfilter { /*N*/ { /*N*/ ::rtl::OUStringBuffer aBuffer( pArr->GetLen() * 2 ); /*N*/ CreateStringFromTokenArray( aBuffer ); -/*N*/ rFormula = aBuffer; +/*N*/ rFormula = aBuffer.makeStringAndClear(); /*N*/ } /*N*/ void ScCompiler::CreateStringFromTokenArray( ::rtl::OUStringBuffer& rBuffer ) diff --git a/binfilter/bf_sc/source/filter/xml/sc_xmlconti.cxx b/binfilter/bf_sc/source/filter/xml/sc_xmlconti.cxx index 2d1e506..0c297aa 100644 --- a/binfilter/bf_sc/source/filter/xml/sc_xmlconti.cxx +++ b/binfilter/bf_sc/source/filter/xml/sc_xmlconti.cxx @@ -100,7 +100,7 @@ void ScXMLContentContext::Characters( const ::rtl::OUString& rChars ) void ScXMLContentContext::EndElement() { - sValue.append(sOUText); + sValue.append(sOUText.toString()); } } diff --git a/binfilter/bf_sch/source/core/sch_memchrt.cxx b/binfilter/bf_sch/source/core/sch_memchrt.cxx index a8967e7..bf5e151 100644 --- a/binfilter/bf_sch/source/core/sch_memchrt.cxx +++ b/binfilter/bf_sch/source/core/sch_memchrt.cxx @@ -686,41 +686,39 @@ using namespace ::com::sun::star; // ======================================== -/*N*/ ::rtl::OUStringBuffer SchMemChart::getXMLStringForCellAddress( const SchCellAddress& rCell ) +/*N*/ void SchMemChart::getXMLStringForCellAddress( const SchCellAddress& rCell, rtl::OUStringBuffer * output ) /*N*/ { -/*N*/ ::rtl::OUStringBuffer aBuffer; +/*N*/ OSL_ASSERT(output != 0); /*N*/ ::std::vector< SchSingleCell >::const_iterator aIter; /*N*/ const ::std::vector< SchSingleCell >::const_iterator aEndIter = rCell.maCells.end(); /*N*/ /*N*/ for( aIter = rCell.maCells.begin(); aIter != aEndIter; aIter++ ) /*N*/ { /*N*/ sal_Int32 nCol = aIter->mnColumn; -/*N*/ aBuffer.append( (sal_Unicode)'.' ); +/*N*/ output->append( (sal_Unicode)'.' ); /*N*/ if( ! aIter->mbRelativeColumn ) -/*N*/ aBuffer.append( (sal_Unicode)'$' ); +/*N*/ output->append( (sal_Unicode)'$' ); /*N*/ /*N*/ // get A, B, C, ..., AA, AB, ... representation of column number /*N*/ if( nCol < 26 ) -/*N*/ aBuffer.append( (sal_Unicode)('A' + nCol) ); +/*N*/ output->append( (sal_Unicode)('A' + nCol) ); /*N*/ else if( nCol < 702 ) /*N*/ { -/*?*/ aBuffer.append( (sal_Unicode)('A' + nCol / 26 - 1 )); -/*?*/ aBuffer.append( (sal_Unicode)('A' + nCol % 26) ); +/*?*/ output->append( (sal_Unicode)('A' + nCol / 26 - 1 )); +/*?*/ output->append( (sal_Unicode)('A' + nCol % 26) ); /*N*/ } /*N*/ else // works for nCol <= 18,278 /*N*/ { -/*?*/ aBuffer.append( (sal_Unicode)('A' + nCol / 702 - 1 )); -/*?*/ aBuffer.append( (sal_Unicode)('A' + (nCol % 702) / 26 )); -/*?*/ aBuffer.append( (sal_Unicode)('A' + nCol % 26) ); +/*?*/ output->append( (sal_Unicode)('A' + nCol / 702 - 1 )); +/*?*/ output->append( (sal_Unicode)('A' + (nCol % 702) / 26 )); +/*?*/ output->append( (sal_Unicode)('A' + nCol % 26) ); /*N*/ } /*N*/ /*N*/ // write row number as number /*N*/ if( ! aIter->mbRelativeRow ) -/*N*/ aBuffer.append( (sal_Unicode)'$' ); -/*N*/ aBuffer.append( aIter->mnRow + (sal_Int32)1 ); +/*N*/ output->append( (sal_Unicode)'$' ); +/*N*/ output->append( aIter->mnRow + (sal_Int32)1 ); /*N*/ } -/*N*/ -/*N*/ return aBuffer; /*N*/ } /*N*/ void SchMemChart::getSingleCellAddressFromXMLString( @@ -922,13 +920,13 @@ using namespace ::com::sun::star; /*?*/ else /*?*/ aBuffer.append( aIter->msTableName ); /*?*/ } -/*?*/ aBuffer.append( getXMLStringForCellAddress( aIter->maUpperLeft )); +/*?*/ getXMLStringForCellAddress( aIter->maUpperLeft, &aBuffer ); /*?*/ /*?*/ if( aIter->maLowerRight.maCells.size()) /*?*/ { /*?*/ // we have a range (not a single cell) /*?*/ aBuffer.append( sal_Unicode( ':' )); -/*?*/ aBuffer.append( getXMLStringForCellAddress( aIter->maLowerRight )); +/*?*/ getXMLStringForCellAddress( aIter->maLowerRight, &aBuffer ); /*?*/ } /*?*/ /*?*/ aIter++; diff --git a/binfilter/bf_xmloff/source/core/xmloff_xmluconv.cxx b/binfilter/bf_xmloff/source/core/xmloff_xmluconv.cxx index 80442f0..4c7941f 100644 --- a/binfilter/bf_xmloff/source/core/xmloff_xmluconv.cxx +++ b/binfilter/bf_xmloff/source/core/xmloff_xmluconv.cxx @@ -650,7 +650,7 @@ void SvXMLUnitConverter::convertDouble( ::rtl::OUStringBuffer& rBuffer, fNumber *= fFactor; ::rtl::math::doubleToUStringBuffer( rBuffer, fNumber, rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, '.', sal_True); if(bWriteUnits) - rBuffer.append(sUnit); + rBuffer.append(sUnit.makeStringAndClear()); } } @@ -1491,7 +1491,6 @@ void ThreeByteToFourByte (const sal_Int8* pBuffer, const sal_Int32 nStart, const nLen = 3; if (nLen == 0) { - sBuffer.setLength(0); return; } @@ -1518,23 +1517,24 @@ void ThreeByteToFourByte (const sal_Int8* pBuffer, const sal_Int32 nStart, const break; } - sBuffer.appendAscii("===="); + sal_Unicode buf[4] = { '=', '=', '=', '=' }; sal_uInt8 nIndex ((nBinaer & 0xFC0000) >> 18); - sBuffer.setCharAt(0, aBase64EncodeTable [nIndex]); + buf[0] = aBase64EncodeTable [nIndex]; nIndex = (nBinaer & 0x3F000) >> 12; - sBuffer.setCharAt(1, aBase64EncodeTable [nIndex]); - if (nLen == 1) - return; - - nIndex = (nBinaer & 0xFC0) >> 6; - sBuffer.setCharAt(2, aBase64EncodeTable [nIndex]); - if (nLen == 2) - return; - - nIndex = (nBinaer & 0x3F); - sBuffer.setCharAt(3, aBase64EncodeTable [nIndex]); + buf[1] = aBase64EncodeTable [nIndex]; + if (nLen > 1) + { + nIndex = (nBinaer & 0xFC0) >> 6; + buf[2] = aBase64EncodeTable [nIndex]; + if (nLen > 2) + { + nIndex = (nBinaer & 0x3F); + buf[3] = aBase64EncodeTable [nIndex]; + } + } + sBuffer.append(buf, SAL_N_ELEMENTS(buf)); } void SvXMLUnitConverter::encodeBase64( ::rtl::OUStringBuffer& aStrBuffer, const uno::Sequence<sal_Int8>& aPass) @@ -1544,9 +1544,7 @@ void SvXMLUnitConverter::encodeBase64( ::rtl::OUStringBuffer& aStrBuffer, const const sal_Int8* pBuffer = aPass.getConstArray(); while (i < nBufferLength) { - ::rtl::OUStringBuffer sBuffer; - ThreeByteToFourByte (pBuffer, i, nBufferLength, sBuffer); - aStrBuffer.append(sBuffer); + ThreeByteToFourByte (pBuffer, i, nBufferLength, aStrBuffer); i += 3; } } diff --git a/binfilter/bf_xmloff/source/forms/xmloff_elementimport.cxx b/binfilter/bf_xmloff/source/forms/xmloff_elementimport.cxx index d1b8e0b..855958a 100644 --- a/binfilter/bf_xmloff/source/forms/xmloff_elementimport.cxx +++ b/binfilter/bf_xmloff/source/forms/xmloff_elementimport.cxx @@ -169,9 +169,9 @@ namespace xmloff ) { OSL_ENSURE(xPropInfo->hasPropertyByName(aCheck->Name), - ::rtl::OString("OElementImport::EndElement: read a property (") - += ::rtl::OString(aCheck->Name.getStr(), aCheck->Name.getLength(), RTL_TEXTENCODING_ASCII_US) - += ::rtl::OString(") which does not exist on the element!")); + (::rtl::OString("OElementImport::EndElement: read a property (") + += ::rtl::OString(aCheck->Name.getStr(), aCheck->Name.getLength(), RTL_TEXTENCODING_ASCII_US) + += ::rtl::OString(") which does not exist on the element!")).getStr()); } } #endif @@ -230,9 +230,9 @@ namespace xmloff } catch(Exception&) { - OSL_FAIL(::rtl::OString("OElementImport::EndElement: could not set the property \"") - += ::rtl::OString(aPropValues->Name.getStr(), aPropValues->Name.getLength(), RTL_TEXTENCODING_ASCII_US) - += ::rtl::OString("\"!")); + OSL_FAIL((::rtl::OString("OElementImport::EndElement: could not set the property \"") + += ::rtl::OString(aPropValues->Name.getStr(), aPropValues->Name.getLength(), RTL_TEXTENCODING_ASCII_US) + += ::rtl::OString("\"!")).getStr()); } } } @@ -330,9 +330,9 @@ namespace xmloff { Reference< XInterface > xPure = m_rFormImport.getServiceFactory()->createInstance(m_sServiceName); OSL_ENSURE(xPure.is(), - ::rtl::OString("OElementImport::createElement: service factory gave me no object (service name: ") - += ::rtl::OString(m_sServiceName.getStr(), m_sServiceName.getLength(), RTL_TEXTENCODING_ASCII_US) - += ::rtl::OString(")!")); + (::rtl::OString("OElementImport::createElement: service factory gave me no object (service name: ") + += ::rtl::OString(m_sServiceName.getStr(), m_sServiceName.getLength(), RTL_TEXTENCODING_ASCII_US) + += ::rtl::OString(")!")).getStr()); xReturn = Reference< XPropertySet >(xPure, UNO_QUERY); } else diff --git a/binfilter/bf_xmloff/source/forms/xmloff_layerimport.cxx b/binfilter/bf_xmloff/source/forms/xmloff_layerimport.cxx index c4ea931..71f7644 100644 --- a/binfilter/bf_xmloff/source/forms/xmloff_layerimport.cxx +++ b/binfilter/bf_xmloff/source/forms/xmloff_layerimport.cxx @@ -345,9 +345,9 @@ namespace xmloff const SvXMLStyleContext* pControlStyle = m_pAutoStyles ? m_pAutoStyles->FindStyleChildContext( XML_STYLE_FAMILY_CONTROL_ID, _rStyleName ) : NULL; OSL_ENSURE( pControlStyle || !m_pAutoStyles, - ::rtl::OString( "OFormLayerXMLImport_Impl::getStyleElement: did not find the style named \"" ) - += ::rtl::OString( _rStyleName.getStr(), _rStyleName.getLength(), RTL_TEXTENCODING_ASCII_US ) - += ::rtl::OString( "\"!" ) ); + (::rtl::OString( "OFormLayerXMLImport_Impl::getStyleElement: did not find the style named \"" ) + += ::rtl::OString( _rStyleName.getStr(), _rStyleName.getLength(), RTL_TEXTENCODING_ASCII_US ) + += ::rtl::OString( "\"!" )).getStr() ); return pControlStyle; } diff --git a/binfilter/bf_xmloff/source/forms/xmloff_propertyexport.cxx b/binfilter/bf_xmloff/source/forms/xmloff_propertyexport.cxx index ade579d..9a5a01c 100644 --- a/binfilter/bf_xmloff/source/forms/xmloff_propertyexport.cxx +++ b/binfilter/bf_xmloff/source/forms/xmloff_propertyexport.cxx @@ -708,9 +708,9 @@ namespace xmloff // the property must exist if (!m_xPropertyInfo->hasPropertyByName(_rPropertyName)) { - OSL_FAIL(::rtl::OString("OPropertyExport::dbg_implCheckProperty: no property with the name ") += - ::rtl::OString(_rPropertyName.getStr(), _rPropertyName.getLength(), RTL_TEXTENCODING_ASCII_US) += - ::rtl::OString("!")); + OSL_FAIL((::rtl::OString("OPropertyExport::dbg_implCheckProperty: no property with the name ") += + ::rtl::OString(_rPropertyName.getStr(), _rPropertyName.getLength(), RTL_TEXTENCODING_ASCII_US) += + ::rtl::OString("!")).getStr()); return; } diff --git a/binfilter/bf_xmloff/source/forms/xmloff_propertyimport.cxx b/binfilter/bf_xmloff/source/forms/xmloff_propertyimport.cxx index f1c2917..25b5404 100644 --- a/binfilter/bf_xmloff/source/forms/xmloff_propertyimport.cxx +++ b/binfilter/bf_xmloff/source/forms/xmloff_propertyimport.cxx @@ -74,9 +74,9 @@ namespace xmloff } else { - OSL_FAIL(::rtl::OString("OPropertyImport::CreateChildContext: unknown sub element (only \"properties\" is recognized, but it is ") - += ::rtl::OString(_rLocalName.getStr(), _rLocalName.getLength(), RTL_TEXTENCODING_ASCII_US) - += ::rtl::OString(")!")); + OSL_FAIL((::rtl::OString("OPropertyImport::CreateChildContext: unknown sub element (only \"properties\" is recognized, but it is ") + += ::rtl::OString(_rLocalName.getStr(), _rLocalName.getLength(), RTL_TEXTENCODING_ASCII_US) + += ::rtl::OString(")!")).getStr()); return SvXMLImportContext::CreateChildContext(_nPrefix, _rLocalName, _rxAttrList); } } @@ -153,9 +153,9 @@ namespace xmloff #endif _rImporter.GetMM100UnitConverter().convertBool(bValue, _rReadCharacters); OSL_ENSURE(bSuccess, - ::rtl::OString("OPropertyImport::convertString: could not convert \"") - += ::rtl::OString(_rReadCharacters.getStr(), _rReadCharacters.getLength(), RTL_TEXTENCODING_ASCII_US) - += ::rtl::OString("\" into a boolean!")); + (::rtl::OString("OPropertyImport::convertString: could not convert \"") + += ::rtl::OString(_rReadCharacters.getStr(), _rReadCharacters.getLength(), RTL_TEXTENCODING_ASCII_US) + += ::rtl::OString("\" into a boolean!")).getStr()); aReturn = ::cppu::bool2any(_bInvertBoolean ? !bValue : bValue); } break; @@ -169,9 +169,9 @@ namespace xmloff #endif _rImporter.GetMM100UnitConverter().convertNumber(nValue, _rReadCharacters); OSL_ENSURE(bSuccess, - ::rtl::OString("OPropertyImport::convertString: could not convert \"") - += ::rtl::OString(_rReadCharacters.getStr(), _rReadCharacters.getLength(), RTL_TEXTENCODING_ASCII_US) - += ::rtl::OString("\" into an integer!")); + (::rtl::OString("OPropertyImport::convertString: could not convert \"") + += ::rtl::OString(_rReadCharacters.getStr(), _rReadCharacters.getLength(), RTL_TEXTENCODING_ASCII_US) + += ::rtl::OString("\" into an integer!")).getStr()); if (TypeClass_SHORT == _rExpectedType.getTypeClass()) aReturn <<= (sal_Int16)nValue; else @@ -210,9 +210,9 @@ namespace xmloff #endif _rImporter.GetMM100UnitConverter().convertDouble(nValue, _rReadCharacters); OSL_ENSURE(bSuccess, - ::rtl::OString("OPropertyImport::convertString: could not convert \"") - += ::rtl::OString(_rReadCharacters.getStr(), _rReadCharacters.getLength(), RTL_TEXTENCODING_ASCII_US) - += ::rtl::OString("\" into a double!")); + (::rtl::OString("OPropertyImport::convertString: could not convert \"") + += ::rtl::OString(_rReadCharacters.getStr(), _rReadCharacters.getLength(), RTL_TEXTENCODING_ASCII_US) + += ::rtl::OString("\" into a double!")).getStr()); aReturn <<= (double)nValue; } break; @@ -238,9 +238,9 @@ namespace xmloff #endif _rImporter.GetMM100UnitConverter().convertDouble(nValue, _rReadCharacters); OSL_ENSURE(bSuccess, - ::rtl::OString("OPropertyImport::convertString: could not convert \"") - += ::rtl::OString(_rReadCharacters.getStr(), _rReadCharacters.getLength(), RTL_TEXTENCODING_ASCII_US) - += ::rtl::OString("\" into a double!")); + (::rtl::OString("OPropertyImport::convertString: could not convert \"") + += ::rtl::OString(_rReadCharacters.getStr(), _rReadCharacters.getLength(), RTL_TEXTENCODING_ASCII_US) + += ::rtl::OString("\" into a double!")).getStr()); // then convert it into the target type switch (nType) @@ -337,9 +337,9 @@ namespace xmloff } else { - OSL_FAIL(::rtl::OString("OPropertyElementsContext::CreateChildContext: unknown child element (\"") - += ::rtl::OString(_rLocalName.getStr(), _rLocalName.getLength(), RTL_TEXTENCODING_ASCII_US) - += ::rtl::OString("\")!")); + OSL_FAIL((::rtl::OString("OPropertyElementsContext::CreateChildContext: unknown child element (\"") + += ::rtl::OString(_rLocalName.getStr(), _rLocalName.getLength(), RTL_TEXTENCODING_ASCII_US) + += ::rtl::OString("\")!")).getStr()); return new SvXMLImportContext(GetImport(), _nPrefix, _rLocalName); } } @@ -385,9 +385,9 @@ namespace xmloff } else { - OSL_FAIL(::rtl::OString("OSinglePropertyContext::CreateChildContext: unknown child element (\"") - += ::rtl::OString(_rLocalName.getStr(), _rLocalName.getLength(), RTL_TEXTENCODING_ASCII_US) - += ::rtl::OString("\")!")); + OSL_FAIL((::rtl::OString("OSinglePropertyContext::CreateChildContext: unknown child element (\"") + += ::rtl::OString(_rLocalName.getStr(), _rLocalName.getLength(), RTL_TEXTENCODING_ASCII_US) + += ::rtl::OString("\")!")).getStr()); return new SvXMLImportContext(GetImport(), _nPrefix, _rLocalName); } } diff --git a/binfilter/bf_xmloff/source/meta/xmloff_xmlmetai.cxx b/binfilter/bf_xmloff/source/meta/xmloff_xmlmetai.cxx index 8fa6579..0a6004f 100644 --- a/binfilter/bf_xmloff/source/meta/xmloff_xmlmetai.cxx +++ b/binfilter/bf_xmloff/source/meta/xmloff_xmlmetai.cxx @@ -766,7 +766,7 @@ void SfxXMLMetaContext::EndElement() if ( sKeywords.getLength() && xInfoProp.is() ) { uno::Any aAny; - aAny <<= ::rtl::OUString(sKeywords); + aAny <<= ::rtl::OUString(sKeywords.toString()); xInfoProp->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(PROP_KEYWORDS)), aAny ); } } diff --git a/binfilter/inc/bf_sch/memchrt.hxx b/binfilter/inc/bf_sch/memchrt.hxx index 3db475f..cc98350 100644 --- a/binfilter/inc/bf_sch/memchrt.hxx +++ b/binfilter/inc/bf_sch/memchrt.hxx @@ -183,7 +183,7 @@ protected : /// contains all information necessary to write the source data ranges SchChartRange maChartRange; - ::rtl::OUStringBuffer getXMLStringForCellAddress( const SchCellAddress& rCell ); + void getXMLStringForCellAddress( const SchCellAddress& rCell, rtl::OUStringBuffer * output ); void getSingleCellAddressFromXMLString( const ::rtl::OUString& rXMLString, sal_Int32 nStartPos, sal_Int32 nEndPos, SchSingleCell& rSingleCell ); _______________________________________________ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits