LibreOffice Module xmloff (master)  1
XMLTextMarkImportContext.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
21 
22 
23 #include <rtl/ustring.hxx>
24 #include <sal/log.hxx>
25 #include <osl/diagnose.h>
26 #include <xmloff/xmluconv.hxx>
27 #include <xmloff/xmltoken.hxx>
28 #include <xmloff/xmlimp.hxx>
29 #include <xmloff/namespacemap.hxx>
30 #include <xmloff/xmlnamespace.hxx>
31 #include <xmloff/odffields.hxx>
32 #include <xmloff/xmlement.hxx>
33 #include <com/sun/star/frame/XModel.hpp>
34 #include <com/sun/star/xml/sax/XAttributeList.hpp>
35 #include <com/sun/star/text/ControlCharacter.hpp>
36 #include <com/sun/star/text/XTextContent.hpp>
37 #include <com/sun/star/beans/XPropertySet.hpp>
38 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
39 #include <com/sun/star/container/XNamed.hpp>
40 #include <com/sun/star/rdf/XMetadatable.hpp>
41 
42 #include <com/sun/star/text/XFormField.hpp>
43 
44 #include <RDFaImportHelper.hxx>
45 
46 
47 using namespace ::com::sun::star;
48 using namespace ::com::sun::star::text;
49 using namespace ::com::sun::star::uno;
50 using namespace ::com::sun::star::beans;
51 using namespace ::com::sun::star::lang;
52 using namespace ::com::sun::star::container;
53 using namespace ::com::sun::star::xml::sax;
54 using namespace ::xmloff::token;
55 
56 
58  SvXMLImport& rImport,
59  XMLTextImportHelper& rHlp,
60  sal_uInt16 nPrefix,
61  const OUString& rLocalName ) :
62  SvXMLImportContext(rImport, nPrefix, rLocalName),
63  rHelper(rHlp)
64 {
65 }
66 
67 
68 void XMLFieldParamImportContext::StartElement(const css::uno::Reference< css::xml::sax::XAttributeList> & xAttrList)
69 {
70  SvXMLImport& rImport = GetImport();
71  OUString sName;
72  OUString sValue;
73 
74  sal_Int16 nLength = xAttrList->getLength();
75  for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
76  {
77  OUString sLocalName;
78  sal_uInt16 nPrefix = rImport.GetNamespaceMap().
79  GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
80  &sLocalName );
81 
82  if ( (XML_NAMESPACE_FIELD == nPrefix) &&
83  IsXMLToken(sLocalName, XML_NAME) )
84  {
85  sName = xAttrList->getValueByIndex(nAttr);
86  }
87  if ( (XML_NAMESPACE_FIELD == nPrefix) &&
88  IsXMLToken(sLocalName, XML_VALUE) )
89  {
90  sValue = xAttrList->getValueByIndex(nAttr);
91  }
92  }
93  if (rHelper.hasCurrentFieldCtx() && !sName.isEmpty()) {
94  rHelper.addFieldParam(sName, sValue);
95  }
96 }
97 
98 
100  SvXMLImport& rImport,
101  XMLTextImportHelper& rHlp,
102  uno::Reference<uno::XInterface> & io_rxCrossRefHeadingBookmark,
103  sal_uInt16 nPrefix,
104  const OUString& rLocalName )
105  : SvXMLImportContext(rImport, nPrefix, rLocalName)
106  , m_rHelper(rHlp)
107  , m_rxCrossRefHeadingBookmark(io_rxCrossRefHeadingBookmark)
108  , m_bHaveAbout(false)
109 {
110 }
111 
112 namespace {
113 
114 enum lcl_MarkType { TypeReference, TypeReferenceStart, TypeReferenceEnd,
115  TypeBookmark, TypeBookmarkStart, TypeBookmarkEnd,
116  TypeFieldmark, TypeFieldmarkStart, TypeFieldmarkEnd
117  };
118 
119 }
120 
122 {
123  { XML_REFERENCE_MARK, TypeReference },
124  { XML_REFERENCE_MARK_START, TypeReferenceStart },
125  { XML_REFERENCE_MARK_END, TypeReferenceEnd },
127  { XML_BOOKMARK_START, TypeBookmarkStart },
128  { XML_BOOKMARK_END, TypeBookmarkEnd },
129  { XML_FIELDMARK, TypeFieldmark },
130  { XML_FIELDMARK_START, TypeFieldmarkStart },
131  { XML_FIELDMARK_END, TypeFieldmarkEnd },
133 };
134 
135 
136 static const char *lcl_getFormFieldmarkName(OUString const &name)
137 {
138  if (name == ODF_FORMCHECKBOX ||
139  name == "msoffice.field.FORMCHECKBOX" ||
140  name == "ecma.office-open-xml.field.FORMCHECKBOX")
141  return ODF_FORMCHECKBOX;
142  else if (name == ODF_FORMDROPDOWN ||
143  name == "ecma.office-open-xml.field.FORMDROPDOWN")
144  return ODF_FORMDROPDOWN;
145  else
146  return nullptr;
147 }
148 
149 static OUString lcl_getFieldmarkName(OUString const& name)
150 {
151  if (name == "msoffice.field.FORMTEXT" ||
152  name == "ecma.office-open-xml.field.FORMTEXT")
153  return ODF_FORMTEXT;
154  else
155  return name;
156 }
157 
158 
160  const Reference<XAttributeList> & xAttrList)
161 {
162  if (!FindName(GetImport(), xAttrList))
163  {
164  m_sBookmarkName.clear();
165  }
166 
168  {
169  if (m_sBookmarkName.isEmpty())
170  {
171  m_sBookmarkName = "Unknown";
172  }
174  }
175 
177  {
178  const OUString sHidden = xAttrList->getValueByName("loext:hidden");
179  const OUString sCondition = xAttrList->getValueByName("loext:condition");
180  m_rHelper.setBookmarkAttributes(m_sBookmarkName, sHidden == "true", sCondition);
181  }
182 }
183 
184 static auto InsertFieldmark(SvXMLImport & rImport,
185  XMLTextImportHelper & rHelper, OUString const& rName) -> void
186 {
187  assert(rHelper.hasCurrentFieldCtx()); // was set up in StartElement()
188 
189  // fdo#86795 check if it's actually a checkbox first
190  OUString const type(rHelper.getCurrentFieldType());
191  OUString const fieldmarkTypeName = lcl_getFieldmarkName(type);
192  if (fieldmarkTypeName == ODF_FORMCHECKBOX ||
193  fieldmarkTypeName == ODF_FORMDROPDOWN)
194  { // sw can't handle checkbox with start+end
195  SAL_INFO("xmloff.text", "invalid fieldmark-start/fieldmark-end ignored");
196  return;
197  }
198 
199  Reference<XTextContent> const xContent = XMLTextMarkImportContext::CreateAndInsertMark(
200  rImport, "com.sun.star.text.Fieldmark",
201  rName, rHelper.GetCursorAsRange());
202 
203  if (!xContent.is())
204  return;
205 
206  // setup fieldmark...
207  Reference<text::XFormField> const xFormField(xContent, UNO_QUERY);
208  assert(xFormField.is());
209  xFormField->setFieldType(fieldmarkTypeName);
210  rHelper.setCurrentFieldParamsTo(xFormField);
211  // move cursor after setFieldType as that may delete/re-insert
212  rHelper.GetCursor()->gotoRange(xContent->getAnchor()->getEnd(), false);
213  rHelper.GetCursor()->goLeft(1, false); // move before CH_TXT_ATR_FIELDEND
214  // tdf#129520: AppendTextNode() ignores the content index!
215  // plan B: insert a spurious paragraph break now and join
216  // it in PopFieldmark()!
217  rHelper.GetText()->insertControlCharacter(rHelper.GetCursor(),
218  text::ControlCharacter::PARAGRAPH_BREAK, false);
219  rHelper.GetCursor()->goLeft(1, false); // back to previous paragraph
220 }
221 
222 static auto PopFieldmark(XMLTextImportHelper & rHelper) -> void
223 {
224  // can't verify name because it's not written as an attribute...
225  uno::Reference<text::XTextContent> const xField(rHelper.popFieldCtx(),
226  uno::UNO_QUERY);
227  if (!xField.is())
228  return;
229 
230  if (rHelper.GetText() == xField->getAnchor()->getText())
231  {
232  try
233  { // skip CH_TXT_ATR_FIELDEND
234  rHelper.GetCursor()->goRight(1, true);
235  rHelper.GetCursor()->setString(OUString()); // undo AppendTextNode from InsertFieldmark
236  rHelper.GetCursor()->gotoRange(xField->getAnchor()->getEnd(), false);
237  }
238  catch (uno::Exception const&)
239  {
240  assert(false); // must succeed
241  }
242  }
243  else
244  {
245  SAL_INFO("xmloff.text", "fieldmark has invalid positions");
246  // could either dispose it or leave it to end at the end of the document?
247  xField->dispose();
248  }
249 }
250 
252 {
254 
255  static const char sAPI_bookmark[] = "com.sun.star.text.Bookmark";
256 
257  lcl_MarkType nTmp{};
258  if (!SvXMLUnitConverter::convertEnum(nTmp, GetLocalName(), lcl_aMarkTypeMap))
259  return;
260 
261  if (m_sBookmarkName.isEmpty() && TypeFieldmarkEnd != nTmp)
262  return;
263 
264  switch (nTmp)
265  {
266  case TypeReference:
267  // export point reference mark
269  "com.sun.star.text.ReferenceMark",
271  m_rHelper.GetCursorAsRange()->getStart());
272  break;
273 
274  case TypeBookmark:
275  {
276  // tdf#94804: detect duplicate heading cross reference bookmarks
277  if (m_sBookmarkName.startsWith("__RefHeading__"))
278  {
280  {
281  uno::Reference<container::XNamed> const xNamed(
282  m_rxCrossRefHeadingBookmark, uno::UNO_QUERY);
284  m_sBookmarkName, xNamed->getName());
285  break; // don't insert
286  }
287  }
288  }
289  [[fallthrough]];
290  case TypeFieldmark:
291  {
292  const char *formFieldmarkName=lcl_getFormFieldmarkName(m_sFieldName);
293  bool bImportAsField = (nTmp==TypeFieldmark && formFieldmarkName!=nullptr); //@TODO handle abbreviation cases...
294  // export point bookmark
297  (bImportAsField ? OUString("com.sun.star.text.FormFieldmark") : OUString(sAPI_bookmark)),
299  m_rHelper.GetCursorAsRange()->getStart(),
300  m_sXmlId) );
301  if (nTmp==TypeFieldmark) {
302  if (xContent.is() && bImportAsField) {
303  // setup fieldmark...
304  Reference< css::text::XFormField> xFormField(xContent, UNO_QUERY);
305  xFormField->setFieldType(OUString::createFromAscii(formFieldmarkName));
306  if (xFormField.is() && m_rHelper.hasCurrentFieldCtx()) {
308  }
309  }
311  }
312  if (TypeBookmark == nTmp
313  && m_sBookmarkName.startsWith("__RefHeading__"))
314  {
315  assert(xContent.is());
316  m_rxCrossRefHeadingBookmark = xContent;
317  }
318  }
319  break;
320 
321  case TypeBookmarkStart:
322  // save XTextRange for later construction of bookmark
323  {
324  std::shared_ptr< ::xmloff::ParsedRDFaAttributes >
325  xRDFaAttributes;
326  if (m_bHaveAbout && TypeBookmarkStart == nTmp)
327  {
328  xRDFaAttributes =
329  GetImport().GetRDFaImportHelper().ParseRDFa(
332  }
335  m_rHelper.GetCursorAsRange()->getStart(),
336  m_sXmlId, xRDFaAttributes);
337  }
338  break;
339 
340  case TypeBookmarkEnd:
341  {
342  // tdf#94804: detect duplicate heading cross reference bookmarks
343  if (m_sBookmarkName.startsWith("__RefHeading__"))
344  {
346  {
347  uno::Reference<container::XNamed> const xNamed(
348  m_rxCrossRefHeadingBookmark, uno::UNO_QUERY);
350  m_sBookmarkName, xNamed->getName());
351  break; // don't insert
352  }
353  }
354 
355  // get old range, and construct
356  Reference<XTextRange> xStartRange;
357  std::shared_ptr< ::xmloff::ParsedRDFaAttributes >
358  xRDFaAttributes;
360  m_sBookmarkName, xStartRange,
361  m_sXmlId, xRDFaAttributes))
362  {
363  Reference<XTextRange> xEndRange(
364  m_rHelper.GetCursorAsRange()->getStart());
365 
366  // check if beginning and end are in same XText
367  if (xStartRange.is() && xEndRange.is() && xStartRange->getText() == xEndRange->getText())
368  {
369  // create range for insertion
370  Reference<XTextCursor> xInsertionCursor =
371  m_rHelper.GetText()->createTextCursorByRange(
372  xEndRange);
373  try {
374  xInsertionCursor->gotoRange(xStartRange, true);
375  } catch (uno::Exception&) {
376  OSL_ENSURE(false,
377  "cannot go to end position of bookmark");
378  }
379 
380  //DBG_ASSERT(! xInsertionCursor->isCollapsed(),
381  // "we want no point mark");
382  // can't assert, because someone could
383  // create a file with subsequence
384  // start/end elements
385 
387  // insert reference
388  xContent = CreateAndInsertMark(GetImport(),
389  sAPI_bookmark,
391  xInsertionCursor,
392  m_sXmlId);
393  if (xRDFaAttributes)
394  {
395  const Reference<rdf::XMetadatable>
396  xMeta(xContent, UNO_QUERY);
397  GetImport().GetRDFaImportHelper().AddRDFa(
398  xMeta, xRDFaAttributes);
399  }
400  const Reference<XPropertySet> xPropertySet(xContent, UNO_QUERY);
401  if (xPropertySet.is())
402  {
403  xPropertySet->setPropertyValue("BookmarkHidden", uno::Any(m_rHelper.getBookmarkHidden(m_sBookmarkName)));
404  xPropertySet->setPropertyValue("BookmarkCondition", uno::Any(m_rHelper.getBookmarkCondition(m_sBookmarkName)));
405  }
406  if (m_sBookmarkName.startsWith("__RefHeading__"))
407  {
408  assert(xContent.is());
409  m_rxCrossRefHeadingBookmark = xContent;
410  }
411  }
412  // else: beginning/end in different XText -> ignore!
413  }
414  // else: no start found -> ignore!
415  break;
416  }
417  case TypeFieldmarkStart: // no separator, so insert at start
418  {
420  break;
421  }
422  case TypeFieldmarkEnd:
423  {
425  break;
426  }
427  case TypeReferenceStart:
428  case TypeReferenceEnd:
429  OSL_FAIL("reference start/end are handled in txtparai !");
430  break;
431 
432  default:
433  OSL_FAIL("unknown mark type");
434  break;
435  }
436 }
437 
439  const OUString& rLocalName,
440  const css::uno::Reference< css::xml::sax::XAttributeList >& )
441 {
443  nPrefix, rLocalName);
444 }
445 
446 
448  SvXMLImport& rImport,
449  const OUString& sServiceName,
450  const OUString& sMarkName,
451  const Reference<XTextRange> & rRange,
452  const OUString& i_rXmlId)
453 {
454  // create mark
455  const Reference<XMultiServiceFactory> xFactory(rImport.GetModel(),
456  UNO_QUERY);
458 
459  if (xFactory.is())
460  {
461  xIfc = xFactory->createInstance(sServiceName);
462 
463  if (!xIfc.is())
464  {
465  OSL_FAIL("CreateAndInsertMark: cannot create service?");
466  return nullptr;
467  }
468 
469  // set name (unless there is no name (text:meta))
470  const Reference<XNamed> xNamed(xIfc, UNO_QUERY);
471  if (xNamed.is())
472  {
473  xNamed->setName(sMarkName);
474  }
475  else
476  {
477  if (!sMarkName.isEmpty())
478  {
479  OSL_FAIL("name given, but XNamed not supported?");
480  return nullptr;
481  }
482  }
483 
484  // cast to XTextContent and attach to document
485  const Reference<XTextContent> xTextContent(xIfc, UNO_QUERY);
486  if (xTextContent.is())
487  {
488  try
489  {
490  // if inserting marks, bAbsorb==sal_False will cause
491  // collapsing of the given XTextRange.
492  rImport.GetTextImport()->GetText()->insertTextContent(rRange,
493  xTextContent, true);
494 
495  // xml:id for RDF metadata -- after insertion!
496  rImport.SetXmlId(xIfc, i_rXmlId);
497 
498  return xTextContent;
499  }
500  catch (css::lang::IllegalArgumentException &)
501  {
502  OSL_FAIL("CreateAndInsertMark: cannot insert?");
503  return nullptr;
504  }
505  }
506  }
507  return nullptr;
508 }
509 
511  SvXMLImport& rImport,
512  const Reference<XAttributeList> & xAttrList)
513 {
514  bool bNameOK = false;
515 
516  // find name attribute first
517  const sal_Int16 nLength = xAttrList->getLength();
518  for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
519  {
520  OUString sLocalName;
521  const sal_uInt16 nPrefix = rImport.GetNamespaceMap().
522  GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
523  &sLocalName );
524 
525  if ( (XML_NAMESPACE_TEXT == nPrefix) &&
526  IsXMLToken(sLocalName, XML_NAME) )
527  {
528  m_sBookmarkName = xAttrList->getValueByIndex(nAttr);
529  bNameOK = true;
530  }
531  else if ( (XML_NAMESPACE_XML == nPrefix) &&
532  IsXMLToken(sLocalName, XML_ID) )
533  {
534  m_sXmlId = xAttrList->getValueByIndex(nAttr);
535  }
536  else if ( XML_NAMESPACE_XHTML == nPrefix )
537  {
538  // RDFa
539  if ( IsXMLToken( sLocalName, XML_ABOUT) )
540  {
541  m_sAbout = xAttrList->getValueByIndex(nAttr);
542  m_bHaveAbout = true;
543  }
544  else if ( IsXMLToken( sLocalName, XML_PROPERTY) )
545  {
546  m_sProperty = xAttrList->getValueByIndex(nAttr);
547  }
548  else if ( IsXMLToken( sLocalName, XML_CONTENT) )
549  {
550  m_sContent = xAttrList->getValueByIndex(nAttr);
551  }
552  else if ( IsXMLToken( sLocalName, XML_DATATYPE) )
553  {
554  m_sDatatype = xAttrList->getValueByIndex(nAttr);
555  }
556  }
557  else if ( (XML_NAMESPACE_FIELD == nPrefix) &&
558  IsXMLToken(sLocalName, XML_TYPE) )
559  {
560  m_sFieldName = xAttrList->getValueByIndex(nAttr);
561  }
562  }
563 
564  return bNameOK;
565 }
566 
567 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool IsXMLToken(const OUString &rString, enum XMLTokenEnum eToken)
compare eToken to the string
Definition: xmltoken.cxx:3434
SAL_DLLPRIVATE::xmloff::RDFaImportHelper & GetRDFaImportHelper()
do not dllexport this; only for advanced cases (bookmark-start)
Definition: xmlimp.cxx:1991
static bool convertEnum(EnumT &rEnum, const OUString &rValue, const SvXMLEnumMapEntry< EnumT > *pMap)
convert string to enum using given enum map, if the enum is not found in the map, this method will re...
Definition: xmluconv.hxx:128
virtual void EndElement()
EndElement is called before a context will be destructed, but after an elements context has been pars...
Definition: xmlictxt.cxx:62
XMLFieldParamImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp, sal_uInt16 nPrfx, const OUString &rLocalName)
void AddCrossRefHeadingMapping(OUString const &rFrom, OUString const &rTo)
Definition: txtimp.cxx:2897
virtual void StartElement(const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
StartElement is called after a context has been constructed and before an elements context is parsed...
virtual void StartElement(const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
StartElement is called after a context has been constructed and before an elements context is parsed...
SvXMLImport & GetImport()
Definition: xmlictxt.hxx:62
#define ODF_FORMCHECKBOX
Definition: odffields.hxx:27
SvXMLNamespaceMap & GetNamespaceMap()
Definition: xmlimp.hxx:402
rtl::Reference< XMLTextImportHelper > const & GetTextImport()
Definition: xmlimp.hxx:600
SvXMLEnumMapEntry< lcl_MarkType > const lcl_aMarkTypeMap[]
static auto InsertFieldmark(SvXMLImport &rImport, XMLTextImportHelper &rHelper, OUString const &rName) -> void
static css::uno::Reference< css::text::XTextContent > CreateAndInsertMark(SvXMLImport &rImport, const OUString &sServiceName, const OUString &sMarkName, const css::uno::Reference< css::text::XTextRange > &rRange, const OUString &i_rXmlId=OUString())
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
const OUString & GetLocalName() const
Definition: xmlictxt.hxx:69
const OUString & getBookmarkCondition(OUString const &bookmark) const
Definition: txtimp.cxx:2964
void addFieldParam(const OUString &name, const OUString &value)
Definition: txtimp.cxx:2649
const char * sName
css::uno::Reference< css::text::XText > & GetText()
Definition: txtimp.cxx:620
char const sHidden[]
constexpr sal_uInt16 XML_NAMESPACE_XML
css::uno::Reference< css::text::XTextRange > & GetCursorAsRange()
Definition: txtimp.cxx:630
static OUString lcl_getFieldmarkName(OUString const &name)
constexpr sal_uInt16 XML_NAMESPACE_TEXT
bool FindAndRemoveBookmarkStartRange(const OUString &sName, css::uno::Reference< css::text::XTextRange > &o_rRange, OUString &o_rXmlId, std::shared_ptr< ::xmloff::ParsedRDFaAttributes > &o_rpRDFaAttributes)
process the start of a range reference
Definition: txtimp.cxx:2600
static const char * lcl_getFormFieldmarkName(OUString const &name)
static auto PopFieldmark(XMLTextImportHelper &rHelper) -> void
bool getBookmarkHidden(OUString const &bookmark) const
Definition: txtimp.cxx:2959
constexpr sal_uInt16 XML_NAMESPACE_XHTML
bool hasCurrentFieldCtx() const
Definition: txtimp.cxx:2671
bool FindName(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList)
void SetXmlId(css::uno::Reference< css::uno::XInterface > const &i_xIfc, OUString const &i_rXmlId)
set the XmlId attribute of given UNO object (for RDF metadata)
Definition: xmlimp.cxx:1966
This class deliberately does not support XWeak, to improve performance when loading large documents...
Definition: xmlictxt.hxx:44
void InsertBookmarkStartRange(const OUString &sName, const css::uno::Reference< css::text::XTextRange > &rRange, OUString const &i_rXmlId, std::shared_ptr< ::xmloff::ParsedRDFaAttributes > &i_rpRDFaAttributes)
save the start of a range reference
Definition: txtimp.cxx:2589
virtual SvXMLImportContextRef CreateChildContext(sal_uInt16 nPrefix, const OUString &rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
Create a children element context.
Map an XMLTokenEnum to an enum value.
Definition: ximpshap.hxx:40
css::uno::Reference< css::text::XFormField > popFieldCtx()
Definition: txtimp.cxx:2634
Handling of tokens in XML:
#define SAL_INFO(area, stream)
#define ODF_FORMTEXT
Definition: odffields.hxx:24
void pushFieldCtx(const OUString &name, const OUString &type)
Definition: txtimp.cxx:2627
const css::uno::Reference< css::frame::XModel > & GetModel() const
Definition: xmlimp.hxx:408
css::uno::Reference< css::uno::XInterface > & m_rxCrossRefHeadingBookmark
virtual void EndElement() override
EndElement is called before a context will be destructed, but after an elements context has been pars...
uno::Reference< ucb::XContent > xContent
ResultType type
Reference< XSingleServiceFactory > xFactory
sal_Int32 nLength
Definition: xmltoken.cxx:36
void setBookmarkAttributes(OUString const &bookmark, bool hidden, OUString const &condition)
Definition: txtimp.cxx:2953
XMLTextMarkImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp, css::uno::Reference< css::uno::XInterface > &io_rxCrossRefHeadingBookmark, sal_uInt16 nPrfx, const OUString &rLocalName)
void setCurrentFieldParamsTo(css::uno::Reference< css::text::XFormField > const &xFormField)
Definition: txtimp.cxx:2676
#define ODF_FORMDROPDOWN
Definition: odffields.hxx:32
constexpr sal_uInt16 XML_NAMESPACE_FIELD