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