merge some stringadds

found with a lightly tweaked version of the loplugin:stringadd
and some hand-holding.

Change-Id: I146aadcaf665e98fea89a9cad2df4dc3935622f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152275
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2023-05-25 14:24:11 +02:00
parent 578758835e
commit e810bd2b99
38 changed files with 161 additions and 213 deletions

View file

@ -1788,10 +1788,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
sal_Int32 index = 0;
do
{
OUStringBuffer aTempTargetName( aTempTargetNameBase );
aTempTargetName.append( index++ );
sTargetLibrariesStoreName = aTempTargetName.makeStringAndClear();
sTargetLibrariesStoreName = aTempTargetNameBase + OUString::number( index++ );
if ( !i_rStorage->hasByName( sTargetLibrariesStoreName ) )
{
break;

View file

@ -448,8 +448,8 @@ OUString ObjectIdentifier::createClassifiedIdentifierForParticles(
if( eObjectType == OBJECTTYPE_UNKNOWN )
eObjectType = ObjectIdentifier::getObjectType( rParentParticle );
OUStringBuffer aRet( m_aProtocol );
aRet.append( lcl_createClassificationStringForType( eObjectType, rDragMethodServiceName, rDragParameterString ));
OUStringBuffer aRet( m_aProtocol +
lcl_createClassificationStringForType( eObjectType, rDragMethodServiceName, rDragParameterString ));
if(aRet.getLength() > m_aProtocol.getLength())
aRet.append("/");
@ -577,8 +577,8 @@ OUString ObjectIdentifier::createClassifiedIdentifierWithParent(
{
//e.g. "MultiClick/Series=2:Point=34"
OUStringBuffer aRet( m_aProtocol );
aRet.append( lcl_createClassificationStringForType( eObjectType, rDragMethodServiceName, rDragParameterString ));
OUStringBuffer aRet( m_aProtocol +
lcl_createClassificationStringForType( eObjectType, rDragMethodServiceName, rDragParameterString ));
if(aRet.getLength() > m_aProtocol.getLength())
aRet.append("/");
aRet.append(rParentPartical);

View file

@ -174,8 +174,8 @@ OUString PotentialRegressionCurveCalculator::ImplGetRepresentation(
}
if( m_fSlope != 0.0 ) // add slope value
{
aTmpBuf.append( mXName + "^" );
aTmpBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fSlope, pValueLength ));
aTmpBuf.append( mXName + "^" +
getFormattedString( xNumFormatter, nNumberFormatKey, m_fSlope, pValueLength ));
}
addStringToEquation( aBuf, nLineLength, aTmpBuf, pFormulaMaxWidth );
}

View file

@ -144,9 +144,7 @@ COMPHELPER_DLLPUBLIC OUString ErrCode::toString() const
pClass = u"Compiler";
break;
}
buf.append(OUString::Concat(" Class:") + pClass);
buf.append(" Code:" + OUString::number(GetCode()));
buf.append(OUString::Concat(" Class:") + pClass + " Code:" + OUString::number(GetCode()));
}
buf.append(")");
return buf.makeStringAndClear();

View file

