summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <cmc@openoffice.org>2002-07-23 09:52:56 +0000
committerCaolán McNamara <cmc@openoffice.org>2002-07-23 09:52:56 +0000
commitad80026105c810fe51c1f35a77ae52034b5e164d (patch)
tree7e39822c4dc3d42ef8e934cadae79ccb64a7fe9b
parent81b5d2f7bd3d382d18a5749df214e03bf0a68e73 (diff)
#101615# Import Export WW8 CTL fontsize
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx84
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx14
-rw-r--r--sw/source/filter/ww8/ww8par2.hxx13
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx30
4 files changed, 105 insertions, 36 deletions
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 7cfd21bd8daa..34afc15eb48a 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.41 $
+ * $Revision: 1.42 $
*
- * last change: $Author: cmc $ $Date: 2002-07-02 15:48:49 $
+ * last change: $Author: cmc $ $Date: 2002-07-23 10:52:52 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -378,38 +378,81 @@ 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)
{
+ //for asian in ww8, there is only one fontsize
+ //and one fontstyle (posture/weight) for ww6
+ //there is the additional problem that there
+ //is only one font setting for all three scripts
switch (nWhich)
{
- case RES_CHRATR_CJK_FONTSIZE:
- case RES_CHRATR_CJK_POSTURE:
- case RES_CHRATR_CJK_WEIGHT:
+ case RES_CHRATR_FONTSIZE:
+ case RES_CHRATR_POSTURE:
+ case RES_CHRATR_WEIGHT:
bRet = FALSE;
break;
- case RES_CHRATR_CJK_LANGUAGE:
+ case RES_CHRATR_LANGUAGE:
+ case RES_CHRATR_CTL_FONT:
+ case RES_CHRATR_CTL_FONTSIZE:
+ case RES_CHRATR_CTL_LANGUAGE:
+ case RES_CHRATR_CTL_POSTURE:
+ case RES_CHRATR_CTL_WEIGHT:
if (bWrtWW8 == 0)
bRet = FALSE;
default:
break;
}
}
+ else if (nScript == com::sun::star::i18n::ScriptType::COMPLEX)
+ {
+ //Complex is ok in ww8, but for ww6 there is only
+ //one font, one fontsize, one fontsize (weight/posture)
+ //and only one language
+ if (bWrtWW8 == 0)
+ {
+ switch (nWhich)
+ {
+ case RES_CHRATR_CJK_FONT:
+ case RES_CHRATR_CJK_FONTSIZE:
+ case RES_CHRATR_CJK_POSTURE:
+ case RES_CHRATR_CJK_WEIGHT:
+ case RES_CHRATR_CJK_LANGUAGE:
+ case RES_CHRATR_FONT:
+ case RES_CHRATR_FONTSIZE:
+ case RES_CHRATR_POSTURE:
+ case RES_CHRATR_WEIGHT:
+ case RES_CHRATR_LANGUAGE:
+ bRet = FALSE;
+ break;
+ default:
+ break;
+ }
+ }
+ }
else
{
+ //for western in ww8, there is only one fontsize
+ //and one fontstyle (posture/weight) for ww6
+ //there is the additional problem that there
+ //is only one font setting for all three scripts
switch (nWhich)
{
- case RES_CHRATR_FONTSIZE:
- case RES_CHRATR_POSTURE:
- case RES_CHRATR_WEIGHT:
+ case RES_CHRATR_CJK_FONTSIZE:
+ case RES_CHRATR_CJK_POSTURE:
+ case RES_CHRATR_CJK_WEIGHT:
bRet = FALSE;
break;
- case RES_CHRATR_LANGUAGE:
+ case RES_CHRATR_CJK_LANGUAGE:
+ case RES_CHRATR_CTL_FONT:
+ case RES_CHRATR_CTL_FONTSIZE:
+ case RES_CHRATR_CTL_LANGUAGE:
+ case RES_CHRATR_CTL_POSTURE:
+ case RES_CHRATR_CTL_WEIGHT:
if (bWrtWW8 == 0)
bRet = FALSE;
default:
break;
}
-
}
return bRet;
}
@@ -1008,12 +1051,19 @@ static Writer& OutWW8_SwSize( Writer& rWrt, const SfxPoolItem& rHt )
{
SwWW8Writer& rWrtWW8 = (SwWW8Writer&)rWrt;
USHORT nId = 0;
- if( rWrtWW8.bWrtWW8 )
- switch ( rHt.Which() )
+ if (rWrtWW8.bWrtWW8)
+ {
+ switch (rHt.Which())
{
- case RES_CHRATR_FONTSIZE:
- case RES_CHRATR_CJK_FONTSIZE: nId = 0x4A43; break;
+ case RES_CHRATR_FONTSIZE:
+ case RES_CHRATR_CJK_FONTSIZE:
+ nId = 0x4A43;
+ break;
+ case RES_CHRATR_CTL_FONTSIZE:
+ nId = 0x4A61;
+ break;
}
+ }
else
nId = 99;
@@ -4054,7 +4104,7 @@ SwAttrFnTab aWW8AttrFnTab = {
/* RES_CHRATR_CJK_POSTURE */ OutWW8_SwPosture,
/* RES_CHRATR_CJK_WEIGHT */ OutWW8_SwWeight,
/* RES_CHRATR_CTL_FONT */ 0,
-/* RES_CHRATR_CTL_FONTSIZE */ 0,
+/* RES_CHRATR_CTL_FONTSIZE */ OutWW8_SwSize,
/* RES_CHRATR_CTL_LANGUAGE */ 0,
/* RES_CHRATR_CTL_POSTURE */ 0,
/* RES_CHRATR_CTL_WEIGHT */ 0,
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index f28778fa0f47..8e8ef42b6d3f 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ww8par2.cxx,v $
*
- * $Revision: 1.59 $
+ * $Revision: 1.60 $
*
- * last change: $Author: cmc $ $Date: 2002-07-18 12:29:10 $
+ * last change: $Author: cmc $ $Date: 2002-07-23 10:52:53 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -3308,6 +3308,14 @@ void WW8RStyle::Set1StyleDefaults()
pIo->pAktColl->SetAttr(aAttr);
}
+ // Style has no FontSize ? WinWord Default is 10pt for western and asian
+ if( !bFCTLSizeChanged )
+ {
+ SvxFontHeightItem aAttr(200);
+ aAttr.SetWhich(RES_CHRATR_CTL_FONTSIZE);
+ pIo->pAktColl->SetAttr(aAttr);
+ }
+
if( pIo->pWDop->fWidowControl && !bWidowsChanged ) // Widows ?
{
pIo->pAktColl->SetAttr( SvxWidowsItem( 2 ) );
@@ -3610,7 +3618,7 @@ void WW8RStyle::Import1Style( USHORT nNr )
pStyRule = 0; // falls noetig, neu anlegen
bTxtColChanged = bFontChanged = bCJKFontChanged = bFSizeChanged =
- bWidowsChanged = FALSE;
+ bFCTLSizeChanged = bWidowsChanged = FALSE;
pIo->SetNAktColl( nNr );
pIo->bStyNormal = nNr == 0;
diff --git a/sw/source/filter/ww8/ww8par2.hxx b/sw/source/filter/ww8/ww8par2.hxx
index 2446dafe9c78..82ec4b32f13c 100644
--- a/sw/source/filter/ww8/ww8par2.hxx
+++ b/sw/source/filter/ww8/ww8par2.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ww8par2.hxx,v $
*
- * $Revision: 1.18 $
+ * $Revision: 1.19 $
*
- * last change: $Author: cmc $ $Date: 2002-06-27 16:04:27 $
+ * last change: $Author: cmc $ $Date: 2002-07-23 10:52:54 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -242,10 +242,11 @@ friend class SwWW8ImplReader;
BYTE nWwNumLevel; // fuer Bullets und Aufzaehlungen in Styles
BOOL bTxtColChanged : 1;
- BOOL bFontChanged : 1; // Fuer Simulation Default-Font
- BOOL bCJKFontChanged: 1; // Fuer Simulation Default-Font
- BOOL bFSizeChanged : 1; // Fuer Simulation Default-FontSize
- BOOL bWidowsChanged : 1; // Fuer Simulation Default-Widows / Orphans
+ BOOL bFontChanged : 1; // For Simulating Default-Font
+ BOOL bCJKFontChanged: 1; // For Simulating Default-CJK Font
+ BOOL bFSizeChanged : 1; // For Simulating Default-FontSize
+ BOOL bFCTLSizeChanged : 1; // For Simulating Default-CTL FontSize
+ BOOL bWidowsChanged : 1; // For Simulating Default-Widows / Orphans
void ImportSprms( long nPosFc, short nLen, BOOL bPap );
void ImportGrupx( short nLen, BOOL bPara, BOOL bOdd );
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 88d48b83067c..90cb5cf109c9 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ww8par6.cxx,v $
*
- * $Revision: 1.96 $
+ * $Revision: 1.97 $
*
- * last change: $Author: cmc $ $Date: 2002-07-18 12:29:11 $
+ * last change: $Author: cmc $ $Date: 2002-07-23 10:52:55 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -3792,11 +3792,15 @@ void SwWW8ImplReader::Read_FontSize( USHORT nId, const BYTE* pData, short nLen )
{
switch( nId )
{
- case 99:
- case 0x4a43: nId = RES_CHRATR_FONTSIZE; break;
-// case 0x4a61: nId = RES_CHRATR_CTL_FONTSIZE; break;
- default:
- return ;
+ case 99:
+ case 0x4a43:
+ nId = RES_CHRATR_FONTSIZE;
+ break;
+ case 0x4a61:
+ nId = RES_CHRATR_CTL_FONTSIZE;
+ break;
+ default:
+ return ;
}
if( nLen < 0 ) // Ende des Attributes
@@ -3817,8 +3821,14 @@ void SwWW8ImplReader::Read_FontSize( USHORT nId, const BYTE* pData, short nLen )
aSz.SetWhich( RES_CHRATR_CJK_FONTSIZE );
NewAttr( aSz );
}
- if( pAktColl && pStyles ) // Style-Def ?
- pStyles->bFSizeChanged = TRUE; // merken zur Simulation Default-FontSize
+ if (pAktColl && pStyles) // Style-Def ?
+ {
+ // merken zur Simulation Default-FontSize
+ if (nId == RES_CHRATR_CTL_FONTSIZE)
+ pStyles->bFCTLSizeChanged = TRUE;
+ else
+ pStyles->bFSizeChanged = TRUE;
+ }
}
}
@@ -5380,7 +5390,7 @@ SprmReadInfo aSprmReadTab[] = {
//0x4A5E, ? ? ? , "sprmCFtcBi", // ;;;
0x485F, (FNReadRecord)0, // "sprmCLidBi", // ;;;
//0x4A60, ? ? ? , "sprmCIcoBi", // ;;;
-//0x4A61, &SwWW8ImplReader::Read_FontSize, // "sprmCHpsBi", // ;;;
+ 0x4A61, &SwWW8ImplReader::Read_FontSize, // "sprmCHpsBi", // ;;;
0xCA62, (FNReadRecord)0, //"sprmCDispFldRMark" // chp.fDispFldRMark, chp.ibstDispFldRMark, chp.dttmDispFldRMark ;Complex (see below);variable length always recorded as 39 bytes;
0x4863, (FNReadRecord)0, //"sprmCIbstRMarkDel" // chp.ibstRMarkDel;index into sttbRMark;short;
0x6864, (FNReadRecord)0, //"sprmCDttmRMarkDel" // chp.dttmRMarkDel;DTTM;long;