summaryrefslogtreecommitdiffstats
path: root/sc/inc/cellvalues.hxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-09-16 19:50:19 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-10-02 21:32:24 -0400
commitdd617c0bbe4906e8d6e589289f42415738f00006 (patch)
tree86bb5f56e14cd30a947366ff504c2389b2a8ef47 /sc/inc/cellvalues.hxx
parentUpdate mdds to 0.11.1. (diff)
downloadcore-dd617c0bbe4906e8d6e589289f42415738f00006.tar.gz
core-dd617c0bbe4906e8d6e589289f42415738f00006.zip
New feature to allow converting formula cells to static values.
You used to have to convert formula cells to static values by copying them and pasting them as values onto the original place. Why not just allow converting them in place? This is something I've always wanted to implement.
Diffstat (limited to 'sc/inc/cellvalues.hxx')
-rw-r--r--sc/inc/cellvalues.hxx60
1 files changed, 60 insertions, 0 deletions
diff --git a/sc/inc/cellvalues.hxx b/sc/inc/cellvalues.hxx
index 4f4c50fab4fd..b545fcdd9115 100644
--- a/sc/inc/cellvalues.hxx
+++ b/sc/inc/cellvalues.hxx
@@ -11,13 +11,29 @@
#define INCLUDED_SC_INC_CELLVALUES_HXX
#include "address.hxx"
+#include <global.hxx>
class ScColumn;
+namespace svl {
+
+class SharedString;
+
+}
+
namespace sc {
struct CellValuesImpl;
+struct CellValueSpan
+{
+ SCROW mnRow1;
+ SCROW mnRow2;
+ CellType meType;
+
+ CellValueSpan( SCROW nRow1, SCROW nRow2, CellType eType );
+};
+
/**
* Think of this as a mini-ScColumn like storage that only stores cell
* values in a column.
@@ -45,16 +61,60 @@ public:
void transferTo( ScColumn& rCol, SCROW nRow );
void copyTo( ScColumn& rCol, SCROW nRow ) const;
+ void swapNonEmpty( ScColumn& rCol );
void assign( const std::vector<double>& rVals );
size_t size() const;
+ void reset( size_t nSize );
+ void setValue( size_t nRow, double fVal );
+ void setValue( size_t nRow, const svl::SharedString& rStr );
+
+ void swap( CellValues& r );
+
+ std::vector<CellValueSpan> getNonEmptySpans() const;
+
private:
void copyCellsTo( ScColumn& rCol, SCROW nRow ) const;
void copyCellTextAttrsTo( ScColumn& rCol, SCROW nRow ) const;
};
+/**
+ * Stores cell values for multiple tables.
+ */
+class TableValues
+{
+ struct Impl;
+
+ Impl* mpImpl;
+
+ TableValues( const TableValues& ); // disabled
+ TableValues& operator= ( const TableValues& ); // disabled
+
+public:
+
+ TableValues();
+ TableValues( const ScRange& rRange );
+ ~TableValues();
+
+ const ScRange& getRange() const;
+
+ /**
+ * Swap the entire column.
+ */
+ void swap( SCTAB nTab, SCCOL nCol, CellValues& rColValue );
+
+ /**
+ * Swap non-empty blocks with the column storage.
+ */
+ void swapNonEmpty( SCTAB nTab, SCCOL nCol, ScColumn& rCol );
+
+ std::vector<CellValueSpan> getNonEmptySpans( SCTAB nTab, SCCOL nCol ) const;
+
+ void swap( TableValues& rOther );
+};
+
}
#endif