[Libreoffice-commits] .: Branch 'libreoffice-3-5' - writerfilter/source

Miklos Vajna vmiklos at kemper.freedesktop.org
Mon Dec 12 01:18:58 PST 2011


 writerfilter/source/dmapper/DomainMapper.cxx |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

New commits:
commit bc822b6b9f8e88e06df05da6344054c4e205a16f
Author: Miklos Vajna <vmiklos at frugalware.org>
Date:   Sun Dec 11 00:54:19 2011 +0100

    dmapper: when parsing NS_ooxml::LN_CT_Spacing_lineRule, pTopContext may be nil
    (cherry picked from commit dc78a1c44c478dc7abb25ff5cbbb7477348f0dd1)

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index d2fc018..4bbba6d 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1020,8 +1020,14 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
 #define SINGLE_LINE_SPACING 240
             style::LineSpacing aSpacing;
             PropertyMapPtr pTopContext = m_pImpl->GetTopContext();
-            PropertyMap::iterator aLineSpacingIter = pTopContext->find(PropertyDefinition( PROP_PARA_LINE_SPACING, true ) );
-            if( aLineSpacingIter != pTopContext->end())
+            bool bFound = false;
+            PropertyMap::iterator aLineSpacingIter;
+            if (pTopContext)
+            {
+                aLineSpacingIter = pTopContext->find(PropertyDefinition( PROP_PARA_LINE_SPACING, true ) );
+                bFound = aLineSpacingIter != pTopContext->end();
+            }
+            if (bFound)
             {
                 aLineSpacingIter->second >>= aSpacing;
             }
@@ -1053,7 +1059,8 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
                     else // NS_ooxml::LN_Value_wordprocessingml_ST_LineSpacingRule_exact
                         aSpacing.Mode = style::LineSpacingMode::FIX;
             }
-            pTopContext->Insert(PROP_PARA_LINE_SPACING, true, uno::makeAny( aSpacing ));
+            if (pTopContext)
+                pTopContext->Insert(PROP_PARA_LINE_SPACING, true, uno::makeAny( aSpacing ));
         }
         break;
         case NS_ooxml::LN_CT_Ind_start:


More information about the Libreoffice-commits mailing list