LibreOffice Module sc (master) 1
colrowst.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 "xiroot.hxx"
23#include <mdds/flat_segment_tree.hpp>
25
27 NONE = 0x00,
28 Used = 0x01,
29 Default = 0x02,
30 Hidden = 0x04,
31 Man = 0x08,
32};
33namespace o3tl {
34 template<> struct typed_flags<ExcColRowFlags> : is_typed_flags<ExcColRowFlags, 0x0f> {};
35}
36
37
38class XclImpColRowSettings final : protected XclImpRoot
39{
40public:
41 explicit XclImpColRowSettings( const XclImpRoot& rRoot );
42 virtual ~XclImpColRowSettings() override;
43
44 void SetDefWidth( sal_uInt16 nDefWidth, bool bStdWidthRec = false );
45 void SetWidthRange( SCCOL nCol1, SCCOL nCol2, sal_uInt16 nWidth );
46 void HideCol( SCCOL nCol );
47 void HideColRange( SCCOL nCol1, SCCOL nCol2 );
48
49 void SetDefHeight( sal_uInt16 nDefHeight, sal_uInt16 nFlags );
50 void SetHeight( SCROW nRow, sal_uInt16 nHeight );
51 void SetRowSettings( SCROW nRow, sal_uInt16 nHeight, sal_uInt16 nFlags );
52 void SetManualRowHeight( SCROW nScRow );
53
54 void SetDefaultXF( SCCOL nScCol1, SCCOL nScCol2, sal_uInt16 nXFIndex );
56 void Convert( SCTAB nScTab );
58 void ConvertHiddenFlags( SCTAB nScTab );
59
60private:
61 void ApplyColFlag(SCCOL nCol, ExcColRowFlags nNewVal);
62 bool GetColFlag(SCCOL nCol, ExcColRowFlags nMask) const;
63
64private:
65 typedef ::mdds::flat_segment_tree<SCROW, sal_uInt16> WidthHeightStoreType;
66 typedef ::mdds::flat_segment_tree<SCROW, ExcColRowFlags> ColRowFlagsType;
67 typedef ::mdds::flat_segment_tree<SCROW, bool> RowHiddenType;
68
74
76
77 sal_uInt16 mnDefWidth;
78 sal_uInt16 mnDefHeight;
79 sal_uInt16 mnDefRowFlags;
80
83 bool mbDirty;
84};
85
86/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetDefWidth(sal_uInt16 nDefWidth, bool bStdWidthRec=false)
Definition: colrowst.cxx:50
void Convert(SCTAB nScTab)
Inserts all column and row settings of the specified sheet, except the hidden flags.
Definition: colrowst.cxx:178
bool mbHasDefHeight
true = Width from STANDARDWIDTH (overrides DEFCOLWIDTH record).
Definition: colrowst.hxx:82
bool mbHasStdWidthRec
Default row flags from DEFAULTROWHEIGHT record.
Definition: colrowst.hxx:81
void SetHeight(SCROW nRow, sal_uInt16 nHeight)
Definition: colrowst.cxx:112
void SetDefaultXF(SCCOL nScCol1, SCCOL nScCol2, sal_uInt16 nXFIndex)
Definition: colrowst.cxx:166
XclImpColRowSettings(const XclImpRoot &rRoot)
Definition: colrowst.cxx:29
void HideColRange(SCCOL nCol1, SCCOL nCol2)
Definition: colrowst.cxx:91
sal_uInt16 mnDefRowFlags
Default height from DEFAULTROWHEIGHT record.
Definition: colrowst.hxx:79
sal_uInt16 mnDefHeight
Default width from DEFCOLWIDTH or STANDARDWIDTH record.
Definition: colrowst.hxx:78
sal_uInt16 mnDefWidth
Definition: colrowst.hxx:77
::mdds::flat_segment_tree< SCROW, sal_uInt16 > WidthHeightStoreType
Definition: colrowst.hxx:65
ColRowFlagsType maRowFlags
Definition: colrowst.hxx:72
void SetManualRowHeight(SCROW nScRow)
Definition: colrowst.cxx:153
WidthHeightStoreType maRowHeights
Definition: colrowst.hxx:71
void HideCol(SCCOL nCol)
Definition: colrowst.cxx:83
::mdds::flat_segment_tree< SCROW, ExcColRowFlags > ColRowFlagsType
Definition: colrowst.hxx:66
WidthHeightStoreType maColWidths
Definition: colrowst.hxx:69
ColRowFlagsType maColFlags
Definition: colrowst.hxx:70
void SetDefHeight(sal_uInt16 nDefHeight, sal_uInt16 nFlags)
Definition: colrowst.cxx:100
RowHiddenType maHiddenRows
Definition: colrowst.hxx:73
void ConvertHiddenFlags(SCTAB nScTab)
Sets the HIDDEN flags at all hidden columns and rows in the specified sheet.
Definition: colrowst.cxx:272
virtual ~XclImpColRowSettings() override
Definition: colrowst.cxx:46
bool GetColFlag(SCCOL nCol, ExcColRowFlags nMask) const
Definition: colrowst.cxx:349
void SetRowSettings(SCROW nRow, sal_uInt16 nHeight, sal_uInt16 nFlags)
Definition: colrowst.cxx:133
void SetWidthRange(SCCOL nCol1, SCCOL nCol2, sal_uInt16 nWidth)
Definition: colrowst.cxx:65
void ApplyColFlag(SCCOL nCol, ExcColRowFlags nNewVal)
Definition: colrowst.cxx:334
bool mbDirty
true = mnDefHeight and mnDefRowFlags are valid.
Definition: colrowst.hxx:83
::mdds::flat_segment_tree< SCROW, bool > RowHiddenType
Definition: colrowst.hxx:67
Access to global data from other classes.
Definition: xiroot.hxx:129
ExcColRowFlags
Definition: colrowst.hxx:26
NONE
static sal_uInt16 nDefWidth
Definition: op.cxx:50
unsigned char sal_uInt8
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17