LibreOffice Module oox (master) 1
datatableconverter.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
21
22#include <com/sun/star/chart2/XDiagram.hpp>
23#include <com/sun/star/chart2/XDataTable.hpp>
25#include <oox/token/properties.hxx>
26
27using namespace css;
28
30{
32 : ConverterBase<DataTableModel>(rParent, rModel)
33{
34}
35
37
38void DataTableConverter::convertFromModel(uno::Reference<chart2::XDiagram> const& rxDiagram)
39{
40 if (!rxDiagram.is())
41 return;
42
43 try
44 {
45 uno::Reference<chart2::XDataTable> xDataTable(
46 createInstance("com.sun.star.chart2.DataTable"), uno::UNO_QUERY_THROW);
47 rxDiagram->setDataTable(xDataTable);
48
49 PropertySet aPropSet(xDataTable);
58
61 }
62 catch (uno::Exception&)
63 {
64 }
65}
66
67} // namespace oox
68
69/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
A wrapper for a UNO property set.
Definition: propertyset.hxx:58
bool setProperty(sal_Int32 nPropId, const Type &rValue)
Puts the passed value into the property set.
Base class of all converter classes.
ObjectFormatter & getFormatter() const
Returns the object formatter.
css::uno::Reference< css::uno::XInterface > createInstance(const OUString &rServiceName) const
Creates an instance for the passed service name, using the process service factory.
DataTableConverter(const ConverterRoot &rParent, DataTableModel &rModel)
void convertFromModel(css::uno::Reference< css::chart2::XDiagram > const &rxDiagram)
Converts the OOXML data table model to a chart2 diagram.
void convertFormatting(PropertySet &rPropSet, const ModelRef< Shape > &rxShapeProp, const ModelRef< TextBody > &rxTextProp, ObjectType eObjType)
Sets frame/text formatting properties to the passed property set.
@ OBJECTTYPE_DATATABLE
Down-bar in line/stock charts.
bool mbShowOutline
Show Vertical Border.
ModelRef< TextBody > mxTextProp
frame formatting.
bool mbShowVBorder
Show Horizontal Border.
constexpr OUStringLiteral PROP_VBorder
constexpr OUStringLiteral PROP_Outline
constexpr OUStringLiteral PROP_HBorder
constexpr OUStringLiteral PROP_Keys