[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-1+backports' - 2 commits - sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Jan 15 16:45:48 UTC 2019


 sw/source/core/text/txtfrm.cxx    |    4 ++--
 sw/source/core/txtnode/txtedt.cxx |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit c7fdea5743de77b4b0fa27095ae16ec5dcfdd437
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue Jan 15 13:27:00 2019 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Tue Jan 15 17:45:09 2019 +0100

    tdf#122722 sw: fix hidden text crash in SwTextFrame::GetCurWord()
    
    A frame that is fully hidden does not have a SwParaPortion,
    see SwTextFrame::Format() early return.
    
    (regression from 9bda4a67565817f0a26f48c4a4b9723894a385f5)
    
    Change-Id: I6b06824e53cef7218b60f60fced8f863adad8b62
    Reviewed-on: https://gerrit.libreoffice.org/66385
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit 0623861685dd1c9daa72a1002f5b018d5c5ef03c)

diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 2a7d18aa4a7a..9f48b30c0846 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -702,7 +702,7 @@ OUString SwTextFrame::GetCurWord(SwPosition const& rPos) const
     OUString const& rText(GetText());
     assert(sal_Int32(nPos) <= rText.getLength()); // invalid index
 
-    if (rText.isEmpty())
+    if (rText.isEmpty() || IsHiddenNow())
         return OUString();
 
     assert(g_pBreakIt && g_pBreakIt->GetBreakIter().is());
commit daabaa9eee67c34f2ab5f7dc946404f8420f0475
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Jan 14 16:29:52 2019 +0000
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Tue Jan 15 17:45:09 2019 +0100

    crashtesting: assert on import of ooo96040-1.odt
    
     #0  std::__uniq_ptr_impl<sw::MergedPara, std::default_delete<sw::MergedPara> >::_M_ptr (this=0x108)
         at include/c++/8.2.0/bits/unique_ptr.h:150
     #1  0x00007f759b5ef71e in std::unique_ptr<sw::MergedPara, std::default_delete<sw::MergedPara> >::get (this=0x108)
         at include/c++/8.2.0/bits/unique_ptr.h:343
     #2  0x00007f759b870d00 in SwTextFrame::GetMergedPara (this=0x0) at sw/source/core/inc/txtfrm.hxx:437
     #3  0x00007f759be822f9 in sw::GetAttrMerged (rFormatSet=SfxItemSet of pool 0x4aae540 with parent 0x0 and Which ranges: [(68, 68), (90, 91)] = {...},
         rNode=..., pLayout=0x4b6f490) at sw/source/core/text/txtfrm.cxx:378
     #4  0x00007f759bf47a53 in SwTextNode::GetParaAttr (this=0x51bf980,
         rSet=SfxItemSet of pool 0x4aae540 with parent 0x0 and Which ranges: [(68, 68), (90, 91)] = {...}, nStt=0, nEnd=0, bOnlyTextAttr=false,
         bGetFromChrFormat=true, bMergeIndentValuesOfNumRule=true, pLayout=0x4b6f490)
         at sw/source/core/txtnode/thints.cxx:2072
     #5  0x00007f759baea5cc in SwEditShell::GetPaMAttr (this=0x50e7050, pPaM=0x4b42e38,
         rSet=SfxItemSet of pool 0x4aae540 with parent 0x0 and Which ranges: [(68, 68), (90, 91)] = {...}, bMergeIndentValuesOfNumRule=true)
         at sw/source/core/edit/edattr.cxx:144
     #6  0x00007f759baea772 in SwEditShell::GetCurAttr (this=0x50e7050,
         rSet=SfxItemSet of pool 0x4aae540 with parent 0x0 and Which ranges: [(68, 68), (90, 91)] = {...}, bMergeIndentValuesOfNumRule=true)
         at sw/source/core/edit/edattr.cxx:184
     #7  0x00007f759c733449 in SwView::StateTabWin (this=0x4e28f10,
         rSet=SfxItemSet of pool 0x4aae540 with parent 0x0 and Which ranges: [(10082, 10082), (10084, 10084), (10415, 10415)] = {...})
         at sw/source/uibase/uiview/viewtab.cxx:1234
     #8  0x00007f759c6f8c83 in SfxStubSwViewStateTabWin (pShell=0x4e28f10,
         rSet=SfxItemSet of pool 0x4aae540 with parent 0x0 and Which ranges: [(10082, 10082), (10084, 10084), (10415, 10415)] = {...})
         at workdir/SdiTarget/sw/sdi/swslots.hxx:13525
    
    Change-Id: I126a043ad3dc274da629a9a4efe349eafd85b485
    Reviewed-on: https://gerrit.libreoffice.org/66326
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit 874963258379f4bf9d392cef5662eecad568eabf)

diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 8c5631008064..ae72ea15fbc3 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -377,8 +377,8 @@ namespace sw {
         rNode.SwContentNode::GetAttr(rFormatSet);
         if (pLayout && pLayout->IsHideRedlines())
         {
-            if (sw::MergedPara const*const pMerged =
-                static_cast<SwTextFrame*>(rNode.getLayoutFrame(pLayout))->GetMergedPara())
+            auto pFrame = static_cast<SwTextFrame*>(rNode.getLayoutFrame(pLayout));
+            if (sw::MergedPara const*const pMerged = pFrame ? pFrame->GetMergedPara() : nullptr)
             {
                 if (pMerged->pFirstNode != &rNode)
                 {


More information about the Libreoffice-commits mailing list