LCOV - code coverage report
Current view: top level - editeng/source/editeng - editattr.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 174 186 93.5 %
Date: 2012-08-25 Functions: 51 53 96.2 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 28 62 45.2 %

           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                 :            : 
      29                 :            : 
      30                 :            : #include <vcl/wrkwin.hxx>
      31                 :            : #include <vcl/dialog.hxx>
      32                 :            : #include <vcl/msgbox.hxx>
      33                 :            : #include <vcl/svapp.hxx>
      34                 :            : 
      35                 :            : #include <editeng/svxfont.hxx>
      36                 :            : #include <editeng/flditem.hxx>
      37                 :            : #include <editeng/fontitem.hxx>
      38                 :            : #include <editeng/postitem.hxx>
      39                 :            : #include <editeng/wghtitem.hxx>
      40                 :            : #include <editeng/udlnitem.hxx>
      41                 :            : #include <editeng/cntritem.hxx>
      42                 :            : #include <editeng/shdditem.hxx>
      43                 :            : #include <editeng/escpitem.hxx>
      44                 :            : #include <editeng/colritem.hxx>
      45                 :            : #include <editeng/wrlmitem.hxx>
      46                 :            : #include <editeng/fhgtitem.hxx>
      47                 :            : #include <editeng/crsditem.hxx>
      48                 :            : #include <editeng/cscoitem.hxx>
      49                 :            : #include <editeng/kernitem.hxx>
      50                 :            : #include <editeng/akrnitem.hxx>
      51                 :            : #include <editeng/langitem.hxx>
      52                 :            : #include <editeng/emphitem.hxx>
      53                 :            : #include <editeng/charscaleitem.hxx>
      54                 :            : #include <editeng/charreliefitem.hxx>
      55                 :            : 
      56                 :            : #include "editattr.hxx"
      57                 :            : 
      58                 :            : DBG_NAME( EE_EditAttrib )
      59                 :            : 
      60                 :            : // -------------------------------------------------------------------------
      61                 :            : // class EditCharAttrib
      62                 :            : // -------------------------------------------------------------------------
      63                 :     112936 : EditCharAttrib::EditCharAttrib( const SfxPoolItem& rAttr, sal_uInt16 nS, sal_uInt16 nE ) :
      64                 :     112936 :     nStart(nS), nEnd(nE), bFeature(false), bEdge(false)
      65                 :            : {
      66                 :            :     DBG_CTOR( EE_EditAttrib, 0 );
      67                 :     112936 :     pItem = &rAttr;
      68                 :            : 
      69                 :            :     DBG_ASSERT( ( rAttr.Which() >= EE_ITEMS_START ) && ( rAttr.Which() <= EE_ITEMS_END ), "EditCharAttrib CTOR: Invalid id!" );
      70                 :            :     DBG_ASSERT( ( rAttr.Which() < EE_FEATURE_START ) || ( rAttr.Which() > EE_FEATURE_END ) || ( nE == (nS+1) ), "EditCharAttrib CTOR: Invalid feature!" );
      71                 :     112936 : }
      72                 :            : 
      73                 :     112455 : EditCharAttrib::~EditCharAttrib()
      74                 :            : {
      75                 :            :     DBG_DTOR( EE_EditAttrib, 0 );
      76         [ -  + ]:     115115 : }
      77                 :            : 
      78                 :       8705 : void EditCharAttrib::SetFont( SvxFont&, OutputDevice* )
      79                 :            : {
      80                 :       8705 : }
      81                 :            : 
      82                 :            : 
      83                 :            : // -------------------------------------------------------------------------
      84                 :            : // class EditCharAttribFont
      85                 :            : // -------------------------------------------------------------------------
      86                 :      11503 : EditCharAttribFont::EditCharAttribFont( const SvxFontItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
      87                 :      11503 :     : EditCharAttrib( rAttr, _nStart, _nEnd )
      88                 :            : {
      89                 :            :     DBG_ASSERT( rAttr.Which() == EE_CHAR_FONTINFO || rAttr.Which() == EE_CHAR_FONTINFO_CJK || rAttr.Which() == EE_CHAR_FONTINFO_CTL, "Not a Font attribute!" );
      90                 :      11503 : }
      91                 :            : 
      92                 :      11614 : void EditCharAttribFont::SetFont( SvxFont& rFont, OutputDevice* )
      93                 :            : {
      94                 :      11614 :     const SvxFontItem& rAttr = (const SvxFontItem&)(*GetItem());
      95                 :            : 
      96         [ +  - ]:      11614 :     rFont.SetName( rAttr.GetFamilyName() );
      97                 :      11614 :     rFont.SetFamily( rAttr.GetFamily() );
      98                 :      11614 :     rFont.SetPitch( rAttr.GetPitch() );
      99                 :      11614 :     rFont.SetCharSet( rAttr.GetCharSet() );
     100                 :      11614 : }
     101                 :            : 
     102                 :            : // -------------------------------------------------------------------------
     103                 :            : // class EditCharAttribItalic
     104                 :            : // -------------------------------------------------------------------------
     105                 :       9789 : EditCharAttribItalic::EditCharAttribItalic( const SvxPostureItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
     106                 :       9789 :     : EditCharAttrib( rAttr, _nStart, _nEnd )
     107                 :            : {
     108                 :            :     DBG_ASSERT( rAttr.Which() == EE_CHAR_ITALIC || rAttr.Which() == EE_CHAR_ITALIC_CJK || rAttr.Which() == EE_CHAR_ITALIC_CTL, "Not a Italic attribute!" );
     109                 :       9789 : }
     110                 :            : 
     111                 :      10636 : void EditCharAttribItalic::SetFont( SvxFont& rFont, OutputDevice* )
     112                 :            : {
     113                 :      10636 :     rFont.SetItalic( ((const SvxPostureItem*)GetItem())->GetPosture() );
     114                 :      10636 : }
     115                 :            : 
     116                 :            : // -------------------------------------------------------------------------
     117                 :            : // class EditCharAttribWeight
     118                 :            : // -------------------------------------------------------------------------
     119                 :      10209 : EditCharAttribWeight::EditCharAttribWeight( const SvxWeightItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
     120                 :      10209 :     : EditCharAttrib( rAttr, _nStart, _nEnd )
     121                 :            : {
     122                 :            :     DBG_ASSERT( rAttr.Which() == EE_CHAR_WEIGHT || rAttr.Which() == EE_CHAR_WEIGHT_CJK || rAttr.Which() == EE_CHAR_WEIGHT_CTL, "Not a Weight attribute!" );
     123                 :      10209 : }
     124                 :            : 
     125                 :      10730 : void EditCharAttribWeight::SetFont( SvxFont& rFont, OutputDevice* )
     126                 :            : {
     127                 :      10730 :     rFont.SetWeight( (FontWeight)((const SvxWeightItem*)GetItem())->GetValue() );
     128                 :      10730 : }
     129                 :            : 
     130                 :            : // -------------------------------------------------------------------------
     131                 :            : // class EditCharAttribUnderline
     132                 :            : // -------------------------------------------------------------------------
     133                 :       4084 : EditCharAttribUnderline::EditCharAttribUnderline( const SvxUnderlineItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
     134                 :       4084 :     : EditCharAttrib( rAttr, _nStart, _nEnd )
     135                 :            : {
     136                 :            :     DBG_ASSERT( rAttr.Which() == EE_CHAR_UNDERLINE, "Not a Underline attribute!" );
     137                 :       4084 : }
     138                 :            : 
     139                 :      10807 : void EditCharAttribUnderline::SetFont( SvxFont& rFont, OutputDevice* pOutDev )
     140                 :            : {
     141                 :      10807 :     rFont.SetUnderline( (FontUnderline)((const SvxUnderlineItem*)GetItem())->GetValue() );
     142         [ +  + ]:      10807 :     if ( pOutDev )
     143                 :       1313 :         pOutDev->SetTextLineColor( ((const SvxUnderlineItem*)GetItem())->GetColor() );
     144                 :      10807 : }
     145                 :            : 
     146                 :            : // -------------------------------------------------------------------------
     147                 :            : // class EditCharAttribOverline
     148                 :            : // -------------------------------------------------------------------------
     149                 :       2044 : EditCharAttribOverline::EditCharAttribOverline( const SvxOverlineItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
     150                 :       2044 :     : EditCharAttrib( rAttr, _nStart, _nEnd )
     151                 :            : {
     152                 :            :     DBG_ASSERT( rAttr.Which() == EE_CHAR_OVERLINE, "Not a overline attribute!" );
     153                 :       2044 : }
     154                 :            : 
     155                 :       7280 : void EditCharAttribOverline::SetFont( SvxFont& rFont, OutputDevice* pOutDev )
     156                 :            : {
     157                 :       7280 :     rFont.SetOverline( (FontUnderline)((const SvxOverlineItem*)GetItem())->GetValue() );
     158         [ +  + ]:       7280 :     if ( pOutDev )
     159                 :        881 :         pOutDev->SetOverlineColor( ((const SvxOverlineItem*)GetItem())->GetColor() );
     160                 :       7280 : }
     161                 :            : 
     162                 :            : // -------------------------------------------------------------------------
     163                 :            : // class EditCharAttribFontHeight
     164                 :            : // -------------------------------------------------------------------------
     165                 :      12254 : EditCharAttribFontHeight::EditCharAttribFontHeight( const SvxFontHeightItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
     166                 :      12254 :     : EditCharAttrib( rAttr, _nStart, _nEnd )
     167                 :            : {
     168                 :            :     DBG_ASSERT( rAttr.Which() == EE_CHAR_FONTHEIGHT || rAttr.Which() == EE_CHAR_FONTHEIGHT_CJK || rAttr.Which() == EE_CHAR_FONTHEIGHT_CTL, "Not a Height attribute!" );
     169                 :      12254 : }
     170                 :            : 
     171                 :      11300 : void EditCharAttribFontHeight::SetFont( SvxFont& rFont, OutputDevice* )
     172                 :            : {
     173                 :            :     // Property is ignored
     174         [ +  - ]:      11300 :     rFont.SetSize( Size( rFont.GetSize().Width(), ((const SvxFontHeightItem*)GetItem())->GetHeight() ) );
     175                 :      11300 : }
     176                 :            : 
     177                 :            : // -------------------------------------------------------------------------
     178                 :            : // class EditCharAttribFontWidth
     179                 :            : // -------------------------------------------------------------------------
     180                 :       2803 : EditCharAttribFontWidth::EditCharAttribFontWidth( const SvxCharScaleWidthItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
     181                 :       2803 :     : EditCharAttrib( rAttr, _nStart, _nEnd )
     182                 :            : {
     183                 :            :     DBG_ASSERT( rAttr.Which() == EE_CHAR_FONTWIDTH, "Not a Width attribute!" );
     184                 :       2803 : }
     185                 :            : 
     186                 :       8959 : void EditCharAttribFontWidth::SetFont( SvxFont& /*rFont*/, OutputDevice* )
     187                 :            : {
     188                 :            :     // must be calculated outside, because f(device)...
     189                 :       8959 : }
     190                 :            : 
     191                 :            : // -------------------------------------------------------------------------
     192                 :            : // class EditCharAttribStrikeout
     193                 :            : // -------------------------------------------------------------------------
     194                 :       3895 : EditCharAttribStrikeout::EditCharAttribStrikeout( const SvxCrossedOutItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
     195                 :       3895 :     : EditCharAttrib( rAttr, _nStart, _nEnd )
     196                 :            : {
     197                 :            :     DBG_ASSERT( rAttr.Which() == EE_CHAR_STRIKEOUT, "Not a Size attribute!" );
     198                 :       3895 : }
     199                 :            : 
     200                 :      10473 : void EditCharAttribStrikeout::SetFont( SvxFont& rFont, OutputDevice* )
     201                 :            : {
     202                 :      10473 :     rFont.SetStrikeout( (FontStrikeout)((const SvxCrossedOutItem*)GetItem())->GetValue() );
     203                 :      10473 : }
     204                 :            : 
     205                 :            : // -------------------------------------------------------------------------
     206                 :            : // class EditCharAttribColor
     207                 :            : // -------------------------------------------------------------------------
     208                 :       4862 : EditCharAttribColor::EditCharAttribColor( const SvxColorItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
     209                 :       4862 :     : EditCharAttrib( rAttr, _nStart, _nEnd )
     210                 :            : {
     211                 :            :     DBG_ASSERT( rAttr.Which() == EE_CHAR_COLOR, "Not a Color attribute!" );
     212                 :       4862 : }
     213                 :            : 
     214                 :      11670 : void EditCharAttribColor::SetFont( SvxFont& rFont, OutputDevice* )
     215                 :            : {
     216                 :      11670 :     rFont.SetColor( ((const SvxColorItem*)GetItem())->GetValue() );
     217                 :      11670 : }
     218                 :            : 
     219                 :            : // -------------------------------------------------------------------------
     220                 :            : // class EditCharAttribLanguage
     221                 :            : // -------------------------------------------------------------------------
     222                 :       9709 : EditCharAttribLanguage::EditCharAttribLanguage( const SvxLanguageItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
     223                 :       9709 :     : EditCharAttrib( rAttr, _nStart, _nEnd )
     224                 :            : {
     225                 :            :     DBG_ASSERT( ( rAttr.Which() == EE_CHAR_LANGUAGE ) || ( rAttr.Which() == EE_CHAR_LANGUAGE_CJK ) || ( rAttr.Which() == EE_CHAR_LANGUAGE_CTL ), "Not a Language attribute!" );
     226                 :       9709 : }
     227                 :            : 
     228                 :       9989 : void EditCharAttribLanguage::SetFont( SvxFont& rFont, OutputDevice* )
     229                 :            : {
     230                 :       9989 :     rFont.SetLanguage( ((const SvxLanguageItem*)GetItem())->GetLanguage() );
     231                 :       9989 : }
     232                 :            : 
     233                 :            : // -------------------------------------------------------------------------
     234                 :            : // class EditCharAttribShadow
     235                 :            : // -------------------------------------------------------------------------
     236                 :       3615 : EditCharAttribShadow::EditCharAttribShadow( const SvxShadowedItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
     237                 :       3615 :     : EditCharAttrib( rAttr, _nStart, _nEnd )
     238                 :            : {
     239                 :            :     DBG_ASSERT( rAttr.Which() == EE_CHAR_SHADOW, "Not a Shadow attribute!" );
     240                 :       3615 : }
     241                 :            : 
     242                 :       9858 : void EditCharAttribShadow::SetFont( SvxFont& rFont, OutputDevice* )
     243                 :            : {
     244                 :       9858 :     rFont.SetShadow( (sal_Bool)((const SvxShadowedItem*)GetItem())->GetValue() );
     245                 :       9858 : }
     246                 :            : 
     247                 :            : // -------------------------------------------------------------------------
     248                 :            : // class EditCharAttribEscapement
     249                 :            : // -------------------------------------------------------------------------
     250                 :       3985 : EditCharAttribEscapement::EditCharAttribEscapement( const SvxEscapementItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
     251                 :       3985 :     : EditCharAttrib( rAttr, _nStart, _nEnd )
     252                 :            : {
     253                 :            :     DBG_ASSERT( rAttr.Which() == EE_CHAR_ESCAPEMENT, "Not a escapement attribute!" );
     254                 :       3985 : }
     255                 :            : 
     256                 :      10782 : void EditCharAttribEscapement::SetFont( SvxFont& rFont, OutputDevice* )
     257                 :            : {
     258                 :      10782 :     sal_uInt16 nProp = ((const SvxEscapementItem*)GetItem())->GetProp();
     259                 :      10782 :     rFont.SetPropr( (sal_uInt8)nProp );
     260                 :            : 
     261                 :      10782 :     short nEsc = ((const SvxEscapementItem*)GetItem())->GetEsc();
     262         [ -  + ]:      10782 :     if ( nEsc == DFLT_ESC_AUTO_SUPER )
     263                 :          0 :         nEsc = 100 - nProp;
     264         [ -  + ]:      10782 :     else if ( nEsc == DFLT_ESC_AUTO_SUB )
     265                 :          0 :         nEsc = sal::static_int_cast< short >( -( 100 - nProp ) );
     266                 :      10782 :     rFont.SetEscapement( nEsc );
     267                 :      10782 : }
     268                 :            : 
     269                 :            : // -------------------------------------------------------------------------
     270                 :            : // class EditCharAttribOutline
     271                 :            : // -------------------------------------------------------------------------
     272                 :       3579 : EditCharAttribOutline::EditCharAttribOutline( const SvxContourItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
     273                 :       3579 :     : EditCharAttrib( rAttr, _nStart, _nEnd )
     274                 :            : {
     275                 :            :     DBG_ASSERT( rAttr.Which() == EE_CHAR_OUTLINE, "Not a Outline attribute!" );
     276                 :       3579 : }
     277                 :            : 
     278                 :       9761 : void EditCharAttribOutline::SetFont( SvxFont& rFont, OutputDevice* )
     279                 :            : {
     280                 :       9761 :     rFont.SetOutline( (sal_Bool)((const SvxContourItem*)GetItem())->GetValue() );
     281                 :       9761 : }
     282                 :            : 
     283                 :            : // -------------------------------------------------------------------------
     284                 :            : // class EditCharAttribTab
     285                 :            : // -------------------------------------------------------------------------
     286                 :          0 : EditCharAttribTab::EditCharAttribTab( const SfxVoidItem& rAttr, sal_uInt16 nPos )
     287                 :          0 :     : EditCharAttrib( rAttr, nPos, nPos+1 )
     288                 :            : {
     289                 :          0 :     SetFeature( sal_True );
     290                 :          0 : }
     291                 :            : 
     292                 :          0 : void EditCharAttribTab::SetFont( SvxFont&, OutputDevice* )
     293                 :            : {
     294                 :          0 : }
     295                 :            : 
     296                 :            : // -------------------------------------------------------------------------
     297                 :            : // class EditCharAttribLineBreak
     298                 :            : // -------------------------------------------------------------------------
     299                 :         40 : EditCharAttribLineBreak::EditCharAttribLineBreak( const SfxVoidItem& rAttr, sal_uInt16 nPos )
     300                 :         40 :     : EditCharAttrib( rAttr, nPos, nPos+1 )
     301                 :            : {
     302                 :         40 :     SetFeature( sal_True );
     303                 :         40 : }
     304                 :            : 
     305                 :         38 : void EditCharAttribLineBreak::SetFont( SvxFont&, OutputDevice* )
     306                 :            : {
     307                 :         38 : }
     308                 :            : 
     309                 :            : // -------------------------------------------------------------------------
     310                 :            : // class EditCharAttribField
     311                 :            : // -------------------------------------------------------------------------
     312                 :       8960 : EditCharAttribField::EditCharAttribField( const SvxFieldItem& rAttr, sal_uInt16 nPos )
     313                 :       8960 :     : EditCharAttrib( rAttr, nPos, nPos+1 )
     314                 :            : {
     315                 :       8960 :     SetFeature( sal_True ); // !!!
     316                 :       8960 :     pTxtColor = 0;
     317                 :       8960 :     pFldColor = 0;
     318                 :       8960 : }
     319                 :            : 
     320                 :       7680 : void EditCharAttribField::SetFont( SvxFont& rFont, OutputDevice* )
     321                 :            : {
     322         [ +  + ]:       7680 :     if ( pFldColor )
     323                 :            :     {
     324                 :        208 :         rFont.SetFillColor( *pFldColor );
     325                 :        208 :         rFont.SetTransparent( sal_False );
     326                 :            :     }
     327         [ +  + ]:       7680 :     if ( pTxtColor )
     328                 :        144 :         rFont.SetColor( *pTxtColor );
     329                 :       7680 : }
     330                 :            : 
     331                 :      15822 : const rtl::OUString& EditCharAttribField::GetFieldValue() const
     332                 :            : {
     333                 :      15822 :     return aFieldValue;
     334                 :            : }
     335                 :            : 
     336                 :       3895 : void EditCharAttribField::SetFieldValue(const rtl::OUString& rVal)
     337                 :            : {
     338                 :       3895 :     aFieldValue = rVal;
     339                 :       3895 : }
     340                 :            : 
     341                 :      16750 : void EditCharAttribField::Reset()
     342                 :            : {
     343                 :      16750 :     aFieldValue = rtl::OUString();
     344                 :      16750 :     delete pTxtColor; pTxtColor = NULL;
     345                 :      16750 :     delete pFldColor; pFldColor = NULL;
     346                 :      16750 : }
     347                 :            : 
     348                 :       3895 : EditCharAttribField::EditCharAttribField( const EditCharAttribField& rAttr )
     349                 :       3895 :     : EditCharAttrib( *rAttr.GetItem(), rAttr.GetStart(), rAttr.GetEnd() ),
     350                 :       3895 :         aFieldValue( rAttr.aFieldValue )
     351                 :            : {
     352                 :            :     // Use this constructor only for temporary Objects, Item is not pooled.
     353 [ #  # ][ -  + ]:       3895 :     pTxtColor = rAttr.pTxtColor ? new Color( *rAttr.pTxtColor ) : 0;
     354 [ -  + ][ #  # ]:       3895 :     pFldColor = rAttr.pFldColor ? new Color( *rAttr.pFldColor ) : 0;
     355                 :       3895 : }
     356                 :            : 
     357                 :      12855 : EditCharAttribField::~EditCharAttribField()
     358                 :            : {
     359                 :      12855 :     Reset();
     360         [ -  + ]:      25710 : }
     361                 :            : 
     362                 :       3895 : bool EditCharAttribField::operator == ( const EditCharAttribField& rAttr ) const
     363                 :            : {
     364         [ +  + ]:       3895 :     if ( aFieldValue != rAttr.aFieldValue )
     365                 :       3508 :         return false;
     366                 :            : 
     367 [ -  + ][ #  # ]:        387 :     if ( ( pTxtColor && !rAttr.pTxtColor ) || ( !pTxtColor && rAttr.pTxtColor ) )
         [ +  - ][ -  + ]
     368                 :          0 :         return false;
     369 [ -  + ][ #  # ]:        387 :     if ( ( pTxtColor && rAttr.pTxtColor ) && ( *pTxtColor != *rAttr.pTxtColor ) )
         [ #  # ][ -  + ]
     370                 :          0 :         return false;
     371                 :            : 
     372 [ -  + ][ #  # ]:        387 :     if ( ( pFldColor && !rAttr.pFldColor ) || ( !pFldColor && rAttr.pFldColor ) )
         [ +  - ][ -  + ]
     373                 :          0 :         return false;
     374 [ -  + ][ #  # ]:        387 :     if ( ( pFldColor && rAttr.pFldColor ) && ( *pFldColor != *rAttr.pFldColor ) )
         [ #  # ][ -  + ]
     375                 :          0 :         return false;
     376                 :            : 
     377                 :       3895 :     return true;
     378                 :            : }
     379                 :            : 
     380                 :            : // -------------------------------------------------------------------------
     381                 :            : // class EditCharAttribPairKerning
     382                 :            : // -------------------------------------------------------------------------
     383                 :       3141 : EditCharAttribPairKerning::EditCharAttribPairKerning( const SvxAutoKernItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
     384                 :       3141 : : EditCharAttrib( rAttr, _nStart, _nEnd )
     385                 :            : {
     386                 :            :     DBG_ASSERT( rAttr.Which() == EE_CHAR_PAIRKERNING, "Not a Pair Kerning!" );
     387                 :       3141 : }
     388                 :            : 
     389                 :       9843 : void EditCharAttribPairKerning::SetFont( SvxFont& rFont, OutputDevice* )
     390                 :            : {
     391                 :       9843 :     rFont.SetKerning( ((const SvxAutoKernItem*)GetItem())->GetValue() );
     392                 :       9843 : }
     393                 :            : 
     394                 :            : // -------------------------------------------------------------------------
     395                 :            : // class EditCharAttribKerning
     396                 :            : // -------------------------------------------------------------------------
     397                 :       3081 : EditCharAttribKerning::EditCharAttribKerning( const SvxKerningItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
     398                 :       3081 : : EditCharAttrib( rAttr, _nStart, _nEnd )
     399                 :            : {
     400                 :            :     DBG_ASSERT( rAttr.Which() == EE_CHAR_KERNING, "Not a Kerning!" );
     401                 :       3081 : }
     402                 :            : 
     403                 :       9687 : void EditCharAttribKerning::SetFont( SvxFont& rFont, OutputDevice* )
     404                 :            : {
     405                 :       9687 :     rFont.SetFixKerning( ((const SvxKerningItem*)GetItem())->GetValue() );
     406                 :       9687 : }
     407                 :            : 
     408                 :            : // -------------------------------------------------------------------------
     409                 :            : // class EditCharAttribWordLineMode
     410                 :            : // -------------------------------------------------------------------------
     411                 :       3074 : EditCharAttribWordLineMode::EditCharAttribWordLineMode( const SvxWordLineModeItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
     412                 :       3074 : : EditCharAttrib( rAttr, _nStart, _nEnd )
     413                 :            : {
     414                 :            :     DBG_ASSERT( rAttr.Which() == EE_CHAR_WLM, "Not a Kerning!" );
     415                 :       3074 : }
     416                 :            : 
     417                 :       9604 : void EditCharAttribWordLineMode::SetFont( SvxFont& rFont, OutputDevice* )
     418                 :            : {
     419                 :       9604 :     rFont.SetWordLineMode( ((const SvxWordLineModeItem*)GetItem())->GetValue() );
     420                 :       9604 : }
     421                 :            : 
     422                 :            : // -------------------------------------------------------------------------
     423                 :            : // class EditCharAttribEmphasisMark
     424                 :            : // -------------------------------------------------------------------------
     425                 :       2907 : EditCharAttribEmphasisMark::EditCharAttribEmphasisMark( const SvxEmphasisMarkItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
     426                 :       2907 :     : EditCharAttrib( rAttr, _nStart, _nEnd )
     427                 :            : {
     428                 :            :     DBG_ASSERT( rAttr.Which() == EE_CHAR_EMPHASISMARK, "Not a Emphasis attribute!" );
     429                 :       2907 : }
     430                 :            : 
     431                 :       9169 : void EditCharAttribEmphasisMark::SetFont( SvxFont& rFont, OutputDevice* )
     432                 :            : {
     433                 :       9169 :     rFont.SetEmphasisMark( ((const SvxEmphasisMarkItem*)GetItem())->GetEmphasisMark() );
     434                 :       9169 : }
     435                 :            : 
     436                 :            : // -------------------------------------------------------------------------
     437                 :            : // class EditCharAttribRelief
     438                 :            : // -------------------------------------------------------------------------
     439                 :       2847 : EditCharAttribRelief::EditCharAttribRelief( const SvxCharReliefItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
     440                 :       2847 :     : EditCharAttrib( rAttr, _nStart, _nEnd )
     441                 :            : {
     442                 :            :     DBG_ASSERT( rAttr.Which() == EE_CHAR_RELIEF, "Not a relief attribute!" );
     443                 :       2847 : }
     444                 :            : 
     445                 :       9072 : void EditCharAttribRelief::SetFont( SvxFont& rFont, OutputDevice* )
     446                 :            : {
     447                 :       9072 :     rFont.SetRelief( (FontRelief)((const SvxCharReliefItem*)GetItem())->GetValue() );
     448                 :       9072 : }
     449                 :            : 
     450                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10