summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-04-07 16:45:38 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-04-07 16:56:13 +0100
commitb56b5d449fc74809fddc9b9bbd1d9f8d244a0d10 (patch)
tree019a9b8b460e61df03b38df53646d0ba4cb78d10 /sc
parentc0c40e35948ce41754676bc3b6da358c3e9c18ed (diff)
fix crash on re-export of fdo64646-4.xls back to xls
Change-Id: Ic6d6e7d7d8d42af0fc739d964a1190d40f9dba2e
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/document.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index c3a2f8e7f82e..170d202bc265 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -3535,17 +3535,19 @@ sal_uInt32 ScDocument::GetNumberFormat( const ScRange& rRange ) const
sal_uInt32 ScDocument::GetNumberFormat( const ScAddress& rPos ) const
{
SCTAB nTab = rPos.Tab();
- if ( maTabs[nTab] )
- return maTabs[nTab]->GetNumberFormat( rPos );
- return 0;
+ if (!TableExists(nTab))
+ return 0;
+
+ return maTabs[nTab]->GetNumberFormat( rPos );
}
void ScDocument::SetNumberFormat( const ScAddress& rPos, sal_uInt32 nNumberFormat )
{
- if (!TableExists(rPos.Tab()))
+ SCTAB nTab = rPos.Tab();
+ if (!TableExists(nTab))
return;
- maTabs[rPos.Tab()]->SetNumberFormat(rPos.Col(), rPos.Row(), nNumberFormat);
+ maTabs[nTab]->SetNumberFormat(rPos.Col(), rPos.Row(), nNumberFormat);
}
void ScDocument::GetNumberFormatInfo( short& nType, sal_uLong& nIndex,