@ -220,8 +220,7 @@ rtl::Reference< Node > Data::resolvePathRepresentation(
return p;
}
if (canonicRepresentation != nullptr) {
canonic.append('/');
canonic.append(createSegment(templateName, seg));
canonic.append("/" + createSegment(templateName, seg));
}
if (path != nullptr) {
path->push_back(seg);

View file

@ -387,8 +387,7 @@ void ODbaseIndex::createINFEntry()
bool bCase = isCaseSensitive();
while (aNewEntry.isEmpty())
{
aNewEntry = OString("NDX");
aNewEntry += OString::number(++nSuffix);
aNewEntry = "NDX" + OString::number(++nSuffix);
for (sal_uInt16 i = 0; i < aInfFile.GetKeyCount(); i++)
{
aKeyName = aInfFile.GetKeyName(i);

View file

@ -701,8 +701,7 @@ namespace accessibility
// paragraphs inbetween are fully included
for( ; i<aEndIndex.nPara; ++i )
{
aRes.append(cNewLine);
aRes.append(mpImpl->GetParagraph(i).getText());
aRes.append(OUStringChar(cNewLine) + mpImpl->GetParagraph(i).getText());
}
if( i<=aEndIndex.nPara )

View file

@ -95,8 +95,8 @@ namespace abp
INetURLObject aURL( rSettings.sDataSourceName );
if( aURL.GetProtocol() == INetProtocol::NotValid )
{
OUString sPath = SvtPathOptions().GetWorkPath();
sPath += "/" + rSettings.sDataSourceName;
OUString sPath = SvtPathOptions().GetWorkPath() +
"/" + rSettings.sDataSourceName;
std::shared_ptr<const SfxFilter> pFilter = lcl_getBaseFilter();
if ( pFilter )

View file

@ -1033,8 +1033,8 @@ void SaneDlg::EstablishQuantumRange()
mxQuantumRangeBox->set_active_text( OUString( pBuf, strlen(pBuf), osl_getThreadTextEncoding() ) );
}
mxQuantumRangeBox->show();
OUString aText( mrSane.GetOptionName( mnCurrentOption ) + " " );
aText += mrSane.GetOptionUnitName( mnCurrentOption );
OUString aText = mrSane.GetOptionName( mnCurrentOption ) + " "
+ mrSane.GetOptionUnitName( mnCurrentOption );
mxOptionDescTxt->set_label(aText);
mxOptionDescTxt->show();
}
@ -1050,8 +1050,8 @@ void SaneDlg::EstablishNumericOption()
return;
char pBuf[256];
OUString aText( mrSane.GetOptionName( mnCurrentOption ) + " " );
aText += mrSane.GetOptionUnitName( mnCurrentOption );
OUString aText = mrSane.GetOptionName( mnCurrentOption ) + " "
+ mrSane.GetOptionUnitName( mnCurrentOption );
if( mfMin != mfMax )
{
o3tl::sprintf( pBuf, " < %g ; %g >", mfMin, mfMax );

View file

@ -409,10 +409,11 @@ namespace
nDec = 3;
}
OUString aSizeStr( ::rtl::math::doubleToUString( fSize,
OUString aSizeStr =
::rtl::math::doubleToUString( fSize,
rtl_math_StringFormat_F, nDec,
SvtSysLocale().GetLocaleData().getNumDecimalSep()[0]) );
aSizeStr += aUnitStr;
SvtSysLocale().GetLocaleData().getNumDecimalSep()[0]) +
aUnitStr;
return aSizeStr;
}

View file

@ -923,12 +923,7 @@ void AddonsOptions_Impl::ReadImages( ImageManager& aImageManager )
OUString AddonsOptions_Impl::GeneratePrefixURL()
{
// Create a unique prefixed Add-On popup menu URL so it can be identified later as a runtime popup menu.
OUString aPopupMenuURL;
OUStringBuffer aBuf( m_aRootAddonPopupMenuURLPrexfix.getLength() + 3 );
aBuf.append( m_aRootAddonPopupMenuURLPrexfix );
aBuf.append( ++m_nRootAddonPopupMenuId );
aPopupMenuURL = aBuf.makeStringAndClear();
return aPopupMenuURL;
return m_aRootAddonPopupMenuURLPrexfix + OUString::number( ++m_nRootAddonPopupMenuId );
}
void AddonsOptions_Impl::ReadMenuMergeInstructions( MergeMenuInstructionContainer& aContainer )

View file

@ -253,11 +253,8 @@ std::unique_ptr<ScMemChart> ScChartArray::CreateMemChartSingle()
}
if (aString.isEmpty())
{
OUStringBuffer aBuf;
aBuf.append(ScResId(STR_ROW));
aBuf.append(' ');
aBuf.append(static_cast<sal_Int32>(aRows[nRow]+1));
aString = aBuf.makeStringAndClear();
aString = ScResId(STR_ROW) + " " +
OUString::number(static_cast<sal_Int32>(aRows[nRow]+1));
}
pMemChart->SetRowText( nRow, aString);
}

View file

@ -260,14 +260,9 @@ ScDBData::~ScDBData()
OUString ScDBData::GetSourceString() const
{
OUStringBuffer aBuf;
if (mpImportParam->bImport)
{
aBuf.append(mpImportParam->aDBName);
aBuf.append('/');
aBuf.append(mpImportParam->aStatement);
}
return aBuf.makeStringAndClear();
return mpImportParam->aDBName + "/" + mpImportParam->aStatement;
return OUString();
}
OUString ScDBData::GetOperations() const

View file

