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/nmspmap.hxx>
30 #include <xmloff/xmlnmspe.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  {
205  // setup fieldmark...
206  Reference<text::XFormField> const xFormField(xContent, UNO_QUERY);
207  assert(xFormField.is());
208  xFormField->setFieldType(fieldmarkTypeName);
209  rHelper.setCurrentFieldParamsTo(xFormField);
210  // move cursor after setFieldType as that may delete/re-insert
211  rHelper.GetCursor()->gotoRange(xContent->getAnchor()->getEnd(), false);
212  rHelper.GetCursor()->goLeft(1, false); // move before CH_TXT_ATR_FIELDEND
213  // tdf#129520: AppendTextNode() ignores the content index!
214  // plan B: insert a spurious paragraph break now and join
215  // it in PopFieldmark()!
216  rHelper.GetText()->insertControlCharacter(rHelper.GetCursor(),
217  text::ControlCharacter::PARAGRAPH_BREAK, false);
218  rHelper.GetCursor()->goLeft(1, false); // back to previous paragraph
219  }
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  {
229  if (rHelper.GetText() == xField->getAnchor()->getText())
230  {
231  try
232  { // skip CH_TXT_ATR_FIELDEND
233  rHelper.GetCursor()->goRight(1, true);
234  rHelper.GetCursor()->setString(OUString()); // undo AppendTextNode from InsertFieldmark
235  rHelper.GetCursor()->gotoRange(xField->getAnchor()->getEnd(), false);
236  }
237  catch (uno::Exception const&)
238  {
239  assert(false); // must succeed
240  }
241  }
242  else
243  {
244  SAL_INFO("xmloff.text", "fieldmark has invalid positions");
245  // could either dispose it or leave it to end at the end of the document?
246  xField->dispose();
247  }
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  {
260  if (!m_sBookmarkName.isEmpty() || TypeFieldmarkEnd == nTmp)
261  {
262  switch (nTmp)
263  {
264  case TypeReference:
265  // export point reference mark
267  "com.sun.star.text.ReferenceMark",
269  m_rHelper.GetCursorAsRange()->getStart());
270  break;
271 
272  case TypeBookmark:
273  {
274  // tdf#94804: detect duplicate heading cross reference bookmarks
275  if (m_sBookmarkName.startsWith("__RefHeading__"))
276  {
278  {
279  uno::Reference<container::XNamed> const xNamed(
280  m_rxCrossRefHeadingBookmark, uno::UNO_QUERY);
282  m_sBookmarkName, xNamed->getName());
283  break; // don't insert
284  }
285  }
286  }
287  [[fallthrough]];
288  case TypeFieldmark:
289  {
290  const char *formFieldmarkName=lcl_getFormFieldmarkName(m_sFieldName);
291  bool bImportAsField = (nTmp==TypeFieldmark && formFieldmarkName!=nullptr); //@TODO handle abbreviation cases...
292  // export point bookmark
295  (bImportAsField ? OUString("com.sun.star.text.FormFieldmark") : OUString(sAPI_bookmark)),
297  m_rHelper.GetCursorAsRange()->getStart(),
298  m_sXmlId) );
299  if (nTmp==TypeFieldmark) {
300  if (xContent.is() && bImportAsField) {
301  // setup fieldmark...
302  Reference< css::text::XFormField> xFormField(xContent, UNO_QUERY);
303  xFormField->setFieldType(OUString::createFromAscii(formFieldmarkName));
304  if (xFormField.is() && m_rHelper.hasCurrentFieldCtx()) {
306  }
307  }
309  }
310  if (TypeBookmark == nTmp
311  && m_sBookmarkName.startsWith("__RefHeading__"))
312  {
313  assert(xContent.is());
314  m_rxCrossRefHeadingBookmark = xContent;
315  }
316  }
317  break;
318 
319  case TypeBookmarkStart:
320  // save XTextRange for later construction of bookmark
321  {
322  std::shared_ptr< ::xmloff::ParsedRDFaAttributes >
323  xRDFaAttributes;
324  if (m_bHaveAbout && TypeBookmarkStart == nTmp)
325  {
326  xRDFaAttributes =
327  GetImport().GetRDFaImportHelper().ParseRDFa(
330  }
333  m_rHelper.GetCursorAsRange()->getStart(),
334  m_sXmlId, xRDFaAttributes);
335  }
336  break;
337 
338  case TypeBookmarkEnd:
339  {
340  // tdf#94804: detect duplicate heading cross reference bookmarks
341  if (m_sBookmarkName.startsWith("__RefHeading__"))
342  {
344  {
345  uno::Reference<container::XNamed> const xNamed(
346  m_rxCrossRefHeadingBookmark, uno::UNO_QUERY);
348  m_sBookmarkName, xNamed->getName());
349  break; // don't insert
350  }
351  }
352 
353  // get old range, and construct
354  Reference<XTextRange> xStartRange;
355  std::shared_ptr< ::xmloff::ParsedRDFaAttributes >
356  xRDFaAttributes;
358  m_sBookmarkName, xStartRange,
359  m_sXmlId, xRDFaAttributes))
360  {
361  Reference<XTextRange> xEndRange(
362  m_rHelper.GetCursorAsRange()->getStart());
363 
364  // check if beginning and end are in same XText
365  if (xStartRange.is() && xEndRange.is() && xStartRange->getText() == xEndRange->getText())
366  {
367  // create range for insertion
368  Reference<XTextCursor> xInsertionCursor =
369  m_rHelper.GetText()->createTextCursorByRange(
370  xEndRange);
371  try {
372  xInsertionCursor->gotoRange(xStartRange, true);
373  } catch (uno::Exception&) {
374  OSL_ENSURE(false,
375  "cannot go to end position of bookmark");
376  }
377 
378  //DBG_ASSERT(! xInsertionCursor->isCollapsed(),
379  // "we want no point mark");
380  // can't assert, because someone could
381  // create a file with subsequence
382  // start/end elements
383 
385  // insert reference
386  xContent = CreateAndInsertMark(GetImport(),
387  sAPI_bookmark,
389  xInsertionCursor,
390  m_sXmlId);
391  if (xRDFaAttributes)
392  {
393  const Reference<rdf::XMetadatable>
394  xMeta(xContent, UNO_QUERY);
395  GetImport().GetRDFaImportHelper().AddRDFa(
396  xMeta, xRDFaAttributes);
397  }
398  const Reference<XPropertySet> xPropertySet(xContent, UNO_QUERY);
399  if (xPropertySet.is())
400  {
401  xPropertySet->setPropertyValue("BookmarkHidden", uno::Any(m_rHelper.getBookmarkHidden(m_sBookmarkName)));
402  xPropertySet->setPropertyValue("BookmarkCondition", uno::Any(m_rHelper.getBookmarkCondition(m_sBookmarkName)));
403  }
404  if (m_sBookmarkName.startsWith("__RefHeading__"))
405  {
406  assert(xContent.is());
407  m_rxCrossRefHeadingBookmark = xContent;
408  }
409  }
410  // else: beginning/end in different XText -> ignore!
411  }
412  // else: no start found -> ignore!
413  break;
414  }
415  case TypeFieldmarkStart: // no separator, so insert at start
416  {
418  break;
419  }
420  case TypeFieldmarkEnd:
421  {
423  break;
424  }
425  case TypeReferenceStart:
426  case TypeReferenceEnd:
427  OSL_FAIL("reference start/end are handled in txtparai !");
428  break;
429 
430  default:
431  OSL_FAIL("unknown mark type");
432  break;
433  }
434  }
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:3422
SAL_DLLPRIVATE::xmloff::RDFaImportHelper & GetRDFaImportHelper()
do not dllexport this; only for advanced cases (bookmark-start)
Definition: xmlimp.cxx:1984
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:2903
constexpr sal_uInt16 XML_NAMESPACE_XHTML
Definition: xmlnmspe.hxx:52
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:397
constexpr sal_uInt16 XML_NAMESPACE_TEXT
Definition: xmlnmspe.hxx:31
rtl::Reference< XMLTextImportHelper > const & GetTextImport()
Definition: xmlimp.hxx:594
static 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 OUString & GetLocalName() const
Definition: xmlictxt.hxx:69
const OUString & getBookmarkCondition(OUString const &bookmark) const
Definition: txtimp.cxx:2970
void addFieldParam(const OUString &name, const OUString &value)
Definition: txtimp.cxx:2655
const char * sName
css::uno::Reference< css::text::XText > & GetText()
Definition: txtimp.cxx:632
constexpr sal_uInt16 XML_NAMESPACE_XML
Definition: xmlnmspe.hxx:51
css::uno::Reference< css::text::XTextRange > & GetCursorAsRange()
Definition: txtimp.cxx:642
static OUString lcl_getFieldmarkName(OUString const &name)
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:2594
static const char * lcl_getFormFieldmarkName(OUString const &name)
static auto PopFieldmark(XMLTextImportHelper &rHelper) -> void
bool getBookmarkHidden(OUString const &bookmark) const
Definition: txtimp.cxx:2965
bool hasCurrentFieldCtx() const
Definition: txtimp.cxx:2677
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:1960
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:2583
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:2640
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:2633
const css::uno::Reference< css::frame::XModel > & GetModel() const
Definition: xmlimp.hxx:403
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:2959
XMLTextMarkImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp, css::uno::Reference< css::uno::XInterface > &io_rxCrossRefHeadingBookmark, sal_uInt16 nPrfx, const OUString &rLocalName)
constexpr sal_uInt16 XML_NAMESPACE_FIELD
Definition: xmlnmspe.hxx:83
void setCurrentFieldParamsTo(css::uno::Reference< css::text::XFormField > const &xFormField)
Definition: txtimp.cxx:2682
#define ODF_FORMDROPDOWN
Definition: odffields.hxx:32