diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-01-25 16:42:16 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-01-25 17:58:55 +0100 |
commit | 4a43ffcef946067c5b3992a00c765a36804a194f (patch) | |
tree | bec59dcdeaeb614d46c21184cb15bd000a622f02 /sw | |
parent | 700470577f62f569a5e81c7b446167f8d9c7b7cc (diff) |
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
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/ToxLinkProcessor.hxx | 7 | ||||
-rw-r--r-- | sw/qa/core/test_ToxLinkProcessor.cxx | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/sw/inc/ToxLinkProcessor.hxx b/sw/inc/ToxLinkProcessor.hxx index 699c0ec9887e..7fceef1050d5 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 0a15982362dd..eb4618e1e8c8 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 |