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 .
23 _ScRangeListTabs::_ScRangeListTabs()
27 _ScRangeListTabs::~_ScRangeListTabs()
32 void _ScRangeListTabs::Append( ScSingleRefData a
, SCTAB nTab
, const bool b
)
47 OSL_ENSURE( ValidTab(a
.nTab
), "-_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
.nCol
,a
.nRow
,a
.nTab
));
74 void _ScRangeListTabs::Append( ScComplexRefData a
, SCTAB nTab
, bool b
)
79 if( a
.Ref1
.nTab
!= a
.Ref2
.nTab
)
82 SCsTAB
& rTab
= a
.Ref1
.nTab
;
88 SCsCOL
& rCol1
= a
.Ref1
.nCol
;
94 SCsROW
& rRow1
= a
.Ref1
.nRow
;
100 SCsCOL
& rCol2
= a
.Ref2
.nCol
;
106 SCsROW
& rRow2
= a
.Ref2
.nRow
;
114 OSL_ENSURE( ValidTab(a
.Ref1
.nTab
),
115 "-_ScRangeListTabs::Append(): Luegen haben kurze Abstuerze!" );
116 OSL_ENSURE( a
.Ref1
.nTab
== a
.Ref2
.nTab
,
117 "+_ScRangeListTabs::Append(): 3D-Ranges werden in SC nicht unterstuetzt!" );
120 if( nTab
== SCTAB_MAX
)
126 if (nTab
< 0 || MAXTAB
< nTab
)
129 TabRangeType::iterator itr
= maTabRanges
.find(nTab
);
130 if (itr
== maTabRanges
.end())
132 // No entry for this table yet. Insert a new one.
133 std::pair
<TabRangeType::iterator
, bool> r
=
134 maTabRanges
.insert(nTab
, new RangeListType
);
142 itr
->second
->push_back(
143 ScRange(a
.Ref1
.nCol
,a
.Ref1
.nRow
,a
.Ref1
.nTab
,
144 a
.Ref2
.nCol
,a
.Ref2
.nRow
,a
.Ref2
.nTab
));
147 const ScRange
* _ScRangeListTabs::First( SCTAB n
)
149 OSL_ENSURE( ValidTab(n
), "-_ScRangeListTabs::First(): Good bye!" );
151 TabRangeType::iterator itr
= maTabRanges
.find(n
);
152 if (itr
== maTabRanges
.end())
153 // No range list exists for this table.
156 const RangeListType
& rList
= *itr
->second
;
157 maItrCur
= rList
.begin();
158 maItrCurEnd
= rList
.end();
159 return rList
.empty() ? NULL
: &(*maItrCur
);
162 const ScRange
* _ScRangeListTabs::Next ()
165 if (maItrCur
== maItrCurEnd
)
171 ConverterBase::ConverterBase( sal_uInt16 nNewBuffer
) :
174 nBufferSize( nNewBuffer
)
176 OSL_ENSURE( nNewBuffer
> 0, "ConverterBase::ConverterBase - nNewBuffer == 0!" );
177 pBuffer
= new sal_Char
[ nNewBuffer
];
180 ConverterBase::~ConverterBase()
185 void ConverterBase::Reset()
195 ExcelConverterBase::ExcelConverterBase( sal_uInt16 nNewBuffer
) :
196 ConverterBase( nNewBuffer
)
200 ExcelConverterBase::~ExcelConverterBase()
204 void ExcelConverterBase::Reset( const ScAddress
& rEingPos
)
206 ConverterBase::Reset();
210 void ExcelConverterBase::Reset()
212 ConverterBase::Reset();
213 aEingPos
.Set( 0, 0, 0 );
219 LotusConverterBase::LotusConverterBase( SvStream
&rStr
, sal_uInt16 nNewBuffer
) :
220 ConverterBase( nNewBuffer
),
226 LotusConverterBase::~LotusConverterBase()
230 void LotusConverterBase::Reset( const ScAddress
& rEingPos
)
232 ConverterBase::Reset();
237 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */