diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-08-07 16:35:06 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-08-12 19:46:26 -0400 |
commit | e1c2403802af2f13075d612ea5ef0e91cf23c878 (patch) | |
tree | 5d34a02db0a3b6cf0e806ae65cbfda4aafb45fcb /sc | |
parent | 01bc4976a058628a40337f8041c0daedfa63da97 (diff) |
Map shared formulas to Calc's formula groups on xlsx import.
Change-Id: If8d11c5ee55afd8529070a699ca50284880ceb45
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/excel/namebuff.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/inc/formulabuffer.hxx | 43 | ||||
-rw-r--r-- | sc/source/filter/inc/workbookhelper.hxx | 2 | ||||
-rw-r--r-- | sc/source/filter/inc/worksheethelper.hxx | 13 | ||||
-rw-r--r-- | sc/source/filter/oox/formulabuffer.cxx | 235 | ||||
-rw-r--r-- | sc/source/filter/oox/sheetdatacontext.cxx | 9 | ||||
-rw-r--r-- | sc/source/filter/oox/workbookhelper.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/oox/worksheethelper.cxx | 11 |
8 files changed, 237 insertions, 80 deletions
diff --git a/sc/source/filter/excel/namebuff.cxx b/sc/source/filter/excel/namebuff.cxx index ac609a462ace..4e47c09f7346 100644 --- a/sc/source/filter/excel/namebuff.cxx +++ b/sc/source/filter/excel/namebuff.cxx @@ -89,8 +89,6 @@ void SharedFormulaBuffer::Store( const ScRange& rRange, const ScTokenArray& rArr ScFormulaCellGroupRef xNewGroup(new ScFormulaCellGroup); xNewGroup->mnStart = rRange.aStart.Row(); xNewGroup->mnLength = nGroupLen; - xNewGroup->mpCode = rArray.Clone(); - xNewGroup->mbInvariant = rArray.IsInvariant(); xNewGroup->setCode(rArray); maFormulaGroups.insert(FormulaGroupsType::value_type(aPos, xNewGroup)); } diff --git a/sc/source/filter/inc/formulabuffer.hxx b/sc/source/filter/inc/formulabuffer.hxx index 1e98060b48aa..c5d8f967c007 100644 --- a/sc/source/filter/inc/formulabuffer.hxx +++ b/sc/source/filter/inc/formulabuffer.hxx @@ -29,13 +29,35 @@ namespace oox { namespace xls { class FormulaBuffer : public WorkbookHelper { + /** + * Represents a shared formula definition. + */ struct SharedFormulaEntry { - ::com::sun::star::table::CellAddress maAddress; + com::sun::star::table::CellAddress maAddress; + com::sun::star::table::CellRangeAddress maRange; OUString maTokenStr; sal_Int32 mnSharedId; - ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaTokens > mxFormulaTokens; - SharedFormulaEntry( const ::com::sun::star::table::CellAddress& rAddress, const OUString& rTokenStr, sal_Int32 nSharedId ) : maAddress( rAddress ), maTokenStr( rTokenStr ), mnSharedId( nSharedId ) {} + + SharedFormulaEntry( + const com::sun::star::table::CellAddress& rAddress, + const com::sun::star::table::CellRangeAddress& rRange, + const OUString& rTokenStr, sal_Int32 nSharedId ); + }; + + /** + * Represents a formula cell that uses shared formula. + */ + struct SharedFormulaDesc + { + com::sun::star::table::CellAddress maAddress; + sal_Int32 mnSharedId; + OUString maCellValue; + sal_Int32 mnValueType; + + SharedFormulaDesc( + const com::sun::star::table::CellAddress& rAddr, sal_Int32 nSharedId, + const OUString& rCellValue, sal_Int32 nValueType ); }; struct TokenAddressItem @@ -54,8 +76,6 @@ class FormulaBuffer : public WorkbookHelper typedef ::std::map< sal_Int32, std::vector< TokenAddressItem > > FormulaDataMap; typedef ::std::map< sal_Int32, std::vector< TokenRangeAddressItem > > ArrayFormulaDataMap; - // shared formuala descriptions, the id and address the formula is at - typedef std::pair< ::com::sun::star::table::CellAddress, sal_Int32 > SharedFormulaDesc; // sheet -> list of shared formula descriptions typedef ::std::map< sal_Int32, std::vector< SharedFormulaDesc > > SheetToSharedFormulaid; // sheet -> stuff needed to create shared formulae @@ -66,7 +86,6 @@ class FormulaBuffer : public WorkbookHelper typedef ::std::pair< ::com::sun::star::table::CellAddress, double > ValueAddressPair; typedef ::std::map< sal_Int32, std::vector< ValueAddressPair > > FormulaValueMap; - void createSharedFormula( const ::com::sun::star::table::CellAddress& rAddress, sal_Int32 nSharedId, const OUString& rTokens ); ::com::sun::star::uno::Reference< com::sun::star::table::XCellRange > getRange( const ::com::sun::star::table::CellRangeAddress& rRange); com::sun::star::uno::Reference< com::sun::star::sheet::XSpreadsheet > mxCurrSheet; FormulaDataMap cellFormulas; @@ -80,15 +99,23 @@ class FormulaBuffer : public WorkbookHelper void applyCellFormula( ScDocument& rDoc, const ApiTokenSequence& rTokens, const ::com::sun::star::table::CellAddress& rAddress ); void applyCellFormulas( const std::vector< TokenAddressItem >& rVector ); void applyCellFormulaValues( const std::vector< ValueAddressPair >& rVector ); + void applySharedFormulas( sal_Int32 nTab ); public: explicit FormulaBuffer( const WorkbookHelper& rHelper ); void finalizeImport(); void setCellFormula( const ::com::sun::star::table::CellAddress& rAddress, const OUString& ); - void setCellFormula( const ::com::sun::star::table::CellAddress& rAddress, sal_Int32 nSharedId ); + + void setCellFormula( + const ::com::sun::star::table::CellAddress& rAddress, sal_Int32 nSharedId, + const OUString& rCellValue, sal_Int32 nValueType ); + void setCellFormulaValue( const ::com::sun::star::table::CellAddress& rAddress, double fValue ); void setCellArrayFormula( const ::com::sun::star::table::CellRangeAddress& rRangeAddress, const ::com::sun::star::table::CellAddress& rTokenAddress, const OUString& ); - void createSharedFormulaMapEntry( const ::com::sun::star::table::CellAddress& rAddress, sal_Int32 nSharedId, const OUString& rTokens ); + void createSharedFormulaMapEntry( + const com::sun::star::table::CellAddress& rAddress, + const com::sun::star::table::CellRangeAddress& rRange, + sal_Int32 nSharedId, const OUString& rTokens ); }; }} diff --git a/sc/source/filter/inc/workbookhelper.hxx b/sc/source/filter/inc/workbookhelper.hxx index f4ce1cc1e37c..e540ba0d8038 100644 --- a/sc/source/filter/inc/workbookhelper.hxx +++ b/sc/source/filter/inc/workbookhelper.hxx @@ -156,7 +156,7 @@ public: /** Returns a reference to the specified spreadsheet in the document model. */ ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet > - getSheetFromDoc( sal_Int16 nSheet ) const; + getSheetFromDoc( sal_Int32 nSheet ) const; /** Returns a reference to the specified spreadsheet in the document model. */ ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet > getSheetFromDoc( const OUString& rSheet ) const; diff --git a/sc/source/filter/inc/worksheethelper.hxx b/sc/source/filter/inc/worksheethelper.hxx index 53b7ed1084c1..270cafea9301 100644 --- a/sc/source/filter/inc/worksheethelper.hxx +++ b/sc/source/filter/inc/worksheethelper.hxx @@ -307,9 +307,18 @@ public: void finalizeDrawingImport(); void setCellFormula( const ::com::sun::star::table::CellAddress& rTokenAddress, const OUString& ); - void setCellFormula( const ::com::sun::star::table::CellAddress& rTokenAddress, sal_Int32 ); + + void setCellFormula( + const com::sun::star::table::CellAddress& rAddr, sal_Int32 nSharedId, + const OUString& rCellValue, sal_Int32 nValueType ); + void setCellArrayFormula( const ::com::sun::star::table::CellRangeAddress& rRangeAddress, const ::com::sun::star::table::CellAddress& rTokenAddress, const OUString& ); - void createSharedFormulaMapEntry( const ::com::sun::star::table::CellAddress& rAddress, sal_Int32 nSharedId, const OUString& rTokens ); + + void createSharedFormulaMapEntry( + const com::sun::star::table::CellAddress& rAddress, + const com::sun::star::table::CellRangeAddress& rRange, + sal_Int32 nSharedId, const OUString& rTokens ); + void setCellFormulaValue( const ::com::sun::star::table::CellAddress& rAddress, double fValue ); private: diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx index 3889b538fb5f..66d15ea81bd6 100644 --- a/sc/source/filter/oox/formulabuffer.cxx +++ b/sc/source/filter/oox/formulabuffer.cxx @@ -22,15 +22,26 @@ #include "autonamecache.hxx" #include "tokenuno.hxx" #include "tokenarray.hxx" +#include "oox/token/tokens.hxx" -namespace oox { -namespace xls { - +using namespace com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::table; using namespace ::com::sun::star::sheet; using namespace ::com::sun::star::container; +namespace oox { namespace xls { + +FormulaBuffer::FormulaBuffer::SharedFormulaEntry::SharedFormulaEntry( + const table::CellAddress& rAddr, const table::CellRangeAddress& rRange, + const OUString& rTokenStr, sal_Int32 nSharedId ) : + maAddress(rAddr), maRange(rRange), maTokenStr(rTokenStr), mnSharedId(nSharedId) {} + +FormulaBuffer::FormulaBuffer::SharedFormulaDesc::SharedFormulaDesc( + const com::sun::star::table::CellAddress& rAddr, sal_Int32 nSharedId, + const OUString& rCellValue, sal_Int32 nValueType ) : + maAddress(rAddr), mnSharedId(nSharedId), maCellValue(rCellValue), mnValueType(nValueType) {} + FormulaBuffer::FormulaBuffer( const WorkbookHelper& rHelper ) : WorkbookHelper( rHelper ) { } @@ -55,43 +66,13 @@ void FormulaBuffer::finalizeImport() ScDocument& rDoc = getScDocument(); Reference< XIndexAccess > xSheets( getDocument()->getSheets(), UNO_QUERY_THROW ); rDoc.SetAutoNameCache( new ScAutoNameCache( &rDoc ) ); - for ( sal_Int16 nTab = 0, nElem = xSheets->getCount(); nTab < nElem; ++nTab ) + for ( sal_Int32 nTab = 0, nElem = xSheets->getCount(); nTab < nElem; ++nTab ) { double fPosition = static_cast< double> (nTab + 1) /static_cast<double>(nElem); xFormulaBar->setPosition( fPosition ); mxCurrSheet = getSheetFromDoc( nTab ); - // process shared Formula - SheetToFormulaEntryMap::iterator sharedIt = sharedFormulas.find( nTab ); - if ( sharedIt != sharedFormulas.end() ) - { - // shared id ( to create the special shared names from ) - std::vector<SharedFormulaEntry>& rSharedFormulas = sharedIt->second; - for ( std::vector<SharedFormulaEntry>::iterator it = rSharedFormulas.begin(), it_end = rSharedFormulas.end(); it != it_end; ++it ) - { - createSharedFormula( it->maAddress, it->mnSharedId, it->maTokenStr ); - } - } - // now process any defined shared formulae - SheetToSharedFormulaid::iterator formulDescIt = sharedFormulaIds.find( nTab ); - SheetToSharedIdToTokenIndex::iterator tokensIt = tokenIndexes.find( nTab ); - if ( formulDescIt != sharedFormulaIds.end() && tokensIt != tokenIndexes.end() ) - { - SharedIdToTokenIndex& rTokenIdMap = tokensIt->second; - std::vector< SharedFormulaDesc >& rVector = formulDescIt->second; - for ( std::vector< SharedFormulaDesc >::iterator it = rVector.begin(), it_end = rVector.end(); it != it_end; ++it ) - { - // see if we have a - // resolved tokenId - CellAddress& rAddress = it->first; - sal_Int32& rnSharedId = it->second; - SharedIdToTokenIndex::iterator itTokenId = rTokenIdMap.find( rnSharedId ); - if ( itTokenId != rTokenIdMap.end() ) - { - ApiTokenSequence aTokens = getFormulaParser().convertNameToFormula( itTokenId->second ); - applyCellFormula( rDoc, aTokens, rAddress ); - } - } - } + + applySharedFormulas(nTab); FormulaDataMap::iterator cellIt = cellFormulas.find( nTab ); if ( cellIt != cellFormulas.end() ) @@ -155,6 +136,157 @@ void FormulaBuffer::applyCellFormulaValues( const std::vector< ValueAddressPair } } } + +namespace { + +class SharedFormulaGroups +{ + struct Key + { + sal_Int32 mnId; + sal_Int32 mnCol; + + Key(sal_Int32 nId, sal_Int32 nCol) : mnId(nId), mnCol(nCol) {} + + bool operator== ( const Key& rOther ) const + { + return mnId == rOther.mnId && mnCol == rOther.mnCol; + } + + bool operator!= ( const Key& rOther ) const + { + return !operator==(rOther); + } + }; + + struct KeyHash + { + size_t operator() ( const Key& rKey ) const + { + double nVal = rKey.mnId; + nVal *= 256.0; + nVal += rKey.mnCol; + return static_cast<size_t>(nVal); + } + }; + + typedef boost::unordered_map<Key, ScFormulaCellGroupRef, KeyHash> StoreType; + StoreType maStore; +public: + + void set( sal_Int32 nSharedId, sal_Int32 nCol, const ScFormulaCellGroupRef& xGroup ) + { + Key aKey(nSharedId, nCol); + maStore.insert(StoreType::value_type(aKey, xGroup)); + } + + ScFormulaCellGroupRef get( sal_Int32 nSharedId, sal_Int32 nCol ) const + { + Key aKey(nSharedId, nCol); + StoreType::const_iterator it = maStore.find(aKey); + return it == maStore.end() ? ScFormulaCellGroupRef() : it->second; + } +}; + +} + +void FormulaBuffer::applySharedFormulas( sal_Int32 nTab ) +{ + SheetToFormulaEntryMap::const_iterator itShared = sharedFormulas.find(nTab); + if (itShared == sharedFormulas.end()) + // There is no shared formulas for this sheet. + return; + + SheetToSharedFormulaid::const_iterator itCells = sharedFormulaIds.find(nTab); + if (itCells == sharedFormulaIds.end()) + // There is no formula cells that use shared formulas for this sheet. + return; + + const std::vector<SharedFormulaEntry>& rSharedFormulas = itShared->second; + const std::vector<SharedFormulaDesc>& rCells = itCells->second; + + ScDocument& rDoc = getScDocument(); + + SharedFormulaGroups aGroups; + { + // Process shared formulas first. + std::vector<SharedFormulaEntry>::const_iterator it = rSharedFormulas.begin(), itEnd = rSharedFormulas.end(); + for (; it != itEnd; ++it) + { + const table::CellAddress& rAddr = it->maAddress; + const table::CellRangeAddress& rRange = it->maRange; + sal_Int32 nId = it->mnSharedId; + const OUString& rTokenStr = it->maTokenStr; + + ScAddress aPos; + ScUnoConversion::FillScAddress(aPos, rAddr); + ScCompiler aComp(&rDoc, aPos); + aComp.SetGrammar(formula::FormulaGrammar::GRAM_ENGLISH_XL_OOX); + ScTokenArray* pArray = aComp.CompileString(rTokenStr); + if (pArray) + { + for (sal_Int32 nCol = rRange.StartColumn; nCol <= rRange.EndColumn; ++nCol) + { + // Create one group per column, since Calc doesn't support + // shared formulas across multiple columns. + ScFormulaCellGroupRef xNewGroup(new ScFormulaCellGroup); + xNewGroup->mnStart = rRange.StartRow; + xNewGroup->mnLength = rRange.EndRow - rRange.StartRow; + xNewGroup->setCode(*pArray); + aGroups.set(nId, nCol, xNewGroup); + } + } + } + } + + { + // Process formulas that use shared formulas. + std::vector<SharedFormulaDesc>::const_iterator it = rCells.begin(), itEnd = rCells.end(); + for (; it != itEnd; ++it) + { + const table::CellAddress& rAddr = it->maAddress; + + ScFormulaCellGroupRef xGroup = aGroups.get(it->mnSharedId, rAddr.Column); + if (!xGroup) + continue; + + ScAddress aPos; + ScUnoConversion::FillScAddress(aPos, rAddr); + ScFormulaCell* pCell = new ScFormulaCell(&rDoc, aPos, xGroup); + + bool bInserted = rDoc.SetGroupFormulaCell(aPos, pCell); + if (!bInserted) + { + // Insertion failed. + delete pCell; + continue; + } + + pCell->StartListeningTo(&rDoc); + + if (it->maCellValue.isEmpty()) + { + // No cached cell value. Mark it for re-calculation. + pCell->SetDirty(true); + continue; + } + + // Set cached formula results. For now, we only use numeric + // results. Find out how to utilize cached results of other types. + switch (it->mnValueType) + { + case XML_n: + // numeric value. + pCell->SetResultDouble(it->maCellValue.toDouble()); + break; + default: + // Mark it for re-calculation. + pCell->SetDirty(true); + } + } + } +} + // bound to need this somewhere else, if so probably need to move it to // worksheethelper or somewhere else more suitable void StartCellListening( sal_Int16 nSheet, sal_Int32 nRow, sal_Int32 nCol, ScDocument& rDoc ) @@ -193,10 +325,12 @@ void FormulaBuffer::applyArrayFormulas( const std::vector< TokenRangeAddressItem } } -void FormulaBuffer::createSharedFormulaMapEntry( const ::com::sun::star::table::CellAddress& rAddress, sal_Int32 nSharedId, const OUString& rTokens ) +void FormulaBuffer::createSharedFormulaMapEntry( + const table::CellAddress& rAddress, const table::CellRangeAddress& rRange, + sal_Int32 nSharedId, const OUString& rTokens ) { std::vector<SharedFormulaEntry>& rSharedFormulas = sharedFormulas[ rAddress.Sheet ]; - SharedFormulaEntry aEntry( rAddress, rTokens, nSharedId ); + SharedFormulaEntry aEntry(rAddress, rRange, rTokens, nSharedId); rSharedFormulas.push_back( aEntry ); } @@ -205,9 +339,11 @@ void FormulaBuffer::setCellFormula( const ::com::sun::star::table::CellAddress& cellFormulas[ rAddress.Sheet ].push_back( TokenAddressItem( rTokenStr, rAddress ) ); } -void FormulaBuffer::setCellFormula( const ::com::sun::star::table::CellAddress& rAddress, sal_Int32 nSharedId ) +void FormulaBuffer::setCellFormula( + const table::CellAddress& rAddress, sal_Int32 nSharedId, const OUString& rCellValue, sal_Int32 nValueType ) { - sharedFormulaIds[ rAddress.Sheet ].push_back( SharedFormulaDesc( rAddress, nSharedId ) ); + sharedFormulaIds[rAddress.Sheet].push_back( + SharedFormulaDesc(rAddress, nSharedId, rCellValue, nValueType)); } void FormulaBuffer::setCellArrayFormula( const ::com::sun::star::table::CellRangeAddress& rRangeAddress, const ::com::sun::star::table::CellAddress& rTokenAddress, const OUString& rTokenStr ) @@ -222,21 +358,6 @@ void FormulaBuffer::setCellFormulaValue( const ::com::sun::star::table::CellAddr cellFormulaValues[ rAddress.Sheet ].push_back( ValueAddressPair( rAddress, fValue ) ); } -void FormulaBuffer::createSharedFormula( const ::com::sun::star::table::CellAddress& rAddress, sal_Int32 nSharedId, const OUString& rTokenStr ) -{ - ApiTokenSequence aTokens = getFormulaParser().importFormula( rAddress, rTokenStr ); - OUString aName = OUStringBuffer().appendAscii( RTL_CONSTASCII_STRINGPARAM( "__shared_" ) ). - append( static_cast< sal_Int32 >( rAddress.Sheet + 1 ) ). - append( sal_Unicode( '_' ) ).append( nSharedId ). - append( OUString("_0") ).makeStringAndClear(); - ScRangeData* pScRangeData = createNamedRangeObject( aName, aTokens, 0 ); - - pScRangeData->SetType(RT_SHARED); - sal_Int32 nTokenIndex = static_cast< sal_Int32 >( pScRangeData->GetIndex() ); - - // store the token index in the map - tokenIndexes[ rAddress.Sheet ][ nSharedId ] = nTokenIndex; -} -} // namespace xls -} // namespace oox +}} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/oox/sheetdatacontext.cxx b/sc/source/filter/oox/sheetdatacontext.cxx index e1efe168de36..24be4d7d2d44 100644 --- a/sc/source/filter/oox/sheetdatacontext.cxx +++ b/sc/source/filter/oox/sheetdatacontext.cxx @@ -157,7 +157,7 @@ void SheetDataContext::onCharacters( const OUString& rChars ) case XLS_TOKEN( f ): if( maFmlaData.mnFormulaType != XML_TOKEN_INVALID ) { - maFormulaStr = rChars; + maFormulaStr = rChars; } break; } @@ -187,10 +187,9 @@ void SheetDataContext::onEndElement() if( maFmlaData.mnSharedId >= 0 ) { if( mbValidRange && maFmlaData.isValidSharedRef( maCellData.maCellAddr ) ) - { - createSharedFormulaMapEntry( maCellData.maCellAddr, maFmlaData.mnSharedId, maFormulaStr ); - } - setCellFormula( maCellData.maCellAddr, maFmlaData.mnSharedId ); + createSharedFormulaMapEntry(maCellData.maCellAddr, maFmlaData.maFormulaRef, maFmlaData.mnSharedId, maFormulaStr); + + setCellFormula(maCellData.maCellAddr, maFmlaData.mnSharedId, maCellValue, maCellData.mnCellType); mrSheetData.setCellFormat( maCellData ); } else diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx index 37d5191e3a93..8802389372c1 100644 --- a/sc/source/filter/oox/workbookhelper.cxx +++ b/sc/source/filter/oox/workbookhelper.cxx @@ -740,7 +740,7 @@ Reference< XSpreadsheetDocument > WorkbookHelper::getDocument() const return mrBookGlob.getDocument(); } -Reference< XSpreadsheet > WorkbookHelper::getSheetFromDoc( sal_Int16 nSheet ) const +Reference< XSpreadsheet > WorkbookHelper::getSheetFromDoc( sal_Int32 nSheet ) const { Reference< XSpreadsheet > xSheet; try diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx index bd8b9ba322d8..9fe91443693f 100644 --- a/sc/source/filter/oox/worksheethelper.cxx +++ b/sc/source/filter/oox/worksheethelper.cxx @@ -1602,9 +1602,11 @@ void WorksheetHelper::setCellFormula( const ::com::sun::star::table::CellAddress getFormulaBuffer().setCellFormula( rTokenAddress, rTokenStr ); } -void WorksheetHelper::setCellFormula( const ::com::sun::star::table::CellAddress& rTokenAddress, sal_Int32 nSharedId ) +void WorksheetHelper::setCellFormula( + const ::com::sun::star::table::CellAddress& rAddr, sal_Int32 nSharedId, + const OUString& rCellValue, sal_Int32 nValueType ) { - getFormulaBuffer().setCellFormula( rTokenAddress, nSharedId ); + getFormulaBuffer().setCellFormula(rAddr, nSharedId, rCellValue, nValueType); } void WorksheetHelper::setCellArrayFormula( const ::com::sun::star::table::CellRangeAddress& rRangeAddress, const ::com::sun::star::table::CellAddress& rTokenAddress, const OUString& rTokenStr ) @@ -1612,9 +1614,10 @@ void WorksheetHelper::setCellArrayFormula( const ::com::sun::star::table::CellRa getFormulaBuffer().setCellArrayFormula( rRangeAddress, rTokenAddress, rTokenStr ); } -void WorksheetHelper::createSharedFormulaMapEntry( const ::com::sun::star::table::CellAddress& rAddress, sal_Int32 nSharedId, const OUString& rTokens ) +void WorksheetHelper::createSharedFormulaMapEntry( + const table::CellAddress& rAddress, const table::CellRangeAddress& rRange, sal_Int32 nSharedId, const OUString& rTokens ) { - getFormulaBuffer().createSharedFormulaMapEntry( rAddress, nSharedId, rTokens ); + getFormulaBuffer().createSharedFormulaMapEntry(rAddress, rRange, nSharedId, rTokens); } // ============================================================================ |