summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-11-27 11:47:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-11-29 07:58:23 +0100
commit5572f20c0f256140aaab38d3d1b3e53f8588112f (patch)
tree2c66d40f5ae0ae9025fd515d7515ef3f84945333 /include
parenttdf#128659 Cannot add AutoCorrect entries (diff)
downloadcore-5572f20c0f256140aaab38d3d1b3e53f8588112f.tar.gz
core-5572f20c0f256140aaab38d3d1b3e53f8588112f.zip
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 'include')
-rw-r--r--include/sfx2/docfile.hxx27
-rw-r--r--include/sfx2/docinsert.hxx2
2 files changed, 8 insertions, 21 deletions
diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
index 77950a473197..120508b6d91e 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -69,35 +69,22 @@ class SFX2_DLLPUBLIC SfxMedium : public SvRefBase
public:
SfxMedium();
- /**
- * @param pSet Takes ownership
- */
SfxMedium( const OUString &rName,
StreamMode nOpenMode,
std::shared_ptr<const SfxFilter> pFilter = nullptr,
- std::unique_ptr<SfxItemSet> pSet = nullptr );
- /**
- * @param pSet Takes ownership
- */
+ const std::shared_ptr<SfxItemSet>& pSet = nullptr );
SfxMedium( const OUString &rName,
const OUString &rReferer,
StreamMode nOpenMode,
std::shared_ptr<const SfxFilter> pFilter = nullptr,
- std::unique_ptr<SfxItemSet> pSet = nullptr );
-
- /**
- * @param pSet does NOT take ownership
- */
+ const std::shared_ptr<SfxItemSet>& pSet = nullptr );
SfxMedium( const css::uno::Reference< css::embed::XStorage >& xStorage,
- const OUString& rBaseURL,
- const SfxItemSet* pSet=nullptr );
- /**
- * @param pSet does NOT take ownership
- */
+ const OUString& rBaseURL,
+ const std::shared_ptr<SfxItemSet>& pSet = nullptr );
SfxMedium( const css::uno::Reference< css::embed::XStorage >& xStorage,
- const OUString& rBaseURL,
- const OUString& rTypeName,
- const SfxItemSet* pSet=nullptr );
+ const OUString& rBaseURL,
+ const OUString& rTypeName,
+ const std::shared_ptr<SfxItemSet>& pSet = nullptr );
SfxMedium( const css::uno::Sequence< css::beans::PropertyValue >& aArgs );
virtual ~SfxMedium() override;
diff --git a/include/sfx2/docinsert.hxx b/include/sfx2/docinsert.hxx
index 0148b854fed2..ae819299079c 100644
--- a/include/sfx2/docinsert.hxx
+++ b/include/sfx2/docinsert.hxx
@@ -50,7 +50,7 @@ private:
std::unique_ptr<sfx2::FileDialogHelper>
m_pFileDlg;
- std::unique_ptr<SfxItemSet> m_xItemSet;
+ std::shared_ptr<SfxItemSet> m_xItemSet;
std::vector<OUString> m_pURLList;
DECL_LINK(DialogClosedHdl, sfx2::FileDialogHelper*, void);