@ -112,16 +112,16 @@ void ScHTMLExport::FillGraphList( const SdrPage* pPage, SCTAB nTab,
void ScHTMLExport::WriteGraphEntry( ScHTMLGraphEntry* pE )
{
SdrObject* pObject = pE->pObject;
OStringBuffer aBuf;
aBuf.append(" " OOO_STRING_SVTOOLS_HTML_O_width "="
+ OString::number(static_cast<sal_Int32>(pE->aSize.Width())));
aBuf.append(" " OOO_STRING_SVTOOLS_HTML_O_height "="
+ OString::number(static_cast<sal_Int32>(pE->aSize.Height())));
OStringBuffer aBuf =
" " OOO_STRING_SVTOOLS_HTML_O_width "="
+ OString::number(static_cast<sal_Int32>(pE->aSize.Width()))
+ " " OOO_STRING_SVTOOLS_HTML_O_height "="
+ OString::number(static_cast<sal_Int32>(pE->aSize.Height()));
if ( pE->bInCell )
{
aBuf.append(" " OOO_STRING_SVTOOLS_HTML_O_hspace "="
+ OString::number(static_cast<sal_Int32>(pE->aSpace.Width())));
aBuf.append(" " OOO_STRING_SVTOOLS_HTML_O_vspace "="
+ OString::number(static_cast<sal_Int32>(pE->aSpace.Width()))
+ " " OOO_STRING_SVTOOLS_HTML_O_vspace "="
+ OString::number(static_cast<sal_Int32>(pE->aSpace.Height())));
}
OString aOpt = aBuf.makeStringAndClear();

View file

@ -208,10 +208,10 @@ void ScSolverOptionsDialog::FillListBox()
if (aValue >>= fDoubleValue)
m_aOptions.back()->SetDoubleValue(fDoubleValue);
OUString sTxt = aVisName + ": ";
sTxt += rtl::math::doubleToUString(fDoubleValue,
rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
ScGlobal::getLocaleData().getNumDecimalSep()[0], true );
OUString sTxt = aVisName + ": " +
rtl::math::doubleToUString(fDoubleValue,
rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
ScGlobal::getLocaleData().getNumDecimalSep()[0], true );
m_xLbSettings->set_text(nPos, sTxt, 0);
}
@ -264,10 +264,10 @@ void ScSolverOptionsDialog::EditOption()
{
pStringItem->SetDoubleValue(m_xValDialog->GetValue());
OUString sTxt(pStringItem->GetText() + ": ");
sTxt += rtl::math::doubleToUString(pStringItem->GetDoubleValue(),
rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
ScGlobal::getLocaleData().getNumDecimalSep()[0], true );
OUString sTxt(pStringItem->GetText() + ": " +
rtl::math::doubleToUString(pStringItem->GetDoubleValue(),
rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
ScGlobal::getLocaleData().getNumDecimalSep()[0], true ));
m_xLbSettings->set_text(nEntry, sTxt, 0);
}

View file

@ -1412,10 +1412,8 @@ OUString HtmlExport::ParagraphToHTMLString( SdrOutliner const * pOutliner, sal_I
SfxItemSet aSet( rEditEngine.GetAttribs( aSelection ) );
OUString aPortion(StringToHTMLString(rEditEngine.GetText( aSelection )));
aStr.append(TextAttribToHTMLString( &aSet, &aState, rBackgroundColor ));
aStr.append(aPortion);
aStr.append(TextAttribToHTMLString( &aSet, &aState, rBackgroundColor ) +
StringToHTMLString(rEditEngine.GetText( aSelection )));
nPos1 = nPos2;
}
@ -1569,9 +1567,9 @@ bool HtmlExport::CreateHtmlForPresPages()
}
// HTML Head
OUStringBuffer aStr(gaHTMLHeader);
aStr.append(CreateMetaCharset());
aStr.append(" <title>" + StringToHTMLString(maPageNames[nSdPage]) + "</title>\r\n");
OUStringBuffer aStr(gaHTMLHeader +
CreateMetaCharset() +
" <title>" + StringToHTMLString(maPageNames[nSdPage]) + "</title>\r\n");
// insert timing information
pPage = maPages[ nSdPage ];
@ -2612,8 +2610,7 @@ OUString HtmlExport::CreateNavBar( sal_uInt16 nSdPage, bool bIsText ) const
// to Index page
if (mbContentsPage)
{
aStr.append(CreateLink(maIndex, aStrNavContent));
aStr.append(' ');
aStr.append(CreateLink(maIndex, aStrNavContent) + " ");
}
// Text/Graphics

View file

@ -510,11 +510,11 @@ OUString SfxHelp::CreateHelpURL_Impl( const OUString& aCommandURL, const OUStrin
aHelpURL.append("/start");
else
{
aHelpURL.append('/');
aHelpURL.append(rtl::Uri::encode(aCommandURL,
rtl_UriCharClassRelSegment,
rtl_UriEncodeKeepEscapes,
RTL_TEXTENCODING_UTF8));
aHelpURL.append("/" +
rtl::Uri::encode(aCommandURL,
rtl_UriCharClassRelSegment,
rtl_UriEncodeKeepEscapes,
RTL_TEXTENCODING_UTF8));
OUStringBuffer aTempURL = aHelpURL;
AppendConfigToken( aTempURL, true );

View file

@ -393,10 +393,10 @@ static OUString getDisplayFileSize(const OUString& rURL)
nDec = 3;
}
OUString aSizeStr(
::rtl::math::doubleToUString(fSize, rtl_math_StringFormat_F, nDec,
SvtSysLocale().GetLocaleData().getNumDecimalSep()[0]));
aSizeStr += aUnitStr;
OUString aSizeStr
= ::rtl::math::doubleToUString(fSize, rtl_math_StringFormat_F, nDec,
SvtSysLocale().GetLocaleData().getNumDecimalSep()[0])
+ aUnitStr;
return aSizeStr;
}

View file

