[Libreoffice-commits] core.git: sw/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Fri Jun 26 11:23:30 UTC 2020


 sw/source/core/inc/swfont.hxx    |    2 +-
 sw/source/core/text/frmpaint.cxx |    3 +--
 sw/source/core/text/itratr.cxx   |    3 +--
 sw/source/core/text/porrst.cxx   |    2 +-
 sw/source/core/text/portxt.cxx   |    3 +--
 sw/source/filter/html/swhtml.cxx |    6 ++----
 6 files changed, 7 insertions(+), 12 deletions(-)

New commits:
commit 5d1d29a3bf1c5501cb094b45243ce7fd7918c5cd
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Jun 26 11:34:57 2020 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri Jun 26 13:22:52 2020 +0200

    Upcoming improved loplugin:elidestringvar: sw
    
    Change-Id: I8cfc70f45a1fe8dff6c272ba617e73cf97480092
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97203
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx
index b9e367602789..7753f0373a9b 100644
--- a/sw/source/core/inc/swfont.hxx
+++ b/sw/source/core/inc/swfont.hxx
@@ -42,7 +42,7 @@ enum class SvxShadowItemSide;
 const sal_Unicode CH_BLANK = ' ';   // ' ' blank spaces
 const sal_Unicode CH_BREAK = 0x0A;
 const sal_Unicode CH_TAB   = '\t';  // \t
-const sal_Unicode CH_PAR    = 0xB6;     // paragraph
+constexpr OUStringChar CH_PAR = u'\u00B6'; // paragraph
 const sal_Unicode CH_BULLET = 0xB7;     // centered dot
 const sal_Unicode CH_FULL_BLANK = 0x3000;
 const sal_Unicode CH_NB_SPACE = 0xA0;
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index ec3fd196d60a..ea54168b379f 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -545,8 +545,7 @@ bool SwTextFrame::PaintEmpty( const SwRect &rRect, bool bCheck ) const
                 // Don't show the paragraph mark for collapsed paragraphs, when they are hidden
                 if ( EmptyHeight( ) > 1 )
                 {
-                    const OUString aTmp( CH_PAR );
-                    SwDrawTextInfo aDrawInf( pSh, *pSh->GetOut(), aTmp, 0, 1 );
+                    SwDrawTextInfo aDrawInf( pSh, *pSh->GetOut(), CH_PAR, 0, 1 );
                     aDrawInf.SetPos( aPos );
                     aDrawInf.SetSpace( 0 );
                     aDrawInf.SetKanaComp( 0 );
diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index 1fadbf708d12..e8b3b8ccda02 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -1357,8 +1357,7 @@ sal_uInt16 SwTextFrame::GetScalingOfSelectedText(
         else if ( cChar == CH_TAB )
         {
             // tab receives width of one space
-            OUString sTmp( CH_BLANK );
-            SwDrawTextInfo aDrawInf(pSh, *pOut, sTmp, 0, 1);
+            SwDrawTextInfo aDrawInf(pSh, *pOut, OUStringChar(CH_BLANK), 0, 1);
             nProWidth += aIter.GetFnt()->GetTextSize_( aDrawInf ).Width();
             nIdx++;
         }
diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx
index 69183bc58557..1e2d24cfe8ec 100644
--- a/sw/source/core/text/porrst.cxx
+++ b/sw/source/core/text/porrst.cxx
@@ -64,7 +64,7 @@ void SwTmpEndPortion::Paint( const SwTextPaintInfo &rInf ) const
         const_cast<SwTextPaintInfo&>(rInf).SetFont(&aFont);
 
         // draw the pilcrow
-        rInf.DrawText(OUString(CH_PAR), *this);
+        rInf.DrawText(CH_PAR, *this);
 
         const_cast<SwTextPaintInfo&>(rInf).SetFont(const_cast<SwFont*>(pOldFnt));
     }
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index 84bbee847d72..59a180ca0d98 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -778,8 +778,7 @@ void SwHolePortion::Paint( const SwTextPaintInfo &rInf ) const
         pFontSave.reset(new SwFontSave( rInf, pHoleFont.get() ));
     }
 
-    const OUString aText( ' ' );
-    rInf.DrawText(aText, *this, TextFrameIndex(0), TextFrameIndex(1));
+    rInf.DrawText(" ", *this, TextFrameIndex(0), TextFrameIndex(1));
 
     pFontSave.reset();
     pHoleFont.reset();
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 7ac757c6ec92..b5ef42e92bae 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -4999,8 +4999,7 @@ void SwHTMLParser::InsertSpacer()
             else
             {
                 NewAttr(m_xAttrTab, &m_xAttrTab->pKerning, SvxKerningItem( static_cast<short>(nSize), RES_CHRATR_KERNING ));
-                OUString aTmp( ' ' );
-                m_xDoc->getIDocumentContentOperations().InsertString( *m_pPam, aTmp );
+                m_xDoc->getIDocumentContentOperations().InsertString( *m_pPam, " " );
                 EndAttr( m_xAttrTab->pKerning );
             }
         }
@@ -5194,8 +5193,7 @@ void SwHTMLParser::InsertLineBreak()
     if( !bCleared && !bBreakItem )
     {
         // If no CLEAR could or should be executed, a line break will be inserted
-        OUString sTmp( u'\x000a' );
-        m_xDoc->getIDocumentContentOperations().InsertString( *m_pPam, sTmp );
+        m_xDoc->getIDocumentContentOperations().InsertString( *m_pPam, "\x0A" );
     }
     else if( m_pPam->GetPoint()->nContent.GetIndex() )
     {


More information about the Libreoffice-commits mailing list