From c5a0b7af847a71fd50f713934b29305f8ce96c6b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 3 May 2021 14:09:20 +0200 Subject: loplugin:stringadd improvement for appending numbers I was wrong, the Concat framework already optimised appending numbers by stack-allocating small buffers, so include them in the plugin Change-Id: I922edbdde273c89abfe21d51c5d25dc01c97db25 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115037 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/source/core/fields/cellfml.cxx | 6 ++-- sw/source/filter/html/htmldrawwriter.cxx | 12 ++++---- sw/source/filter/html/htmlflywriter.cxx | 13 ++++---- sw/source/filter/html/htmltabw.cxx | 14 ++++----- sw/source/filter/ww8/docxattributeoutput.cxx | 20 ++++++------ sw/source/filter/ww8/rtfattributeoutput.cxx | 10 +++--- sw/source/filter/ww8/rtfsdrexport.cxx | 46 ++++++++++++---------------- sw/source/uibase/config/modcfg.cxx | 2 +- sw/source/uibase/uiview/pview.cxx | 7 ++--- 9 files changed, 59 insertions(+), 71 deletions(-) (limited to 'sw/source') diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx index 0ed5d21c293d..a3a32b80b98e 100644 --- a/sw/source/core/fields/cellfml.cxx +++ b/sw/source/core/fields/cellfml.cxx @@ -557,8 +557,8 @@ void SwTableFormula::BoxNmsToPtr( const SwTable& rTable, OUStringBuffer& rNewStr if( pLastBox ) { pBox = rTable.GetTableBox( *pLastBox ); - rNewStr.append(reinterpret_cast(pBox)) - .append(":"); + rNewStr.append(OUString::number(reinterpret_cast(pBox)) + + ":"); rFirstBox = rFirstBox.copy( pLastBox->getLength()+1 ); } @@ -1222,7 +1222,7 @@ void SwTableFormula::SplitMergeBoxNm_( const SwTable& rTable, OUStringBuffer& rN } if( pLastBox ) - rNewStr.append(reinterpret_cast(pEndBox)).append(":"); + rNewStr.append(OUString::number(reinterpret_cast(pEndBox)) + ":"); rNewStr.append(reinterpret_cast(pSttBox)) .append(rFirstBox[ rFirstBox.getLength()-1] ); diff --git a/sw/source/filter/html/htmldrawwriter.cxx b/sw/source/filter/html/htmldrawwriter.cxx index f9ac9a39542c..3f9758ae8bc0 100644 --- a/sw/source/filter/html/htmldrawwriter.cxx +++ b/sw/source/filter/html/htmldrawwriter.cxx @@ -177,13 +177,13 @@ Writer& OutHTML_DrawFrameFormatAsMarquee( Writer& rWrt, sal_Int32 nCount = rItemSet.Get( SDRATTR_TEXT_ANICOUNT ).GetValue(); if( 0==nCount ) nCount = SdrTextAniKind::Slide==eAniKind ? 1 : -1; - sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_loop "=\""). - append(nCount).append("\""); + sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_loop "=\"" + + OString::number(nCount) + "\""); // SCROLLDELAY sal_uInt16 nDelay = rItemSet.Get( SDRATTR_TEXT_ANIDELAY ).GetValue(); sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_scrolldelay - "=\"").append(static_cast(nDelay)).append("\""); + "=\"" + OString::number(nDelay) + "\""); // SCROLLAMOUNT sal_Int16 nAmount = rItemSet.Get( SDRATTR_TEXT_ANIAMOUNT ).GetValue(); @@ -200,7 +200,7 @@ Writer& OutHTML_DrawFrameFormatAsMarquee( Writer& rWrt, if( nAmount ) { sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_scrollamount - "=\"").append(static_cast(nAmount)).append("\""); + "=\"" + OString::number(nAmount) + "\""); } Size aTwipSz( pTextObj->GetLogicRect().GetSize() ); @@ -231,13 +231,13 @@ Writer& OutHTML_DrawFrameFormatAsMarquee( Writer& rWrt, if( aPixelSz.Width() ) { sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_width - "=\"").append(static_cast(aPixelSz.Width())).append("\""); + "=\"" + OString::number(aPixelSz.Width()) + "\""); } if( aPixelSz.Height() ) { sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_height - "=\"").append(static_cast(aPixelSz.Height())).append("\""); + "=\"" + OString::number(aPixelSz.Height()) + "\""); } } diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index bbc0874a4784..50a5a648efae 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -633,13 +633,13 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, if( aPixelSpc.Width() ) { sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_hspace - "=\"").append(static_cast(aPixelSpc.Width())).append("\""); + "=\"" + OString::number(aPixelSpc.Width()) + "\""); } if( aPixelSpc.Height() ) { sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_vspace - "=\"").append(static_cast(aPixelSpc.Height())).append("\""); + "=\"" + OString::number(aPixelSpc.Height()) + "\""); } } @@ -1587,7 +1587,7 @@ static Writer & OutHTML_FrameFormatAsMulticol( Writer& rWrt, if( nCols ) { sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_cols - "=\"").append(static_cast(nCols)).append("\""); + "=\"" + OString::number(nCols) + "\""); } // the Gutter width (minimum value) as GUTTER @@ -1601,7 +1601,7 @@ static Writer & OutHTML_FrameFormatAsMulticol( Writer& rWrt, MapMode(MapUnit::MapTwip) ).Width()); } sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_gutter - "=\"").append(static_cast(nGutter)).append("\""); + "=\"" + OString::number(nGutter) + "\""); } rWrt.Strm().WriteOString( sOut.makeStringAndClear() ); @@ -1959,12 +1959,11 @@ Writer& OutHTML_HeaderFooter( Writer& rWrt, const SwFrameFormat& rFrameFormat, nSize = static_cast(Application::GetDefaultDevice() ->LogicToPixel( Size(nSize,0), MapMode(MapUnit::MapTwip) ).Width()); - aSpacer = OStringBuffer(OOO_STRING_SVTOOLS_HTML_spacer + aSpacer = OOO_STRING_SVTOOLS_HTML_spacer " " OOO_STRING_SVTOOLS_HTML_O_type "=\"" OOO_STRING_SVTOOLS_HTML_SPTYPE_vertical "\"" " " OOO_STRING_SVTOOLS_HTML_O_size - "=\"").append(static_cast(nSize)).append("\""). - makeStringAndClear(); + "=\"" + OString::number(nSize) + "\""; } const SwFormatContent& rFlyContent = rFrameFormat.GetContent(); diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx index e05d4124e6b5..af5f67922bed 100644 --- a/sw/source/filter/html/htmltabw.cxx +++ b/sw/source/filter/html/htmltabw.cxx @@ -310,12 +310,12 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt, if( nRowSpan>1 ) { sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_rowspan - "=\"").append(static_cast(nRowSpan)).append("\""); + "=\"" + OString::number(nRowSpan) + "\""); } if( nColSpan > 1 ) { sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_colspan - "=\"").append(static_cast(nColSpan)).append("\""); + "=\"" + OString::number(nColSpan) + "\""); } tools::Long nWidth = 0; @@ -388,7 +388,7 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt, if( nHeight ) { sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_height - "=\"").append(static_cast(aPixelSz.Height())).append("\""); + "=\"" + OString::number(aPixelSz.Height()) + "\""); } const SfxItemSet& rItemSet = pBox->GetFrameFormat()->GetAttrSet(); @@ -677,23 +677,23 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, if( aPixelSpc.Width() ) { sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_hspace - "=\"").append(static_cast(aPixelSpc.Width())).append("\""); + "=\"" + OString::number(aPixelSpc.Width()) + "\""); } if( aPixelSpc.Height() ) { sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_vspace - "=\"").append(static_cast(aPixelSpc.Height())).append("\""); + "=\"" + OString::number(aPixelSpc.Height()) + "\""); } } // output CELLPADDING: from layout or calculated sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_cellpadding - "=\"").append(static_cast(SwHTMLWriter::ToPixel(m_nCellPadding,false))).append("\""); + "=\"" + OString::number(SwHTMLWriter::ToPixel(m_nCellPadding,false)) + "\""); // output CELLSPACING: from layout or calculated sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_cellspacing - "=\"").append(static_cast(SwHTMLWriter::ToPixel(m_nCellSpacing,false))).append("\""); + "=\"" + OString::number(SwHTMLWriter::ToPixel(m_nCellSpacing,false)) + "\""); rWrt.Strm().WriteOString( sOut.makeStringAndClear() ); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index c7f672ae4f58..3c6b2616e13a 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -8717,8 +8717,8 @@ void DocxAttributeOutput::FormatFrameSize( const SwFormatFrameSize& rSize ) if (m_rExport.SdrExporter().getTextFrameSyntax() && m_rExport.SdrExporter().getFlyFrameSize()) { const Size* pSize = m_rExport.SdrExporter().getFlyFrameSize(); - m_rExport.SdrExporter().getTextFrameStyle().append(";width:").append(double(pSize->Width()) / 20); - m_rExport.SdrExporter().getTextFrameStyle().append("pt;height:").append(double(pSize->Height()) / 20).append("pt"); + m_rExport.SdrExporter().getTextFrameStyle().append(";width:" + OString::number(double(pSize->Width()) / 20)); + m_rExport.SdrExporter().getTextFrameStyle().append("pt;height:" + OString::number(double(pSize->Height()) / 20) + "pt"); } else if (m_rExport.SdrExporter().getDMLTextFrameSyntax()) { @@ -8763,8 +8763,8 @@ void DocxAttributeOutput::FormatLRSpace( const SvxLRSpaceItem& rLRSpace ) if (m_rExport.SdrExporter().getTextFrameSyntax()) { - m_rExport.SdrExporter().getTextFrameStyle().append(";mso-wrap-distance-left:").append(double(rLRSpace.GetLeft()) / 20).append("pt"); - m_rExport.SdrExporter().getTextFrameStyle().append(";mso-wrap-distance-right:").append(double(rLRSpace.GetRight()) / 20).append("pt"); + m_rExport.SdrExporter().getTextFrameStyle().append(";mso-wrap-distance-left:" + OString::number(double(rLRSpace.GetLeft()) / 20) + "pt"); + m_rExport.SdrExporter().getTextFrameStyle().append(";mso-wrap-distance-right:" + OString::number(double(rLRSpace.GetRight()) / 20) + "pt"); } else if (m_rExport.SdrExporter().getDMLTextFrameSyntax()) { @@ -8820,8 +8820,8 @@ void DocxAttributeOutput::FormatULSpace( const SvxULSpaceItem& rULSpace ) if (m_rExport.SdrExporter().getTextFrameSyntax()) { - m_rExport.SdrExporter().getTextFrameStyle().append(";mso-wrap-distance-top:").append(double(rULSpace.GetUpper()) / 20).append("pt"); - m_rExport.SdrExporter().getTextFrameStyle().append(";mso-wrap-distance-bottom:").append(double(rULSpace.GetLower()) / 20).append("pt"); + m_rExport.SdrExporter().getTextFrameStyle().append(";mso-wrap-distance-top:" + OString::number(double(rULSpace.GetUpper()) / 20) + "pt"); + m_rExport.SdrExporter().getTextFrameStyle().append(";mso-wrap-distance-bottom:" + OString::number(double(rULSpace.GetLower()) / 20) + "pt"); } else if (m_rExport.SdrExporter().getDMLTextFrameSyntax()) { @@ -9036,7 +9036,7 @@ void DocxAttributeOutput::FormatVertOrientation( const SwFormatVertOrient& rFlyV if (m_rExport.SdrExporter().getTextFrameSyntax()) { - m_rExport.SdrExporter().getTextFrameStyle().append(";margin-top:").append(double(rFlyVert.GetPos()) / 20).append("pt"); + m_rExport.SdrExporter().getTextFrameStyle().append(";margin-top:" + OString::number(double(rFlyVert.GetPos()) / 20) + "pt"); if ( !sAlign.isEmpty() ) m_rExport.SdrExporter().getTextFrameStyle().append(";mso-position-vertical:" + sAlign); m_rExport.SdrExporter().getTextFrameStyle().append(";mso-position-vertical-relative:" + sVAnchor); @@ -9062,7 +9062,7 @@ void DocxAttributeOutput::FormatHorizOrientation( const SwFormatHoriOrient& rFly if (m_rExport.SdrExporter().getTextFrameSyntax()) { - m_rExport.SdrExporter().getTextFrameStyle().append(";margin-left:").append(double(rFlyHori.GetPos()) / 20).append("pt"); + m_rExport.SdrExporter().getTextFrameStyle().append(";margin-left:" + OString::number(double(rFlyHori.GetPos()) / 20) + "pt"); if ( !sAlign.isEmpty() ) m_rExport.SdrExporter().getTextFrameStyle().append(";mso-position-horizontal:" + sAlign); m_rExport.SdrExporter().getTextFrameStyle().append(";mso-position-horizontal-relative:" + sHAnchor); @@ -9998,8 +9998,8 @@ void DocxAttributeOutput::BulletDefinition(int nId, const Graphic& rGraphic, Siz OStringBuffer aStyle; // Size is in twips, we need it in points. - aStyle.append("width:").append(double(aSize.Width()) / 20); - aStyle.append("pt;height:").append(double(aSize.Height()) / 20).append("pt"); + aStyle.append("width:" + OString::number(double(aSize.Width()) / 20)); + aStyle.append("pt;height:" + OString::number(double(aSize.Height()) / 20) + "pt"); m_pSerializer->startElementNS(XML_w, XML_pict); m_pSerializer->startElementNS( XML_v, XML_shape, XML_style, aStyle.getStr(), diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 978e44ded2c0..34e6cabd0591 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -176,7 +176,8 @@ static OString OutTBLBorderLine(RtfExport const& rExport, const editeng::SvxBord ::editeng::ConvertBorderWidthToWord(pLine->GetBorderLineStyle(), pLine->GetWidth())); if (255 >= pLine->GetWidth()) // That value comes from RTF specs { - aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRW).append(static_cast(fConverted)); + aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRW + + OString::number(static_cast(fConverted))); } else { @@ -4258,11 +4259,8 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat *pPolyPoly, pNd, /*bCorrectCrop=*/true); OStringBuffer aVerticies; for (sal_uInt16 i = 0; i < aPoly.GetSize(); ++i) - aVerticies.append(";(") - .append(aPoly[i].X()) - .append(",") - .append(aPoly[i].Y()) - .append(")"); + aVerticies.append(";(" + OString::number(aPoly[i].X()) + "," + + OString::number(aPoly[i].Y()) + ")"); aFlyProperties.push_back(std::make_pair( "pWrapPolygonVertices", "8;" + OString::number(aPoly.GetSize()) + aVerticies.makeStringAndClear())); diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx index f4c2e3deca3e..320d8026ed33 100644 --- a/sw/source/filter/ww8/rtfsdrexport.cxx +++ b/sw/source/filter/ww8/rtfsdrexport.cxx @@ -178,8 +178,7 @@ void RtfSdrExport::Commit(EscherPropertyContainer& rProps, const tools::Rectangl break; } if (nWrapType) - m_aShapeStyle.append(OOO_STRING_SVTOOLS_RTF_SHPWR) - .append(static_cast(nWrapType)); + m_aShapeStyle.append(OOO_STRING_SVTOOLS_RTF_SHPWR + OString::number(nWrapType)); } break; case ESCHER_Prop_fillColor: @@ -293,7 +292,7 @@ void RtfSdrExport::Commit(EscherPropertyContainer& rProps, const tools::Rectangl // number of segments sal_uInt16 nSegments = impl_GetUInt16(pSegmentIt); sal_Int32 nVertices = 0; - aSegmentInfo.append("2;").append(static_cast(nSegments)); + aSegmentInfo.append("2;" + OString::number(nSegments)); pSegmentIt += 4; for (; nSegments; --nSegments) @@ -316,11 +315,8 @@ void RtfSdrExport::Commit(EscherPropertyContainer& rProps, const tools::Rectangl nPointSize); sal_Int32 nY = impl_GetPointComponent(pVerticesIt, nVerticesPos, nPointSize); - aVerticies.append(";(") - .append(nX) - .append(",") - .append(nY) - .append(")"); + aVerticies.append(";(" + OString::number(nX) + "," + + OString::number(nY) + ")"); nVertices++; } break; @@ -330,8 +326,8 @@ void RtfSdrExport::Commit(EscherPropertyContainer& rProps, const tools::Rectangl = impl_GetPointComponent(pVerticesIt, nVerticesPos, nPointSize); sal_Int32 nY = impl_GetPointComponent(pVerticesIt, nVerticesPos, nPointSize); - aVerticies.append(";(").append(nX).append(",").append(nY).append( - ")"); + aVerticies.append(";(" + OString::number(nX) + "," + + OString::number(nY) + ")"); nVertices++; break; } @@ -344,11 +340,8 @@ void RtfSdrExport::Commit(EscherPropertyContainer& rProps, const tools::Rectangl pVerticesIt, nVerticesPos, nPointSize); sal_Int32 nY = impl_GetPointComponent( pVerticesIt, nVerticesPos, nPointSize); - aVerticies.append(";(") - .append(nX) - .append(",") - .append(nY) - .append(")"); + aVerticies.append(";(" + OString::number(nX) + "," + + OString::number(nY) + ")"); nVertices++; } } @@ -466,10 +459,10 @@ void RtfSdrExport::AddLineDimensions(const tools::Rectangle& rRectangle) m_aShapeProps.insert(std::pair("fFlipH", "1")); // the actual dimensions - m_aShapeStyle.append(OOO_STRING_SVTOOLS_RTF_SHPLEFT).append(rRectangle.Left()); - m_aShapeStyle.append(OOO_STRING_SVTOOLS_RTF_SHPTOP).append(rRectangle.Top()); - m_aShapeStyle.append(OOO_STRING_SVTOOLS_RTF_SHPRIGHT).append(rRectangle.Right()); - m_aShapeStyle.append(OOO_STRING_SVTOOLS_RTF_SHPBOTTOM).append(rRectangle.Bottom()); + m_aShapeStyle.append(OOO_STRING_SVTOOLS_RTF_SHPLEFT + OString::number(rRectangle.Left())); + m_aShapeStyle.append(OOO_STRING_SVTOOLS_RTF_SHPTOP + OString::number(rRectangle.Top())); + m_aShapeStyle.append(OOO_STRING_SVTOOLS_RTF_SHPRIGHT + OString::number(rRectangle.Right())); + m_aShapeStyle.append(OOO_STRING_SVTOOLS_RTF_SHPBOTTOM + OString::number(rRectangle.Bottom())); } void RtfSdrExport::AddRectangleDimensions(OStringBuffer& rBuffer, @@ -478,10 +471,10 @@ void RtfSdrExport::AddRectangleDimensions(OStringBuffer& rBuffer, // We get the position relative to (the current?) character m_aShapeProps.insert(std::pair("posrelh", "3")); - rBuffer.append(OOO_STRING_SVTOOLS_RTF_SHPLEFT).append(rRectangle.Left()); - rBuffer.append(OOO_STRING_SVTOOLS_RTF_SHPTOP).append(rRectangle.Top()); - rBuffer.append(OOO_STRING_SVTOOLS_RTF_SHPRIGHT).append(rRectangle.Right()); - rBuffer.append(OOO_STRING_SVTOOLS_RTF_SHPBOTTOM).append(rRectangle.Bottom()); + rBuffer.append(OOO_STRING_SVTOOLS_RTF_SHPLEFT + OString::number(rRectangle.Left())); + rBuffer.append(OOO_STRING_SVTOOLS_RTF_SHPTOP + OString::number(rRectangle.Top())); + rBuffer.append(OOO_STRING_SVTOOLS_RTF_SHPRIGHT + OString::number(rRectangle.Right())); + rBuffer.append(OOO_STRING_SVTOOLS_RTF_SHPBOTTOM + OString::number(rRectangle.Bottom())); } static void lcl_AppendSP(OStringBuffer& rRunText, const char* cName, std::string_view rValue) @@ -531,10 +524,9 @@ void RtfSdrExport::impl_writeGraphic() // Add it to the properties. RtfStringBuffer aBuf; aBuf->append("{" OOO_STRING_SVTOOLS_RTF_PICT OOO_STRING_SVTOOLS_RTF_PNGBLIP); - aBuf->append(OOO_STRING_SVTOOLS_RTF_PICW).append(sal_Int32(aMapped.Width())); - aBuf->append(OOO_STRING_SVTOOLS_RTF_PICH) - .append(sal_Int32(aMapped.Height())) - .append(SAL_NEWLINE_STRING); + aBuf->append(OOO_STRING_SVTOOLS_RTF_PICW + OString::number(aMapped.Width())); + aBuf->append(OOO_STRING_SVTOOLS_RTF_PICH + OString::number(aMapped.Height()) + + SAL_NEWLINE_STRING); aBuf->append(msfilter::rtfutil::WriteHex(pGraphicAry, nSize)); aBuf->append('}'); m_aShapeProps.insert(std::pair("pib", aBuf.makeStringAndClear())); diff --git a/sw/source/uibase/config/modcfg.cxx b/sw/source/uibase/config/modcfg.cxx index 20bde25caa5b..ef51d6e6ba95 100644 --- a/sw/source/uibase/config/modcfg.cxx +++ b/sw/source/uibase/config/modcfg.cxx @@ -200,7 +200,7 @@ OUString SwModuleOptions::ConvertWordDelimiter(const OUString& rDelim, bool bFro default: if( c <= 0x1f || c >= 0x7f ) { - sReturn.append("\\x").append( static_cast(c), 16 ); + sReturn.append("\\x" + OUString::number( static_cast(c), 16 )); } else { diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index a2e7c29a7361..856dc09f9db3 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -398,14 +398,13 @@ OUString SwPagePreviewWin::GetStatusStr( sal_uInt16 nPageCnt ) const const sal_uInt16 nPageNum = mpPgPreviewLayout->IsPageVisible( mpPgPreviewLayout->SelectedPage() ) ? mpPgPreviewLayout->SelectedPage() : std::max(mnSttPage, 1); - OUStringBuffer aStatusStr; + OUString aStatusStr; const sal_uInt16 nVirtPageNum = mpPgPreviewLayout->GetVirtPageNumByPageNum( nPageNum ); if( nVirtPageNum && nVirtPageNum != nPageNum ) { - aStatusStr.append(static_cast(nVirtPageNum)).append( " " ); + aStatusStr = OUString::number(nVirtPageNum) + " " ; } - aStatusStr.append(static_cast(nPageNum)).append( " / " ).append(static_cast(nPageCnt)); - return aStatusStr.makeStringAndClear(); + return aStatusStr + OUString::number(nPageNum) + " / " + OUString::number(nPageCnt); } void SwPagePreviewWin::KeyInput( const KeyEvent &rKEvt ) -- cgit v1.2.3