summaryrefslogtreecommitdiff
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:26 +0100
commitf3d4c125775b00432a2ef8db329c23c793abc40f (patch)
tree64da0e1b0638fde5bc5502c8a97347e5dd616ecd /include
parent09e86f7cef6ca3e2ca451cbbae439006820c71d4 (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 Reviewed-on: https://gerrit.libreoffice.org/84024 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> Change-Id: I77559e9f766d84aca0f9dc0bd1b856c69f0f62f1 Reviewed-on: https://gerrit.libreoffice.org/84025 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 ab2ea96aba28..2019b5738c01 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -69,35 +69,22 @@ class SFX2_DLLPUBLIC SfxMedium final : 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);