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 
62 //= OFormLayerXMLImport_Impl
64  :m_rImporter(_rImporter)
65 {
66  // build the attribute2property map
67  // string properties which are exported as attributes
90 
91  // properties not added because they're already present in another form
92  OSL_ENSURE(
95  "OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl: invalid attribute names (1)!");
96  // if this fails, we would have to add a translation from faAction->PROPERTY_TARGETURL
97  // We did not because we already have one CCAFlags::TargetLocation->PROPERTY_TARGETURL,
98  // and CCAFlags::TargetLocation and faAction should be represented by the same attribute
99 
100  OSL_ENSURE(
101  OUString::createFromAscii(OAttributeMetaData::getCommonControlAttributeName(CCAFlags::Name)).equalsAscii(
103  "OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl: invalid attribute names (2)!");
104  // the same for faName, CCAFlags::Name and PROPERTY_NAME
105 
106  // boolean properties which are exported as attributes
153 
154  // the int16 attributes
163 
164  // the int32 attributes
167 
168  // the enum attributes
212 
213  // 'initialize'
215 }
216 
218 {}
219 
221 {
222  OSL_ENSURE(!m_xAutoStyles.is(), "OFormLayerXMLImport_Impl::setAutoStyleContext: not to be called twice!");
223  m_xAutoStyles.set(_pNewContext);
224 }
225 
226 void OFormLayerXMLImport_Impl::applyControlNumberStyle(const Reference< XPropertySet >& _rxControlModel, const OUString& _rControlNumberStyleName)
227 {
228  OSL_ENSURE(_rxControlModel.is() && (!_rControlNumberStyleName.isEmpty()),
229  "OFormLayerXMLImport_Impl::applyControlNumberStyle: invalid arguments (this will crash)!");
230 
231  OSL_ENSURE(m_xAutoStyles.is(), "OFormLayerXMLImport_Impl::applyControlNumberStyle: have no auto style context!");
232  if (!m_xAutoStyles.is())
233  {
234  m_xAutoStyles.set(m_rImporter.GetShapeImport()->GetAutoStylesContext());
235  }
236 
237  if (!m_xAutoStyles.is())
238  return;
239 
240  const SvXMLStyleContext* pStyle = m_xAutoStyles->FindStyleChildContext(XmlStyleFamily::DATA_STYLE, _rControlNumberStyleName);
241  if (pStyle)
242  {
243  const SvXMLNumFormatContext* pDataStyle = static_cast<const SvXMLNumFormatContext*>(pStyle);
244 
245  // set this format at the control model
246  try
247  {
248  // the models number format supplier and formats
249  Reference< XNumberFormatsSupplier > xFormatsSupplier;
250  _rxControlModel->getPropertyValue(PROPERTY_FORMATSSUPPLIER) >>= xFormatsSupplier;
251  Reference< XNumberFormats > xFormats;
252  if (xFormatsSupplier.is())
253  xFormats = xFormatsSupplier->getNumberFormats();
254  OSL_ENSURE(xFormats.is(), "OFormLayerXMLImport_Impl::applyControlNumberStyle: could not obtain the controls number formats!");
255 
256  // obtain a key
257  if (xFormats.is())
258  {
259  sal_Int32 nFormatKey = const_cast<SvXMLNumFormatContext*>(pDataStyle)->CreateAndInsert( xFormatsSupplier );
260  OSL_ENSURE(-1 != nFormatKey, "OFormLayerXMLImport_Impl::applyControlNumberStyle: could not obtain a format key!");
261 
262  // set the format on the control model
263  _rxControlModel->setPropertyValue(PROPERTY_FORMATKEY, makeAny(nFormatKey));
264  }
265  }
266  catch(const Exception&)
267  {
268  OSL_FAIL("OFormLayerXMLImport_Impl::applyControlNumberStyle: couldn't set the format!");
269  }
270  }
271  else
272  OSL_FAIL("OFormLayerXMLImport_Impl::applyControlNumberStyle: did not find the style with the given name!");
273 }
274 
275 void OFormLayerXMLImport_Impl::registerCellValueBinding( const Reference< XPropertySet >& _rxControlModel, const OUString& _rCellAddress )
276 {
277  OSL_ENSURE( _rxControlModel.is() && !_rCellAddress.isEmpty(),
278  "OFormLayerXMLImport_Impl::registerCellValueBinding: invalid arguments!" );
279  m_aCellValueBindings.emplace_back( _rxControlModel, _rCellAddress );
280 }
281 
283  const Reference< XPropertySet >& _rxControlModel,
284  const OUString& _rBindingID )
285 {
286  // TODO: is an empty binding name allowed?
287  OSL_ENSURE( _rxControlModel.is(), "need model" );
288 
289  m_aXFormsValueBindings.emplace_back( _rxControlModel, _rBindingID );
290 }
291 
293  const Reference< XPropertySet >& _rxControlModel,
294  const OUString& _rBindingID )
295 {
296  // TODO: is an empty binding name allowed?
297  OSL_ENSURE( _rxControlModel.is(), "need model" );
298 
299  m_aXFormsListBindings.emplace_back( _rxControlModel, _rBindingID );
300 }
301 
303  const Reference< XPropertySet >& _rxControlModel,
304  const OUString& _rSubmissionID )
305 {
306  // TODO: is an empty binding name allowed?
307  OSL_ENSURE( _rxControlModel.is(), "need model" );
308 
309  m_aXFormsSubmissions.emplace_back( _rxControlModel, _rSubmissionID );
310 }
311 
312 void OFormLayerXMLImport_Impl::registerCellRangeListSource( const Reference< XPropertySet >& _rxControlModel, const OUString& _rCellRangeAddress )
313 {
314  OSL_ENSURE( _rxControlModel.is() && !_rCellRangeAddress.isEmpty(),
315  "OFormLayerXMLImport_Impl::registerCellRangeListSource: invalid arguments!" );
316  m_aCellRangeListSources.emplace_back( _rxControlModel, _rCellRangeAddress );
317 }
318 const SvXMLStyleContext* OFormLayerXMLImport_Impl::getStyleElement(const OUString& _rStyleName) const
319 {
320  OSL_ENSURE( m_xAutoStyles.is(), "OFormLayerXMLImport_Impl::getStyleElement: have no auto style context!" );
321  // did you use setAutoStyleContext?
322 
323  const SvXMLStyleContext* pControlStyle =
324  m_xAutoStyles.is() ? m_xAutoStyles->FindStyleChildContext( XmlStyleFamily::TEXT_PARAGRAPH, _rStyleName ) : nullptr;
325  OSL_ENSURE( pControlStyle || !m_xAutoStyles.is(),
326  OStringBuffer("OFormLayerXMLImport_Impl::getStyleElement: did not find the style named \"").append(OUStringToOString(_rStyleName, RTL_TEXTENCODING_ASCII_US)).append("\"!").getStr() );
327  return pControlStyle;
328 }
329 
331 {
332  // install our own translation table. We need to disable the other tables because of name conflicts.
335 }
336 
338 {
339  // install the original event tables.
341 }
342 
343 void OFormLayerXMLImport_Impl::registerControlId(const Reference< XPropertySet >& _rxControl, const OUString& _rId)
344 {
345  OSL_ENSURE(m_aCurrentPageIds != m_aControlIds.end(), "OFormLayerXMLImport_Impl::registerControlId: no current page!");
346  OSL_ENSURE(!_rId.isEmpty(), "OFormLayerXMLImport_Impl::registerControlId: invalid (empty) control id!");
347 
348  OSL_ENSURE(m_aCurrentPageIds->second.end() == m_aCurrentPageIds->second.find(_rId), "OFormLayerXMLImport_Impl::registerControlId: control id already used!");
349  m_aCurrentPageIds->second[_rId] = _rxControl;
350 }
351 
352 void OFormLayerXMLImport_Impl::registerControlReferences(const Reference< XPropertySet >& _rxControl, const OUString& _rReferringControls)
353 {
354  OSL_ENSURE(!_rReferringControls.isEmpty(), "OFormLayerXMLImport_Impl::registerControlReferences: invalid (empty) control id list!");
355  OSL_ENSURE(_rxControl.is(), "OFormLayerXMLImport_Impl::registerControlReferences: invalid (NULL) control!");
356  m_aControlReferences.emplace_back( _rxControl, _rReferringControls );
357 }
358 
359 void OFormLayerXMLImport_Impl::startPage(const Reference< XDrawPage >& _rxDrawPage)
360 {
361  m_xCurrentPageFormsSupp.clear();
362 
363  OSL_ENSURE(_rxDrawPage.is(), "OFormLayerXMLImport_Impl::startPage: NULL page!");
364  m_xCurrentPageFormsSupp.set(_rxDrawPage, css::uno::UNO_QUERY);
365  OSL_ENSURE( m_xCurrentPageFormsSupp.is(), "OFormLayerXMLImport_Impl::startPage: invalid draw page (no XFormsSupplier)!" );
366  if ( !m_xCurrentPageFormsSupp.is() )
367  return;
368 
369  // add a new entry to our page map
370  ::std::pair< MapDrawPage2Map::iterator, bool > aPagePosition = m_aControlIds.emplace(_rxDrawPage, MapString2PropertySet());
371  OSL_ENSURE(aPagePosition.second, "OFormLayerXMLImport_Impl::startPage: already imported this page!");
372  m_aCurrentPageIds = aPagePosition.first;
373 }
374 
376 {
377  OSL_ENSURE( m_xCurrentPageFormsSupp.is(), "OFormLayerXMLImport_Impl::endPage: sure you called startPage before?" );
378 
379  // do some knittings for the controls which are referring to each other
380  try
381  {
382  static const sal_Unicode s_nSeparator = ',';
383  OUString sCurrentReferring;
384  OUString sSeparator(&s_nSeparator, 1);
385  Reference< XPropertySet > xCurrentReferring;
386  sal_Int32 nSeparator, nPrevSep;
387  for ( const auto& rReferences : m_aControlReferences )
388  {
389  // the list of control ids is comma separated
390 
391  // in a list of n ids there are only n-1 separators ... have to catch this last id
392  // -> normalize the list
393  OUString sReferring = rReferences.second + sSeparator;
394 
395  nPrevSep = -1;
396  while (-1 != (nSeparator = sReferring.indexOf(s_nSeparator, nPrevSep + 1)))
397  {
398  sCurrentReferring = sReferring.copy(nPrevSep + 1, nSeparator - nPrevSep - 1);
399  xCurrentReferring = lookupControlId(sCurrentReferring);
400  if (xCurrentReferring.is())
401  // if this condition fails, this is an error, but lookupControlId should have asserted this ...
402  xCurrentReferring->setPropertyValue( PROPERTY_CONTROLLABEL, makeAny( rReferences.first ) );
403 
404  nPrevSep = nSeparator;
405  }
406  }
407  }
408  catch(Exception&)
409  {
410  TOOLS_WARN_EXCEPTION("xmloff.forms",
411  "unable to knit the control references (caught an exception)!");
412  }
413 
414  // now that we have all children of the forms collection, attach the events
415  Reference< XIndexAccess > xIndexContainer;
416  if ( m_xCurrentPageFormsSupp.is() && m_xCurrentPageFormsSupp->hasForms() )
417  xIndexContainer.set(m_xCurrentPageFormsSupp->getForms(), css::uno::UNO_QUERY);
418  if ( xIndexContainer.is() )
419  ODefaultEventAttacherManager::setEvents( xIndexContainer );
420 
421  // clear the structures for the control references.
422  m_aControlReferences.clear();
423 
424  // and no we have no current page anymore
426 }
427 
429 {
430  OSL_ENSURE(m_aCurrentPageIds != m_aControlIds.end(), "OFormLayerXMLImport_Impl::lookupControlId: no current page!");
432  if (m_aCurrentPageIds != m_aControlIds.end())
433  {
434  MapString2PropertySet::const_iterator aPos = m_aCurrentPageIds->second.find(_rControlId);
435  if (m_aCurrentPageIds->second.end() != aPos)
436  xReturn = aPos->second;
437  else
438  OSL_FAIL("OFormLayerXMLImport_Impl::lookupControlId: invalid control id (did not find it)!");
439  }
440  return xReturn;
441 }
442 
444  SvXMLImport& _rImport,
445  sal_uInt16 _nPrefix,
446  const OUString& _rLocalName)
447 {
448  return new OFormsRootImport( _rImport, _nPrefix, _rLocalName );
449 }
450 
451 SvXMLImportContext* OFormLayerXMLImport_Impl::createContext(const sal_uInt16 _nPrefix, const OUString& _rLocalName,
452  const Reference< xml::sax::XAttributeList >&)
453 {
454  SvXMLImportContext* pContext = nullptr;
455  if ( _rLocalName == "form" )
456  {
457  if ( m_xCurrentPageFormsSupp.is() )
458  pContext = new OFormImport(*this, *this, _nPrefix, _rLocalName, m_xCurrentPageFormsSupp->getForms() );
459  }
460  else if ( _nPrefix == XML_NAMESPACE_XFORMS
462  {
463  pContext = createXFormsModelContext( m_rImporter, _nPrefix, _rLocalName );
464  }
465 
466  return pContext;
467 }
468 
470 {
471  SvXMLImport& rImport = getGlobalContext();
472  if ( !( rImport.getImportFlags() & SvXMLImportFlags::CONTENT ) )
473  return;
474 
475  // create (and bind) the spreadsheet cell bindings
476  if ( !m_aCellValueBindings.empty()
478  )
479  {
480  for ( const auto& rCellBindings : m_aCellValueBindings )
481  {
482  try
483  {
484  FormCellBindingHelper aHelper( rCellBindings.first, rImport.GetModel() );
485  OSL_ENSURE( aHelper.isCellBindingAllowed(), "OFormLayerXMLImport_Impl::documentDone: can't bind this control model!" );
486  if ( aHelper.isCellBindingAllowed() )
487  {
488  // There are special bindings for listboxes. See
489  // OListAndComboImport::doRegisterCellValueBinding for a comment on this HACK.
490  OUString sBoundCellAddress( rCellBindings.second );
491  sal_Int32 nIndicator = sBoundCellAddress.lastIndexOf( ":index" );
492 
493  bool bUseIndexBinding = false;
494  if ( nIndicator != -1 )
495  {
496  sBoundCellAddress = sBoundCellAddress.copy( 0, nIndicator );
497  bUseIndexBinding = true;
498  }
499 
500  aHelper.setBinding( aHelper.createCellBindingFromStringAddress( sBoundCellAddress, bUseIndexBinding ) );
501  }
502  }
503  catch( const Exception& )
504  {
505  TOOLS_WARN_EXCEPTION("xmloff.forms",
506  "caught an exception while binding to a cell!");
507  }
508  }
509  m_aCellValueBindings.clear();
510  }
511 
512  // the same for the spreadsheet cell range list sources
513  if ( !m_aCellRangeListSources.empty()
515  )
516  {
517  for ( const auto& rRangeBindings : m_aCellRangeListSources )
518  {
519  try
520  {
521  FormCellBindingHelper aHelper( rRangeBindings.first, rImport.GetModel() );
522  OSL_ENSURE( aHelper.isListCellRangeAllowed(), "OFormLayerXMLImport_Impl::documentDone: can't bind this control model!" );
523  if ( aHelper.isListCellRangeAllowed() )
524  {
525  aHelper.setListSource( aHelper.createCellListSourceFromStringAddress( rRangeBindings.second ) );
526  }
527  }
528  catch( const Exception& )
529  {
530  TOOLS_WARN_EXCEPTION("xmloff.forms",
531  "caught an exception while binding to a cell range!");
532  }
533  }
534  m_aCellRangeListSources.clear();
535  }
536 
537  // process XForms-bindings; call registerXFormsValueBinding for each
538  for (const auto& aXFormsValueBinding : m_aXFormsValueBindings)
539  bindXFormsValueBinding(rImport.GetModel(), aXFormsValueBinding);
540  // same for list bindings
541  for (const auto& aXFormsListBindings : m_aXFormsListBindings)
542  bindXFormsListBinding(rImport.GetModel(), aXFormsListBindings);
543  // same for submissions
544  for (const auto& aXFormsSubmission : m_aXFormsSubmissions)
545  bindXFormsSubmission(rImport.GetModel(), aXFormsSubmission);
546 }
547 
548 } // namespace xmloff
549 
550 /* 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:3434
#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
constexpr sal_uInt16 XML_NAMESPACE_XFORMS
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:1588
::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
#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: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
void applyControlNumberStyle(const css::uno::Reference< css::beans::XPropertySet > &_rxControlModel, const OUString &_rControlNumberStyleName)
#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:460
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:408
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
#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:608
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:63
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