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