summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-03-24 19:12:58 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-03-25 07:27:34 +0000
commit3a0c5b782001fc398740b46f2adc9e07055505d6 (patch)
tree508da0c4db6b64d4e920d58a01b37995649a6b52 /framework
parentf2b027d5cdaf0e88d1fe47c4d89ef57c03b1f9b8 (diff)
loplugin:stringadd in editeng..framework
after my patch to merge the bufferadd loplugin into stringadd Change-Id: Ieac16a01fde6467a2f6fe47864069304a3c44e47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149552 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/fwe/helper/titlehelper.cxx3
-rw-r--r--framework/source/fwi/classes/converter.cxx11
-rw-r--r--framework/source/recording/dispatchrecorder.cxx36
-rw-r--r--framework/source/services/urltransformer.cxx7
-rw-r--r--framework/source/uielement/headermenucontroller.cxx11
-rw-r--r--framework/source/uielement/langselectionstatusbarcontroller.cxx3
-rw-r--r--framework/source/uielement/recentfilesmenucontroller.cxx3
7 files changed, 33 insertions, 41 deletions
diff --git a/framework/source/fwe/helper/titlehelper.cxx b/framework/source/fwe/helper/titlehelper.cxx
index 31981d403b4f..e0983d9e5549 100644
--- a/framework/source/fwe/helper/titlehelper.cxx
+++ b/framework/source/fwe/helper/titlehelper.cxx
@@ -434,8 +434,7 @@ void TitleHelper::impl_updateTitleForController (const css::uno::Reference< css:
sTitle.append (xModelTitle->getTitle ());
if ( nLeasedNumber > 1 )
{
- sTitle.append(" : ");
- sTitle.append(nLeasedNumber);
+ sTitle.append(" : " + OUString::number(nLeasedNumber));
}
if (xModel.is ())
{
diff --git a/framework/source/fwi/classes/converter.cxx b/framework/source/fwi/classes/converter.cxx
index a29c5b1271c9..59ae35d396b5 100644
--- a/framework/source/fwi/classes/converter.cxx
+++ b/framework/source/fwi/classes/converter.cxx
@@ -76,36 +76,37 @@ OUString Converter::convert_DateTime2ISO8601( const DateTime& aSource )
sBuffer.append("0");
sBuffer.append( nYear );
- sBuffer.append("-");
// write month formatted as "MM"
+ sBuffer.append("-");
if (nMonth<10)
sBuffer.append("0");
sBuffer.append( nMonth );
- sBuffer.append("-");
// write day formatted as "DD"
+ sBuffer.append("-");
if (nDay<10)
sBuffer.append("0");
sBuffer.append( nDay );
- sBuffer.append("T");
// write hours formatted as "hh"
+ sBuffer.append("T");
if (nHour<10)
sBuffer.append("0");
sBuffer.append( nHour );
- sBuffer.append(":");
// write min formatted as "mm"
+ sBuffer.append(":");
if (nMin<10)
sBuffer.append("0");
sBuffer.append( nMin );
- sBuffer.append(":");
// write sec formatted as "ss"
+ sBuffer.append(":");
if (nSec<10)
sBuffer.append("0");
sBuffer.append( nSec );
+ // write time-zone
sBuffer.append("Z");
return sBuffer.makeStringAndClear();
diff --git a/framework/source/recording/dispatchrecorder.cxx b/framework/source/recording/dispatchrecorder.cxx
index fe81814955f7..9c4a1bc90a81 100644
--- a/framework/source/recording/dispatchrecorder.cxx
+++ b/framework/source/recording/dispatchrecorder.cxx
@@ -145,14 +145,15 @@ OUString SAL_CALL DispatchRecorder::getRecordedMacro()
aScriptBuffer.ensureCapacity(10000);
m_nRecordingID = 1;
- aScriptBuffer.append("rem ----------------------------------------------------------------------\n");
- aScriptBuffer.append("rem define variables\n");
- aScriptBuffer.append("dim document as object\n");
- aScriptBuffer.append("dim dispatcher as object\n");
- aScriptBuffer.append("rem ----------------------------------------------------------------------\n");
- aScriptBuffer.append("rem get access to the document\n");
- aScriptBuffer.append("document = ThisComponent.CurrentController.Frame\n");
- aScriptBuffer.append("dispatcher = createUnoService(\"com.sun.star.frame.DispatchHelper\")\n\n");
+ aScriptBuffer.append(
+ "rem ----------------------------------------------------------------------\n"
+ "rem define variables\n"
+ "dim document as object\n"
+ "dim dispatcher as object\n"
+ "rem ----------------------------------------------------------------------\n"
+ "rem get access to the document\n"
+ "document = ThisComponent.CurrentController.Frame\n"
+ "dispatcher = createUnoService(\"com.sun.star.frame.DispatchHelper\")\n\n");
for (auto const& statement : m_aStatements)
implts_recordMacro( statement.aCommand, statement.aArgs, statement.bIsComment, aScriptBuffer );
@@ -320,22 +321,17 @@ void DispatchRecorder::implts_recordMacro( std::u16string_view aURL,
// add arg().Name
if(bAsComment)
aArgumentBuffer.append(REM_AS_COMMENT);
- aArgumentBuffer.append (sArrayName);
- aArgumentBuffer.append("(");
- aArgumentBuffer.append (nValidArgs);
- aArgumentBuffer.append(").Name = \"");
- aArgumentBuffer.append (lArguments[i].Name);
- aArgumentBuffer.append("\"\n");
+ aArgumentBuffer.append(sArrayName
+ + "(" + OUString::number(nValidArgs)
+ + ").Name = \"" + lArguments[i].Name
+ + "\"\n");
// add arg().Value
if(bAsComment)
aArgumentBuffer.append(REM_AS_COMMENT);
- aArgumentBuffer.append (sArrayName);
- aArgumentBuffer.append("(");
- aArgumentBuffer.append (nValidArgs);
- aArgumentBuffer.append(").Value = ");
- aArgumentBuffer.append (sValBuffer);
- aArgumentBuffer.append("\n");
+ aArgumentBuffer.append(sArrayName
+ + "(" + OUString::number(nValidArgs)
+ + ").Value = " + sValBuffer + "\n");
++nValidArgs;
}
diff --git a/framework/source/services/urltransformer.cxx b/framework/source/services/urltransformer.cxx
index 239aed6dbfa0..b2ec62c5a434 100644
--- a/framework/source/services/urltransformer.cxx
+++ b/framework/source/services/urltransformer.cxx
@@ -76,8 +76,8 @@ void lcl_ParserHelper(INetURLObject& _rParser, css::util::URL& _rURL,bool _bUseI
OUStringBuffer aPath(128);
for ( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
{
- aPath.append( '/');
- aPath.append( _rParser.getName( nIndex, false, INetURLObject::DecodeMechanism::NONE ));
+ aPath.append( "/"
+ + _rParser.getName( nIndex, false, INetURLObject::DecodeMechanism::NONE ));
}
if ( nCount > 0 )
@@ -227,8 +227,7 @@ sal_Bool SAL_CALL URLTransformer::assemble( css::util::URL& aURL )
aCompletePath.append( aURL.Name );
else
{
- aCompletePath.append( '/' );
- aCompletePath.append( aURL.Name );
+ aCompletePath.append( "/" + aURL.Name );
}
}
diff --git a/framework/source/uielement/headermenucontroller.cxx b/framework/source/uielement/headermenucontroller.cxx
index f8c76fb8d8c1..7fc2259ef553 100644
--- a/framework/source/uielement/headermenucontroller.cxx
+++ b/framework/source/uielement/headermenucontroller.cxx
@@ -127,10 +127,10 @@ void HeaderMenuController::fillPopupMenu( const Reference< css::frame::XModel >&
xPropSet->getPropertyValue( aDisplayNameStr ) >>= aDisplayName;
xPropSet->getPropertyValue( aHeaderFooterIsOnStr ) >>= bHeaderIsOn;
- OUStringBuffer aStrBuf( aCmd );
- aStrBuf.append( "?PageStyle:string=");
- aStrBuf.append( aDisplayName );
- aStrBuf.append( "&On:bool=" );
+ OUStringBuffer aStrBuf( aCmd
+ + "?PageStyle:string="
+ + aDisplayName
+ + "&On:bool=" );
if ( !bHeaderIsOn )
aStrBuf.append( "true" );
else
@@ -161,8 +161,7 @@ void HeaderMenuController::fillPopupMenu( const Reference< css::frame::XModel >&
// Insert special item for all command
rPopupMenu->insertItem(ALL_MENUITEM_ID, FwkResId(STR_MENU_HEADFOOTALL), 0, 0);
- OUStringBuffer aStrBuf( aCmd );
- aStrBuf.append( "?On:bool=" );
+ OUStringBuffer aStrBuf( aCmd + "?On:bool=" );
// Command depends on check state of first menu item entry
if ( !bFirstChecked )
diff --git a/framework/source/uielement/langselectionstatusbarcontroller.cxx b/framework/source/uielement/langselectionstatusbarcontroller.cxx
index b0f71f3e3f33..e620af612092 100644
--- a/framework/source/uielement/langselectionstatusbarcontroller.cxx
+++ b/framework/source/uielement/langselectionstatusbarcontroller.cxx
@@ -251,8 +251,7 @@ void LangSelectionStatusbarController::LangMenu(
}
else if (MID_LANG_PARA_1 <= nId && nId <= MID_LANG_PARA_9)
{
- aBuff.append( ".uno:LanguageStatus?Language:string=Paragraph_" );
- aBuff.append( aSelectedLang );
+ aBuff.append( ".uno:LanguageStatus?Language:string=Paragraph_" + aSelectedLang );
}
else if (nId == MID_LANG_PARA_NONE)
{
diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx
index 644fd2215780..194f66d1476f 100644
--- a/framework/source/uielement/recentfilesmenucontroller.cxx
+++ b/framework/source/uielement/recentfilesmenucontroller.cxx
@@ -228,8 +228,7 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >
}
else
{
- aMenuShortCut.append( sal_Int32( i + 1 ) );
- aMenuShortCut.append( ". " );
+ aMenuShortCut.append( OUString::number(sal_Int32( i + 1 ) ) + ". " );
}
OUString aURLString = "vnd.sun.star.popup:RecentFileList?entry=" + OUString::number(i);