[Libreoffice-commits] core.git: writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Mon Aug 4 08:38:49 PDT 2014
writerfilter/source/dmapper/DomainMapper.cxx | 10 ++++
writerfilter/source/dmapper/DomainMapperTableManager.cxx | 26 ++++++++---
writerfilter/source/dmapper/DomainMapperTableManager.hxx | 1
writerfilter/source/ooxml/model.xml | 34 ++++++++++++++-
4 files changed, 63 insertions(+), 8 deletions(-)
New commits:
commit 65facd8c79ffb26e3a79c5139ece83dadfe65d9b
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Aug 4 17:36:54 2014 +0200
writerfilter: tokenize all attributes of CT_TblLook
Change-Id: I0dcaef56804a6998f83afe73d01eb0d5b21a210a
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index e719ef1..33b6a95d 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -179,6 +179,9 @@ DomainMapper::~DomainMapper()
void DomainMapper::lcl_attribute(Id nName, Value & val)
{
+ if (m_pImpl->getTableManager().attribute(nName, val))
+ return;
+
static OUString sLocalBookmarkName;
sal_Int32 nIntValue = val.getInt();
OUString sStringValue = val.getString();
@@ -2451,6 +2454,13 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext )
m_pImpl->m_pSdtHelper->getInteropGrabBagAndClear();
}
break;
+ case NS_ooxml::LN_CT_TblPrBase_tblLook:
+ {
+ writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
+ if (pProperties.get())
+ pProperties->resolve(*this);
+ }
+ break;
default:
{
#ifdef DEBUG_DOMAINMAPPER
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index e5a5b8b..d5a36a9 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -74,6 +74,25 @@ DomainMapperTableManager::~DomainMapperTableManager()
delete m_pTablePropsHandler, m_pTablePropsHandler = NULL;
}
+bool DomainMapperTableManager::attribute(Id nName, Value& rValue)
+{
+ bool bRet = true;
+
+ switch (nName)
+ {
+ case NS_ooxml::LN_CT_TblLook_val:
+ {
+ TablePropertyMapPtr pPropMap(new TablePropertyMap());
+ pPropMap->Insert(PROP_TBL_LOOK, uno::makeAny(rValue.getInt()));
+ insertTableProps(pPropMap);
+ }
+ break;
+ default:
+ bRet = false;
+ }
+
+ return bRet;
+}
bool DomainMapperTableManager::sprm(Sprm & rSprm)
{
@@ -318,13 +337,6 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
m_nGridSpan = nIntValue;
}
break;
- case NS_ooxml::LN_CT_TblPrBase_tblLook:
- {
- TablePropertyMapPtr pPropMap( new TablePropertyMap );
- pPropMap->Insert( PROP_TBL_LOOK, uno::makeAny( nIntValue ));
- insertTableProps(pPropMap);
- }
- break;
case NS_ooxml::LN_CT_TcPrBase_textDirection:
{
TablePropertyMapPtr pPropMap( new TablePropertyMap );
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.hxx b/writerfilter/source/dmapper/DomainMapperTableManager.hxx
index fea928b..24145bd 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.hxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.hxx
@@ -81,6 +81,7 @@ public:
inline void SetStyleProperties( PropertyMapPtr pProperties ) { m_pStyleProps = pProperties; };
virtual bool sprm(Sprm & rSprm) SAL_OVERRIDE;
+ bool attribute(Id nName, Value & val);
virtual void startLevel( ) SAL_OVERRIDE;
virtual void endLevel( ) SAL_OVERRIDE;
diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml
index b1613d1..0555ea9 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -18377,7 +18377,7 @@
</optional>
<optional>
<element name="tblLook">
- <ref name="CT_ShortHexNumber"/>
+ <ref name="CT_TblLook"/>
</element>
</optional>
</define>
@@ -18458,6 +18458,29 @@
<ref name="EG_ContentRowContent"/>
</zeroOrMore>
</define>
+ <define name="CT_TblLook">
+ <attribute name="firstRow">
+ <ref name="ST_OnOff"/>
+ </attribute>
+ <attribute name="lastRow">
+ <ref name="ST_OnOff"/>
+ </attribute>
+ <attribute name="firstColumn">
+ <ref name="ST_OnOff"/>
+ </attribute>
+ <attribute name="lastColumn">
+ <ref name="ST_OnOff"/>
+ </attribute>
+ <attribute name="noHBand">
+ <ref name="ST_OnOff"/>
+ </attribute>
+ <attribute name="noVBand">
+ <ref name="ST_OnOff"/>
+ </attribute>
+ <attribute name="val">
+ <ref name="ST_ShortHexNumber"/>
+ </attribute>
+ </define>
<define name="ST_FtnPos">
<choice>
<!-- Footnotes Positioned at Page Bottom -->
@@ -23171,6 +23194,15 @@
<action name="end" action="clearProps"/>
</resource>
<resource name="CT_Tbl" resource="TextTable"/>
+ <resource name="CT_TblLook" resource="Properties">
+ <attribute name="firstRow" tokenid="ooxml:CT_TblLook_firstRow"/>
+ <attribute name="lastRow" tokenid="ooxml:CT_TblLook_lastRow"/>
+ <attribute name="firstColumn" tokenid="ooxml:CT_TblLook_firstColumn"/>
+ <attribute name="lastColumn" tokenid="ooxml:CT_TblLook_lastColumn"/>
+ <attribute name="noHBand" tokenid="ooxml:CT_TblLook_noHBand"/>
+ <attribute name="noVBand" tokenid="ooxml:CT_TblLook_noVBand"/>
+ <attribute name="val" tokenid="ooxml:CT_TblLook_val"/>
+ </resource>
<resource name="ST_FtnPos" resource="List">
<value tokenid="ooxml:Value_ST_FtnPos_pageBottom">pageBottom</value>
<value tokenid="ooxml:Value_ST_FtnPos_beneathText">beneathText</value>
More information about the Libreoffice-commits
mailing list