LibreOffice Module xmloff (master) 1
Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
xmloff::OFormLayerXMLExport_Impl Class Reference

the implementation class for OFormLayerXMLExport More...

#include <layerexport.hxx>

Inheritance diagram for xmloff::OFormLayerXMLExport_Impl:
[legend]
Collaboration diagram for xmloff::OFormLayerXMLExport_Impl:
[legend]

Public Member Functions

 OFormLayerXMLExport_Impl (SvXMLExport &_rContext)
 
virtual ~OFormLayerXMLExport_Impl ()
 
virtual SvXMLExportgetGlobalContext ()=0
 
virtual ::rtl::Reference< SvXMLExportPropertyMappergetStylePropertyMapper ()=0
 
virtual void exportCollectionElements (const css::uno::Reference< css::container::XIndexAccess > &_rxCollection)=0
 steps through a collection and exports all children of this collection More...
 
virtual OUString getObjectStyleName (const css::uno::Reference< css::beans::XPropertySet > &_rxObject)=0
 

Private Types

typedef std::unordered_map< css::uno::Reference< css::beans::XPropertySet >, sal_Int32 > MapPropertySet2Int
 

Private Member Functions

void exportGridColumn (const css::uno::Reference< css::beans::XPropertySet > &_rxColumn, const css::uno::Sequence< css::script::ScriptEventDescriptor > &_rEvents)
 exports one single grid column More...
 
void exportControl (const css::uno::Reference< css::beans::XPropertySet > &_rxControl, const css::uno::Sequence< css::script::ScriptEventDescriptor > &_rEvents)
 exports one single control More...
 
void exportForm (const css::uno::Reference< css::beans::XPropertySet > &_rxProps, const css::uno::Sequence< css::script::ScriptEventDescriptor > &_rEvents)
 exports one single form More...
 
bool seekPage (const css::uno::Reference< css::drawing::XDrawPage > &_rxDrawPage)
 seek to the page given. More...
 
OUString getControlId (const css::uno::Reference< css::beans::XPropertySet > &_rxControl)
 get the id of the given control. More...
 
OUString getControlNumberStyle (const css::uno::Reference< css::beans::XPropertySet > &_rxControl)
 retrieves the style name for the control's number style. More...
 
virtual void exportCollectionElements (const css::uno::Reference< css::container::XIndexAccess > &_rxCollection) override
 steps through a collection and exports all children of this collection More...
 
virtual SvXMLExportgetGlobalContext () override
 
virtual OUString getObjectStyleName (const css::uno::Reference< css::beans::XPropertySet > &_rxObject) override
 
virtual ::rtl::Reference< SvXMLExportPropertyMappergetStylePropertyMapper () override
 
void clear ()
 clear any structures which have been build in the recent <method>examine</method> calls. More...
 
void examineForms (const css::uno::Reference< css::drawing::XDrawPage > &_rxDrawPage)
 examine a forms collection. More...
 
void exportForms (const css::uno::Reference< css::drawing::XDrawPage > &_rxDrawPage)
 export a forms collection of a draw page More...
 
void exportXForms () const
 exports the XForms model data More...
 
bool documentContainsXForms () const
 determines whether the given page contains XForm instances More...
 
void exportAutoControlNumberStyles ()
 exports the automatic control number styles More...
 
void exportAutoStyles ()
 exports the auto-styles collected during the examineForms calls More...
 
bool implMoveIterators (const css::uno::Reference< css::drawing::XDrawPage > &_rxDrawPage, bool _bClear)
 moves the m_aCurrentPage* members to the positions specifying the given page. More...
 
bool checkExamineControl (const css::uno::Reference< css::beans::XPropertySet > &_rxObject)
 check the object given if it's a control, if so, examine it. More...
 
void examineControlNumberFormat (const css::uno::Reference< css::beans::XPropertySet > &_rxControl)
 examines the control's number format, so later the format style can be referred More...
 
