diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-09-28 12:31:24 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-09-28 12:32:28 +0200 |
commit | ef16c7411a2d79abab9cd3075580db783ee065ac (patch) | |
tree | 9ad0566414a9b5d21a61ea4d0dbc5514fa2ec5d6 /writerfilter | |
parent | 2348f05b31f5fc6f4e60b128e9133c76e6df8ae3 (diff) |
Use constants for ST_TextDirection values
Change-Id: I2c6576f8142a8fe3808a156f2047fe425f769cd9
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 9 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 2 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapperTableManager.cxx | 10 | ||||
-rw-r--r-- | writerfilter/source/ooxml/model.xml | 10 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 10 |
5 files changed, 20 insertions, 21 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 5330076352fc..fd8f25a0670c 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -1683,13 +1683,12 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext ) sal_Int16 nDirection = text::WritingMode_LR_TB; switch( nIntValue ) { - case 0: - case 4: + case NS_ooxml::LN_Value_ST_TextDirection_lrTb: + case NS_ooxml::LN_Value_ST_TextDirection_lrTbV: nDirection = text::WritingMode_LR_TB; break; - case 1: - case 2: - case 3: + case NS_ooxml::LN_Value_ST_TextDirection_tbRl: + case NS_ooxml::LN_Value_ST_TextDirection_btLr: nDirection = text::WritingMode_TB_RL; break; default:; diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 6e20825d0716..7d2e4f3920ea 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -753,7 +753,7 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl const boost::optional<PropertyMap::Property> aCellDirectionVal = (*aCellIterator)->getProperty(PROP_CELL_DIRECTION); if (aCellDirectionVal) { - if (aCellDirectionVal->second.get<sal_Int32>() == 3) + if (aCellDirectionVal->second.get<sal_Int32>() == NS_ooxml::LN_Value_ST_TextDirection_btLr) { // btLr, so map ParagraphAdjust_CENTER to VertOrientation::CENTER. uno::Reference<beans::XPropertySet> xPropertySet((*m_pTableSeq)[nRow][nCell][0], uno::UNO_QUERY); diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx index 69592d479d7e..0efd6cdeacee 100644 --- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx @@ -378,13 +378,13 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm) bool bInsertCellProps = true; switch ( nIntValue ) { - case 1: // tbRl + case NS_ooxml::LN_Value_ST_TextDirection_tbRl: // Binary filter takes BiDirection into account ( but I have no idea about that here ) // or even what it is. But... here's where to handle it if it becomes an issue pPropMap->Insert( PROP_FRM_DIRECTION, uno::makeAny( text::WritingMode2::TB_RL )); SAL_INFO( "writerfilter", "Have inserted textDirection " << nIntValue ); break; - case 3: // btLr + case NS_ooxml::LN_Value_ST_TextDirection_btLr: { // We have to fake this text direction pPropMap->Insert( PROP_FRM_DIRECTION, uno::makeAny( text::WritingMode2::LR_TB )); @@ -400,13 +400,13 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm) m_bHasBtlrCell = true; } break; - case 4: // lrTbV + case NS_ooxml::LN_Value_ST_TextDirection_lrTbV: pPropMap->Insert( PROP_FRM_DIRECTION, uno::makeAny( text::WritingMode2::LR_TB )); break; - case 5: // tbRlV + case NS_ooxml::LN_Value_ST_TextDirection_tbRlV: pPropMap->Insert( PROP_FRM_DIRECTION, uno::makeAny( text::WritingMode2::TB_RL )); break; - case 0: // lrTb + case NS_ooxml::LN_Value_ST_TextDirection_lrTb: case NS_ooxml::LN_Value_ST_TextDirection_tbLrV: default: // Ignore - we can't handle these diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml index 1bb6cc1396bb..56b345c11722 100644 --- a/writerfilter/source/ooxml/model.xml +++ b/writerfilter/source/ooxml/model.xml @@ -17243,11 +17243,11 @@ <attribute name="val" tokenid="ooxml:CT_Kinsoku_val"/> </resource> <resource name="ST_TextDirection" resource="List"> - <value tokenid="0">lrTb</value> - <value tokenid="1">tbRl</value> - <value tokenid="3">btLr</value> - <value tokenid="4">lrTbV</value> - <value tokenid="5">tbRlV</value> + <value tokenid="ooxml:Value_ST_TextDirection_lrTb">lrTb</value> + <value tokenid="ooxml:Value_ST_TextDirection_tbRl">tbRl</value> + <value tokenid="ooxml:Value_ST_TextDirection_btLr">btLr</value> + <value tokenid="ooxml:Value_ST_TextDirection_lrTbV">lrTbV</value> + <value tokenid="ooxml:Value_ST_TextDirection_tbRlV">tbRlV</value> <value tokenid="ooxml:Value_ST_TextDirection_tbLrV">tbLrV</value> </resource> <resource name="CT_TextDirection" resource="Value"> diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 78c2d712a0b3..1d1d48354bd8 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -2768,19 +2768,19 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) switch (nKeyword) { case RTF_CLTXLRTB: - nParam = 0; + nParam = NS_ooxml::LN_Value_ST_TextDirection_lrTb; break; case RTF_CLTXTBRL: - nParam = 1; + nParam = NS_ooxml::LN_Value_ST_TextDirection_tbRl; break; case RTF_CLTXBTLR: - nParam = 3; + nParam = NS_ooxml::LN_Value_ST_TextDirection_btLr; break; case RTF_CLTXLRTBV: - nParam = 4; + nParam = NS_ooxml::LN_Value_ST_TextDirection_lrTbV; break; case RTF_CLTXTBRLV: - nParam = 5; + nParam = NS_ooxml::LN_Value_ST_TextDirection_tbRlV; break; default: break; |