Move ObjectInspectorWidgets code into cxx file

having this much code in a header file is not a good idea

Change-Id: Ic21eca651335bb282ebbf9434811ae591b7e0b18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166620
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2024-04-25 12:19:42 +02:00
parent d8d2a68271
commit 15d19cb69d
3 changed files with 45 additions and 26 deletions

View File

@@ -10,36 +10,14 @@
#pragma once
#include <sfx2/dllapi.h>
#include <vcl/weld.hxx>
struct ObjectInspectorWidgets
struct SFX2_DLLPUBLIC ObjectInspectorWidgets
{
ObjectInspectorWidgets(const std::unique_ptr<weld::Builder>& rxBuilder)
: mpClassNameLabel(rxBuilder->weld_label("class_name_value_id"))
, mpInterfacesTreeView(rxBuilder->weld_tree_view("interfaces_treeview_id"))
, mpServicesTreeView(rxBuilder->weld_tree_view("services_treeview_id"))
, mpPropertiesTreeView(rxBuilder->weld_tree_view("properties_treeview_id"))
, mpMethodsTreeView(rxBuilder->weld_tree_view("methods_treeview_id"))
, mpToolbar(rxBuilder->weld_toolbar("object_inspector_toolbar"))
, mpNotebook(rxBuilder->weld_notebook("object_inspector_notebookbar"))
, mpTextView(rxBuilder->weld_text_view("object_inspector_text_view"))
, mpPaned(rxBuilder->weld_paned("object_inspector_paned"))
{
}
ObjectInspectorWidgets(const std::unique_ptr<weld::Builder>& rxBuilder);
~ObjectInspectorWidgets()
{
// dispose welded objects
mpClassNameLabel.reset();
mpInterfacesTreeView.reset();
mpServicesTreeView.reset();
mpPropertiesTreeView.reset();
mpMethodsTreeView.reset();
mpToolbar.reset();
mpNotebook.reset();
mpTextView.reset();
mpPaned.reset();
}
~ObjectInspectorWidgets();
std::unique_ptr<weld::Label> mpClassNameLabel;
std::unique_ptr<weld::TreeView> mpInterfacesTreeView;

View File

@@ -174,6 +174,7 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/devtools/DevelopmentToolDockingWindow \
sfx2/source/devtools/DocumentModelTreeHandler \
sfx2/source/devtools/ObjectInspectorTreeHandler \
sfx2/source/devtools/ObjectInspectorWidgets \
sfx2/source/dialog/alienwarn \
sfx2/source/dialog/basedlgs \
sfx2/source/dialog/checkin \

View File

@@ -0,0 +1,40 @@
/* -*- 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/.
*
*/
#include <sfx2/devtools/ObjectInspectorWidgets.hxx>
ObjectInspectorWidgets::ObjectInspectorWidgets(const std::unique_ptr<weld::Builder>& rxBuilder)
: mpClassNameLabel(rxBuilder->weld_label("class_name_value_id"))
, mpInterfacesTreeView(rxBuilder->weld_tree_view("interfaces_treeview_id"))
, mpServicesTreeView(rxBuilder->weld_tree_view("services_treeview_id"))
, mpPropertiesTreeView(rxBuilder->weld_tree_view("properties_treeview_id"))
, mpMethodsTreeView(rxBuilder->weld_tree_view("methods_treeview_id"))
, mpToolbar(rxBuilder->weld_toolbar("object_inspector_toolbar"))
, mpNotebook(rxBuilder->weld_notebook("object_inspector_notebookbar"))
, mpTextView(rxBuilder->weld_text_view("object_inspector_text_view"))
, mpPaned(rxBuilder->weld_paned("object_inspector_paned"))
{
}
ObjectInspectorWidgets::~ObjectInspectorWidgets()
{
// dispose welded objects
mpClassNameLabel.reset();
mpInterfacesTreeView.reset();
mpServicesTreeView.reset();
mpPropertiesTreeView.reset();
mpMethodsTreeView.reset();
mpToolbar.reset();
mpNotebook.reset();
mpTextView.reset();
mpPaned.reset();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */