LibreOffice Module reportdesign (master)  1
xmlComponent.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  */
19 #include "xmlComponent.hxx"
20 #include "xmlfilter.hxx"
21 #include <xmloff/xmltoken.hxx>
22 #include <xmloff/xmlnamespace.hxx>
23 #include <osl/diagnose.h>
24 #include <tools/diagnose_ex.h>
25 
26 namespace rptxml
27 {
28  using namespace ::com::sun::star;
29  using namespace ::com::sun::star::uno;
30  using namespace ::com::sun::star::beans;
31  using namespace ::com::sun::star::report;
32  using namespace ::com::sun::star::xml::sax;
33 OXMLComponent::OXMLComponent( ORptFilter& _rImport
34  ,const Reference< XFastAttributeList > & _xAttrList
35  ,const Reference< XReportComponent > & _xComponent
36  ) :
37  SvXMLImportContext( _rImport )
38  ,m_xComponent(_xComponent)
39 {
40  OSL_ENSURE(m_xComponent.is(),"Component is NULL!");
41 
42  for (auto &aIter : sax_fastparser::castToFastAttributeList( _xAttrList ))
43  {
44  try
45  {
46  switch( aIter.getToken() )
47  {
48  case XML_ELEMENT(DRAW, XML_NAME):
49  m_xComponent->setName(aIter.toString());
50  break;
51  default:
52  XMLOFF_WARN_UNKNOWN("reportdesign", aIter);
53  }
54  }
55  catch(const Exception&)
56  {
57  TOOLS_WARN_EXCEPTION( "reportdesign", "Exception caught while putting props into report component!");
58  }
59  }
60 }
61 
62 
64 {
65 }
66 
67 
68 } // namespace rptxml
69 
70 
71 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual ~OXMLComponent() override
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
#define XMLOFF_WARN_UNKNOWN(area, rIter)
#define TOOLS_WARN_EXCEPTION(area, stream)
#define XML_ELEMENT(prefix, name)
OXMLComponent(const OXMLComponent &)
OUString toString(OptionInfo const *info)