LCOV - code coverage report
Current view: top level - sw/source/core/inc - swfont.hxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 428 452 94.7 %
Date: 2014-04-11 Functions: 130 144 90.3 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : #ifndef INCLUDED_SW_SOURCE_CORE_INC_SWFONT_HXX
      20             : #define INCLUDED_SW_SOURCE_CORE_INC_SWFONT_HXX
      21             : 
      22             : #include <i18nlangtag/lang.h>
      23             : #include <tools/color.hxx>
      24             : #include <tools/stream.hxx>
      25             : #include <tools/gen.hxx>
      26             : #include <editeng/svxfont.hxx>
      27             : #include <swtypes.hxx>
      28             : #include <drawfont.hxx>
      29             : #include <editeng/borderline.hxx>
      30             : #include <boost/optional.hpp>
      31             : 
      32             : class SfxItemSet;
      33             : class SwAttrSet;
      34             : class SwDoCapitals;     // DoCapitals
      35             : class SwDrawTextInfo;   // _DrawText
      36             : class SwScriptInfo;     // _GetTxtSize
      37             : class SwViewShell;
      38             : class IDocumentSettingAccess;
      39             : 
      40             : const sal_Unicode CH_BLANK = ' ';   // ' ' blank spaces
      41             : const sal_Unicode CH_BREAK = 0x0A;
      42             : const sal_Unicode CH_TAB   = '\t';  // \t
      43             : const sal_Unicode CH_PAR    = 0xB6;     // paragraph
      44             : const sal_Unicode CH_BULLET = 0xB7;     // centered dot
      45             : 
      46     1131665 : class SwSubFont : public SvxFont
      47             : {
      48             :     friend class SwFont;
      49             :     const void *pMagic;         // "MagicNumber" within the font cache
      50             :     Size        aSize;          // foreigners only see this size
      51             :     sal_uInt16      nFntIndex;      // index in the font cache
      52             :     sal_uInt16      nOrgHeight;     // height including escapement/proportion
      53             :     sal_uInt16      nOrgAscent;     // ascent including escapement/proportion
      54             :     sal_uInt16      nPropWidth;     // proportional width
      55             :     bool smallCapsPercentage66;
      56     1131624 :     inline SwSubFont() : aSize(0,0)
      57     1131624 :     { pMagic = NULL; nFntIndex = nOrgHeight = nOrgAscent = 0; nPropWidth =100; smallCapsPercentage66 = false; }
      58             : 
      59             :     sal_uInt16 CalcEscAscent( const sal_uInt16 nOldAscent ) const;
      60             :     sal_uInt16 CalcEscHeight( const sal_uInt16 nOldHeight,
      61             :                           const sal_uInt16 nOldAscent ) const;
      62             :     void CalcEsc( SwDrawTextInfo& rInf, Point& rPos );
      63             : 
      64             :     inline void CopyMagic( const SwSubFont& rFnt )
      65             :         { pMagic = rFnt.pMagic; nFntIndex = rFnt.nFntIndex; }
      66             : 
      67             :     SwSubFont& operator=( const SwSubFont &rFont );
      68             : 
      69             :     short _CheckKerning( );
      70             : 
      71             :     sal_Bool ChgFnt( SwViewShell *pSh, OutputDevice& rOut );
      72             :     sal_Bool IsSymbol( SwViewShell *pSh );
      73             :     sal_uInt16 GetAscent( SwViewShell *pSh, const OutputDevice& rOut );
      74             :     sal_uInt16 GetHeight( SwViewShell *pSh, const OutputDevice& rOut );
      75             :     Size _GetTxtSize( SwDrawTextInfo& rInf );
      76             :     Size GetCapitalSize( SwDrawTextInfo& rInf );
      77             :     void _DrawText( SwDrawTextInfo &rInf, const sal_Bool bGrey );
      78             :     void DrawCapital( SwDrawTextInfo &rInf );
      79             :     void DrawStretchCapital( SwDrawTextInfo &rInf );
      80             :     void DoOnCapitals( SwDoCapitals &rDo );
      81             :     void _DrawStretchText( SwDrawTextInfo &rInf );
      82             :     sal_Int32 _GetCrsrOfst( SwDrawTextInfo& rInf );
      83             :     sal_Int32 GetCapitalCrsrOfst( SwDrawTextInfo& rInf );
      84             : 
      85             :     inline void SetColor( const Color& rColor );
      86             :     inline void SetFillColor( const Color& rColor );
      87             :     inline void SetCharSet( const rtl_TextEncoding eCharSet );
      88             :     inline void SetPitch( const FontPitch ePitch );
      89             :     inline void SetAlign( const FontAlign eAlign );
      90             :     inline void SetUnderline( const FontUnderline eUnderline );
      91             :     inline void SetOverline( const FontUnderline eOverline );
      92             :     inline void SetStrikeout( const FontStrikeout eStrikeout );
      93             :     inline void SetItalic( const FontItalic eItalic );
      94             :     inline void SetOutline( const sal_Bool bOutline );
      95             :     inline void SetVertical( const sal_uInt16 nDir, const sal_Bool bVertFormat );
      96             :     inline void SetShadow( const sal_Bool bShadow );
      97             :     inline void SetAutoKern( const sal_uInt8 nAutoKern );
      98             :     inline void SetWordLineMode( const sal_Bool bWordLineMode );
      99             :     inline void SetEmphasisMark( const FontEmphasisMark eValue );
     100             :     inline void SetRelief( const FontRelief eNew );
     101             : 
     102             :     // methods for sub-/superscript
     103             :     inline void SetEscapement( const short nNewEsc );
     104             :     inline void SetProportion( const sal_uInt8 nNewPropr );
     105             : 
     106             :     inline void SetFamily( const FontFamily eFamily );
     107             :     inline void SetName( const OUString& rName );
     108             :     inline void SetStyleName( const OUString& rStyleName );
     109             :     inline void SetSize( const Size& rSize );
     110             :     inline void SetWeight( const FontWeight eWeight );
     111             :     inline void SetLanguage( LanguageType eNewLang );
     112      147173 :     inline short CheckKerning()
     113      147173 :     {   return GetFixKerning() >= 0 ? GetFixKerning() : _CheckKerning( ); }
     114        3045 :     inline void SetPropWidth( const sal_uInt16 nNew )
     115        3045 :         { pMagic = 0; nPropWidth = nNew; }
     116             : public:
     117      423111 :     sal_uInt16 GetPropWidth() const { return nPropWidth; }
     118             : };
     119             : 
     120             : #define SW_LATIN 0
     121             : #define SW_CJK 1
     122             : #define SW_CTL 2
     123             : #define SW_SCRIPTS 3
     124             : 
     125             : class SwFont
     126             : {
     127             :     // CJK == Chinese, Japanese, Korean
     128             :     // CTL == Complex text layout ( Hebrew, Arabic )
     129             :     SwSubFont   aSub[SW_SCRIPTS]; // Latin-, CJK- and CTL-font
     130             : 
     131             :     Color*      pBackColor;     // background color (i.e. at character styles)
     132             :     Color       m_aHighlightColor;   // highlight color
     133             :     Color       aUnderColor;    // color of the underlining
     134             :     Color       aOverColor;     // color of the overlining
     135             : 
     136             :     // character borders
     137             :     boost::optional<editeng::SvxBorderLine>     m_aTopBorder;
     138             :     boost::optional<editeng::SvxBorderLine>     m_aBottomBorder;
     139             :     boost::optional<editeng::SvxBorderLine>     m_aRightBorder;
     140             :     boost::optional<editeng::SvxBorderLine>     m_aLeftBorder;
     141             : 
     142             :     // border distance
     143             :     sal_uInt16 m_nTopBorderDist;
     144             :     sal_uInt16 m_nBottomBorderDist;
     145             :     sal_uInt16 m_nRightBorderDist;
     146             :     sal_uInt16 m_nLeftBorderDist;
     147             : 
     148             :     Color               m_aShadowColor;
     149             :     sal_uInt16          m_nShadowWidth;
     150             :     SvxShadowLocation   m_aShadowLocation;
     151             : 
     152             :     sal_uInt8   nToxCnt;        // counts the nesting depth of the Tox
     153             :     sal_uInt8   nRefCnt;        // counts the nesting depth of the Refs
     154             :     sal_uInt8   m_nMetaCount;   // count META/METAFIELD
     155             :     sal_uInt8   m_nInputFieldCount; // count INPUTFIELD
     156             : 
     157             :     sal_uInt8   nActual;        // actual font (Latin, CJK or CTL)
     158             : 
     159             :     // switch for the font-extensions
     160             :     sal_Bool bNoHyph        :1;  // SwTxtNoHyphenHere: no separator
     161             :     sal_Bool bBlink         :1;  // blinking font
     162             :     sal_Bool bPaintBlank    :1;  // blanks not with DrawRect
     163             :     sal_Bool bFntChg        :1;
     164             :     sal_Bool bOrgChg        :1;  // nOrgHeight/Ascent are invalid
     165             :     sal_Bool bURL           :1;
     166             :     sal_Bool bPaintWrong    :1;  // flag for spelling mistakes
     167             :     sal_Bool bGreyWave      :1;  // for the extended TextInput: gray waveline
     168             :     sal_Bool bNoColReplace  :1;  // Replacement without colormanipulation
     169             : 
     170             : public:
     171             :     SwFont( const SwAttrSet* pSet, const IDocumentSettingAccess* pIDocumentSettingAccess );
     172             :     SwFont( const SwFont& rFont );
     173             : 
     174      305537 :     inline void ChgFnt( SwViewShell *pSh, OutputDevice& rOut )
     175      305537 :         { bPaintBlank = aSub[nActual].ChgFnt( pSh, rOut ); }
     176             : 
     177             :     ~SwFont();
     178             : 
     179             :     SwFont& operator=( const SwFont &rFont );
     180             : 
     181      678611 :     inline sal_uInt8 GetActual() const {    return nActual; }
     182             :     inline void SetActual( sal_uInt8 nNew );
     183           0 :     inline const SvxFont& GetActualFont() const { return aSub[nActual]; }
     184             : 
     185             :     // gets a MagicNumber via SwFntAccess
     186             :     void GoMagic( SwViewShell *pSh, sal_uInt8 nWhich );
     187             :     // set background color
     188             :     void SetBackColor( Color* pNewColor );
     189       30898 :     inline const Color* GetBackColor() const{ return pBackColor; }
     190             :     void SetHighlightColor( const Color& aNewColor );
     191       13668 :     const Color& GetHighlightColor() const { return m_aHighlightColor; }
     192             : 
     193      136778 :     inline void ChkMagic( SwViewShell *pSh, sal_uInt8 nWhich )
     194      136778 :         { if( !aSub[ nWhich ].pMagic ) GoMagic( pSh, nWhich ); }
     195             :     // assumes the MagicNumber of a (hopefully not identical) colleague
     196             :     inline void CopyMagic( const SwFont* pFnt, sal_uInt8 nWhich )
     197             :         { aSub[nWhich].CopyMagic( pFnt->aSub[nWhich] ); }
     198      112866 :     inline void GetMagic( const void* &rMagic, sal_uInt16 &rIdx, sal_uInt8 nWhich )
     199      112866 :         { rMagic = aSub[nWhich].pMagic; rIdx = aSub[nWhich].nFntIndex; }
     200      114499 :     inline void SetMagic( const void* pNew, const sal_uInt16 nIdx, sal_uInt8 nWhich )
     201      114499 :         { aSub[nWhich].pMagic = pNew; aSub[nWhich].nFntIndex = nIdx; }
     202       13369 :     inline sal_Bool DifferentMagic( const SwFont* pFnt, sal_uInt8 nWhich )
     203       14370 :         { return aSub[nWhich].pMagic != pFnt->aSub[nWhich].pMagic ||
     204       14370 :           !aSub[nWhich].pMagic || !pFnt->aSub[nWhich].pMagic; }
     205             : 
     206         142 :     inline const Size &GetSize( sal_uInt8 nWhich ) const
     207         142 :         { return aSub[nWhich].aSize; }
     208      263532 :     inline sal_Bool IsFntChg() const { return bFntChg; }
     209       91421 :     inline void SetFntChg( const sal_Bool bNew ) { bFntChg = bNew; }
     210             : 
     211             :     // the encapsulated SV-Font-methods (set bFntChg to sal_True)
     212             :     inline void SetColor( const Color& rColor );
     213             :     inline void SetFillColor( const Color& rColor );
     214             :     inline void SetAlign( const FontAlign eAlign );
     215             :     inline void SetUnderline( const FontUnderline eUnderline );
     216       45378 :     inline void SetUnderColor( const Color &rColor ) { aUnderColor = rColor; }
     217             :     inline void SetOverline( const FontUnderline eOverline );
     218       36946 :     inline void SetOverColor( const Color &rColor ) { aOverColor = rColor; }
     219             :     inline void SetStrikeout( const FontStrikeout eStrikeout );
     220             :     inline void SetOutline( const sal_Bool bOutline );
     221             :            void SetVertical( sal_uInt16 nDir, const sal_Bool nVertLayout = sal_False );
     222             :     inline void SetShadow( const sal_Bool bShadow );
     223             :     inline void SetAutoKern( sal_uInt8 nAutoKern );
     224             :     inline void SetTransparent( const sal_Bool bTrans );
     225             :     inline void SetWordLineMode( const sal_Bool bWordLineMode );
     226             :     inline void SetFixKerning( const short nNewKern );
     227             :     inline void SetCaseMap( const SvxCaseMap eNew );
     228             :     inline void SetEmphasisMark( const FontEmphasisMark eValue );
     229             : 
     230             :     // methods for sub-/superscript
     231             :     inline void SetEscapement( const short nNewEsc );
     232             :     inline void SetProportion( const sal_uInt8 nNewPropr );
     233             : 
     234             :     inline void SetPropWidth( const sal_uInt16 nNew );
     235             : 
     236             :     inline void SetFamily( const FontFamily eFamily, const sal_uInt8 nWhich );
     237             :     inline void SetName( const OUString& rName, const sal_uInt8 nWhich );
     238             :     inline void SetStyleName( const OUString& rStyleName, const sal_uInt8 nWhich );
     239             :     inline void SetSize( const Size& rSize, const sal_uInt8 nWhich );
     240             :     inline void SetWeight( const FontWeight eWeight, const sal_uInt8 nWhich );
     241             :     inline void SetItalic( const FontItalic eItalic, const sal_uInt8 nWhich );
     242             :     inline void SetLanguage( LanguageType eNewLang, const sal_uInt8 nWhich );
     243             :     inline void SetCharSet( const rtl_TextEncoding eCharSet, const sal_uInt8 nWhich );
     244             :     inline void SetPitch( const FontPitch ePitch, const sal_uInt8 nWhich );
     245             :     inline void SetRelief( const FontRelief eNew );
     246             : 
     247             :     // Get/Set-methods for the current setting
     248             :     inline void SetNoHyph( const sal_Bool bNew );
     249             :     inline sal_Bool IsNoHyph() const { return bNoHyph; }
     250             :     inline void SetBlink( const sal_Bool bBlink );
     251       13996 :     inline sal_Bool IsBlink() const { return bBlink; }
     252        1225 :     inline sal_uInt8 &GetTox() { return nToxCnt; }
     253             :     inline sal_uInt8 GetTox() const { return nToxCnt; }
     254       59498 :     inline sal_Bool IsTox() const { return ( 0 != nToxCnt ); }
     255         156 :     inline sal_uInt8 &GetRef() { return nRefCnt; }
     256             :     inline sal_uInt8 GetRef() const { return nRefCnt; }
     257       59474 :     inline sal_Bool IsRef() const { return ( 0 != nRefCnt ); }
     258        1120 :     inline sal_uInt8 &GetMeta() { return m_nMetaCount; }
     259             :     inline sal_uInt8 GetMeta() const { return m_nMetaCount; }
     260       59456 :     inline bool IsMeta() const { return (0 != m_nMetaCount); }
     261           8 :     inline sal_uInt8 &GetInputField() { return m_nInputFieldCount; }
     262             :     inline sal_uInt8 GetInputField() const { return m_nInputFieldCount; }
     263       59477 :     inline bool IsInputField() const { return (0 != m_nInputFieldCount); }
     264             :     inline void SetURL( const sal_Bool bURL );
     265       81508 :     inline sal_Bool IsURL() const { return bURL; }
     266             :     inline void SetGreyWave( const sal_Bool bNew );
     267       14034 :     inline sal_Bool IsGreyWave() const { return bGreyWave; }
     268             :     inline void SetNoCol( const sal_Bool bNew );
     269             :     inline sal_Bool IsNoCol() const { return bNoColReplace; }
     270             : 
     271             :     inline void SetPaintBlank( const sal_Bool bNew );
     272         278 :     inline sal_Bool IsPaintBlank() const { return bPaintBlank; }
     273             :     inline void SetPaintWrong( const sal_Bool bNew );
     274             :     inline sal_Bool IsPaintWrong() const { return bPaintWrong; }
     275             : 
     276             :     // setting of the base class font for SwTxtCharFmt
     277             :     void SetDiffFnt( const SfxItemSet* pSet,
     278             :                      const IDocumentSettingAccess* pIDocumentSettingAccess );
     279             : 
     280           0 :     inline const SvxFont &GetFnt( const sal_uInt8 nWhich ) const
     281           0 :         { return aSub[nWhich]; };
     282             : 
     283           0 :     sal_Bool IsSymbol( SwViewShell *pSh )
     284           0 :         { return aSub[nActual].IsSymbol( pSh ); }
     285      190265 :     FontUnderline GetUnderline() const { return aSub[nActual].GetUnderline(); }
     286      381145 :     const Color& GetUnderColor() const { return aUnderColor; }
     287         143 :     FontUnderline GetOverline() const { return aSub[nActual].GetOverline(); }
     288      381096 :     const Color& GetOverColor() const { return aOverColor; }
     289             :     short GetFixKerning() const { return aSub[nActual].GetFixKerning(); }
     290         143 :     FontStrikeout GetStrikeout() const { return aSub[nActual].GetStrikeout(); }
     291             :     const Color& GetColor() const { return aSub[nActual].GetColor(); }
     292             :     sal_Bool IsShadow() const { return aSub[nActual].IsShadow(); }
     293        4429 :     sal_Bool IsWordLineMode() const { return aSub[nActual].IsWordLineMode(); }
     294             :     sal_Bool IsOutline() const { return aSub[nActual].IsOutline(); }
     295             :     sal_Bool IsKerning() const { return aSub[nActual].IsKerning(); }
     296        5209 :     short GetEscapement() const { return aSub[nActual].GetEscapement(); }
     297        3823 :     SvxCaseMap GetCaseMap() const { return aSub[nActual].GetCaseMap(); }
     298         230 :     sal_uInt8 GetPropr() const { return aSub[nActual].GetPropr(); }
     299       65578 :     FontItalic GetItalic() const { return aSub[nActual].GetItalic(); }
     300      104511 :     LanguageType GetLanguage() const { return aSub[nActual].GetLanguage(); }
     301             :     FontAlign GetAlign() const { return aSub[nActual].GetAlign(); }
     302             :     const OUString& GetName() const { return aSub[nActual].GetName(); }
     303             :     const OUString& GetStyleName() const {return aSub[nActual].GetStyleName();}
     304             :     FontFamily GetFamily() const { return aSub[nActual].GetFamily(); }
     305             :     FontPitch GetPitch() const { return aSub[nActual].GetPitch(); }
     306             :     rtl_TextEncoding GetCharSet() const { return aSub[nActual].GetCharSet(); }
     307       14199 :     long GetHeight() const { return aSub[nActual].GetSize().Height(); }
     308         176 :     FontWeight GetWeight() const { return aSub[nActual].GetWeight(); }
     309           0 :     FontEmphasisMark GetEmphasisMark() const
     310           0 :         { return aSub[nActual].GetEmphasisMark(); }
     311             :     sal_uInt16 GetPropWidth() const { return aSub[nActual].GetPropWidth(); }
     312             :     sal_uInt16 GetOrientation( const sal_Bool nVertLayout = sal_False ) const;
     313             : 
     314           0 :     inline const OUString& GetName( const sal_uInt8 nWhich ) const
     315           0 :         { return aSub[nWhich].GetName(); }
     316           0 :     inline LanguageType GetLanguage( const sal_uInt8 nWhich ) const
     317           0 :         { return aSub[nWhich].GetLanguage(); }
     318             :     inline const OUString& GetStyleName( const sal_uInt8 nWhich ) const
     319             :         { return aSub[nWhich].GetStyleName(); }
     320             :     inline FontFamily GetFamily( const sal_uInt8 nWhich ) const
     321             :         { return aSub[nWhich].GetFamily(); }
     322             :     inline FontItalic GetItalic( const sal_uInt8 nWhich ) const
     323             :         { return aSub[nWhich].GetItalic(); }
     324             :     inline FontPitch GetPitch( const sal_uInt8 nWhich ) const
     325             :         { return aSub[nWhich].GetPitch(); }
     326          12 :     inline rtl_TextEncoding GetCharSet( const sal_uInt8 nWhich ) const
     327          12 :         { return aSub[nWhich].GetCharSet(); }
     328          33 :     inline long GetHeight( const sal_uInt8 nWhich ) const
     329          33 :         { return aSub[nWhich].GetSize().Height(); }
     330             :     inline FontWeight GetWeight( const sal_uInt8 nWhich ) const
     331             :         { return aSub[nWhich].GetWeight(); }
     332             :     inline FontEmphasisMark GetEmphasisMark( const sal_uInt8 nWhich ) const
     333             :         { return aSub[nWhich].GetEmphasisMark(); }
     334             : 
     335             :     // makes the logical font be effective in the OutputDevice
     336             :     void ChgPhysFnt( SwViewShell *pSh, OutputDevice& rOut );
     337             : 
     338             :     Size GetCapitalSize( SwDrawTextInfo& rInf )
     339             :         { return aSub[nActual].GetCapitalSize( rInf ); }
     340             : 
     341             :     sal_Int32 GetCapitalBreak( SwViewShell* pSh,  const OutputDevice* pOut,
     342             :         const SwScriptInfo* pScript, const OUString& rTxt,
     343             :         long nTextWidth, const sal_Int32 nIdx,
     344             :         const sal_Int32 nLen );
     345             : 
     346             :     sal_Int32 GetCapitalCrsrOfst( SwDrawTextInfo& rInf )
     347             :         { return aSub[nActual].GetCapitalCrsrOfst( rInf ); }
     348             : 
     349             :     void DrawCapital( SwDrawTextInfo &rInf )
     350             :         { aSub[nActual].DrawCapital( rInf ); }
     351             : 
     352             :     void DrawStretchCapital( SwDrawTextInfo &rInf )
     353             :         { aSub[nActual].DrawStretchCapital( rInf ); }
     354             : 
     355           2 :     void DoOnCapitals( SwDoCapitals &rDo )
     356           2 :         { aSub[nActual].DoOnCapitals( rDo ); }
     357             : 
     358       64439 :     Size _GetTxtSize( SwDrawTextInfo& rInf )
     359       64439 :         { rInf.SetFont( this ); return aSub[nActual]._GetTxtSize( rInf ); }
     360             : 
     361             :     sal_Int32 GetTxtBreak( SwDrawTextInfo& rInf, long nTextWidth );
     362             : 
     363           0 :     sal_Int32 _GetCrsrOfst( SwDrawTextInfo& rInf )
     364           0 :         { return aSub[nActual]._GetCrsrOfst( rInf ); }
     365             : 
     366       14034 :     inline void _DrawText( SwDrawTextInfo &rInf )
     367       14034 :         { aSub[nActual]._DrawText( rInf, IsGreyWave() ); }
     368             : 
     369          57 :     inline void _DrawStretchText( SwDrawTextInfo &rInf )
     370          57 :         { aSub[nActual]._DrawStretchText( rInf ); }
     371             : 
     372       68593 :     inline short CheckKerning()
     373       68593 :         { return aSub[nActual].CheckKerning(); }
     374             : 
     375      145977 :     inline sal_uInt16 GetAscent( SwViewShell *pSh, const OutputDevice& rOut )
     376      145977 :         { return aSub[nActual].GetAscent( pSh, rOut ); }
     377      200428 :     inline sal_uInt16 GetHeight( SwViewShell *pSh, const OutputDevice& rOut )
     378      200428 :         { return aSub[nActual].GetHeight( pSh, rOut ); }
     379             : 
     380       26740 :     inline void Invalidate()
     381       26740 :         { bFntChg = bOrgChg = sal_True; }
     382             : 
     383             :     void SetTopBorder( const editeng::SvxBorderLine* pTopBorder );
     384             :     void SetBottomBorder( const editeng::SvxBorderLine* pBottomBorder );
     385             :     void SetRightBorder( const editeng::SvxBorderLine* pRightBorder );
     386             :     void SetLeftBorder( const editeng::SvxBorderLine* pLeftBorder );
     387             : 
     388          12 :     const boost::optional<editeng::SvxBorderLine>& GetTopBorder() const { return m_aTopBorder; }
     389          12 :     const boost::optional<editeng::SvxBorderLine>& GetBottomBorder() const { return m_aBottomBorder; }
     390        1807 :     const boost::optional<editeng::SvxBorderLine>& GetRightBorder() const { return m_aRightBorder; }
     391       13982 :     const boost::optional<editeng::SvxBorderLine>& GetLeftBorder() const { return m_aLeftBorder; }
     392             : 
     393             :     // Get absolute border correspond to the layout verticality and orientation.
     394             :     const boost::optional<editeng::SvxBorderLine>& GetAbsTopBorder( const bool bVertLayout ) const;
     395             :     const boost::optional<editeng::SvxBorderLine>& GetAbsBottomBorder( const bool bVertLayout ) const;
     396             :     const boost::optional<editeng::SvxBorderLine>& GetAbsRightBorder( const bool bVertLayout ) const;
     397             :     const boost::optional<editeng::SvxBorderLine>& GetAbsLeftBorder( const bool bVertLayout ) const;
     398             : 
     399             :     void SetTopBorderDist( const sal_uInt16 nTopDist );
     400             :     void SetBottomBorderDist( const sal_uInt16 nBottomDist );
     401             :     void SetRightBorderDist( const sal_uInt16 nRightDist );
     402             :     void SetLeftBorderDist( const sal_uInt16 nLeftDist );
     403             : 
     404           0 :     sal_uInt16 GetTopBorderDist() const { return m_nTopBorderDist; }
     405           0 :     sal_uInt16 GetBottomBorderDist() const { return m_nBottomBorderDist; }
     406           0 :     sal_uInt16 GetRightBorderDist() const { return m_nRightBorderDist; }
     407           0 :     sal_uInt16 GetLeftBorderDist() const { return m_nLeftBorderDist; }
     408             : 
     409             :     // Return with the whole space which border holed (border width, spacing and shadow width)
     410             :     sal_uInt16 GetTopBorderSpace() const;
     411             :     sal_uInt16 GetBottomBorderSpace() const;
     412             :     sal_uInt16 GetRightBorderSpace() const;
     413             :     sal_uInt16 GetLeftBorderSpace() const;
     414             : 
     415             :     /// Check whether font has any border on any side
     416             :     bool HasBorder() const;
     417             : 
     418             :     void SetShadowColor( const Color& rColor );
     419             :     void SetShadowWidth( const sal_uInt16 nWidth );
     420             :     void SetShadowLocation( const SvxShadowLocation aLocation );
     421             : 
     422       14199 :     const Color&        GetShadowColor() const { return m_aShadowColor; }
     423       14199 :     sal_uInt16          GetShadowWidth() const { return m_nShadowWidth; }
     424           0 :     SvxShadowLocation   GetShadowLocation() const { return m_aShadowLocation; }
     425             : 
     426             :     /**
     427             :      * Get the absolute shadow location dependent from orientation.
     428             :      *
     429             :      * @param[in]   bVertLayout true, if the container layout is vertical
     430             :      *                          false, otherwise
     431             :      * @return      absolute location
     432             :     **/
     433             :     SvxShadowLocation GetAbsShadowLocation( const bool bVertLayout ) const;
     434             : 
     435             :     /**
     436             :      * Calculate the shadow space on the specified side dependent from
     437             :      * the orientation and connection with neightbours.
     438             :      * @see shaditem.hxx for integer constants of sides
     439             :      *
     440             :      * @param[in]   nShadow     specify the side
     441             :      * @param[in]   bVertLayout true, if the container layout is vertical
     442             :      *                          false, otherwise
     443             :      * @param[in]   bSkipLeft   relative left shadow space is skipped
     444             :      * @param[in]   bSkipRight  relative right shadow space is skipped
     445             :      * @return      the shadow space
     446             :     **/
     447             :     sal_uInt16 CalcShadowSpace(
     448             :         const sal_uInt16 nShadow, const bool bVertLayout,
     449             :         const bool bSkipLeft, const bool bSkipRight ) const;
     450             : };
     451             : 
     452       68035 : inline void SwFont::SetColor( const Color& rColor )
     453             : {
     454       68035 :     bFntChg = sal_True;
     455       68035 :     aSub[0].SetColor( rColor );
     456       68035 :     aSub[1].SetColor( rColor );
     457       68035 :     aSub[2].SetColor( rColor );
     458       68035 : }
     459             : 
     460             : // encapsulated SV-Font-method
     461      204105 : inline void SwSubFont::SetColor( const Color& rColor )
     462             : {
     463      204105 :     pMagic = 0;
     464      204105 :     Font::SetColor( rColor );
     465      204105 : }
     466             : 
     467             : // encapsulated SV-Font-method
     468         147 : inline void SwSubFont::SetFillColor( const Color& rColor )
     469             : {
     470         147 :     pMagic = 0;
     471         147 :     Font::SetFillColor( rColor );
     472         147 : }
     473             : 
     474          49 : inline void SwFont::SetFillColor( const Color& rColor )
     475             : {
     476          49 :     bFntChg = sal_True;
     477          49 :     aSub[0].SetFillColor( rColor );
     478          49 :     aSub[1].SetFillColor( rColor );
     479          49 :     aSub[2].SetFillColor( rColor );
     480          49 : }
     481             : 
     482             : // encapsulated SV-Font-method
     483      172517 : inline void SwSubFont::SetFamily( const FontFamily eFamily )
     484             : {
     485      172517 :     pMagic = 0;
     486      172517 :     Font::SetFamily( eFamily );
     487      172517 : }
     488             : 
     489       60841 : inline void SwFont::SetFamily( const FontFamily eFamily, const sal_uInt8 nWhich )
     490             : {
     491       60841 :     bFntChg = sal_True;
     492       60841 :     aSub[nWhich].SetFamily( eFamily );
     493       60841 : }
     494             : 
     495             : // encapsulated SV-Font-method
     496      171394 : inline void SwSubFont::SetName( const OUString& rName )
     497             : {
     498      171394 :     pMagic = 0;
     499      171394 :     Font::SetName( rName );
     500      171394 : }
     501             : 
     502       60841 : inline void SwFont::SetName( const OUString& rName, const sal_uInt8 nWhich )
     503             : {
     504       60841 :     bFntChg = sal_True;
     505       60841 :     aSub[nWhich].SetName( rName );
     506       60841 : }
     507             : 
     508             : // encapsulated SV-Font-method
     509      171394 : inline void SwSubFont::SetStyleName( const OUString& rStyleName )
     510             : {
     511      171394 :     pMagic = 0;
     512      171394 :     Font::SetStyleName( rStyleName );
     513      171394 : }
     514             : 
     515       60841 : inline void SwFont::SetStyleName( const OUString& rStyle, const sal_uInt8 nWhich )
     516             : {
     517       60841 :     bFntChg = sal_True;
     518       60841 :     aSub[nWhich].SetStyleName( rStyle );
     519       60841 : }
     520             : 
     521             : // encapsulated SV-Font-method
     522      171394 : inline void SwSubFont::SetCharSet( const rtl_TextEncoding eCharSet )
     523             : {
     524      171394 :     pMagic = 0;
     525      171394 :     Font::SetCharSet( eCharSet );
     526      171394 : }
     527             : 
     528       60841 : inline void SwFont::SetCharSet( const rtl_TextEncoding eCharSet, const sal_uInt8 nWhich )
     529             : {
     530       60841 :     bFntChg = sal_True;
     531       60841 :     aSub[nWhich].SetCharSet( eCharSet );
     532       60841 : }
     533             : 
     534             : // encapsulated SV-Font-method
     535      171391 : inline void SwSubFont::SetPitch( const FontPitch ePitch )
     536             : {
     537      171391 :     pMagic = 0;
     538      171391 :     Font::SetPitch( ePitch );
     539      171391 : }
     540             : 
     541             : // encapsulated SV-Font-method
     542       60838 : inline void SwFont::SetPitch( const FontPitch ePitch, const sal_uInt8 nWhich )
     543             : {
     544       60838 :     bFntChg = sal_True;
     545       60838 :     aSub[nWhich].SetPitch( ePitch );
     546       60838 : }
     547             : 
     548             : // encapsulated SV-Font-method
     549      153006 : inline void SwSubFont::SetAlign( const FontAlign eAlign )
     550             : {
     551      153006 :     pMagic = 0;
     552      153006 :     Font::SetAlign( eAlign );
     553      153006 : }
     554             : 
     555       51002 : inline void SwFont::SetAlign( const FontAlign eAlign )
     556             : {
     557       51002 :     bFntChg = sal_True;
     558       51002 :     aSub[0].SetAlign( eAlign );
     559       51002 :     aSub[1].SetAlign( eAlign );
     560       51002 :     aSub[2].SetAlign( eAlign );
     561       51002 : }
     562             : 
     563             : // encapsulated SV-Font-method
     564      159378 : inline void SwSubFont::SetWeight( const FontWeight eWeight )
     565             : {
     566      159378 :     pMagic = 0;
     567      159378 :     Font::SetWeight( eWeight );
     568      159378 : }
     569             : 
     570       48825 : inline void SwFont::SetWeight( const FontWeight eWeight, const sal_uInt8 nWhich )
     571             : {
     572       48825 :     bFntChg = sal_True;
     573       48825 :     aSub[nWhich].SetWeight( eWeight );
     574       48825 : }
     575             : 
     576             : // encapsulated SV-Font-method
     577      146031 : inline void SwSubFont::SetUnderline( const FontUnderline eUnderline )
     578             : {
     579      146031 :     pMagic = 0;
     580      146031 :     Font::SetUnderline( eUnderline );
     581      146031 : }
     582             : 
     583       48643 : inline void SwFont::SetUnderline( const FontUnderline eUnderline )
     584             : {
     585       48643 :     bFntChg = sal_True;
     586       48643 :     aSub[0].SetUnderline( eUnderline );
     587       48643 :     aSub[1].SetUnderline( eUnderline );
     588       48643 :     aSub[2].SetUnderline( eUnderline );
     589       48643 : }
     590             : 
     591             : // encapsulated SV-Font-method
     592      120638 : inline void SwSubFont::SetOverline( const FontUnderline eOverline )
     593             : {
     594      120638 :     pMagic = 0;
     595      120638 :     Font::SetOverline( eOverline );
     596      120638 : }
     597             : 
     598       40212 : inline void SwFont::SetOverline( const FontUnderline eOverline )
     599             : {
     600       40212 :     bFntChg = sal_True;
     601       40212 :     aSub[0].SetOverline( eOverline );
     602       40212 :     aSub[1].SetOverline( eOverline );
     603       40212 :     aSub[2].SetOverline( eOverline );
     604       40212 : }
     605             : 
     606             : // encapsulated SV-Font-method
     607      117815 : inline void SwSubFont::SetStrikeout( const FontStrikeout eStrikeout )
     608             : {
     609      117815 :     pMagic = 0;
     610      117815 :     Font::SetStrikeout( eStrikeout );
     611      117815 : }
     612             : 
     613       39271 : inline void SwFont::SetStrikeout( const FontStrikeout eStrikeout )
     614             : {
     615       39271 :     bFntChg = sal_True;
     616       39271 :     aSub[0].SetStrikeout( eStrikeout );
     617       39271 :     aSub[1].SetStrikeout( eStrikeout );
     618       39271 :     aSub[2].SetStrikeout( eStrikeout );
     619       39271 : }
     620             : 
     621             : // encapsulated SV-Font-method
     622      138791 : inline void SwSubFont::SetItalic( const FontItalic eItalic )
     623             : {
     624      138791 :     pMagic = 0;
     625      138791 :     Font::SetItalic( eItalic );
     626      138791 : }
     627             : 
     628       28238 : inline void SwFont::SetItalic( const FontItalic eItalic, const sal_uInt8 nWhich )
     629             : {
     630       28238 :     bFntChg = sal_True;
     631       28238 :     aSub[nWhich].SetItalic( eItalic );
     632       28238 : }
     633             : 
     634             : // encapsulated SV-Font-method
     635      113724 : inline void SwSubFont::SetOutline( const sal_Bool bOutline )
     636             : {
     637      113724 :     pMagic = 0;
     638      113724 :     Font::SetOutline( bOutline );
     639      113724 : }
     640             : 
     641       37908 : inline void SwFont::SetOutline( const sal_Bool bOutline )
     642             : {
     643       37908 :     bFntChg = sal_True;
     644       37908 :     aSub[0].SetOutline( bOutline );
     645       37908 :     aSub[1].SetOutline( bOutline );
     646       37908 :     aSub[2].SetOutline( bOutline );
     647       37908 : }
     648             : 
     649             : // encapsulated SV-Font-method
     650      114219 : inline void SwSubFont::SetShadow( const sal_Bool bShadow )
     651             : {
     652      114219 :     pMagic = 0;
     653      114219 :     Font::SetShadow( bShadow );
     654      114219 : }
     655             : 
     656       38073 : inline void SwFont::SetShadow( const sal_Bool bShadow )
     657             : {
     658       38073 :     bFntChg = sal_True;
     659       38073 :     aSub[0].SetShadow( bShadow );
     660       38073 :     aSub[1].SetShadow( bShadow );
     661       38073 :     aSub[2].SetShadow( bShadow );
     662       38073 : }
     663             : 
     664             : // encapsulated SV-Font-method
     665      117690 : inline void SwSubFont::SetAutoKern( const sal_uInt8 nAutoKern )
     666             : {
     667      117690 :     pMagic = 0;
     668      117690 :     Font::SetKerning( nAutoKern );
     669      117690 : }
     670             : 
     671       39230 : inline void SwFont::SetAutoKern( sal_uInt8 nAutoKern )
     672             : {
     673       39230 :     bFntChg = sal_True;
     674       39230 :     aSub[1].SetAutoKern( nAutoKern );
     675       39230 :     if( nAutoKern )
     676       32444 :         nAutoKern = KERNING_FONTSPECIFIC;
     677       39230 :     aSub[0].SetAutoKern( nAutoKern );
     678       39230 :     aSub[2].SetAutoKern( nAutoKern );
     679       39230 : }
     680             : 
     681       51002 : inline void SwFont::SetTransparent( const sal_Bool bTrans )
     682             : {
     683       51002 :     aSub[0].SetTransparent( bTrans );
     684       51002 :     aSub[1].SetTransparent( bTrans );
     685       51002 :     aSub[2].SetTransparent( bTrans );
     686       51002 : }
     687             : 
     688       38772 : inline void SwFont::SetFixKerning( const short nNewKern )
     689             : {
     690       38772 :     aSub[SW_LATIN].SetFixKerning( nNewKern );
     691       38772 :     aSub[SW_CJK].SetFixKerning( nNewKern );
     692       38772 :     aSub[SW_CTL].SetFixKerning( nNewKern );
     693       38772 : }
     694             : 
     695       38539 : inline void SwFont::SetCaseMap( const SvxCaseMap eNew )
     696             : {
     697       38539 :     aSub[SW_LATIN].SetCaseMap( eNew );
     698       38539 :     aSub[SW_CJK].SetCaseMap( eNew );
     699       38539 :     aSub[SW_CTL].SetCaseMap( eNew );
     700       38539 : }
     701             : 
     702             : // encapsulated SV-Font-method
     703      114336 : inline void SwSubFont::SetWordLineMode( const sal_Bool bWordLineMode )
     704             : {
     705      114336 :     pMagic = 0;
     706      114336 :     Font::SetWordLineMode( bWordLineMode );
     707      114336 : }
     708             : 
     709       38112 : inline void SwFont::SetWordLineMode( const sal_Bool bWordLineMode )
     710             : {
     711       38112 :     bFntChg = sal_True;
     712       38112 :     aSub[0].SetWordLineMode( bWordLineMode );
     713       38112 :     aSub[1].SetWordLineMode( bWordLineMode );
     714       38112 :     aSub[2].SetWordLineMode( bWordLineMode );
     715       38112 : }
     716             : // encapsulated SV-Font-method
     717      113601 : inline void SwSubFont::SetEmphasisMark( const FontEmphasisMark eValue )
     718             : {
     719      113601 :     pMagic = 0;
     720      113601 :     Font::SetEmphasisMark( eValue );
     721      113601 : }
     722             : 
     723       37867 : inline void SwFont::SetEmphasisMark( const FontEmphasisMark eValue )
     724             : {
     725       37867 :     bFntChg = sal_True;
     726       37867 :     aSub[0].SetEmphasisMark( eValue );
     727       37867 :     aSub[1].SetEmphasisMark( eValue );
     728       37867 :     aSub[2].SetEmphasisMark( eValue );
     729       37867 : }
     730             : 
     731       37318 : inline void SwFont::SetPropWidth( const sal_uInt16 nNew )
     732             : {
     733       37318 :     if( nNew != aSub[0].GetPropWidth() )
     734             :     {
     735        1015 :         bFntChg = sal_True;
     736        1015 :         aSub[0].SetPropWidth( nNew );
     737        1015 :         aSub[1].SetPropWidth( nNew );
     738        1015 :         aSub[2].SetPropWidth( nNew );
     739             :     }
     740       37318 : }
     741             : 
     742             : // encapsulated SV-Font-method
     743        5142 : inline void SwSubFont::SetRelief( const FontRelief eNew )
     744             : {
     745        5142 :     pMagic = 0;
     746        5142 :     Font::SetRelief( eNew );
     747        5142 : }
     748             : 
     749       37704 : inline void SwFont::SetRelief( const FontRelief eNew )
     750             : {
     751       37704 :     if( eNew != aSub[0].GetRelief() )
     752             :     {
     753        1714 :         bFntChg = sal_True;
     754        1714 :         aSub[0].SetRelief( eNew );
     755        1714 :         aSub[1].SetRelief( eNew );
     756        1714 :         aSub[2].SetRelief( eNew );
     757             :     }
     758       37704 : }
     759             : 
     760             : // overloaded font-method
     761      179299 : inline void SwSubFont::SetSize( const Size& rSize )
     762             : {
     763      179299 :     aSize = rSize;
     764      179299 :     if ( GetPropr() == 100 )
     765      177975 :         Font::SetSize( aSize );
     766             :     else
     767             :     {
     768             :         Font::SetSize( Size(
     769        1324 :             (long) aSize.Width() * GetPropr() / 100L,
     770        2648 :             (long) aSize.Height() * GetPropr() / 100L ) );
     771             :     }
     772      179299 :     pMagic = 0;
     773      179299 : }
     774             : 
     775       86645 : inline void SwFont::SetSize( const Size& rSize, const sal_uInt8 nWhich )
     776             : {
     777       86645 :     if( aSub[nWhich].aSize != rSize )
     778             :     {
     779       67839 :         aSub[nWhich].SetSize( rSize );
     780       67839 :         bFntChg = sal_True;
     781       67839 :         bOrgChg = sal_True;
     782             :     }
     783       86645 : }
     784             : 
     785      308886 : inline void SwFont::SetActual( sal_uInt8 nNew )
     786             : {
     787      308886 :      if ( nActual != nNew )
     788             :      {
     789         201 :         bFntChg = sal_True;
     790         201 :         bOrgChg = sal_True;
     791         201 :         nActual = nNew;
     792             :      }
     793      308886 : }
     794             : 
     795       16426 : inline void SwSubFont::SetProportion( const sal_uInt8 nNewPropr )
     796             : {
     797       16426 :     pMagic = 0;
     798       16426 :     Font::SetSize( Size( (long) aSize.Width() * nNewPropr / 100L,
     799       32852 :                          (long) aSize.Height() * nNewPropr / 100L ) );
     800       16426 :     SvxFont::SetPropr( nNewPropr );
     801       16426 : }
     802             : 
     803       14251 : inline void SwFont::SetProportion( const sal_uInt8 nNewPropr )
     804             : {
     805       14251 :     if( nNewPropr != aSub[0].GetPropr() )
     806             :     {
     807        5462 :         bFntChg = sal_True;
     808        5462 :         bOrgChg = sal_True;
     809             : 
     810        5462 :         aSub[0].SetProportion( nNewPropr );
     811        5462 :         aSub[1].SetProportion( nNewPropr );
     812        5462 :         aSub[2].SetProportion( nNewPropr );
     813             :     }
     814       14251 : }
     815             : 
     816       15165 : inline void SwSubFont::SetEscapement( const short nNewEsc )
     817             : {
     818       15165 :     pMagic = 0;
     819       15165 :     SvxFont::SetEscapement( nNewEsc );
     820       15165 : }
     821             : 
     822       39994 : inline void SwFont::SetEscapement( const short nNewEsc )
     823             : {
     824       39994 :     if( nNewEsc != aSub[0].GetEscapement() )
     825             :     {
     826             :         // these have to be set, otherwise nOrgHeight and nOrgAscent will not
     827             :         // be calculated
     828        5055 :         bFntChg = sal_True;
     829        5055 :         bOrgChg = sal_True;
     830             : 
     831        5055 :         aSub[0].SetEscapement( nNewEsc );
     832        5055 :         aSub[1].SetEscapement( nNewEsc );
     833        5055 :         aSub[2].SetEscapement( nNewEsc );
     834             :     }
     835       39994 : }
     836             : 
     837      139746 : inline void SwSubFont::SetLanguage( LanguageType eNewLang )
     838             : {
     839      139746 :     pMagic = 0;
     840      139746 :     if( eNewLang == LANGUAGE_SYSTEM )
     841          63 :         eNewLang = (LanguageType)GetAppLanguage();
     842      139746 :     SvxFont::SetLanguage( eNewLang );
     843      139746 : }
     844             : 
     845       29163 : inline void SwFont::SetLanguage( const LanguageType eNewLang, const sal_uInt8 nWhich )
     846             : {
     847       29163 :     aSub[nWhich].SetLanguage( eNewLang );
     848       29163 :     if( SW_CJK == nWhich )
     849             :     {
     850        6114 :         aSub[SW_LATIN].SetCJKContextLanguage( eNewLang );
     851        6114 :         aSub[SW_CJK].SetCJKContextLanguage( eNewLang );
     852        6114 :         aSub[SW_CTL].SetCJKContextLanguage( eNewLang );
     853             :     }
     854       29163 : }
     855             : 
     856             : inline void SwFont::SetPaintBlank( const sal_Bool bNew )
     857             : {
     858             :     bPaintBlank = bNew;
     859             : }
     860             : 
     861             : inline void SwFont::SetPaintWrong( const sal_Bool bNew )
     862             : {
     863             :     bPaintWrong = bNew;
     864             : }
     865             : 
     866           0 : inline void SwFont::SetNoHyph( const sal_Bool bNew )
     867             : {
     868           0 :     bNoHyph = bNew;
     869           0 : }
     870             : 
     871        1325 : inline void SwFont::SetBlink( const sal_Bool bNew )
     872             : {
     873        1325 :     bBlink = bNew;
     874        1325 : }
     875             : 
     876             : inline void SwFont::SetURL( const sal_Bool bNew )
     877             : {
     878             :     bURL = bNew;
     879             : }
     880             : 
     881           0 : inline void SwFont::SetGreyWave( const sal_Bool bNew )
     882             : {
     883           0 :     bGreyWave = bNew;
     884           0 : }
     885             : 
     886        1843 : inline void SwFont::SetNoCol( const sal_Bool bNew )
     887             : {
     888        1843 :     bNoColReplace = bNew;
     889        1843 : }
     890             : 
     891        2343 : inline void SwSubFont::SetVertical( const sal_uInt16 nDir, const sal_Bool bVertFormat )
     892             : {
     893        2343 :     pMagic = 0;
     894        2343 :     Font::SetVertical( bVertFormat );
     895        2343 :     Font::SetOrientation( nDir );
     896        2343 : }
     897             : 
     898       37136 : inline void SwFont::SetTopBorderDist( const sal_uInt16 nTopDist )
     899             : {
     900       37136 :     m_nTopBorderDist = nTopDist;
     901       37136 :     bFntChg = sal_True;
     902       37136 :     aSub[SW_LATIN].pMagic = aSub[SW_CJK].pMagic = aSub[SW_CTL].pMagic = 0;
     903       37136 : }
     904             : 
     905       37136 : inline void SwFont::SetBottomBorderDist( const sal_uInt16 nBottomDist )
     906             : {
     907       37136 :     m_nBottomBorderDist = nBottomDist;
     908       37136 :     bFntChg = sal_True;
     909       37136 :     aSub[SW_LATIN].pMagic = aSub[SW_CJK].pMagic = aSub[SW_CTL].pMagic = 0;
     910       37136 : }
     911             : 
     912       37136 : inline void SwFont::SetRightBorderDist( const sal_uInt16 nRightDist )
     913             : {
     914       37136 :     m_nRightBorderDist = nRightDist;
     915       37136 :     bFntChg = sal_True;
     916       37136 :     aSub[SW_LATIN].pMagic = aSub[SW_CJK].pMagic = aSub[SW_CTL].pMagic = 0;
     917       37136 : }
     918             : 
     919       37136 : inline void SwFont::SetLeftBorderDist( const sal_uInt16 nLeftDist )
     920             : {
     921       37136 :     m_nLeftBorderDist = nLeftDist;
     922       37136 :     bFntChg = sal_True;
     923       37136 :     aSub[SW_LATIN].pMagic = aSub[SW_CJK].pMagic = aSub[SW_CTL].pMagic = 0;
     924       37136 : }
     925             : 
     926      261856 : inline sal_uInt16 SwFont::GetTopBorderSpace() const
     927             : {
     928      261856 :     sal_uInt16 nRet = 0;
     929      261856 :     if( m_aTopBorder )
     930             :     {
     931          96 :         nRet += m_aTopBorder.get().GetScaledWidth() + m_nTopBorderDist;
     932             :     }
     933      523700 :     if( m_aShadowLocation == SVX_SHADOW_TOPLEFT ||
     934      261844 :         m_aShadowLocation == SVX_SHADOW_TOPRIGHT )
     935             :     {
     936          30 :         nRet += m_nShadowWidth;
     937             :     }
     938      261856 :     return nRet;
     939             : }
     940             : 
     941      132407 : inline sal_uInt16 SwFont::GetBottomBorderSpace() const
     942             : {
     943      132407 :     sal_uInt16 nRet = 0;
     944      132407 :     if( m_aBottomBorder )
     945             :     {
     946          48 :         nRet += m_aBottomBorder.get().GetScaledWidth() + m_nBottomBorderDist;
     947             :     }
     948      264811 :     if( m_aShadowLocation == SVX_SHADOW_BOTTOMLEFT ||
     949      132404 :         m_aShadowLocation == SVX_SHADOW_BOTTOMRIGHT )
     950             :     {
     951          15 :         nRet += m_nShadowWidth;
     952             :     }
     953      132407 :     return nRet;
     954             : }
     955             : 
     956       67383 : inline sal_uInt16 SwFont::GetRightBorderSpace() const
     957             : {
     958       67383 :     sal_uInt16 nRet = 0;
     959       67383 :     if( m_aRightBorder )
     960             :     {
     961          27 :         nRet += m_aRightBorder.get().GetScaledWidth() + m_nRightBorderDist;
     962             :     }
     963      134760 :     if( m_aShadowLocation == SVX_SHADOW_TOPRIGHT ||
     964       67377 :         m_aShadowLocation == SVX_SHADOW_BOTTOMRIGHT )
     965             :     {
     966          15 :         nRet += m_nShadowWidth;
     967             :     }
     968       67383 :     return nRet;
     969             : }
     970             : 
     971       67391 : inline sal_uInt16 SwFont::GetLeftBorderSpace() const
     972             : {
     973       67391 :     sal_uInt16 nRet = 0;
     974       67391 :     if( m_aLeftBorder )
     975             :     {
     976          38 :         nRet += m_aLeftBorder.get().GetScaledWidth() + m_nLeftBorderDist;
     977             :     }
     978      134779 :     if( m_aShadowLocation == SVX_SHADOW_TOPLEFT ||
     979       67388 :         m_aShadowLocation == SVX_SHADOW_BOTTOMLEFT )
     980             :     {
     981           7 :         nRet += m_nShadowWidth;
     982             :     }
     983       67391 :     return nRet;
     984             : }
     985             : 
     986       82223 : inline bool SwFont::HasBorder() const
     987             : {
     988       82223 :     return m_aTopBorder || m_aBottomBorder || m_aLeftBorder || m_aRightBorder;
     989             : }
     990             : 
     991       37098 : inline void SwFont::SetShadowColor( const Color& rColor )
     992             : {
     993       37098 :     m_aShadowColor = rColor;
     994       37098 :     bFntChg = sal_True;
     995       37098 :     aSub[SW_LATIN].pMagic = aSub[SW_CJK].pMagic = aSub[SW_CTL].pMagic = 0;
     996       37098 : }
     997             : 
     998       37098 : inline void SwFont::SetShadowWidth( const sal_uInt16 nWidth )
     999             : {
    1000       37098 :     m_nShadowWidth = nWidth;
    1001       37098 :     bFntChg = sal_True;
    1002       37098 :     aSub[SW_LATIN].pMagic = aSub[SW_CJK].pMagic = aSub[SW_CTL].pMagic = 0;
    1003       37098 : }
    1004             : 
    1005       37098 : inline void SwFont::SetShadowLocation( const SvxShadowLocation aLocation )
    1006             : {
    1007       37098 :     m_aShadowLocation = aLocation;
    1008       37098 :     bFntChg = sal_True;
    1009       37098 :     aSub[SW_LATIN].pMagic = aSub[SW_CJK].pMagic = aSub[SW_CTL].pMagic = 0;
    1010       37098 : }
    1011             : 
    1012       37095 : inline void SwFont::SetHighlightColor( const Color& aNewColor )
    1013             : {
    1014       37095 :     m_aHighlightColor = aNewColor;
    1015       37095 :     bFntChg = sal_True;
    1016       37095 :     aSub[SW_LATIN].pMagic = aSub[SW_CJK].pMagic = aSub[SW_CTL].pMagic = 0;
    1017       37095 : }
    1018             : 
    1019             : /*************************************************************************
    1020             :  *                      class SwUnderlineFont
    1021             :  *
    1022             :  * Used for the "continuous underline" feature.
    1023             :  *************************************************************************/
    1024             : 
    1025             : class SwUnderlineFont
    1026             : {
    1027             :     Point aPos;
    1028             :     SwFont* pFnt;
    1029             : 
    1030             : public:
    1031             :     // sets the font which should paint the common baseline
    1032             :     // and the starting point of the common baseline
    1033             :     SwUnderlineFont( SwFont& rFnt, const Point& rPoint );
    1034             :     ~SwUnderlineFont();
    1035             : 
    1036          99 :     SwFont& GetFont()
    1037             :     {
    1038             :         OSL_ENSURE( pFnt, "No underline font" );
    1039          99 :         return *pFnt;
    1040             :     }
    1041          50 :     const Point& GetPos() const { return aPos; }
    1042             :     // the x coordinate of the starting point has to be set for each portion
    1043          49 :     void SetPos( const Point& rPoint ) { aPos = rPoint;  }
    1044             : };
    1045             : 
    1046             : /*************************************************************************
    1047             :  *                      class SvStatistics
    1048             :  *************************************************************************/
    1049             : 
    1050             : #ifdef DBG_UTIL
    1051             : 
    1052             : class SvStatistics
    1053             : {
    1054             : public:
    1055             :     sal_uInt16 nGetTextSize;
    1056             :     sal_uInt16 nDrawText;
    1057             :     sal_uInt16 nGetStretchTextSize;
    1058             :     sal_uInt16 nDrawStretchText;
    1059             :     sal_uInt16 nChangeFont;
    1060             :     sal_uInt16 nGetFontMetric;
    1061             : 
    1062             :     inline void Reset()
    1063             :     {
    1064             :         nGetTextSize = nDrawText = nGetStretchTextSize =
    1065             :         nDrawStretchText = nChangeFont = nGetFontMetric = 0;
    1066             :     }
    1067             : 
    1068             :     inline SvStatistics() { Reset(); }
    1069             : 
    1070             :     inline void PrintOn( SvStream &rOS ) const; //$ ostream
    1071             :     inline sal_Bool IsEmpty() const
    1072             :     {
    1073             :         return !( nGetTextSize || nDrawText ||
    1074             :                   nDrawStretchText || nChangeFont || nGetFontMetric );
    1075             :     }
    1076             : };
    1077             : 
    1078             : // global variable, implemented in swfont.cxx
    1079             : extern SvStatistics g_SvStat;
    1080             : 
    1081             : #define SV_STAT(nWhich) ++(g_SvStat.nWhich);
    1082             : 
    1083             : inline void SvStatistics::PrintOn( SvStream &rOS ) const //$ ostream
    1084             : {
    1085             :     if( IsEmpty() )
    1086             :         return;
    1087             : 
    1088             :     rOS.WriteCharPtr( "{   SV called:\n" );
    1089             :     if( nGetTextSize )
    1090             :         rOS.WriteCharPtr( "\tnGetTextSize: " ).WriteUInt16( nGetTextSize ).WriteChar( '\n' );
    1091             :     if( nDrawText )
    1092             :         rOS.WriteCharPtr( "\tnDrawText: " ).WriteUInt16( nDrawText ).WriteChar( '\n' );
    1093             :     if( nGetStretchTextSize )
    1094             :         rOS.WriteCharPtr( "\tnGetStretchTextSize: " ).WriteUInt16( nGetStretchTextSize ).WriteChar( '\n' );
    1095             :     if( nDrawStretchText )
    1096             :         rOS.WriteCharPtr( "\tnDrawStretchText: " ).WriteUInt16( nDrawStretchText ).WriteChar( '\n' );
    1097             :     if( nChangeFont )
    1098             :         rOS.WriteCharPtr( "\tnChangeFont: " ).WriteUInt16(  nChangeFont ).WriteChar( '\n' );
    1099             :     if( nGetFontMetric )
    1100             :         rOS.WriteCharPtr( "\tnGetFontMetric: " ).WriteUInt16( nGetFontMetric ).WriteChar( '\n' );
    1101             :      rOS.WriteCharPtr( "}\n" );
    1102             : }
    1103             : #else
    1104             : #define SV_STAT(nWhich)
    1105             : #endif  /* DBG_UTIL */
    1106             : 
    1107             : #endif
    1108             : 
    1109             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10