diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-07-22 16:13:48 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-07-29 12:21:24 +0000 |
commit | dcc4c1a7d4968fa0dc2331e218861f4450ad5225 (patch) | |
tree | c702861ba1588eeca35136b7fc61e5f5ce95489d | |
parent | 033154d99a834024993b3faf3af9a6842dc907b8 (diff) |
fdo#80486 writerfilter: RTF import: ignore \par inside \ftnsep
Word can apparently have complex footnote separators, but the
domain-mapper only sets a single flag that there is a separator
(m_bHasFtnSep), so the only thing that makes sense for \par here
is to completely ignore it.
(regression from e1afe4318787425dc40f2d0b1f02fa17e925c8da)
Change-Id: I32d9b01a0a9248ba646654295a74953a6cb74fb3
(cherry picked from commit 75c5679a96437caa6041d2550562f2a4db80d586)
Reviewed-on: https://gerrit.libreoffice.org/10465
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r-- | sw/qa/extras/rtfimport/data/fdo77996.rtf | 1 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 10 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 10 |
3 files changed, 10 insertions, 11 deletions
diff --git a/sw/qa/extras/rtfimport/data/fdo77996.rtf b/sw/qa/extras/rtfimport/data/fdo77996.rtf index b5b4fdec7905..055d86008ebb 100644 --- a/sw/qa/extras/rtfimport/data/fdo77996.rtf +++ b/sw/qa/extras/rtfimport/data/fdo77996.rtf @@ -26,6 +26,7 @@ {\operator {\uc1 \u106 ?}{\uc1 \u97 ?}{\uc1 \u121 ?}} } +\fet2 {\*\ftnsep \pard \plain {\insrsid \chftnsep \par }}{\*\ftnsepc \pard \plain {\insrsid \chftnsepc \par }}{\*\aftnsep \pard \plain {\insrsid \chftnsep \par }}{\*\aftnsepc \pard \plain {\insrsid \chftnsepc \par }} {\loch \af11 \hich \af11 \dbch \f11 {\uc1 \u21414 ?}{\uc1 \u38376 ?}{\uc1 \u38056 ?}{\uc1 \u19994 ?}{\uc1 \u32929 ?}{\uc1 \u20221 ?}{\uc1 \u26377 ?}{\uc1 \u38480 ?}{\uc1 \u20844 ?}{\uc1 \u21496 ?} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 2a956dbe2487..7e5bd67e6a50 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -1281,12 +1281,14 @@ DECLARE_RTFIMPORT_TEST(testFdo77996, "fdo77996.rtf") uno::Reference<document::XDocumentPropertiesSupplier> xDocumentPropertiesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<document::XDocumentProperties> xProps(xDocumentPropertiesSupplier->getDocumentProperties()); CPPUNIT_ASSERT_EQUAL(OUString("Aln Lin (Bei Jing)"), xProps->getAuthor()); - CPPUNIT_ASSERT_EQUAL( - OUString("\xe5\x8e\xa6\xe9\x97\xa8\xe9\x92\xa8\xe4\xb8\x9a\xe8\x82\xa1\xe4\xbb\xbd\xe6\x9c\x89\xe9\x99\x90\xe5\x85\xac\xe5\x8f\xb8", 30, - RTL_TEXTENCODING_UTF8), - xProps->getTitle()); + OUString aTitle("\xe5\x8e\xa6\xe9\x97\xa8\xe9\x92\xa8\xe4\xb8\x9a\xe8\x82\xa1\xe4\xbb\xbd\xe6\x9c\x89\xe9\x99\x90\xe5\x85\xac\xe5\x8f\xb8", 30, + RTL_TEXTENCODING_UTF8); + CPPUNIT_ASSERT_EQUAL(aTitle, xProps->getTitle()); uno::Reference<beans::XPropertySet> xUDProps(xProps->getUserDefinedProperties(), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(OUString("jay"), getProperty<OUString>(xUDProps, "Operator")); + + // fdo#80486 also check that the ftnsep doesn't insert paragraph breaks + getParagraph(1, aTitle); } DECLARE_RTFIMPORT_TEST(testFdo47802, "fdo47802.rtf") diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 6ea5d1d4896f..68db15d778da 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -2049,6 +2049,8 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) break; case RTF_PAR: { + if (m_aStates.top().nDestinationState == DESTINATION_FOOTNOTESEPARATOR) + break; // just ignore it - only thing we read in here is CHFTNSEP checkFirstRun(); bool bNeedPap = m_bNeedPap; checkNeedPap(); @@ -2056,13 +2058,7 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) runProps(); if (!m_aStates.top().pCurrentBuffer) { - if (m_aStates.top().nDestinationState == DESTINATION_FOOTNOTESEPARATOR) - { - static const sal_Unicode uCR = 0xd; - Mapper().utext((const sal_uInt8*)&uCR, 1); - } - else - parBreak(); + parBreak(); // Not in table? Reset max width. m_nCellxMax = 0; } |