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