diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-16 10:13:30 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-16 12:12:31 +0200 |
commit | 4a96fb8ec0130e1036913093836bcf28bc37a49b (patch) | |
tree | e7aad9be4ca417e9e64f688cc99bee0638037741 /sfx2 | |
parent | f33b6e341fb7dd1ab3acd4fe5457b716be316e89 (diff) |
loplugin:bufferadd loosen some constraints
and extend O*StringView to have a constructor that takes a pointer and a
length
Change-Id: I6120e96280f030757e855a6596efdae438b7e1e8
Reviewed-on: https://gerrit.libreoffice.org/80872
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appuno.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/bastyp/frmhtmlw.cxx | 7 | ||||
-rw-r--r-- | sfx2/source/dialog/filedlghelper.cxx | 18 | ||||
-rw-r--r-- | sfx2/source/view/classificationhelper.cxx | 3 |
4 files changed, 15 insertions, 19 deletions
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index d5e315147957..e947abd17d61 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -257,8 +257,7 @@ void TransformParameters( sal_uInt16 nSlotId, const uno::Sequence<beans::Propert for ( nSub=0; nSub<nSubCount; nSub++ ) { // search sub item by name - OStringBuffer aStr; - aStr.append(pSlot->pUnoName).append('.').append(pType->aAttrib[nSub].pName); + OString aStr = rtl::OStringView(pSlot->pUnoName) + "." + pType->aAttrib[nSub].pName; if ( rPropValue.Name.equalsAsciiL(aStr.getStr(), aStr.getLength()) ) { sal_uInt8 nSubId = static_cast<sal_uInt8>(static_cast<sal_Int8>(pType->aAttrib[nSub].nAID)); @@ -364,8 +363,7 @@ void TransformParameters( sal_uInt16 nSlotId, const uno::Sequence<beans::Propert for ( sal_uInt16 nSub=0; nSub<nSubCount; nSub++ ) { // search sub item by name - OStringBuffer aStr; - aStr.append(rArg.pName).append('.').append(pType->aAttrib[nSub].pName); + OString aStr = rtl::OStringView(rArg.pName) + "." + pType->aAttrib[nSub].pName; if ( rProp.Name.equalsAsciiL(aStr.getStr(), aStr.getLength()) ) { // at least one member found ... diff --git a/sfx2/source/bastyp/frmhtmlw.cxx b/sfx2/source/bastyp/frmhtmlw.cxx index b36539f3a8c3..09dcd0cfe85c 100644 --- a/sfx2/source/bastyp/frmhtmlw.cxx +++ b/sfx2/source/bastyp/frmhtmlw.cxx @@ -120,10 +120,9 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const OUString& rBaseURL, if( pIndent ) rStrm.WriteCharPtr( pIndent ); - OStringBuffer sOut; - sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_base).append(' ') - .append(OOO_STRING_SVTOOLS_HTML_O_target).append("=\""); - rStrm.WriteOString( sOut.makeStringAndClear() ); + OString sOut = "<" OOO_STRING_SVTOOLS_HTML_base " " + OOO_STRING_SVTOOLS_HTML_O_target "=\""; + rStrm.WriteOString( sOut ); HTMLOutFuncs::Out_String( rStrm, rTarget, eDestEnc, pNonConvertableChars ) .WriteCharPtr( "\">" ); } diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 958ff03dc230..ea3d7a821cec 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -1780,19 +1780,19 @@ void FileDialogHelper_Impl::addFilters( const OUString& rFactory, m_nDontFlags |= nDont; // create the list of filters - OUStringBuffer sQuery(256); - sQuery.append("getSortedFilterList()"); - sQuery.append(":module="); - sQuery.append(rFactory); // use long name here ! - sQuery.append(":iflags="); - sQuery.append(OUString::number(static_cast<sal_Int32>(m_nMustFlags))); - sQuery.append(":eflags="); - sQuery.append(OUString::number(static_cast<sal_Int32>(m_nDontFlags))); + OUString sQuery = + "getSortedFilterList()" + ":module=" + + rFactory + // use long name here ! + ":iflags=" + + OUString::number(static_cast<sal_Int32>(m_nMustFlags)) + + ":eflags=" + + OUString::number(static_cast<sal_Int32>(m_nDontFlags)); uno::Reference< XEnumeration > xResult; try { - xResult = xFilterCont->createSubSetEnumerationByQuery(sQuery.makeStringAndClear()); + xResult = xFilterCont->createSubSetEnumerationByQuery(sQuery); } catch( const uno::Exception& ) { diff --git a/sfx2/source/view/classificationhelper.cxx b/sfx2/source/view/classificationhelper.cxx index 23e737900614..57c6a50df38f 100644 --- a/sfx2/source/view/classificationhelper.cxx +++ b/sfx2/source/view/classificationhelper.cxx @@ -441,8 +441,7 @@ void SfxClassificationHelper::Impl::setStartValidity(SfxClassificationPolicyType { // The policy left the start date unchanged, replace it with the system time. util::DateTime aDateTime = DateTime(DateTime::SYSTEM).GetUNODateTime(); - OUStringBuffer aBuffer = utl::toISO8601(aDateTime); - it->second = aBuffer.toString(); + it->second = utl::toISO8601(aDateTime); } } } |