summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-04-05 18:37:53 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-04-05 18:42:55 +0200
commitce1cbedd471206b71a8f98f5ff63ce46e685dd5f (patch)
treeb116b67fe16634e84e1ddf193416ff280662e049 /writerfilter
parent1d633d54bde1c1ae74ae51fcf02d3eced160c1e3 (diff)
import RTF_LISTPICTURE and RTF_LEVELPICTURE
Change-Id: Iff8d07a53ddfc114eb4c3921273c007bb750be6b
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx31
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.hxx6
2 files changed, 34 insertions, 3 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index d10a5a0b7951..e4eda7312c19 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -289,7 +289,8 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x
m_bWasInFrame(false),
m_bHadPicture(false),
m_bHadSect(false),
- m_nCellxMax(0)
+ m_nCellxMax(0),
+ m_nListPictureId(0)
{
OSL_ASSERT(xInputStream.is());
m_pInStream.reset(utl::UcbStreamHelper::CreateStream(xInputStream, sal_True));
@@ -756,6 +757,14 @@ int RTFDocumentImpl::resolvePict(bool bInline)
if (xPropertySet.is())
xPropertySet->setPropertyValue("GraphicURL", uno::Any(aGraphicUrl));
+ if (m_aStates.top().bInListpicture)
+ {
+ // Send the shape directly, no section is started, to additional properties will be ignored anyway.
+ Mapper().startShape(xShape);
+ Mapper().endShape();
+ return 0;
+ }
+
// Send it to the dmapper.
RTFSprms aSprms;
RTFSprms aAttributes;
@@ -1261,6 +1270,10 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
case RTF_LISTTABLE:
m_aStates.top().nDestinationState = DESTINATION_LISTTABLE;
break;
+ case RTF_LISTPICTURE:
+ m_aStates.top().nDestinationState = DESTINATION_LISTPICTURE;
+ m_aStates.top().bInListpicture = true;
+ break;
case RTF_LIST:
m_aStates.top().nDestinationState = DESTINATION_LISTENTRY;
break;
@@ -2691,6 +2704,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
case RTF_LEVELJC: nSprm = NS_ooxml::LN_CT_Lvl_lvlJc; break;
case RTF_LEVELNFC: nSprm = NS_rtf::LN_NFC; break;
case RTF_LEVELSTARTAT: nSprm = NS_rtf::LN_ISTARTAT; break;
+ case RTF_LEVELPICTURE: nSprm = NS_ooxml::LN_CT_Lvl_lvlPicBulletId; break;
default: break;
}
if (nSprm > 0)
@@ -3873,7 +3887,7 @@ int RTFDocumentImpl::popState()
break;
case DESTINATION_PICPROP:
case DESTINATION_SHAPEINSTRUCTION:
- if (!m_bObject)
+ if (!m_bObject && !aState.bInListpicture)
m_pSdrImport->resolve(m_aStates.top().aShape);
break;
case DESTINATION_BOOKMARKSTART:
@@ -4557,6 +4571,16 @@ int RTFDocumentImpl::popState()
case DESTINATION_SHPPICT:
case DESTINATION_SHAPE:
m_aStates.top().aFrame = aState.aFrame;
+ if (aState.nDestinationState == DESTINATION_SHPPICT && m_aStates.size() && m_aStates.top().nDestinationState == DESTINATION_LISTPICTURE)
+ {
+ RTFSprms aAttributes;
+ aAttributes.set(NS_ooxml::LN_CT_NumPicBullet_numPicBulletId, RTFValue::Pointer_t(new RTFValue(m_nListPictureId++)));
+ RTFSprms aSprms;
+ // Dummy value, real picture is already sent to dmapper.
+ aSprms.set(NS_ooxml::LN_CT_NumPicBullet_pict, RTFValue::Pointer_t(new RTFValue(0)));
+ RTFValue::Pointer_t pValue(new RTFValue(aAttributes, aSprms));
+ m_aListTableSprms.set(NS_ooxml::LN_CT_Numbering_numPicBullet, pValue, false);
+ }
break;
case DESTINATION_TITLE:
{
@@ -4697,7 +4721,8 @@ RTFParserState::RTFParserState(RTFDocumentImpl *pDocumentImpl)
nMinute(0),
nCurrentStyleIndex(-1),
pCurrentBuffer(0),
- bHasTableStyle(false)
+ bHasTableStyle(false),
+ bInListpicture(false)
{
}
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index f8e016e8036c..6690680e44fb 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -71,6 +71,7 @@ namespace writerfilter {
DESTINATION_FIELDINSTRUCTION,
DESTINATION_FIELDRESULT,
DESTINATION_LISTTABLE,
+ DESTINATION_LISTPICTURE,
DESTINATION_LISTENTRY,
DESTINATION_LISTOVERRIDETABLE,
DESTINATION_LISTOVERRIDEENTRY,
@@ -414,6 +415,9 @@ namespace writerfilter {
/// If a table style was requested to be used.
bool bHasTableStyle;
+
+ /// If we're inside a \listpicture group.
+ bool bInListpicture;
};
class RTFTokenizer;
@@ -607,6 +611,8 @@ namespace writerfilter {
bool m_bHadSect;
/// Max width of the rows in the current table.
int m_nCellxMax;
+ /// ID of the next \listlevel picture.
+ int m_nListPictureId;
};
} // namespace rtftok
} // namespace writerfilter