Use the XModel3 interface instead of only the very basic XInterface base interface for the document as the object that is passed is known to implement this more specific interface. The DevelopmentToolDockingWindow ctor passes the result of calling SfxObjectShell::GetBaseModel (which returns XModel3) for the param. This also prepares for switching the return type of SfxObjectShell::GetBaseModel to a reference of the concrete SfxBaseModel in an upcoming commit (without introducing ambiguity due to multi-inheritance from XInterface in places using only an XInterface reference). Change-Id: I61f531caea266286fe51b5231c13f56e5b9d82b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211050 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
63 lines
1.7 KiB
C++
63 lines
1.7 KiB
C++
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
/*
|
|
* This file is part of the LibreOffice project.
|
|
*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <tools/link.hxx>
|
|
|
|
#include <com/sun/star/frame/XModel3.hpp>
|
|
#include <com/sun/star/uno/XInterface.hpp>
|
|
#include <com/sun/star/uno/Reference.hxx>
|
|
|
|
namespace weld
|
|
{
|
|
class TreeIter;
|
|
}
|
|
namespace weld
|
|
{
|
|
class TreeView;
|
|
}
|
|
|
|
/** Document model tree handler
|
|
*
|
|
* Handles the DOM tree part of DevTools, which includes interaction with
|
|
* the DOM tree view UI elements and the DOM model.
|
|
*/
|
|
class DocumentModelTreeHandler
|
|
{
|
|
private:
|
|
std::unique_ptr<weld::TreeView>& mpDocumentModelTree;
|
|
css::uno::Reference<css::frame::XModel3> mxDocument;
|
|
|
|
// Clears all children of a tree node, where the parent is
|
|
// identified by the input tree iter.
|
|
void clearChildren(weld::TreeIter const& rParent);
|
|
|
|
// Clear all tree view nodes.
|
|
void clearAll();
|
|
|
|
public:
|
|
DocumentModelTreeHandler(std::unique_ptr<weld::TreeView>& pDocumentModelTree,
|
|
css::uno::Reference<css::frame::XModel3> xDocument);
|
|
|
|
DECL_LINK(ExpandingHandler, const weld::TreeIter&, bool);
|
|
|
|
void inspectDocument();
|
|
|
|
static css::uno::Reference<css::uno::XInterface> getObjectByID(OUString const& rID);
|
|
|
|
void dispose();
|
|
|
|
// selects the input object if it exists in the DOM tree view
|
|
void selectObject(css::uno::Reference<css::uno::XInterface> const& xInterface);
|
|
};
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|