diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2021-11-24 13:11:18 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-02-14 11:25:40 +0100 |
commit | 6fbe2bace6551b07bf8e26a3f1bd6b252ec043ab (patch) | |
tree | 8c892d5c4259271778d3f5d0c2532f5c75915b9d /sd/source | |
parent | 045e922a36b8f037f2df9361d9dee7d5eefd4cae (diff) |
jsdialog: sidebar: enable animation panel effects
- enable subcontrol .ui for jsdialogs in annimation panel
- optimize to not recreate widget on every sidebar refresh
- don't sent close message for whole sidebar when called from
subcontrol
This fixes widgets in annimation panel like: Direction listbox,
or other replacements for selecting color, font etc. for font effect
Change-Id: I5683ca9cefe384ed0d2a34d46936ddf4a9b45bce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125757
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Mert Tumer <mert.tumer@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129170
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/animations/CustomAnimationDialog.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/animations/CustomAnimationPane.cxx | 14 |
2 files changed, 16 insertions, 2 deletions
diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx index 58e595e75877..2a23da8fed34 100644 --- a/sd/source/ui/animations/CustomAnimationDialog.cxx +++ b/sd/source/ui/animations/CustomAnimationDialog.cxx @@ -44,6 +44,7 @@ #include <svtools/ctrltool.hxx> #include <sfx2/objsh.hxx> +#include <sfx2/viewsh.hxx> #include <tools/debug.hxx> #include <tools/urlobj.hxx> #include <tools/diagnose_ex.h> @@ -84,7 +85,8 @@ using ::com::sun::star::beans::XPropertySet; namespace sd { SdPropertySubControl::SdPropertySubControl(weld::Container* pParent) - : mxBuilder(Application::CreateBuilder(pParent, "modules/simpress/ui/customanimationfragment.ui")) + : mxBuilder(Application::CreateBuilder(pParent, "modules/simpress/ui/customanimationfragment.ui", + false, reinterpret_cast<sal_uInt64>(SfxViewShell::Current()))) , mxContainer(mxBuilder->weld_container("EffectFragment")) , mpParent(pParent) { diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index 5782005d0870..59036ff4a2f5 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -553,6 +553,9 @@ void CustomAnimationPane::updateControls() if (!mxLBSubControl || nOldPropertyType != nNewPropertyType) { + // for LOK destroy old widgets first + mxLBSubControl.reset(nullptr); + // then create new control, to keep correct pointers for actions mxLBSubControl = SdPropertySubControl::create(nNewPropertyType, mxFTProperty.get(), mxPlaceholderBox.get(), GetFrameWeld(), aValue, pEffect->getPresetId(), LINK(this, CustomAnimationPane, implPropertyHdl)); } else @@ -663,7 +666,16 @@ void CustomAnimationPane::updateControls() else { // use an empty direction box to fill the space - mxLBSubControl = SdPropertySubControl::create(nPropertyTypeDirection, mxFTProperty.get(), mxPlaceholderBox.get(), GetFrameWeld(), uno::Any(), OUString(), LINK(this, CustomAnimationPane, implPropertyHdl)); + if (!mxLBSubControl || (nOldPropertyType != nPropertyTypeDirection && nOldPropertyType != nPropertyTypeNone)) + { + // for LOK destroy old widgets first + mxLBSubControl.reset(nullptr); + // then create new control, to keep correct pointers for actions + mxLBSubControl = SdPropertySubControl::create(nPropertyTypeDirection, mxFTProperty.get(), mxPlaceholderBox.get(), GetFrameWeld(), uno::Any(), OUString(), LINK(this, CustomAnimationPane, implPropertyHdl)); + } + else + mxLBSubControl->setValue(uno::Any(), OUString()); + mxPlaceholderBox->set_sensitive(false); mxFTProperty->set_sensitive(false); mxFTStartDelay->set_sensitive(false); |