diff --git a/unoidl/source/sourcetreeprovider.cxx b/unoidl/source/sourcetreeprovider.cxx index 399329f30e40..629e50fbf8f3 100644 --- a/unoidl/source/sourcetreeprovider.cxx +++ b/unoidl/source/sourcetreeprovider.cxx @@ -284,7 +284,7 @@ rtl::Reference SourceTreeProvider::findEntity(OUString const & name) throw FileFormatException( //TODO "", "Illegal UNOIDL identifier \"" + name + "\""); } - OUString uri(uri_ + buf.makeStringAndClear()); + OUString uri(uri_ + buf); rtl::Reference ent; // Prevent conflicts between foo/ and Foo.idl on case-preserving file // systems: diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx index 55cde4a360a4..220d850885cb 100644 --- a/unotools/source/i18n/localedatawrapper.cxx +++ b/unotools/source/i18n/localedatawrapper.cxx @@ -353,7 +353,7 @@ const std::vector< LanguageType >& LocaleDataWrapper::getInstalledLanguageTypes( aMsg.append(static_cast(static_cast(eLang)), 16); aMsg.append(" -> "); aMsg.append(aBackLanguageTag.getBcp47()); - outputCheckMessage( aMsg.makeStringAndClear() ); + outputCheckMessage( aMsg ); } eLang = LANGUAGE_DONTKNOW; } diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index e8db8d68f12e..71e25f4571f8 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -855,8 +855,9 @@ void RTFDocumentImpl::resolvePict(bool const bInline, uno::ReferencemakeStringAndClear(), - rState.getCurrentEncoding()); + OString aStr + = OUStringToOString(*pCurrentDestinationText, rState.getCurrentEncoding()); + pCurrentDestinationText->setLength(0); // decode hex dump OStringBuffer aBuf; int b = 0; @@ -2638,8 +2640,13 @@ RTFError RTFDocumentImpl::beforePopState(RTFParserState& rState) != m_aStates.top().getCurrentDestinationText()) break; // not for nested group if (m_xDocumentProperties.is()) - m_xDocumentProperties->setKeywords(comphelper::string::convertCommaSeparated( - m_aStates.top().getCurrentDestinationText()->makeStringAndClear())); + { + OUStringBuffer* pCurrentDestinationText + = m_aStates.top().getCurrentDestinationText(); + m_xDocumentProperties->setKeywords( + comphelper::string::convertCommaSeparated(*pCurrentDestinationText)); + pCurrentDestinationText->setLength(0); + } break; case Destination::COMMENT: if (&m_aStates.top().getDestinationText() @@ -2757,13 +2764,12 @@ RTFError RTFDocumentImpl::beforePopState(RTFParserState& rState) break; case Destination::ANNOTATIONDATE: { - if (&m_aStates.top().getDestinationText() - != m_aStates.top().getCurrentDestinationText()) + OUStringBuffer* pCurrentDestinationText = m_aStates.top().getCurrentDestinationText(); + if (&m_aStates.top().getDestinationText() != pCurrentDestinationText) break; // not for nested group - OUString aStr(OStringToOUString( - DTTM22OString( - m_aStates.top().getCurrentDestinationText()->makeStringAndClear().toInt32()), - rState.getCurrentEncoding())); + OUString aStr(OStringToOUString(DTTM22OString(o3tl::toInt32(*pCurrentDestinationText)), + rState.getCurrentEncoding())); + pCurrentDestinationText->setLength(0); auto pValue = new RTFValue(aStr); RTFSprms aAnnAttributes; aAnnAttributes.set(NS_ooxml::LN_CT_TrackChange_date, pValue); @@ -3620,9 +3626,9 @@ RTFError RTFDocumentImpl::popState() RTFError RTFDocumentImpl::handleEmbeddedObject() { - OString aStr - = OUStringToOString(m_aStates.top().getCurrentDestinationText()->makeStringAndClear(), - RTL_TEXTENCODING_ASCII_US); + OUStringBuffer* pCurrentDestinationText = m_aStates.top().getCurrentDestinationText(); + OString aStr = OUStringToOString(*pCurrentDestinationText, RTL_TEXTENCODING_ASCII_US); + pCurrentDestinationText->setLength(0); std::unique_ptr pStream(new SvMemoryStream()); if (!msfilter::rtfutil::ExtractOLE2FromObjdata(aStr, *pStream)) return RTFError::HEX_INVALID; diff --git a/writerfilter/source/rtftok/rtftokenizer.cxx b/writerfilter/source/rtftok/rtftokenizer.cxx index 4dc80416c64f..420c6d36f0c3 100644 --- a/writerfilter/source/rtftok/rtftokenizer.cxx +++ b/writerfilter/source/rtftok/rtftokenizer.cxx @@ -8,6 +8,7 @@ */ #include "rtftokenizer.hxx" +#include #include #include #include @@ -237,7 +238,7 @@ RTFError RTFTokenizer::resolveKeyword() break; } } - nParam = aParameter.makeStringAndClear().toInt32(); + nParam = o3tl::toInt32(aParameter); if (bNeg) nParam = -nParam; }