[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source

Tomaž Vajngerl tomaz.vajngerl at collabora.com
Wed Oct 14 02:30:14 PDT 2015


 sw/source/core/text/portxt.cxx |   53 +----------------------------------------
 1 file changed, 2 insertions(+), 51 deletions(-)

New commits:
commit 9c9e9e153792081a5c91516b96b3bad54c929ddc
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Mon Oct 12 23:28:53 2015 +0200

    tdf#77014 fix input field breaking of words at new line
    
    SwTextInputFieldPortion::Format has previously tried to erase the
    input field special chars, which caused the words not breaking as
    expected or in the same way as normal text. It appears that it is
    actually not necessary to do this at all so just calling the super
    class method SwTextPortion::Format does the job and fixes the
    problem. After testing I could not find anything that is obviously
    wrong.
    
    Change-Id: Ie763f55ad55863dd224425dc481b7100deb639fa
    (cherry picked from commit 5e1714fd7fcb45fa5f1220d892dba597da40b500)
    Reviewed-on: https://gerrit.libreoffice.org/19349
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index 5220493..b66ee15 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -655,58 +655,9 @@ SwTextInputFieldPortion::SwTextInputFieldPortion()
     SetWhichPor( POR_INPUTFLD );
 }
 
-bool SwTextInputFieldPortion::Format( SwTextFormatInfo &rInf )
+bool SwTextInputFieldPortion::Format(SwTextFormatInfo &rTextFormatInfo)
 {
-    mbContainsInputFieldStart =
-        rInf.GetChar( rInf.GetIdx() ) == CH_TXT_ATR_INPUTFIELDSTART;
-    mbContainsInputFieldEnd =
-        rInf.GetChar( rInf.GetIdx() + rInf.GetLen() - 1 ) == CH_TXT_ATR_INPUTFIELDEND;
-
-    bool bRet = false;
-    if ( rInf.GetLen() == 1
-         && ( mbContainsInputFieldStart || mbContainsInputFieldEnd ) )
-    {
-        Width( 0 );
-    }
-    else
-    {
-        SwTextSlot aFormatText( &rInf, this, true, true );
-        if ( rInf.GetLen() == 0 )
-        {
-            Width( 0 );
-        }
-        else
-        {
-            const sal_Int32 nFormerLineStart = rInf.GetLineStart();
-            if ( !mbContainsInputFieldStart )
-            {
-                rInf.SetLineStart( 0 );
-            }
-
-            bRet = SwTextPortion::Format( rInf );
-
-            if ( mbContainsInputFieldEnd )
-            {
-                // adjust portion length accordingly, if complete text fits into the portion
-                if ( GetLen() == rInf.GetLen() )
-                {
-                    SetLen( GetLen() + 1 );
-                }
-            }
-
-            if ( mbContainsInputFieldStart )
-            {
-                // adjust portion length accordingly
-                SetLen( GetLen() + 1 );
-            }
-            else
-            {
-                rInf.SetLineStart( nFormerLineStart );
-            }
-        }
-    }
-
-    return bRet;
+    return SwTextPortion::Format(rTextFormatInfo);
 }
 
 void SwTextInputFieldPortion::Paint( const SwTextPaintInfo &rInf ) const


More information about the Libreoffice-commits mailing list