sw/source/core/doc/docdesc.cxx |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 4ada4bc29bb51dec1852a11f0064538a53d6a8c9
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Mar 4 15:50:08 2021 +0000
Commit:     Tünde Tóth <toth.tu...@nisz.hu>
CommitDate: Thu Oct 21 12:02:07 2021 +0200

    ofz#31672 Bad-cast
    
    ==3484068== Invalid read of size 8
    ==3484068==    at 0x226E9EDC: SwClient::GetRegisteredIn() const 
(calbck.hxx:159)
    ==3484068==    by 0x22A09E30: SwDoc::ChgPageDesc(unsigned long, SwPageDesc 
const&) (docdesc.cxx:465)
    ==3484068==    by 0x238B1ECC: UpdatePageDescs(SwDoc&, unsigned long) 
(fltshell.cxx:1094)
    ==3484068==    by 0x1CDD6E52: SwWW8ImplReader::CoreLoad(WW8Glossary const*) 
(ww8par.cxx:5482)
    ==3484068==    by 0x1CDD90A1: 
SwWW8ImplReader::LoadThroughDecryption(WW8Glossary*) (ww8par.cxx:5939)
    ==3484068==    by 0x1CDDAE71: SwWW8ImplReader::LoadDoc(WW8Glossary*) 
(ww8par.cxx:6243)
    
    ==3484068==  Address 0x28c215c8 is 40 bytes inside a block of size 56 free'd
    ==3484068==    at 0x483AEDD: operator delete(void*) 
(vg_replace_malloc.c:584)
    ==3484068==    by 0x23009F47: SwFormatHeader::~SwFormatHeader() 
(atrfrm.cxx:503)
    ==3484068==    by 0x9DDC3F3: SfxItemPool::Remove(SfxPoolItem const&) 
(itempool.cxx:741)
    ==3484068==    by 0x9E17BD6: SfxItemSet::~SfxItemSet() (itemset.cxx:252)
    ==3484068==    by 0x227FE847: SwAttrSet::~SwAttrSet() (swatrset.hxx:161)
    ==3484068==    by 0x227FD139: SwFormat::SetFormatAttr(SfxPoolItem const&) 
(format.cxx:524)
    ==3484068==    by 0x22A07AA6: SwDoc::CopyMasterHeader(SwPageDesc const&, 
SwFormatHeader const&, SwPageDesc&, bool, bool) (docdesc.cxx:248)
    ==3484068==    by 0x22A09B4D: SwDoc::ChgPageDesc(unsigned long, SwPageDesc 
const&) (docdesc.cxx:457)
    ==3484068==    by 0x238B1ECC: UpdatePageDescs(SwDoc&, unsigned long) 
(fltshell.cxx:1094)
    ==3484068==    by 0x1CDD6E52: SwWW8ImplReader::CoreLoad(WW8Glossary const*) 
(ww8par.cxx:5482)
    ==3484068==    by 0x1CDD90A1: 
SwWW8ImplReader::LoadThroughDecryption(WW8Glossary*) (ww8par.cxx:5939)
    ==3484068==    by 0x1CDDAE71: SwWW8ImplReader::LoadDoc(WW8Glossary*) 
(ww8par.cxx:6243)
    
    since...
    
    commit f5dc6b11d2218d94c9effe7a1ab418d0133da5e3
    Date:   Tue Jan 26 13:11:42 2021 +0100
    
        tdf#140117 sw UI: keep headers/footers when inactive
    
    Change-Id: I14787d4203c457393e8b5d0222df67d394a4c9ed
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111970
    Tested-by: Caolán McNamara <caol...@redhat.com>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    (cherry picked from commit 61ff5e8126c64ff521a148c5003e15a86d50c4cc)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123972
    Tested-by: Tünde Tóth <toth.tu...@nisz.hu>
    Reviewed-by: Tünde Tóth <toth.tu...@nisz.hu>

diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 5da2c32f90be..341dfaaafb14 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -463,11 +463,11 @@ void SwDoc::ChgPageDesc( size_t i, const SwPageDesc 
&rChged )
     const bool bStashLeftHead = !rDesc.IsHeaderShared() && 
rChged.IsHeaderShared();
     const bool bStashFirstMasterHead = !rDesc.IsFirstShared() && 
rChged.IsFirstShared();
     const bool bStashFirstLeftHead = (!rDesc.IsHeaderShared() && 
rChged.IsHeaderShared()) || (!rDesc.IsFirstShared() && rChged.IsFirstShared());
-    if (rLeftHead.GetRegisteredIn() && bStashLeftHead)
+    if (bStashLeftHead && rLeftHead.GetRegisteredIn())
         rDesc.StashFrameFormat(rChged.GetLeft(), true, true, false);
-    if (rFirstMasterHead.GetRegisteredIn() && bStashFirstMasterHead)
+    if (bStashFirstMasterHead && rFirstMasterHead.GetRegisteredIn())
         rDesc.StashFrameFormat(rChged.GetFirstMaster(), true, false, true);
-    if (rFirstLeftHead.GetRegisteredIn() && bStashFirstLeftHead)
+    if (bStashFirstLeftHead && rFirstLeftHead.GetRegisteredIn())
         rDesc.StashFrameFormat(rChged.GetFirstLeft(), true, true, true);
 
     rDesc.ChgHeaderShare( rChged.IsHeaderShared() );
@@ -501,11 +501,11 @@ void SwDoc::ChgPageDesc( size_t i, const SwPageDesc 
&rChged )
     const bool bStashLeftFoot = !rDesc.IsFooterShared() && 
rChged.IsFooterShared();
     const bool bStashFirstMasterFoot = !rDesc.IsFirstShared() && 
rChged.IsFirstShared();
     const bool bStashFirstLeftFoot = (!rDesc.IsFooterShared() && 
rChged.IsFooterShared()) || (!rDesc.IsFirstShared() && rChged.IsFirstShared());
-    if (rLeftFoot.GetRegisteredIn() && bStashLeftFoot)
+    if (bStashLeftFoot && rLeftFoot.GetRegisteredIn())
         rDesc.StashFrameFormat(rChged.GetLeft(), false, true, false);
-    if (rFirstMasterFoot.GetRegisteredIn() && bStashFirstMasterFoot)
+    if (bStashFirstMasterFoot && rFirstMasterFoot.GetRegisteredIn())
         rDesc.StashFrameFormat(rChged.GetFirstMaster(), false, false, true);
-    if (rFirstLeftFoot.GetRegisteredIn() && bStashFirstLeftFoot)
+    if (bStashFirstLeftFoot && rFirstLeftFoot.GetRegisteredIn())
         rDesc.StashFrameFormat(rChged.GetFirstLeft(), false, true, true);
 
     rDesc.ChgFooterShare( rChged.IsFooterShared() );

Reply via email to