1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "tp_PointGeometry.hxx"
21 #include <res_BarGeometry.hxx>
23 #include <chartview/ChartSfxItemIds.hxx>
25 #include <svl/intitem.hxx>
26 #include <svx/svx3ditems.hxx>
31 SchLayoutTabPage::SchLayoutTabPage(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
& rInAttrs
)
32 : SfxTabPage(pPage
, pController
, u
"modules/schart/ui/tp_ChartType.ui"_ustr
, u
"tp_ChartType"_ustr
, &rInAttrs
)
34 m_pGeometryResources
.reset(new BarGeometryResources(m_xBuilder
.get()));
37 SchLayoutTabPage::~SchLayoutTabPage()
39 m_pGeometryResources
.reset();
42 std::unique_ptr
<SfxTabPage
> SchLayoutTabPage::Create(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
* rOutAttrs
)
44 return std::make_unique
<SchLayoutTabPage
>(pPage
, pController
, *rOutAttrs
);
47 bool SchLayoutTabPage::FillItemSet(SfxItemSet
* rOutAttrs
)
49 int nShape
= m_pGeometryResources
? m_pGeometryResources
->get_selected_index() : -1;
54 if (nShape
==CHART_SHAPE3D_PYRAMID
)
57 rOutAttrs
->Put(SfxInt32Item(SCHATTR_STYLE_SHAPE
,nShape
));
58 rOutAttrs
->Put(makeSvx3DHorizontalSegmentsItem(nSegs
));
63 void SchLayoutTabPage::Reset(const SfxItemSet
* rInAttrs
)
65 if (const SfxInt32Item
* pShapeItem
= rInAttrs
->GetItemIfSet(SCHATTR_STYLE_SHAPE
))
67 tools::Long nVal
= pShapeItem
->GetValue();
68 if(m_pGeometryResources
)
70 m_pGeometryResources
->select(static_cast<sal_uInt16
>(nVal
));
71 m_pGeometryResources
->set_visible(true);
78 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */