[Libreoffice-commits] .: 2 commits - sw/source

Caolán McNamara caolan at kemper.freedesktop.org
Fri Feb 18 08:13:30 PST 2011


 sw/source/filter/ww8/ww8atr.cxx  |   19 +++++++++----------
 sw/source/filter/ww8/ww8par6.cxx |   17 ++++++++++-------
 sw/source/filter/ww8/ww8scan.cxx |    8 ++++----
 3 files changed, 23 insertions(+), 21 deletions(-)

New commits:
commit 63267e756c7db34afab55568c2af4c5b85d57cae
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Feb 18 16:08:41 2011 +0000

    0x486e is sprmCRgLid1_80 not sprmCRgLid1

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index e4c613b..71e9c6e 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -1315,7 +1315,7 @@ void WW8AttributeOutput::CharLanguage( const SvxLanguageItem& rLanguage )
                 nId = NS_sprm::LN_CRgLid0_80;
                 break;
             case RES_CHRATR_CJK_LANGUAGE:
-                nId = NS_sprm::LN_CRgLid1;
+                nId = NS_sprm::LN_CRgLid1_80;
                 break;
             case RES_CHRATR_CTL_LANGUAGE:
                 nId = NS_sprm::LN_CLidBi;
@@ -1333,19 +1333,18 @@ void WW8AttributeOutput::CharLanguage( const SvxLanguageItem& rLanguage )
             m_rWW8Export.pO->Insert( (BYTE)nId, m_rWW8Export.pO->Count() );
         m_rWW8Export.InsUInt16( rLanguage.GetLanguage() );
 
-        // unknown as to exactly why, but this seems to shadow the other
-        // paramater in word 2000 and without it spellchecking doesn't work
+        // Word 2000 and above apparently require both old and new versions of
+        // these sprms to be set, without it spellchecking doesn't work
         if ( nId == NS_sprm::LN_CRgLid0_80 )
         {
-            m_rWW8Export.InsUInt16( 0x4873 );
+            m_rWW8Export.InsUInt16( NS_sprm::LN_CRgLid0 );
             m_rWW8Export.InsUInt16( rLanguage.GetLanguage() );
         }
-        else if ( nId == NS_sprm::LN_CLidBi )
+        else if ( nId == NS_sprm::LN_CRgLid1_80 )
         {
-            m_rWW8Export.InsUInt16( 0x4874 );
+            m_rWW8Export.InsUInt16( NS_sprm::LN_CRgLid1 );
             m_rWW8Export.InsUInt16( rLanguage.GetLanguage() );
         }
-
     }
 }
 
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 4e4d8ce..a9cf3b0 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -3840,7 +3840,8 @@ void SwWW8ImplReader::Read_Language( USHORT nId, const BYTE* pData, short nLen )
         case 0x4873: //Methinks, uncertain
             nId = RES_CHRATR_LANGUAGE;
             break;
-        case 0x486E:
+        case 0x486E: //sprmCRgLid1_80
+        case 0x4874: //Methinks, uncertain
             nId = RES_CHRATR_CJK_LANGUAGE;
             break;
         case 83:
@@ -5940,7 +5941,7 @@ const wwSprmDispatcher *GetWW8SprmDispatcher()
         {0x486D, &SwWW8ImplReader::Read_Language},   //"sprmCRgLid0_80" chp.rglid[0];
                                                      //LID: for non-Far East text;
                                                      //word;
-        {0x486E, &SwWW8ImplReader::Read_Language},   //"sprmCRgLid1" chp.rglid[1];
+        {0x486E, &SwWW8ImplReader::Read_Language},   //"sprmCRgLid1_80" chp.rglid[1];
                                                      //LID: for Far East text;word;
         {0x286F, &SwWW8ImplReader::Read_IdctHint},   //"sprmCIdctHint" chp.idctHint;
                                                      //IDCT: byte;
@@ -6154,10 +6155,12 @@ const wwSprmDispatcher *GetWW8SprmDispatcher()
         {0xC650, 0},                                 //undocumented
         {0xC651, 0},                                 //undocumented
         {0xF661, 0},                                 //undocumented
-        {0x4873, &SwWW8ImplReader::Read_Language},   //"sprmCRgLid3?" chp.rglid[0];
-                                                     //LID: for non-Far East text
+        {0x4873, &SwWW8ImplReader::Read_Language},   //"sprmCRgLid0" chp.rglid[0];
+                                                     //LID: for non-Far East text;
                                                      //(like a duplicate of 486D)
-        {0x4874, 0},                                 //undocumented
+        {0x4874, 0},                                 //"sprmCRgLid1" chp.rglid[1];
+                                                     //LID: for Far East text
+                                                     //(like a duplicate of 486E)
         {0x6463, 0},                                 //undocumented
         {0x2461, &SwWW8ImplReader::Read_RTLJustify}, //undoc, must be asian version
                                                      //of "sprmPJc"
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index cefb63d..c1fa380 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -629,7 +629,7 @@ const wwSprmSearcher *wwSprmParser::GetWW8SprmSearcher()
                             // chp.fUsePgsuSettings;1 or 0
         {0x486B, 2, L_FIX}, // "sprmCCpg" ;;word;
         {0x486D, 2, L_FIX}, // "sprmCRgLid0_80" chp.rglid[0];LID: for non-FE text
