summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-10-26 12:53:05 +0100
committerMichael Stahl <mstahl@redhat.com>2014-11-04 12:33:56 +0000
commitdb8cc3a1c481bd1f97b2688ff85a00eec8b25926 (patch)
tree529e2c703f52cbc03d4425634c8e76b8dc88ac31 /writerfilter
parentbe7e9d72f4ca87476fbeda5bed48732244dc588b (diff)
fdo#82076 RTF import: handle footnote in table cell
(cherry picked from commit 956c3ff3d43e1b181f7c91518edee1c7c4dc2a0a) Change-Id: I69def7936c320e93db5d4504922d52346caaf9cf Reviewed-on: https://gerrit.libreoffice.org/12242 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx19
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.hxx3
2 files changed, 20 insertions, 2 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 9339c5111f57..145fd4a3d67f 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1452,6 +1452,14 @@ void RTFDocumentImpl::replayBuffer(RTFBuffer_t& rBuffer,
RTFSdrImport::SHAPE);
else if (boost::get<0>(aTuple) == BUFFER_ENDSHAPE)
m_pSdrImport->close();
+ else if (boost::get<0>(aTuple) == BUFFER_RESOLVESUBSTREAM)
+ {
+ RTFSprms& rAttributes = boost::get<1>(aTuple)->getAttributes();
+ sal_Size nPos = rAttributes.find(0)->getInt();
+ Id nId = rAttributes.find(1)->getInt();
+ OUString aCustomMark = rAttributes.find(2)->getString();
+ resolveSubstream(nPos, nId, aCustomMark);
+ }
else
assert(false);
}
@@ -1668,7 +1676,16 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
m_aStates.top().nDestinationState = DESTINATION_FOOTNOTE;
if (bCustomMark)
Mapper().startCharacterGroup();
- resolveSubstream(m_nGroupStartPos - 1, nId, aCustomMark);
+ if (!m_aStates.top().pCurrentBuffer)
+ resolveSubstream(m_nGroupStartPos - 1, nId, aCustomMark);
+ else
+ {
+ RTFSprms aAttributes;
+ aAttributes.set(Id(0), RTFValue::Pointer_t(new RTFValue(m_nGroupStartPos - 1)));
+ aAttributes.set(Id(1), RTFValue::Pointer_t(new RTFValue(nId)));
+ aAttributes.set(Id(2), RTFValue::Pointer_t(new RTFValue(aCustomMark)));
+ m_aStates.top().pCurrentBuffer->push_back(Buf_t(BUFFER_RESOLVESUBSTREAM, RTFValue::Pointer_t(new RTFValue(aAttributes))));
+ }
if (bCustomMark)
{
m_aStates.top().aCharacterAttributes.clear();
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index 98a5523c3152..3cc9c51383a6 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -55,7 +55,8 @@ enum RTFBufferTypes
BUFFER_ENDRUN,
BUFFER_PAR,
BUFFER_STARTSHAPE,
- BUFFER_ENDSHAPE
+ BUFFER_ENDSHAPE,
+ BUFFER_RESOLVESUBSTREAM
};
/// Form field types