LCOV - code coverage report
Current view: top level - sw/source/core/text - inftxt.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 208 241 86.3 %
Date: 2012-08-25 Functions: 176 195 90.3 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 25 58 43.1 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : #ifndef _INFTXT_HXX
      29                 :            : #define _INFTXT_HXX
      30                 :            : #include <com/sun/star/linguistic2/XHyphenatedWord.hpp>
      31                 :            : #include <com/sun/star/beans/PropertyValues.hpp>
      32                 :            : 
      33                 :            : #include <map>
      34                 :            : 
      35                 :            : #include "swtypes.hxx"
      36                 :            : #include "txttypes.hxx"
      37                 :            : #include "swrect.hxx"
      38                 :            : #include "txtfly.hxx"
      39                 :            : #include "swfont.hxx"
      40                 :            : #include "porlay.hxx"
      41                 :            : #include "txtfrm.hxx"
      42                 :            : #include "ndtxt.hxx"
      43                 :            : #include <editeng/paravertalignitem.hxx>
      44                 :            : 
      45                 :            : class Font;
      46                 :            : class OutputDevice;
      47                 :            : class SvxBrushItem;
      48                 :            : class SvxLineSpacingItem;
      49                 :            : class SvxTabStop;
      50                 :            : class SvxTabStopItem;
      51                 :            : class SwAttrSet;
      52                 :            : class SwFldPortion;
      53                 :            : class SwFlyPortion;
      54                 :            : class SwFmtDrop;
      55                 :            : class SwLineLayout;
      56                 :            : class SwLinePortion;
      57                 :            : class SwParaPortion;
      58                 :            : class SwTabPortion;
      59                 :            : class SwTxtFrm;
      60                 :            : class SwTxtSizeInfo;
      61                 :            : class SwViewOption;
      62                 :            : class ViewShell;
      63                 :            : class SwAttrIter;
      64                 :            : struct SwMultiCreator;
      65                 :            : class SwMultiPortion;
      66                 :            : class SwWrongList;
      67                 :            : 
      68                 :            : /* Minimum percentage for kerning */
      69                 :            : #define MINKERNPERCENT 5
      70                 :            : #define ARROW_WIDTH 200
      71                 :            : #define DIR_LEFT2RIGHT 0
      72                 :            : #define DIR_BOTTOM2TOP 1
      73                 :            : #define DIR_RIGHT2LEFT 2
      74                 :            : #define DIR_TOP2BOTTOM 3
      75                 :            : 
      76                 :            : #ifdef DBG_UTIL
      77                 :            : #define OPTDBG( rInf )   (rInf).IsOptDbg()
      78                 :            : #else
      79                 :            : #define OPTDBG( rInf )   sal_False
      80                 :            : #endif
      81                 :            : 
      82                 :            : /*************************************************************************
      83                 :            :  * class SwLineInfo
      84                 :            :  * Respects the attribute LineSpace when calculating the Height/Ascent
      85                 :            :  *************************************************************************/
      86                 :            : 
      87                 :            : class SwLineInfo
      88                 :            : {
      89                 :            :     friend class SwTxtIter;
      90                 :            : 
      91                 :            :     SvxTabStopItem* pRuler;
      92                 :            :     const SvxLineSpacingItem *pSpace;
      93                 :            :     sal_uInt16 nVertAlign;
      94                 :            :     KSHORT nDefTabStop;
      95                 :            :     bool bListTabStopIncluded;
      96                 :            :     long nListTabStopPosition;
      97                 :            : 
      98                 :            :     void CtorInitLineInfo( const SwAttrSet& rAttrSet,
      99                 :            :                            const SwTxtNode& rTxtNode );
     100                 :            : 
     101                 :            :     SwLineInfo();
     102                 :            :     ~SwLineInfo();
     103                 :            : public:
     104                 :            :     // #i24363# tab stops relative to indent - returns the tab stop following nSearchPos or NULL
     105                 :            :     const SvxTabStop *GetTabStop( const SwTwips nSearchPos,
     106                 :            :                                  const SwTwips nRight ) const;
     107                 :      54918 :     inline const SvxLineSpacingItem *GetLineSpacing() const { return pSpace; }
     108                 :        206 :     inline KSHORT GetDefTabStop() const { return nDefTabStop; }
     109                 :        184 :     inline void SetDefTabStop( KSHORT nNew ) const
     110                 :        184 :         { ( (SwLineInfo*)this )->nDefTabStop = nNew; }
     111                 :            : 
     112                 :            :     // vertical alignment
     113                 :      50237 :     inline sal_uInt16 GetVertAlign() const { return nVertAlign; }
     114                 :      29996 :     inline sal_Bool HasSpecialAlign( sal_Bool bVert ) const
     115                 :            :         { return bVert ?
     116                 :            :                  ( SvxParaVertAlignItem::BASELINE  != nVertAlign ) :
     117                 :            :                  ( SvxParaVertAlignItem::BASELINE  != nVertAlign &&
     118 [ -  + ][ +  - ]:      29996 :                    SvxParaVertAlignItem::AUTOMATIC != nVertAlign ); }
                 [ -  + ]
     119                 :            : 
     120                 :            :     sal_uInt16 NumberOfTabStops() const;
     121                 :            : 
     122                 :        120 :     inline bool IsListTabStopIncluded() const
     123                 :            :     {
     124                 :        120 :         return bListTabStopIncluded;
     125                 :            :     }
     126                 :         30 :     inline long GetListTabStopPosition() const
     127                 :            :     {
     128                 :         30 :         return nListTabStopPosition;
     129                 :            :     }
     130                 :            : 
     131                 :            :     friend SvStream &operator<<( SvStream &rOS, const SwLineInfo &rInf );
     132                 :            : };
     133                 :            : 
     134                 :            : /*************************************************************************
     135                 :            :  * class SwTxtInfo
     136                 :            :  *************************************************************************/
     137                 :            : 
     138                 :            : class SwTxtInfo
     139                 :            : {
     140                 :            :     // Implementation in txthyph.cxx
     141                 :            :     friend void SetParaPortion( SwTxtInfo *pInf, SwParaPortion *pRoot );
     142                 :            :     SwParaPortion *pPara;
     143                 :            :     xub_StrLen nTxtStart;                 // TxtOfst for Follows
     144                 :            : 
     145                 :            : protected:
     146                 :      94335 :     inline SwTxtInfo() : pPara(0) {}
     147                 :            : public:
     148                 :            :     void CtorInitTxtInfo( SwTxtFrm *pFrm );
     149                 :            :     SwTxtInfo( const SwTxtInfo &rInf );
     150                 :        163 :     inline SwTxtInfo( SwTxtFrm *pFrm ) { CtorInitTxtInfo( pFrm ); }
     151                 :     705596 :     inline SwParaPortion *GetParaPortion() { return pPara; }
     152                 :     407759 :     inline const SwParaPortion *GetParaPortion() const { return pPara; }
     153                 :     380614 :     inline xub_StrLen GetTxtStart() const { return nTxtStart; }
     154                 :            : 
     155                 :            :     friend SvStream &operator<<( SvStream &rOS, const SwTxtInfo &rInf );
     156                 :            : };
     157                 :            : 
     158                 :            : /*************************************************************************
     159                 :            :  * class SwTxtSizeInfo
     160                 :            :  *************************************************************************/
     161                 :            : 
     162                 :            : typedef ::std::map< sal_uLong, sal_IntPtr > SwTxtPortionMap;
     163                 :            : 
     164                 :     166883 : class SwTxtSizeInfo : public SwTxtInfo
     165                 :            : {
     166                 :            : protected:
     167                 :            :     // during formatting, a small database is built, mapping portion pointers
     168                 :            :     // to their maximum size (used for kana compression)
     169                 :            :     SwTxtPortionMap aMaxWidth;
     170                 :            :     // for each line, an array of compression values is calculated
     171                 :            :     // this array is passed over to the info structure
     172                 :            :     std::deque<sal_uInt16>* pKanaComp;
     173                 :            : 
     174                 :            :     ViewShell    *pVsh;
     175                 :            : 
     176                 :            :     // pOut is the output device, pRef is the device used for formatting
     177                 :            :     OutputDevice* pOut;
     178                 :            :     OutputDevice* pRef;
     179                 :            : 
     180                 :            :     SwFont *pFnt;
     181                 :            :     SwUnderlineFont *pUnderFnt; // Font for underlining
     182                 :            :     SwTxtFrm *pFrm;
     183                 :            :     const SwViewOption *pOpt;
     184                 :            :     const XubString *pTxt;
     185                 :            :     xub_StrLen nIdx, nLen;
     186                 :            :     sal_uInt16 nKanaIdx;
     187                 :            :     sal_Bool bOnWin     : 1;
     188                 :            :     sal_Bool bNotEOL    : 1;
     189                 :            :     sal_Bool bURLNotify : 1;
     190                 :            :     sal_Bool bStopUnderFlow : 1; // Underflow was stopped e.g. by a FlyPortion
     191                 :            :     sal_Bool bFtnInside : 1;     // the current line contains a footnote
     192                 :            :     sal_Bool bOtherThanFtnInside : 1; // the current line contains another portion than a footnote portion.
     193                 :            :                                       // needed for checking keep together of footnote portion with previous portion
     194                 :            :     sal_Bool bMulti : 1;        // inside a multiportion
     195                 :            :     sal_Bool bFirstMulti : 1;   // this flag is used for two purposes:
     196                 :            :                                 // - the multiportion is the first lineportion
     197                 :            :                                 // - indicates, if we are currently in second
     198                 :            :                                 //   line of multi portion
     199                 :            :     sal_Bool bRuby : 1;         // during the formatting of a phonetic line
     200                 :            :     sal_Bool bHanging : 1;      // formatting of hanging punctuation allowed
     201                 :            :     sal_Bool bScriptSpace : 1;  // space between different scripts (Asian/Latin)
     202                 :            :     sal_Bool bForbiddenChars : 1; // Forbidden start/endline characters
     203                 :            :     sal_Bool bSnapToGrid : 1;   // paragraph snaps to grid
     204                 :            :     sal_uInt8 nDirection : 2;       // writing direction: 0/90/180/270 degree
     205                 :            : 
     206                 :            : protected:
     207                 :            :     void CtorInitTxtSizeInfo( SwTxtFrm *pFrm, SwFont *pFnt = 0,
     208                 :            :                    const xub_StrLen nIdx = 0,
     209                 :            :                    const xub_StrLen nLen = STRING_LEN );
     210                 :      28680 :     SwTxtSizeInfo() : pKanaComp(0), pVsh(0), pOut(0), pRef(0), pFnt(0), pUnderFnt(0), pFrm(0), pOpt(0), pTxt(0) {}
     211                 :            : public:
     212                 :            :     SwTxtSizeInfo( const SwTxtSizeInfo &rInf );
     213                 :            :     SwTxtSizeInfo( const SwTxtSizeInfo &rInf, const XubString &rTxt,
     214                 :            :                    const xub_StrLen nIdx = 0,
     215                 :            :                    const xub_StrLen nLen = STRING_LEN );
     216                 :            : 
     217                 :      65655 :     inline SwTxtSizeInfo( SwTxtFrm *pTxtFrm, SwFont *pTxtFnt = 0,
     218                 :            :                    const xub_StrLen nIndex = 0,
     219                 :            :                    const xub_StrLen nLength = STRING_LEN )
     220         [ +  - ]:      65655 :            { CtorInitTxtSizeInfo( pTxtFrm, pTxtFnt, nIndex, nLength ); }
     221                 :            : 
     222                 :            :     // GetMultiAttr returns the text attribute of the multiportion,
     223                 :            :     // if rPos is inside any multi-line part.
     224                 :            :     // rPos will set to the end of the multi-line part.
     225                 :            :     SwMultiCreator* GetMultiCreator( xub_StrLen &rPos, SwMultiPortion* pM ) const;
     226                 :            : 
     227                 :     406101 :     inline sal_Bool OnWin() const { return bOnWin; }
     228                 :     112096 :     inline void SetOnWin( const sal_Bool bNew ) { bOnWin = bNew; }
     229                 :      73000 :     inline sal_Bool NotEOL() const { return bNotEOL; }
     230                 :       2062 :     inline void SetNotEOL( const sal_Bool bNew ) { bNotEOL = bNew; }
     231                 :      72548 :     inline sal_Bool URLNotify() const { return bURLNotify; }
     232                 :            :     inline void SetURLNotify( const sal_Bool bNew ) { bURLNotify = bNew; }
     233                 :      72548 :     inline sal_Bool StopUnderFlow() const { return bStopUnderFlow; }
     234                 :     109397 :     inline void SetStopUnderFlow( const sal_Bool bNew ) { bStopUnderFlow = bNew; }
     235                 :     125310 :     inline sal_Bool IsFtnInside() const { return bFtnInside; }
     236                 :      52904 :     inline void SetFtnInside( const sal_Bool bNew ) { bFtnInside = bNew; }
     237                 :     128161 :     inline sal_Bool IsOtherThanFtnInside() const { return bOtherThanFtnInside; }
     238                 :     108375 :     inline void SetOtherThanFtnInside( const sal_Bool bNew ) { bOtherThanFtnInside = bNew; }
     239                 :     157290 :     inline sal_Bool IsMulti() const { return bMulti; }
     240                 :       4638 :     inline void SetMulti( const sal_Bool bNew ) { bMulti = bNew; }
     241                 :      91181 :     inline sal_Bool IsFirstMulti() const { return bFirstMulti; }
     242                 :       1288 :     inline void SetFirstMulti( const sal_Bool bNew ) { bFirstMulti = bNew; }
     243                 :     128813 :     inline sal_Bool IsRuby() const { return bRuby; }
     244                 :        852 :     inline void SetRuby( const sal_Bool bNew ) { bRuby = bNew; }
     245                 :     112159 :     inline sal_Bool IsHanging() const { return bHanging; }
     246                 :      14873 :     inline void SetHanging( const sal_Bool bNew ) { bHanging = bNew; }
     247                 :     142184 :     inline sal_Bool HasScriptSpace() const { return bScriptSpace; }
     248                 :      14873 :     inline void SetScriptSpace( const sal_Bool bNew ) { bScriptSpace = bNew; }
     249                 :     112159 :     inline sal_Bool HasForbiddenChars() const { return bForbiddenChars; }
     250                 :      14873 :     inline void SetForbiddenChars( const sal_Bool bN ) { bForbiddenChars = bN; }
     251                 :     197586 :     inline sal_Bool SnapToGrid() const { return bSnapToGrid; }
     252                 :      95267 :     inline void SetSnapToGrid( const sal_Bool bN ) { bSnapToGrid = bN; }
     253                 :     320491 :     inline sal_uInt8 GetDirection() const { return nDirection; }
     254                 :        784 :     inline void SetDirection( const sal_uInt8 nNew ) { nDirection = nNew; }
     255                 :     138447 :     inline sal_Bool IsRotated() const { return 0 != ( 1 & nDirection ); }
     256                 :            : 
     257                 :     165688 :     inline ViewShell *GetVsh() { return pVsh; }
     258                 :     143248 :     inline const ViewShell *GetVsh() const { return pVsh; }
     259                 :            : 
     260                 :     374761 :     inline OutputDevice *GetOut() { return pOut; }
     261                 :     224959 :     inline const OutputDevice *GetOut() const { return pOut; }
     262                 :     105937 :     inline void SetOut( OutputDevice* pNewOut ) { pOut = pNewOut; }
     263                 :            : 
     264                 :     125633 :     inline OutputDevice *GetRefDev() { return pRef; }
     265                 :            :     inline const OutputDevice *GetRefDev() const { return pRef; }
     266                 :            : 
     267                 :     315586 :     inline SwFont *GetFont() { return pFnt; }
     268                 :     223246 :     inline const SwFont *GetFont() const { return pFnt; }
     269                 :     126931 :     inline void SetFont( SwFont *pNew ) { pFnt = pNew; }
     270                 :            :     void SelectFont();
     271                 :      70170 :     inline void SetUnderFnt( SwUnderlineFont* pNew ) { pUnderFnt = pNew; }
     272                 :     182649 :     inline SwUnderlineFont* GetUnderFnt() const { return pUnderFnt; }
     273                 :            : 
     274                 :     320779 :     inline const  SwViewOption &GetOpt() const { return *pOpt; }
     275                 :    1191070 :     inline const XubString &GetTxt() const { return *pTxt; }
     276                 :    3652665 :     inline xub_Unicode GetChar( const xub_StrLen nPos ) const
     277                 :    3652665 :         { return pTxt->GetChar( nPos ); }
     278                 :            : 
     279                 :            :     inline KSHORT      GetTxtHeight() const;
     280                 :            : 
     281                 :            :     //
     282                 :            :     // GetTxtSize
     283                 :            :     //
     284                 :            :     SwPosSize GetTxtSize( OutputDevice* pOut, const SwScriptInfo* pSI,
     285                 :            :                           const XubString& rTxt, const xub_StrLen nIdx,
     286                 :            :                           const xub_StrLen nLen, const sal_uInt16 nComp ) const;
     287                 :            :     SwPosSize GetTxtSize() const;
     288                 :            :     void GetTxtSize( const SwScriptInfo* pSI, const xub_StrLen nIdx,
     289                 :            :                       const xub_StrLen nLen, const sal_uInt16 nComp,
     290                 :            :                       sal_uInt16& nMinSize, sal_uInt16& nMaxSizeDiff ) const;
     291                 :            :     inline SwPosSize GetTxtSize( const SwScriptInfo* pSI, const xub_StrLen nIdx,
     292                 :            :                                  const xub_StrLen nLen, const sal_uInt16 nComp ) const;
     293                 :            :     inline SwPosSize GetTxtSize( const XubString &rTxt ) const;
     294                 :            : 
     295                 :            :     //
     296                 :            :     // GetTxtBreak
     297                 :            :     //
     298                 :            :     xub_StrLen GetTxtBreak( const long nLineWidth,
     299                 :            :                                            const xub_StrLen nMaxLen,
     300                 :            :                                            const sal_uInt16 nComp ) const;
     301                 :            :     xub_StrLen GetTxtBreak( const long nLineWidth,
     302                 :            :                                            const xub_StrLen nMaxLen,
     303                 :            :                                            const sal_uInt16 nComp,
     304                 :            :                                            xub_StrLen& rExtraCharPos ) const;
     305                 :            : 
     306                 :            :     inline KSHORT GetAscent() const;
     307                 :            : 
     308                 :    2494155 :     inline xub_StrLen GetIdx() const { return nIdx; }
     309                 :     330371 :     inline void SetIdx( const xub_StrLen nNew ) { nIdx = nNew; }
     310                 :     528897 :     inline xub_StrLen GetLen() const { return nLen; }
     311                 :     414386 :     inline void SetLen( const xub_StrLen nNew ) { nLen = nNew; }
     312                 :       7898 :     inline void SetTxt( const XubString &rNew ){ pTxt = &rNew; }
     313                 :            : 
     314                 :            :     friend SvStream &operator<<( SvStream &rOS, const SwTxtSizeInfo &rInf );
     315                 :            : 
     316                 :            :     // No Bullets for the symbol font!
     317                 :          0 :     inline sal_Bool IsNoSymbol() const
     318                 :          0 :     { return RTL_TEXTENCODING_SYMBOL != pFnt->GetCharSet( pFnt->GetActual() ); }
     319                 :            : 
     320                 :            :     void NoteAnimation() const;
     321                 :            : 
     322                 :            :     // Home is where Your heart is...
     323                 :     532449 :     inline SwTxtFrm *GetTxtFrm() { return pFrm; }
     324                 :     262890 :     inline const SwTxtFrm *GetTxtFrm() const { return pFrm; }
     325                 :            : 
     326                 :       2851 :     inline sal_Bool HasHint( xub_StrLen nPos ) const
     327                 :       2851 :         { return _HasHint( pFrm->GetTxtNode(), nPos ); }
     328                 :            :     static sal_Bool _HasHint( const SwTxtNode* pTxtNode, xub_StrLen nPos );
     329                 :            : 
     330                 :            :     // If Kana Compression is enabled, a minimum and maximum portion width
     331                 :            :     // is calculated. We format lines with minimal size and share remaining
     332                 :            :     // space among compressed kanas.
     333                 :            :     // During formatting, the maximum values of compressable portions are
     334                 :            :     // stored in aMaxWidth and discarded after a line has been formatted.
     335                 :          0 :     inline void SetMaxWidthDiff( sal_uLong nKey, sal_uInt16 nVal )
     336                 :            :     {
     337         [ #  # ]:          0 :         aMaxWidth.insert( ::std::make_pair( nKey, nVal ) );
     338                 :          0 :     };
     339                 :          0 :     inline sal_uInt16 GetMaxWidthDiff( sal_uLong nKey )
     340                 :            :     {
     341         [ #  # ]:          0 :         SwTxtPortionMap::iterator it = aMaxWidth.find( nKey );
     342                 :            : 
     343 [ #  # ][ #  # ]:          0 :         if( it != aMaxWidth.end() )
     344         [ #  # ]:          0 :             return it->second;
     345                 :            :         else
     346                 :          0 :             return 0;
     347                 :            :     };
     348                 :          0 :     inline void ResetMaxWidthDiff()
     349                 :            :     {
     350                 :          0 :         aMaxWidth.clear();
     351                 :          0 :     };
     352                 :      52762 :     inline sal_Bool CompressLine()
     353                 :            :     {
     354                 :      52762 :         return (sal_Bool)!aMaxWidth.empty();
     355                 :            :     };
     356                 :            : 
     357                 :            :     //
     358                 :            :     // Feature: Kana Compression
     359                 :            :     //
     360                 :      72548 :     inline MSHORT GetKanaIdx() const { return nKanaIdx; }
     361                 :      42373 :     inline void ResetKanaIdx(){ nKanaIdx = 0; }
     362                 :       3196 :     inline void SetKanaIdx( MSHORT nNew ) { nKanaIdx = nNew; }
     363                 :        681 :     inline void IncKanaIdx() { ++nKanaIdx; }
     364                 :      45569 :     inline void SetKanaComp( std::deque<sal_uInt16> *pNew ){ pKanaComp = pNew; }
     365                 :      72548 :     inline std::deque<sal_uInt16>* GetpKanaComp() const { return pKanaComp; }
     366                 :      26423 :     inline sal_uInt16 GetKanaComp() const
     367                 :          0 :         { return ( pKanaComp && nKanaIdx < pKanaComp->size() )
     368   [ -  +  #  # ]:      26423 :                    ? (*pKanaComp)[nKanaIdx] : 0; }
     369                 :            : 
     370                 :            : #ifdef DBG_UTIL
     371                 :            :     sal_Bool IsOptDbg() const;
     372                 :            : #endif
     373                 :            : };
     374                 :            : 
     375                 :            : /*************************************************************************
     376                 :            :  * class SwTxtPaintInfo
     377                 :            :  *************************************************************************/
     378                 :            : 
     379         [ +  - ]:      46225 : class SwTxtPaintInfo : public SwTxtSizeInfo
     380                 :            : {
     381                 :            :     const SwWrongList *pWrongList;
     382                 :            :     const SwWrongList *pGrammarCheckList;
     383                 :            :     const SwWrongList *pSmartTags;    // SMARTTAGS
     384                 :            :     std::vector<long>* pSpaceAdd;
     385                 :            :     const SvxBrushItem *pBrushItem; // For the background
     386                 :            :     SwRect      aItemRect;          // Also for the background
     387                 :            :     SwTxtFly    aTxtFly;    // Calculate the FlyFrm
     388                 :            :     Point       aPos;       // Paint position
     389                 :            :     SwRect      aPaintRect; // Original paint rect (from Layout paint)
     390                 :            : 
     391                 :            :     MSHORT nSpaceIdx;
     392                 :            :     void _DrawText( const XubString &rText, const SwLinePortion &rPor,
     393                 :            :                    const xub_StrLen nIdx, const xub_StrLen nLen,
     394                 :            :                    const sal_Bool bKern, const sal_Bool bWrong = sal_False,
     395                 :            :                    const sal_Bool bSmartTag = sal_False,
     396                 :            :                    const sal_Bool bGrammarCheck = sal_False );  // SMARTTAGS
     397                 :            : 
     398                 :            :     SwTxtPaintInfo &operator=(const SwTxtPaintInfo&);
     399                 :            :     void _NotifyURL( const SwLinePortion &rPor ) const;
     400                 :            :     void _DrawBackBrush( const SwLinePortion &rPor ) const;
     401                 :            : 
     402                 :            : protected:
     403                 :            : #ifdef DBG_UTIL
     404                 :            :     SwTxtPaintInfo() { pFrm = 0; pWrongList = 0; pGrammarCheckList = 0; pSmartTags = 0; pSpaceAdd = 0;
     405                 :            :                        pBrushItem = ((SvxBrushItem*)-1);}
     406                 :            : #else
     407         [ +  - ]:      14873 :     SwTxtPaintInfo() { pFrm = 0; pWrongList = 0; pGrammarCheckList = 0; pWrongList = 0; pSmartTags = 0; pSpaceAdd = 0; pBrushItem = 0;}
     408                 :            : #endif
     409                 :            : public:
     410                 :            :     SwTxtPaintInfo( const SwTxtPaintInfo &rInf );
     411                 :            :     SwTxtPaintInfo( const SwTxtPaintInfo &rInf, const XubString &rTxt );
     412                 :            : 
     413                 :            :     void CtorInitTxtPaintInfo( SwTxtFrm *pFrame, const SwRect &rPaint );
     414                 :            : 
     415                 :            :     void SetBack( const SvxBrushItem *pItem,
     416                 :            :                   const SwRect &rRect ) { pBrushItem = pItem; aItemRect = rRect;}
     417                 :      17545 :     const SvxBrushItem *GetBrushItem() const { return pBrushItem; }
     418                 :          0 :     const SwRect       &GetBrushRect() const { return aItemRect;  }
     419                 :            : 
     420                 :      13807 :     inline SwTxtPaintInfo( SwTxtFrm *pFrame, const SwRect &rPaint )
     421 [ +  - ][ +  - ]:      13807 :            { CtorInitTxtPaintInfo( pFrame, rPaint ); }
     422                 :            : 
     423                 :     510518 :     inline SwTwips X() const { return aPos.X(); }
     424                 :     180609 :     inline void X( const long nNew ) { aPos.X() = nNew; }
     425                 :     110613 :     inline SwTwips Y() const { return aPos.Y(); }
     426                 :     136343 :     inline void Y( const SwTwips nNew ) { aPos.Y() = nNew; }
     427                 :            : 
     428                 :     227145 :     inline SwTxtFly *GetTxtFly() { return &aTxtFly; }
     429                 :      32256 :     inline const SwTxtFly *GetTxtFly() const { return &aTxtFly; }
     430                 :            :     inline void DrawText( const XubString &rText, const SwLinePortion &rPor,
     431                 :            :                           const xub_StrLen nIdx = 0,
     432                 :            :                           const xub_StrLen nLen = STRING_LEN,
     433                 :            :                           const sal_Bool bKern = sal_False) const;
     434                 :            :     inline void DrawText( const SwLinePortion &rPor, const xub_StrLen nLen,
     435                 :            :                           const sal_Bool bKern = sal_False ) const;
     436                 :            :     inline void DrawMarkedText( const SwLinePortion &rPor, const xub_StrLen nLen,
     437                 :            :                                 const sal_Bool bKern,
     438                 :            :                                 const sal_Bool bWrong,
     439                 :            :                                 const sal_Bool bSmartTags,
     440                 :            :                                 const sal_Bool bGrammarCheck ) const;
     441                 :            : 
     442                 :            :     void DrawRect( const SwRect &rRect, sal_Bool bNoGraphic = sal_False,
     443                 :            :                    sal_Bool bRetouche = sal_True ) const;
     444                 :            :     void DrawTab( const SwLinePortion &rPor ) const;
     445                 :            :     void DrawLineBreak( const SwLinePortion &rPor ) const;
     446                 :            :     void DrawRedArrow( const SwLinePortion &rPor ) const;
     447                 :            :     void DrawPostIts( const SwLinePortion &rPor, sal_Bool bScript ) const;
     448                 :            :     void DrawBackground( const SwLinePortion &rPor ) const;
     449                 :            :     void DrawViewOpt( const SwLinePortion &rPor, const MSHORT nWhich ) const;
     450                 :      26471 :     inline void DrawBackBrush( const SwLinePortion &rPor ) const
     451                 :      26471 :     { /* if( pFnt->GetBackColor() ) */ _DrawBackBrush( rPor ); }
     452                 :            : 
     453                 :            :     void DrawCheckBox( const SwFieldFormPortion &rPor, bool checked) const;
     454                 :            : 
     455                 :          0 :     inline void NotifyURL( const SwLinePortion &rPor ) const
     456         [ #  # ]:          0 :         { if( URLNotify() ) _NotifyURL( rPor ); }
     457                 :            : 
     458                 :            :     void CalcRect( const SwLinePortion& rPor, SwRect* pRect, SwRect* pIntersect = 0 ) const;
     459                 :            : 
     460                 :            :     inline SwTwips GetPaintOfst() const;
     461                 :            :     inline void SetPaintOfst( const SwTwips nNew );
     462                 :     192200 :     inline const Point &GetPos() const { return aPos; }
     463                 :      42401 :     inline void SetPos( const Point &rNew ) { aPos = rNew; }
     464                 :            : 
     465                 :      70632 :     inline const SwRect &GetPaintRect() const { return aPaintRect; }
     466                 :            :     inline void SetPaintRect( const SwRect &rNew ) { aPaintRect = rNew; }
     467                 :            : 
     468                 :            :     friend SvStream &operator<<( SvStream &rOS, const SwTxtPaintInfo &rInf );
     469                 :            : 
     470                 :            :     //
     471                 :            :     // STUFF FOR JUSTIFIED ALIGNMENT
     472                 :            :     //
     473                 :      17937 :     inline MSHORT GetSpaceIdx() const { return nSpaceIdx; }
     474                 :      42765 :     inline void ResetSpaceIdx(){nSpaceIdx = 0; }
     475                 :        756 :     inline void SetSpaceIdx( MSHORT nNew ) { nSpaceIdx = nNew; }
     476                 :        681 :     inline void IncSpaceIdx() { ++nSpaceIdx; }
     477                 :          0 :     inline void RemoveFirstSpaceAdd() { pSpaceAdd->erase( pSpaceAdd->begin() ); }
     478                 :     150945 :     inline long GetSpaceAdd() const
     479                 :         60 :         { return ( pSpaceAdd && nSpaceIdx < pSpaceAdd->size() )
     480   [ +  +  +  - ]:     151005 :                    ? (*pSpaceAdd)[nSpaceIdx] : 0; }
     481                 :            : 
     482                 :      43521 :     inline void SetpSpaceAdd( std::vector<long>* pNew ){ pSpaceAdd = pNew; }
     483                 :      17937 :     inline std::vector<long>* GetpSpaceAdd() const { return pSpaceAdd; }
     484                 :            : 
     485                 :            : 
     486                 :      13781 :     inline void SetWrongList( const SwWrongList *pNew ){ pWrongList = pNew; }
     487                 :      42184 :     inline const SwWrongList* GetpWrongList() const { return pWrongList; }
     488                 :            : 
     489                 :      14419 :     inline void SetGrammarCheckList( const SwWrongList *pNew ){ pGrammarCheckList = pNew; }
     490                 :      45835 :     inline const SwWrongList* GetGrammarCheckList() const { return pGrammarCheckList; }
     491                 :            : 
     492                 :            :     // SMARTTAGS
     493                 :      13781 :     inline void SetSmartTags( const SwWrongList *pNew ){ pSmartTags = pNew; }
     494                 :      45835 :     inline const SwWrongList* GetSmartTags() const { return pSmartTags; }
     495                 :            : };
     496                 :            : 
     497                 :            : /*************************************************************************
     498                 :            :  * class SwTxtFormatInfo
     499                 :            :  *************************************************************************/
     500                 :            : 
     501 [ +  - ][ +  - ]:      22253 : class SwTxtFormatInfo : public SwTxtPaintInfo
     502                 :            : {
     503                 :            :     // temporary arguments for hyphenation
     504                 :            :     com::sun::star::beans::PropertyValues   aHyphVals;
     505                 :            : 
     506                 :            :     SwLineLayout    *pRoot;       // The Root of the current line (pCurr)
     507                 :            :     SwLinePortion   *pLast;       // The last Portion
     508                 :            :     SwFlyPortion    *pFly;        // The following FlyPortion
     509                 :            :     SwFldPortion    *pLastFld;    // Wrapped Field
     510                 :            :     SwLinePortion   *pUnderFlow;  // Underflow: Last Portion
     511                 :            :     SwLinePortion   *pRest;       // The Rest is the start of the next Line
     512                 :            : 
     513                 :            :     SwTabPortion    *pLastTab;     // The _last_ TabPortion
     514                 :            : 
     515                 :            :     xub_StrLen nSoftHyphPos;    // SoftHyphPos forr Hyphenation
     516                 :            :     xub_StrLen nHyphStart;      // TxtPos at which the interactive hyphen is at the moment
     517                 :            :     xub_StrLen nHyphWrdStart;   // Position of the found word
     518                 :            :     xub_StrLen nHyphWrdLen;     // Length of the found word
     519                 :            :     xub_StrLen nLineStart;      // Current line start in rTxt
     520                 :            :     xub_StrLen nUnderScorePos;  // enlarge repaint if underscore has been found
     521                 :            :     // #i34348# Changed type from sal_uInt16 to SwTwips
     522                 :            :     SwTwips nLeft;              // Left margin
     523                 :            :     SwTwips nRight;             // Right margin
     524                 :            :     SwTwips nFirst;             // EZE
     525                 :            :     KSHORT nRealWidth;          // "real" line width
     526                 :            :     KSHORT nWidth;              // "virtual" line width
     527                 :            :     KSHORT nLineHeight;         // Final height after CalcLine
     528                 :            :     KSHORT nLineNettoHeight;    // line height without spacing
     529                 :            :     KSHORT nForcedLeftMargin;   // Shift of left margin due to frame
     530                 :            : 
     531                 :            :     sal_Int16  nMinLeading;     // minimum number of chars before hyphenation point
     532                 :            :     sal_Int16  nMinTrailing;    // minimum number of chars after hyphenation point
     533                 :            :     sal_Int16  nMinWordLength;  // minimum length of word to be hyphenated
     534                 :            : 
     535                 :            :     sal_Bool bFull   : 1;      // Line is full
     536                 :            :     sal_Bool bFtnDone  : 1;    // Ftn already formatted
     537                 :            :     sal_Bool bErgoDone : 1;    // ErgoDone already formatted
     538                 :            :     sal_Bool bNumDone  : 1;    // bNumDone already formatted
     539                 :            :     sal_Bool bArrowDone : 1;   // Arrow to the left for scrolling paragraphs
     540                 :            :     sal_Bool bStop   : 1;      // Cancel immediately, discarding the line
     541                 :            :     sal_Bool bNewLine  : 1;    // Format another line
     542                 :            :     sal_Bool bShift  : 1;      // Position change: Repaint until further notice
     543                 :            :     sal_Bool bUnderFlow : 1;   // Context: UnderFlow() ?
     544                 :            :     sal_Bool bInterHyph: 1;    // Interactive hyphenation?
     545                 :            :     sal_Bool bAutoHyph : 1;    // Automatic hyphenation?
     546                 :            :     sal_Bool bDropInit : 1;    // Set DropWidth
     547                 :            :     sal_Bool bQuick  : 1;      // FormatQuick()
     548                 :            :     sal_Bool bNoEndHyph  : 1;  // Switch off hyphenation at the line end (due to MaxHyphens)
     549                 :            :     sal_Bool bNoMidHyph  : 1;  // Switch off hyphenation before flys (due to MaxHyphens)
     550                 :            :     sal_Bool bIgnoreFly: 1;    // FitToContent ignores flys
     551                 :            :     sal_Bool bFakeLineStart: 1; // String has been replaced by field portion
     552                 :            :                                 // info structure only pretends that we are at
     553                 :            :                                 // the beginning of a line
     554                 :            :     sal_Bool bTabOverflow;      // Tabs are expanding after the end margin
     555                 :            : 
     556                 :            :     xub_Unicode   cTabDecimal;  // the current decimal delimiter
     557                 :            :     xub_Unicode   cHookChar;    // For tabs in fields etc.
     558                 :            :     sal_uInt8   nMaxHyph;       // Max. line count of followup hyphenations
     559                 :            :     sal_Bool   bTestFormat;     // Test formatting from WouldFit, no notification etc.
     560                 :            : 
     561                 :            :     // Hyphenating ...
     562                 :            :     sal_Bool InitHyph( const sal_Bool bAuto = sal_False );
     563                 :            :     sal_Bool _CheckFtnPortion( SwLineLayout* pCurr );
     564                 :            : 
     565                 :            : public:
     566                 :            :     void CtorInitTxtFormatInfo( SwTxtFrm *pFrm, const sal_Bool bInterHyph = sal_False,
     567                 :            :         const sal_Bool bQuick = sal_False, const sal_Bool bTst = sal_False );
     568                 :      14873 :     inline SwTxtFormatInfo(SwTxtFrm *pFrame,const sal_Bool bInterHyphL=sal_False,
     569                 :            :             const sal_Bool bQuickL = sal_False, const sal_Bool bTst = sal_False )
     570 [ +  - ][ +  - ]:      14873 :            { CtorInitTxtFormatInfo( pFrame, bInterHyphL, bQuickL, bTst ); }
     571                 :            : 
     572                 :            :     // For the formatting inside a double line in a line (multi-line portion)
     573                 :            :     // we need a modified text-format-info:
     574                 :            :     SwTxtFormatInfo( const SwTxtFormatInfo& rInf, SwLineLayout& rLay,
     575                 :            :         SwTwips nActWidth );
     576                 :            : 
     577                 :     201716 :     inline KSHORT Width() const { return nWidth; }
     578                 :      54388 :     inline void Width( const KSHORT nNew ) { nWidth = nNew; }
     579                 :            :            void Init();
     580                 :            : 
     581                 :            :     // Returns the first changed position of the paragraph
     582                 :            :     inline xub_StrLen GetReformatStart() const;
     583                 :            : 
     584                 :            :     // Margins
     585                 :        188 :     inline SwTwips Left() const { return nLeft; }
     586                 :      53368 :     inline void Left( const SwTwips nNew ) { nLeft = nNew; }
     587                 :      53368 :     inline SwTwips Right() const { return nRight; }
     588                 :      53368 :     inline void Right( const SwTwips nNew ) { nRight = nNew; }
     589                 :        188 :     inline SwTwips First() const { return nFirst; }
     590                 :      53368 :     inline void First( const SwTwips nNew ) { nFirst = nNew; }
     591                 :            :     inline SwTwips CurrLeft() const { return (nLineStart ? nLeft : nFirst); }
     592                 :     111294 :     inline KSHORT RealWidth() const { return nRealWidth; }
     593                 :      53884 :     inline void RealWidth( const KSHORT nNew ) { nRealWidth = nNew; }
     594                 :        188 :     inline KSHORT ForcedLeftMargin() const { return nForcedLeftMargin; }
     595                 :      53784 :     inline void ForcedLeftMargin( const KSHORT nN ) { nForcedLeftMargin = nN; }
     596                 :            : 
     597                 :      28990 :     inline sal_uInt8 &MaxHyph() { return nMaxHyph; }
     598                 :            :     inline const sal_uInt8 &MaxHyph() const { return nMaxHyph; }
     599                 :            : 
     600                 :       3784 :     inline SwLineLayout *GetRoot() { return pRoot; }
     601                 :          0 :     inline const SwLineLayout *GetRoot() const { return pRoot; }
     602                 :            : 
     603                 :      53368 :     inline void SetRoot( SwLineLayout *pNew ) { pRoot = pNew; }
     604                 :     635594 :     inline SwLinePortion *GetLast() { return pLast; }
     605                 :     166870 :     inline void SetLast( SwLinePortion *pNewLast ) { pLast = pNewLast; }
     606                 :     160668 :     inline sal_Bool IsFull() const { return bFull; }
     607                 :      67926 :     inline void SetFull( const sal_Bool bNew ) { bFull = bNew; }
     608                 :          0 :     inline sal_Bool IsHyphForbud() const
     609         [ #  # ]:          0 :         { return pFly ? bNoMidHyph : bNoEndHyph; }
     610                 :            :     inline void SetHyphForbud( const sal_Bool bNew )
     611                 :            :         { if ( pFly ) bNoMidHyph = bNew; else bNoEndHyph = bNew; }
     612                 :     107152 :     inline void ChkNoHyph( const sal_uInt8 bEnd, const sal_uInt8 bMid )
     613 [ +  + ][ -  + ]:     107152 :         { bNoEndHyph = (nMaxHyph && bEnd >= nMaxHyph);
     614 [ +  + ][ -  + ]:     107152 :           bNoMidHyph = (nMaxHyph && bMid >= nMaxHyph); }
     615                 :       1874 :     inline sal_Bool IsIgnoreFly() const { return bIgnoreFly; }
     616                 :         90 :     inline void SetIgnoreFly( const sal_Bool bNew ) { bIgnoreFly = bNew; }
     617                 :        319 :     inline sal_Bool IsFakeLineStart() const { return bFakeLineStart; }
     618                 :       2547 :     inline void SetFakeLineStart( const sal_Bool bNew ) { bFakeLineStart = bNew; }
     619                 :     377625 :     inline sal_Bool IsStop() const { return bStop; }
     620                 :        356 :     inline void SetStop( const sal_Bool bNew ) { bStop = bNew; }
     621                 :     502736 :     inline SwLinePortion *GetRest() { return pRest; }
     622                 :       1516 :     inline void SetRest( SwLinePortion *pNewRest ) { pRest = pNewRest; }
     623                 :     199914 :     inline sal_Bool IsNewLine() const { return bNewLine; }
     624                 :         97 :     inline void SetNewLine( const sal_Bool bNew ) { bNewLine = bNew; }
     625                 :      40880 :     inline sal_Bool IsShift() const { return bShift; }
     626                 :      12049 :     inline void SetShift( const sal_Bool bNew ) { bShift = bNew; }
     627                 :          0 :     inline sal_Bool IsInterHyph() const { return bInterHyph; }
     628                 :            :     inline sal_Bool IsAutoHyph() const { return bAutoHyph; }
     629                 :      52512 :     inline sal_Bool IsUnderFlow() const { return bUnderFlow; }
     630                 :      14023 :     inline void ClrUnderFlow() { bUnderFlow = sal_False; }
     631                 :      52762 :     inline sal_Bool IsDropInit() const { return bDropInit; }
     632                 :          0 :     inline void SetDropInit( const sal_Bool bNew ) { bDropInit = bNew; }
     633                 :      17053 :     inline sal_Bool IsQuick() const { return bQuick; }
     634                 :      41758 :     inline sal_Bool IsTest() const { return bTestFormat; }
     635                 :            : 
     636                 :     313244 :     inline xub_StrLen GetLineStart() const { return nLineStart; }
     637                 :      69608 :     inline void SetLineStart( const xub_StrLen nNew ) { nLineStart = nNew; }
     638                 :            : 
     639                 :            :     // these are used during fly calculation
     640                 :      54618 :     inline KSHORT GetLineHeight() const { return nLineHeight; }
     641                 :      52762 :     inline void SetLineHeight( const KSHORT nNew ) { nLineHeight = nNew; }
     642                 :          0 :     inline KSHORT GetLineNettoHeight() const { return nLineNettoHeight; }
     643                 :      52762 :     inline void SetLineNettoHeight( const KSHORT nNew ) { nLineNettoHeight = nNew; }
     644                 :            : 
     645                 :            :     inline const SwLinePortion *GetUnderFlow() const { return pUnderFlow; }
     646                 :     109397 :     inline SwLinePortion *GetUnderFlow() { return pUnderFlow; }
     647                 :          0 :     inline void SetUnderFlow( SwLinePortion *pNew )
     648                 :          0 :            { pUnderFlow = pNew; bUnderFlow = sal_True; }
     649                 :          0 :     inline xub_StrLen GetSoftHyphPos() const { return nSoftHyphPos; }
     650                 :          6 :     inline void SetSoftHyphPos( const xub_StrLen nNew ) { nSoftHyphPos = nNew; }
     651                 :            : 
     652                 :            :     inline void SetParaFtn();
     653                 :            : 
     654                 :            :     // FlyFrms
     655                 :     322868 :     inline SwFlyPortion *GetFly() { return pFly; }
     656                 :     108358 :     inline void SetFly( SwFlyPortion *pNew ) { pFly = pNew; }
     657                 :            : 
     658                 :            :     inline const SwAttrSet& GetCharAttr() const;
     659                 :            : 
     660                 :            :     // Tabs
     661                 :     149831 :     inline SwTabPortion *GetLastTab() { return pLastTab; }
     662                 :          4 :     inline void SetLastTab( SwTabPortion *pNew ) { pLastTab = pNew; }
     663                 :          4 :     inline xub_Unicode GetTabDecimal() const { return cTabDecimal; }
     664                 :          0 :     inline void SetTabDecimal( const xub_Unicode cNew ) { cTabDecimal = cNew;}
     665                 :            : 
     666                 :            :     // Last*
     667                 :            :     inline SwFldPortion *GetLastFld() { return pLastFld; }
     668                 :            :     inline void SetLastFld( SwFldPortion *pNew ) { pLastFld = pNew; }
     669                 :            : 
     670                 :        302 :     inline void ClearHookChar() { cHookChar = 0; }
     671                 :          0 :     inline void SetHookChar( const xub_Unicode cNew ) { cHookChar = cNew; }
     672                 :      67317 :     inline xub_Unicode GetHookChar() const { return cHookChar; }
     673                 :            : 
     674                 :            :     // Done-Flags
     675                 :      12102 :     inline sal_Bool IsFtnDone() const { return bFtnDone; }
     676                 :      11665 :     inline void SetFtnDone( const sal_Bool bNew ) { bFtnDone = bNew; }
     677                 :     161237 :     inline sal_Bool IsErgoDone() const { return bErgoDone; }
     678                 :      67321 :     inline void SetErgoDone( const sal_Bool bNew ) { bErgoDone = bNew; }
     679                 :      65640 :     inline sal_Bool IsNumDone() const { return bNumDone; }
     680                 :      64858 :     inline void SetNumDone( const sal_Bool bNew ) { bNumDone = bNew; }
     681                 :     149523 :     inline sal_Bool IsArrowDone() const { return bArrowDone; }
     682                 :      65513 :     inline void SetArrowDone( const sal_Bool bNew ) { bArrowDone = bNew; }
     683                 :            : 
     684                 :            :     // For SwTxtPortion::Hyphenate
     685                 :            :     inline sal_Bool IsSoftHyph( const xub_StrLen nPos ) const;
     686                 :            :     sal_Bool ChgHyph( const sal_Bool bNew );
     687                 :            : 
     688                 :            :     // Should the hyphenate helper be discarded?
     689                 :            :     sal_Bool IsHyphenate() const;
     690                 :            :     inline void SetHyphStart( const xub_StrLen nNew ) { nHyphStart = nNew; }
     691                 :            :     inline xub_StrLen GetHyphStart() const { return nHyphStart; }
     692                 :            :     inline void SetHyphWrdStart( const xub_StrLen nNew ) { nHyphWrdStart = nNew; }
     693                 :            :     inline xub_StrLen GetHyphWrdStart() const { return nHyphWrdStart; }
     694                 :            :     inline void SetHyphWrdLen( const xub_StrLen nNew ) { nHyphWrdLen = nNew; }
     695                 :            :     inline xub_StrLen GetHyphWrdLen() const { return nHyphWrdLen; }
     696                 :      53303 :     inline xub_StrLen GetUnderScorePos() const { return nUnderScorePos; }
     697                 :          0 :     inline void SetUnderScorePos( xub_StrLen nNew ) { nUnderScorePos = nNew; }
     698                 :            : 
     699                 :            :     // Calls HyphenateWord() of Hyphenator
     700                 :            :     ::com::sun::star::uno::Reference<
     701                 :            :         ::com::sun::star::linguistic2::XHyphenatedWord >
     702                 :            :                 HyphWord( const String &rTxt, const sal_uInt16 nMinTrail );
     703                 :            :     const com::sun::star::beans::PropertyValues &
     704                 :            :                 GetHyphValues() const;
     705                 :            : 
     706                 :      52762 :     sal_Bool CheckFtnPortion( SwLineLayout* pCurr )
     707 [ +  + ][ -  + ]:      52762 :         { return IsFtnInside() && _CheckFtnPortion( pCurr ); }
     708                 :            : 
     709                 :            :     // Dropcaps called by SwTxtFormatter::CTOR
     710                 :            :     const SwFmtDrop *GetDropFmt() const;
     711                 :            : 
     712                 :            :     // Resets the FormatInfo back to its original state
     713                 :            :     void Reset( const SwTxtFrm *pFrame); // , const sal_Bool bAll );
     714                 :            : 
     715                 :            :     // Sets the last SwKernPortion as pLast, if it is followed by empty portions
     716                 :            :     sal_Bool LastKernPortion();
     717                 :            : 
     718                 :            :     // Looks for tabs, TabDec, TXTATR and BRK from nIdx until nEnd.
     719                 :            :     // Return: Position; sets cHookChar if necessary
     720                 :            :     xub_StrLen ScanPortionEnd( const xub_StrLen nStart, const xub_StrLen nEnd );
     721                 :            : 
     722                 :            :     friend SvStream &operator<<( SvStream &rOS, const SwTxtFormatInfo &rInf );
     723                 :            : 
     724                 :      53784 :     inline void SetTabOverflow( sal_Bool bOverflow ) { bTabOverflow = bOverflow; }
     725                 :          0 :     inline sal_Bool IsTabOverflow( ) { return bTabOverflow; }
     726                 :            : };
     727                 :            : 
     728                 :            : /*************************************************************************
     729                 :            :  * class SwTxtSlot
     730                 :            :  * For the text replacement and restoration of SwTxtSizeInfo.
     731                 :            :  * The way this is done is a bit of a hack: Although rInf is const we change it
     732                 :            :  * anyway.
     733                 :            :  * Because rInf is restorated again in the DTOR, we can do this.
     734                 :            :  * You could call it a "logical const", if you wish.
     735                 :            : *************************************************************************/
     736                 :            : class SwTxtSlot
     737                 :            : {
     738                 :            :     XubString aTxt;
     739                 :            :     const XubString *pOldTxt;
     740                 :            :     const SwWrongList* pOldSmartTagList;
     741                 :            :     const SwWrongList* pOldGrammarCheckList;
     742                 :            :     SwWrongList* pTempList;
     743                 :            :     xub_StrLen nIdx;
     744                 :            :     xub_StrLen nLen;
     745                 :            :     sal_Bool bOn;
     746                 :            : protected:
     747                 :            :     SwTxtSizeInfo *pInf;
     748                 :            : public:
     749                 :            :     // The replacement string originates either from the portion via GetExpText()
     750                 :            :     // or from the char * pCh, if it is not NULL
     751                 :            :     SwTxtSlot( const SwTxtSizeInfo *pNew, const SwLinePortion *pPor, bool bTxtLen,
     752                 :            :                bool bExgLists, const sal_Char *pCh = NULL );
     753                 :            :     ~SwTxtSlot();
     754                 :            :     inline sal_Bool IsOn() const { return bOn; }
     755                 :            : };
     756                 :            : 
     757                 :            : /*************************************************************************
     758                 :            :  * class SwFontSave
     759                 :            :  *************************************************************************/
     760                 :            : 
     761                 :            : class SwFontSave
     762                 :            : {
     763                 :            :     SwTxtSizeInfo *pInf;
     764                 :            :     SwFont        *pFnt;
     765                 :            :     SwAttrIter    *pIter;
     766                 :            : public:
     767                 :            :     SwFontSave( const SwTxtSizeInfo &rInf, SwFont *pFnt,
     768                 :            :                 SwAttrIter* pItr = NULL );
     769                 :            :    ~SwFontSave();
     770                 :            : };
     771                 :            : 
     772                 :            : /*************************************************************************
     773                 :            :  * class SwDefFontSave
     774                 :            :  *************************************************************************/
     775                 :            : 
     776                 :            : class SwDefFontSave
     777                 :            : {
     778                 :            :     SwTxtSizeInfo *pInf;
     779                 :            :     SwFont        *pFnt;
     780                 :            :     SwFont        *pNewFnt;
     781                 :            :     sal_Bool           bAlter;
     782                 :            : public:
     783                 :            :     SwDefFontSave( const SwTxtSizeInfo &rInf );
     784                 :            :    ~SwDefFontSave();
     785                 :            : };
     786                 :            : 
     787                 :            : /*************************************************************************
     788                 :            :  * Inline implementations of SwTxtSizeInfo
     789                 :            :  *************************************************************************/
     790                 :            : 
     791                 :     107750 : inline KSHORT SwTxtSizeInfo::GetAscent() const
     792                 :            : {
     793                 :            :     OSL_ENSURE( GetOut(), "SwTxtSizeInfo::GetAscent() without pOut" );
     794                 :     107750 :     return ((SwFont*)GetFont())->GetAscent( pVsh, *GetOut() );
     795                 :            : }
     796                 :            : 
     797                 :     107711 : inline KSHORT SwTxtSizeInfo::GetTxtHeight() const
     798                 :            : {
     799                 :            :     OSL_ENSURE( GetOut(), "SwTxtSizeInfo::GetTxtHeight() without pOut" );
     800                 :     107711 :     return ((SwFont*)GetFont())->GetHeight( pVsh, *GetOut() );
     801                 :            : }
     802                 :            : 
     803                 :        833 : inline SwPosSize SwTxtSizeInfo::GetTxtSize( const XubString &rTxt ) const
     804                 :            : {
     805                 :        833 :     return GetTxtSize( pOut, 0, rTxt, 0, rTxt.Len(), 0 );
     806                 :            : }
     807                 :            : 
     808                 :          0 : inline SwPosSize SwTxtSizeInfo::GetTxtSize( const SwScriptInfo* pSI,
     809                 :            :                                             const xub_StrLen nNewIdx,
     810                 :            :                                             const xub_StrLen nNewLen,
     811                 :            :                                             const sal_uInt16 nCompress ) const
     812                 :            : {
     813                 :          0 :     return GetTxtSize( pOut, pSI, *pTxt, nNewIdx, nNewLen, nCompress );
     814                 :            : }
     815                 :            : 
     816                 :            : /*************************************************************************
     817                 :            :  * Inline implementations of SwTxtPaintInfo
     818                 :            :  *************************************************************************/
     819                 :            : 
     820                 :     114487 : inline SwTwips SwTxtPaintInfo::GetPaintOfst() const
     821                 :            : {
     822                 :     114487 :     return GetParaPortion()->GetRepaint()->GetOfst();
     823                 :            : }
     824                 :            : 
     825                 :     164283 : inline void SwTxtPaintInfo::SetPaintOfst( const SwTwips nNew )
     826                 :            : {
     827                 :     164283 :     GetParaPortion()->GetRepaint()->SetOfst( nNew );
     828                 :     164283 : }
     829                 :            : 
     830                 :            : 
     831                 :         18 : inline void SwTxtPaintInfo::DrawText( const XubString &rText,
     832                 :            :                             const SwLinePortion &rPor,
     833                 :            :                             const xub_StrLen nStart, const xub_StrLen nLength,
     834                 :            :                             const sal_Bool bKern ) const
     835                 :            : {
     836                 :         18 :     ((SwTxtPaintInfo*)this)->_DrawText( rText, rPor, nStart, nLength, bKern );
     837                 :         18 : }
     838                 :            : 
     839                 :       3622 : inline void SwTxtPaintInfo::DrawText( const SwLinePortion &rPor,
     840                 :            :         const xub_StrLen nLength, const sal_Bool bKern ) const
     841                 :            : {
     842                 :       3622 :     ((SwTxtPaintInfo*)this)->_DrawText( *pTxt, rPor, nIdx, nLength, bKern );
     843                 :       3622 : }
     844                 :            : 
     845                 :      22839 : inline void SwTxtPaintInfo::DrawMarkedText( const SwLinePortion &rPor,
     846                 :            :                                             const xub_StrLen nLength,
     847                 :            :                                             const sal_Bool bKern,
     848                 :            :                                             const sal_Bool bWrong,
     849                 :            :                                             const sal_Bool bSmartTags,
     850                 :            :                                             const sal_Bool bGrammarCheck ) const
     851                 :            : {
     852                 :      22839 :     ((SwTxtPaintInfo*)this)->_DrawText( *pTxt, rPor, nIdx, nLength, bKern, bWrong, bSmartTags, bGrammarCheck );
     853                 :      22839 : }
     854                 :            : 
     855                 :            : /*************************************************************************
     856                 :            :  * Inline implementations of SwTxtFormatInfo
     857                 :            :  *************************************************************************/
     858                 :            : 
     859                 :     114105 : inline xub_StrLen SwTxtFormatInfo::GetReformatStart() const
     860                 :            : {
     861                 :     114105 :     return GetParaPortion()->GetReformat()->Start();
     862                 :            : }
     863                 :            : 
     864                 :        362 : inline const SwAttrSet& SwTxtFormatInfo::GetCharAttr() const
     865                 :            : {
     866                 :        362 :     return GetTxtFrm()->GetTxtNode()->GetSwAttrSet();
     867                 :            : }
     868                 :            : 
     869                 :        142 : inline void SwTxtFormatInfo::SetParaFtn()
     870                 :            : {
     871                 :        142 :     GetTxtFrm()->SetFtn( sal_True );
     872                 :        142 : }
     873                 :            : 
     874                 :            : inline sal_Bool SwTxtFormatInfo::IsSoftHyph( const xub_StrLen nPos ) const
     875                 :            : {
     876                 :            :     return CHAR_SOFTHYPHEN == GetTxtFrm()->GetTxtNode()->GetTxt().GetChar(nPos);
     877                 :            : }
     878                 :            : 
     879                 :            : 
     880                 :            : 
     881                 :            : #endif
     882                 :            : 
     883                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10