Bump for 3.6-28
[LibreOffice.git] / chart2 / source / controller / dialogs / tp_PointGeometry.cxx
blob022cc29b4ca55ffa4f5d464e740e164d73e2e56f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #include "tp_PointGeometry.hxx"
30 #include "TabPages.hrc"
31 #include "res_BarGeometry.hxx"
32 #include "ResId.hxx"
34 #include "chartview/ChartSfxItemIds.hxx"
36 // header for SfxInt32Item
37 #include <svl/intitem.hxx>
38 // header for class Svx3DHorizontalSegmentsItem
39 #include <svx/svx3ditems.hxx>
41 //.............................................................................
42 namespace chart
44 //.............................................................................
46 SchLayoutTabPage::SchLayoutTabPage(Window* pWindow,const SfxItemSet& rInAttrs)
47 : SfxTabPage(pWindow, SchResId(TP_LAYOUT), rInAttrs)
48 , m_pGeometryResources(0)
50 Size aPageSize( this->GetSizePixel() );
51 Point aPos( this->LogicToPixel( Point(6,6), MapMode(MAP_APPFONT) ) );
52 m_pGeometryResources = new BarGeometryResources( this );
53 m_pGeometryResources->SetPosPixel( aPos );
56 SchLayoutTabPage::~SchLayoutTabPage()
58 if( m_pGeometryResources )
59 delete m_pGeometryResources;
62 SfxTabPage* SchLayoutTabPage::Create(Window* pWindow,
63 const SfxItemSet& rOutAttrs)
65 return new SchLayoutTabPage(pWindow, rOutAttrs);
68 sal_Bool SchLayoutTabPage::FillItemSet(SfxItemSet& rOutAttrs)
71 if(m_pGeometryResources && m_pGeometryResources->GetSelectEntryCount())
73 long nShape=CHART_SHAPE3D_SQUARE;
74 long nSegs=32;
76 nShape = m_pGeometryResources->GetSelectEntryPos();
77 if(nShape==CHART_SHAPE3D_PYRAMID)
78 nSegs=4;
80 rOutAttrs.Put(SfxInt32Item(SCHATTR_STYLE_SHAPE,nShape));
81 rOutAttrs.Put(Svx3DHorizontalSegmentsItem(nSegs));
83 return sal_True;
86 void SchLayoutTabPage::Reset(const SfxItemSet& rInAttrs)
88 const SfxPoolItem *pPoolItem = NULL;
90 if (rInAttrs.GetItemState(SCHATTR_STYLE_SHAPE,sal_True, &pPoolItem) == SFX_ITEM_SET)
92 long nVal=((const SfxInt32Item*)pPoolItem)->GetValue();
93 if(m_pGeometryResources)
95 m_pGeometryResources->SelectEntryPos(static_cast<sal_uInt16>(nVal));
96 m_pGeometryResources->Show( true );
101 //.............................................................................
102 } //namespace chart
103 //.............................................................................
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */