Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
5 : : * This Source Code Form is subject to the terms of the Mozilla Public
6 : : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
11 : : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : : * contributor license agreements. See the NOTICE file distributed
13 : : * with this work for additional information regarding copyright
14 : : * ownership. The ASF licenses this file to you under the Apache
15 : : * License, Version 2.0 (the "License"); you may not use this file
16 : : * except in compliance with the License. You may obtain a copy of
17 : : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : : */
19 : :
20 : : #include <com/sun/star/uno/Reference.hxx>
21 : : #include <com/sun/star/frame/XDesktop.hpp>
22 : : #include <com/sun/star/util/XURLTransformer.hpp>
23 : : #include <com/sun/star/beans/PropertyValue.hpp>
24 : : #include <com/sun/star/beans/XPropertySet.hpp>
25 : : #include <com/sun/star/util/XFlushable.hpp>
26 : :
27 : : #include <stdlib.h>
28 : : #include <vcl/msgbox.hxx>
29 : : #include <tools/string.hxx>
30 : : #include <svl/itempool.hxx>
31 : : #include <svl/aeitem.hxx>
32 : : #include <svl/slstitm.hxx>
33 : : #include <svl/stritem.hxx>
34 : : #include <svl/intitem.hxx>
35 : : #include <svl/eitem.hxx>
36 : : #include <svl/szitem.hxx>
37 : : #include <svl/undo.hxx>
38 : :
39 : : #include <sfx2/sfxsids.hrc>
40 : : #include <sot/exchange.hxx>
41 : :
42 : : #include <svl/isethint.hxx>
43 : :
44 : : #include <officecfg/Inet.hxx>
45 : : #include <officecfg/Office/Common.hxx>
46 : : #include <unotools/configmgr.hxx>
47 : : #include <tools/urlobj.hxx>
48 : : #include <unotools/saveopt.hxx>
49 : : #include <svtools/helpopt.hxx>
50 : : #include <unotools/securityoptions.hxx>
51 : : #include <unotools/pathoptions.hxx>
52 : : #include <svtools/miscopt.hxx>
53 : : #include <vcl/toolbox.hxx>
54 : : #include <unotools/localfilehelper.hxx>
55 : : #include <rtl/strbuf.hxx>
56 : : #include <rtl/ustrbuf.hxx>
57 : :
58 : : #include <sfx2/app.hxx>
59 : : #include <sfx2/docfile.hxx>
60 : : #include <sfx2/viewfrm.hxx>
61 : : #include "sfx2/sfxhelp.hxx"
62 : : #include "sfxtypes.hxx"
63 : : #include <sfx2/dispatch.hxx>
64 : : #include <sfx2/objsh.hxx>
65 : : #include "objshimp.hxx"
66 : : #include <sfx2/viewsh.hxx>
67 : : #include <sfx2/request.hxx>
68 : : #include <sfx2/evntconf.hxx>
69 : : #include "appdata.hxx"
70 : : #include "workwin.hxx"
71 : : #include "helper.hxx" // SfxContentHelper::...
72 : : #include "app.hrc"
73 : : #include "sfx2/sfxresid.hxx"
74 : : #include "shutdownicon.hxx"
75 : :
76 : : using namespace ::com::sun::star::uno;
77 : : using namespace ::com::sun::star::util;
78 : : using namespace ::com::sun::star::frame;
79 : : using namespace ::com::sun::star::beans;
80 : :
81 : : //-------------------------------------------------------------------------
82 : :
83 : : class SfxEventAsyncer_Impl : public SfxListener
84 : : {
85 : : SfxEventHint aHint;
86 : : Timer* pTimer;
87 : :
88 : : public:
89 : :
90 : : virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
91 : : SfxEventAsyncer_Impl( const SfxEventHint& rHint );
92 : : ~SfxEventAsyncer_Impl();
93 : : DECL_LINK( TimerHdl, Timer*);
94 : : };
95 : :
96 : : // -----------------------------------------------------------------------
97 : :
98 : 12274 : void SfxEventAsyncer_Impl::Notify( SfxBroadcaster&, const SfxHint& rHint )
99 : : {
100 [ + - ][ + + ]: 12274 : SfxSimpleHint* pHint = PTR_CAST( SfxSimpleHint, &rHint );
101 [ + + ][ + + ]: 12274 : if( pHint && pHint->GetId() == SFX_HINT_DYING && pTimer->IsActive() )
[ + - ][ + + ]
102 : : {
103 : 465 : pTimer->Stop();
104 [ + - ]: 465 : delete this;
105 : : }
106 : 12274 : }
107 : :
108 : : // -----------------------------------------------------------------------
109 : :
110 : 2473 : SfxEventAsyncer_Impl::SfxEventAsyncer_Impl( const SfxEventHint& rHint )
111 [ + - ]: 2473 : : aHint( rHint )
112 : : {
113 [ + - ]: 2473 : if( rHint.GetObjShell() )
114 [ + - ]: 2473 : StartListening( *rHint.GetObjShell() );
115 [ + - ][ + - ]: 2473 : pTimer = new Timer;
116 [ + - ]: 2473 : pTimer->SetTimeoutHdl( LINK(this, SfxEventAsyncer_Impl, TimerHdl) );
117 [ + - ]: 2473 : pTimer->SetTimeout( 0 );
118 [ + - ]: 2473 : pTimer->Start();
119 : 2473 : }
120 : :
121 : : // -----------------------------------------------------------------------
122 : :
123 [ + - ]: 2469 : SfxEventAsyncer_Impl::~SfxEventAsyncer_Impl()
124 : : {
125 [ + - ][ + - ]: 2469 : delete pTimer;
126 [ - + ]: 4938 : }
127 : :
128 : : // -----------------------------------------------------------------------
129 : :
130 : 2004 : IMPL_LINK(SfxEventAsyncer_Impl, TimerHdl, Timer*, pAsyncTimer)
131 : : {
132 : : (void)pAsyncTimer; // unused variable
133 : 2004 : SfxObjectShellRef xRef( aHint.GetObjShell() );
134 [ + - ]: 2004 : pAsyncTimer->Stop();
135 : : #ifdef DBG_UTIL
136 : : if (!xRef.Is())
137 : : {
138 : : rtl::OStringBuffer aTmp(RTL_CONSTASCII_STRINGPARAM("SfxEvent: "));
139 : : aTmp.append(rtl::OUStringToOString(aHint.GetEventName(), RTL_TEXTENCODING_UTF8));
140 : : OSL_TRACE( "%s", aTmp.getStr() );
141 : : }
142 : : #endif
143 [ + - ][ + - ]: 2004 : SFX_APP()->Broadcast( aHint );
144 [ + - ]: 2004 : if ( xRef.Is() )
145 [ + - ]: 2004 : xRef->Broadcast( aHint );
146 [ + - ][ + - ]: 2004 : delete this;
147 [ + - ]: 2004 : return 0L;
148 : : }
149 : :
150 : :
151 : : //--------------------------------------------------------------------
152 : :
153 : 0 : sal_Bool SfxApplication::GetOptions( SfxItemSet& rSet )
154 : : {
155 : 0 : sal_Bool bRet = sal_False;
156 : 0 : SfxItemPool &rPool = GetPool();
157 : :
158 : 0 : const sal_uInt16 *pRanges = rSet.GetRanges();
159 [ # # ]: 0 : SvtSaveOptions aSaveOptions;
160 [ # # ]: 0 : SvtHelpOptions aHelpOptions;
161 [ # # ]: 0 : SvtSecurityOptions aSecurityOptions;
162 [ # # ]: 0 : SvtMiscOptions aMiscOptions;
163 : :
164 [ # # ]: 0 : while ( *pRanges )
165 : : {
166 [ # # ]: 0 : for(sal_uInt16 nWhich = *pRanges++; nWhich <= *pRanges; ++nWhich)
167 : : {
168 [ # # # # : 0 : switch(nWhich)
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# ]
169 : : {
170 : : case SID_ATTR_BUTTON_OUTSTYLE3D :
171 [ # # ][ # # ]: 0 : if(rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_BUTTON_OUTSTYLE3D ),
172 [ # # ][ # # ]: 0 : aMiscOptions.GetToolboxStyle() != TOOLBOX_STYLE_FLAT)))
[ # # ][ # # ]
173 : 0 : bRet = sal_True;
174 : 0 : break;
175 : : case SID_ATTR_BUTTON_BIGSIZE :
176 : : {
177 [ # # ][ # # ]: 0 : if( rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_BUTTON_BIGSIZE ), aMiscOptions.AreCurrentSymbolsLarge() ) ) )
[ # # ][ # # ]
[ # # ][ # # ]
178 : 0 : bRet = sal_True;
179 : 0 : break;
180 : : }
181 : : case SID_ATTR_BACKUP :
182 : : {
183 : 0 : bRet = sal_True;
184 [ # # ][ # # ]: 0 : if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_BACKUP))
185 [ # # ][ # # ]: 0 : if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_BACKUP ),aSaveOptions.IsBackup())))
[ # # ][ # # ]
[ # # ][ # # ]
186 : 0 : bRet = sal_False;
187 : : }
188 : 0 : break;
189 : : case SID_ATTR_PRETTYPRINTING:
190 : : {
191 : 0 : bRet = sal_True;
192 [ # # ][ # # ]: 0 : if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_DOPRETTYPRINTING))
193 [ # # ][ # # ]: 0 : if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_PRETTYPRINTING ), aSaveOptions.IsPrettyPrinting())))
[ # # ][ # # ]
[ # # ][ # # ]
194 : 0 : bRet = sal_False;
195 : : }
196 : 0 : break;
197 : : case SID_ATTR_WARNALIENFORMAT:
198 : : {
199 : 0 : bRet = sal_True;
200 [ # # ][ # # ]: 0 : if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_WARNALIENFORMAT))
201 [ # # ][ # # ]: 0 : if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_WARNALIENFORMAT ), aSaveOptions.IsWarnAlienFormat())))
[ # # ][ # # ]
[ # # ][ # # ]
202 : 0 : bRet = sal_False;
203 : : }
204 : 0 : break;
205 : : case SID_ATTR_AUTOSAVE :
206 : : {
207 : 0 : bRet = sal_True;
208 [ # # ][ # # ]: 0 : if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_AUTOSAVE))
209 [ # # ][ # # ]: 0 : if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_AUTOSAVE ), aSaveOptions.IsAutoSave())))
[ # # ][ # # ]
[ # # ][ # # ]
210 : 0 : bRet = sal_False;
211 : : }
212 : 0 : break;
213 : : case SID_ATTR_AUTOSAVEPROMPT :
214 : : {
215 : 0 : bRet = sal_True;
216 [ # # ][ # # ]: 0 : if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_AUTOSAVEPROMPT))
217 [ # # ][ # # ]: 0 : if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_AUTOSAVEPROMPT ), aSaveOptions.IsAutoSavePrompt())))
[ # # ][ # # ]
[ # # ][ # # ]
218 : 0 : bRet = sal_False;
219 : : }
220 : 0 : break;
221 : : case SID_ATTR_AUTOSAVEMINUTE :
222 : : {
223 : 0 : bRet = sal_True;
224 [ # # ][ # # ]: 0 : if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_AUTOSAVETIME))
225 [ # # ][ # # ]: 0 : if (!rSet.Put( SfxUInt16Item( rPool.GetWhich( SID_ATTR_AUTOSAVEMINUTE ), (sal_uInt16)aSaveOptions.GetAutoSaveTime())))
[ # # ][ # # ]
[ # # ][ # # ]
226 : 0 : bRet = sal_False;
227 : : }
228 : 0 : break;
229 : : case SID_ATTR_DOCINFO :
230 : : {
231 : 0 : bRet = sal_True;
232 [ # # ][ # # ]: 0 : if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_DOCINFSAVE))
233 [ # # ][ # # ]: 0 : if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_DOCINFO ), aSaveOptions.IsDocInfoSave())))
[ # # ][ # # ]
[ # # ][ # # ]
234 : 0 : bRet = sal_False;
235 : : }
236 : 0 : break;
237 : : case SID_ATTR_WORKINGSET :
238 : : {
239 : 0 : bRet = sal_True;
240 [ # # ][ # # ]: 0 : if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_SAVEWORKINGSET))
241 [ # # ][ # # ]: 0 : if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_WORKINGSET ), aSaveOptions.IsSaveWorkingSet())))
[ # # ][ # # ]
[ # # ][ # # ]
242 : 0 : bRet = sal_False;
243 : : }
244 : 0 : break;
245 : : case SID_ATTR_SAVEDOCVIEW :
246 : : {
247 : 0 : bRet = sal_True;
248 [ # # ][ # # ]: 0 : if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_SAVEDOCVIEW))
249 [ # # ][ # # ]: 0 : if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_SAVEDOCVIEW ), aSaveOptions.IsSaveDocView())))
[ # # ][ # # ]
[ # # ][ # # ]
250 : 0 : bRet = sal_False;
251 : : }
252 : 0 : break;
253 : : case SID_ATTR_METRIC :
254 : 0 : break;
255 : : case SID_HELPBALLOONS :
256 [ # # ][ # # ]: 0 : if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_HELPBALLOONS ),
257 [ # # ][ # # ]: 0 : aHelpOptions.IsExtendedHelp() ) ) )
[ # # ][ # # ]
258 : 0 : bRet = sal_True;
259 : 0 : break;
260 : : case SID_HELPTIPS :
261 [ # # ][ # # ]: 0 : if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_HELPTIPS ),
262 [ # # ][ # # ]: 0 : aHelpOptions.IsHelpTips() ) ) )
[ # # ][ # # ]
263 : 0 : bRet = sal_True;
264 : 0 : break;
265 : : case SID_ATTR_AUTOHELPAGENT :
266 [ # # ][ # # ]: 0 : if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_ATTR_AUTOHELPAGENT ),
267 [ # # ][ # # ]: 0 : aHelpOptions.IsHelpAgentAutoStartMode() ) ) )
[ # # ][ # # ]
268 : 0 : bRet = sal_True;
269 : 0 : break;
270 : : case SID_HELPAGENT_TIMEOUT :
271 [ # # ][ # # ]: 0 : if ( rSet.Put( SfxInt32Item( rPool.GetWhich( SID_HELPAGENT_TIMEOUT ),
272 [ # # ][ # # ]: 0 : aHelpOptions.GetHelpAgentTimeoutPeriod() ) ) )
[ # # ][ # # ]
273 : 0 : bRet = sal_True;
274 : 0 : break;
275 : : case SID_ATTR_WELCOMESCREEN :
276 [ # # ][ # # ]: 0 : if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_ATTR_WELCOMESCREEN ),
277 [ # # ][ # # ]: 0 : aHelpOptions.IsWelcomeScreen() ) ) )
[ # # ][ # # ]
278 : 0 : bRet = sal_True;
279 : 0 : break;
280 : : case SID_HELP_STYLESHEET :
281 [ # # ][ # # ]: 0 : if(rSet.Put( SfxStringItem ( rPool.GetWhich( SID_HELP_STYLESHEET ),
282 [ # # ][ # # ]: 0 : aHelpOptions.GetHelpStyleSheet() ) ) )
[ # # ][ # # ]
283 : 0 : bRet = sal_True;
284 : 0 : break;
285 : : case SID_ATTR_UNDO_COUNT :
286 [ # # ]: 0 : if (rSet.Put(
287 : : SfxUInt16Item (
288 [ # # ]: 0 : rPool.GetWhich(SID_ATTR_UNDO_COUNT),
289 [ # # ][ # # ]: 0 : officecfg::Office::Common::Undo::Steps::get())))
[ # # ]
290 : : {
291 : 0 : bRet = true;
292 : : }
293 : 0 : break;
294 : : case SID_ATTR_QUICKLAUNCHER :
295 : : {
296 [ # # ][ # # ]: 0 : if ( ShutdownIcon::IsQuickstarterInstalled() )
297 : : {
298 [ # # ][ # # ]: 0 : if ( rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_QUICKLAUNCHER ),
299 [ # # ][ # # ]: 0 : ShutdownIcon::GetAutostart() ) ) )
[ # # ][ # # ]
300 : 0 : bRet = sal_True;
301 : : }
302 : : else
303 : : {
304 [ # # ][ # # ]: 0 : rSet.DisableItem( rPool.GetWhich( SID_ATTR_QUICKLAUNCHER ) );
305 : 0 : bRet = sal_True;
306 : : }
307 : 0 : break;
308 : : }
309 : : case SID_SAVEREL_INET :
310 : : {
311 : 0 : bRet = sal_True;
312 [ # # ][ # # ]: 0 : if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_SAVERELINET))
313 [ # # ][ # # ]: 0 : if (!rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_SAVEREL_INET ), aSaveOptions.IsSaveRelINet() )))
[ # # ][ # # ]
[ # # ][ # # ]
314 : 0 : bRet = sal_False;
315 : : }
316 : 0 : break;
317 : : case SID_SAVEREL_FSYS :
318 : : {
319 : 0 : bRet = sal_True;
320 [ # # ][ # # ]: 0 : if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_SAVERELFSYS))
321 [ # # ][ # # ]: 0 : if (!rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_SAVEREL_FSYS ), aSaveOptions.IsSaveRelFSys() )))
[ # # ][ # # ]
[ # # ][ # # ]
322 : 0 : bRet = sal_False;
323 : : }
324 : 0 : break;
325 : : case SID_BASIC_ENABLED :
326 : : {
327 : 0 : bRet = sal_True;
328 [ # # ][ # # ]: 0 : if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::E_BASICMODE))
329 : : {
330 [ # # ][ # # ]: 0 : if ( !rSet.Put( SfxUInt16Item( rPool.GetWhich( SID_BASIC_ENABLED ), sal::static_int_cast< sal_uInt16 >(aSecurityOptions.GetBasicMode()))))
[ # # ][ # # ]
[ # # ][ # # ]
331 : 0 : bRet = sal_False;
332 : : }
333 : : }
334 : 0 : break;
335 : : case SID_INET_EXE_PLUGIN :
336 : : {
337 : 0 : bRet = sal_True;
338 [ # # ][ # # ]: 0 : if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::E_EXECUTEPLUGINS))
339 : : {
340 [ # # ][ # # ]: 0 : if ( !rSet.Put( SfxBoolItem( SID_INET_EXE_PLUGIN, aSecurityOptions.IsExecutePlugins() ) ) )
[ # # ][ # # ]
[ # # ]
341 : 0 : bRet = sal_False;
342 : : }
343 : : }
344 : 0 : break;
345 : : case SID_MACRO_WARNING :
346 : : {
347 : 0 : bRet = sal_True;
348 [ # # ][ # # ]: 0 : if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::E_WARNING))
349 : : {
350 [ # # ][ # # ]: 0 : if ( !rSet.Put( SfxBoolItem( SID_MACRO_WARNING, aSecurityOptions.IsWarningEnabled() ) ) )
[ # # ][ # # ]
[ # # ]
351 : 0 : bRet = sal_False;
352 : : }
353 : : }
354 : 0 : break;
355 : : case SID_MACRO_CONFIRMATION :
356 : : {
357 : 0 : bRet = sal_True;
358 [ # # ][ # # ]: 0 : if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::E_CONFIRMATION))
359 : : {
360 [ # # ][ # # ]: 0 : if ( !rSet.Put( SfxBoolItem( SID_MACRO_CONFIRMATION, aSecurityOptions.IsConfirmationEnabled() ) ) )
[ # # ][ # # ]
[ # # ]
361 : 0 : bRet = sal_False;
362 : : }
363 : : }
364 : 0 : break;
365 : : case SID_SECURE_URL :
366 : : {
367 : 0 : bRet = sal_True;
368 [ # # ][ # # ]: 0 : if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::E_SECUREURLS))
369 : : {
370 [ # # ]: 0 : ::com::sun::star::uno::Sequence< ::rtl::OUString > seqURLs = aSecurityOptions.GetSecureURLs();
371 [ # # ]: 0 : std::vector<String> aList;
372 : 0 : sal_uInt32 nCount = seqURLs.getLength();
373 : : sal_uInt32 nURL;
374 [ # # ]: 0 : for( nURL=0; nURL<nCount; ++nURL )
375 [ # # ][ # # ]: 0 : aList.push_back(seqURLs[nURL]);
[ # # ][ # # ]
376 : :
377 [ # # ][ # # ]: 0 : if( !rSet.Put( SfxStringListItem( rPool.GetWhich(SID_SECURE_URL), &aList ) ) )
[ # # ][ # # ]
[ # # ]
378 [ # # ]: 0 : bRet = sal_False;
379 : : }
380 : : }
381 : 0 : break;
382 : : case SID_INET_PROXY_TYPE :
383 [ # # ]: 0 : if (rSet.Put(
384 : : SfxUInt16Item(
385 [ # # ]: 0 : rPool.GetWhich(SID_INET_PROXY_TYPE),
386 : : (officecfg::Inet::Settings::ooInetProxyType::
387 [ # # ][ # # ]: 0 : get().get_value_or(0)))))
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
388 : : {
389 : 0 : bRet = true;
390 : : }
391 : 0 : break;
392 : : case SID_INET_HTTP_PROXY_NAME :
393 [ # # ]: 0 : if (rSet.Put(
394 : : SfxStringItem(
395 [ # # ]: 0 : rPool.GetWhich(SID_INET_HTTP_PROXY_NAME),
396 : : officecfg::Inet::Settings::ooInetHTTPProxyName::
397 [ # # ][ # # ]: 0 : get())))
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
398 : : {
399 : 0 : bRet = true;
400 : : }
401 : 0 : break;
402 : : case SID_INET_HTTP_PROXY_PORT :
403 [ # # ]: 0 : if (rSet.Put(
404 : : SfxInt32Item(
405 [ # # ]: 0 : rPool.GetWhich(SID_INET_HTTP_PROXY_PORT),
406 : : (officecfg::Inet::Settings::
407 [ # # ][ # # ]: 0 : ooInetHTTPProxyPort::get().get_value_or(0)))))
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
408 : : {
409 : 0 : bRet = true;
410 : : }
411 : 0 : break;
412 : : case SID_INET_FTP_PROXY_NAME :
413 [ # # ]: 0 : if (rSet.Put(
414 : : SfxStringItem(
415 [ # # ]: 0 : rPool.GetWhich(SID_INET_FTP_PROXY_NAME),
416 : : officecfg::Inet::Settings::ooInetFTPProxyName::
417 [ # # ][ # # ]: 0 : get())))
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
418 : : {
419 : 0 : bRet = true;
420 : : }
421 : 0 : break;
422 : : case SID_INET_FTP_PROXY_PORT :
423 [ # # ]: 0 : if (rSet.Put(
424 : : SfxInt32Item(
425 [ # # ]: 0 : rPool.GetWhich(SID_INET_FTP_PROXY_PORT),
426 : : (officecfg::Inet::Settings::ooInetFTPProxyPort::
427 [ # # ][ # # ]: 0 : get().get_value_or(0)))))
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
428 : : {
429 : 0 : bRet = true;
430 : : }
431 : 0 : break;
432 : : case SID_INET_NOPROXY :
433 [ # # ]: 0 : if (rSet.Put(
434 : : SfxStringItem(
435 [ # # ]: 0 : rPool.GetWhich( SID_INET_NOPROXY),
436 : : (officecfg::Inet::Settings::ooInetNoProxy::
437 [ # # ][ # # ]: 0 : get()))))
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
438 : : {
439 : 0 : bRet = true;
440 : : }
441 : 0 : break;
442 : : case SID_ATTR_PATHNAME :
443 : : case SID_ATTR_PATHGROUP :
444 : : {
445 [ # # ][ # # ]: 0 : SfxAllEnumItem aNames(rPool.GetWhich(SID_ATTR_PATHGROUP));
446 [ # # ][ # # ]: 0 : SfxAllEnumItem aValues(rPool.GetWhich(SID_ATTR_PATHNAME));
447 [ # # ]: 0 : SvtPathOptions aPathCfg;
448 [ # # ]: 0 : for ( sal_uInt16 nProp = SvtPathOptions::PATH_ADDIN;
449 : : nProp <= SvtPathOptions::PATH_WORK; nProp++ )
450 : : {
451 [ # # ][ # # ]: 0 : aNames.InsertValue( nProp, SfxResId(CONFIG_PATH_START + nProp).toString() );
[ # # ]
452 : 0 : rtl::OUString aValue;
453 [ # # # # : 0 : switch ( nProp )
# # # # #
# # # # #
# # # # #
# # # # ]
454 : : {
455 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_ADDIN: ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aPathCfg.GetAddinPath(), aValue ); break;
[ # # ]
456 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_AUTOCORRECT: aValue = aPathCfg.GetAutoCorrectPath(); break;
457 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_AUTOTEXT: aValue = aPathCfg.GetAutoTextPath(); break;
458 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_BACKUP: aValue = aPathCfg.GetBackupPath(); break;
459 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_BASIC: aValue = aPathCfg.GetBasicPath(); break;
460 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_BITMAP: aValue = aPathCfg.GetBitmapPath(); break;
461 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_CONFIG: aValue = aPathCfg.GetConfigPath(); break;
462 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_DICTIONARY: aValue = aPathCfg.GetDictionaryPath(); break;
463 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_FAVORITES: aValue = aPathCfg.GetFavoritesPath(); break;
464 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_FILTER: ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aPathCfg.GetFilterPath(), aValue ); break;
[ # # ]
465 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_GALLERY: aValue = aPathCfg.GetGalleryPath(); break;
466 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_GRAPHIC: aValue = aPathCfg.GetGraphicPath(); break;
467 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_HELP: ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aPathCfg.GetHelpPath(), aValue ); break;
[ # # ]
468 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_LINGUISTIC: aValue = aPathCfg.GetLinguisticPath(); break;
469 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_MODULE: ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aPathCfg.GetModulePath(), aValue ); break;
[ # # ]
470 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_PALETTE: aValue = aPathCfg.GetPalettePath(); break;
471 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_PLUGIN: ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aPathCfg.GetPluginPath(), aValue ); break;
[ # # ]
472 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_STORAGE: ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aPathCfg.GetStoragePath(), aValue ); break;
[ # # ]
473 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_TEMP: aValue = aPathCfg.GetTempPath(); break;
474 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_TEMPLATE: aValue = aPathCfg.GetTemplatePath(); break;
475 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_USERCONFIG: aValue = aPathCfg.GetUserConfigPath(); break;
476 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_WORK: aValue = aPathCfg.GetWorkPath(); break;
477 : : }
478 [ # # ]: 0 : aValues.InsertValue( nProp, aValue );
479 : 0 : }
480 : :
481 [ # # ][ # # ]: 0 : if ( rSet.Put(aNames) || rSet.Put(aValues) )
[ # # ][ # # ]
[ # # ]
482 [ # # ][ # # ]: 0 : bRet = sal_True;
[ # # ]
483 : : }
484 : :
485 : : default:
486 : : DBG_WARNING( "W1:Wrong ID while getting Options!" );
487 : 0 : break;
488 : : }
489 : : #ifdef DBG_UTIL
490 : : if ( !bRet )
491 : : OSL_FAIL( "Putting options failed!" );
492 : : #endif
493 : : }
494 : 0 : pRanges++;
495 : : }
496 : :
497 [ # # ][ # # ]: 0 : return bRet;
[ # # ][ # # ]
498 : : }
499 : :
500 : : //--------------------------------------------------------------------
501 : 0 : sal_Bool SfxApplication::IsSecureURL( const INetURLObject& rURL, const String* pReferer ) const
502 : : {
503 [ # # ][ # # ]: 0 : return SvtSecurityOptions().IsSecureURL( rURL.GetMainURL( INetURLObject::NO_DECODE ), *pReferer );
[ # # ][ # # ]
504 : : }
505 : : //--------------------------------------------------------------------
506 : : // TODO/CLEANUP: Why two SetOptions Methods?
507 : 0 : void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
508 : : {
509 : 0 : const SfxPoolItem *pItem = 0;
510 : 0 : SfxItemPool &rPool = GetPool();
511 : :
512 [ # # ]: 0 : SvtSaveOptions aSaveOptions;
513 [ # # ]: 0 : SvtHelpOptions aHelpOptions;
514 [ # # ]: 0 : SvtSecurityOptions aSecurityOptions;
515 [ # # ]: 0 : SvtPathOptions aPathOptions;
516 [ # # ]: 0 : SvtMiscOptions aMiscOptions;
517 : : boost::shared_ptr< comphelper::ConfigurationChanges > batch(
518 [ # # ][ # # ]: 0 : comphelper::ConfigurationChanges::create());
519 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BUTTON_OUTSTYLE3D), sal_True, &pItem) )
[ # # ]
520 : : {
521 : : DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
522 : : sal_uInt16 nOutStyle =
523 [ # # ]: 0 : ( (const SfxBoolItem *)pItem)->GetValue() ? 0 : TOOLBOX_STYLE_FLAT;
524 [ # # ]: 0 : aMiscOptions.SetToolboxStyle( nOutStyle );
525 : : }
526 : :
527 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BUTTON_BIGSIZE), sal_True, &pItem) )
[ # # ]
528 : : {
529 : : DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
530 : 0 : sal_Bool bBigSize = ( (const SfxBoolItem*)pItem )->GetValue();
531 : : aMiscOptions.SetSymbolsSize(
532 : : sal::static_int_cast< sal_Int16 >(
533 [ # # ][ # # ]: 0 : bBigSize ? SFX_SYMBOLS_SIZE_LARGE : SFX_SYMBOLS_SIZE_SMALL ) );
534 [ # # ]: 0 : SfxViewFrame* pCurrViewFrame = SfxViewFrame::GetFirst();
535 [ # # ]: 0 : while ( pCurrViewFrame )
536 : : {
537 : : // update all "final" dispatchers
538 [ # # ][ # # ]: 0 : if ( !pCurrViewFrame->GetActiveChildFrame_Impl() )
539 [ # # ]: 0 : pCurrViewFrame->GetDispatcher()->Update_Impl(sal_True);
540 [ # # ]: 0 : pCurrViewFrame = SfxViewFrame::GetNext(*pCurrViewFrame);
541 : : }
542 : : }
543 : :
544 : : // Backup
545 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BACKUP), sal_True, &pItem) )
[ # # ]
546 : : {
547 : : DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
548 [ # # ]: 0 : aSaveOptions.SetBackup( ( (const SfxBoolItem*)pItem )->GetValue() );
549 : : }
550 : :
551 : : // PrettyPrinting
552 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_ATTR_PRETTYPRINTING ), sal_True, &pItem ) )
[ # # ]
553 : : {
554 : : DBG_ASSERT( pItem->ISA( SfxBoolItem ), "BoolItem expected" );
555 [ # # ]: 0 : aSaveOptions.SetPrettyPrinting( static_cast< const SfxBoolItem*> ( pItem )->GetValue() );
556 : : }
557 : :
558 : : // WarnAlienFormat
559 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_ATTR_WARNALIENFORMAT ), sal_True, &pItem ) )
[ # # ]
560 : : {
561 : : DBG_ASSERT( pItem->ISA( SfxBoolItem ), "BoolItem expected" );
562 [ # # ]: 0 : aSaveOptions.SetWarnAlienFormat( static_cast< const SfxBoolItem*> ( pItem )->GetValue() );
563 : : }
564 : :
565 : : // AutoSave
566 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVE), sal_True, &pItem))
[ # # ]
567 : : {
568 : : DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
569 [ # # ]: 0 : aSaveOptions.SetAutoSave( ( (const SfxBoolItem*)pItem )->GetValue() );
570 : : }
571 : :
572 : : // AutoSave-Propt
573 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVEPROMPT), sal_True, &pItem))
[ # # ]
574 : : {
575 : : DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
576 [ # # ]: 0 : aSaveOptions.SetAutoSavePrompt(((const SfxBoolItem *)pItem)->GetValue());
577 : : }
578 : :
579 : : // AutoSave-Time
580 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVEMINUTE), sal_True, &pItem))
[ # # ]
581 : : {
582 : : DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected");
583 [ # # ]: 0 : aSaveOptions.SetAutoSaveTime(((const SfxUInt16Item *)pItem)->GetValue());
584 : : }
585 : :
586 : : // DocInfo
587 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_DOCINFO), sal_True, &pItem))
[ # # ]
588 : : {
589 : : DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
590 [ # # ]: 0 : aSaveOptions.SetDocInfoSave(((const SfxBoolItem *)pItem)->GetValue());
591 : : }
592 : :
593 : : // Mark open Documents
594 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_WORKINGSET), sal_True, &pItem))
[ # # ]
595 : : {
596 : : DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
597 [ # # ]: 0 : aSaveOptions.SetSaveWorkingSet(((const SfxBoolItem *)pItem)->GetValue());
598 : : }
599 : :
600 : : // Save window settings
601 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_SAVEDOCVIEW), sal_True, &pItem))
[ # # ]
602 : : {
603 : : DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
604 [ # # ]: 0 : aSaveOptions.SetSaveDocView(((const SfxBoolItem *)pItem)->GetValue());
605 : : }
606 : :
607 : : // Metric
608 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_METRIC), sal_True, &pItem))
609 : : {
610 : : DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected");
611 : : }
612 : :
613 : : // HelpBalloons
614 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_HELPBALLOONS), sal_True, &pItem))
[ # # ]
615 : : {
616 : : DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
617 [ # # ]: 0 : aHelpOptions.SetExtendedHelp(((const SfxBoolItem *)pItem)->GetValue());
618 : : }
619 : :
620 : : // HelpTips
621 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_HELPTIPS), sal_True, &pItem))
[ # # ]
622 : : {
623 : : DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
624 [ # # ]: 0 : aHelpOptions.SetHelpTips(((const SfxBoolItem *)pItem)->GetValue());
625 : : }
626 : :
627 : : // AutoHelpAgent
628 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOHELPAGENT ), sal_True, &pItem))
[ # # ]
629 : : {
630 : : DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
631 [ # # ]: 0 : aHelpOptions.SetHelpAgentAutoStartMode( ((const SfxBoolItem *)pItem)->GetValue() );
632 : : }
633 : :
634 : : // help agent timeout
635 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_HELPAGENT_TIMEOUT ), sal_True, &pItem ) )
[ # # ]
636 : : {
637 : : DBG_ASSERT(pItem->ISA(SfxInt32Item), "Int32Item expected");
638 [ # # ]: 0 : aHelpOptions.SetHelpAgentTimeoutPeriod( ( (const SfxInt32Item*)pItem )->GetValue() );
639 : : }
640 : :
641 : : // WelcomeScreen
642 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_WELCOMESCREEN ), sal_True, &pItem))
[ # # ]
643 : : {
644 : : DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
645 [ # # ]: 0 : aHelpOptions.SetWelcomeScreen( ((const SfxBoolItem *)pItem)->GetValue() );
646 : : }
647 : :
648 : : // WelcomeScreen
649 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_WELCOMESCREEN_RESET ), sal_True, &pItem))
[ # # ]
650 : : {
651 : : DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
652 : 0 : sal_Bool bReset = ((const SfxBoolItem *)pItem)->GetValue();
653 : : if ( bReset )
654 : : {
655 : : OSL_FAIL( "Not implemented, may be EOL!" );
656 : : } }
657 : :
658 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_HELP_STYLESHEET ), sal_True, &pItem))
[ # # ]
659 : : {
660 : : DBG_ASSERT(pItem->ISA(SfxStringItem), "StringItem expected");
661 [ # # ]: 0 : aHelpOptions.SetHelpStyleSheet( ((const SfxStringItem *)pItem)->GetValue() );
662 : : }
663 : :
664 : : // SaveRelINet
665 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_SAVEREL_INET), sal_True, &pItem))
[ # # ]
666 : : {
667 : : DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
668 [ # # ]: 0 : aSaveOptions.SetSaveRelINet(((const SfxBoolItem *)pItem)->GetValue());
669 : : }
670 : :
671 : : // SaveRelFSys
672 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_SAVEREL_FSYS), sal_True, &pItem))
[ # # ]
673 : : {
674 : : DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
675 [ # # ]: 0 : aSaveOptions.SetSaveRelFSys(((const SfxBoolItem *)pItem)->GetValue());
676 : : }
677 : :
678 : : // Undo-Count
679 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_UNDO_COUNT), sal_True, &pItem))
[ # # ]
680 : : {
681 : : DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected");
682 : 0 : sal_uInt16 nUndoCount = ((const SfxUInt16Item*)pItem)->GetValue();
683 [ # # ]: 0 : officecfg::Office::Common::Undo::Steps::set(nUndoCount, batch);
684 : :
685 : : // To catch all Undo-Managers: Iterate over all Frames
686 [ # # ][ # # ]: 0 : for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst();
[ # # ]
687 : : pFrame;
688 : : pFrame = SfxViewFrame::GetNext(*pFrame) )
689 : : {
690 : : // Get the Dispatcher of the Frames
691 : 0 : SfxDispatcher *pDispat = pFrame->GetDispatcher();
692 [ # # ]: 0 : pDispat->Flush();
693 : :
694 : : // Iterate over all SfxShells on the Dispatchers Stack
695 : 0 : sal_uInt16 nIdx = 0;
696 [ # # ][ # # ]: 0 : for ( SfxShell *pSh = pDispat->GetShell(nIdx);
[ # # ]
697 : : pSh;
698 : 0 : ++nIdx, pSh = pDispat->GetShell(nIdx) )
699 : : {
700 [ # # ]: 0 : ::svl::IUndoManager *pShUndoMgr = pSh->GetUndoManager();
701 [ # # ]: 0 : if ( pShUndoMgr )
702 [ # # ]: 0 : pShUndoMgr->SetMaxUndoActionCount( nUndoCount );
703 : : }
704 : : }
705 : : }
706 : :
707 : : // Office autostart
708 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_QUICKLAUNCHER), sal_True, &pItem))
[ # # ]
709 : : {
710 : : DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
711 [ # # ]: 0 : ShutdownIcon::SetAutostart( ( (const SfxBoolItem*)pItem )->GetValue() != sal_False );
712 : : }
713 : :
714 : : // StarBasic Enable
715 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(SID_BASIC_ENABLED, sal_True, &pItem))
716 : : {
717 : : DBG_ASSERT(pItem->ISA(SfxUInt16Item), "SfxInt16Item expected");
718 [ # # ]: 0 : aSecurityOptions.SetBasicMode( (EBasicSecurityMode)( (const SfxUInt16Item*)pItem )->GetValue() );
719 : : }
720 : :
721 : : // Execute PlugIns
722 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(SID_INET_EXE_PLUGIN, sal_True, &pItem))
723 : : {
724 : : DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected");
725 [ # # ]: 0 : aSecurityOptions.SetExecutePlugins( ( (const SfxBoolItem *)pItem )->GetValue() );
726 : : }
727 : :
728 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_PROXY_TYPE), sal_True, &pItem))
[ # # ]
729 : : {
730 : : DBG_ASSERT( pItem->ISA(SfxUInt16Item), "UInt16Item expected" );
731 : : officecfg::Inet::Settings::ooInetProxyType::set(
732 [ # # ]: 0 : static_cast< SfxUInt16Item const * >(pItem)->GetValue(), batch);
733 : : }
734 : :
735 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_HTTP_PROXY_NAME ), sal_True, &pItem ) )
[ # # ]
736 : : {
737 : : DBG_ASSERT( pItem->ISA(SfxStringItem), "StringItem expected" );
738 : : officecfg::Inet::Settings::ooInetHTTPProxyName::set(
739 [ # # ]: 0 : static_cast< SfxStringItem const * >(pItem)->GetValue(), batch);
740 : : }
741 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_HTTP_PROXY_PORT ), sal_True, &pItem ) )
[ # # ]
742 : : {
743 : : DBG_ASSERT( pItem->ISA(SfxInt32Item), "Int32Item expected" );
744 : : officecfg::Inet::Settings::ooInetHTTPProxyPort::set(
745 [ # # ]: 0 : static_cast< SfxInt32Item const * >(pItem)->GetValue(), batch);
746 : : }
747 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_FTP_PROXY_NAME ), sal_True, &pItem ) )
[ # # ]
748 : : {
749 : : DBG_ASSERT( pItem->ISA(SfxStringItem), "StringItem expected" );
750 : : officecfg::Inet::Settings::ooInetFTPProxyName::set(
751 [ # # ]: 0 : static_cast< SfxStringItem const * >(pItem)->GetValue(), batch);
752 : : }
753 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_FTP_PROXY_PORT ), sal_True, &pItem ) )
[ # # ]
754 : : {
755 : : DBG_ASSERT( pItem->ISA(SfxInt32Item), "Int32Item expected" );
756 : : officecfg::Inet::Settings::ooInetFTPProxyPort::set(
757 [ # # ]: 0 : static_cast< SfxInt32Item const * >(pItem)->GetValue(), batch);
758 : : }
759 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(SID_INET_NOPROXY, sal_True, &pItem))
760 : : {
761 : : DBG_ASSERT(pItem->ISA(SfxStringItem), "StringItem expected");
762 : : officecfg::Inet::Settings::ooInetNoProxy::set(
763 [ # # ]: 0 : static_cast< SfxStringItem const * >(pItem)->GetValue(), batch);
764 : : }
765 : :
766 : : // Secure-Referers
767 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(SID_SECURE_URL, sal_True, &pItem))
768 : : {
769 : : DBG_ASSERT(pItem->ISA(SfxStringListItem), "StringListItem expected");
770 [ # # ]: 0 : const std::vector<String> &aList = ((SfxStringListItem*)pItem)->GetList();
771 : 0 : sal_uInt32 nCount = aList.size();
772 [ # # ]: 0 : ::com::sun::star::uno::Sequence< ::rtl::OUString > seqURLs(nCount);
773 [ # # ]: 0 : for( sal_uInt32 nPosition=0;nPosition<nCount;++nPosition)
774 [ # # ][ # # ]: 0 : seqURLs[nPosition] = aList[nPosition];
[ # # ]
775 : :
776 [ # # ][ # # ]: 0 : aSecurityOptions.SetSecureURLs( seqURLs );
777 : : }
778 : :
779 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(SID_MACRO_WARNING, sal_True, &pItem))
780 : : {
781 : : DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected");
782 [ # # ]: 0 : aSecurityOptions.SetWarningEnabled( ( (const SfxBoolItem *)pItem )->GetValue() );
783 : : }
784 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(SID_MACRO_CONFIRMATION, sal_True, &pItem))
785 : : {
786 : : DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected");
787 [ # # ]: 0 : aSecurityOptions.SetConfirmationEnabled( ( (const SfxBoolItem *)pItem )->GetValue() );
788 : : }
789 : :
790 : : // Store changed data
791 [ # # ][ # # ]: 0 : batch->commit();
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
792 : 0 : }
793 : :
794 : : //--------------------------------------------------------------------
795 : 0 : void SfxApplication::SetOptions(const SfxItemSet &rSet)
796 : : {
797 [ # # ]: 0 : SvtPathOptions aPathOptions;
798 : :
799 : : // Data is saved in DocInfo and IniManager
800 : 0 : const SfxPoolItem *pItem = 0;
801 : 0 : SfxItemPool &rPool = GetPool();
802 : :
803 [ # # ]: 0 : SfxAllItemSet aSendSet( rSet );
804 : :
805 : : // PathName
806 [ # # ][ # # ]: 0 : if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_PATHNAME), sal_True, &pItem))
[ # # ]
807 : : {
808 : : DBG_ASSERT(pItem->ISA(SfxAllEnumItem), "AllEnumItem expected");
809 : 0 : const SfxAllEnumItem* pEnumItem = (const SfxAllEnumItem *)pItem;
810 [ # # ]: 0 : sal_uInt32 nCount = pEnumItem->GetValueCount();
811 : 0 : rtl::OUString aNoChangeStr( ' ' );
812 [ # # ]: 0 : for( sal_uInt32 nPath=0; nPath<nCount; ++nPath )
813 : : {
814 [ # # ]: 0 : rtl::OUString sValue = pEnumItem->GetValueTextByPos((sal_uInt16)nPath);
815 [ # # ]: 0 : if ( sValue != aNoChangeStr )
816 : : {
817 [ # # # # : 0 : switch( nPath )
# # # # #
# # # # #
# # # # #
# # # # ]
818 : : {
819 : : case SvtPathOptions::PATH_ADDIN:
820 : : {
821 : 0 : rtl::OUString aTmp;
822 [ # # ][ # # ]: 0 : if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) )
823 [ # # ][ # # ]: 0 : aPathOptions.SetAddinPath( aTmp );
[ # # ]
824 : 0 : break;
825 : : }
826 : :
827 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_AUTOCORRECT: aPathOptions.SetAutoCorrectPath( sValue );break;
[ # # ]
828 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_AUTOTEXT: aPathOptions.SetAutoTextPath( sValue );break;
[ # # ]
829 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_BACKUP: aPathOptions.SetBackupPath( sValue );break;
[ # # ]
830 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_BASIC: aPathOptions.SetBasicPath( sValue );break;
[ # # ]
831 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_BITMAP: aPathOptions.SetBitmapPath( sValue );break;
[ # # ]
832 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_CONFIG: aPathOptions.SetConfigPath( sValue );break;
[ # # ]
833 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_DICTIONARY: aPathOptions.SetDictionaryPath( sValue );break;
[ # # ]
834 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_FAVORITES: aPathOptions.SetFavoritesPath( sValue );break;
[ # # ]
835 : : case SvtPathOptions::PATH_FILTER:
836 : : {
837 : 0 : rtl::OUString aTmp;
838 [ # # ][ # # ]: 0 : if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) )
839 [ # # ][ # # ]: 0 : aPathOptions.SetFilterPath( aTmp );
[ # # ]
840 : 0 : break;
841 : : }
842 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_GALLERY: aPathOptions.SetGalleryPath( sValue );break;
[ # # ]
843 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_GRAPHIC: aPathOptions.SetGraphicPath( sValue );break;
[ # # ]
844 : : case SvtPathOptions::PATH_HELP:
845 : : {
846 : 0 : rtl::OUString aTmp;
847 [ # # ][ # # ]: 0 : if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) )
848 [ # # ][ # # ]: 0 : aPathOptions.SetHelpPath( aTmp );
[ # # ]
849 : 0 : break;
850 : : }
851 : :
852 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_LINGUISTIC: aPathOptions.SetLinguisticPath( sValue );break;
[ # # ]
853 : : case SvtPathOptions::PATH_MODULE:
854 : : {
855 : 0 : rtl::OUString aTmp;
856 [ # # ][ # # ]: 0 : if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) )
857 [ # # ][ # # ]: 0 : aPathOptions.SetModulePath( aTmp );
[ # # ]
858 : 0 : break;
859 : : }
860 : :
861 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_PALETTE: aPathOptions.SetPalettePath( sValue );break;
[ # # ]
862 : : case SvtPathOptions::PATH_PLUGIN:
863 : : {
864 : 0 : rtl::OUString aTmp;
865 [ # # ][ # # ]: 0 : if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) )
866 [ # # ][ # # ]: 0 : aPathOptions.SetPluginPath( aTmp );
[ # # ]
867 : 0 : break;
868 : : }
869 : :
870 : : case SvtPathOptions::PATH_STORAGE:
871 : : {
872 : 0 : rtl::OUString aTmp;
873 [ # # ][ # # ]: 0 : if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) )
874 [ # # ][ # # ]: 0 : aPathOptions.SetStoragePath( aTmp );
[ # # ]
875 : 0 : break;
876 : : }
877 : :
878 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_TEMP: aPathOptions.SetTempPath( sValue );break;
[ # # ]
879 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_TEMPLATE: aPathOptions.SetTemplatePath( sValue );break;
[ # # ]
880 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_USERCONFIG: aPathOptions.SetUserConfigPath( sValue );break;
[ # # ]
881 [ # # ][ # # ]: 0 : case SvtPathOptions::PATH_WORK: aPathOptions.SetWorkPath( sValue );break;
[ # # ]
882 : : default: SAL_WARN( "sfx2.appl", "SfxApplication::SetOptions_Impl() Invalid path number found for set directories!" );
883 : : }
884 : : }
885 : 0 : }
886 : :
887 [ # # ][ # # ]: 0 : aSendSet.ClearItem( rPool.GetWhich( SID_ATTR_PATHNAME ) );
888 : : }
889 : :
890 [ # # ]: 0 : SetOptions_Impl( rSet );
891 : :
892 : : // Undo-Count
893 [ # # ][ # # ]: 0 : Broadcast( SfxItemSetHint( rSet ) );
[ # # ][ # # ]
[ # # ]
894 : 0 : }
895 : :
896 : : //--------------------------------------------------------------------
897 : 26102 : void SfxApplication::NotifyEvent( const SfxEventHint& rEventHint, bool bSynchron )
898 : : {
899 : 26102 : SfxObjectShell *pDoc = rEventHint.GetObjShell();
900 [ + - ][ + + ]: 26102 : if ( pDoc && ( pDoc->IsPreview() || !pDoc->Get_Impl()->bInitialized ) )
[ + + ][ + - ]
901 : 26102 : return;
902 : :
903 [ + + ]: 21206 : if ( bSynchron )
904 : : {
905 : : #ifdef DBG_UTIL
906 : : if (!pDoc)
907 : : {
908 : : rtl::OStringBuffer aTmp(RTL_CONSTASCII_STRINGPARAM("SfxEvent: "));
909 : : aTmp.append(rtl::OUStringToOString(rEventHint.GetEventName(), RTL_TEXTENCODING_UTF8));
910 : : OSL_TRACE( "%s", aTmp.getStr() );
911 : : }
912 : : #endif
913 : 18733 : Broadcast(rEventHint);
914 [ + - ]: 18733 : if ( pDoc )
915 : 18733 : pDoc->Broadcast( rEventHint );
916 : : }
917 : : else
918 [ + - ]: 2473 : new SfxEventAsyncer_Impl( rEventHint );
919 : : }
920 : :
921 [ + - ][ - + ]: 39441 : IMPL_OBJHINT( SfxStringHint, String )
[ + - ][ + + ]
[ + + ]
922 : :
923 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|