diff options
author | jp <jp@openoffice.org> | 2001-02-15 19:08:10 +0000 |
---|---|---|
committer | jp <jp@openoffice.org> | 2001-02-15 19:08:10 +0000 |
commit | 497cda668155aab71ed3ae0594a5996dee25dbea (patch) | |
tree | 4eacbeb3ec712500579f1b7db615ac01acdeb88c /sw/source/filter | |
parent | fef28a49098675a627382ff498251b5442e4e24f (diff) |
im-/export the Rotate-/ScaleWidth-Character attribut
Diffstat (limited to 'sw/source/filter')
-rw-r--r-- | sw/source/filter/ww8/ww8atr.cxx | 51 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.hxx | 12 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par6.cxx | 80 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8scan.cxx | 11 |
4 files changed, 109 insertions, 45 deletions
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 2c95ed9d912d..35ef0760ccc9 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.7 $ + * $Revision: 1.8 $ * - * last change: $Author: cmc $ $Date: 2001-02-06 17:28:21 $ + * last change: $Author: jp $ $Date: 2001-02-15 20:08:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -181,6 +181,12 @@ #ifndef _SVX_TWOLINESITEM_HXX #include <svx/twolinesitem.hxx> #endif +#ifndef _SVX_CHARSCALEITEM_HXX +#include <svx/charscaleitem.hxx> +#endif +#ifndef _SVX_CHARROTATEITEM_HXX +#include <svx/charrotateitem.hxx> +#endif #ifndef _FMTFLD_HXX //autogen #include <fmtfld.hxx> @@ -925,6 +931,35 @@ static Writer& OutWW8_SwSize( Writer& rWrt, const SfxPoolItem& rHt ) return rWrt; } +static Writer& OutWW8_ScaleWidth( Writer& rWrt, const SfxPoolItem& rHt ) +{ + SwWW8Writer& rWrtWW8 = (SwWW8Writer&)rWrt; + if( rWrtWW8.bWrtWW8 ) + { + rWrtWW8.InsUInt16( 0x4852 ); + rWrtWW8.InsUInt16( ((SvxCharScaleWidthItem&)rHt).GetValue() ); + } + return rWrt; +} +static Writer& OutWW8_CharRotate( Writer& rWrt, const SfxPoolItem& rHt ) +{ + SwWW8Writer& rWrtWW8 = (SwWW8Writer&)rWrt; + if( rWrtWW8.bWrtWW8 ) + { + const SvxCharRotateItem& rAttr = (const SvxCharRotateItem&)rHt; + + rWrtWW8.InsUInt16( 0xCA78 ); + rWrtWW8.pO->Insert( (BYTE)0x06, rWrtWW8.pO->Count() ); //len 6 + rWrtWW8.pO->Insert( (BYTE)0x01, rWrtWW8.pO->Count() ); + + rWrtWW8.InsUInt16( rAttr.IsFitToLine() ? 1 : 0 ); + static const BYTE aZeroArr[ 3 ] = { 0, 0, 0 }; + rWrtWW8.pO->Insert( aZeroArr, 3, rWrtWW8.pO->Count() ); + } + return rWrt; +} + + static Writer& OutWW8_EmphasisMark( Writer& rWrt, const SfxPoolItem& rHt ) { SwWW8Writer& rWrtWW8 = (SwWW8Writer&)rWrt; @@ -2147,9 +2182,8 @@ static Writer& OutWW8_SvxTwoLinesItem( Writer& rWrt, const SfxPoolItem& rHt ) else nType = 1; rWrtWW8.InsUInt16( nType ); - rWrtWW8.pO->Insert( (BYTE)0x00, rWrtWW8.pO->Count() ); - rWrtWW8.pO->Insert( (BYTE)0x00, rWrtWW8.pO->Count() ); - rWrtWW8.pO->Insert( (BYTE)0x00, rWrtWW8.pO->Count() ); + static const BYTE aZeroArr[ 3 ] = { 0, 0, 0 }; + rWrtWW8.pO->Insert( aZeroArr, 3, rWrtWW8.pO->Count() ); return rWrt; } @@ -3467,10 +3501,10 @@ SwAttrFnTab aWW8AttrFnTab = { /* RES_CHRATR_CTL_LANGUAGE */ 0, /* RES_CHRATR_CTL_POSTURE */ 0, /* RES_CHRATR_CTL_WEIGHT */ 0, -/* RES_CHRATR_WRITING_DIRECTION */ 0, +/* RES_CHRATR_WRITING_DIRECTION */ OutWW8_CharRotate, /* RES_CHRATR_EMPHASIS_MARK*/ OutWW8_EmphasisMark, /* RES_TXTATR_TWO_LINES */ OutWW8_SvxTwoLinesItem, -/* RES_CHRATR_DUMMY4 */ 0, +/* RES_CHRATR_DUMMY4 */ OutWW8_ScaleWidth, /* RES_CHRATR_DUMMY5 */ 0, /* RES_CHRATR_DUMMY1 */ 0, // Dummy: @@ -3580,6 +3614,9 @@ SwAttrFnTab aWW8AttrFnTab = { /************************************************************************* $Log: not supported by cvs2svn $ + Revision 1.7 2001/02/06 17:28:21 cmc + #83581# CJK Two Lines in One {Im|Ex}port for Word + Revision 1.6 2001/01/16 17:18:46 jp Bug #80650#: Out_SfxItemSet: if switch off the numrule then write the LR_Space direct diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index 40df357b31fe..c61247563142 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ww8par.hxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: cmc $ $Date: 2001-02-06 17:28:21 $ + * last change: $Author: jp $ $Date: 2001-02-15 20:08:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1000,6 +1000,7 @@ public: // eigentlich private, geht aber leider nur public void Read_FontKern( USHORT, BYTE* pData, short nLen ); void Read_Invisible( USHORT, BYTE* pData, short nLen ); void Read_Emphasis( USHORT, BYTE* pData, short nLen ); + void Read_ScaleWidth( USHORT, BYTE* pData, short nLen ); void Read_NoLineNumb( USHORT nId, BYTE* pData, short nLen ); @@ -1061,7 +1062,7 @@ public: // eigentlich private, geht aber leider nur public void Read_StyleCode( USHORT, BYTE* pData, short nLen ); void Read_Majority( USHORT, BYTE* pData, short nLen ); - void Read_DoubleLine( USHORT, BYTE* pDATA, short nLen); + void Read_DoubleLine_Rotate( USHORT, BYTE* pDATA, short nLen); // Felder @@ -1142,11 +1143,14 @@ public: // eigentlich private, geht aber leider nur public Source Code Control System - Header - $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/sw/source/filter/ww8/ww8par.hxx,v 1.11 2001-02-06 17:28:21 cmc Exp $ + $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/sw/source/filter/ww8/ww8par.hxx,v 1.12 2001-02-15 20:08:10 jp Exp $ Source Code Control System - Update $Log: not supported by cvs2svn $ + Revision 1.11 2001/02/06 17:28:21 cmc + #83581# CJK Two Lines in One {Im|Ex}port for Word + Revision 1.10 2001/01/30 20:11:06 cmc #83362# CJK Forbidden Character {Im|Ex}port diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 2bc7a4c3ec97..49ebddbf0f73 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.11 $ + * $Revision: 1.12 $ * - * last change: $Author: cmc $ $Date: 2001-02-07 16:15:13 $ + * last change: $Author: jp $ $Date: 2001-02-15 20:08:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -186,6 +186,12 @@ #ifndef _SVX_PBINITEM_HXX #include <svx/pbinitem.hxx> #endif +#ifndef _SVX_CHARSCALEITEM_HXX +#include <svx/charscaleitem.hxx> +#endif +#ifndef _SVX_CHARROTATEITEM_HXX +#include <svx/charrotateitem.hxx> +#endif #ifndef _SVX_HYZNITEM_HXX //autogen #include <svx/hyznitem.hxx> @@ -3190,37 +3196,37 @@ NoBracket 78 CA 06 - 02 00 00 02 34 52 <> 78 CA 06 - 02 03 00 02 34 52 {} 78 CA 06 - 02 04 00 02 34 52 */ -void SwWW8ImplReader::Read_DoubleLine( USHORT, BYTE* pData, short nLen ) +void SwWW8ImplReader::Read_DoubleLine_Rotate( USHORT, BYTE* pData, short nLen ) { if( nLen < 0 ) // close the tag - pCtrlStck->SetAttr( *pPaM->GetPoint(), RES_CHRATR_TWO_LINES); - else { - if( pData ) + pCtrlStck->SetAttr( *pPaM->GetPoint(), RES_CHRATR_TWO_LINES ); + pCtrlStck->SetAttr( *pPaM->GetPoint(), RES_CHRATR_ROTATE ); + } + else if( pData && 6 == nLen ) + { + switch( *pData ) { - ASSERT( (nLen == 6) && (pData[0] == 0x02), - "Problems with Two Lines in One CJK feature"); - if (nLen != 6) - return; - switch (SVBT16ToShort(pData+1)) + case 2: // double line { - default: - case 0: - NewAttr( SvxTwoLinesItem()); - break; - case 1: - NewAttr( SvxTwoLinesItem(sal_True,'(',')')); - break; - case 2: - NewAttr( SvxTwoLinesItem(sal_True,'[',']')); - break; - case 3: - NewAttr( SvxTwoLinesItem(sal_True,'<','>')); - break; - case 4: - NewAttr( SvxTwoLinesItem(sal_True,'{','}')); - break; + sal_Unicode cStt = 0, cEnd = 0; + switch( SVBT16ToShort( pData+1 ) ) + { + case 1: cStt = '(', cEnd = ')'; break; + case 2: cStt = '[', cEnd = ']'; break; + case 3: cStt = '<', cEnd = '>'; break; + case 4: cStt = '{', cEnd = '}'; break; + } + NewAttr( SvxTwoLinesItem( sal_True, cStt, cEnd )); } + break; + + case 1: // rotated characters + { + BOOL bFitToLine = 0 != *(pData+1); + NewAttr( SvxCharRotateItem( 900, bFitToLine )); + } + break; } } } @@ -3946,6 +3952,17 @@ void SwWW8ImplReader::Read_Emphasis( USHORT, BYTE* pData, short nLen ) } } +void SwWW8ImplReader::Read_ScaleWidth( USHORT, BYTE* pData, short nLen ) +{ + if( nLen < 0 ) + pCtrlStck->SetAttr( *pPaM->GetPoint(), RES_CHRATR_SCALEW ); + else + { + sal_uInt16 nVal = SVBT16ToShort( pData ); + NewAttr( SvxCharScaleWidthItem( nVal ) ); + } +} + SwWW8Shade::SwWW8Shade( BOOL bVer67, const WW8_SHD& rSHD ) { @@ -4694,7 +4711,7 @@ SprmReadInfo aSprmReadTab[] = { 0x4A4F, &SwWW8ImplReader::Read_FontCode, //"sprmCRgFtc0" // chp.rgftc[0];ftc for ASCII text (see below);short; 0x4A50, &SwWW8ImplReader::Read_FontCode, //"sprmCRgFtc1" // chp.rgftc[1];ftc for Far East text (see below);short; 0x4A51, &SwWW8ImplReader::Read_FontCode, //"sprmCRgFtc2" // chp.rgftc[2];ftc for non-Far East text (see below);short; -//0x4852, ? ? ? , "sprmCCharScale", // ;;; + 0x4852, &SwWW8ImplReader::Read_ScaleWidth, // ? ? ? , "sprmCCharScale", // ;;; 0x2A53, &SwWW8ImplReader::Read_BoldUsw, //"sprmCFDStrike" // chp.fDStrike;;byte; 0x0854, (FNReadRecord)0, //"sprmCFImprint" // chp.fImprint;1 or 0;bit; 0x0855, &SwWW8ImplReader::Read_Special, //"sprmCFSpec" // chp.fSpec ;1 or 0;bit; @@ -4805,7 +4822,7 @@ SprmReadInfo aSprmReadTab[] = { //0xD62A, ? ? ? , "sprmTDiagLine", // ;;; 0xD62B, (FNReadRecord)0, //"sprmTVertMerge" // tap.rgtc[].vertMerge;complex (see below);variable length always recorded as 2 bytes; 0xD62C, (FNReadRecord)0, //"sprmTVertAlign" // tap.rgtc[].vertAlign;complex (see below);variable length always recorded as 3 byte; - 0xCA78, &SwWW8ImplReader::Read_DoubleLine + 0xCA78, &SwWW8ImplReader::Read_DoubleLine_Rotate }; //----------------------------------------- @@ -4907,12 +4924,15 @@ short SwWW8ImplReader::ImportSprm( BYTE* pPos, short nSprmsLen, USHORT nId ) Source Code Control System - Header - $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/sw/source/filter/ww8/ww8par6.cxx,v 1.11 2001-02-07 16:15:13 cmc Exp $ + $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/sw/source/filter/ww8/ww8par6.cxx,v 1.12 2001-02-15 20:08:10 jp Exp $ Source Code Control System - Update $Log: not supported by cvs2svn $ + Revision 1.11 2001/02/07 16:15:13 cmc + #83307# Change automatic width handling for frames, with special care for header/footer problems + Revision 1.10 2001/02/07 11:12:31 cmc #83308# Allow negative frame positions diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index 5d5689cc3a3c..8365aede7e0e 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ww8scan.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: cmc $ $Date: 2001-02-06 17:28:21 $ + * last change: $Author: jp $ $Date: 2001-02-15 20:08:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -5758,7 +5758,7 @@ static SprmInfo aWwSprmTab[] = { 0x4A4F, 2, L_FIX, // "sprmCRgFtc0" chp.rgftc[0];ftc for ASCII text (see below);short; 0x4A50, 2, L_FIX, // "sprmCRgFtc1" chp.rgftc[1];ftc for Far East text (see below);short; 0x4A51, 2, L_FIX, // "sprmCRgFtc2" chp.rgftc[2];ftc for non-Far East text (see below);short; -//0x4852, 0, L_FIX, // "sprmCCharScale" ;;; + 0x4852, 2, L_FIX, // "sprmCCharScale" ;;short; 0x2A53, 1, L_FIX, // "sprmCFDStrike" chp.fDStrike;;byte; 0x0854, 1, L_FIX, // "sprmCFImprint" chp.fImprint;1 or 0;bit; 0x0855, 1, L_FIX, // "sprmCFSpec" chp.fSpec ;1 or 0;bit; @@ -6093,11 +6093,14 @@ BYTE WW8SprmDataOfs( USHORT nId ) /************************************************************************* Source Code Control System - Header - $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/sw/source/filter/ww8/ww8scan.cxx,v 1.8 2001-02-06 17:28:21 cmc Exp $ + $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/sw/source/filter/ww8/ww8scan.cxx,v 1.9 2001-02-15 20:08:10 jp Exp $ Source Code Control System - Update $Log: not supported by cvs2svn $ + Revision 1.8 2001/02/06 17:28:21 cmc + #83581# CJK Two Lines in One {Im|Ex}port for Word + Revision 1.7 2001/01/30 20:11:06 cmc #83362# CJK Forbidden Character {Im|Ex}port |