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