From 6829122e78bc5614930e1b03595ef74eece941ff Mon Sep 17 00:00:00 2001 From: Frank Meies Date: Thu, 28 Feb 2002 11:42:19 +0000 Subject: #95586# Accessibility - Handling of text portions --- sw/source/core/text/porexp.hxx | 14 ++++-- sw/source/core/text/porfld.hxx | 8 +-- sw/source/core/text/porftn.hxx | 8 +-- sw/source/core/text/porglue.cxx | 14 +----- sw/source/core/text/porglue.hxx | 5 +- sw/source/core/text/porhyph.hxx | 17 +++++-- sw/source/core/text/porlin.cxx | 11 +++-- sw/source/core/text/porlin.hxx | 10 ++-- sw/source/core/text/pormulti.cxx | 103 ++++++++++++++++++++++++++++++++++++++- sw/source/core/text/pormulti.hxx | 36 +++++++++++++- sw/source/core/text/porrst.cxx | 20 +++++--- sw/source/core/text/porrst.hxx | 9 ++-- sw/source/core/text/portab.hxx | 8 ++- sw/source/core/text/portxt.cxx | 25 +++++++++- sw/source/core/text/portxt.hxx | 11 ++++- sw/source/core/text/txttab.cxx | 18 ++++++- 16 files changed, 257 insertions(+), 60 deletions(-) (limited to 'sw/source/core') diff --git a/sw/source/core/text/porexp.hxx b/sw/source/core/text/porexp.hxx index c370dab3f518..0c96c931ade8 100644 --- a/sw/source/core/text/porexp.hxx +++ b/sw/source/core/text/porexp.hxx @@ -2,9 +2,9 @@ * * $RCSfile: porexp.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: fme $ $Date: 2002-02-19 14:54:01 $ + * last change: $Author: fme $ $Date: 2002-02-28 12:42:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -75,9 +75,12 @@ public: virtual sal_Bool Format( SwTxtFormatInfo &rInf ); virtual xub_StrLen GetCrsrOfst( const MSHORT nOfst ) const; virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const; - virtual void HandlePortion( SwPortionHandler& rPH ) const; virtual SwPosSize GetTxtSize( const SwTxtSizeInfo &rInfo ) const; virtual void Paint( const SwTxtPaintInfo &rInf ) const; + + // Accessibility: pass information about this portion to the PortionHandler + virtual void HandlePortion( SwPortionHandler& rPH ) const; + OUTPUT_OPERATOR }; @@ -100,12 +103,15 @@ public: virtual SwLinePortion *Compress(); virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const; - virtual void HandlePortion( SwPortionHandler& rPH ) const; virtual void FormatEOL( SwTxtFormatInfo &rInf ); virtual sal_Bool Format( SwTxtFormatInfo &rInf ); virtual void Paint( const SwTxtPaintInfo &rInf ) const; MSHORT MayUnderFlow( const SwTxtFormatInfo &rInf, xub_StrLen nIdx, sal_Bool bUnderFlow ) const; + + // Accessibility: pass information about this portion to the PortionHandler + virtual void HandlePortion( SwPortionHandler& rPH ) const; + OUTPUT_OPERATOR }; diff --git a/sw/source/core/text/porfld.hxx b/sw/source/core/text/porfld.hxx index 07a834375ea4..1eacbd59846f 100644 --- a/sw/source/core/text/porfld.hxx +++ b/sw/source/core/text/porfld.hxx @@ -2,9 +2,9 @@ * * $RCSfile: porfld.hxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: fme $ $Date: 2002-02-19 14:55:40 $ + * last change: $Author: fme $ $Date: 2002-02-28 12:42:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -107,7 +107,6 @@ public: inline const XubString &GetExp() const { return aExpand; } virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const; - virtual void HandlePortion( SwPortionHandler& rPH ) const; virtual sal_Bool Format( SwTxtFormatInfo &rInf ); virtual void Paint( const SwTxtPaintInfo &rInf ) const; @@ -140,6 +139,9 @@ public: // Extra-GetTxtSize wegen pFnt virtual SwPosSize GetTxtSize( const SwTxtSizeInfo &rInfo ) const; + // Accessibility: pass information about this portion to the PortionHandler + virtual void HandlePortion( SwPortionHandler& rPH ) const; + OUTPUT_OPERATOR }; diff --git a/sw/source/core/text/porftn.hxx b/sw/source/core/text/porftn.hxx index d84580b8245c..a41d6f719df1 100644 --- a/sw/source/core/text/porftn.hxx +++ b/sw/source/core/text/porftn.hxx @@ -2,9 +2,9 @@ * * $RCSfile: porftn.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: fme $ $Date: 2002-02-19 14:56:37 $ + * last change: $Author: fme $ $Date: 2002-02-28 12:42:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -114,7 +114,6 @@ public: virtual sal_Bool Format( SwTxtFormatInfo &rInf ); virtual void Paint( const SwTxtPaintInfo &rInf ) const; virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const; - virtual void HandlePortion( SwPortionHandler& rPH ) const; inline void SetNumber( const XubString& rStr ) { aErgo = rStr; } inline const XubString &GetQuoTxt() const { return aExpand; } @@ -122,6 +121,9 @@ public: // Felder-Cloner fuer SplitGlue virtual SwFldPortion *Clone( const XubString &rExpand ) const; + // Accessibility: pass information about this portion to the PortionHandler + virtual void HandlePortion( SwPortionHandler& rPH ) const; + OUTPUT_OPERATOR }; diff --git a/sw/source/core/text/porglue.cxx b/sw/source/core/text/porglue.cxx index d2958d7cd0d7..9e4a48f2241f 100644 --- a/sw/source/core/text/porglue.cxx +++ b/sw/source/core/text/porglue.cxx @@ -2,9 +2,9 @@ * * $RCSfile: porglue.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: fme $ $Date: 2002-02-19 14:57:27 $ + * last change: $Author: fme $ $Date: 2002-02-28 12:42:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -130,16 +130,6 @@ sal_Bool SwGluePortion::GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) return sal_False; } -/************************************************************************* - * virtual SwGluePortion::HandlePortion() - *************************************************************************/ - -void SwGluePortion::HandlePortion( SwPortionHandler& rPH ) const -{ - String aString; - rPH.Special( GetLen(), aString, GetWhichPor() ); -} - /************************************************************************* * virtual SwGluePortion::Paint() *************************************************************************/ diff --git a/sw/source/core/text/porglue.hxx b/sw/source/core/text/porglue.hxx index c3d6f95c6f15..2fc994cd8048 100644 --- a/sw/source/core/text/porglue.hxx +++ b/sw/source/core/text/porglue.hxx @@ -2,9 +2,9 @@ * * $RCSfile: porglue.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: fme $ $Date: 2002-02-19 14:57:27 $ + * last change: $Author: fme $ $Date: 2002-02-28 12:42:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -94,7 +94,6 @@ public: virtual xub_StrLen GetCrsrOfst( const KSHORT nOfst ) const; virtual SwPosSize GetTxtSize( const SwTxtSizeInfo &rInfo ) const; virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const; - virtual void HandlePortion( SwPortionHandler& rPH ) const; OUTPUT_OPERATOR }; diff --git a/sw/source/core/text/porhyph.hxx b/sw/source/core/text/porhyph.hxx index 555b4bae74d8..663f8538e9bf 100644 --- a/sw/source/core/text/porhyph.hxx +++ b/sw/source/core/text/porhyph.hxx @@ -2,9 +2,9 @@ * * $RCSfile: porhyph.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fme $ $Date: 2002-02-19 14:58:24 $ + * last change: $Author: fme $ $Date: 2002-02-28 12:42:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -72,8 +72,11 @@ class SwHyphPortion : public SwExpandPortion public: inline SwHyphPortion( ) { SetWhichPor( POR_HYPH ); } virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const; - virtual void HandlePortion( SwPortionHandler& rPH ) const; virtual sal_Bool Format( SwTxtFormatInfo &rInf ); + + // Accessibility: pass information about this portion to the PortionHandler + virtual void HandlePortion( SwPortionHandler& rPH ) const; + OUTPUT_OPERATOR }; @@ -87,7 +90,10 @@ class SwHyphStrPortion : public SwHyphPortion public: inline SwHyphStrPortion( const XubString &rStr ); virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const; + + // Accessibility: pass information about this portion to the PortionHandler virtual void HandlePortion( SwPortionHandler& rPH ) const; + OUTPUT_OPERATOR }; @@ -104,7 +110,6 @@ class SwSoftHyphPortion : public SwHyphPortion public: SwSoftHyphPortion(); virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const; - virtual void HandlePortion( SwPortionHandler& rPH ) const; virtual SwLinePortion *Compress(); virtual void Paint( const SwTxtPaintInfo &rInf ) const; virtual sal_Bool Format( SwTxtFormatInfo &rInf ); @@ -113,6 +118,10 @@ public: sal_Bool IsExpand() const { return bExpand; } virtual KSHORT GetViewWidth( const SwTxtSizeInfo &rInf ) const; + + // Accessibility: pass information about this portion to the PortionHandler + virtual void HandlePortion( SwPortionHandler& rPH ) const; + OUTPUT_OPERATOR }; diff --git a/sw/source/core/text/porlin.cxx b/sw/source/core/text/porlin.cxx index 6e6a1b7d2425..84f4d46b6e97 100644 --- a/sw/source/core/text/porlin.cxx +++ b/sw/source/core/text/porlin.cxx @@ -2,9 +2,9 @@ * * $RCSfile: porlin.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: fme $ $Date: 2002-02-19 15:01:28 $ + * last change: $Author: fme $ $Date: 2002-02-28 12:42:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -421,6 +421,10 @@ void SwLinePortion::Move( SwTxtPaintInfo &rInf ) } if( rInf.IsRotated() ) rInf.Y( rInf.Y() + ( bB2T ? -PrtWidth() : PrtWidth() ) ); +#ifdef BIDI + else if ( DIR_RIGHT2LEFT == rInf.GetDirection() ) + rInf.X( rInf.X() - PrtWidth() ); +#endif else rInf.X( rInf.X() + PrtWidth() ); } @@ -454,6 +458,7 @@ sal_Bool SwLinePortion::GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) void SwLinePortion::HandlePortion( SwPortionHandler& rPH ) const { - rPH.Text( GetLen() ); + String aString; + rPH.Special( GetLen(), aString, GetWhichPor() ); } diff --git a/sw/source/core/text/porlin.hxx b/sw/source/core/text/porlin.hxx index 2ab26052cd00..60ae652283a0 100644 --- a/sw/source/core/text/porlin.hxx +++ b/sw/source/core/text/porlin.hxx @@ -2,9 +2,9 @@ * * $RCSfile: porlin.hxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: fme $ $Date: 2002-02-19 15:01:28 $ + * last change: $Author: fme $ $Date: 2002-02-28 12:42:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -144,9 +144,6 @@ public: // liefert 0 zurueck, wenn keine Nutzdaten enthalten sind. virtual SwLinePortion *Compress(); - // Accessibility: call functions at the SwPortionHandler - virtual void HandlePortion( SwPortionHandler& rPH ) const; - inline void SetWhichPor( const MSHORT nNew ) { nWhichPor = nNew; } inline const MSHORT GetWhichPor( ) const { return nWhichPor; } @@ -226,6 +223,9 @@ public: // for text- and multi-portions virtual long CalcSpacing( short nSpaceAdd, const SwTxtSizeInfo &rInf ) const; + // Accessibility: pass information about this portion to the PortionHandler + virtual void HandlePortion( SwPortionHandler& rPH ) const; + OUTPUT_OPERATOR }; diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx index a3fd982b6f43..f85a655282a4 100644 --- a/sw/source/core/text/pormulti.cxx +++ b/sw/source/core/text/pormulti.cxx @@ -2,9 +2,9 @@ * * $RCSfile: pormulti.cxx,v $ * - * $Revision: 1.53 $ + * $Revision: 1.54 $ * - * last change: $Author: fme $ $Date: 2002-02-07 11:18:13 $ + * last change: $Author: fme $ $Date: 2002-02-28 12:42:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -78,6 +78,13 @@ #ifndef _SVX_CHARROTATEITEM_HXX #include #endif + +#ifdef BIDI +#ifndef _SV_OUTDEV_HXX //autogen +#include +#endif +#endif + #ifndef _TXATBASE_HXX //autogen #include #endif @@ -99,6 +106,9 @@ #ifndef _LAYFRM_HXX #include // GetUpper() #endif +#ifndef _SW_PORTIONHANDLER_HXX +#include +#endif #ifndef _PORMULTI_HXX #include // SwMultiPortion #endif @@ -218,6 +228,15 @@ long SwMultiPortion::CalcSpacing( short nSpaceAdd, const SwTxtSizeInfo &rInf ) return 0; } +/************************************************************************* + * virtual SwMultiPortion::HandlePortion() + *************************************************************************/ + +void SwMultiPortion::HandlePortion( SwPortionHandler& rPH ) const +{ + rPH.Text( GetLen(), GetWhichPor() ); +} + /*-----------------01.11.00 14:21------------------- * SwMultiPortion::ActualizeTabulator() * sets the tabulator-flag, if there's any tabulator-portion inside. @@ -276,6 +295,14 @@ SwRotatedPortion::SwRotatedPortion( const SwMultiCreator& rCreate, SetDirection( pRot->IsBottomToTop() ? 1 : 3 ); } +#ifdef BIDI +SwBidiPortion::SwBidiPortion( const SwMultiCreator& rCreate, + xub_StrLen nEnd ) : SwMultiPortion( nEnd ) +{ + SetBidi(); +} +#endif + /*-----------------01.11.00 14:22------------------- * SwDoubleLinePortion::SwDoubleLinePortion(..) * This constructor is for the continuation of a doubleline portion @@ -903,6 +930,29 @@ sal_Bool lcl_HasRotation( const SwTxtAttr& rAttr, SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos ) const { +#ifdef BIDI + // do we have a script change? + const SwScriptInfo& rSI = + ((SwParaPortion*)GetParaPortion())->GetScriptInfo(); + // create a bidi portion if frame is + // a) LTR and next script is CTL or + // b) RTL and next script is not CTL + if ( GetTxt().Len() != rPos && + ( GetTxtFrm()->IsRightToLeft() && + 0 == rSI.DirType( rPos ) ) || + ( ! GetTxtFrm()->IsRightToLeft() && + 1 == rSI.DirType( rPos ) ) ) + { + rPos = rSI.NextDirChg( rPos ); + if ( STRING_LEN == rPos ) + return NULL; + SwMultiCreator *pRet = new SwMultiCreator; + pRet->pItem = NULL; + pRet->pAttr = NULL; + pRet->nId = SW_MC_BIDI; + return pRet; + } +#endif const SvxCharRotateItem* pRotate = NULL; const SfxPoolItem* pRotItem; if( SFX_ITEM_SET == pFrm->GetTxtNode()->GetSwAttrSet(). @@ -1420,6 +1470,13 @@ void SwTxtPainter::PaintMultiPortion( const SwRect &rPaint, nOfst = nTmpX; } } +#ifdef BIDI + else if ( rMulti.IsBidi() ) + { + GetInfo().X( GetInfo().X() + rMulti.Width() ); + nOfst = nOldY - rMulti.GetAscent(); + } +#endif else nOfst = nOldY - rMulti.GetAscent(); @@ -1530,14 +1587,44 @@ void SwTxtPainter::PaintMultiPortion( const SwRect &rPaint, GetInfo().GetUnderFnt()->SetProportion( 50 ); } +#ifdef BIDI + // !!! should be moved !!! + const ULONG nOldLayoutMode = GetInfo().GetOut()->GetLayoutMode(); + if ( rMulti.IsBidi() ) + { + if ( GetInfo().GetTxtFrm()->IsRightToLeft() ) + GetInfo().GetOut()->SetLayoutMode( TEXT_LAYOUT_COMPLEX_DISABLED ); + else + GetInfo().GetOut()->SetLayoutMode( TEXT_LAYOUT_BIDI_STRONG | + TEXT_LAYOUT_BIDI_RTL ); + } +#endif + pPor->Paint( GetInfo() ); +#ifdef BIDI + GetInfo().GetOut()->SetLayoutMode( nOldLayoutMode ); +#endif + if( GetFnt()->IsURL() && pPor->InTxtGrp() ) GetInfo().NotifyURL( *pPor ); bFirst &= !pPor->GetLen(); if( pNext || !pPor->IsMarginPortion() ) +#ifdef BIDI + { + BYTE nOldInfoDir = GetInfo().GetDirection(); + if ( rMulti.IsBidi() ) + // DIR_RIGHT2LEFT is only set to indicate that Move should + // subtract the portion width + GetInfo().SetDirection( DIR_RIGHT2LEFT ); + + pPor->Move( GetInfo() ); + GetInfo().SetDirection( nOldInfoDir ); + } +#else pPor->Move( GetInfo() ); +#endif pPor = pNext; @@ -1807,7 +1894,11 @@ BOOL SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf, rMulti.CalcSize( *this, aInf ); pCurr->SetRealHeight( pCurr->Height() ); +#ifdef BIDI + if( rMulti.HasRotation() || rMulti.IsBidi() ) +#else if( rMulti.HasRotation() && !rMulti.IsDouble() ) +#endif break; // second line has to be formatted else if( pCurr->GetLen() rInf.Width() ) && nStartIdx != rInf.GetLineStart(); } +#ifdef BIDI + else if ( rMulti.IsBidi() ) + bRet = rMulti.GetLen() < nMultiLen; +#endif // line break has to be performed! if( bRet ) @@ -2013,6 +2108,10 @@ BOOL SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf, pTmp = new SwRotatedPortion( nMultiLen + rInf.GetIdx(), rMulti.GetDirection() ); } +#ifdef BIDI + else if( rMulti.IsBidi() ) + pTmp = new SwBidiPortion( nMultiLen + rInf.GetIdx() ); +#endif else pTmp = NULL; if( pNextFirst && pTmp ) diff --git a/sw/source/core/text/pormulti.hxx b/sw/source/core/text/pormulti.hxx index 02f6e65b1543..fc080e5a87e8 100644 --- a/sw/source/core/text/pormulti.hxx +++ b/sw/source/core/text/pormulti.hxx @@ -2,9 +2,9 @@ * * $RCSfile: pormulti.hxx,v $ * - * $Revision: 1.17 $ + * $Revision: 1.18 $ * - * last change: $Author: fme $ $Date: 2002-01-31 14:29:52 $ + * last change: $Author: fme $ $Date: 2002-02-28 12:42:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -86,6 +86,9 @@ class SwFont; #define SW_MC_DOUBLE 0 #define SW_MC_RUBY 1 #define SW_MC_ROTATE 2 +#ifdef BIDI +#define SW_MC_BIDI 3 +#endif struct SwMultiCreator { @@ -129,6 +132,9 @@ class SwMultiPortion : public SwLinePortion sal_Bool bTab2 :1; // Second line includes tabulator sal_Bool bDouble :1; // Double line sal_Bool bRuby :1; // Phonetics +#ifdef BIDI + sal_Bool bBidi :1; +#endif sal_Bool bTop :1; // Phonetic position sal_Bool bFormatted :1; // Already formatted sal_Bool bFollowFld :1; // Field follow inside @@ -136,12 +142,21 @@ class SwMultiPortion : public SwLinePortion sal_Bool bFlyInCntnt:1; // Fly as character inside protected: SwMultiPortion( xub_StrLen nEnd ) : pFldRest( 0 ), bTab1( sal_False ), +#ifdef BIDI + bTab2( sal_False ), bDouble( sal_False ), bRuby( sal_False ), + bBidi( sal_False ), bFormatted( sal_False ), bFollowFld( sal_False ), + nDirection( 0 ), bFlyInCntnt( sal_False ) +#else bTab2( sal_False ), bDouble( sal_False ), bRuby( sal_False ), bFormatted( sal_False ), bFollowFld( sal_False ), nDirection( 0 ), bFlyInCntnt( sal_False ) +#endif { SetWhichPor( POR_MULTI ); SetLen( nEnd ); } inline void SetDouble() { bDouble = sal_True; } inline void SetRuby() { bRuby = sal_True; } +#ifdef BIDI + inline void SetBidi() { bBidi = sal_True; } +#endif inline void SetTop( sal_Bool bNew ) { bTop = bNew; } inline void SetTab1( sal_Bool bNew ) { bTab1 = bNew; } inline void SetTab2( sal_Bool bNew ) { bTab2 = bNew; } @@ -164,6 +179,9 @@ public: inline void SetFlyInCntnt( sal_Bool bNew ) { bFlyInCntnt = bNew; } inline sal_Bool IsDouble() const { return bDouble; } inline sal_Bool IsRuby() const { return bRuby; } +#ifdef BIDI + inline sal_Bool IsBidi() const { return bBidi; } +#endif inline sal_Bool OnTop() const { return bTop; } void ActualizeTabulator(); @@ -180,6 +198,10 @@ public: inline sal_uInt8 GetDirection() const { return nDirection; } inline USHORT GetFontRotation() const { return ( HasRotation() ? ( IsRevers() ? 2700 : 900 ) : 0 ); } + + // Accessibility: pass information about this portion to the PortionHandler + virtual void HandlePortion( SwPortionHandler& rPH ) const; + OUTPUT_OPERATOR }; @@ -250,6 +272,16 @@ public: : SwMultiPortion( nEnd ) { SetDirection( nDir ); } }; +#ifdef BIDI +class SwBidiPortion : public SwMultiPortion +{ +public: + SwBidiPortion( const SwMultiCreator& rCreate, xub_StrLen nEnd ); + SwBidiPortion( xub_StrLen nEnd ) + : SwMultiPortion( nEnd ) { SetBidi(); } +}; +#endif + // For cursor travelling in multiportions class SwTxtCursorSave diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx index 324311947549..912e2daee58e 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.23 $ + * $Revision: 1.24 $ * - * last change: $Author: fme $ $Date: 2002-02-27 13:09:41 $ + * last change: $Author: fme $ $Date: 2002-02-28 12:42:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -258,6 +258,16 @@ sal_Bool SwBreakPortion::Format( SwTxtFormatInfo &rInf ) return sal_True; } +/************************************************************************* + * virtual SwBreakPortion::HandlePortion() + *************************************************************************/ + +void SwBreakPortion::HandlePortion( SwPortionHandler& rPH ) const +{ + rPH.Text( GetLen(), GetWhichPor() ); +} + + #ifdef VERTICAL_LAYOUT SwKernPortion::SwKernPortion( SwLinePortion &rPortion, short nKrn, sal_Bool bBG, sal_Bool bGK ) : @@ -332,12 +342,6 @@ void SwKernPortion::FormatEOL( SwTxtFormatInfo &rInf ) rInf.GetLast()->FormatEOL( rInf ); } -void SwKernPortion::HandlePortion( SwPortionHandler& rPH ) const -{ - String aString; - rPH.Special( GetLen(), aString, GetWhichPor() ); -} - SwArrowPortion::SwArrowPortion( const SwLinePortion &rPortion ) : bLeft( sal_True ) { diff --git a/sw/source/core/text/porrst.hxx b/sw/source/core/text/porrst.hxx index 21c68f4f987a..feb09f6c8ca8 100644 --- a/sw/source/core/text/porrst.hxx +++ b/sw/source/core/text/porrst.hxx @@ -2,9 +2,9 @@ * * $RCSfile: porrst.hxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: fme $ $Date: 2002-02-27 13:10:15 $ + * last change: $Author: fme $ $Date: 2002-02-28 12:42:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -101,6 +101,10 @@ public: virtual KSHORT GetViewWidth( const SwTxtSizeInfo &rInf ) const; USHORT GetRestWidth() const { return nRestWidth; } virtual xub_StrLen GetCrsrOfst( const MSHORT nOfst ) const; + + // Accessibility: pass information about this portion to the PortionHandler + virtual void HandlePortion( SwPortionHandler& rPH ) const; + OUTPUT_OPERATOR }; @@ -138,7 +142,6 @@ public: virtual void FormatEOL( SwTxtFormatInfo &rInf ); virtual void Paint( const SwTxtPaintInfo &rInf ) const; - virtual void HandlePortion( SwPortionHandler& rPH ) const; OUTPUT_OPERATOR }; diff --git a/sw/source/core/text/portab.hxx b/sw/source/core/text/portab.hxx index 826f9f6d6813..c383d8d67e69 100644 --- a/sw/source/core/text/portab.hxx +++ b/sw/source/core/text/portab.hxx @@ -2,9 +2,9 @@ * * $RCSfile: portab.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fme $ $Date: 2001-05-28 16:20:44 $ + * last change: $Author: fme $ $Date: 2002-02-28 12:42:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -82,6 +82,10 @@ public: sal_Bool PostFormat( SwTxtFormatInfo &rInf ); inline sal_Bool IsFilled() const { return 0 != cFill; } inline KSHORT GetTabPos() const { return nTabPos; } + + // Accessibility: pass information about this portion to the PortionHandler + virtual void HandlePortion( SwPortionHandler& rPH ) const; + OUTPUT_OPERATOR }; diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx index 9f23d4f294bb..1cf6c55bab4a 100644 --- a/sw/source/core/text/portxt.cxx +++ b/sw/source/core/text/portxt.cxx @@ -2,9 +2,9 @@ * * $RCSfile: portxt.cxx,v $ * - * $Revision: 1.18 $ + * $Revision: 1.19 $ * - * last change: $Author: fme $ $Date: 2002-02-07 11:18:13 $ + * last change: $Author: fme $ $Date: 2002-02-28 12:42:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -78,6 +78,9 @@ #ifndef _ERRHDL_HXX #include // ASSERT #endif +#ifndef _SW_PORTIONHANDLER_HXX +#include +#endif #ifndef _TXTCFG_HXX #include #endif @@ -684,6 +687,15 @@ long SwTxtPortion::CalcSpacing( short nSpaceAdd, const SwTxtSizeInfo &rInf ) con return nCnt * nSpaceAdd; } +/************************************************************************* + * virtual SwTxtPortion::HandlePortion() + *************************************************************************/ + +void SwTxtPortion::HandlePortion( SwPortionHandler& rPH ) const +{ + rPH.Text( GetLen(), GetWhichPor() ); +} + /************************************************************************* * class SwHolePortion *************************************************************************/ @@ -722,3 +734,12 @@ sal_Bool SwHolePortion::Format( SwTxtFormatInfo &rInf ) return rInf.IsFull() || rInf.X() >= rInf.Width(); } +/************************************************************************* + * virtual SwHolePortion::HandlePortion() + *************************************************************************/ + +void SwHolePortion::HandlePortion( SwPortionHandler& rPH ) const +{ + rPH.Text( GetLen(), GetWhichPor() ); +} + diff --git a/sw/source/core/text/portxt.hxx b/sw/source/core/text/portxt.hxx index 28e409981826..1bfe3bba941d 100644 --- a/sw/source/core/text/portxt.hxx +++ b/sw/source/core/text/portxt.hxx @@ -2,9 +2,9 @@ * * $RCSfile: portxt.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: fme $ $Date: 2001-05-28 16:20:44 $ + * last change: $Author: fme $ $Date: 2002-02-28 12:42:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -101,6 +101,9 @@ public: sal_Bool CreateHyphen( SwTxtFormatInfo &rInf, SwTxtGuess &rGuess ); + // Accessibility: pass information about this portion to the PortionHandler + virtual void HandlePortion( SwPortionHandler& rPH ) const; + OUTPUT_OPERATOR DECL_FIXEDMEMPOOL_NEWDEL(SwTxtPortion) }; @@ -119,6 +122,10 @@ public: virtual SwLinePortion *Compress(); virtual sal_Bool Format( SwTxtFormatInfo &rInf ); virtual void Paint( const SwTxtPaintInfo &rInf ) const; + + // Accessibility: pass information about this portion to the PortionHandler + virtual void HandlePortion( SwPortionHandler& rPH ) const; + OUTPUT_OPERATOR DECL_FIXEDMEMPOOL_NEWDEL(SwHolePortion) }; diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx index 34e22a5a6994..fc2e68769761 100644 --- a/sw/source/core/text/txttab.cxx +++ b/sw/source/core/text/txttab.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txttab.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: fme $ $Date: 2002-01-16 09:50:11 $ + * last change: $Author: fme $ $Date: 2002-02-28 12:42:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -77,6 +77,10 @@ #ifndef _FRMATR_HXX #include #endif +#ifndef _SW_PORTIONHANDLER_HXX +#include +#endif + #include "viewopt.hxx" // SwViewOptions #include "txtcfg.hxx" #include "portab.hxx" @@ -499,3 +503,13 @@ void SwTabPortion::Paint( const SwTxtPaintInfo &rInf ) const } } } + +/************************************************************************* + * virtual SwTabPortion::HandlePortion() + *************************************************************************/ + +void SwTabPortion::HandlePortion( SwPortionHandler& rPH ) const +{ + rPH.Text( GetLen(), GetWhichPor() ); +} + -- cgit v1.2.3