1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 _ScRangeListTabs::_ScRangeListTabs()
26 _ScRangeListTabs::~_ScRangeListTabs()
30 void _ScRangeListTabs::Append( const ScAddress
& aSRD
, SCTAB nTab
, const bool b
)
47 OSL_ENSURE( ValidTab(a
.Tab()), "-_ScRangeListTabs::Append(): A lie has no crash!" );
50 if( nTab
== SCTAB_MAX
)
55 if (nTab
< 0 || MAXTAB
< nTab
)
58 TabRangeType::iterator itr
= maTabRanges
.find(nTab
);
59 if (itr
== maTabRanges
.end())
61 // No entry for this table yet. Insert a new one.
62 std::pair
<TabRangeType::iterator
, bool> r
=
63 maTabRanges
.insert(nTab
, new RangeListType
);
71 itr
->second
->push_back(ScRange(a
.Col(),a
.Row(),a
.Tab()));
74 void _ScRangeListTabs::Append( const ScRange
& aCRD
, SCTAB nTab
, bool b
)
81 if (a
.aStart
.Tab() != a
.aEnd
.Tab())
84 if (a
.aStart
.Tab() > MAXTAB
)
85 a
.aStart
.SetTab(MAXTAB
);
86 else if (a
.aStart
.Tab() < 0)
89 if (a
.aStart
.Col() > MAXCOL
)
90 a
.aStart
.SetCol(MAXCOL
);
91 else if (a
.aStart
.Col() < 0)
94 if (a
.aStart
.Row() > MAXROW
)
95 a
.aStart
.SetRow(MAXROW
);
96 else if (a
.aStart
.Row() < 0)
99 if (a
.aEnd
.Col() > MAXCOL
)
100 a
.aEnd
.SetCol(MAXCOL
);
101 else if (a
.aEnd
.Col() < 0)
104 if (a
.aEnd
.Row() > MAXROW
)
105 a
.aEnd
.SetRow(MAXROW
);
106 else if (a
.aEnd
.Row() < 0)
109 #if 0 // no members 'Ref1' or 'Ref2' in 'ScRange'
112 OSL_ENSURE( ValidTab(a
.Ref1
.nTab
),
113 "-_ScRangeListTabs::Append(): Luegen haben kurze Abstuerze!" );
114 OSL_ENSURE( a
.Ref1
.nTab
== a
.Ref2
.nTab
,
115 "+_ScRangeListTabs::Append(): 3D-Ranges werden in SC nicht unterstuetzt!" );
119 if( nTab
== SCTAB_MAX
)
123 nTab
= a
.aStart
.Tab();
125 if (nTab
< 0 || MAXTAB
< nTab
)
128 TabRangeType::iterator itr
= maTabRanges
.find(nTab
);
129 if (itr
== maTabRanges
.end())
131 // No entry for this table yet. Insert a new one.
132 std::pair
<TabRangeType::iterator
, bool> r
=
133 maTabRanges
.insert(nTab
, new RangeListType
);
141 itr
->second
->push_back(a
);
144 const ScRange
* _ScRangeListTabs::First( SCTAB n
)
146 OSL_ENSURE( ValidTab(n
), "-_ScRangeListTabs::First(): Good bye!" );
148 TabRangeType::iterator itr
= maTabRanges
.find(n
);
149 if (itr
== maTabRanges
.end())
150 // No range list exists for this table.
153 const RangeListType
& rList
= *itr
->second
;
154 maItrCur
= rList
.begin();
155 maItrCurEnd
= rList
.end();
156 return rList
.empty() ? NULL
: &(*maItrCur
);
159 const ScRange
* _ScRangeListTabs::Next ()
162 if (maItrCur
== maItrCurEnd
)
168 ConverterBase::ConverterBase( svl::SharedStringPool
& rSPool
, sal_uInt16 nNewBuffer
) :
172 nBufferSize( nNewBuffer
)
174 OSL_ENSURE( nNewBuffer
> 0, "ConverterBase::ConverterBase - nNewBuffer == 0!" );
175 pBuffer
= new sal_Char
[ nNewBuffer
];
178 ConverterBase::~ConverterBase()
183 void ConverterBase::Reset()
190 ExcelConverterBase::ExcelConverterBase( svl::SharedStringPool
& rSPool
, sal_uInt16 nNewBuffer
) :
191 ConverterBase(rSPool
, nNewBuffer
)
195 ExcelConverterBase::~ExcelConverterBase()
199 void ExcelConverterBase::Reset( const ScAddress
& rEingPos
)
201 ConverterBase::Reset();
205 void ExcelConverterBase::Reset()
207 ConverterBase::Reset();
208 aEingPos
.Set( 0, 0, 0 );
211 LotusConverterBase::LotusConverterBase( SvStream
&rStr
, svl::SharedStringPool
& rSPool
, sal_uInt16 nNewBuffers
) :
212 ConverterBase(rSPool
, nNewBuffers
),
218 LotusConverterBase::~LotusConverterBase()
222 void LotusConverterBase::Reset( const ScAddress
& rEingPos
)
224 ConverterBase::Reset();
229 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */