Resolves: tdf#127416 unparent iconset block on dtor
otherwise gtk keeps the widgets around
Change-Id: I6227662e0a8a4d5a88f4ff6199d6fa06e5be8fe0
Reviewed-on: https://gerrit.libreoffice.org/79649
Tested-by: Jenkins
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx
index 89588a1..6b2e291 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -1279,10 +1279,12 @@ private:
std::unique_ptr<weld::Label> mxFtEntry;
std::unique_ptr<weld::Entry> mxEdEntry;
std::unique_ptr<weld::ComboBox> mxLbEntryType;
weld::Container* mpContainer;
public:
ScIconSetFrmtDataEntry(weld::Container* pParent, ScIconSetType eType, ScDocument* pDoc,
sal_Int32 i, const ScColorScaleEntry* pEntry = nullptr);
~ScIconSetFrmtDataEntry();
void Show() { mxGrid->show(); }
void Hide() { mxGrid->hide(); }
void set_grid_top_attach(int nTop)
@@ -1303,6 +1305,7 @@ ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry(weld::Container* pParent, ScIconS
, mxFtEntry(mxBuilder->weld_label("label"))
, mxEdEntry(mxBuilder->weld_entry("entry"))
, mxLbEntryType(mxBuilder->weld_combo_box("listbox"))
, mpContainer(pParent)
{
mxImgIcon->set_from_icon_name(ScIconSetFormat::getIconName(eType, i));
if(pEntry)
@@ -1335,6 +1338,11 @@ ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry(weld::Container* pParent, ScIconS
}
}
ScIconSetFrmtDataEntry::~ScIconSetFrmtDataEntry()
{
mpContainer->move(mxGrid.get(), nullptr);
}
ScColorScaleEntry* ScIconSetFrmtDataEntry::CreateEntry(ScDocument* pDoc, const ScAddress& rPos) const
{
sal_Int32 nPos = mxLbEntryType->get_active();