sw/source/filter/html/htmlgrin.cxx |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit b049163f0d3c418f3007a786d754b81a2973cdf0
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Mon Apr 28 13:16:50 2025 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Mon Apr 28 15:56:36 2025 +0200

    ofz#406054647 Clear invalid AnchorPos
    
    in the absence of a straight forward idea to avoid it in the first place
    
    Change-Id: I73cf48445de4150282b1b7f9f4c78ad3a8cf9caa
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184715
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sw/source/filter/html/htmlgrin.cxx 
b/sw/source/filter/html/htmlgrin.cxx
index ffaff0798dcf..23afb49dbac9 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -829,6 +829,16 @@ IMAGE_SETEVENT:
     if (eNodeType != SwNodeType::Text && eNodeType != SwNodeType::Table)
         return;
 
+    const SwFormatAnchor& rAnch = aFrameSet.Get(RES_ANCHOR);
+    if (SwNode* pAnchorNode = rAnch.GetAnchorNode())
+    {
+        if (pAnchorNode->IsEndNode())
+        {
+            SAL_WARN("sw.html", "Invalid EndNode Anchor");
+            aFrameSet.ClearItem(RES_ANCHOR);
+        }
+    }
+
     // passing empty sGrfNm here, means we don't want the graphic to be linked
     SwFrameFormat *const pFlyFormat =
         m_xDoc->getIDocumentContentOperations().InsertGraphic(

Reply via email to