xref: /trunk/main/sw/source/core/text/txtinit.cxx (revision efeef26f)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sw.hxx"
26 
27 
28 
29 #include "errhdl.hxx"
30 #include "txtcfg.hxx"
31 #include "swcache.hxx"
32 #include "fntcache.hxx"     // pFntCache  ( SwFont/ScrFont-PrtFont Cache )
33 #include "swfntcch.hxx"     // pSwFontCache  ( SwAttrSet/SwFont Cache )
34 #include "txtfrm.hxx"
35 #include "txtcache.hxx"
36 #include "porlay.hxx"
37 #include "porglue.hxx"
38 #include "porexp.hxx"
39 #include "porrst.hxx"
40 #include "portab.hxx"
41 #include "porfly.hxx"
42 #include "portox.hxx"
43 #include "porref.hxx"
44 #include "porftn.hxx"
45 #include "porhyph.hxx"
46 #include "pordrop.hxx"
47 #include "blink.hxx" 	// Blink-Manager
48 #include "init.hxx"   // Deklarationen fuer _TextInit() und _TextFinit()
49 #include "txtfly.hxx"	// SwContourCache
50 #include "dbg_lay.hxx"  // Layout Debug Fileausgabe
51 
52 SwCache *SwTxtFrm::pTxtCache = 0;
53 long SwTxtFrm::nMinPrtLine = 0;
54 SwContourCache *pContourCache = 0;
55 SwDropCapCache *pDropCapCache = 0;
56 
57 IMPL_FIXEDMEMPOOL_NEWDEL( SwTxtLine, 	  50,  50 )
58 IMPL_FIXEDMEMPOOL_NEWDEL( SwParaPortion,  50,  50 )	//Absaetze
59 IMPL_FIXEDMEMPOOL_NEWDEL( SwLineLayout,  150, 150 )	//Zeilen
60 IMPL_FIXEDMEMPOOL_NEWDEL( SwHolePortion, 150, 150 )	//z.B. Blanks am Zeilenende
61 IMPL_FIXEDMEMPOOL_NEWDEL( SwTxtPortion,  200, 100 )	//Attributwechsel
62 
63 /*************************************************************************
64  *                  _TextInit(), _TextFinit()
65  *************************************************************************/
66 
67 // Werden _nur_ in init.cxx verwendet, dort stehen extern void _TextFinit()
68 // und extern void _TextInit(...)
69 
_TextInit()70 void _TextInit()
71 {
72     pFntCache = new SwFntCache;                     // Cache for SwSubFont -> SwFntObj = { Font aFont, Font* pScrFont, Font* pPrtFont, OutputDevice* pPrinter, ... }
73     pSwFontCache = new SwFontCache;                 // Cache for SwTxtFmtColl -> SwFontObj = { SwFont aSwFont, SfxPoolItem* pDefaultArray }
74     SwCache *pTxtCache = new SwCache( 250, 100      // Cache for SwTxtFrm -> SwTxtLine = { SwParaPortion* pLine }
75 #ifdef DBG_UTIL
76 	, "static SwTxtFrm::pTxtCache"
77 #endif
78 	);
79 	SwTxtFrm::SetTxtCache( pTxtCache );
80     pWaveCol = new Color( COL_GRAY );
81     PROTOCOL_INIT
82 }
83 
_TextFinit()84 void _TextFinit()
85 {
86 	PROTOCOL_STOP
87 	delete SwTxtFrm::GetTxtCache();
88 	delete pSwFontCache;
89 	delete pFntCache;
90 	delete pBlink;
91 	delete pWaveCol;
92 	delete pContourCache;
93 	SwDropPortion::DeleteDropCapCache();
94 }
95 
96 
97 
98