LibreOffice Module sc (master)
1
sc
inc
markmulti.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
#include "
segmenttree.hxx
"
23
#include "
markarr.hxx
"
24
25
#include <vector>
26
27
class
ScRangeList
;
28
struct
ScSheetLimits
;
29
30
class
SC_DLLPUBLIC
ScMultiSel
31
{
32
33
private
:
34
std::vector<ScMarkArray>
aMultiSelContainer
;
35
ScMarkArray
aRowSel
;
36
const
ScSheetLimits
&
mrSheetLimits
;
37
38
friend
class
ScMultiSelIter
;
39
40
public
:
41
ScMultiSel
(
ScSheetLimits
const
&);
42
ScMultiSel
(
const
ScMultiSel
& rMultiSel) =
default
;
43
ScMultiSel
(
ScMultiSel
&& rMultiSel) =
default
;
44
45
ScMultiSel
& operator=(
const
ScMultiSel
& rMultiSel);
46
ScMultiSel
& operator=(
ScMultiSel
&& rMultiSel);
47
48
SCCOL
GetMultiSelectionCount()
const
;
49
bool
HasMarks(
SCCOL
nCol )
const
;
50
bool
HasOneMark(
SCCOL
nCol,
SCROW
& rStartRow,
SCROW
& rEndRow )
const
;
51
bool
GetMark(
SCCOL
nCol,
SCROW
nRow )
const
;
52
bool
IsAllMarked(
SCCOL
nCol,
SCROW
nStartRow,
SCROW
nEndRow )
const
;
53
bool
HasEqualRowsMarked(
SCCOL
nCol1,
SCCOL
nCol2 )
const
;
54
SCROW
GetNextMarked(
SCCOL
nCol,
SCROW
nRow,
bool
bUp )
const
;
55
// Returns the first column of the range [column,nLastCol] for which
56
// all those columns have equal marks. Value returned is not less than nMinCol.
57
SCCOL
GetStartOfEqualColumns(
SCCOL
nLastCol,
SCCOL
nMinCol = 0 )
const
;
58
void
SetMarkArea(
SCCOL
nStartCol,
SCCOL
nEndCol,
SCROW
nStartRow,
SCROW
nEndRow,
bool
bMark );
59
void
Set
(
ScRangeList
const
& );
60
bool
IsRowMarked(
SCROW
nRow )
const
;
61
bool
IsRowRangeMarked(
SCROW
nStartRow,
SCROW
nEndRow )
const
;
62
bool
IsEmpty
()
const
{
return
( aMultiSelContainer.empty() && !aRowSel.
HasMarks
() ); }
63
ScMarkArray
GetMarkArray(
SCCOL
nCol )
const
;
64
void
Clear
();
65
void
MarkAllCols(
SCROW
nStartRow,
SCROW
nEndRow );
66
bool
HasAnyMarks()
const
;
67
void
ShiftCols(
SCCOL
nStartCol, sal_Int32 nColOffset);
68
void
ShiftRows(
SCROW
nStartRow, sal_Int32 nRowOffset);
69
70
// For faster access from within ScMarkData, instead of creating
71
// ScMultiSelIter with ScFlatBoolRowSegments bottleneck.
72
const
ScMarkArray
&
GetRowSelArray
()
const
{
return
aRowSel; }
73
const
ScMarkArray
* GetMultiSelArray(
SCCOL
nCol )
const
;
74
};
75
76
class
ScMultiSelIter
77
{
78
79
private
:
80
std::unique_ptr<ScFlatBoolRowSegments>
pRowSegs
;
81
ScMarkArrayIter
aMarkArrayIter
;
82
SCROW
nNextSegmentStart
;
83
public
:
84
ScMultiSelIter
(
const
ScMultiSel
& rMultiSel,
SCCOL
nCol );
85
86
bool
Next
(
SCROW
& rTop,
SCROW
& rBottom );
89
bool
GetRangeData
(
SCROW
nRow,
ScFlatBoolRowSegments::RangeData
& rRowRange )
const
;
90
};
91
92
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScMarkArrayIter
Definition:
markarr.hxx:79
ScMarkArray
This is a rather odd datastructure.
Definition:
markarr.hxx:44
ScMarkArray::HasMarks
bool HasMarks() const
Definition:
markarr.hxx:62
ScMultiSelIter
Definition:
markmulti.hxx:77
ScMultiSelIter::GetRangeData
bool GetRangeData(SCROW nRow, ScFlatBoolRowSegments::RangeData &rRowRange) const
Only to be used by ScMultiSel::IsAllMarked() or otherwise sure that a segment tree is actually used.
Definition:
markmulti.cxx:478
ScMultiSelIter::pRowSegs
std::unique_ptr< ScFlatBoolRowSegments > pRowSegs
Definition:
markmulti.hxx:80
ScMultiSelIter::aMarkArrayIter
ScMarkArrayIter aMarkArrayIter
Definition:
markmulti.hxx:81
ScMultiSelIter::Next
bool Next(SCROW &rTop, SCROW &rBottom)
Definition:
markmulti.cxx:455
ScMultiSelIter::ScMultiSelIter
ScMultiSelIter(const ScMultiSel &rMultiSel, SCCOL nCol)
Definition:
markmulti.cxx:419
ScMultiSelIter::nNextSegmentStart
SCROW nNextSegmentStart
Definition:
markmulti.hxx:82
ScMultiSel
Definition:
markmulti.hxx:31
ScMultiSel::mrSheetLimits
const ScSheetLimits & mrSheetLimits
Definition:
markmulti.hxx:36
ScMultiSel::GetRowSelArray
const ScMarkArray & GetRowSelArray() const
Definition:
markmulti.hxx:72
ScMultiSel::ScMultiSel
ScMultiSel(const ScMultiSel &rMultiSel)=default
ScMultiSel::aMultiSelContainer
std::vector< ScMarkArray > aMultiSelContainer
Definition:
markmulti.hxx:34
ScMultiSel::aRowSel
ScMarkArray aRowSel
Definition:
markmulti.hxx:35
ScMultiSel::ScMultiSel
ScMultiSel(ScMultiSel &&rMultiSel)=default
ScMultiSel::IsEmpty
bool IsEmpty() const
Definition:
markmulti.hxx:62
ScRangeList
Definition:
rangelst.hxx:32
SwFieldTypesEnum::Set
@ Set
markarr.hxx
Clear
void Clear(EHistoryType eHistory)
SC_DLLPUBLIC
#define SC_DLLPUBLIC
Definition:
scdllapi.h:27
segmenttree.hxx
ScFlatBoolRowSegments::RangeData
Definition:
segmenttree.hxx:33
ScSheetLimits
Definition:
sheetlimits.hxx:28
SCCOL
sal_Int16 SCCOL
Definition:
types.hxx:21
SCROW
sal_Int32 SCROW
Definition:
types.hxx:17
Generated on Sun Jul 30 2023 04:27:46 for LibreOffice Module sc (master) by
1.9.3