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/.
10 #ifndef INCLUDED_SC_INC_CELLVALUES_HXX
11 #define INCLUDED_SC_INC_CELLVALUES_HXX
13 #include "address.hxx"
27 struct CellValuesImpl
;
34 CellValueSpan( SCROW nRow1
, SCROW nRow2
);
38 * Think of this as a mini-ScColumn like storage that only stores cell
43 std::unique_ptr
<CellValuesImpl
> mpImpl
;
45 CellValues( const CellValues
& ) = delete;
46 CellValues
& operator= ( const CellValues
& ) = delete;
53 * Transfer values from specified column. The transferred segment in the
54 * source column becomes empty after this call.
56 * @param rCol source column to transfer values from.
57 * @param nRow top row position in the source column.
58 * @param nLen length of the segment to transfer.
60 void transferFrom( ScColumn
& rCol
, SCROW nRow
, size_t nLen
);
62 void copyTo( ScColumn
& rCol
, SCROW nRow
) const;
63 void swapNonEmpty( ScColumn
& rCol
);
65 void assign( const std::vector
<double>& rVals
);
69 void reset( size_t nSize
);
70 void setValue( size_t nRow
, double fVal
);
71 void setValue( size_t nRow
, const svl::SharedString
& rStr
);
73 void swap( CellValues
& r
);
75 std::vector
<CellValueSpan
> getNonEmptySpans() const;
78 void copyCellsTo( ScColumn
& rCol
, SCROW nRow
) const;
79 void copyCellTextAttrsTo( ScColumn
& rCol
, SCROW nRow
) const;
83 * Stores cell values for multiple tables.
89 std::unique_ptr
<Impl
> mpImpl
;
91 TableValues( const TableValues
& ) = delete;
92 TableValues
& operator= ( const TableValues
& ) = delete;
97 TableValues( const ScRange
& rRange
);
100 const ScRange
& getRange() const;
103 * Swap the entire column.
105 void swap( SCTAB nTab
, SCCOL nCol
, CellValues
& rColValue
);
108 * Swap non-empty blocks with the column storage.
110 void swapNonEmpty( SCTAB nTab
, SCCOL nCol
, ScColumn
& rCol
);
112 std::vector
<CellValueSpan
> getNonEmptySpans( SCTAB nTab
, SCCOL nCol
) const;
114 void swap( TableValues
& rOther
);
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */