[Libreoffice-commits] core.git: writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Sun Sep 28 03:32:58 PDT 2014
writerfilter/source/dmapper/DomainMapper.cxx | 9 ++++-----
writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 2 +-
writerfilter/source/dmapper/DomainMapperTableManager.cxx | 10 +++++-----
writerfilter/source/ooxml/model.xml | 10 +++++-----
writerfilter/source/rtftok/rtfdocumentimpl.cxx | 10 +++++-----
5 files changed, 20 insertions(+), 21 deletions(-)
New commits:
commit ef16c7411a2d79abab9cd3075580db783ee065ac
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sun Sep 28 12:31:24 2014 +0200
Use constants for ST_TextDirection values
Change-Id: I2c6576f8142a8fe3808a156f2047fe425f769cd9
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 5330076..fd8f25a 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 6e20825..7d2e4f3 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 69592d4..0efd6cd 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 1bb6cc1..56b345c 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 78c2d71..1d1d483 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;
More information about the Libreoffice-commits
mailing list