[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - lotuswordpro/source

Caolán McNamara caolanm at redhat.com
Thu Dec 10 04:09:23 PST 2015


 lotuswordpro/source/filter/lwppara.cxx |   20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

New commits:
commit 50ca71d16e37cb7612dd26172f5c876882cb700d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 10 09:35:46 2015 +0000

    guard against missing spacing property
    
    (cherry picked from commit 10de96bf0fb820b38607b0c25a0d3219ad343819)
    Reviewed-on: https://gerrit.libreoffice.org/20569
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit cb6f34b370da1d45e1c2b945b60cbcaf7b9c3a45)
    
    Change-Id: If5c50cddfee88cc92852737c1459ebe94b7256bb
    Reviewed-on: https://gerrit.libreoffice.org/20570
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/lotuswordpro/source/filter/lwppara.cxx b/lotuswordpro/source/filter/lwppara.cxx
index ed03231..7ed4d1a 100644
--- a/lotuswordpro/source/filter/lwppara.cxx
+++ b/lotuswordpro/source/filter/lwppara.cxx
@@ -418,18 +418,20 @@ void LwpPara::RegisterStyle()
             case PP_LOCAL_SPACING:
             {
                 noSpacing = false;
-                if (!rParaStyle.GetSpacing())
-                    OverrideSpacing(NULL,static_cast<LwpParaSpacingProperty*>(pProps)->GetSpacing(),pOverStyle);
-                else
+                LwpSpacingOverride *pSpacing = static_cast<LwpParaSpacingProperty*>(pProps)->GetSpacing();
+                if (pSpacing)
                 {
-                    boost::scoped_ptr<LwpSpacingOverride> const
-                        pSpacing(rParaStyle.GetSpacing()->clone());
-                    OverrideSpacing(pSpacing.get(),
-                            static_cast<LwpParaSpacingProperty*>(pProps)->GetSpacing(),
-                            pOverStyle);
+                    if (!rParaStyle.GetSpacing())
+                        OverrideSpacing(nullptr, pSpacing, pOverStyle);
+                    else
+                    {
+                        std::unique_ptr<LwpSpacingOverride> const
+                            pNewSpacing(rParaStyle.GetSpacing()->clone());
+                        OverrideSpacing(pNewSpacing.get(), pSpacing, pOverStyle);
+                    }
                 }
-            }
                 break;
+            }
             case PP_LOCAL_BORDER:
             {
                 OverrideParaBorder(pProps, pOverStyle);


More information about the Libreoffice-commits mailing list