diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2015-10-12 23:28:53 +0200 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2015-10-14 22:07:36 +0000 |
commit | 6335a0b1c12c68b5feab2aee108bd353cfe1e8bc (patch) | |
tree | 2e280b9cf6f291ee34a2e34caf3c9c97a4359a38 | |
parent | 7750ea00a88aa6c7acd0a99c9596f16910ab13ba (diff) |
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.
(cherry picked from commit 5e1714fd7fcb45fa5f1220d892dba597da40b500)
Change-Id: Ie763f55ad55863dd224425dc481b7100deb639fa
Reviewed-on: https://gerrit.libreoffice.org/19357
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
-rw-r--r-- | sw/source/core/text/portxt.cxx | 51 |
1 files changed, 1 insertions, 50 deletions
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx index 4f17702621f9..3b512eedcce8 100644 --- a/sw/source/core/text/portxt.cxx +++ b/sw/source/core/text/portxt.cxx @@ -656,56 +656,7 @@ SwTxtInputFldPortion::SwTxtInputFldPortion() bool SwTxtInputFldPortion::Format( SwTxtFormatInfo &rInf ) { - 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 - { - SwTxtSlot aFormatTxt( &rInf, this, true, true ); - if ( rInf.GetLen() == 0 ) - { - Width( 0 ); - } - else - { - const sal_Int32 nFormerLineStart = rInf.GetLineStart(); - if ( !mbContainsInputFieldStart ) - { - rInf.SetLineStart( 0 ); - } - - bRet = SwTxtPortion::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 SwTxtPortion::Format(rInf); } void SwTxtInputFldPortion::Paint( const SwTxtPaintInfo &rInf ) const |