xref: /aoo41x/main/sc/source/filter/inc/lotfntbf.hxx (revision 3ee7c2db)
138d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
338d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
438d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
538d50f7bSAndrew Rist  * distributed with this work for additional information
638d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
738d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
838d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
938d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
1038d50f7bSAndrew Rist  *
1138d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
1238d50f7bSAndrew Rist  *
1338d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
1438d50f7bSAndrew Rist  * software distributed under the License is distributed on an
1538d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1638d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
1738d50f7bSAndrew Rist  * specific language governing permissions and limitations
1838d50f7bSAndrew Rist  * under the License.
1938d50f7bSAndrew Rist  *
2038d50f7bSAndrew Rist  *************************************************************/
2138d50f7bSAndrew Rist 
2238d50f7bSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SC_LOTFNTBF_HXX
25cdf0e10cSrcweir #define SC_LOTFNTBF_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <tools/solar.h>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #include "scitems.hxx"
30cdf0e10cSrcweir #include <editeng/fontitem.hxx>
31cdf0e10cSrcweir #include <editeng/fhgtitem.hxx>
32cdf0e10cSrcweir #include <editeng/colritem.hxx>
33cdf0e10cSrcweir 
34cdf0e10cSrcweir // ---------------------------------------------------- class LotusFontBuffer -
35cdf0e10cSrcweir 
36cdf0e10cSrcweir // Code in fontbuff.cxx (excel)
37cdf0e10cSrcweir 
38cdf0e10cSrcweir class LotusFontBuffer
39cdf0e10cSrcweir {
40cdf0e10cSrcweir private:
41cdf0e10cSrcweir 	struct ENTRY
42cdf0e10cSrcweir 	{
43cdf0e10cSrcweir 		String*				pTmpName;
44cdf0e10cSrcweir 		SvxFontItem*		pFont;
45cdf0e10cSrcweir 		SvxFontHeightItem*	pHeight;
46cdf0e10cSrcweir 		SvxColorItem*		pColor;
47cdf0e10cSrcweir 		sal_Int32				nType;		// < 0 -> undefiniert
ENTRYLotusFontBuffer::ENTRY48cdf0e10cSrcweir 		inline				ENTRY( void )
49cdf0e10cSrcweir 							{
50cdf0e10cSrcweir 								pTmpName = NULL;
51cdf0e10cSrcweir 								pFont = NULL;
52cdf0e10cSrcweir 								pHeight = NULL;
53cdf0e10cSrcweir 								pColor = NULL;
54cdf0e10cSrcweir 								nType = -1;
55cdf0e10cSrcweir 							}
~ENTRYLotusFontBuffer::ENTRY56cdf0e10cSrcweir 		inline				~ENTRY()
57cdf0e10cSrcweir 							{
58cdf0e10cSrcweir 								if( pTmpName )
59cdf0e10cSrcweir 									delete pTmpName;
60cdf0e10cSrcweir 								if( pFont )
61cdf0e10cSrcweir 									delete pFont;
62cdf0e10cSrcweir 								if( pHeight )
63cdf0e10cSrcweir 									delete pHeight;
64cdf0e10cSrcweir 								if( pColor )
65cdf0e10cSrcweir 									delete pColor;
66cdf0e10cSrcweir 							}
TmpNameLotusFontBuffer::ENTRY67cdf0e10cSrcweir 		inline void			TmpName( const String &rNew )
68cdf0e10cSrcweir 							{
69cdf0e10cSrcweir 								if( pTmpName )
70cdf0e10cSrcweir 									*pTmpName = rNew;
71cdf0e10cSrcweir 								else
72cdf0e10cSrcweir 									pTmpName = new String( rNew );
73cdf0e10cSrcweir 							}
FontLotusFontBuffer::ENTRY74cdf0e10cSrcweir 		inline void			Font( SvxFontItem& rNew )
75cdf0e10cSrcweir 							{
76cdf0e10cSrcweir 								if( pFont )
77cdf0e10cSrcweir 									delete pFont;
78cdf0e10cSrcweir 								pFont = &rNew;
79cdf0e10cSrcweir 							}
HeightLotusFontBuffer::ENTRY80cdf0e10cSrcweir 		inline void			Height( SvxFontHeightItem& rNew )
81cdf0e10cSrcweir 							{
82cdf0e10cSrcweir 								if( pHeight )
83cdf0e10cSrcweir 									delete pHeight;
84cdf0e10cSrcweir 								pHeight = &rNew;
85cdf0e10cSrcweir 							}
ColorLotusFontBuffer::ENTRY86cdf0e10cSrcweir 		inline void			Color( SvxColorItem& rNew )
87cdf0e10cSrcweir 							{
88cdf0e10cSrcweir 								if( pColor )
89cdf0e10cSrcweir 									delete pColor;
90cdf0e10cSrcweir 								pColor = &rNew;
91cdf0e10cSrcweir 							}
TypeLotusFontBuffer::ENTRY92cdf0e10cSrcweir 		inline void			Type( const sal_uInt16 nNew )		{ nType = nNew; }
93cdf0e10cSrcweir 	};
94cdf0e10cSrcweir 
95cdf0e10cSrcweir 	void					MakeFont( ENTRY* pEntry );
96cdf0e10cSrcweir public:
97*3ee7c2dbSArmin Le Grand 	const static sal_uInt16	nSize = 8;
98cdf0e10cSrcweir 	void					Fill( const sal_uInt8 nIndex, SfxItemSet& rItemSet );
99cdf0e10cSrcweir 	void					SetName( const sal_uInt16 nIndex, const String& rName );
100cdf0e10cSrcweir 	void					SetHeight( const sal_uInt16 nIndex, const sal_uInt16 nHeight );
101cdf0e10cSrcweir 	void					SetType( const sal_uInt16 nIndex, const sal_uInt16 nType );
102*3ee7c2dbSArmin Le Grand private:
103*3ee7c2dbSArmin Le Grand 	ENTRY					pData[ nSize ];
104cdf0e10cSrcweir };
105cdf0e10cSrcweir 
106cdf0e10cSrcweir 
107cdf0e10cSrcweir 
108cdf0e10cSrcweir #endif
109