summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper
diff options
context:
space:
mode:
Diffstat (limited to 'writerfilter/source/dmapper')
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx23
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.hxx2
2 files changed, 21 insertions, 4 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index a43e396ba461..7eb07f3043ac 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -3963,6 +3963,20 @@ FieldContext::~FieldContext()
{
}
+void FieldContext::SetTextField(uno::Reference<text::XTextField> const& xTextField)
+{
+#ifndef NDEBUG
+ if (xTextField.is())
+ {
+ uno::Reference<lang::XServiceInfo> const xServiceInfo(xTextField, uno::UNO_QUERY);
+ assert(xServiceInfo.is());
+ // those must be set by SetFormField()
+ assert(!xServiceInfo->supportsService("com.sun.star.text.Fieldmark")
+ && !xServiceInfo->supportsService("com.sun.star.text.FormFieldmark"));
+ }
+#endif
+ m_xTextField = xTextField;
+}
void FieldContext::AppendCommand(const OUString& rPart)
{
@@ -5472,8 +5486,7 @@ void DomainMapper_Impl::CloseFieldCommand()
case FIELD_FORMDROPDOWN :
case FIELD_FORMTEXT :
{
- uno::Reference< text::XTextField > xTextField( xFieldInterface, uno::UNO_QUERY );
- if ( !xTextField.is() )
+ if (bCreateEnhancedField)
{
FFDataHandler::Pointer_t
pFFDataHandler(pContext->getFFDataHandler());
@@ -5950,6 +5963,11 @@ void DomainMapper_Impl::CloseFieldCommand()
uno::makeAny( lcl_ParseNumberingType(pContext->GetCommand()) ));
break;
}
+
+ if (!bCreateEnhancedField)
+ {
+ pContext->SetTextField( uno::Reference<text::XTextField>(xFieldInterface, uno::UNO_QUERY) );
+ }
}
else
{
@@ -5984,7 +6002,6 @@ void DomainMapper_Impl::CloseFieldCommand()
m_bParaHadField = false;
}
//set the text field if there is any
- pContext->SetTextField( uno::Reference< text::XTextField >( xFieldInterface, uno::UNO_QUERY ) );
}
catch( const uno::Exception& )
{
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index f547360df842..575f6fd1876f 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -200,7 +200,7 @@ public:
const css::uno::Reference<css::beans::XPropertySet>& GetCustomField() const { return m_xCustomField; }
void SetCustomField(css::uno::Reference<css::beans::XPropertySet> const& xCustomField) { m_xCustomField = xCustomField; }
const css::uno::Reference<css::text::XTextField>& GetTextField() const { return m_xTextField;}
- void SetTextField(css::uno::Reference<css::text::XTextField> const& xTextField) { m_xTextField = xTextField;}
+ void SetTextField(css::uno::Reference<css::text::XTextField> const& xTextField);
const css::uno::Reference<css::text::XFormField>& GetFormField() const { return m_xFormField;}
void SetFormField(css::uno::Reference<css::text::XFormField> const& xFormField) { m_xFormField = xFormField;}