LCOV - code coverage report
Current view: top level - libreoffice/svl/source/items - sfontitm.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 63 0.0 %
Date: 2012-12-27 Functions: 0 8 0.0 %
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             : 
      20             : #include <tools/stream.hxx>
      21             : #include <tools/vcompat.hxx>
      22             : #include <svl/sfontitm.hxx>
      23             : 
      24             : //============================================================================
      25             : //
      26             : //  class SfxFontItem
      27             : //
      28             : //============================================================================
      29             : 
      30           0 : TYPEINIT1(SfxFontItem, SfxPoolItem);
      31             : 
      32             : //============================================================================
      33             : // virtual
      34           0 : int SfxFontItem::operator ==(const SfxPoolItem & rItem) const
      35             : {
      36           0 :     const SfxFontItem * pFontItem = PTR_CAST(SfxFontItem, &rItem);
      37             :     return pFontItem && m_bHasFont == pFontItem->m_bHasFont
      38             :            && m_bHasColor == pFontItem->m_bHasColor
      39             :            && m_bHasFillColor == pFontItem->m_bHasFillColor
      40           0 :            && (!m_bHasColor || m_aColor == pFontItem->m_aColor)
      41           0 :            && (!m_bHasFillColor || m_aFillColor == pFontItem->m_aFillColor)
      42           0 :            && (!m_bHasFont || (m_bKerning == pFontItem->m_bKerning
      43             :                               && m_bShadow == pFontItem->m_bShadow
      44             :                               && m_bOutline == pFontItem->m_bOutline
      45             :                               && m_bWordLine == pFontItem->m_bWordLine
      46             :                               && m_nOrientation == pFontItem->m_nOrientation
      47             :                               && m_nStrikeout == pFontItem->m_nStrikeout
      48             :                               && m_nUnderline == pFontItem->m_nUnderline
      49             :                               && m_nItalic == pFontItem->m_nItalic
      50             :                               && m_nWidthType == pFontItem->m_nWidthType
      51             :                               && m_nWeight == pFontItem->m_nWeight
      52             :                               && m_nPitch == pFontItem->m_nPitch
      53             :                               && m_nFamily == pFontItem->m_nFamily
      54             :                               && m_nLanguage == pFontItem->m_nLanguage
      55             :                               && m_nCharSet == pFontItem->m_nCharSet
      56           0 :                               && m_aFillColor == pFontItem->m_aFillColor
      57           0 :                               && m_aColor == pFontItem->m_aColor
      58           0 :                               && m_aSize == pFontItem->m_aSize
      59           0 :                               && m_aStyleName == pFontItem->m_aStyleName
      60           0 :                               && m_aName == pFontItem->m_aName));
      61             : }
      62             : 
      63             : //============================================================================
      64             : // virtual
      65           0 : SfxPoolItem * SfxFontItem::Create(SvStream & rStream, sal_uInt16) const
      66             : {
      67           0 :     VersionCompat aItemCompat(rStream, STREAM_READ);
      68           0 :     SfxFontItem * pItem = new SfxFontItem(Which());
      69             :     {
      70           0 :         VersionCompat aFontCompat(rStream, STREAM_READ);
      71           0 :         pItem->m_aName = readByteString(rStream);
      72           0 :         pItem->m_aStyleName = readByteString(rStream);
      73           0 :         rStream >> pItem->m_aSize;
      74           0 :         sal_Int16 nCharSet = 0;
      75           0 :         rStream >> nCharSet;
      76           0 :         pItem->m_nCharSet = rtl_TextEncoding(nCharSet);
      77           0 :         rStream >> pItem->m_nFamily >> pItem->m_nPitch >> pItem->m_nWeight
      78           0 :                 >> pItem->m_nUnderline >> pItem->m_nStrikeout
      79           0 :                 >> pItem->m_nItalic;
      80           0 :         sal_Int16 nLanguage = 0;
      81           0 :         rStream >> nLanguage;
      82           0 :         pItem->m_nLanguage = LanguageType(nLanguage);
      83           0 :         rStream >> pItem->m_nWidthType >> pItem->m_nOrientation;
      84           0 :         sal_Int8 nWordLine = 0;
      85           0 :         rStream >> nWordLine;
      86           0 :         pItem->m_bWordLine = nWordLine != 0;
      87           0 :         sal_Int8 nOutline = 0;
      88           0 :         rStream >> nOutline;
      89           0 :         pItem->m_bOutline = nOutline != 0;
      90           0 :         sal_Int8 nShadow = 0;
      91           0 :         rStream >> nShadow;
      92           0 :         pItem->m_bShadow = nShadow != 0;
      93           0 :         sal_Int8 nKerning = 0;
      94           0 :         rStream >> nKerning;
      95           0 :         pItem->m_bKerning = nKerning != 0;
      96             :     }
      97           0 :     pItem->m_aColor.Read(rStream, sal_True);
      98           0 :     pItem->m_aFillColor.Read(rStream, sal_True);
      99           0 :     sal_Int16 nFlags = 0;
     100           0 :     rStream >> nFlags;
     101           0 :     pItem->m_bHasFont = (nFlags & 4) != 0;
     102           0 :     pItem->m_bHasColor = (nFlags & 1) != 0;
     103           0 :     pItem->m_bHasFillColor = (nFlags & 2) != 0;
     104           0 :     return pItem;
     105             : }
     106             : 
     107             : //============================================================================
     108             : // virtual
     109           0 : SvStream & SfxFontItem::Store(SvStream & rStream, sal_uInt16) const
     110             : {
     111           0 :     VersionCompat aItemCompat(rStream, STREAM_WRITE, 1);
     112             :     {
     113           0 :         VersionCompat aFontCompat(rStream, STREAM_WRITE, 1);
     114           0 :         writeByteString(rStream, m_aName);
     115           0 :         writeByteString(rStream, m_aStyleName);
     116           0 :         rStream << m_aSize << sal_Int16(m_nCharSet)
     117           0 :                 << m_nFamily << m_nPitch << m_nWeight << m_nUnderline
     118           0 :                 << m_nStrikeout << m_nItalic << sal_Int16(m_nLanguage)
     119           0 :                 << m_nWidthType << m_nOrientation << sal_Int8(m_bWordLine)
     120           0 :                 << sal_Int8(m_bOutline) << sal_Int8(m_bShadow)
     121           0 :                 << sal_Int8(m_bKerning);
     122             :     }
     123           0 :     (const_cast< Color & >(m_aColor)).Write(rStream, sal_True);
     124           0 :     (const_cast< Color & >(m_aFillColor)).Write(rStream, sal_True);
     125             :     rStream << sal_Int16(m_bHasFont << 2 | m_bHasColor
     126           0 :                           | m_bHasFillColor << 1);
     127           0 :     return rStream;
     128             : }
     129             : 
     130             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10