LibreOffice Module reportdesign (master)  1
xmlReportElementBase.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  */
20 #include <xmloff/xmlnamespace.hxx>
21 #include <xmloff/xmltoken.hxx>
22 #include "xmlReportElementBase.hxx"
23 #include "xmlfilter.hxx"
24 #include "xmlControlProperty.hxx"
25 #include "xmlReportElement.hxx"
26 #include "xmlEnums.hxx"
27 #include "xmlTable.hxx"
28 #include <tools/diagnose_ex.h>
29 
30 namespace rptxml
31 {
32  using namespace ::com::sun::star;
33  using namespace ::com::sun::star::report;
34  using namespace ::com::sun::star::uno;
35  using namespace ::com::sun::star::xml::sax;
36 
38  ,const Reference< XReportComponent > & _xComponent
39  ,OXMLTable* _pContainer) :
40  SvXMLImportContext( rImport )
41 ,m_rImport(rImport)
42 ,m_pContainer(_pContainer)
43 ,m_xReportComponent(_xComponent)
44 {
45 }
46 
47 
49 {
50 }
51 
52 css::uno::Reference< css::xml::sax::XFastContextHandler > OXMLReportElementBase::createFastChildContext(
53  sal_Int32 nElement,
54  const Reference< XFastAttributeList > & xAttrList )
55 {
56  css::uno::Reference< css::xml::sax::XFastContextHandler > xContext;
57 
58  switch( nElement )
59  {
61  {
62  uno::Reference<report::XReportControlModel> xReportModel(m_xReportComponent,uno::UNO_QUERY);
63  if ( xReportModel.is() )
64  {
66  xContext = new OXMLReportElement( m_rImport,xAttrList,xReportModel);
67  }
68  }
69  break;
72  xContext = new OXMLControlProperty( m_rImport,xAttrList,m_xReportComponent);
73  break;
74  default:
75  break;
76  }
77 
78  return xContext;
79 }
80 
82 {
83  try
84  {
85  if ( m_pContainer && m_pContainer->getSection().is() && m_xReportComponent.is() )
87  }
88  catch(Exception&)
89  {
90  TOOLS_WARN_EXCEPTION( "reportdesign", "Exception caught while inserting a new control!");
91  }
92 }
93 
94 } // namespace rptxml
95 
96 
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
XML_REPORT_ELEMENT
XML_PROPERTIES
void Increment(sal_Int32 nInc=1)
#define TOOLS_WARN_EXCEPTION(area, stream)
ProgressBarHelper * GetProgressBarHelper()
OXMLReportElementBase(const OXMLReportElementBase &)=delete
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
const SvXMLImport & m_rImport
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
css::uno::Reference< css::report::XReportComponent > m_xReportComponent
FORM
#define XML_ELEMENT(prefix, name)
const css::uno::Reference< css::report::XSection > & getSection() const
Definition: xmlTable.hxx:82
#define PROGRESS_BAR_STEP
Definition: xmlEnums.hxx:22
REPORT