Kaydet (Commit) 75c5679a authored tarafından Michael Stahl's avatar Michael Stahl

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 e1afe431)

Change-Id: I32d9b01a0a9248ba646654295a74953a6cb74fb3
üst 82e17dbb
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
{\operator {\uc1 \u106 ?}{\uc1 \u97 ?}{\uc1 \u121 ?}} {\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 {\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 ?} {\uc1 \u21414 ?}{\uc1 \u38376 ?}{\uc1 \u38056 ?}{\uc1 \u19994 ?}{\uc1 \u32929 ?}{\uc1 \u20221 ?}{\uc1 \u26377 ?}{\uc1 \u38480 ?}{\uc1 \u20844 ?}{\uc1 \u21496 ?}
......
...@@ -1337,12 +1337,14 @@ DECLARE_RTFIMPORT_TEST(testFdo77996, "fdo77996.rtf") ...@@ -1337,12 +1337,14 @@ DECLARE_RTFIMPORT_TEST(testFdo77996, "fdo77996.rtf")
uno::Reference<document::XDocumentPropertiesSupplier> xDocumentPropertiesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<document::XDocumentPropertiesSupplier> xDocumentPropertiesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<document::XDocumentProperties> xProps(xDocumentPropertiesSupplier->getDocumentProperties()); uno::Reference<document::XDocumentProperties> xProps(xDocumentPropertiesSupplier->getDocumentProperties());
CPPUNIT_ASSERT_EQUAL(OUString("Aln Lin (Bei Jing)"), xProps->getAuthor()); CPPUNIT_ASSERT_EQUAL(OUString("Aln Lin (Bei Jing)"), xProps->getAuthor());
CPPUNIT_ASSERT_EQUAL( 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,
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);
RTL_TEXTENCODING_UTF8), CPPUNIT_ASSERT_EQUAL(aTitle, xProps->getTitle());
xProps->getTitle());
uno::Reference<beans::XPropertySet> xUDProps(xProps->getUserDefinedProperties(), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xUDProps(xProps->getUserDefinedProperties(), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(OUString("jay"), getProperty<OUString>(xUDProps, "Operator")); 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") DECLARE_RTFIMPORT_TEST(testFdo47802, "fdo47802.rtf")
......
...@@ -2040,6 +2040,8 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) ...@@ -2040,6 +2040,8 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
break; break;
case RTF_PAR: case RTF_PAR:
{ {
if (m_aStates.top().nDestinationState == DESTINATION_FOOTNOTESEPARATOR)
break; // just ignore it - only thing we read in here is CHFTNSEP
checkFirstRun(); checkFirstRun();
bool bNeedPap = m_bNeedPap; bool bNeedPap = m_bNeedPap;
checkNeedPap(); checkNeedPap();
...@@ -2047,13 +2049,7 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) ...@@ -2047,13 +2049,7 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
runProps(); runProps();
if (!m_aStates.top().pCurrentBuffer) if (!m_aStates.top().pCurrentBuffer)
{ {
if (m_aStates.top().nDestinationState == DESTINATION_FOOTNOTESEPARATOR) parBreak();
{
static const sal_Unicode uCR = 0xd;
Mapper().utext((const sal_uInt8*)&uCR, 1);
}
else
parBreak();
// Not in table? Reset max width. // Not in table? Reset max width.
m_nCellxMax = 0; m_nCellxMax = 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment