diff options
author | Shivam Kumar Singh <shivamhere247@gmail.com> | 2020-06-06 18:57:13 +0530 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2020-06-13 01:09:59 +0200 |
commit | c98affa44e3f61279ae9fe052dbcfbda0c58838e (patch) | |
tree | 3b896cb3442c38060e2cbd2ecd999bf91b523b66 /svx | |
parent | d400009e7c74d13f01fda923d7399eac11b83b66 (diff) |
Changed the source code location for Inspector
The Inspector has been instead of defining in svx
now defined such that the main implementation is
in sw folder whereas there is a common interface in
svx.
This change has been done as a progressive step towards
cleaner code.
Change-Id: I49af862f87b4315385c2e275b1079394c326b119
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95657
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/sidebar/PanelFactory.cxx | 5 | ||||
-rw-r--r-- | svx/source/sidebar/inspector/InspectorTextPanel.cxx | 20 | ||||
-rw-r--r-- | svx/source/sidebar/inspector/InspectorTextPanel.hxx | 52 | ||||
-rw-r--r-- | svx/uiconfig/ui/inspectortextpanel.ui | 2 |
4 files changed, 9 insertions, 70 deletions
diff --git a/svx/source/sidebar/PanelFactory.cxx b/svx/source/sidebar/PanelFactory.cxx index 6b8ed657351e..e37648b38c25 100644 --- a/svx/source/sidebar/PanelFactory.cxx +++ b/svx/source/sidebar/PanelFactory.cxx @@ -20,7 +20,6 @@ #include <config_features.h> #include "text/TextPropertyPanel.hxx" -#include "inspector/InspectorTextPanel.hxx" #include "styles/StylesPropertyPanel.hxx" #include "paragraph/ParaPropertyPanel.hxx" #include "lists/ListsPropertyPanel.hxx" @@ -125,10 +124,6 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement ( { pControl = TextPropertyPanel::Create(pParentWindow, xFrame); } - else if (rsResourceURL.endsWith("/InspectorTextPanel")) - { - pControl = InspectorTextPanel::Create(pParentWindow, xFrame); - } else if (rsResourceURL.endsWith("/StylesPropertyPanel")) { pControl = StylesPropertyPanel::Create(pParentWindow, xFrame); diff --git a/svx/source/sidebar/inspector/InspectorTextPanel.cxx b/svx/source/sidebar/inspector/InspectorTextPanel.cxx index 6eaa6f992573..68ac911a6408 100644 --- a/svx/source/sidebar/inspector/InspectorTextPanel.cxx +++ b/svx/source/sidebar/inspector/InspectorTextPanel.cxx @@ -17,11 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "InspectorTextPanel.hxx" +#include <svx/sidebar/InspectorTextPanel.hxx> #include <com/sun/star/lang/IllegalArgumentException.hpp> -#include <comphelper/lok.hxx> -#include <sfx2/lokhelper.hxx> using namespace css; @@ -44,11 +42,17 @@ InspectorTextPanel::Create(vcl::Window* pParent, InspectorTextPanel::InspectorTextPanel(vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame) : PanelLayout(pParent, "InspectorTextPanel", "svx/ui/inspectortextpanel.ui", rxFrame) - , mxListBoxStyles(m_xBuilder->weld_tree_view("liststore")) + , mxListBoxStyles(m_xBuilder->weld_tree_view("listbox_fonts")) { mxListBoxStyles->set_size_request(-1, mxListBoxStyles->get_height_rows(10)); } +void InspectorTextPanel::updateEntries(std::vector<OUString> store) +{ + for (OUString& str : store) + mxListBoxStyles->append_text(str); +} + InspectorTextPanel::~InspectorTextPanel() { disposeOnce(); } void InspectorTextPanel::dispose() @@ -58,14 +62,6 @@ void InspectorTextPanel::dispose() PanelLayout::dispose(); } -void InspectorTextPanel::HandleContextChange(const vcl::EnumContext& rContext) -{ - if (maContext == rContext) - return; - - maContext = rContext; -} - } // end of namespace svx::sidebar /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/sidebar/inspector/InspectorTextPanel.hxx b/svx/source/sidebar/inspector/InspectorTextPanel.hxx deleted file mode 100644 index 0d6160dfe75e..000000000000 --- a/svx/source/sidebar/inspector/InspectorTextPanel.hxx +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- 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/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#pragma once - -#include <sfx2/sidebar/IContextChangeReceiver.hxx> -#include <sfx2/weldutils.hxx> -#include <vcl/EnumContext.hxx> -#include <sfx2/sidebar/PanelLayout.hxx> - -namespace svx -{ -namespace sidebar -{ -class InspectorTextPanel : public PanelLayout, public ::sfx2::sidebar::IContextChangeReceiver -{ -public: - virtual ~InspectorTextPanel() override; - virtual void dispose() override; - - static VclPtr<vcl::Window> Create(vcl::Window* pParent, - const css::uno::Reference<css::frame::XFrame>& rxFrame); - - virtual void HandleContextChange(const vcl::EnumContext& rContext) override; - - InspectorTextPanel(vcl::Window* pParent, - const css::uno::Reference<css::frame::XFrame>& rxFrame); - -private: - std::unique_ptr<weld::TreeView> mxListBoxStyles; // To dump all the properties - - vcl::EnumContext maContext; -}; -} -} // end of namespace svx::sidebar - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/uiconfig/ui/inspectortextpanel.ui b/svx/uiconfig/ui/inspectortextpanel.ui index 1ebd98403eb5..726a3d840dc6 100644 --- a/svx/uiconfig/ui/inspectortextpanel.ui +++ b/svx/uiconfig/ui/inspectortextpanel.ui @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- Generated with glade 3.20.4 --> -<interface domain="sw"> +<interface domain="svx"> <requires lib="gtk+" version="3.18"/> <object class="GtkTreeStore" id="liststore"> <columns> |