summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2008-09-04 09:09:34 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2008-09-04 09:09:34 +0000
commit3c6ee267621302514d98874fb72cbc3cb61d829c (patch)
tree44bd574fa364be1782dfdee30ab4455f7a5bb001
parente584b9796ef70412b16c50318c67328a7dc283b1 (diff)
INTEGRATION: CWS swenhancedfields2 (1.142.8); FILE MERGED
2008/08/04 15:18:37 b_michaelsen 1.142.8.3: RESYNC: (1.142-1.150); FILE MERGED 2008/05/07 09:56:44 ama 1.142.8.2: Patch #i33737#: Enhanced fields 2008/04/23 09:01:55 ama 1.142.8.1: #i33737#: Enhanced fields
-rw-r--r--xmloff/source/text/txtparae.cxx65
1 files changed, 64 insertions, 1 deletions
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 36c78b6445..8b8c29dcff 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: txtparae.cxx,v $
- * $Revision: 1.152 $
+ * $Revision: 1.153 $
*
* This file is part of OpenOffice.org.
*
@@ -78,6 +78,10 @@
#include <com/sun/star/document/XEmbeddedObjectSupplier.hpp>
#include <com/sun/star/document/XEventsSupplier.hpp>
#include <com/sun/star/document/XRedlinesSupplier.hpp>
+
+#include <com/sun/star/text/XBookmarksSupplier.hpp>
+#include <com/sun/star/text/XFormField.hpp>
+
#include <com/sun/star/text/XTextSection.hpp>
#include <com/sun/star/text/SectionFileLink.hpp>
#include <com/sun/star/drawing/XShape.hpp>
@@ -985,6 +989,9 @@ XMLTextParagraphExport::XMLTextParagraphExport(
sVisitedCharStyleName(RTL_CONSTASCII_USTRINGPARAM("VisitedCharStyleName")),
sWidth(RTL_CONSTASCII_USTRINGPARAM("Width")),
sWidthType( RTL_CONSTASCII_USTRINGPARAM( "WidthType" ) ),
+ sTextFieldStart( RTL_CONSTASCII_USTRINGPARAM( "TextFieldStart" ) ),
+ sTextFieldEnd( RTL_CONSTASCII_USTRINGPARAM( "TextFieldEnd" ) ),
+ sTextFieldStartEnd( RTL_CONSTASCII_USTRINGPARAM( "TextFieldStartEnd" ) ),
aCharStyleNamesPropInfoCache( sCharStyleNames )
{
UniReference < XMLPropertySetMapper > xPropMapper(new XMLTextPropertySetMapper( TEXT_PROP_MAP_PARA ));
@@ -2212,6 +2219,62 @@ void XMLTextParagraphExport::exportTextRangeEnumeration(
{
exportRuby(xPropSet, bAutoStyles);
}
+ else if (sType.equals(sTextFieldStart))
+ {
+ Reference<XNamed> xBookmark(xPropSet->getPropertyValue(sBookmark), UNO_QUERY);
+ if (xBookmark.is()) {
+ GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, xBookmark->getName());
+ }
+ Reference< ::com::sun::star::text::XFormField > xFormField(xPropSet->getPropertyValue(sBookmark), UNO_QUERY);
+ if (xFormField.is()) {
+ GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_TYPE, ::rtl::OUString::createFromAscii("msoffice.field.FORMTEXT"));
+ }
+ GetExport().StartElement(XML_NAMESPACE_FIELD, XML_FIELDMARK_START, sal_False);
+ if (xFormField.is()) {
+ GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_NAME, ::rtl::OUString::createFromAscii("Description"));
+ GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_VALUE, xFormField->getDescription());
+ GetExport().StartElement(XML_NAMESPACE_FIELD, XML_PARAM, sal_False);
+ GetExport().EndElement(XML_NAMESPACE_FIELD, XML_PARAM, sal_False);
+ }
+ GetExport().EndElement(XML_NAMESPACE_FIELD, XML_FIELDMARK_START, sal_False);
+ }
+ else if (sType.equals(sTextFieldEnd))
+ {
+ GetExport().StartElement(XML_NAMESPACE_FIELD, XML_FIELDMARK_END, sal_False);
+ GetExport().EndElement(XML_NAMESPACE_FIELD, XML_FIELDMARK_END, sal_False);
+ }
+ else if (sType.equals(sTextFieldStartEnd))
+ {
+ Reference<XNamed> xBookmark(xPropSet->getPropertyValue(sBookmark), UNO_QUERY);
+ if (xBookmark.is()) {
+ GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, xBookmark->getName());
+ }
+ Reference< ::com::sun::star::text::XFormField > xFormField(xPropSet->getPropertyValue(sBookmark), UNO_QUERY);
+ if (xFormField.is()) {
+ sal_Int16 fftype=xFormField->getType();
+ switch (fftype) {
+ case 1:
+ GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_TYPE, ::rtl::OUString::createFromAscii("msoffice.field.FORMCHECKBOX"));
+ break;
+ default:
+ DBG_ASSERT(false, "hey ---- add your export stuff here!!");
+ break;
+ }
+ }
+ GetExport().StartElement(XML_NAMESPACE_FIELD, XML_FIELDMARK, sal_False);
+ if (xFormField.is()) {
+ GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_NAME, ::rtl::OUString::createFromAscii("Description"));
+ GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_VALUE, xFormField->getDescription());
+ GetExport().StartElement(XML_NAMESPACE_FIELD, XML_PARAM, sal_False);
+ GetExport().EndElement(XML_NAMESPACE_FIELD, XML_PARAM, sal_False);
+
+ GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_NAME, ::rtl::OUString::createFromAscii("Result"));
+ GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_VALUE, ::rtl::OUString::valueOf((sal_Int32 )xFormField->getRes()));
+ GetExport().StartElement(XML_NAMESPACE_FIELD, XML_PARAM, sal_False);
+ GetExport().EndElement(XML_NAMESPACE_FIELD, XML_PARAM, sal_False);
+ }
+ GetExport().EndElement(XML_NAMESPACE_FIELD, XML_FIELDMARK, sal_False);
+ }
else if (sType.equals(sSoftPageBreak))
{
exportSoftPageBreak(xPropSet, bAutoStyles);