[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
Mark Hung (via logerrit)
logerrit at kemper.freedesktop.org
Mon Oct 26 18:30:24 UTC 2020
sw/source/core/text/portxt.cxx | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
New commits:
commit b8dd7d02a072c80961838b00c9e8cbdbddc9ce08
Author: Mark Hung <marklh9 at gmail.com>
AuthorDate: Fri Oct 2 11:24:31 2020 +0800
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Mon Oct 26 19:29:49 2020 +0100
tdf#130314 space counting for input field.
1. Input field should be counted like other fields,
with its content expanded with GetExpText().
2. Use only GetLen() instead of rInf.GetLen() in
SwTextInputFieldPortion::GetExpText() because
when justifying the text, rInf.GetLen() isn't
always updated corresponding to rInf.GetIdx().
( Check SwTextAdjuster::CalcNewBlock() for ref.)
Change-Id: I6a41275295607887c476fdd3f8e5a90c936c9d31
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103782
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9 at gmail.com>
Signed-off-by: Xisco Fauli <xiscofauli at libreoffice.org>
This commit also contains the following commit:
tdf#130314 fix incorrect logic in last commit
Previous commit ( ac76f9e8ad8b ) contains a logical
mistake. Change && to || there.
Change-Id: Id982ce6f22b0022316b564029f813da9072b71e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104089
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9 at gmail.com>
Signed-off-by: Xisco Fauli <xiscofauli at libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104806
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index 84bbee847d72..65d6a58f3dc2 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -583,7 +583,7 @@ TextFrameIndex SwTextPortion::GetSpaceCnt(const SwTextSizeInfo &rInf,
return TextFrameIndex(0);
}
- if ( InExpGrp() )
+ if ( InExpGrp() || PortionType::InputField == GetWhichPor() )
{
if( !IsBlankPortion() && !InNumberGrp() && !IsCombinedPortion() )
{
@@ -620,7 +620,7 @@ long SwTextPortion::CalcSpacing( long nSpaceAdd, const SwTextSizeInfo &rInf ) co
return 0;
}
- if ( InExpGrp() )
+ if ( InExpGrp() || PortionType::InputField == GetWhichPor() )
{
if( !IsBlankPortion() && !InNumberGrp() && !IsCombinedPortion() )
{
@@ -717,13 +717,13 @@ void SwTextInputFieldPortion::Paint( const SwTextPaintInfo &rInf ) const
bool SwTextInputFieldPortion::GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const
{
sal_Int32 nIdx(rInf.GetIdx());
- sal_Int32 nLen(rInf.GetLen());
+ sal_Int32 nLen(GetLen());
if ( rInf.GetChar( rInf.GetIdx() ) == CH_TXT_ATR_INPUTFIELDSTART )
{
++nIdx;
--nLen;
}
- if (rInf.GetChar(rInf.GetIdx() + rInf.GetLen() - TextFrameIndex(1)) == CH_TXT_ATR_INPUTFIELDEND)
+ if (rInf.GetChar(rInf.GetIdx() + GetLen() - TextFrameIndex(1)) == CH_TXT_ATR_INPUTFIELDEND)
{
--nLen;
}
More information about the Libreoffice-commits
mailing list