diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-08-28 20:42:20 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-08-28 21:37:00 -0400 |
commit | 902e3898d385875029fda3b42c1854b159a18483 (patch) | |
tree | 13e6afaa2dbc14bbc78f74871c9c2b47d75ad837 /sc | |
parent | 1298c1d13572c6fbfbabb813b2d6843368c6df1f (diff) |
Make some methods non-inline, and add method descriptions.
Change-Id: Ib8d5fa666827a7f97035ad37d05e305bb920c300
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/document.hxx | 4 | ||||
-rw-r--r-- | sc/inc/dpcache.hxx | 20 | ||||
-rw-r--r-- | sc/inc/dpobject.hxx | 14 | ||||
-rw-r--r-- | sc/source/core/data/documen3.cxx | 5 | ||||
-rw-r--r-- | sc/source/core/data/dpcache.cxx | 20 | ||||
-rw-r--r-- | sc/source/core/data/dpobject.cxx | 37 |
6 files changed, 87 insertions, 13 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 6bfb13887176..fb0352110528 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -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; diff --git a/sc/inc/dpcache.hxx b/sc/inc/dpcache.hxx index 06f66c0b7788..63242435a7db 100644 --- a/sc/inc/dpcache.hxx +++ b/sc/inc/dpcache.hxx @@ -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; diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx index 12b83edcbf1c..1ff70249ae16 100644 --- a/sc/inc/dpobject.hxx +++ b/sc/inc/dpobject.hxx @@ -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; diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index 7a2bc044f8c2..61ac5f807971 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -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) diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx index 96435573617c..e9687c5f409f 100644 --- a/sc/source/core/data/dpcache.cxx +++ b/sc/source/core/data/dpcache.cxx @@ -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) diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 481541e3c881..458720998cf1 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -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(); |