You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by pf...@apache.org on 2011/10/29 21:04:05 UTC
svn commit: r1194975 - in /incubator/ooo/trunk/main/sw/source/filter/ww8:
ww8par2.cxx ww8par6.cxx ww8scan.cxx ww8scan.hxx
Author: pfg
Date: Sat Oct 29 19:04:04 2011
New Revision: 1194975
URL: http://svn.apache.org/viewvc?rev=1194975&view=rev
Log:
i92341 - WW8: CTL/Thai font convert incorrectly when import from MS Office 2003.
Modified:
incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par2.cxx
incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par6.cxx
incubator/ooo/trunk/main/sw/source/filter/ww8/ww8scan.cxx
incubator/ooo/trunk/main/sw/source/filter/ww8/ww8scan.hxx
Modified: incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par2.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par2.cxx?rev=1194975&r1=1194974&r2=1194975&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par2.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par2.cxx Sat Oct 29 19:04:04 2011
@@ -3934,28 +3934,17 @@ WW8RStyle::WW8RStyle(WW8Fib& _rFib, SwWW
void WW8RStyle::Set1StyleDefaults()
{
+ // see #i25247#, #i25561#, #i48064#, #i92341# for default font
if (!bCJKFontChanged) // Style no CJK Font? set the default
- pIo->SetNewFontAttr(ftcStandardChpCJKStsh, true, RES_CHRATR_CJK_FONT);
-
- // see i25247
- const WW8_FFN* pF = pIo->pFonts->GetFont(3);
- if (pF)
- {
- rtl_TextEncoding eEnc = WW8Fib::GetFIBCharset(pF->chs);
- if ((ftcStandardChpCTLStsh == 0) && (eEnc == RTL_TEXTENCODING_MS_1255))
- ftcStandardChpCTLStsh = 3;
- }
-
- if (ftcStandardChpCJKStsh == 0)
- ftcStandardChpCJKStsh = 2;
+ pIo->SetNewFontAttr(ftcFE, true, RES_CHRATR_CJK_FONT);
if (!bCTLFontChanged) // Style no CTL Font? set the default
- pIo->SetNewFontAttr(ftcStandardChpCTLStsh, true, RES_CHRATR_CTL_FONT);
+ pIo->SetNewFontAttr(ftcBi, true, RES_CHRATR_CTL_FONT);
//#88976# western 2nd to make western charset conversion the default
if (!bFontChanged) // Style has no Font? set the default,
{
- pIo->SetNewFontAttr(ftcStandardChpStsh, true, RES_CHRATR_FONT);
+ pIo->SetNewFontAttr(ftcAsci, true, RES_CHRATR_FONT);
/* removed by a patch from cmc for #i52786#
if (pIo->bVer67)
SetStyleCharSet(pIo->pCollA[pIo->nAktColl]);
Modified: incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par6.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par6.cxx?rev=1194975&r1=1194974&r2=1194975&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par6.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par6.cxx Sat Oct 29 19:04:04 2011
@@ -3675,18 +3675,18 @@ void SwWW8ImplReader::Read_FontCode( sal
{ // (siehe sprmCSymbol) gesetzte Font !
switch( nId )
{
- // case 0x4a51: //font to bias towards all else being equal ?
case 113:
- case 0x4a5E:
+ case 0x4A51: //"Other" font, override with BiDi if it exists
+ case 0x4A5E: //BiDi Font
nId = RES_CHRATR_CTL_FONT;
break;
case 93:
case 111:
- case 0x4a4f:
+ case 0x4A4f:
nId = RES_CHRATR_FONT;
break;
case 112:
- case 0x4a50:
+ case 0x4A50:
nId = RES_CHRATR_CJK_FONT;
break;
default:
@@ -5867,8 +5867,8 @@ const wwSprmDispatcher *GetWW8SprmDispat
{0x085B, 0}, //"sprmCFDiacColor"
{0x085C, &SwWW8ImplReader::Read_BoldBiDiUsw},//"sprmCFBoldBi"
{0x085D, &SwWW8ImplReader::Read_BoldBiDiUsw},//"sprmCFItalicBi"
- {0x4A5E, &SwWW8ImplReader::Read_FontCode},
- {0x485F, &SwWW8ImplReader::Read_Language}, // "sprmCLidBi"
+ {0x4A5E, &SwWW8ImplReader::Read_FontCode}, //"sprmCFtcBi"
+ {0x485F, &SwWW8ImplReader::Read_Language}, //"sprmCLidBi"
//0x4A60, ? ? ?, //"sprmCIcoBi",
{0x4A61, &SwWW8ImplReader::Read_FontSize}, //"sprmCHpsBi"
{0xCA62, 0}, //"sprmCDispFldRMark"
Modified: incubator/ooo/trunk/main/sw/source/filter/ww8/ww8scan.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/filter/ww8/ww8scan.cxx?rev=1194975&r1=1194974&r2=1194975&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/filter/ww8/ww8scan.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/filter/ww8/ww8scan.cxx Sat Oct 29 19:04:04 2011
@@ -5988,7 +5988,7 @@ rtl_TextEncoding WW8Fib::GetFIBCharset(s
WW8Style::WW8Style(SvStream& rStream, WW8Fib& rFibPara)
: rFib(rFibPara), rSt(rStream), cstd(0), cbSTDBaseInFile(0),
stiMaxWhenSaved(0), istdMaxFixedWhenSaved(0), nVerBuiltInNamesWhenSaved(0),
- ftcStandardChpStsh(0), ftcStandardChpCJKStsh(0), ftcStandardChpCTLStsh(0)
+ ftcAsci(0), ftcFE(0), ftcOther(0), ftcBi(0)
{
nStyleStart = rFib.fcStshf;
nStyleLen = rFib.lcbStshf;
@@ -6033,17 +6033,22 @@ WW8Style::WW8Style(SvStream& rStream, WW
rSt >> nVerBuiltInNamesWhenSaved;
if( 14 > nRead ) break;
- rSt >> ftcStandardChpStsh;
+ rSt >> ftcAsci;
if( 16 > nRead ) break;
- rSt >> ftcStandardChpCJKStsh;
+ rSt >> ftcFE;
if ( 18 > nRead ) break;
- rSt >> ftcStandardChpCTLStsh;
+ rSt >> ftcOther;
+
+ ftcBi = ftcOther;
+
+ if ( 20 > nRead ) break;
+ rSt >> ftcBi;
// ggfs. den Rest ueberlesen
- if( 18 < nRead )
- rSt.SeekRel( nRead-18 );
+ if( 20 < nRead )
+ rSt.SeekRel( nRead-20 );
}
while( !this ); // Trick: obiger Block wird genau einmal durchlaufen
// und kann vorzeitig per "break" verlassen werden.
Modified: incubator/ooo/trunk/main/sw/source/filter/ww8/ww8scan.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/filter/ww8/ww8scan.hxx?rev=1194975&r1=1194974&r2=1194975&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/filter/ww8/ww8scan.hxx (original)
+++ incubator/ooo/trunk/main/sw/source/filter/ww8/ww8scan.hxx Sat Oct 29 19:04:04 2011
@@ -1463,11 +1463,13 @@ protected:
sal_uInt16 istdMaxFixedWhenSaved; // How many fixed-index istds are there?
sal_uInt16 nVerBuiltInNamesWhenSaved; // Current version of built-in stylenames
// ftc used by StandardChpStsh for this document
- sal_uInt16 ftcStandardChpStsh;
+ sal_uInt16 ftcAsci;
// CJK ftc used by StandardChpStsh for this document
- sal_uInt16 ftcStandardChpCJKStsh;
+ sal_uInt16 ftcFE;
+ // CTL/Other ftc used by StandardChpStsh for this document
+ sal_uInt16 ftcOther;
// CTL ftc used by StandardChpStsh for this document
- sal_uInt16 ftcStandardChpCTLStsh;
+ sal_uInt16 ftcBi;
//No copying
WW8Style(const WW8Style&);