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

Caolán McNamara caolanm at redhat.com
Sun Dec 13 04:43:53 PST 2015


 lotuswordpro/source/filter/lwpdoc.cxx |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

New commits:
commit c3568650bf339e283b6212e87d60a7faead2ec80
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Dec 13 12:42:54 2015 +0000

    use more references to fix life cycles
    
    Change-Id: Ib70b5ebc498e6517ef40d0515e69e2e77288c1b5
    (cherry picked from commit 62a6cadbab6c7bdfbd605c1c75c250904ed10442)

diff --git a/lotuswordpro/source/filter/lwpdoc.cxx b/lotuswordpro/source/filter/lwpdoc.cxx
index 12975e3..d0be396 100644
--- a/lotuswordpro/source/filter/lwpdoc.cxx
+++ b/lotuswordpro/source/filter/lwpdoc.cxx
@@ -284,18 +284,18 @@ void LwpDocument::RegisterLayoutStyles()
 void LwpDocument::RegisterStylesInPara()
 {
     //Register all automatic styles in para
-    LwpHeadContent* pContent = m_pFoundry
+    rtl::Reference<LwpHeadContent> xContent(m_pFoundry
         ? dynamic_cast<LwpHeadContent*> (m_pFoundry->GetContentManager().GetContentList().obj().get())
-        : nullptr;
-    if (pContent)
+        : nullptr);
+    if (xContent.is())
     {
-        LwpStory* pStory = dynamic_cast<LwpStory*>(pContent->GetChildHead().obj(VO_STORY).get());
-        while(pStory)
+        rtl::Reference<LwpStory> xStory(dynamic_cast<LwpStory*>(xContent->GetChildHead().obj(VO_STORY).get()));
+        while (xStory.is())
         {
             //Register the child para
-            pStory->SetFoundry(m_pFoundry);
-            pStory->DoRegisterStyle();
-            pStory = dynamic_cast<LwpStory*>(pStory->GetNext().obj(VO_STORY).get());
+            xStory->SetFoundry(m_pFoundry);
+            xStory->DoRegisterStyle();
+            xStory.set(dynamic_cast<LwpStory*>(xStory->GetNext().obj(VO_STORY).get()));
         }
     }
 }


More information about the Libreoffice-commits mailing list