Kaydet (Commit) 2419d3c2 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

fdo#43534: Fully support external references in CELL function.

Some parameters don't work with external references, however, such
as PROTECT, PREFIX and WIDTH.
üst ec3aa099
...@@ -109,7 +109,7 @@ public: ...@@ -109,7 +109,7 @@ public:
{ {
bool mbIsSet; bool mbIsSet;
short mnType; short mnType;
sal_uInt32 mnIndex; sal_uLong mnIndex;
explicit CellFormat(); explicit CellFormat();
}; };
...@@ -119,7 +119,7 @@ private: ...@@ -119,7 +119,7 @@ private:
struct Cell struct Cell
{ {
TokenRef mxToken; TokenRef mxToken;
sal_uInt32 mnFmtIndex; sal_uLong mnFmtIndex;
}; };
typedef ::boost::unordered_map<SCCOL, Cell> RowDataType; typedef ::boost::unordered_map<SCCOL, Cell> RowDataType;
typedef ::boost::unordered_map<SCROW, RowDataType> RowsDataType; typedef ::boost::unordered_map<SCROW, RowDataType> RowsDataType;
...@@ -160,7 +160,7 @@ public: ...@@ -160,7 +160,7 @@ public:
* false _only when_ adding a range of cell * false _only when_ adding a range of cell
* values, for performance reasons. * values, for performance reasons.
*/ */
SC_DLLPUBLIC void setCell(SCCOL nCol, SCROW nRow, TokenRef pToken, sal_uInt32 nFmtIndex = 0, bool bSetCacheRange = true); SC_DLLPUBLIC void setCell(SCCOL nCol, SCROW nRow, TokenRef pToken, sal_uLong nFmtIndex = 0, bool bSetCacheRange = true);
SC_DLLPUBLIC TokenRef getCell(SCCOL nCol, SCROW nRow, sal_uInt32* pnFmtIndex = NULL) const; SC_DLLPUBLIC TokenRef getCell(SCCOL nCol, SCROW nRow, sal_uInt32* pnFmtIndex = NULL) const;
bool hasRow( SCROW nRow ) const; bool hasRow( SCROW nRow ) const;
/** Set/clear referenced status flag only if current status is not /** Set/clear referenced status flag only if current status is not
...@@ -242,7 +242,7 @@ public: ...@@ -242,7 +242,7 @@ public:
void setRangeNameTokens(sal_uInt16 nFileId, const ::rtl::OUString& rName, TokenArrayRef pArray); void setRangeNameTokens(sal_uInt16 nFileId, const ::rtl::OUString& rName, TokenArrayRef pArray);
void setCellData(sal_uInt16 nFileId, const ::rtl::OUString& rTabName, void setCellData(sal_uInt16 nFileId, const ::rtl::OUString& rTabName,
SCCOL nCol, SCROW nRow, TokenRef pToken, sal_uInt32 nFmtIndex); SCCOL nCol, SCROW nRow, TokenRef pToken, sal_uLong nFmtIndex);
struct SingleRangeData struct SingleRangeData
{ {
...@@ -681,7 +681,7 @@ private: ...@@ -681,7 +681,7 @@ private:
void insertRefCell(sal_uInt16 nFileId, const ScAddress& rCell); void insertRefCell(sal_uInt16 nFileId, const ScAddress& rCell);
void fillCellFormat(sal_uInt32 nFmtIndex, ScExternalRefCache::CellFormat* pFmt) const; void fillCellFormat(sal_uLong nFmtIndex, ScExternalRefCache::CellFormat* pFmt) const;
ScExternalRefCache::TokenRef getSingleRefTokenFromSrcDoc( ScExternalRefCache::TokenRef getSingleRefTokenFromSrcDoc(
sal_uInt16 nFileId, const ScDocument* pSrcDoc, const ScAddress& rCell, sal_uInt16 nFileId, const ScDocument* pSrcDoc, const ScAddress& rCell,
......
...@@ -286,7 +286,7 @@ bool ScExternalRefCache::Table::isReferenced() const ...@@ -286,7 +286,7 @@ bool ScExternalRefCache::Table::isReferenced() const
return meReferenced != UNREFERENCED; return meReferenced != UNREFERENCED;
} }
void ScExternalRefCache::Table::setCell(SCCOL nCol, SCROW nRow, TokenRef pToken, sal_uInt32 nFmtIndex, bool bSetCacheRange) void ScExternalRefCache::Table::setCell(SCCOL nCol, SCROW nRow, TokenRef pToken, sal_uLong nFmtIndex, bool bSetCacheRange)
{ {
using ::std::pair; using ::std::pair;
RowsDataType::iterator itrRow = maRows.find(nRow); RowsDataType::iterator itrRow = maRows.find(nRow);
...@@ -713,7 +713,7 @@ void ScExternalRefCache::setRangeNameTokens(sal_uInt16 nFileId, const OUString& ...@@ -713,7 +713,7 @@ void ScExternalRefCache::setRangeNameTokens(sal_uInt16 nFileId, const OUString&
} }
void ScExternalRefCache::setCellData(sal_uInt16 nFileId, const OUString& rTabName, SCCOL nCol, SCROW nRow, void ScExternalRefCache::setCellData(sal_uInt16 nFileId, const OUString& rTabName, SCCOL nCol, SCROW nRow,
TokenRef pToken, sal_uInt32 nFmtIndex) TokenRef pToken, sal_uLong nFmtIndex)
{ {
if (!isDocInitialized(nFileId)) if (!isDocInitialized(nFileId))
return; return;
...@@ -1643,7 +1643,7 @@ void putCellDataIntoCache( ...@@ -1643,7 +1643,7 @@ void putCellDataIntoCache(
// Now, insert the token into cache table but don't cache empty cells. // Now, insert the token into cache table but don't cache empty cells.
if (pToken->GetType() != formula::svEmptyCell) if (pToken->GetType() != formula::svEmptyCell)
{ {
sal_uInt32 nFmtIndex = (pFmt && pFmt->mbIsSet) ? pFmt->mnIndex : 0; sal_uLong nFmtIndex = (pFmt && pFmt->mbIsSet) ? pFmt->mnIndex : 0;
rRefCache.setCellData(nFileId, rTabName, rCell.Col(), rCell.Row(), pToken, nFmtIndex); rRefCache.setCellData(nFileId, rTabName, rCell.Col(), rCell.Row(), pToken, nFmtIndex);
} }
} }
...@@ -1946,7 +1946,7 @@ void ScExternalRefManager::insertRefCell(sal_uInt16 nFileId, const ScAddress& rC ...@@ -1946,7 +1946,7 @@ void ScExternalRefManager::insertRefCell(sal_uInt16 nFileId, const ScAddress& rC
itr->second.insert(static_cast<ScFormulaCell*>(pCell)); itr->second.insert(static_cast<ScFormulaCell*>(pCell));
} }
void ScExternalRefManager::fillCellFormat(sal_uInt32 nFmtIndex, ScExternalRefCache::CellFormat* pFmt) const void ScExternalRefManager::fillCellFormat(sal_uLong nFmtIndex, ScExternalRefCache::CellFormat* pFmt) const
{ {
if (!pFmt) if (!pFmt)
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment