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 <editeng/colritem.hxx>
28 #include <com/sun/star/lang/Locale.hpp>
31 struct ScSubTotalParam
;
34 enum class ScColorSortMode
{
45 ScColorSortMode aColorSortMode
;
46 Color aColorSortColor
;
49 /** Struct to hold non-data extended area, used with
50 ScDocument::ShrinkToUsedDataArea().
52 struct ScDataAreaExtras
54 /// If TRUE, consider the presence of cell notes besides data.
55 bool mbCellNotes
= false;
56 /// If TRUE, consider the presence of draw objects anchored to the cell.
57 bool mbCellDrawObjects
= false;
58 /// If TRUE, consider the presence of cell formats.
59 bool mbCellFormats
= false;
60 SCCOL mnStartCol
= SCCOL_MAX
;
61 SCROW mnStartRow
= SCROW_MAX
;
65 bool anyExtrasWanted() const { return mbCellNotes
|| mbCellDrawObjects
|| mbCellFormats
; }
66 void resetArea() { mnStartCol
= SCCOL_MAX
; mnStartRow
= SCROW_MAX
; mnEndCol
= -1; mnEndRow
= -1; }
68 bool operator==( const ScDataAreaExtras
& rOther
) const
70 // Ignore area range, this is used in ScSortParam::operator==().
71 return mbCellNotes
== rOther
.mbCellNotes
72 && mbCellDrawObjects
== rOther
.mbCellDrawObjects
73 && mbCellFormats
== rOther
.mbCellFormats
;
83 /// Obtain the overall range if area extras are larger.
84 void GetOverallRange( SCCOL
& nCol1
, SCROW
& nRow1
, SCCOL
& nCol2
, SCROW
& nRow2
, Clip eClip
= Clip::None
) const
86 if (eClip
!= Clip::Col
)
88 if (nCol1
> mnStartCol
)
93 if (eClip
!= Clip::Row
)
95 if (nRow1
> mnStartRow
)
102 /// Set the overall range.
103 void SetOverallRange( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
)
112 struct SC_DLLPUBLIC ScSortParam
118 ScDataAreaExtras aDataAreaExtras
;
119 sal_uInt16 nUserIndex
;
129 ::std::vector
<ScSortKeyState
>
131 css::lang::Locale aCollatorLocale
;
132 OUString aCollatorAlgorithm
;
133 sal_uInt16 nCompatHeader
;
136 ScSortParam( const ScSortParam
& r
);
138 ScSortParam( const ScSubTotalParam
& rSub
, const ScSortParam
& rOld
);
140 ScSortParam( const ScQueryParam
&, SCCOL nCol
);
143 ScSortParam
& operator= ( const ScSortParam
& r
);
144 bool operator== ( const ScSortParam
& rOther
) const;
148 sal_uInt16
GetSortKeyCount() const { return maKeyState
.size(); }
156 * This sort range already takes into account the presence or absence of
157 * header row / column i.e. if a header row / column is present, it
158 * excludes that row / column.
161 ScDataAreaExtras maDataAreaExtras
;
164 * List of original column / row positions after reordering.
166 std::vector
<SCCOLROW
> maOrderIndices
;
168 bool mbHiddenFiltered
;
173 * Reorder the position indices such that it can be used to undo the
174 * original reordering.
180 , mbHiddenFiltered(false)
181 , mbUpdateRefs(false)
182 , mbHasHeaders(false)
189 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */