diff options
author | Armin Le Grand (Allotropia) <Armin.Le.Grand@me.com> | 2022-05-23 15:48:41 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2022-05-25 09:59:17 +0200 |
commit | 8b4b852a35149b1cfffc681cbb4f57d4c0b671b3 (patch) | |
tree | 66dc1121c200bc0baa7caa135cee60cb02a67f80 /sc | |
parent | 2682828f73a6c759735613ec924357424baeae24 (diff) |
Advanced Diagram support: Isolated IDiagramHelper, selection visualization
Moved and isolated IDiagramHelper to own file to get SdrObjGroup smaller
and less dependent again, all places adapted. isDiagram() now available
at SdrObject directly, adapted and have less places which need to cast
for SdrObjGroup for check.
Started to add SdrHdl/selection visualization to seleced Diagram. Only
as a start, will need to be extended to look good/better, plus evtl.
functionality in handles/UI.
Corrected error(s) found by failing UnitTests
More clang-notes (static, namespace) I nneeded to follow
Change-Id: If4675b3270d3ee30259fce49deb017dbbaf5c0c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134825
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/drawfunc/drawsh2.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/drawsh5.cxx | 9 |
2 files changed, 5 insertions, 8 deletions
diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx index c4eb11484aa5..020178be50ce 100644 --- a/sc/source/ui/drawfunc/drawsh2.cxx +++ b/sc/source/ui/drawfunc/drawsh2.cxx @@ -270,9 +270,7 @@ void ScDrawShell::GetDrawFuncState( SfxItemSet& rSet ) // disable functions rSet.DisableItem( SID_FITCELLSIZE ); // Support advanced DiagramHelper - SdrObjGroup* pAnchorObj = dynamic_cast<SdrObjGroup*>(pObj); - - if(!pAnchorObj || !pAnchorObj->isDiagram()) + if(!pObj || !pObj->isDiagram()) { rSet.DisableItem( SID_REGENERATE_DIAGRAM ); rSet.DisableItem( SID_EDIT_DIAGRAM ); diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx index c06b1b646760..b95f77f9339c 100644 --- a/sc/source/ui/drawfunc/drawsh5.cxx +++ b/sc/source/ui/drawfunc/drawsh5.cxx @@ -33,6 +33,7 @@ #include <svx/svdogrp.hxx> #include <sfx2/docfile.hxx> #include <osl/diagnose.h> +#include <svx/diagram/IDiagramHelper.hxx> #include <com/sun/star/form/FormButtonType.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -282,14 +283,12 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq ) SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); // Support advanced DiagramHelper - SdrObjGroup* pAnchorObj = dynamic_cast<SdrObjGroup*>(pObj); - - if(pAnchorObj && pAnchorObj->isDiagram()) + if(nullptr != pObj && pObj->isDiagram()) { if(SID_REGENERATE_DIAGRAM == nSlotId) { pView->UnmarkAll(); - pAnchorObj->getDiagramHelper()->reLayout(*pAnchorObj); + pObj->getDiagramHelper()->reLayout(*static_cast<SdrObjGroup*>(pObj)); pView->MarkObj(pObj, pView->GetSdrPageView()); } else // SID_EDIT_DIAGRAM @@ -298,7 +297,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq ) vcl::Window* pWin = rViewData.GetActiveWin(); ScopedVclPtr<VclAbstractDialog> pDlg = pFact->CreateDiagramDialog( pWin ? pWin->GetFrameWeld() : nullptr, - *pAnchorObj); + *static_cast<SdrObjGroup*>(pObj)); pDlg->Execute(); } } |