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 <sal/log.hxx>
25 #include <tools/diagnose_ex.h>
26 
27 namespace rptxml
28 {
29  using namespace ::com::sun::star;
30  using namespace ::com::sun::star::uno;
31  using namespace ::com::sun::star::beans;
32  using namespace ::com::sun::star::report;
33  using namespace ::com::sun::star::xml::sax;
34 OXMLComponent::OXMLComponent( ORptFilter& _rImport
35  ,const Reference< XFastAttributeList > & _xAttrList
36  ,const Reference< XReportComponent > & _xComponent
37  ) :
38  SvXMLImportContext( _rImport )
39  ,m_xComponent(_xComponent)
40 {
41  OSL_ENSURE(m_xComponent.is(),"Component is NULL!");
42 
43  for (auto &aIter : sax_fastparser::castToFastAttributeList( _xAttrList ))
44  {
45  try
46  {
47  switch( aIter.getToken() )
48  {
49  case XML_ELEMENT(DRAW, XML_NAME):
50  m_xComponent->setName(aIter.toString());
51  break;
52  default:
53  XMLOFF_WARN_UNKNOWN("reportdesign", aIter);
54  }
55  }
56  catch(const Exception&)
57  {
58  TOOLS_WARN_EXCEPTION( "reportdesign", "Exception caught while putting props into report component!");
59  }
60  }
61 }
62 
63 
65 {
66 }
67 
68 
69 } // namespace rptxml
70 
71 
72 /* 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)