summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-01-05 12:52:42 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-01-05 13:04:35 +0100
commite1afe4318787425dc40f2d0b1f02fa17e925c8da (patch)
tree3daa72ba07dc4cb274632be3a43cb36588923b06 /writerfilter
parent16adb05eb347fc17e80883e2930432857c945fbb (diff)
RTF import: handle RTF_FTNSEP and RTF_CHFTNSEP
Commit 330b860205c7ba69dd6603f65324d0f89ad9cd5f (fdo#68787 DOCX import: handle when w:separator is missing for footnotes, 2013-09-04) disabled footnote separator by default in dmapper, as the OOXML tokenizer always provided a uFtnEdnSep in case a separator was wanted. Let the RTF tokenizer do the same, this way we're in sync with Word again: if RTF_CHFTNSEP is in RTF_FTNSEP, then we show the separator, otherwise we don't. Change-Id: I74b46c5d71227682e093695336dc9eb6fde22121
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx18
-rw-r--r--writerfilter/source/rtftok/rtflistener.hxx1
2 files changed, 18 insertions, 1 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index b8506c562875..30702f6686b6 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1739,6 +1739,10 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
m_aStates.top().bInShapeGroup = true;
}
break;
+ case RTF_FTNSEP:
+ m_aStates.top().nDestinationState = DESTINATION_FOOTNOTESEPARATOR;
+ m_aStates.top().aCharacterAttributes.set(NS_ooxml::LN_CT_FtnEdn_type, RTFValue::Pointer_t(new RTFValue(NS_ooxml::LN_Value_wordprocessingml_ST_FtnEdn_separator)));
+ break;
default:
SAL_INFO("writerfilter", "TODO handle destination '" << lcl_RtfToString(nKeyword) << "'");
// Make sure we skip destinations (even without \*) till we don't handle them
@@ -1806,7 +1810,13 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
runProps();
if (!m_aStates.top().pCurrentBuffer)
{
- parBreak();
+ if (m_aStates.top().nDestinationState == DESTINATION_FOOTNOTESEPARATOR)
+ {
+ static const sal_Unicode uCR = 0xd;
+ Mapper().utext((const sal_uInt8*)&uCR, 1);
+ }
+ else
+ parBreak();
// Not in table? Reset max width.
m_nCellxMax = 0;
}
@@ -2020,6 +2030,12 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
singleChar(0x15);
}
break;
+ case RTF_CHFTNSEP:
+ {
+ static const sal_Unicode uFtnEdnSep = 0x3;
+ Mapper().utext((const sal_uInt8*)&uFtnEdnSep, 1);
+ }
+ break;
default:
{
SAL_INFO("writerfilter", "TODO handle symbol '" << lcl_RtfToString(nKeyword) << "'");
diff --git a/writerfilter/source/rtftok/rtflistener.hxx b/writerfilter/source/rtftok/rtflistener.hxx
index 616da4b38d2f..0e07187106d9 100644
--- a/writerfilter/source/rtftok/rtflistener.hxx
+++ b/writerfilter/source/rtftok/rtflistener.hxx
@@ -150,6 +150,7 @@ namespace writerfilter {
DESTINATION_LFOLEVEL,
DESTINATION_BACKGROUND,
DESTINATION_SHAPEGROUP,
+ DESTINATION_FOOTNOTESEPARATOR,
};
enum RTFErrors