LibreOffice Module sc (master) 1
sortparam.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#define DEFSORT 3
23
24#include <vector>
25
26#include "address.hxx"
27#include <editeng/colritem.hxx>
28#include <com/sun/star/lang/Locale.hpp>
29#include "scdllapi.h"
30
31struct ScSubTotalParam;
32struct ScQueryParam;
33
34enum class ScColorSortMode {
35 None,
38};
39
41{
43 bool bDoSort;
47};
48
53{
55 bool mbCellNotes = false;
57 bool mbCellDrawObjects = false;
59 bool mbCellFormats = false;
64
67
68 bool operator==( const ScDataAreaExtras& rOther ) const
69 {
70 // Ignore area range, this is used in ScSortParam::operator==().
71 return mbCellNotes == rOther.mbCellNotes
73 && mbCellFormats == rOther.mbCellFormats;
74 }
75
76 enum class Clip
77 {
78 None,
79 Col,
80 Row
81 };
82
84 void GetOverallRange( SCCOL& nCol1, SCROW& nRow1, SCCOL& nCol2, SCROW& nRow2, Clip eClip = Clip::None ) const
85 {
86 if (eClip != Clip::Col)
87 {
88 if (nCol1 > mnStartCol)
89 nCol1 = mnStartCol;
90 if (nCol2 < mnEndCol)
91 nCol2 = mnEndCol;
92 }
93 if (eClip != Clip::Row)
94 {
95 if (nRow1 > mnStartRow)
96 nRow1 = mnStartRow;
97 if (nRow2 < mnEndRow)
98 nRow2 = mnEndRow;
99 }
100 }
101
103 void SetOverallRange( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 )
104 {
105 mnStartCol = nCol1;
106 mnStartRow = nRow1;
107 mnEndCol = nCol2;
108 mnEndRow = nRow2;
109 }
110};
111
113{
119 sal_uInt16 nUserIndex;
121 bool bByRow;
129 ::std::vector<ScSortKeyState>
131 css::lang::Locale aCollatorLocale;
133 sal_uInt16 nCompatHeader;
134
135 ScSortParam();
136 ScSortParam( const ScSortParam& r );
138 ScSortParam( const ScSubTotalParam& rSub, const ScSortParam& rOld );
140 ScSortParam( const ScQueryParam&, SCCOL nCol );
141 ~ScSortParam();
142
143 ScSortParam& operator= ( const ScSortParam& r );
144 bool operator== ( const ScSortParam& rOther ) const;
145 void Clear ();
146 void MoveToDest();
147
148 sal_uInt16 GetSortKeyCount() const { return maKeyState.size(); }
149};
150
151namespace sc {
152
154{
162
166 std::vector<SCCOLROW> maOrderIndices;
171
176 void reverse();
177
179 : mbByRow(false)
180 , mbHiddenFiltered(false)
181 , mbUpdateRefs(false)
182 , mbHasHeaders(false)
183 {
184 }
185};
186
187}
188
189/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const SCCOL SCCOL_MAX
Definition: address.hxx:56
const SCROW SCROW_MAX
Definition: address.hxx:55
void Clear(EHistoryType eHistory)
None
CAUTION! The following defines must be in the same namespace as the respective type.
Definition: broadcast.cxx:15
#define SC_DLLPUBLIC
Definition: scdllapi.h:27
ScColorSortMode
Definition: sortparam.hxx:34
Struct to hold non-data extended area, used with ScDocument::ShrinkToUsedDataArea().
Definition: sortparam.hxx:53
bool mbCellDrawObjects
If TRUE, consider the presence of draw objects anchored to the cell.
Definition: sortparam.hxx:57
bool mbCellFormats
If TRUE, consider the presence of cell formats.
Definition: sortparam.hxx:59
void GetOverallRange(SCCOL &nCol1, SCROW &nRow1, SCCOL &nCol2, SCROW &nRow2, Clip eClip=Clip::None) const
Obtain the overall range if area extras are larger.
Definition: sortparam.hxx:84
void SetOverallRange(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
Set the overall range.
Definition: sortparam.hxx:103
bool operator==(const ScDataAreaExtras &rOther) const
Definition: sortparam.hxx:68
bool mbCellNotes
If TRUE, consider the presence of cell notes besides data.
Definition: sortparam.hxx:55
bool anyExtrasWanted() const
Definition: sortparam.hxx:65
Color aColorSortColor
Definition: sortparam.hxx:46
ScColorSortMode aColorSortMode
Definition: sortparam.hxx:45
SCCOLROW nField
Definition: sortparam.hxx:42
SCTAB nDestTab
Definition: sortparam.hxx:126
SCROW nDestRow
Definition: sortparam.hxx:128
sal_uInt16 nCompatHeader
Definition: sortparam.hxx:133
SCCOL nDestCol
Definition: sortparam.hxx:127
bool bNaturalSort
Definition: sortparam.hxx:123
::std::vector< ScSortKeyState > maKeyState
Definition: sortparam.hxx:130
OUString aCollatorAlgorithm
Definition: sortparam.hxx:132
bool bHasHeader
Definition: sortparam.hxx:120
ScDataAreaExtras aDataAreaExtras
Definition: sortparam.hxx:118
css::lang::Locale aCollatorLocale
Definition: sortparam.hxx:131
sal_uInt16 nUserIndex
Definition: sortparam.hxx:119
sal_uInt16 GetSortKeyCount() const
Definition: sortparam.hxx:148
bool bCaseSens
Definition: sortparam.hxx:122
void reverse()
Reorder the position indices such that it can be used to undo the original reordering.
Definition: sortparam.cxx:281
ScDataAreaExtras maDataAreaExtras
Definition: sortparam.hxx:161
std::vector< SCCOLROW > maOrderIndices
List of original column / row positions after reordering.
Definition: sortparam.hxx:166
ScRange maSortRange
This sort range already takes into account the presence or absence of header row / column i....
Definition: sortparam.hxx:160
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
Definition: types.hxx:23
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)
Definition: xlstyle.cxx:518