summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorJürgen Schmidt <jsc@apache.org>2012-06-07 06:46:32 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-04-04 16:12:23 +0100
commit348a5f8e80cba72d6a6aa13f001a16d9a62b70aa (patch)
tree3187667b55c9887953cdc1bf01d8145b7643d17b /writerfilter
parentf01c37887016df5fb4101224edf1d97dcf96250d (diff)
Resolves: #i119544# sequence number is not displayed in docx
fix: add code to handle the SEQ field command... Patch By: Jin Long Wu Found By: Don Jun Zung Reviewed By: jsc (cherry picked from commit 0d2415df82388eb1a9a00c2d5e6bd3d9193057db) Change-Id: Ia588857aa453ea05cde2e66f6efd403e8eb282f2
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx28
1 files changed, 27 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 5249272cdab4..b4ca0fb34afe 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -3109,7 +3109,33 @@ void DomainMapper_Impl::CloseFieldCommand()
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;