1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_chart2.hxx"
26 
27 #include "dlg_ChartType.hxx"
28 #include "dlg_ChartType.hrc"
29 #include "ResId.hxx"
30 #include "ResourceIds.hrc"
31 #include "Strings.hrc"
32 #include "tp_ChartType.hxx"
33 #include "macros.hxx"
34 #include <com/sun/star/chart2/XChartDocument.hpp>
35 
36 using namespace ::com::sun::star;
37 
38 //.............................................................................
39 namespace chart
40 {
41 //.............................................................................
42 using namespace ::com::sun::star;
43 using namespace ::com::sun::star::chart2;
44 
ChartTypeDialog(Window * pParent,const uno::Reference<frame::XModel> & xChartModel,const uno::Reference<uno::XComponentContext> & xContext)45 ChartTypeDialog::ChartTypeDialog( Window* pParent
46                 , const uno::Reference< frame::XModel >& xChartModel
47                 , const uno::Reference< uno::XComponentContext >& xContext )
48                 : ModalDialog( pParent, SchResId( DLG_DIAGRAM_TYPE ))
49                 , m_aFL( this, SchResId( FL_BUTTONS ) )
50                 , m_aBtnOK( this, SchResId( BTN_OK ) )
51                 , m_aBtnCancel( this, SchResId( BTN_CANCEL ) )
52                 , m_aBtnHelp( this, SchResId( BTN_HELP ) )
53                 , m_pChartTypeTabPage(0)
54                 , m_xChartModel(xChartModel)
55                 , m_xCC( xContext )
56 {
57     FreeResource();
58 
59     this->SetText(String(SchResId(STR_PAGE_CHARTTYPE)));
60 
61     //don't create the tabpages before FreeResource, otherwise the help ids are not matched correctly
62     m_pChartTypeTabPage = new ChartTypeTabPage(this,uno::Reference< XChartDocument >::query(m_xChartModel),m_xCC,true/*live update*/,true/*hide title description*/);
63     m_pChartTypeTabPage->initializePage();
64     m_pChartTypeTabPage->Show();
65  }
66 
~ChartTypeDialog()67 ChartTypeDialog::~ChartTypeDialog()
68 {
69     delete m_pChartTypeTabPage;
70 }
71 
72 //.............................................................................
73 } //namespace chart
74 //.............................................................................
75