summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-11-28 19:46:26 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-11-28 22:21:05 +0100
commit0c4736a3e6b6e641579f517cf134ce2fd89fe132 (patch)
tree8ced01f0248f5a91b9d63a10edfccf854b9bbe17
parentaec49ceb877f3f3d79a77e60022ab08655798020 (diff)
Resolves: tdf#129082 insert sheet from file fails
since... tdf#127958 crash adding 2 or more files into writer master document commit 8f6f9e4217d03d874fb1ce391730a1c893ab6844 Date: Mon Oct 7 09:40:41 2019 +0200 used the SfxItemSet copy ctor to make a copy of the itemset, but the orig itemset was a SfxAllItemSet not a SfxItemSet. an SfxAllItemSet allows all items to be added but a plain SfxItemSet only allows items in certain ranges to be inserted. Upshot is that later on the filename property cannot be set in the itemset, so file can't be opened. since... tdf#128898 import text from file with text-decode failed commit cc4dbe473b0b68dbe120065c1d6a64a087f41ba2 Date: Wed Nov 27 11:47:57 2019 +0200 tdf#128898 import text from file with text-decode failed these are std::shared_ptr so we can return to passing in the original SfxAllItemSet again to fix the problem Change-Id: I63a4230a96f9dae7726d854297ebb2b51df4868d Reviewed-on: https://gerrit.libreoffice.org/84024 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sfx2/source/doc/docinsert.cxx10
1 files changed, 2 insertions, 8 deletions
diff --git a/sfx2/source/doc/docinsert.cxx b/sfx2/source/doc/docinsert.cxx
index ec25e6a39fd5..7b7fa8516e95 100644
--- a/sfx2/source/doc/docinsert.cxx
+++ b/sfx2/source/doc/docinsert.cxx
@@ -105,12 +105,9 @@ std::unique_ptr<SfxMedium> DocumentInserter::CreateMedium(char const*const pFall
if (!m_nError && m_xItemSet && !m_pURLList.empty())
{
DBG_ASSERT( m_pURLList.size() == 1, "DocumentInserter::CreateMedium(): invalid URL list count" );
- std::unique_ptr<SfxItemSet> xItemSet;
- if (m_xItemSet)
- xItemSet = std::make_unique<SfxItemSet>(*m_xItemSet);
pMedium.reset(new SfxMedium(
m_pURLList[0], SFX_STREAM_READONLY,
- SfxGetpApp()->GetFilterMatcher().GetFilter4FilterName( m_sFilter ), std::move(xItemSet) ));
+ SfxGetpApp()->GetFilterMatcher().GetFilter4FilterName( m_sFilter ), m_xItemSet ));
pMedium->UseInteractionHandler( true );
std::unique_ptr<SfxFilterMatcher> pMatcher;
if ( !m_sDocFactory.isEmpty() )
@@ -145,12 +142,9 @@ SfxMediumList DocumentInserter::CreateMediumList()
{
for (auto const& url : m_pURLList)
{
- std::unique_ptr<SfxItemSet> xItemSet;
- if (m_xItemSet)
- xItemSet = std::make_unique<SfxItemSet>(*m_xItemSet);
std::unique_ptr<SfxMedium> pMedium(new SfxMedium(
url, SFX_STREAM_READONLY,
- SfxGetpApp()->GetFilterMatcher().GetFilter4FilterName( m_sFilter ), std::move(xItemSet) ));
+ SfxGetpApp()->GetFilterMatcher().GetFilter4FilterName( m_sFilter ), m_xItemSet ));
pMedium->UseInteractionHandler( true );