diff options
-rw-r--r-- | sd/source/ui/animations/CustomAnimationDialog.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/animations/CustomAnimationPane.cxx | 14 | ||||
-rw-r--r-- | vcl/inc/jsdialog/jsdialogbuilder.hxx | 9 | ||||
-rw-r--r-- | vcl/jsdialog/enabled.cxx | 3 | ||||
-rw-r--r-- | vcl/jsdialog/jsdialogbuilder.cxx | 6 |
5 files changed, 31 insertions, 5 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 b952a72f69ab..0b317da19c3d 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -551,6 +551,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 @@ -661,7 +664,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); diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx index 59462a92468c..e4f3227fd7ba 100644 --- a/vcl/inc/jsdialog/jsdialogbuilder.hxx +++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx @@ -138,10 +138,17 @@ class JSDialogSender { std::unique_ptr<JSDialogNotifyIdle> mpIdleNotify; +protected: + bool m_bCanClose; // specifies if can send a close message + public: - JSDialogSender() = default; + JSDialogSender() + : m_bCanClose(true) + { + } JSDialogSender(VclPtr<vcl::Window> aNotifierWindow, VclPtr<vcl::Window> aContentWindow, std::string sTypeOfJSON) + : m_bCanClose(true) { initializeSender(aNotifierWindow, aContentWindow, sTypeOfJSON); } diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index d39833c71d84..6de05a65c9eb 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -121,7 +121,8 @@ bool isBuilderEnabledForSidebar(std::u16string_view rUIFile) || rUIFile == u"svx/ui/inspectortextpanel.ui" || rUIFile == u"modules/swriter/ui/sidebarstylepresets.ui" || rUIFile == u"modules/swriter/ui/sidebartheme.ui" - || rUIFile == u"modules/swriter/ui/sidebartableedit.ui") + || rUIFile == u"modules/swriter/ui/sidebartableedit.ui" + || rUIFile == u"modules/simpress/ui/customanimationfragment.ui") return true; return false; diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index 08fd92f6a57d..f527867c81b4 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -324,7 +324,7 @@ void JSDialogSender::sendFullUpdate(bool bForce) void JSDialogSender::sendClose() { - if (!mpIdleNotify) + if (!mpIdleNotify || !m_bCanClose) return; mpIdleNotify->clearQueue(); @@ -539,6 +539,10 @@ JSInstanceBuilder::JSInstanceBuilder(weld::Widget* pParent, const OUString& rUIR } else { + // embedded fragments cannot send close message for whole sidebar + if (rUIFile == "modules/simpress/ui/customanimationfragment.ui") + m_bCanClose = false; + // builder for PanelLayout, get SidebarDockingWindow as m_aContentWindow m_aContentWindow = pRoot; for (int i = 0; i < 9 && m_aContentWindow; i++) |