LibreOffice Module sw (master)  1
apphdl.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 <config_features.h>
21 #include <config_fuzzers.h>
22 #include <config_wasm_strip.h>
23 
25 #include <sfx2/dispatch.hxx>
26 #include <sfx2/event.hxx>
27 #include <sfx2/objitem.hxx>
30 #include <svl/eitem.hxx>
31 #include <svl/whiter.hxx>
32 #include <svl/isethint.hxx>
33 #include <svl/stritem.hxx>
34 #include <sfx2/request.hxx>
35 #include <sfx2/fcontnr.hxx>
36 #include <svl/ctloptions.hxx>
37 #include <svtools/colorcfg.hxx>
39 #include <tools/diagnose_ex.h>
40 #include <unotools/useroptions.hxx>
41 #include <com/sun/star/document/UpdateDocMode.hpp>
42 #include <sfx2/docfile.hxx>
43 #include <sfx2/objface.hxx>
44 #include <vcl/settings.hxx>
45 #include <vcl/svapp.hxx>
46 #include <o3tl/string_view.hxx>
47 
48 #include <view.hxx>
49 #include <pview.hxx>
50 #include <srcview.hxx>
51 #include <wrtsh.hxx>
52 #include <docsh.hxx>
53 #include <cmdid.h>
54 #include <initui.hxx>
55 #include <uitool.hxx>
56 #include <swmodule.hxx>
57 #include <wview.hxx>
58 #include <usrpref.hxx>
59 #include <gloslst.hxx>
60 #include <glosdoc.hxx>
61 #include <doc.hxx>
64 #include <prtopt.hxx>
65 #include <modcfg.hxx>
66 #include <fontcfg.hxx>
67 #include <barcfg.hxx>
68 #include <navicfg.hxx>
69 #include <uinums.hxx>
70 #include <dbconfig.hxx>
71 #include <mmconfigitem.hxx>
72 #include <strings.hrc>
73 #include <com/sun/star/container/XChild.hpp>
74 #include <com/sun/star/sdbc/XConnection.hpp>
75 #include <com/sun/star/sdb/TextConnectionSettings.hpp>
76 #include <com/sun/star/sdbc/XDataSource.hpp>
77 #include <com/sun/star/task/OfficeRestartManager.hpp>
78 #include <org/freedesktop/PackageKit/SyncDbusSessionHelper.hpp>
79 #include <swabstdlg.hxx>
82 
84 #include <rtl/ref.hxx>
85 
86 #include <officecfg/Office/Common.hxx>
87 
88 using namespace ::com::sun::star;
89 
90 // Slotmaps for the application's methods
91 
92 // here are the SlotID's being included
93 // see Idl-file
94 #define ShellClass_SwModule
95 #include <sfx2/msg.hxx>
96 #include <swslots.hxx>
97 
99 
100 void SwModule::InitInterface_Impl()
101 {
102  GetStaticInterface()->RegisterStatusBar(StatusBarId::WriterStatusBar);
103 
104  GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_APPLICATION,
105  SfxVisibilityFlags::Standard | SfxVisibilityFlags::Client | SfxVisibilityFlags::Viewer,
106  ToolbarId::Module_Toolbox);
107 }
108 
109 // other states
111 {
112  SfxWhichIter aIter(rSet);
113  sal_uInt16 nWhich = aIter.FirstWhich();
114 
115  SwView* pActView = ::GetActiveView();
116  bool bWebView = dynamic_cast<SwWebView*>( pActView ) != nullptr;
117 
118  while(nWhich)
119  {
120  switch(nWhich)
121  {
122  case FN_BUSINESS_CARD:
123  case FN_LABEL:
124  case FN_ENVELOP:
125  {
126  bool bDisable = false;
127  SfxViewShell* pCurrView = SfxViewShell::Current();
128  if( !pCurrView || dynamic_cast< const SwView *>( pCurrView ) == nullptr )
129  bDisable = true;
130  SwDocShell *pDocSh = static_cast<SwDocShell*>( SfxObjectShell::Current());
131  if ( bDisable ||
132  (pDocSh && (pDocSh->IsReadOnly() ||
133  pDocSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED)) )
134  rSet.DisableItem( nWhich );
135 
136  }
137  break;
138  case FN_XFORMS_INIT:
139  // slot is always active!
140  break;
141  case FN_EDIT_FORMULA:
142  {
143  SwWrtShell* pSh = nullptr;
144  SelectionType nSelection = SelectionType::NONE;
145  if( pActView )
146  pSh = &pActView->GetWrtShell();
147  if( pSh )
148  nSelection = pSh->GetSelectionType();
149 
150  if( (pSh && pSh->HasSelection()) ||
151  !(nSelection & (SelectionType::Text | SelectionType::Table)))
152  rSet.DisableItem(nWhich);
153  }
154  break;
155  case SID_ATTR_METRIC:
156  rSet.Put( SfxUInt16Item( SID_ATTR_METRIC, static_cast< sal_uInt16 >(::GetDfltMetric(bWebView))));
157  break;
159  rSet.Put( SfxBoolItem( nWhich, m_pModuleConfig->
160  IsInsTableFormatNum( bWebView )));
161  break;
162  case FN_MAILMERGE_WIZARD:
163  {
164  SfxObjectShell* pObjectShell = GetObjectShell();
165  if (pObjectShell && pObjectShell->isExportLocked())
166  rSet.DisableItem(nWhich);
167  break;
168  }
173  {
174  SwView* pView = ::GetActiveView();
175  std::shared_ptr<SwMailMergeConfigItem> xConfigItem;
176  if (pView)
177  xConfigItem = pView->GetMailMergeConfigItem();
178  if (!xConfigItem)
179  rSet.DisableItem(nWhich);
180  else if (xConfigItem->GetConnection().is()
181  && !xConfigItem->GetConnection()->isClosed())
182  {
183  bool bFirst, bLast;
184  bool bValid = xConfigItem->IsResultSetFirstLast(bFirst, bLast);
185 
186  if (!bValid ||
187  (bFirst && (nWhich == FN_MAILMERGE_FIRST_ENTRY || nWhich == FN_MAILMERGE_PREV_ENTRY)) ||
188  (bLast && (nWhich == FN_MAILMERGE_LAST_ENTRY || nWhich == FN_MAILMERGE_NEXT_ENTRY)))
189  {
190  rSet.DisableItem(nWhich);
191  }
192  }
193  }
194  break;
197  {
198  // just trigger calling statusChanged() of MMExcludeEntryController
199  // resp. MMCurrentEntryController
200  rSet.InvalidateItem(nWhich);
201  }
202  break;
207  {
208  SwView* pView = ::GetActiveView();
209  std::shared_ptr<SwMailMergeConfigItem> xConfigItem;
210  if (pView)
211  xConfigItem = pView->EnsureMailMergeConfigItem();
212 
213  // #i51949# hide e-Mail option if e-Mail is not supported
214  // #i63267# printing might be disabled
215  // Without attempting to open the database, (in case it is remote or passworded),
216  // hide everything after determining there are no valid results. tdf#121606
217  if (!xConfigItem ||
218  xConfigItem->GetCurrentDBData().sDataSource.isEmpty() ||
219  xConfigItem->GetCurrentDBData().sCommand.isEmpty() ||
220  (xConfigItem->GetConnection().is() && !xConfigItem->GetConnection()->isClosed() && !xConfigItem->GetResultSet().is()) ||
222  (nWhich == FN_MAILMERGE_EMAIL_DOCUMENTS && !xConfigItem->IsMailAvailable()))
223  {
224  rSet.DisableItem(nWhich);
225  }
226  }
227  break;
228  default:
229  OSL_FAIL("::StateOther: default");
230  }
231  nWhich = aIter.NextWhich();
232  }
233 }
234 
235 // start field dialog
236 static void NewXForms( SfxRequest& rReq ); // implementation: below
237 
238 std::shared_ptr<SwMailMergeConfigItem> SwView::EnsureMailMergeConfigItem(const SfxItemSet* pArgs)
239 {
240  // create if it does not exist yet
241  std::shared_ptr<SwMailMergeConfigItem> xMMConfig = GetMailMergeConfigItem();
242  if (!xMMConfig)
243  {
244  xMMConfig = std::make_shared<SwMailMergeConfigItem>();
245  xMMConfig->SetSourceView(this);
246 
247  //set the first used database as default source on the config item
248  const SfxUnoAnyItem* pItem = nullptr;
249  if (pArgs && (pItem = pArgs->GetItemIfSet(
251  {
252  //mailmerge has been called from the database beamer
253  uno::Sequence< beans::PropertyValue> aDBValues;
254  if (pItem->GetValue() >>= aDBValues)
255  {
256  SwDBData aDBData;
257  svx::ODataAccessDescriptor aDescriptor(aDBValues);
259  aDescriptor[svx::DataAccessDescriptorProperty::Command] >>= aDBData.sCommand;
261 
262  uno::Reference< sdbc::XConnection> xConnection;
263  uno::Reference< sdbc::XDataSource> xSource;
264  uno::Reference< sdbcx::XColumnsSupplier> xColumnsSupplier;
266  aDescriptor[svx::DataAccessDescriptorProperty::Connection] >>= xConnection;
267  uno::Reference<container::XChild> xChild(xConnection, uno::UNO_QUERY);
268  if (xChild.is())
269  xSource.set(xChild->getParent(), uno::UNO_QUERY);
270  xMMConfig->SetCurrentConnection(
272  xColumnsSupplier, aDBData);
273  }
274  }
275  else
276  {
277  std::vector<OUString> aDBNameList;
278  std::vector<OUString> aAllDBNames;
279  GetWrtShell().GetAllUsedDB(aDBNameList, &aAllDBNames);
280  if (!aDBNameList.empty())
281  {
282  OUString sDBName(aDBNameList[0]);
283  SwDBData aDBData;
284  sal_Int32 nIdx{ 0 };
285  aDBData.sDataSource = sDBName.getToken(0, DB_DELIM, nIdx);
286  aDBData.sCommand = sDBName.getToken(0, DB_DELIM, nIdx);
287  aDBData.nCommandType = o3tl::toInt32(o3tl::getToken(sDBName, 0, DB_DELIM, nIdx));
288  //set the currently used database for the wizard
289  xMMConfig->SetCurrentDBData(aDBData);
290  }
291  }
292 
293  SetMailMergeConfigItem(xMMConfig);
294  }
295  return xMMConfig;
296 }
297 
298 #if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS
299 
300 namespace
301 {
302 
303 SwView* lcl_LoadDoc(SwView* pView, const OUString& rURL)
304 {
305  SwView* pNewView = nullptr;
306  if(!rURL.isEmpty())
307  {
308  SfxStringItem aURL(SID_FILE_NAME, rURL);
309  SfxStringItem aTargetFrameName( SID_TARGETNAME, "_blank" );
310  SfxBoolItem aHidden( SID_HIDDEN, true );
311  SfxStringItem aReferer(SID_REFERER, pView->GetDocShell()->GetTitle());
312  const SfxObjectItem* pItem = static_cast<const SfxObjectItem*>(
313  pView->GetViewFrame()->GetDispatcher()->ExecuteList(SID_OPENDOC,
314  SfxCallMode::SYNCHRON,
315  { &aURL, &aHidden, &aReferer, &aTargetFrameName }));
316  SfxShell* pShell = pItem ? pItem->GetShell() : nullptr;
317 
318  if(pShell)
319  {
320  SfxViewShell* pViewShell = pShell->GetViewShell();
321  if(pViewShell)
322  {
323  pNewView = dynamic_cast<SwView*>(pViewShell);
324  if (pNewView)
325  {
326  pNewView->GetViewFrame()->GetFrame().Appear();
327  }
328  else
329  {
330  pViewShell->GetViewFrame()->DoClose();
331  }
332  }
333  }
334  }
335  else
336  {
337  SfxStringItem aFactory(SID_NEWDOCDIRECT, SwDocShell::Factory().GetFilterContainer()->GetName());
338  const SfxFrameItem* pItem = static_cast<const SfxFrameItem*>(
340  SID_NEWDOCDIRECT, SfxCallMode::SYNCHRON, { &aFactory }));
341  SfxFrame* pFrame = pItem ? pItem->GetFrame() : nullptr;
342  SfxViewFrame* pViewFrame = pFrame ? pFrame->GetCurrentViewFrame() : nullptr;
343  pNewView = pViewFrame ? dynamic_cast<SwView*>( pViewFrame->GetViewShell() ) : nullptr;
344  }
345 
346  return pNewView;
347 }
348 
349 class SwMailMergeWizardExecutor : public salhelper::SimpleReferenceObject
350 {
351  SwView* m_pView; // never owner
352  SwView* m_pView2Close; // never owner
353  VclPtr<AbstractMailMergeWizard> m_pWizard; // always owner
354  VclPtr<AbstractMailMergeWizard> m_pWizardToDestroyInCallback;
355 
356  void EndDialogHdl(sal_Int32 nResponse);
357  DECL_LINK( DestroyDialogHdl, void*, void );
358  DECL_LINK( DestroyWizardHdl, void*, void );
359  DECL_LINK( CancelHdl, void*, void );
360  DECL_LINK( CloseFrameHdl, void*, void );
361 
362  void ExecutionFinished();
363  void ExecuteWizard();
364 
365 public:
366  SwMailMergeWizardExecutor();
367  virtual ~SwMailMergeWizardExecutor() override;
368 
369  void ExecuteMailMergeWizard( const SfxItemSet * pArgs );
370 };
371 
372 SwMailMergeWizardExecutor::SwMailMergeWizardExecutor()
373  : m_pView( nullptr ),
374  m_pView2Close( nullptr ),
375  m_pWizard( nullptr )
376 {
377 }
378 
379 SwMailMergeWizardExecutor::~SwMailMergeWizardExecutor()
380 {
381  OSL_ENSURE( m_pWizard == nullptr, "SwMailMergeWizardExecutor: m_pWizard must be Null!" );
382 }
383 
384 bool lcl_hasAllComponentsAvailable()
385 {
386  try
387  {
388  return css::sdb::TextConnectionSettings::create(comphelper::getProcessComponentContext()).is();
389  }
390  catch (const css::uno::Exception &)
391  {
393  "sw.core", "assuming Base to be missing; caught ");
394  return false;
395  }
396 }
397 
398 void SwMailMergeWizardExecutor::ExecuteMailMergeWizard( const SfxItemSet * pArgs )
399 {
400  if(!lcl_hasAllComponentsAvailable())
401  {
403  {
404  try
405  {
406  using namespace org::freedesktop::PackageKit;
407  using namespace svtools;
408  css::uno::Reference< XSyncDbusSessionHelper > xSyncDbusSessionHelper(SyncDbusSessionHelper::create(comphelper::getProcessComponentContext()));
409  const css::uno::Sequence< OUString > vPackages{ "libreoffice-base" };
410  xSyncDbusSessionHelper->InstallPackageNames(vPackages, OUString());
411  SolarMutexGuard aGuard;
412  executeRestartDialog(comphelper::getProcessComponentContext(), nullptr, RESTART_REASON_MAILMERGE_INSTALL);
413  }
414  catch (const css::uno::Exception &)
415  {
417  "sw.core",
418  "trying to install LibreOffice Base, caught");
419  auto xRestartManager
421  if (!xRestartManager->isRestartRequested(false))
422  {
423  // Base is absent, and could not initiate its install - ask user to do that manually
424  // Only show the dialog if restart is not initiated yet
425  std::unique_ptr<weld::MessageDialog> xWarnBox(Application::CreateMessageDialog(
426  nullptr, VclMessageType::Info, VclButtonsType::Ok,
427  SwResId(STR_NO_BASE_FOR_MERGE)));
428  xWarnBox->run();
429  }
430  }
431  } else {
432  auto xRestartManager
434  if (!xRestartManager->isRestartRequested(false))
435  {
436  // Base is absent, and could not initiate its install - ask user to do that manually
437  // Only show the dialog if restart is not initiated yet
438  std::unique_ptr<weld::MessageDialog> xWarnBox(Application::CreateMessageDialog(
439  nullptr, VclMessageType::Info, VclButtonsType::Ok,
440  SwResId(STR_NO_BASE_FOR_MERGE)));
441  xWarnBox->run();
442  }
443  }
444  return;
445  }
446  if ( m_pView )
447  {
448  OSL_FAIL("SwMailMergeWizardExecutor::ExecuteMailMergeWizard: Already executing the wizard!" );
449  return;
450  }
451 
452  m_pView = ::GetActiveView();
453  if (!m_pView)
454  return;
455 
456  // keep self alive until done.
457  acquire();
458 
459  // create if it does not exist yet
460  std::shared_ptr<SwMailMergeConfigItem> xMMConfig = m_pView->EnsureMailMergeConfigItem(pArgs);
461 
463  m_pWizard = pFact->CreateMailMergeWizard(*m_pView, xMMConfig);
464 
465  ExecuteWizard();
466 }
467 
468 void SwMailMergeWizardExecutor::ExecutionFinished()
469 {
470  std::shared_ptr<SwMailMergeConfigItem> xMMConfig = m_pView->GetMailMergeConfigItem();
471  if (xMMConfig)
472  xMMConfig->Commit();
473 
474  SwDoc* pDoc = m_pView->GetDocShell()->GetDoc();
475  if (pDoc)
476  {
477  SwDBManager* pDbManager = pDoc->GetDBManager();
478  if (pDbManager)
479  pDbManager->CommitLastRegistrations();
480 
481  // Show the toolbar
482  m_pView->ShowUIElement("private:resource/toolbar/mailmerge");
483 
484  // Update Mail Merge controls
485  const sal_uInt16 slotIds[] = { FN_MAILMERGE_FIRST_ENTRY,
495  0 };
496  m_pView->GetViewFrame()->GetBindings().Invalidate(slotIds);
497  }
498 
499  // release/destroy asynchronously
500  Application::PostUserEvent( LINK( this, SwMailMergeWizardExecutor, DestroyDialogHdl ) );
501 }
502 
503 void SwMailMergeWizardExecutor::ExecuteWizard()
504 {
505  m_pWizard->StartExecuteAsync([this](sal_Int32 nResult){
506  EndDialogHdl(nResult);
507  });
508 }
509 
510 void SwMailMergeWizardExecutor::EndDialogHdl(sal_Int32 nRet)
511 {
512  sal_uInt16 nRestartPage = m_pWizard->GetRestartPage();
513 
514  switch ( nRet )
515  {
516  case RET_LOAD_DOC:
517  {
518  SwView* pNewView = lcl_LoadDoc(m_pView, m_pWizard->GetReloadDocument());
519 
520  // Destroy wizard asynchronously, since we are deep inside the wizard and dialog
521  // machinery code here
522  m_pWizardToDestroyInCallback = m_pWizard;
524  LINK( this, SwMailMergeWizardExecutor, DestroyWizardHdl ), nullptr );
525 
527  std::shared_ptr<SwMailMergeConfigItem> xMMConfig = m_pView->GetMailMergeConfigItem();
528  if (pNewView)
529  {
530  pNewView->SetMailMergeConfigItem(xMMConfig);
531  m_pView = pNewView;
532  xMMConfig->DocumentReloaded();
533  //new source view!
534  xMMConfig->SetSourceView( m_pView );
535  m_pWizard = pFact->CreateMailMergeWizard(*m_pView, xMMConfig);
536  m_pWizard->ShowPage( nRestartPage );
537  }
538  else
539  {
540  m_pWizard = pFact->CreateMailMergeWizard(*m_pView, xMMConfig);
541  }
542 
543  // execute the wizard again
544  ExecuteWizard();
545  break;
546  }
547  case RET_TARGET_CREATED:
548  {
549  std::shared_ptr<SwMailMergeConfigItem> xMMConfig = m_pView->GetMailMergeConfigItem();
550  SwView* pTargetView = xMMConfig->GetTargetView();
551  OSL_ENSURE(pTargetView, "No target view has been created");
552  if(pTargetView)
553  {
554  // destroy wizard asynchronously
555  m_pWizardToDestroyInCallback = m_pWizard;
557  LINK( this, SwMailMergeWizardExecutor, DestroyWizardHdl ), nullptr );
558 
560  m_pWizard = pFact->CreateMailMergeWizard(*pTargetView, xMMConfig);
561  m_pWizard->ShowPage( nRestartPage );
562 
563  // execute the wizard again
564  ExecuteWizard();
565  }
566  else
567  {
568  // should not happen - just in case no target view has been created
569  ExecutionFinished();
570  }
571  break;
572  }
573  case RET_REMOVE_TARGET:
574  {
575  std::shared_ptr<SwMailMergeConfigItem> xMMConfig = m_pView->GetMailMergeConfigItem();
576  SwView* pTargetView = xMMConfig->GetTargetView();
577  SwView* pSourceView = xMMConfig->GetSourceView();
578  OSL_ENSURE(pTargetView && pSourceView, "source or target view not available" );
579  if(pTargetView && pSourceView)
580  {
581  m_pView2Close = pTargetView;
582  pTargetView->GetViewFrame()->GetTopViewFrame()->GetWindow().Hide();
583  pSourceView->GetViewFrame()->GetFrame().AppearWithUpdate();
584  // the current view has be set when the target is destroyed
585  m_pView = pSourceView;
586  xMMConfig->SetTargetView(nullptr);
587 
588  // destroy wizard asynchronously
589  m_pWizardToDestroyInCallback = m_pWizard;
591  LINK( this, SwMailMergeWizardExecutor, CloseFrameHdl ), m_pWizard );
592 
594  m_pWizard = pFact->CreateMailMergeWizard(*pSourceView, xMMConfig);
595  m_pWizard->ShowPage( nRestartPage );
596 
597  // execute the wizard again
598  ExecuteWizard();
599  }
600  else
601  {
602  // should not happen - just in case no target view has been created
603  ExecutionFinished();
604  }
605  break;
606  }
607  case RET_CANCEL:
608  {
609  // close frame and destroy wizard asynchronously
611  LINK( this, SwMailMergeWizardExecutor, CancelHdl ), m_pWizard );
612  break;
613  }
614  default: // finish
615  {
616  std::shared_ptr<SwMailMergeConfigItem> xMMConfig = m_pView->GetMailMergeConfigItem();
617  SwView* pSourceView = xMMConfig ? xMMConfig->GetSourceView() : nullptr;
618  if(pSourceView)
619  {
620  xMMConfig->GetSourceView()->GetViewFrame()->GetFrame().Appear();
621  }
622  ExecutionFinished();
623  break;
624  }
625 
626  } // switch
627 }
628 
629 IMPL_LINK_NOARG(SwMailMergeWizardExecutor, DestroyDialogHdl, void*, void)
630 {
631  m_pWizard.disposeAndClear();
632 
633  release();
634 }
635 
636 IMPL_LINK_NOARG(SwMailMergeWizardExecutor, DestroyWizardHdl, void*, void)
637 {
638  m_pWizardToDestroyInCallback.disposeAndClear();
639 }
640 
641 IMPL_LINK_NOARG(SwMailMergeWizardExecutor, CancelHdl, void*, void)
642 {
643  std::shared_ptr<SwMailMergeConfigItem> xMMConfig = m_pView->GetMailMergeConfigItem();
644  if (xMMConfig)
645  {
646  if (xMMConfig->GetTargetView())
647  {
648  xMMConfig->GetTargetView()->GetViewFrame()->DoClose();
649  xMMConfig->SetTargetView(nullptr);
650  }
651  if (xMMConfig->GetSourceView())
652  {
653  auto pViewFrame(xMMConfig->GetSourceView()->GetViewFrame());
654  pViewFrame->GetFrame().AppearWithUpdate();
655  }
656  xMMConfig->Commit();
657  }
658 
659  // Revoke created connections
660  SwDoc* pDoc = m_pView->GetDocShell()->GetDoc();
661  SwDBManager* pDbManager = pDoc->GetDBManager();
662  if (pDbManager)
663  pDbManager->RevokeLastRegistrations();
664 
665  m_pWizard.disposeAndClear();
666  release();
667 }
668 
669 IMPL_LINK_NOARG(SwMailMergeWizardExecutor, CloseFrameHdl, void*, void)
670 {
671  if ( m_pView2Close )
672  {
673  m_pView2Close->GetViewFrame()->DoClose();
674  m_pView2Close = nullptr;
675  }
676  m_pWizardToDestroyInCallback.disposeAndClear();
677 }
678 } // namespace
679 
680 #endif // HAVE_FEATURE_DBCONNECTIVITY
681 
683 {
684  const SfxItemSet *pArgs = rReq.GetArgs();
685  const SfxPoolItem* pItem = nullptr;
686 
687  sal_uInt16 nWhich = rReq.GetSlot();
688  switch (nWhich)
689  {
690  case FN_ENVELOP:
691  InsertEnv( rReq );
692  break;
693 
694  case FN_BUSINESS_CARD:
695  case FN_LABEL:
696  InsertLab(rReq, nWhich == FN_LABEL);
697  break;
698 
699  case FN_XFORMS_INIT:
700  NewXForms( rReq );
701  break;
702 
703  case SID_ATTR_METRIC:
704  if(pArgs && SfxItemState::SET == pArgs->GetItemState(nWhich, false, &pItem))
705  {
706  FieldUnit eUnit = static_cast<FieldUnit>(static_cast<const SfxUInt16Item*>(pItem)->GetValue());
707  switch( eUnit )
708  {
709  case FieldUnit::MM:
710  case FieldUnit::CM:
711  case FieldUnit::INCH:
712  case FieldUnit::PICA:
713  case FieldUnit::POINT:
714  {
715  SwView* pActView = ::GetActiveView();
716  bool bWebView = dynamic_cast<SwWebView*>( pActView ) != nullptr;
717  ::SetDfltMetric(eUnit, bWebView);
718  }
719  break;
720  default:;//prevent warning
721  }
722  }
723  break;
724 
726  {
727  bool bWebView = dynamic_cast<SwWebView*>( ::GetActiveView() )!= nullptr ,
728  bSet;
729 
730  if( pArgs && SfxItemState::SET == pArgs->GetItemState(
731  nWhich, false, &pItem ))
732  bSet = static_cast<const SfxBoolItem*>(pItem)->GetValue();
733  else
734  bSet = !m_pModuleConfig->IsInsTableFormatNum( bWebView );
735 
736  m_pModuleConfig->SetInsTableFormatNum( bWebView, bSet );
737  }
738  break;
739 #if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS
740  case FN_MAILMERGE_WIZARD:
741  {
742  // show the mailmerge wizard
743  rtl::Reference< SwMailMergeWizardExecutor > xEx( new SwMailMergeWizardExecutor );
744  xEx->ExecuteMailMergeWizard( pArgs );
745  }
746  break;
752  {
753  SwView* pView = ::GetActiveView();
754  const std::shared_ptr<SwMailMergeConfigItem>& xConfigItem = pView->GetMailMergeConfigItem();
755  if (!xConfigItem)
756  return;
757 
758  const bool bHadConnection
759  = xConfigItem->GetConnection().is() && !xConfigItem->GetConnection()->isClosed();
760 
761  sal_Int32 nPos = xConfigItem->GetResultSetPosition();
762  switch (nWhich)
763  {
764  case FN_MAILMERGE_FIRST_ENTRY: xConfigItem->MoveResultSet(1); break;
765  case FN_MAILMERGE_PREV_ENTRY: xConfigItem->MoveResultSet(nPos - 1); break;
766  case FN_MAILMERGE_NEXT_ENTRY: xConfigItem->MoveResultSet(nPos + 1); break;
767  case FN_MAILMERGE_LAST_ENTRY: xConfigItem->MoveResultSet(-1); break;
768  case FN_MAILMERGE_CURRENT_ENTRY: /* don't move the result set, just update the document */ break;
769  default: break;
770  }
771 
772  // now the record has to be merged into the source document
773  // TODO can we re-use PerformMailMerge() here somehow?
774  const SwDBData& rDBData = xConfigItem->GetCurrentDBData();
775  uno::Sequence<uno::Any> vSelection({ uno::Any(xConfigItem->GetResultSetPosition()) });
777  {"Selection", uno::Any(vSelection)},
778  {"DataSourceName", uno::Any(rDBData.sDataSource)},
779  {"Command", uno::Any(rDBData.sCommand)},
780  {"CommandType", uno::Any(rDBData.nCommandType)},
781  {"ActiveConnection", uno::Any(xConfigItem->GetConnection().getTyped())},
782  {"Filter", uno::Any(xConfigItem->GetFilter())},
783  {"Cursor", uno::Any(xConfigItem->GetResultSet())}
784  }));
785 
786  SwWrtShell& rSh = pView->GetWrtShell();
787  SwMergeDescriptor aMergeDesc(DBMGR_MERGE, rSh, aDescriptor);
788  rSh.GetDBManager()->Merge(aMergeDesc);
789 
790  // update enabled / disabled status of the buttons in the toolbar
791  SfxBindings& rBindings = rSh.GetView().GetViewFrame()->GetBindings();
798  if (!bHadConnection && xConfigItem->GetConnection().is()
799  && !xConfigItem->GetConnection()->isClosed())
800  {
801  // The connection has been activated. Update controls that were disabled
806  }
807  rBindings.Update();
808  }
809  break;
814  {
815  std::shared_ptr<SwMailMergeConfigItem> xConfigItem = GetActiveView()->GetMailMergeConfigItem();
816  assert(xConfigItem);
817  if (!xConfigItem->GetResultSet().is())
818  {
819  // The connection has been attempted, but failed or no results found,
820  // so invalidate the toolbar buttons in case they need to be disabled.
821  SfxBindings& rBindings
831  rBindings.Update();
832  return;
833  }
834 
835  if (nWhich == FN_MAILMERGE_CREATE_DOCUMENTS)
836  {
838 
839  if (xConfigItem && xConfigItem->GetTargetView())
840  xConfigItem->GetTargetView()->GetViewFrame()->GetFrame().Appear();
841  }
842  else
843  {
844  xConfigItem->SetTargetView(nullptr);
846  if (nWhich == FN_MAILMERGE_SAVE_DOCUMENTS)
848  else if (nWhich == FN_MAILMERGE_PRINT_DOCUMENTS)
850  else if (nWhich == FN_MAILMERGE_EMAIL_DOCUMENTS)
852  }
853  }
854  break;
855 #endif
856  }
857 }
858 
859 // Catch notifications
860 
861 // Catch hint for DocInfo
862 void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
863 {
864  if( const SfxEventHint* pEvHint = dynamic_cast<const SfxEventHint*>( &rHint) )
865  {
866  SwDocShell* pDocSh = dynamic_cast<SwDocShell*>( pEvHint->GetObjShell() );
867  if( pDocSh )
868  {
869  SwWrtShell* pWrtSh = pDocSh->GetWrtShell();
870  switch( pEvHint->GetEventId() )
871  {
872  case SfxEventHintId::LoadFinished:
873  // if it is a new document created from a template,
874  // update fixed fields
875  if (pDocSh->GetMedium())
876  {
877  const SfxBoolItem* pTemplateItem = SfxItemSet::GetItem<SfxBoolItem>(pDocSh->GetMedium()->GetItemSet(), SID_TEMPLATE, false);
878  if (pTemplateItem && pTemplateItem->GetValue())
879  {
880  // assume that not calling via SwEditShell::SetFixFields
881  // is allowed, because the shell hasn't been created yet
882  assert(!pWrtSh);
883  pDocSh->GetDoc()->getIDocumentFieldsAccess().SetFixFields(nullptr);
884  }
885  }
886  break;
887  case SfxEventHintId::CreateDoc:
888  // Update all FIX-Date/Time fields
889  if( pWrtSh )
890  {
891  const SfxUInt16Item* pUpdateDocItem = SfxItemSet::GetItem<SfxUInt16Item>(pDocSh->GetMedium()->GetItemSet(), SID_UPDATEDOCMODE, false);
892  bool bUpdateFields = true;
893  if( pUpdateDocItem && pUpdateDocItem->GetValue() == document::UpdateDocMode::NO_UPDATE)
894  bUpdateFields = false;
895  if(bUpdateFields)
896  {
897  comphelper::dispatchCommand(".uno:UpdateInputFields", {});
898 
899  // Are database fields contained?
900  // Get all used databases for the first time
901  SwDoc *pDoc = pDocSh->GetDoc();
902  std::vector<OUString> aDBNameList;
903  pDoc->GetAllUsedDB( aDBNameList );
904  if(!aDBNameList.empty())
905  { // Open database beamer
906  ShowDBObj(pWrtSh->GetView(), pDoc->GetDBData());
907  }
908  }
909  }
910  break;
911  default: break;
912  }
913  }
914  }
915  else if(const SfxItemSetHint* pSfxItemSetHint = dynamic_cast<const SfxItemSetHint*>(&rHint))
916  {
917  if( SfxItemState::SET == pSfxItemSetHint->GetItemSet().GetItemState(SID_ATTR_PATHNAME))
918  {
919  ::GetGlossaries()->UpdateGlosPath( false );
921  if(pList->IsActive())
922  pList->Update();
923  }
924  }
925  else
926  {
927  if (rHint.GetId() == SfxHintId::Deinitializing)
928  {
929  m_pWebUsrPref.reset();
930  m_pUsrPref.reset();
931  m_pModuleConfig.reset();
932  m_pPrintOptions.reset();
933  m_pWebPrintOptions.reset();
934  m_pChapterNumRules.reset();
935  m_pStdFontConfig.reset();
936  m_pNavigationConfig.reset();
937  m_pToolbarConfig.reset();
938  m_pWebToolbarConfig.reset();
939  m_pDBConfig.reset();
940  if( m_pColorConfig )
941  {
942  m_pColorConfig->RemoveListener(this);
943  m_pColorConfig.reset();
944  }
946  {
947  m_pAccessibilityOptions->RemoveListener(this);
948  m_pAccessibilityOptions.reset();
949  }
950  if( m_pCTLOptions )
951  {
952  m_pCTLOptions->RemoveListener(this);
953  m_pCTLOptions.reset();
954  }
955  if( m_pUserOptions )
956  {
957  m_pUserOptions->RemoveListener(this);
958  m_pUserOptions.reset();
959  }
960  }
961  }
962 }
963 
965 {
966  if( pBrdCst == m_pUserOptions.get() )
967  {
968  m_bAuthorInitialised = false;
969  }
970  else if ( pBrdCst == m_pColorConfig.get() )
971  {
972  if( pBrdCst == m_pColorConfig.get() )
974 
975  //invalidate all edit windows
976  SfxViewShell* pViewShell = SfxViewShell::GetFirst();
977  while(pViewShell)
978  {
979  if(pViewShell->GetWindow())
980  {
981  if(dynamic_cast< const SwView *>( pViewShell ) != nullptr ||
982  dynamic_cast< const SwPagePreview *>( pViewShell ) != nullptr ||
983  dynamic_cast< const SwSrcView *>( pViewShell ) != nullptr)
984  {
985  pViewShell->GetWindow()->Invalidate();
986  }
987  }
988  pViewShell = SfxViewShell::GetNext( *pViewShell );
989  }
990  }
991 #if !ENABLE_WASM_STRIP_ACCESSIBILITY
992  else if ( pBrdCst == m_pAccessibilityOptions.get() )
993  {
994  //set Accessibility options
995  SfxViewShell* pViewShell = SfxViewShell::GetFirst();
996  while(pViewShell)
997  {
998  if(pViewShell->GetWindow())
999  {
1000  auto pSwView = dynamic_cast<SwView *>( pViewShell );
1001  auto pPagePreview = dynamic_cast<SwPagePreview *>( pViewShell );
1002 
1003  if(pSwView)
1005  else if(pPagePreview)
1006  pPagePreview->ApplyAccessibilityOptions(*m_pAccessibilityOptions);
1007 
1008  if(pSwView || pPagePreview || dynamic_cast< const SwSrcView *>( pViewShell ) != nullptr)
1009  {
1010  pViewShell->GetWindow()->Invalidate();
1011  }
1012  }
1013  pViewShell = SfxViewShell::GetNext( *pViewShell );
1014  }
1015  }
1016 #endif
1017  else if( pBrdCst == m_pCTLOptions.get() )
1018  {
1019  const SfxObjectShell* pObjSh = SfxObjectShell::GetFirst();
1020  while( pObjSh )
1021  {
1022  if( auto pDocShell = dynamic_cast<const SwDocShell*>(pObjSh) )
1023  {
1024  SwDoc* pDoc = const_cast<SwDocShell*>(pDocShell)->GetDoc();
1026  if ( pVSh )
1027  pVSh->ChgNumberDigits();
1028  }
1029  pObjSh = SfxObjectShell::GetNext(*pObjSh);
1030  }
1031  }
1032 
1033 }
1034 
1036 {
1037  if(!m_pDBConfig)
1038  m_pDBConfig.reset(new SwDBConfig);
1039  return m_pDBConfig.get();
1040 }
1041 
1043 {
1044  if(!m_pColorConfig)
1045  {
1048  m_pColorConfig->AddListener(this);
1049  }
1050  return *m_pColorConfig;
1051 }
1052 
1054 {
1056  {
1058  m_pAccessibilityOptions->AddListener(this);
1059  }
1060  return *m_pAccessibilityOptions;
1061 }
1062 
1064 {
1065  if(!m_pCTLOptions)
1066  {
1067  m_pCTLOptions.reset(new SvtCTLOptions);
1068  m_pCTLOptions->AddListener(this);
1069  }
1070  return *m_pCTLOptions;
1071 }
1072 
1074 {
1075  if(!m_pUserOptions)
1076  {
1077  m_pUserOptions.reset(new SvtUserOptions);
1078  m_pUserOptions->AddListener(this);
1079  }
1080  return *m_pUserOptions;
1081 }
1082 
1083 const SwMasterUsrPref *SwModule::GetUsrPref(bool bWeb) const
1084 {
1085  SwModule* pNonConstModule = const_cast<SwModule*>(this);
1086  if(bWeb && !m_pWebUsrPref)
1087  {
1088  // The SpellChecker is needed in SwMasterUsrPref's Load, but it must not
1089  // be created there #58256#
1090  pNonConstModule->m_pWebUsrPref.reset(new SwMasterUsrPref(true));
1091  }
1092  else if(!bWeb && !m_pUsrPref)
1093  {
1094  pNonConstModule->m_pUsrPref.reset(new SwMasterUsrPref(false));
1095  }
1096  return bWeb ? m_pWebUsrPref.get() : m_pUsrPref.get();
1097 }
1098 
1099 void NewXForms( SfxRequest& rReq )
1100 {
1101  // copied & excerpted from SwModule::InsertLab(..)
1102 
1103  // create new document
1104  SfxObjectShellLock xDocSh( new SwDocShell( SfxObjectCreateMode::STANDARD) );
1105  xDocSh->DoInitNew();
1106 
1107  // initialize XForms
1108  static_cast<SwDocShell*>( &xDocSh )->GetDoc()->initXForms( true );
1109 
1110  // load document into frame
1111  SfxViewFrame::DisplayNewDocument( *xDocSh, rReq );
1112 
1113  // set return value
1114  rReq.SetReturnValue( SfxVoidItem( rReq.GetSlot() ) );
1115 }
1116 
1117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
SfxViewFrame * GetViewFrame() const
bool GetValue() const
static void ShowDBObj(SwView const &rView, const SwDBData &rData)
Definition: swmodul1.cxx:368
ConfigurationHints
DECL_LINK(CheckNameHdl, SvxNameDialog &, bool)
void Appear()
SvtAccessibilityOptions & GetAccessibilityOptions()
Definition: apphdl.cxx:1053
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
void RevokeLastRegistrations()
Revoke not committed registrations in case of mail merge cancel.
Definition: dbmgr.cxx:3226
URL aURL
FieldUnit
sal_Int32 nCommandType
Definition: swdbdata.hxx:32
#define FN_MAILMERGE_EXCLUDE_ENTRY
Definition: cmdid.h:249
#define FN_MAILMERGE_SAVE_DOCUMENTS
Definition: cmdid.h:254
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
void SetMailMergeConfigItem(std::shared_ptr< SwMailMergeConfigItem > const &rConfigItem)
Definition: view0.cxx:127
#define SFX_IMPL_INTERFACE(Class, SuperClass)
std::shared_ptr< SwMailMergeConfigItem > EnsureMailMergeConfigItem(const SfxItemSet *pArgs=nullptr)
Definition: apphdl.cxx:238
OUString GetTitle(sal_uInt16 nMaxLen=0) const
SwView * GetActiveView()
Definition: swmodul1.cxx:116
#define FN_ENVELOP
Definition: cmdid.h:761
#define RET_TARGET_CREATED
Definition: swabstdlg.hxx:373
std::unique_ptr< SwDBConfig > m_pDBConfig
Definition: swmodule.hxx:89
SwDocShell * GetDocShell()
Definition: doc.hxx:1351
SfxFrame * GetFrame() const
std::shared_ptr< SwMailMergeConfigItem > const & GetMailMergeConfigItem() const
Definition: view0.cxx:133
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: apphdl.cxx:862
std::string GetValue
View of a document.
Definition: pview.hxx:161
SfxDispatcher * GetDispatcher()
void Update()
Definition: gloslst.cxx:232
#define RET_LOAD_DOC
Definition: swabstdlg.hxx:372
OUString sDataSource
Definition: swdbdata.hxx:30
static const AllSettings & GetSettings()
::utl::SharedUNOComponent< css::sdbc::XConnection > SharedConnection
static void NewXForms(SfxRequest &rReq)
Definition: apphdl.cxx:1099
#define FN_MAILMERGE_NEXT_ENTRY
Definition: cmdid.h:246
Definition: doc.hxx:187
sal_uInt16 GetValue() const
void InvalidateItem(sal_uInt16 nWhich)
sal_uInt16 FirstWhich()
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
std::unique_ptr< SwMasterUsrPref, o3tl::default_delete< SwMasterUsrPref > > m_pWebUsrPref
Definition: swmodule.hxx:81
Data records in fields.
Definition: dbmgr.hxx:88
static SfxObjectShell * Current()
const SwMasterUsrPref * GetUsrPref(bool bWeb) const
Definition: apphdl.cxx:1083
#define FN_EDIT_FORMULA
Definition: cmdid.h:84
const SfxItemSet * GetArgs() const
void Invalidate(sal_uInt16 nId)
std::unique_ptr< SwChapterNumRules > m_pChapterNumRules
Definition: swmodule.hxx:84
static SfxViewFrame * DisplayNewDocument(SfxObjectShell const &i_rDoc, const SfxRequest &i_rCreateDocRequest)
RET_CANCEL
SwDBConfig * GetDBConfig()
Definition: apphdl.cxx:1035
SfxHintId GetId() const
sal_uInt16 NextWhich()
SwWrtShell & GetWrtShell() const
Definition: view.hxx:413
#define FN_PARAM_DATABASE_PROPERTIES
Definition: cmdid.h:830
bool IsActive() const
Used by the UI to modify the document model.
Definition: wrtsh.hxx:96
virtual void ConfigurationChanged(utl::ConfigurationBroadcaster *, ConfigurationHints) override
Definition: apphdl.cxx:964
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:164
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
Definition: doc.cxx:357
vcl::Window & GetWindow() const
const SwView & GetView() const
Definition: wrtsh.hxx:437
#define FN_MAILMERGE_EMAIL_DOCUMENTS
Definition: cmdid.h:256
virtual void ExecuteMMResultPrintDialog(weld::Window *pParent)=0
void StateOther(SfxItemSet &)
Definition: apphdl.cxx:110
void InsertEnv(SfxRequest &)
Definition: appenv.cxx:131
bool dispatchCommand(const OUString &rCommand, const uno::Reference< css::frame::XFrame > &rFrame, const css::uno::Sequence< css::beans::PropertyValue > &rArguments, const uno::Reference< css::frame::XDispatchResultListener > &rListener)
std::unique_ptr< SwPrintOptions > m_pWebPrintOptions
Definition: swmodule.hxx:83
SfxFrame & GetFrame() const
static SfxViewShell * GetNext(const SfxViewShell &rPrev, bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
static SfxViewShell * Current()
SfxViewFrame * GetCurrentViewFrame() const
SW_DLLPUBLIC SwGlossaries * GetGlossaries()
Definition: initui.cxx:162
void CommitLastRegistrations()
Accept not committed registrations.
Definition: dbmgr.cxx:3254
virtual void ExecuteMMResultSaveDialog(weld::Window *pParent)=0
const css::uno::Any & GetValue() const
virtual OUString GetName() const override
SfxObjectCreateMode GetCreateMode() const
css::uno::Sequence< css::beans::PropertyValue > InitPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
bool m_bAuthorInitialised
Definition: swmodule.hxx:112
virtual void ExecuteMMResultEmailDialog(weld::Window *pParent)=0
void ApplyAccessibilityOptions(SvtAccessibilityOptions const &rAccessibilityOptions)
Definition: pview.cxx:1835
std::unique_ptr< SvtAccessibilityOptions > m_pAccessibilityOptions
Definition: swmodule.hxx:91
SwDoc * GetDoc()
returns Doc. But be careful!
Definition: docsh.hxx:204
SVT_DLLPUBLIC bool executeRestartDialog(css::uno::Reference< css::uno::XComponentContext > const &context, weld::Window *parent, RestartReason reason)
bool HasSelection() const
Definition: wrtsh.hxx:147
void GetAllUsedDB(std::vector< OUString > &rDBNameList, std::vector< OUString > const *pAllDBNames)
Definition: edfld.cxx:301
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
SW_DLLPUBLIC FieldUnit GetDfltMetric(bool bWeb)
Definition: uitool.cxx:755
#define FN_MAILMERGE_CURRENT_ENTRY
Definition: cmdid.h:248
SelectionType
SfxBindings & GetBindings()
std::unique_ptr< SwStdFontConfig > m_pStdFontConfig
Definition: swmodule.hxx:85
void GetAllUsedDB(std::vector< OUString > &rDBNameList, const std::vector< OUString > *pAllDBNames=nullptr)
Definition: docfld.cxx:445
void AppearWithUpdate()
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
bool IsInsTableFormatNum(bool bHTML) const
Definition: swmodul1.cxx:545
SwWrtShell * GetWrtShell()
Access to the SwWrtShell belonging to SwView.
Definition: docsh.hxx:225
SvtUserOptions & GetUserOptions()
Definition: apphdl.cxx:1073
SfxItemSet * GetItemSet() const
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
SfxViewFrame * GetTopViewFrame() const
#define FN_MAILMERGE_PRINT_DOCUMENTS
Definition: cmdid.h:255
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
virtual VclPtr< AbstractMailMergeWizard > CreateMailMergeWizard(SwView &rView, std::shared_ptr< SwMailMergeConfigItem > &rConfigItem)=0
void ChgNumberDigits()
Definition: viewsh.cxx:1074
static void ApplyColorConfigValues(const svtools::ColorConfig &rConfig)
Definition: viewopt.cxx:481
static SfxViewShell * GetFirst(bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
#define FN_MAILMERGE_LAST_ENTRY
Definition: cmdid.h:247
#define DB_DELIM
Definition: swtypes.hxx:130
SfxViewShell * GetViewShell() const
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:405
void UpdateGlosPath(bool bFull)
Definition: glosdoc.cxx:349
SwDocShell * GetDocShell()
Definition: view.cxx:1132
bool IsReadOnly() const
std::unique_ptr< svtools::ColorConfig > m_pColorConfig
Definition: swmodule.hxx:90
void InsertLab(SfxRequest &, bool bLabel)
Definition: applab.cxx:135
void SetReturnValue(const SfxPoolItem &)
bool isExportLocked() const
weld::Window * GetFrameWeld() const
void Update(sal_uInt16 nId)
#define TOOLS_INFO_EXCEPTION(area, stream)
#define RET_REMOVE_TARGET
Definition: swabstdlg.hxx:374
static std::shared_ptr< SwMailMergeConfigItem > PerformMailMerge(SwView const *pView)
Definition: dbmgr.cxx:3201
std::unique_ptr< SwModuleOptions, o3tl::default_delete< SwModuleOptions > > m_pModuleConfig
Definition: swmodule.hxx:79
std::unique_ptr< SwToolbarConfigItem > m_pWebToolbarConfig
Definition: swmodule.hxx:88
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
sal_uInt16 GetSlot() const
#define FN_MAILMERGE_PREV_ENTRY
Definition: cmdid.h:245
void DisableItem(sal_uInt16 nWhich)
bool has(DataAccessDescriptorProperty _eWhich) const
static SfxObjectShell * GetFirst(const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
#define FN_MAILMERGE_FIRST_ENTRY
Definition: cmdid.h:244
#define FN_MAILMERGE_CREATE_DOCUMENTS
Definition: cmdid.h:253
virtual void SetFixFields(const DateTime *pNewDateTime)=0
std::unique_ptr< SwMasterUsrPref, o3tl::default_delete< SwMasterUsrPref > > m_pUsrPref
Definition: swmodule.hxx:80
Reference< XComponentContext > getProcessComponentContext()
std::unique_ptr< SwPrintOptions > m_pPrintOptions
Definition: swmodule.hxx:82
std::unique_ptr< SvtCTLOptions > m_pCTLOptions
Definition: swmodule.hxx:92
svtools::ColorConfig & GetColorConfig()
Definition: apphdl.cxx:1042
vcl::Window * GetWindow() const
bool DoClose()
std::unique_ptr< SwNavigationConfig > m_pNavigationConfig
Definition: swmodule.hxx:86
std::unique_ptr< SwToolbarConfigItem > m_pToolbarConfig
Definition: swmodule.hxx:87
void ExecOther(SfxRequest &)
Definition: apphdl.cxx:682
std::unique_ptr< SvtUserOptions > m_pUserOptions
Definition: swmodule.hxx:93
const MiscSettings & GetMiscSettings() const
static SfxObjectShell * GetNext(const SfxObjectShell &rPrev, const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
SvtCTLOptions & GetCTLOptions()
Definition: apphdl.cxx:1063
bool GetDisablePrinting() const
SelectionType GetSelectionType() const
Definition: wrtsh1.cxx:1631
void SetDfltMetric(FieldUnit eMetric, bool bWeb)
Definition: uitool.cxx:762
OUString sCommand
Definition: swdbdata.hxx:31
#define FN_SET_MODOPT_TBLNUMFMT
Definition: cmdid.h:182
#define FN_MAILMERGE_WIZARD
Definition: cmdid.h:239
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, bool bMobile=false)
virtual SfxObjectShell * GetObjectShell()
SwDBManager * GetDBManager() const
Definition: doc.hxx:669
Definition: view.hxx:144
sal_uInt16 nPos
IMPL_LINK_NOARG(SwContentControlButton, PopupModeEndHdl, weld::Popover &, void)
#define SFX_OBJECTBAR_APPLICATION
SfxMedium * GetMedium() const
SwGlossaryList * GetGlossaryList()
Definition: initui.cxx:174