summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-10-10 08:41:24 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-10-10 08:41:35 +0200
commit999fb810673f7c1b490cdac1f29c2e931e8e7f2e (patch)
treea4646b3600cd3f870e0bc1936f10c9fc0a2c4b27 /writerfilter
parent0c06f9c5bb002c0aac1811ea973787f6f94d4758 (diff)
Use constants for ST_StyleType values
Change-Id: I57ca4ef567126321ab745c8d1d7290b66df23c05
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/StyleSheetTable.cxx8
-rw-r--r--writerfilter/source/ooxml/model.xml8
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx9
3 files changed, 13 insertions, 12 deletions
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 6fee9e2008bd..a8a8a8ddb57c 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -422,16 +422,16 @@ void StyleSheetTable::lcl_attribute(Id Name, Value & val)
StyleType nType(STYLE_TYPE_UNKNOWN);
switch (nIntValue)
{
- case 1:
+ case NS_ooxml::LN_Value_ST_StyleType_paragraph:
nType = STYLE_TYPE_PARA;
break;
- case 2:
+ case NS_ooxml::LN_Value_ST_StyleType_character:
nType = STYLE_TYPE_CHAR;
break;
- case 3:
+ case NS_ooxml::LN_Value_ST_StyleType_table:
nType = STYLE_TYPE_TABLE;
break;
- case 4:
+ case NS_ooxml::LN_Value_ST_StyleType_numbering:
nType = STYLE_TYPE_LIST;
break;
default:
diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml
index 0f40a4ea3b68..447658f18e3d 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -18757,10 +18757,10 @@
<attribute name="type" tokenid="ooxml:CT_TblStyleOverrideType"/>
</resource>
<resource name="ST_StyleType" resource="List">
- <value tokenid="1">paragraph</value>
- <value tokenid="2">character</value>
- <value tokenid="3">table</value>
- <value tokenid="4">numbering</value>
+ <value tokenid="ooxml:Value_ST_StyleType_paragraph">paragraph</value>
+ <value tokenid="ooxml:Value_ST_StyleType_character">character</value>
+ <value tokenid="ooxml:Value_ST_StyleType_table">table</value>
+ <value tokenid="ooxml:Value_ST_StyleType_numbering">numbering</value>
</resource>
<resource name="CT_Style" resource="Properties">
<element name="name" tokenid="ooxml:CT_Style_name"/>
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index df8ade0c5cd1..2fbf983bdbb2 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -3720,7 +3720,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
if (m_aStates.top().nDestinationState == DESTINATION_STYLESHEET || m_aStates.top().nDestinationState == DESTINATION_STYLEENTRY)
{
m_nCurrentStyleIndex = nParam;
- RTFValue::Pointer_t pValue(new RTFValue(1));
+ RTFValue::Pointer_t pValue(new RTFValue(NS_ooxml::LN_Value_ST_StyleType_paragraph));
m_aStates.top().aTableAttributes.set(NS_ooxml::LN_CT_Style_type, pValue); // paragraph style
}
else
@@ -3736,7 +3736,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
if (m_aStates.top().nDestinationState == DESTINATION_STYLESHEET || m_aStates.top().nDestinationState == DESTINATION_STYLEENTRY)
{
m_nCurrentStyleIndex = nParam;
- RTFValue::Pointer_t pValue(new RTFValue(2));
+ RTFValue::Pointer_t pValue(new RTFValue(NS_ooxml::LN_Value_ST_StyleType_character));
m_aStates.top().aTableAttributes.set(NS_ooxml::LN_CT_Style_type, pValue); // character style
}
else
@@ -3758,7 +3758,8 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
if (m_aStates.top().nDestinationState == DESTINATION_STYLESHEET || m_aStates.top().nDestinationState == DESTINATION_STYLEENTRY)
{
m_nCurrentStyleIndex = nParam;
- RTFValue::Pointer_t pValue(new RTFValue(0)); // FIXME the correct value would be 3 but maybe table styles mess things up in dmapper, be cautious and disable them for now
+ // FIXME the correct value would be NS_ooxml::LN_Value_ST_StyleType_table but maybe table styles mess things up in dmapper, be cautious and disable them for now
+ RTFValue::Pointer_t pValue(new RTFValue(0));
m_aStates.top().aTableAttributes.set(NS_ooxml::LN_CT_Style_type, pValue); // table style
}
break;
@@ -4837,7 +4838,7 @@ int RTFDocumentImpl::pushState()
// the *default* is \s0 i.e. paragraph style default
// this will be overwritten by \sN \csN \dsN \tsN
m_nCurrentStyleIndex = 0;
- RTFValue::Pointer_t pValue(new RTFValue(1));
+ RTFValue::Pointer_t pValue(new RTFValue(NS_ooxml::LN_Value_ST_StyleType_paragraph));
m_aStates.top().aTableAttributes.set(NS_ooxml::LN_CT_Style_type, pValue);
}
break;