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/isethint.hxx>
33#include <svl/stritem.hxx>
34#include <sfx2/request.hxx>
35#include <sfx2/fcontnr.hxx>
36#include <svl/ctloptions.hxx>
37#include <svtools/colorcfg.hxx>
41#include <com/sun/star/document/UpdateDocMode.hpp>
42#include <sfx2/docfile.hxx>
43#include <sfx2/objface.hxx>
44#include <vcl/settings.hxx>
45#include <vcl/svapp.hxx>
46#include <o3tl/string_view.hxx>
47
48#include <view.hxx>
49#include <pview.hxx>
50#include <srcview.hxx>
51#include <wrtsh.hxx>
52#include <docsh.hxx>
53#include <cmdid.h>
54#include <initui.hxx>
55#include <uitool.hxx>
56#include <swmodule.hxx>
57#include <wview.hxx>
58#include <usrpref.hxx>
59#include <gloslst.hxx>
60#include <glosdoc.hxx>
61#include <doc.hxx>
64#include <prtopt.hxx>
65#include <modcfg.hxx>
66#include <fontcfg.hxx>
67#include <barcfg.hxx>
68#include <navicfg.hxx>
69#include <uinums.hxx>
70#include <dbconfig.hxx>
71#include <mmconfigitem.hxx>
72#include <strings.hrc>
73#include <com/sun/star/container/XChild.hpp>
74#include <com/sun/star/sdbc/XConnection.hpp>
75#include <com/sun/star/sdb/TextConnectionSettings.hpp>
76#include <com/sun/star/sdbc/XDataSource.hpp>
77#include <com/sun/star/task/OfficeRestartManager.hpp>
78#include <org/freedesktop/PackageKit/SyncDbusSessionHelper.hpp>
79#include <swabstdlg.hxx>
82#include <comphelper/lok.hxx>
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 = SfxItemSet::GetItem<SfxBoolItem>(pDocSh->GetMedium()->GetItemSet(), 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 = SfxItemSet::GetItem<SfxUInt16Item>(pDocSh->GetMedium()->GetItemSet(), 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 if(const SfxItemSetHint* pSfxItemSetHint = dynamic_cast<const SfxItemSetHint*>(&rHint))
922 {
923 if( SfxItemState::SET == pSfxItemSetHint->GetItemSet().GetItemState(SID_ATTR_PATHNAME))
924 {
927 if(pList->IsActive())
928 pList->Update();
929 }
930 }
931 else
932 {
933 if (rHint.GetId() == SfxHintId::Deinitializing)
934 {
935 m_pWebUsrPref.reset();
936 m_pUsrPref.reset();
937 m_pModuleConfig.reset();
938 m_pPrintOptions.reset();
939 m_pWebPrintOptions.reset();
940 m_pChapterNumRules.reset();
941 m_pStdFontConfig.reset();
942 m_pNavigationConfig.reset();
943 m_pToolbarConfig.reset();
944 m_pWebToolbarConfig.reset();
945 m_pDBConfig.reset();
946 if( m_pColorConfig )
947 {
948 m_pColorConfig->RemoveListener(this);
949 m_pColorConfig.reset();
950 }
952 {
953 m_pAccessibilityOptions->RemoveListener(this);
955 }
956 if( m_pCTLOptions )
957 {
958 m_pCTLOptions->RemoveListener(this);
959 m_pCTLOptions.reset();
960 }
961 if( m_pUserOptions )
962 {
963 m_pUserOptions->RemoveListener(this);
964 m_pUserOptions.reset();
965 }
966 }
967 }
968}
969
971{
972 if( pBrdCst == m_pUserOptions.get() )
973 {
974 m_bAuthorInitialised = false;
975 }
976 else if ( pBrdCst == m_pColorConfig.get() )
977 {
978 //invalidate only the current view in tiled rendering mode, or all views otherwise
979 bool bOnlyInvalidateCurrentView = comphelper::LibreOfficeKit::isActive();
980 SfxViewShell* pViewShell = bOnlyInvalidateCurrentView ? SfxViewShell::Current() : SfxViewShell::GetFirst();
981 while(pViewShell)
982 {
983 if(pViewShell->GetWindow())
984 {
985 auto pSwView = dynamic_cast<SwView *>( pViewShell );
986 if(pSwView != nullptr ||
987 dynamic_cast< const SwPagePreview *>( pViewShell ) != nullptr ||
988 dynamic_cast< const SwSrcView *>( pViewShell ) != nullptr)
989 {
990 SwViewOption aNewOptions = *pSwView->GetWrtShell().GetViewOptions();
991 aNewOptions.SetThemeName(m_pColorConfig->GetCurrentSchemeName());
992 aNewOptions.SetColorConfig(*m_pColorConfig);
993 pSwView->GetWrtShell().ApplyViewOptions(aNewOptions);
994 pViewShell->GetWindow()->Invalidate();
995 }
996 }
997 if (bOnlyInvalidateCurrentView)
998 break;
999 pViewShell = SfxViewShell::GetNext( *pViewShell );
1000 }
1001 }
1002#if !ENABLE_WASM_STRIP_ACCESSIBILITY
1003 else if ( pBrdCst == m_pAccessibilityOptions.get() )
1004 {
1005 //set Accessibility options
1006 SfxViewShell* pViewShell = SfxViewShell::GetFirst();
1007 while(pViewShell)
1008 {
1009 if(pViewShell->GetWindow())
1010 {
1011 auto pSwView = dynamic_cast<SwView *>( pViewShell );
1012 auto pPagePreview = dynamic_cast<SwPagePreview *>( pViewShell );
1013
1014 if(pSwView)
1016 else if(pPagePreview)
1017 pPagePreview->ApplyAccessibilityOptions(*m_pAccessibilityOptions);
1018
1019 if(pSwView || pPagePreview || dynamic_cast< const SwSrcView *>( pViewShell ) != nullptr)
1020 {
1021 pViewShell->GetWindow()->Invalidate();
1022 }
1023 }
1024 pViewShell = SfxViewShell::GetNext( *pViewShell );
1025 }
1026 }
1027#endif
1028 else if( pBrdCst == m_pCTLOptions.get() )
1029 {
1030 const SfxObjectShell* pObjSh = SfxObjectShell::GetFirst();
1031 while( pObjSh )
1032 {
1033 if( auto pDocShell = dynamic_cast<const SwDocShell*>(pObjSh) )
1034 {
1035 SwDoc* pDoc = const_cast<SwDocShell*>(pDocShell)->GetDoc();
1037 if ( pVSh )
1038 pVSh->ChgNumberDigits();
1039 }
1040 pObjSh = SfxObjectShell::GetNext(*pObjSh);
1041 }
1042 }
1043
1044}
1045
1047{
1048 if(!m_pDBConfig)
1049 m_pDBConfig.reset(new SwDBConfig);
1050 return m_pDBConfig.get();
1051}
1052
1054{
1055 if(!m_pColorConfig)
1056 {
1059 m_pColorConfig->AddListener(this);
1060 }
1061 return *m_pColorConfig;
1062}
1063
1065{
1067 {
1069 m_pAccessibilityOptions->AddListener(this);
1070 }
1072}
1073
1075{
1076 if(!m_pCTLOptions)
1077 {
1078 m_pCTLOptions.reset(new SvtCTLOptions);
1079 m_pCTLOptions->AddListener(this);
1080 }
1081 return *m_pCTLOptions;
1082}
1083
1085{
1086 if(!m_pUserOptions)
1087 {
1088 m_pUserOptions.reset(new SvtUserOptions);
1089 m_pUserOptions->AddListener(this);
1090 }
1091 return *m_pUserOptions;
1092}
1093
1095{
1096 SwModule* pNonConstModule = const_cast<SwModule*>(this);
1097 if(bWeb && !m_pWebUsrPref)
1098 {
1099 // The SpellChecker is needed in SwMasterUsrPref's Load, but it must not
1100 // be created there #58256#
1101 pNonConstModule->m_pWebUsrPref.reset(new SwMasterUsrPref(true));
1102 }
1103 else if(!bWeb && !m_pUsrPref)
1104 {
1105 pNonConstModule->m_pUsrPref.reset(new SwMasterUsrPref(false));
1106 }
1107 return bWeb ? m_pWebUsrPref.get() : m_pUsrPref.get();
1108}
1109
1111{
1112 // copied & excerpted from SwModule::InsertLab(..)
1113
1114 // create new document
1115 SfxObjectShellLock xDocSh( new SwDocShell( SfxObjectCreateMode::STANDARD) );
1116 xDocSh->DoInitNew();
1117
1118 // initialize XForms
1119 static_cast<SwDocShell*>( &xDocSh )->GetDoc()->initXForms( true );
1120
1121 // load document into frame
1122 SfxViewFrame::DisplayNewDocument( *xDocSh, rReq );
1123
1124 // set return value
1125 rReq.SetReturnValue( SfxVoidItem( rReq.GetSlot() ) );
1126}
1127
1128/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static void NewXForms(SfxRequest &rReq)
Definition: apphdl.cxx:1110
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
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 * 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)
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:3243
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:3218
void CommitLastRegistrations()
Accept not committed registrations.
Definition: dbmgr.cxx:3271
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:195
SwDBManager * GetDBManager() const
Definition: doc.hxx:681
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
Definition: doc.cxx:365
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:413
void GetAllUsedDB(std::vector< OUString > &rDBNameList, const std::vector< OUString > *pAllDBNames=nullptr)
Definition: docfld.cxx:444
SwDocShell * GetDocShell()
Definition: doc.hxx:1364
SwDBManager * GetDBManager() const
For evaluation of DB fields (new DB-manager).
Definition: edfld.cxx:335
void GetAllUsedDB(std::vector< OUString > &rDBNameList, std::vector< OUString > const *pAllDBNames)
Definition: edfld.cxx:308
void UpdateGlosPath(bool bFull)
Definition: glosdoc.cxx:348
void Update()
Definition: gloslst.cxx:234
std::unique_ptr< SwStdFontConfig > m_pStdFontConfig
Definition: swmodule.hxx:85
std::unique_ptr< SwPrintOptions > m_pWebPrintOptions
Definition: swmodule.hxx:83
SvtAccessibilityOptions & GetAccessibilityOptions()
Definition: apphdl.cxx:1064
virtual void ConfigurationChanged(utl::ConfigurationBroadcaster *, ConfigurationHints) override
Definition: apphdl.cxx:970
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:1084
svtools::ColorConfig & GetColorConfig()
Definition: apphdl.cxx:1053
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:1094
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:1046
bool m_bAuthorInitialised
Definition: swmodule.hxx:112
SvtCTLOptions & GetCTLOptions()
Definition: apphdl.cxx:1074
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(SvtAccessibilityOptions const &rAccessibilityOptions)
Definition: pview.cxx:1843
static void SetInitialColorConfig(const SwViewColors &rColorConfig)
Definition: viewopt.hxx:328
void SetThemeName(const OUString &rThemeName)
Definition: viewopt.hxx:318
void SetColorConfig(const SwViewColors &rColorConfig)
Definition: viewopt.hxx:308
void ChgNumberDigits()
Definition: viewsh.cxx:1062
Definition: view.hxx:146
SwWrtShell & GetWrtShell() const
Definition: view.hxx:421
std::shared_ptr< SwMailMergeConfigItem > const & GetMailMergeConfigItem() const
Definition: view0.cxx:136
std::shared_ptr< SwMailMergeConfigItem > EnsureMailMergeConfigItem(const SfxItemSet *pArgs=nullptr)
Definition: apphdl.cxx:237
SwDocShell * GetDocShell()
Definition: view.cxx:1163
void SetMailMergeConfigItem(std::shared_ptr< SwMailMergeConfigItem > const &rConfigItem)
Definition: view0.cxx:130
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
SelectionType GetSelectionType() const
Definition: wrtsh1.cxx:1717
bool HasSelection() const
Definition: wrtsh.hxx:147
const SwView & GetView() const
Definition: wrtsh.hxx:443
bool IsActive() const
bool has(DataAccessDescriptorProperty _eWhich) const
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
#define FN_MAILMERGE_EMAIL_DOCUMENTS
Definition: cmdid.h:262
#define FN_PARAM_DATABASE_PROPERTIES
Definition: cmdid.h:850
#define FN_MAILMERGE_WIZARD
Definition: cmdid.h:245
#define FN_MAILMERGE_PRINT_DOCUMENTS
Definition: cmdid.h:261
#define FN_MAILMERGE_FIRST_ENTRY
Definition: cmdid.h:250
#define FN_MAILMERGE_LAST_ENTRY
Definition: cmdid.h:253
#define FN_EDIT_FORMULA
Definition: cmdid.h:84
#define FN_SET_MODOPT_TBLNUMFMT
Definition: cmdid.h:181
#define FN_MAILMERGE_CURRENT_ENTRY
Definition: cmdid.h:254
#define FN_MAILMERGE_CREATE_DOCUMENTS
Definition: cmdid.h:259
#define FN_MAILMERGE_EXCLUDE_ENTRY
Definition: cmdid.h:255
#define FN_MAILMERGE_SAVE_DOCUMENTS
Definition: cmdid.h:260
#define FN_MAILMERGE_PREV_ENTRY
Definition: cmdid.h:251
#define FN_MAILMERGE_NEXT_ENTRY
Definition: cmdid.h:252
#define FN_ENVELOP
Definition: cmdid.h:781
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
SwGlossaryList * GetGlossaryList()
Definition: initui.cxx:174
SW_DLLPUBLIC SwGlossaries * GetGlossaries()
Definition: initui.cxx:162
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
#define RET_TARGET_CREATED
Definition: swabstdlg.hxx:381
#define RET_LOAD_DOC
Definition: swabstdlg.hxx:380
#define RET_REMOVE_TARGET
Definition: swabstdlg.hxx:382
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:762
SW_DLLPUBLIC FieldUnit GetDfltMetric(bool bWeb)
Definition: uitool.cxx:755
RET_CANCEL