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