[Libreoffice-commits] core.git: officecfg/registry
officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 5c7937803fa03df79921667bd2121609c5696b5a Author: Shivam Kumar Singh AuthorDate: Tue Sep 15 13:33:41 2020 +0530 Commit: Rizal Muttaqin CommitDate: Tue Sep 15 15:48:19 2020 +0200 tdf#135028 Added icon for the Styles Inspector Change-Id: Ie6c5430bd43d40193297062cd546ef311e41dd15 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102707 Tested-by: Jenkins Reviewed-by: Rizal Muttaqin diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu index 3be01d081c8c..11881687f1f8 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu @@ -49,7 +49,7 @@ InspectorDeck - private:graphicrepository/cmd/lc_editglossary.png + private:graphicrepository/cmd/lc_inspectordeck.png ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/sfx2 officecfg/registry sfx2/source sw/inc sw/sdi sw/source
include/sfx2/sidebar/Sidebar.hxx|3 officecfg/registry/data/org/openoffice/Office/Accelerators.xcu |6 + officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu |8 ++ sfx2/source/sidebar/Sidebar.cxx | 34 ++ sw/inc/cmdid.h |2 sw/sdi/_viewsh.sdi |4 + sw/sdi/swriter.sdi | 15 sw/source/uibase/uiview/view2.cxx |9 ++ 8 files changed, 81 insertions(+) New commits: commit eef202b0659a8ef5f2c1d0b38f292039f0ceaa8d Author: Shivam Kumar Singh AuthorDate: Mon Aug 17 10:46:27 2020 +0530 Commit: Heiko Tietze CommitDate: Tue Aug 25 11:29:49 2020 +0200 tdf#135334 Add keyboard shortcut to launch SI Change-Id: Id4e911e36527395eb0ed5f29a089a66e0908e882 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100835 Tested-by: Jenkins Reviewed-by: Heiko Tietze diff --git a/include/sfx2/sidebar/Sidebar.hxx b/include/sfx2/sidebar/Sidebar.hxx index 2ac3b0e6a425..9bb250029a28 100644 --- a/include/sfx2/sidebar/Sidebar.hxx +++ b/include/sfx2/sidebar/Sidebar.hxx @@ -21,6 +21,7 @@ #define INCLUDED_SFX2_SIDEBAR_SIDEBAR_HXX #include +#include #include namespace com::sun::star::frame { class XFrame; } @@ -34,6 +35,8 @@ namespace sfx2::sidebar { class SFX2_DLLPUBLIC Sidebar { public: +static void ToggleDeck(const OUString& rsDeckId, SfxViewFrame *pViewFrame); + /** Switch to the deck that contains the specified panel and make sure that the panel is visible (expanded and scrolled into the visible area.) diff --git a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu index 8124fef24d53..b8a46cfc035a 100644 --- a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu @@ -5870,6 +5870,12 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing vnd.sun.star.findbar:FocusToFindbar + + +I10N SHORTCUTS - NO TRANSLATE +.uno:InspectorDeck + + I10N SHORTCUTS - NO TRANSLATE diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu index 0e4dd6fdc29d..f3e04aab39b6 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu @@ -3765,6 +3765,14 @@ true + + + Inspector Deck + + + 0 + + diff --git a/sfx2/source/sidebar/Sidebar.cxx b/sfx2/source/sidebar/Sidebar.cxx index 6f205389e166..ccd2fbc589d2 100644 --- a/sfx2/source/sidebar/Sidebar.cxx +++ b/sfx2/source/sidebar/Sidebar.cxx @@ -21,11 +21,45 @@ #include #include #include +#include +#include +#include +#include +#include using namespace css; namespace sfx2::sidebar { +void Sidebar::ToggleDeck(const OUString& rsDeckId, SfxViewFrame* pViewFrame) +{ +if (!pViewFrame) +return; + +SfxChildWindow* pSidebarChildWindow = pViewFrame->GetChildWindow(SID_SIDEBAR); +bool bInitiallyVisible = pSidebarChildWindow && pSidebarChildWindow->IsVisible(); +if (!bInitiallyVisible) +pViewFrame->ShowChildWindow(SID_SIDEBAR); + +if (SidebarController* pController = + SidebarController::GetSidebarControllerForFrame(pViewFrame->GetFrame().GetFrameInterface())) +{ +if (bInitiallyVisible && pController->IsDeckVisible(rsDeckId)) +{ +// close the sidebar if it was already visible and showing this sidebar deck +const util::URL aURL(Tools::GetURL(".uno:Sidebar")); +css::uno::Reference xDispatch(Tools::GetDispatch(pViewFrame->GetFrame().GetFrameInterface(), aURL)); +if (xDispatch.is()) +xDispatch->dispatch(aURL, css::uno::Sequence()); +} +else +{ +pController->OpenThenSwitchToDeck(rsDeckId); +pController->GetFocusManager().GrabFocusPanel(); +} +} +} + void Sidebar::ShowPanel ( const OUString& rsPanelId, const css::uno::Reference& rxFrame, bool bFocus) diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h index fda0486edbe2..0728b983bc89 100644 --- a/sw/inc/cmdid.h +++ b/sw/inc/cmdid.h @@ -864,6 +864,8 @@ #define SID_ATTR_PAGE_FOOTER_LAYOUT (FN_SIDEBAR + 10) #define SID_ATTR_PAGE_MARGIN(FN_SIDEBAR + 11) +#define SID_INSPECTOR_DECK (FN_SIDEBAR + 13) + //Member IDs for Fill / SetVariable of items #define M
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit a2f226d63e88f2c6ba6771b37a7039c82e3d0001 Author: Shivam Kumar Singh AuthorDate: Tue Aug 11 18:25:39 2020 +0530 Commit: Mike Kaganski CommitDate: Wed Aug 12 12:07:43 2020 +0200 tdf#135528 tdf#135491 Fix LO crash when using macro with SI enabled WriterInspectorTextPanel.cxx tries to work on the current shell which might change everytime. This patch uses the original shell stored in m_pWrtShell to get the current DocShell. Change-Id: I243e7346b748ca81041016f526b6d4da7861f7bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100493 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx index 7c10f757edbc..bbb018bfcc72 100644 --- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx +++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx @@ -501,7 +501,7 @@ IMPL_LINK(WriterInspectorTextPanel, AttrChangedNotify, LinkParamNone*, pLink, vo if (m_oldLink.IsSet()) m_oldLink.Call(pLink); -SwDocShell* pDocSh = static_cast(SfxObjectShell::Current()); +SwDocShell* pDocSh = m_pShell->GetDoc()->GetDocShell(); std::vector aStore; if (pDocSh && pDocSh->GetDoc()->GetEditShell()->GetCursor()->GetNode().GetTextNode()) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/inc sw/source
sw/inc/inspectorproperties.hrc|6 + sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx | 89 +++--- 2 files changed, 84 insertions(+), 11 deletions(-) New commits: commit 6ce2eddfdc35100b8079a4584dd3945e923d66a9 Author: Shivam Kumar Singh AuthorDate: Fri Aug 7 13:36:52 2020 +0530 Commit: Mike Kaganski CommitDate: Sun Aug 9 21:50:11 2020 +0200 tdf#135406 - Border properties not properly listed in the Styles Inspector Several Border properties are stored as STRUCT internally. Added support to show them in the Inspector. Change-Id: Ida1014691ab2245eea04487ce753c23bdf0bddb9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100288 Reviewed-by: Mike Kaganski Tested-by: Jenkins diff --git a/sw/inc/inspectorproperties.hrc b/sw/inc/inspectorproperties.hrc index 7d9a272d1df2..f51521b30e9e 100644 --- a/sw/inc/inspectorproperties.hrc +++ b/sw/inc/inspectorproperties.hrc @@ -28,7 +28,13 @@ */ // Format names +#define RID_BORDER_COLOR NC_("RID_ATTRIBUTE_NAMES_MAP", "Color") #define RID_BORDER_DISTANCE NC_("RID_ATTRIBUTE_NAMES_MAP", "Border Distance") +#define RID_BORDER_INNER_LINE_WIDTH NC_("RID_ATTRIBUTE_NAMES_MAP", "Inner Line Width") +#define RID_BORDER_LINE_DISTANCE NC_("RID_ATTRIBUTE_NAMES_MAP", "Line Distance") +#define RID_BORDER_LINE_STYLE NC_("RID_ATTRIBUTE_NAMES_MAP", "Line Style") +#define RID_BORDER_LINE_WIDTH NC_("RID_ATTRIBUTE_NAMES_MAP", "Line Width") +#define RID_BORDER_OUTER_LINE_WIDTH NC_("RID_ATTRIBUTE_NAMES_MAP", "Outer Line Width") #define RID_BOTTOM_BORDER NC_("RID_ATTRIBUTE_NAMES_MAP", "Bottom Border") #define RID_BOTTOM_BORDER_DISTANCE NC_("RID_ATTRIBUTE_NAMES_MAP", "Bottom Border Distance") #define RID_BREAK_TYPE NC_("RID_ATTRIBUTE_NAMES_MAP", "Break Type") diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx index f63fdc79b8bf..7c10f757edbc 100644 --- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx +++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -296,6 +297,12 @@ static OUString PropertyNametoRID(const OUString& rName) { "UnvisitedCharStyleName", RID_UNVISITED_CHAR_STYLE_NAME }, { "VisitedCharStyleName", RID_VISITED_CHAR_STYLE_NAME }, { "WritingMode", RID_WRITING_MODE }, +{ "BorderColor", RID_BORDER_COLOR }, +{ "BorderInnerLineWidth", RID_BORDER_INNER_LINE_WIDTH }, +{ "BorderLineDistance", RID_BORDER_LINE_DISTANCE }, +{ "BorderLineStyle", RID_BORDER_LINE_STYLE }, +{ "BorderLineWidth", RID_BORDER_LINE_WIDTH }, +{ "BorderOuterLineWidth", RID_BORDER_OUTER_LINE_WIDTH }, }; auto itr = aNameToRID.find(rName); @@ -304,6 +311,69 @@ static OUString PropertyNametoRID(const OUString& rName) return rName; } +static svx::sidebar::TreeNode SimplePropToTreeNode(const OUString& rName, const css::uno::Any& rVal) +{ +svx::sidebar::TreeNode aCurNode; +aCurNode.sNodeName = PropertyNametoRID(rName); +aCurNode.aValue = rVal; + +return aCurNode; +} + +static svx::sidebar::TreeNode BorderToTreeNode(const OUString& rName, const css::uno::Any& rVal) +{ +table::BorderLine2 aBorder; +rVal >>= aBorder; +svx::sidebar::TreeNode aChild; +svx::sidebar::TreeNode aCurNode; +aCurNode.sNodeName = PropertyNametoRID(rName); +aCurNode.NodeType = svx::sidebar::TreeNode::ComplexProperty; + +aCurNode.children.push_back(SimplePropToTreeNode("BorderColor", css::uno::Any(aBorder.Color))); +aCurNode.children.push_back( +SimplePropToTreeNode("BorderLineWidth", css::uno::Any(aBorder.LineWidth))); +aCurNode.children.push_back( +SimplePropToTreeNode("BorderLineStyle", css::uno::Any(aBorder.LineStyle))); +aCurNode.children.push_back( +SimplePropToTreeNode("BorderLineDistance", css::uno::Any(aBorder.LineDistance))); +aCurNode.children.push_back( +SimplePropToTreeNode("BorderInnerLineWidth", css::uno::Any(aBorder.InnerLineWidth))); +aCurNode.children.push_back( +SimplePropToTreeNode("BorderOuterLineWidth", css::uno::Any(aBorder.OuterLineWidth))); + +return aCurNode; +} + +static svx::sidebar::TreeNode +PropertyToTreeNode(const css::beans::Property& rProperty, + const uno::Reference& xPropertiesSet, const bool& rIsGrey) +{ +const OUString& rPropName = rProperty.Name; +svx::sidebar::TreeNode aCurNode; +const uno::Any aAny = xPropertiesSet->getPropertyValue(rP
[Libreoffice-commits] core.git: svx/uiconfig
svx/uiconfig/ui/inspectortextpanel.ui |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) New commits: commit afb68e1f21a539bf93c8131a2a8a6055feec88f1 Author: Shivam Kumar Singh AuthorDate: Tue Aug 4 14:24:38 2020 +0530 Commit: Heiko Tietze CommitDate: Fri Aug 7 14:09:07 2020 +0200 Set Ellipsize for proper viewing of properties in Inspector Add ... at the end of long properties Change-Id: I7ab9eba4c4dab10446d66dcd99d677fa70a455d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100046 Tested-by: Jenkins Tested-by: Heiko Tietze Reviewed-by: Heiko Tietze diff --git a/svx/uiconfig/ui/inspectortextpanel.ui b/svx/uiconfig/ui/inspectortextpanel.ui index 3454a32758db..9e3794327a7c 100644 --- a/svx/uiconfig/ui/inspectortextpanel.ui +++ b/svx/uiconfig/ui/inspectortextpanel.ui @@ -1,5 +1,5 @@ - + @@ -60,7 +60,9 @@ True Properties - + +end + 5 0 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: svx/source
svx/source/sidebar/inspector/InspectorTextPanel.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit b6576ce2321f68e4e2c7399f3c2fdf934df43d1e Author: Shivam Kumar Singh AuthorDate: Mon Aug 3 20:06:19 2020 +0530 Commit: Caolán McNamara CommitDate: Wed Aug 5 17:06:49 2020 +0200 tdf#135344 Resolved Inspector scroll bar issues Change-Id: Ifd1b494c2302e8d21cc87296fc8222ffa2c75faa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100010 Reviewed-by: Heiko Tietze Reviewed-by: Caolán McNamara Tested-by: Jenkins Tested-by: Caolán McNamara diff --git a/svx/source/sidebar/inspector/InspectorTextPanel.cxx b/svx/source/sidebar/inspector/InspectorTextPanel.cxx index d9a389aefab9..2a212f33fe22 100644 --- a/svx/source/sidebar/inspector/InspectorTextPanel.cxx +++ b/svx/source/sidebar/inspector/InspectorTextPanel.cxx @@ -47,7 +47,7 @@ InspectorTextPanel::InspectorTextPanel(vcl::Window* pParent, : PanelLayout(pParent, "InspectorTextPanel", "svx/ui/inspectortextpanel.ui", rxFrame) , mpListBoxStyles(m_xBuilder->weld_tree_view("listbox_fonts")) { -mpListBoxStyles->set_size_request(-1, mpListBoxStyles->get_height_rows(25)); +mpListBoxStyles->set_size_request(-1, -1); float fWidth = mpListBoxStyles->get_approximate_digit_width(); std::vector aWidths; aWidths.push_back(fWidth * 34); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/inc sw/source
sw/inc/inspectorproperties.hrc| 250 ++ sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx | 231 2 files changed, 480 insertions(+), 1 deletion(-) New commits: commit f39f37326ac787e88a0782915afac91cf418a539 Author: Shivam Kumar Singh AuthorDate: Mon Aug 3 11:52:21 2020 +0530 Commit: Mike Kaganski CommitDate: Mon Aug 3 21:26:47 2020 +0200 tdf#134560 tdf#135107 make inspector contents human readable This patch adds a dedicated hrc file for RID's of all the properties that can be displayed in the Inspector Change-Id: I258ca060508e28b7b66e96393fcef4fd104bb781 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99983 Tested-by: Mike Kaganski Reviewed-by: Mike Kaganski diff --git a/sw/inc/inspectorproperties.hrc b/sw/inc/inspectorproperties.hrc new file mode 100644 index ..7d9a272d1df2 --- /dev/null +++ b/sw/inc/inspectorproperties.hrc @@ -0,0 +1,250 @@ +/* -*- 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 + +#define NC_(Context, String) reinterpret_cast(Context "\004" u8##String) +#define NNC_(Context, StringSingular, StringPlural) reinterpret_cast(Context "\004" u8##StringSingular "\004" u8##StringPlural) + +/* +Description: API names for Paragraph, Character +and Text cursor properties + */ + +// Format names +#define RID_BORDER_DISTANCE NC_("RID_ATTRIBUTE_NAMES_MAP", "Border Distance") +#define RID_BOTTOM_BORDER NC_("RID_ATTRIBUTE_NAMES_MAP", "Bottom Border") +#define RID_BOTTOM_BORDER_DISTANCE NC_("RID_ATTRIBUTE_NAMES_MAP", "Bottom Border Distance") +#define RID_BREAK_TYPE NC_("RID_ATTRIBUTE_NAMES_MAP", "Break Type") +#define RID_CATEGORY NC_("RID_ATTRIBUTE_NAMES_MAP", "Category") +#define RID_CELL NC_("RID_ATTRIBUTE_NAMES_MAP", "Cell") +#define RID_CHAR_AUTO_ESCAPEMENT NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Auto Escapement") +#define RID_CHAR_AUTO_KERNING NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Auto Kerning") +#define RID_CHAR_AUTO_STYLE_NAME NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Auto Style Name") +#define RID_CHAR_BACK_COLOR NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Back Color") +#define RID_CHAR_BACK_TRANSPARENT NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Back Transparent") +#define RID_CHAR_BORDER_DISTANCE NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Border Distance") +#define RID_CHAR_BOTTOM_BORDER NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Bottom Border") +#define RID_CHAR_BOTTOM_BORDER_DISTANCE NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Bottom Border Distance") +#define RID_CHAR_CASE_MAP NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Case Map") +#define RID_CHAR_COLOR NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Color") +#define RID_CHAR_COMBINE_IS_ON NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Combine is On") +#define RID_CHAR_COMBINE_PREFIX NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Combine Prefix") +#define RID_CHAR_COMBINE_SUFFIX NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Combine Suffix") +#define RID_CHAR_CONTOURED NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Contoured") +#define RID_CHAR_CROSSED_OUT NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Crossed Out") +#define RID_CHAR_DIFF_HEIGHT NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Difference Height") +#define RID_CHAR_DIFF_HEIGHT_ASIAN NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Difference Height Asia
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx | 23 ++ sw/source/uibase/sidebar/WriterInspectorTextPanel.hxx |9 ++- 2 files changed, 27 insertions(+), 5 deletions(-) New commits: commit 3b8c893b487a3ee27bac710da74856225fb72950 Author: Shivam Kumar Singh AuthorDate: Tue Jul 28 18:50:17 2020 +0530 Commit: Mike Kaganski CommitDate: Tue Jul 28 21:19:03 2020 +0200 tdf#135178 tdf#135179 tdf#134820 Issue in SetChgLnk in Inspector Change-Id: I39755d333506ffe3fa2b6302f9ec72c15cd9eff9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99629 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx index b2c346353e52..4959f4b52344 100644 --- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx +++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx @@ -58,9 +58,21 @@ WriterInspectorTextPanel::WriterInspectorTextPanel(vcl::Window* pParent, : InspectorTextPanel(pParent, rxFrame) { SwDocShell* pDocSh = static_cast(SfxObjectShell::Current()); -SwWrtShell* pShell = pDocSh->GetWrtShell(); -if (pShell) -pShell->SetChgLnk(LINK(this, WriterInspectorTextPanel, AttrChangedNotify)); +m_pShell = pDocSh->GetWrtShell(); +if (m_pShell) +{ +m_oldLink = m_pShell->GetChgLnk(); +m_pShell->SetChgLnk(LINK(this, WriterInspectorTextPanel, AttrChangedNotify)); +} +} + +WriterInspectorTextPanel::~WriterInspectorTextPanel() { disposeOnce(); } + +void WriterInspectorTextPanel::dispose() +{ +m_pShell->SetChgLnk(m_oldLink); + +InspectorTextPanel::dispose(); } static void InsertValues(const css::uno::Reference& rSource, @@ -188,8 +200,11 @@ static void UpdateTree(SwDocShell* pDocSh, std::vector& aStore.push_back(aDFNode); } -IMPL_LINK_NOARG(WriterInspectorTextPanel, AttrChangedNotify, LinkParamNone*, void) +IMPL_LINK(WriterInspectorTextPanel, AttrChangedNotify, LinkParamNone*, pLink, void) { +if (m_oldLink.IsSet()) +m_oldLink.Call(pLink); + SwDocShell* pDocSh = static_cast(SfxObjectShell::Current()); std::vector aStore; diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.hxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.hxx index 43acb654411b..5fd3402af222 100644 --- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.hxx +++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.hxx @@ -21,6 +21,8 @@ #include #include +class SwWrtShell; + namespace sw::sidebar { class WriterInspectorTextPanel final : public svx::sidebar::InspectorTextPanel @@ -32,7 +34,12 @@ public: WriterInspectorTextPanel(vcl::Window* pParent, const css::uno::Reference& rxFrame); -// virtual ~WriterInspectorTextPanel(); +virtual ~WriterInspectorTextPanel() override; +virtual void dispose() override; + +private: +SwWrtShell* m_pShell; +Link m_oldLink; // attributes have changed DECL_LINK(AttrChangedNotify, LinkParamNone*, void); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: extras/source
extras/source/wordbook/technical.dic |5 + 1 file changed, 5 insertions(+) New commits: commit a177fcb1a5ac8c57c9e491c107943651bd714fd6 Author: Shivam Kumar Singh AuthorDate: Sun May 10 00:57:59 2020 +0530 Commit: Ilmari Lauhakangas CommitDate: Tue Jul 28 07:49:35 2020 +0200 tdf#87605 Added a few more terms Change-Id: Ib138b4f1ab0bc75265e593f66bd09b3fe75f0eae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93893 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas diff --git a/extras/source/wordbook/technical.dic b/extras/source/wordbook/technical.dic index 91bea60b39a5..c29586aa7bfb 100644 --- a/extras/source/wordbook/technical.dic +++ b/extras/source/wordbook/technical.dic @@ -86,6 +86,7 @@ eDirectory Edubuntu eGuide Electronics +elementary Etch Ethernet Evolution @@ -97,6 +98,7 @@ Firefox Firewall FLAC Flash +Flipkart Foundation Foxconn FreeBSD @@ -188,6 +190,7 @@ Mono MOOC Moodle Motorola +Mouse Mozilla MySQL Naver @@ -218,6 +221,7 @@ OpenWorld= OpenZorg= Opera OPPO +Operating Optronics Oracle= P2P @@ -225,6 +229,7 @@ Panasonic Pangolin PayPal PDF +Pen drive PeopleSoft= Phishing Plug-in ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx | 122 +++--- 1 file changed, 49 insertions(+), 73 deletions(-) New commits: commit a93b329b4c1757f0a585cac6348e9b152372c33f Author: Shivam Kumar Singh AuthorDate: Sat Jul 25 13:29:12 2020 +0530 Commit: Mike Kaganski CommitDate: Sun Jul 26 21:32:07 2020 +0200 tdf#135106 Direct Formatting should be empty by default Change-Id: Ic7dfb2e681c5128288b2f39054bc642ab6028fed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99420 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx index 51d052e0ed91..b2c346353e52 100644 --- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx +++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include #include #include @@ -61,12 +63,49 @@ WriterInspectorTextPanel::WriterInspectorTextPanel(vcl::Window* pParent, pShell->SetChgLnk(LINK(this, WriterInspectorTextPanel, AttrChangedNotify)); } -static void UpdateTree(SwDocShell* pDocSh, std::vector& aStore) +static void InsertValues(const css::uno::Reference& rSource, + std::unordered_map& rIsDefined, + svx::sidebar::TreeNode& rNode, const bool& isRoot, + const std::vector& rHiddenProperty) { +uno::Reference xPropertiesSet(rSource, uno::UNO_QUERY_THROW); +uno::Reference xPropertiesState(rSource, uno::UNO_QUERY_THROW); +const uno::Sequence aProperties += xPropertiesSet->getPropertySetInfo()->getProperties(); + +for (const beans::Property& rProperty : aProperties) +{ +if (std::find(rHiddenProperty.begin(), rHiddenProperty.end(), rProperty.Name) +!= rHiddenProperty.end()) +continue; +if (isRoot +|| xPropertiesState->getPropertyState(rProperty.Name) + == beans::PropertyState_DIRECT_VALUE) +{ +const uno::Any aAny = xPropertiesSet->getPropertyValue(rProperty.Name); +svx::sidebar::TreeNode aTemp; +if (rIsDefined[rProperty.Name]) +aTemp.isGrey = true; +rIsDefined[rProperty.Name] = true; +aTemp.sNodeName = rProperty.Name; +aTemp.aValue = aAny; +rNode.children.push_back(aTemp); +} +} + const comphelper::string::NaturalStringSorter aSorter( comphelper::getProcessComponentContext(), Application::GetSettings().GetUILanguageTag().getLocale()); +std::sort( +rNode.children.begin(), rNode.children.end(), +[&aSorter](svx::sidebar::TreeNode const& rEntry1, svx::sidebar::TreeNode const& rEntry2) { +return aSorter.compare(rEntry1.sNodeName, rEntry2.sNodeName) < 0; +}); +} + +static void UpdateTree(SwDocShell* pDocSh, std::vector& aStore) +{ SwDoc* pDoc = pDocSh->GetDoc(); SwPaM* pCursor = pDoc->GetEditShell()->GetCursor(); svx::sidebar::TreeNode aDFNode; @@ -82,31 +121,15 @@ static void UpdateTree(SwDocShell* pDocSh, std::vector& uno::Reference xRange( SwXTextRange::CreateXTextRange(*pDoc, *pCursor->GetPoint(), nullptr)); - uno::Reference xPropertiesSet(xRange, uno::UNO_QUERY_THROW); -uno::Reference xPropertiesState(xRange, uno::UNO_QUERY_THROW); - -uno::Sequence aProperties -= xPropertiesSet->getPropertySetInfo()->getProperties(); - std::unordered_map aIsDefined; -for (const beans::Property& rProperty : std::as_const(aProperties)) -{ -if (xPropertiesState->getPropertyState(rProperty.Name) == beans::PropertyState_DIRECT_VALUE) -{ -const uno::Any aAny = xPropertiesSet->getPropertyValue(rProperty.Name); -aIsDefined[rProperty.Name] = true; -svx::sidebar::TreeNode aTemp; -aTemp.sNodeName = rProperty.Name; -aTemp.aValue = aAny; -aDFNode.children.push_back(aTemp); -} -} -std::sort( -aDFNode.children.begin(), aDFNode.children.end(), -[&aSorter](svx::sidebar::TreeNode const& rEntry1, svx::sidebar::TreeNode const& rEntry2) { -return aSorter.compare(rEntry1.sNodeName, rEntry2.sNodeName) < 0; -}); + +InsertValues(xRange, aIsDefined, aDFNode, false, + { UNO_NAME_RSID, UNO_NAME_PARA_IS_NUMBERING_RESTART, UNO_NAME_PARA_STYLE_NAME, + UNO_NAME_PARA_CONDITIONAL_STYLE_NAME, UNO_NAME_PAGE_STYLE_NAME, + UNO_NAME_NUMBERING_START_VALUE, UNO_NAME_NUMBERING_IS_NUMBER, + UNO_NAME_PARA_CONTINUEING_PREVIOUS_SUB_TREE, UNO_NAME_CHAR_STYLE_NAME, + UNO_NAME_NUMBERING_LEVEL }); uno::Reference xStyleFamiliesSupplier(pDocSh->GetBaseModel(),
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 49a273dde0aaf6329a6776176413ffb7845d7b1f Author: Shivam Kumar Singh AuthorDate: Sat Jul 25 10:45:49 2020 +0530 Commit: Mike Kaganski CommitDate: Sat Jul 25 08:40:56 2020 +0200 cleanup: change DEFAULT to DIRECT in Inspector Change-Id: I2894e7bab9aa8f076a5de56021c6ba4e451ac2f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99416 Reviewed-by: Mike Kaganski Tested-by: Jenkins diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx index 8dbf36c07188..51d052e0ed91 100644 --- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx +++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx @@ -178,7 +178,7 @@ static void UpdateTree(SwDocShell* pDocSh, std::vector& { const uno::Any aAny = xPropertiesSet->getPropertyValue(sPropName); svx::sidebar::TreeNode aTemp; -// Already defined in "Default Formatting" or "Character Styles" or any child Paragraph Style ? +// Already defined in "Direct Formatting" or "Character Styles" or any child Paragraph Style ? if (aIsDefined[sPropName]) aTemp.isGrey = true; aIsDefined[sPropName] = true; @@ -205,7 +205,7 @@ static void UpdateTree(SwDocShell* pDocSh, std::vector& Display Order :- PARAGRAPH STYLE CHARACTER STYLE -DEFAULT FORMATTING +DIRECT FORMATTING */ aStore.push_back(aParaNode); aStore.push_back(aCharNode); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx | 25 ++ 1 file changed, 25 insertions(+) New commits: commit 6e86f77da5cf66c832f785a7f4eb806a3fdc26c6 Author: Shivam Kumar Singh AuthorDate: Thu Jul 23 23:09:11 2020 +0530 Commit: Mike Kaganski CommitDate: Fri Jul 24 13:42:27 2020 +0200 tdf#135038 Sort attributes in Styles Inspector Change-Id: I49cbfcec280af26b34c956b270277c4f3409c777 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99335 Reviewed-by: Mike Kaganski Tested-by: Jenkins diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx index a6faa29f7290..8dbf36c07188 100644 --- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx +++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx @@ -31,6 +31,10 @@ #include #include +#include +#include +#include +#include namespace sw::sidebar { @@ -59,6 +63,10 @@ WriterInspectorTextPanel::WriterInspectorTextPanel(vcl::Window* pParent, static void UpdateTree(SwDocShell* pDocSh, std::vector& aStore) { +const comphelper::string::NaturalStringSorter aSorter( +comphelper::getProcessComponentContext(), +Application::GetSettings().GetUILanguageTag().getLocale()); + SwDoc* pDoc = pDocSh->GetDoc(); SwPaM* pCursor = pDoc->GetEditShell()->GetCursor(); svx::sidebar::TreeNode aDFNode; @@ -94,6 +102,11 @@ static void UpdateTree(SwDocShell* pDocSh, std::vector& aDFNode.children.push_back(aTemp); } } +std::sort( +aDFNode.children.begin(), aDFNode.children.end(), +[&aSorter](svx::sidebar::TreeNode const& rEntry1, svx::sidebar::TreeNode const& rEntry2) { +return aSorter.compare(rEntry1.sNodeName, rEntry2.sNodeName) < 0; +}); uno::Reference xStyleFamiliesSupplier(pDocSh->GetBaseModel(), uno::UNO_QUERY); @@ -132,6 +145,12 @@ static void UpdateTree(SwDocShell* pDocSh, std::vector& } } +std::sort(aCurrentChild.children.begin(), aCurrentChild.children.end(), + [&aSorter](svx::sidebar::TreeNode const& rEntry1, + svx::sidebar::TreeNode const& rEntry2) { + return aSorter.compare(rEntry1.sNodeName, rEntry2.sNodeName) < 0; + }); + aCharNode.children.push_back(aCurrentChild); } @@ -169,6 +188,12 @@ static void UpdateTree(SwDocShell* pDocSh, std::vector& } } +std::sort(aCurrentChild.children.begin(), aCurrentChild.children.end(), + [&aSorter](svx::sidebar::TreeNode const& rEntry1, + svx::sidebar::TreeNode const& rEntry2) { + return aSorter.compare(rEntry1.sNodeName, rEntry2.sNodeName) < 0; + }); + aParaNode.children.push_back(aCurrentChild); sCurrentParaStyle = aParentParaStyle; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: svx/source svx/uiconfig
svx/source/sidebar/inspector/InspectorTextPanel.cxx |2 +- svx/uiconfig/ui/inspectortextpanel.ui |6 -- 2 files changed, 5 insertions(+), 3 deletions(-) New commits: commit 27c1a7fbcd3e236d4eee7ee3e1a7acdaa47510eb Author: Shivam Kumar Singh AuthorDate: Thu Jul 23 12:12:21 2020 +0530 Commit: Mike Kaganski CommitDate: Thu Jul 23 16:40:10 2020 +0200 Added headers to Inspector Panel Change-Id: Id44d42a9a1495b74ce7f75be28aa2e39403e9f4a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99265 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/svx/source/sidebar/inspector/InspectorTextPanel.cxx b/svx/source/sidebar/inspector/InspectorTextPanel.cxx index ddbee7f51624..d9a389aefab9 100644 --- a/svx/source/sidebar/inspector/InspectorTextPanel.cxx +++ b/svx/source/sidebar/inspector/InspectorTextPanel.cxx @@ -51,7 +51,7 @@ InspectorTextPanel::InspectorTextPanel(vcl::Window* pParent, float fWidth = mpListBoxStyles->get_approximate_digit_width(); std::vector aWidths; aWidths.push_back(fWidth * 34); -aWidths.push_back(fWidth * 15); +aWidths.push_back(fWidth * 34); mpListBoxStyles->set_column_fixed_widths(aWidths); } diff --git a/svx/uiconfig/ui/inspectortextpanel.ui b/svx/uiconfig/ui/inspectortextpanel.ui index 71199a8e449d..0b2de5a225f4 100644 --- a/svx/uiconfig/ui/inspectortextpanel.ui +++ b/svx/uiconfig/ui/inspectortextpanel.ui @@ -54,8 +54,6 @@ True True liststore -False -False 0 True @@ -63,6 +61,8 @@ +True +Properties @@ -75,6 +75,8 @@ +True +Values ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/svx svx/source svx/uiconfig sw/source
include/svx/sidebar/InspectorTextPanel.hxx| 13 ++ svx/source/sidebar/inspector/InspectorTextPanel.cxx | 74 svx/uiconfig/ui/inspectortextpanel.ui | 28 sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx | 106 -- 4 files changed, 136 insertions(+), 85 deletions(-) New commits: commit 19f44fe53863ef8c9087aa965b786544f71ffdc8 Author: Shivam Kumar Singh AuthorDate: Sat Jul 18 11:51:33 2020 +0530 Commit: Mike Kaganski CommitDate: Wed Jul 22 21:01:28 2020 +0200 tdf#134564 tdf#134578 Improve hierarchy viewing in Inspector Significance of this patch - * Added TreeView Lines in the ui file for Inspector for better hierarchy viewing * Properties and there respective values are divided into separate columns. * Grey out disabled properties * bold PS, CS and DF Change-Id: I825a75dd2c5bc54715fe59f3c639024a5e3ab5cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98990 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/include/svx/sidebar/InspectorTextPanel.hxx b/include/svx/sidebar/InspectorTextPanel.hxx index 30285a8870db..10ddf932fe06 100644 --- a/include/svx/sidebar/InspectorTextPanel.hxx +++ b/include/svx/sidebar/InspectorTextPanel.hxx @@ -26,7 +26,20 @@ namespace svx::sidebar struct TreeNode { OUString sNodeName; +css::uno::Any aValue; +bool isGrey; +enum +{ +Category, +ComplexProperty, +SimpleProperty +} NodeType; std::vector children; +TreeNode() +: isGrey(false) +, NodeType(SimpleProperty) +{ +} }; class SVX_DLLPUBLIC InspectorTextPanel : public PanelLayout { diff --git a/svx/source/sidebar/inspector/InspectorTextPanel.cxx b/svx/source/sidebar/inspector/InspectorTextPanel.cxx index 6ab6b1043de3..ddbee7f51624 100644 --- a/svx/source/sidebar/inspector/InspectorTextPanel.cxx +++ b/svx/source/sidebar/inspector/InspectorTextPanel.cxx @@ -19,6 +19,9 @@ #include +#include +#include +#include #include using namespace css; @@ -45,6 +48,56 @@ InspectorTextPanel::InspectorTextPanel(vcl::Window* pParent, , mpListBoxStyles(m_xBuilder->weld_tree_view("listbox_fonts")) { mpListBoxStyles->set_size_request(-1, mpListBoxStyles->get_height_rows(25)); +float fWidth = mpListBoxStyles->get_approximate_digit_width(); +std::vector aWidths; +aWidths.push_back(fWidth * 34); +aWidths.push_back(fWidth * 15); +mpListBoxStyles->set_column_fixed_widths(aWidths); +} + +static bool GetPropertyValues(const OUString& rPropName, const uno::Any& rAny, OUString& rString) +{ +// Hide Asian and Complex properties +if (SvtLanguageOptions().IsCJKFontEnabled() && rPropName.indexOf("Asian") != -1) +return false; +if (SvtLanguageOptions().IsCTLFontEnabled() && rPropName.indexOf("Complex") != -1) +return false; + +if (bool bValue; rAny >>= bValue) +{ +rString = OUString::boolean(bValue); +} +else if (OUString aValue; (rAny >>= aValue) && !(aValue.isEmpty())) +{ +rString = aValue; +} +else if (awt::FontSlant eValue; rAny >>= eValue) +{ +rString = (eValue == awt::FontSlant_ITALIC) ? OUStringLiteral("italic") +: OUStringLiteral("normal"); +} +else if (long nValueLong; rAny >>= nValueLong) +{ +if (rPropName.indexOf("Color") != -1) +rString = "0x" + OUString::number(nValueLong, 16); +else +rString = OUString::number(nValueLong); +} +else if (double fValue; rAny >>= fValue) +{ +if (rPropName.indexOf("Weight") != -1) +rString = (fValue > 100) ? OUStringLiteral("bold") : OUStringLiteral("normal"); +else +rString = OUString::number((round(fValue * 100)) / 100.00); +} +else if (short nValueShort; rAny >>= nValueShort) +{ +rString = OUString::number(nValueShort); +} +else +return false; + +return true; } static void FillBox_Impl(weld::TreeView& rListBoxStyles, const TreeNode& rCurrent, @@ -52,10 +105,25 @@ static void FillBox_Impl(weld::TreeView& rListBoxStyles, const TreeNode& rCurren { std::unique_ptr pResult = rListBoxStyles.make_iterator(); const OUString& rName = rCurrent.sNodeName; -rListBoxStyles.insert(pParent, -1, &rName, nullptr, nullptr, nullptr, false, pResult.get()); +OUString sPairValue; -for (const TreeNode& rChildNode : rCurrent.children) -FillBox_Impl(rListBoxStyles, rChildNode, pResult.get()); +if (rCurrent.NodeType != TreeNode::SimpleProperty +|| GetPropertyValues(rName, rCurrent.aValue, sPairValue)) +{ +rListBoxStyles.insert(pParent, -1, &rName, nullptr, nullptr, nullptr, false, pResult.get()); +rListBoxStyles.set_sensitive(*pResult, !rCurrent.isGrey, 0); +rListBoxStyles.set_text_emphasis(*
[Libreoffice-commits] core.git: include/svx svx/source sw/source
include/svx/sidebar/InspectorTextPanel.hxx|2 svx/source/sidebar/inspector/InspectorTextPanel.cxx | 36 +++ sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx | 82 -- sw/source/uibase/sidebar/WriterInspectorTextPanel.hxx |4 4 files changed, 56 insertions(+), 68 deletions(-) New commits: commit 51ccfd3b39d1d32052e8d51ab9ba7324ccd843f5 Author: Shivam Kumar Singh AuthorDate: Fri Jul 3 00:36:12 2020 +0530 Commit: Mike Kaganski CommitDate: Thu Jul 16 12:12:50 2020 +0200 Cleanup: Fix variable names for Inspector Fixing of variable names following LO naming conventions and some other minor fixes. Change-Id: Iad58584ecc07a02287193a615c428819363ed0c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97810 Reviewed-by: Mike Kaganski Tested-by: Jenkins diff --git a/include/svx/sidebar/InspectorTextPanel.hxx b/include/svx/sidebar/InspectorTextPanel.hxx index 77240cd5a671..e2c479950eac 100644 --- a/include/svx/sidebar/InspectorTextPanel.hxx +++ b/include/svx/sidebar/InspectorTextPanel.hxx @@ -45,7 +45,7 @@ public: void updateEntries(const std::vector& rStore); private: -std::unique_ptr mxListBoxStyles; +std::unique_ptr mpListBoxStyles; }; } } // end of namespace svx::sidebar diff --git a/svx/source/sidebar/inspector/InspectorTextPanel.cxx b/svx/source/sidebar/inspector/InspectorTextPanel.cxx index 1b0ea48a55c3..6157f2bc67fb 100644 --- a/svx/source/sidebar/inspector/InspectorTextPanel.cxx +++ b/svx/source/sidebar/inspector/InspectorTextPanel.cxx @@ -42,52 +42,50 @@ InspectorTextPanel::Create(vcl::Window* pParent, InspectorTextPanel::InspectorTextPanel(vcl::Window* pParent, const css::uno::Reference& rxFrame) : PanelLayout(pParent, "InspectorTextPanel", "svx/ui/inspectortextpanel.ui", rxFrame) -, mxListBoxStyles(m_xBuilder->weld_tree_view("listbox_fonts")) +, mpListBoxStyles(m_xBuilder->weld_tree_view("listbox_fonts")) { -mxListBoxStyles->set_size_request(-1, mxListBoxStyles->get_height_rows(25)); +mpListBoxStyles->set_size_request(-1, mpListBoxStyles->get_height_rows(25)); } -static void FillBox_Impl(weld::TreeView& rListBoxStyles, const TreeNode& current, +static void FillBox_Impl(weld::TreeView& rListBoxStyles, const TreeNode& rCurrent, weld::TreeIter* pParent) { std::unique_ptr pResult = rListBoxStyles.make_iterator(); -const OUString& rName = current.sNodeName; +const OUString& rName = rCurrent.sNodeName; rListBoxStyles.insert(pParent, -1, &rName, nullptr, nullptr, nullptr, false, pResult.get()); -for (const TreeNode& ChildNode : current.children) -FillBox_Impl(rListBoxStyles, ChildNode, pResult.get()); +for (const TreeNode& rChildNode : rCurrent.children) +FillBox_Impl(rListBoxStyles, rChildNode, pResult.get()); } void InspectorTextPanel::updateEntries(const std::vector& rStore) { -mxListBoxStyles->freeze(); -mxListBoxStyles->clear(); -for (const TreeNode& ChildNode : rStore) +mpListBoxStyles->freeze(); +mpListBoxStyles->clear(); +for (const TreeNode& rChildNode : rStore) { -FillBox_Impl(*mxListBoxStyles, ChildNode, nullptr); +FillBox_Impl(*mpListBoxStyles, rChildNode, nullptr); } -mxListBoxStyles->thaw(); +mpListBoxStyles->thaw(); -weld::TreeView* pTreeDiagram = mxListBoxStyles.get(); +weld::TreeView* pTreeDiagram = mpListBoxStyles.get(); pTreeDiagram->all_foreach([pTreeDiagram](weld::TreeIter& rEntry) { pTreeDiagram->expand_row(rEntry); return false; }); -std::unique_ptr xEntry = mxListBoxStyles->make_iterator(); -if (!mxListBoxStyles->get_iter_first(*xEntry)) -return; -if (!mxListBoxStyles->iter_next(*xEntry)) -return; -mxListBoxStyles->collapse_row(*xEntry); // Collapse "Default Paragraph Style" +std::unique_ptr pEntry = mpListBoxStyles->make_iterator(); +mpListBoxStyles->get_iter_first(*pEntry); +mpListBoxStyles->iter_next(*pEntry); +mpListBoxStyles->collapse_row(*pEntry); // Collapse "Default Paragraph Style" } InspectorTextPanel::~InspectorTextPanel() { disposeOnce(); } void InspectorTextPanel::dispose() { -mxListBoxStyles.reset(); +mpListBoxStyles.reset(); PanelLayout::dispose(); } diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx index da9f7eaa4709..30824925d935 100644 --- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx +++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx @@ -18,7 +18,7 @@ */ #include "WriterInspectorTextPanel.hxx" -#include + #include #include #include @@ -68,48 +68,42 @@ static bool GetPropertyValues(const beans::Property rProperty, const uno::Any& r if (SvtLanguageOptions().IsCTLFontEnabled() && rProperty.Name.indexOf("Complex") != -1)
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit 9006cbf6a13317a386194d6857f22391464c2aa0 Author: Shivam Kumar Singh AuthorDate: Tue Jun 30 19:47:56 2020 +0530 Commit: Mike Kaganski CommitDate: Thu Jul 16 02:41:16 2020 +0200 Support for disabling Asian/Complex fonts for Inspector Hide/Show Asian and Complex properties from the Inspector when disabled/enabled from Tools->Options->Language Settings Change-Id: I6447d4406b9371d63e757b332c3393f3496e0a4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97530 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx index 83c48c41815a..da9f7eaa4709 100644 --- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx +++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx @@ -32,6 +32,7 @@ #include #include +#include namespace sw::sidebar { @@ -62,7 +63,9 @@ static bool GetPropertyValues(const beans::Property rProperty, const uno::Any& r OUString& rString) { // Hide Asian and Complex properties -if (rProperty.Name.indexOf("Asian") != -1 || rProperty.Name.indexOf("Complex") != -1) +if (SvtLanguageOptions().IsCJKFontEnabled() && rProperty.Name.indexOf("Asian") != -1) +return false; +if (SvtLanguageOptions().IsCTLFontEnabled() && rProperty.Name.indexOf("Complex") != -1) return false; OUString aValue; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx |8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) New commits: commit 8f121c1a9d5583e187f5468fc197c92e4c019f16 Author: Shivam Kumar Singh AuthorDate: Wed Jul 15 16:24:52 2020 +0530 Commit: Mike Kaganski CommitDate: Wed Jul 15 15:46:11 2020 +0200 tdf#134816 Crash when using a parentless style other than DPS Change-Id: I2da764a50c7018eb28a63dd47c2c4e2c2975bdb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98816 Reviewed-by: Mike Kaganski Tested-by: Jenkins diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx index 5273a6a022d1..83c48c41815a 100644 --- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx +++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx @@ -193,7 +193,7 @@ static void UpdateTree(SwDocShell* pDocSh, std::vector& xStyleFamily.set(xStyleFamilies->getByName("ParagraphStyles"), uno::UNO_QUERY_THROW); -while (true) +while (!sCurrentParaStyle.isEmpty()) { uno::Reference xPropertiesStyle(xStyleFamily->getByName(sCurrentParaStyle), uno::UNO_QUERY_THROW); @@ -205,12 +205,10 @@ static void UpdateTree(SwDocShell* pDocSh, std::vector& svx::sidebar::TreeNode pCurrentChild; pCurrentChild.sNodeName = sDisplayName; -const bool bStandardStyle = sCurrentParaStyle == "Standard"; // Last Parent Style - for (const beans::Property& rProperty : std::as_const(aProperties)) { OUString sPropName = rProperty.Name; -if (bStandardStyle +if (aParentParaStyle.isEmpty() // root of style hierarchy || xPropertiesState->getPropertyState(sPropName) == beans::PropertyState_DIRECT_VALUE) { @@ -232,8 +230,6 @@ static void UpdateTree(SwDocShell* pDocSh, std::vector& pParaNode.children.push_back(pCurrentChild); sCurrentParaStyle = aParentParaStyle; -if (bStandardStyle) -break; } std::reverse(pParaNode.children.begin(), ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx | 212 +- sw/source/uibase/sidebar/WriterInspectorTextPanel.hxx |6 2 files changed, 107 insertions(+), 111 deletions(-) New commits: commit 0bca30bff7d9e49c81459122735565ff0d9816c3 Author: Shivam Kumar Singh AuthorDate: Sat Jul 11 20:18:51 2020 +0530 Commit: Mike Kaganski CommitDate: Wed Jul 15 08:34:54 2020 +0200 tdf#134555 Show direct formatting at the Styles Inspector Change-Id: I9141019f8ef66600614a4fdcc74fca8d75c80d05 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98561 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx index 7222c3de0989..5273a6a022d1 100644 --- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx +++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -109,152 +110,153 @@ static bool GetPropertyValues(const beans::Property rProperty, const uno::Any& r return true; } -static void UpdateTree(SwDocShell* pDocSh, svx::sidebar::TreeNode& pParentNode, - std::unordered_map& maIsDefined, StyleType sType) +static void UpdateTree(SwDocShell* pDocSh, std::vector& aStore) { SwDoc* pDoc = pDocSh->GetDoc(); SwPaM* pCursor = pDoc->GetEditShell()->GetCursor(); +svx::sidebar::TreeNode pDFNode; +svx::sidebar::TreeNode pCharNode; +svx::sidebar::TreeNode pParaNode; -uno::Reference xStyleFamiliesSupplier(pDocSh->GetBaseModel(), - uno::UNO_QUERY); -uno::Reference xStyleFamilies -= xStyleFamiliesSupplier->getStyleFamilies(); -uno::Reference xStyleFamily; - -if (sType == CHARACTERSTYLES) -xStyleFamilies->getByName("CharacterStyles") >>= xStyleFamily; -else -xStyleFamilies->getByName("ParagraphStyles") >>= xStyleFamily; +pDFNode.sNodeName = "Direct Formatting"; +pCharNode.sNodeName = "Character Styles"; +pParaNode.sNodeName = "Paragraph Styles"; -uno::Reference xCursor = dynamic_cast(pCursor); uno::Reference xRange( SwXTextRange::CreateXTextRange(*pDoc, *pCursor->GetPoint(), nullptr)); -uno::Reference properties(xRange, uno::UNO_QUERY_THROW); -OUString sCurrentStyleName, sDisplayName; -if (sType == CHARACTERSTYLES) -properties->getPropertyValue("CharStyleName") >>= sCurrentStyleName; -else -properties->getPropertyValue("ParaStyleName") >>= sCurrentStyleName; +uno::Reference xPropertiesSet(xRange, uno::UNO_QUERY_THROW); +uno::Reference xPropertiesState(xRange, uno::UNO_QUERY_THROW); -if (sCurrentStyleName.isEmpty()) -return; // In case of Default Character Styles; +uno::Sequence aProperties += xPropertiesSet->getPropertySetInfo()->getProperties(); -while (true) +std::unordered_map aIsDefined; +for (const beans::Property& rProperty : std::as_const(aProperties)) { -uno::Reference xProp1; -uno::Reference xProp1Set; -xStyleFamily->getByName(sCurrentStyleName) >>= xProp1; -xStyleFamily->getByName(sCurrentStyleName) >>= xProp1Set; -OUString aParentCharStyle = xProp1->getParentStyle(); -xProp1Set->getPropertyValue("DisplayName") >>= sDisplayName; -svx::sidebar::TreeNode pCurrentChild; -pCurrentChild.sNodeName = sDisplayName; - -if (aParentCharStyle.isEmpty()) +if (xPropertiesState->getPropertyState(rProperty.Name) == beans::PropertyState_DIRECT_VALUE) { -break; // when current style is "Standard" there is no parent +OUString aPropertyValuePair; +const uno::Any aAny = xPropertiesSet->getPropertyValue(rProperty.Name); +if (GetPropertyValues(rProperty, aAny, aPropertyValuePair)) +{ +aIsDefined[rProperty.Name] = true; +svx::sidebar::TreeNode pTemp; +pTemp.sNodeName = aPropertyValuePair; +pDFNode.children.push_back(pTemp); +} } +} -const uno::Sequence aProperties -= xProp1Set->getPropertySetInfo()->getProperties(); -const uno::Reference xProp2Set( -xStyleFamily->getByName(aParentCharStyle), uno::UNO_QUERY); +uno::Reference xStyleFamiliesSupplier(pDocSh->GetBaseModel(), + uno::UNO_QUERY); +uno::Reference xStyleFamilies += xStyleFamiliesSupplier->getStyleFamilies(); +OUString sCurrentCharStyle, sCurrentParaStyle, sDisplayName; -try -{ -for (const beans::Property& rProperty : aProperties) -{ -OUString sPropName = rProperty.Name; +uno::Reference xStyleFamily( +x
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/sidebar/SwPanelFactory.cxx |2 sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx | 71 +++--- sw/source/uibase/sidebar/WriterInspectorTextPanel.hxx | 21 + 3 files changed, 35 insertions(+), 59 deletions(-) New commits: commit 00be56d9db396d284f66ab723d6fbb898b888dfb Author: Shivam Kumar Singh AuthorDate: Fri Jul 10 16:00:37 2020 +0530 Commit: Heiko Tietze CommitDate: Mon Jul 13 11:11:55 2020 +0200 tdf#134661 Issue in Inspector update This patch now uses AttrChangedNotify instead of NotifyItemUpdate to check for cursor change Change-Id: Ibdbd1565d72097d2f78ecb8194a201585951ce9d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98490 Tested-by: Jenkins Reviewed-by: Mike Kaganski Reviewed-by: Heiko Tietze diff --git a/sw/source/uibase/sidebar/SwPanelFactory.cxx b/sw/source/uibase/sidebar/SwPanelFactory.cxx index b3d1bbf6932f..b073b2801733 100644 --- a/sw/source/uibase/sidebar/SwPanelFactory.cxx +++ b/sw/source/uibase/sidebar/SwPanelFactory.cxx @@ -172,7 +172,7 @@ Reference SAL_CALL SwPanelFactory::createUIElement ( } else if (rsResourceURL.endsWith("/WriterInspectorTextPanel")) { -VclPtr pPanel = sw::sidebar::WriterInspectorTextPanel::Create( pParentWindow, xFrame, pBindings); +VclPtr pPanel = sw::sidebar::WriterInspectorTextPanel::Create( pParentWindow, xFrame); xElement = sfx2::sidebar::SidebarPanelBase::Create( rsResourceURL, xFrame, diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx index 0bfafc0a5bc9..7222c3de0989 100644 --- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx +++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx @@ -35,8 +35,7 @@ namespace sw::sidebar { VclPtr WriterInspectorTextPanel::Create(vcl::Window* pParent, - const uno::Reference& rxFrame, - SfxBindings* pBindings) + const uno::Reference& rxFrame) { if (pParent == nullptr) throw lang::IllegalArgumentException( @@ -44,20 +43,18 @@ VclPtr WriterInspectorTextPanel::Create(vcl::Window* pParent, if (!rxFrame.is()) throw lang::IllegalArgumentException("no XFrame given to WriterInspectorTextPanel::Create", nullptr, 1); -if (pBindings == nullptr) -throw lang::IllegalArgumentException( -"no SfxBindings given to WriterInspectorTextPanel::Create", nullptr, 2); -return VclPtr::Create(pParent, rxFrame, pBindings); +return VclPtr::Create(pParent, rxFrame); } WriterInspectorTextPanel::WriterInspectorTextPanel(vcl::Window* pParent, - const uno::Reference& rxFrame, - SfxBindings* pBindings) + const uno::Reference& rxFrame) : InspectorTextPanel(pParent, rxFrame) -, maCharStyle(SID_STYLE_FAMILY1, *pBindings, *this) -, maParaStyle(SID_STYLE_FAMILY2, *pBindings, *this) { +SwDocShell* pDocSh = static_cast(SfxObjectShell::Current()); +SwWrtShell* pShell = pDocSh->GetWrtShell(); +if (pShell) +pShell->SetChgLnk(LINK(this, WriterInspectorTextPanel, AttrChangedNotify)); } static bool GetPropertyValues(const beans::Property rProperty, const uno::Any& rAny, @@ -229,44 +226,34 @@ static void UpdateTree(SwDocShell* pDocSh, svx::sidebar::TreeNode& pParentNode, std::reverse(pParentNode.children.begin(), pParentNode.children.end()); } -void WriterInspectorTextPanel::NotifyItemUpdate(const sal_uInt16 nSId, -const SfxItemState /*eState*/, -const SfxPoolItem* /*pState*/) +IMPL_LINK_NOARG(WriterInspectorTextPanel, AttrChangedNotify, LinkParamNone*, void) { SwDocShell* pDocSh = static_cast(SfxObjectShell::Current()); std::vector aStore; std::unordered_map maIsDefined; -switch (nSId) +if (pDocSh && pDocSh->GetDoc()->GetEditShell()->GetCursor()->GetNode().GetTextNode()) { -case SID_STYLE_FAMILY1: -case SID_STYLE_FAMILY2: -{ -if (pDocSh && pDocSh->GetDoc()->GetEditShell()->GetCursor()->GetNode().GetTextNode()) -{ -/* -First check in the property set of Character Styles -(as CS has higher priority over PS), then look into -property set of Paragraph Styles; -*/ -svx::sidebar::TreeNode pTempChar; -pTempChar.sNodeName = "CHARACTER STYLES"; -UpdateTree(pDocSh, pTempChar, maIsDefined, CHARACTERSTYLES); -svx::sidebar::TreeNode
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 4213a0b6929d188d5ec75a6b90e194c2b6ba9d11 Author: Shivam Kumar Singh AuthorDate: Tue Jul 7 01:06:55 2020 +0530 Commit: Heiko Tietze CommitDate: Thu Jul 9 14:43:19 2020 +0200 tdf#134562 Added check for textnode Change-Id: I0a38de547747f04a61a66c9ef62e59a68c4e1826 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98225 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx index dbc22de258b5..0bfafc0a5bc9 100644 --- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx +++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx @@ -20,6 +20,7 @@ #include "WriterInspectorTextPanel.hxx" #include #include +#include #include #include #include @@ -241,7 +242,7 @@ void WriterInspectorTextPanel::NotifyItemUpdate(const sal_uInt16 nSId, case SID_STYLE_FAMILY1: case SID_STYLE_FAMILY2: { -if (pDocSh) +if (pDocSh && pDocSh->GetDoc()->GetEditShell()->GetCursor()->GetNode().GetTextNode()) { /* First check in the property set of Character Styles ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: svx/source sw/source
svx/source/sidebar/inspector/InspectorTextPanel.cxx |7 ++- sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx | 10 -- 2 files changed, 6 insertions(+), 11 deletions(-) New commits: commit 9abeaaff50e9f6f15c0ef1be5fdabb6fbe1b7a5c Author: Shivam Kumar Singh AuthorDate: Wed Jul 8 09:44:19 2020 +0530 Commit: Mike Kaganski CommitDate: Wed Jul 8 14:55:14 2020 +0200 tdf#134567 Show all properties in DPS Change-Id: If2238a80fbc9fc803fc5e12904964bf4289ba2d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98310 Tested-by: Jenkins Tested-by: Heiko Tietze Reviewed-by: Heiko Tietze Reviewed-by: Mike Kaganski diff --git a/svx/source/sidebar/inspector/InspectorTextPanel.cxx b/svx/source/sidebar/inspector/InspectorTextPanel.cxx index 906ca736a91a..652e63261713 100644 --- a/svx/source/sidebar/inspector/InspectorTextPanel.cxx +++ b/svx/source/sidebar/inspector/InspectorTextPanel.cxx @@ -44,7 +44,7 @@ InspectorTextPanel::InspectorTextPanel(vcl::Window* pParent, : PanelLayout(pParent, "InspectorTextPanel", "svx/ui/inspectortextpanel.ui", rxFrame) , mxListBoxStyles(m_xBuilder->weld_tree_view("listbox_fonts")) { -mxListBoxStyles->set_size_request(-1, mxListBoxStyles->get_height_rows(27)); +mxListBoxStyles->set_size_request(-1, mxListBoxStyles->get_height_rows(25)); } static void FillBox_Impl(weld::TreeView& rListBoxStyles, const TreeNode& current, @@ -74,6 +74,11 @@ void InspectorTextPanel::updateEntries(const std::vector& rStore) pTreeDiagram->expand_row(rEntry); return false; }); + +std::unique_ptr xEntry = mxListBoxStyles->make_iterator(); +mxListBoxStyles->get_iter_first(*xEntry); +mxListBoxStyles->iter_next(*xEntry); +mxListBoxStyles->collapse_row(*xEntry); // Collapse "Default Paragraph Style" } InspectorTextPanel::~InspectorTextPanel() { disposeOnce(); } diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx index b4733e0c1633..dbc22de258b5 100644 --- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx +++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx @@ -146,10 +146,8 @@ static void UpdateTree(SwDocShell* pDocSh, svx::sidebar::TreeNode& pParentNode, { uno::Reference xProp1; uno::Reference xProp1Set; -uno::Reference xProp1State; xStyleFamily->getByName(sCurrentStyleName) >>= xProp1; xStyleFamily->getByName(sCurrentStyleName) >>= xProp1Set; -xStyleFamily->getByName(sCurrentStyleName) >>= xProp1State; OUString aParentCharStyle = xProp1->getParentStyle(); xProp1Set->getPropertyValue("DisplayName") >>= sDisplayName; svx::sidebar::TreeNode pCurrentChild; @@ -170,10 +168,6 @@ static void UpdateTree(SwDocShell* pDocSh, svx::sidebar::TreeNode& pParentNode, for (const beans::Property& rProperty : aProperties) { OUString sPropName = rProperty.Name; -// If property's current value equals default value -if (xProp1Set->getPropertyValue(sPropName) -== xProp1State->getPropertyDefault(sPropName)) -continue; if (maIsDefined[sPropName]) continue; @@ -204,9 +198,7 @@ static void UpdateTree(SwDocShell* pDocSh, svx::sidebar::TreeNode& pParentNode, } uno::Reference aProp1Set; -uno::Reference aProp1State; xStyleFamily->getByName(sCurrentStyleName) >>= aProp1Set; -xStyleFamily->getByName(sCurrentStyleName) >>= aProp1State; const uno::Sequence aProperties = aProp1Set->getPropertySetInfo()->getProperties(); @@ -216,8 +208,6 @@ static void UpdateTree(SwDocShell* pDocSh, svx::sidebar::TreeNode& pParentNode, for (const beans::Property& rProperty : aProperties) { OUString aPropertyValuePair, sPropName = rProperty.Name; -if (aProp1Set->getPropertyValue(sPropName) == aProp1State->getPropertyDefault(sPropName)) -continue; if (maIsDefined[sPropName]) continue; maIsDefined[sPropName] = true; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 4541f80e7fabf4c7d250d8d31a1ef330540c7ffb Author: Shivam Kumar Singh AuthorDate: Wed Jul 8 10:04:33 2020 +0530 Commit: Mike Kaganski CommitDate: Wed Jul 8 14:53:51 2020 +0200 tdf#134568 Omit Default Character Styles Change-Id: Id3cdcb609c9edf3b3ed7a13d0d64a392479f81f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98311 Tested-by: Jenkins Tested-by: Heiko Tietze Reviewed-by: Heiko Tietze diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx index a81efa78a8b4..b4733e0c1633 100644 --- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx +++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx @@ -140,7 +140,7 @@ static void UpdateTree(SwDocShell* pDocSh, svx::sidebar::TreeNode& pParentNode, properties->getPropertyValue("ParaStyleName") >>= sCurrentStyleName; if (sCurrentStyleName.isEmpty()) -sCurrentStyleName = "Standard"; +return; // In case of Default Character Styles; while (true) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/svx officecfg/registry svx/source svx/uiconfig sw/source
include/svx/sidebar/InspectorTextPanel.hxx |8 officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu |7 svx/source/sidebar/inspector/InspectorTextPanel.cxx | 30 - svx/uiconfig/ui/inspectortextpanel.ui|1 sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx| 301 ++- sw/source/uibase/sidebar/WriterInspectorTextPanel.hxx| 13 6 files changed, 233 insertions(+), 127 deletions(-) New commits: commit 4b8abb3db70ab5af3a9e92a327b46bbf38a481b3 Author: Shivam Kumar Singh AuthorDate: Fri Jun 26 17:03:52 2020 +0530 Commit: Mike Kaganski CommitDate: Fri Jul 3 09:43:26 2020 +0200 Added tree view for Inspector and support for PS -> The support for PS has been added. -> The UI for Inspector has been updated with expand/collapse buttons for PS and CS. -> Any property is listed only once at the Inspector either at PS or at CS -> Hide any property having default value (only modified properties are of interest) -> Hide Asian and Complex Properties Change-Id: I3b519eef7a5699339608fdb8c29d6f04498f4346 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97263 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/include/svx/sidebar/InspectorTextPanel.hxx b/include/svx/sidebar/InspectorTextPanel.hxx index 74c0b90fcd64..77240cd5a671 100644 --- a/include/svx/sidebar/InspectorTextPanel.hxx +++ b/include/svx/sidebar/InspectorTextPanel.hxx @@ -25,6 +25,11 @@ namespace svx { namespace sidebar { +struct TreeNode +{ +OUString sNodeName; +std::vector children; +}; class SVX_DLLPUBLIC InspectorTextPanel : public PanelLayout { public: @@ -36,7 +41,8 @@ public: InspectorTextPanel(vcl::Window* pParent, const css::uno::Reference& rxFrame); -virtual void updateEntries(std::vector store); + +void updateEntries(const std::vector& rStore); private: std::unique_ptr mxListBoxStyles; diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu index 5e31fd73689d..5bfe97af7726 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu @@ -397,7 +397,10 @@ - Character Styles + Styles Inspector + + + true InspectorTextPanel @@ -414,7 +417,7 @@ private:resource/toolpanel/SwPanelFactory/WriterInspectorTextPanel - 120 + 100 true diff --git a/svx/source/sidebar/inspector/InspectorTextPanel.cxx b/svx/source/sidebar/inspector/InspectorTextPanel.cxx index 07ab0ab38ca4..906ca736a91a 100644 --- a/svx/source/sidebar/inspector/InspectorTextPanel.cxx +++ b/svx/source/sidebar/inspector/InspectorTextPanel.cxx @@ -44,14 +44,36 @@ InspectorTextPanel::InspectorTextPanel(vcl::Window* pParent, : PanelLayout(pParent, "InspectorTextPanel", "svx/ui/inspectortextpanel.ui", rxFrame) , mxListBoxStyles(m_xBuilder->weld_tree_view("listbox_fonts")) { -mxListBoxStyles->set_size_request(-1, mxListBoxStyles->get_height_rows(10)); +mxListBoxStyles->set_size_request(-1, mxListBoxStyles->get_height_rows(27)); } -void InspectorTextPanel::updateEntries(std::vector store) +static void FillBox_Impl(weld::TreeView& rListBoxStyles, const TreeNode& current, + weld::TreeIter* pParent) { +std::unique_ptr pResult = rListBoxStyles.make_iterator(); +const OUString& rName = current.sNodeName; +rListBoxStyles.insert(pParent, -1, &rName, nullptr, nullptr, nullptr, false, pResult.get()); + +for (const TreeNode& ChildNode : current.children) +FillBox_Impl(rListBoxStyles, ChildNode, pResult.get()); +} + +void InspectorTextPanel::updateEntries(const std::vector& rStore) +{ +mxListBoxStyles->freeze(); mxListBoxStyles->clear(); -for (OUString& str : store) -mxListBoxStyles->append_text(str); +for (const TreeNode& ChildNode : rStore) +{ +FillBox_Impl(*mxListBoxStyles, ChildNode, nullptr); +} + +mxListBoxStyles->thaw(); + +weld::TreeView* pTreeDiagram = mxListBoxStyles.get(); +pTreeDiagram->all_foreach([pTreeDiagram](weld::TreeIter& rEntry) { +pTreeDiagram->expand_row(rEntry); +return false; +}); } InspectorTextPanel::~InspectorTextPanel() { disposeOnce(); } diff --git a/svx/uiconfig/ui/inspectortextpanel.ui b/svx/uiconfig/ui/inspectortextpanel.ui index 726a3d840dc6..af7c5cbe2ed5 100644 --- a/svx/uiconfig/ui/inspectortextpanel.ui +++ b/svx/uiconfig/ui/inspectortextpanel.ui @@ -46,7 +46,6 @@ False False 0 -False diff --git a/s
[Libreoffice-commits] core.git: svx/source sw/source
svx/source/sidebar/inspector/InspectorTextPanel.cxx |1 sw/source/uibase/sidebar/SwPanelFactory.cxx |2 sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx | 182 +- sw/source/uibase/sidebar/WriterInspectorTextPanel.hxx | 25 ++ 4 files changed, 197 insertions(+), 13 deletions(-) New commits: commit 006c65bbd472cb1d7d44e095714e28190b76be0d Author: Shivam Kumar Singh AuthorDate: Fri May 29 13:10:52 2020 +0530 Commit: Tomaž Vajngerl CommitDate: Thu Jun 25 10:17:07 2020 +0200 Get the property dump of the text at the cursor We need the property dump consisting of 1) Character Properties 2) Paragraph Properties 3) Character Style Properties 4) Paragraph Style Properties This patch gives all the properties related to 'Character Styles' at the cursor. This patch manages inheritance features, which means, it lists any property only at that level in which the property has been redefined for the last time. Change-Id: Ice2ae9ac92aec4af9d395885e06602753e636457 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95094 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/svx/source/sidebar/inspector/InspectorTextPanel.cxx b/svx/source/sidebar/inspector/InspectorTextPanel.cxx index 68ac911a6408..07ab0ab38ca4 100644 --- a/svx/source/sidebar/inspector/InspectorTextPanel.cxx +++ b/svx/source/sidebar/inspector/InspectorTextPanel.cxx @@ -49,6 +49,7 @@ InspectorTextPanel::InspectorTextPanel(vcl::Window* pParent, void InspectorTextPanel::updateEntries(std::vector store) { +mxListBoxStyles->clear(); for (OUString& str : store) mxListBoxStyles->append_text(str); } diff --git a/sw/source/uibase/sidebar/SwPanelFactory.cxx b/sw/source/uibase/sidebar/SwPanelFactory.cxx index b073b2801733..b3d1bbf6932f 100644 --- a/sw/source/uibase/sidebar/SwPanelFactory.cxx +++ b/sw/source/uibase/sidebar/SwPanelFactory.cxx @@ -172,7 +172,7 @@ Reference SAL_CALL SwPanelFactory::createUIElement ( } else if (rsResourceURL.endsWith("/WriterInspectorTextPanel")) { -VclPtr pPanel = sw::sidebar::WriterInspectorTextPanel::Create( pParentWindow, xFrame); +VclPtr pPanel = sw::sidebar::WriterInspectorTextPanel::Create( pParentWindow, xFrame, pBindings); xElement = sfx2::sidebar::SidebarPanelBase::Create( rsResourceURL, xFrame, diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx index c0fc42be0ac4..10277c7eabe4 100644 --- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx +++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx @@ -18,16 +18,24 @@ */ #include "WriterInspectorTextPanel.hxx" - +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -using namespace css; +#include namespace sw::sidebar { -VclPtr -WriterInspectorTextPanel::Create(vcl::Window* pParent, - const css::uno::Reference& rxFrame) +VclPtr WriterInspectorTextPanel::Create(vcl::Window* pParent, + const uno::Reference& rxFrame, + SfxBindings* pBindings) { if (pParent == nullptr) throw lang::IllegalArgumentException( @@ -35,17 +43,175 @@ WriterInspectorTextPanel::Create(vcl::Window* pParent, if (!rxFrame.is()) throw lang::IllegalArgumentException("no XFrame given to WriterInspectorTextPanel::Create", nullptr, 1); +if (pBindings == nullptr) +throw lang::IllegalArgumentException( +"no SfxBindings given to WriterInspectorTextPanel::Create", nullptr, 2); -return VclPtr::Create(pParent, rxFrame); +return VclPtr::Create(pParent, rxFrame, pBindings); } -WriterInspectorTextPanel::WriterInspectorTextPanel( -vcl::Window* pParent, const css::uno::Reference& rxFrame) + +WriterInspectorTextPanel::WriterInspectorTextPanel(vcl::Window* pParent, + const uno::Reference& rxFrame, + SfxBindings* pBindings) : InspectorTextPanel(pParent, rxFrame) +, maCharStyle(SID_STYLE_FAMILY1, *pBindings, *this) +{ +} + +void WriterInspectorTextPanel::NotifyItemUpdate(const sal_uInt16 nSId, +const SfxItemState /*eState*/, +const SfxPoolItem* /*pState*/) { +SwDocShell* pDocSh = static_cast(SfxObjectShell::Current()); std::vector store; +switch (nSId) +{ +case SID_STYLE_FAMILY1: +{ +if (pDocSh) +{ +SwDoc* pDoc = pDocSh->GetDoc(); +SwPaM* pCursor = pDoc->GetEditShell()->GetCursor(); + +uno::Reference
[Libreoffice-commits] core.git: include/svx officecfg/registry svx/source svx/uiconfig sw/Library_sw.mk sw/source
include/svx/sidebar/InspectorTextPanel.hxx | 13 -- officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu |2 svx/source/sidebar/PanelFactory.cxx |5 - svx/source/sidebar/inspector/InspectorTextPanel.cxx | 20 +--- svx/uiconfig/ui/inspectortextpanel.ui|2 sw/Library_sw.mk |1 sw/source/uibase/sidebar/SwPanelFactory.cxx | 10 ++ sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx| 51 +++ sw/source/uibase/sidebar/WriterInspectorTextPanel.hxx| 42 + 9 files changed, 118 insertions(+), 28 deletions(-) New commits: commit c98affa44e3f61279ae9fe052dbcfbda0c58838e Author: Shivam Kumar Singh AuthorDate: Sat Jun 6 18:57:13 2020 +0530 Commit: Tomaž Vajngerl CommitDate: Sat Jun 13 01:09:59 2020 +0200 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 Reviewed-by: Tomaž Vajngerl diff --git a/svx/source/sidebar/inspector/InspectorTextPanel.hxx b/include/svx/sidebar/InspectorTextPanel.hxx similarity index 78% rename from svx/source/sidebar/inspector/InspectorTextPanel.hxx rename to include/svx/sidebar/InspectorTextPanel.hxx index 0d6160dfe75e..74c0b90fcd64 100644 --- a/svx/source/sidebar/inspector/InspectorTextPanel.hxx +++ b/include/svx/sidebar/InspectorTextPanel.hxx @@ -18,16 +18,14 @@ */ #pragma once -#include -#include -#include #include +#include namespace svx { namespace sidebar { -class InspectorTextPanel : public PanelLayout, public ::sfx2::sidebar::IContextChangeReceiver +class SVX_DLLPUBLIC InspectorTextPanel : public PanelLayout { public: virtual ~InspectorTextPanel() override; @@ -36,15 +34,12 @@ public: static VclPtr Create(vcl::Window* pParent, const css::uno::Reference& rxFrame); -virtual void HandleContextChange(const vcl::EnumContext& rContext) override; - InspectorTextPanel(vcl::Window* pParent, const css::uno::Reference& rxFrame); +virtual void updateEntries(std::vector store); private: -std::unique_ptr mxListBoxStyles; // To dump all the properties - -vcl::EnumContext maContext; +std::unique_ptr mxListBoxStyles; }; } } // end of namespace svx::sidebar diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu index fae993013b49..5e31fd73689d 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu @@ -411,7 +411,7 @@ - private:resource/toolpanel/SvxPanelFactory/InspectorTextPanel + private:resource/toolpanel/SwPanelFactory/WriterInspectorTextPanel 120 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 #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 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 #include -#include -#include using namespace css; @@ -44,11 +42,17 @@ InspectorTextPanel::Create(vcl::Window* pParent, InspectorTextPanel::InspectorTextPanel(vcl::Window* pParent, const css::uno::Reference& rxFrame) : PanelLayout(pParent, "InspectorTextPanel", "svx/ui/inspectortextpane
[Libreoffice-commits] core.git: svx/source svx/uiconfig
svx/source/sidebar/inspector/InspectorTextPanel.cxx | 12 - svx/source/sidebar/inspector/InspectorTextPanel.hxx |5 svx/uiconfig/ui/inspectortextpanel.ui | 158 +--- 3 files changed, 45 insertions(+), 130 deletions(-) New commits: commit a9b47360c2af2514b1064fb179f9fb9f0b8ad225 Author: Shivam Kumar Singh AuthorDate: Sun May 31 22:55:40 2020 +0530 Commit: Mike Kaganski CommitDate: Tue Jun 2 12:00:32 2020 +0200 Removed the "Font.." things from the Inspector Removed all the font related stuff and added a common property listing box for the 'Character' Properties. Another patch coming up for 'Paragraph' properties. Change-Id: I71de4d4fe6536f49e0e700c850e2e714287c5e04 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95228 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl Reviewed-by: Mike Kaganski diff --git a/svx/source/sidebar/inspector/InspectorTextPanel.cxx b/svx/source/sidebar/inspector/InspectorTextPanel.cxx index 0c719dfccb2f..6eaa6f992573 100644 --- a/svx/source/sidebar/inspector/InspectorTextPanel.cxx +++ b/svx/source/sidebar/inspector/InspectorTextPanel.cxx @@ -44,22 +44,16 @@ InspectorTextPanel::Create(vcl::Window* pParent, InspectorTextPanel::InspectorTextPanel(vcl::Window* pParent, const css::uno::Reference& rxFrame) : PanelLayout(pParent, "InspectorTextPanel", "svx/ui/inspectortextpanel.ui", rxFrame) -, mxFont(m_xBuilder->weld_toolbar("font")) -, mxFontDispatch(new ToolbarUnoDispatcher(*mxFont, *m_xBuilder, rxFrame)) -, mxFontHeight(m_xBuilder->weld_toolbar("fontheight")) -, mxFontHeightDispatch(new ToolbarUnoDispatcher(*mxFontHeight, *m_xBuilder, rxFrame)) +, mxListBoxStyles(m_xBuilder->weld_tree_view("liststore")) { +mxListBoxStyles->set_size_request(-1, mxListBoxStyles->get_height_rows(10)); } InspectorTextPanel::~InspectorTextPanel() { disposeOnce(); } void InspectorTextPanel::dispose() { -mxFontHeightDispatch.reset(); -mxFontDispatch.reset(); - -mxFontHeight.reset(); -mxFont.reset(); +mxListBoxStyles.reset(); PanelLayout::dispose(); } diff --git a/svx/source/sidebar/inspector/InspectorTextPanel.hxx b/svx/source/sidebar/inspector/InspectorTextPanel.hxx index ed8b24a52d48..0d6160dfe75e 100644 --- a/svx/source/sidebar/inspector/InspectorTextPanel.hxx +++ b/svx/source/sidebar/inspector/InspectorTextPanel.hxx @@ -42,10 +42,7 @@ public: const css::uno::Reference& rxFrame); private: -std::unique_ptr mxFont; -std::unique_ptr mxFontDispatch; -std::unique_ptr mxFontHeight; -std::unique_ptr mxFontHeightDispatch; +std::unique_ptr mxListBoxStyles; // To dump all the properties vcl::EnumContext maContext; }; diff --git a/svx/uiconfig/ui/inspectortextpanel.ui b/svx/uiconfig/ui/inspectortextpanel.ui index f3966cc687fd..1ebd98403eb5 100644 --- a/svx/uiconfig/ui/inspectortextpanel.ui +++ b/svx/uiconfig/ui/inspectortextpanel.ui @@ -1,150 +1,74 @@ - - + + + + + + + + + + True False -True +6 +6 - + True False True -6 -vertical -3 +True - + True False -6 - - -True -False -10 -Font Name -True -font - - -False -True -0 - - +True +True +6 +6 - + True -False +True True -icons -False -2 +True +in - + True -False +True True - - -True -False -True -True -False - - -True - - - +True +liststore +False +False +0 +False + + - - -True -False - - - - -True -True -1 - - -
[Libreoffice-commits] core.git: officecfg/registry svx/Library_svx.mk svx/source svx/uiconfig svx/UIConfig_svx.mk
officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu | 49 +++ svx/Library_svx.mk |1 svx/UIConfig_svx.mk |1 svx/source/sidebar/PanelFactory.cxx |5 svx/source/sidebar/inspector/InspectorTextPanel.cxx | 77 + svx/source/sidebar/inspector/InspectorTextPanel.hxx | 55 +++ svx/uiconfig/ui/inspectortextpanel.ui| 156 +++ 7 files changed, 344 insertions(+) New commits: commit 9d6e64ba575c12ce4ab381332f8971e55ffe9972 Author: Shivam Kumar Singh AuthorDate: Sat May 9 19:41:25 2020 +0530 Commit: Mike Kaganski CommitDate: Mon May 18 11:01:41 2020 +0200 Added a new tab "Styles Inspector" at the side bar Patch significance :- 1) Added a new tab "Styles Inspector" at the side bar 2) Added the "Character Styles" properties in the inspector Change-Id: I717f0a555d9c90f833c61b641c8eba53f93d4655 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93909 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu index af6acf5218a9..fae993013b49 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu @@ -41,6 +41,29 @@ + + + Styles Inspector + + + InspectorDeck + + + private:graphicrepository/cmd/lc_editglossary.png + + + +WriterVariants, any, visible ; + + + + 450 + + + true + + + Page @@ -372,6 +395,32 @@ + + + Character Styles + + + InspectorTextPanel + + + InspectorDeck + + + +WriterVariants, any, visible ; + + + + private:resource/toolpanel/SvxPanelFactory/InspectorTextPanel + + + 120 + + + true + + + Media Playback diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk index 8f8dd0c7020f..a378df63702d 100644 --- a/svx/Library_svx.mk +++ b/svx/Library_svx.mk @@ -177,6 +177,7 @@ $(eval $(call gb_Library_add_exception_objects,svx,\ svx/source/mnuctrls/smarttagmenu \ svx/source/sidebar/ContextChangeEventMultiplexer \ svx/source/sidebar/EmptyPanel \ +svx/source/sidebar/inspector/InspectorTextPanel \ svx/source/sidebar/nbdtmg \ svx/source/sidebar/nbdtmgfact \ svx/source/sidebar/PanelFactory \ diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk index 1a6a87cca4de..fdc7d1b3bc52 100644 --- a/svx/UIConfig_svx.mk +++ b/svx/UIConfig_svx.mk @@ -80,6 +80,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\ svx/uiconfig/ui/headfootformatpage \ svx/uiconfig/ui/imapdialog \ svx/uiconfig/ui/imapmenu \ + svx/uiconfig/ui/inspectortextpanel \ svx/uiconfig/ui/interimdockparent \ svx/uiconfig/ui/interimparent \ svx/uiconfig/ui/labelbox \ diff --git a/svx/source/sidebar/PanelFactory.cxx b/svx/source/sidebar/PanelFactory.cxx index e37648b38c25..6b8ed657351e 100644 --- a/svx/source/sidebar/PanelFactory.cxx +++ b/svx/source/sidebar/PanelFactory.cxx @@ -20,6 +20,7 @@ #include #include "text/TextPropertyPanel.hxx" +#include "inspector/InspectorTextPanel.hxx" #include "styles/StylesPropertyPanel.hxx" #include "paragraph/ParaPropertyPanel.hxx" #include "lists/ListsPropertyPanel.hxx" @@ -124,6 +125,10 @@ Reference 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 new file mode 100644 index ..0c719dfccb2f --- /dev/null +++ b/svx/source/sidebar/inspector/InspectorTextPanel.cxx @@ -0,0 +1,77 @@ +/* -*- 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 Apa
[Libreoffice-commits] core.git: svx/source
svx/source/sidebar/media/MediaPlaybackPanel.hxx |5 + svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx |5 + svx/source/sidebar/paragraph/ParaPropertyPanel.hxx |5 + svx/source/sidebar/paragraph/ParaSpacingWindow.hxx |5 + svx/source/sidebar/styles/StylesPropertyPanel.hxx |5 + 5 files changed, 5 insertions(+), 20 deletions(-) New commits: commit 845859017a74978a7ad5c6473b473f38f284edf2 Author: Shivam Kumar Singh AuthorDate: Sun May 10 01:18:52 2020 +0530 Commit: Julien Nabet CommitDate: Thu May 14 22:49:11 2020 +0200 tdf#124176: Use pragma once instead of header guard Change-Id: I6adea171e05fec4a36225cead031214c7d1544e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93895 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/svx/source/sidebar/media/MediaPlaybackPanel.hxx b/svx/source/sidebar/media/MediaPlaybackPanel.hxx index 69c6d08af6ef..a71a18a5e38e 100644 --- a/svx/source/sidebar/media/MediaPlaybackPanel.hxx +++ b/svx/source/sidebar/media/MediaPlaybackPanel.hxx @@ -16,8 +16,7 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_SD_SOURCE_SIDEBAR_MEDIAPLAYBACKPANEL_HXX -#define INCLUDED_SD_SOURCE_SIDEBAR_MEDIAPLAYBACKPANEL_HXX +#pragma once #include #include @@ -81,6 +80,4 @@ private: } // end of namespace svx::sidebar -#endif - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx b/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx index 6904b9fcd696..14b335a375a6 100644 --- a/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx +++ b/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx @@ -16,8 +16,7 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_PARAGRAPH_PARALINESPACINGCONTROL_HXX -#define INCLUDED_SVX_SOURCE_SIDEBAR_PARAGRAPH_PARALINESPACINGCONTROL_HXX +#pragma once #include @@ -77,6 +76,4 @@ private: }; } -#endif - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx index 5ea5cc842242..d59712360055 100644 --- a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx +++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx @@ -16,8 +16,7 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_PARAGRAPH_PARAPROPERTYPANEL_HXX -#define INCLUDED_SVX_SOURCE_SIDEBAR_PARAGRAPH_PARAPROPERTYPANEL_HXX +#pragma once #include #include @@ -135,6 +134,4 @@ private: } // end of namespace svx::sidebar -#endif - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/sidebar/paragraph/ParaSpacingWindow.hxx b/svx/source/sidebar/paragraph/ParaSpacingWindow.hxx index 77f308697f43..70ffd6d749fa 100644 --- a/svx/source/sidebar/paragraph/ParaSpacingWindow.hxx +++ b/svx/source/sidebar/paragraph/ParaSpacingWindow.hxx @@ -16,8 +16,7 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_PARAGRAPH_PARASPACINGWINDOW_HXX -#define INCLUDED_SVX_SOURCE_SIDEBAR_PARAGRAPH_PARASPACINGWINDOW_HXX +#pragma once #include #include @@ -113,6 +112,4 @@ public: }; } -#endif - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/sidebar/styles/StylesPropertyPanel.hxx b/svx/source/sidebar/styles/StylesPropertyPanel.hxx index 058c594249aa..f9dd6b1747e9 100644 --- a/svx/source/sidebar/styles/StylesPropertyPanel.hxx +++ b/svx/source/sidebar/styles/StylesPropertyPanel.hxx @@ -1,5 +1,4 @@ -#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_STYLES_STYLESPROPERTYPANEL_HXX -#define INCLUDED_SVX_SOURCE_SIDEBAR_STYLES_STYLESPROPERTYPANEL_HXX +#pragma once #include #include @@ -33,5 +32,3 @@ public: }; } //end of namespace svx::sidebar - -#endif ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/ribbar/workctrl.cxx | 12 1 file changed, 8 insertions(+), 4 deletions(-) New commits: commit 26c9b7863b7e3a8f3a1c43ec26f2efe77c1958a7 Author: Shivam Kumar Singh AuthorDate: Wed Jan 29 13:36:17 2020 +0530 Commit: Jim Raykowski CommitDate: Fri Mar 13 22:44:34 2020 +0100 tdf#129471 alphabetize Navigate By option in writer The "Navigate By" option in find does not have a particular order. In this patch all the options are sorted alphabetically . Change-Id: I52fdce37ac86ed12b7ea123f7238bf2b788f8a2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87670 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx index 336b48031b2e..90ed663b5952 100644 --- a/sw/source/uibase/ribbar/workctrl.cxx +++ b/sw/source/uibase/ribbar/workctrl.cxx @@ -50,6 +50,7 @@ #include #include #include +#include // Size check #define NAVI_ENTRIES 18 @@ -656,8 +657,12 @@ NavElementBox_Impl::NavElementBox_Impl( { m_xWidget->set_size_request(42, -1); // set to something small so the size set at the .ui takes precedence -for (sal_uInt16 i = 0; i < NID_COUNT; ++i) -m_xWidget->append("", SwResId(aNavigationStrIds[i]), aNavigationImgIds[i]); +std::map > aStoreSortedNavigationIds; +for(sal_uInt16 i = 0; i < NID_COUNT; i++) +aStoreSortedNavigationIds[SwResId(aNavigationStrIds[i])] = std::make_pair(aNavigationInsertIds[i], aNavigationImgIds[i]);// for ordering of Navigation Pane + +for (auto const &itr : aStoreSortedNavigationIds) +m_xWidget->append(OUString::number(itr.second.first), itr.first, itr.second.second); m_xWidget->connect_changed(LINK(this, NavElementBox_Impl, SelectHdl)); m_xWidget->connect_key_press(LINK(this, NavElementBox_Impl, KeyInputHdl)); @@ -682,8 +687,7 @@ IMPL_LINK(NavElementBox_Impl, SelectHdl, weld::ComboBox&, rComboBox, void) { SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty ); -sal_uInt16 nPos = rComboBox.get_active(); -sal_uInt16 nMoveType = aNavigationInsertIds[nPos]; +sal_uInt16 nMoveType = rComboBox.get_active_id().toUInt32(); SwView::SetMoveType( nMoveType ); css::uno::Sequence< css::beans::PropertyValue > aArgs; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/dialog/templdlg.cxx | 72 +--- sfx2/source/inc/templdgi.hxx|1 2 files changed, 61 insertions(+), 12 deletions(-) New commits: commit ddf96414896fd19b2ed82f9e4d4974855cf1e83a Author: Shivam Kumar Singh AuthorDate: Sat Feb 1 20:58:49 2020 +0530 Commit: Maxim Monastirsky CommitDate: Thu Feb 27 12:10:57 2020 +0100 tdf#128357 Forcing default style to stay at top in page styles Change-Id: I1f3d17f0d735a95c40e2fb9f1f6a7f12b5b30b82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87808 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 25e9f0ffb918..fb6608d6490f 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -19,6 +19,9 @@ #include +#include +#include +#include #include #include #include @@ -576,7 +579,7 @@ public: } -static void MakeTree_Impl(StyleTreeArr_Impl& rArr) +static void MakeTree_Impl(StyleTreeArr_Impl& rArr, const OUString& aUIName) { const comphelper::string::NaturalStringSorter aSorter( ::comphelper::getProcessComponentContext(), @@ -609,11 +612,12 @@ static void MakeTree_Impl(StyleTreeArr_Impl& rArr) rArr.erase(std::remove_if(rArr.begin(), rArr.end(), [](std::unique_ptr const & pEntry) { return !pEntry; }), rArr.end()); // tdf#91106 sort top level styles +std::sort(rArr.begin(), rArr.end()); std::sort(rArr.begin(), rArr.end(), -[&aSorter](std::unique_ptr const & pEntry1, std::unique_ptr const & pEntry2) { -if (pEntry2->getName() == "Default Style") +[&aSorter, &aUIName](std::unique_ptr const & pEntry1, std::unique_ptr const & pEntry2) { +if (pEntry2->getName() == aUIName) return false; -if (pEntry1->getName() == "Default Style") +if (pEntry1->getName() == aUIName) return true; // default always first return aSorter.compare(pEntry1->getName(), pEntry2->getName()) < 0; }); @@ -697,7 +701,7 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, vcl , xModuleManager(frame::ModuleManager::create(::comphelper::getProcessComponentContext())) , m_pDeletionWatcher(nullptr) -, aFmtLb( VclPtr::Create(this, WB_BORDER | WB_TABSTOP | WB_SORT) ) +, aFmtLb( VclPtr::Create(this, WB_BORDER | WB_TABSTOP) ) , pTreeBox( VclPtr::Create(this, WB_HASBUTTONS | WB_HASLINES | WB_BORDER | WB_TABSTOP | WB_HASLINESATROOT | WB_HASBUTTONSATROOT | WB_HIDESELECTION) ) @@ -729,7 +733,7 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, vcl aFmtLb->SetAccessibleName(SfxResId(STR_STYLE_ELEMTLIST)); aFmtLb->SetHelpId( HID_TEMPLATE_FMT ); aFilterLb->SetHelpId( HID_TEMPLATE_FILTER ); -aFmtLb->SetStyle( aFmtLb->GetStyle() | WB_SORT | WB_HIDESELECTION ); +aFmtLb->SetStyle( aFmtLb->GetStyle() | WB_HIDESELECTION ); vcl::Font aFont = aFmtLb->GetFont(); aFont.SetWeight( WEIGHT_NORMAL ); aFmtLb->SetFont( aFont ); @@ -1071,6 +1075,44 @@ void SfxCommonTemplateDialog_Impl::EnableTreeDrag( bool bEnable ) bTreeDrag = bEnable; } +static OUString lcl_GetStyleFamilyName( SfxStyleFamily nFamily ) +{ +if(nFamily == SfxStyleFamily::Char) +return "CharacterStyles" ; +if(nFamily == SfxStyleFamily::Para) +return "ParagraphStyles"; +if(nFamily == SfxStyleFamily::Page) +return "PageStyles"; +if(nFamily == SfxStyleFamily::Table) +return "TableStyles"; +return OUString(); +} + +OUString SfxCommonTemplateDialog_Impl::getDefaultStyleName( const SfxStyleFamily eFam ) +{ +OUString sDefaultStyle; +OUString aFamilyName = lcl_GetStyleFamilyName(eFam); +if( aFamilyName == "TableStyles" ) +sDefaultStyle = "Default Style"; +else +sDefaultStyle = "Standard"; +uno::Reference< style::XStyleFamiliesSupplier > xModel(GetObjectShell()->GetModel(), uno::UNO_QUERY); +OUString aUIName; +try +{ +uno::Reference< container::XNameAccess > xStyles; +uno::Reference< container::XNameAccess > xCont = xModel->getStyleFamilies(); +xCont->getByName( aFamilyName ) >>= xStyles; +uno::Reference< beans::XPropertySet > xInfo; +xStyles->getByName( sDefaultStyle ) >>= xInfo; +xInfo->getPropertyValue("DisplayName") >>= aUIName; +} +catch (const uno::Exception&) +{ +} +return aUIName; +} + void SfxCommonTemplateDialog_Impl::FillTreeBox() { OSL_ENSURE( pTreeBox, "FillTreeBox() without treebox"); @@ -1080,7 +1122,8 @@ void SfxCommonTemplateDialog_Impl::FillTreeBox() const SfxStyleFamilyItem* pItem = GetFamilyItem_Impl(); if (!pItem) return; -pStyleSheetPool->SetSearchMa
[Libreoffice-commits] core.git: sd/uiconfig
sd/uiconfig/sdraw/menubar/menubar.xml |1 + 1 file changed, 1 insertion(+) New commits: commit 7b2da820f3d8a2e42c30db0897faeb690f3b5f22 Author: Shivam Kumar Singh AuthorDate: Fri Feb 21 23:24:34 2020 +0530 Commit: Heiko Tietze CommitDate: Mon Feb 24 16:37:56 2020 +0100 tdf#130717 Adding 3D Window option to Format Menu Change-Id: Iae57419519ea0ff43549c9283e591e2d76eea7ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89237 Tested-by: Jenkins Reviewed-by: Heiko Tietze diff --git a/sd/uiconfig/sdraw/menubar/menubar.xml b/sd/uiconfig/sdraw/menubar/menubar.xml index e336d6840765..c61ffd9cc264 100644 --- a/sd/uiconfig/sdraw/menubar/menubar.xml +++ b/sd/uiconfig/sdraw/menubar/menubar.xml @@ -423,6 +423,7 @@ + ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sd/uiconfig
sd/uiconfig/sdraw/menubar/menubar.xml |1 + 1 file changed, 1 insertion(+) New commits: commit 8eea26e7c19a58be77343c30fdbcd780a13ac402 Author: Shivam Kumar Singh AuthorDate: Fri Feb 21 22:50:05 2020 +0530 Commit: Heiko Tietze CommitDate: Mon Feb 24 11:12:37 2020 +0100 tdf#130716 Adding Connector option to Format menu Change-Id: I39a1ebc1ffe91a1fbc036033f95ea6c4d4d885bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89234 Tested-by: Jenkins Tested-by: Heiko Tietze Reviewed-by: Heiko Tietze diff --git a/sd/uiconfig/sdraw/menubar/menubar.xml b/sd/uiconfig/sdraw/menubar/menubar.xml index 02e67fc1bf6a..e336d6840765 100644 --- a/sd/uiconfig/sdraw/menubar/menubar.xml +++ b/sd/uiconfig/sdraw/menubar/menubar.xml @@ -421,6 +421,7 @@ + ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sd/qa
sd/qa/unit/data/tdf123841.odg |binary sd/qa/unit/import-tests.cxx | 15 +++ 2 files changed, 15 insertions(+) New commits: commit 1d219e509750c73edbe610a9ed7f06e7de3bdbc1 Author: Shivam Kumar Singh AuthorDate: Fri Jan 24 16:44:42 2020 +0530 Commit: Michael Stahl CommitDate: Mon Feb 17 15:28:57 2020 +0100 sd: Unit test to check the fill style of odg object. Checks if the Fill Style is FillStyle_NONE . Change-Id: Ib2aff22fe9a4bcf9b483b7e3ac77df7bddf9415c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87440 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/sd/qa/unit/data/tdf123841.odg b/sd/qa/unit/data/tdf123841.odg new file mode 100644 index ..a92477e83af9 Binary files /dev/null and b/sd/qa/unit/data/tdf123841.odg differ diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 9eff839c2865..4d17e314fcf5 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -128,6 +128,7 @@ public: void testMasterPageStyleParent(); void testGradientAngle(); void testTdf97808(); +void testFillStyleNone(); void testFdo64512(); void testFdo71075(); void testN828390_2(); @@ -235,6 +236,7 @@ public: CPPUNIT_TEST(testMasterPageStyleParent); CPPUNIT_TEST(testGradientAngle); CPPUNIT_TEST(testTdf97808); +CPPUNIT_TEST(testFillStyleNone); CPPUNIT_TEST(testFdo64512); CPPUNIT_TEST(testFdo71075); CPPUNIT_TEST(testN828390_2); @@ -775,6 +777,19 @@ void SdImportTest::testTdf97808() xDocShRef->DoClose(); } +void SdImportTest::testFillStyleNone() +{ +sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/tdf123841.odg"), ODG); + +const SdrPage* pPage = GetPage(1, xDocShRef); +const SdrObject* pObj = pPage->GetObj(0); +auto& rFillStyleItem += dynamic_cast(pObj->GetMergedItem(XATTR_FILLSTYLE)); +// Without the accompanying fix in place, this test would have failed with 'Expected: 0; Actual: +// 1', i.e. the shape's fill was FillStyle_SOLID, making the text of the shape unreadable. +CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, rFillStyleItem.GetValue()); +xDocShRef->DoClose(); +} void SdImportTest::testFdo64512() { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: embeddedobj/test include/editeng include/salhelper
embeddedobj/test/Container1/nativelib/nativeview.c |2 +- include/editeng/svxfont.hxx|2 +- include/salhelper/timer.hxx|2 +- 3 files changed, 3 insertions(+), 3 deletions(-) New commits: commit 03685b1ab86a9b8d78ad2a4fd460c2aaa50f03ab Author: Shivam Kumar Singh AuthorDate: Wed Jan 15 14:44:44 2020 +0530 Commit: Stephan Bergmann CommitDate: Tue Feb 4 18:27:25 2020 +0100 tdf#96505 Get rid of cargo cult "long" integer literals . In some places the integers end with L which denotes that the number is in long long format. This representation was not required . Change-Id: Ia8ae328ee943780ccbfb7ce15013f3ac0365a3db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86842 Reviewed-by: Stephan Bergmann Tested-by: Stephan Bergmann diff --git a/embeddedobj/test/Container1/nativelib/nativeview.c b/embeddedobj/test/Container1/nativelib/nativeview.c index 29dd49437e0b..9d0f478bd410 100644 --- a/embeddedobj/test/Container1/nativelib/nativeview.c +++ b/embeddedobj/test/Container1/nativelib/nativeview.c @@ -34,7 +34,7 @@ static LRESULT APIENTRY NativeViewWndProc( HWND , UINT , WPARAM , LPARAM ); #include "jawt_md.h" #include "NativeView.h" -#define MY_ASSERT(X,S) if (!X) { fprintf(stderr,"%s\n",S); return 0L;} +#define MY_ASSERT(X,S) if (!X) { fprintf(stderr,"%s\n",S); return 0;} #define SYSTEM_WIN32 1 #define SYSTEM_WIN16 2 diff --git a/include/editeng/svxfont.hxx b/include/editeng/svxfont.hxx index cf8862da0a9d..b584bb842b4d 100644 --- a/include/editeng/svxfont.hxx +++ b/include/editeng/svxfont.hxx @@ -53,7 +53,7 @@ public: sal_uInt8 GetPropr() const { return nPropr; } void SetPropr( const sal_uInt8 nNewPropr ) { nPropr = nNewPropr; } void SetProprRel( const sal_uInt8 nNewPropr ) -{ SetPropr( static_cast( static_cast(nNewPropr) * static_cast(nPropr) / 100L ) ); } +{ SetPropr( static_cast( static_cast(nNewPropr) * static_cast(nPropr) / 100 ) ); } // Kerning short GetFixKerning() const { return nKern; } diff --git a/include/salhelper/timer.hxx b/include/salhelper/timer.hxx index 440790432f59..f6e67f454270 100644 --- a/include/salhelper/timer.hxx +++ b/include/salhelper/timer.hxx @@ -50,7 +50,7 @@ struct SAL_WARN_UNUSED TTimeValue : public TimeValue TTimeValue(sal_uInt32 MilliSecs) { -Seconds = MilliSecs / 1000L; +Seconds = MilliSecs / 1000; Nanosec = (MilliSecs % 1000) * 100L; normalize(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/qa
sw/qa/extras/ooxmlexport/ooxmlexport4.cxx |8 ++-- sw/qa/extras/ooxmlexport/ooxmlexport5.cxx | 30 ++ 2 files changed, 12 insertions(+), 26 deletions(-) New commits: commit 6ffaefa1694f71175bb499cd5ee5886b23874e90 Author: Shivam Kumar Singh AuthorDate: Wed Jan 22 21:43:57 2020 +0530 Commit: Mike Kaganski CommitDate: Sat Jan 25 09:13:41 2020 +0100 tdf#129423: Make export tests export-only where applicable Change-Id: Iff36608e3f1d643175e47a96333df4cb80a88064 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87209 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx index abadb9765aa1..05466e36b70f 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx @@ -768,15 +768,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf104707_urlComment, "tdf104707_urlComment.odt") CPPUNIT_ASSERT_EQUAL(OUString("https://bugs.documentfoundation.org/show_bug.cgi?id=104707";), aURL); } -DECLARE_OOXMLEXPORT_TEST(testOLEObjectinHeader, "2129393649.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOLEObjectinHeader, "2129393649.docx") { // fdo#76015 : Document contains oleobject in header xml. // Problem was relationship entry for oleobject from header was // exported into document.xml.rels file because of this rels file // for headers were missing from document/word/rels. xmlDocPtr pXmlDoc = parseExport("word/_rels/header1.xml.rels"); -if(!pXmlDoc) -return; assertXPath(pXmlDoc,"/rels:Relationships/rels:Relationship[1]","Id","rId1"); @@ -910,12 +908,10 @@ DECLARE_OOXMLEXPORT_TEST(testTCTagMisMatch, "TCTagMisMatch.docx") assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]", 1); } -DECLARE_OOXMLEXPORT_TEST(testFDO78292, "FDO78292.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78292, "FDO78292.docx") { //text node is a leaf node, it should not have any children xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if(!pXmlDoc) - return; assertXPath(pXmlDoc,"/w:document/w:body/w:p[14]/w:sdt[3]/w:sdtPr[1]/w:text/w14:checked",0); } diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx index 9cc5e69775cf..b59a14a89619 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx @@ -109,22 +109,18 @@ DECLARE_OOXMLEXPORT_TEST(testDecimalNumberingNoLeveltext, "decimal-numbering-no- assertXPath (pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:lvlText","val", ""); } -DECLARE_OOXMLEXPORT_TEST(testNoDuplicateAttributeExport, "duplicate-east-asia.odt") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testNoDuplicateAttributeExport, "duplicate-east-asia.odt") { // File asserting while saving in LO. -xmlDocPtr pXmlDoc = parseExport("word/document.xml"); -if (!pXmlDoc) -return; +parseExport("word/document.xml"); } -DECLARE_OOXMLEXPORT_TEST(testfdo79008, "fdo79008.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79008, "fdo79008.docx") { /* File crashing while saving in LO. * Check if document.xml file is created after fix */ -xmlDocPtr pXmlDoc = parseExport("word/document.xml"); -if (!pXmlDoc) -return; + parseExport("word/document.xml"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAuthorPropertySdt, "author-property.docx") @@ -239,18 +235,14 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOldComplexMergeleft, "tdf90681-2.odt") assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:vMerge", "val", "continue"); } -DECLARE_OOXMLEXPORT_TEST(testOldComplexMergeTableInTable, "ooo96040-2.odt") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOldComplexMergeTableInTable, "ooo96040-2.odt") { -xmlDocPtr pXmlDoc = parseExport("word/document.xml"); -if (!pXmlDoc) -return; +parseExport("word/document.xml"); } -DECLARE_OOXMLEXPORT_TEST(testHyperlinkContainingPlaceholderField, "hyperlink-field.odt") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testHyperlinkContainingPlaceholderField, "hyperlink-field.odt") { -xmlDocPtr pXmlDoc = parseExport("word/document.xml"); -if (!pXmlDoc) -return; +parseExport("word/document.xml"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTablePreferredWidth, "tablePreferredWidth.docx") @@ -505,14 +497,12 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(tdf118702,"tdf118702.odt") assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:sectPr/w:pgSz", "orient", "landscape" ); } -DECLARE_OOXMLEXPORT_TEST(testfdo79822, "fdo79822.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79822, "fdo79822.docx") { /* File getting crash while saving in LO. * The Docx contain smartart and the file was created in ms word 2007 */ -xmlDocPtr pXmlDoc = parseExport("word/document.xml"); -if (!pXm