Return-Path: X-Original-To: apmail-openoffice-commits-archive@www.apache.org Delivered-To: apmail-openoffice-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8DBC41090C for ; Mon, 20 Jan 2014 17:54:57 +0000 (UTC) Received: (qmail 18767 invoked by uid 500); 20 Jan 2014 17:54:55 -0000 Delivered-To: apmail-openoffice-commits-archive@openoffice.apache.org Received: (qmail 18676 invoked by uid 500); 20 Jan 2014 17:54:54 -0000 Mailing-List: contact commits-help@openoffice.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openoffice.apache.org Delivered-To: mailing list commits@openoffice.apache.org Received: (qmail 18669 invoked by uid 99); 20 Jan 2014 17:54:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Jan 2014 17:54:53 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Jan 2014 17:54:52 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id B2B572388993; Mon, 20 Jan 2014 17:54:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1559791 - /openoffice/trunk/main/writerfilter/source/dmapper/DomainMapper.cxx Date: Mon, 20 Jan 2014 17:54:32 -0000 To: commits@openoffice.apache.org From: orw@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140120175432.B2B572388993@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: orw Date: Mon Jan 20 17:54:32 2014 New Revision: 1559791 URL: http://svn.apache.org/r1559791 Log: 124058: *.docx import - check existence of Style before accessing it Modified: openoffice/trunk/main/writerfilter/source/dmapper/DomainMapper.cxx Modified: openoffice/trunk/main/writerfilter/source/dmapper/DomainMapper.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/writerfilter/source/dmapper/DomainMapper.cxx?rev=1559791&r1=1559790&r2=1559791&view=diff ============================================================================== --- openoffice/trunk/main/writerfilter/source/dmapper/DomainMapper.cxx (original) +++ openoffice/trunk/main/writerfilter/source/dmapper/DomainMapper.cxx Mon Jan 20 17:54:32 2014 @@ -2263,32 +2263,45 @@ void DomainMapper::sprmWithProps( Sprm& 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& } 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& } } break; + case NS_sprm::LN_PFNoLineNumb: // sprmPFNoLineNumb /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 1 */ /* WRITERFILTERSTATUS: comment: */