diff options
author | Andrzej Hunt <andrzej@ahunt.org> | 2015-05-11 15:13:16 +0100 |
---|---|---|
committer | Andrzej Hunt <andrzej@ahunt.org> | 2015-10-20 18:18:32 +0200 |
commit | 045c51150f1c719a39089f7b7684261985fea96b (patch) | |
tree | 4ccc5da74050772f4dac1b2b5904f12a3cfbd087 /sc/inc/units.hxx | |
parent | Use the actual default format for value/unit splitting. (diff) | |
download | core-045c51150f1c719a39089f7b7684261985fea96b.tar.gz core-045c51150f1c719a39089f7b7684261985fea96b.zip |
Implement unit conversion for ranges.
Not entirely finished yet, some further refactoring needed elsewhere
to allow sensible implementation of the header editing.
Change-Id: I81af74d698098f901b17fcda413e7aac04c94274
Diffstat (limited to 'sc/inc/units.hxx')
-rw-r--r-- | sc/inc/units.hxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sc/inc/units.hxx b/sc/inc/units.hxx index 9837d3664c20..381ec7dc08e1 100644 --- a/sc/inc/units.hxx +++ b/sc/inc/units.hxx @@ -16,6 +16,7 @@ class ScAddress; class ScDocument; +class ScRange; class ScTokenArray; namespace sc { @@ -75,6 +76,27 @@ public: const OUString& rsNewUnit, const OUString& rsOldUnit) = 0; + /** + * Convert cells from one unit to another. + * + * If possible the input unit will be determined automatically (using local + * and header units). + * + * Returns false if input units are not compatible with the desired output units, + * (including the case where some of the input units are compatibles but others + * aren't). + * + * Local and header unit annotations are modified as appropriate such that the output + * remains unambiguous. Hence, if the header cell is included in rRange, its unit + * annotation is also updated as appropriate. If instead the header is excluded, + * but all other cells are selected in a column, then local annotations are added. + * + * rsInputUnit overrides the automatic determination of input units, i.e. disables + * input unit detection. + */ + virtual bool convertCellUnits(const ScRange& rRange, + ScDocument* pDoc, + const OUString& rsOutputUnit) = 0; virtual ~Units() {} }; |