[Libreoffice-commits] core.git: sw/qa sw/source

Justin Luth (via logerrit) logerrit at kemper.freedesktop.org
Thu Aug 13 14:54:45 UTC 2020


 sw/qa/extras/ooxmlexport/ooxmlexport5.cxx |    2 +-
 sw/source/filter/ww8/wrtw8nds.cxx         |   15 +--------------
 2 files changed, 2 insertions(+), 15 deletions(-)

New commits:
commit 245470582c91e9ebb84e53a80afd86b7978e5650
Author:     Justin Luth <justin.luth at collabora.com>
AuthorDate: Sat Aug 8 14:35:06 2020 +0300
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu Aug 13 16:53:52 2020 +0200

    tdf#135329 sw MS export: remove effectively dead anchoring code
    
    commit dce1d0766c5013e35762ab85f263df312901f5f4
    Author: Caolán McNamara on Mon Oct 14 13:24:31 2002 +0000
        #i2916# integrate markm character anchoring export impl
    
    1.) if (nPos >= nStartPos && nPos <= nMinPos)
    2.)     nMinPos = nPos;
    
    3.) ++nPos;
    4.) if (nPos >= nStartPos && nPos <= nMinPos)
    5.)     nMinPos = nPos;
    
    So lines 3/4/5 should be dead code.
    With lines 1 and 2, MinPos has changed to be nPos,
    so if we increment nPos, by definition it will now be
    larger than itself (aka MinPos).
    
    There is ONLY one time when this could have been used,
    and that is if nPos == nStartPos - 1.
    However, in that case the fly WILL ALREADY BE HANDLED,
    because it is in the current run's position.
    So if the fly is already going to be handled,
    what good will treating the next character
    separately do?
    
    So the comment sounds really important, but in practice
    it seems as if it is not happening.
    Plus round-tripping already breaks everything anyway,
    so very unlikely to raise any substantial regressions.
    
    Change-Id: Ifa867ac3614aef82a3dde358ee3e5bd54d5a1142
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100386
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <justin_luth at sil.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index 53a88a7e8a8b..3a522bc84891 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -630,7 +630,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO79915, "fdo79915.docx")
 {
     xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
 
-    assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[10]/w:t", "How much buoyancy does the water provide?");
+    assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[9]/w:t", "How much buoyancy does the water provide?");
 }
 
 DECLARE_OOXMLEXPORT_TEST(testfdo79817, "fdo79817.docx")
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 82799abfd9c8..4dd1f15395bb 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -354,13 +354,7 @@ sal_Int32 SwWW8AttrIter::SearchNext( sal_Int32 nStartPos )
         IterToCurrent();
     }
 
-    /*
-     #i2916#
-     Check to see if there are any graphics anchored to characters in this
-     paragraph's text. Set nMinPos to 1 past the placement for anchored to
-     character because anchors in Word appear after the character they are
-     anchored to.
-    */
+    // #i2916# Check to see if there are any graphics anchored to characters in this paragraph's text.
     if (maFlyIter != maFlyFrames.end())
     {
         const SwPosition &rAnchor = maFlyIter->GetPosition();
@@ -368,13 +362,6 @@ sal_Int32 SwWW8AttrIter::SearchNext( sal_Int32 nStartPos )
         sal_Int32 nPos = rAnchor.nContent.GetIndex();
         if (nPos >= nStartPos && nPos <= nMinPos)
             nMinPos = nPos;
-
-        if (maFlyIter->GetFrameFormat().GetAnchor().GetAnchorId() == RndStdIds::FLY_AT_CHAR)
-        {
-            ++nPos;
-            if (nPos >= nStartPos && nPos <= nMinPos)
-                nMinPos = nPos;
-        }
     }
 
     //nMinPos found and not going to change at this point


More information about the Libreoffice-commits mailing list