Update ooo320-m1
[ooovba.git] / sw / source / filter / inc / fltglbls.hxx
blob9b5c3491792878b00e5070948c73dca0ff18fd35
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: fltglbls.hxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _FLTGLBS_HXX
31 #define _FLTGLBS_HXX
33 #include <tools/string.hxx>
34 #include <i18npool/lang.h>
35 #include <svtools/svarray.hxx>
38 class SfxPoolItem;
39 class SwDoc;
40 class SwPaM;
41 class SwTable;
43 class XF_Buffer;
44 class ColorBuffer;
45 class FontBuffer;
46 class SvNumberFormatter;
49 class ExcGlob;
50 extern ExcGlob *pExcGlob;
52 class LotGlob;
53 extern LotGlob *pLotGlob;
55 // ----- Basis-Klasse ----------------------------------------------------
56 class FilterGlobals
58 protected:
59 SvPtrarr aTblFmts;
60 USHORT nColStart;
61 USHORT nColEnd;
62 USHORT nRowStart;
63 USHORT nRowEnd;
64 USHORT nAnzCols;
65 USHORT nAnzRows;
67 public:
68 FilterGlobals( SwDoc& rDoc, const SwPaM& rPam );
69 ~FilterGlobals();
71 SwDoc *pD;
72 SwPaM *pPam;
73 const SwTable *pTable;
75 SvNumberFormatter *pNumFormatter;
76 LanguageType eDefLanguage;
77 ULONG nStandard;
78 ULONG nDefFormat; // = 0xFFFFFFFF
80 void SetRange( USHORT nCS, USHORT nCE, USHORT nRS, USHORT nRE );
82 BOOL IsInColRange( USHORT nCol )
83 { return ( nCol >= nColStart && nCol <= nColEnd ); }
84 BOOL IsInRowRange( USHORT nRow )
85 { return ( nRow >= nRowStart && nRow <= nRowEnd ); }
86 BOOL IsInRange( USHORT nCol, USHORT nRow )
87 { return IsInRowRange(nRow) && IsInColRange(nCol); }
89 void NormalizeCol( USHORT &rCol ) { rCol -= nColStart; }
90 void NormalizeRow( USHORT &rRow ) { rRow -= nRowStart; }
91 void Normalize( USHORT &rCol, USHORT &rRow )
92 { NormalizeCol( rCol ); NormalizeRow( rRow ); }
94 USHORT AnzCols() const { return nAnzCols; }
95 USHORT AnzRows() const { return nAnzRows; }
97 BOOL ColRangeLimitter( USHORT &rCS, USHORT &rCE );
99 void InsertText( USHORT nCol, USHORT nRow, const String& rStr );
100 void CreateTable();
101 void InsertAttr( const SfxPoolItem& rItem );
103 inline void ColLimitter( USHORT &rCol );
104 inline void RowLimitter( USHORT &rRow );
111 inline void FilterGlobals::ColLimitter( USHORT &rCol )
113 if( rCol < nColStart )
114 rCol = nColStart;
115 else if( rCol > nColEnd )
116 rCol = nColEnd;
119 inline void FilterGlobals::RowLimitter( USHORT &rRow )
121 if( rRow < nRowStart )
122 rRow = nRowStart;
123 else if( rRow > nRowEnd )
124 rRow = nRowEnd;
127 #endif