summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-01-25 16:42:16 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-01-25 20:25:12 +0000
commitca512d0323c261d90559ddf6df561300cb048173 (patch)
tree07faab0ab9d17c8fee1f22221d1aef591cea4b85 /sw
parent24077d0551dc67914bc8f06889be3367fa1aaba6 (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 (cherry picked from commit 4a43ffcef946067c5b3992a00c765a36804a194f) Reviewed-on: https://gerrit.libreoffice.org/33549 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/ToxLinkProcessor.hxx7
-rw-r--r--sw/qa/core/test_ToxLinkProcessor.cxx2
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