xref: /trunk/main/sc/source/ui/inc/ScDevChart.hxx (revision 38d50f7b)
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 #ifndef INCLUDED_DEVCHARTCONFIG_HXX
24 #define INCLUDED_DEVCHARTCONFIG_HXX
25 
26 #include <unotools/configitem.hxx>
27 
28 namespace ScDevChart
29 {
30 
31 class DevChartConfigItem : public ::utl::ConfigItem
32 {
33 public:
DevChartConfigItem()34     DevChartConfigItem() :
35             ConfigItem( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Internal" )),
36                         CONFIG_MODE_IMMEDIATE_UPDATE )
37     {}
38 
39     bool UseDevelopmentChart();
40 };
41 
UseDevelopmentChart()42 bool DevChartConfigItem::UseDevelopmentChart()
43 {
44     bool bResult = false;
45 
46     ::com::sun::star::uno::Sequence< ::rtl::OUString > aNames( 1 );
47     aNames[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DevelopmentChart" ));
48 
49     ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aResult( GetProperties( aNames ));
50 
51     OSL_ASSERT( aResult.getLength());
52     aResult[0] >>= bResult;
53 
54     return bResult;
55 }
56 
57 /** States whether the new chart implementation or the old one should be used.
58     If <TRUE/> is returned the newly developed chart (chart2) should be used.
59     If <FALSE/> is returned, the old chart (sch) should be used.
60 
61     Config-Item: Office.Common/Internal:DevelopmentChart
62 
63     This function (the complete header) is only for a transitional period.  It
64     will be deprecated after the new chart is definitely integrated into the
65     product.
66  */
UseDevChart()67 bool UseDevChart()
68 {
69 //     static DevChartConfigItem aCfgItem;
70 //     return aCfgItem.UseDevelopmentChart();
71 
72     // ignore configuration
73     //@todo: get rid of this class
74     return true;
75 }
76 
77 } // namespace ScDevChart
78 
79 // INCLUDED_DEVCHARTCONFIG_HXX
80 #endif
81