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 
23 #include <sfx2/dispatch.hxx>
24 #include <sfx2/event.hxx>
25 #include <sfx2/objitem.hxx>
28 #include <svl/eitem.hxx>
29 #include <svl/whiter.hxx>
30 #include <svl/isethint.hxx>
31 #include <svl/stritem.hxx>
32 #include <sfx2/request.hxx>
33 #include <sfx2/fcontnr.hxx>
34 #include <svl/ctloptions.hxx>
35 #include <svtools/colorcfg.hxx>
37 #include <tools/diagnose_ex.h>
38 #include <unotools/useroptions.hxx>
39 #include <com/sun/star/document/UpdateDocMode.hpp>
40 #include <sfx2/docfile.hxx>
41 #include <sfx2/objface.hxx>
42 #include <vcl/settings.hxx>
43 #include <vcl/svapp.hxx>
44 
45 #include <view.hxx>
46 #include <pview.hxx>
47 #include <srcview.hxx>
48 #include <wrtsh.hxx>
49 #include <docsh.hxx>
50 #include <cmdid.h>
51 #include <initui.hxx>
52 #include <uitool.hxx>
53 #include <swmodule.hxx>
54 #include <wview.hxx>
55 #include <usrpref.hxx>
56 #include <gloslst.hxx>
57 #include <glosdoc.hxx>
58 #include <doc.hxx>
61 #include <prtopt.hxx>
62 #include <modcfg.hxx>
63 #include <fontcfg.hxx>
64 #include <barcfg.hxx>
65 #include <navicfg.hxx>
66 #include <uinums.hxx>
67 #include <dbconfig.hxx>
68 #include <mmconfigitem.hxx>
69 #include <strings.hrc>
70 #include <com/sun/star/container/XChild.hpp>
71 #include <com/sun/star/sdbc/XConnection.hpp>
72 #include <com/sun/star/sdb/TextConnectionSettings.hpp>
73 #include <com/sun/star/sdbc/XDataSource.hpp>
74 #include <com/sun/star/task/OfficeRestartManager.hpp>
75 #include <org/freedesktop/PackageKit/SyncDbusSessionHelper.hpp>
76 #include <swabstdlg.hxx>
79 
81 #include <rtl/ref.hxx>
82 
83 using namespace ::com::sun::star;
84 
85 // Slotmaps for the application's methods
86 
87 // here are the SlotID's being included
88 // see Idl-file
89 #define ShellClass_SwModule
90 #include <sfx2/msg.hxx>
91 #include <swslots.hxx>
92 
94 
95 void SwModule::InitInterface_Impl()
96 {
97  GetStaticInterface()->RegisterStatusBar(StatusBarId::WriterStatusBar);
98 
99  GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_APPLICATION,
100  SfxVisibilityFlags::Standard | SfxVisibilityFlags::Client | SfxVisibilityFlags::Viewer,
101  ToolbarId::Module_Toolbox);
102 }
103 
104 // other states
106 {
107  SfxWhichIter aIter(rSet);
108  sal_uInt16 nWhich = aIter.FirstWhich();
109 
110  SwView* pActView = ::GetActiveView();
111  bool bWebView = dynamic_cast<SwWebView*>( pActView ) != nullptr;
112 
113  while(nWhich)
114  {
115  switch(nWhich)
116  {
117  case FN_BUSINESS_CARD:
118  case FN_LABEL:
119  case FN_ENVELOP:
120  {
121  bool bDisable = false;
122  SfxViewShell* pCurrView = SfxViewShell::Current();
123  if( !pCurrView || dynamic_cast< const SwView *>( pCurrView ) == nullptr )
124  bDisable = true;
125  SwDocShell *pDocSh = static_cast<SwDocShell*>( SfxObjectShell::Current());
126  if ( bDisable ||
127  (pDocSh && (pDocSh->IsReadOnly() ||
128  pDocSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED)) )
129  rSet.DisableItem( nWhich );
130 
131  }
132  break;
133  case FN_XFORMS_INIT:
134  // slot is always active!
135  break;
136  case FN_EDIT_FORMULA:
137  {
138  SwWrtShell* pSh = nullptr;
139  SelectionType nSelection = SelectionType::NONE;
140  if( pActView )
141  pSh = &pActView->GetWrtShell();
142  if( pSh )
143  nSelection = pSh->GetSelectionType();
144 
145  if( (pSh && pSh->HasSelection()) ||
146  !(nSelection & (SelectionType::Text | SelectionType::Table)))
147  rSet.DisableItem(nWhich);
148  }
149  break;
150  case SID_ATTR_METRIC:
151  rSet.Put( SfxUInt16Item( SID_ATTR_METRIC, static_cast< sal_uInt16 >(::GetDfltMetric(bWebView))));
152  break;
154  rSet.Put( SfxBoolItem( nWhich, m_pModuleConfig->
155  IsInsTableFormatNum( bWebView )));
156  break;
157  case FN_MAILMERGE_WIZARD:
158  {
159  SwView* pView = ::GetActiveView();
160  if (pView && pView->GetViewShell()->isExportLocked())
161  rSet.DisableItem(nWhich);
162  break;
163  }
168  {
169  SwView* pView = ::GetActiveView();
170  std::shared_ptr<SwMailMergeConfigItem> xConfigItem;
171  if (pView)
172  xConfigItem = pView->GetMailMergeConfigItem();
173  if (!xConfigItem)
174  rSet.DisableItem(nWhich);
175  else if (xConfigItem->GetConnection().is()
176  && !xConfigItem->GetConnection()->isClosed())
177  {
178  bool bFirst, bLast;
179  bool bValid = xConfigItem->IsResultSetFirstLast(bFirst, bLast);
180 
181  if (!bValid ||
182  (bFirst && (nWhich == FN_MAILMERGE_FIRST_ENTRY || nWhich == FN_MAILMERGE_PREV_ENTRY)) ||
183  (bLast && (nWhich == FN_MAILMERGE_LAST_ENTRY || nWhich == FN_MAILMERGE_NEXT_ENTRY)))
184  {
185  rSet.DisableItem(nWhich);
186  }
187  }
188  }
189  break;
192  {
193  // just trigger calling statusChanged() of MMExcludeEntryController
194  // resp. MMCurrentEntryController
195  rSet.InvalidateItem(nWhich);
196  }
197  break;
202  {
203  SwView* pView = ::GetActiveView();
204  std::shared_ptr<SwMailMergeConfigItem> xConfigItem;
205  bool bUnLockDispatcher = false;
206  SfxDispatcher* pDispatcher = nullptr;
207  if (pView)
208  {
209  xConfigItem = pView->EnsureMailMergeConfigItem();
210 
211  // tdf#121607 lock the dispatcher while processing
212  // this request, and release it afterwards,
213  // that means that if this request pops up a dialog
214  // any other pending requests will be deferred
215  // until this request is finished, i.e. they won't
216  // be dispatched by the dispatcher timeout until
217  // unlock is called, serializing the password dialogs
218  pDispatcher = pView->GetViewFrame()->GetDispatcher();
219  if (!pDispatcher->IsLocked())
220  {
221  pDispatcher->Lock(true);
222  bUnLockDispatcher = true;
223  }
224  }
225 
226  // #i51949# hide e-Mail option if e-Mail is not supported
227  // #i63267# printing might be disabled
228  if (!xConfigItem ||
229  !xConfigItem->GetConnection().is() ||
230  xConfigItem->GetConnection()->isClosed() ||
231  !xConfigItem->GetResultSet().is() ||
232  xConfigItem->GetCurrentDBData().sDataSource.isEmpty() ||
233  xConfigItem->GetCurrentDBData().sCommand.isEmpty() ||
235  (nWhich == FN_MAILMERGE_EMAIL_DOCUMENTS && !xConfigItem->IsMailAvailable()))
236  {
237  rSet.DisableItem(nWhich);
238  }
239 
240  if (bUnLockDispatcher)
241  pDispatcher->Lock(false);
242  }
243  break;
244  default:
245  OSL_FAIL("::StateOther: default");
246  }
247  nWhich = aIter.NextWhich();
248  }
249 }
250 
251 // start field dialog
252 static void NewXForms( SfxRequest& rReq ); // implementation: below
253 
254 std::shared_ptr<SwMailMergeConfigItem> SwView::EnsureMailMergeConfigItem(const SfxItemSet* pArgs)
255 {
256  // create if it does not exist yet
257  std::shared_ptr<SwMailMergeConfigItem> xMMConfig = GetMailMergeConfigItem();
258  if (!xMMConfig)
259  {
260  xMMConfig.reset(new SwMailMergeConfigItem);
261  xMMConfig->SetSourceView(this);
262 
263  //set the first used database as default source on the config item
264  const SfxPoolItem* pItem = nullptr;
265  if (pArgs && SfxItemState::SET == pArgs->GetItemState(
266  FN_PARAM_DATABASE_PROPERTIES, false, &pItem))
267  {
268  //mailmerge has been called from the database beamer
269  uno::Sequence< beans::PropertyValue> aDBValues;
270  if (static_cast<const SfxUnoAnyItem*>(pItem)->GetValue() >>= aDBValues)
271  {
272  SwDBData aDBData;
273  svx::ODataAccessDescriptor aDescriptor(aDBValues);
275  aDescriptor[svx::DataAccessDescriptorProperty::Command] >>= aDBData.sCommand;
277 
278  uno::Reference< sdbc::XConnection> xConnection;
279  uno::Reference< sdbc::XDataSource> xSource;
280  uno::Reference< sdbcx::XColumnsSupplier> xColumnsSupplier;
282  aDescriptor[svx::DataAccessDescriptorProperty::Connection] >>= xConnection;
283  uno::Reference<container::XChild> xChild(xConnection, uno::UNO_QUERY);
284  if (xChild.is())
285  xSource.set(xChild->getParent(), uno::UNO_QUERY);
286  xMMConfig->SetCurrentConnection(
288  xColumnsSupplier, aDBData);
289  }
290  }
291  else
292  {
293  std::vector<OUString> aDBNameList;
294  std::vector<OUString> aAllDBNames;
295  GetWrtShell().GetAllUsedDB(aDBNameList, &aAllDBNames);
296  if (!aDBNameList.empty())
297  {
298  OUString sDBName(aDBNameList[0]);
299  SwDBData aDBData;
300  sal_Int32 nIdx{ 0 };
301  aDBData.sDataSource = sDBName.getToken(0, DB_DELIM, nIdx);
302  aDBData.sCommand = sDBName.getToken(0, DB_DELIM, nIdx);
303  aDBData.nCommandType = sDBName.getToken(0, DB_DELIM, nIdx).toInt32();
304  //set the currently used database for the wizard
305  xMMConfig->SetCurrentDBData(aDBData);
306  }
307  }
308 
309  SetMailMergeConfigItem(xMMConfig);
310  }
311  return xMMConfig;
312 }
313 
314 #if HAVE_FEATURE_DBCONNECTIVITY
315 
316 namespace
317 {
318 
319 SwView* lcl_LoadDoc(SwView* pView, const OUString& rURL)
320 {
321  SwView* pNewView = nullptr;
322  if(!rURL.isEmpty())
323  {
324  SfxStringItem aURL(SID_FILE_NAME, rURL);
325  SfxStringItem aTargetFrameName( SID_TARGETNAME, "_blank" );
326  SfxBoolItem aHidden( SID_HIDDEN, true );
327  SfxStringItem aReferer(SID_REFERER, pView->GetDocShell()->GetTitle());
328  const SfxObjectItem* pItem = static_cast<const SfxObjectItem*>(
329  pView->GetViewFrame()->GetDispatcher()->ExecuteList(SID_OPENDOC,
330  SfxCallMode::SYNCHRON,
331  { &aURL, &aHidden, &aReferer, &aTargetFrameName }));
332  SfxShell* pShell = pItem ? pItem->GetShell() : nullptr;
333 
334  if(pShell)
335  {
336  SfxViewShell* pViewShell = pShell->GetViewShell();
337  if(pViewShell)
338  {
339  if ((pNewView = dynamic_cast<SwView*>(pViewShell)))
340  {
341  pNewView->GetViewFrame()->GetFrame().Appear();
342  }
343  else
344  {
345  pViewShell->GetViewFrame()->DoClose();
346  }
347  }
348  }
349  }
350  else
351  {
352  SfxStringItem aFactory(SID_NEWDOCDIRECT, SwDocShell::Factory().GetFilterContainer()->GetName());
353  const SfxFrameItem* pItem = static_cast<const SfxFrameItem*>(
355  SID_NEWDOCDIRECT, SfxCallMode::SYNCHRON, { &aFactory }));
356  SfxFrame* pFrame = pItem ? pItem->GetFrame() : nullptr;
357  SfxViewFrame* pViewFrame = pFrame ? pFrame->GetCurrentViewFrame() : nullptr;
358  pNewView = pViewFrame ? dynamic_cast<SwView*>( pViewFrame->GetViewShell() ) : nullptr;
359  }
360 
361  return pNewView;
362 }
363 
364 class SwMailMergeWizardExecutor : public salhelper::SimpleReferenceObject
365 {
366  SwView* m_pView; // never owner
367  SwView* m_pView2Close; // never owner
368  VclPtr<AbstractMailMergeWizard> m_pWizard; // always owner
369  VclPtr<AbstractMailMergeWizard> m_pWizardToDestroyInCallback;
370 
371  void EndDialogHdl(sal_Int32 nResponse);
372  DECL_LINK( DestroyDialogHdl, void*, void );
373  DECL_LINK( DestroyWizardHdl, void*, void );
374  DECL_LINK( CancelHdl, void*, void );
375  DECL_LINK( CloseFrameHdl, void*, void );
376 
377  void ExecutionFinished();
378  void ExecuteWizard();
379 
380 public:
381  SwMailMergeWizardExecutor();
382  virtual ~SwMailMergeWizardExecutor() override;
383 
384  void ExecuteMailMergeWizard( const SfxItemSet * pArgs );
385 };
386 
387 SwMailMergeWizardExecutor::SwMailMergeWizardExecutor()
388  : m_pView( nullptr ),
389  m_pView2Close( nullptr ),
390  m_pWizard( nullptr )
391 {
392 }
393 
394 SwMailMergeWizardExecutor::~SwMailMergeWizardExecutor()
395 {
396  OSL_ENSURE( m_pWizard == nullptr, "SwMailMergeWizardExecutor: m_pWizard must be Null!" );
397 }
398 
399 bool lcl_hasAllComponentsAvailable()
400 {
401  try
402  {
403  return css::sdb::TextConnectionSettings::create(comphelper::getProcessComponentContext()).is();
404  }
405  catch (const css::uno::Exception &)
406  {
408  "sw.core", "assuming Base to be missing; caught ");
409  return false;
410  }
411 }
412 
413 void SwMailMergeWizardExecutor::ExecuteMailMergeWizard( const SfxItemSet * pArgs )
414 {
415  if(!lcl_hasAllComponentsAvailable())
416  {
417  try
418  {
419  using namespace org::freedesktop::PackageKit;
420  using namespace svtools;
421  css::uno::Reference< XSyncDbusSessionHelper > xSyncDbusSessionHelper(SyncDbusSessionHelper::create(comphelper::getProcessComponentContext()));
422  const css::uno::Sequence< OUString > vPackages{ "libreoffice-base" };
423  xSyncDbusSessionHelper->InstallPackageNames(vPackages, OUString());
424  SolarMutexGuard aGuard;
425  executeRestartDialog(comphelper::getProcessComponentContext(), nullptr, RESTART_REASON_MAILMERGE_INSTALL);
426  }
427  catch (const css::uno::Exception &)
428  {
430  "sw.core",
431  "trying to install LibreOffice Base, caught");
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.get() ? 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
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::makeAny(xConfigItem->GetResultSetPosition()) });
777  {"Selection", uno::makeAny(vSelection)},
778  {"DataSourceName", uno::makeAny(rDBData.sDataSource)},
779  {"Command", uno::makeAny(rDBData.sCommand)},
780  {"CommandType", uno::makeAny(rDBData.nCommandType)},
781  {"ActiveConnection", uno::makeAny(xConfigItem->GetConnection().getTyped())},
782  {"Filter", uno::makeAny(xConfigItem->GetFilter())},
783  {"Cursor", uno::makeAny(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;
811  {
812  std::shared_ptr<SwMailMergeConfigItem> xConfigItem = SwDBManager::PerformMailMerge(GetActiveView());
813 
814  if (xConfigItem && xConfigItem->GetTargetView())
815  xConfigItem->GetTargetView()->GetViewFrame()->GetFrame().Appear();
816  }
817  break;
821  {
822  std::shared_ptr<SwMailMergeConfigItem> xConfigItem = GetActiveView()->GetMailMergeConfigItem();
823  if(!xConfigItem)
824  return;
825  xConfigItem->SetTargetView(nullptr);
827  switch (nWhich)
828  {
832  }
833  }
834  break;
835 #endif
836  }
837 }
838 
839 // Catch notifications
840 
841 // Catch hint for DocInfo
842 void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
843 {
844  if( const SfxEventHint* pEvHint = dynamic_cast<const SfxEventHint*>( &rHint) )
845  {
846  SwDocShell* pDocSh = dynamic_cast<SwDocShell*>( pEvHint->GetObjShell() );
847  if( pDocSh )
848  {
849  SwWrtShell* pWrtSh = pDocSh->GetWrtShell();
850  switch( pEvHint->GetEventId() )
851  {
852  case SfxEventHintId::LoadFinished:
853  // if it is a new document created from a template,
854  // update fixed fields
855  if (pDocSh->GetMedium())
856  {
857  const SfxBoolItem* pTemplateItem = SfxItemSet::GetItem<SfxBoolItem>(pDocSh->GetMedium()->GetItemSet(), SID_TEMPLATE, false);
858  if (pTemplateItem && pTemplateItem->GetValue())
859  {
860  // assume that not calling via SwEditShell::SetFixFields
861  // is allowed, because the shell hasn't been created yet
862  assert(!pWrtSh);
863  pDocSh->GetDoc()->getIDocumentFieldsAccess().SetFixFields(nullptr);
864  }
865  }
866  break;
867  case SfxEventHintId::CreateDoc:
868  // Update all FIX-Date/Time fields
869  if( pWrtSh )
870  {
871  const SfxUInt16Item* pUpdateDocItem = SfxItemSet::GetItem<SfxUInt16Item>(pDocSh->GetMedium()->GetItemSet(), SID_UPDATEDOCMODE, false);
872  bool bUpdateFields = true;
873  if( pUpdateDocItem && pUpdateDocItem->GetValue() == document::UpdateDocMode::NO_UPDATE)
874  bUpdateFields = false;
875  if(bUpdateFields)
876  {
877  comphelper::dispatchCommand(".uno:UpdateInputFields", {});
878 
879  // Are database fields contained?
880  // Get all used databases for the first time
881  SwDoc *pDoc = pDocSh->GetDoc();
882  std::vector<OUString> aDBNameList;
883  pDoc->GetAllUsedDB( aDBNameList );
884  if(!aDBNameList.empty())
885  { // Open database beamer
886  ShowDBObj(pWrtSh->GetView(), pDoc->GetDBData());
887  }
888  }
889  }
890  break;
891  default: break;
892  }
893  }
894  }
895  else if(const SfxItemSetHint* pSfxItemSetHint = dynamic_cast<const SfxItemSetHint*>(&rHint))
896  {
897  if( SfxItemState::SET == pSfxItemSetHint->GetItemSet().GetItemState(SID_ATTR_PATHNAME))
898  {
899  ::GetGlossaries()->UpdateGlosPath( false );
901  if(pList->IsActive())
902  pList->Update();
903  }
904  }
905  else
906  {
907  if (rHint.GetId() == SfxHintId::Deinitializing)
908  {
909  m_pWebUsrPref.reset();
910  m_pUsrPref.reset();
911  m_pModuleConfig.reset();
912  m_pPrintOptions.reset();
913  m_pWebPrintOptions.reset();
914  m_pChapterNumRules.reset();
915  m_pStdFontConfig.reset();
916  m_pNavigationConfig.reset();
917  m_pToolbarConfig.reset();
918  m_pWebToolbarConfig.reset();
919  m_pDBConfig.reset();
920  if( m_pColorConfig )
921  {
922  m_pColorConfig->RemoveListener(this);
923  m_pColorConfig.reset();
924  }
926  {
927  m_pAccessibilityOptions->RemoveListener(this);
928  m_pAccessibilityOptions.reset();
929  }
930  if( m_pCTLOptions )
931  {
932  m_pCTLOptions->RemoveListener(this);
933  m_pCTLOptions.reset();
934  }
935  if( m_pUserOptions )
936  {
937  m_pUserOptions->RemoveListener(this);
938  m_pUserOptions.reset();
939  }
940  }
941  }
942 }
943 
945 {
946  if( pBrdCst == m_pUserOptions.get() )
947  {
948  m_bAuthorInitialised = false;
949  }
950  else if ( pBrdCst == m_pColorConfig.get() || pBrdCst == m_pAccessibilityOptions.get() )
951  {
952  bool bAccessibility = false;
953  if( pBrdCst == m_pColorConfig.get() )
955  else
956  bAccessibility = true;
957 
958  //invalidate all edit windows
959  SfxViewShell* pViewShell = SfxViewShell::GetFirst();
960  while(pViewShell)
961  {
962  if(pViewShell->GetWindow())
963  {
964  if(dynamic_cast< const SwView *>( pViewShell ) != nullptr ||
965  dynamic_cast< const SwPagePreview *>( pViewShell ) != nullptr ||
966  dynamic_cast< const SwSrcView *>( pViewShell ) != nullptr)
967  {
968  if(bAccessibility)
969  {
970  if(dynamic_cast< const SwView *>( pViewShell ) != nullptr)
971  static_cast<SwView*>(pViewShell)->ApplyAccessibilityOptions(*m_pAccessibilityOptions);
972  else if(dynamic_cast< const SwPagePreview *>( pViewShell ) != nullptr)
973  static_cast<SwPagePreview*>(pViewShell)->ApplyAccessibilityOptions(*m_pAccessibilityOptions);
974  }
975  pViewShell->GetWindow()->Invalidate();
976  }
977  }
978  pViewShell = SfxViewShell::GetNext( *pViewShell );
979  }
980  }
981  else if( pBrdCst == m_pCTLOptions.get() )
982  {
983  const SfxObjectShell* pObjSh = SfxObjectShell::GetFirst();
984  while( pObjSh )
985  {
986  if( auto pDocShell = dynamic_cast<const SwDocShell*>(pObjSh) )
987  {
988  SwDoc* pDoc = const_cast<SwDocShell*>(pDocShell)->GetDoc();
990  if ( pVSh )
991  pVSh->ChgNumberDigits();
992  }
993  pObjSh = SfxObjectShell::GetNext(*pObjSh);
994  }
995  }
996 
997 }
998 
1000 {
1001  if(!m_pDBConfig)
1002  m_pDBConfig.reset(new SwDBConfig);
1003  return m_pDBConfig.get();
1004 }
1005 
1007 {
1008  if(!m_pColorConfig)
1009  {
1012  m_pColorConfig->AddListener(this);
1013  }
1014  return *m_pColorConfig;
1015 }
1016 
1018 {
1020  {
1022  m_pAccessibilityOptions->AddListener(this);
1023  }
1024  return *m_pAccessibilityOptions;
1025 }
1026 
1028 {
1029  if(!m_pCTLOptions)
1030  {
1031  m_pCTLOptions.reset(new SvtCTLOptions);
1032  m_pCTLOptions->AddListener(this);
1033  }
1034  return *m_pCTLOptions;
1035 }
1036 
1038 {
1039  if(!m_pUserOptions)
1040  {
1041  m_pUserOptions.reset(new SvtUserOptions);
1042  m_pUserOptions->AddListener(this);
1043  }
1044  return *m_pUserOptions;
1045 }
1046 
1047 const SwMasterUsrPref *SwModule::GetUsrPref(bool bWeb) const
1048 {
1049  SwModule* pNonConstModule = const_cast<SwModule*>(this);
1050  if(bWeb && !m_pWebUsrPref)
1051  {
1052  // The SpellChecker is needed in SwMasterUsrPref's Load, but it must not
1053  // be created there #58256#
1054  pNonConstModule->m_pWebUsrPref.reset(new SwMasterUsrPref(true));
1055  }
1056  else if(!bWeb && !m_pUsrPref)
1057  {
1058  pNonConstModule->m_pUsrPref.reset(new SwMasterUsrPref(false));
1059  }
1060  return bWeb ? m_pWebUsrPref.get() : m_pUsrPref.get();
1061 }
1062 
1063 void NewXForms( SfxRequest& rReq )
1064 {
1065  // copied & excerpted from SwModule::InsertLab(..)
1066 
1067  // create new document
1068  SfxObjectShellLock xDocSh( new SwDocShell( SfxObjectCreateMode::STANDARD) );
1069  xDocSh->DoInitNew();
1070 
1071  // initialize XForms
1072  static_cast<SwDocShell*>( &xDocSh )->GetDoc()->initXForms( true );
1073 
1074  // load document into frame
1075  SfxViewFrame::DisplayNewDocument( *xDocSh, rReq );
1076 
1077  // set return value
1078  rReq.SetReturnValue( SfxVoidItem( rReq.GetSlot() ) );
1079 }
1080 
1081 /* 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:365
ConfigurationHints
void Appear()
SvtAccessibilityOptions & GetAccessibilityOptions()
Definition: apphdl.cxx:1017
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:3261
URL aURL
FieldUnit
sal_Int32 nCommandType
Definition: swdbdata.hxx:32
#define FN_MAILMERGE_EXCLUDE_ENTRY
Definition: cmdid.h:231
#define FN_MAILMERGE_SAVE_DOCUMENTS
Definition: cmdid.h:236
bool isExportLocked()
void SetMailMergeConfigItem(std::shared_ptr< SwMailMergeConfigItem > const &rConfigItem)
Definition: view0.cxx:122
#define SFX_IMPL_INTERFACE(Class, SuperClass)
std::shared_ptr< SwMailMergeConfigItem > EnsureMailMergeConfigItem(const SfxItemSet *pArgs=nullptr)
Definition: apphdl.cxx:254
OUString GetTitle(sal_uInt16 nMaxLen=0) const
SwView * GetActiveView()
Definition: swmodul1.cxx:115
#define FN_ENVELOP
Definition: cmdid.h:733
#define RET_TARGET_CREATED
Definition: swabstdlg.hxx:345
std::unique_ptr< SwDBConfig > m_pDBConfig
Definition: swmodule.hxx:90
SwDocShell * GetDocShell()
Definition: doc.hxx:1346
SfxFrame * GetFrame() const
std::shared_ptr< SwMailMergeConfigItem > const & GetMailMergeConfigItem() const
Definition: view0.cxx:128
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: apphdl.cxx:842
std::string GetValue
View of a document.
Definition: pview.hxx:161
SfxDispatcher * GetDispatcher()
void Update()
Definition: gloslst.cxx:230
#define RET_LOAD_DOC
Definition: swabstdlg.hxx:344
OUString sDataSource
Definition: swdbdata.hxx:30
static const AllSettings & GetSettings()
static void NewXForms(SfxRequest &rReq)
Definition: apphdl.cxx:1063
#define FN_MAILMERGE_NEXT_ENTRY
Definition: cmdid.h:228
Definition: doc.hxx:185
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::unique_ptr< SwMasterUsrPref, o3tl::default_delete< SwMasterUsrPref > > m_pWebUsrPref
Definition: swmodule.hxx:82
Data records in fields.
Definition: dbmgr.hxx:87
static SfxObjectShell * Current()
const SwMasterUsrPref * GetUsrPref(bool bWeb) const
Definition: apphdl.cxx:1047
::utl::SharedUNOComponent< css::sdbc::XConnection > SharedConnection
#define FN_EDIT_FORMULA
Definition: cmdid.h:77
const SfxItemSet * GetArgs() const
void Invalidate(sal_uInt16 nId)
std::unique_ptr< SwChapterNumRules > m_pChapterNumRules
Definition: swmodule.hxx:85
static SfxViewFrame * DisplayNewDocument(SfxObjectShell const &i_rDoc, const SfxRequest &i_rCreateDocRequest)
RET_CANCEL
SwDBConfig * GetDBConfig()
Definition: apphdl.cxx:999
SfxHintId GetId() const
sal_uInt16 NextWhich()
SwWrtShell & GetWrtShell() const
Definition: view.hxx:400
#define FN_PARAM_DATABASE_PROPERTIES
Definition: cmdid.h:805
bool IsActive() const
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
virtual void ConfigurationChanged(utl::ConfigurationBroadcaster *, ConfigurationHints) override
Definition: apphdl.cxx:944
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
Definition: doc.cxx:356
vcl::Window & GetWindow() const
const SwView & GetView() const
Definition: wrtsh.hxx:428
#define FN_MAILMERGE_EMAIL_DOCUMENTS
Definition: cmdid.h:238
virtual void ExecuteMMResultPrintDialog(weld::Window *pParent)=0
void StateOther(SfxItemSet &)
Definition: apphdl.cxx:105
void InsertEnv(SfxRequest &)
Definition: appenv.cxx:130
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:84
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:160
void CommitLastRegistrations()
Accept not committed registrations.
Definition: dbmgr.cxx:3289
virtual void ExecuteMMResultSaveDialog(weld::Window *pParent)=0
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:113
virtual void ExecuteMMResultEmailDialog(weld::Window *pParent)=0
std::unique_ptr< SvtAccessibilityOptions > m_pAccessibilityOptions
Definition: swmodule.hxx:92
SwDoc * GetDoc()
returns Doc. But be careful!
Definition: docsh.hxx:203
SVT_DLLPUBLIC bool executeRestartDialog(css::uno::Reference< css::uno::XComponentContext > const &context, weld::Window *parent, RestartReason reason)
bool HasSelection() const
Definition: wrtsh.hxx:141
void GetAllUsedDB(std::vector< OUString > &rDBNameList, std::vector< OUString > const *pAllDBNames)
Definition: edfld.cxx:309
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
SW_DLLPUBLIC FieldUnit GetDfltMetric(bool bWeb)
Definition: uitool.cxx:698
#define FN_MAILMERGE_CURRENT_ENTRY
Definition: cmdid.h:230
std::unique_ptr< SwStdFontConfig > m_pStdFontConfig
Definition: swmodule.hxx:86
void GetAllUsedDB(std::vector< OUString > &rDBNameList, const std::vector< OUString > *pAllDBNames=nullptr)
Definition: docfld.cxx:412
void AppearWithUpdate()
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
bool IsInsTableFormatNum(bool bHTML) const
Definition: swmodul1.cxx:554
SwWrtShell * GetWrtShell()
Access to the SwWrtShell belonging to SwView.
Definition: docsh.hxx:224
SvtUserOptions & GetUserOptions()
Definition: apphdl.cxx:1037
SfxItemSet * GetItemSet() const
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
SfxViewFrame * GetTopViewFrame() const
#define FN_MAILMERGE_PRINT_DOCUMENTS
Definition: cmdid.h:237
void Lock(bool bLock)
OUString SwResId(const char *pId)
Definition: swmodule.cxx:178
virtual VclPtr< AbstractMailMergeWizard > CreateMailMergeWizard(SwView &rView, std::shared_ptr< SwMailMergeConfigItem > &rConfigItem)=0
void ChgNumberDigits()
Definition: viewsh.cxx:963
static void ApplyColorConfigValues(const svtools::ColorConfig &rConfig)
Definition: viewopt.cxx:450
static SfxViewShell * GetFirst(bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
#define FN_MAILMERGE_LAST_ENTRY
Definition: cmdid.h:229
#define DB_DELIM
Definition: swtypes.hxx:141
SfxViewShell * GetViewShell() const
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:404
void UpdateGlosPath(bool bFull)
Definition: glosdoc.cxx:347
SwDocShell * GetDocShell()
Definition: view.cxx:1107
bool IsReadOnly() const
std::unique_ptr< svtools::ColorConfig > m_pColorConfig
Definition: swmodule.hxx:91
void InsertLab(SfxRequest &, bool bLabel)
Definition: applab.cxx:136
SelectionType
Definition: wrtsh.hxx:58
void SetReturnValue(const SfxPoolItem &)
weld::Window * GetFrameWeld() const
void Update(sal_uInt16 nId)
#define TOOLS_INFO_EXCEPTION(area, stream)
#define RET_REMOVE_TARGET
Definition: swabstdlg.hxx:346
static std::shared_ptr< SwMailMergeConfigItem > PerformMailMerge(SwView const *pView)
Definition: dbmgr.cxx:3236
std::unique_ptr< SwModuleOptions, o3tl::default_delete< SwModuleOptions > > m_pModuleConfig
Definition: swmodule.hxx:80
std::unique_ptr< SwToolbarConfigItem > m_pWebToolbarConfig
Definition: swmodule.hxx:89
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
sal_uInt16 GetSlot() const
#define FN_MAILMERGE_PREV_ENTRY
Definition: cmdid.h:227
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:226
#define FN_MAILMERGE_CREATE_DOCUMENTS
Definition: cmdid.h:235
virtual void SetFixFields(const DateTime *pNewDateTime)=0
bool DoInitNew(SfxMedium *pMedium=nullptr)
std::unique_ptr< SwMasterUsrPref, o3tl::default_delete< SwMasterUsrPref > > m_pUsrPref
Definition: swmodule.hxx:81
Reference< XComponentContext > getProcessComponentContext()
std::unique_ptr< SwPrintOptions > m_pPrintOptions
Definition: swmodule.hxx:83
std::unique_ptr< SvtCTLOptions > m_pCTLOptions
Definition: swmodule.hxx:93
svtools::ColorConfig & GetColorConfig()
Definition: apphdl.cxx:1006
vcl::Window * GetWindow() const
bool DoClose()
std::unique_ptr< SwNavigationConfig > m_pNavigationConfig
Definition: swmodule.hxx:87
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage)
std::unique_ptr< SwToolbarConfigItem > m_pToolbarConfig
Definition: swmodule.hxx:88
bool IsLocked() const
void ExecOther(SfxRequest &)
Definition: apphdl.cxx:682
std::unique_ptr< SvtUserOptions > m_pUserOptions
Definition: swmodule.hxx:94
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:1027
bool GetDisablePrinting() const
SelectionType GetSelectionType() const
Definition: wrtsh1.cxx:1388
void SetDfltMetric(FieldUnit eMetric, bool bWeb)
Definition: uitool.cxx:705
OUString sCommand
Definition: swdbdata.hxx:31
#define FN_SET_MODOPT_TBLNUMFMT
Definition: cmdid.h:177
#define FN_MAILMERGE_WIZARD
Definition: cmdid.h:221
SwDBManager * GetDBManager() const
Definition: doc.hxx:664
Definition: view.hxx:146
IMPL_LINK_NOARG(FormFieldButton, FieldPopupModeEndHdl, FloatingWindow *, void)
sal_uInt16 nPos
#define SFX_OBJECTBAR_APPLICATION
SfxMedium * GetMedium() const
SwGlossaryList * GetGlossaryList()
Definition: initui.cxx:172