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 "ResourceIds.hrc"
22 #include "res_BarGeometry.hxx"
25 #include "chartview/ChartSfxItemIds.hxx"
27 #include <svl/intitem.hxx>
28 #include <svx/svx3ditems.hxx>
33 SchLayoutTabPage::SchLayoutTabPage(vcl::Window
* pWindow
,const SfxItemSet
& rInAttrs
)
34 : SfxTabPage(pWindow
, "tp_ChartType", "modules/schart/ui/tp_ChartType.ui", &rInAttrs
)
35 , m_pGeometryResources(0)
37 m_pGeometryResources
= new BarGeometryResources( this );
40 SchLayoutTabPage::~SchLayoutTabPage()
45 void SchLayoutTabPage::dispose()
47 delete m_pGeometryResources
;
48 m_pGeometryResources
= NULL
;
49 SfxTabPage::dispose();
52 VclPtr
<SfxTabPage
> SchLayoutTabPage::Create(vcl::Window
* pWindow
,
53 const SfxItemSet
* rOutAttrs
)
55 return VclPtr
<SchLayoutTabPage
>::Create(pWindow
, *rOutAttrs
);
58 bool SchLayoutTabPage::FillItemSet(SfxItemSet
* rOutAttrs
)
61 if(m_pGeometryResources
&& m_pGeometryResources
->GetSelectEntryCount())
65 long nShape
= m_pGeometryResources
->GetSelectEntryPos();
66 if(nShape
==CHART_SHAPE3D_PYRAMID
)
69 rOutAttrs
->Put(SfxInt32Item(SCHATTR_STYLE_SHAPE
,nShape
));
70 rOutAttrs
->Put(makeSvx3DHorizontalSegmentsItem(nSegs
));
75 void SchLayoutTabPage::Reset(const SfxItemSet
* rInAttrs
)
77 const SfxPoolItem
*pPoolItem
= NULL
;
79 if (rInAttrs
->GetItemState(SCHATTR_STYLE_SHAPE
,true, &pPoolItem
) == SfxItemState::SET
)
81 long nVal
= static_cast<const SfxInt32Item
*>(pPoolItem
)->GetValue();
82 if(m_pGeometryResources
)
84 m_pGeometryResources
->SelectEntryPos(static_cast<sal_uInt16
>(nVal
));
85 m_pGeometryResources
->Show( true );
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */