math: store main viewshell id in math view shell
problem: when we enter to edit a formula a new view shell is created. In LOK all the JSwidgets would be mapped to this window id. But when LOK requests widgets we get the requests from the main viewshell and we can't find any widgets mapped to the main viewshell which means LOK can't load any widgets. Currently there's no mechanism to find the sub viewshell Change-Id: I4f9ce161101ef6815f4d9e712d9bd42f0dc83ea3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180038 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180287 Tested-by: Jenkins
This commit is contained in:
committed by
Caolán McNamara
parent
9d4e8447a1
commit
1de4b9ae2b
@@ -37,6 +37,9 @@ private:
|
|||||||
public:
|
public:
|
||||||
PanelLayout(weld::Widget* pParent, const OUString& rID, const OUString& rUIXMLDescription);
|
PanelLayout(weld::Widget* pParent, const OUString& rID, const OUString& rUIXMLDescription);
|
||||||
|
|
||||||
|
PanelLayout(weld::Widget* pParent, const OUString& rID, const OUString& rUIXMLDescription,
|
||||||
|
sal_uInt64 nWindowId);
|
||||||
|
|
||||||
void SetPanel(sfx2::sidebar::Panel* pPanel);
|
void SetPanel(sfx2::sidebar::Panel* pPanel);
|
||||||
|
|
||||||
virtual ~PanelLayout();
|
virtual ~PanelLayout();
|
||||||
|
@@ -17,8 +17,16 @@
|
|||||||
|
|
||||||
using namespace sfx2::sidebar;
|
using namespace sfx2::sidebar;
|
||||||
|
|
||||||
PanelLayout::PanelLayout(weld::Widget* pParent, const OUString& rID, const OUString& rUIXMLDescription)
|
PanelLayout::PanelLayout(weld::Widget* pParent, const OUString& rID,
|
||||||
: m_xBuilder(Application::CreateBuilder(pParent, rUIXMLDescription, false, reinterpret_cast<sal_uInt64>(SfxViewShell::Current())))
|
const OUString& rUIXMLDescription)
|
||||||
|
: PanelLayout(pParent, rID, rUIXMLDescription,
|
||||||
|
reinterpret_cast<sal_uInt64>(SfxViewShell::Current()))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
PanelLayout::PanelLayout(weld::Widget* pParent, const OUString& rID,
|
||||||
|
const OUString& rUIXMLDescription, sal_uInt64 nWindowId)
|
||||||
|
: m_xBuilder(Application::CreateBuilder(pParent, rUIXMLDescription, false, nWindowId))
|
||||||
, m_xContainer(m_xBuilder->weld_container(rID))
|
, m_xContainer(m_xBuilder->weld_container(rID))
|
||||||
, m_pPanel(nullptr)
|
, m_pPanel(nullptr)
|
||||||
{
|
{
|
||||||
|
@@ -35,15 +35,16 @@
|
|||||||
namespace sm::sidebar
|
namespace sm::sidebar
|
||||||
{
|
{
|
||||||
// static
|
// static
|
||||||
std::unique_ptr<PanelLayout> SmElementsPanel::Create(weld::Widget& rParent,
|
std::unique_ptr<PanelLayout>
|
||||||
const SfxBindings& rBindings)
|
SmElementsPanel::Create(weld::Widget& rParent, const SfxBindings& rBindings, sal_uInt64 nWindowId)
|
||||||
{
|
{
|
||||||
return std::make_unique<SmElementsPanel>(rParent, rBindings);
|
return std::make_unique<SmElementsPanel>(rParent, rBindings, nWindowId);
|
||||||
}
|
}
|
||||||
|
|
||||||
SmElementsPanel::SmElementsPanel(weld::Widget& rParent, const SfxBindings& rBindings)
|
SmElementsPanel::SmElementsPanel(weld::Widget& rParent, const SfxBindings& rBindings,
|
||||||
|
sal_uInt64 nWindowId)
|
||||||
: PanelLayout(&rParent, u"MathElementsPanel"_ustr,
|
: PanelLayout(&rParent, u"MathElementsPanel"_ustr,
|
||||||
u"modules/smath/ui/sidebarelements_math.ui"_ustr)
|
u"modules/smath/ui/sidebarelements_math.ui"_ustr, nWindowId)
|
||||||
, mrBindings(rBindings)
|
, mrBindings(rBindings)
|
||||||
, mxCategoryList(m_xBuilder->weld_combo_box(u"categorylist"_ustr))
|
, mxCategoryList(m_xBuilder->weld_combo_box(u"categorylist"_ustr))
|
||||||
, mxElementsControl(std::make_unique<SmElementsControl>(
|
, mxElementsControl(std::make_unique<SmElementsControl>(
|
||||||
|
@@ -36,11 +36,12 @@ namespace sm::sidebar
|
|||||||
class SmElementsPanel : public PanelLayout, public SfxListener
|
class SmElementsPanel : public PanelLayout, public SfxListener
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static std::unique_ptr<PanelLayout> Create(weld::Widget& rParent, const SfxBindings& rBindings);
|
static std::unique_ptr<PanelLayout> Create(weld::Widget& rParent, const SfxBindings& rBindings,
|
||||||
|
sal_uInt64 nWindowId);
|
||||||
|
|
||||||
void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
|
void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
|
||||||
|
|
||||||
SmElementsPanel(weld::Widget& rParent, const SfxBindings& rBindings);
|
SmElementsPanel(weld::Widget& rParent, const SfxBindings& rBindings, sal_uInt64 nWindowId);
|
||||||
~SmElementsPanel();
|
~SmElementsPanel();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -28,6 +28,7 @@
|
|||||||
#include <comphelper/namedvaluecollection.hxx>
|
#include <comphelper/namedvaluecollection.hxx>
|
||||||
#include <sfx2/sidebar/SidebarPanelBase.hxx>
|
#include <sfx2/sidebar/SidebarPanelBase.hxx>
|
||||||
#include <vcl/weldutils.hxx>
|
#include <vcl/weldutils.hxx>
|
||||||
|
#include <view.hxx>
|
||||||
|
|
||||||
#include "SmElementsPanel.hxx"
|
#include "SmElementsPanel.hxx"
|
||||||
#include "SmPropertiesPanel.hxx"
|
#include "SmPropertiesPanel.hxx"
|
||||||
@@ -91,7 +92,9 @@ css::uno::Reference<css::ui::XUIElement> SAL_CALL SmPanelFactory::createUIElemen
|
|||||||
}
|
}
|
||||||
else if (ResourceURL.endsWith("/MathElementsPanel"))
|
else if (ResourceURL.endsWith("/MathElementsPanel"))
|
||||||
{
|
{
|
||||||
pPanel = sm::sidebar::SmElementsPanel::Create(*pParent, *pBindings);
|
SfxViewShell* pViewShell = SfxViewShell::Get(xFrame->getController());
|
||||||
|
pPanel = sm::sidebar::SmElementsPanel::Create(*pParent, *pBindings,
|
||||||
|
reinterpret_cast<sal_uInt64>(pViewShell));
|
||||||
aLayoutSize = { 300, -1, -1 };
|
aLayoutSize = { 300, -1, -1 };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user