crashtesting: failure on tdf89191-1.odt

crash since

commit 664197d95b
Author: Justin Luth <justin_luth@sil.org>
Date:   Thu Sep 10 11:41:11 2015 +0300

    tdf#36117 .docx preserve page vertical alignment after RT

Change-Id: I225fa4dc0a7ea2eab6ef748f7c72bfad361257dd
This commit is contained in:
Caolán McNamara
2015-11-01 21:11:29 +00:00
parent c2a76550a2
commit 36a3885eb2
2 changed files with 13 additions and 12 deletions

Binary file not shown.

View File

@@ -1610,10 +1610,10 @@ public:
return *mpItemSet; return *mpItemSet;
} }
const SwPageDesc& GetOldPageDesc(); const SwPageDesc* GetOldPageDesc();
}; };
const SwPageDesc& SwStyleBase_Impl::GetOldPageDesc() const SwPageDesc* SwStyleBase_Impl::GetOldPageDesc()
{ {
if(!mpOldPageDesc) 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, static void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
@@ -1988,8 +1987,9 @@ static void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
{ {
if( pDoc ) if( pDoc )
{ {
SwPageDesc* pPageDesc = pDoc->FindPageDesc( rBase.GetOldPageDesc().GetName() ); const SwPageDesc* pOldPageDesc = rBase.GetOldPageDesc();
if( pPageDesc ) SwPageDesc* pPageDesc = pOldPageDesc ? pDoc->FindPageDesc(pOldPageDesc->GetName()) : nullptr;
if (pPageDesc)
{ {
drawing::TextVerticalAdjust nVA; drawing::TextVerticalAdjust nVA;
rValue >>= nVA; rValue >>= nVA;
@@ -3874,27 +3874,28 @@ uno::Sequence< uno::Any > SAL_CALL SwXPageStyle::GetPropertyValues_Impl(
default: break; default: break;
} }
const SwPageDesc& rDesc = aBase.GetOldPageDesc(); const SwPageDesc* pDesc = aBase.GetOldPageDesc();
assert(pDesc);
const SwFrameFormat* pFrameFormat = 0; const SwFrameFormat* pFrameFormat = 0;
bool bShare = (bHeader && rDesc.IsHeaderShared()) || (!bHeader && rDesc.IsFooterShared()); bool bShare = (bHeader && pDesc->IsHeaderShared()) || (!bHeader && pDesc->IsFooterShared());
bool bShareFirst = rDesc.IsFirstShared(); bool bShareFirst = pDesc->IsFirstShared();
// TextLeft returns the left content if there is one, // TextLeft returns the left content if there is one,
// Text and TextRight return the master content. // Text and TextRight return the master content.
// TextRight does the same as Text and is for // TextRight does the same as Text and is for
// comptability only. // comptability only.
if( bLeft && !bShare ) if( bLeft && !bShare )
{ {
pFrameFormat = &rDesc.GetLeft(); pFrameFormat = &pDesc->GetLeft();
} }
else if (bFirst && !bShareFirst) else if (bFirst && !bShareFirst)
{ {
pFrameFormat = &rDesc.GetFirstMaster(); pFrameFormat = &pDesc->GetFirstMaster();
// no need to make GetFirstLeft() accessible // no need to make GetFirstLeft() accessible
// since it is always shared // since it is always shared
} }
else else
{ {
pFrameFormat = &rDesc.GetMaster(); pFrameFormat = &pDesc->GetMaster();
} }
const uno::Reference< text::XText > xRet = const uno::Reference< text::XText > xRet =
lcl_makeHeaderFooter(nRes, bHeader, pFrameFormat); lcl_makeHeaderFooter(nRes, bHeader, pFrameFormat);