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"
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 //.............................................................................
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
;
76 nShape
= m_pGeometryResources
->GetSelectEntryPos();
77 if(nShape
==CHART_SHAPE3D_PYRAMID
)
80 rOutAttrs
.Put(SfxInt32Item(SCHATTR_STYLE_SHAPE
,nShape
));
81 rOutAttrs
.Put(Svx3DHorizontalSegmentsItem(nSegs
));
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 //.............................................................................
103 //.............................................................................
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */