summaryrefslogtreecommitdiff
path: root/sc/source/ui/docshell
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-05-23 14:11:21 +0200
committerEike Rathke <erack@redhat.com>2016-05-23 16:21:56 +0200
commit43030487c45f49bccdfad987c60d9483b938ebac (patch)
tree851e8fe4cdc1d8b6b8733d4f6523c817cb5db41b /sc/source/ui/docshell
parent81a8d1250319023f6ca272e0b233ef638cae40f7 (diff)
Resolves: tdf#86282 do not use file name as sheet name for linked documents
... and external references. Change-Id: I6e23eeff39086091f13914a3f964aec1016a7de4
Diffstat (limited to 'sc/source/ui/docshell')
-rw-r--r--sc/source/ui/docshell/docsh.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index de05c84cc7cc..6559d9f9d836 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -1199,8 +1199,15 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
aDocument.StartAllListeners();
sc::SetFormulaDirtyContext aCxt;
aDocument.SetAllFormulasDirty(aCxt);
- INetURLObject aURLObjForDefaultNameSheetName(rMedium.GetName());
- aDocument.RenameTab(0,aURLObjForDefaultNameSheetName.GetBase());
+ if (GetCreateMode() != SfxObjectCreateMode::INTERNAL)
+ {
+ // ScDocShell was not created with
+ // SfxModelFlags::EXTERNAL_LINK for which we do not
+ // want Sheet1 renamed in order to get predictable
+ // sheet names for external references.
+ INetURLObject aURLObjForDefaultNameSheetName(rMedium.GetName());
+ aDocument.RenameTab(0,aURLObjForDefaultNameSheetName.GetBase());
+ }
bOverflowRow = aImpEx.IsOverflowRow();
bOverflowCol = aImpEx.IsOverflowCol();
bOverflowCell = aImpEx.IsOverflowCell();