ooo-build r13627 - in trunk: . patches/test
- From: kyoshida svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r13627 - in trunk: . patches/test
- Date: Tue, 19 Aug 2008 14:15:35 +0000 (UTC)
Author: kyoshida
Date: Tue Aug 19 14:15:35 2008
New Revision: 13627
URL: http://svn.gnome.org/viewvc/ooo-build?rev=13627&view=rev
Log:
2008-08-19 Kohei Yoshida <kyoshida novell com>
* patches/test/calc-external-ref-odf-cache.diff: a little more
progress & code cleanup.
Modified:
trunk/ChangeLog
trunk/patches/test/calc-external-ref-odf-cache.diff
Modified: trunk/patches/test/calc-external-ref-odf-cache.diff
==============================================================================
--- trunk/patches/test/calc-external-ref-odf-cache.diff (original)
+++ trunk/patches/test/calc-external-ref-odf-cache.diff Tue Aug 19 14:15:35 2008
@@ -312,19 +312,303 @@
//------------------------------------------------------------------
diff --git sc/source/filter/xml/xmlcelli.cxx sc/source/filter/xml/xmlcelli.cxx
-index 92eb208..347a657 100644
+index 92eb208..a990e54 100644
--- sc/source/filter/xml/xmlcelli.cxx
+++ sc/source/filter/xml/xmlcelli.cxx
-@@ -272,7 +272,7 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
+@@ -146,185 +146,131 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
+ rtl::OUString aLocalName;
+ rtl::OUString* pStyleName = NULL;
+ rtl::OUString* pCurrencySymbol = NULL;
+- for( sal_Int16 i=0; i < nAttrCount; ++i )
++ const SvXMLTokenMap& rTokenMap = rImport.GetTableRowCellAttrTokenMap();
++ for (sal_Int16 i = 0; i < nAttrCount; ++i)
+ {
+- sal_uInt16 nPrefix = rXMLImport.GetNamespaceMap().GetKeyByAttrName(
+- xAttrList->getNameByIndex( i ), &aLocalName );
+- const rtl::OUString& sValue(xAttrList->getValueByIndex( i ));
++ sal_uInt16 nAttrPrefix = rImport.GetNamespaceMap().GetKeyByAttrName(
++ xAttrList->getNameByIndex(i), &aLocalName);
+
+- if (nPrefix == XML_NAMESPACE_TABLE)
+- {
+- sal_uInt32 nLength(aLocalName.getLength());
+-
+- switch (nLength)
++ const rtl::OUString& sValue = xAttrList->getValueByIndex(i);
++ sal_uInt16 nToken = rTokenMap.Get(nAttrPrefix, aLocalName);
++ switch (nToken)
++ {
++ case XML_TOK_TABLE_ROW_CELL_ATTR_STYLE_NAME:
++ pStyleName = new rtl::OUString(sValue);
++ break;
++ case XML_TOK_TABLE_ROW_CELL_ATTR_CONTENT_VALIDATION_NAME:
++ DBG_ASSERT(!pContentValidationName, "here should be only one Validation Name");
++ pContentValidationName = new rtl::OUString(sValue);
++ break;
++ case XML_TOK_TABLE_ROW_CELL_ATTR_SPANNED_ROWS:
++ bIsMerged = sal_True;
++ nMergedRows = sValue.toInt32();
++ break;
++ case XML_TOK_TABLE_ROW_CELL_ATTR_SPANNED_COLS:
++ bIsMerged = sal_True;
++ nMergedCols = sValue.toInt32();
++ break;
++ case XML_TOK_TABLE_ROW_CELL_ATTR_SPANNED_MATRIX_COLS:
++ bIsMatrix = sal_True;
++ nMatrixCols = sValue.toInt32();
++ break;
++ case XML_TOK_TABLE_ROW_CELL_ATTR_SPANNED_MATRIX_ROWS:
++ bIsMatrix = sal_True;
++ nMatrixRows = sValue.toInt32();
++ break;
++ case XML_TOK_TABLE_ROW_CELL_ATTR_REPEATED:
++ nCellsRepeated = std::max( sValue.toInt32(), (sal_Int32) 1 );
++ break;
++ case XML_TOK_TABLE_ROW_CELL_ATTR_VALUE_TYPE:
++ nCellType = GetScImport().GetCellType(sValue);
++ bIsEmpty = sal_False;
++ break;
++ case XML_TOK_TABLE_ROW_CELL_ATTR_VALUE:
+ {
+- case 7 :
+- {
+- if (IsXMLToken(aLocalName, XML_FORMULA))
+- {
+- if (sValue.getLength())
+- {
+- DBG_ASSERT(!pOUFormula, "here should be only one formula");
+- DELETEZ( pOUFormula);
+- rtl::OUString sFormula;
+- sal_uInt16 nFormulaPrefix = GetImport().GetNamespaceMap().
+- _GetKeyByAttrName( sValue, &sFormula, sal_False );
+-
+- if (ScXMLImport::IsAcceptedFormulaNamespace(
+- nFormulaPrefix, sValue, eGrammar,
+- eStorageGrammar))
+- {
+- // Namespaces we accept.
+- pOUFormula = new rtl::OUString( sFormula);
+- }
+- else
+- {
+- // No namespace => entire string.
+- // Also unknown namespace included in formula,
+- // so hopefully will result in string or
+- // compile error.
+- pOUFormula = new rtl::OUString( sValue);
+- }
+- }
+- }
+- }
+- break;
+- case 10 :
+- {
+- if (IsXMLToken(aLocalName, XML_STYLE_NAME))
+- pStyleName = new rtl::OUString(sValue);
+- }
+- break;
+- case 19 :
++ if (sValue.getLength())
{
- if (IsXMLToken(aLocalName, XML_VALUE_TYPE))
- {
+- if (IsXMLToken(aLocalName, XML_NUMBER_ROWS_SPANNED))
+- {
+- bIsMerged = sal_True;
+- nMergedRows = sValue.toInt32();
+- }
++ rXMLImport.GetMM100UnitConverter().convertDouble(fValue, sValue);
++ bIsEmpty = sal_False;
+ }
+- break;
+- case 22 :
+- {
+- if (IsXMLToken(aLocalName, XML_NUMBER_COLUMNS_SPANNED))
+- {
+- bIsMerged = sal_True;
+- nMergedCols = sValue.toInt32();
+- }
+- }
+- break;
+- case 23 :
+- {
+- if (IsXMLToken(aLocalName, XML_NUMBER_COLUMNS_REPEATED))
+- nCellsRepeated = std::max( sValue.toInt32(), (sal_Int32) 1 );
+- else if (IsXMLToken(aLocalName, XML_CONTENT_VALIDATION_NAME))
+- {
+- DBG_ASSERT(!pContentValidationName, "here should be only one Validation Name");
+- pContentValidationName = new rtl::OUString(sValue);
+- }
+- }
+- break;
+- case 26 :
+- {
+- if (IsXMLToken(aLocalName, XML_NUMBER_MATRIX_ROWS_SPANNED))
+- {
+- bIsMatrix = sal_True;
+- nMatrixRows = sValue.toInt32();
+- }
+- }
+- break;
+- case 29 :
+- {
+- if (IsXMLToken(aLocalName, XML_NUMBER_MATRIX_COLUMNS_SPANNED))
+- {
+- bIsMatrix = sal_True;
+- nMatrixCols = sValue.toInt32();
+- }
+- }
+- break;
+ }
+- }
+- else if (nPrefix == XML_NAMESPACE_OFFICE)
+- {
+- sal_uInt32 nLength(aLocalName.getLength());
+-
+- switch (nLength)
++ break;
++ case XML_TOK_TABLE_ROW_CELL_ATTR_DATE_VALUE:
+ {
+- case 5 :
++ if (sValue.getLength() && rXMLImport.SetNullDateOnUnitConverter())
+ {
+- if (IsXMLToken(aLocalName, XML_VALUE))
+- {
+- if (sValue.getLength())
+- {
+- rXMLImport.GetMM100UnitConverter().convertDouble(fValue, sValue);
+- bIsEmpty = sal_False;
+- }
+- }
++ rXMLImport.GetMM100UnitConverter().convertDateTime(fValue, sValue);
++ bIsEmpty = sal_False;
+ }
+- break;
+- case 8 :
++ }
++ break;
++ case XML_TOK_TABLE_ROW_CELL_ATTR_TIME_VALUE:
++ {
++ if (sValue.getLength())
+ {
+- if (IsXMLToken(aLocalName, XML_CURRENCY))
+- pCurrencySymbol = new rtl::OUString(sValue);
++ rXMLImport.GetMM100UnitConverter().convertTime(fValue, sValue);
++ bIsEmpty = sal_False;
+ }
+- break;
+- case 10 :
++ }
++ break;
++ case XML_TOK_TABLE_ROW_CELL_ATTR_STRING_VALUE:
++ {
++ if (sValue.getLength())
+ {
+- if (IsXMLToken(aLocalName, XML_VALUE_TYPE))
+- {
- nCellType = GetCellType(sValue);
-+ nCellType = GetScImport().GetCellType(sValue);
- bIsEmpty = sal_False;
- }
- else if (IsXMLToken(aLocalName, XML_DATE_VALUE))
-@@ -335,32 +335,6 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
+- bIsEmpty = sal_False;
+- }
+- else if (IsXMLToken(aLocalName, XML_DATE_VALUE))
+- {
+- if (sValue.getLength() && rXMLImport.SetNullDateOnUnitConverter())
+- {
+- rXMLImport.GetMM100UnitConverter().convertDateTime(fValue, sValue);
+- bIsEmpty = sal_False;
+- }
+- }
+- else if (IsXMLToken(aLocalName, XML_TIME_VALUE))
+- {
+- if (sValue.getLength())
+- {
+- rXMLImport.GetMM100UnitConverter().convertTime(fValue, sValue);
+- bIsEmpty = sal_False;
+- }
+- }
++ DBG_ASSERT(!pOUTextValue, "here should be only one string value");
++ pOUTextValue = new rtl::OUString(sValue);
++ bIsEmpty = sal_False;
+ }
+- break;
+- case 12 :
++ }
++ break;
++ case XML_TOK_TABLE_ROW_CELL_ATTR_BOOLEAN_VALUE:
++ {
++ if (sValue.getLength())
+ {
+- if (IsXMLToken(aLocalName, XML_STRING_VALUE))
+- {
+- if (sValue.getLength())
+- {
+- DBG_ASSERT(!pOUTextValue, "here should be only one string value");
+- pOUTextValue = new rtl::OUString(sValue);
+- bIsEmpty = sal_False;
+- }
+- }
++ if ( IsXMLToken(sValue, XML_TRUE) )
++ fValue = 1.0;
++ else if ( IsXMLToken(sValue, XML_FALSE) )
++ fValue = 0.0;
++ else
++ rXMLImport.GetMM100UnitConverter().convertDouble(fValue, sValue);
++ bIsEmpty = sal_False;
+ }
+- break;
+- case 13 :
++ }
++ break;
++ case XML_TOK_TABLE_ROW_CELL_ATTR_FORMULA:
++ {
++ if (sValue.getLength())
+ {
+- if (IsXMLToken(aLocalName, XML_BOOLEAN_VALUE))
+- {
+- if (sValue.getLength())
+- {
+- if ( IsXMLToken(sValue, XML_TRUE) )
+- fValue = 1.0;
+- else if ( IsXMLToken(sValue, XML_FALSE) )
+- fValue = 0.0;
+- else
+- rXMLImport.GetMM100UnitConverter().convertDouble(fValue, sValue);
+- bIsEmpty = sal_False;
+- }
+- }
++ DBG_ASSERT(!pOUFormula, "here should be only one formula");
++ DELETEZ( pOUFormula);
++ rtl::OUString sFormula;
++ sal_uInt16 nFormulaPrefix = GetImport().GetNamespaceMap().
++ _GetKeyByAttrName( sValue, &sFormula, sal_False );
++
++ if (ScXMLImport::IsAcceptedFormulaNamespace(
++ nFormulaPrefix, sValue, eGrammar,
++ eStorageGrammar))
++ {
++ // Namespaces we accept.
++ pOUFormula = new rtl::OUString( sFormula);
++ }
++ else
++ {
++ // No namespace => entire string.
++ // Also unknown namespace included in formula,
++ // so hopefully will result in string or
++ // compile error.
++ pOUFormula = new rtl::OUString( sValue);
++ }
+ }
+- break;
+ }
+- }
++ break;
++ case XML_TOK_TABLE_ROW_CELL_ATTR_CURRENCY:
++ pCurrencySymbol = new rtl::OUString(sValue);
++ break;
++ default:
++ ;
++ }
+ }
+ if (pOUFormula)
+ {
+@@ -335,32 +281,6 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
rXMLImport.GetStylesImportHelper()->SetAttributes(pStyleName, pCurrencySymbol, nCellType);
}
@@ -989,10 +1273,10 @@
void CollectUserDefinedNamespaces(const SfxItemPool* pPool, sal_uInt16 nAttrib);
diff --git sc/source/filter/xml/xmlexternaltabi.cxx sc/source/filter/xml/xmlexternaltabi.cxx
new file mode 100644
-index 0000000..87c0d65
+index 0000000..e1d0ebd
--- /dev/null
+++ sc/source/filter/xml/xmlexternaltabi.cxx
-@@ -0,0 +1,348 @@
+@@ -0,0 +1,343 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1191,6 +1475,7 @@
+ using namespace ::xmloff::token;
+
+ sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
++ const SvXMLTokenMap& rTokenMap = rImport.GetTableRowCellAttrTokenMap();
+ for (sal_Int16 i = 0; i < nAttrCount; ++i)
+ {
+ OUString aLocalName;
@@ -1198,78 +1483,72 @@
+ xAttrList->getNameByIndex(i), &aLocalName);
+
+ const rtl::OUString& sValue = xAttrList->getValueByIndex(i);
-+ const SvXMLTokenMap& rMap = rImport.GetTableRowCellAttrTokenMap();
-+ sal_uInt16 nToken = rMap.Get(nAttrPrefix, aLocalName);
++ sal_uInt16 nToken = rTokenMap.Get(nAttrPrefix, aLocalName);
+
-+ if (nAttrPrefix == XML_NAMESPACE_TABLE)
++ switch (nToken)
+ {
-+ if (nToken == XML_TOK_TABLE_ROW_CELL_ATTR_REPEATED)
++ case XML_TOK_TABLE_ROW_CELL_ATTR_REPEATED:
+ {
+ mnRepeatCount = ::std::max(sValue.toInt32(), static_cast<sal_Int32>(1));
+ }
-+ }
-+ else if (nAttrPrefix == XML_NAMESPACE_OFFICE)
-+ {
-+ switch (nToken)
++ break;
++ case XML_TOK_TABLE_ROW_CELL_ATTR_VALUE_TYPE:
+ {
-+ case XML_TOK_TABLE_ROW_CELL_ATTR_VALUE_TYPE:
++ mnCellType = mrScImport.GetCellType(sValue);
++ }
++ break;
++ case XML_TOK_TABLE_ROW_CELL_ATTR_VALUE:
++ {
++ if (sValue.getLength())
+ {
-+ mnCellType = mrScImport.GetCellType(sValue);
++ mrScImport.GetMM100UnitConverter().convertDouble(mfCellValue, sValue);
++ mbIsNumeric = true;
++ mbIsEmpty = false;
+ }
-+ break;
-+ case XML_TOK_TABLE_ROW_CELL_ATTR_VALUE:
++ }
++ break;
++ case XML_TOK_TABLE_ROW_CELL_ATTR_DATE_VALUE:
++ {
++ if (sValue.getLength() && mrScImport.SetNullDateOnUnitConverter())
+ {
-+ if (sValue.getLength())
-+ {
-+ mrScImport.GetMM100UnitConverter().convertDouble(mfCellValue, sValue);
-+ mbIsNumeric = true;
-+ mbIsEmpty = false;
-+ }
++ mrScImport.GetMM100UnitConverter().convertDateTime(mfCellValue, sValue);
++ mbIsNumeric = true;
++ mbIsEmpty = false;
+ }
-+ break;
-+ case XML_TOK_TABLE_ROW_CELL_ATTR_DATE_VALUE:
++ }
++ break;
++ case XML_TOK_TABLE_ROW_CELL_ATTR_TIME_VALUE:
++ {
++ if (sValue.getLength())
+ {
-+ if (sValue.getLength() && mrScImport.SetNullDateOnUnitConverter())
-+ {
-+ mrScImport.GetMM100UnitConverter().convertDateTime(mfCellValue, sValue);
-+ mbIsNumeric = true;
-+ mbIsEmpty = false;
-+ }
++ mrScImport.GetMM100UnitConverter().convertTime(mfCellValue, sValue);
++ mbIsNumeric = true;
++ mbIsEmpty = false;
+ }
-+ break;
-+ case XML_TOK_TABLE_ROW_CELL_ATTR_TIME_VALUE:
++ }
++ break;
++ case XML_TOK_TABLE_ROW_CELL_ATTR_STRING_VALUE:
++ {
++ if (sValue.getLength())
+ {
-+ if (sValue.getLength())
-+ {
-+ mrScImport.GetMM100UnitConverter().convertTime(mfCellValue, sValue);
-+ mbIsNumeric = true;
-+ mbIsEmpty = false;
-+ }
++ maCellString = sValue;
++ mbIsNumeric = false;
++ mbIsEmpty = false;
+ }
-+ break;
-+ case XML_TOK_TABLE_ROW_CELL_ATTR_STRING_VALUE:
-+ {
-+ if (sValue.getLength())
-+ {
-+ maCellString = sValue;
-+ mbIsNumeric = false;
-+ mbIsEmpty = false;
-+ }
-+ }
-+ break;
-+ case XML_TOK_TABLE_ROW_CELL_ATTR_BOOLEAN_VALUE:
++ }
++ break;
++ case XML_TOK_TABLE_ROW_CELL_ATTR_BOOLEAN_VALUE:
++ {
++ if (sValue.getLength())
+ {
-+ if (sValue.getLength())
-+ {
-+ mfCellValue = IsXMLToken(sValue, XML_TRUE) ? 1.0 : 0.0;
-+ mbIsNumeric = true;
-+ mbIsEmpty = false;
-+ }
++ mfCellValue = IsXMLToken(sValue, XML_TRUE) ? 1.0 : 0.0;
++ mbIsNumeric = true;
++ mbIsEmpty = false;
+ }
-+ break;
-+ default:
-+ ;
-+ }
++ }
++ break;
++ default:
++ ;
+ }
+ }
+}
@@ -1674,7 +1953,7 @@
extern const XMLPropertyMapEntry aXMLScColumnStylesProperties[];
extern const XMLPropertyMapEntry aXMLScRowStylesProperties[];
diff --git sc/source/filter/xml/xmltabi.cxx sc/source/filter/xml/xmltabi.cxx
-index 4a0f83e..b55da0b 100644
+index 4a0f83e..af80b31 100644
--- sc/source/filter/xml/xmltabi.cxx
+++ sc/source/filter/xml/xmltabi.cxx
@@ -40,6 +40,7 @@
@@ -1808,7 +2087,7 @@
}
else
{
-@@ -134,10 +228,29 @@ SvXMLImportContext *ScXMLTableContext::CreateChildContext( USHORT nPrefix,
+@@ -134,10 +228,30 @@ SvXMLImportContext *ScXMLTableContext::CreateChildContext( USHORT nPrefix,
const ::com::sun::star::uno::Reference<
::com::sun::star::xml::sax::XAttributeList>& xAttrList )
{
@@ -1816,7 +2095,8 @@
+ sal_uInt16 nToken = rTokenMap.Get(nPrefix, rLName);
+ if (pExternalRefInfo.get())
+ {
-+ // We only care about the row elements for external cache data.
++ // We only care about the table-row and table-source elements for
++ // external cache data.
+ switch (nToken)
+ {
+ case XML_TOK_TABLE_ROW:
@@ -1840,7 +2120,7 @@
{
case XML_TOK_TABLE_COL_GROUP:
pContext = new ScXMLTableColsContext( GetScImport(), nPrefix,
-@@ -195,6 +308,8 @@ SvXMLImportContext *ScXMLTableContext::CreateChildContext( USHORT nPrefix,
+@@ -195,6 +309,8 @@ SvXMLImportContext *ScXMLTableContext::CreateChildContext( USHORT nPrefix,
pContext = GetScImport().GetFormImport()->createOfficeFormsContext( GetScImport(), nPrefix, rLName );
}
break;
@@ -1895,10 +2175,18 @@
// -----------------------------------------------------------------------
diff --git sc/source/ui/docshell/externalrefmgr.cxx sc/source/ui/docshell/externalrefmgr.cxx
-index 8b5858d..27beb77 100644
+index 8b5858d..8f34a8f 100644
--- sc/source/ui/docshell/externalrefmgr.cxx
+++ sc/source/ui/docshell/externalrefmgr.cxx
-@@ -105,13 +105,13 @@ void ScExternalRefCache::Table::setCell(SCROW nRow, SCCOL nCol, TokenRef pToken)
+@@ -63,6 +63,7 @@
+ #include "unotools/ucbhelper.hxx"
+
+ #include <memory>
++#include <algorithm>
+
+ using ::std::auto_ptr;
+ using ::com::sun::star::uno::Any;
+@@ -105,13 +106,13 @@ void ScExternalRefCache::Table::setCell(SCROW nRow, SCCOL nCol, TokenRef pToken)
rRow.insert(RowDataType::value_type(nCol, pToken));
}
@@ -1914,7 +2202,7 @@
}
const RowDataType& rRowData = itrTable->second;
-@@ -119,10 +119,36 @@ ScToken* ScExternalRefCache::Table::getCell(SCROW nRow, SCCOL nCol) const
+@@ -119,10 +120,42 @@ ScToken* ScExternalRefCache::Table::getCell(SCROW nRow, SCCOL nCol) const
if (itrRow == rRowData.end())
{
// this row doesn't have the specified column.
@@ -1933,6 +2221,9 @@
+ RowsDataType::const_iterator itr = maRows.begin(), itrEnd = maRows.end();
+ for (; itr != itrEnd; ++itr)
+ aRows.push_back(itr->first);
++
++ // hash map is not ordered, so we need to explicitly sort it.
++ ::std::sort(aRows.begin(), aRows.end());
+ rRows.swap(aRows);
+}
+
@@ -1949,11 +2240,14 @@
+ RowDataType::const_iterator itrCol = rRowData.begin(), itrColEnd = rRowData.end();
+ for (; itrCol != itrColEnd; ++itrCol)
+ aCols.push_back(itrCol->first);
++
++ // hash map is not ordered, so we need to explicitly sort it.
++ ::std::sort(aCols.begin(), aCols.end());
+ rCols.swap(aCols);
}
// ----------------------------------------------------------------------------
-@@ -157,7 +183,7 @@ ScToken* ScExternalRefCache::getCellData(sal_uInt16 nFileId, const String& rTabN
+@@ -157,7 +190,7 @@ ScToken* ScExternalRefCache::getCellData(sal_uInt16 nFileId, const String& rTabN
// the table data is not instantiated yet.
return NULL;
}
@@ -1962,7 +2256,7 @@
}
ScTokenArray* ScExternalRefCache::getCellRangeData(sal_uInt16 nFileId, const String& rTabName, const ScRange& rRange)
-@@ -208,7 +234,7 @@ ScTokenArray* ScExternalRefCache::getCellRangeData(sal_uInt16 nFileId, const Str
+@@ -208,7 +241,7 @@ ScTokenArray* ScExternalRefCache::getCellRangeData(sal_uInt16 nFileId, const Str
{
for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
{
@@ -1971,7 +2265,7 @@
if (!pToken)
return NULL;
-@@ -409,7 +435,7 @@ const vector<String>* ScExternalRefCache::getAllTableNames(sal_uInt16 nFileId) c
+@@ -409,7 +442,7 @@ const vector<String>* ScExternalRefCache::getAllTableNames(sal_uInt16 nFileId) c
return &pDoc->maTableNames;
}
@@ -1980,7 +2274,7 @@
{
DocItem* pDoc = getDocItem(nFileId);
if (!pDoc)
-@@ -419,9 +445,11 @@ ScExternalRefCache::Table* ScExternalRefCache::getCacheTable(sal_uInt16 nFileId,
+@@ -419,9 +452,11 @@ ScExternalRefCache::Table* ScExternalRefCache::getCacheTable(sal_uInt16 nFileId,
size_t nIndex;
if (lcl_getTableDataIndex(rDoc.maTableNameIndex, rTabName, nIndex))
@@ -1994,7 +2288,7 @@
// Specified table doesn't exist yet. Create one.
TableTypeRef pTab(new Table);
-@@ -835,6 +863,8 @@ ScTokenArray* ScExternalRefManager::getRangeNameTokens(sal_uInt16 nFileId, const
+@@ -835,6 +870,8 @@ ScTokenArray* ScExternalRefManager::getRangeNameTokens(sal_uInt16 nFileId, const
bTokenAdded = true;
}
break;
@@ -2003,7 +2297,7 @@
}
if (!bTokenAdded)
-@@ -849,10 +879,7 @@ void ScExternalRefManager::refreshAllReferencingCells(sal_uInt16 nFileId)
+@@ -849,10 +886,7 @@ void ScExternalRefManager::refreshAllReferencingCells(sal_uInt16 nFileId)
{
RefCellMap::iterator itr = maRefCells.find(nFileId);
if (itr == maRefCells.end())
@@ -2014,7 +2308,7 @@
RefCellSet aNewSet;
RefCellSet& rSet = itr->second;
-@@ -911,8 +938,8 @@ ScDocument* ScExternalRefManager::getSrcDocument(sal_uInt16 nFileId)
+@@ -911,8 +945,8 @@ ScDocument* ScExternalRefManager::getSrcDocument(sal_uInt16 nFileId)
return NULL;
String aFilter;
@@ -2025,7 +2319,7 @@
if (!aSrcDoc.maShell.Is())
{
// source document could not be loaded.
-@@ -946,17 +973,24 @@ ScDocument* ScExternalRefManager::getSrcDocument(sal_uInt16 nFileId)
+@@ -946,17 +980,24 @@ ScDocument* ScExternalRefManager::getSrcDocument(sal_uInt16 nFileId)
return pSrcDoc;
}
@@ -2051,7 +2345,7 @@
SfxItemSet* pSet = new SfxAllItemSet(SFX_APP()->GetPool());
if (aOptions.Len())
pSet->Put(SfxStringItem(SID_FILE_FILTEROPTIONS, aOptions));
-@@ -1050,34 +1084,78 @@ bool ScExternalRefManager::compileTokensByCell(const ScAddress& rCell)
+@@ -1050,34 +1091,78 @@ bool ScExternalRefManager::compileTokensByCell(const ScAddress& rCell)
return true;
}
@@ -2121,22 +2415,22 @@
{
- if (nFileId >= maFileNames.size())
+ if (nFileId >= maSrcFiles.size())
- return NULL;
-
-- return &maFileNames[nFileId];
++ return NULL;
++
+ return &maSrcFiles[nFileId].maFileName;
+}
+
+const ScExternalRefManager::SrcFileData* ScExternalRefManager::getExternalFileData(sal_uInt16 nFileId) const
+{
+ if (nFileId >= maSrcFiles.size())
-+ return NULL;
-+
+ return NULL;
+
+- return &maFileNames[nFileId];
+ return &maSrcFiles[nFileId];
}
const vector<String>* ScExternalRefManager::getAllCachedTableNames(sal_uInt16 nFileId) const
-@@ -1085,6 +1163,11 @@ const vector<String>* ScExternalRefManager::getAllCachedTableNames(sal_uInt16 nF
+@@ -1085,6 +1170,11 @@ const vector<String>* ScExternalRefManager::getAllCachedTableNames(sal_uInt16 nF
return maRefCache.getAllTableNames(nFileId);
}
@@ -2148,7 +2442,7 @@
template<typename MapContainer>
static void lcl_removeByFileId(sal_uInt16 nFileId, MapContainer& rMap)
{
-@@ -1103,10 +1186,26 @@ void ScExternalRefManager::refreshNames(sal_uInt16 nFileId)
+@@ -1103,10 +1193,26 @@ void ScExternalRefManager::refreshNames(sal_uInt16 nFileId)
void ScExternalRefManager::switchSrcFile(sal_uInt16 nFileId, const String& rNewFile)
{
@@ -2176,7 +2470,7 @@
void ScExternalRefManager::removeSrcDocument(sal_uInt16 nFileId, bool bBreakLink)
{
maRefCache.clearCache(nFileId);
-@@ -1131,7 +1230,7 @@ void ScExternalRefManager::clear()
+@@ -1131,7 +1237,7 @@ void ScExternalRefManager::clear()
bool ScExternalRefManager::hasExternalData() const
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]