summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-11-01 21:11:29 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-11-01 21:13:13 +0000
commit36a3885eb2ec26acbce587497db68606feddfc42 (patch)
treeea475fe4c6fca75d157886f7def7d7b73270e8fd
parentc2a76550a287adf8bdbe93c02395fb80cb11c950 (diff)
crashtesting: failure on tdf89191-1.odt
crash since commit 664197d95becd516c3dac25a50439078ba61e051 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
-rw-r--r--sw/qa/core/exportdata/ooxml/pass/tdf89191-1.odtbin0 -> 89157 bytes
-rw-r--r--sw/source/core/unocore/unostyle.cxx25
2 files changed, 13 insertions, 12 deletions
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 000000000000..7ca047dccdc9
--- /dev/null
+++ b/sw/qa/core/exportdata/ooxml/pass/tdf89191-1.odt
Binary files differ
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 2372c75a1053..dfb10e05de3a 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);