[Libreoffice-commits] core.git: sw/qa sw/source

Caolán McNamara caolanm at redhat.com
Sun Nov 1 13:15:52 PST 2015


 sw/qa/core/exportdata/ooxml/pass/tdf89191-1.odt |binary
 sw/source/core/unocore/unostyle.cxx             |   25 ++++++++++++------------
 2 files changed, 13 insertions(+), 12 deletions(-)

New commits:
commit 36a3885eb2ec26acbce587497db68606feddfc42
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Nov 1 21:11:29 2015 +0000

    crashtesting: failure on tdf89191-1.odt
    
    crash since
    
    commit 664197d95becd516c3dac25a50439078ba61e051
    Author: Justin Luth <justin_luth at sil.org>
    Date:   Thu Sep 10 11:41:11 2015 +0300
    
        tdf#36117 .docx preserve page vertical alignment after RT
    
    Change-Id: I225fa4dc0a7ea2eab6ef748f7c72bfad361257dd

diff --git a/sw/qa/core/exportdata/ooxml/pass/tdf89191-1.odt b/sw/qa/core/exportdata/ooxml/pass/tdf89191-1.odt
new file mode 100644
index 0000000..7ca047d
Binary files /dev/null and b/sw/qa/core/exportdata/ooxml/pass/tdf89191-1.odt differ
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 2372c75..dfb10e0 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -1610,10 +1610,10 @@ public:
         return *mpItemSet;
     }
 
-    const SwPageDesc& GetOldPageDesc();
+    const SwPageDesc* GetOldPageDesc();
 };
 
-const SwPageDesc& SwStyleBase_Impl::GetOldPageDesc()
+const SwPageDesc* SwStyleBase_Impl::GetOldPageDesc()
 {
     if(!mpOldPageDesc)
     {
@@ -1633,8 +1633,7 @@ const SwPageDesc& SwStyleBase_Impl::GetOldPageDesc()
             }
         }
     }
-    assert(mpOldPageDesc != 0);
-    return *mpOldPageDesc;
+    return mpOldPageDesc;
 }
 
 static void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
@@ -1988,8 +1987,9 @@ static void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
         {
             if( pDoc )
             {
-                SwPageDesc* pPageDesc = pDoc->FindPageDesc( rBase.GetOldPageDesc().GetName() );
-                if( pPageDesc )
+                const SwPageDesc* pOldPageDesc = rBase.GetOldPageDesc();
+                SwPageDesc* pPageDesc = pOldPageDesc ? pDoc->FindPageDesc(pOldPageDesc->GetName()) : nullptr;
+                if (pPageDesc)
                 {
                     drawing::TextVerticalAdjust nVA;
                     rValue >>= nVA;
@@ -3874,27 +3874,28 @@ uno::Sequence< uno::Any > SAL_CALL SwXPageStyle::GetPropertyValues_Impl(
                         default: break;
                     }
 
-                    const SwPageDesc& rDesc = aBase.GetOldPageDesc();
+                    const SwPageDesc* pDesc = aBase.GetOldPageDesc();
+                    assert(pDesc);
                     const SwFrameFormat* pFrameFormat = 0;
-                    bool bShare = (bHeader && rDesc.IsHeaderShared()) || (!bHeader && rDesc.IsFooterShared());
-                    bool bShareFirst = rDesc.IsFirstShared();
+                    bool bShare = (bHeader && pDesc->IsHeaderShared()) || (!bHeader && pDesc->IsFooterShared());
+                    bool bShareFirst = pDesc->IsFirstShared();
                     // TextLeft returns the left content if there is one,
                     // Text and TextRight return the master content.
                     // TextRight does the same as Text and is for
                     // comptability only.
                     if( bLeft && !bShare )
                     {
-                        pFrameFormat = &rDesc.GetLeft();
+                        pFrameFormat = &pDesc->GetLeft();
                     }
                     else if (bFirst && !bShareFirst)
                     {
-                        pFrameFormat = &rDesc.GetFirstMaster();
+                        pFrameFormat = &pDesc->GetFirstMaster();
                         // no need to make GetFirstLeft() accessible
                         // since it is always shared
                     }
                     else
                     {
-                        pFrameFormat = &rDesc.GetMaster();
+                        pFrameFormat = &pDesc->GetMaster();
                     }
                     const uno::Reference< text::XText > xRet =
                         lcl_makeHeaderFooter(nRes, bHeader, pFrameFormat);


More information about the Libreoffice-commits mailing list