diff options
Diffstat (limited to 'sc/source/ui/docshell/externalrefmgr.cxx')
-rw-r--r-- | sc/source/ui/docshell/externalrefmgr.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index 0569e95605b1..7fa31246275a 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -2024,7 +2024,7 @@ SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, Stri if (!isFileLoadable(aFile)) return NULL; - String aOptions; + String aOptions( pFileData->maFilterOptions ); ScDocumentLoader::GetFilterName(aFile, rFilter, aOptions, true, false); const SfxFilter* pFilter = ScDocShell::Factory().GetFilterContainer()->GetFilter4FilterName(rFilter); @@ -2040,9 +2040,6 @@ SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, Stri setRelativeFileName(nFileId, aStr); } - // Update the filter data now that we are loading it again. - setFilterData(nFileId, rFilter, aOptions); - SfxItemSet* pSet = new SfxAllItemSet(SFX_APP()->GetPool()); if (aOptions.Len()) pSet->Put(SfxStringItem(SID_FILE_FILTEROPTIONS, aOptions)); @@ -2077,6 +2074,13 @@ SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, Stri pExtOptNew->GetDocSettings().mnLinkCnt = nLinkCount + 1; pNewShell->DoLoad(pMedium.release()); + + // with UseInteractionHandler, options may be set by dialog during DoLoad + String aNew = ScDocumentLoader::GetOptions(*pNewShell->GetMedium()); + if (aNew.Len() && aNew != aOptions) + aOptions = aNew; + setFilterData(nFileId, rFilter, aOptions); // update the filter data, including the new options + return aRef; } |