diff options
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/data/document.cxx | 13 | ||||
-rw-r--r-- | sc/source/core/data/table1.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 7 |
3 files changed, 25 insertions, 0 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index f207610d3013..95c7ae5dca12 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -192,6 +192,19 @@ bool ScDocument::HasTable( SCTAB nTab ) const return false; } +bool ScDocument::GetHashCode( SCTAB nTab, sal_Int64& rHashCode ) const +{ + if (ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size())) + { + if (maTabs[nTab]) + { + rHashCode = maTabs[nTab]->GetHashCode(); + return true; + } + } + return false; +} + bool ScDocument::GetName( SCTAB nTab, OUString& rName ) const { if (ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size())) diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index d93d1f4d7ed3..be738f9c5a6e 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -354,6 +354,11 @@ ScTable::~ScTable() aCol[k].PrepareBroadcastersForDestruction(); } +sal_Int64 ScTable::GetHashCode() const +{ + return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); +} + void ScTable::GetName( OUString& rName ) const { rName = aName; diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index cba78bd63e70..f03768d1ec48 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -523,6 +523,13 @@ OUString ScModelObj::getPartName( int nPart ) return sTabName; } +OUString ScModelObj::getPartHash( int nPart ) +{ + sal_Int64 nHashCode; + ScViewData* pViewData = ScDocShell::GetViewData(); + return (pViewData->GetDocument()->GetHashCode(nPart, nHashCode) ? OUString::number(nHashCode) : OUString()); +} + Size ScModelObj::getDocumentSize() { Size aSize(10, 10); // minimum size |