fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / filter / inc / lotrange.hxx
blob62356e25b74590f2c778efa0461f03869a7a016f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SC_SOURCE_FILTER_INC_LOTRANGE_HXX
21 #define INCLUDED_SC_SOURCE_FILTER_INC_LOTRANGE_HXX
23 #include <compiler.hxx>
25 class LotusRangeList;
27 typedef sal_uInt16 LR_ID;
29 #define ID_FAIL 0xFFFF
31 class LotusRange
33 friend class LotusRangeList;
34 private:
35 sal_uInt32 nHash;
36 SCCOL nColStart;
37 SCROW nRowStart;
38 SCCOL nColEnd;
39 SCROW nRowEnd;
40 LR_ID nId;
41 void MakeHash();
42 inline void Copy( const LotusRange& );
43 inline void SetId( LR_ID nId );
44 public:
45 LotusRange( SCCOL nCol, SCROW nRow );
46 LotusRange( SCCOL nColS, SCROW nRowS, SCCOL nColE, SCROW nRowE );
47 LotusRange( const LotusRange& );
48 inline LotusRange &operator =( const LotusRange& );
49 inline bool operator ==( const LotusRange& ) const;
50 inline bool operator !=( const LotusRange& ) const;
51 inline bool IsSingle() const;
54 inline void LotusRange::Copy( const LotusRange& rCpy )
56 nHash = rCpy.nHash;
57 nColStart = rCpy.nColStart;
58 nRowStart = rCpy.nRowStart;
59 nColEnd = rCpy.nColEnd;
60 nRowEnd = rCpy.nRowEnd;
61 nId = rCpy.nId;
64 inline void LotusRange::SetId( LR_ID nNewId )
66 nId = nNewId;
69 inline LotusRange &LotusRange::operator =( const LotusRange& rCpy )
71 Copy( rCpy );
72 return *this;
75 inline bool LotusRange::operator ==( const LotusRange& rRef ) const
77 return ( nHash == rRef.nHash && nColStart == rRef.nColStart &&
78 nRowStart == rRef.nRowStart && nColEnd == rRef.nColEnd &&
79 nRowEnd == rRef.nRowEnd );
82 inline bool LotusRange::operator !=( const LotusRange& rRef ) const
84 return ( nHash != rRef.nHash || nColStart != rRef.nColStart ||
85 nRowStart != rRef.nRowStart || nColEnd != rRef.nColEnd ||
86 nRowEnd != rRef.nRowEnd );
89 inline bool LotusRange::IsSingle() const
91 return ( nColStart == nColEnd && nRowStart == nRowEnd );
94 class LotusRangeList
96 private:
97 LOTUS_ROOT* m_pLotRoot;
98 LR_ID nIdCnt;
99 ScComplexRefData aComplRef;
100 static SCCOL nEingCol;
101 static SCROW nEingRow;
102 std::vector<LotusRange*> maRanges;
104 public:
105 LotusRangeList(LOTUS_ROOT* pLotRoot);
106 ~LotusRangeList();
107 inline sal_uInt16 GetIndex( SCCOL nCol, SCROW nRow );
108 inline sal_uInt16 GetIndex( SCCOL nColS, SCROW nRowS, SCCOL nColE, SCROW nRowE );
109 sal_uInt16 GetIndex( const LotusRange& );
110 inline void Append( SCCOL nCol, SCROW nRow, const OUString& );
111 inline void Append( SCCOL nColS, SCROW nRowS, SCCOL nColE, SCROW nRowE, const OUString& );
112 void Append( LotusRange* pLR, const OUString& rName );
113 inline static void SetEing( const SCCOL nCol, const SCROW nRow );
116 inline LR_ID LotusRangeList::GetIndex( SCCOL nCol, SCROW nRow )
118 LotusRange aRef( nCol, nRow );
119 return GetIndex( aRef );
122 inline LR_ID LotusRangeList::GetIndex( SCCOL nColS, SCROW nRowS, SCCOL nColE, SCROW nRowE )
124 LotusRange aRef( nColS, nRowS, nColE, nRowE );
125 return GetIndex( aRef );
128 inline void LotusRangeList::Append( SCCOL nCol, SCROW nRow, const OUString& rName )
130 Append( new LotusRange( nCol, nRow ), rName );
133 inline void LotusRangeList::Append( SCCOL nColS, SCROW nRowS, SCCOL nColE, SCROW nRowE, const OUString& r )
135 Append( new LotusRange( nColS, nRowS, nColE, nRowE ), r );
138 inline void LotusRangeList::SetEing( const SCCOL nCol, const SCROW nRow )
140 nEingCol = nCol;
141 nEingRow = nRow;
144 #endif
146 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */