xref: /trunk/main/sw/source/core/bastyp/swtypes.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 #include "swtypes.hxx"
28 #include "tools/string.hxx"
29 #include <vcl/svapp.hxx>
30 #include <vcl/window.hxx>
31 #include <vcl/graph.hxx>
32 #include <editeng/unolingu.hxx>
33 #include <pagefrm.hxx>
34 #include <swatrset.hxx>
35 #include <frmfmt.hxx>
36 #include <frmtool.hxx>
37 #include <ndtxt.hxx>
38 #include <UndoDelete.hxx>
39 #include <UndoInsert.hxx>
40 #include <swtable.hxx>
41 #include <viscrs.hxx>
42 #include <fntcache.hxx>
43 #include <swfntcch.hxx>
44 #include <hffrm.hxx>
45 #include <colfrm.hxx>
46 #include <bodyfrm.hxx>
47 #include <tabfrm.hxx>
48 #include <txtfrm.hxx>
49 #include <swtblfmt.hxx>
50 #include <rowfrm.hxx>
51 #include <cellfrm.hxx>
52 #include <sectfrm.hxx>
53 
54 using namespace com::sun::star;
55 
56 ByteString aEmptyByteStr;		// Konstante Strings
57 String aEmptyStr;				// Konstante Strings
58 String aDotStr('.');			// Konstante Strings
59 
60 IMPL_FIXEDMEMPOOL_NEWDEL( SwAttrSet, 25, 25 )
61 IMPL_FIXEDMEMPOOL_NEWDEL( SwStartNode, 20, 20 )
62 IMPL_FIXEDMEMPOOL_NEWDEL( SwEndNode,   20, 20 )
63 IMPL_FIXEDMEMPOOL_NEWDEL( SwTableBox, 50, 50 )
64 IMPL_FIXEDMEMPOOL_NEWDEL( SwUndoDelete, 10, 10 )
65 IMPL_FIXEDMEMPOOL_NEWDEL( SwUndoInsert, 10, 10 )
66 IMPL_FIXEDMEMPOOL_NEWDEL( SwPaM, 10, 10 )
67 IMPL_FIXEDMEMPOOL_NEWDEL( SwCursor, 10, 10 )
68 IMPL_FIXEDMEMPOOL_NEWDEL( SwShellCrsr, 10, 10 )
69 IMPL_FIXEDMEMPOOL_NEWDEL( SwTxtNode, 50, 50 )
70 IMPL_FIXEDMEMPOOL_NEWDEL( SwpHints, 25, 25 )
71 IMPL_FIXEDMEMPOOL_NEWDEL( SwFntObj, 50, 50 )
72 IMPL_FIXEDMEMPOOL_NEWDEL( SwFontObj, 50, 50 )
73 IMPL_FIXEDMEMPOOL_NEWDEL( SwBorderAttrs, 100, 100 )
74 IMPL_FIXEDMEMPOOL_NEWDEL( SwCellFrm,	50, 50 )
75 IMPL_FIXEDMEMPOOL_NEWDEL( SwRowFrm,		10, 10 )
76 IMPL_FIXEDMEMPOOL_NEWDEL( SwColumnFrm,	40, 40 )
77 IMPL_FIXEDMEMPOOL_NEWDEL( SwSectionFrm,	20, 20 )
78 IMPL_FIXEDMEMPOOL_NEWDEL( SwTabFrm,	10, 10 )
79 IMPL_FIXEDMEMPOOL_NEWDEL( SwPageFrm,	20, 20 )
80 IMPL_FIXEDMEMPOOL_NEWDEL( SwBodyFrm,	20, 20 )
81 IMPL_FIXEDMEMPOOL_NEWDEL( SwHeaderFrm,	20, 20 )
82 IMPL_FIXEDMEMPOOL_NEWDEL( SwFooterFrm,	20, 20 )
83 IMPL_FIXEDMEMPOOL_NEWDEL( SwTxtFrm, 	50,  50 )
84 IMPL_FIXEDMEMPOOL_NEWDEL( SwTableFmt, 10, 10 )
85 IMPL_FIXEDMEMPOOL_NEWDEL( SwTableLineFmt, 10, 10 )
86 IMPL_FIXEDMEMPOOL_NEWDEL( SwTableBoxFmt, 50, 50 )
87 IMPL_FIXEDMEMPOOL_NEWDEL( _SwCursor_SavePos, 20, 20 )
88 
89 
GetGraphicSizeTwip(const Graphic & rGraphic,OutputDevice * pOutDev)90 Size GetGraphicSizeTwip( const Graphic& rGraphic, OutputDevice* pOutDev )
91 {
92 	const MapMode aMapTwip( MAP_TWIP );
93  	Size aSize( rGraphic.GetPrefSize() );
94 	if( MAP_PIXEL == rGraphic.GetPrefMapMode().GetMapUnit() )
95 	{
96 		if( !pOutDev )
97 			pOutDev = Application::GetDefaultDevice();
98 		aSize = pOutDev->PixelToLogic( aSize, aMapTwip );
99 	}
100 	else
101 		aSize = OutputDevice::LogicToLogic( aSize,
102 										rGraphic.GetPrefMapMode(), aMapTwip );
103 	return aSize;
104 }
105 
106 
GetSpellChecker()107 uno::Reference< linguistic2::XSpellChecker1 >  GetSpellChecker()
108 {
109 	return LinguMgr::GetSpellChecker();
110 }
111 
112 
GetHyphenator()113 uno::Reference< linguistic2::XHyphenator >  GetHyphenator()
114 {
115 	return LinguMgr::GetHyphenator();
116 }
117 
118 
GetThesaurus()119 uno::Reference< linguistic2::XThesaurus >  GetThesaurus()
120 {
121 	return LinguMgr::GetThesaurus();
122 }
123 
124 
GetLinguPropertySet()125 uno::Reference< beans::XPropertySet >  GetLinguPropertySet()
126 {
127 	return LinguMgr::GetLinguPropertySet();
128 }
129 
130 
131