Blame SOURCES/0052-Resolves-fdo-80906-Delete-any-control-on-Dialog-edit.patch

f085be
From 5f712e0376cf77386b788093e9d19cfd0ea29913 Mon Sep 17 00:00:00 2001
f085be
From: Julien Nabet <serval2412@yahoo.fr>
f085be
Date: Mon, 21 Jul 2014 19:26:58 +0200
f085be
Subject: [PATCH 052/137] Resolves fdo#80906: Delete any control on Dialog
f085be
 editing window crashes LO
f085be
MIME-Version: 1.0
f085be
Content-Type: text/plain; charset=UTF-8
f085be
Content-Transfer-Encoding: 8bit
f085be
f085be
Quick fix for this bt:
f085be
3  0x00002aaaab2935d2 in __GI___assert_fail (assertion=0x2aaae1f2806a "_pInterface != 0",
f085be
    file=0x2aaae1f28018 "/home/julien/compile-libreoffice/libreoffice/include/com/sun/star/uno/Reference.h", line=402,
f085be
    function=0x2aaae1f28480 <com::sun::star::uno::Reference<com::sun::star::resource::XStringResourceManager>::operator->() const::__PRETTY_FUNCTION__> "interface_type* com::sun::star::uno::Reference< <template-parameter-1-1> >::operator->() const [with interface_type = com::sun::star::resource::XStringResourceManager]") at assert.c:101
f085be
4  0x00002aaae1e2963b in com::sun::star::uno::Reference<com::sun::star::resource::XStringResourceManager>::operator-> (this=0x7fffffff2d00)
f085be
    at /home/julien/compile-libreoffice/libreoffice/include/com/sun/star/uno/Reference.h:402
f085be
5  0x00002aaae1eb5c87 in basctl::LocalizationMgr::implHandleControlResourceProperties (aControlAny=
f085be
    uno::Any {<com::sun::star::uno::XInterface> = {_vptr.XInterface = 0x8935ea8}, <No data fields>}, aDialogName="Dialog1", aCtrlName="TextField1",
f085be
    xStringResourceManager=empty uno::Reference, xSourceStringResolver=empty uno::Reference, eMode=basctl::LocalizationMgr::REMOVE_IDS_FROM_RESOURCE)
f085be
    at /home/julien/compile-libreoffice/libreoffice/basctl/source/basicide/localizationmgr.cxx:202
f085be
6  0x00002aaae1eb92a0 in basctl::LocalizationMgr::deleteControlResourceIDsForDeletedEditorObject (pEditor=0x919d820, aControlAny=
f085be
    uno::Any {<com::sun::star::uno::XInterface> = {_vptr.XInterface = 0x8935ea8}, <No data fields>}, aCtrlName="TextField1")
f085be
    at /home/julien/compile-libreoffice/libreoffice/basctl/source/basicide/localizationmgr.cxx:896
f085be
Indeed, LocalizationMgr::setControlResourceIDsForNewEditorObject just returns if !xStringResourceManager.is()
f085be
So let's do the same when trying to delete ControlResources
f085be
See http://opengrok.libreoffice.org/xref/core/basctl/source/basicide/localizationmgr.cxx#835
f085be
f085be
Cherry-picked from e1840cf944b36b7ead5800a036870e38f4ddb049
f085be
f085be
Change-Id: I4be49503cd2464f97a25840dfdc29877e5fb2b93
f085be
Reviewed-on: https://gerrit.libreoffice.org/10449
f085be
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
f085be
Tested-by: Caolán McNamara <caolanm@redhat.com>
f085be
---
f085be
 basctl/source/basicide/localizationmgr.cxx | 2 +-
f085be
 1 file changed, 1 insertion(+), 1 deletion(-)
f085be
f085be
diff --git a/basctl/source/basicide/localizationmgr.cxx b/basctl/source/basicide/localizationmgr.cxx
f085be
index 2812387..9d0cc87 100644
f085be
--- a/basctl/source/basicide/localizationmgr.cxx
f085be
+++ b/basctl/source/basicide/localizationmgr.cxx
f085be
@@ -199,7 +199,7 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties
f085be
 
f085be
     Reference< XPropertySet > xPropertySet;
f085be
     aControlAny >>= xPropertySet;
f085be
-    if( xPropertySet.is() )
f085be
+    if( xPropertySet.is() && xStringResourceManager.is())
f085be
     {
f085be
         Sequence< Locale > aLocaleSeq = xStringResourceManager->getLocales();
f085be
         sal_Int32 nLocaleCount = aLocaleSeq.getLength();
f085be
-- 
f085be
1.9.3
f085be