only use the form import object when it is a form component
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: I38968a0834a044ceb068337fe1d96eb364739019 Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13698 Reviewed-by: Noel Grandin <noel.grandin@collabora.com> (cherry picked from commit ed137476afd19a0324bf117fd315b751bfa920c9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211626 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
This commit is contained in:
committed by
Xisco Fauli
parent
0e705d4a0b
commit
4f3909125e
@@ -37,6 +37,7 @@
|
||||
#include <com/sun/star/util/XCloneable.hpp>
|
||||
#include <com/sun/star/util/Duration.hpp>
|
||||
#include <com/sun/star/form/FormComponentType.hpp>
|
||||
#include <com/sun/star/form/XFormComponent.hpp>
|
||||
#include <com/sun/star/awt/ImagePosition.hpp>
|
||||
#include <com/sun/star/beans/XMultiPropertySet.hpp>
|
||||
#include <com/sun/star/beans/XPropertyContainer.hpp>
|
||||
@@ -587,6 +588,13 @@ namespace xmloff
|
||||
OStringBuffer("OElementImport::createElement: service factory gave me no object (service name: " +
|
||||
OUStringToOString(m_sServiceName, RTL_TEXTENCODING_ASCII_US) +
|
||||
")!").getStr());
|
||||
// only use the created object when it is a form component
|
||||
if (!Reference< XFormComponent >(xPure, UNO_QUERY).is())
|
||||
{
|
||||
SAL_WARN("xmloff.forms", "OElementImport::createElement: " << m_sServiceName
|
||||
<< " is not a form component");
|
||||
return xReturn;
|
||||
}
|
||||
xReturn.set(xPure, UNO_QUERY);
|
||||
if (auto const props = Reference<css::beans::XPropertySet>(xPure, css::uno::UNO_QUERY))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user