writerfilter/source/dmapper/PropertyMap.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 89243df2836ff7b689502c41902cd4d2871858bd
Author:     Justin Luth <[email protected]>
AuthorDate: Fri Jul 12 07:42:39 2024 -0400
Commit:     Tomaž Vajngerl <[email protected]>
CommitDate: Tue Jul 16 05:42:26 2024 +0200

    tdf#160139 sw RTF paste: don't empty headers/footers
    
    Regression from quikee's 24.2
    commit 4b0fa253a4540f5461397815d290586f9ddabe61
        tdf#136472 adjust ooxml import to handle first header/footer
    
    RTF paste is particularly nasty because it calls CloseSectionGroup,
    which is rather strange for just pasting some characters...
    
    Fix the problem by leaving the paste alone:
    we already omit a number of actions in this case,
    and was similarly done initially by quikee in copyHeaderFooter.
    
    setHeaderFooterProperties() was newly added by quikee,
    so relatively safe to start avoiding on paste.
    
    Change-Id: Iad997481a75bb971f9e71373175134cbec9aa7d9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170328
    Reviewed-by: Tomaž Vajngerl <[email protected]>
    Tested-by: Jenkins
    (cherry picked from commit aaf93cd9629acd476284a4933a656ddd188a80aa)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170349
    Reviewed-by: Xisco Fauli <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170406
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Justin Luth <[email protected]>

diff --git a/writerfilter/source/dmapper/PropertyMap.cxx 
b/writerfilter/source/dmapper/PropertyMap.cxx
index 0a1e7f7de12d..797e278357ba 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -517,7 +517,8 @@ void 
SectionPropertyMap::removeXTextContent(uno::Reference<text::XText> const& r
  */
 void SectionPropertyMap::setHeaderFooterProperties(DomainMapper_Impl& rDM_Impl)
 {
-    if (!m_aPageStyle.is())
+    // do not alter header/footer during copy/paste
+    if (!m_aPageStyle.is() || !rDM_Impl.IsNewDoc())
         return;
 
     bool bHasHeader = false;

Reply via email to