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 : : #include <viewsh.hxx>
30 : : #include "swfntcch.hxx"
31 : : #include "fmtcol.hxx"
32 : : #include "swfont.hxx"
33 : :
34 : : // aus atrstck.cxx
35 : : extern const sal_uInt8 StackPos[];
36 : :
37 : : // globale Variablen, werden in SwFntCch.Hxx bekanntgegeben
38 : : // Der FontCache wird in TxtInit.Cxx _TXTINIT erzeugt und in _TXTEXIT geloescht
39 : : SwFontCache *pSwFontCache = NULL;
40 : :
41 : : /*************************************************************************
42 : : |*
43 : : |* SwFontObj::SwFontObj(), ~SwFontObj()
44 : : |*
45 : : |*************************************************************************/
46 : :
47 : 1663 : SwFontObj::SwFontObj( const void *pOwn, ViewShell *pSh ) :
48 : : SwCacheObj( (void*)pOwn ),
49 [ + + ][ + - ]: 1663 : aSwFont( &((SwTxtFmtColl *)pOwn)->GetAttrSet(), pSh ? pSh->getIDocumentSettingAccess() : 0 )
[ + - ]
50 : : {
51 [ + - ]: 1663 : aSwFont.GoMagic( pSh, aSwFont.GetActual() );
52 : 1663 : const SwAttrSet& rAttrSet = ((SwTxtFmtColl *)pOwn)->GetAttrSet();
53 [ + + ]: 68183 : for (sal_uInt16 i = RES_CHRATR_BEGIN; i < RES_CHRATR_END; i++)
54 [ + - ]: 66520 : pDefaultArray[ StackPos[ i ] ] = &rAttrSet.Get( i, sal_True );
55 : 1663 : }
56 : :
57 [ + - ]: 1663 : SwFontObj::~SwFontObj()
58 : : {
59 [ - + ]: 3326 : }
60 : :
61 : : /*************************************************************************
62 : : |*
63 : : |* SwFontAccess::SwFontAccess()
64 : : |*
65 : : |*************************************************************************/
66 : :
67 : 100587 : SwFontAccess::SwFontAccess( const void *pOwn, ViewShell *pSh ) :
68 : : SwCacheAccess( *pSwFontCache, pOwn,
69 : 100587 : ((SwTxtFmtColl*)pOwn)->IsInSwFntCache() ),
70 : 100587 : pShell( pSh )
71 : : {
72 : 100587 : }
73 : :
74 : 195293 : SwFontObj *SwFontAccess::Get( )
75 : : {
76 : 195293 : return (SwFontObj *) SwCacheAccess::Get( );
77 : : }
78 : :
79 : 1663 : SwCacheObj *SwFontAccess::NewObj( )
80 : : {
81 : 1663 : ((SwTxtFmtColl*)pOwner)->SetInSwFntCache( sal_True );
82 [ + - ]: 1663 : return new SwFontObj( pOwner, pShell );
83 : : }
84 : :
85 : :
86 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|