diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-04-06 14:52:02 +0300 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-04-07 08:38:36 +0200 |
commit | ef7ecb85645c68aeec2585240fa72e322e424020 (patch) | |
tree | 98ab057985be2f3369546f319faddf11945b2d96 | |
parent | tdf#136740: Do not initialize document settings when pasting (diff) | |
download | core-ef7ecb85645c68aeec2585240fa72e322e424020.tar.gz core-ef7ecb85645c68aeec2585240fa72e322e424020.zip |
tdf#136740: reimplement the fix using existing m_bIsNewDoc
This reimplements the fix from commit d7c4d0d4ea83481693af3645a03b03b53e456f60.
The unit test from commit a90a324aa590a94a4091fbfadea67e0b0203767c still passes.
Change-Id: I84c61fa68b9bee679a8e82ef7b8f164297bacb5a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113665
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 7fc2cafbba36db25e7d0083cea162d2df08611b5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113646
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r-- | sw/source/uibase/dochdl/swdtflvr.cxx | 6 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index 8caa6c50c358..894d9049bcfd 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -32,7 +32,6 @@ #include <comphelper/fileformat.h> #include <comphelper/processfactory.hxx> #include <comphelper/servicehelper.hxx> -#include <comphelper/SetFlagContextHelper.hxx> #include <comphelper/storagehelper.hxx> #include <comphelper/string.hxx> #include <o3tl/deleter.hxx> @@ -2101,11 +2100,6 @@ bool SwTransferable::PasteFileContent( TransferableDataHelper& rData, rSh.SetChgLnk( Link<LinkParamNone*,void>() ); const SwPosition& rInsPos = *rSh.GetCursor()->Start(); - - // Reader might need to know if we are pasting into an existing document, or initializing - // a new document; e.g. initializing document setting could be skipped when pasting. - css::uno::ContextLayer layer(comphelper::NewFlagContext("InPasteFromClipboard")); - SwReader aReader(*pStream, OUString(), OUString(), *rSh.GetCursor()); rSh.SaveTableBoxContent( &rInsPos ); diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 3cc89508c71c..a6bca50007ce 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -22,7 +22,6 @@ #include <com/sun/star/drawing/XDrawPageSupplier.hpp> #include <filter/msfilter/util.hxx> #include <filter/msfilter/rtfutil.hxx> -#include <comphelper/SetFlagContextHelper.hxx> #include <comphelper/string.hxx> #include <tools/diagnose_ex.h> #include <tools/globname.hxx> @@ -267,7 +266,7 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x , m_pMapperStream(nullptr) , m_aDefaultState(this) , m_bSkipUnknown(false) - , m_bFirstRun(!comphelper::IsContextFlagActive("InPasteFromClipboard")) + , m_bFirstRun(true) , m_bFirstRunException(false) , m_bNeedPap(true) , m_bNeedCr(false) @@ -372,6 +371,9 @@ void RTFDocumentImpl::resolveSubstream(std::size_t nPos, Id nId, OUString const& void RTFDocumentImpl::outputSettingsTable() { + // tdf#136740: do not change trarget document settings when pasting + if (!m_bIsNewDoc) + return; writerfilter::Reference<Properties>::Pointer_t pProp = new RTFReferenceProperties(m_aSettingsTableAttributes, m_aSettingsTableSprms); RTFReferenceTable::Entries_t aSettingsTableEntries; |