Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / source / filter / inc / colrowst.hxx
blob8a8219896b37ae3b9d86fbba47343c6aadd13f1f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #ifndef SC_COLROWST_HXX
21 #define SC_COLROWST_HXX
23 #include "xiroot.hxx"
24 #include <mdds/flat_segment_tree.hpp>
26 // ============================================================================
28 class XclImpColRowSettings : protected XclImpRoot
30 public:
31 explicit XclImpColRowSettings( const XclImpRoot& rRoot );
32 virtual ~XclImpColRowSettings();
34 void SetDefWidth( sal_uInt16 nDefWidth, bool bStdWidthRec = false );
35 void SetWidthRange( SCCOL nCol1, SCCOL nCol2, sal_uInt16 nWidth );
36 void HideCol( SCCOL nCol );
37 void HideColRange( SCCOL nCol1, SCCOL nCol2 );
39 void SetDefHeight( sal_uInt16 nDefHeight, sal_uInt16 nFlags );
40 void SetHeight( SCROW nRow, sal_uInt16 nHeight );
41 void SetRowSettings( SCROW nRow, sal_uInt16 nHeight, sal_uInt16 nFlags );
42 void SetManualRowHeight( SCROW nScRow );
44 void SetDefaultXF( SCCOL nScCol1, SCCOL nScCol2, sal_uInt16 nXFIndex );
45 /** Inserts all column and row settings of the specified sheet, except the hidden flags. */
46 void Convert( SCTAB nScTab );
47 /** Sets the HIDDEN flags at all hidden columns and rows in the specified sheet. */
48 void ConvertHiddenFlags( SCTAB nScTab );
50 private:
51 void ApplyColFlag(SCCOL nCol, sal_uInt8 nNewVal);
52 bool GetColFlag(SCCOL nCol, sal_uInt8 nMask) const;
54 private:
55 typedef ::mdds::flat_segment_tree<SCROW, sal_uInt16> WidthHeightStoreType;
56 typedef ::mdds::flat_segment_tree<SCROW, sal_uInt8> ColRowFlagsType;
57 typedef ::mdds::flat_segment_tree<SCROW, bool> RowHiddenType;
59 WidthHeightStoreType maColWidths;
60 ColRowFlagsType maColFlags;
61 WidthHeightStoreType maRowHeights;
62 ColRowFlagsType maRowFlags;
63 RowHiddenType maHiddenRows;
65 SCROW mnLastScRow;
67 sal_uInt16 mnDefWidth; /// Default width from DEFCOLWIDTH or STANDARDWIDTH record.
68 sal_uInt16 mnDefHeight; /// Default height from DEFAULTROWHEIGHT record.
69 sal_uInt16 mnDefRowFlags; /// Default row flags from DEFAULTROWHEIGHT record.
71 bool mbHasStdWidthRec; /// true = Width from STANDARDWIDTH (overrides DEFCOLWIDTH record).
72 bool mbHasDefHeight; /// true = mnDefHeight and mnDefRowFlags are valid.
73 bool mbDirty;
79 #endif
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */