sw/source/core/doc/docfld.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 016f3aea1e1a3731f925a3f8e7e5a92fff3ef28d
Author:     Andreas Heinisch <andreas.heini...@yahoo.de>
AuthorDate: Wed Sep 13 13:50:08 2023 +0200
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
CommitDate: Thu Sep 14 08:21:25 2023 +0200

    tdf#106663 - Fields: use the starting position of the frame
    
    instead of the length of the text in the frame. Otherwise,
    the searching position is after the first field,
    e.g., "Heading x1", where x1 is the field and the postion
    of the index would be at the end of the paragraph.
    
    Change-Id: Ifb48bfea09e29c6263f4f81190643a88b0f57aa1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156894
    Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
    Tested-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>

diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index 01bcc1cd8483..f8e3d079a960 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -213,7 +213,8 @@ void SetGetExpField::SetBodyPos( const SwContentFrame& 
rFrame )
         bool const bResult = ::GetBodyTextNode( rDoc, aPos, rFrame );
         OSL_ENSURE(bResult, "Where is the field?");
         m_nNode = aPos.GetNodeIndex();
-        m_nContent = aPos.GetContentIndex();
+        // tdf#106663 - use the starting position of the frame
+        m_nContent = 0;
     }
 }
 

Reply via email to