diff options
author | Mohammed Abdul Azeem <azeemmysore@gmail.com> | 2016-02-09 03:54:15 +0530 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-02-17 08:41:12 +0000 |
commit | 2c02986b76f26d6f09d5b1f9d209879bfa427ea1 (patch) | |
tree | 60cb199d609d1b8f5f36ddfdefcc25bdd1065556 /sc/source/filter/oox/formulabuffer.cxx | |
parent | e327587699ed9e071da68bf7b2a3eb62c34af135 (diff) |
tdf#97654 - replaced UNO cell types in xlsx import with calc internal ones
All reference to CellAddress in ApiCellRangeList::getBaseAddress() is changed to ScAddress and its chain of changes has been made.
Change-Id: I43d9eb8dc02c74640d9fac11a44429850f31ade1
Reviewed-on: https://gerrit.libreoffice.org/22222
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc/source/filter/oox/formulabuffer.cxx')
-rw-r--r-- | sc/source/filter/oox/formulabuffer.cxx | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx index ba14600def57..9f957dab0fa3 100644 --- a/sc/source/filter/oox/formulabuffer.cxx +++ b/sc/source/filter/oox/formulabuffer.cxx @@ -344,11 +344,21 @@ FormulaBuffer::SharedFormulaEntry::SharedFormulaEntry( const OUString& rTokenStr, sal_Int32 nSharedId ) : maAddress(rAddr), maTokenStr(rTokenStr), mnSharedId(nSharedId) {} +FormulaBuffer::SharedFormulaEntry::SharedFormulaEntry( + const ScAddress& rAddr, + const OUString& rTokenStr, sal_Int32 nSharedId ) : + maAddress( CellAddress( rAddr.Tab(), rAddr.Col(), rAddr.Row() ) ), maTokenStr(rTokenStr), mnSharedId(nSharedId) {} + FormulaBuffer::SharedFormulaDesc::SharedFormulaDesc( const css::table::CellAddress& rAddr, sal_Int32 nSharedId, const OUString& rCellValue, sal_Int32 nValueType ) : maAddress(rAddr), mnSharedId(nSharedId), maCellValue(rCellValue), mnValueType(nValueType) {} +FormulaBuffer::SharedFormulaDesc::SharedFormulaDesc( + const ScAddress& rAddr, sal_Int32 nSharedId, + const OUString& rCellValue, sal_Int32 nValueType ) : + maAddress( CellAddress( rAddr.Tab(), rAddr.Col(), rAddr.Row() ) ), mnSharedId(nSharedId), maCellValue(rCellValue), mnValueType(nValueType) {} + FormulaBuffer::SheetItem::SheetItem() : mpCellFormulas(nullptr), mpArrayFormulas(nullptr), @@ -466,12 +476,28 @@ void FormulaBuffer::createSharedFormulaMapEntry( rSharedFormulas.push_back( aEntry ); } +void FormulaBuffer::createSharedFormulaMapEntry( + const ScAddress& rAddress, + sal_Int32 nSharedId, const OUString& rTokens ) +{ + assert( rAddress.Tab() >= 0 && (size_t)rAddress.Tab() < maSharedFormulas.size() ); + std::vector<SharedFormulaEntry>& rSharedFormulas = maSharedFormulas[ rAddress.Tab() ]; + SharedFormulaEntry aEntry(rAddress, rTokens, nSharedId); + rSharedFormulas.push_back( aEntry ); +} + void FormulaBuffer::setCellFormula( const css::table::CellAddress& rAddress, const OUString& rTokenStr ) { assert( rAddress.Sheet >= 0 && (size_t)rAddress.Sheet < maCellFormulas.size() ); maCellFormulas[ rAddress.Sheet ].push_back( TokenAddressItem( rTokenStr, rAddress ) ); } +void FormulaBuffer::setCellFormula( const ScAddress& rAddress, const OUString& rTokenStr ) +{ + assert( rAddress.Tab() >= 0 && (size_t)rAddress.Tab() < maCellFormulas.size() ); + maCellFormulas[ rAddress.Tab() ].push_back( TokenAddressItem( rTokenStr, rAddress ) ); +} + void FormulaBuffer::setCellFormula( const table::CellAddress& rAddress, sal_Int32 nSharedId, const OUString& rCellValue, sal_Int32 nValueType ) { @@ -480,6 +506,14 @@ void FormulaBuffer::setCellFormula( SharedFormulaDesc(rAddress, nSharedId, rCellValue, nValueType)); } +void FormulaBuffer::setCellFormula( + const ScAddress& rAddress, sal_Int32 nSharedId, const OUString& rCellValue, sal_Int32 nValueType ) +{ + assert( rAddress.Tab() >= 0 && (size_t)rAddress.Tab() < maSharedFormulaIds.size() ); + maSharedFormulaIds[rAddress.Tab()].push_back( + SharedFormulaDesc(rAddress, nSharedId, rCellValue, nValueType)); +} + void FormulaBuffer::setCellArrayFormula( const css::table::CellRangeAddress& rRangeAddress, const css::table::CellAddress& rTokenAddress, const OUString& rTokenStr ) { @@ -499,6 +533,17 @@ void FormulaBuffer::setCellFormulaValue( maCellFormulaValues[rAddress.Sheet].push_back(aVal); } +void FormulaBuffer::setCellFormulaValue( + const ScAddress& rAddress, const OUString& rValueStr, sal_Int32 nCellType ) +{ + assert( rAddress.Tab() >= 0 && (size_t)rAddress.Tab() < maCellFormulaValues.size() ); + FormulaValue aVal; + aVal.maCellAddress = CellAddress( rAddress.Tab(), rAddress.Col(), rAddress.Row() ); + aVal.maValueStr = rValueStr; + aVal.mnCellType = nCellType; + maCellFormulaValues[rAddress.Tab()].push_back(aVal); +} + }} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |