LibreOffice Module xmloff (master)  1
layerimport.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 
20 #include "layerimport.hxx"
21 #include "formenums.hxx"
22 #include "elementimport.hxx"
23 #include "officeforms.hxx"
24 #include "strings.hxx"
25 #include <xmloff/xmlictxt.hxx>
26 #include <xmloff/xmlstyle.hxx>
27 #include <xmloff/families.hxx>
28 #include <xmloff/xmlimp.hxx>
29 #include <XMLEventImportHelper.hxx>
30 #include <xmloff/xmlnumfi.hxx>
31 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
32 #include <com/sun/star/form/FormSubmitEncoding.hpp>
33 #include <com/sun/star/form/FormSubmitMethod.hpp>
34 #include <com/sun/star/sdb/CommandType.hpp>
35 #include <com/sun/star/form/NavigationBarMode.hpp>
36 #include <com/sun/star/form/TabulatorCycle.hpp>
37 #include <com/sun/star/form/FormButtonType.hpp>
38 #include <com/sun/star/form/ListSourceType.hpp>
39 #include "formevents.hxx"
40 #include "formcellbinding.hxx"
41 #include <xmloff/xformsimport.hxx>
42 #include <xmloff/xmltoken.hxx>
43 #include <xmloff/xmlnamespace.hxx>
44 #include <rtl/strbuf.hxx>
45 #include <tools/diagnose_ex.h>
46 #include <algorithm>
47 
48 namespace xmloff
49 {
50 
51 using namespace ::com::sun::star::uno;
52 using namespace ::com::sun::star::awt;
53 using namespace ::com::sun::star::lang;
54 using namespace ::com::sun::star::beans;
55 using namespace ::com::sun::star::container;
56 using namespace ::com::sun::star::drawing;
57 using namespace ::com::sun::star;
58 using namespace ::com::sun::star::util;
59 using namespace ::com::sun::star::form;
60 using namespace ::com::sun::star::sdb;
61 using namespace token;
62 
63 //= OFormLayerXMLImport_Impl
65  :m_rImporter(_rImporter)
66 {
67  // build the attribute2property map
68  // string properties which are exported as attributes
91 
92  // properties not added because they're already present in another form
93  OSL_ENSURE(
96  "OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl: invalid attribute names (1)!");
97  // if this fails, we would have to add a translation from faAction->PROPERTY_TARGETURL
98  // We did not because we already have one CCAFlags::TargetLocation->PROPERTY_TARGETURL,
99  // and CCAFlags::TargetLocation and faAction should be represented by the same attribute
100 
101  OSL_ENSURE(
102  OUString::createFromAscii(OAttributeMetaData::getCommonControlAttributeName(CCAFlags::Name)).equalsAscii(
104  "OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl: invalid attribute names (2)!");
105  // the same for faName, CCAFlags::Name and PROPERTY_NAME
106 
107  // boolean properties which are exported as attributes
154 
155  // the int16 attributes
164 
165  // the int32 attributes
168 
169  // the enum attributes
213 
214  // 'initialize'
216 }
217 
219 {}
220 
222 {
223  OSL_ENSURE(!m_xAutoStyles.is(), "OFormLayerXMLImport_Impl::setAutoStyleContext: not to be called twice!");
224  m_xAutoStyles.set(_pNewContext);
225 }
226 
227 void OFormLayerXMLImport_Impl::applyControlNumberStyle(const Reference< XPropertySet >& _rxControlModel, const OUString& _rControlNumberStyleName)
228 {
229  OSL_ENSURE(_rxControlModel.is() && (!_rControlNumberStyleName.isEmpty()),
230  "OFormLayerXMLImport_Impl::applyControlNumberStyle: invalid arguments (this will crash)!");
231 
232  OSL_ENSURE(m_xAutoStyles.is(), "OFormLayerXMLImport_Impl::applyControlNumberStyle: have no auto style context!");
233  if (!m_xAutoStyles.is())
234  {
235  m_xAutoStyles.set(m_rImporter.GetShapeImport()->GetAutoStylesContext());
236  }
237 
238  if (!m_xAutoStyles.is())
239  return;
240 
241  const SvXMLStyleContext* pStyle = m_xAutoStyles->FindStyleChildContext(XmlStyleFamily::DATA_STYLE, _rControlNumberStyleName);
242  if (pStyle)
243  {
244  const SvXMLNumFormatContext* pDataStyle = static_cast<const SvXMLNumFormatContext*>(pStyle);
245 
246  // set this format at the control model
247  try
248  {
249  // the models number format supplier and formats
250  Reference< XNumberFormatsSupplier > xFormatsSupplier;
251  _rxControlModel->getPropertyValue(PROPERTY_FORMATSSUPPLIER) >>= xFormatsSupplier;
252  Reference< XNumberFormats > xFormats;
253  if (xFormatsSupplier.is())
254  xFormats = xFormatsSupplier->getNumberFormats();
255  OSL_ENSURE(xFormats.is(), "OFormLayerXMLImport_Impl::applyControlNumberStyle: could not obtain the controls number formats!");
256 
257  // obtain a key
258  if (xFormats.is())
259  {
260  sal_Int32 nFormatKey = const_cast<SvXMLNumFormatContext*>(pDataStyle)->CreateAndInsert( xFormatsSupplier );
261  OSL_ENSURE(-1 != nFormatKey, "OFormLayerXMLImport_Impl::applyControlNumberStyle: could not obtain a format key!");
262 
263  // set the format on the control model
264  _rxControlModel->setPropertyValue(PROPERTY_FORMATKEY, makeAny(nFormatKey));
265  }
266  }
267  catch(const Exception&)
268  {
269  OSL_FAIL("OFormLayerXMLImport_Impl::applyControlNumberStyle: couldn't set the format!");
270  }
271  }
272  else
273  OSL_FAIL("OFormLayerXMLImport_Impl::applyControlNumberStyle: did not find the style with the given name!");
274 }
275 
276 void OFormLayerXMLImport_Impl::registerCellValueBinding( const Reference< XPropertySet >& _rxControlModel, const OUString& _rCellAddress )
277 {
278  OSL_ENSURE( _rxControlModel.is() && !_rCellAddress.isEmpty(),
279  "OFormLayerXMLImport_Impl::registerCellValueBinding: invalid arguments!" );
280  m_aCellValueBindings.emplace_back( _rxControlModel, _rCellAddress );
281 }
282 
284  const Reference< XPropertySet >& _rxControlModel,
285  const OUString& _rBindingID )
286 {
287  // TODO: is an empty binding name allowed?
288  OSL_ENSURE( _rxControlModel.is(), "need model" );
289 
290  m_aXFormsValueBindings.emplace_back( _rxControlModel, _rBindingID );
291 }
292 
294  const Reference< XPropertySet >& _rxControlModel,
295  const OUString& _rBindingID )
296 {
297  // TODO: is an empty binding name allowed?
298  OSL_ENSURE( _rxControlModel.is(), "need model" );
299 
300  m_aXFormsListBindings.emplace_back( _rxControlModel, _rBindingID );
301 }
302 
304  const Reference< XPropertySet >& _rxControlModel,
305  const OUString& _rSubmissionID )
306 {
307  // TODO: is an empty binding name allowed?
308  OSL_ENSURE( _rxControlModel.is(), "need model" );
309 
310  m_aXFormsSubmissions.emplace_back( _rxControlModel, _rSubmissionID );
311 }
312 
313 void OFormLayerXMLImport_Impl::registerCellRangeListSource( const Reference< XPropertySet >& _rxControlModel, const OUString& _rCellRangeAddress )
314 {
315  OSL_ENSURE( _rxControlModel.is() && !_rCellRangeAddress.isEmpty(),
316  "OFormLayerXMLImport_Impl::registerCellRangeListSource: invalid arguments!" );
317  m_aCellRangeListSources.emplace_back( _rxControlModel, _rCellRangeAddress );
318 }
319 const SvXMLStyleContext* OFormLayerXMLImport_Impl::getStyleElement(const OUString& _rStyleName) const
320 {
321  OSL_ENSURE( m_xAutoStyles.is(), "OFormLayerXMLImport_Impl::getStyleElement: have no auto style context!" );
322  // did you use setAutoStyleContext?
323 
324  const SvXMLStyleContext* pControlStyle =
325  m_xAutoStyles.is() ? m_xAutoStyles->FindStyleChildContext( XmlStyleFamily::TEXT_PARAGRAPH, _rStyleName ) : nullptr;
326  OSL_ENSURE( pControlStyle || !m_xAutoStyles.is(),
327  OStringBuffer("OFormLayerXMLImport_Impl::getStyleElement: did not find the style named \"" +
328  OUStringToOString(_rStyleName, RTL_TEXTENCODING_ASCII_US) +
329  "\"!").getStr() );
330  return pControlStyle;
331 }
332 
334 {
335  // install our own translation table. We need to disable the other tables because of name conflicts.
338 }
339 
341 {
342  // install the original event tables.
344 }
345 
346 void OFormLayerXMLImport_Impl::registerControlId(const Reference< XPropertySet >& _rxControl, const OUString& _rId)
347 {
348  OSL_ENSURE(m_aCurrentPageIds != m_aControlIds.end(), "OFormLayerXMLImport_Impl::registerControlId: no current page!");
349  OSL_ENSURE(!_rId.isEmpty(), "OFormLayerXMLImport_Impl::registerControlId: invalid (empty) control id!");
350 
351  OSL_ENSURE(m_aCurrentPageIds->second.end() == m_aCurrentPageIds->second.find(_rId), "OFormLayerXMLImport_Impl::registerControlId: control id already used!");
352  m_aCurrentPageIds->second[_rId] = _rxControl;
353 }
354 
355 void OFormLayerXMLImport_Impl::registerControlReferences(const Reference< XPropertySet >& _rxControl, const OUString& _rReferringControls)
356 {
357  OSL_ENSURE(!_rReferringControls.isEmpty(), "OFormLayerXMLImport_Impl::registerControlReferences: invalid (empty) control id list!");
358  OSL_ENSURE(_rxControl.is(), "OFormLayerXMLImport_Impl::registerControlReferences: invalid (NULL) control!");
359  m_aControlReferences.emplace_back( _rxControl, _rReferringControls );
360 }
361 
362 void OFormLayerXMLImport_Impl::startPage(const Reference< XDrawPage >& _rxDrawPage)
363 {
364  m_xCurrentPageFormsSupp.clear();
365 
366  OSL_ENSURE(_rxDrawPage.is(), "OFormLayerXMLImport_Impl::startPage: NULL page!");
367  m_xCurrentPageFormsSupp.set(_rxDrawPage, css::uno::UNO_QUERY);
368  OSL_ENSURE( m_xCurrentPageFormsSupp.is(), "OFormLayerXMLImport_Impl::startPage: invalid draw page (no XFormsSupplier)!" );
369  if ( !m_xCurrentPageFormsSupp.is() )
370  return;
371 
372  // add a new entry to our page map
373  ::std::pair< MapDrawPage2Map::iterator, bool > aPagePosition = m_aControlIds.emplace(_rxDrawPage, MapString2PropertySet());
374  OSL_ENSURE(aPagePosition.second, "OFormLayerXMLImport_Impl::startPage: already imported this page!");
375  m_aCurrentPageIds = aPagePosition.first;
376 }
377 
379 {
380  OSL_ENSURE( m_xCurrentPageFormsSupp.is(), "OFormLayerXMLImport_Impl::endPage: sure you called startPage before?" );
381 
382  // do some knittings for the controls which are referring to each other
383  try
384  {
385  static const sal_Unicode s_nSeparator = ',';
386  OUString sCurrentReferring;
387  OUString sSeparator(&s_nSeparator, 1);
388  Reference< XPropertySet > xCurrentReferring;
389  sal_Int32 nSeparator, nPrevSep;
390  for ( const auto& rReferences : m_aControlReferences )
391  {
392  // the list of control ids is comma separated
393 
394  // in a list of n ids there are only n-1 separators ... have to catch this last id
395  // -> normalize the list
396  OUString sReferring = rReferences.second + sSeparator;
397 
398  nPrevSep = -1;
399  while (-1 != (nSeparator = sReferring.indexOf(s_nSeparator, nPrevSep + 1)))
400  {
401  sCurrentReferring = sReferring.copy(nPrevSep + 1, nSeparator - nPrevSep - 1);
402  xCurrentReferring = lookupControlId(sCurrentReferring);
403  if (xCurrentReferring.is())
404  // if this condition fails, this is an error, but lookupControlId should have asserted this ...
405  xCurrentReferring->setPropertyValue( PROPERTY_CONTROLLABEL, makeAny( rReferences.first ) );
406 
407  nPrevSep = nSeparator;
408  }
409  }
410  }
411  catch(Exception&)
412  {
413  TOOLS_WARN_EXCEPTION("xmloff.forms",
414  "unable to knit the control references (caught an exception)!");
415  }
416 
417  // now that we have all children of the forms collection, attach the events
418  Reference< XIndexAccess > xIndexContainer;
419  if ( m_xCurrentPageFormsSupp.is() && m_xCurrentPageFormsSupp->hasForms() )
420  xIndexContainer.set(m_xCurrentPageFormsSupp->getForms(), css::uno::UNO_QUERY);
421  if ( xIndexContainer.is() )
422  ODefaultEventAttacherManager::setEvents( xIndexContainer );
423 
424  // clear the structures for the control references.
425  m_aControlReferences.clear();
426 
427  // and no we have no current page anymore
429 }
430 
432 {
433  OSL_ENSURE(m_aCurrentPageIds != m_aControlIds.end(), "OFormLayerXMLImport_Impl::lookupControlId: no current page!");
435  if (m_aCurrentPageIds != m_aControlIds.end())
436  {
437  MapString2PropertySet::const_iterator aPos = m_aCurrentPageIds->second.find(_rControlId);
438  if (m_aCurrentPageIds->second.end() != aPos)
439  xReturn = aPos->second;
440  else
441  SAL_WARN("xmloff", "unknown control id " << _rControlId);
442  }
443  return xReturn;
444 }
445 
447  SvXMLImport& _rImport)
448 {
449  return new OFormsRootImport( _rImport );
450 }
451 
453  sal_Int32 nElement,
454  const Reference< xml::sax::XFastAttributeList >&)
455 {
456  SvXMLImportContext* pContext = nullptr;
457  if ( (nElement & TOKEN_MASK) == XML_FORM )
458  {
459  if ( m_xCurrentPageFormsSupp.is() )
460  pContext = new OFormImport(*this, *this, m_xCurrentPageFormsSupp->getForms() );
461  }
462  else if ( nElement == XML_ELEMENT(XFORMS, XML_MODEL) )
463  {
465  }
466  else
467  SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
468 
469  return pContext;
470 }
471 
473 {
474  SvXMLImport& rImport = getGlobalContext();
475  if ( !( rImport.getImportFlags() & SvXMLImportFlags::CONTENT ) )
476  return;
477 
478  // create (and bind) the spreadsheet cell bindings
479  if ( !m_aCellValueBindings.empty()
481  )
482  {
483  for ( const auto& rCellBindings : m_aCellValueBindings )
484  {
485  try
486  {
487  FormCellBindingHelper aHelper( rCellBindings.first, rImport.GetModel() );
488  OSL_ENSURE( aHelper.isCellBindingAllowed(), "OFormLayerXMLImport_Impl::documentDone: can't bind this control model!" );
489  if ( aHelper.isCellBindingAllowed() )
490  {
491  // There are special bindings for listboxes. See
492  // OListAndComboImport::doRegisterCellValueBinding for a comment on this HACK.
493  OUString sBoundCellAddress( rCellBindings.second );
494  sal_Int32 nIndicator = sBoundCellAddress.lastIndexOf( ":index" );
495 
496  bool bUseIndexBinding = false;
497  if ( nIndicator != -1 )
498  {
499  sBoundCellAddress = sBoundCellAddress.copy( 0, nIndicator );
500  bUseIndexBinding = true;
501  }
502 
503  aHelper.setBinding( aHelper.createCellBindingFromStringAddress( sBoundCellAddress, bUseIndexBinding ) );
504  }
505  }
506  catch( const Exception& )
507  {
508  TOOLS_WARN_EXCEPTION("xmloff.forms",
509  "caught an exception while binding to a cell!");
510  }
511  }
512  m_aCellValueBindings.clear();
513  }
514 
515  // the same for the spreadsheet cell range list sources
516  if ( !m_aCellRangeListSources.empty()
518  )
519  {
520  for ( const auto& rRangeBindings : m_aCellRangeListSources )
521  {
522  try
523  {
524  FormCellBindingHelper aHelper( rRangeBindings.first, rImport.GetModel() );
525  OSL_ENSURE( aHelper.isListCellRangeAllowed(), "OFormLayerXMLImport_Impl::documentDone: can't bind this control model!" );
526  if ( aHelper.isListCellRangeAllowed() )
527  {
528  aHelper.setListSource( aHelper.createCellListSourceFromStringAddress( rRangeBindings.second ) );
529  }
530  }
531  catch( const Exception& )
532  {
533  TOOLS_WARN_EXCEPTION("xmloff.forms",
534  "caught an exception while binding to a cell range!");
535  }
536  }
537  m_aCellRangeListSources.clear();
538  }
539 
540  // process XForms-bindings; call registerXFormsValueBinding for each
541  for (const auto& aXFormsValueBinding : m_aXFormsValueBindings)
542  bindXFormsValueBinding(rImport.GetModel(), aXFormsValueBinding);
543  // same for list bindings
544  for (const auto& aXFormsListBindings : m_aXFormsListBindings)
545  bindXFormsListBinding(rImport.GetModel(), aXFormsListBindings);
546  // same for submissions
547  for (const auto& aXFormsSubmission : m_aXFormsSubmissions)
548  bindXFormsSubmission(rImport.GetModel(), aXFormsSubmission);
549 }
550 
551 } // namespace xmloff
552 
553 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void registerCellValueBinding(const css::uno::Reference< css::beans::XPropertySet > &_rxControlModel, const OUString &_rCellAddress)
#define PROPERTY_LABEL
Definition: strings.hxx:31
#define PROPERTY_APPLYFILTER
Definition: strings.hxx:53
void registerXFormsValueBinding(const css::uno::Reference< css::beans::XPropertySet > &_rxControlModel, const OUString &_rBindingID)
#define PROPERTY_CONTROLLABEL
Definition: strings.hxx:74
const SvXMLEnumMapEntry< sal_Int32 > aCommandTypeMap[]
Definition: formenums.cxx:59
void endPage()
end importing the forms of the current page
#define PROPERTY_ORDER
Definition: strings.hxx:49
void registerCellRangeListSource(const css::uno::Reference< css::beans::XPropertySet > &_rxControlModel, const OUString &_rCellRangeAddress)
#define PROPERTY_ALLOWINSERTS
Definition: strings.hxx:51
void bindXFormsValueBinding(Reference< XModel > const &xModel, const pair< Reference< XPropertySet >, OUString > &aPair)
const SvXMLEnumMapEntry< sal_Int32 > aOrientationMap[]
Definition: formenums.cxx:151
static const char * getCommonControlAttributeName(CCAFlags _nId)
calculates the xml attribute representation of a common control attribute.
#define PROPERTY_BOUNDCOLUMN
Definition: strings.hxx:63
const SvXMLEnumMapEntry< NavigationBarMode > aNavigationTypeMap[]
Definition: formenums.cxx:66
static sal_Int32 getDatabaseAttributeToken(DAFlags _nId)
calculates the xml attribute representation of a database attribute.
const SvXMLEnumMapEntry< FormSubmitEncoding > aSubmitEncodingMap[]
Definition: formenums.cxx:46
const SvXMLEnumMapEntry< FormSubmitMethod > aSubmitMethodMap[]
Definition: formenums.cxx:53
#define PROPERTY_AUTOCOMPLETE
Definition: strings.hxx:70
#define PROPERTY_TABSTOP
Definition: strings.hxx:39
#define PROPERTY_MULTILINE
Definition: strings.hxx:28
#define PROPERTY_INPUT_REQUIRED
Definition: strings.hxx:65
void setAutoStyleContext(SvXMLStylesContext *_pNewContext)
announces the auto-style context to the form importer
void addBooleanProperty(sal_Int32 nAttributeToken, const OUString &_rPropertyName, const bool _bAttributeDefault, const bool _bInverseSemantics=false)
add an attribute assignment referring to a boolean property to the map
#define PROPERTY_COMMAND_TYPE
Definition: strings.hxx:58
::std::vector< ModelStringPair > m_aXFormsValueBindings
Definition: layerimport.hxx:77
#define PROPERTY_DEFAULT_STATE
Definition: strings.hxx:38
#define PROPERTY_DATASOURCENAME
Definition: strings.hxx:47
void bindXFormsListBinding(Reference< XModel > const &xModel, const ::pair< Reference< XPropertySet >, OUString > &aPair)
#define PROPERTY_FOCUS_ON_CLICK
Definition: strings.hxx:130
sal_uInt16 sal_Unicode
#define PROPERTY_DATAFIELD
Definition: strings.hxx:62
#define PROPERTY_PRINTABLE
Definition: strings.hxx:36
rtl::Reference< SvXMLStylesContext > m_xAutoStyles
Definition: layerimport.hxx:59
::std::vector< ModelStringPair > m_aXFormsListBindings
Definition: layerimport.hxx:80
static sal_Int32 getSpecialAttributeToken(SCAFlags _nId)
calculates the xml attribute representation of a special attribute.
const SvXMLEnumMapEntry< TriState > aCheckStateMap[]
Definition: formenums.cxx:99
const SvXMLEnumMapEntry< ListSourceType > aListSourceTypeMap[]
Definition: formenums.cxx:88
#define PROPERTY_LISTSOURCETYPE
Definition: strings.hxx:67
#define PROPERTY_STATE
Definition: strings.hxx:40
#define PROPERTY_TITLE
Definition: strings.hxx:34
static sal_Int32 getFormAttributeToken(FormAttributes _eAttrib)
retrieves the name of an attribute of a form xml representation
#define PROPERTY_TARGETURL
Definition: strings.hxx:33
#define PROPERTY_GROUP_NAME
Definition: strings.hxx:135
void setEvents(const css::uno::Reference< css::container::XIndexAccess > &_rxContainer)
XMLEventImportHelper & GetEventImport()
Definition: xmlimp.cxx:1500
::std::vector< ModelStringPair > m_aCellRangeListSources
Definition: layerimport.hxx:74
static OUString getPrefixAndNameFromToken(sal_Int32 nToken)
Definition: xmlimp.cxx:1925
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
#define PROPERTY_BUTTONTYPE
Definition: strings.hxx:61
#define PROPERTY_SUBMIT_METHOD
Definition: strings.hxx:57
const XMLEventNameTranslation * g_pFormsEventTranslation
Definition: formevents.cxx:66
void registerControlId(const css::uno::Reference< css::beans::XPropertySet > &_rxControl, const OUString &_rId)
void addInt16Property(sal_Int32 nAttributeToken, const OUString &_rPropertyName)
add an attribute assignment referring to an int16 property to the map
#define PROPERTY_IGNORERESULT
Definition: strings.hxx:55
#define PROPERTY_TRISTATE
Definition: strings.hxx:73
const SvXMLEnumMapEntry< FormButtonType > aFormButtonTypeMap[]
Definition: formenums.cxx:80
#define PROPERTY_TABINDEX
Definition: strings.hxx:45
SvXMLImportContext * createContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &_rxAttribs)
create an SvXMLImportContext instance which is able to import the element...
#define PROPERTY_NAME
Definition: strings.hxx:29
#define TOOLS_WARN_EXCEPTION(area, stream)
void registerControlReferences(const css::uno::Reference< css::beans::XPropertySet > &_rxControl, const OUString &_rReferringControls)
#define PROPERTY_TOGGLE
Definition: strings.hxx:129
#define PROPERTY_READONLY
Definition: strings.hxx:37
encapsulates functionality related to binding a form control to a spreadsheet cell ...
::std::vector< ModelStringPair > m_aCellValueBindings
Definition: layerimport.hxx:72
helper class importing a single element
void registerXFormsSubmission(const css::uno::Reference< css::beans::XPropertySet > &_rxControlModel, const OUString &_rSubmissionID)
Any aHelper
#define PROPERTY_NAVIGATION
Definition: strings.hxx:59
OAttribute2Property m_aAttributeMetaData
Definition: layerimport.hxx:54
void AddTranslationTable(const XMLEventNameTranslation *pTransTable)
add event name translation to the internal table
void bindXFormsSubmission(Reference< XModel > const &xModel, const pair< Reference< XPropertySet >, OUString > &aPair)
#define PROPERTY_FORMATSSUPPLIER
Definition: strings.hxx:110
#define PROPERTY_ALLOWUPDATES
Definition: strings.hxx:52
void addInt32Property(sal_Int32 nAttributeToken, const OUString &_rPropertyName)
add an attribute assignment referring to an int32 property to the map
#define PROPERTY_FILTER
Definition: strings.hxx:48
void applyControlNumberStyle(const css::uno::Reference< css::beans::XPropertySet > &_rxControlModel, const OUString &_rControlNumberStyleName)
#define PROPERTY_ALLOWDELETES
Definition: strings.hxx:50
#define PROPERTY_ENABLED
Definition: strings.hxx:41
#define PROPERTY_ORIENTATION
Definition: strings.hxx:128
#define PROPERTY_VISUAL_EFFECT
Definition: strings.hxx:131
This class deliberately does not support XWeak, to improve performance when loading large documents...
Definition: xmlictxt.hxx:44
void documentDone()
to be called when the document has been completely imported
::std::vector< ModelStringPair > m_aControlReferences
Definition: layerimport.hxx:70
#define PROPERTY_TARGETFRAME
Definition: strings.hxx:32
void startPage(const css::uno::Reference< css::drawing::XDrawPage > &_rxDrawPage)
start importing the forms of the given page
#define PROPERTY_MULTISELECTION
Definition: strings.hxx:71
void PopTranslationTable()
recover the top-most previously saved translation table
SvXMLImportFlags getImportFlags() const
Definition: xmlimp.hxx:456
static SvXMLImportContext * createOfficeFormsContext(SvXMLImport &_rImport)
creates an import context for the office:forms element
void registerXFormsListBinding(const css::uno::Reference< css::beans::XPropertySet > &_rxControlModel, const OUString &_rBindingID)
#define PROPERTY_STRICTFORMAT
Definition: strings.hxx:69
#define XML_ELEMENT(prefix, name)
Definition: xmlimp.hxx:97
#define PROPERTY_DROPDOWN
Definition: strings.hxx:35
const css::uno::Reference< css::frame::XModel > & GetModel() const
Definition: xmlimp.hxx:404
#define PROPERTY_DEFAULTBUTTON
Definition: strings.hxx:72
::std::vector< ModelStringPair > m_aXFormsSubmissions
Definition: layerimport.hxx:83
#define PROPERTY_LINECOUNT
Definition: strings.hxx:44
void PushTranslationTable()
save the old translation table on a stack and install an empty table
#define PROPERTY_BLOCK_INCREMENT
Definition: strings.hxx:121
#define PROPERTY_MAXTEXTLENGTH
Definition: strings.hxx:43
static sal_Int32 getCommonControlAttributeToken(CCAFlags _nId)
calculates the xml attribute representation of a common control attribute.
const SvXMLEnumMapEntry< sal_Int16 > aVisualEffectMap[]
Definition: formenums.cxx:157
#define SAL_WARN(area, stream)
constexpr sal_Int32 TOKEN_MASK
Definition: xmlimp.hxx:94
void addStringProperty(sal_Int32 nAttributeToken, const OUString &_rPropertyName)
add an attribute assignment referring to a string property to the map
#define PROPERTY_CYCLE
Definition: strings.hxx:60
const SvXMLEnumMapEntry< TabulatorCycle > aTabulatorCycleMap[]
Definition: formenums.cxx:73
bool isListCellRangeAllowed() const
checks whether it's possible to bind the control model to a range of spreadsheet cells supplying the ...
std::map< OUString, css::uno::Reference< css::beans::XPropertySet > > MapString2PropertySet
Definition: layerimport.hxx:61
SvXMLImportContext * createXFormsModelContext(SvXMLImport &rImport)
create import context for xforms:model element.
#define PROPERTY_FORMATKEY
Definition: strings.hxx:105
#define PROPERTY_EMPTY_IS_NULL
Definition: strings.hxx:64
MapDrawPage2Map::iterator m_aCurrentPageIds
Definition: layerimport.hxx:65
#define PROPERTY_COMMAND
Definition: strings.hxx:46
css::uno::Reference< css::form::XFormsSupplier2 > m_xCurrentPageFormsSupp
the supplier for the forms of the currently imported page
Definition: layerimport.hxx:58
#define PROPERTY_SUBMIT_ENCODING
Definition: strings.hxx:56
void addEnumProperty(sal_Int32 nAttributeToken, const OUString &_rPropertyName, const SvXMLEnumMapEntry< EnumT > *_pValueMap, const css::uno::Type *_pType=nullptr)
add an attribute assignment referring to an enum property to the map
bool isCellBindingAllowed() const
checks whether it's possible to bind the control model to a spreadsheet cell
static const char * getFormAttributeName(FormAttributes _eAttrib)
retrieves the name of an attribute of a form xml representation
#define PROPERTY_ESCAPEPROCESSING
Definition: strings.hxx:54
rtl::Reference< XMLShapeImportHelper > const & GetShapeImport()
Definition: xmlimp.hxx:608
OFormLayerXMLImport_Impl(SvXMLImport &_rImporter)
Definition: layerimport.cxx:64
css::uno::Reference< css::beans::XPropertySet > lookupControlId(const OUString &_rControlId)
get the control with the given id
css::uno::Any SAL_CALL makeAny(const SharedUNOComponent< INTERFACE, COMPONENT > &value)
const SvXMLStyleContext * getStyleElement(const OUString &_rStyleName) const