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-28 08:30:09 +0100 |
commit | cc4dbe473b0b68dbe120065c1d6a64a087f41ba2 (patch) | |
tree | 4a79023e31188c96819beaedb8f48bc52b7e1d28 /sfx2/source/doc | |
parent | 2bf687bebb30defe576ddb20c1c9680979ed3086 (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.
Change-Id: I77559e9f766d84aca0f9dc0bd1b856c69f0f62f1
Reviewed-on: https://gerrit.libreoffice.org/83930
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/doc')
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 14 | ||||
-rw-r--r-- | sfx2/source/doc/sfxbasemodel.cxx | 8 |
2 files changed, 11 insertions, 11 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 7f77ccc924dc..0e646ae723b5 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -287,7 +287,7 @@ public: OUString m_aLogicName; OUString m_aLongName; - mutable std::unique_ptr<SfxItemSet> m_pSet; + mutable std::shared_ptr<SfxItemSet> m_pSet; mutable std::unique_ptr<INetURLObject> m_pURLObj; std::shared_ptr<const SfxFilter> m_pFilter; @@ -3210,20 +3210,20 @@ void SfxMedium::CompleteReOpen() pImpl->bUseInteractionHandler = bUseInteractionHandler; } -SfxMedium::SfxMedium(const OUString &rName, StreamMode nOpenMode, std::shared_ptr<const SfxFilter> pFilter, std::unique_ptr<SfxItemSet> pInSet) : +SfxMedium::SfxMedium(const OUString &rName, StreamMode nOpenMode, std::shared_ptr<const SfxFilter> pFilter, const std::shared_ptr<SfxItemSet>& pInSet) : pImpl(new SfxMedium_Impl) { - pImpl->m_pSet = std::move( pInSet ); + pImpl->m_pSet = pInSet; pImpl->m_pFilter = std::move(pFilter); pImpl->m_aLogicName = rName; pImpl->m_nStorOpenMode = nOpenMode; Init_Impl(); } -SfxMedium::SfxMedium(const OUString &rName, const OUString &rReferer, StreamMode nOpenMode, std::shared_ptr<const SfxFilter> pFilter, std::unique_ptr<SfxItemSet> pInSet) : +SfxMedium::SfxMedium(const OUString &rName, const OUString &rReferer, StreamMode nOpenMode, std::shared_ptr<const SfxFilter> pFilter, const std::shared_ptr<SfxItemSet>& pInSet) : pImpl(new SfxMedium_Impl) { - pImpl->m_pSet = std::move(pInSet); + pImpl->m_pSet = pInSet; SfxItemSet * s = GetItemSet(); if (s->GetItem(SID_REFERER) == nullptr) { s->Put(SfxStringItem(SID_REFERER, rReferer)); @@ -3302,7 +3302,7 @@ SfxMedium::SfxMedium( const uno::Sequence<beans::PropertyValue>& aArgs ) : } -SfxMedium::SfxMedium( const uno::Reference < embed::XStorage >& rStor, const OUString& rBaseURL, const SfxItemSet* p ) : +SfxMedium::SfxMedium( const uno::Reference < embed::XStorage >& rStor, const OUString& rBaseURL, const std::shared_ptr<SfxItemSet>& p ) : pImpl(new SfxMedium_Impl) { OUString aType = SfxFilter::GetTypeFromStorage(rStor); @@ -3320,7 +3320,7 @@ SfxMedium::SfxMedium( const uno::Reference < embed::XStorage >& rStor, const OUS } -SfxMedium::SfxMedium( const uno::Reference < embed::XStorage >& rStor, const OUString& rBaseURL, const OUString &rTypeName, const SfxItemSet* p ) : +SfxMedium::SfxMedium( const uno::Reference < embed::XStorage >& rStor, const OUString& rBaseURL, const OUString &rTypeName, const std::shared_ptr<SfxItemSet>& p ) : pImpl(new SfxMedium_Impl) { pImpl->m_pFilter = SfxGetpApp()->GetFilterMatcher().GetFilter4EA( rTypeName ); diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index c841644cc98c..f6068448e531 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -3739,11 +3739,11 @@ void SAL_CALL SfxBaseModel::storeToStorage( const Reference< embed::XStorage >& if ( !m_pData->m_pObjectShell.is() ) throw io::IOException(); // TODO: - SfxAllItemSet aSet( m_pData->m_pObjectShell->GetPool() ); - TransformParameters( SID_SAVEASDOC, aMediaDescriptor, aSet ); + std::shared_ptr<SfxAllItemSet> xSet( new SfxAllItemSet(m_pData->m_pObjectShell->GetPool()) ); + TransformParameters( SID_SAVEASDOC, aMediaDescriptor, *xSet ); // TODO/LATER: maybe a special URL "private:storage" should be used - const SfxStringItem* pItem = aSet.GetItem<SfxStringItem>(SID_FILTER_NAME, false); + const SfxStringItem* pItem = xSet->GetItem<SfxStringItem>(SID_FILTER_NAME, false); sal_Int32 nVersion = SOFFICE_FILEFORMAT_CURRENT; if( pItem ) { @@ -3765,7 +3765,7 @@ void SAL_CALL SfxBaseModel::storeToStorage( const Reference< embed::XStorage >& m_pData->m_pObjectShell->SetupStorage( xStorage, nVersion, false ); // BaseURL is part of the ItemSet - SfxMedium aMedium( xStorage, OUString(), &aSet ); + SfxMedium aMedium( xStorage, OUString(), xSet ); aMedium.CanDisposeStorage_Impl( false ); if ( aMedium.GetFilter() ) { |