LibreOffice Module xmloff (master)  1
SchXMLAxisContext.hxx
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 #pragma once
20 
22 #include <xmloff/xmlictxt.hxx>
23 
24 #include "transporttypes.hxx"
25 
26 #include <com/sun/star/chart/XDiagram.hpp>
27 #include <com/sun/star/xml/sax/XAttributeList.hpp>
28 
30 {
31 public:
33  SvXMLImport& rImport,
34  css::uno::Reference< css::chart::XDiagram > const & xDiagram,
35  std::vector< SchXMLAxis >& aAxes,
36  OUString& rCategoriesAddress,
37  bool bAddMissingXAxisForNetCharts,
38  bool bAdaptWrongPercentScaleValues,
39  bool bAdaptXAxisOrientationForOld2DBarCharts,
40  bool& rbAxisPositionAttributeImported );
41  virtual ~SchXMLAxisContext() override;
42 
43  virtual void SAL_CALL startFastElement( sal_Int32 nElement,
44  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
45  virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
46  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
47  sal_Int32 nElement,
48  const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
49 
50  static void CorrectAxisPositions( const css::uno::Reference< css::chart2::XChartDocument >& xNewDoc,
51  std::u16string_view rChartTypeServiceName,
52  std::u16string_view rODFVersionOfFile,
53  bool bAxisPositionAttributeImported );
54 
55 private:
57  css::uno::Reference< css::chart::XDiagram > m_xDiagram;
59  std::vector< SchXMLAxis >& m_rAxes;
60  css::uno::Reference< css::beans::XPropertySet > m_xAxisProps;
61  OUString m_aAutoStyleName;
63  sal_Int32 m_nAxisType;//css::chart::ChartAxisType
66  bool m_bAddMissingXAxisForNetCharts; //to correct errors from older versions
67  bool m_bAdaptWrongPercentScaleValues; //to correct errors from older versions
68  bool m_bAdaptXAxisOrientationForOld2DBarCharts; //to correct different behaviour from older versions
70 
71  css::uno::Reference< css::drawing::XShape > getTitleShape() const;
72  void CreateGrid( const OUString& sAutoStyleName, bool bIsMajor );
73  void CreateAxis();
74  void SetAxisTitle();
75 };
76 
77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
SchXMLAxisContext(SchXMLImportHelper &rImpHelper, SvXMLImport &rImport, css::uno::Reference< css::chart::XDiagram > const &xDiagram, std::vector< SchXMLAxis > &aAxes, OUString &rCategoriesAddress, bool bAddMissingXAxisForNetCharts, bool bAdaptWrongPercentScaleValues, bool bAdaptXAxisOrientationForOld2DBarCharts, bool &rbAxisPositionAttributeImported)
css::uno::Reference< css::drawing::XShape > getTitleShape() const
css::uno::Reference< css::chart::XDiagram > m_xDiagram
bool & m_rbAxisPositionAttributeImported
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
static void CorrectAxisPositions(const css::uno::Reference< css::chart2::XChartDocument > &xNewDoc, std::u16string_view rChartTypeServiceName, std::u16string_view rODFVersionOfFile, bool bAxisPositionAttributeImported)
std::vector< SchXMLAxis > & m_rAxes
bool m_bAdaptXAxisOrientationForOld2DBarCharts
OUString & m_rCategoriesAddress
css::uno::Reference< css::beans::XPropertySet > m_xAxisProps
With this class you can import a element containing its data as element o...
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
This class deliberately does not support XWeak, to improve performance when loading large documents...
Definition: xmlictxt.hxx:44
SchXMLImportHelper & m_rImportHelper
virtual ~SchXMLAxisContext() override
void CreateGrid(const OUString &sAutoStyleName, bool bIsMajor)