diff options
author | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2013-07-03 17:43:33 +0200 |
---|---|---|
committer | Fridrich Strba <fridrich@documentfoundation.org> | 2013-07-08 09:04:42 +0000 |
commit | 5a36fd99620aa1568e1140b5a78dc357390fba14 (patch) | |
tree | 27fc10c904c0b5d59d2646daa1056abd465f4262 /writerfilter | |
parent | 706ed1aa74a3e68abe2ed80cd81db8f04150c247 (diff) |
n#825976: Added common flags support for SEQ field import
(cherry picked from commit 031ced0d1ade5350ef0b17a245a2cb5c76e6173d)
Conflicts:
writerfilter/source/dmapper/DomainMapper_Impl.cxx
Change-Id: I9a4505cf060880811abfe355b2ebf810cde9a4d6
Reviewed-on: https://gerrit.libreoffice.org/4723
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 1d968997629a..b51ed29aa05e 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -3187,6 +3187,30 @@ void DomainMapper_Impl::CloseFieldCommand() // attach the master to the field uno::Reference< text::XDependentTextField > xDependentField( xFieldInterface, uno::UNO_QUERY_THROW ); xDependentField->attachTextFieldMaster( xMaster ); + + rtl::OUString sFormula = sSeqName + "+1"; + rtl::OUString sValue; + if( lcl_FindInCommand( pContext->GetCommand(), 'c', sValue )) + { + sFormula = sSeqName; + } + else if( lcl_FindInCommand( pContext->GetCommand(), 'r', sValue )) + { + sFormula = sValue; + } + // TODO \s isn't handled, but the spec isn't easy to understand without + // an example for this one. + xFieldProperties->setPropertyValue( + rPropNameSupplier.GetName(PROP_CONTENT), + uno::makeAny(sFormula)); + + // Take care of the numeric formatting definition, default is Arabic + sal_Int16 nNumberingType = lcl_ParseNumberingType(pContext->GetCommand()); + if (nNumberingType == style::NumberingType::PAGE_DESCRIPTOR) + nNumberingType == style::NumberingType::ARABIC; + xFieldProperties->setPropertyValue( + rPropNameSupplier.GetName(PROP_NUMBERING_TYPE), + uno::makeAny(nNumberingType)); } break; case FIELD_SET : break; @@ -3264,15 +3288,14 @@ void DomainMapper_Impl::CloseFieldCommand() rPropNameSupplier.GetName(PROP_NUMBERING_TYPE), uno::makeAny( lcl_ParseNumberingType(pContext->GetCommand()) )); break; - } } //set the text field if there is any pContext->SetTextField( uno::Reference< text::XTextField >( xFieldInterface, uno::UNO_QUERY ) ); } - catch( const uno::Exception& ) + catch( const uno::Exception& e ) { - OSL_FAIL( "Exception in CloseFieldCommand()" ); + SAL_WARN( "writerfilter", "Exception in CloseFieldCommand(): " << e.Message ); } pContext->SetCommandCompleted(); } |