Kaydet (Commit) 902e3898 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Make some methods non-inline, and add method descriptions.

Change-Id: Ib8d5fa666827a7f97035ad37d05e305bb920c300
üst 1298c1d1
......@@ -551,9 +551,9 @@ public:
SC_DLLPUBLIC const ScRangeData* GetRangeAtBlock( const ScRange& rBlock, OUString* pName=NULL ) const;
bool HasPivotTable() const;
SC_DLLPUBLIC bool HasPivotTable() const;
SC_DLLPUBLIC ScDPCollection* GetDPCollection();
const ScDPCollection* GetDPCollection() const { return pDPCollection; }
SC_DLLPUBLIC const ScDPCollection* GetDPCollection() const;
SC_DLLPUBLIC ScDPObject* GetDPAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab) const;
ScDPObject* GetDPAtBlock( const ScRange& rBlock ) const;
......
......@@ -118,7 +118,7 @@ private:
GroupFieldsType maGroupFields;
mutable StringSetType maStringPool;
LabelsType maLabelNames; // Stores dimension names.
LabelsType maLabelNames; // Stores dimension names and the data layout dimension name at position 0.
mdds::flat_segment_tree<SCROW, bool> maEmptyRows;
SCROW mnDataSize;
SCROW mnRowCount;
......@@ -129,7 +129,7 @@ public:
const OUString* InternString(const OUString& rStr) const;
void AddReference(ScDPObject* pObj) const;
void RemoveReference(ScDPObject* pObj) const;
const ObjectSetType& GetAllReferences() const { return maRefObjects;}
const ObjectSetType& GetAllReferences() const;
SCROW GetIdByItemData(long nDim, const ScDPItemData& rItem) const;
OUString GetFormattedString(long nDim, const ScDPItemData& rItem) const;
......@@ -160,15 +160,25 @@ public:
bool InitFromDoc(ScDocument* pDoc, const ScRange& rRange);
bool InitFromDataBase(DBConnector& rDB);
SCROW GetRowCount() const { return mnRowCount;}
/**
* Row count is the number of records plus any trailing empty rows in case
* the source data is sheet and contains trailing empty rows.
*/
SCROW GetRowCount() const;
/**
* Data size is the number of records without any trailing empty rows for
* sheet source data. For any other source type, this should equal the
* row count.
*/
SCROW GetDataSize() const;
SCROW GetItemDataId( sal_uInt16 nDim, SCROW nRow, bool bRepeatIfEmpty ) const;
OUString GetDimensionName(LabelsType::size_type nDim) const;
bool IsRowEmpty(SCROW nRow) const;
bool ValidQuery(SCROW nRow, const ScQueryParam& rQueryParam) const;
ScDocument* GetDoc() const { return mpDoc;}
long GetColumnCount() const { return mnColumnCount;}
ScDocument* GetDoc() const;
long GetColumnCount() const;
const ScDPItemData* GetItemDataById( long nDim, SCROW nId ) const;
......
......@@ -130,13 +130,14 @@ public:
void Output( const ScAddress& rPos );
ScRange GetNewOutputRange( bool& rOverflow );
const ScRange GetOutputRangeByType( sal_Int32 nType );
ScRange GetOutputRangeByType( sal_Int32 nType );
void SetSaveData(const ScDPSaveData& rData);
ScDPSaveData* GetSaveData() const { return pSaveData; }
void SetOutRange(const ScRange& rRange);
const ScRange& GetOutRange() const { return aOutRange; }
const ScRange& GetOutRange() const;
void SetHeaderLayout(bool bUseGrid);
bool GetHeaderLayout() const { return mbHeaderLayout;}
......@@ -394,9 +395,12 @@ public:
void FreeTable(ScDPObject* pDPObj);
SC_DLLPUBLIC bool InsertNewTable(ScDPObject* pDPObj);
SheetCaches& GetSheetCaches() { return maSheetCaches;}
NameCaches& GetNameCaches() { return maNameCaches;}
DBCaches& GetDBCaches() { return maDBCaches;}
SC_DLLPUBLIC SheetCaches& GetSheetCaches();
SC_DLLPUBLIC const SheetCaches& GetSheetCaches() const;
NameCaches& GetNameCaches();
SC_DLLPUBLIC const NameCaches& GetNameCaches() const;
DBCaches& GetDBCaches();
SC_DLLPUBLIC const DBCaches& GetDBCaches() const;
ScRangeList GetAllTableRanges( SCTAB nTab ) const;
bool IntersectsTableByColumns( SCCOL nCol1, SCCOL nCol2, SCROW nRow, SCTAB nTab ) const;
......
......@@ -323,6 +323,11 @@ ScDPCollection* ScDocument::GetDPCollection()
return pDPCollection;
}
const ScDPCollection* ScDocument::GetDPCollection() const
{
return pDPCollection;
}
ScDPObject* ScDocument::GetDPAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab) const
{
if (!pDPCollection)
......
......@@ -646,6 +646,16 @@ bool ScDPCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam) const
return bRet;
}
ScDocument* ScDPCache::GetDoc() const
{
return mpDoc;
}
long ScDPCache::GetColumnCount() const
{
return mnColumnCount;
}
bool ScDPCache::IsRowEmpty(SCROW nRow) const
{
bool bEmpty = true;
......@@ -829,6 +839,11 @@ size_t ScDPCache::GetGroupFieldCount() const
return maGroupFields.size();
}
SCROW ScDPCache::GetRowCount() const
{
return mnRowCount;
}
SCROW ScDPCache::GetDataSize() const
{
OSL_ENSURE(mnDataSize <= GetRowCount(), "Data size should never be larger than the row count.");
......@@ -907,6 +922,11 @@ void ScDPCache::RemoveReference(ScDPObject* pObj) const
mpDoc->GetDPCollection()->RemoveCache(this);
}
const ScDPCache::ObjectSetType& ScDPCache::GetAllReferences() const
{
return maRefObjects;
}
SCROW ScDPCache::GetIdByItemData(long nDim, const ScDPItemData& rItem) const
{
if (nDim < 0)
......
......@@ -416,6 +416,11 @@ void ScDPObject::SetOutRange(const ScRange& rRange)
pOutput->SetPosition( rRange.aStart );
}
const ScRange& ScDPObject::GetOutRange() const
{
return aOutRange;
}
void ScDPObject::SetSheetDesc(const ScSheetSourceDesc& rDesc, bool /*bFromRefUpdate*/)
{
if ( pSheetDesc && rDesc == *pSheetDesc )
......@@ -921,7 +926,7 @@ void ScDPObject::Output( const ScAddress& rPos )
pDoc->ApplyFlagsTab(s.Col(), s.Row(), e.Col(), e.Row(), s.Tab(), SC_MF_DP_TABLE);
}
const ScRange ScDPObject::GetOutputRangeByType( sal_Int32 nType )
ScRange ScDPObject::GetOutputRangeByType( sal_Int32 nType )
{
CreateOutput();
......@@ -3611,6 +3616,36 @@ bool ScDPCollection::InsertNewTable(ScDPObject* pDPObj)
return true;
}
ScDPCollection::SheetCaches& ScDPCollection::GetSheetCaches()
{
return maSheetCaches;
}
const ScDPCollection::SheetCaches& ScDPCollection::GetSheetCaches() const
{
return maSheetCaches;
}
ScDPCollection::NameCaches& ScDPCollection::GetNameCaches()
{
return maNameCaches;
}
const ScDPCollection::NameCaches& ScDPCollection::GetNameCaches() const
{
return maNameCaches;
}
ScDPCollection::DBCaches& ScDPCollection::GetDBCaches()
{
return maDBCaches;
}
const ScDPCollection::DBCaches& ScDPCollection::GetDBCaches() const
{
return maDBCaches;
}
ScRangeList ScDPCollection::GetAllTableRanges( SCTAB nTab ) const
{
return std::for_each(maTables.begin(), maTables.end(), AccumulateOutputRanges(nTab)).getRanges();
......
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