sal_Int32 implExamineControlNumberFormat (const css::uno::Reference< css::beans::XPropertySet > &_rxObject)
 examines the control's number format, so later the format style can be referred More...
 
void collectGridColumnStylesAndIds (const css::uno::Reference< css::beans::XPropertySet > &_rxControl)
 collects AutoStyles for grid columns More...
 
sal_Int32 ensureTranslateFormat (const css::uno::Reference< css::beans::XPropertySet > &_rxFormattedControl)
 ensures that the number format of the given control exist in our own formats supplier. More...
 
SvXMLNumFmtExportgetControlNumberStyleExport ()
 returns the instance exporting our control's number styles More...
 
void ensureControlNumberStyleExport ()
 ensures that the instance exporting our control's number styles exists More...
 
OUString getImmediateNumberStyle (const css::uno::Reference< css::beans::XPropertySet > &_rxObject)
 determines the number format style for the given object without remembering it More...
 
void excludeFromExport (const css::uno::Reference< css::awt::XControlModel > &_rxControl)
 exclude the given control (model) from export. More...
 

Static Private Member Functions

static bool pageContainsForms (const css::uno::Reference< css::drawing::XDrawPage > &_rxDrawPage)
 determines whether the given page contains logical forms More...
 
static bool impl_isFormPageContainingForms (const css::uno::Reference< css::drawing::XDrawPage > &_rxDrawPage, css::uno::Reference< css::container::XIndexAccess > &_rxForms)
 
static const OUString & getControlNumberStyleNamePrefix ()
 returns the prefix to be used for control number styles More...
 

Private Attributes

SvXMLExportm_rContext
 
SvXMLNumFmtExportm_pControlNumberStyles
 
PropertySetBag m_aIgnoreList
 
::rtl::Reference< XMLPropertyHandlerFactorym_xPropertyHandlerFactory
 
::rtl::Reference< SvXMLExportPropertyMapperm_xStyleExportMapper
 
css::uno::Reference< css::util::XNumberFormats > m_xControlNumberFormats
 
MapPropertySet2Map m_aControlIds
 
MapPropertySet2Map m_aReferringControls
 
MapPropertySet2Map::iterator m_aCurrentPageIds
 
MapPropertySet2Map::iterator m_aCurrentPageReferring
 
MapPropertySet2Int m_aControlNumberFormats
 
MapPropertySet2String m_aGridColumnStyles
 

Friends

class OFormLayerXMLExport
 

Additional Inherited Members

- Protected Member Functions inherited from xmloff::IFormsExportContext
 ~IFormsExportContext ()
 

Detailed Description

the implementation class for OFormLayerXMLExport

Definition at line 58 of file layerexport.hxx.

Member Typedef Documentation

◆ MapPropertySet2Int

typedef std::unordered_map<css::uno::Reference<css::beans::XPropertySet>, sal_Int32> xmloff::OFormLayerXMLExport_Impl::MapPropertySet2Int
private

Definition at line 109 of file layerexport.hxx.

Constructor & Destructor Documentation

◆ OFormLayerXMLExport_Impl()

xmloff::OFormLayerXMLExport_Impl::OFormLayerXMLExport_Impl ( SvXMLExport _rContext)
explicit

◆ ~OFormLayerXMLExport_Impl()

xmloff::OFormLayerXMLExport_Impl::~OFormLayerXMLExport_Impl ( )
virtual

Definition at line 96 of file layerexport.cxx.

Member Function Documentation

◆ checkExamineControl()

bool xmloff::OFormLayerXMLExport_Impl::checkExamineControl ( const css::uno::Reference< css::beans::XPropertySet > &  _rxObject)
private

check the object given if it's a control, if so, examine it.

Returns
<TRUE> if the object has been handled

Definition at line 487 of file layerexport.cxx.

