LCOV - code coverage report
Current view: top level - sw/source/core/txtnode - swfntcch.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 18 18 100.0 %
Date: 2014-04-11 Functions: 6 6 100.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 <viewsh.hxx>
      21             : #include "swfntcch.hxx"
      22             : #include "fmtcol.hxx"
      23             : #include "swfont.hxx"
      24             : 
      25             : // aus atrstck.cxx
      26             : extern const sal_uInt8 StackPos[];
      27             : 
      28             : // globale Variablen, werden in SwFntCch.Hxx bekanntgegeben
      29             : // Der FontCache wird in TxtInit.Cxx _TXTINIT erzeugt und in _TXTEXIT geloescht
      30             : SwFontCache *pSwFontCache = NULL;
      31             : 
      32             : /*************************************************************************
      33             : |*
      34             : |*  SwFontObj::SwFontObj(), ~SwFontObj()
      35             : |*
      36             : |*************************************************************************/
      37             : 
      38        2890 : SwFontObj::SwFontObj( const void *pOwn, SwViewShell *pSh ) :
      39             :     SwCacheObj( (void*)pOwn ),
      40        2890 :     aSwFont( &((SwTxtFmtColl *)pOwn)->GetAttrSet(), pSh ? pSh->getIDocumentSettingAccess() : 0 )
      41             : {
      42        2890 :     aSwFont.GoMagic( pSh, aSwFont.GetActual() );
      43        2890 :     const SwAttrSet& rAttrSet = ((SwTxtFmtColl *)pOwn)->GetAttrSet();
      44      132940 :     for (sal_uInt16 i = RES_CHRATR_BEGIN; i < RES_CHRATR_END; i++)
      45      130050 :         pDefaultArray[ StackPos[ i ] ] = &rAttrSet.Get( i, true );
      46        2890 : }
      47             : 
      48        5780 : SwFontObj::~SwFontObj()
      49             : {
      50        5780 : }
      51             : 
      52             : /*************************************************************************
      53             : |*
      54             : |*  SwFontAccess::SwFontAccess()
      55             : |*
      56             : |*************************************************************************/
      57             : 
      58      136762 : SwFontAccess::SwFontAccess( const void *pOwn, SwViewShell *pSh ) :
      59             :     SwCacheAccess( *pSwFontCache, pOwn,
      60      136762 :             ((SwTxtFmtColl*)pOwn)->IsInSwFntCache() ),
      61      136762 :     pShell( pSh )
      62             : {
      63      136762 : }
      64             : 
      65      249583 : SwFontObj *SwFontAccess::Get( )
      66             : {
      67      249583 :     return (SwFontObj *) SwCacheAccess::Get( );
      68             : }
      69             : 
      70        2890 : SwCacheObj *SwFontAccess::NewObj( )
      71             : {
      72        2890 :     ((SwTxtFmtColl*)pOwner)->SetInSwFntCache( sal_True );
      73        2890 :     return new SwFontObj( pOwner, pShell );
      74             : }
      75             : 
      76             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10