Line data Source code
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 "tp_PointGeometry.hxx"
21 : #include "ResourceIds.hrc"
22 : #include "res_BarGeometry.hxx"
23 : #include "ResId.hxx"
24 :
25 : #include "chartview/ChartSfxItemIds.hxx"
26 :
27 : #include <svl/intitem.hxx>
28 : #include <svx/svx3ditems.hxx>
29 :
30 : namespace chart
31 : {
32 :
33 0 : SchLayoutTabPage::SchLayoutTabPage(vcl::Window* pWindow,const SfxItemSet& rInAttrs)
34 : : SfxTabPage(pWindow, "tp_ChartType", "modules/schart/ui/tp_ChartType.ui", &rInAttrs)
35 0 : , m_pGeometryResources(0)
36 : {
37 0 : m_pGeometryResources = new BarGeometryResources( this );
38 0 : }
39 :
40 0 : SchLayoutTabPage::~SchLayoutTabPage()
41 : {
42 0 : delete m_pGeometryResources;
43 0 : }
44 :
45 0 : SfxTabPage* SchLayoutTabPage::Create(vcl::Window* pWindow,
46 : const SfxItemSet* rOutAttrs)
47 : {
48 0 : return new SchLayoutTabPage(pWindow, *rOutAttrs);
49 : }
50 :
51 0 : bool SchLayoutTabPage::FillItemSet(SfxItemSet* rOutAttrs)
52 : {
53 :
54 0 : if(m_pGeometryResources && m_pGeometryResources->GetSelectEntryCount())
55 : {
56 0 : long nSegs=32;
57 :
58 0 : long nShape = m_pGeometryResources->GetSelectEntryPos();
59 0 : if(nShape==CHART_SHAPE3D_PYRAMID)
60 0 : nSegs=4;
61 :
62 0 : rOutAttrs->Put(SfxInt32Item(SCHATTR_STYLE_SHAPE,nShape));
63 0 : rOutAttrs->Put(makeSvx3DHorizontalSegmentsItem(nSegs));
64 : }
65 0 : return true;
66 : }
67 :
68 0 : void SchLayoutTabPage::Reset(const SfxItemSet* rInAttrs)
69 : {
70 0 : const SfxPoolItem *pPoolItem = NULL;
71 :
72 0 : if (rInAttrs->GetItemState(SCHATTR_STYLE_SHAPE,true, &pPoolItem) == SfxItemState::SET)
73 : {
74 0 : long nVal = static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
75 0 : if(m_pGeometryResources)
76 : {
77 0 : m_pGeometryResources->SelectEntryPos(static_cast<sal_uInt16>(nVal));
78 0 : m_pGeometryResources->Show( true );
79 : }
80 : }
81 0 : }
82 :
83 102 : } //namespace chart
84 :
85 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|