LibreOffice Module sc (master)
1
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
sc
inc
markarr.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 "
address.hxx
"
23
#include <
tools/long.hxx
>
24
#include <vector>
25
26
class
ScRangeList
;
27
struct
ScSheetLimits
;
28
29
struct
ScMarkEntry
30
{
31
SCROW
nRow
: 30;
// 30 because 31 causes compiler problems with VisualStudio
32
bool
bMarked
: 1;
33
34
bool
operator==
(
const
ScMarkEntry
& rOther)
const
35
{
return
nRow
== rOther.
nRow
&&
bMarked
== rOther.
bMarked
; }
36
};
37
43
class
SC_DLLPUBLIC
ScMarkArray
44
{
45
const
ScSheetLimits
&
mrSheetLimits
;
46
std::vector<ScMarkEntry>
mvData
;
47
48
friend
class
ScMarkArrayIter
;
49
friend
class
ScDocument
;
// for FillInfo
50
51
public
:
52
ScMarkArray
(
const
ScSheetLimits
& rLimits );
53
ScMarkArray
(
ScMarkArray
&& rArray ) noexcept;
54
ScMarkArray
( const
ScMarkArray
& rArray );
55
void
Reset(
bool
bMarked = false,
SCSIZE
nNeeded = 1 );
56
bool
GetMark(
SCROW
nRow ) const;
57
void
SetMarkArea(
SCROW
nStartRow,
SCROW
nEndRow,
bool
bMarked );
58
void
Set(
std
::vector<
ScMarkEntry
> && );
59
bool
IsAllMarked(
SCROW
nStartRow,
SCROW
nEndRow ) const;
60
bool
HasOneMark(
SCROW
& rStartRow,
SCROW
& rEndRow ) const;
61
62
bool
HasMarks()
const
{
return
mvData.size() > 1 || ( mvData.size() == 1 && mvData[0].bMarked ); }
63
64
ScMarkArray
& operator=(
ScMarkArray
const
& rSource );
65
ScMarkArray
& operator=(
ScMarkArray
&& rSource) noexcept;
66
bool
operator==(
ScMarkArray
const & rOther ) const;
67
68
bool
Search(
SCROW
nRow,
SCSIZE
& nIndex ) const;
69
71
SCROW
GetNextMarked(
SCROW
nRow,
bool
bUp ) const;
72
SCROW
GetMarkEnd(
SCROW
nRow,
bool
bUp ) const;
73
74
void
Shift(
SCROW
nStartRow,
tools
::
Long
nOffset );
75
void
Intersect( const
ScMarkArray
& rOther );
76
};
77
78
class
SC_DLLPUBLIC
ScMarkArrayIter
// iterate over selected range
79
{
80
const
ScMarkArray
*
pArray
;
81
SCSIZE
nPos
;
82
public
:
83
ScMarkArrayIter(
const
ScMarkArray
* pNewArray );
84
85
bool
Next
(
SCROW
& rTop,
SCROW
& rBottom );
86
void
reset(
const
ScMarkArray
* pNewArray );
87
};
88
89
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScMarkArray::mvData
std::vector< ScMarkEntry > mvData
Definition:
markarr.hxx:46
Long
long Long
ScSheetLimits
Definition:
sheetlimits.hxx:27
std
ScMarkEntry::nRow
SCROW nRow
Definition:
markarr.hxx:31
SwRemoveResult::Next
SCSIZE
size_t SCSIZE
size_t typedef to be able to find places where code was changed from USHORT to size_t and is used to ...
Definition:
address.hxx:44
ScMarkArray
This is a rather odd datastructure.
Definition:
markarr.hxx:43
ScRangeList
Definition:
rangelst.hxx:31
ScMarkEntry
Definition:
markarr.hxx:29
address.hxx
tools
ScMarkEntry::bMarked
bool bMarked
Definition:
markarr.hxx:32
ScMarkEntry::operator==
bool operator==(const ScMarkEntry &rOther) const
Definition:
markarr.hxx:34
long.hxx
ScMarkArrayIter::pArray
const ScMarkArray * pArray
Definition:
markarr.hxx:80
SCROW
sal_Int32 SCROW
Definition:
types.hxx:17
ScMarkArrayIter::nPos
SCSIZE nPos
Definition:
markarr.hxx:81
ScMarkArrayIter
Definition:
markarr.hxx:78
ScDocument
Definition:
document.hxx:321
SC_DLLPUBLIC
#define SC_DLLPUBLIC
Definition:
scdllapi.h:27
ScMarkArray::mrSheetLimits
const ScSheetLimits & mrSheetLimits
Definition:
markarr.hxx:45
Generated on Tue Jun 21 2022 19:45:35 for LibreOffice Module sc (master) by
1.8.10