summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/document.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index ccbaf00ebbe4..f1b03205fe82 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -192,21 +192,22 @@ bool ScDocument::HasTable( SCTAB nTab ) const
bool ScDocument::GetName( SCTAB nTab, OUString& rName ) const
{
if (ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()))
+ {
if (maTabs[nTab])
{
maTabs[nTab]->GetName( rName );
return true;
}
+ }
rName.clear();
return false;
}
OUString ScDocument::GetCopyTabName( SCTAB nTab ) const
{
- if (nTab < static_cast<SCTAB>(maTabNames.size()))
+ if (ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabNames.size()))
return maTabNames[nTab];
- else
- return OUString();
+ return OUString();
}
bool ScDocument::SetCodeName( SCTAB nTab, const OUString& rName )