summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat@free.fr>2013-07-03 17:43:33 +0200
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2013-07-04 16:39:18 +0200
commit5743211f8b5f1d68b746b462942210ef69565960 (patch)
treea521f36d375d629f9c69d277aa45dad23c05df92
parent71a049c97049a38f37bf9417d752ca2d8d161a81 (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
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx29
1 files changed, 26 insertions, 3 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index ded3f892fa66..44c0a7ad0179 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -3220,6 +3220,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 = sIdentifier + "+1";
+ rtl::OUString sValue;
+ if( lcl_FindInCommand( pContext->GetCommand(), 'c', sValue ))
+ {
+ sFormula = sIdentifier;
+ }
+ 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;
@@ -3297,15 +3321,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();
}