[Libreoffice-commits] core.git: sc/source
Noel Power
noel.power at suse.com
Fri May 17 10:32:16 PDT 2013
sc/source/filter/oox/formulabuffer.cxx | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
New commits:
commit 81b0155096fc369feae3fe33fc8cf09c2ed3de01
Author: Noel Power <noel.power at suse.com>
Date: Fri May 17 18:27:05 2013 +0100
fix missing xlsx import formula dependecy startlisten on formula array cells
Formula arrays in xlsx documents don't change ( when depenant cells change ) this is
because of some performace hacks that prevent wide-scale startlisten calls
( e.g. inhibited because filter calls SetInsertingFromOtherDoc(true) ) Instead
of enabling that stuff again some we do some manual dependecy setting
Change-Id: I994d0ec505339201f6f78229963de45f10437212
diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx
index eba84aba..0c44329 100644
--- a/sc/source/filter/oox/formulabuffer.cxx
+++ b/sc/source/filter/oox/formulabuffer.cxx
@@ -155,16 +155,41 @@ void FormulaBuffer::applyCellFormulaValues( const std::vector< ValueAddressPair
}
}
}
+// 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 )
+{
+ ScAddress aCellPos;
+ CellAddress aAddress;
+ aAddress.Sheet = nSheet;
+ aAddress.Row = nRow;
+ aAddress.Column = nCol;
+ ScUnoConversion::FillScAddress( aCellPos, aAddress );
+ ScFormulaCell* pFCell = rDoc.GetFormulaCell( aCellPos );
+ if ( pFCell )
+ pFCell->StartListeningTo( &rDoc );
+}
void FormulaBuffer::applyArrayFormulas( const std::vector< TokenRangeAddressItem >& rVector )
{
+ ScDocument& rDoc = getScDocument();
for ( std::vector< TokenRangeAddressItem >::const_iterator it = rVector.begin(), it_end = rVector.end(); it != it_end; ++it )
{
Reference< XArrayFormulaTokens > xTokens( getRange( it->maCellRangeAddress ), UNO_QUERY );
OSL_ENSURE( xTokens.is(), "SheetDataBuffer::finalizeArrayFormula - missing formula token interface" );
ApiTokenSequence aTokens = getFormulaParser().importFormula( it->maTokenAndAddress.maCellAddress, it->maTokenAndAddress.maTokenStr );
if( xTokens.is() )
+ {
xTokens->setArrayTokens( aTokens );
+ // set dependencies, add listeners on the cells in array
+ for ( sal_Int32 nCol = it->maCellRangeAddress.StartColumn; nCol <= it->maCellRangeAddress.EndColumn; ++nCol )
+ {
+ for ( sal_Int32 nRow = it->maCellRangeAddress.StartRow; nRow <= it->maCellRangeAddress.EndRow; ++nRow )
+ {
+ StartCellListening( it->maCellRangeAddress.Sheet, nRow, nCol, rDoc );
+ }
+ }
+ }
}
}
More information about the Libreoffice-commits
mailing list