References collectGridColumnStylesAndIds(), examineControlNumberFormat(), SvXMLExport::GetTextParagraphExport(), m_aControlIds, m_aCurrentPageIds, m_aCurrentPageReferring, m_rContext, xmloff::PROPERTY_CLASSID, xmloff::PROPERTY_CONTROLLABEL, and xmloff::PROPERTY_FORMATKEY.

Referenced by examineForms().

◆ clear()

void xmloff::OFormLayerXMLExport_Impl::clear ( )
private

◆ collectGridColumnStylesAndIds()

void xmloff::OFormLayerXMLExport_Impl::collectGridColumnStylesAndIds ( const css::uno::Reference< css::beans::XPropertySet > &  _rxControl)
private

◆ documentContainsXForms()

bool xmloff::OFormLayerXMLExport_Impl::documentContainsXForms ( ) const
private

determines whether the given page contains XForm instances

Definition at line 287 of file layerexport.cxx.

References SvXMLExport::GetModel(), and m_rContext.

◆ ensureControlNumberStyleExport()

void xmloff::OFormLayerXMLExport_Impl::ensureControlNumberStyleExport ( )
private

ensures that the instance exporting our control's number styles exists

Definition at line 681 of file layerexport.cxx.

References Exception, SvXMLExport::getComponentContext(), getControlNumberStyleNamePrefix(), Locale, m_pControlNumberStyles, m_rContext, and m_xControlNumberFormats.

Referenced by ensureTranslateFormat(), and getControlNumberStyleExport().

◆ ensureTranslateFormat()

sal_Int32 xmloff::OFormLayerXMLExport_Impl::ensureTranslateFormat ( const css::uno::Reference< css::beans::XPropertySet > &  _rxFormattedControl)
private

ensures that the number format of the given control exist in our own formats supplier.

