1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_chart2.hxx"
30 
31 #include "tp_ErrorBars.hxx"
32 #include "ResId.hxx"
33 #include "TabPages.hrc"
34 #include "TabPageNotifiable.hxx"
35 
36 using namespace ::com::sun::star;
37 
38 //.............................................................................
39 namespace chart
40 {
41 //.............................................................................
42 
43 ErrorBarsTabPage::ErrorBarsTabPage( Window* pParent, const SfxItemSet& rInAttrs ) :
44         SfxTabPage( pParent, SchResId( TP_YERRORBAR ), rInAttrs ),
45         m_aErrorBarResources(
46             this,
47             // the parent is the tab control, of which the parent is the dialog
48             dynamic_cast< Dialog * >( pParent->GetParent() ),
49             rInAttrs, /* bNoneAvailable = */ false )
50 {
51     FreeResource();
52 }
53 
54 ErrorBarsTabPage::~ErrorBarsTabPage()
55 {
56 }
57 
58 SfxTabPage* ErrorBarsTabPage::Create(
59     Window* pParent, const SfxItemSet& rOutAttrs )
60 {
61     return new ErrorBarsTabPage( pParent, rOutAttrs );
62 }
63 
64 sal_Bool ErrorBarsTabPage::FillItemSet( SfxItemSet& rOutAttrs )
65 {
66     return m_aErrorBarResources.FillItemSet( rOutAttrs );
67 }
68 
69 void ErrorBarsTabPage::Reset( const SfxItemSet& rInAttrs )
70 {
71     m_aErrorBarResources.Reset( rInAttrs );
72 }
73 
74 void ErrorBarsTabPage::DataChanged( const DataChangedEvent& rDCEvt )
75 {
76     SfxTabPage::DataChanged( rDCEvt );
77 
78     if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) )
79         m_aErrorBarResources.FillValueSets();
80 }
81 
82 void ErrorBarsTabPage::SetAxisMinorStepWidthForErrorBarDecimals( double fMinorStepWidth )
83 {
84     m_aErrorBarResources.SetAxisMinorStepWidthForErrorBarDecimals( fMinorStepWidth );
85 }
86 
87 void ErrorBarsTabPage::SetErrorBarType( ErrorBarResources::tErrorBarType eNewType )
88 {
89     m_aErrorBarResources.SetErrorBarType( eNewType );
90 }
91 
92 void ErrorBarsTabPage::SetChartDocumentForRangeChoosing(
93     const uno::Reference< chart2::XChartDocument > & xChartDocument )
94 {
95     m_aErrorBarResources.SetChartDocumentForRangeChoosing( xChartDocument );
96 }
97 
98 //.............................................................................
99 } //namespace chart
100 //.............................................................................
101