diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-05-02 20:38:06 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-05-09 13:34:30 -0400 |
commit | 794d35975a35cab2ca992c45820e771481294581 (patch) | |
tree | a9e69e0765641d6460f908dcc183f2c7c810cbe4 /sc | |
parent | 8d8f9dd80abf4e1eb08eee9763ea38f2b15f02b8 (diff) |
Switch script type storage from unsigned short to unsigned char.
This will save quite a bit of storage. It requires the next version
of mdds (probably will be 0.8.0).
Change-Id: I11e972c043ad58e8b76e241d3312b5a1de952cf7
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/column.cxx | 8 | ||||
-rw-r--r-- | sc/source/core/data/column2.cxx | 14 | ||||
-rw-r--r-- | sc/source/core/data/column3.cxx | 4 |
3 files changed, 13 insertions, 13 deletions
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 2933e9fbef88..be9e5d6ef219 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -75,13 +75,13 @@ ScNeededSizeOptions::ScNeededSizeOptions() : void ScColumn::SwapScriptTypes( ScriptType& rSrc, SCROW nSrcRow, ScriptType& rDest, SCROW nDestRow ) { - unsigned short nSrcVal = 0; - unsigned short nDestVal = 0; + unsigned char nSrcVal = 0; + unsigned char nDestVal = 0; if (!rSrc.is_empty(nSrcRow)) - nSrcVal = rSrc.get<unsigned short>(nSrcRow); + nSrcVal = rSrc.get<unsigned char>(nSrcRow); if (!rDest.is_empty(nDestRow)) - nDestVal = rDest.get<unsigned short>(nDestRow); + nDestVal = rDest.get<unsigned char>(nDestRow); if (nDestVal) rSrc.set(nSrcRow, nDestVal); diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index c93e043550a4..bad84e9e5469 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -1469,7 +1469,7 @@ void ScColumn::CopyScriptTypesToDocument(SCROW nRow1, SCROW nRow2, ScColumn& rDe nRowPos = static_cast<size_t>(nRow2); // End row position. // Keep copying until we hit the end row position. - mdds::mtv::ushort_element_block::const_iterator itData, itDataEnd; + mdds::mtv::uchar_element_block::const_iterator itData, itDataEnd; for (; itBlk != itBlkEnd; ++itBlk, nBlockStart = nBlockEnd, nOffsetInBlock = 0) { nBlockEnd = nBlockStart + itBlk->size; @@ -1486,15 +1486,15 @@ void ScColumn::CopyScriptTypesToDocument(SCROW nRow1, SCROW nRow2, ScColumn& rDe } // Non-empty block. - itData = mdds::mtv::ushort_element_block::begin(*itBlk->data); - itDataEnd = mdds::mtv::ushort_element_block::end(*itBlk->data); + itData = mdds::mtv::uchar_element_block::begin(*itBlk->data); + itDataEnd = mdds::mtv::uchar_element_block::end(*itBlk->data); std::advance(itData, nOffsetInBlock); if (nBlockStart <= nRowPos && nRowPos <= nBlockEnd) { // This block contains the end row. Only copy partially. size_t nOffset = nRowPos - nBlockStart + 1; - itDataEnd = mdds::mtv::ushort_element_block::begin(*itBlk->data); + itDataEnd = mdds::mtv::uchar_element_block::begin(*itBlk->data); std::advance(itDataEnd, nOffset); rDestCol.maScriptTypes.set(nBlockStart + nOffsetInBlock, itData, itDataEnd); @@ -1545,7 +1545,7 @@ void ScColumn::SetCell(SCROW nRow, ScBaseCell* pNewCell) } maTextWidths.set<unsigned short>(nRow, TEXTWIDTH_DIRTY); - maScriptTypes.set<unsigned short>(nRow, SC_SCRIPTTYPE_UNKNOWN); + maScriptTypes.set<unsigned char>(nRow, SC_SCRIPTTYPE_UNKNOWN); CellStorageModified(); } } @@ -1565,7 +1565,7 @@ sal_uInt8 ScColumn::GetScriptType( SCROW nRow ) const if (!ValidRow(nRow) || maScriptTypes.is_empty(nRow)) return 0; - return maScriptTypes.get<unsigned short>(nRow); + return maScriptTypes.get<unsigned char>(nRow); } void ScColumn::SetScriptType( SCROW nRow, sal_uInt8 nType ) @@ -1576,7 +1576,7 @@ void ScColumn::SetScriptType( SCROW nRow, sal_uInt8 nType ) if (!nType) maScriptTypes.set_empty(nRow, nRow); else - maScriptTypes.set<unsigned short>(nRow, nType); + maScriptTypes.set<unsigned char>(nRow, nType); } size_t ScColumn::GetFormulaHash( SCROW nRow ) const diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 63b3a5ff7b55..233433032c4f 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -104,7 +104,7 @@ void ScColumn::Append( SCROW nRow, ScBaseCell* pCell ) maItems.back().nRow = nRow; maTextWidths.set<unsigned short>(nRow, TEXTWIDTH_DIRTY); - maScriptTypes.set<unsigned short>(nRow, SC_SCRIPTTYPE_UNKNOWN); + maScriptTypes.set<unsigned char>(nRow, SC_SCRIPTTYPE_UNKNOWN); CellStorageModified(); } @@ -1415,7 +1415,7 @@ bool ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, pOldCell->Delete(); maItems[i].pCell = pNewCell; // Replace maTextWidths.set<unsigned short>(nRow, TEXTWIDTH_DIRTY); - maScriptTypes.set<unsigned short>(nRow, SC_SCRIPTTYPE_UNKNOWN); + maScriptTypes.set<unsigned char>(nRow, SC_SCRIPTTYPE_UNKNOWN); CellStorageModified(); if ( pNewCell->GetCellType() == CELLTYPE_FORMULA ) |