sw/inc/ToxLinkProcessor.hxx          |    7 +++++--
 sw/qa/core/test_ToxLinkProcessor.cxx |    2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit ca512d0323c261d90559ddf6df561300cb048173
Author: Michael Stahl <[email protected]>
Date:   Wed Jan 25 16:42:16 2017 +0100

    sw: stop swapping start and end position of links in ToX
    
    This causes:
    
    sw/source/core/txtnode/thints.cxx:3198: +SwpHints::Insert: invalid hint, 
end < start
    
    Change-Id: I933c790127ab1469bb57c4d288dbb49be16ace19
    (cherry picked from commit 4a43ffcef946067c5b3992a00c765a36804a194f)
    Reviewed-on: https://gerrit.libreoffice.org/33549
    Tested-by: Jenkins <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Caolán McNamara <[email protected]>

diff --git a/sw/inc/ToxLinkProcessor.hxx b/sw/inc/ToxLinkProcessor.hxx
index 699c0ec..7fceef1 100644
--- a/sw/inc/ToxLinkProcessor.hxx
+++ b/sw/inc/ToxLinkProcessor.hxx
@@ -69,8 +69,11 @@ private:
      * A link is closed if it has both a start and an end token.
      */
     struct ClosedLink {
-        ClosedLink(const OUString& url, sal_Int32 startPosition, sal_Int32 
endPosition) :
-                mINetFormat(url, OUString()), mStartTextPos(endPosition), 
mEndTextPos(startPosition) {
+        ClosedLink(const OUString& url, sal_Int32 startPosition, sal_Int32 
endPosition)
+            : mINetFormat(url, OUString())
+            , mStartTextPos(startPosition)
+            , mEndTextPos(endPosition)
+        {
         }
         SwFormatINetFormat mINetFormat;
         sal_Int32 mStartTextPos;
diff --git a/sw/qa/core/test_ToxLinkProcessor.cxx 
b/sw/qa/core/test_ToxLinkProcessor.cxx
index 0a15982..eb4618e 100644
--- a/sw/qa/core/test_ToxLinkProcessor.cxx
+++ b/sw/qa/core/test_ToxLinkProcessor.cxx
@@ -82,7 +82,7 @@ 
ToxLinkProcessorTest::StandardOpenLinkIsAddedWhenMoreLinksThanAvaiableAreClosed(
     sut.CloseLink(1, URL_1);
     sut.CloseLink(1, URL_1);
     CPPUNIT_ASSERT_EQUAL(2u, static_cast<unsigned>(sut.m_ClosedLinks.size()));
-    CPPUNIT_ASSERT_EQUAL(0u, 
static_cast<unsigned>(sut.m_ClosedLinks.at(1)->mEndTextPos));
+    CPPUNIT_ASSERT_EQUAL(1u, 
static_cast<unsigned>(sut.m_ClosedLinks.at(1)->mEndTextPos));
 }
 
 void
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to