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

Helper class for importing property values. More...

#include <propertyimport.hxx>

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

Public Member Functions

 OPropertyImport (OFormLayerXMLImport_Impl &_rImport)
 
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext (sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
 
virtual void SAL_CALL startFastElement (sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &_rxAttrList) override
 
virtual void SAL_CALL characters (const OUString &_rChars) override
 This method is called for all characters that are contained in the current element. More...
 
- Public Member Functions inherited from SvXMLImportContext
 SvXMLImportContext (SvXMLImport &rImport)
 A contexts constructor does anything that is required if an element starts. More...
 
virtual ~SvXMLImportContext ()
 A contexts destructor does anything that is required if an element ends. More...
 
virtual void SAL_CALL startFastElement (sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
 
virtual void SAL_CALL startUnknownElement (const OUString &Namespace, const OUString &Name, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
 
virtual void SAL_CALL endFastElement (sal_Int32 Element) override
 endFastElement is called before a context will be destructed, but after an elements context has been parsed. More...
 
virtual void SAL_CALL endUnknownElement (const OUString &Namespace, const OUString &Name) override
 
virtual css::uno::Reference< XFastContextHandler > SAL_CALL createFastChildContext (sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
 
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createUnknownChildContext (const OUString &Namespace, const OUString &Name, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
 
virtual void SAL_CALL characters (const OUString &aChars) override
 This method is called for all characters that are contained in the current element. More...
 
virtual css::uno::Any SAL_CALL queryInterface (const css::uno::Type &aType) final override
 
virtual void SAL_CALL acquire () noexcept final override
 
virtual void SAL_CALL release () noexcept final override
 
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () final override
 
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId () final override
 

Protected Types

typedef ::std::vector< css::beans::PropertyValue > PropertyValueArray
 

Protected Member Functions

virtual bool handleAttribute (sal_Int32 nElement, const OUString &_rValue)
 handle one single attribute. More...
 
bool encounteredAttribute (sal_Int32 nElement) const
 determine if the element imported by the object had a given attribute. More...
 
void enableTrackAttributes ()
 enables the tracking of the encountered attributes More...
 
void implPushBackPropertyValue (const css::beans::PropertyValue &_rProp)
 
void implPushBackPropertyValue (const OUString &_rName, const css::uno::Any &_rValue)
 
void implPushBackGenericPropertyValue (const css::beans::PropertyValue &_rProp)
 
- Protected Member Functions inherited from SvXMLImportContext
SvXMLImportGetImport ()
 
const SvXMLImportGetImport () const
 

Protected Attributes

PropertyValueArray m_aValues
 
PropertyValueArray m_aGenericValues
 
o3tl::sorted_vector< sal_Int32 > m_aEncounteredAttributes
 
OFormLayerXMLImport_Implm_rContext
 
bool m_bTrackAttributes
 

Friends

class OSinglePropertyContext
 
class OListPropertyContext
 

Detailed Description

Helper class for importing property values.

This class imports properties which are stored as attributes as well as properties which are stored in <form:properties> elements.

Definition at line 71 of file propertyimport.hxx.

Member Typedef Documentation

◆ PropertyValueArray

typedef ::std::vector< css::beans::PropertyValue > xmloff::OPropertyImport::PropertyValueArray
protected

Definition at line 77 of file propertyimport.hxx.

Constructor & Destructor Documentation

◆ OPropertyImport()

xmloff::OPropertyImport::OPropertyImport ( OFormLayerXMLImport_Impl _rImport)

Definition at line 256 of file propertyimport.cxx.

References m_rContext.

Member Function Documentation

◆ characters()

void xmloff::OPropertyImport::characters ( const OUString &  aChars)
overridevirtual

This method is called for all characters that are contained in the current element.

The default is to ignore them.

Reimplemented from SvXMLImportContext.

Definition at line 302 of file propertyimport.cxx.

References o3tl::trim().

◆ createFastChildContext()

css::uno::Reference< css::xml::sax::XFastContextHandler > xmloff::OPropertyImport::createFastChildContext ( sal_Int32  nElement,
const css::uno::Reference< css::xml::sax::XFastAttributeList > &  AttrList 
)
overridevirtual

◆ enableTrackAttributes()

void xmloff::OPropertyImport::enableTrackAttributes ( )
inlineprotected

enables the tracking of the encountered attributes

The tracking will raise the import costs a little bit, but it's cheaper than derived classes tracking this themself.

Definition at line 131 of file propertyimport.hxx.

References m_bTrackAttributes.

Referenced by xmloff::OButtonImport::OButtonImport(), xmloff::OFormImport::OFormImport(), xmloff::OListAndComboImport::OListAndComboImport(), and xmloff::OTextLikeImport::OTextLikeImport().

◆ encounteredAttribute()

bool xmloff::OPropertyImport::encounteredAttribute ( sal_Int32  nElement) const
protected

determine if the element imported by the object had a given attribute.

Please be aware of the fact that the name given must be a local name, i.e. not contain a namespace. All form relevant attributes are in the same namespace, so this would be a redundant information.

Definition at line 296 of file propertyimport.cxx.

References o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::end(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::find(), m_aEncounteredAttributes, m_bTrackAttributes, and TOKEN_MASK.

◆ handleAttribute()

bool xmloff::OPropertyImport::handleAttribute ( sal_Int32  nElement,
const OUString &  _rValue 
)
protectedvirtual

◆ implPushBackGenericPropertyValue()

void xmloff::OPropertyImport::implPushBackGenericPropertyValue ( const css::beans::PropertyValue &  _rProp)
inlineprotected

Definition at line 144 of file propertyimport.hxx.

References m_aGenericValues.

◆ implPushBackPropertyValue() [1/2]

void xmloff::OPropertyImport::implPushBackPropertyValue ( const css::beans::PropertyValue &  _rProp)
inlineprotected

◆ implPushBackPropertyValue() [2/2]

void xmloff::OPropertyImport::implPushBackPropertyValue ( const OUString &  _rName,
const css::uno::Any &  _rValue 
)
inlineprotected

Definition at line 138 of file propertyimport.hxx.

References m_aValues.

◆ startFastElement()

void xmloff::OPropertyImport::startFastElement ( sal_Int32  nElement,
const css::uno::Reference< css::xml::sax::XFastAttributeList > &  _rxAttrList 
)
overridevirtual

Friends And Related Function Documentation

◆ OListPropertyContext

friend class OListPropertyContext
friend

Definition at line 74 of file propertyimport.hxx.

◆ OSinglePropertyContext

friend class OSinglePropertyContext
friend

Definition at line 73 of file propertyimport.hxx.

Member Data Documentation

◆ m_aEncounteredAttributes

o3tl::sorted_vector<sal_Int32> xmloff::OPropertyImport::m_aEncounteredAttributes
protected

Definition at line 82 of file propertyimport.hxx.

Referenced by encounteredAttribute(), and startFastElement().

◆ m_aGenericValues

PropertyValueArray xmloff::OPropertyImport::m_aGenericValues
protected

◆ m_aValues

PropertyValueArray xmloff::OPropertyImport::m_aValues
protected

◆ m_bTrackAttributes

bool xmloff::OPropertyImport::m_bTrackAttributes
protected

◆ m_rContext

OFormLayerXMLImport_Impl& xmloff::OPropertyImport::m_rContext
protected

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