LibreOffice Module cui (master) 1
optsave.cxx
Go to the documentation of this file.
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 <sal/config.h>
21
22#include <string_view>
23
24#include <o3tl/string_view.hxx>
25#include <svl/eitem.hxx>
26#include <svl/intitem.hxx>
27#include "optsave.hxx"
28#include <treeopt.hxx>
29#include <officecfg/Office/Common.hxx>
32#include <unotools/saveopt.hxx>
34#include <com/sun/star/lang/XMultiServiceFactory.hpp>
35#include <com/sun/star/container/XNameContainer.hpp>
36#include <com/sun/star/container/XContainerQuery.hpp>
37#include <com/sun/star/container/XEnumeration.hpp>
38#include <com/sun/star/beans/PropertyValue.hpp>
39#include <sfx2/sfxsids.hrc>
40#include <sfx2/docfilt.hxx>
43#include <osl/diagnose.h>
45#include <officecfg/Office/Recovery.hxx>
46
47#include <sfx2/fcontnr.hxx>
48
49using namespace com::sun::star::uno;
50using namespace com::sun::star::util;
51using namespace com::sun::star::lang;
52using namespace com::sun::star::beans;
53using namespace com::sun::star::container;
54using namespace comphelper;
55
56#define CFG_PAGE_AND_GROUP u"General", u"LoadSave"
57
58
60{
62 std::vector< OUString > aFilterArr[APP_COUNT];
63 std::vector< bool > aODFArr[APP_COUNT];
64 std::vector< OUString > aUIFilterArr[APP_COUNT];
68
70};
71
73{
74}
75
76// class SvxSaveTabPage --------------------------------------------------
77
79 : SfxTabPage( pPage, pController, "cui/ui/optsavepage.ui", "OptSavePage", &rCoreSet )
80 , pImpl(new SvxSaveTabPage_Impl)
81 , m_xLoadUserSettingsCB(m_xBuilder->weld_check_button("load_settings"))
82 , m_xLoadDocPrinterCB(m_xBuilder->weld_check_button("load_docprinter"))
83 , m_xDocInfoCB(m_xBuilder->weld_check_button("docinfo"))
84 , m_xBackupCB(m_xBuilder->weld_check_button("backup"))
85 , m_xAutoSaveCB(m_xBuilder->weld_check_button("autosave"))
86 , m_xAutoSaveEdit(m_xBuilder->weld_spin_button("autosave_spin"))
87 , m_xMinuteFT(m_xBuilder->weld_label("autosave_mins"))
88 , m_xUserAutoSaveCB(m_xBuilder->weld_check_button("userautosave"))
89 , m_xRelativeFsysCB(m_xBuilder->weld_check_button("relative_fsys"))
90 , m_xRelativeInetCB(m_xBuilder->weld_check_button("relative_inet"))
91 , m_xODFVersionLB(m_xBuilder->weld_combo_box("odfversion"))
92 , m_xWarnAlienFormatCB(m_xBuilder->weld_check_button("warnalienformat"))
93 , m_xDocTypeLB(m_xBuilder->weld_combo_box("doctype"))
94 , m_xSaveAsFT(m_xBuilder->weld_label("saveas_label"))
95 , m_xSaveAsLB(m_xBuilder->weld_combo_box("saveas"))
96 , m_xODFWarningFI(m_xBuilder->weld_widget("odfwarning_image"))
97 , m_xODFWarningFT(m_xBuilder->weld_label("odfwarning_label"))
98{
99 m_xAutoSaveEdit->set_max_length(2);
100
101 m_xODFVersionLB->set_id(0, OUString::number(SvtSaveOptions::ODFVER_011)); // 1.0/1.1
102 m_xODFVersionLB->set_id(1, OUString::number(SvtSaveOptions::ODFVER_012)); // 1.2
103 m_xODFVersionLB->set_id(2, OUString::number(SvtSaveOptions::ODFVER_012_EXT_COMPAT)); // 1.2 Extended (compatibility mode)
104 m_xODFVersionLB->set_id(3, OUString::number(SvtSaveOptions::ODFVER_012_EXTENDED)); // 1.2 Extended
105 m_xODFVersionLB->set_id(4, OUString::number(SvtSaveOptions::ODFVER_013)); // 1.3
106 m_xODFVersionLB->set_id(5, OUString::number(SvtSaveOptions::ODFVER_LATEST)); // 1.3 Extended (recommended)
107
108 m_xDocTypeLB->set_id(0, OUString::number(APP_WRITER) );
109 m_xDocTypeLB->set_id(1, OUString::number(APP_WRITER_WEB) );
110 m_xDocTypeLB->set_id(2, OUString::number(APP_WRITER_GLOBAL));
111 m_xDocTypeLB->set_id(3, OUString::number(APP_CALC) );
112 m_xDocTypeLB->set_id(4, OUString::number(APP_IMPRESS) );
113 m_xDocTypeLB->set_id(5, OUString::number(APP_DRAW) );
114 m_xDocTypeLB->set_id(6, OUString::number(APP_MATH) );
115
116 m_xAutoSaveCB->connect_toggled( LINK( this, SvxSaveTabPage, AutoClickHdl_Impl ) );
117
118 SvtModuleOptions aModuleOpt;
120 {
121 m_xSaveAsLB->remove_id(OUString::number(APP_MATH));
122 m_xDocTypeLB->remove_id(OUString::number(APP_MATH));
123 }
124 else
125 {
128 }
129
131 {
132 m_xSaveAsLB->remove_id(OUString::number(APP_DRAW));
133 m_xDocTypeLB->remove_id(OUString::number(APP_DRAW));
134 }
135 else
136 {
139 }
140
142 {
143 m_xSaveAsLB->remove_id(OUString::number(APP_IMPRESS));
144 m_xDocTypeLB->remove_id(OUString::number(APP_IMPRESS));
145 }
146 else
147 {
150 }
151
153 {
154 m_xSaveAsLB->remove_id(OUString::number(APP_CALC));
155 m_xDocTypeLB->remove_id(OUString::number(APP_CALC));
156 }
157 else
158 {
161 }
162
164 {
165 m_xSaveAsLB->remove_id(OUString::number(APP_WRITER));
166 m_xSaveAsLB->remove_id(OUString::number(APP_WRITER_WEB));
167 m_xSaveAsLB->remove_id(OUString::number(APP_WRITER_GLOBAL));
168 m_xDocTypeLB->remove_id(OUString::number(APP_WRITER));
169 m_xDocTypeLB->remove_id(OUString::number(APP_WRITER_WEB));
170 m_xDocTypeLB->remove_id(OUString::number(APP_WRITER_GLOBAL));
171 }
172 else
173 {
180 }
181
182 Link<weld::ComboBox&,void> aLink = LINK( this, SvxSaveTabPage, ODFVersionHdl_Impl );
183 m_xODFVersionLB->connect_changed( aLink );
184 aLink = LINK( this, SvxSaveTabPage, FilterHdl_Impl );
185 m_xDocTypeLB->connect_changed( aLink );
186 m_xSaveAsLB->connect_changed( aLink );
187
189}
190
192{
193}
194
195std::unique_ptr<SfxTabPage> SvxSaveTabPage::Create(weld::Container* pPage, weld::DialogController* pController,
196 const SfxItemSet* rAttrSet)
197{
198 return std::make_unique<SvxSaveTabPage>(pPage, pController, *rAttrSet);
199}
200
202{
203 SvtOptionsDialogOptions aOptionsDlgOpt;
204
205 if ( aOptionsDlgOpt.IsOptionHidden( u"Backup", CFG_PAGE_AND_GROUP ) )
206 {
207 // hide controls of "Backup"
208 m_xBackupCB->hide();
209 }
210
211 if ( aOptionsDlgOpt.IsOptionHidden( u"AutoSave", CFG_PAGE_AND_GROUP ) )
212 {
213 // hide controls of "AutoSave"
214 m_xAutoSaveCB->hide();
215 m_xAutoSaveEdit->hide();
216 m_xMinuteFT->hide();
217 }
218
219 if ( aOptionsDlgOpt.IsOptionHidden( u"UserAutoSave", CFG_PAGE_AND_GROUP ) )
220 {
221 // hide controls of "UserAutoSave"
222 m_xUserAutoSaveCB->hide();
223 }
224
225}
226
228{
230 bool bModified = false, bRequestRestart = false;
231 if(m_xLoadUserSettingsCB->get_state_changed_from_saved())
232 officecfg::Office::Common::Load::UserDefinedSettings::set(m_xLoadUserSettingsCB->get_active(), xChanges);
233
234 if ( m_xLoadDocPrinterCB->get_state_changed_from_saved() )
235 officecfg::Office::Common::Save::Document::LoadPrinter::set(m_xLoadDocPrinterCB->get_active(), xChanges);
236
237 if ( m_xODFVersionLB->get_value_changed_from_saved() )
238 {
239 sal_Int32 nVersion = m_xODFVersionLB->get_active_id().toInt32();
241 }
242
243 if ( m_xDocInfoCB->get_state_changed_from_saved() )
244 {
245 rSet->Put( SfxBoolItem( SID_ATTR_DOCINFO,
246 m_xDocInfoCB->get_active() ) );
247 bModified = true;
248 }
249
250 if ( m_xBackupCB->get_sensitive() && m_xBackupCB->get_state_changed_from_saved() )
251 {
252 rSet->Put( SfxBoolItem( SID_ATTR_BACKUP, m_xBackupCB->get_active() ) );
253 bModified = true;
254 }
255
256 if ( m_xAutoSaveCB->get_state_changed_from_saved() )
257 {
258 rSet->Put( SfxBoolItem( SID_ATTR_AUTOSAVE,
259 m_xAutoSaveCB->get_active() ) );
260 bModified = bRequestRestart = true;
261 }
262 if ( m_xWarnAlienFormatCB->get_state_changed_from_saved() )
263 {
264 rSet->Put( SfxBoolItem( SID_ATTR_WARNALIENFORMAT,
265 m_xWarnAlienFormatCB->get_active() ) );
266 bModified = true;
267 }
268
269 if ( m_xAutoSaveEdit->get_value_changed_from_saved() )
270 {
271 rSet->Put( SfxUInt16Item( SID_ATTR_AUTOSAVEMINUTE,
272 static_cast<sal_uInt16>(m_xAutoSaveEdit->get_value()) ) );
273 bModified = bRequestRestart = true;
274 }
275
276 if ( m_xUserAutoSaveCB->get_state_changed_from_saved() )
277 {
278 rSet->Put( SfxBoolItem( SID_ATTR_USERAUTOSAVE,
279 m_xUserAutoSaveCB->get_active() ) );
280 bModified = true;
281 }
282 // save relatively
283 if ( m_xRelativeFsysCB->get_state_changed_from_saved() )
284 {
285 rSet->Put( SfxBoolItem( SID_SAVEREL_FSYS,
286 m_xRelativeFsysCB->get_active() ) );
287 bModified = true;
288 }
289
290 if ( m_xRelativeInetCB->get_state_changed_from_saved() )
291 {
292 rSet->Put( SfxBoolItem( SID_SAVEREL_INET,
293 m_xRelativeInetCB->get_active() ) );
294 bModified = true;
295 }
296
297 SvtModuleOptions aModuleOpt;
298 if(!pImpl->aDefaultArr[APP_MATH].isEmpty() &&
301
302 if( !pImpl->aDefaultArr[APP_DRAW].isEmpty() &&
305
306 if(!pImpl->aDefaultArr[APP_IMPRESS].isEmpty() &&
309
310 if(!pImpl->aDefaultArr[APP_CALC].isEmpty() &&
313
314 if(!pImpl->aDefaultArr[APP_WRITER].isEmpty() &&
317
318 if(!pImpl->aDefaultArr[APP_WRITER_WEB].isEmpty() &&
321
322 if(!pImpl->aDefaultArr[APP_WRITER_GLOBAL].isEmpty() &&
325
326 xChanges->commit();
327
328 if (bRequestRestart)
329 {
331 if (pParentDlg)
333 }
334
335 return bModified;
336}
337
338static bool isODFFormat( std::u16string_view sFilter )
339{
340 static const char* aODFFormats[] =
341 {
342 "writer8",
343 "writer8_template",
344 "writerglobal8",
345 "writerglobal8_writer",
346 "calc8",
347 "calc8_template",
348 "draw8",
349 "draw8_template",
350 "impress8",
351 "impress8_template",
352 "impress8_draw",
353 "chart8",
354 "math8",
355 nullptr
356 };
357
358 bool bRet = false;
359 int i = 0;
360 while ( aODFFormats[i] != nullptr )
361 {
362 if ( o3tl::equalsAscii( sFilter, aODFFormats[i++] ) )
363 {
364 bRet = true;
365 break;
366 }
367 }
368
369 return bRet;
370}
371
373{
374 m_xLoadUserSettingsCB->set_active(officecfg::Office::Common::Load::UserDefinedSettings::get());
375 m_xLoadUserSettingsCB->save_state();
376 m_xLoadUserSettingsCB->set_sensitive(!officecfg::Office::Common::Load::UserDefinedSettings::isReadOnly());
377 m_xLoadDocPrinterCB->set_active( officecfg::Office::Common::Save::Document::LoadPrinter::get() );
378 m_xLoadDocPrinterCB->save_state();
379 m_xLoadDocPrinterCB->set_sensitive(!officecfg::Office::Common::Save::Document::LoadPrinter::isReadOnly());
380
381 if ( !pImpl->bInitialized )
382 {
383 try
384 {
386 pImpl->xFact.set(xMSF->createInstance("com.sun.star.document.FilterFactory"), UNO_QUERY);
387
388 DBG_ASSERT(pImpl->xFact.is(), "service com.sun.star.document.FilterFactory unavailable");
389 Reference< XContainerQuery > xQuery(pImpl->xFact, UNO_QUERY);
390 if(xQuery.is())
391 {
392 for (sal_Int32 n = 0, nEntryCount = m_xDocTypeLB->get_count(); n < nEntryCount; ++n)
393 {
394 unsigned int nData = m_xDocTypeLB->get_id(n).toUInt32();
395 OUString sCommand = "getSortedFilterList():module=%1:iflags=" +
396 OUString::number(static_cast<int>(SfxFilterFlags::IMPORT|SfxFilterFlags::EXPORT)) +
397 ":eflags=" +
398 OUString::number(static_cast<int>(SfxFilterFlags::NOTINFILEDLG));
399 OUString sReplace;
400 switch(nData)
401 {
402 case APP_WRITER : sReplace = "com.sun.star.text.TextDocument"; break;
403 case APP_WRITER_WEB : sReplace = "com.sun.star.text.WebDocument"; break;
404 case APP_WRITER_GLOBAL : sReplace = "com.sun.star.text.GlobalDocument"; break;
405 case APP_CALC : sReplace = "com.sun.star.sheet.SpreadsheetDocument";break;
406 case APP_IMPRESS : sReplace = "com.sun.star.presentation.PresentationDocument";break;
407 case APP_DRAW : sReplace = "com.sun.star.drawing.DrawingDocument";break;
408 case APP_MATH : sReplace = "com.sun.star.formula.FormulaProperties";break;
409 default: OSL_FAIL("illegal user data");
410 }
411 sCommand = sCommand.replaceFirst("%1", sReplace);
412 Reference< XEnumeration > xList = xQuery->createSubSetEnumerationByQuery(sCommand);
413 std::vector< OUString > lList;
414 std::vector<bool> lODFList;
415 while(xList->hasMoreElements())
416 {
417 SequenceAsHashMap aFilter(xList->nextElement());
418 OUString sFilter = aFilter.getUnpackedValueOrDefault("Name",OUString());
419 if (!sFilter.isEmpty())
420 {
421 lList.push_back(sFilter);
422 lODFList.push_back( isODFFormat( sFilter ) );
423 }
424 }
425 pImpl->aFilterArr[nData] = lList;
426 pImpl->aODFArr[nData] = lODFList;
427 }
428 }
429 m_xDocTypeLB->set_active(0);
430 FilterHdl_Impl(*m_xDocTypeLB);
431 }
432 catch(Exception const &)
433 {
434 TOOLS_WARN_EXCEPTION( "cui.options", "exception in FilterFactory access" );
435 }
436
437 pImpl->bInitialized = true;
438 }
439
440 m_xDocInfoCB->set_active(officecfg::Office::Common::Save::Document::EditProperty::get());
441 m_xDocInfoCB->set_sensitive(!officecfg::Office::Common::Save::Document::EditProperty::isReadOnly());
442
443 m_xBackupCB->set_active(officecfg::Office::Common::Save::Document::CreateBackup::get());
444 m_xBackupCB->set_sensitive(!officecfg::Office::Common::Save::Document::CreateBackup::isReadOnly());
445
446 m_xAutoSaveCB->set_active(officecfg::Office::Common::Save::Document::AutoSave::get());
447 m_xAutoSaveCB->set_sensitive(!officecfg::Office::Common::Save::Document::AutoSave::isReadOnly());
448
449 m_xUserAutoSaveCB->set_active(officecfg::Office::Recovery::AutoSave::UserAutoSaveEnabled::get());
450 m_xUserAutoSaveCB->set_sensitive(!officecfg::Office::Recovery::AutoSave::UserAutoSaveEnabled::isReadOnly());
451
452 m_xWarnAlienFormatCB->set_active(officecfg::Office::Common::Save::Document::WarnAlienFormat::get());
453 m_xWarnAlienFormatCB->set_sensitive(!officecfg::Office::Common::Save::Document::WarnAlienFormat::isReadOnly());
454
455 m_xAutoSaveEdit->set_value(officecfg::Office::Common::Save::Document::AutoSaveTimeIntervall::get());
456 m_xAutoSaveEdit->set_sensitive(!officecfg::Office::Common::Save::Document::AutoSaveTimeIntervall::isReadOnly());
457
458 // save relatively
459 m_xRelativeFsysCB->set_active(officecfg::Office::Common::Save::URL::FileSystem::get());
460 m_xRelativeFsysCB->set_sensitive(!officecfg::Office::Common::Save::URL::FileSystem::isReadOnly());
461
462 m_xRelativeInetCB->set_active(officecfg::Office::Common::Save::URL::Internet::get());
463 m_xRelativeInetCB->set_sensitive(!officecfg::Office::Common::Save::URL::Internet::isReadOnly());
464
465 sal_Int32 nDefaultVersion = GetODFDefaultVersion();
466 m_xODFVersionLB->set_active_id(OUString::number(nDefaultVersion));
467 m_xODFVersionLB->set_sensitive(!officecfg::Office::Common::Save::ODF::DefaultVersion::isReadOnly());
468
469 AutoClickHdl_Impl(*m_xAutoSaveCB);
470 ODFVersionHdl_Impl(*m_xODFVersionLB);
471
472 m_xDocInfoCB->save_state();
473 m_xBackupCB->save_state();
474 m_xWarnAlienFormatCB->save_state();
475 m_xAutoSaveCB->save_state();
476 m_xAutoSaveEdit->save_value();
477
478 m_xUserAutoSaveCB->save_state();
479
480 m_xRelativeFsysCB->save_state();
481 m_xRelativeInetCB->save_state();
482 m_xODFVersionLB->save_value();
483}
484
485IMPL_LINK(SvxSaveTabPage, AutoClickHdl_Impl, weld::Toggleable&, rBox, void)
486{
487 if (&rBox != m_xAutoSaveCB.get())
488 return;
489
490 if (m_xAutoSaveCB->get_active())
491 {
492 m_xAutoSaveEdit->set_sensitive(true);
493 m_xMinuteFT->set_sensitive(true);
494 m_xUserAutoSaveCB->set_sensitive(true);
495 }
496 else
497 {
498 m_xAutoSaveEdit->set_sensitive(false);
499 m_xMinuteFT->set_sensitive(false);
500 m_xUserAutoSaveCB->set_sensitive(false);
501 }
502}
503
504static OUString lcl_ExtracUIName(const Sequence<PropertyValue> &rProperties, std::u16string_view rExtension)
505{
506 OUString sName;
507 const PropertyValue* pPropVal = rProperties.getConstArray();
508 const PropertyValue* const pEnd = pPropVal + rProperties.getLength();
509 for( ; pPropVal != pEnd; pPropVal++ )
510 {
511 const OUString &rName = pPropVal->Name;
512 if (rName == "UIName")
513 {
514 OUString sUIName;
515 if ( ( pPropVal->Value >>= sUIName ) && sUIName.getLength() )
516 {
517 if (!rExtension.empty())
518 {
519 return sUIName + " (" + rExtension + ")";
520 }
521 else
522 {
523 return sUIName;
524 }
525 }
526 }
527 else if (rName == "Name")
528 {
529 pPropVal->Value >>= sName;
530 }
531 }
532
533 OSL_ENSURE( false, "Filter without UIName!" );
534
535 return sName;
536}
537
538IMPL_LINK( SvxSaveTabPage, FilterHdl_Impl, weld::ComboBox&, rBox, void )
539{
540 const int nCurPos = m_xDocTypeLB->get_active();
541
542 int nData = -1;
543 if (nCurPos < APP_COUNT)
544 nData = m_xDocTypeLB->get_id(nCurPos).toInt32();
545
546 if ( nData >= 0 && nData < APP_COUNT )
547 {
548 if(m_xDocTypeLB.get() == &rBox)
549 {
550 m_xSaveAsLB->clear();
551 auto & rFilters = pImpl->aFilterArr[nData];
552 if(pImpl->aUIFilterArr[nData].empty())
553 {
554 pImpl->aUIFilterArr[nData].resize(pImpl->aFilterArr[nData].size());
555 auto & rUIFilters = pImpl->aUIFilterArr[nData];
556 for(size_t nFilter = 0; nFilter < pImpl->aFilterArr[nData].size(); nFilter++)
557 {
558 Any aProps = pImpl->xFact->getByName(rFilters[nFilter]);
559 // get the extension of the filter
560 OUString extension;
561 SfxFilterMatcher matcher;
562 std::shared_ptr<const SfxFilter> pFilter = matcher.GetFilter4FilterName(rFilters[nFilter]);
563 if (pFilter)
564 {
565 extension = pFilter->GetWildcard().getGlob().getToken(0, ';');
566 }
568 aProps >>= aProperties;
569 rUIFilters[nFilter] = lcl_ExtracUIName(aProperties, extension);
570 }
571 }
572 auto const & rUIFilters = pImpl->aUIFilterArr[nData];
573 OUString sSelect;
574 for(size_t i = 0; i < pImpl->aUIFilterArr[nData].size(); i++)
575 {
576 OUString sId;
577 if (pImpl->aODFArr[nData][i])
578 sId = weld::toId(pImpl.get());
579 m_xSaveAsLB->append(sId, rUIFilters[i]);
580 if (rFilters[i] == pImpl->aDefaultArr[nData])
581 sSelect = rUIFilters[i];
582 }
583 if (!sSelect.isEmpty())
584 {
585 m_xSaveAsLB->set_active_text(sSelect);
586 }
587
588 m_xSaveAsFT->set_sensitive(!pImpl->aDefaultReadonlyArr[nData]);
589 m_xSaveAsLB->set_sensitive(!pImpl->aDefaultReadonlyArr[nData]);
590 }
591 else
592 {
593 OUString sSelect = rBox.get_active_text();
594 auto const & rFilters = pImpl->aFilterArr[nData];
595 auto const & rUIFilters = pImpl->aUIFilterArr[nData];
596 for(size_t i = 0; i < pImpl->aUIFilterArr[nData].size(); i++)
597 if(rUIFilters[i] == sSelect)
598 {
599 sSelect = rFilters[i];
600 break;
601 }
602
603 pImpl->aDefaultArr[nData] = sSelect;
604 }
605 }
606
607 ODFVersionHdl_Impl( *m_xSaveAsLB );
608}
609
611{
612 sal_Int32 nVersion = m_xODFVersionLB->get_active_id().toInt32();
614 if ( bShown )
615 {
616 bool bHasODFFormat = false;
617 const int nCount = m_xSaveAsLB->get_count();
618 for (int i = 0; i < nCount; ++i )
619 {
620 if ( m_xSaveAsLB->get_id(i).toInt64() != 0 )
621 {
622 bHasODFFormat = true;
623 break;
624 }
625 }
626
627 bShown = !bHasODFFormat
628 || ( m_xSaveAsLB->get_active_id().toInt64() != 0);
629 }
630
631 m_xODFWarningFI->set_visible(bShown);
632 m_xODFWarningFT->set_visible(bShown);
633}
634
635/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
PropertiesInfo aProperties
void SetNeedsRestart(svtools::RestartReason eReason)
Definition: treeopt.cxx:1939
std::shared_ptr< const SfxFilter > GetFilter4FilterName(const OUString &rName, SfxFilterFlags nMust=SfxFilterFlags::NONE, SfxFilterFlags nDont=SFX_FILTER_NOTINSTALLED) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SfxOkDialogController * GetDialogController() const
bool IsModuleInstalled(EModule eModule) const
bool IsDefaultFilterReadonly(EFactory eFactory) const
void SetFactoryDefaultFilter(EFactory eFactory, const OUString &sFilter)
OUString GetFactoryDefaultFilter(EFactory eFactory) const
bool IsOptionHidden(std::u16string_view _rOption, std::u16string_view _rPage, std::u16string_view _rGroup) const
void DetectHiddenControls()
Definition: optsave.cxx:201
std::unique_ptr< SvxSaveTabPage_Impl > pImpl
Definition: optsave.hxx:42
std::unique_ptr< weld::CheckButton > m_xLoadUserSettingsCB
Definition: optsave.hxx:44
std::unique_ptr< weld::CheckButton > m_xAutoSaveCB
Definition: optsave.hxx:48
std::unique_ptr< weld::CheckButton > m_xLoadDocPrinterCB
Definition: optsave.hxx:45
std::unique_ptr< weld::ComboBox > m_xSaveAsLB
Definition: optsave.hxx:58
std::unique_ptr< weld::SpinButton > m_xAutoSaveEdit
Definition: optsave.hxx:49
std::unique_ptr< weld::ComboBox > m_xDocTypeLB
Definition: optsave.hxx:56
std::unique_ptr< weld::CheckButton > m_xRelativeInetCB
Definition: optsave.hxx:53
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: optsave.cxx:227
std::unique_ptr< weld::CheckButton > m_xBackupCB
Definition: optsave.hxx:47
std::unique_ptr< weld::Label > m_xMinuteFT
Definition: optsave.hxx:50
std::unique_ptr< weld::CheckButton > m_xDocInfoCB
Definition: optsave.hxx:46
std::unique_ptr< weld::CheckButton > m_xRelativeFsysCB
Definition: optsave.hxx:52
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: optsave.cxx:195
virtual ~SvxSaveTabPage() override
Definition: optsave.cxx:191
SvxSaveTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: optsave.cxx:78
std::unique_ptr< weld::CheckButton > m_xWarnAlienFormatCB
Definition: optsave.hxx:55
virtual void Reset(const SfxItemSet *rSet) override
Definition: optsave.cxx:372
std::unique_ptr< weld::ComboBox > m_xODFVersionLB
Definition: optsave.hxx:54
std::unique_ptr< weld::CheckButton > m_xUserAutoSaveCB
Definition: optsave.hxx:51
static std::shared_ptr< ConfigurationChanges > create()
TValueType getUnpackedValueOrDefault(const OUString &sKey, const TValueType &aDefault) const
int nCount
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
float u
sal_Int16 nVersion
sal_Int64 n
const char * sName
@ Exception
Reference< XMultiServiceFactory > getProcessServiceFactory()
int i
bool equalsAscii(std::u16string_view s1, const char *s2)
RESTART_REASON_SAVE
OUString toId(const void *pValue)
#define CFG_PAGE_AND_GROUP
Definition: optsave.cxx:56
static bool isODFFormat(std::u16string_view sFilter)
Definition: optsave.cxx:338
static OUString lcl_ExtracUIName(const Sequence< PropertyValue > &rProperties, std::u16string_view rExtension)
Definition: optsave.cxx:504
IMPL_LINK(SvxSaveTabPage, AutoClickHdl_Impl, weld::Toggleable &, rBox, void)
Definition: optsave.cxx:485
IMPL_LINK_NOARG(SvxSaveTabPage, ODFVersionHdl_Impl, weld::ComboBox &, void)
Definition: optsave.cxx:610
#define APP_WRITER
Definition: optsave.hxx:24
#define APP_DRAW
Definition: optsave.hxx:29
#define APP_COUNT
Definition: optsave.hxx:31
#define APP_IMPRESS
Definition: optsave.hxx:28
#define APP_WRITER_GLOBAL
Definition: optsave.hxx:26
#define APP_CALC
Definition: optsave.hxx:27
#define APP_WRITER_WEB
Definition: optsave.hxx:25
#define APP_MATH
Definition: optsave.hxx:30
UNOTOOLS_DLLPUBLIC SvtSaveOptions::ODFDefaultVersion GetODFDefaultVersion()
UNOTOOLS_DLLPUBLIC void SetODFDefaultVersion(SvtSaveOptions::ODFDefaultVersion eVersion)
static SfxItemSet & rSet
std::vector< OUString > aUIFilterArr[APP_COUNT]
Definition: optsave.cxx:64
std::vector< OUString > aFilterArr[APP_COUNT]
Definition: optsave.cxx:62
std::vector< bool > aODFArr[APP_COUNT]
Definition: optsave.cxx:63
bool aDefaultReadonlyArr[APP_COUNT]
Definition: optsave.cxx:66
OUString aDefaultArr[APP_COUNT]
Definition: optsave.cxx:65
Reference< XNameContainer > xFact
Definition: optsave.cxx:61
OUString sId