summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-03-17 19:06:45 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-03-18 07:20:51 +0000
commit4b9acb48b1ea45c82dbd8df3faa35cabd3bb9b4d (patch)
tree963dde5c91fc5030365b8dcf035bac57e26436f3 /sfx2
parent6f54b54ec3dc51fb8824adb08620fde4c70d10f2 (diff)
loplugin:stringadd use more O[U]StringChar
Change-Id: I196e4539ad430a39415eff9d7170b33df7228230 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149062 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/newhelp.cxx18
-rw-r--r--sfx2/source/bastyp/frmhtmlw.cxx12
-rw-r--r--sfx2/source/control/bindings.cxx8
-rw-r--r--sfx2/source/view/lokhelper.cxx2
4 files changed, 14 insertions, 26 deletions
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 98b20b05d2f0..fe84c8f44a17 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -600,7 +600,6 @@ void IndexTabPage_Impl::InitializeIndex()
{
int ndx,tmp;
OUString aIndex, aTempString;
- OUStringBuffer aData( 128 ); // Capacity of up to 128 characters
sfx2::KeywordInfo::iterator it;
for ( int i = 0; i < aKeywordList.getLength(); ++i )
@@ -646,8 +645,7 @@ void IndexTabPage_Impl::InitializeIndex()
{
if ( aAnchorList[0].getLength() > 0 )
{
- aData.append( aRefList[0] ).append( '#' ).append( aAnchorList[0] );
- sId = weld::toId(new IndexEntry_Impl(aData.makeStringAndClear(), insert));
+ sId = weld::toId(new IndexEntry_Impl(aRefList[0] + "#" + aAnchorList[0], insert));
}
else
sId = weld::toId(new IndexEntry_Impl(aRefList[0], insert));
@@ -662,20 +660,10 @@ void IndexTabPage_Impl::InitializeIndex()
for ( sal_uInt32 j = 1; j < nRefListLen ; ++j )
{
- aData
- .append( aKeywordPair )
- .append( ' ' )
- .append( '-' )
- .append( ' ' )
- .append( aTitleList[j] );
-
- aTempString = aData.makeStringAndClear();
+ aTempString = aKeywordPair + " - " + aTitleList[j];
if ( aAnchorList[j].getLength() > 0 )
- {
- aData.append( aRefList[j] ).append( '#' ).append( aAnchorList[j] );
- sId = weld::toId(new IndexEntry_Impl(aData.makeStringAndClear(), insert));
- }
+ sId = weld::toId(new IndexEntry_Impl(aRefList[j] + "#" + aAnchorList[j], insert));
else
sId = weld::toId(new IndexEntry_Impl(aRefList[j], insert));
diff --git a/sfx2/source/bastyp/frmhtmlw.cxx b/sfx2/source/bastyp/frmhtmlw.cxx
index 9b539ec82fc8..5c8f4b5351f3 100644
--- a/sfx2/source/bastyp/frmhtmlw.cxx
+++ b/sfx2/source/bastyp/frmhtmlw.cxx
@@ -253,14 +253,14 @@ void SfxFrameHTMLWriter::Out_FrameDescriptor(
aAny = xSet->getPropertyValue("FrameMarginWidth");
if ( (aAny >>= nVal) && nVal != SIZE_NOT_SET )
{
- sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_marginwidth)
- .append('=').append(nVal);
+ sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_marginwidth
+ "=" + OString::number(nVal));
}
aAny = xSet->getPropertyValue("FrameMarginHeight");
if ( (aAny >>= nVal) && nVal != SIZE_NOT_SET )
{
- sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_marginheight)
- .append('=').append(nVal);
+ sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_marginheight
+ "=" + OString::number(nVal));
}
bool bVal = true;
@@ -284,8 +284,8 @@ void SfxFrameHTMLWriter::Out_FrameDescriptor(
if ( aAny >>= bVal )
{
const char* pStr = bVal ? sHTML_SC_yes : sHTML_SC_no;
- sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_frameborder)
- .append('=').append(pStr);
+ sOut.append(OString::Concat(" " OOO_STRING_SVTOOLS_HTML_O_frameborder
+ "=") + pStr);
}
}
rOut.WriteOString( sOut );
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index 51d6b36d237f..5eb19de835ca 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -1310,13 +1310,13 @@ bool SfxBindings::NextJob_Impl(Timer const * pTimer)
}
-sal_uInt16 SfxBindings::EnterRegistrations(const char *pFile, int nLine)
+sal_uInt16 SfxBindings::EnterRegistrations(std::string_view pFile, int nLine)
{
SAL_INFO(
"sfx.control",
std::setw(std::min(nRegLevel, sal_uInt16(8))) << ' ' << "this = " << this
<< " Level = " << nRegLevel << " SfxBindings::EnterRegistrations "
- << (pFile
+ << (!pFile.empty()
? SAL_STREAM("File: " << pFile << " Line: " << nLine) : ""));
// When bindings are locked, also lock sub bindings.
@@ -1351,7 +1351,7 @@ sal_uInt16 SfxBindings::EnterRegistrations(const char *pFile, int nLine)
}
-void SfxBindings::LeaveRegistrations( const char *pFile, int nLine )
+void SfxBindings::LeaveRegistrations( std::string_view pFile, int nLine )
{
DBG_ASSERT( nRegLevel, "Leave without Enter" );
@@ -1412,7 +1412,7 @@ void SfxBindings::LeaveRegistrations( const char *pFile, int nLine )
"sfx.control",
std::setw(std::min(nRegLevel, sal_uInt16(8))) << ' ' << "this = " << this
<< " Level = " << nRegLevel << " SfxBindings::LeaveRegistrations "
- << (pFile
+ << (!pFile.empty()
? SAL_STREAM("File: " << pFile << " Line: " << nLine) : ""));
}
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 70d18b54edae..6cf26ca47433 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -581,7 +581,7 @@ void SfxLokHelper::notifyWindow(const SfxViewShell* pThisView,
if (!rItem.first.isEmpty() && !rItem.second.isEmpty())
{
aPayload.append(", \"" + rItem.first + "\": \"" +
- rItem.second).append('"');
+ rItem.second + "\"");
}
}
aPayload.append('}');