diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-07-22 16:13:48 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-07-22 16:32:37 +0200 |
commit | 75c5679a96437caa6041d2550562f2a4db80d586 (patch) | |
tree | e715ba2bd367673171cd129c6398b701089784e1 | |
parent | 82e17dbb2a16c7653a163139f0eea51faa4d46b8 (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
-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 14a8728befa2..289cce893d96 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -1337,12 +1337,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 f25e51884891..95e41dc44a65 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -2040,6 +2040,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(); @@ -2047,13 +2049,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; } |