-        {0x486E, 2, L_FIX}, // "sprmCRgLid1" chp.rglid[1];LID: for Far East text
+        {0x486E, 2, L_FIX}, // "sprmCRgLid1_80" chp.rglid[1];LID: for Far East text
         {0x286F, 1, L_FIX}, // "sprmCIdctHint" chp.idctHint;IDCT:
         {0x2E00, 1, L_FIX}, // "sprmPicBrcl" pic.brcl;brcl (see PIC definition)
         {0xCE01, 0, L_VAR}, // "sprmPicScale" pic.mx, pic.my, pic.dxaCropleft,
@@ -745,8 +745,8 @@ const wwSprmSearcher *wwSprmParser::GetWW8SprmSearcher()
         {0xC650, 0, L_VAR}, // undocumented
         {0xC651, 0, L_VAR}, // undocumented
         {0xF661, 3, L_FIX}, // undocumented
-        {0x4873, 2, L_FIX}, // undocumented
-        {0x4874, 2, L_FIX}, // undocumented
+        {0x4873, 2, L_FIX}, // "sprmCRgLid0" chp.rglid[0];LID: for non-FE text
+        {0x4874, 2, L_FIX}, // "sprmCRgLid1" chp.rglid[1];LID: for Far East text
         {0x6463, 4, L_FIX}, // undocumented
         {0x2461, 1, L_FIX}, // undoc, must be asian version of "sprmPJc"
         {0x845D, 2, L_FIX}, // undoc, must be asian version of "sprmPDxaRight"
commit a632f2a929439a02586540932eee97a90e164a75
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Feb 18 15:37:12 2011 +0000

    0x486d is sprmCRgLid0_80 not sprmCRgLid0

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 40a266b..e4c613b 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -1312,7 +1312,7 @@ void WW8AttributeOutput::CharLanguage( const SvxLanguageItem& rLanguage )
         switch ( rLanguage.Which() )
         {
             case RES_CHRATR_LANGUAGE:
-                nId = NS_sprm::LN_CRgLid0;
+                nId = NS_sprm::LN_CRgLid0_80;
                 break;
             case RES_CHRATR_CJK_LANGUAGE:
                 nId = NS_sprm::LN_CRgLid1;
@@ -1327,7 +1327,7 @@ void WW8AttributeOutput::CharLanguage( const SvxLanguageItem& rLanguage )
 
     if ( nId )
     {
-        if ( m_rWW8Export.bWrtWW8 ) // use sprmCRgLid0 rather than sprmCLid
+        if ( m_rWW8Export.bWrtWW8 ) // use sprmCRgLid0_80 rather than sprmCLid
             m_rWW8Export.InsUInt16( nId );
         else
             m_rWW8Export.pO->Insert( (BYTE)nId, m_rWW8Export.pO->Count() );
@@ -1335,7 +1335,7 @@ void WW8AttributeOutput::CharLanguage( const SvxLanguageItem& rLanguage )
 
         // unknown as to exactly why, but this seems to shadow the other
         // paramater in word 2000 and without it spellchecking doesn't work
-        if ( nId == NS_sprm::LN_CRgLid0 )
+        if ( nId == NS_sprm::LN_CRgLid0_80 )
         {
             m_rWW8Export.InsUInt16( 0x4873 );
             m_rWW8Export.InsUInt16( rLanguage.GetLanguage() );
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index add4be1..4e4d8ce 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -3836,7 +3836,7 @@ void SwWW8ImplReader::Read_Language( USHORT nId, const BYTE* pData, short nLen )
     switch( nId )
     {
         case 97:
-        case 0x486D:
+        case 0x486D: //sprmCRgLid0_80
         case 0x4873: //Methinks, uncertain
             nId = RES_CHRATR_LANGUAGE;
             break;
@@ -5937,7 +5937,7 @@ const wwSprmDispatcher *GetWW8SprmDispatcher()
                                                      //chp.fUsePgsuSettings; 1 or 0;
                                                      //bit;
         {0x486B, 0},                                 //"sprmCCpg" ;;word;
-        {0x486D, &SwWW8ImplReader::Read_Language},   //"sprmCRgLid0" chp.rglid[0];
+        {0x486D, &SwWW8ImplReader::Read_Language},   //"sprmCRgLid0_80" chp.rglid[0];
                                                      //LID: for non-Far East text;
                                                      //word;
         {0x486E, &SwWW8ImplReader::Read_Language},   //"sprmCRgLid1" chp.rglid[1];
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 74fe57a..cefb63d 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -628,7 +628,7 @@ const wwSprmSearcher *wwSprmParser::GetWW8SprmSearcher()
         {0x0868, 1, L_FIX}, // "sprmCFUsePgsuSettings"
                             // chp.fUsePgsuSettings;1 or 0
         {0x486B, 2, L_FIX}, // "sprmCCpg" ;;word;
-        {0x486D, 2, L_FIX}, // "sprmCRgLid0" chp.rglid[0];LID: for non-FE text
+        {0x486D, 2, L_FIX}, // "sprmCRgLid0_80" chp.rglid[0];LID: for non-FE text
         {0x486E, 2, L_FIX}, // "sprmCRgLid1" chp.rglid[1];LID: for Far East text
         {0x286F, 1, L_FIX}, // "sprmCIdctHint" chp.idctHint;IDCT:
         {0x2E00, 1, L_FIX}, // "sprmPicBrcl" pic.brcl;brcl (see PIC definition)


More information about the Libreoffice-commits mailing list