diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-03-02 23:11:29 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-03-02 23:26:38 +0100 |
commit | 103efac8110be7e6f42fffcecc74abdcae4df7f9 (patch) | |
tree | d9834a8ff51f55c0fee3904235c45bbc24fa5bc2 /sw | |
parent | 06f9ad262742ea939bf23e82530b7166ca4ce456 (diff) |
tdf#101178 sw: DOCX export: fix crash
These conditions in DocxAttributeOutput::EndRun() are apparently not
mutually exclusive, so don't increment m_nFieldsInHyperlink twice.
Whether the m_nFieldsInHyperlink makes any sense considering there are
*2* hyperlinks then, i can't tell.
Change-Id: I5030f3303bd83633fcb044573860bc8ecaacae32
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/toxmarkhyperlink.fodt | 1 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 7 |
2 files changed, 3 insertions, 5 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/toxmarkhyperlink.fodt b/sw/qa/extras/ooxmlexport/data/toxmarkhyperlink.fodt index cbc8b59b75f8..b1323f6f41bc 100644 --- a/sw/qa/extras/ooxmlexport/data/toxmarkhyperlink.fodt +++ b/sw/qa/extras/ooxmlexport/data/toxmarkhyperlink.fodt @@ -42,6 +42,7 @@ <text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link"><text:alphabetical-index-mark text:string-value="foo" text:key1="bar"/><text:alphabetical-index-mark text:string-value="foo" text:key1="baz"/><text:alphabetical-index-mark text:string-value="foo" text:key1="quux"/>foo</text:a></text:p> <text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">foo<text:alphabetical-index-mark text:string-value="foo" text:key1="bar"/><text:alphabetical-index-mark text:string-value="foo" text:key1="baz"/><text:alphabetical-index-mark text:string-value="foo" text:key1="quux"/></text:a></text:p> <text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">foo</text:a><text:alphabetical-index-mark text:string-value="foo" text:key1="bar"/><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">bar</text:a></text:p> + <text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">foo</text:a><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link"><text:bibliography-mark text:identifier="fuh" text:bibliography-type="www" text:author="FB" text:title="foobar" text:url="http://example.com/">[fuh]</text:bibliography-mark></text:a></text:p> <!-- <text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">foo</text:a> diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 0212233e8ec8..6f7acdb976e6 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -1141,12 +1141,9 @@ void DocxAttributeOutput::EndRun() continue; } - if (m_startedHyperlink) - ++m_nFieldsInHyperlink; - - if ( m_pHyperlinkAttrList.is() ) + if (m_startedHyperlink || m_pHyperlinkAttrList.is()) { - m_nFieldsInHyperlink++; + ++m_nFieldsInHyperlink; } } ++pIt; |