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
......@@ -107,9 +107,9 @@ public:
struct CellFormat
{
bool mbIsSet;
short mnType;
sal_uInt32 mnIndex;
bool mbIsSet;
short mnType;
sal_uLong mnIndex;
explicit CellFormat();
};
......@@ -118,8 +118,8 @@ private:
/** individual cell within cached external ref table. */
struct Cell
{
TokenRef mxToken;
sal_uInt32 mnFmtIndex;
TokenRef mxToken;
sal_uLong mnFmtIndex;
};
typedef ::boost::unordered_map<SCCOL, Cell> RowDataType;
typedef ::boost::unordered_map<SCROW, RowDataType> RowsDataType;
......@@ -160,7 +160,7 @@ public:
* false _only when_ adding a range of cell
* 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;
bool hasRow( SCROW nRow ) const;
/** Set/clear referenced status flag only if current status is not
......@@ -242,7 +242,7 @@ public:
void setRangeNameTokens(sal_uInt16 nFileId, const ::rtl::OUString& rName, TokenArrayRef pArray);
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
{
......@@ -681,7 +681,7 @@ private:
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(
sal_uInt16 nFileId, const ScDocument* pSrcDoc, const ScAddress& rCell,
......
......@@ -286,7 +286,7 @@ bool ScExternalRefCache::Table::isReferenced() const
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;
RowsDataType::iterator itrRow = maRows.find(nRow);
......@@ -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,
TokenRef pToken, sal_uInt32 nFmtIndex)
TokenRef pToken, sal_uLong nFmtIndex)
{
if (!isDocInitialized(nFileId))
return;
......@@ -1643,7 +1643,7 @@ void putCellDataIntoCache(
// Now, insert the token into cache table but don't cache empty cells.
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);
}
}
......@@ -1946,7 +1946,7 @@ void ScExternalRefManager::insertRefCell(sal_uInt16 nFileId, const ScAddress& rC
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)
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