diff options
author | Jan Holesovsky <kendy@collabora.com> | 2015-12-18 12:21:40 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-03-18 09:13:56 +0100 |
commit | ac522d12b6e10b04f1c62709a96673062fdd000a (patch) | |
tree | b6436365379ecc2b9763859946ce1498a2ac3eb7 /sw/source/uibase | |
parent | 7b93b5e96af5427ab4d909e09b7ea98c8600a014 (diff) |
mailmerge: Introduce a mailmerge toolbar.
So far contains just a button to start the mailmerge wizard, and it is shown
when the mailmerge wizard starts.
The plan is that the last 3 steps (Edit document; Personalize document; Save,
print or send) will be removed from the wizard, and instead introduced in the
mailmerge toolbar.
Change-Id: I3a55a5b3b8a73bc6775579ac42c4ae30c6c9bac6
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/app/apphdl.cxx | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx index ab8ba8cd8d00..daa58c198931 100644 --- a/sw/source/uibase/app/apphdl.cxx +++ b/sw/source/uibase/app/apphdl.cxx @@ -87,6 +87,7 @@ #include <editeng/unolingu.hxx> #include <com/sun/star/beans/XMultiPropertySet.hpp> #include <com/sun/star/beans/XFastPropertySet.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertyState.hpp> #include <com/sun/star/beans/XPropertyStateChangeListener.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> @@ -672,11 +673,36 @@ void SwModule::ExecOther(SfxRequest& rReq) #if HAVE_FEATURE_DBCONNECTIVITY case FN_MAILMERGE_WIZARD: { + // show the mailmerge wizard rtl::Reference< SwMailMergeWizardExecutor > xEx( new SwMailMergeWizardExecutor ); xEx->ExecuteMailMergeWizard( pArgs ); + + // show the mailmerge toolbar + SwView* pView = ::GetActiveView(); + if (!pView) + return; + + uno::Reference<beans::XPropertySet> xPropSet(pView->GetViewFrame()->GetFrame().GetFrameInterface(), uno::UNO_QUERY); + if (!xPropSet.is()) + return; + + uno::Reference<frame::XLayoutManager> xLayoutManager; + uno::Any aValue = xPropSet->getPropertyValue("LayoutManager"); + aValue >>= xLayoutManager; + if (!xLayoutManager.is()) + return; + + const OUString sResourceURL( "private:resource/toolbar/mailmerge" ); + uno::Reference<ui::XUIElement> xUIElement = xLayoutManager->getElement(sResourceURL); + if (!xUIElement.is()) + { + // do the work, finally + xLayoutManager->createElement(sResourceURL); + xLayoutManager->showElement(sResourceURL); + } } -#endif break; +#endif } } |