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

Caolán McNamara caolan at kemper.freedesktop.org
Thu Feb 24 07:21:05 PST 2011


 sw/source/filter/ww8/ww8par.cxx  |    3 ++-
 sw/source/filter/ww8/ww8par.hxx  |    1 -
 sw/source/filter/ww8/ww8par6.cxx |   19 -------------------
 3 files changed, 2 insertions(+), 21 deletions(-)

New commits:
commit 123c08bc37ccb7b8ac46e1c5ba1182e4d5fb1d29
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 24 15:19:00 2011 +0000

    Related: fdo#33549 remove bogus CorrectResIdForCharset
    
    This looks totally bogus, and even if it isn't then in
    SwWW8ImplReader::SetNewFontAttr the *original* nWhich
    needs to be the one used for the push onto the encoding
    stack, otherwise its all busted afterwards on the pop.
    
    I suspect this is an attempt to fix some other problem
    earlier, maybe idcthint related or maybe default font
    related. Impossible to know as there was no comments
    or bugids mentioned originally to see what the problem
    being fixed was.

diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index b1c1ec1..f949d6b 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -1154,7 +1154,6 @@ private:
     bool GetFontParams(USHORT, FontFamily&, String&, FontPitch&,
         rtl_TextEncoding&);
     bool SetNewFontAttr(USHORT nFCode, bool bSetEnums, USHORT nWhich);
-    USHORT CorrectResIdForCharset(CharSet nCharSet, USHORT nWhich);
     void ResetCharSetVars();
     void ResetCJKCharSetVars();
 
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index a9cf3b0..62e85c1 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -3564,23 +3564,6 @@ bool SwWW8ImplReader::GetFontParams( USHORT nFCode, FontFamily& reFamily,
     return true;
 }
 
-USHORT SwWW8ImplReader::CorrectResIdForCharset(CharSet nCharSet, USHORT nWhich)
-{
-    USHORT nResult = 0;
-    
-    switch (nCharSet) {
-        case RTL_TEXTENCODING_MS_932:
-            nResult = RES_CHRATR_CJK_FONT;
-            break;
-
-        default:
-            nResult = nWhich;
-            break;
-    }
-    
-    return nResult;
-}
-
 bool SwWW8ImplReader::SetNewFontAttr(USHORT nFCode, bool bSetEnums,
     USHORT nWhich)
 {
@@ -3629,8 +3612,6 @@ bool SwWW8ImplReader::SetNewFontAttr(USHORT nFCode, bool bSetEnums,
     CharSet eDstCharSet = eSrcCharSet;
 
     SvxFontItem aFont( eFamily, aName, aEmptyStr, ePitch, eDstCharSet, nWhich);
-    
-    nWhich = CorrectResIdForCharset(eSrcCharSet, nWhich);
 
     if( bSetEnums )
     {
commit e79713d909f1b898e99492fbde295168f189e966
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 24 14:13:27 2011 +0000

    don't search past end of string

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 2772a1e..cfbcb29 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2772,7 +2772,8 @@ void SwWW8ImplReader::emulateMSWordAddTextToParagraph(const rtl::OUString& rAddS
         }
 
         nPos = nEnd;
-        nScript = lcl_getScriptType(xBI, rAddString, nPos);
+        if (nPos < nLen)
+            nScript = lcl_getScriptType(xBI, rAddString, nPos);
     }
 
 }


More information about the Libreoffice-commits mailing list