summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Johansson <sleeping.pillow@gmail.com>2016-11-01 12:19:08 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-12-05 09:18:43 +0000
commitf4cdf96b43db7c39ae8f23896d44368807f5f500 (patch)
treec94e517ce0fa554060f02fbe34865169ea577892
parent60c3c615c8cf4e1f2ccb9d61c5f0d748827bb828 (diff)
tdf#93592 Make it possible to add default language resource to dialogeditor
During the conversion of uno services a few lines where removed that probably should not have been removed. This caused the dialog editor to crash if you tried to add a new language resource to a document fdo#93077. The fix for that bug fixed the crash but also made it imposible to add a language resource to a dialog that isn't previously translated. With this patch the functionality should be back on track, adding/removing language resources without problems at least as far as my testing goes. Change-Id: Ie6e083837894a219bf8e9c75dec6bf7652d51615 Reviewed-on: https://gerrit.libreoffice.org/30462 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> (cherry picked from commit 1453bc4ab3d42c34c32a7da63ed6f7bdbe513c2d) Reviewed-on: https://gerrit.libreoffice.org/31533 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--basctl/source/dlged/managelang.cxx19
-rw-r--r--basic/source/uno/dlgcont.cxx6
2 files changed, 11 insertions, 14 deletions
diff --git a/basctl/source/dlged/managelang.cxx b/basctl/source/dlged/managelang.cxx
index 56c0e8c67384..063e981cb425 100644
--- a/basctl/source/dlged/managelang.cxx
+++ b/basctl/source/dlged/managelang.cxx
@@ -149,19 +149,12 @@ IMPL_LINK_NOARG_TYPED(ManageLanguageDialog, AddHdl, Button*, void)
ScopedVclPtrInstance< SetDefaultLanguageDialog > aDlg( this, m_xLocalizationMgr );
if ( RET_OK == aDlg->Execute() )
{
- if (!m_xLocalizationMgr->isLibraryLocalized())
- {
- SAL_WARN("basctl.basicide", "Adding langs to non-localized library tdf#93077");
- }
- else
- {
- // add new locales
- Sequence< Locale > aLocaleSeq = aDlg->GetLocales();
- m_xLocalizationMgr->handleAddLocales( aLocaleSeq );
- // update listbox
- ClearLanguageBox();
- FillLanguageBox();
- }
+ // add new locales
+ Sequence< Locale > aLocaleSeq = aDlg->GetLocales();
+ m_xLocalizationMgr->handleAddLocales( aLocaleSeq );
+ // update listbox
+ ClearLanguageBox();
+ FillLanguageBox();
if (SfxBindings* pBindings = GetBindingsPtr())
pBindings->Invalidate( SID_BASICIDE_CURRENT_LANG );
diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx
index 2a8684e494bb..f9ea797aa7c2 100644
--- a/basic/source/uno/dlgcont.cxx
+++ b/basic/source/uno/dlgcont.cxx
@@ -380,7 +380,11 @@ Reference< css::resource::XStringResourcePersistence >
}
catch(const uno::Exception& )
{
- // TODO: Error handling?
+ // Something went wrong while trying to get the storage library.
+ // Return an object that supports StringResourceWithStorage, give it a storage location later.
+ xRet = Reference< resource::XStringResourcePersistence >(
+ mxContext->getServiceManager()->createInstanceWithContext("com.sun.star.resource.StringResourceWithStorage", mxContext),
+ UNO_QUERY );
return xRet;
}