@ -654,8 +654,8 @@ public:
{
int nLength = mxIdlArray->getLen(maAny);
OUString aType = getAnyType(maAny).replaceAll(u"[]", u"");
aType += u"[" + OUString::number(nLength) + u"]";
OUString aType
= getAnyType(maAny).replaceAll(u"[]", u"") + u"[" + OUString::number(nLength) + u"]";
OUString aValue
= SfxResId(STR_PROPERTY_VALUE_SEQUENCE).replaceFirst("%1", OUString::number(nLength));

View file

@ -1341,8 +1341,7 @@ void StyleList::DeleteHdl()
weld::TreeView* pTreeView = m_xTreeBox->get_visible() ? m_xTreeBox.get() : m_xFmtLb.get();
const SfxStyleFamilyItem* pItem = GetFamilyItem();
OUStringBuffer aMsg;
aMsg.append(SfxResId(STR_DELETE_STYLE_USED) + SfxResId(STR_DELETE_STYLE));
OUStringBuffer aMsg(SfxResId(STR_DELETE_STYLE_USED) + SfxResId(STR_DELETE_STYLE));
pTreeView->selected_foreach(
[this, pTreeView, pItem, &aList, &bUsedStyle, &aMsg](weld::TreeIter& rEntry) {

View file

@ -517,9 +517,9 @@ void prepareUserKeys(const Reference < XSimpleRegistry >& xDest,
hasSubKeys = true;
OUString linkTarget = xKey->getLinkTarget(relativKey);
OUString linkName(xKey->getKeyName().copy(xUnoKey->getKeyName().getLength()));
linkName += "/" + relativKey;
OUString linkName(
OUString::Concat(xKey->getKeyName().subView(xUnoKey->getKeyName().getLength()))
+ "/" + relativKey);
if (bRegister)
{

View file

@ -424,8 +424,7 @@ css::uno::Reference< css::uri::XUriReference > Factory::makeAbsolute(
auto const path = uriReference->getPath();
auto [segments, proc] = processSegments(path, {}, true);
if (proc) {
OUStringBuffer abs(uriReference->getScheme());
abs.append(':');
OUStringBuffer abs(uriReference->getScheme() + ":");
if (uriReference->hasAuthority()) {
abs.append("//" + uriReference->getAuthority());
}
@ -454,12 +453,10 @@ css::uno::Reference< css::uri::XUriReference > Factory::makeAbsolute(
abs.append(i.segment);
}
if (uriReference->hasQuery()) {
abs.append('?');
abs.append(uriReference->getQuery());
abs.append("?" + uriReference->getQuery());
}
if (uriReference->hasFragment()) {
abs.append('#');
abs.append(uriReference->getFragment());
abs.append("#" + uriReference->getFragment());
}
return parse(abs.makeStringAndClear());
}
@ -467,28 +464,23 @@ css::uno::Reference< css::uri::XUriReference > Factory::makeAbsolute(
return clone(uriReference);
} else if (!uriReference->hasAuthority()
&& uriReference->getPath().isEmpty()) {
OUStringBuffer abs(baseUriReference->getScheme());
abs.append(':');
OUStringBuffer abs(baseUriReference->getScheme() + ":");
if (baseUriReference->hasAuthority()) {
abs.append("//" + baseUriReference->getAuthority());
}
abs.append(baseUriReference->getPath());
if (uriReference->hasQuery()) {
abs.append('?');
abs.append(uriReference->getQuery());
abs.append("?" + uriReference->getQuery());
} else if (baseUriReference->hasQuery()) {
abs.append('?');
abs.append(baseUriReference->getQuery());
abs.append("?" + baseUriReference->getQuery());
}
if (uriReference->hasFragment()) {
abs.append('#');
abs.append(uriReference->getFragment());
abs.append("#" + uriReference->getFragment());
}
return parse(abs.makeStringAndClear());
} else {
OUStringBuffer abs(128);
abs.append(baseUriReference->getScheme());
abs.append(':');
abs.append(baseUriReference->getScheme() + ":");
if (uriReference->hasAuthority()) {
abs.append("//" + uriReference->getAuthority());
} else if (baseUriReference->hasAuthority()) {
@ -568,12 +560,10 @@ css::uno::Reference< css::uri::XUriReference > Factory::makeAbsolute(
}
}
if (uriReference->hasQuery()) {
abs.append('?');
abs.append(uriReference->getQuery());
abs.append("?" + uriReference->getQuery());
}
if (uriReference->hasFragment()) {
abs.append('#');
abs.append(uriReference->getFragment());
abs.append("#" + uriReference->getFragment());
}
return parse(abs.makeStringAndClear());
}
@ -690,12 +680,10 @@ css::uno::Reference< css::uri::XUriReference > Factory::makeRelative(
}
}
if (!omitQuery && uriReference->hasQuery()) {
rel.append('?');
rel.append(uriReference->getQuery());
rel.append("?" + uriReference->getQuery());
}
if (uriReference->hasFragment()) {
rel.append('#');
rel.append(uriReference->getFragment());
rel.append("#" + uriReference->getFragment());
}
return parse(rel.makeStringAndClear());
}

View file

@ -293,8 +293,7 @@ void UrlReference::setParameter(OUString const & key, OUString const & value)
newPath.append(m_base.m_path.subView(0, i));
if (!bExistent) {
newPath.append( m_base.m_path.indexOf('?') < 0 ? '?' : '&' );
newPath.append(encodeNameOrParamFragment(key));
newPath.append('=');
newPath.append(encodeNameOrParamFragment(key) + "=");
}
newPath.append(encodeNameOrParamFragment(value));
if (bExistent) {

View file

@ -605,12 +605,12 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
if( rOutName.isEmpty() )
return rStream;
OStringBuffer sOut;
sOut.append(OString::Concat("<") +
OOO_STRING_SVTOOLS_HTML_map
" "
OOO_STRING_SVTOOLS_HTML_O_name
"=\"");
OStringBuffer sOut =
OString::Concat("<") +
OOO_STRING_SVTOOLS_HTML_map
" "
OOO_STRING_SVTOOLS_HTML_O_name
"=\"";
rStream.WriteOString( sOut );
sOut.setLength(0);
Out_String( rStream, rOutName );

View file

@ -567,21 +567,21 @@ static void lcl_FormatPostIt(
pIDCO->SplitNode( *aPam.GetPoint(), false );
}
OUString aStr( SwViewShell::GetShellRes()->aPostItPage );
aStr += sTmp +
OUString aStr = SwViewShell::GetShellRes()->aPostItPage +
sTmp +
OUString::number( nPageNo ) +
" ";
if( nLineNo )
{
aStr += SwViewShell::GetShellRes()->aPostItLine;
aStr += sTmp +
aStr += SwViewShell::GetShellRes()->aPostItLine +
sTmp +
OUString::number( nLineNo ) +
" ";
}
aStr += SwViewShell::GetShellRes()->aPostItAuthor;
aStr += sTmp + pField->GetPar1() + " ";
SvtSysLocale aSysLocale;
aStr += /*(LocaleDataWrapper&)*/aSysLocale.GetLocaleData().getDate( pField->GetDate() );
aStr += SwViewShell::GetShellRes()->aPostItAuthor +
sTmp + pField->GetPar1() + " " +
/*(LocaleDataWrapper&)*/aSysLocale.GetLocaleData().getDate( pField->GetDate() );
if(pField->GetResolved())
aStr += " " + SwResId(STR_RESOLVED);
pIDCO->InsertString( aPam, aStr );

View file

@ -535,31 +535,31 @@ MakeUndoReplaceRewriter(sal_uLong const occurrences,
aResult.AddRule(UndoArg1, OUString::number(occurrences));
aResult.AddRule(UndoArg2, SwResId(STR_OCCURRENCES_OF));
OUString aTmpStr = SwResId(STR_START_QUOTE);
aTmpStr += ShortenString(sOld, nUndoStringLength,
SwResId(STR_LDOTS));
aTmpStr += SwResId(STR_END_QUOTE);
OUString aTmpStr =
SwResId(STR_START_QUOTE)
+ ShortenString(sOld, nUndoStringLength, SwResId(STR_LDOTS))
+ SwResId(STR_END_QUOTE);
aResult.AddRule(UndoArg3, aTmpStr);
}
else if (1 == occurrences)
{
{
OUString aTmpStr = SwResId(STR_START_QUOTE);
// #i33488 #
aTmpStr += ShortenString(sOld, nUndoStringLength,
SwResId(STR_LDOTS));
aTmpStr += SwResId(STR_END_QUOTE);
OUString aTmpStr =
SwResId(STR_START_QUOTE)
+ ShortenString(sOld, nUndoStringLength, SwResId(STR_LDOTS))
+ SwResId(STR_END_QUOTE);
aResult.AddRule(UndoArg1, aTmpStr);
}
aResult.AddRule(UndoArg2, SwResId(STR_YIELDS));
{
OUString aTmpStr = SwResId(STR_START_QUOTE);
// #i33488 #
aTmpStr += ShortenString(sNew, nUndoStringLength,
SwResId(STR_LDOTS));
aTmpStr += SwResId(STR_END_QUOTE);
OUString aTmpStr =
SwResId(STR_START_QUOTE)
+ ShortenString(sNew, nUndoStringLength, SwResId(STR_LDOTS))
+ SwResId(STR_END_QUOTE);
aResult.AddRule(UndoArg3, aTmpStr);
}
}
@ -998,10 +998,10 @@ SwRewriter SwUndoInsertLabel::CreateRewriter(const OUString &rStr)
if (!rStr.isEmpty())
{
aTmpStr += SwResId(STR_START_QUOTE);
aTmpStr += ShortenString(rStr, nUndoStringLength,
SwResId(STR_LDOTS));
aTmpStr += SwResId(STR_END_QUOTE);
aTmpStr =
SwResId(STR_START_QUOTE)
+ ShortenString(rStr, nUndoStringLength, SwResId(STR_LDOTS))
+ SwResId(STR_END_QUOTE);
}
aRewriter.AddRule(UndoArg1, aTmpStr);

View file

@ -198,8 +198,7 @@ static OString OutBorderLine(RtfExport const& rExport, const editeng::SvxBorderL
const char* pStr, sal_uInt16 nDist,
SvxShadowLocation eShadowLocation = SvxShadowLocation::NONE)
{
OStringBuffer aRet;
aRet.append(OutTBLBorderLine(rExport, pLine, pStr));
OStringBuffer aRet(OutTBLBorderLine(rExport, pLine, pStr));
if (pLine)
{
aRet.append(OOO_STRING_SVTOOLS_RTF_BRSP + OString::number(static_cast<sal_Int32>(nDist)));
@ -528,10 +527,9 @@ void RtfAttributeOutput::StartRuby(const SwTextNode& rNode, sal_Int32 /*nPos*/,
const SwFormatRuby& rRuby)
{
WW8Ruby aWW8Ruby(rNode, rRuby, GetExport());
OUString aStr(FieldString(ww::eEQ) + "\\* jc");
aStr += OUString::number(aWW8Ruby.GetJC()) + " \\* \"Font:" + aWW8Ruby.GetFontFamily()
+ "\" \\* hps";
aStr += OUString::number((aWW8Ruby.GetRubyHeight() + 5) / 10) + " \\o";
OUString aStr = FieldString(ww::eEQ) + "\\* jc" + OUString::number(aWW8Ruby.GetJC())
+ " \\* \"Font:" + aWW8Ruby.GetFontFamily() + "\" \\* hps"
+ OUString::number((aWW8Ruby.GetRubyHeight() + 5) / 10) + " \\o";
if (aWW8Ruby.GetDirective())
{
aStr += "\\a" + OUStringChar(aWW8Ruby.GetDirective());

View file

@ -894,10 +894,15 @@ const SfxPoolItem& SwWW8AttrIter::GetItem(sal_uInt16 nWhich) const
void WW8AttributeOutput::StartRuby( const SwTextNode& rNode, sal_Int32 /*nPos*/, const SwFormatRuby& rRuby )
{
WW8Ruby aWW8Ruby(rNode, rRuby, GetExport());
OUString aStr( FieldString( ww::eEQ ) + "\\* jc" );
aStr += OUString::number(aWW8Ruby.GetJC()) + " \\* \"Font:" + aWW8Ruby.GetFontFamily()
+ "\" \\* hps";
aStr += OUString::number((aWW8Ruby.GetRubyHeight() + 5) / 10) + " \\o";
OUString aStr =
FieldString( ww::eEQ )
+ "\\* jc"
+ OUString::number(aWW8Ruby.GetJC())
+ " \\* \"Font:"
+ aWW8Ruby.GetFontFamily()
+ "\" \\* hps"
+ OUString::number((aWW8Ruby.GetRubyHeight() + 5) / 10)
+ " \\o";
if (aWW8Ruby.GetDirective())
{
aStr += OUString::Concat(u"\\a") + OUStringChar(aWW8Ruby.GetDirective());

View file

@ -556,9 +556,9 @@ void SwXMLExport::ExportTableColumnStyle( const SwXMLTableColumn_Impl& rCol )
{
SvXMLElementExport aElem( *this, XML_NAMESPACE_STYLE, XML_STYLE, true,
true );
OUStringBuffer sValue;
if( rCol.GetWidthOpt() )
{
OUStringBuffer sValue;
GetTwipUnitConverter().convertMeasureToXML( sValue,
rCol.GetWidthOpt() );
AddAttribute( XML_NAMESPACE_STYLE, XML_COLUMN_WIDTH,
@ -566,10 +566,9 @@ void SwXMLExport::ExportTableColumnStyle( const SwXMLTableColumn_Impl& rCol )
}
if( rCol.GetRelWidth() )
{
sValue.append( static_cast<sal_Int32>(rCol.GetRelWidth()) );
sValue.append( '*' );
OUString sValue = OUString::number(static_cast<sal_Int32>(rCol.GetRelWidth()) ) + "*";
AddAttribute( XML_NAMESPACE_STYLE, XML_REL_COLUMN_WIDTH,
sValue.makeStringAndClear() );
sValue );
}
{

View file

@ -492,8 +492,8 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
case IsAttrAtPos::RefMark:
if(aContentAtPos.aFnd.pAttr)
{
sText = SwResId(STR_CONTENT_TYPE_SINGLE_REFERENCE) + ": ";
sText += static_cast<const SwFormatRefMark*>(aContentAtPos.aFnd.pAttr)->GetRefName();
sText = SwResId(STR_CONTENT_TYPE_SINGLE_REFERENCE) + ": " +
static_cast<const SwFormatRefMark*>(aContentAtPos.aFnd.pAttr)->GetRefName();
}
break;

View file

@ -421,12 +421,13 @@ void SwSrcView::GetState(SfxItemSet& rSet)
break;
case SID_TABLE_CELL:
{
OUString aPos( SwResId(STR_SRCVIEW_ROW) );
TextSelection aSel = pTextView->GetSelection();
aPos += OUString::number( aSel.GetEnd().GetPara()+1 );
aPos += " : " +
SwResId(STR_SRCVIEW_COL);
aPos += OUString::number( aSel.GetEnd().GetIndex()+1 );
OUString aPos =
SwResId(STR_SRCVIEW_ROW)
+ OUString::number( aSel.GetEnd().GetPara()+1 )
+ " : "
+ SwResId(STR_SRCVIEW_COL)
+ OUString::number( aSel.GetEnd().GetIndex()+1 );
SvxStatusItem aItem( SID_TABLE_CELL, aPos, StatusCategory::RowColumn );
rSet.Put( aItem );
}
@ -475,8 +476,7 @@ void SwSrcView::GetState(SfxItemSet& rSet)
nCount = rMgr.GetUndoActionCount();
if(nCount)
{
OUString aStr(SvtResId( STR_UNDO));
aStr += rMgr.GetUndoActionComment(--nCount);
OUString aStr = SvtResId( STR_UNDO) + rMgr.GetUndoActionComment(--nCount);
rSet.Put(SfxStringItem(nWhich, aStr));
}
else
@ -487,8 +487,7 @@ void SwSrcView::GetState(SfxItemSet& rSet)
nCount = rMgr.GetRedoActionCount();
if(nCount)
{
OUString aStr(SvtResId( STR_REDO));
aStr += rMgr.GetRedoActionComment(--nCount);
OUString aStr = SvtResId( STR_REDO) + rMgr.GetRedoActionComment(--nCount);
rSet.Put(SfxStringItem(nWhich,aStr));
}
else

View file

@ -1967,8 +1967,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
if( rShell.IsCursorInTable() )
{
// table name + cell coordinate
sStr = rShell.GetTableFormat()->GetName() + ":";
sStr += rShell.GetBoxNms();
sStr = rShell.GetTableFormat()->GetName() + ":" + rShell.GetBoxNms();
eCategory = StatusCategory::TableCell;
}
else

View file

@ -702,8 +702,7 @@ void PropertySetRegistry::renamePropertySet( const OUString& rOldKey,
// Fill new item...
// Set Values
OUString aKey = aOldValuesKey;
aKey += makeHierarchalNameSegment( rPropName );
OUString aKey = aOldValuesKey + makeHierarchalNameSegment( rPropName );
// ... handle
OUString aNewKey1 = aKey + aHandleKey;
@ -1122,8 +1121,8 @@ void SAL_CALL PersistentPropertySet::setPropertyValue( const OUString& aProperty
m_pCreator->getRootConfigReadAccess(), UNO_QUERY );
if ( xRootHierNameAccess.is() )
{
OUString aFullPropName( getFullKeyImpl(aCGuard) + "/" );
aFullPropName += makeHierarchalNameSegment( aPropertyName );
OUString aFullPropName( getFullKeyImpl(aCGuard) + "/" +
makeHierarchalNameSegment( aPropertyName ) );
// Does property exist?
if ( xRootHierNameAccess->hasByHierarchicalName( aFullPropName ) )
@ -1213,8 +1212,8 @@ Any SAL_CALL PersistentPropertySet::getPropertyValue(
m_pCreator->getRootConfigReadAccess(), UNO_QUERY );
if ( xNameAccess.is() )
{
OUString aFullPropName( getFullKeyImpl(aGuard) + "/" );
aFullPropName += makeHierarchalNameSegment( PropertyName ) + "/Value";
OUString aFullPropName( getFullKeyImpl(aGuard) + "/" +
makeHierarchalNameSegment( PropertyName ) + "/Value" );
try
{
return xNameAccess->getByHierarchicalName( aFullPropName );
@ -1342,8 +1341,8 @@ void SAL_CALL PersistentPropertySet::addProperty(
if ( xRootHierNameAccess.is() )
{
aFullValuesName = getFullKeyImpl(aGuard);
OUString aFullPropName = aFullValuesName + "/";
aFullPropName += makeHierarchalNameSegment( Name );
OUString aFullPropName = aFullValuesName + "/" +
makeHierarchalNameSegment( Name );
if ( xRootHierNameAccess->hasByHierarchicalName( aFullPropName ) )
{
@ -1485,8 +1484,8 @@ void SAL_CALL PersistentPropertySet::removeProperty( const OUString& Name )
if ( xRootHierNameAccess.is() )
{
OUString aFullValuesName = getFullKeyImpl(aGuard);
OUString aFullPropName = aFullValuesName + "/";
aFullPropName += makeHierarchalNameSegment( Name );
OUString aFullPropName = aFullValuesName + "/" +
makeHierarchalNameSegment( Name );
// Property in set?
if ( !xRootHierNameAccess->hasByHierarchicalName( aFullPropName ) )
@ -1787,8 +1786,8 @@ void SAL_CALL PersistentPropertySet::setPropertyValues(
{
const OUString& rName = rNewValue.Name;
OUString aFullPropName = aFullPropNamePrefix;
aFullPropName += makeHierarchalNameSegment( rName );
OUString aFullPropName = aFullPropNamePrefix +
makeHierarchalNameSegment( rName );
// Does property exist?
if ( xRootHierNameAccess->hasByHierarchicalName( aFullPropName ) )
@ -2096,8 +2095,8 @@ Property SAL_CALL PropertySetInfo_Impl::getPropertyByName(
UNO_QUERY );
if ( xRootHierNameAccess.is() )
{
OUString aFullPropName( m_pOwner->getFullKey() + "/" );
aFullPropName += makeHierarchalNameSegment( aName );
OUString aFullPropName( m_pOwner->getFullKey() + "/" +
makeHierarchalNameSegment( aName ) );
// Does property exist?
if ( !xRootHierNameAccess->hasByHierarchicalName( aFullPropName ) )
@ -2175,8 +2174,8 @@ sal_Bool SAL_CALL PropertySetInfo_Impl::hasPropertyByName(
UNO_QUERY );
if ( xRootHierNameAccess.is() )
{
OUString aFullPropName( m_pOwner->getFullKey() + "/" );
aFullPropName += makeHierarchalNameSegment( Name );
OUString aFullPropName( m_pOwner->getFullKey() + "/" +
makeHierarchalNameSegment( Name ) );
return xRootHierNameAccess->hasByHierarchicalName( aFullPropName );
}

View file

@ -699,8 +699,8 @@ HierarchyContent::makeNewIdentifier( const OUString& rTitle )
// Assemble new content identifier...
HierarchyUri aUri( m_xIdentifier->getContentIdentifier() );
OUString aNewURL = aUri.getParentUri() + "/";
aNewURL += ::ucb_impl::urihelper::encodeSegment( rTitle );
OUString aNewURL = aUri.getParentUri() + "/" +
::ucb_impl::urihelper::encodeSegment( rTitle );
return uno::Reference< ucb::XContentIdentifier >(
new ::ucbhelper::ContentIdentifier( aNewURL ) );
@ -1348,8 +1348,7 @@ void HierarchyContent::insert( sal_Int32 nNameClashResolve,
do
{
OUString aNewId = xId->getContentIdentifier() + "_";
aNewId += OUString::number( ++nTry );
OUString aNewId = xId->getContentIdentifier() + "_" + OUString::number( ++nTry );
xId = new ::ucbhelper::ContentIdentifier( aNewId );
}
while ( hasData( xId ) && ( nTry < 1000 ) );

View file

@ -1259,8 +1259,8 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
uno::Reference< ucb::XContentIdentifier > xOldId = m_xIdentifier;
// Assemble new content identifier...
OUString aNewURL = m_aUri.getParentUri() + "/";
aNewURL += ::ucb_impl::urihelper::encodeSegment( aNewTitle );
OUString aNewURL = m_aUri.getParentUri() + "/" +
::ucb_impl::urihelper::encodeSegment( aNewTitle );
uno::Reference< ucb::XContentIdentifier > xNewId
= new ::ucbhelper::ContentIdentifier( aNewURL );
@ -1538,8 +1538,7 @@ void Content::insert(
do
{
OUString aNew = aNewUri.getUri() + "_";
aNew += OUString::number( ++nTry );
OUString aNew = aNewUri.getUri() + "_" + OUString::number( ++nTry );
aNewUri.setUri( aNew );
}
while ( hasData( aNewUri ) && ( nTry < 1000 ) );

View file

@ -876,12 +876,9 @@ SvXMLExport::EnsureNamespace(OUString const & i_rNamespace)
sPrefix = aPreferredPrefix;
nKey = GetNamespaceMap_().GetKeyByPrefix( sPrefix );
sal_Int32 n( 0 );
OUStringBuffer buf;
while( nKey != USHRT_MAX )
{
buf.append( aPreferredPrefix );
buf.append( ++n );
sPrefix = buf.makeStringAndClear();
sPrefix = aPreferredPrefix + OUString::number(++n);
nKey = GetNamespaceMap_().GetKeyByPrefix( sPrefix );
}

View file

@ -965,7 +965,6 @@ void SvXMLExportPropertyMapper::_exportXML(
const uno::Sequence< OUString > aAttribNames( xAttrContainer->getElementNames() );
OUStringBuffer sNameBuffer;
xml::AttributeData aData;
for( const auto& rAttribName : aAttribNames )
{
@ -1008,9 +1007,7 @@ void SvXMLExportPropertyMapper::_exportXML(
OUString sOrigPrefix( sPrefix );
do
{
sNameBuffer.append( sOrigPrefix );
sNameBuffer.append( ++n );
sPrefix = sNameBuffer.makeStringAndClear();
sPrefix = sOrigPrefix + OUString::number( ++n );
nKey = pNamespaceMap->GetKeyByPrefix( sPrefix );
}
while( nKey != USHRT_MAX );
@ -1024,8 +1021,7 @@ void SvXMLExportPropertyMapper::_exportXML(
sPrefix = pNamespaceMap->GetPrefixByKey( nKey );
}
// In any case, the attribute name has to be adapted.
sNameBuffer.append(sPrefix + ":" + rAttribName.subView(nColonPos+1));
sAttribName = sNameBuffer.makeStringAndClear();
sAttribName = sPrefix + ":" + rAttribName.subView(nColonPos+1);
}
if( bAddNamespace )

View file

@ -1201,10 +1201,9 @@ void XMLTextParagraphExport::exportListChange(
{
if ( rNextInfo.HasStartValue() )
{
OUStringBuffer aBuffer;
aBuffer.append( static_cast<sal_Int32>(rNextInfo.GetStartValue()) );
OUString aTmp = OUString::number( static_cast<sal_Int32>(rNextInfo.GetStartValue()) );
GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE,
aBuffer.makeStringAndClear() );
aTmp );
}
else if (bRestartNumberingAtContinuedList)
{
@ -1276,19 +1275,15 @@ void XMLTextParagraphExport::exportListChange(
GetExport().CheckAttrList();
if( rNextInfo.HasStartValue() )
{
OUStringBuffer aBuffer;
aBuffer.append( static_cast<sal_Int32>(rNextInfo.GetStartValue()) );
GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE,
aBuffer.makeStringAndClear() );
OUString aTmp = OUString::number( static_cast<sal_Int32>(rNextInfo.GetStartValue()) );
GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE, aTmp );
}
// Handle restart without start value on list level 1 (#i103745#)
else if ( rNextInfo.IsRestart() && /*!rNextInfo.HasStartValue() &&*/
rNextInfo.GetLevel() == 1 )
{
OUStringBuffer aBuffer;
aBuffer.append( static_cast<sal_Int32>(rNextInfo.GetListLevelStartValue()) );
GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE,
aBuffer.makeStringAndClear() );
OUString aTmp = OUString::number( static_cast<sal_Int32>(rNextInfo.GetListLevelStartValue()) );
GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE, aTmp );
}
if ( ( GetExport().getExportFlags() & SvXMLExportFlags::OASIS ) &&
GetExport().getSaneDefaultVersion() >= SvtSaveOptions::ODFSVER_012)