The given control is examined for its format (i.e. it's FormatKey/FormatsSupplier properties), and the format is added (if necessary) to m_xControlNumberFormats

.

Returns
the format key of the control's format relative to our own formats supplier

Definition at line 634 of file layerexport.cxx.

References Any, ensureControlNumberStyleExport(), Locale, m_xControlNumberFormats, xmloff::PROPERTY_FORMATKEY, xmloff::PROPERTY_FORMATSSUPPLIER, xmloff::PROPERTY_FORMATSTRING, and xmloff::PROPERTY_LOCALE.

Referenced by implExamineControlNumberFormat().

◆ examineControlNumberFormat()

void xmloff::OFormLayerXMLExport_Impl::examineControlNumberFormat ( const css::uno::Reference< css::beans::XPropertySet > &  _rxControl)
private

examines the control's number format, so later the format style can be referred

remembers the format key for the control, so it can later be asked for in getControlNumberStyle

Definition at line 620 of file layerexport.cxx.

References implExamineControlNumberFormat(), and m_aControlNumberFormats.

Referenced by checkExamineControl().

◆ examineForms()

void xmloff::OFormLayerXMLExport_Impl::examineForms ( const css::uno::Reference< css::drawing::XDrawPage > &  _rxDrawPage)
private

examine a forms collection.

The method will collect control ids and add styles to the export context as necessary.

Every control in the object hierarchy given will be assigned to a unique id, which is stored for later use.

In addition, any references the controls may have between each other, are collected and stored for later use.

Upon calling this method, the id map will be cleared before collecting the new ids, so any ids you collected previously will be lost

Parameters
_rxDrawPagethe draw page which's forms collection should be examined
See also
getControlId
exportControl
exportForms

Definition at line 393 of file layerexport.cxx.

References checkExamineControl(), impl_isFormPageContainingForms(), and implMoveIterators().

◆ excludeFromExport()

void xmloff::OFormLayerXMLExport_Impl::excludeFromExport ( const css::uno::Reference< css::awt::XControlModel > &  _rxControl)
private

exclude the given control (model) from export.

If your document contains form controls which are not to be exported for whatever reason, you need to announce the models of these controls (can be retrieved from XControlShape::getControl) to the form layer exporter.
Of course you have to do this before calling <member>exportForms</member>

Definition at line 716 of file layerexport.cxx.

References o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::insert(), and m_aIgnoreList.

◆ exportAutoControlNumberStyles()

void xmloff::OFormLayerXMLExport_Impl::exportAutoControlNumberStyles ( )
private

exports the automatic control number styles

Definition at line 247 of file layerexport.cxx.

References SvXMLNumFmtExport::Export(), and m_pControlNumberStyles.

◆ exportAutoStyles()

void xmloff::OFormLayerXMLExport_Impl::exportAutoStyles ( )
private

exports the auto-styles collected during the examineForms calls

Definition at line 253 of file layerexport.cxx.

References CONTROL_ID, SvXMLExport::GetAutoStylePool(), and m_rContext.

◆ exportCollectionElements()

void xmloff::OFormLayerXMLExport_Impl::exportCollectionElements ( const css::uno::Reference< css::container::XIndexAccess > &  _rxCollection)
overrideprivatevirtual

◆ exportControl()

void xmloff::OFormLayerXMLExport_Impl::exportControl ( const css::uno::Reference< css::beans::XPropertySet > &  _rxControl,
const css::uno::Sequence< css::script::ScriptEventDescriptor > &  _rEvents 
)
private

exports one single control

Definition at line 134 of file layerexport.cxx.

References xmloff::OElementExport::doExport(), getControlId(), and m_aCurrentPageReferring.

Referenced by exportCollectionElements().

◆ exportForm()

void xmloff::OFormLayerXMLExport_Impl::exportForm ( const css::uno::Reference< css::beans::XPropertySet > &  _rxProps,
const css::uno::Sequence< css::script::ScriptEventDescriptor > &  _rEvents 
)
private

exports one single form

Definition at line 151 of file layerexport.cxx.

References xmloff::OElementExport::doExport().

Referenced by exportCollectionElements().

◆ exportForms()

void xmloff::OFormLayerXMLExport_Impl::exportForms ( const css::uno::Reference< css::drawing::XDrawPage > &  _rxDrawPage)
private

export a forms collection of a draw page

The method will obtain the forms collection of the page and call <method>exportCollectionElements</method>.

Definition at line 258 of file layerexport.cxx.

References exportCollectionElements(), impl_isFormPageContainingForms(), and implMoveIterators().

◆ exportGridColumn()

void xmloff::OFormLayerXMLExport_Impl::exportGridColumn ( const css::uno::Reference< css::beans::XPropertySet > &  _rxColumn,
const css::uno::Sequence< css::script::ScriptEventDescriptor > &  _rEvents 
)
private

exports one single grid column

Definition at line 126 of file layerexport.cxx.

References xmloff::OElementExport::doExport(), and getControlId().

Referenced by exportCollectionElements().

◆ exportXForms()

void xmloff::OFormLayerXMLExport_Impl::exportXForms ( ) const
private

exports the XForms model data

Definition at line 274 of file layerexport.cxx.

References exportXForms(), and m_rContext.

Referenced by exportXForms().

◆ getControlId()

OUString xmloff::OFormLayerXMLExport_Impl::getControlId ( const css::uno::Reference< css::beans::XPropertySet > &  _rxControl)
private

get the id of the given control.

You must have sought to the page of the control before calling this.

Definition at line 356 of file layerexport.cxx.

References m_aControlIds, and m_aCurrentPageIds.

Referenced by exportControl(), and exportGridColumn().

◆ getControlNumberStyle()

OUString xmloff::OFormLayerXMLExport_Impl::getControlNumberStyle ( const css::uno::Reference< css::beans::XPropertySet > &  _rxControl)
private

retrieves the style name for the control's number style.

For performance reasons, this method is allowed to be called for any controls, even those which do not have a number style. In this case, an empty string is returned.

Definition at line 377 of file layerexport.cxx.

References getControlNumberStyleExport(), SvXMLNumFmtExport::GetStyleName(), m_aControlNumberFormats, and m_pControlNumberStyles.

◆ getControlNumberStyleExport()

SvXMLNumFmtExport * xmloff::OFormLayerXMLExport_Impl::getControlNumberStyleExport ( )
private

returns the instance exporting our control's number styles

Definition at line 710 of file layerexport.cxx.

References ensureControlNumberStyleExport(), and m_pControlNumberStyles.

Referenced by getControlNumberStyle(), getImmediateNumberStyle(), and implExamineControlNumberFormat().

◆ getControlNumberStyleNamePrefix()

const OUString & xmloff::OFormLayerXMLExport_Impl::getControlNumberStyleNamePrefix ( )
staticprivate

returns the prefix to be used for control number styles

Definition at line 66 of file layerexport.cxx.

Referenced by ensureControlNumberStyleExport().

◆ getGlobalContext()

SvXMLExport & xmloff::OFormLayerXMLExport_Impl::getGlobalContext ( )
overrideprivatevirtual

Implements xmloff::IFormsExportContext.

Definition at line 164 of file layerexport.cxx.

References m_rContext.

◆ getImmediateNumberStyle()

OUString xmloff::OFormLayerXMLExport_Impl::getImmediateNumberStyle ( const css::uno::Reference< css::beans::XPropertySet > &  _rxObject)
private

determines the number format style for the given object without remembering it

Definition at line 366 of file layerexport.cxx.

References getControlNumberStyleExport(), SvXMLNumFmtExport::GetStyleName(), and implExamineControlNumberFormat().

Referenced by collectGridColumnStylesAndIds().

◆ getObjectStyleName()

OUString xmloff::OFormLayerXMLExport_Impl::getObjectStyleName ( const css::uno::Reference< css::beans::XPropertySet > &  _rxObject)
overrideprivatevirtual

Implements xmloff::IFormsExportContext.

Definition at line 224 of file layerexport.cxx.

References m_aGridColumnStyles.

◆ getStylePropertyMapper()

rtl::Reference< SvXMLExportPropertyMapper > xmloff::OFormLayerXMLExport_Impl::getStylePropertyMapper ( )
overrideprivatevirtual

Implements xmloff::IFormsExportContext.

Definition at line 159 of file layerexport.cxx.

References m_xStyleExportMapper.

◆ impl_isFormPageContainingForms()

bool xmloff::OFormLayerXMLExport_Impl::impl_isFormPageContainingForms ( const css::uno::Reference< css::drawing::XDrawPage > &  _rxDrawPage,
css::uno::Reference< css::container::XIndexAccess > &  _rxForms 
)
staticprivate

Definition at line 100 of file layerexport.cxx.

Referenced by examineForms(), and exportForms().

◆ implExamineControlNumberFormat()

sal_Int32 xmloff::OFormLayerXMLExport_Impl::implExamineControlNumberFormat ( const css::uno::Reference< css::beans::XPropertySet > &  _rxObject)
private

examines the control's number format, so later the format style can be referred

does not remember the information returned in any way

Definition at line 608 of file layerexport.cxx.

References ensureTranslateFormat(), getControlNumberStyleExport(), and SvXMLNumFmtExport::SetUsed().

Referenced by examineControlNumberFormat(), and getImmediateNumberStyle().

◆ implMoveIterators()

bool xmloff::OFormLayerXMLExport_Impl::implMoveIterators ( const css::uno::Reference< css::drawing::XDrawPage > &  _rxDrawPage,
bool  _bClear 
)
private

moves the m_aCurrentPage* members to the positions specifying the given page.

Returns
<TRUE> if there already were structures for the given page

Definition at line 296 of file layerexport.cxx.

References m_aControlIds, m_aCurrentPageIds, m_aCurrentPageReferring, and m_aReferringControls.

Referenced by examineForms(), exportForms(), and seekPage().

◆ pageContainsForms()

bool xmloff::OFormLayerXMLExport_Impl::pageContainsForms ( const css::uno::Reference< css::drawing::XDrawPage > &  _rxDrawPage)
staticprivate

determines whether the given page contains logical forms

Definition at line 280 of file layerexport.cxx.

References SAL_WARN_IF.

Referenced by xmloff::OFormLayerXMLExport::pageContainsForms().

◆ seekPage()

bool xmloff::OFormLayerXMLExport_Impl::seekPage ( const css::uno::Reference< css::drawing::XDrawPage > &  _rxDrawPage)
private

seek to the page given.

This must be called before you can retrieve any ids for controls on the page.

See also
getControlId

Definition at line 333 of file layerexport.cxx.

References implMoveIterators().

Friends And Related Function Documentation

◆ OFormLayerXMLExport

friend class OFormLayerXMLExport
friend

Definition at line 61 of file layerexport.hxx.

Member Data Documentation

◆ m_aControlIds

MapPropertySet2Map xmloff::OFormLayerXMLExport_Impl::m_aControlIds
private

◆ m_aControlNumberFormats

MapPropertySet2Int xmloff::OFormLayerXMLExport_Impl::m_aControlNumberFormats
private

Definition at line 110 of file layerexport.hxx.

Referenced by clear(), examineControlNumberFormat(), and getControlNumberStyle().

◆ m_aCurrentPageIds

MapPropertySet2Map::iterator xmloff::OFormLayerXMLExport_Impl::m_aCurrentPageIds
private

◆ m_aCurrentPageReferring

MapPropertySet2Map::iterator xmloff::OFormLayerXMLExport_Impl::m_aCurrentPageReferring
private

Definition at line 103 of file layerexport.hxx.

Referenced by checkExamineControl(), clear(), exportControl(), and implMoveIterators().

◆ m_aGridColumnStyles

MapPropertySet2String xmloff::OFormLayerXMLExport_Impl::m_aGridColumnStyles
private

Definition at line 113 of file layerexport.hxx.

Referenced by clear(), collectGridColumnStylesAndIds(), and getObjectStyleName().

◆ m_aIgnoreList

PropertySetBag xmloff::OFormLayerXMLExport_Impl::m_aIgnoreList
private

Definition at line 67 of file layerexport.hxx.

Referenced by clear(), excludeFromExport(), and exportCollectionElements().

◆ m_aReferringControls

MapPropertySet2Map xmloff::OFormLayerXMLExport_Impl::m_aReferringControls
private

Definition at line 95 of file layerexport.hxx.

Referenced by clear(), and implMoveIterators().

◆ m_pControlNumberStyles

SvXMLNumFmtExport* xmloff::OFormLayerXMLExport_Impl::m_pControlNumberStyles
private

◆ m_rContext

SvXMLExport& xmloff::OFormLayerXMLExport_Impl::m_rContext
private

◆ m_xControlNumberFormats

css::uno::Reference< css::util::XNumberFormats > xmloff::OFormLayerXMLExport_Impl::m_xControlNumberFormats
private

Definition at line 90 of file layerexport.hxx.

Referenced by ensureControlNumberStyleExport(), and ensureTranslateFormat().

◆ m_xPropertyHandlerFactory

::rtl::Reference< XMLPropertyHandlerFactory > xmloff::OFormLayerXMLExport_Impl::m_xPropertyHandlerFactory
private

Definition at line 70 of file layerexport.hxx.

Referenced by OFormLayerXMLExport_Impl().

◆ m_xStyleExportMapper

::rtl::Reference< SvXMLExportPropertyMapper > xmloff::OFormLayerXMLExport_Impl::m_xStyleExportMapper
private

The documentation for this class was generated from the following files: