From 064f4fe82c30118a34c4aeb47bf8604f0b8356a1 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Wed, 13 Apr 2022 08:40:23 +0300 Subject: [PATCH] tdf#139991: move 0-byte file handling to SfxFrameLoader_Impl::load This centralizes the code that handles templates, and allows the empty files to use default templates. This partially reverts commits: ada07f303e7cd1e39c73abe0741aefe7d9d73a57 Author Miklos Vajna Date Wed Oct 28 14:54:52 2020 +0100 tdf#123476 filter: try to detect 0-byte files based on extension 2854362f429e476d4a1ab4759c6a1f1c04150280 Author Mike Kaganski Date Wed Jan 27 16:05:54 2021 +0100 tdf#123476 filter: Also handle empty ODF dff586735b6618d9b011823594a33287d8f7f223 Author Mike Kaganski Date Mon May 03 17:04:04 2021 +0200 tdf#123476: also use filter by extension when its service is the same The unit tests from these commits are retained and extended for templates. Change-Id: I755738d2d5a6d6955d84d6e12f3accc017e0391f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132938 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- filter/CppunitTest_filter_textfilterdetect.mk | 1 + filter/qa/unit/data/calc.ots | Bin 0 -> 9564 bytes filter/qa/unit/data/impress.otp | Bin 0 -> 15382 bytes filter/qa/unit/data/writer.ott | Bin 0 -> 10017 bytes filter/qa/unit/textfilterdetect.cxx | 159 ++++++++++++------ .../source/textfilterdetect/filterdetect.cxx | 53 +----- sfx2/source/doc/objstor.cxx | 12 +- sfx2/source/view/frmload.cxx | 60 +++++++ 8 files changed, 170 insertions(+), 115 deletions(-) create mode 100644 filter/qa/unit/data/calc.ots create mode 100644 filter/qa/unit/data/impress.otp create mode 100644 filter/qa/unit/data/writer.ott diff --git a/filter/CppunitTest_filter_textfilterdetect.mk b/filter/CppunitTest_filter_textfilterdetect.mk index 4066c26591a3..6fb22f8b074e 100644 --- a/filter/CppunitTest_filter_textfilterdetect.mk +++ b/filter/CppunitTest_filter_textfilterdetect.mk @@ -21,6 +21,7 @@ $(eval $(call gb_CppunitTest_use_libraries,filter_textfilterdetect, \ cppu \ cppuhelper \ sal \ + sfx \ test \ textfd \ tl \ diff --git a/filter/qa/unit/data/calc.ots b/filter/qa/unit/data/calc.ots new file mode 100644 index 0000000000000000000000000000000000000000..d16d2307fee94f2657f2b92cdb691c67cad386ff GIT binary patch literal 9564 zcmch7by$?!7WW`3E!`<09a4(YrF3_WFu)+q&?((WE1lBa-R;nw3P=y#5+9uVc|GS` zJ_EaU~So1t!ylfZ9ulRZ-6$ezt<%Ah32gRcK@tJ z^b0L3ODj98JJo;a?N@rX5Fo_v|G`R#rKQw23eNbxxx6No~1Tx_QlLp6(e~(>AtCVRtiI%g9QVR zUaT+kGgPy|@^m`K_(NW~2Flj)=hm-LyDGvEk;p=Y!N)7EL_7maNJeT3kge4BPNx)n z!SgS2Q_GNnRf>)NRTL5L1VfRe`+OkYBz3YHdUj04Bu)(Q? z0Mt+4biXu~>}Y#0y2h9|?-)4Sjdt!YQbp@0vhT=k*1vSRS-WN#ydhjFuCNz16CB7e zzIeY@aX_x}s#snM0kPuLWaI%H0N@P|0Q_tH|H^&Hx9+orIGKTLSscyH<~7YNXSp%1 zoAiJ=EhTVD)U#lGmq71EJJO+tA~SEMvb{c;e59j6rY5DmI)2&I8_CogG@3cTO%dog zNV@CD$~(f}+yI?g_d}F$a>opjThbS``HUT(joPZ4pX%syZE(QMQW3XaIbO6`&<|` zYL*_aYP`eIDT^l<5E{_TeM2S|KPd}o6C;vYI^!%GBy;OGxi0Onte%a6jp=unPcyMA zqsv$YGIDznDtl421*po1FGpFglo~1c#~ZY$VB^%PhPtYZAnnU9#UQmi0kbE% z#Vb2~lX)?JX$BaC_e7P1u@c=(h+qi;chX%fAAjYzc2GbiKg}!3V zBw*a!vc%$nim39J8vHQK_Ie0Oa!~4MW)@lDN`aZ6J>zi^hV&uktR$f)dHJ-;XV+5*zc7`(0t zDyR=I&GY|6DWRE0;Y=hX{Knm8(Vbs@fL=nog4`NUF!giR? zYmb?j&zP{mseYDZ+XjI&XvO=l&;ZFGmp56I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.otp new file mode 100644 index 0000000000000000000000000000000000000000..199a5f9d470fe59d59a7cabaeb8a9478daec4bf9 GIT binary patch literal 15382 zcmbWe1ymi&(l$J}Yj6@Q!QI^*f)m``-F1`T?hrIM!GgOx1b3Io|&$vYr1Eudb+9=2%xYW{U%}{q!5tYa6@xtIEgy_X@E#mC~S-cd4IWJ0V(x)hES?3&$_7IxqQG zhVUP~EbCYM$mCyDnv~kQH&6(f(cui0#C#C1)<|6QeP~30MPrip!CFI=Tg5{)*e4rD zQ*Y>57kpAlN9pi=X>hk_y43a9B6V*GFf1WIPyrGkDqd4?5~hA!-sC{FN0)lsrhq0) zUCBQ|2{)iBS=p}TtR=ioXJ4u1Fc&T95R*F;pa`fJON-#Zka`mT!uAQ>&OEbla@0cX zXLYm-);Eb{!$`@ahA)1|kH4HHI+l+wGvzEt?|cMu3qH;`vo>20!X*wnOEQ51>r703 z?n+H4E2f8whM8h0-==buzqiFgY^}F?z1=+2Q&KgERvNzPJWpar z$48!QJ)oq;dOJoHj1fMKY+h+0Ad{$ZLc3yz!(@kyBPDG3rK;k@D#;c1fjW}hsUdj< zCLlfC*jc5QPZN>qN`j48Dc5Gu;agLGf9XgA-6Th^ld*sALr4rpq^~kGq}H*7rJ;U| zbrVw*Mh?a$1kXp9lfZl&tdQ*vrql# zMoWk>up%92T$oFc#P82gKj){;H>SxTL3rQljoixynm>{|Ee)C|>-8k`!DbFp`BlMF@ z`}O`<_c9}u_?3kz)*fDaj6=}I#!WVD69%+7#NI0n;{X|tAw>COU)3GLTjzRVkC*6? z`UQWe@quS6A%A9^mjgJ6%itpn{ktDQtk90v$c)pK?#SqR48C>w{vH_DAk6^T7b@4m zL;?!G@EvxPtyATKb4>IKsnhz+E^Pl=p(@E_%TzNL#ZW=|t?|=O^xLldf?<%q@`v6* zeSNH~RIzS%`5svJW*}{Zk>MzYInXe(mPHuKu?WfiM`Eb8)^wPuuFeYD=d5JJhnyq= zh1M|j!hYxPY@2=JPf)NBOS96YifkAQpT=6n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Ty!G4czLe=6|b#n*oT`A2NtN9%8c^dAb`hwbk*`ENn~Y0tmd z|PkhGQRPPJXtDw&*vThK~ zFL;?-!%9X>L8_sp-XF^}6e?+qbdzbn9Jyi+P0w&raxzQIoz<{FaHg7Y!Wu;*G{@Rw zVTkO0n}U3`$eEcUgIT4G4S^}H_ln14bc208lkF%;u%}BL)seOCGsR1#22Y0CAAv)Ap3wocr#+lg5jKk`y2+YJ_Bv zI(z!zjDOnC-QwL9;zPZa?up>Zbl;hzg?gyBARb`>em|%3=Lg~Usg=J<{e0EK7{d=z zyl4M@D&^1X|B(Dg#rNZT=r53dOsV`H1&O@p2SDc@xSbmT5 zP{;lt)_Xtv73arP%kNPh=30J`*)LH3ZOY~MV1HIA`xjt8re1!J@@GRY{sQIaDVX2m z{5gPd9{sz4{yY`)52Wvd9Y2qJJT%vTkjy>Ozp}^ul+5=a{x13Rna#sa;s=G^ZzFyT zi2POV=SKg-iOvs#zgOUX% #include #include +#include +#include +#include +#include #include +#include #include #include #include @@ -31,12 +36,8 @@ namespace /// Test class for PlainTextFilterDetect. class TextFilterDetectTest : public test::BootstrapFixture, public unotest::MacrosTest { - uno::Reference mxComponent; - public: void setUp() override; - void tearDown() override; - uno::Reference& getComponent() { return mxComponent; } }; void TextFilterDetectTest::setUp() @@ -46,14 +47,6 @@ void TextFilterDetectTest::setUp() mxDesktop.set(frame::Desktop::create(mxComponentContext)); } -void TextFilterDetectTest::tearDown() -{ - if (mxComponent.is()) - mxComponent->dispose(); - - test::BootstrapFixture::tearDown(); -} - constexpr OUStringLiteral DATA_DIRECTORY = u"/filter/qa/unit/data/"; CPPUNIT_TEST_FIXTURE(TextFilterDetectTest, testTdf114428) @@ -78,68 +71,126 @@ CPPUNIT_TEST_FIXTURE(TextFilterDetectTest, testTdf114428) CPPUNIT_TEST_FIXTURE(TextFilterDetectTest, testEmptyFile) { - // Given an empty file, with a pptx extension - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "empty.pptx"; + const OUString sDataDirectory = m_directories.getURLFromSrc(DATA_DIRECTORY); + auto supportsService = [](const uno::Reference& x, const OUString& s) { + return uno::Reference(x, uno::UNO_QUERY_THROW)->supportsService(s); + }; + // Given an empty file, with a pptx extension // When loading the file - getComponent() = loadFromDesktop(aURL); + auto xComponent = loadFromDesktop(sDataDirectory + "empty.pptx"); // Then make sure it is opened in Impress. - uno::Reference xServiceInfo(getComponent(), uno::UNO_QUERY); - CPPUNIT_ASSERT(xServiceInfo.is()); - // Without the accompanying fix in place, this test would have failed, as it was opened in // Writer instead. - CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.presentation.PresentationDocument")); - - getComponent()->dispose(); + CPPUNIT_ASSERT(supportsService(xComponent, "com.sun.star.presentation.PresentationDocument")); + xComponent->dispose(); // Now also test ODT - aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "empty.odt"; - getComponent() = loadFromDesktop(aURL); - xServiceInfo.set(getComponent(), uno::UNO_QUERY); - CPPUNIT_ASSERT(xServiceInfo.is()); + xComponent = loadFromDesktop(sDataDirectory + "empty.odt"); // Make sure it opens in Writer. - CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.TextDocument")); - getComponent()->dispose(); + CPPUNIT_ASSERT(supportsService(xComponent, "com.sun.star.text.TextDocument")); + xComponent->dispose(); // ... and ODS - aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "empty.ods"; - getComponent() = loadFromDesktop(aURL); - xServiceInfo.set(getComponent(), uno::UNO_QUERY); - CPPUNIT_ASSERT(xServiceInfo.is()); + xComponent = loadFromDesktop(sDataDirectory + "empty.ods"); // Make sure it opens in Calc. - CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.sheet.SpreadsheetDocument")); - getComponent()->dispose(); + CPPUNIT_ASSERT(supportsService(xComponent, "com.sun.star.sheet.SpreadsheetDocument")); + xComponent->dispose(); // ... and ODP - aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "empty.odp"; - getComponent() = loadFromDesktop(aURL); - xServiceInfo.set(getComponent(), uno::UNO_QUERY); - CPPUNIT_ASSERT(xServiceInfo.is()); + xComponent = loadFromDesktop(sDataDirectory + "empty.odp"); // Without the accompanying fix in place, this test would have failed, as it was opened in // Writer instead. - CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.presentation.PresentationDocument")); - getComponent()->dispose(); + CPPUNIT_ASSERT(supportsService(xComponent, "com.sun.star.presentation.PresentationDocument")); + xComponent->dispose(); // ... and DOC - aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "empty.doc"; // Without the accompanying fix in place, this test would have failed, the import filter aborted // loading. - getComponent() = loadFromDesktop(aURL); - xServiceInfo.set(getComponent(), uno::UNO_QUERY); - CPPUNIT_ASSERT(xServiceInfo.is()); - CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.TextDocument")); - uno::Reference xModel(getComponent(), uno::UNO_QUERY); - uno::Sequence aArgs = xModel->getArgs(); - comphelper::SequenceAsHashMap aMap(aArgs); - OUString aFilterName; - aMap["FilterName"] >>= aFilterName; - // Without the accompanying fix in place, this test would have failed with: - // - Expected: MS Word 97 - // - Actual : MS WinWord 6.0 - // i.e. opening worked, but saving back failed instead of producing a WW8 binary file. - CPPUNIT_ASSERT_EQUAL(OUString("MS Word 97"), aFilterName); + xComponent = loadFromDesktop(sDataDirectory + "empty.doc"); + CPPUNIT_ASSERT(supportsService(xComponent, "com.sun.star.text.TextDocument")); + { + uno::Reference xModel(xComponent, uno::UNO_QUERY); + uno::Sequence aArgs = xModel->getArgs(); + comphelper::SequenceAsHashMap aMap(aArgs); + OUString aFilterName; + aMap["FilterName"] >>= aFilterName; + // Without the accompanying fix in place, this test would have failed with: + // - Expected: MS Word 97 + // - Actual : MS WinWord 6.0 + // i.e. opening worked, but saving back failed instead of producing a WW8 binary file. + CPPUNIT_ASSERT_EQUAL(OUString("MS Word 97"), aFilterName); + } + xComponent->dispose(); + + // Now test with default templates set + + SfxObjectFactory::SetStandardTemplate("com.sun.star.presentation.PresentationDocument", + sDataDirectory + "impress.otp"); + SfxObjectFactory::SetStandardTemplate("com.sun.star.text.TextDocument", + sDataDirectory + "writer.ott"); + SfxObjectFactory::SetStandardTemplate("com.sun.star.sheet.SpreadsheetDocument", + sDataDirectory + "calc.ots"); + + xComponent = loadFromDesktop(sDataDirectory + "empty.pptx"); + { + uno::Reference xDoc(xComponent, uno::UNO_QUERY_THROW); + uno::Reference xPages(xDoc->getDrawPages(), uno::UNO_SET_THROW); + uno::Reference xPage(xPages->getByIndex(0), uno::UNO_QUERY_THROW); + uno::Reference xBox(xPage->getByIndex(0), uno::UNO_QUERY_THROW); + + // Make sure the template's text was loaded + CPPUNIT_ASSERT_EQUAL(OUString("Title of Impress template"), xBox->getString()); + } + xComponent->dispose(); + + xComponent = loadFromDesktop(sDataDirectory + "empty.odt"); + { + uno::Reference xDoc(xComponent, uno::UNO_QUERY_THROW); + uno::Reference xEA(xDoc->getText(), uno::UNO_QUERY_THROW); + uno::Reference xEnum(xEA->createEnumeration(), uno::UNO_SET_THROW); + uno::Reference xParagraph(xEnum->nextElement(), uno::UNO_QUERY_THROW); + + // Make sure the template's text was loaded + CPPUNIT_ASSERT_EQUAL(OUString(u"Writer template’s first line"), xParagraph->getString()); + } + xComponent->dispose(); + + xComponent = loadFromDesktop(sDataDirectory + "empty.ods"); + { + uno::Reference xDoc(xComponent, uno::UNO_QUERY_THROW); + uno::Reference xRA(xDoc->getSheets(), uno::UNO_QUERY_THROW); + uno::Reference xC(xRA->getCellByPosition(0, 0, 0), uno::UNO_QUERY_THROW); + + // Make sure the template's text was loaded + CPPUNIT_ASSERT_EQUAL(OUString(u"Calc template’s first cell"), xC->getString()); + } + xComponent->dispose(); + + xComponent = loadFromDesktop(sDataDirectory + "empty.odp"); + { + uno::Reference xDoc(xComponent, uno::UNO_QUERY_THROW); + uno::Reference xPages(xDoc->getDrawPages(), uno::UNO_SET_THROW); + uno::Reference xPage(xPages->getByIndex(0), uno::UNO_QUERY_THROW); + uno::Reference xBox(xPage->getByIndex(0), uno::UNO_QUERY_THROW); + + // Make sure the template's text was loaded + CPPUNIT_ASSERT_EQUAL(OUString("Title of Impress template"), xBox->getString()); + } + xComponent->dispose(); + + xComponent = loadFromDesktop(sDataDirectory + "empty.doc"); + { + uno::Reference xDoc(xComponent, uno::UNO_QUERY_THROW); + uno::Reference xEA(xDoc->getText(), uno::UNO_QUERY_THROW); + uno::Reference xEnum(xEA->createEnumeration(), uno::UNO_SET_THROW); + uno::Reference xParagraph(xEnum->nextElement(), uno::UNO_QUERY_THROW); + + // Make sure the template's text was loaded + CPPUNIT_ASSERT_EQUAL(OUString(u"Writer template’s first line"), xParagraph->getString()); + } + xComponent->dispose(); } } diff --git a/filter/source/textfilterdetect/filterdetect.cxx b/filter/source/textfilterdetect/filterdetect.cxx index 0edbb1f4cc47..9d25e289ec89 100644 --- a/filter/source/textfilterdetect/filterdetect.cxx +++ b/filter/source/textfilterdetect/filterdetect.cxx @@ -20,8 +20,6 @@ #include #include #include -#include -#include constexpr OUStringLiteral WRITER_TEXT_FILTER = u"Text"; constexpr OUStringLiteral CALC_TEXT_FILTER = u"Text - txt - csv (StarCalc)"; @@ -129,45 +127,6 @@ bool IsHTMLStream( const uno::Reference& xInStream ) OString aToken = sHeader.copy( nStartOfTagIndex, i - nStartOfTagIndex ); return GetHTMLToken( OStringToOUString( aToken.toAsciiLowerCase(), RTL_TEXTENCODING_ASCII_US ) ) != HtmlTokenId::NONE; } - -/** - * Given an (empty) file URL in rMediaDesc and rExt, looks up the best filter type for it and - * writes the type name to rType, the filter name to rMediaDesc. - */ -bool HandleEmptyFileUrlByExtension(MediaDescriptor& rMediaDesc, const OUString& rExt, - OUString& rType, OUString& rService) -{ - OUString aURL = rMediaDesc.getUnpackedValueOrDefault(MediaDescriptor::PROP_URL, OUString()); - if (!tools::isEmptyFileUrl(aURL)) - { - return false; - } - - if (rExt.isEmpty()) - { - return false; - } - - // Requiring the export+preferred flags helps to find the relevant filter, e.g. .doc -> WW8 (and - // not WW6 or Mac_Word). - SfxFilterFlags nMust - = SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | SfxFilterFlags::PREFERED; - std::shared_ptr pFilter(SfxFilterMatcher().GetFilter4Extension(rExt, nMust)); - if (!pFilter) - { - // retry without PREFERRED so we can find at least something for 0-byte *.ods - nMust = SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT; - pFilter = SfxFilterMatcher().GetFilter4Extension(rExt, nMust); - - if (!pFilter) - return false; - } - - rMediaDesc[MediaDescriptor::PROP_FILTERNAME] <<= pFilter->GetFilterName(); - rType = pFilter->GetTypeName(); - rService = pFilter->GetServiceName(); - return true; -} } PlainTextFilterDetect::PlainTextFilterDetect() {} @@ -226,15 +185,7 @@ OUString SAL_CALL PlainTextFilterDetect::detect(uno::Sequence& xStorage bool SfxObjectShell::Load( SfxMedium& rMedium ) { - return GeneralInit_Impl(rMedium.GetStorage(), !tools::isEmptyFileUrl(rMedium.GetName())); + return GeneralInit_Impl(rMedium.GetStorage(), true); } void SfxObjectShell::DoInitUnitTest() @@ -662,9 +662,7 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed ) bWarnMediaTypeFallback = false; } - if (bWarnMediaTypeFallback - || (!tools::isEmptyFileUrl(pMedium->GetName()) - && !xStorage->getElementNames().hasElements())) + if (bWarnMediaTypeFallback || !xStorage->getElementNames().hasElements()) SetError(ERRCODE_IO_BROKENPACKAGE); } catch( uno::Exception& ) @@ -2260,11 +2258,7 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium, // #i119492# During loading, some OLE objects like chart will be set // modified flag, so needs to reset the flag to false after loading - bool bRtn = true; - if (!tools::isEmptyFileUrl(rMedium.GetName())) - { - bRtn = xLoader->filter(aArgs); - } + bool bRtn = xLoader->filter(aArgs); const uno::Sequence < OUString > aNames = GetEmbeddedObjectContainer().GetObjectNames(); for ( const auto& rName : aNames ) { diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index 91b045b2f1a3..bd0329fb2ac3 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -55,8 +56,11 @@ #include #include #include +#include #include #include +#include +#include #include using namespace com::sun::star; @@ -585,6 +589,25 @@ Reference< XController2 > SfxFrameLoader_Impl::impl_createDocumentView( const Re return xController; } +std::shared_ptr getEmptyURLFilter(const OUString& sURL) +{ + INetURLObject aParser(sURL); + const OUString aExt = aParser.getExtension(INetURLObject::LAST_SEGMENT, true, + INetURLObject::DecodeMechanism::WithCharset); + const SfxFilterMatcher& rMatcher = SfxGetpApp()->GetFilterMatcher(); + + // Requiring the export+preferred flags helps to find the relevant filter, e.g. .doc -> WW8 (and + // not WW6 or Mac_Word). + std::shared_ptr pFilter = rMatcher.GetFilter4Extension( + aExt, SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | SfxFilterFlags::PREFERED); + if (!pFilter) + { + // retry without PREFERED so we can find at least something for 0-byte *.ods + pFilter + = rMatcher.GetFilter4Extension(aExt, SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT); + } + return pFilter; +} sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rArgs, const Reference< XFrame >& _rTargetFrame ) @@ -608,6 +631,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA // check for factory URLs to create a new doc, instead of loading one const OUString sURL = aDescriptor.getOrDefault( "URL", OUString() ); const bool bIsFactoryURL = sURL.startsWith( "private:factory/" ); + std::shared_ptr pEmptyURLFilter; bool bInitNewModel = bIsFactoryURL; const bool bIsDefault = bIsFactoryURL && !bExternalModel; if (!aDescriptor.has("Replaceable")) @@ -640,6 +664,28 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA { // compatibility aDescriptor.put( "FileName", aDescriptor.get( "URL" ) ); + + if (!bIsFactoryURL && !bExternalModel && tools::isEmptyFileUrl(sURL)) + { + pEmptyURLFilter = getEmptyURLFilter(sURL); + if (pEmptyURLFilter) + { + aDescriptor.put("DocumentService", pEmptyURLFilter->GetServiceName()); + if (impl_determineTemplateDocument(aDescriptor)) + { + // if the media descriptor allowed us to determine a template document + // to create the new document from, then do not init a new document model + // from scratch (below), but instead load the template document + bInitNewModel = false; + // Do not try to load from empty UCB content + aDescriptor.remove("UCBContent"); + } + else + { + bInitNewModel = true; + } + } + } } bool bLoadSuccess = false; @@ -692,6 +738,20 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA const SfxObjectShellRef xDoc = impl_findObjectShell( xModel ); ENSURE_OR_THROW( xDoc.is(), "no SfxObjectShell for the given model" ); + if (pEmptyURLFilter) + { + // Detach the medium from the template, and set proper document name and filter + auto pMedium = xDoc->GetMedium(); + auto pItemSet = pMedium->GetItemSet(); + pItemSet->ClearItem(SID_TEMPLATE); + pItemSet->Put(SfxStringItem(SID_FILTER_NAME, pEmptyURLFilter->GetFilterName())); + pMedium->SetName(sURL, true); + pMedium->SetFilter(pEmptyURLFilter); + pMedium->GetInitFileDate(true); + xDoc->SetLoading(SfxLoadedFlags::NONE); + xDoc->FinishedLoading(); + } + // ensure the ID of the to-be-created view is in the descriptor, if possible const SfxInterfaceId nViewId = impl_determineEffectiveViewId_nothrow( *xDoc, aDescriptor ); const sal_Int16 nViewNo = xDoc->GetFactory().GetViewNo_Impl( nViewId, 0 );