summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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();