diff -Nru libreoffice-l10n-4.4.3~rc2/debian/changelog libreoffice-l10n-4.4.3~rc2/debian/changelog --- libreoffice-l10n-4.4.3~rc2/debian/changelog 2015-05-12 15:14:04.000000000 +0000 +++ libreoffice-l10n-4.4.3~rc2/debian/changelog 2015-05-19 15:09:10.000000000 +0000 @@ -1,3 +1,9 @@ +libreoffice-l10n (1:4.4.3~rc2-0ubuntu1~vivid4) vivid; urgency=medium + + * Fix mailmerge without libreoffice-base scenario + + -- Bjoern Michaelsen Tue, 19 May 2015 17:01:04 +0200 + libreoffice-l10n (1:4.4.3~rc2-0ubuntu1~vivid3) vivid; urgency=medium * add upstream hack to prevent crash on exit (LP: #1418551) diff -Nru libreoffice-l10n-4.4.3~rc2/debian/patches/mailmerge-base.diff libreoffice-l10n-4.4.3~rc2/debian/patches/mailmerge-base.diff --- libreoffice-l10n-4.4.3~rc2/debian/patches/mailmerge-base.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-l10n-4.4.3~rc2/debian/patches/mailmerge-base.diff 2015-05-19 15:04:16.000000000 +0000 @@ -0,0 +1,162 @@ +From: Bjoern Michaelsen +Date: Tue, 19 May 2015 13:58:13 +0200 +Subject: [PATCH] check for and handle missing base in mail merge (related: + fdo#33266) + +Change-Id: I3e362a873c28026cbecf005c07def1295aa920e0 + +Conflicts: + sw/source/uibase/app/apphdl.cxx + +--- + include/svtools/restartdialog.hxx | 5 +++- + svtools/source/dialogs/restartdialog.cxx | 3 +++ + svtools/uiconfig/ui/restartdialog.ui | 15 +++++++++++ + sw/source/uibase/app/apphdl.cxx | 45 +++++++++++++++++++++++++++++++- + 4 files changed, 66 insertions(+), 2 deletions(-) + +diff --git a/include/svtools/restartdialog.hxx b/include/svtools/restartdialog.hxx +--- a/include/svtools/restartdialog.hxx ++++ b/include/svtools/restartdialog.hxx +@@ -29,9 +29,12 @@ enum RestartReason { + RESTART_REASON_PDF_AS_STANDARD_JOB_FORMAT, + // For the modified default print job format to take effect, + // %PRODUCTNAME must be restarted. +- RESTART_REASON_BIBLIOGRAPHY_INSTALL ++ RESTART_REASON_BIBLIOGRAPHY_INSTALL, + // "For the bibliography to work properly, + // %PRODUCTNAME must be restarted." ++ RESTART_REASON_MAILMERGE_INSTALL ++ // "For the mail merge to work properly, ++ // %PRODUCTNAME must be restarted." + }; + + // Must be called with the solar mutex locked: +diff --git a/svtools/source/dialogs/restartdialog.cxx b/svtools/source/dialogs/restartdialog.cxx +--- a/svtools/source/dialogs/restartdialog.cxx ++++ b/svtools/source/dialogs/restartdialog.cxx +@@ -40,6 +40,9 @@ public: + case svtools::RESTART_REASON_BIBLIOGRAPHY_INSTALL: + get(reason_, "reason_bibliography_install"); + break; ++ case svtools::RESTART_REASON_MAILMERGE_INSTALL: ++ get(reason_, "reason_mailmerge_install"); ++ break; + default: + assert(false); // this cannot happen + } +diff --git a/svtools/uiconfig/ui/restartdialog.ui b/svtools/uiconfig/ui/restartdialog.ui +--- a/svtools/uiconfig/ui/restartdialog.ui ++++ b/svtools/uiconfig/ui/restartdialog.ui +@@ -101,6 +101,21 @@ + + + ++ ++ False ++ True ++ 0 ++ For the mail merge to work properly, %PRODUCTNAME must be restarted. ++ True ++ 50 ++ ++ ++ False ++ True ++ 2 ++ ++ ++ + + True + False +diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx +--- a/sw/source/uibase/app/apphdl.cxx ++++ b/sw/source/uibase/app/apphdl.cxx +@@ -21,17 +21,19 @@ + + #include + ++#include + #include + #include + #include + #include +-#include + #include + #include + #include + #include + #include ++#include + #include ++#include + #include + #include + #include +@@ -92,7 +94,9 @@ + #include + #include + #include ++#include + #include ++#include + #include + + #include +@@ -115,6 +119,24 @@ using namespace ::com::sun::star; + + #include + ++namespace ++{ ++ static bool lcl_hasAllComponentsAvailable() ++ { ++ try ++ { ++ return css::sdb::TextConnectionSettings::create(comphelper::getProcessComponentContext()).is(); ++ } ++ catch (css::uno::Exception & e) ++ { ++ SAL_INFO( ++ "sw.core", ++ "assuming Base to be missing; caught " << e.Message); ++ return false; ++ } ++ } ++} ++ + SFX_IMPL_INTERFACE(SwModule, SfxModule, SW_RES(RID_SW_NAME) ) + + void SwModule::InitInterface_Impl() +@@ -277,6 +299,27 @@ SwMailMergeWizardExecutor::~SwMailMergeWizardExecutor() + + void SwMailMergeWizardExecutor::ExecuteMailMergeWizard( const SfxItemSet * pArgs ) + { ++ if(!lcl_hasAllComponentsAvailable()) ++ { ++ try ++ { ++ using namespace org::freedesktop::PackageKit; ++ using namespace svtools; ++ css::uno::Reference< XSyncDbusSessionHelper > xSyncDbusSessionHelper(SyncDbusSessionHelper::create(comphelper::getProcessComponentContext())); ++ const css::uno::Sequence< OUString > vPackages{ "libreoffice-base" }; ++ OUString sInteraction; ++ xSyncDbusSessionHelper->InstallPackageNames(0, vPackages, sInteraction); ++ SolarMutexGuard aGuard; ++ executeRestartDialog(comphelper::getProcessComponentContext(), NULL, RESTART_REASON_MAILMERGE_INSTALL); ++ } ++ catch (const css::uno::Exception & e) ++ { ++ SAL_INFO( ++ "sw.core", ++ "trying to install LibreOffice Base, caught " << e.Message); ++ } ++ return; ++ } + if ( m_pView ) + { + OSL_FAIL("SwMailMergeWizardExecutor::ExecuteMailMergeWizard: Already executing the wizard!" ); +-- +1.9.1 + diff -Nru libreoffice-l10n-4.4.3~rc2/debian/patches/series libreoffice-l10n-4.4.3~rc2/debian/patches/series --- libreoffice-l10n-4.4.3~rc2/debian/patches/series 2015-05-12 15:10:26.000000000 +0000 +++ libreoffice-l10n-4.4.3~rc2/debian/patches/series 2015-05-19 15:04:16.000000000 +0000 @@ -30,3 +30,4 @@ lp-753627-readd-updated-Ubuntu-brand-palette-colors.diff kubuntu_breeze-icons.diff lp-1418551.diff +mailmerge-base.diff