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 #include "ChartController.hxx"
27 #include "macros.hxx"
28 
29 #include "dlg_DataEditor.hxx"
30 #include "DataSourceHelper.hxx"
31 #include "DiagramHelper.hxx"
32 #include "ControllerLockGuard.hxx"
33 #include "UndoGuard.hxx"
34 #include "ResId.hxx"
35 #include "Strings.hrc"
36 
37 // for RET_OK
38 #include <vcl/msgbox.hxx>
39 #include <vcl/svapp.hxx>
40 #include <vos/mutex.hxx>
41 #include <com/sun/star/chart2/XChartDocument.hpp>
42 
43 using namespace ::com::sun::star;
44 
45 using ::com::sun::star::uno::Reference;
46 using ::com::sun::star::uno::Sequence;
47 
48 namespace chart
49 {
50 
executeDispatch_EditData()51 void ChartController::executeDispatch_EditData()
52 {
53     Reference< chart2::XChartDocument > xChartDoc( getModel(), uno::UNO_QUERY );
54     if( xChartDoc.is())
55     {
56         Window* pParent( NULL );
57 
58         Reference< ::com::sun::star::chart2::data::XDataProvider > xDataProvider( xChartDoc->getDataProvider());
59 
60         {
61             // /--
62             ::vos::OGuard aSolarGuard( Application::GetSolarMutex());
63             // using assignment for broken gcc 3.3
64             UndoLiveUpdateGuardWithData aUndoGuard = UndoLiveUpdateGuardWithData(
65                 String( SchResId( STR_ACTION_EDIT_CHART_DATA )),
66                 m_xUndoManager );
67             DataEditor aDataEditorDialog( pParent, xChartDoc, m_xCC );
68             // the dialog has no OK/Cancel
69             aDataEditorDialog.Execute();
70             aUndoGuard.commit();
71             // \--
72         }
73     }
74 }
75 
76 } //  namespace chart
77