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.mehrbrodt@allotropia.de>
Tested-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index 01bcc1c..f8e3d07 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;
    }
}