summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-12-09 16:48:29 +0000
committerAndras Timar <andras.timar@collabora.com>2015-12-10 16:14:38 +0100
commit1772ef53103ed9284ee65f72d57c4aa0fabe6305 (patch)
tree816e4bf874394e686a1d19c3a702fc650e5f7ed2 /lotuswordpro
parentef07e395e489648536af79c69acdd9be72b0f877 (diff)
guard against missing alignment property
(cherry picked from commit 7e341379ecec218c0ff2ff0e8db9f14468b125f6) Reviewed-on: https://gerrit.libreoffice.org/20543 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 3b9e2bb22e782d073d8e67ae975ebb8ca5eea552) Change-Id: I1d4825c2136e516baf759f4b2c40c911547b93d7 Reviewed-on: https://gerrit.libreoffice.org/20544 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com> (cherry picked from commit 3592f0020b3136b17f6b8289f433462563a46759)
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/lwppara.cxx22
1 files changed, 13 insertions, 9 deletions
diff --git a/lotuswordpro/source/filter/lwppara.cxx b/lotuswordpro/source/filter/lwppara.cxx
index c2f2f2071719..ed03231ae794 100644
--- a/lotuswordpro/source/filter/lwppara.cxx
+++ b/lotuswordpro/source/filter/lwppara.cxx
@@ -386,18 +386,22 @@ void LwpPara::RegisterStyle()
{
case PP_LOCAL_ALIGN:
{
- if (!rParaStyle.GetAlignment())
- OverrideAlignment(NULL,static_cast<LwpParaAlignProperty*>(pProps)->GetAlignment(),pOverStyle);
- else
+ LwpAlignmentOverride *pAlignment = static_cast<LwpParaAlignProperty*>(pProps)->GetAlignment();
+ if (pAlignment)
{
- boost::scoped_ptr<LwpAlignmentOverride> const pAlign(
- rParaStyle.GetAlignment()->clone());
- OverrideAlignment(pAlign.get(),
- static_cast<LwpParaAlignProperty*>(pProps)->GetAlignment(),
- pOverStyle);
+ if (!rParaStyle.GetAlignment())
+ OverrideAlignment(nullptr, pAlignment, pOverStyle);
+ else
+ {
+ std::unique_ptr<LwpAlignmentOverride> const pAlign(
+ rParaStyle.GetAlignment()->clone());
+ OverrideAlignment(pAlign.get(),
+ pAlignment,
+ pOverStyle);
+ }
}
- }
break;
+ }
case PP_LOCAL_INDENT:
{
noIndent = false;