diff options
author | Andreas Martens <ama@openoffice.org> | 2001-03-15 14:59:12 +0000 |
---|---|---|
committer | Andreas Martens <ama@openoffice.org> | 2001-03-15 14:59:12 +0000 |
commit | da7671e4f7482110ecd0cfbfd7dbd9e0b873c81c (patch) | |
tree | 0bcc29dcd64fe91b78fb02b89dbf993146cf771f | |
parent | f5e62c3d12dedf359400405e72ded11c347478f0 (diff) |
Opt.(FME): The new attribute handler makes a lot of code superfluous
-rw-r--r-- | sw/inc/txtatr.hxx | 362 | ||||
-rw-r--r-- | sw/inc/txtinet.hxx | 12 | ||||
-rw-r--r-- | sw/inc/txtrfmrk.hxx | 7 | ||||
-rw-r--r-- | sw/inc/txttxmrk.hxx | 7 | ||||
-rw-r--r-- | sw/source/core/inc/swfont.hxx | 8 | ||||
-rw-r--r-- | sw/source/core/text/frmpaint.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/text/itratr.cxx | 28 | ||||
-rw-r--r-- | sw/source/core/text/itratr.hxx | 7 | ||||
-rw-r--r-- | sw/source/core/text/porlay.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/text/porrst.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/text/redlnitr.cxx | 97 | ||||
-rw-r--r-- | sw/source/core/text/redlnitr.hxx | 26 | ||||
-rw-r--r-- | sw/source/core/txtnode/atrref.cxx | 17 | ||||
-rw-r--r-- | sw/source/core/txtnode/atrtox.cxx | 19 | ||||
-rw-r--r-- | sw/source/core/txtnode/makefile.mk | 8 | ||||
-rw-r--r-- | sw/source/core/txtnode/swfont.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/txtnode/thints.cxx | 95 | ||||
-rw-r--r-- | sw/source/core/txtnode/txatbase.cxx | 27 | ||||
-rw-r--r-- | sw/source/core/txtnode/txtatr2.cxx | 511 |
19 files changed, 77 insertions, 1186 deletions
diff --git a/sw/inc/txtatr.hxx b/sw/inc/txtatr.hxx index a9f322031bc9..d4996d0d981d 100644 --- a/sw/inc/txtatr.hxx +++ b/sw/inc/txtatr.hxx @@ -2,9 +2,9 @@ * * $RCSfile: txtatr.hxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: jp $ $Date: 2001-02-15 20:10:39 $ + * last change: $Author: ama $ $Date: 2001-03-15 15:49:15 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -67,16 +67,6 @@ #ifndef _TOOLS_COLOR_HXX #include <tools/color.hxx> #endif -#ifndef _LANG_HXX -#include <tools/lang.hxx> -#endif -#ifndef _SV_FONTTYPE_HXX //autogen -#include <vcl/fonttype.hxx> -#endif -#ifndef _SVX_SVXENUM_HXX //autogen -#include <svx/svxenum.hxx> -#endif - #ifndef _TXATBASE_HXX #include <txatbase.hxx> // SwTxtAttr/SwTxtAttrEnd #endif @@ -87,199 +77,13 @@ class SwTxtNode; // fuer SwTxtFld class SvxFont; class SwCharSetCol; -class SwImplPrev; -class SwFmtRuby; class SwCharFmt; class SvxTwoLinesItem; -// ATT_FONT *********************************************************** - -class SwTxtFont: public SwTxtAttrEnd -{ - // Hier werden die alten Werte aus dem Font bei ChgFnt() gemerkt. - String aPrevName; - String aPrevStyleName; - FontFamily ePrevFamily; - FontPitch ePrevPitch; - CharSet ePrevCharSet; - BYTE nScript; -public: - SwTxtFont( const SvxFontItem& rAttr, xub_StrLen nStart, xub_StrLen nEnd, - const BYTE nScrpt ); - ~SwTxtFont( ); - - virtual void ChgFnt(SwFont *); - virtual void RstFnt(SwFont *); - virtual void ChgTxtAttr( SwTxtAttr & ); - virtual void RstTxtAttr( SwTxtAttr & ); -}; - -// ATT_POSTURE *********************************************************** - -class SwTxtPosture : public SwTxtAttrEnd -{ - FontItalic ePrevPosture; - BYTE nScript; -public: - SwTxtPosture( const SvxPostureItem& rAttr, xub_StrLen nStart, - xub_StrLen nEnd, const BYTE nScrpt ); - - virtual void ChgFnt(SwFont *); - virtual void RstFnt(SwFont *); - virtual void ChgTxtAttr( SwTxtAttr & ); - virtual void RstTxtAttr( SwTxtAttr & ); -}; - -// ATT_WEIGHT ************************************************************ - -class SwTxtWeight : public SwTxtAttrEnd -{ - // Hier merkt es sich das SV-Attribut Weight aus dem Font. - FontWeight ePrevWeight; - BYTE nScript; -public: - SwTxtWeight( const SvxWeightItem& rAttr, xub_StrLen nStart, xub_StrLen nEnd, - const BYTE nScrpt ); - - virtual void ChgFnt(SwFont *); - virtual void RstFnt(SwFont *); - virtual void ChgTxtAttr( SwTxtAttr & ); - virtual void RstTxtAttr( SwTxtAttr & ); -}; - -// ATT_SHADOWED ********************************************************** - -class SwTxtShadowed : public SwTxtAttrEnd -{ - BOOL bPrevShadow; -public: - SwTxtShadowed( const SvxShadowedItem& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); - - virtual void ChgFnt(SwFont *); - virtual void RstFnt(SwFont *); - virtual void ChgTxtAttr( SwTxtAttr & ); - virtual void RstTxtAttr( SwTxtAttr & ); -}; - -// ATT_AUTOKERN ********************************************************** - -class SwTxtAutoKern : public SwTxtAttrEnd -{ - BOOL bPrevAutoKern; -public: - SwTxtAutoKern( const SvxAutoKernItem& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); - - virtual void ChgFnt(SwFont *); - virtual void RstFnt(SwFont *); -}; - -// ATT_WORDLINEMODE ********************************************************** - -class SwTxtWordLineMode : public SwTxtAttrEnd -{ - BOOL bPrevWordLineMode; -public: - SwTxtWordLineMode( const SvxWordLineModeItem& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); - - virtual void ChgFnt(SwFont *); - virtual void RstFnt(SwFont *); - virtual void ChgTxtAttr( SwTxtAttr & ); - virtual void RstTxtAttr( SwTxtAttr & ); -}; - -// ATT_CONTOUR *********************************************************** - -class SwTxtContour : public SwTxtAttrEnd -{ - BOOL bPrevContour; -public: - SwTxtContour( const SvxContourItem& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); - - virtual void ChgFnt(SwFont *); - virtual void RstFnt(SwFont *); - virtual void ChgTxtAttr( SwTxtAttr & ); - virtual void RstTxtAttr( SwTxtAttr & ); -}; - -// ATT_CROSSEDOUT ******************************************************** - -class SwTxtCrossedOut : public SwTxtAttrEnd -{ - FontStrikeout ePrevCrossedOut; -public: - SwTxtCrossedOut( const SvxCrossedOutItem& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); - - virtual void ChgFnt(SwFont *); - virtual void RstFnt(SwFont *); - virtual void ChgTxtAttr( SwTxtAttr & ); - virtual void RstTxtAttr( SwTxtAttr & ); -}; - -// ATT_UNDERLINE ********************************************************* - -class SwTxtUnderline : public SwTxtAttrEnd -{ - FontUnderline ePrevUnderline; - Color ePrevColor; -public: - SwTxtUnderline( const SvxUnderlineItem& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); - - virtual void ChgFnt(SwFont *); - virtual void RstFnt(SwFont *); - virtual void ChgTxtAttr( SwTxtAttr & ); - virtual void RstTxtAttr( SwTxtAttr & ); -}; - -// ATT_SIZE ************************************************************** - -class SwTxtSize : public SwTxtAttrEnd -{ - Size aPrevSize; - BYTE nScript; -public: - SwTxtSize( const SvxFontHeightItem& rAttr, xub_StrLen nStart, - xub_StrLen nEnd, const BYTE nScrpt ); - - virtual void ChgFnt(SwFont *); - virtual void RstFnt(SwFont *); - virtual void ChgTxtAttr( SwTxtAttr & ); - virtual void RstTxtAttr( SwTxtAttr & ); -}; - -// ATT_COLOR ************************************************************* - -class SwTxtColor : public SwTxtAttrEnd -{ - friend class SwTxtCharSetColor; - Color aPrevColor; -public: - SwTxtColor( const SvxColorItem& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); - - virtual void ChgFnt(SwFont *); - virtual void RstFnt(SwFont *); - virtual void ChgTxtAttr( SwTxtAttr & ); - virtual void RstTxtAttr( SwTxtAttr & ); -}; - -// ATT_CHARSETCOLOR ****************************************************** - -class SwTxtCharSetColor : public SwTxtAttrEnd -{ - SwCharSetCol *pPrevCharSetCol; -public: - SwTxtCharSetColor( const SvxCharSetColorItem& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); - ~SwTxtCharSetColor(); - virtual void ChgFnt(SwFont *); - virtual void RstFnt(SwFont *); - virtual void ChgTxtAttr( SwTxtAttr & ); - virtual void RstTxtAttr( SwTxtAttr & ); -}; - // ATT_CHARFMT ********************************************* class SwTxtCharFmt : public SwTxtAttrEnd { - SwImplPrev *pImpl; SwTxtNode* pMyTxtNd; BOOL bPrevNoHyph : 1; BOOL bPrevBlink : 1; @@ -290,9 +94,6 @@ public: SwTxtCharFmt( const SwFmtCharFmt& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); ~SwTxtCharFmt( ); - virtual void ChgFnt(SwFont *); - virtual void RstFnt(SwFont *); - // werden vom SwFmtCharFmt hierher weitergeleitet virtual void Modify( SfxPoolItem*, SfxPoolItem* ); // SwClient virtual BOOL GetInfo( SfxPoolItem& rInfo ) const; @@ -303,109 +104,6 @@ public: }; - -// ATT_KERNING *********************************************************** - -class SwTxtKerning : public SwTxtAttrEnd -{ - short nPrevKern; -public: - SwTxtKerning( const SvxKerningItem& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); - - virtual void ChgFnt(SwFont *); - virtual void RstFnt(SwFont *); - virtual void ChgTxtAttr( SwTxtAttr & ); - virtual void RstTxtAttr( SwTxtAttr & ); -}; - -// ATT_CASEMAP *********************************************************** - -class SwTxtCaseMap : public SwTxtAttrEnd -{ - SvxCaseMap ePrevCaseMap; -public: - SwTxtCaseMap( const SvxCaseMapItem& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); - - virtual void ChgFnt(SwFont *); - virtual void RstFnt(SwFont *); - virtual void ChgTxtAttr( SwTxtAttr & ); - virtual void RstTxtAttr( SwTxtAttr & ); -}; - -// ATT_LANGUAGE ********************************************************** - -class SwTxtLanguage : public SwTxtAttrEnd -{ - LanguageType ePrevLang; - BYTE nScript; -public: - SwTxtLanguage( const SvxLanguageItem& rAttr, xub_StrLen nStart, - xub_StrLen nEnd, const BYTE nScrpt ); - - virtual void ChgFnt(SwFont *); - virtual void RstFnt(SwFont *); -}; - - -// ATT_ESCAPEMENT ******************************************************** - -class SwTxtEscapement : public SwTxtAttrEnd -{ - short nPrevEsc; - BYTE nPrevPropr; - -public: - SwTxtEscapement( const SvxEscapementItem& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); - - virtual void ChgFnt(SwFont *); - virtual void RstFnt(SwFont *); - virtual void ChgTxtAttr( SwTxtAttr & ); - virtual void RstTxtAttr( SwTxtAttr & ); -}; - -// ATT_BLINK *********************** - -class SwTxtBlink : public SwTxtAttrEnd -{ - BOOL bPrev; -public: - SwTxtBlink( const SvxBlinkItem& rAttr, - xub_StrLen nStart, xub_StrLen nEnd ); - - virtual void ChgFnt(SwFont *); - virtual void RstFnt(SwFont *); - virtual void ChgTxtAttr( SwTxtAttr & ); - virtual void RstTxtAttr( SwTxtAttr & ); -}; - -// ATT_BACKGROUND *********************** - -class SwTxtBackground : public SwTxtAttrEnd -{ - Color *pPrevColor; -public: - SwTxtBackground( const SvxBrushItem& rAttr, - xub_StrLen nStart, xub_StrLen nEnd ); - ~SwTxtBackground(); - virtual void ChgFnt(SwFont *); - virtual void RstFnt(SwFont *); - virtual void ChgTxtAttr( SwTxtAttr & ); - virtual void RstTxtAttr( SwTxtAttr & ); -}; - -// ATT_NOHYPHENHERE ************************** - -class SwTxtNoHyphenHere : public SwTxtAttrEnd -{ - BOOL bPrev; -public: - SwTxtNoHyphenHere( const SvxNoHyphenItem& rAttr, - xub_StrLen nStart, xub_StrLen nEnd ); - - virtual void ChgFnt(SwFont *); - virtual void RstFnt(SwFont *); -}; - // ATT_HARDBLANK ****************************** class SwTxtHardBlank : public SwTxtAttr @@ -416,7 +114,6 @@ public: inline sal_Unicode GetChar() const { return cChar; } }; - // ATT_XNLCONTAINERITEM ****************************** class SwTxtXMLAttrContainer : public SwTxtAttrEnd @@ -437,9 +134,6 @@ public: virtual ~SwTxtRuby(); TYPEINFO(); -//?? virtual void ChgFnt(SwFont *); -//?? virtual void RstFnt(SwFont *); - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); virtual BOOL GetInfo( SfxPoolItem& rInfo ) const; @@ -453,7 +147,6 @@ public: { return ((SwTxtRuby*)this)->GetCharFmt(); } }; - // ****************************** class SwTxt2Lines : public SwTxtAttrEnd @@ -463,58 +156,8 @@ public: xub_StrLen nStart, xub_StrLen nEnd ); }; -// EMPHASIS_MARK ************************************************************ - -class SwTxtEmphasisMark : public SwTxtAttrEnd -{ - // Hier merkt es sich das SV-Attribut Weight aus dem Font. - FontEmphasisMark ePrevEmphasis; -public: - SwTxtEmphasisMark( const SvxEmphasisMarkItem& rAttr, - xub_StrLen nStart, xub_StrLen nEnd ); - - virtual void ChgFnt(SwFont *); - virtual void RstFnt(SwFont *); - virtual void ChgTxtAttr( SwTxtAttr & ); - virtual void RstTxtAttr( SwTxtAttr & ); -}; - -// CHARROTATE ************************************************************ - -class SwTxtCharRotate : public SwTxtAttrEnd -{ - // Hier merkt es sich das SV-Attribut den Wert aus dem Font. - USHORT nPrevRotate; -public: - SwTxtCharRotate( const SvxCharRotateItem& rAttr, - xub_StrLen nStart, xub_StrLen nEnd ); - - virtual void ChgFnt(SwFont *); - virtual void RstFnt(SwFont *); - virtual void ChgTxtAttr( SwTxtAttr & ); - virtual void RstTxtAttr( SwTxtAttr & ); -}; - -// CHARSCALEWIDTH ********************************************************** - -class SwTxtCharScaleWidth : public SwTxtAttrEnd -{ - // Hier merkt es sich das SV-Attribut den Wert aus dem Font. - USHORT nPrevScale; -public: - SwTxtCharScaleWidth( const SvxCharScaleWidthItem& rAttr, - xub_StrLen nStart, xub_StrLen nEnd ); - - virtual void ChgFnt(SwFont *); - virtual void RstFnt(SwFont *); - virtual void ChgTxtAttr( SwTxtAttr & ); - virtual void RstTxtAttr( SwTxtAttr & ); -}; - - // --------------- Inline Implementierungen ------------------------ - inline const SwTxtNode& SwTxtCharFmt::GetTxtNode() const { ASSERT( pMyTxtNd, "SwTxtCharFmt:: wo ist mein TextNode?" ); @@ -527,5 +170,4 @@ inline const SwTxtNode& SwTxtRuby::GetTxtNode() const return *pMyTxtNd; } - #endif diff --git a/sw/inc/txtinet.hxx b/sw/inc/txtinet.hxx index ffa231dc32f2..4c29d9f65f73 100644 --- a/sw/inc/txtinet.hxx +++ b/sw/inc/txtinet.hxx @@ -2,9 +2,9 @@ * * $RCSfile: txtinet.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: ama $ $Date: 2000-09-25 12:02:29 $ + * last change: $Author: ama $ $Date: 2001-03-15 15:48:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -72,17 +72,12 @@ class SvxFont; class SwTxtNode; class SwCharFmt; class Color; -class SwImplPrev; // ATT_INETFMT ********************************************* class SwTxtINetFmt : public SwTxtAttrEnd, public SwClient { - SwImplPrev *pImpl; SwTxtNode* pMyTxtNd; - BOOL bPrevNoHyph : 1; - BOOL bPrevBlink : 1; - BOOL bPrevURL : 1; BOOL bVisited : 1; // Besuchter Link? BOOL bValidVis : 1; // Ist das bVisited-Flag gueltig? BOOL bColor : 1; @@ -92,9 +87,6 @@ public: virtual ~SwTxtINetFmt(); TYPEINFO(); - virtual void ChgFnt(SwFont *); - virtual void RstFnt(SwFont *); - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); virtual BOOL GetInfo( SfxPoolItem& rInfo ) const; diff --git a/sw/inc/txtrfmrk.hxx b/sw/inc/txtrfmrk.hxx index 52e6ea84a5e6..1c4e46a5b7bd 100644 --- a/sw/inc/txtrfmrk.hxx +++ b/sw/inc/txtrfmrk.hxx @@ -2,9 +2,9 @@ * * $RCSfile: txtrfmrk.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:14:29 $ + * last change: $Author: ama $ $Date: 2001-03-15 15:48:44 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -81,9 +81,6 @@ public: virtual xub_StrLen *GetEnd(); // SwTxtAttr inline const xub_StrLen* GetEnd() const { return pEnd; } - virtual void ChgFnt(SwFont *); // SwTxtAttr - virtual void RstFnt(SwFont *); // SwTxtAttr - // erfrage und setze den TxtNode Pointer inline const SwTxtNode& GetTxtNode() const; void ChgTxtNode( const SwTxtNode* pNew ) { pMyTxtNd = (SwTxtNode*)pNew; } diff --git a/sw/inc/txttxmrk.hxx b/sw/inc/txttxmrk.hxx index a65fa3ce33c7..2a1f6942514d 100644 --- a/sw/inc/txttxmrk.hxx +++ b/sw/inc/txttxmrk.hxx @@ -2,9 +2,9 @@ * * $RCSfile: txttxmrk.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:14:29 $ + * last change: $Author: ama $ $Date: 2001-03-15 15:48:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -83,9 +83,6 @@ public: virtual xub_StrLen *GetEnd(); // SwTxtAttr inline const xub_StrLen* GetEnd() const { return pEnd; } - virtual void ChgFnt(SwFont *); // SwTxtAttr - virtual void RstFnt(SwFont *); // SwTxtAttr - void CopyTOXMark( SwDoc* pDestDoc ); // erfrage und setze den TxtNode Pointer diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx index 64066652c693..e94aeba1f653 100644 --- a/sw/source/core/inc/swfont.hxx +++ b/sw/source/core/inc/swfont.hxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.hxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: ama $ $Date: 2001-03-13 09:38:46 $ + * last change: $Author: ama $ $Date: 2001-03-15 15:49:41 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -88,9 +88,7 @@ class SwDoCapitals; // DoCapitals class SwWrongList; class SwDrawTextInfo; // _DrawText class ViewShell; -#ifndef OLD_ATTR_HANDLING class SwAttrHandler; -#endif const xub_Unicode CH_BLANK = ' '; // ' ' Leerzeichen const xub_Unicode CH_BREAK = 0x0A; // @@ -225,9 +223,7 @@ protected: public: SwFont( const SwAttrSet* pSet ); -#ifndef OLD_ATTR_HANDLING SwFont( const SwAttrHandler& rAttrHandler ); -#endif SwFont( const SwFont& rFont ); inline void ChgFnt( ViewShell *pSh, OutputDevice *pOut ) diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx index 77cc0ae23e0b..f4c85a1bcaa0 100644 --- a/sw/source/core/text/frmpaint.cxx +++ b/sw/source/core/text/frmpaint.cxx @@ -2,9 +2,9 @@ * * $RCSfile: frmpaint.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: ama $ $Date: 2001-03-05 14:05:59 $ + * last change: $Author: ama $ $Date: 2001-03-15 15:59:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -521,13 +521,9 @@ sal_Bool SwTxtFrm::PaintEmpty( const SwRect &rRect, sal_Bool bCheck ) const MSHORT nRedlPos = pDoc->GetRedlinePos( rTxtNode ); if( MSHRT_MAX != nRedlPos ) { -#ifndef OLD_ATTR_HANDLING SwAttrHandler aAttrHandler; aAttrHandler.Init( GetTxtNode()->GetSwAttrSet() ); SwRedlineItr aRedln( rTxtNode, *pFnt, aAttrHandler, nRedlPos, sal_True ); -#else - SwRedlineItr aRedln( rTxtNode, *pFnt, nRedlPos, sal_True ); -#endif } } diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx index 5c85d2f4f009..bb6e61d1b071 100644 --- a/sw/source/core/text/itratr.cxx +++ b/sw/source/core/text/itratr.cxx @@ -2,9 +2,9 @@ * * $RCSfile: itratr.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: ama $ $Date: 2001-03-08 10:53:32 $ + * last change: $Author: ama $ $Date: 2001-03-15 15:52:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -183,20 +183,12 @@ using namespace ::com::sun::star; void SwAttrIter::Chg( SwTxtAttr *pHt ) { -#ifndef OLD_ATTR_HANDLING ASSERT( pHt && pFnt, "No attribute of font available for change"); if( pRedln && pRedln->IsOn() ) pRedln->ChangeTxtAttr( pFnt, *pHt, sal_True ); else aAttrHandler.PushAndChg( *pHt, *pFnt ); nChgCnt++; -#else - if( pRedln && pRedln->IsOn() ) - pRedln->ChangeTxtAttr( pFnt, *pHt, sal_True ); - else - pHt->ChgFnt( pFnt ); - nChgCnt++; -#endif } /************************************************************************* @@ -205,7 +197,6 @@ void SwAttrIter::Chg( SwTxtAttr *pHt ) void SwAttrIter::Rst( SwTxtAttr *pHt ) { -#ifndef OLD_ATTR_HANDLING ASSERT( pHt && pFnt, "No attribute of font available for reset"); // get top from stack after removing pHt if( pRedln && pRedln->IsOn() ) @@ -213,13 +204,6 @@ void SwAttrIter::Rst( SwTxtAttr *pHt ) else aAttrHandler.PopAndChg( *pHt, *pFnt ); nChgCnt--; -#else - if( pRedln && pRedln->IsOn() ) - pRedln->ChangeTxtAttr( pFnt, *pHt, sal_False ); - else - pHt->RstFnt( pFnt ); - nChgCnt--; -#endif } /************************************************************************* @@ -437,6 +421,10 @@ sal_Bool SwAttrIter::Seek( const xub_StrLen nNewPos ) if( pRedln ) nChgCnt += pRedln->Seek( *pFnt, nNewPos, nPos ); nPos = nNewPos; + + if( nPropFont ) + pFnt->SetProportion( nPropFont ); + return pFnt->IsFntChg(); } @@ -956,16 +944,14 @@ USHORT SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd ) SwScriptInfo aScriptInfo; SwAttrIter aIter( *(SwTxtNode*)this, aScriptInfo ); -#ifndef OLD_ATTR_HANDLING // We do not want scaling attributes to be considered during this // calculation. For this, we push a temporary scaling attribute with // scaling value 100 and priority flag on top of the scaling stack SwAttrHandler& rAH = aIter.GetAttrHandler(); SvxCharScaleWidthItem aItem; - SwTxtCharScaleWidth aAttr( aItem, nStt, nEnd ); + SwTxtAttrEnd aAttr( aItem, nStt, nEnd ); aAttr.SetPriorityAttr( sal_True ); rAH.PushAndChg( aAttr, *(aIter.GetFnt()) ); -#endif xub_StrLen nIdx = nStt; diff --git a/sw/source/core/text/itratr.hxx b/sw/source/core/text/itratr.hxx index 181b72eb46ed..e3ca6e38adeb 100644 --- a/sw/source/core/text/itratr.hxx +++ b/sw/source/core/text/itratr.hxx @@ -2,9 +2,9 @@ * * $RCSfile: itratr.hxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: ama $ $Date: 2001-03-06 16:22:53 $ + * last change: $Author: ama $ $Date: 2001-03-15 15:53:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -95,10 +95,7 @@ class SwAttrIter friend class SwFontSave; protected: -#ifndef OLD_ATTR_HANDLING SwAttrHandler aAttrHandler; -#endif - ViewShell *pShell; SwFont *pFnt; SwpHints *pHints; diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index f2f343a903a7..75b1521b62cf 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -2,9 +2,9 @@ * * $RCSfile: porlay.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: ama $ $Date: 2001-02-20 10:20:48 $ + * last change: $Author: ama $ $Date: 2001-03-15 15:54:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -512,6 +512,8 @@ void SwScriptInfo::InitScriptInfo( const String& rTxt ) nChg = pBreakIt->xBreak->endOfScript( rTxt, nChg, nScript ); if( nChg < rTxt.Len() ) nScript = pBreakIt->xBreak->getScriptType( rTxt, nChg ); + else + nScript = i18n::ScriptType::LATIN; } do { diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx index 679ec0f0ecca..d8f857758c86 100644 --- a/sw/source/core/text/porrst.cxx +++ b/sw/source/core/text/porrst.cxx @@ -2,9 +2,9 @@ * * $RCSfile: porrst.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: ama $ $Date: 2001-03-06 16:23:45 $ + * last change: $Author: ama $ $Date: 2001-03-15 15:54:33 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -148,11 +148,9 @@ #ifndef _PORFLY_HXX #include <porfly.hxx> // SwFlyPortion #endif -#ifndef OLD_ATTR_HANDLING #ifndef _ATRHNDL_HXX #include <atrhndl.hxx> #endif -#endif /************************************************************************* * class SwTmpEndPortion *************************************************************************/ @@ -378,13 +376,9 @@ SwTwips SwTxtFrm::EmptyHeight() const MSHORT nRedlPos = pDoc->GetRedlinePos( rTxtNode ); if( MSHRT_MAX != nRedlPos ) { -#ifndef OLD_ATTR_HANDLING SwAttrHandler aAttrHandler; aAttrHandler.Init( GetTxtNode()->GetSwAttrSet() ); SwRedlineItr aRedln( rTxtNode, *pFnt, aAttrHandler, nRedlPos, sal_True ); -#else - SwRedlineItr aRedln( rTxtNode, *pFnt, nRedlPos, sal_True ); -#endif } } diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx index 1ea5e8ccda42..bbad9b317bcf 100644 --- a/sw/source/core/text/redlnitr.cxx +++ b/sw/source/core/text/redlnitr.cxx @@ -2,9 +2,9 @@ * * $RCSfile: redlnitr.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: ama $ $Date: 2001-03-08 08:22:27 $ + * last change: $Author: ama $ $Date: 2001-03-15 15:53:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -113,11 +113,9 @@ #ifndef _BREAKIT_HXX #include <breakit.hxx> #endif -#ifndef OLD_ATTR_HANDLING #ifndef _ATRHNDL_HXX #include <atrhndl.hxx> #endif -#endif ////////////////////////// @@ -161,12 +159,8 @@ void SwAttrIter::CtorInit( SwTxtNode& rTxtNode, SwScriptInfo& rScrInf ) delete pFnt; if ( rTxtNode.HasSwAttrSet() ) { -#ifndef OLD_ATTR_HANDLING aAttrHandler.Init( *pAttrSet ); pFnt = new SwFont( aAttrHandler ); -#else - pFnt = new SwFont( pAttrSet ); -#endif } else { @@ -190,12 +184,6 @@ void SwAttrIter::CtorInit( SwTxtNode& rTxtNode, SwScriptInfo& rScrInf ) USHORT nScript = pScriptInfo->GetScriptType( 0 ); xub_StrLen nChg = 0; USHORT nCnt = 0; - if( i18n::ScriptType::WEAK == nScript ) - { - nChg = pScriptInfo->NextScriptChg( 0 ); - if( nChg < rTxtNode.GetTxt().Len() ) - nScript = pScriptInfo->GetScriptType( 0 ); - } // set font to script type of first character switch ( nScript ) { @@ -252,13 +240,8 @@ void SwAttrIter::CtorInit( SwTxtNode& rTxtNode, SwScriptInfo& rScrInf ) nInputStt = pExtInp->Start()->nContent.GetIndex(); } -#ifndef OLD_ATTR_HANDLING pRedln = new SwRedlineItr( rTxtNode, *pFnt, aAttrHandler, nRedlPos, bShow, pArr, nInputStt ); -#else - pRedln = new SwRedlineItr( rTxtNode, *pFnt, nRedlPos, - bShow, pArr, nInputStt ); -#endif if( pRedln->IsOn() ) ++nChgCnt; @@ -283,7 +266,6 @@ void SwAttrIter::CtorInit( SwTxtNode& rTxtNode, SwScriptInfo& rScrInf ) * kein Redline aktiv, nStart und nEnd sind invalid. *************************************************************************/ -#ifndef OLD_ATTR_HANDLING SwRedlineItr::SwRedlineItr( const SwTxtNode& rTxtNd, SwFont& rFnt, SwAttrHandler& rAH, MSHORT nRed, sal_Bool bShw, const SvUShorts *pArr, xub_StrLen nExtStart ) @@ -297,19 +279,6 @@ SwRedlineItr::SwRedlineItr( const SwTxtNode& rTxtNd, SwFont& rFnt, pExt = NULL; Seek( rFnt, 0, STRING_LEN ); } -#else -SwRedlineItr::SwRedlineItr( const SwTxtNode& rTxtNd, SwFont& rFnt, - MSHORT nRed, sal_Bool bShw, const SvUShorts *pArr, xub_StrLen nExtStart ) - : rDoc( *rTxtNd.GetDoc() ), rNd( rTxtNd ), nNdIdx( rTxtNd.GetIndex() ), - nFirst( nRed ), nAct( MSHRT_MAX ), bOn( sal_False ), pSet(0), bShow( bShw ) -{ - if( pArr ) - pExt = new SwExtend( *pArr, nExtStart ); - else - pExt = NULL; - Seek( rFnt, 0, STRING_LEN ); -} -#endif SwRedlineItr::~SwRedlineItr() { @@ -422,11 +391,7 @@ short SwRedlineItr::_Seek( SwFont& rFnt, xub_StrLen nNew, xub_StrLen nOld ) SwTxtAttr* pAttr = ((SwTxtNode&)rNd).MakeTmpTxtAttr(*pItem); pAttr->SetPriorityAttr( sal_True ); aHints.C40_INSERT( SwTxtAttr, pAttr, aHints.Count()); -#ifndef OLD_ATTR_HANDLING rAttrHandler.PushAndChg( *pAttr, rFnt ); -#else - pAttr->ChgFnt( &rFnt ); -#endif if( RES_CHRATR_COLOR == nWhich ) rFnt.SetNoCol( sal_True ); } @@ -461,7 +426,6 @@ void SwRedlineItr::FillHints( MSHORT nAuthor, SwRedlineType eType ) } } -#ifndef OLD_ATTR_HANDLING void SwRedlineItr::ChangeTxtAttr( SwFont* pFnt, SwTxtAttr &rHt, sal_Bool bChg ) { ASSERT( IsOn(), "SwRedlineItr::ChangeTxtAttr: Off?" ); @@ -474,48 +438,6 @@ void SwRedlineItr::ChangeTxtAttr( SwFont* pFnt, SwTxtAttr &rHt, sal_Bool bChg ) else rAttrHandler.PopAndChg( rHt, *pFnt ); } -#endif - -#ifdef OLD_ATTR_HANDLING -void SwRedlineItr::_ChangeTxtAttr( SwFont* pFnt, SwTxtAttr &rHt, sal_Bool bChg ) -{ - ASSERT( IsOn(), "SwRedlineItr::ChangeTxtAttr: Off?" ); - if( ExtOn() ) - pExt->ChangeTxtAttr( rHt, bChg ); - MSHORT nWhich = rHt.Which(); - MSHORT i; - if( RES_TXTATR_CHARFMT == nWhich || RES_TXTATR_INETFMT == nWhich ) - { - for( i = 0; i < aHints.Count(); ++i ) - aHints[ i ]->RstFnt( pFnt ); - if( bChg ) - rHt.ChgFnt( pFnt ); - else - rHt.RstFnt( pFnt ); - for( i = 0; i < aHints.Count(); ++i ) - aHints[ i ]->ChgFnt( pFnt ); - } - else - { - for( i = 0; i < aHints.Count(); ++i ) - { - SwTxtAttr *pPos = aHints[ i ]; - if( pPos->Which() == nWhich ) - { - if( bChg ) - rHt.ChgTxtAttr( *pPos ); - else - rHt.RstTxtAttr( *pPos ); - return; - } - } - if( bChg ) - rHt.ChgFnt( pFnt ); - else - rHt.RstFnt( pFnt ); - } -} -#endif void SwRedlineItr::_Clear( SwFont* pFnt ) { @@ -526,13 +448,9 @@ void SwRedlineItr::_Clear( SwFont* pFnt ) SwTxtAttr *pPos = aHints[ 0 ]; aHints.Remove(0); if( pFnt ) -#ifndef OLD_ATTR_HANDLING rAttrHandler.PopAndChg( *pPos, *pFnt ); else rAttrHandler.Pop( *pPos ); -#else - pPos->RstFnt( pFnt ); -#endif delete pPos; } if( pFnt ) @@ -686,14 +604,3 @@ xub_StrLen SwExtend::Next( xub_StrLen nNext ) } return nNext; } - -#ifdef OLD_ATTR_HANDLING -void SwExtend::ChangeTxtAttr( SwTxtAttr &rHt, sal_Bool bChg ) -{ - ASSERT( pFnt, "SwExtend: No font, no fun." ); - if( bChg ) - rHt.ChgFnt( pFnt ); - else - rHt.RstFnt( pFnt ); -} -#endif diff --git a/sw/source/core/text/redlnitr.hxx b/sw/source/core/text/redlnitr.hxx index 94e853cfa5e0..2ccd0025b2c3 100644 --- a/sw/source/core/text/redlnitr.hxx +++ b/sw/source/core/text/redlnitr.hxx @@ -2,9 +2,9 @@ * * $RCSfile: redlnitr.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: ama $ $Date: 2001-03-08 08:21:32 $ + * last change: $Author: ama $ $Date: 2001-03-15 15:54:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -73,10 +73,7 @@ class SwTxtNode; class SwDoc; class SfxItemSet; - -#ifndef OLD_ATTR_HANDLING class SwAttrHandler; -#endif class SwExtend { @@ -98,9 +95,6 @@ public: { if( pFnt ) return _Leave( rFnt, nNew ); return sal_False; } short Enter( SwFont& rFnt, xub_StrLen nNew ); xub_StrLen Next( xub_StrLen nNext ); -#ifdef OLD_ATTR_HANDLING - void ChangeTxtAttr( SwTxtAttr &rHt, sal_Bool bChg ); -#endif }; class SwRedlineItr @@ -108,9 +102,7 @@ class SwRedlineItr SwpHtStart_SAR aHints; const SwDoc& rDoc; const SwTxtNode& rNd; -#ifndef OLD_ATTR_HANDLING SwAttrHandler& rAttrHandler; -#endif SfxItemSet *pSet; SwExtend *pExt; ULONG nNdIdx; @@ -127,32 +119,18 @@ class SwRedlineItr void FillHints( MSHORT nAuthor, SwRedlineType eType ); short _Seek( SwFont& rFnt, xub_StrLen nNew, xub_StrLen nOld ); xub_StrLen _GetNextRedln( xub_StrLen nNext ); -#ifdef OLD_ATTR_HANDLING - void _ChangeTxtAttr( SwFont* pFnt, SwTxtAttr &rHt, sal_Bool bChg ); -#endif inline short EnterExtend( SwFont& rFnt, xub_StrLen nNew ) { if( pExt ) return pExt->Enter( rFnt, nNew ); return 0; } inline xub_StrLen NextExtend( xub_StrLen nNext ) { if( pExt ) return pExt->Next( nNext ); return nNext; } public: -#ifndef OLD_ATTR_HANDLING SwRedlineItr( const SwTxtNode& rTxtNd, SwFont& rFnt, SwAttrHandler& rAH, xub_StrLen nRedlPos, sal_Bool bShw, const SvUShorts *pArr = 0, xub_StrLen nStart = STRING_LEN ); -#else - SwRedlineItr( const SwTxtNode& rTxtNd, SwFont& rFnt, - xub_StrLen nRedlPos, sal_Bool bShw, const SvUShorts *pArr = 0, - xub_StrLen nStart = STRING_LEN ); -#endif ~SwRedlineItr(); inline sal_Bool IsOn() const { return bOn || ( pExt && pExt->IsOn() ); } inline void Clear( SwFont* pFnt ) { if( bOn ) _Clear( pFnt ); } -#ifndef OLD_ATTR_HANDLING void ChangeTxtAttr( SwFont* pFnt, SwTxtAttr &rHt, sal_Bool bChg ); -#else - inline void ChangeTxtAttr( SwFont* pFnt, SwTxtAttr &rHt, sal_Bool bChg ) - { if( bShow || pExt ) _ChangeTxtAttr( pFnt, rHt, bChg ); } -#endif inline short Seek( SwFont& rFnt, xub_StrLen nNew, xub_StrLen nOld ) { if( bShow || pExt ) return _Seek( rFnt, nNew, nOld ); return 0; } inline void Reset() { if( nAct != nFirst ) nAct = STRING_LEN; diff --git a/sw/source/core/txtnode/atrref.cxx b/sw/source/core/txtnode/atrref.cxx index 220de1ada782..ccd7b8946635 100644 --- a/sw/source/core/txtnode/atrref.cxx +++ b/sw/source/core/txtnode/atrref.cxx @@ -2,9 +2,9 @@ * * $RCSfile: atrref.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: jp $ $Date: 2000-11-06 10:43:55 $ + * last change: $Author: ama $ $Date: 2001-03-15 15:51:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -142,16 +142,3 @@ xub_StrLen* SwTxtRefMark::GetEnd() return pEnd; } -void SwTxtRefMark::ChgFnt( SwFont * pFont ) -{ - ASSERT( pFont->GetRef()<255, "ChgFnt: Ref-Schachtelungstiefe zu gross" ); - pFont->GetRef()++; -} - -void SwTxtRefMark::RstFnt( SwFont * pFont ) -{ - ASSERT( pFont->GetRef(), "RstFnt: Ref-Rst ohne Ref-Chg?" ); - pFont->GetRef()--; -} - - diff --git a/sw/source/core/txtnode/atrtox.cxx b/sw/source/core/txtnode/atrtox.cxx index 48178b5b70d6..7558962ff2c0 100644 --- a/sw/source/core/txtnode/atrtox.cxx +++ b/sw/source/core/txtnode/atrtox.cxx @@ -2,9 +2,9 @@ * * $RCSfile: atrtox.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: jp $ $Date: 2000-11-06 10:43:55 $ + * last change: $Author: ama $ $Date: 2001-03-15 15:52:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -107,18 +107,6 @@ xub_StrLen* SwTxtTOXMark::GetEnd() return pEnd; } -void SwTxtTOXMark::ChgFnt(SwFont *pFont) -{ - ASSERT( pFont->GetTox()<255, "ChgFnt: Tox-Schachtelungstiefe zu gross" ); - pFont->GetTox()++; -} - -void SwTxtTOXMark::RstFnt(SwFont *pFont) -{ - ASSERT( pFont->GetTox(), "RstFnt: Tox-Rst ohne Tox-Chg?" ); - pFont->GetTox()--; -} - void SwTxtTOXMark::CopyTOXMark( SwDoc* pDoc ) { SwTOXMark& rTOX = (SwTOXMark&)GetTOXMark(); @@ -149,6 +137,3 @@ void SwTxtTOXMark::CopyTOXMark( SwDoc* pDoc ) // ((SwTOXType*)pType)->Add( &rTOX ); } - - - diff --git a/sw/source/core/txtnode/makefile.mk b/sw/source/core/txtnode/makefile.mk index ea53e8471c32..eef5d8569249 100644 --- a/sw/source/core/txtnode/makefile.mk +++ b/sw/source/core/txtnode/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.2 $ +# $Revision: 1.3 $ # -# last change: $Author: jp $ $Date: 2000-12-21 09:32:45 $ +# last change: $Author: ama $ $Date: 2001-03-15 15:50:28 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -107,8 +107,6 @@ CXXFILES = \ thints.cxx \ txatbase.cxx \ txatritr.cxx \ - txtatr0.cxx \ - txtatr1.cxx \ txtatr2.cxx \ txtedt.cxx @@ -132,8 +130,6 @@ SLOFILES = \ $(SLO)$/thints.obj \ $(SLO)$/txatbase.obj \ $(SLO)$/txatritr.obj \ - $(SLO)$/txtatr0.obj \ - $(SLO)$/txtatr1.obj \ $(SLO)$/txtatr2.obj \ $(SLO)$/txtedt.obj diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index f7dd4a1682c7..02e1663c3655 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: ama $ $Date: 2001-03-13 09:39:30 $ + * last change: $Author: ama $ $Date: 2001-03-15 15:51:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -149,11 +149,9 @@ #ifndef _SWATRSET_HXX //autogen #include <swatrset.hxx> #endif -#ifndef OLD_ATTR_HANDLING #ifndef _ATRHNDL_HXX #include <atrhndl.hxx> #endif -#endif #include "viewsh.hxx" // Bildschirmabgleich #include "swfont.hxx" @@ -656,7 +654,6 @@ SwFont::SwFont( const SwAttrSet* pAttrSet ) pBackColor = NULL; } -#ifndef OLD_ATTR_HANDLING SwFont::SwFont( const SwAttrHandler& rAttrHandler ) { nActual = SW_LATIN; @@ -775,7 +772,6 @@ SwFont::SwFont( const SwAttrHandler& rAttrHandler ) else pBackColor = NULL; } -#endif SwSubFont& SwSubFont::operator=( const SwSubFont &rFont ) { diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index 0e63ab3ec8db..c9d03083482f 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -2,9 +2,9 @@ * * $RCSfile: thints.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: ama $ $Date: 2001-03-12 09:57:07 $ + * last change: $Author: ama $ $Date: 2001-03-15 15:50:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -90,9 +90,6 @@ #ifndef _SVX_EMPHITEM_HXX //autogen #include <svx/emphitem.hxx> #endif -#ifndef _SVX_TWOLINESITEM_HXX -#include <svx/twolinesitem.hxx> -#endif #ifndef _SVX_CHARSCALEITEM_HXX #include <svx/charscaleitem.hxx> #endif @@ -231,71 +228,43 @@ SwTxtAttr* SwTxtNode::MakeTxtAttr( const SfxPoolItem& rAttr, rAttr; SwTxtAttr* pNew = 0; - BYTE nScript = SW_LATIN; switch( rNew.Which() ) { case RES_CHRATR_CASEMAP: - pNew = new SwTxtCaseMap( (SvxCaseMapItem&)rNew, nStt, nEnd ); - break; case RES_CHRATR_COLOR: - pNew = new SwTxtColor( (SvxColorItem&)rNew, nStt, nEnd ); - break; case RES_CHRATR_CHARSETCOLOR: - pNew = new SwTxtCharSetColor( (SvxCharSetColorItem&)rNew, nStt, nEnd ); - break; case RES_CHRATR_CONTOUR: - pNew = new SwTxtContour( (SvxContourItem&)rNew, nStt, nEnd ); - break; case RES_CHRATR_CROSSEDOUT: - pNew = new SwTxtCrossedOut( (SvxCrossedOutItem&)rNew, nStt, nEnd ); - break; case RES_CHRATR_ESCAPEMENT: - pNew = new SwTxtEscapement( (SvxEscapementItem&)rNew, nStt, nEnd ); - break; - case RES_CHRATR_CTL_FONT: nScript += SW_CTL - SW_CJK; // no break; - case RES_CHRATR_CJK_FONT: nScript += SW_CJK - SW_LATIN; // no break; - case RES_CHRATR_FONT: - pNew = new SwTxtFont( (SvxFontItem&)rNew, nStt, nEnd, nScript ); - break; - case RES_CHRATR_CTL_FONTSIZE: nScript += SW_CTL - SW_CJK; // no break; - case RES_CHRATR_CJK_FONTSIZE: nScript += SW_CJK - SW_LATIN; // no break; - case RES_CHRATR_FONTSIZE: - pNew = new SwTxtSize( (SvxFontHeightItem&)rNew, nStt, nEnd, nScript ); - break; case RES_CHRATR_KERNING: - pNew = new SwTxtKerning( (SvxKerningItem&)rNew, nStt, nEnd ); - break; - case RES_CHRATR_CTL_LANGUAGE: nScript += SW_CTL - SW_CJK; // no break; - case RES_CHRATR_CJK_LANGUAGE: nScript += SW_CJK - SW_LATIN; // no break; - case RES_CHRATR_LANGUAGE: - pNew = new SwTxtLanguage( (SvxLanguageItem&)rNew, nStt, nEnd, nScript ); - break; - case RES_CHRATR_CTL_POSTURE: nScript += SW_CTL - SW_CJK; // no break; - case RES_CHRATR_CJK_POSTURE: nScript += SW_CJK - SW_LATIN; // no break; - case RES_CHRATR_POSTURE: - pNew = new SwTxtPosture( (SvxPostureItem&)rNew, nStt, nEnd, nScript ); - break; case RES_CHRATR_SHADOWED: - pNew = new SwTxtShadowed( (SvxShadowedItem&)rNew, nStt, nEnd ); - break; case RES_CHRATR_AUTOKERN: - pNew = new SwTxtAutoKern( (SvxAutoKernItem&)rNew, nStt, nEnd ); - break; case RES_CHRATR_WORDLINEMODE: - pNew = new SwTxtWordLineMode( (SvxWordLineModeItem&)rNew, nStt, nEnd ); - break; case RES_CHRATR_UNDERLINE: - pNew = new SwTxtUnderline( (SvxUnderlineItem&)rNew, nStt, nEnd ); - break; - case RES_CHRATR_CTL_WEIGHT: nScript += SW_CTL - SW_CJK; // no break; - case RES_CHRATR_CJK_WEIGHT: nScript += SW_CJK - SW_LATIN; // no break; + case RES_CHRATR_FONT: + case RES_CHRATR_CTL_FONT: + case RES_CHRATR_CJK_FONT: + case RES_CHRATR_FONTSIZE: + case RES_CHRATR_CTL_FONTSIZE: + case RES_CHRATR_CJK_FONTSIZE: + case RES_CHRATR_LANGUAGE: + case RES_CHRATR_CTL_LANGUAGE: + case RES_CHRATR_CJK_LANGUAGE: + case RES_CHRATR_POSTURE: + case RES_CHRATR_CTL_POSTURE: + case RES_CHRATR_CJK_POSTURE: case RES_CHRATR_WEIGHT: - pNew = new SwTxtWeight( (SvxWeightItem&)rNew, nStt, nEnd, nScript ); - break; + case RES_CHRATR_CTL_WEIGHT: + case RES_CHRATR_CJK_WEIGHT: case RES_CHRATR_EMPHASIS_MARK: - pNew = new SwTxtEmphasisMark( (SvxEmphasisMarkItem&)rNew, nStt, nEnd ); + case RES_CHRATR_NOHYPHEN: + case RES_CHRATR_BLINK: + case RES_CHRATR_BACKGROUND: + case RES_CHRATR_ROTATE: + case RES_CHRATR_SCALEW: + case RES_CHRATR_RELIEF: + pNew = new SwTxtAttrEnd( rNew, nStt, nEnd ); break; - case RES_TXTATR_CHARFMT: { SwFmtCharFmt &rFmtCharFmt = (SwFmtCharFmt&) rNew; @@ -330,27 +299,9 @@ SwTxtAttr* SwTxtNode::MakeTxtAttr( const SfxPoolItem& rAttr, case RES_TXTATR_HARDBLANK: pNew = new SwTxtHardBlank( (SwFmtHardBlank&)rNew, nStt ); break; - case RES_CHRATR_NOHYPHEN: - pNew = new SwTxtNoHyphenHere( (SvxNoHyphenItem&)rNew, nStt, nEnd ); - break; - case RES_CHRATR_BLINK: - pNew = new SwTxtBlink( (SvxBlinkItem&)rNew, nStt, nEnd ); - break; - case RES_CHRATR_BACKGROUND: - pNew = new SwTxtBackground( (SvxBrushItem&)rNew, nStt, nEnd ); - break; case RES_CHRATR_TWO_LINES: pNew = new SwTxt2Lines( (SvxTwoLinesItem&)rNew, nStt, nEnd ); break; - case RES_CHRATR_ROTATE: - pNew = new SwTxtCharRotate( (SvxCharRotateItem&)rNew, nStt, nEnd ); - break; - case RES_CHRATR_SCALEW: - pNew = new SwTxtCharScaleWidth( (SvxCharScaleWidthItem&)rNew, nStt, nEnd ); - break; - case RES_CHRATR_RELIEF: - pNew = new SwTxtAttrEnd( rNew, nStt, nEnd ); - break; case RES_TXTATR_REFMARK: pNew = nStt == nEnd ? new SwTxtRefMark( (SwFmtRefMark&)rNew, nStt ) diff --git a/sw/source/core/txtnode/txatbase.cxx b/sw/source/core/txtnode/txatbase.cxx index ffd8e98e3840..a2933ff256f5 100644 --- a/sw/source/core/txtnode/txatbase.cxx +++ b/sw/source/core/txtnode/txatbase.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txatbase.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: ama $ $Date: 2001-03-06 16:08:39 $ + * last change: $Author: ama $ $Date: 2001-03-15 15:51:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -68,10 +68,6 @@ #ifndef _SFXITEMPOOL_HXX #include <svtools/itempool.hxx> #endif - -#ifndef _SWTYPES_HXX -#include <swtypes.hxx> -#endif #ifndef _TXATBASE_HXX #include <txatbase.hxx> #endif @@ -105,32 +101,13 @@ int SwTxtAttr::operator==( const SwTxtAttr& rAttr ) const return GetAttr() == rAttr.GetAttr(); } -void SwTxtAttr::ChgFnt(SwFont *) -{ -} - -void SwTxtAttr::RstFnt(SwFont *) -{ -} - SwTxtAttrEnd::SwTxtAttrEnd( const SfxPoolItem& rAttr, xub_StrLen nS, xub_StrLen nE ) : SwTxtAttr( rAttr, nS ), nEnd( nE ) { } -void SwTxtAttr::ChgTxtAttr( SwTxtAttr & ) -{ -} - -void SwTxtAttr::RstTxtAttr( SwTxtAttr & ) -{ -} - xub_StrLen* SwTxtAttrEnd::GetEnd() { return &nEnd; } - - - diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx index 9f10eedb0c1e..d4d04e24a9c4 100644 --- a/sw/source/core/txtnode/txtatr2.cxx +++ b/sw/source/core/txtnode/txtatr2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtatr2.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: jp $ $Date: 2001-02-15 20:09:26 $ + * last change: $Author: ama $ $Date: 2001-03-15 15:49:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -68,49 +68,15 @@ #ifndef _HINTIDS_HXX #include <hintids.hxx> #endif - #ifndef _SFX_OBJSH_HXX //autogen #include <sfx2/objsh.hxx> #endif - #ifndef _XMLOFF_XMLCNITM_HXX #include <xmloff/xmlcnitm.hxx> #endif - -#ifndef _SVX_LANGITEM_HXX //autogen -#include <svx/langitem.hxx> -#endif -#ifndef _SVX_KERNITEM_HXX //autogen -#include <svx/kernitem.hxx> -#endif -#ifndef _SVX_NHYPITEM_HXX //autogen -#include <svx/nhypitem.hxx> -#endif -#ifndef _SVX_BLNKITEM_HXX //autogen -#include <svx/blnkitem.hxx> -#endif -#ifndef _SVX_CMAPITEM_HXX //autogen -#include <svx/cmapitem.hxx> -#endif -#ifndef _SVX_ESCPITEM_HXX //autogen -#include <svx/escpitem.hxx> -#endif -#ifndef _SVX_BRSHITEM_HXX //autogen -#include <svx/brshitem.hxx> -#endif -#ifndef _SVX_EMPHITEM_HXX //autogen -#include <svx/emphitem.hxx> -#endif #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 _TXTINET_HXX //autogen #include <txtinet.hxx> #endif @@ -123,21 +89,9 @@ #ifndef _FMTINFMT_HXX //autogen #include <fmtinfmt.hxx> #endif -#ifndef _CHARATR_HXX -#include <charatr.hxx> -#endif -#ifndef _FRMATR_HXX -#include <frmatr.hxx> -#endif #ifndef _CHARFMT_HXX //autogen #include <charfmt.hxx> #endif -#ifndef _SWFONT_HXX -#include <swfont.hxx> -#endif -#ifndef _FNTCACHE_HXX -#include <fntcache.hxx> // SwFntAccess -#endif #ifndef _NDTXT_HXX #include <ndtxt.hxx> // SwCharFmt, SwTxtNode #endif @@ -153,82 +107,26 @@ #ifndef _FMTRUBY_HXX #include <fmtruby.hxx> #endif +#ifndef _FMTHBSH_HXX //autogen +#include <fmthbsh.hxx> +#endif TYPEINIT1(SwTxtINetFmt,SwClient); TYPEINIT1(SwTxtRuby,SwClient); - /************************************************************************* - * class SwImplPrev - * Internal structur for SwTxtCharFmt- und SwTxtINetFmt-attributs to store - * the actual fonts (Latin, CJK and CTL), change them and restore them. + * class SwTxtHardBlank *************************************************************************/ -class SwImplPrev -{ - Color* pPrevColor; - SvxFont* pPrevLatin; - SvxFont* pPrevCJK; - SvxFont* pPrevCTL; - const void* pLatinNo; - const void* pCJKNo; - const void* pCTLNo; - USHORT nLatinIndex; - USHORT nCJKIndex; - USHORT nCTLIndex; -public: - SwImplPrev(): pPrevColor(0), pPrevLatin(0), pPrevCJK(0), pPrevCTL(0) {} - ~SwImplPrev() - { delete pPrevColor; delete pPrevLatin; delete pPrevCJK; delete pPrevCTL; } - BOOL ChangeFont( SwFont *pFont, SwCharFmt *pFmt ); - void ResetFont( SwFont* pFont, const BOOL bColor ); -}; - -BOOL SwImplPrev::ChangeFont( SwFont* pFont, SwCharFmt* pFmt ) +SwTxtHardBlank::SwTxtHardBlank( const SwFmtHardBlank& rAttr, xub_StrLen nStart ) + : SwTxtAttr( rAttr, nStart ), + cChar( rAttr.GetChar() ) { - if ( pPrevLatin ) - { - *pPrevLatin = pFont->GetFnt( SW_LATIN ); - *pPrevCJK = pFont->GetFnt( SW_CJK ); - *pPrevCTL = pFont->GetFnt( SW_CTL ); - } - else - { - pPrevLatin = new SvxFont( pFont->GetFnt( SW_LATIN ) ); - pPrevCJK = new SvxFont( pFont->GetFnt( SW_CJK ) ); - pPrevCTL = new SvxFont( pFont->GetFnt( SW_CTL ) ); - } - pFont->GetMagic( pLatinNo, nLatinIndex, SW_LATIN ); - pFont->GetMagic( pCJKNo, nCJKIndex, SW_CJK ); - pFont->GetMagic( pCTLNo, nCTLIndex, SW_CTL ); - pFont->SetDiffFnt( &pFmt->GetAttrSet() ); - delete pPrevColor; - BOOL bRet = SFX_ITEM_SET == - pFmt->GetAttrSet().GetItemState( RES_CHRATR_BACKGROUND, TRUE ); - if( bRet ) - { - pPrevColor = new Color( pFmt->GetChrBackground().GetColor() ); - pPrevColor = pFont->XChgBackColor( pPrevColor ); - } - else - pPrevColor = NULL; - return bRet; + ASSERT( ' ' != cChar && '-' != cChar, + "Invalid character for the HardBlank attribute - " + "must be a normal unicode character" ); } -void SwImplPrev::ResetFont( SwFont* pFont, const BOOL bColor ) -{ - pFont->SetFnt( *pPrevLatin, SW_LATIN ); - pFont->SetFnt( *pPrevCJK, SW_CJK ); - pFont->SetFnt( *pPrevCTL, SW_CTL ); - pFont->SetMagic( pLatinNo, nLatinIndex, SW_LATIN ); - pFont->SetMagic( pCJKNo, nCJKIndex, SW_CJK ); - pFont->SetMagic( pCTLNo, nCTLIndex, SW_CTL ); - if( bColor ) - { - pFont->SetBackColor( pPrevColor ); - pPrevColor = NULL; - } -} /************************************************************************* * class SwTxtCharFmt @@ -237,7 +135,6 @@ void SwImplPrev::ResetFont( SwFont* pFont, const BOOL bColor ) SwTxtCharFmt::SwTxtCharFmt( const SwFmtCharFmt& rAttr, xub_StrLen nStart, xub_StrLen nEnd ) : SwTxtAttrEnd( rAttr, nStart, nEnd ), - pImpl( NULL ), pMyTxtNd( 0 ) { ((SwFmtCharFmt&)rAttr).pTxtAttr = this; @@ -246,34 +143,6 @@ SwTxtCharFmt::SwTxtCharFmt( const SwFmtCharFmt& rAttr, SwTxtCharFmt::~SwTxtCharFmt( ) { - delete pImpl; -} - -void SwTxtCharFmt::ChgFnt( SwFont *pFont ) -{ - SwCharFmt* pFmt = SwTxtAttrEnd::GetCharFmt().GetCharFmt(); - if ( pFmt ) - { - if( !pImpl ) - pImpl = new SwImplPrev(); - bPrevNoHyph = pFont->IsNoHyph(); - bPrevBlink = pFont->IsBlink(); - bPrevURL = pFont->IsURL(); - bColor = pImpl->ChangeFont( pFont, pFmt ); - } -} - -void SwTxtCharFmt::RstFnt(SwFont *pFont) -{ - if ( pImpl ) - { - pFont->SetBlink( bPrevBlink ); - pFont->SetNoHyph( bPrevNoHyph ); - pFont->SetURL( bPrevURL ); - pImpl->ResetFont( pFont, bColor ); - delete pImpl; - pImpl = NULL; - } } void SwTxtCharFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) @@ -313,8 +182,7 @@ SwTxtINetFmt::SwTxtINetFmt( const SwFmtINetFmt& rAttr, xub_StrLen nStart, xub_StrLen nEnd ) : SwTxtAttrEnd( rAttr, nStart, nEnd ), SwClient( 0 ), - pMyTxtNd( 0 ), - pImpl( 0 ) + pMyTxtNd( 0 ) { bValidVis = FALSE; ((SwFmtINetFmt&)rAttr).pTxtAttr = this; @@ -323,21 +191,6 @@ SwTxtINetFmt::SwTxtINetFmt( const SwFmtINetFmt& rAttr, SwTxtINetFmt::~SwTxtINetFmt( ) { - delete pImpl; -} -void SwTxtINetFmt::ChgFnt( SwFont *pFont ) -{ - SwCharFmt* pFmt = GetCharFmt(); - if( pFmt ) - { - if( !pImpl ) - pImpl = new SwImplPrev(); - bPrevNoHyph = pFont->IsNoHyph(); - bPrevBlink = pFont->IsBlink(); - bPrevURL = pFont->IsURL(); - pFont->SetURL( TRUE ); - bColor = pImpl->ChangeFont( pFont, pFmt ); - } } SwCharFmt* SwTxtINetFmt::GetCharFmt() @@ -390,20 +243,6 @@ SwCharFmt* SwTxtINetFmt::GetCharFmt() return pRet; } -void SwTxtINetFmt::RstFnt(SwFont *pFont) -{ - const SwFmtINetFmt& rFmt = SwTxtAttrEnd::GetINetFmt(); - if( pImpl && rFmt.GetValue().Len() ) - { - pFont->SetBlink( bPrevBlink ); - pFont->SetNoHyph( bPrevNoHyph ); - pFont->SetURL( bPrevURL ); - pImpl->ResetFont( pFont, bColor ); - delete pImpl; - pImpl = NULL; - } -} - void SwTxtINetFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) { USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0; @@ -438,235 +277,6 @@ BOOL SwTxtINetFmt::IsProtect( ) const return pMyTxtNd && pMyTxtNd->IsProtect(); } -/************************************************************************* - * class SwTxtEscapement - *************************************************************************/ - -SwTxtEscapement::SwTxtEscapement( const SvxEscapementItem& rAttr, - USHORT nStart, USHORT nEnd ) - : SwTxtAttrEnd( rAttr, nStart, nEnd ) -{} - -void SwTxtEscapement::ChgFnt(SwFont *pFont) -{ - short nNewEsc = GetEscapement().GetEsc(); - BYTE nNewPropr = GetEscapement().GetProp(); - if( !nNewEsc ) - nNewPropr = 100; - nPrevEsc = pFont->GetEscapement(); - nPrevPropr = pFont->GetPropr(); - pFont->SetEscapement( nNewEsc ); - pFont->SetProportion( nNewPropr ); -} - -void SwTxtEscapement::RstFnt(SwFont *pFont) -{ - pFont->SetEscapement( nPrevEsc ); - pFont->SetProportion( nPrevPropr ); -} - -void SwTxtEscapement::ChgTxtAttr( SwTxtAttr &rAttr ) -{ - nPrevEsc = ((SwTxtEscapement&)rAttr).nPrevEsc; - nPrevPropr = ((SwTxtEscapement&)rAttr).nPrevPropr; - short nNewEsc = GetEscapement().GetEsc(); - BYTE nNewPropr = GetEscapement().GetProp(); - if( !nNewEsc ) - nNewPropr = 100; - ((SwTxtEscapement&)rAttr).nPrevEsc = nNewEsc; - ((SwTxtEscapement&)rAttr).nPrevPropr = nNewPropr; -} - -void SwTxtEscapement::RstTxtAttr( SwTxtAttr &rAttr ) -{ - ((SwTxtEscapement&)rAttr).nPrevEsc = nPrevEsc; - ((SwTxtEscapement&)rAttr).nPrevPropr = nPrevPropr; -} - -/************************************************************************* - * class SwTxtCaseMap - *************************************************************************/ - -SwTxtCaseMap::SwTxtCaseMap( const SvxCaseMapItem& rAttr, - xub_StrLen nStart, xub_StrLen nEnd ) - : SwTxtAttrEnd( rAttr, nStart, nEnd ) -{} - -void SwTxtCaseMap::ChgFnt(SwFont *pFont) -{ - ePrevCaseMap = pFont->GetCaseMap(); - pFont->SetCaseMap( GetCaseMap().GetCaseMap() ); -} - -void SwTxtCaseMap::RstFnt(SwFont *pFont) -{ - pFont->SetCaseMap( ePrevCaseMap ); -} - -void SwTxtCaseMap::ChgTxtAttr( SwTxtAttr &rAttr ) -{ - ePrevCaseMap = ((SwTxtCaseMap&)rAttr).ePrevCaseMap; - ((SwTxtCaseMap&)rAttr).ePrevCaseMap = GetCaseMap().GetCaseMap(); -} - -void SwTxtCaseMap::RstTxtAttr( SwTxtAttr &rAttr ) -{ - ((SwTxtCaseMap&)rAttr).ePrevCaseMap = ePrevCaseMap; -} - -/************************************************************************* - * class SwTxtBlink - *************************************************************************/ - -SwTxtBlink::SwTxtBlink( const SvxBlinkItem& rAttr, - xub_StrLen nStart, xub_StrLen nEnd ) - : SwTxtAttrEnd( rAttr, nStart, nEnd ) -{} - -void SwTxtBlink::ChgFnt(SwFont *pFont) -{ - bPrev = pFont->IsBlink(); - pFont->SetBlink( GetBlink().GetValue() ); -} - -void SwTxtBlink::RstFnt(SwFont *pFont) -{ - pFont->SetBlink( bPrev ); -} - -void SwTxtBlink::ChgTxtAttr( SwTxtAttr &rAttr ) -{ - bPrev = ((SwTxtBlink&)rAttr).bPrev; - ((SwTxtBlink&)rAttr).bPrev = GetBlink().GetValue(); -} - -void SwTxtBlink::RstTxtAttr( SwTxtAttr &rAttr ) -{ - ((SwTxtBlink&)rAttr).bPrev = bPrev; -} - -/************************************************************************* - * class SwTxtBackground - *************************************************************************/ - -SwTxtBackground::SwTxtBackground( const SvxBrushItem& rAttr, - xub_StrLen nStart, xub_StrLen nEnd ) - : SwTxtAttrEnd( rAttr, nStart, nEnd ), - pPrevColor( NULL ) -{ -#ifdef JP_DEBUG - SetDontExpand( TRUE ); // never expand this attribut - SetLockExpandFlag( TRUE ); - SetDontMergeAttr( TRUE ); -#endif -} - -SwTxtBackground::~SwTxtBackground( ) -{ - delete pPrevColor; -} - -void SwTxtBackground::ChgFnt(SwFont *pFont) -{ - delete pPrevColor; - pPrevColor = new Color( GetChrBackground().GetColor() ); - pPrevColor = pFont->XChgBackColor( pPrevColor ); -} - -void SwTxtBackground::RstFnt(SwFont *pFont) -{ - pFont->SetBackColor( pPrevColor ); - pPrevColor = NULL; -} - -void SwTxtBackground::ChgTxtAttr( SwTxtAttr &rAttr ) -{ - delete pPrevColor; - pPrevColor = ((SwTxtBackground&)rAttr).pPrevColor; - ((SwTxtBackground&)rAttr).pPrevColor = - new Color( GetChrBackground().GetColor() ); -} - -void SwTxtBackground::RstTxtAttr( SwTxtAttr &rAttr ) -{ - delete ((SwTxtBackground&)rAttr).pPrevColor; - ((SwTxtBackground&)rAttr).pPrevColor = pPrevColor; - pPrevColor = NULL; -} - -/************************************************************************* - * class SwTxtNoHyphHere - *************************************************************************/ - -SwTxtNoHyphenHere::SwTxtNoHyphenHere( const SvxNoHyphenItem& rAttr, - xub_StrLen nStart, xub_StrLen nEnd ) - : SwTxtAttrEnd( rAttr, nStart, nEnd ) -{} - -void SwTxtNoHyphenHere::ChgFnt(SwFont *pFont) -{ - bPrev = pFont->IsNoHyph(); - pFont->SetNoHyph( GetNoHyphenHere().GetValue() ); -} - -void SwTxtNoHyphenHere::RstFnt(SwFont *pFont) -{ - pFont->SetNoHyph( bPrev ); -} - -/************************************************************************* - * class SwTxtKerning - *************************************************************************/ - -SwTxtKerning::SwTxtKerning( const SvxKerningItem& rAttr, - xub_StrLen nStart, xub_StrLen nEnd ) - : SwTxtAttrEnd( rAttr, nStart, nEnd ) -{} - -void SwTxtKerning::ChgFnt( SwFont *pFont ) -{ - const SvxKerningItem& rAttr = GetKerning(); - nPrevKern = pFont->GetFixKerning(); - pFont->SetFixKerning( rAttr.GetValue() ); -} - -void SwTxtKerning::RstFnt( SwFont *pFont ) -{ - pFont->SetFixKerning( nPrevKern ); -} - -void SwTxtKerning::ChgTxtAttr( SwTxtAttr &rAttr ) -{ - nPrevKern = ((SwTxtKerning&)rAttr).nPrevKern; - ((SwTxtKerning&)rAttr).nPrevKern = GetKerning().GetValue(); -} - -void SwTxtKerning::RstTxtAttr( SwTxtAttr &rAttr ) -{ - ((SwTxtKerning&)rAttr).nPrevKern = nPrevKern; -} - -/************************************************************************* - * class SwTxtLanguage - *************************************************************************/ - -SwTxtLanguage::SwTxtLanguage( const SvxLanguageItem& rAttr, - xub_StrLen nStart, xub_StrLen nEnd, const BYTE nScrpt ) - : SwTxtAttrEnd( rAttr, nStart, nEnd ), nScript( nScrpt ) -{} - -void SwTxtLanguage::ChgFnt( SwFont *pFont ) -{ - ePrevLang = pFont->GetLanguage( nScript ); - pFont->SetLanguage( ((SvxLanguageItem&)GetAttr()).GetLanguage(), nScript ); -} - -void SwTxtLanguage::RstFnt( SwFont *pFont ) -{ - pFont->SetLanguage( ePrevLang, nScript ); -} - - // ATT_XNLCONTAINERITEM ****************************** SwTxtXMLAttrContainer::SwTxtXMLAttrContainer( @@ -695,15 +305,6 @@ SwTxtRuby::~SwTxtRuby() { } -/* -void SwTxtRuby::ChgFnt(SwFont *) -{ -} -void SwTxtRuby::RstFnt(SwFont *) -{ -} -*/ - void SwTxtRuby::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) { USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0; @@ -780,89 +381,3 @@ SwTxt2Lines::SwTxt2Lines( const SvxTwoLinesItem& rAttr, { } -// ****************************** - -SwTxtEmphasisMark::SwTxtEmphasisMark( const SvxEmphasisMarkItem& rAttr, - xub_StrLen nStart, xub_StrLen nEnd ) - : SwTxtAttrEnd( rAttr, nStart, nEnd ) -{} - -void SwTxtEmphasisMark::ChgFnt(SwFont *pFont) -{ - ePrevEmphasis = pFont->GetEmphasisMark(); - pFont->SetEmphasisMark( GetEmphasisMark().GetEmphasisMark() ); -} - -void SwTxtEmphasisMark::RstFnt(SwFont *pFont) -{ - pFont->SetEmphasisMark( ePrevEmphasis ); -} - -void SwTxtEmphasisMark::ChgTxtAttr( SwTxtAttr &rAttr ) -{ - ePrevEmphasis = ((SwTxtEmphasisMark&)rAttr).ePrevEmphasis; - ((SwTxtEmphasisMark&)rAttr).ePrevEmphasis = GetEmphasisMark().GetEmphasisMark(); -} - -void SwTxtEmphasisMark::RstTxtAttr( SwTxtAttr &rAttr ) -{ - ((SwTxtEmphasisMark&)rAttr).ePrevEmphasis = ePrevEmphasis; -} - -// ****************************** - -SwTxtCharRotate::SwTxtCharRotate( const SvxCharRotateItem& rAttr, - xub_StrLen nStart, xub_StrLen nEnd ) - : SwTxtAttrEnd( rAttr, nStart, nEnd ) -{ -} - -void SwTxtCharRotate::ChgFnt( SwFont* pFont ) -{ - nPrevRotate = pFont->GetOrientation(); - pFont->SetVertical( GetCharRotate().GetValue() ); -} - -void SwTxtCharRotate::RstFnt( SwFont* pFont ) -{ - pFont->SetVertical( nPrevRotate ); -} - -void SwTxtCharRotate::ChgTxtAttr( SwTxtAttr & rAttr ) -{ - nPrevRotate = ((SwTxtCharRotate&)rAttr).nPrevRotate; - ((SwTxtCharRotate&)rAttr).nPrevRotate = GetCharRotate().GetValue(); -} - -void SwTxtCharRotate::RstTxtAttr( SwTxtAttr & rAttr ) -{ - ((SwTxtCharRotate&)rAttr).nPrevRotate = nPrevRotate; -} - -// ****************************** - -SwTxtCharScaleWidth::SwTxtCharScaleWidth( const SvxCharScaleWidthItem& rAttr, - xub_StrLen nStart, xub_StrLen nEnd ) - : SwTxtAttrEnd( rAttr, nStart, nEnd ) -{ -} - -void SwTxtCharScaleWidth::ChgFnt( SwFont* pFont ) -{ - nPrevScale = pFont->GetPropWidth(); - pFont->SetPropWidth( GetCharScaleW().GetValue() ); -} -void SwTxtCharScaleWidth::RstFnt(SwFont * pFont ) -{ - pFont->SetPropWidth( nPrevScale ); -} -void SwTxtCharScaleWidth::ChgTxtAttr( SwTxtAttr & rAttr ) -{ - nPrevScale = ((SwTxtCharScaleWidth&)rAttr).nPrevScale; - ((SwTxtCharScaleWidth&)rAttr).nPrevScale = GetCharScaleW().GetValue(); -} -void SwTxtCharScaleWidth::RstTxtAttr( SwTxtAttr & rAttr ) -{ - ((SwTxtCharScaleWidth&)rAttr).nPrevScale = nPrevScale; -} - |