[Libreoffice-commits] core.git: Branch 'aoo/trunk' - writerfilter/source

Oliver-Rainer Wittmann orw at apache.org
Mon Jan 20 10:08:14 PST 2014


 writerfilter/source/dmapper/DomainMapper.cxx |   29 +++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)

New commits:
commit 3771f2a8da98fd1ef2ac40a18a2c104c3087b327
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date:   Mon Jan 20 17:54:32 2014 +0000

    124058: *.docx import - check existence of Style before accessing it

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 742b3cb..2778fec 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2263,32 +2263,45 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
         break;  // sprmPBrcl
     case NS_sprm::LN_PBrcp:
         break;  // sprmPBrcp
+
     case NS_sprm::LN_PIlvl: // sprmPIlvl
         /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 1 */
         /* WRITERFILTERSTATUS: comment:  */
-        //todo: Numbering level will be implemented in the near future (OOo 3.0?)
-            if( m_pImpl->IsStyleSheetImport() )
+        {
+            StyleSheetPropertyMap* pStyleSheetPropertyMap = NULL;
+            if ( m_pImpl->IsStyleSheetImport() )
             {
-                //style sheets cannot have a numbering rule attached
                 StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() );
+            }
+
+            if ( pStyleSheetPropertyMap != NULL )
+            {
                 pStyleSheetPropertyMap->SetListLevel( (sal_Int16)nIntValue );
             }
             else
+            {
                 rContext->Insert( PROP_NUMBERING_LEVEL, true, uno::makeAny( (sal_Int16)nIntValue ));
+            }
+        }
         break;
+
     case NS_sprm::LN_PIlfo: // sprmPIlfo
         /* WRITERFILTERSTATUS: done: 50, planned: 0, spent: 1 */
         /* WRITERFILTERSTATUS: comment:  */
         {
             //convert the ListTable entry to a NumberingRules propery and apply it
+            StyleSheetPropertyMap* pStyleSheetPropertyMap = NULL;
+            if ( m_pImpl->IsStyleSheetImport() )
+            {
+                StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() );
+            }
+
             ListsManager::Pointer pListTable = m_pImpl->GetListTable();
             ListDef::Pointer pList = pListTable->GetList( nIntValue );
             if( pList.get( ) )
             {
-                if( m_pImpl->IsStyleSheetImport() )
+                if ( pStyleSheetPropertyMap != NULL )
                 {
-                    //style sheets cannot have a numbering rule attached
-                    StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() );
                     pStyleSheetPropertyMap->SetListId( nIntValue );
                 }
                 else
@@ -2299,10 +2312,9 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
             }
             else
             {
-                if( m_pImpl->IsStyleSheetImport() )
+                if ( pStyleSheetPropertyMap != NULL )
                 {
                     // set the number id for AbstractNum references
-                    StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() );
                     pStyleSheetPropertyMap->SetNumId( nIntValue );
                 }
                 else
@@ -2313,6 +2325,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
             }
         }
         break;
+
     case NS_sprm::LN_PFNoLineNumb:   // sprmPFNoLineNumb
         /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 1 */
         /* WRITERFILTERSTATUS: comment:  */


More information about the Libreoffice-commits mailing list