https://bugs.freedesktop.org/show_bug.cgi?id=71027

--- Comment #1 from Lionel Elie Mamane <lio...@mamane.lu> ---
The immediate cause for this is:

java.lang.NullPointerException
    at
com.sun.star.wizards.form.StyleApplier.setDBControlColors(StyleApplier.java:347)
    at
com.sun.star.wizards.form.StyleApplier.applyDBControlProperties(StyleApplier.java:397)
    at com.sun.star.wizards.form.StyleApplier.applyStyle(StyleApplier.java:199)
    at
com.sun.star.wizards.form.FormDocument$ControlForm.initialize(FormDocument.java:417)
    at
com.sun.star.wizards.form.UIControlArranger$ArrangeButtonList.itemStateChanged(UIControlArranger.java:446)
    at com.sun.star.wizards.ui.ButtonList.fireItemSelected(ButtonList.java:429)
    at com.sun.star.wizards.ui.ButtonList.setSelected(ButtonList.java:571)
    at com.sun.star.wizards.ui.ButtonList.actionPerformed(ButtonList.java:792)
    at com.sun.star.bridges.jni_uno.JNI_proxy.dispatch_call(Native Method)
    at com.sun.star.bridges.jni_uno.JNI_proxy.invoke(JNI_proxy.java:183)
    at sun.proxy.$Proxy76.execute(Unknown Source)
    at com.sun.star.wizards.ui.UnoDialog.executeDialog(UnoDialog.java:698)
    at com.sun.star.wizards.ui.UnoDialog.executeDialog(UnoDialog.java:737)
    at com.sun.star.wizards.form.FormWizard.start(FormWizard.java:355)
    at
com.sun.star.wizards.form.CallFormWizard$FormWizardImplementation.trigger(CallFormWizard.java:75)


which is itself caused by
  file wizards/com/sun/star/wizards/form/StyleApplier.java, function
applyDBControlProperties:
  XPropertySet xPropertySet =
oTimeStampControl.getControlofGroupShapeByIndex(i);
getControlofGroupShapeByIndex returns null, which is caused by
  file wizards/com/sun/star/wizards/document/TimeStampControl.java, function
getControlofGroupShapeByIndex

  Object oControl = xShapes.getByIndex(_i);
  XControlShape xControlShape = UnoRuntime.queryInterface(XControlShape.class,
oControl);

up to there it is fine and not null, but then xControlShape.getControl()
returns NULL.

xControlShape is a SvxShapeControl, so this ends up in
svx/source/unodraw/unoshap2.cxx,
around line 622:

Reference< awt::XControlModel > SAL_CALL SvxShapeControl::getControl()
    throw( uno::RuntimeException )
{
    ::SolarMutexGuard aGuard;

    Reference< awt::XControlModel > xModel;

    SdrUnoObj* pUnoObj = dynamic_cast< SdrUnoObj * >(mpObj.get());
    if( pUnoObj )
        xModel = pUnoObj->GetUnoControlModel();

    return xModel;
}

In the problematic call, mpObj.get() is NULL. But it was non-NULL before...

mpObj is a ::tools::WeakReference< SdrObject >

My understanding of "weak reference" is that it is a reference that does not
keep
the object from being garbage-collected (through our reference-counting
system).
So, a reference to that object must be held somewhere else; if not it will
disappear.
My guess is that this is what happens here.

I don't have any clue what other object is supposed to hold that reference;
mpObj is initialised with a FRESH FmFormObj in the constructor of
SvxShapeControl
(which is called as such:

    SdrObject* pObj = new FmFormObj();
    xRet =
static_cast<cppu::OWeakObject*>(static_cast<SvxShape_UnoImplHelper*>(new
SvxShapeControl(pObj)));
    return xRet;

So I don't see a reference to pObj being held anywhere.


The big mystery is that this exact same code worked in LibreOffice 4.1.0.1 and
as far as I can see, none of the code I quoted above changed since 4.1.0.1: not
the wizards/... java files, and not svx/source/unodraw/unoshap* and not
include/svx/unoshape.hxx.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to