diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-15 15:06:25 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-15 22:12:41 -0400 |
commit | 6b51a4e7a3f511fc1dce0b21fe7926d303e9afbf (patch) | |
tree | 0df13d4d20918eea498697c8750b9004b205c102 /sc | |
parent | e7c6d50cbe5f4b78294d046299c153f2e4b50498 (diff) |
Set up new container to store cell text's script type.
Change-Id: I0330dea1b2f85a8ba12cb232ab8b4263607ba225
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/column.hxx | 7 | ||||
-rw-r--r-- | sc/source/core/data/column.cxx | 1 | ||||
-rw-r--r-- | sc/source/core/data/column2.cxx | 12 |
3 files changed, 16 insertions, 4 deletions
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index dd14b6a896c4..2469a6c60a2e 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -91,12 +91,19 @@ struct ColEntry class ScColumn { typedef mdds::multi_type_vector<mdds::mtv::element_block_func> TextWidthType; + typedef mdds::multi_type_vector<mdds::mtv::element_block_func> ScriptType; // Only stores empty or unsigned short values. Empty values correspond // with empty cells. All non-empty cell positions must have unsigned short // values; either the reall text widths or TEXTWIDTH_DIRTY. TextWidthType maTextWidths; + // Empty elements represent unknown script types. For now, we store script + // type values as unsigned shorts. Once multi_type_vector supports char + // and unsigned char (due in 0.7.2), we can switch to that to save storage + // space. + ScriptType maScriptTypes; + SCCOL nCol; SCTAB nTab; diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index a53c8a8db0bc..b472e9e9b023 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -61,6 +61,7 @@ ScNeededSizeOptions::ScNeededSizeOptions() : ScColumn::ScColumn() : maTextWidths(MAXROWCOUNT), + maScriptTypes(MAXROWCOUNT), nCol( 0 ), pAttrArray( NULL ), pDocument( NULL ) diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 84cc89da90a9..2715fb9d0d1a 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -1445,18 +1445,22 @@ void ScColumn::SetTextWidth(SCROW nRow, unsigned short nWidth) sal_uInt8 ScColumn::GetScriptType( SCROW nRow ) const { - if (!ValidRow(nRow)) + if (!ValidRow(nRow) || maScriptTypes.is_empty(nRow)) return SC_SCRIPTTYPE_UNKNOWN; - return SC_SCRIPTTYPE_UNKNOWN; + return maScriptTypes.get<unsigned short>(nRow); } -void ScColumn::SetScriptType( SCROW nRow, sal_uInt8 /*nType*/ ) +void ScColumn::SetScriptType( SCROW nRow, sal_uInt8 nType ) { if (!ValidRow(nRow)) return; - // TODO: Implement this. + if (nType == SC_SCRIPTTYPE_UNKNOWN) + // empty element represents unknown script type. + maScriptTypes.set_empty(nRow, nRow); + else + maScriptTypes.set<unsigned short>(nRow, nType); } void ScColumn::FindDataAreaPos(SCROW& rRow, bool bDown) const |