[Libreoffice-commits] core.git: writerfilter/source

Miklos Vajna vmiklos at collabora.co.uk
Mon Sep 29 00:37:05 PDT 2014


 writerfilter/source/dmapper/DomainMapper.cxx   |   14 ++++++++------
 writerfilter/source/ooxml/model.xml            |   14 +++++++-------
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |    6 +++---
 3 files changed, 18 insertions(+), 16 deletions(-)

New commits:
commit a2a1b55c28d9da58c69fd389af8795f367a64505
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Sep 29 09:35:54 2014 +0200

    Use constants for ST_TabJc values
    
    Change-Id: Idfb554f2ee77e0315b3ed69c4fae8ad4e8e87b3f

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index fd8f25a..a624e12 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -3322,15 +3322,17 @@ com::sun::star::style::TabAlign DomainMapper::getTabAlignFromValue(const sal_Int
 {
     switch (nIntValue)
     {
-    case 0:
-    case 4: // bar not supported
-    case 5: // num not supported
+    case NS_ooxml::LN_Value_ST_TabJc_start:
+    case NS_ooxml::LN_Value_ST_TabJc_left:
+    case NS_ooxml::LN_Value_ST_TabJc_bar: // bar not supported
+    case NS_ooxml::LN_Value_ST_TabJc_num: // num not supported
         return com::sun::star::style::TabAlign_LEFT;
-    case 1:
+    case NS_ooxml::LN_Value_ST_TabJc_center:
         return com::sun::star::style::TabAlign_CENTER;
-    case 2:
+    case NS_ooxml::LN_Value_ST_TabJc_end:
+    case NS_ooxml::LN_Value_ST_TabJc_right:
         return com::sun::star::style::TabAlign_RIGHT;
-    case 3:
+    case NS_ooxml::LN_Value_ST_TabJc_decimal:
         return com::sun::star::style::TabAlign_DECIMAL;
     }
     return com::sun::star::style::TabAlign_LEFT;
diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml
index 56b345c..b5ec46c 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -17068,13 +17068,13 @@
     </resource>
     <resource name="ST_TabJc" resource="List">
       <value tokenid="ooxml:Value_ST_TabJc_clear">clear</value>
-      <value tokenid="0">start</value>
-      <value tokenid="0">left</value>
-      <value tokenid="1">center</value>
-      <value tokenid="2">end</value>
-      <value tokenid="2">right</value>
-      <value tokenid="3">decimal</value>
-      <value tokenid="4">bar</value>
+      <value tokenid="ooxml:Value_ST_TabJc_start">start</value>
+      <value tokenid="ooxml:Value_ST_TabJc_left">left</value>
+      <value tokenid="ooxml:Value_ST_TabJc_center">center</value>
+      <value tokenid="ooxml:Value_ST_TabJc_end">end</value>
+      <value tokenid="ooxml:Value_ST_TabJc_right">right</value>
+      <value tokenid="ooxml:Value_ST_TabJc_decimal">decimal</value>
+      <value tokenid="ooxml:Value_ST_TabJc_bar">bar</value>
       <value tokenid="ooxml:Value_ST_TabJc_num">num</value>
     </resource>
     <resource name="ST_TabTlc" resource="List">
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 1d1d483..d613449 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2513,13 +2513,13 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
     switch (nKeyword)
     {
     case RTF_TQR:
-        nParam = 2;
+        nParam = NS_ooxml::LN_Value_ST_TabJc_right;
         break;
     case RTF_TQC:
-        nParam = 1;
+        nParam = NS_ooxml::LN_Value_ST_TabJc_center;
         break;
     case RTF_TQDEC:
-        nParam = 3;
+        nParam = NS_ooxml::LN_Value_ST_TabJc_decimal;
         break;
     default:
         break;


More information about the Libreoffice-commits mailing list