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/xmltkmap.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 <osl/diagnose.h>
29 #include <tools/diagnose_ex.h>
30 
31 namespace rptxml
32 {
33  using namespace ::com::sun::star;
34  using namespace ::com::sun::star::report;
35  using namespace ::com::sun::star::uno;
36  using namespace ::com::sun::star::xml::sax;
37 
39  ,const Reference< XReportComponent > & _xComponent
40  ,OXMLTable* _pContainer) :
41  SvXMLImportContext( rImport )
42 ,m_rImport(rImport)
43 ,m_pContainer(_pContainer)
44 ,m_xReportComponent(_xComponent)
45 {
46 }
47 
48 
50 {
51 }
52 
53 css::uno::Reference< css::xml::sax::XFastContextHandler > OXMLReportElementBase::createFastChildContext(
54  sal_Int32 nElement,
55  const Reference< XFastAttributeList > & xAttrList )
56 {
57  css::uno::Reference< css::xml::sax::XFastContextHandler > xContext;
58 
59  switch( nElement )
60  {
62  {
63  uno::Reference<report::XReportControlModel> xReportModel(m_xReportComponent,uno::UNO_QUERY);
64  if ( xReportModel.is() )
65  {
67  xContext = new OXMLReportElement( m_rImport,xAttrList,xReportModel);
68  }
69  }
70  break;
73  xContext = new OXMLControlProperty( m_rImport,xAttrList,m_xReportComponent);
74  break;
75  default:
76  break;
77  }
78 
79  return xContext;
80 }
81 
83 {
84  try
85  {
86  if ( m_pContainer && m_pContainer->getSection().is() && m_xReportComponent.is() )
88  }
89  catch(Exception&)
90  {
91  TOOLS_WARN_EXCEPTION( "reportdesign", "Exception caught while inserting a new control!");
92  }
93 }
94 
95 } // namespace rptxml
96 
97 
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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
XML_REPORT_ELEMENT