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 .
23 #include <mdds/flat_segment_tree.hpp>
24 #include <o3tl/typed_flags_set.hxx>
26 enum class ExcColRowFlags
: sal_uInt8
{
34 template<> struct typed_flags
<ExcColRowFlags
> : is_typed_flags
<ExcColRowFlags
, 0x0f> {};
38 class XclImpColRowSettings final
: protected XclImpRoot
41 explicit XclImpColRowSettings( const XclImpRoot
& rRoot
);
42 virtual ~XclImpColRowSettings() override
;
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
);
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
);
54 void SetDefaultXF( SCCOL nScCol1
, SCCOL nScCol2
, sal_uInt16 nXFIndex
);
55 /** Inserts all column and row settings of the specified sheet, except the hidden flags. */
56 void Convert( SCTAB nScTab
);
57 /** Sets the HIDDEN flags at all hidden columns and rows in the specified sheet. */
58 void ConvertHiddenFlags( SCTAB nScTab
);
61 void ApplyColFlag(SCCOL nCol
, ExcColRowFlags nNewVal
);
62 bool GetColFlag(SCCOL nCol
, ExcColRowFlags nMask
) const;
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
;
69 WidthHeightStoreType maColWidths
;
70 ColRowFlagsType maColFlags
;
71 WidthHeightStoreType maRowHeights
;
72 ColRowFlagsType maRowFlags
;
73 RowHiddenType maHiddenRows
;
77 sal_uInt16 mnDefWidth
; /// Default width from DEFCOLWIDTH or STANDARDWIDTH record.
78 sal_uInt16 mnDefHeight
; /// Default height from DEFAULTROWHEIGHT record.
79 sal_uInt16 mnDefRowFlags
; /// Default row flags from DEFAULTROWHEIGHT record.
81 bool mbHasStdWidthRec
; /// true = Width from STANDARDWIDTH (overrides DEFCOLWIDTH record).
82 bool mbHasDefHeight
; /// true = mnDefHeight and mnDefRowFlags are valid.
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */