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 .
26 #include "address.hxx"
27 #include <com/sun/star/lang/Locale.hpp>
30 struct ScSubTotalParam
;
40 /** Struct to hold non-data extended area, used with
41 ScDocument::ShrinkToUsedDataArea().
43 struct ScDataAreaExtras
45 /// If TRUE, consider the presence of cell notes besides data.
46 bool mbCellNotes
= false;
47 /// If TRUE, consider the presence of draw objects anchored to the cell.
48 bool mbCellDrawObjects
= false;
49 /// If TRUE, consider the presence of cell formats.
50 bool mbCellFormats
= false;
51 SCCOL mnStartCol
= SCCOL_MAX
;
52 SCROW mnStartRow
= SCROW_MAX
;
56 bool anyExtrasWanted() const { return mbCellNotes
|| mbCellDrawObjects
|| mbCellFormats
; }
57 void resetArea() { mnStartCol
= SCCOL_MAX
; mnStartRow
= SCROW_MAX
; mnEndCol
= -1; mnEndRow
= -1; }
59 bool operator==( const ScDataAreaExtras
& rOther
) const
61 // Ignore area range, this is used in ScSortParam::operator==().
62 return mbCellNotes
== rOther
.mbCellNotes
63 && mbCellDrawObjects
== rOther
.mbCellDrawObjects
64 && mbCellFormats
== rOther
.mbCellFormats
;
74 /// Obtain the overall range if area extras are larger.
75 void GetOverallRange( SCCOL
& nCol1
, SCROW
& nRow1
, SCCOL
& nCol2
, SCROW
& nRow2
, Clip eClip
= Clip::None
) const
77 if (eClip
!= Clip::Col
)
79 if (nCol1
> mnStartCol
)
84 if (eClip
!= Clip::Row
)
86 if (nRow1
> mnStartRow
)
93 /// Set the overall range.
94 void SetOverallRange( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
)
103 struct SC_DLLPUBLIC ScSortParam
109 ScDataAreaExtras aDataAreaExtras
;
110 sal_uInt16 nUserIndex
;
120 ::std::vector
<ScSortKeyState
>
122 css::lang::Locale aCollatorLocale
;
123 OUString aCollatorAlgorithm
;
124 sal_uInt16 nCompatHeader
;
127 ScSortParam( const ScSortParam
& r
);
129 ScSortParam( const ScSubTotalParam
& rSub
, const ScSortParam
& rOld
);
131 ScSortParam( const ScQueryParam
&, SCCOL nCol
);
134 ScSortParam
& operator= ( const ScSortParam
& r
);
135 bool operator== ( const ScSortParam
& rOther
) const;
139 sal_uInt16
GetSortKeyCount() const { return maKeyState
.size(); }
147 * This sort range already takes into account the presence or absence of
148 * header row / column i.e. if a header row / column is present, it
149 * excludes that row / column.
152 ScDataAreaExtras maDataAreaExtras
;
155 * List of original column / row positions after reordering.
157 std::vector
<SCCOLROW
> maOrderIndices
;
159 bool mbHiddenFiltered
;
164 * Reorder the position indices such that it can be used to undo the
165 * original reordering.
172 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */