29#include <com/sun/star/report/XReportControlModel.hpp>
31#include <osl/diagnose.h>
41 ,
const Reference< XReportComponent > & _xComponent
42 ,OXMLTable* _pContainer
43 ,OXMLCell* _pCellParent) :
44 OXMLReportElementBase( rImport,_xComponent,_pContainer)
46,m_pCellParent(_pCellParent)
48,m_bContainsShape(false)
53OXMLSubDocument::~OXMLSubDocument()
57css::uno::Reference< css::xml::sax::XFastContextHandler > OXMLSubDocument::createFastChildContext(
59 const Reference< XFastAttributeList > & xAttrList )
61 css::uno::Reference< css::xml::sax::XFastContextHandler > xContext = OXMLReportElementBase::createFastChildContext(nElement,xAttrList);
82 if ( !m_bContainsShape )
83 m_nCurrentCount = m_pContainer->getSection()->getCount();
84 uno::Reference< drawing::XShapes > xShapes = m_pContainer->getSection();
86 m_bContainsShape =
true;
90 m_pCellParent->setContainsShape(
true);
95 SAL_WARN(
"reportdesign",
"unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
102void OXMLSubDocument::endFastElement(sal_Int32 )
104 if ( !m_bContainsShape )
107 m_xReportComponent.set(m_pContainer->getSection()->getByIndex(m_nCurrentCount),uno::UNO_QUERY);
108 if ( !m_xReportComponent.is() )
111 if ( !m_aMasterFields.empty() )
112 m_xReportComponent->setMasterFields(Sequence< OUString>(&*m_aMasterFields.begin(),m_aMasterFields.size()));
113 if ( !m_aDetailFields.empty() )
114 m_xReportComponent->setDetailFields(Sequence< OUString>(&*m_aDetailFields.begin(),m_aDetailFields.size()));
116 m_xReportComponent->setName(m_xFake->getName());
117 m_xReportComponent->setPrintRepeatedValues(m_xFake->getPrintRepeatedValues());
118 uno::Reference< report::XReportControlModel > xFakeModel(m_xFake,uno::UNO_QUERY);
119 uno::Reference< report::XReportControlModel > xComponentModel(m_xReportComponent,uno::UNO_QUERY);
120 if ( !(xComponentModel.is() && xFakeModel.is()) )
123 xComponentModel->setPrintWhenGroupChange(xFakeModel->getPrintWhenGroupChange());
124 const sal_Int32
nCount = xFakeModel->getCount();
129 uno::Reference< report::XFormatCondition > xCond(xFakeModel->getByIndex(
i),uno::UNO_QUERY);
130 uno::Reference< report::XFormatCondition > xNewCond = xComponentModel->createFormatCondition();
131 ::comphelper::copyProperties(xCond, xNewCond);
132 xComponentModel->insertByIndex(xComponentModel->getCount(),
uno::Any(xNewCond));
135 catch(uno::Exception&)
137 OSL_FAIL(
"Can not access format condition!");
141void OXMLSubDocument::addMasterDetailPair(const ::std::pair< OUString,OUString >& _aPair)
143 m_aMasterFields.push_back(_aPair.first);
144 m_aDetailFields.push_back(_aPair.second);
static SvXMLShapeContext * CreateGroupChildContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes, bool bTemporaryShape=false)
OXMLSubDocument(const OXMLSubDocument &)=delete
#define SAL_WARN(area, stream)
#define PROGRESS_BAR_STEP
#define XML_ELEMENT(prefix, name)