include/vcl/EnumContext.hxx | 1 officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu | 5 officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs | 2 oox/Library_oox.mk | 1 oox/inc/drawingml/chart/datatablecontext.hxx | 42 +++++ oox/inc/drawingml/chart/datatablemodel.hxx | 41 +++++ oox/inc/drawingml/chart/plotareacontext.hxx | 15 - oox/inc/drawingml/chart/plotareamodel.hxx | 10 - oox/source/drawingml/chart/datatablecontext.cxx | 68 ++++++++ oox/source/drawingml/chart/plotareacontext.cxx | 32 --- oox/source/drawingml/chart/plotareamodel.cxx | 11 - sc/Library_sc.mk | 1 sc/UIConfig_scalc.mk | 1 sc/inc/document.hxx | 8 sc/inc/shellids.hxx | 1 sc/sdi/SparklineShell.sdi | 17 ++ sc/sdi/scslots.sdi | 1 sc/source/ui/app/scdll.cxx | 2 sc/source/ui/inc/SparklineShell.hxx | 40 ++++ sc/source/ui/inc/tabvwsh.hxx | 6 sc/source/ui/view/SparklineShell.cxx | 54 ++++++ sc/source/ui/view/tabview3.cxx | 13 + sc/source/ui/view/tabvwsh4.cxx | 42 ++++- sc/uiconfig/scalc/popupmenu/sparkline.xml | 81 ++++++++++ svx/source/sidebar/paragraph/ParaPropertyPanel.cxx | 1 vcl/source/window/EnumContext.cxx | 1 26 files changed, 423 insertions(+), 74 deletions(-)
New commits: commit d8426e9928e104f51e0e761374a0fe2e1ba417c8 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Fri Apr 15 00:55:54 2022 +0900 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Tue Apr 19 01:49:18 2022 +0200 sc: introduce SparklineShell and Sparkline context Having a separate sparkline context is very useful, so we can add a custom UI when the user has the cursor over a sparkline. This will allow a "Sparkline" tab for NotebookBar and its own deck in Sidebar, activated only when the sparkline is present. Also the pop-up menu can be customized specifically for the sparkline, but this may be less useful. For the sparkline context we need a custom shell - SparklineShell where now all the UNO commands can be implemented (not done in this commit). Change-Id: Idca2ad946af3afdd1b494744b80c9c093eec602c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133022 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> (cherry picked from commit e1f3f2e00c37173e5f6f1cbb5235ab95b100bde7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133062 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/include/vcl/EnumContext.hxx b/include/vcl/EnumContext.hxx index 639a427a138a..dec5711b6ba5 100644 --- a/include/vcl/EnumContext.hxx +++ b/include/vcl/EnumContext.hxx @@ -96,6 +96,7 @@ public: Text, TextObject, Trendline, + Sparkline, // Default context of an application. Do we need this? Default, diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu index 61b702749b19..bc134ef10486 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu @@ -340,6 +340,7 @@ Calc, default, visible ; Calc, EditCell, visible ; Calc, Pivot, visible ; + Calc, Sparkline, visible ; </value> </prop> <prop oor:name="ImplementationURL" oor:type="xs:string"> @@ -375,6 +376,7 @@ Calc, DrawLine, hidden ; Calc, EditCell, visible ; Calc, Pivot, visible, .uno:CellTextDlg ; + Calc, Sparkline, visible ; DrawImpress, Draw, hidden ; DrawImpress, DrawFontwork, hidden ; DrawImpress, DrawText, visible ; @@ -1179,6 +1181,7 @@ Calc, default, visible ; Calc, EditCell, visible ; Calc, Pivot, visible ; + Calc, Sparkline, visible ; </value> </prop> <prop oor:name="ImplementationURL" oor:type="xs:string"> @@ -1212,6 +1215,7 @@ Calc, EditCell, visible ; Calc, default, visible ; Calc, Pivot, visible ; + Calc, Sparkline, visible ; </value> </prop> <prop oor:name="ImplementationURL" oor:type="xs:string"> @@ -1245,6 +1249,7 @@ Calc, EditCell, visible ; Calc, default, visible ; Calc, Pivot, visible ; + Calc, Sparkline, visible ; </value> </prop> <prop oor:name="ImplementationURL" oor:type="xs:string"> diff --git a/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs b/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs index 53ad678e3574..1eb7007d3008 100644 --- a/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs @@ -109,7 +109,7 @@ 2 Context name Know context names are 3DObject, Annotation, Auditing, Axis, Cell, Chart, Draw, DrawPage, DrawText, EditCell, ErrorBar, Form, Frame, Graphic, HandoutPage, MasterPage, Media, Multiobj, OLE, OutlineText, - Pivot, Series, SlidesorterPage, Table, Text, TextObject, Trendline + Pivot, Series, SlidesorterPage, Table, Text, TextObject, Trendline, Sparkline default Special values: diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk index eb81a6817ab2..7933dbb739b3 100644 --- a/sc/Library_sc.mk +++ b/sc/Library_sc.mk @@ -658,6 +658,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\ sc/source/ui/view/scextopt \ sc/source/ui/view/select \ sc/source/ui/view/selectionstate \ + sc/source/ui/view/SparklineShell \ sc/source/ui/view/spelldialog \ sc/source/ui/view/spelleng \ sc/source/ui/view/spellcheckcontext \ diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk index 643645ee7432..cf5f7e0951bf 100644 --- a/sc/UIConfig_scalc.mk +++ b/sc/UIConfig_scalc.mk @@ -37,6 +37,7 @@ $(eval $(call gb_UIConfig_add_popupmenufiles,modules/scalc,\ sc/uiconfig/scalc/popupmenu/rowheader \ sc/uiconfig/scalc/popupmenu/row_operations \ sc/uiconfig/scalc/popupmenu/sheettab \ + sc/uiconfig/scalc/popupmenu/sparkline \ )) $(eval $(call gb_UIConfig_add_statusbarfiles,modules/scalc,\ diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 9bf190571f56..c2c597983cea 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -837,6 +837,14 @@ public: SC_DLLPUBLIC ScDPCollection* GetDPCollection(); SC_DLLPUBLIC const ScDPCollection* GetDPCollection() const; SC_DLLPUBLIC ScDPObject* GetDPAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab) const; + SC_DLLPUBLIC ScDPObject* GetDPAtCursor(ScAddress const& rAddress) const + { + return GetDPAtCursor(rAddress.Col(), rAddress.Row(), rAddress.Tab()); + } + SC_DLLPUBLIC bool HasDataPilotAtPosition(ScAddress const& rAddress) const + { + return GetDPAtCursor(rAddress) != nullptr; + } ScDPObject* GetDPAtBlock( const ScRange& rBlock ) const; void StopTemporaryChartLock(); diff --git a/sc/inc/shellids.hxx b/sc/inc/shellids.hxx index 9f4fbf7a991c..ecef989d87bb 100644 --- a/sc/inc/shellids.hxx +++ b/sc/inc/shellids.hxx @@ -39,5 +39,6 @@ #define SCID_GRAPHIC_SHELL (SFX_INTERFACE_SC_START+SfxInterfaceId(15)) #define SCID_PAGEBREAK_SHELL (SFX_INTERFACE_SC_START+SfxInterfaceId(16)) #define SCID_MEDIA_SHELL (SFX_INTERFACE_SC_START+SfxInterfaceId(17)) +#define SCID_SPARKLINE_SHELL (SFX_INTERFACE_SC_START+SfxInterfaceId(18)) /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/sdi/SparklineShell.sdi b/sc/sdi/SparklineShell.sdi new file mode 100644 index 000000000000..24e939e04ea0 --- /dev/null +++ b/sc/sdi/SparklineShell.sdi @@ -0,0 +1,17 @@ +/* + * 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/. + * + */ + +interface Sparkline +{ +} + +shell SparklineShell +{ + import Sparkline; +} diff --git a/sc/sdi/scslots.sdi b/sc/sdi/scslots.sdi index 8cf0aaddc0fe..f6ccd7113d5b 100644 --- a/sc/sdi/scslots.sdi +++ b/sc/sdi/scslots.sdi @@ -58,6 +58,7 @@ module StarCalc include "graphsh.sdi" include "pgbrksh.sdi" include "mediash.sdi" + include "SparklineShell.sdi" } diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx index 58efb29ecb9a..2256ee2e125b 100644 --- a/sc/source/ui/app/scdll.cxx +++ b/sc/source/ui/app/scdll.cxx @@ -51,6 +51,7 @@ #include <mediash.hxx> #include <pgbrksh.hxx> #include <scdll.hxx> +#include <SparklineShell.hxx> #include <appoptio.hxx> #include <searchresults.hxx> @@ -125,6 +126,7 @@ void ScDLL::Init() ScDrawTextObjectBar ::RegisterInterface(pMod); ScEditShell ::RegisterInterface(pMod); ScPivotShell ::RegisterInterface(pMod); + sc::SparklineShell ::RegisterInterface(pMod); ScAuditingShell ::RegisterInterface(pMod); ScFormatShell ::RegisterInterface(pMod); ScCellShell ::RegisterInterface(pMod); diff --git a/sc/source/ui/inc/SparklineShell.hxx b/sc/source/ui/inc/SparklineShell.hxx new file mode 100644 index 000000000000..11028dd8a461 --- /dev/null +++ b/sc/source/ui/inc/SparklineShell.hxx @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#pragma once + +#include <sfx2/shell.hxx> + +#include <shellids.hxx> + +class ScTabViewShell; +class SfxModule; + +namespace sc +{ +class SparklineShell final : public SfxShell +{ +public: + SFX_DECL_INTERFACE(SCID_SPARKLINE_SHELL) + +private: + /// SfxInterface initializer. + static void InitInterface_Impl(); + +public: + SparklineShell(ScTabViewShell* pView); + virtual ~SparklineShell() override; + +private: + ScTabViewShell* m_pViewShell; +}; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index 957dab0efcda..2aba65effefa 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -60,6 +60,7 @@ class ScDPObject; class ScNavigatorSettings; class ScRangeName; class ScDrawTransferObj; +namespace sc { class SparklineShell; } struct ScHeaderFieldData; @@ -85,7 +86,8 @@ enum ObjectSelectionType OST_OleObject, OST_Chart, OST_Graphic, - OST_Media + OST_Media, + OST_Sparkline, }; class ScFormEditData; @@ -100,6 +102,7 @@ private: std::unique_ptr<ScDrawTextObjectBar> pDrawTextShell; std::unique_ptr<ScEditShell> pEditShell; std::unique_ptr<ScPivotShell> pPivotShell; + std::unique_ptr<sc::SparklineShell> m_pSparklineShell; std::unique_ptr<ScAuditingShell> pAuditingShell; std::unique_ptr<ScDrawFormShell> pDrawFormShell; std::unique_ptr<ScCellShell> pCellShell; @@ -280,6 +283,7 @@ public: void SetDrawTextShell( bool bActive ); void SetPivotShell( bool bActive ); + void SetSparklineShell(bool bActive); void SetDialogDPObject( std::unique_ptr<ScDPObject> pObj ); const ScDPObject* GetDialogDPObject() const { return pDialogDPObject.get(); } diff --git a/sc/source/ui/view/SparklineShell.cxx b/sc/source/ui/view/SparklineShell.cxx new file mode 100644 index 000000000000..3b3c4f8399ed --- /dev/null +++ b/sc/source/ui/view/SparklineShell.cxx @@ -0,0 +1,54 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#include <scitems.hxx> +#include <sfx2/objface.hxx> +#include <sfx2/objsh.hxx> +#include <sfx2/request.hxx> +#include <svl/whiter.hxx> +#include <vcl/EnumContext.hxx> + +#include <sc.hrc> +#include <SparklineShell.hxx> +#include <tabvwsh.hxx> +#include <docsh.hxx> +#include <document.hxx> + +#define ShellClass_SparklineShell +#include <scslots.hxx> + +namespace sc +{ +SFX_IMPL_INTERFACE(SparklineShell, SfxShell) + +void SparklineShell::InitInterface_Impl() { GetStaticInterface()->RegisterPopupMenu("sparkline"); } + +SparklineShell::SparklineShell(ScTabViewShell* pViewShell) + : SfxShell(pViewShell) + , m_pViewShell(pViewShell) +{ + SetPool(&m_pViewShell->GetPool()); + ScViewData& rViewData = m_pViewShell->GetViewData(); + SfxUndoManager* pUndoManager = rViewData.GetSfxDocShell()->GetUndoManager(); + SetUndoManager(pUndoManager); + if (!rViewData.GetDocument().IsUndoEnabled()) + { + pUndoManager->SetMaxUndoActionCount(0); + } + SetName("Sparkline"); + SfxShell::SetContextName( + vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Sparkline)); +} + +SparklineShell::~SparklineShell() = default; + +} // end sc namespace + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index d62f3c2817a0..20954d8711cc 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -634,10 +634,15 @@ void ScTabView::CursorPosChanged() // Broadcast, so that other Views of the document also switch - ScDocument& rDoc = aViewData.GetDocument(); - bool bDP = nullptr != rDoc.GetDPAtCursor( - aViewData.GetCurX(), aViewData.GetCurY(), aViewData.GetTabNo() ); - aViewData.GetViewShell()->SetPivotShell(bDP); + ScDocument& rDocument = aViewData.GetDocument(); + bool bDataPilot = rDocument.HasDataPilotAtPosition(aViewData.GetCurPos()); + aViewData.GetViewShell()->SetPivotShell(bDataPilot); + + if (!bDataPilot) + { + bool bSparkline = rDocument.HasSparkline(aViewData.GetCurPos()); + aViewData.GetViewShell()->SetSparklineShell(bSparkline); + } // UpdateInputHandler now in CellContentChanged diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index e50484525fdb..10c80a66e31f 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -46,6 +46,7 @@ #include <drformsh.hxx> #include <editsh.hxx> #include <pivotsh.hxx> +#include <SparklineShell.hxx> #include <auditsh.hxx> #include <drtxtob.hxx> #include <inputhdl.hxx> @@ -690,6 +691,25 @@ void ScTabViewShell::SetPivotShell( bool bActive ) SetCurSubShell(OST_Cell); } +void ScTabViewShell::SetSparklineShell(bool bActive) +{ + if (eCurOST != OST_Sparkline && eCurOST != OST_Cell) + return; + + if (bActive) + { + bActiveDrawTextSh = bActiveDrawSh = false; + bActiveDrawFormSh=false; + bActiveGraphicSh=false; + bActiveMediaSh=false; + bActiveOleObjectSh=false; + bActiveChartSh=false; + SetCurSubShell(OST_Sparkline); + } + else + SetCurSubShell(OST_Cell); +} + void ScTabViewShell::SetAuditShell( bool bActive ) { if ( bActive ) @@ -948,6 +968,20 @@ void ScTabViewShell::SetCurSubShell(ObjectSelectionType eOST, bool bForce) bCellBrush = true; } break; + case OST_Sparkline: + { + AddSubShell(*pCellShell); + if(bPgBrk) AddSubShell(*pPageBreakShell); + + if (!m_pSparklineShell) + { + m_pSparklineShell.reset(new sc::SparklineShell(this)); + m_pSparklineShell->SetRepeatTarget(&aTarget); + } + AddSubShell(*m_pSparklineShell); + bCellBrush = true; + } + break; default: OSL_FAIL("wrong shell requested"); break; @@ -992,11 +1026,14 @@ SfxShell* ScTabViewShell::GetMySubShell() const SfxShell* pSub = const_cast<ScTabViewShell*>(this)->GetSubShell(nPos); while (pSub) { - if ( pSub == pDrawShell.get() || pSub == pDrawTextShell.get() || pSub == pEditShell.get() || + if (pSub == pDrawShell.get() || pSub == pDrawTextShell.get() || pSub == pEditShell.get() || pSub == pPivotShell.get() || pSub == pAuditingShell.get() || pSub == pDrawFormShell.get() || pSub == pCellShell.get() || pSub == pOleObjectShell.get() || pSub == pChartShell.get() || - pSub == pGraphicShell.get() || pSub == pMediaShell.get() || pSub == pPageBreakShell.get()) + pSub == pGraphicShell.get() || pSub == pMediaShell.get() || pSub == pPageBreakShell.get() || + pSub == m_pSparklineShell.get()) + { return pSub; // found + } pSub = const_cast<ScTabViewShell*>(this)->GetSubShell(++nPos); } @@ -1812,6 +1849,7 @@ ScTabViewShell::~ScTabViewShell() pDrawTextShell.reset(); pEditShell.reset(); pPivotShell.reset(); + m_pSparklineShell.reset(); pAuditingShell.reset(); pCurFrameLine.reset(); mpFormEditData.reset(); diff --git a/sc/uiconfig/scalc/popupmenu/sparkline.xml b/sc/uiconfig/scalc/popupmenu/sparkline.xml new file mode 100644 index 000000000000..fb7f4ff9ecd8 --- /dev/null +++ b/sc/uiconfig/scalc/popupmenu/sparkline.xml @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * 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/. + * +--> +<menu:menupopup xmlns:menu="http://openoffice.org/2001/menu"> + <menu:menuitem menu:id=".uno:Cut"/> + <menu:menuitem menu:id=".uno:Copy"/> + <menu:menuitem menu:id=".uno:Paste"/> + <menu:menu menu:id=".uno:PasteSpecialMenu"> + <menu:menupopup> + <menu:menuitem menu:id=".uno:PasteUnformatted"/> + <menu:menuseparator/> + <menu:menuitem menu:id=".uno:PasteOnlyText"/> + <menu:menuitem menu:id=".uno:PasteOnlyValue"/> + <menu:menuitem menu:id=".uno:PasteOnlyFormula"/> + <menu:menuseparator/> + <menu:menuitem menu:id=".uno:PasteTransposed"/> + <menu:menuseparator/> + <menu:menuitem menu:id=".uno:PasteSpecial"/> + </menu:menupopup> + </menu:menu> + <menu:menuseparator/> + <menu:menuitem menu:id=".uno:DataSelect"/> + <menu:menuitem menu:id=".uno:CurrentValidation"/> + <menu:menuitem menu:id=".uno:DefineCurrentName"/> + <menu:menuseparator/> + <menu:menuitem menu:id=".uno:InsertCell"/> + <menu:menuitem menu:id=".uno:DeleteCell"/> + <menu:menuitem menu:id=".uno:Delete"/> + <menu:menuitem menu:id=".uno:MergeCells"/> + <menu:menuitem menu:id=".uno:SplitCell"/> + <menu:menuseparator/> + <menu:menuitem menu:id=".uno:FormatPaintbrush"/> + <menu:menuitem menu:id=".uno:ResetAttributes"/> + <menu:menu menu:id=".uno:FormatStylesMenu"> + <menu:menupopup> + <menu:menuitem menu:id=".uno:EditStyle"/> + <menu:menuseparator/> + <menu:menuitem menu:id=".uno:DefaultCellStylesmenu" menu:style="radio"/> + <menu:menuitem menu:id=".uno:Accent1CellStyles" menu:style="radio"/> + <menu:menuitem menu:id=".uno:Accent2CellStyles" menu:style="radio"/> + <menu:menuitem menu:id=".uno:Accent3CellStyles" menu:style="radio"/> + <menu:menuseparator/> + <menu:menuitem menu:id=".uno:BadCellStyles" menu:style="radio"/> + <menu:menuitem menu:id=".uno:ErrorCellStyles" menu:style="radio"/> + <menu:menuitem menu:id=".uno:GoodCellStyles" menu:style="radio"/> + <menu:menuitem menu:id=".uno:NeutralCellStyles" menu:style="radio"/> + <menu:menuitem menu:id=".uno:WarningCellStyles" menu:style="radio"/> + <menu:menuseparator/> + <menu:menuitem menu:id=".uno:FootnoteCellStyles" menu:style="radio"/> + <menu:menuitem menu:id=".uno:NoteCellStyles" menu:style="radio"/> + </menu:menupopup> + </menu:menu> + <menu:menuseparator/> + <menu:menuitem menu:id=".uno:InsertAnnotation"/> + <menu:menuitem menu:id=".uno:EditAnnotation"/> + <menu:menuitem menu:id=".uno:DeleteNote"/> + <menu:menuitem menu:id=".uno:ShowNote"/> + <menu:menuitem menu:id=".uno:HideNote"/> + <menu:menuseparator/> + <menu:menu menu:id=".uno:FormatSparklineMenu"> + <menu:menupopup> + <menu:menuitem menu:id=".uno:InsertSparkline"/> + <menu:menuitem menu:id=".uno:DeleteSparkline"/> + <menu:menuitem menu:id=".uno:DeleteSparklineGroup"/> + <menu:menuitem menu:id=".uno:EditSparklineGroup"/> + <menu:menuitem menu:id=".uno:EditSparkline"/> + <menu:menuitem menu:id=".uno:GroupSparklines"/> + <menu:menuitem menu:id=".uno:UngroupSparklines"/> + </menu:menupopup> + </menu:menu> + <menu:menuseparator/> + <menu:menuitem menu:id=".uno:CurrentConditionalFormatDialog"/> + <menu:menuitem menu:id=".uno:CurrentConditionalFormatManagerDialog"/> + <menu:menuitem menu:id=".uno:FormatCellDialog"/> +</menu:menupopup> diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx index 5b592a7f4c98..77962e065aeb 100644 --- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx +++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx @@ -116,6 +116,7 @@ void ParaPropertyPanel::HandleContextChange ( case CombinedEnumContext(Application::Calc, Context::EditCell): case CombinedEnumContext(Application::Calc, Context::Cell): case CombinedEnumContext(Application::Calc, Context::Pivot): + case CombinedEnumContext(Application::Calc, Context::Sparkline): case CombinedEnumContext(Application::DrawImpress, Context::Text): case CombinedEnumContext(Application::DrawImpress, Context::OutlineText): break; diff --git a/vcl/source/window/EnumContext.cxx b/vcl/source/window/EnumContext.cxx index b407a8069bc7..2eb23e591a5a 100644 --- a/vcl/source/window/EnumContext.cxx +++ b/vcl/source/window/EnumContext.cxx @@ -184,6 +184,7 @@ void EnumContext::ProvideContextContainers() AddEntry("Text", Context::Text); AddEntry("TextObject", Context::TextObject); AddEntry("Trendline", Context::Trendline); + AddEntry("Sparkline", Context::Sparkline); // other general contexts AddEntry("any", Context::Any); commit 12bb012f94b591b5cd46fc7d5f210f9c2736a9b6 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Thu Apr 14 15:57:01 2022 +0900 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Tue Apr 19 01:49:07 2022 +0200 oox: move DataTable{Context,Model} into own file, prop. "showKeys" Move DataTableContext and DataTableModel into its own files and add the missing "showKeys" property of the data table (dTable). Change-Id: I44fb436000c7f00a596fc9b12489d15ea1368e68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133021 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> (cherry picked from commit 32e38ec654cfd467aad74da59366bd41142b3bdc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133061 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/oox/Library_oox.mk b/oox/Library_oox.mk index 6550a3942c88..b2abf32bc63b 100644 --- a/oox/Library_oox.mk +++ b/oox/Library_oox.mk @@ -118,6 +118,7 @@ $(eval $(call gb_Library_add_exception_objects,oox,\ oox/source/drawingml/chart/datasourcecontext \ oox/source/drawingml/chart/datasourceconverter \ oox/source/drawingml/chart/datasourcemodel \ + oox/source/drawingml/chart/datatablecontext \ oox/source/drawingml/chart/modelbase \ oox/source/drawingml/chart/objectformatter \ oox/source/drawingml/chart/plotareacontext \ diff --git a/oox/inc/drawingml/chart/datatablecontext.hxx b/oox/inc/drawingml/chart/datatablecontext.hxx new file mode 100644 index 000000000000..01a75c6e634d --- /dev/null +++ b/oox/inc/drawingml/chart/datatablecontext.hxx @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#pragma once + +#include <drawingml/chart/chartcontextbase.hxx> + +namespace oox::drawingml::chart +{ +struct DataTableModel; + +/** Handler for a data table context (c:dTable element). + */ +class DataTableContext final : public ContextBase<DataTableModel> +{ +public: + explicit DataTableContext(::oox::core::ContextHandler2Helper& rParent, DataTableModel& rModel); + virtual ~DataTableContext() override; + + virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, + const AttributeList& rAttribs) override; +}; + +} // namespace oox::drawingml::chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/inc/drawingml/chart/datatablemodel.hxx b/oox/inc/drawingml/chart/datatablemodel.hxx new file mode 100644 index 000000000000..5c7fe7901200 --- /dev/null +++ b/oox/inc/drawingml/chart/datatablemodel.hxx @@ -0,0 +1,41 @@ +/* -*- 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 + +namespace oox::drawingml::chart +{ +struct DataTableModel +{ + bool mbShowHBorder : 1; /// Show Horizontal Border + bool mbShowVBorder : 1; /// Show Vertical Border + bool mbShowOutline : 1; /// Show outline + bool mbShowKeys : 1; + + DataTableModel() + : mbShowHBorder(false) + , mbShowVBorder(false) + , mbShowOutline(false) + , mbShowKeys(false) + { + } +}; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/inc/drawingml/chart/plotareacontext.hxx b/oox/inc/drawingml/chart/plotareacontext.hxx index 05984449f9d0..2b3fae932161 100644 --- a/oox/inc/drawingml/chart/plotareacontext.hxx +++ b/oox/inc/drawingml/chart/plotareacontext.hxx @@ -53,21 +53,6 @@ public: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override; }; - -struct DataTableModel; - -/** Handler for a data table context (c:dTable element). - */ -class DataTableContext final : public ContextBase< DataTableModel > -{ -public: - explicit DataTableContext( ::oox::core::ContextHandler2Helper& rParent, DataTableModel& rModel ); - virtual ~DataTableContext() override; - - virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override; -}; - - struct PlotAreaModel; /** Handler for a chart plot area context (c:plotArea element). diff --git a/oox/inc/drawingml/chart/plotareamodel.hxx b/oox/inc/drawingml/chart/plotareamodel.hxx index eea7d14d89a9..dfa27a5a96ab 100644 --- a/oox/inc/drawingml/chart/plotareamodel.hxx +++ b/oox/inc/drawingml/chart/plotareamodel.hxx @@ -24,6 +24,7 @@ #include <drawingml/chart/axismodel.hxx> #include <drawingml/chart/seriesmodel.hxx> #include <drawingml/chart/typegroupmodel.hxx> +#include <drawingml/chart/datatablemodel.hxx> namespace oox::drawingml::chart { @@ -52,15 +53,6 @@ struct WallFloorModel ~WallFloorModel(); }; -struct DataTableModel -{ - bool mbShowHBorder; /// Show Horizontal Border - bool mbShowVBorder; /// Show Vertical Border - bool mbShowOutline; /// Show outline - explicit DataTableModel(); - ~DataTableModel(); -}; - struct PlotAreaModel { typedef ModelVector< TypeGroupModel > TypeGroupVector; diff --git a/oox/source/drawingml/chart/datatablecontext.cxx b/oox/source/drawingml/chart/datatablecontext.cxx new file mode 100644 index 000000000000..c40a4f782450 --- /dev/null +++ b/oox/source/drawingml/chart/datatablecontext.cxx @@ -0,0 +1,68 @@ +/* -*- 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 . + */ + +#include <drawingml/chart/datatablecontext.hxx> + +#include <drawingml/chart/plotareamodel.hxx> +#include <oox/core/xmlfilterbase.hxx> +#include <oox/helper/attributelist.hxx> +#include <oox/token/namespaces.hxx> +#include <oox/token/tokens.hxx> + +namespace oox::drawingml::chart +{ +using ::oox::core::ContextHandler2Helper; +using ::oox::core::ContextHandlerRef; + +DataTableContext::DataTableContext(ContextHandler2Helper& rParent, DataTableModel& rModel) + : ContextBase<DataTableModel>(rParent, rModel) +{ +} + +DataTableContext::~DataTableContext() {} + +ContextHandlerRef DataTableContext::onCreateContext(sal_Int32 nElement, + const AttributeList& rAttribs) +{ + switch (getCurrentElement()) + { + case C_TOKEN(dTable): + switch (nElement) + { + case C_TOKEN(showHorzBorder): + mrModel.mbShowHBorder = rAttribs.getBool(XML_val, false); + break; + case C_TOKEN(showVertBorder): + mrModel.mbShowVBorder = rAttribs.getBool(XML_val, false); + break; + case C_TOKEN(showOutline): + mrModel.mbShowOutline = rAttribs.getBool(XML_val, false); + break; + case C_TOKEN(showKeys): + //mrModel.mbShowKeys = rAttribs.getBool( XML_val, false ); + break; + } + break; + } + return nullptr; +} + +} // namespace oox::drawingml::chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/plotareacontext.cxx b/oox/source/drawingml/chart/plotareacontext.cxx index 4f231e0eda35..4afddee4700c 100644 --- a/oox/source/drawingml/chart/plotareacontext.cxx +++ b/oox/source/drawingml/chart/plotareacontext.cxx @@ -24,6 +24,7 @@ #include <drawingml/chart/plotareamodel.hxx> #include <drawingml/chart/seriescontext.hxx> #include <drawingml/chart/typegroupcontext.hxx> +#include <drawingml/chart/datatablecontext.hxx> #include <oox/core/xmlfilterbase.hxx> #include <oox/helper/attributelist.hxx> #include <oox/token/namespaces.hxx> @@ -106,37 +107,6 @@ ContextHandlerRef WallFloorContext::onCreateContext( sal_Int32 nElement, const A return nullptr; } -DataTableContext::DataTableContext( ContextHandler2Helper& rParent, DataTableModel& rModel ) : - ContextBase< DataTableModel >( rParent, rModel ) -{ -} - -DataTableContext::~DataTableContext() -{ -} - -ContextHandlerRef DataTableContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs) -{ - switch( getCurrentElement() ) - { - case C_TOKEN( dTable ): - switch( nElement ) - { - case C_TOKEN( showHorzBorder ): - mrModel.mbShowHBorder = rAttribs.getBool( XML_val, false ); - break; - case C_TOKEN( showVertBorder ): - mrModel.mbShowVBorder = rAttribs.getBool( XML_val, false ); - break; - case C_TOKEN( showOutline ): - mrModel.mbShowOutline = rAttribs.getBool( XML_val, false ); - break; - } - break; - } - return nullptr; -} - PlotAreaContext::PlotAreaContext( ContextHandler2Helper& rParent, PlotAreaModel& rModel ) : ContextBase< PlotAreaModel >( rParent, rModel ) { diff --git a/oox/source/drawingml/chart/plotareamodel.cxx b/oox/source/drawingml/chart/plotareamodel.cxx index c5e403a2453a..c0ed2f4d6589 100644 --- a/oox/source/drawingml/chart/plotareamodel.cxx +++ b/oox/source/drawingml/chart/plotareamodel.cxx @@ -42,17 +42,6 @@ WallFloorModel::~WallFloorModel() { } -DataTableModel::DataTableModel() : - mbShowHBorder(false), - mbShowVBorder(false), - mbShowOutline(false) -{ -} - -DataTableModel::~DataTableModel() -{ -} - PlotAreaModel::PlotAreaModel() { mxShapeProp.create().getFillProperties().moFillType = XML_noFill;