1*40df464eSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*40df464eSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*40df464eSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*40df464eSAndrew Rist  * distributed with this work for additional information
6*40df464eSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*40df464eSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*40df464eSAndrew Rist  * "License"); you may not use this file except in compliance
9*40df464eSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*40df464eSAndrew Rist  *
11*40df464eSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*40df464eSAndrew Rist  *
13*40df464eSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*40df464eSAndrew Rist  * software distributed under the License is distributed on an
15*40df464eSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*40df464eSAndrew Rist  * KIND, either express or implied.  See the License for the
17*40df464eSAndrew Rist  * specific language governing permissions and limitations
18*40df464eSAndrew Rist  * under the License.
19*40df464eSAndrew Rist  *
20*40df464eSAndrew Rist  *************************************************************/
21*40df464eSAndrew Rist 
22*40df464eSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #include "AccessibilityOptTest.hxx"
25cdf0e10cSrcweir #include "configitems/accessibilityoptions_const.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
28cdf0e10cSrcweir #include <com/sun/star/container/XNameAccess.hpp>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #include <comphelper/configurationhelper.hxx>
31cdf0e10cSrcweir #include <unotools/processfactory.hxx>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir namespace css = ::com::sun::star;
34cdf0e10cSrcweir 
AccessibilityOptTest()35cdf0e10cSrcweir AccessibilityOptTest::AccessibilityOptTest()
36cdf0e10cSrcweir {
37cdf0e10cSrcweir 	m_xCfg = css::uno::Reference< css::container::XNameAccess >(
38cdf0e10cSrcweir 		::comphelper::ConfigurationHelper::openConfig(
39cdf0e10cSrcweir 		::utl::getProcessServiceFactory(),
40cdf0e10cSrcweir 		s_sAccessibility,
41cdf0e10cSrcweir 		::comphelper::ConfigurationHelper::E_STANDARD),
42cdf0e10cSrcweir 		css::uno::UNO_QUERY);
43cdf0e10cSrcweir }
44cdf0e10cSrcweir 
~AccessibilityOptTest()45cdf0e10cSrcweir AccessibilityOptTest::~AccessibilityOptTest()
46cdf0e10cSrcweir {
47cdf0e10cSrcweir 	if (m_xCfg.is())
48cdf0e10cSrcweir 		m_xCfg.clear();
49cdf0e10cSrcweir }
50cdf0e10cSrcweir 
51cdf0e10cSrcweir //=============================================================================
52cdf0e10cSrcweir //test GetAutoDetectSystemHC()
impl_checkGetAutoDetectSystemHC()53cdf0e10cSrcweir void AccessibilityOptTest::impl_checkGetAutoDetectSystemHC()
54cdf0e10cSrcweir {
55cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY);
56cdf0e10cSrcweir 	sal_Bool bAutoDetectSystemHC;
57cdf0e10cSrcweir 	sal_Bool bAutoDetectSystemHC_;
58cdf0e10cSrcweir 
59cdf0e10cSrcweir 	bAutoDetectSystemHC  = aAccessibilityOpt.GetAutoDetectSystemHC();
60cdf0e10cSrcweir 	xSet->setPropertyValue( s_sAutoDetectSystemHC, css::uno::makeAny(bAutoDetectSystemHC ? sal_False:sal_True) );
61cdf0e10cSrcweir 	::comphelper::ConfigurationHelper::flush(m_xCfg);
62cdf0e10cSrcweir 	bAutoDetectSystemHC_ = aAccessibilityOpt.GetAutoDetectSystemHC();
63cdf0e10cSrcweir 
64cdf0e10cSrcweir 	if ( bAutoDetectSystemHC_ == bAutoDetectSystemHC )//old config item will not throw error
65cdf0e10cSrcweir 		throw css::uno::RuntimeException(
66cdf0e10cSrcweir 		::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetAutoDetectSystemHC() error!")),	0);
67cdf0e10cSrcweir }
68cdf0e10cSrcweir 
69cdf0e10cSrcweir //=============================================================================
70cdf0e10cSrcweir //test GetIsForPagePreviews()
impl_checkGetIsForPagePreviews()71cdf0e10cSrcweir void AccessibilityOptTest::impl_checkGetIsForPagePreviews()
72cdf0e10cSrcweir {
73cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY);
74cdf0e10cSrcweir 	sal_Bool bIsForPagePreviews ;
75cdf0e10cSrcweir 	sal_Bool bIsForPagePreviews_;
76cdf0e10cSrcweir 
77cdf0e10cSrcweir 	bIsForPagePreviews  = aAccessibilityOpt.GetIsForPagePreviews();
78cdf0e10cSrcweir 	xSet->setPropertyValue( s_sIsForPagePreviews, css::uno::makeAny(bIsForPagePreviews ? sal_False:sal_True) );
79cdf0e10cSrcweir 	::comphelper::ConfigurationHelper::flush(m_xCfg);
80cdf0e10cSrcweir 	bIsForPagePreviews_ = aAccessibilityOpt.GetIsForPagePreviews();
81cdf0e10cSrcweir 
82cdf0e10cSrcweir 	if ( bIsForPagePreviews_ == bIsForPagePreviews )//old config item will not throw error
83cdf0e10cSrcweir 		throw css::uno::RuntimeException(
84cdf0e10cSrcweir 		::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetIsForPagePreviews() error!")),	0);
85cdf0e10cSrcweir }
86cdf0e10cSrcweir 
87cdf0e10cSrcweir //=============================================================================
88cdf0e10cSrcweir //test impl_checkGetIsHelpTipsDisappear()
impl_checkGetIsHelpTipsDisappear()89cdf0e10cSrcweir void AccessibilityOptTest::impl_checkGetIsHelpTipsDisappear()
90cdf0e10cSrcweir {
91cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY);
92cdf0e10cSrcweir 	sal_Bool bIsHelpTipsDisappear ;
93cdf0e10cSrcweir 	sal_Bool bIsHelpTipsDisappear_;
94cdf0e10cSrcweir 
95cdf0e10cSrcweir 	bIsHelpTipsDisappear  = aAccessibilityOpt.GetIsHelpTipsDisappear();
96cdf0e10cSrcweir 	xSet->setPropertyValue( s_sIsHelpTipsDisappear, css::uno::makeAny(bIsHelpTipsDisappear ? sal_False:sal_True) );
97cdf0e10cSrcweir 	::comphelper::ConfigurationHelper::flush(m_xCfg);
98cdf0e10cSrcweir 	bIsHelpTipsDisappear_ = aAccessibilityOpt.GetIsHelpTipsDisappear();
99cdf0e10cSrcweir 
100cdf0e10cSrcweir 	if ( bIsHelpTipsDisappear_ == bIsHelpTipsDisappear )//old config item will not throw error
101cdf0e10cSrcweir 		throw css::uno::RuntimeException(
102cdf0e10cSrcweir 		::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetIsHelpTipsDisappear() error!")),	0);
103cdf0e10cSrcweir }
104cdf0e10cSrcweir 
105cdf0e10cSrcweir //=============================================================================
106cdf0e10cSrcweir //test impl_checkGetIsAllowAnimatedGraphics()
impl_checkGetIsAllowAnimatedGraphics()107cdf0e10cSrcweir void AccessibilityOptTest::impl_checkGetIsAllowAnimatedGraphics()
108cdf0e10cSrcweir {
109cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY);
110cdf0e10cSrcweir 	sal_Bool bIsAllowAnimatedGraphics ;
111cdf0e10cSrcweir 	sal_Bool bIsAllowAnimatedGraphics_;
112cdf0e10cSrcweir 
113cdf0e10cSrcweir 	bIsAllowAnimatedGraphics  = aAccessibilityOpt.GetIsAllowAnimatedGraphics();
114cdf0e10cSrcweir 	xSet->setPropertyValue( s_sIsAllowAnimatedGraphics, css::uno::makeAny(bIsAllowAnimatedGraphics ? sal_False:sal_True) );
115cdf0e10cSrcweir 	::comphelper::ConfigurationHelper::flush(m_xCfg);
116cdf0e10cSrcweir 	bIsAllowAnimatedGraphics_ = aAccessibilityOpt.GetIsAllowAnimatedGraphics();
117cdf0e10cSrcweir 
118cdf0e10cSrcweir 	if ( bIsAllowAnimatedGraphics_ == bIsAllowAnimatedGraphics )//old config item will not throw error
119cdf0e10cSrcweir 		throw css::uno::RuntimeException(
120cdf0e10cSrcweir 		::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetIsAllowAnimatedGraphics() error!")),	0);
121cdf0e10cSrcweir }
122cdf0e10cSrcweir 
123cdf0e10cSrcweir //=============================================================================
124cdf0e10cSrcweir //test impl_checkGetIsAllowAnimatedText()
impl_checkGetIsAllowAnimatedText()125cdf0e10cSrcweir void AccessibilityOptTest::impl_checkGetIsAllowAnimatedText()
126cdf0e10cSrcweir {
127cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY);
128cdf0e10cSrcweir 	sal_Bool bIsAllowAnimatedText ;
129cdf0e10cSrcweir 	sal_Bool bIsAllowAnimatedText_;
130cdf0e10cSrcweir 
131cdf0e10cSrcweir 	bIsAllowAnimatedText  = aAccessibilityOpt.GetIsAllowAnimatedText();
132cdf0e10cSrcweir 	xSet->setPropertyValue( s_sIsAllowAnimatedText, css::uno::makeAny(bIsAllowAnimatedText ? sal_False:sal_True) );
133cdf0e10cSrcweir 	::comphelper::ConfigurationHelper::flush(m_xCfg);
134cdf0e10cSrcweir 	bIsAllowAnimatedText_ = aAccessibilityOpt.GetIsAllowAnimatedText();
135cdf0e10cSrcweir 
136cdf0e10cSrcweir 	if ( bIsAllowAnimatedText_ == bIsAllowAnimatedText )//old config item will not throw error
137cdf0e10cSrcweir 		throw css::uno::RuntimeException(
138cdf0e10cSrcweir 		::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetIsAllowAnimatedText() error!")),	0);
139cdf0e10cSrcweir }
140cdf0e10cSrcweir 
141cdf0e10cSrcweir //=============================================================================
142cdf0e10cSrcweir //test impl_checkGetIsAutomaticFontColor()
impl_checkGetIsAutomaticFontColor()143cdf0e10cSrcweir void AccessibilityOptTest::impl_checkGetIsAutomaticFontColor()
144cdf0e10cSrcweir {
145cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY);
146cdf0e10cSrcweir 	sal_Bool bIsAutomaticFontColor ;
147cdf0e10cSrcweir 	sal_Bool bIsAutomaticFontColor_;
148cdf0e10cSrcweir 
149cdf0e10cSrcweir 	bIsAutomaticFontColor  = aAccessibilityOpt.GetIsAutomaticFontColor();
150cdf0e10cSrcweir 	xSet->setPropertyValue( s_sIsAutomaticFontColor, css::uno::makeAny(bIsAutomaticFontColor ? sal_False:sal_True) );
151cdf0e10cSrcweir 	::comphelper::ConfigurationHelper::flush(m_xCfg);
152cdf0e10cSrcweir 	bIsAutomaticFontColor_ = aAccessibilityOpt.GetIsAutomaticFontColor();
153cdf0e10cSrcweir 
154cdf0e10cSrcweir 	if ( bIsAutomaticFontColor_ == bIsAutomaticFontColor )//old config item will not throw error
155cdf0e10cSrcweir 		throw css::uno::RuntimeException(
156cdf0e10cSrcweir 		::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetIsAutomaticFontColor() error!")),	0);
157cdf0e10cSrcweir }
158cdf0e10cSrcweir 
159cdf0e10cSrcweir //=============================================================================
160cdf0e10cSrcweir //test impl_checkGetIsSystemFont()
impl_checkGetIsSystemFont()161cdf0e10cSrcweir void AccessibilityOptTest::impl_checkGetIsSystemFont()
162cdf0e10cSrcweir {
163cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY);
164cdf0e10cSrcweir 	sal_Bool bIsSystemFont ;
165cdf0e10cSrcweir 	sal_Bool bIsSystemFont_;
166cdf0e10cSrcweir 
167cdf0e10cSrcweir 	bIsSystemFont  = aAccessibilityOpt.GetIsSystemFont();
168cdf0e10cSrcweir 	xSet->setPropertyValue( s_sIsSystemFont, css::uno::makeAny(bIsSystemFont ? sal_False:sal_True) );
169cdf0e10cSrcweir 	::comphelper::ConfigurationHelper::flush(m_xCfg);
170cdf0e10cSrcweir 	bIsSystemFont_ = aAccessibilityOpt.GetIsSystemFont();
171cdf0e10cSrcweir 
172cdf0e10cSrcweir 	if ( bIsSystemFont_ == bIsSystemFont )//old config item will not throw error
173cdf0e10cSrcweir 		throw css::uno::RuntimeException(
174cdf0e10cSrcweir 		::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetIsSystemFont() error!")),	0);
175cdf0e10cSrcweir }
176cdf0e10cSrcweir 
177cdf0e10cSrcweir //=============================================================================
178cdf0e10cSrcweir //test impl_checkGetHelpTipSeconds()
impl_checkGetHelpTipSeconds()179cdf0e10cSrcweir void AccessibilityOptTest::impl_checkGetHelpTipSeconds()
180cdf0e10cSrcweir {
181cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY);
182cdf0e10cSrcweir 	sal_Int16 nHelpTipSeconds ;
183cdf0e10cSrcweir 	sal_Int16 nHelpTipSeconds_;
184cdf0e10cSrcweir 
185cdf0e10cSrcweir 	nHelpTipSeconds  = aAccessibilityOpt.GetHelpTipSeconds();
186cdf0e10cSrcweir 	xSet->setPropertyValue( s_sHelpTipSeconds, css::uno::makeAny(sal_Int16(nHelpTipSeconds+1)) );
187cdf0e10cSrcweir 	::comphelper::ConfigurationHelper::flush(m_xCfg);
188cdf0e10cSrcweir 	nHelpTipSeconds_ = aAccessibilityOpt.GetHelpTipSeconds();
189cdf0e10cSrcweir 
190cdf0e10cSrcweir 	if ( nHelpTipSeconds_ == nHelpTipSeconds )//old config item will not throw error
191cdf0e10cSrcweir 		throw css::uno::RuntimeException(
192cdf0e10cSrcweir 		::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetHelpTipSeconds() error!")),	0);
193cdf0e10cSrcweir }
194cdf0e10cSrcweir 
195cdf0e10cSrcweir //=============================================================================
196cdf0e10cSrcweir //test impl_checkIsSelectionInReadonly()
impl_checkIsSelectionInReadonly()197cdf0e10cSrcweir void AccessibilityOptTest::impl_checkIsSelectionInReadonly()
198cdf0e10cSrcweir {
199cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY);
200cdf0e10cSrcweir 	sal_Bool bIsSelectionInReadonly ;
201cdf0e10cSrcweir 	sal_Bool bIsSelectionInReadonly_;
202cdf0e10cSrcweir 
203cdf0e10cSrcweir 	bIsSelectionInReadonly  = aAccessibilityOpt.IsSelectionInReadonly();
204cdf0e10cSrcweir 	xSet->setPropertyValue( s_sIsSelectionInReadonly, css::uno::makeAny(bIsSelectionInReadonly ? sal_False:sal_True) );
205cdf0e10cSrcweir 	::comphelper::ConfigurationHelper::flush(m_xCfg);
206cdf0e10cSrcweir 	bIsSelectionInReadonly_ = aAccessibilityOpt.IsSelectionInReadonly();
207cdf0e10cSrcweir 
208cdf0e10cSrcweir 	if ( bIsSelectionInReadonly_ == bIsSelectionInReadonly )//old config item will not throw error
209cdf0e10cSrcweir 		throw css::uno::RuntimeException(
210cdf0e10cSrcweir 		::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsSelectionInReadonly() error!")),	0);
211cdf0e10cSrcweir }
212cdf0e10cSrcweir 
213cdf0e10cSrcweir //=============================================================================
214cdf0e10cSrcweir //test SetAutoDetectSystemHC()
impl_checkSetAutoDetectSystemHC()215cdf0e10cSrcweir void AccessibilityOptTest::impl_checkSetAutoDetectSystemHC()
216cdf0e10cSrcweir {
217cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY);
218cdf0e10cSrcweir 	sal_Bool bAutoDetectSystemHC;
219cdf0e10cSrcweir 	sal_Bool bAutoDetectSystemHC_;
220cdf0e10cSrcweir 
221cdf0e10cSrcweir 	xSet->getPropertyValue(s_sAutoDetectSystemHC) >>= bAutoDetectSystemHC;
222cdf0e10cSrcweir 	aAccessibilityOpt.SetAutoDetectSystemHC( bAutoDetectSystemHC ? sal_False:sal_True );
223cdf0e10cSrcweir 	xSet->getPropertyValue(s_sAutoDetectSystemHC) >>= bAutoDetectSystemHC_;
224cdf0e10cSrcweir 
225cdf0e10cSrcweir 	if ( bAutoDetectSystemHC_ == bAutoDetectSystemHC )//old config item will throw error
226cdf0e10cSrcweir 		throw css::uno::RuntimeException(
227cdf0e10cSrcweir 		::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetAutoDetectSystemHC() error!")),	0);
228cdf0e10cSrcweir }
229cdf0e10cSrcweir 
230cdf0e10cSrcweir //=============================================================================
231cdf0e10cSrcweir //test SetIsForPagePreviews()
impl_checkSetIsForPagePreviews()232cdf0e10cSrcweir void AccessibilityOptTest::impl_checkSetIsForPagePreviews()
233cdf0e10cSrcweir {
234cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY);
235cdf0e10cSrcweir 	sal_Bool bIsForPagePreviews ;
236cdf0e10cSrcweir 	sal_Bool bIsForPagePreviews_;
237cdf0e10cSrcweir 
238cdf0e10cSrcweir 	xSet->getPropertyValue(s_sIsForPagePreviews) >>= bIsForPagePreviews;
239cdf0e10cSrcweir 	aAccessibilityOpt.SetIsForPagePreviews( bIsForPagePreviews ? sal_False:sal_True );
240cdf0e10cSrcweir 	xSet->getPropertyValue(s_sIsForPagePreviews) >>= bIsForPagePreviews_;
241cdf0e10cSrcweir 
242cdf0e10cSrcweir 	if ( bIsForPagePreviews_ == bIsForPagePreviews )//old config item will throw error
243cdf0e10cSrcweir 		throw css::uno::RuntimeException(
244cdf0e10cSrcweir 		::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetIsForPagePreviews() error!")),	0);
245cdf0e10cSrcweir }
246cdf0e10cSrcweir 
247cdf0e10cSrcweir //=============================================================================
248cdf0e10cSrcweir //test impl_checkSetIsHelpTipsDisappear()
impl_checkSetIsHelpTipsDisappear()249cdf0e10cSrcweir void AccessibilityOptTest::impl_checkSetIsHelpTipsDisappear()
250cdf0e10cSrcweir {
251cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY);
252cdf0e10cSrcweir 	sal_Bool bIsHelpTipsDisappear ;
253cdf0e10cSrcweir 	sal_Bool bIsHelpTipsDisappear_;
254cdf0e10cSrcweir 
255cdf0e10cSrcweir 	xSet->getPropertyValue(s_sIsHelpTipsDisappear) >>= bIsHelpTipsDisappear;
256cdf0e10cSrcweir 	aAccessibilityOpt.SetIsHelpTipsDisappear( bIsHelpTipsDisappear ? sal_False:sal_True );
257cdf0e10cSrcweir 	xSet->getPropertyValue(s_sIsHelpTipsDisappear) >>= bIsHelpTipsDisappear_;
258cdf0e10cSrcweir 
259cdf0e10cSrcweir 	if ( bIsHelpTipsDisappear_ == bIsHelpTipsDisappear )//old config item will throw error
260cdf0e10cSrcweir 		throw css::uno::RuntimeException(
261cdf0e10cSrcweir 		::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetIsHelpTipsDisappear() error!")),	0);
262cdf0e10cSrcweir }
263cdf0e10cSrcweir 
264cdf0e10cSrcweir //=============================================================================
265cdf0e10cSrcweir //test impl_checkSetIsAllowAnimatedGraphics()
impl_checkSetIsAllowAnimatedGraphics()266cdf0e10cSrcweir void AccessibilityOptTest::impl_checkSetIsAllowAnimatedGraphics()
267cdf0e10cSrcweir {
268cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY);
269cdf0e10cSrcweir 	sal_Bool bIsAllowAnimatedGraphics ;
270cdf0e10cSrcweir 	sal_Bool bIsAllowAnimatedGraphics_;
271cdf0e10cSrcweir 
272cdf0e10cSrcweir 	xSet->getPropertyValue(s_sIsAllowAnimatedGraphics) >>= bIsAllowAnimatedGraphics;
273cdf0e10cSrcweir 	aAccessibilityOpt.SetIsAllowAnimatedGraphics( bIsAllowAnimatedGraphics ? sal_False:sal_True );
274cdf0e10cSrcweir 	xSet->getPropertyValue(s_sIsAllowAnimatedGraphics) >>= bIsAllowAnimatedGraphics_;
275cdf0e10cSrcweir 
276cdf0e10cSrcweir 	if ( bIsAllowAnimatedGraphics_ == bIsAllowAnimatedGraphics )//old config item will throw error
277cdf0e10cSrcweir 		throw css::uno::RuntimeException(
278cdf0e10cSrcweir 		::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetIsAllowAnimatedGraphics() error!")),	0);
279cdf0e10cSrcweir }
280cdf0e10cSrcweir 
281cdf0e10cSrcweir //=============================================================================
282cdf0e10cSrcweir //test impl_checkSetIsAllowAnimatedText()
impl_checkSetIsAllowAnimatedText()283cdf0e10cSrcweir void AccessibilityOptTest::impl_checkSetIsAllowAnimatedText()
284cdf0e10cSrcweir {
285cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY);
286cdf0e10cSrcweir 	sal_Bool bIsAllowAnimatedText ;
287cdf0e10cSrcweir 	sal_Bool bIsAllowAnimatedText_;
288cdf0e10cSrcweir 
289cdf0e10cSrcweir 	xSet->getPropertyValue(s_sIsAllowAnimatedText) >>= bIsAllowAnimatedText;
290cdf0e10cSrcweir 	aAccessibilityOpt.SetIsAllowAnimatedText( bIsAllowAnimatedText ? sal_False:sal_True );
291cdf0e10cSrcweir 	xSet->getPropertyValue(s_sIsAllowAnimatedText) >>= bIsAllowAnimatedText_;
292cdf0e10cSrcweir 
293cdf0e10cSrcweir 	if ( bIsAllowAnimatedText_ == bIsAllowAnimatedText )//old config item will throw error
294cdf0e10cSrcweir 		throw css::uno::RuntimeException(
295cdf0e10cSrcweir 		::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetIsAllowAnimatedText() error!")),	0);
296cdf0e10cSrcweir }
297cdf0e10cSrcweir 
298cdf0e10cSrcweir //=============================================================================
299cdf0e10cSrcweir //test impl_checkSetIsAutomaticFontColor()
impl_checkSetIsAutomaticFontColor()300cdf0e10cSrcweir void AccessibilityOptTest::impl_checkSetIsAutomaticFontColor()
301cdf0e10cSrcweir {
302cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY);
303cdf0e10cSrcweir 	sal_Bool bIsAutomaticFontColor ;
304cdf0e10cSrcweir 	sal_Bool bIsAutomaticFontColor_;
305cdf0e10cSrcweir 
306cdf0e10cSrcweir 	xSet->getPropertyValue(s_sIsAutomaticFontColor) >>= bIsAutomaticFontColor;
307cdf0e10cSrcweir 	aAccessibilityOpt.SetIsAutomaticFontColor( bIsAutomaticFontColor ? sal_False:sal_True );
308cdf0e10cSrcweir 	xSet->getPropertyValue(s_sIsAutomaticFontColor) >>= bIsAutomaticFontColor_;
309cdf0e10cSrcweir 
310cdf0e10cSrcweir 	if ( bIsAutomaticFontColor_ == bIsAutomaticFontColor )//old config item will throw error
311cdf0e10cSrcweir 		throw css::uno::RuntimeException(
312cdf0e10cSrcweir 		::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetIsAutomaticFontColor() error!")),	0);
313cdf0e10cSrcweir }
314cdf0e10cSrcweir 
315cdf0e10cSrcweir //=============================================================================
316cdf0e10cSrcweir //test impl_checkSetIsSystemFont()
impl_checkSetIsSystemFont()317cdf0e10cSrcweir void AccessibilityOptTest::impl_checkSetIsSystemFont()
318cdf0e10cSrcweir {
319cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY);
320cdf0e10cSrcweir 	sal_Bool bIsSystemFont ;
321cdf0e10cSrcweir 	sal_Bool bIsSystemFont_;
322cdf0e10cSrcweir 
323cdf0e10cSrcweir 	xSet->getPropertyValue(s_sIsSystemFont) >>= bIsSystemFont;
324cdf0e10cSrcweir 	aAccessibilityOpt.SetIsSystemFont( bIsSystemFont ? sal_False:sal_True );
325cdf0e10cSrcweir 	xSet->getPropertyValue(s_sIsSystemFont) >>= bIsSystemFont_;
326cdf0e10cSrcweir 
327cdf0e10cSrcweir 	if ( bIsSystemFont_ == bIsSystemFont )//old config item will throw error
328cdf0e10cSrcweir 		throw css::uno::RuntimeException(
329cdf0e10cSrcweir 		::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetIsSystemFont() error!")),	0);
330cdf0e10cSrcweir }
331cdf0e10cSrcweir 
332cdf0e10cSrcweir //=============================================================================
333cdf0e10cSrcweir //test impl_checkSetHelpTipSeconds()
impl_checkSetHelpTipSeconds()334cdf0e10cSrcweir void AccessibilityOptTest::impl_checkSetHelpTipSeconds()
335cdf0e10cSrcweir {
336cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY);
337cdf0e10cSrcweir 	sal_Int16 nHelpTipSeconds ;
338cdf0e10cSrcweir 	sal_Int16 nHelpTipSeconds_;
339cdf0e10cSrcweir 
340cdf0e10cSrcweir 	xSet->getPropertyValue(s_sHelpTipSeconds) >>= nHelpTipSeconds;
341cdf0e10cSrcweir 	aAccessibilityOpt.SetHelpTipSeconds( sal_Int16(nHelpTipSeconds+1) );
342cdf0e10cSrcweir 	xSet->getPropertyValue(s_sHelpTipSeconds) >>= nHelpTipSeconds_;
343cdf0e10cSrcweir 
344cdf0e10cSrcweir 	if ( nHelpTipSeconds_ == nHelpTipSeconds )//old config item will throw error
345cdf0e10cSrcweir 		throw css::uno::RuntimeException(
346cdf0e10cSrcweir 		::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetHelpTipSeconds() error!")),	0);
347cdf0e10cSrcweir }
348cdf0e10cSrcweir 
349cdf0e10cSrcweir //=============================================================================
350cdf0e10cSrcweir //test impl_checkSetSelectionInReadonly()
impl_checkSetSelectionInReadonly()351cdf0e10cSrcweir void AccessibilityOptTest::impl_checkSetSelectionInReadonly()
352cdf0e10cSrcweir {
353cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY);
354cdf0e10cSrcweir 	sal_Bool bIsSelectionInReadonly ;
355cdf0e10cSrcweir 	sal_Bool bIsSelectionInReadonly_;
356cdf0e10cSrcweir 
357cdf0e10cSrcweir 	xSet->getPropertyValue(s_sIsSelectionInReadonly) >>= bIsSelectionInReadonly;
358cdf0e10cSrcweir 	aAccessibilityOpt.SetSelectionInReadonly( bIsSelectionInReadonly ? sal_False:sal_True );
359cdf0e10cSrcweir 	xSet->getPropertyValue(s_sIsSelectionInReadonly) >>= bIsSelectionInReadonly_;
360cdf0e10cSrcweir 
361cdf0e10cSrcweir 	if ( bIsSelectionInReadonly_ == bIsSelectionInReadonly )//old config item will throw error
362cdf0e10cSrcweir 		throw css::uno::RuntimeException(
363cdf0e10cSrcweir 		::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetSelectionInReadonly() error!")),	0);
364cdf0e10cSrcweir }
365cdf0e10cSrcweir 
366cdf0e10cSrcweir //=============================================================================
impl_checkAccessibilityOptions()367cdf0e10cSrcweir void AccessibilityOptTest::impl_checkAccessibilityOptions()
368cdf0e10cSrcweir {
369cdf0e10cSrcweir 	impl_checkGetAutoDetectSystemHC();
370cdf0e10cSrcweir 	impl_checkGetIsForPagePreviews();
371cdf0e10cSrcweir 	impl_checkGetIsHelpTipsDisappear();
372cdf0e10cSrcweir 	impl_checkGetIsAllowAnimatedGraphics();
373cdf0e10cSrcweir 	impl_checkGetIsAllowAnimatedText();
374cdf0e10cSrcweir 	impl_checkGetIsAutomaticFontColor();
375cdf0e10cSrcweir 	impl_checkGetIsSystemFont();
376cdf0e10cSrcweir 	impl_checkGetHelpTipSeconds();
377cdf0e10cSrcweir 	impl_checkIsSelectionInReadonly();
378cdf0e10cSrcweir 
379cdf0e10cSrcweir 	impl_checkSetAutoDetectSystemHC();
380cdf0e10cSrcweir 	impl_checkSetIsForPagePreviews();
381cdf0e10cSrcweir 	impl_checkSetIsHelpTipsDisappear();
382cdf0e10cSrcweir 	impl_checkSetIsAllowAnimatedGraphics();
383cdf0e10cSrcweir 	impl_checkSetIsAllowAnimatedText();
384cdf0e10cSrcweir 	impl_checkSetIsAutomaticFontColor();
385cdf0e10cSrcweir 	impl_checkSetIsSystemFont();
386cdf0e10cSrcweir 	impl_checkSetHelpTipSeconds();
387cdf0e10cSrcweir 	impl_checkSetSelectionInReadonly();
388cdf0e10cSrcweir }
389