diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 0ee22cdfd9a7..b881d8edfe36 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -2,9 +2,9 @@ * * $RCSfile: wrtw8esh.cxx,v $ * - * $Revision: 1.35 $ + * $Revision: 1.36 $ * - * last change: $Author: cmc $ $Date: 2002-06-13 14:19:04 $ + * last change: $Author: cmc $ $Date: 2002-06-27 11:07:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -824,7 +824,7 @@ void WW8_SdrAttrIter::OutAttr( xub_StrLen nSwPos ) nWhich != nSlotId && 0 != ( pOut = aWW8AttrFnTab[ nWhich - RES_CHRATR_BEGIN ] ) ) { - if (SwWW8Writer::CollapseScriptsforWordOk(nScript,nWhich)) + if (rWrt.CollapseScriptsforWordOk(nScript,nWhich)) { // use always the SW-Which Id ! SfxPoolItem* pI = rHt.pAttr->Clone(); @@ -926,7 +926,7 @@ void WW8_SdrAttrIter::OutParaAttr( BOOL bCharAttr ) // use always the SW-Which Id ! SfxPoolItem* pI = pItem->Clone(); pI->SetWhich( nWhich ); - if (SwWW8Writer::CollapseScriptsforWordOk(nScript,nWhich)) + if (rWrt.CollapseScriptsforWordOk(nScript,nWhich)) (*pOut)( rWrt, *pI ); delete pI; } diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 11f25f98cbd9..1dd371452006 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -2,9 +2,9 @@ * * $RCSfile: wrtw8nds.cxx,v $ * - * $Revision: 1.28 $ + * $Revision: 1.29 $ * - * last change: $Author: cmc $ $Date: 2002-06-25 09:43:11 $ + * last change: $Author: cmc $ $Date: 2002-06-27 11:07:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -458,7 +458,7 @@ void WW8_SwAttrIter::OutAttr( xub_StrLen nSwPos ) if( pEnd ? ( nSwPos >= *pHt->GetStart() && nSwPos < *pEnd ) : nSwPos == *pHt->GetStart() ) { - if (SwWW8Writer::CollapseScriptsforWordOk(nScript, + if (rWrt.CollapseScriptsforWordOk(nScript, pHt->GetAttr().Which())) { Out(aWW8AttrFnTab, pHt->GetAttr(), rWrt); diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 7acad61837ff..4c20145282bd 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -2,9 +2,9 @@ * * $RCSfile: wrtw8sty.cxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: cmc $ $Date: 2002-06-11 12:42:49 $ + * last change: $Author: cmc $ $Date: 2002-06-27 11:07:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -72,6 +72,10 @@ #include #endif +#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_ +#include +#endif + #define _SVSTDARR_STRINGSSORTDTOR #ifndef _HINTIDS_HXX @@ -479,8 +483,19 @@ void WW8WrtStyle::Set1StyleDefaults( const SwFmt& rFmt, BOOL bPap ) const BOOL* pFlags = aFlags + ( nStt - RES_CHRATR_BEGIN ); for( n = nStt; n < nEnd; ++n, ++pFlags ) + { if( *pFlags && SFX_ITEM_SET != rFmt.GetItemState( n, FALSE )) - Out( aWW8AttrFnTab, rFmt.GetAttr( n, TRUE ), rWrt ); + { + //If we are a character property then see if it is one of the + //western/asian ones that must be collapsed together for export to + //word. If so default to the western varient. + if ( !bPap && rWrt.CollapseScriptsforWordOk( + ::com::sun::star::i18n::ScriptType::LATIN, n) ) + { + Out(aWW8AttrFnTab, rFmt.GetAttr(n, TRUE), rWrt); + } + } + } rWrt.SetCurItemSet( pOldI ); } diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 24f409d6ccf1..b316c8ce53a6 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -2,9 +2,9 @@ * * $RCSfile: wrtww8.hxx,v $ * - * $Revision: 1.27 $ + * $Revision: 1.28 $ * - * last change: $Author: cmc $ $Date: 2002-06-25 11:31:09 $ + * last change: $Author: cmc $ $Date: 2002-06-27 11:07:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -574,7 +574,7 @@ public: static void InsAsString16( WW8Bytes& rO, const String& ); static void InsAsString8( WW8Bytes& rO, const String& rStr, rtl_TextEncoding eCodeSet ); - static BOOL CollapseScriptsforWordOk(USHORT nScript, USHORT nWhich); + BOOL CollapseScriptsforWordOk(USHORT nScript, USHORT nWhich); USHORT DupNumRuleWithLvlStart(const SwNumRule *pRule,BYTE nLvl,USHORT nVal); void InsUInt16( UINT16 n ) { SwWW8Writer::InsUInt16( *pO, n ); } diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 2d9d53b336b6..6f5984eafc88 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ww8atr.cxx,v $ * - * $Revision: 1.38 $ + * $Revision: 1.39 $ * - * last change: $Author: cmc $ $Date: 2002-06-17 10:19:03 $ + * last change: $Author: cmc $ $Date: 2002-06-27 11:07:41 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -373,11 +373,13 @@ Sadly word does not have two different sizes for asian font size and western font size, it has to different fonts, but not sizes, so we have to use our guess as to the script used and disable the export of one type. The same occurs for font weight and posture (bold and italic) + +In addition WW7- has only one character language identifier while WW8+ has two */ BOOL SwWW8Writer::CollapseScriptsforWordOk(USHORT nScript, USHORT nWhich) { BOOL bRet=TRUE; - if ( nScript != com::sun::star::i18n::ScriptType::ASIAN) + if (nScript != com::sun::star::i18n::ScriptType::ASIAN) { switch (nWhich) { @@ -386,6 +388,9 @@ BOOL SwWW8Writer::CollapseScriptsforWordOk(USHORT nScript, USHORT nWhich) case RES_CHRATR_CJK_WEIGHT: bRet = FALSE; break; + case RES_CHRATR_CJK_LANGUAGE: + if (bWrtWW8 == 0) + bRet = FALSE; default: break; } @@ -399,6 +404,9 @@ BOOL SwWW8Writer::CollapseScriptsforWordOk(USHORT nScript, USHORT nWhich) case RES_CHRATR_WEIGHT: bRet = FALSE; break; + case RES_CHRATR_LANGUAGE: + if (bWrtWW8 == 0) + bRet = FALSE; default: break; }