Coverage Report

Created: 2025-11-16 09:57

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/oox/source/drawingml/chart/datatableconverter.cxx
Line
Count
Source
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
20
#include <drawingml/chart/datatableconverter.hxx>
21
22
#include <com/sun/star/chart2/XDiagram.hpp>
23
#include <com/sun/star/chart2/XDataTable.hpp>
24
#include <drawingml/chart/plotareamodel.hxx>
25
#include <oox/token/properties.hxx>
26
27
using namespace css;
28
29
namespace oox::drawingml::chart
30
{
31
DataTableConverter::DataTableConverter(const ConverterRoot& rParent, DataTableModel& rModel)
32
0
    : ConverterBase<DataTableModel>(rParent, rModel)
33
0
{
34
0
}
35
36
0
DataTableConverter::~DataTableConverter() = default;
37
38
void DataTableConverter::convertFromModel(uno::Reference<chart2::XDiagram> const& rxDiagram)
39
0
{
40
0
    if (!rxDiagram.is())
41
0
        return;
42
43
0
    try
44
0
    {
45
0
        uno::Reference<chart2::XDataTable> xDataTable(
46
0
            createInstance(u"com.sun.star.chart2.DataTable"_ustr), uno::UNO_QUERY_THROW);
47
0
        rxDiagram->setDataTable(xDataTable);
48
49
0
        PropertySet aPropSet(xDataTable);
50
0
        if (mrModel.mbShowHBorder)
51
0
            aPropSet.setProperty(PROP_HBorder, mrModel.mbShowHBorder);
52
0
        if (mrModel.mbShowVBorder)
53
0
            aPropSet.setProperty(PROP_VBorder, mrModel.mbShowVBorder);
54
0
        if (mrModel.mbShowOutline)
55
0
            aPropSet.setProperty(PROP_Outline, mrModel.mbShowOutline);
56
0
        if (mrModel.mbShowKeys)
57
0
            aPropSet.setProperty(PROP_Keys, mrModel.mbShowKeys);
58
59
0
        getFormatter().convertFormatting(aPropSet, mrModel.mxShapeProp, mrModel.mxTextProp,
60
0
                                         OBJECTTYPE_DATATABLE);
61
0
    }
62
0
    catch (uno::Exception&)
63
0
    {
64
0
    }
65
0
}
66
67
} // namespace oox
68
69
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */