weld SvxConfigDialog

Change-Id: Ia6983fd658521cf8704ca1ed95ecff6590ddde09
Reviewed-on: https://gerrit.libreoffice.org/68906
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/cui/source/customize/CommandCategoryListBox.cxx b/cui/source/customize/CommandCategoryListBox.cxx
index 2f9a9a4..110a1d1 100644
--- a/cui/source/customize/CommandCategoryListBox.cxx
+++ b/cui/source/customize/CommandCategoryListBox.cxx
@@ -273,9 +273,10 @@ OUString CommandCategoryListBox::getCommandName(const OUString& sCommand)
}

void CommandCategoryListBox::categorySelected(CuiConfigFunctionListBox* pFunctionListBox,
                                              const OUString& filterTerm , SaveInData *pCurrentSaveInData)
                                              const OUString& filterTerm, SaveInData *pCurrentSaveInData)
{
    SfxGroupInfo_Impl *pInfo = reinterpret_cast<SfxGroupInfo_Impl*>(m_xControl->get_active_id().toInt64());
    std::vector<std::unique_ptr<weld::TreeIter>> aNodesToExpand;
    pFunctionListBox->freeze();
    pFunctionListBox->ClearAll();

@@ -292,6 +293,9 @@ void CommandCategoryListBox::categorySelected(CuiConfigFunctionListBox* pFunctio
                SfxGroupInfo_Impl *pCurrentInfo =
                    reinterpret_cast<SfxGroupInfo_Impl*>(m_xControl->get_id(nCurPos).toInt64());

                if (!pCurrentInfo) //seperator
                    continue;

                if (pCurrentInfo->nKind == SfxCfgKind::GROUP_FUNCTION)
                {
                    css::uno::Sequence< css::frame::DispatchInformation > lCommands;
@@ -376,10 +380,10 @@ void CommandCategoryListBox::categorySelected(CuiConfigFunctionListBox* pFunctio
                        m_aGroupInfo.push_back(
                            std::make_unique<SfxGroupInfo_Impl>(
                                SfxCfgKind::GROUP_SCRIPTCONTAINER, 0 ) );
                        std::unique_ptr<weld::TreeIter> xMacroGroup(pFunctionListBox->append_ondemand(OUString::number(reinterpret_cast<sal_Int64>(m_aGroupInfo.back().get())), sUIName));
                        std::unique_ptr<weld::TreeIter> xMacroGroup(pFunctionListBox->tree_append(OUString::number(reinterpret_cast<sal_Int64>(m_aGroupInfo.back().get())), sUIName));

                        //Add the children and the grand children
                        addChildren(xMacroGroup.get(), childGroup, pFunctionListBox, filterTerm, pCurrentSaveInData);
                        addChildren(xMacroGroup.get(), childGroup, pFunctionListBox, filterTerm, pCurrentSaveInData, aNodesToExpand);

                        // Remove the main group if empty
                        if (!pFunctionListBox->iter_has_child(*xMacroGroup))
@@ -388,7 +392,7 @@ void CommandCategoryListBox::categorySelected(CuiConfigFunctionListBox* pFunctio
                        }
                        else if (!filterTerm.isEmpty())
                        {
                            pFunctionListBox->expand_row(*xMacroGroup);
                            aNodesToExpand.emplace_back(std::move(xMacroGroup));
                        }
                    }
                }
@@ -410,7 +414,7 @@ void CommandCategoryListBox::categorySelected(CuiConfigFunctionListBox* pFunctio

                m_aGroupInfo.push_back( std::make_unique<SfxGroupInfo_Impl>( SfxCfgKind::GROUP_STYLES, 0 ) );
                // pIt.sLabel is Name of the style family
                std::unique_ptr<weld::TreeIter> xFuncEntry(pFunctionListBox->append_ondemand(OUString::number(reinterpret_cast<sal_Int64>(m_aGroupInfo.back().get())), pIt.sLabel));
                std::unique_ptr<weld::TreeIter> xFuncEntry(pFunctionListBox->tree_append(OUString::number(reinterpret_cast<sal_Int64>(m_aGroupInfo.back().get())), pIt.sLabel));

                const std::vector< SfxStyleInfo_Impl > lStyles = pStylesInfo->getStyles(pIt.sFamily);

@@ -451,7 +455,7 @@ void CommandCategoryListBox::categorySelected(CuiConfigFunctionListBox* pFunctio
                }
                else if (!filterTerm.isEmpty())
                {
                    pFunctionListBox->expand_row(*xFuncEntry);
                    aNodesToExpand.emplace_back(std::move(xFuncEntry));
                }
            }

@@ -467,6 +471,10 @@ void CommandCategoryListBox::categorySelected(CuiConfigFunctionListBox* pFunctio

    if (pFunctionListBox->n_children())
        pFunctionListBox->select(0);

    //post freeze
    for (const auto& it : aNodesToExpand)
        pFunctionListBox->expand_row(*it);
}

void CommandCategoryListBox::SetStylesInfo(SfxStylesInfo_Impl* pStyles)
@@ -476,7 +484,8 @@ void CommandCategoryListBox::SetStylesInfo(SfxStylesInfo_Impl* pStyles)

void CommandCategoryListBox::addChildren(
    weld::TreeIter* parentEntry, const css::uno::Reference< css::script::browse::XBrowseNode > &parentNode,
    CuiConfigFunctionListBox* pFunctionListBox, const OUString& filterTerm , SaveInData *pCurrentSaveInData)
    CuiConfigFunctionListBox* pFunctionListBox, const OUString& filterTerm , SaveInData *pCurrentSaveInData,
    std::vector<std::unique_ptr<weld::TreeIter>> &rNodesToExpand)
{
    // Setup search filter parameters
    m_searchOptions.searchString = filterTerm;
@@ -493,15 +502,15 @@ void CommandCategoryListBox::addChildren(

            m_aGroupInfo.push_back( std::make_unique<SfxGroupInfo_Impl>(SfxCfgKind::GROUP_SCRIPTCONTAINER,
                                                                         0, static_cast<void *>( child.get())));
            std::unique_ptr<weld::TreeIter> xNewEntry(pFunctionListBox->append_ondemand(OUString::number(reinterpret_cast<sal_Int64>(m_aGroupInfo.back().get())), sUIName, parentEntry));
            std::unique_ptr<weld::TreeIter> xNewEntry(pFunctionListBox->tree_append(OUString::number(reinterpret_cast<sal_Int64>(m_aGroupInfo.back().get())), sUIName, parentEntry));

            addChildren(xNewEntry.get(), child, pFunctionListBox, filterTerm, pCurrentSaveInData);
            addChildren(xNewEntry.get(), child, pFunctionListBox, filterTerm, pCurrentSaveInData, rNodesToExpand);

            // Remove the group if empty
            if (!pFunctionListBox->iter_has_child(*xNewEntry))
                pFunctionListBox->remove(*xNewEntry);
            else
                pFunctionListBox->expand_row(*xNewEntry);
                rNodesToExpand.emplace_back(std::move(xNewEntry));
        }
        else if ( child.get()->getType() == css::script::browse::BrowseNodeTypes::SCRIPT )
        {
diff --git a/cui/source/customize/SvxMenuConfigPage.cxx b/cui/source/customize/SvxMenuConfigPage.cxx
index 8e8adf5..28f340a2 100644
--- a/cui/source/customize/SvxMenuConfigPage.cxx
+++ b/cui/source/customize/SvxMenuConfigPage.cxx
@@ -100,14 +100,14 @@ SvxMenuConfigPage::SvxMenuConfigPage(TabPageParent pParent, const SfxItemSet& rS
    : SvxConfigPage(pParent, rSet)
    , m_bIsMenuBar(bIsMenuBar)
{
    m_xGearBtn = m_xBuilder->weld_menu_button("menugearbtn");
    m_xGearBtn->show();
    m_xContentsListBox.reset(new SvxMenuEntriesListBox(m_xBuilder->weld_tree_view("menucontents"), this));
    weld::TreeView& rTreeView = m_xContentsListBox->get_widget();
    rTreeView.connect_size_allocate(LINK(this, SvxMenuConfigPage, MenuEntriesSizeAllocHdl));
    Size aSize(m_xFunctions->get_size_request());
    rTreeView.set_size_request(aSize.Width(), aSize.Height());
    MenuEntriesSizeAllocHdl(aSize);
    rTreeView.set_grid_left_attach(0);
    rTreeView.set_grid_top_attach(0);
    rTreeView.set_hexpand(true);
    rTreeView.set_vexpand(true);
    rTreeView.show();
@@ -139,10 +139,6 @@ SvxMenuConfigPage::SvxMenuConfigPage(TabPageParent pParent, const SfxItemSet& rS
    m_xModifyBtn->remove_item("resetIcon");
    m_xModifyBtn->remove_item("restoreItem");

    m_xGearBtn->remove_item("gear_iconAndText");
    m_xGearBtn->remove_item("gear_iconOnly");
    m_xGearBtn->remove_item("gear_textOnly");

    if ( !bIsMenuBar )
    {
        //TODO: Remove this when the gear button is implemented for context menus
@@ -242,9 +238,9 @@ void SvxMenuConfigPage::UpdateButtonStates()
    {
        SvxConfigEntry* pMenuData = GetTopLevelSelection();
        // Add option (gear_add) will always be enabled
        m_xGearBtn->set_item_sensitive( "gear_delete", pMenuData->IsDeletable() );
        m_xGearBtn->set_item_sensitive( "gear_rename", pMenuData->IsRenamable() );
        m_xGearBtn->set_item_sensitive( "gear_move", pMenuData->IsMovable() );
        m_xGearBtn->set_item_sensitive( "menu_gear_delete", pMenuData->IsDeletable() );
        m_xGearBtn->set_item_sensitive( "menu_gear_rename", pMenuData->IsRenamable() );
        m_xGearBtn->set_item_sensitive( "menu_gear_move", pMenuData->IsMovable() );
    }
}

@@ -335,7 +331,7 @@ void SvxMenuConfigPage::SelectElement()

IMPL_LINK(SvxMenuConfigPage, GearHdl, const OString&, rIdent, void)
{
    if (rIdent == "gear_add")
    if (rIdent == "menu_gear_add")
    {
        SvxMainMenuOrganizerDialog aDialog(GetDialogFrameWeld(),
            GetSaveInData()->GetEntries(), nullptr, true );
@@ -347,11 +343,11 @@ IMPL_LINK(SvxMenuConfigPage, GearHdl, const OString&, rIdent, void)
            GetSaveInData()->SetModified();
        }
    }
    else if (rIdent == "gear_delete")
    else if (rIdent == "menu_gear_delete")
    {
        DeleteSelectedTopLevel();
    }
    else if (rIdent == "gear_rename")
    else if (rIdent == "menu_gear_rename")
    {
        SvxConfigEntry* pMenuData = GetTopLevelSelection();

@@ -376,7 +372,7 @@ IMPL_LINK(SvxMenuConfigPage, GearHdl, const OString&, rIdent, void)
            GetSaveInData()->SetModified();
        }
    }
    else if (rIdent == "gear_move")
    else if (rIdent == "menu_gear_move")
    {
        SvxConfigEntry* pMenuData = GetTopLevelSelection();

diff --git a/cui/source/customize/SvxToolbarConfigPage.cxx b/cui/source/customize/SvxToolbarConfigPage.cxx
index 252efe5..66a4d72 100644
--- a/cui/source/customize/SvxToolbarConfigPage.cxx
+++ b/cui/source/customize/SvxToolbarConfigPage.cxx
@@ -99,6 +99,8 @@
SvxToolbarConfigPage::SvxToolbarConfigPage(TabPageParent pParent, const SfxItemSet& rSet)
    : SvxConfigPage(pParent, rSet)
{
    m_xGearBtn = m_xBuilder->weld_menu_button("toolbargearbtn");
    m_xGearBtn->show();
    m_xContainer->set_help_id(HID_SVX_CONFIG_TOOLBAR);

    m_xContentsListBox.reset(new SvxToolbarEntriesListBox(m_xBuilder->weld_tree_view("toolcontents"), this));
@@ -109,8 +111,6 @@ SvxToolbarConfigPage::SvxToolbarConfigPage(TabPageParent pParent, const SfxItemS
    aWidths.push_back(rTreeView.get_checkbox_column_width());
    aWidths.push_back(rTreeView.get_checkbox_column_width());
    rTreeView.set_column_fixed_widths(aWidths);
    rTreeView.set_grid_left_attach(0);
    rTreeView.set_grid_top_attach(0);
    rTreeView.set_hexpand(true);
    rTreeView.set_vexpand(true);
    rTreeView.set_help_id( HID_SVX_CONFIG_TOOLBAR_CONTENTS );
@@ -154,7 +154,7 @@ SvxToolbarConfigPage::SvxToolbarConfigPage(TabPageParent pParent, const SfxItemS
    m_xInsertBtn->remove_item("insertsubmenu");

    // Gear menu's "Move" action is irrelevant to the toolbars
    m_xGearBtn->set_item_sensitive("gear_move", false);
    m_xGearBtn->set_item_sensitive("toolbar_gear_move", false);

    // default toolbar to select is standardbar unless a different one
    // has been passed in
@@ -358,7 +358,7 @@ IMPL_LINK( SvxToolbarConfigPage, GearHdl, const OString&, rIdent, void )
{
    SvxConfigEntry* pCurrentToolbar = GetTopLevelSelection();

    if (rIdent == "gear_add")
    if (rIdent == "toolbar_gear_add")
    {
        OUString prefix = CuiResId( RID_SVXSTR_NEW_TOOLBAR );

@@ -409,7 +409,7 @@ IMPL_LINK( SvxToolbarConfigPage, GearHdl, const OString&, rIdent, void )
            pData->SetModified();
        }
    }
    else if (rIdent == "gear_delete")
    else if (rIdent == "toolbar_gear_delete")
    {
        if ( pCurrentToolbar && pCurrentToolbar->IsDeletable() )
        {
@@ -417,7 +417,7 @@ IMPL_LINK( SvxToolbarConfigPage, GearHdl, const OString&, rIdent, void )
            UpdateButtonStates();
        }
    }
    else if (rIdent == "gear_rename")
    else if (rIdent == "toolbar_gear_rename")
    {
        sal_Int32 nSelectionPos = m_xTopLevelListBox->get_active();
        SvxConfigEntry* pToolbar =
@@ -449,7 +449,7 @@ IMPL_LINK( SvxToolbarConfigPage, GearHdl, const OString&, rIdent, void )
            m_xTopLevelListBox->set_active_id(sId);
        }
    }
    else if (rIdent == "gear_iconOnly" || rIdent == "gear_textOnly" || rIdent == "gear_iconAndText")
    else if (rIdent == "toolbar_gear_iconOnly" || rIdent == "toolbar_gear_textOnly" || rIdent == "toolbar_gear_iconAndText")
    {
        ToolbarSaveInData* pSaveInData = static_cast<ToolbarSaveInData*>( GetSaveInData() );

@@ -460,11 +460,11 @@ IMPL_LINK( SvxToolbarConfigPage, GearHdl, const OString&, rIdent, void )
        }

        sal_Int32 nStyle = 0;
        if (rIdent == "gear_iconOnly")
        if (rIdent == "toolbar_gear_iconOnly")
            nStyle = 0;
        else if (rIdent == "gear_textOnly")
        else if (rIdent == "toolbar_gear_textOnly")
            nStyle = 1;
        else if (rIdent == "gear_iconAndText")
        else if (rIdent == "toolbar_gear_iconAndText")
            nStyle = 2;

        pCurrentToolbar->SetStyle( nStyle );
@@ -768,9 +768,9 @@ void SvxToolbarConfigPage::UpdateButtonStates()
    m_xModifyBtn->set_sensitive( bIsValidSelection && !bIsSeparator );

    // Handle the gear button
    // "gear_add" option is always enabled
    m_xGearBtn->set_item_sensitive("gear_delete", pToolbar && pToolbar->IsDeletable());
    m_xGearBtn->set_item_sensitive("gear_rename", pToolbar && pToolbar->IsRenamable());
    // "toolbar_gear_add" option is always enabled
    m_xGearBtn->set_item_sensitive("toolbar_gear_delete", pToolbar && pToolbar->IsDeletable());
    m_xGearBtn->set_item_sensitive("toolbar_gear_rename", pToolbar && pToolbar->IsRenamable());
}

short SvxToolbarConfigPage::QueryReset()
@@ -812,17 +812,17 @@ void SvxToolbarConfigPage::SelectElement()
    {
        case 0:
        {
            m_xGearBtn->set_item_active("gear_iconOnly", true);
            m_xGearBtn->set_item_active("toolbar_gear_iconOnly", true);
            break;
        }
        case 1:
        {
            m_xGearBtn->set_item_active("gear_textOnly", true);
            m_xGearBtn->set_item_active("toolbar_gear_textOnly", true);
            break;
        }
        case 2:
        {
            m_xGearBtn->set_item_active("gear_iconAndText", true);
            m_xGearBtn->set_item_active("toolbar_gear_iconAndText", true);
            break;
        }
    }
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index 40f15d5..8d5e509 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -1024,7 +1024,9 @@ void SfxAcceleratorConfigPage::Init(const uno::Reference<ui::XAcceleratorConfigu
            continue;
        TAccInfo*    pEntry   = new TAccInfo(i1, 0/*nListPos*/, aKey);
        m_xEntriesBox->append(OUString::number(reinterpret_cast<sal_Int64>(pEntry)), sKey);
        m_xEntriesBox->set_text(m_xEntriesBox->n_children() - 1, OUString(), 1);
        int nPos = m_xEntriesBox->n_children() - 1;
        m_xEntriesBox->set_text(nPos, OUString(), 1);
        m_xEntriesBox->set_sensitive(nPos, true);
    }

    // Assign all commands to its shortcuts - reading the accelerator config.
@@ -1315,8 +1317,6 @@ IMPL_LINK_NOARG(SfxAcceleratorConfigPage, TimeOut_Impl, Timer*, void)

    weld::TreeView& rTreeView = m_xGroupLBox->get_widget();
    SelectHdl(rTreeView);

    SelectHdl(m_xFunctionBox->get_widget());
}

IMPL_LINK_NOARG(SfxAcceleratorConfigPage, LoadHdl, sfx2::FileDialogHelper*, void)
@@ -1522,7 +1522,7 @@ void SfxAcceleratorConfigPage::Reset( const SfxItemSet* rSet )
    // change the description of the radio button, which switch to the module
    // dependent accelerator configuration
    OUString sButtonText = m_xModuleButton->get_label();
    sButtonText = sButtonText.replaceFirst("$(MODULE)", m_sModuleUIName);
    sButtonText = m_xModuleButton->strip_mnemonic(sButtonText).replaceFirst("$(MODULE)", m_sModuleUIName);
    m_xModuleButton->set_label(sButtonText);

    if (m_xModule.is())
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 8f28bb7..dc87895 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -206,22 +206,16 @@ static VclPtr<SfxTabPage> CreateSvxEventConfigPage( TabPageParent pParent, const
 * key bindings.
 *
 *****************************************************************************/
SvxConfigDialog::SvxConfigDialog(vcl::Window * pParent, const SfxItemSet* pInSet)
    : SfxTabDialog(pParent, "CustomizeDialog",
        "cui/ui/customizedialog.ui", pInSet)
    , m_nMenusPageId(0)
    , m_nToolbarsPageId(0)
    , m_nContextMenusPageId(0)
    , m_nKeyboardPageId(0)
    , m_nEventsPageId(0)
SvxConfigDialog::SvxConfigDialog(weld::Window * pParent, const SfxItemSet* pInSet)
    : SfxTabDialogController(pParent, "cui/ui/customizedialog.ui", "CustomizeDialog", pInSet)
{
    SvxConfigPageHelper::InitImageType();

    m_nMenusPageId = AddTabPage("menus", CreateSvxMenuConfigPage);
    m_nToolbarsPageId = AddTabPage("toolbars", CreateSvxToolbarConfigPage);
    m_nContextMenusPageId = AddTabPage("contextmenus", CreateSvxContextMenuConfigPage);
    m_nKeyboardPageId = AddTabPage("keyboard", CreateKeyboardConfigPage);
    m_nEventsPageId = AddTabPage("events", CreateSvxEventConfigPage);
    AddTabPage("menus", CreateSvxMenuConfigPage, nullptr);
    AddTabPage("toolbars", CreateSvxToolbarConfigPage, nullptr);
    AddTabPage("contextmenus", CreateSvxContextMenuConfigPage, nullptr);
    AddTabPage("keyboard", CreateKeyboardConfigPage, nullptr);
    AddTabPage("events", CreateSvxEventConfigPage, nullptr);

    const SfxPoolItem* pItem =
        pInSet->GetItem( pInSet->GetPool()->GetWhich( SID_CONFIG ) );
@@ -232,7 +226,7 @@ SvxConfigDialog::SvxConfigDialog(vcl::Window * pParent, const SfxItemSet* pInSet

        if (text.startsWith( ITEM_TOOLBAR_URL ) )
        {
            SetCurPageId(m_nToolbarsPageId);
            SetCurPageId("toolbars");
        }
    }
}
@@ -242,17 +236,17 @@ void SvxConfigDialog::SetFrame(const css::uno::Reference< css::frame::XFrame >& 
    m_xFrame = xFrame;

    if (!SvxConfigPageHelper::showKeyConfigTabPage( xFrame ))
        RemoveTabPage(m_nKeyboardPageId);
        RemoveTabPage("keyboard");
}

void SvxConfigDialog::PageCreated( sal_uInt16 nId, SfxTabPage& rPage )
void SvxConfigDialog::PageCreated(const OString &rId, SfxTabPage& rPage)
{
    if (nId == m_nMenusPageId || nId == m_nKeyboardPageId ||
        nId == m_nToolbarsPageId || nId == m_nContextMenusPageId)
    if (rId == "menus" || rId == "keyboard" ||
        rId == "toolbars" || rId == "contextmenus")
    {
        rPage.SetFrame(m_xFrame);
    }
    else if (nId == m_nEventsPageId)
    else if (rId == "events")
    {
        dynamic_cast< SvxEventConfigPage& >( rPage ).LateInit( m_xFrame );
    }
@@ -911,22 +905,12 @@ void ContextMenuSaveInData::ResetContextMenu( const SvxConfigEntry* pEntry )

void SvxMenuEntriesListBox::CreateDropDown()
{
    int nWidth = m_xControl->get_text_height();
    int nWidth = m_xControl->get_text_height() / 2;
    m_xDropDown->SetOutputSizePixel(Size(nWidth, nWidth));

    int nSize = nWidth / 2;
    int nHalfSize = nSize / 2;
    int nY = nHalfSize;
    int nX = 0;

    m_xDropDown->SetFillColor(COL_BLACK);

    int n = 0;
    while (n <= nHalfSize)
    {
        m_xDropDown->DrawRect(::tools::Rectangle(nX + n, nY + n, nX + n, nY + nSize - n));
        ++n;
    }
    DecorationView aDecoView(m_xDropDown.get());
    aDecoView.DrawSymbol(tools::Rectangle(Point(0, 0), Size(nWidth, nWidth)),
                         SymbolType::SPIN_RIGHT, m_xDropDown->GetTextColor(),
                         DrawSymbolFlags::NONE);
}

/******************************************************************************
@@ -939,7 +923,7 @@ void SvxMenuEntriesListBox::CreateDropDown()
 *****************************************************************************/
SvxMenuEntriesListBox::SvxMenuEntriesListBox(std::unique_ptr<weld::TreeView> xControl, SvxConfigPage* pPg)
    : m_xControl(std::move(xControl))
    , m_xDropDown(VclPtr<VirtualDevice>::Create(*Application::GetDefaultDevice(), DeviceFormat::DEFAULT, DeviceFormat::DEFAULT))
    , m_xDropDown(m_xControl->create_virtual_device())
    , pPage(pPg)
    , m_bIsInternalDrag( false )
{
@@ -994,7 +978,6 @@ SvxConfigPage::SvxConfigPage(TabPageParent pParent, const SfxItemSet& rSet)
    , m_xDescriptionFieldLb(m_xBuilder->weld_label("descriptionlabel"))
    , m_xDescriptionField(m_xBuilder->weld_text_view("desc"))
    , m_xTopLevelListBox(m_xBuilder->weld_combo_box("toplevellist"))
    , m_xGearBtn(m_xBuilder->weld_menu_button("gearbtn"))
    , m_xMoveUpButton(m_xBuilder->weld_button("up"))
    , m_xMoveDownButton(m_xBuilder->weld_button("down"))
    , m_xSaveInListBox(m_xBuilder->weld_combo_box("savein"))
@@ -1301,10 +1284,9 @@ OUString SvxConfigPage::GetScriptURL() const
{
    OUString result;

    int nEntry = m_xFunctions->get_selected_index();
    if (nEntry != -1)
    SfxGroupInfo_Impl *pData = reinterpret_cast<SfxGroupInfo_Impl*>(m_xFunctions->get_selected_id().toInt64());
    if (pData)
    {
        SfxGroupInfo_Impl *pData = reinterpret_cast<SfxGroupInfo_Impl*>(m_xFunctions->get_id(nEntry).toInt64());
        if  (   ( pData->nKind == SfxCfgKind::FUNCTION_SLOT ) ||
                ( pData->nKind == SfxCfgKind::FUNCTION_SCRIPT ) ||
                ( pData->nKind == SfxCfgKind::GROUP_STYLES )    )
diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index f8de796..c7252ad 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -249,23 +249,19 @@ std::vector< SfxStyleInfo_Impl > SfxStylesInfo_Impl::getStyles(const OUString& s

OUString CuiConfigFunctionListBox::GetHelpText( bool bConsiderParent )
{
    int nSelected = m_xTreeView->get_selected_index();
    if (nSelected != -1)
    SfxGroupInfo_Impl *pData = reinterpret_cast<SfxGroupInfo_Impl*>(get_selected_id().toInt64());
    if (pData)
    {
        SfxGroupInfo_Impl *pData = reinterpret_cast<SfxGroupInfo_Impl*>(m_xTreeView->get_id(nSelected).toInt64());
        if (pData)
        if ( pData->nKind == SfxCfgKind::FUNCTION_SLOT )
        {
            if ( pData->nKind == SfxCfgKind::FUNCTION_SLOT )
            {
                if (bConsiderParent)
                    return Application::GetHelp()->GetHelpText(pData->sCommand, m_xTreeView.get());
                else
                    return Application::GetHelp()->GetHelpText(pData->sCommand, static_cast<weld::Widget*>(nullptr));
            }
            else if ( pData->nKind == SfxCfgKind::FUNCTION_SCRIPT )
            {
                return pData->sHelpText;
            }
            if (bConsiderParent)
                return Application::GetHelp()->GetHelpText(pData->sCommand, m_xTreeView.get());
            else
                return Application::GetHelp()->GetHelpText(pData->sCommand, static_cast<weld::Widget*>(nullptr));
        }
        else if ( pData->nKind == SfxCfgKind::FUNCTION_SCRIPT )
        {
            return pData->sHelpText;
        }
    }
    return OUString();
@@ -273,22 +269,16 @@ OUString CuiConfigFunctionListBox::GetHelpText( bool bConsiderParent )

OUString CuiConfigFunctionListBox::GetCurCommand()
{
    int nSelected = m_xTreeView->get_selected_index();
    if (nSelected == -1)
        return OUString();
    SfxGroupInfo_Impl *pData = reinterpret_cast<SfxGroupInfo_Impl*>(m_xTreeView->get_id(nSelected).toInt64());
    if (!pData)
    SfxGroupInfo_Impl *pData = reinterpret_cast<SfxGroupInfo_Impl*>(get_selected_id().toInt64());
    if (pData)
        return OUString();
    return pData->sCommand;
}

OUString CuiConfigFunctionListBox::GetCurLabel()
{
    int nSelected = m_xTreeView->get_selected_index();
    if (nSelected == -1)
        return OUString();
    SfxGroupInfo_Impl *pData = reinterpret_cast<SfxGroupInfo_Impl*>(m_xTreeView->get_id(nSelected).toInt64());
    if (!pData)
    SfxGroupInfo_Impl *pData = reinterpret_cast<SfxGroupInfo_Impl*>(get_selected_id().toInt64());
    if (pData)
        return OUString();
    if (!pData->sLabel.isEmpty())
        return pData->sLabel;
@@ -341,13 +331,9 @@ void CuiConfigFunctionListBox::ClearAll()

OUString CuiConfigFunctionListBox::GetSelectedScriptURI()
{
    int nSelected = m_xTreeView->get_selected_index();
    if (nSelected != -1)
    {
        SfxGroupInfo_Impl *pData = reinterpret_cast<SfxGroupInfo_Impl*>(m_xTreeView->get_id(nSelected).toInt64());
        if (pData && pData->nKind == SfxCfgKind::FUNCTION_SCRIPT)
            return *static_cast<OUString*>(pData->pObject);
    }
    SfxGroupInfo_Impl *pData = reinterpret_cast<SfxGroupInfo_Impl*>(get_selected_id().toInt64());
    if (pData && pData->nKind == SfxCfgKind::FUNCTION_SCRIPT)
        return *static_cast<OUString*>(pData->pObject);
    return OUString();
}

diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx
index 501a14c..633154b 100644
--- a/cui/source/dialogs/hangulhanjadlg.cxx
+++ b/cui/source/dialogs/hangulhanjadlg.cxx
@@ -227,7 +227,7 @@ namespace svx
    };

    RubyRadioButton::RubyRadioButton(std::unique_ptr<weld::RadioButton> xControl)
        : m_xVirDev(VclPtr<VirtualDevice>::Create(*Application::GetDefaultDevice(), DeviceFormat::DEFAULT, DeviceFormat::DEFAULT))
        : m_xVirDev(xControl->create_virtual_device())
        , m_xControl(std::move(xControl))
    {
        // expand the point size of the desired font to the equivalent pixel size
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 11ee06a..9e342f4 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1012,15 +1012,13 @@ VclPtr<SfxAbstractTabDialog> AbstractDialogFactory_Impl::CreateAutoCorrTabDialog
    return VclPtr<CuiAbstractTabController_Impl>::Create(std::make_unique<OfaAutoCorrDlg>(pParent, pAttrSet));
}

VclPtr<SfxAbstractTabDialog> AbstractDialogFactory_Impl::CreateCustomizeTabDialog(
VclPtr<SfxAbstractTabDialog> AbstractDialogFactory_Impl::CreateCustomizeTabDialog(weld::Window* pParent,
                                                const SfxItemSet* pAttrSet,
                                                const Reference< frame::XFrame >& xViewFrame )
{
    VclPtr<SfxTabDialog> pDlg;
    VclPtrInstance<SvxConfigDialog> pDlg1( nullptr, pAttrSet );
    pDlg1->SetFrame(xViewFrame);
    pDlg.reset(pDlg1);
    return VclPtr<CuiAbstractTabDialog_Impl>::Create( pDlg );
    std::unique_ptr<SvxConfigDialog> xDlg1(new SvxConfigDialog(pParent, pAttrSet));
    xDlg1->SetFrame(xViewFrame);
    return VclPtr<CuiAbstractTabController_Impl>::Create(std::move(xDlg1));
}

// TabDialog that use functionality of the drawing layer
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index ea21cfd..021cbc0 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -692,7 +692,7 @@ public:
                                                           sal_uInt32 nResId,
                                                           const OUString& rParameter ) override;
    virtual VclPtr<SfxAbstractTabDialog> CreateAutoCorrTabDialog(weld::Window* pParent, const SfxItemSet* pAttrSet) override;
    virtual VclPtr<SfxAbstractTabDialog> CreateCustomizeTabDialog(
    virtual VclPtr<SfxAbstractTabDialog> CreateCustomizeTabDialog(weld::Window* pParent,
                                            const SfxItemSet* pAttrSet,
                                            const css::uno::Reference< css::frame::XFrame >& xViewFrame ) override;
    virtual VclPtr<SfxAbstractTabDialog> CreateTextTabDialog( weld::Window* pParent,
diff --git a/cui/source/inc/CommandCategoryListBox.hxx b/cui/source/inc/CommandCategoryListBox.hxx
index 4af8c9a..63dfede 100644
--- a/cui/source/inc/CommandCategoryListBox.hxx
+++ b/cui/source/inc/CommandCategoryListBox.hxx
@@ -72,7 +72,8 @@ public:
    // Adds children of the given macro group to the functions list
    void addChildren(
        weld::TreeIter* parentEntry, const css::uno::Reference<com::sun::star::script::browse::XBrowseNode> &parentNode,
        CuiConfigFunctionListBox* pFunctionListBox, const OUString &filterTerm , SaveInData *pCurrentSaveInData );
        CuiConfigFunctionListBox* pFunctionListBox, const OUString &filterTerm , SaveInData *pCurrentSaveInData,
        std::vector<std::unique_ptr<weld::TreeIter>> &rNodesToExpand);
};

#endif // INCLUDED_CUI_SOURCE_INC_COMMANDCATEGORYLISTBOX_HXX
diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx
index 8d89aaf..3ac0d49 100644
--- a/cui/source/inc/cfg.hxx
+++ b/cui/source/inc/cfg.hxx
@@ -73,20 +73,15 @@ class SvxConfigPage;

typedef std::vector< SvxConfigEntry* > SvxEntries;

class SvxConfigDialog : public SfxTabDialog
class SvxConfigDialog : public SfxTabDialogController
{
private:
    css::uno::Reference< css::frame::XFrame > m_xFrame;
    sal_uInt16 m_nMenusPageId;
    sal_uInt16 m_nToolbarsPageId;
    sal_uInt16 m_nContextMenusPageId;
    sal_uInt16 m_nKeyboardPageId;
    sal_uInt16 m_nEventsPageId;

public:
    SvxConfigDialog( vcl::Window*, const SfxItemSet* );
    SvxConfigDialog(weld::Window*, const SfxItemSet*);

    virtual void                PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) override;
    virtual void PageCreated(const OString& rId, SfxTabPage &rPage) override;
    void SetFrame(const css::uno::Reference< css::frame::XFrame >& xFrame);
};

diff --git a/cui/source/inc/cfgutil.hxx b/cui/source/inc/cfgutil.hxx
index 9a8eb73..a55015a 100644
--- a/cui/source/inc/cfgutil.hxx
+++ b/cui/source/inc/cfgutil.hxx
@@ -123,10 +123,10 @@ public:
    {
        m_xTreeView->insert(pParent, -1, &rStr, &rId, nullptr, nullptr, nullptr, false, nullptr);
    }
    std::unique_ptr<weld::TreeIter> append_ondemand(const OUString& rId, const OUString& rStr, weld::TreeIter* pParent = nullptr)
    std::unique_ptr<weld::TreeIter> tree_append(const OUString& rId, const OUString& rStr, weld::TreeIter* pParent = nullptr)
    {
        std::unique_ptr<weld::TreeIter> xIter(m_xTreeView->make_iterator());
        m_xTreeView->insert(pParent, -1, &rStr, &rId, nullptr, nullptr, nullptr, true, xIter.get());
        m_xTreeView->insert(pParent, -1, &rStr, &rId, nullptr, nullptr, nullptr, false, xIter.get());
        return xIter;
    }
    void append(const OUString& rId, const OUString& rStr, const OUString& rImage, weld::TreeIter* pParent = nullptr)
@@ -139,6 +139,7 @@ public:
        m_xTreeView->set_image(*m_xScratchIter, rImage, -1);
    }
    void remove(int nPos) { m_xTreeView->remove(nPos); }
    void scroll_to_row(int pos) { m_xTreeView->scroll_to_row(pos); }
    void remove(weld::TreeIter& rIter) { m_xTreeView->remove(rIter); }
    void expand_row(weld::TreeIter& rIter) { m_xTreeView->expand_row(rIter); }
    int n_children() const { return m_xTreeView->n_children(); }
@@ -153,9 +154,19 @@ public:
    OUString get_id(const weld::TreeIter& rIter) const { return m_xTreeView->get_id(rIter); }
    OUString get_id(int nPos) const { return m_xTreeView->get_id(nPos); }
    bool get_selected(weld::TreeIter* pIter) const { return m_xTreeView->get_selected(pIter); }
    OUString get_selected_text() const { return m_xTreeView->get_selected_text(); }
    OUString get_selected_text() const
    {
        if (!m_xTreeView->get_selected(m_xScratchIter.get()))
            return OUString();
        return m_xTreeView->get_text(*m_xScratchIter);
    }
    OUString get_selected_id() const
    {
        if (!m_xTreeView->get_selected(m_xScratchIter.get()))
            return OUString();
        return m_xTreeView->get_id(*m_xScratchIter);
    }
    int get_selected_index() const { return m_xTreeView->get_selected_index(); }
    void scroll_to_row(int nRow) { return m_xTreeView->scroll_to_row(nRow); }
    void select(const weld::TreeIter& rIter) { m_xTreeView->select(rIter); }
    void select(int pos) { m_xTreeView->select(pos); }
    void set_size_request(int nWidth, int nHeight) { m_xTreeView->set_size_request(nWidth, nHeight); }
diff --git a/cui/uiconfig/ui/accelconfigpage.ui b/cui/uiconfig/ui/accelconfigpage.ui
index d651300..6f24858 100644
--- a/cui/uiconfig/ui/accelconfigpage.ui
+++ b/cui/uiconfig/ui/accelconfigpage.ui
@@ -97,6 +97,7 @@
                            <child>
                              <object class="GtkCellRendererText" id="cellrenderer1"/>
                              <attributes>
                                <attribute name="sensitive">3</attribute>
                                <attribute name="text">0</attribute>
                              </attributes>
                            </child>
@@ -392,7 +393,7 @@
                            <property name="model">liststore1</property>
                            <property name="headers_visible">False</property>
                            <property name="search_column">0</property>
                            <property name="show_expanders">False</property>
                            <property name="show_expanders">True</property>
                            <child internal-child="selection">
                              <object class="GtkTreeSelection" id="Macro Library List-selection1"/>
                            </child>
diff --git a/cui/uiconfig/ui/customizedialog.ui b/cui/uiconfig/ui/customizedialog.ui
index 30ecea9..1fca194 100644
--- a/cui/uiconfig/ui/customizedialog.ui
+++ b/cui/uiconfig/ui/customizedialog.ui
@@ -1,12 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<!-- Generated with glade 3.22.1 -->
<interface domain="cui">
  <requires lib="gtk+" version="3.18"/>
  <object class="GtkDialog" id="CustomizeDialog">
    <property name="can_focus">False</property>
    <property name="border_width">6</property>
    <property name="title" translatable="yes" context="customizedialog|CustomizeDialog">Customize</property>
    <property name="modal">True</property>
    <property name="default_width">0</property>
    <property name="default_height">0</property>
    <property name="type_hint">dialog</property>
    <child>
      <placeholder/>
    </child>
    <child internal-child="vbox">
      <object class="GtkBox" id="dialog-vbox1">
        <property name="can_focus">False</property>
@@ -98,6 +104,30 @@
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
              </object>
            </child>
            <child type="tab">
@@ -117,6 +147,30 @@
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
              </object>
              <packing>
                <property name="position">1</property>
@@ -140,6 +194,30 @@
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
              </object>
              <packing>
                <property name="position">2</property>
@@ -163,6 +241,30 @@
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
              </object>
              <packing>
                <property name="position">3</property>
@@ -186,6 +288,30 @@
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
              </object>
              <packing>
                <property name="position">4</property>
diff --git a/cui/uiconfig/ui/menuassignpage.ui b/cui/uiconfig/ui/menuassignpage.ui
index 5f184ca..63c74ab 100644
--- a/cui/uiconfig/ui/menuassignpage.ui
+++ b/cui/uiconfig/ui/menuassignpage.ui
@@ -2,72 +2,6 @@
<!-- Generated with glade 3.22.1 -->
<interface domain="cui">
  <requires lib="gtk+" version="3.18"/>
  <object class="GtkMenu" id="gearmenu">
    <property name="visible">True</property>
    <property name="can_focus">False</property>
    <child>
      <object class="GtkMenuItem" id="gear_add">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="label" translatable="yes" context="menuassignpage|gear_add">_Add...</property>
        <property name="use_underline">True</property>
      </object>
    </child>
    <child>
      <object class="GtkMenuItem" id="gear_delete">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="label" translatable="yes" context="menuassignpage|gear_delete">_Delete</property>
        <property name="use_underline">True</property>
      </object>
    </child>
    <child>
      <object class="GtkMenuItem" id="gear_rename">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="label" translatable="yes" context="menuassignpage|gear_rename">_Rename...</property>
        <property name="use_underline">True</property>
      </object>
    </child>
    <child>
      <object class="GtkMenuItem" id="gear_move">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="label" translatable="yes" context="menuassignpage|gear_move">_Move...</property>
        <property name="use_underline">True</property>
      </object>
    </child>
    <child>
      <object class="GtkSeparatorMenuItem" id="gear_separator">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
      </object>
    </child>
    <child>
      <object class="GtkRadioMenuItem" id="gear_iconAndText">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="label" translatable="yes" context="menuassignpage|gear_iconAndText">_Icon and text</property>
        <property name="use_underline">True</property>
      </object>
    </child>
    <child>
      <object class="GtkRadioMenuItem" id="gear_iconOnly">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="label" translatable="yes" context="menuassignpage|gear_iconOnly">Icon _only</property>
        <property name="use_underline">True</property>
      </object>
    </child>
    <child>
      <object class="GtkRadioMenuItem" id="gear_textOnly">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="label" translatable="yes" context="menuassignpage|gear_textOnly">_Text only</property>
        <property name="use_underline">True</property>
      </object>
    </child>
  </object>
  <object class="GtkImage" id="image1">
    <property name="visible">True</property>
    <property name="can_focus">False</property>
@@ -95,6 +29,11 @@
    <property name="can_focus">False</property>
    <property name="icon_name">sfx2/res/actionaction013.png</property>
  </object>
  <object class="GtkImage" id="image8">
    <property name="visible">True</property>
    <property name="can_focus">False</property>
    <property name="icon_name">sfx2/res/actionaction013.png</property>
  </object>
  <object class="GtkMenu" id="insertmenu">
    <property name="visible">True</property>
    <property name="can_focus">False</property>
@@ -125,6 +64,68 @@
      <column type="gchararray"/>
    </columns>
  </object>
  <object class="GtkTreeStore" id="liststore2">
    <columns>
      <!-- column-name check1 -->
      <column type="gboolean"/>
      <!-- column-name expander -->
      <column type="GdkPixbuf"/>
      <!-- column-name text -->
      <column type="gchararray"/>
      <!-- column-name id -->
      <column type="gchararray"/>
      <!-- column-name checkvis1 -->
      <column type="gboolean"/>
    </columns>
  </object>
  <object class="GtkTreeStore" id="liststore3">
    <columns>
      <!-- column-name expander -->
      <column type="GdkPixbuf"/>
      <!-- column-name text -->
      <column type="gchararray"/>
      <!-- column-name image1 -->
      <column type="GdkPixbuf"/>
      <!-- column-name id -->
      <column type="gchararray"/>
    </columns>
  </object>
  <object class="GtkMenu" id="menugearmenu">
    <property name="visible">True</property>
    <property name="can_focus">False</property>
    <child>
      <object class="GtkMenuItem" id="menu_gear_add">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="label" translatable="yes" context="menuassignpage|gear_add">_Add...</property>
        <property name="use_underline">True</property>
      </object>
    </child>
    <child>
      <object class="GtkMenuItem" id="menu_gear_delete">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="label" translatable="yes" context="menuassignpage|gear_delete">_Delete</property>
        <property name="use_underline">True</property>
      </object>
    </child>
    <child>
      <object class="GtkMenuItem" id="menu_gear_rename">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="label" translatable="yes" context="menuassignpage|gear_rename">_Rename...</property>
        <property name="use_underline">True</property>
      </object>
    </child>
    <child>
      <object class="GtkMenuItem" id="menu_gear_move">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="label" translatable="yes" context="menuassignpage|gear_move">_Move...</property>
        <property name="use_underline">True</property>
      </object>
    </child>
  </object>
  <object class="GtkMenu" id="modifymenu">
    <property name="visible">True</property>
    <property name="can_focus">False</property>
@@ -161,6 +162,78 @@
      </object>
    </child>
  </object>
  <object class="GtkMenu" id="toolbargearmenu">
    <property name="visible">True</property>
    <property name="can_focus">False</property>
    <child>
      <object class="GtkMenuItem" id="toolbar_gear_add">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="label" translatable="yes" context="menuassignpage|gear_add">_Add...</property>
        <property name="use_underline">True</property>
      </object>
    </child>
    <child>
      <object class="GtkMenuItem" id="toolbar_gear_delete">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="label" translatable="yes" context="menuassignpage|gear_delete">_Delete</property>
        <property name="use_underline">True</property>
      </object>
    </child>
    <child>
      <object class="GtkMenuItem" id="toolbar_gear_rename">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="label" translatable="yes" context="menuassignpage|gear_rename">_Rename...</property>
        <property name="use_underline">True</property>
      </object>
    </child>
    <child>
      <object class="GtkMenuItem" id="toolbar_gear_move">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="label" translatable="yes" context="menuassignpage|gear_move">_Move...</property>
        <property name="use_underline">True</property>
      </object>
    </child>
    <child>
      <object class="GtkSeparatorMenuItem" id="toolbar_gear_separator">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
      </object>
    </child>
    <child>
      <object class="GtkRadioMenuItem" id="toolbar_gear_iconAndText">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="label" translatable="yes" context="menuassignpage|gear_iconAndText">_Icon and text</property>
        <property name="use_underline">True</property>
        <property name="draw_as_radio">True</property>
        <property name="group">toolbar_gear_iconOnly</property>
      </object>
    </child>
    <child>
      <object class="GtkRadioMenuItem" id="toolbar_gear_iconOnly">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="label" translatable="yes" context="menuassignpage|gear_iconOnly">Icon _only</property>
        <property name="use_underline">True</property>
        <property name="active">True</property>
        <property name="draw_as_radio">True</property>
      </object>
    </child>
    <child>
      <object class="GtkRadioMenuItem" id="toolbar_gear_textOnly">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="label" translatable="yes" context="menuassignpage|gear_textOnly">_Text only</property>
        <property name="use_underline">True</property>
        <property name="draw_as_radio">True</property>
        <property name="group">toolbar_gear_iconOnly</property>
      </object>
    </child>
  </object>
  <object class="GtkBox" id="MenuAssignPage">
    <property name="visible">True</property>
    <property name="can_focus">False</property>
@@ -202,6 +275,7 @@
                <property name="can_focus">True</property>
                <property name="tooltip_text" translatable="yes" context="menuassignpage|desc">Local help is not installed.</property>
                <property name="editable">False</property>
                <property name="wrap_mode">word</property>
                <property name="cursor_visible">False</property>
                <property name="accepts_tab">False</property>
                <accessibility>
@@ -252,6 +326,7 @@
                <property name="headers_visible">False</property>
                <property name="search_column">1</property>
                <property name="enable_tree_lines">True</property>
                <property name="show_expanders">True</property>
                <child internal-child="selection">
                  <object class="GtkTreeSelection" id="Macro Library List-selection1"/>
                </child>
@@ -389,20 +464,19 @@
              </packing>
            </child>
            <child>
              <object class="GtkMenuButton" id="gearbtn">
                <property name="visible">True</property>
              <object class="GtkMenuButton" id="menugearbtn">
                <property name="can_focus">True</property>
                <property name="receives_default">True</property>
                <property name="halign">end</property>
                <property name="margin_left">1</property>
                <property name="image">image7</property>
                <property name="always_show_image">True</property>
                <property name="popup">gearmenu</property>
                <property name="popup">menugearmenu</property>
                <property name="use_popover">False</property>
                <child internal-child="accessible">
                  <object class="AtkObject" id="gearbtn-atkobject">
                  <object class="AtkObject" id="menugearbtn-atkobject">
                    <property name="AtkObject::accessible-name" translatable="yes" context="menuassignpage|gearbtn">Gear Menu</property>
                    <property name="AtkObject::accessible-description" translatable="yes" context="menuassignpage|gearbtn">Contains commands to modify or delete the selected toolbar or the top level menu, and the command to add new toolbars or top level menus.</property>
                    <property name="AtkObject::accessible-description" translatable="yes" context="menuassignpage|menugearbtn">Contains commands to modify or delete the selected top level menu, and the command to add new top level menus.</property>
                  </object>
                </child>
              </object>
@@ -411,6 +485,28 @@
                <property name="top_attach">0</property>
              </packing>
            </child>
            <child>
              <object class="GtkMenuButton" id="toolbargearbtn">
                <property name="can_focus">True</property>
                <property name="receives_default">True</property>
                <property name="halign">end</property>
                <property name="margin_left">1</property>
                <property name="image">image8</property>
                <property name="always_show_image">True</property>
                <property name="popup">toolbargearmenu</property>
                <property name="use_popover">False</property>
                <child internal-child="accessible">
                  <object class="AtkObject" id="toolbargearbtn-atkobject">
                    <property name="AtkObject::accessible-name" translatable="yes" context="menuassignpage|gearbtn">Gear Menu</property>
                    <property name="AtkObject::accessible-description" translatable="yes" context="menuassignpage|toolbargearbtn">Contains commands to modify or delete the selected toolbar, and the command to add new toolbars.</property>
                  </object>
                </child>
              </object>
              <packing>
                <property name="left_attach">2</property>
                <property name="top_attach">0</property>
              </packing>
            </child>
          </object>
          <packing>
            <property name="left_attach">2</property>
@@ -439,26 +535,46 @@
                    <property name="no_show_all">True</property>
                    <property name="hexpand">True</property>
                    <property name="vexpand">True</property>
                    <property name="model">liststore1</property>
                    <property name="model">liststore2</property>
                    <property name="headers_visible">False</property>
                    <property name="reorderable">True</property>
                    <property name="search_column">1</property>
                    <property name="show_expanders">False</property>
                    <child internal-child="selection">
                      <object class="GtkTreeSelection"/>
                    </child>
                    <child>
                      <object class="GtkTreeViewColumn" id="treeviewcolumn1">
                      <object class="GtkTreeViewColumn" id="treeviewcolumn4">
                        <property name="resizable">True</property>
                        <property name="spacing">6</property>
                        <property name="alignment">0.5</property>
                        <child>
                          <object class="GtkCellRendererPixbuf" id="cellrenderertext1"/>
                          <object class="GtkCellRendererToggle" id="cellrenderer5"/>
                          <attributes>
                            <attribute name="pixbuf">0</attribute>
                            <attribute name="visible">4</attribute>
                            <attribute name="active">0</attribute>
                          </attributes>
                        </child>
                      </object>
                    </child>
                    <child>
                      <object class="GtkTreeViewColumn" id="treeviewcolumn9">
                        <property name="spacing">6</property>
                        <child>
                          <object class="GtkCellRendererText" id="cellrenderertext3"/>
                          <object class="GtkCellRendererPixbuf" id="cellrenderertext9"/>
                          <attributes>
                            <attribute name="text">1</attribute>
                            <attribute name="pixbuf">1</attribute>
                          </attributes>
                        </child>
                      </object>
                    </child>
                    <child>
                      <object class="GtkTreeViewColumn" id="treeviewcolumn10">
                        <property name="spacing">6</property>
                        <child>
                          <object class="GtkCellRendererText" id="cellrenderertext10"/>
                          <attributes>
                            <attribute name="text">2</attribute>
                          </attributes>
                        </child>
                      </object>
@@ -481,35 +597,51 @@
                <child>
                  <object class="GtkTreeView" id="menucontents">
                    <property name="width_request">-1</property>
                    <property name="visible">True</property>
                    <property name="can_focus">True</property>
                    <property name="receives_default">True</property>
                    <property name="no_show_all">True</property>
                    <property name="hexpand">True</property>
                    <property name="vexpand">True</property>
                    <property name="model">liststore1</property>
                    <property name="model">liststore3</property>
                    <property name="headers_visible">False</property>
                    <property name="reorderable">True</property>
                    <property name="search_column">1</property>
                    <property name="show_expanders">False</property>
                    <property name="enable_tree_lines">True</property>
                    <child internal-child="selection">
                      <object class="GtkTreeSelection"/>
                      <object class="GtkTreeSelection" id="Macro Library List-selection2"/>
                    </child>
                    <child>
                      <object class="GtkTreeViewColumn" id="treeviewcolumn3">
                      <object class="GtkTreeViewColumn" id="treeviewcolumn22">
                        <property name="spacing">6</property>
                        <child>
                          <object class="GtkCellRendererPixbuf" id="cellrenderertext5"/>
                          <object class="GtkCellRendererPixbuf" id="cellrenderertext44"/>
                          <attributes>
                            <attribute name="pixbuf">0</attribute>
                          </attributes>
                        </child>
                      </object>
                    </child>
                    <child>
                      <object class="GtkTreeViewColumn" id="treeviewcolumn33">
                        <child>
                          <object class="GtkCellRendererText" id="cellrenderertext6"/>
                          <object class="GtkCellRendererText" id="cellrenderertext22"/>
                          <attributes>
                            <attribute name="text">1</attribute>
                          </attributes>
                        </child>
                      </object>
                    </child>
                    <child>
                      <object class="GtkTreeViewColumn" id="treeviewcolumn44">
                        <child>
                          <object class="GtkCellRendererPixbuf" id="cellrenderertext55"/>
                          <attributes>
                            <attribute name="pixbuf">2</attribute>
                          </attributes>
                        </child>
                      </object>
                    </child>
                  </object>
                </child>
              </object>
@@ -825,12 +957,6 @@
      </packing>
    </child>
  </object>
  <object class="GtkSizeGroup" id="sizegrp1">
    <widgets>
      <widget name="grid6"/>
      <widget name="functions"/>
    </widgets>
  </object>
  <object class="GtkSizeGroup" id="sizegrp2">
    <property name="mode">vertical</property>
    <widgets>
diff --git a/include/sfx2/sfxdlg.hxx b/include/sfx2/sfxdlg.hxx
index 48b6b96..26d978d 100644
--- a/include/sfx2/sfxdlg.hxx
+++ b/include/sfx2/sfxdlg.hxx
@@ -128,7 +128,7 @@ public:
    static SfxAbstractDialogFactory*    Create();
    virtual VclPtr<VclAbstractDialog>          CreateFrameDialog(vcl::Window* pParent, const css::uno::Reference< css::frame::XFrame >& rFrame, sal_uInt32 nResId, const OUString& rParameter ) = 0;
    virtual VclPtr<SfxAbstractTabDialog>       CreateAutoCorrTabDialog(weld::Window* pParent, const SfxItemSet* pAttrSet) = 0;
    virtual VclPtr<SfxAbstractTabDialog>       CreateCustomizeTabDialog(
    virtual VclPtr<SfxAbstractTabDialog>       CreateCustomizeTabDialog(weld::Window* pParent,
                                            const SfxItemSet* pAttrSet,
                                            const css::uno::Reference< css::frame::XFrame >& xViewFrame ) = 0;
    virtual CreateTabPage               GetTabPageCreatorFunc( sal_uInt16 nId ) = 0;
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 6c49930..42b1685 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -294,6 +294,8 @@ namespace vcl {

VCL_DLLPUBLIC void DrawFocusRect(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect);

typedef struct _cairo_surface cairo_surface_t;

/**
* Some things multiple-inherit from VclAbstractDialog and OutputDevice,
* so we need to use virtual inheritance to keep the referencing counting
@@ -307,6 +309,8 @@ class VCL_DLLPUBLIC OutputDevice : public virtual VclReferenceBase
    friend class WorkWindow;
    friend void ImplHandleResize( vcl::Window* pWindow, long nNewWidth, long nNewHeight );

    friend cairo_surface_t* get_underlying_alpha_cairo_surface(const VirtualDevice&);

private:
    OutputDevice(const OutputDevice&) = delete;
    OutputDevice& operator=(const OutputDevice&) = delete;
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index fdd2d48..49ae4a2 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -202,6 +202,10 @@ public:
    //parents
    virtual void help_hierarchy_foreach(const std::function<bool(const OString&)>& func) = 0;

    virtual OUString strip_mnemonic(const OUString& rLabel) const = 0;

    virtual VclPtr<VirtualDevice> create_virtual_device() const = 0;

    virtual ~Widget() {}
};

diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index e72bb8a..5a3552f 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -459,7 +459,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
            }

            Reference <XFrame> xFrame(GetRequestFrame(rReq));
            ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateCustomizeTabDialog(
            ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateCustomizeTabDialog(rReq.GetFrameWeld(),
                &aSet, xFrame ));

            const short nRet = pDlg->Execute();
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 572ed4a..815be92 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -610,6 +610,17 @@ public:

    virtual void help_hierarchy_foreach(const std::function<bool(const OString&)>& func) override;

    virtual OUString strip_mnemonic(const OUString &rLabel) const override
    {
        return rLabel.replaceFirst("~", "");
    }

    virtual VclPtr<VirtualDevice> create_virtual_device() const override
    {
        // create with (annoying) seperate alpha layer that LibreOffice itself uses
        return VclPtr<VirtualDevice>::Create(*Application::GetDefaultDevice(), DeviceFormat::DEFAULT, DeviceFormat::DEFAULT);
    }

    SystemWindow* getSystemWindow()
    {
        return m_xWidget->GetSystemWindow();
@@ -2846,6 +2857,7 @@ public:

    virtual void expand_row(const weld::TreeIter& rIter) override
    {
        assert(m_xTreeView->IsUpdateMode() && "don't expand when frozen");
        const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
        if (!m_xTreeView->IsExpanded(rVclIter.iter) && signal_expanding(rIter))
            m_xTreeView->Expand(rVclIter.iter);
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 3e17f6e..51deeb6 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -1859,6 +1859,19 @@ public:
    }

    virtual void help_hierarchy_foreach(const std::function<bool(const OString&)>& func) override;

    virtual OUString strip_mnemonic(const OUString &rLabel) const override
    {
        return rLabel.replaceFirst("_", "");
    }

    virtual VclPtr<VirtualDevice> create_virtual_device() const override
    {
        // create with no seperate alpha layer like everything sane does
        auto xRet = VclPtr<VirtualDevice>::Create();
        xRet->SetBackground(COL_TRANSPARENT);
        return xRet;
    }
};

namespace
@@ -5548,6 +5561,7 @@ private:

    bool signal_test_expand_row(GtkTreeIter& iter)
    {
        disable_notify_events();
        GtkInstanceTreeIter aIter(nullptr);

        // if there's a preexisting placeholder child, required to make this
@@ -5576,6 +5590,7 @@ private:
            insert_row(subiter, &iter, -1, nullptr, &sDummy, nullptr, nullptr, nullptr);
        }

        enable_notify_events();
        return bRet;
    }

@@ -5642,7 +5657,7 @@ private:
        return m_aModelColToViewCol[modelcol];
    }

    static void signalRowDeleted(GtkTreeModel*, GtkTreePath*, GtkTreeIter*, gpointer widget)
    static void signalRowDeleted(GtkTreeModel*, GtkTreePath*, gpointer widget)
    {
        GtkInstanceTreeView* pThis = static_cast<GtkInstanceTreeView*>(widget);
        pThis->signal_model_changed();
@@ -5855,7 +5870,8 @@ public:
        m_xSorter.reset(new comphelper::string::NaturalStringSorter(
                            ::comphelper::getProcessComponentContext(),
                            Application::GetSettings().GetUILanguageTag().getLocale()));
        set_sort_order(true);
        GtkTreeSortable* pSortable = GTK_TREE_SORTABLE(m_pTreeStore);
        gtk_tree_sortable_set_sort_column_id(pSortable, m_nTextCol, GTK_SORT_ASCENDING);
    }

    virtual void set_sort_order(bool bAscending) override
@@ -6084,8 +6100,11 @@ public:

    virtual void set_sensitive(int pos, bool bSensitive, int col) override
    {
        col = get_model_col(col);
        ++col; // skip over id column
        if (col == -1)
            col = m_nTextCol;
        else
            col = get_model_col(col);
        col += m_nIdCol + 1; // skip over id column
        col += m_aToggleVisMap.size(); // skip over toggle columns
        set(pos, col, bSensitive);
    }
@@ -6349,12 +6368,15 @@ public:

    virtual void expand_row(const weld::TreeIter& rIter) override
    {
        assert(gtk_tree_view_get_model(m_pTreeView) && "don't expand when frozen");

        const GtkInstanceTreeIter& rGtkIter = static_cast<const GtkInstanceTreeIter&>(rIter);
        GtkTreeModel *pModel = GTK_TREE_MODEL(m_pTreeStore);
        GtkTreePath* path = gtk_tree_model_get_path(pModel, const_cast<GtkTreeIter*>(&rGtkIter.iter));
        if (!gtk_tree_view_row_expanded(m_pTreeView, path))
            gtk_tree_view_expand_to_path(m_pTreeView, path);
        gtk_tree_path_free(path);

    }

    virtual void collapse_row(const weld::TreeIter& rIter) override