diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-11-27 11:47:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-11-29 07:58:23 +0100 |
commit | 5572f20c0f256140aaab38d3d1b3e53f8588112f (patch) | |
tree | 2c66d40f5ae0ae9025fd515d7515ef3f84945333 /sw | |
parent | c883980f994208e4c1b47d1f09828f661b42258f (diff) |
tdf#128898 import text from file with text-decode failed
regression from
commit 8f6f9e4217d03d874fb1ce391730a1c893ab6844
tdf#127958 crash adding 2 or more files into writer master document
just make SfxMedium use shared_ptr, rather than the sometimes yes,
sometimes no, ownership.
Reviewed-on: https://gerrit.libreoffice.org/83930
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
(cherry picked from commit cc4dbe473b0b68dbe120065c1d6a64a087f41ba2)
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
63a4230a96f9dae7726d854297ebb2b51df4868d
Change-Id: I77559e9f766d84aca0f9dc0bd1b856c69f0f62f1
Reviewed-on: https://gerrit.libreoffice.org/84029
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/unocore/unocrsrhelper.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 2e935b87477c..7581c46b16e9 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -1023,8 +1023,8 @@ void InsertFile(SwUnoCursor* pUnoCursor, const OUString& rURL, } else pMed.reset(xReadStorage.is() ? - new SfxMedium(xReadStorage, sBaseURL, nullptr ) : - new SfxMedium(sFileName, StreamMode::READ, nullptr, nullptr )); + new SfxMedium(xReadStorage, sBaseURL ) : + new SfxMedium(sFileName, StreamMode::READ )); if( !sBaseURL.isEmpty() ) pMed->GetItemSet()->Put( SfxStringItem( SID_DOC_BASEURL, sBaseURL ) ); @@ -1046,7 +1046,7 @@ void InsertFile(SwUnoCursor* pUnoCursor, const OUString& rURL, { if( xReadStorage.is() ) { - pMed.reset(new SfxMedium(xReadStorage, sBaseURL, nullptr )); + pMed.reset(new SfxMedium(xReadStorage, sBaseURL )); pMed->SetFilter( pFilter ); } else |