Return-Path: X-Original-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 27BBECD78 for ; Thu, 7 Jun 2012 07:46:56 +0000 (UTC) Received: (qmail 88455 invoked by uid 500); 7 Jun 2012 07:46:56 -0000 Delivered-To: apmail-incubator-ooo-commits-archive@incubator.apache.org Received: (qmail 88410 invoked by uid 500); 7 Jun 2012 07:46:55 -0000 Mailing-List: contact ooo-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ooo-dev@incubator.apache.org Delivered-To: mailing list ooo-commits@incubator.apache.org Received: (qmail 88384 invoked by uid 99); 7 Jun 2012 07:46:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jun 2012 07:46:54 +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; Thu, 07 Jun 2012 07:46:53 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 444D923889BF; Thu, 7 Jun 2012 07:46:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1347450 - /incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx Date: Thu, 07 Jun 2012 07:46:33 -0000 To: ooo-commits@incubator.apache.org From: jsc@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120607074633.444D923889BF@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jsc Date: Thu Jun 7 07:46:32 2012 New Revision: 1347450 URL: http://svn.apache.org/viewvc?rev=1347450&view=rev Log: 119544: sequence number is not displayed when open docx fix: add code to handle the SEQ field command... Patch By: Jin Long Wu Found By: Don Jun Zung Reviewed By: jsc Modified: incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx Modified: incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx?rev=1347450&r1=1347449&r2=1347450&view=diff ============================================================================== --- incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx (original) +++ incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx Thu Jun 7 07:46:32 2012 @@ -3179,7 +3179,33 @@ void DomainMapper_Impl::CloseFieldComman break; case FIELD_SECTION : break; case FIELD_SECTIONPAGES : break; - case FIELD_SEQ : break; + case FIELD_SEQ : + { + // command looks like: " SEQ Table \* ARABIC " + ::rtl::OUString sCmd(pContext->GetCommand()); + // find the sequence name, e.g. "SEQ" + ::rtl::OUString sSeqName = lcl_FindQuotedText(sCmd, "SEQ ", '\\'); + sSeqName = sSeqName.trim(); + + // create a sequence field master using the sequence name + uno::Reference< beans::XPropertySet > xMaster = FindOrCreateFieldMaster( + "com.sun.star.text.FieldMaster.SetExpression", + sSeqName); + + xMaster->setPropertyValue( + rPropNameSupplier.GetName(PROP_SUB_TYPE), + uno::makeAny(text::SetVariableType::SEQUENCE)); + + // apply the numbering type + xFieldProperties->setPropertyValue( + rPropNameSupplier.GetName(PROP_NUMBERING_TYPE), + uno::makeAny( lcl_ParseNumberingType(pContext->GetCommand()) )); + + // attach the master to the field + uno::Reference< text::XDependentTextField > xDependentField( xFieldInterface, uno::UNO_QUERY_THROW ); + xDependentField->attachTextFieldMaster( xMaster ); + } + break; case FIELD_SET : break; case FIELD_SKIPIF : break; case FIELD_STYLEREF : break;