Kaydet (Commit) 446be18a authored tarafından Caolán McNamara's avatar Caolán McNamara

make CppunitTest_sw_ww8export work again

revert xmloff portion of

commit 35e68754
Author: Noel Grandin <noel@peralex.com>
Date:   Thu Oct 1 15:10:56 2015 +0200

    loplugin:unusedmethods

    Change-Id: I3d6f1300f4fae2af9e580d1d3b2c2c80fa9e9268
    Reviewed-on: https://gerrit.libreoffice.org/19075Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
Tested-by: 's avatarNoel Grandin <noelgrandin@gmail.com>

Change-Id: I24aa3f113a77d93c789b063b3c099bf2038e1dad
üst 9ad516a0
......@@ -30,6 +30,7 @@ namespace com { namespace sun { namespace star {
} } }
void exportDom( SvXMLExport&, const com::sun::star::uno::Reference<com::sun::star::xml::dom::XDocument>& );
void exportDom( SvXMLExport&, const com::sun::star::uno::Reference<com::sun::star::xml::dom::XNode>& );
#endif
......
......@@ -257,4 +257,10 @@ void exportDom( SvXMLExport& rExport, const Reference<XDocument>& xDocument )
visit( aDomExport, xDocument );
}
void exportDom( SvXMLExport& rExport, const Reference<XNode>& xNode )
{
DomExport aDomExport( rExport );
visit( aDomExport, xNode );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -572,7 +572,17 @@ namespace xmloff
{
}
// SvXMLImportContext overridables
virtual SvXMLImportContext* CreateChildContext(
sal_uInt16 _nPrefix, const OUString& _rLocalName,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
virtual void EndElement();
protected:
// OElementImport overridables
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
createElement();
// create the child context for the given control type
virtual SvXMLImportContext* implCreateControlWrapper(
sal_uInt16 _nPrefix, const OUString& _rLocalName) = 0;
......@@ -595,6 +605,11 @@ namespace xmloff
OColumnImport(OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
OControlElement::ElementType _eType);
protected:
// OElementImport overridables
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
createElement();
};
//= OColumnWrapperImport
......
......@@ -28,6 +28,58 @@
// no namespace. Same as above: this file is included from elementimport.hxx only,
// and this is done inside the namespace
//= OContainerImport
template <class BASE>
inline SvXMLImportContext* OContainerImport< BASE >::CreateChildContext(
sal_uInt16 _nPrefix, const OUString& _rLocalName,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList)
{
// maybe it's a sub control
if (_rLocalName == m_sWrapperElementName)
{
if (m_xMeAsContainer.is())
return implCreateControlWrapper(_nPrefix, _rLocalName);
else
{
OSL_FAIL("OContainerImport::CreateChildContext: don't have an element!");
return NULL;
}
}
return BASE::CreateChildContext(_nPrefix, _rLocalName, _rxAttrList);
}
template <class BASE>
inline ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
OContainerImport< BASE >::createElement()
{
// let the base class create the object
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xReturn = BASE::createElement();
if (!xReturn.is())
return xReturn;
// ensure that the object is a XNameContainer (we strongly need this for inserting child elements)
m_xMeAsContainer = ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >(xReturn, ::com::sun::star::uno::UNO_QUERY);
if (!m_xMeAsContainer.is())
{
OSL_FAIL("OContainerImport::createElement: invalid element (no XNameContainer) created!");
xReturn.clear();
}
return xReturn;
}
template <class BASE>
inline void OContainerImport< BASE >::EndElement()
{
BASE::EndElement();
// now that we have all children, attach the events
::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > xIndexContainer(m_xMeAsContainer, ::com::sun::star::uno::UNO_QUERY);
if (xIndexContainer.is())
ODefaultEventAttacherManager::setEvents(xIndexContainer);
}
//= OColumnImport
template <class BASE>
OColumnImport< BASE >::OColumnImport(OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
......@@ -39,4 +91,19 @@ OColumnImport< BASE >::OColumnImport(OFormLayerXMLImport_Impl& _rImport, IEventA
OSL_ENSURE(m_xColumnFactory.is(), "OColumnImport::OColumnImport: invalid parent container (no factory)!");
}
// OElementImport overridables
template <class BASE>
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > OColumnImport< BASE >::createElement()
{
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xReturn;
// no call to the base class' method. We have to use the grid column factory
if (m_xColumnFactory.is())
{
// create the column
xReturn = m_xColumnFactory->createColumn(this->m_sServiceName);
OSL_ENSURE(xReturn.is(), "OColumnImport::createElement: the factory returned an invalid object!");
}
return xReturn;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment