tdf#140387 grab focus to first panel widget on panel gaining focus

otherwise focus is getting lost in these currently mixed vcl+gtk widget
panels.

Change-Id: I6488ddfc98afdedb55bb3217f3877e96258dd65a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110955
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/chart2/source/controller/sidebar/ChartAxisPanel.cxx b/chart2/source/controller/sidebar/ChartAxisPanel.cxx
index 63807f37..c1d9a4e 100644
--- a/chart2/source/controller/sidebar/ChartAxisPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartAxisPanel.cxx
@@ -219,6 +219,8 @@ ChartAxisPanel::ChartAxisPanel(
    , mbModelValid(true)
{
    Initialize();

    m_pInitialFocusWidget = mxCBShowLabel.get();
}

ChartAxisPanel::~ChartAxisPanel()
diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
index 27b96dc..b14705cc 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
@@ -336,6 +336,8 @@ ChartElementsPanel::ChartElementsPanel(
    maTextSubTitle = mxTextSubTitle->get_label();

    Initialize();

    m_pInitialFocusWidget = mxCBTitle.get();
}

ChartElementsPanel::~ChartElementsPanel()
diff --git a/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx b/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx
index cb768d3..b435520 100644
--- a/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx
@@ -249,6 +249,8 @@ ChartErrorBarPanel::ChartErrorBarPanel(
    , mbModelValid(true)
{
    Initialize();

    m_pInitialFocusWidget = mxRBPosAndNeg.get();
}

ChartErrorBarPanel::~ChartErrorBarPanel()
diff --git a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
index 8a0c0d7..727aabb 100644
--- a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
@@ -297,6 +297,8 @@ ChartSeriesPanel::ChartSeriesPanel(
    , mbModelValid(true)
{
    Initialize();

    m_pInitialFocusWidget = mxCBLabel.get();
}

ChartSeriesPanel::~ChartSeriesPanel()
diff --git a/chart2/source/controller/sidebar/ChartTypePanel.cxx b/chart2/source/controller/sidebar/ChartTypePanel.cxx
index 74a8e7b..a0e38bd 100644
--- a/chart2/source/controller/sidebar/ChartTypePanel.cxx
+++ b/chart2/source/controller/sidebar/ChartTypePanel.cxx
@@ -119,6 +119,8 @@ ChartTypePanel::ChartTypePanel(vcl::Window* pParent,
    m_pSortByXValuesResourceGroup->setChangeListener(this);

    Initialize();

    m_pInitialFocusWidget = m_xMainTypeList.get();
}

ChartTypePanel::~ChartTypePanel() { disposeOnce(); }
diff --git a/include/sfx2/sidebar/PanelLayout.hxx b/include/sfx2/sidebar/PanelLayout.hxx
index e8ee96a..0e9e568 100644
--- a/include/sfx2/sidebar/PanelLayout.hxx
+++ b/include/sfx2/sidebar/PanelLayout.hxx
@@ -25,6 +25,7 @@ protected:
    std::unique_ptr<weld::Builder> m_xBuilder;
    VclPtr<vcl::Window> m_xVclContentArea;
    std::unique_ptr<weld::Container> m_xContainer;
    weld::Widget* m_pInitialFocusWidget;

private:
    Idle m_aPanelLayoutIdle;
@@ -40,6 +41,7 @@ public:
    virtual void dispose() override;

    virtual Size GetOptimalSize() const override;
    virtual void GetFocus() override;
    virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags = PosSizeFlags::All) override;
    virtual void queue_resize(StateChangedType eReason = StateChangedType::Layout) override;
    virtual bool EventNotify(NotifyEvent& rNEvt) override;
diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx
index 436fcff..e5adb68 100644
--- a/sc/source/ui/formdlg/dwfunctr.cxx
+++ b/sc/source/ui/formdlg/dwfunctr.cxx
@@ -70,6 +70,8 @@ ScFunctionWin::ScFunctionWin(vcl::Window* pParent, const css::uno::Reference<css
    xCatBox->set_active(0);

    SelComboHdl(*xCatBox);

    m_pInitialFocusWidget = xCatBox.get();
}

/*************************************************************************
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index 4b72476..5d3e736 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -417,6 +417,8 @@ ScNavigatorDlg::ScNavigatorDlg(SfxBindings* pB, vcl::Window* pParent)
    SetListMode(eNavMode);

    aExpandedSize = GetOptimalSize();

    m_pInitialFocusWidget = m_xEdCol.get();
}

void ScNavigatorDlg::UpdateSheetLimits()
diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
index 24396c7..702845c 100644
--- a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
+++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
@@ -73,6 +73,7 @@ AlignmentPropertyPanel::AlignmentPropertyPanel(
    , mpBindings(pBindings)
{
    Initialize();
    m_pInitialFocusWidget = &mxMFLeftIndent->get_widget();
}

AlignmentPropertyPanel::~AlignmentPropertyPanel()
diff --git a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
index 12fc841..bd7069e 100644
--- a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
+++ b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
@@ -54,6 +54,7 @@ NumberFormatPropertyPanel::NumberFormatPropertyPanel(
    , mpBindings(pBindings)
{
    Initialize();
    m_pInitialFocusWidget = mxLbCategory.get();
}

NumberFormatPropertyPanel::~NumberFormatPropertyPanel()
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index 045522b..624d70a 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -155,6 +155,7 @@ CustomAnimationPane::CustomAnimationPane( Window* pParent, ViewShellBase& rBase,
    , maLateInitTimer()
{
    initialize();
    m_pInitialFocusWidget = &mxCustomAnimationList->get_widget();
}

void CustomAnimationPane::initialize()
diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx
index 1c2c4f2..8d9023a 100644
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -86,6 +86,8 @@ SdNavigatorWin::SdNavigatorWin(vcl::Window* pParent, SfxBindings* pInBindings)
    mxLbDocs->connect_changed(LINK(this, SdNavigatorWin, SelectDocumentHdl));

    SetDragImage();

    m_pInitialFocusWidget = mxToolbox.get();
}

void SdNavigatorWin::SetUpdateRequestFunctor(const UpdateRequestFunctor& rUpdateRequest)
diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx b/sd/source/ui/sidebar/LayoutMenu.cxx
index 96a2fce..ca44ceb7 100644
--- a/sd/source/ui/sidebar/LayoutMenu.cxx
+++ b/sd/source/ui/sidebar/LayoutMenu.cxx
@@ -173,6 +173,7 @@ LayoutMenu::LayoutMenu (
#ifdef DEBUG
    SetText(OUString("sd:LayoutMenu"));
#endif
    m_pInitialFocusWidget = mxLayoutValueSet->GetDrawingArea();
}

void LayoutMenu::implConstruct( DrawDocShell& rDocumentShell )
diff --git a/sd/source/ui/sidebar/MasterPagesSelector.cxx b/sd/source/ui/sidebar/MasterPagesSelector.cxx
index bbd1e86..9d358f9 100644
--- a/sd/source/ui/sidebar/MasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx
@@ -86,6 +86,8 @@ MasterPagesSelector::MasterPagesSelector (

    Link<MasterPageContainerChangeEvent&,void> aChangeListener (LINK(this,MasterPagesSelector,ContainerChangeListener));
    mpContainer->AddChangeListener(aChangeListener);

    m_pInitialFocusWidget = mxPreviewValueSet->GetDrawingArea();
}

MasterPagesSelector::~MasterPagesSelector()
diff --git a/sd/source/ui/table/TableDesignPane.hxx b/sd/source/ui/table/TableDesignPane.hxx
index 27f2b16..d03a326 100644
--- a/sd/source/ui/table/TableDesignPane.hxx
+++ b/sd/source/ui/table/TableDesignPane.hxx
@@ -83,6 +83,12 @@ private:
    DECL_LINK(implValueSetHdl, ValueSet*, void);
    DECL_LINK(implCheckBoxHdl, weld::ToggleButton&, void);

public:
    weld::Widget* GetInitialFocusWidget()
    {
        return m_xValueSet->GetDrawingArea();
    }

private:
    ViewShellBase& mrBase;

@@ -105,6 +111,7 @@ public:
            "modules/simpress/ui/tabledesignpanel.ui", css::uno::Reference<css::frame::XFrame>())
        , m_xImpl(new TableDesignWidget(*m_xBuilder, rBase))
    {
        m_pInitialFocusWidget = m_xImpl->GetInitialFocusWidget();
    }
    virtual void dispose() override
    {
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index c76f06b..27697a4 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -369,6 +369,7 @@ SfxTemplatePanelControl::SfxTemplatePanelControl(SfxBindings* pBindings, vcl::Wi
    , pImpl(new SfxTemplateDialog_Impl(pBindings, this))
{
    OSL_ASSERT(pBindings!=nullptr);
    m_pInitialFocusWidget = pImpl->m_xActionTbL.get();
}

SfxTemplatePanelControl::~SfxTemplatePanelControl()
diff --git a/sfx2/source/sidebar/PanelLayout.cxx b/sfx2/source/sidebar/PanelLayout.cxx
index c419403..0e37e227 100644
--- a/sfx2/source/sidebar/PanelLayout.cxx
+++ b/sfx2/source/sidebar/PanelLayout.cxx
@@ -18,6 +18,7 @@ using namespace sfx2::sidebar;
PanelLayout::PanelLayout(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription,
                         const css::uno::Reference<css::frame::XFrame> &rFrame)
    : Control(pParent)
    , m_pInitialFocusWidget(nullptr)
    , m_bInClose(false)
    , mxFrame(rFrame)
{
@@ -34,6 +35,13 @@ PanelLayout::PanelLayout(vcl::Window* pParent, const OString& rID, const OUStrin
    m_xContainer = m_xBuilder->weld_container(rID);
}

void PanelLayout::GetFocus()
{
    Control::GetFocus();
    if (m_pInitialFocusWidget)
        m_pInitialFocusWidget->grab_focus();
}

PanelLayout::~PanelLayout()
{
    disposeOnce();
@@ -42,6 +50,7 @@ PanelLayout::~PanelLayout()
void PanelLayout::dispose()
{
    m_bInClose = true;
    m_pInitialFocusWidget = nullptr;
    m_aPanelLayoutIdle.Stop();
    m_xContainer.reset();
    m_xBuilder.reset();
diff --git a/svx/source/gallery2/GalleryControl.cxx b/svx/source/gallery2/GalleryControl.cxx
index a25d178..7ecbffa 100644
--- a/svx/source/gallery2/GalleryControl.cxx
+++ b/svx/source/gallery2/GalleryControl.cxx
@@ -36,6 +36,7 @@ GalleryControl::GalleryControl(vcl::Window* pParent)
    , mxBrowser2(new GalleryBrowser2(*m_xBuilder, mpGallery))
{
    mxBrowser1->SelectTheme(0);
    m_pInitialFocusWidget = mxBrowser1->GetInitialFocusWidget();
}

GalleryControl::~GalleryControl()
diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx
index 2c2d8ef..295adea 100644
--- a/svx/source/gallery2/galbrws1.cxx
+++ b/svx/source/gallery2/galbrws1.cxx
@@ -304,12 +304,17 @@ void GalleryBrowser1::ImplExecute(std::string_view rIdent)
    }
}

void GalleryBrowser1::GrabFocus()
weld::Widget* GalleryBrowser1::GetInitialFocusWidget()
{
    if (mxNewTheme->get_sensitive())
        mxNewTheme->grab_focus();
        return mxNewTheme.get();
    else
        mxThemes->grab_focus();
        return mxThemes.get();
}

void GalleryBrowser1::GrabFocus()
{
    GetInitialFocusWidget()->grab_focus();
}

void GalleryBrowser1::Notify( SfxBroadcaster&, const SfxHint& rHint )
diff --git a/svx/source/gallery2/galbrws1.hxx b/svx/source/gallery2/galbrws1.hxx
index d179972..7a51bd0 100644
--- a/svx/source/gallery2/galbrws1.hxx
+++ b/svx/source/gallery2/galbrws1.hxx
@@ -86,6 +86,7 @@ public:

    void                    SelectTheme( sal_uInt16 nThemePos ) { mxThemes->select( nThemePos ); SelectThemeHdl( *mxThemes ); }
    OUString                GetSelectedTheme() const { return mxThemes->get_selected_text(); }
    weld::Widget*           GetInitialFocusWidget();
    void                    GrabFocus();
};

diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
index 43ee78a..5e21096 100644
--- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
@@ -107,6 +107,8 @@ AreaPropertyPanelBase::AreaPropertyPanelBase(
    mpPanel = dynamic_cast<sfx2::sidebar::Panel*>(pParent);

    Initialize();

    m_pInitialFocusWidget = mxLbFillType.get();
}

AreaPropertyPanelBase::~AreaPropertyPanelBase()
diff --git a/svx/source/sidebar/effect/EffectPropertyPanel.cxx b/svx/source/sidebar/effect/EffectPropertyPanel.cxx
index 6c42942..58d027b 100644
--- a/svx/source/sidebar/effect/EffectPropertyPanel.cxx
+++ b/svx/source/sidebar/effect/EffectPropertyPanel.cxx
@@ -41,6 +41,8 @@ EffectPropertyPanel::EffectPropertyPanel(vcl::Window* pParent,
    , mxSoftEdgeRadius(m_xBuilder->weld_metric_spin_button("SB_SOFTEDGE_RADIUS", FieldUnit::POINT))
{
    Initialize();

    m_pInitialFocusWidget = &mxGlowRadius->get_widget();
}

EffectPropertyPanel::~EffectPropertyPanel() { disposeOnce(); }
diff --git a/svx/source/sidebar/inspector/InspectorTextPanel.cxx b/svx/source/sidebar/inspector/InspectorTextPanel.cxx
index 7c71369..7b07be9 100644
--- a/svx/source/sidebar/inspector/InspectorTextPanel.cxx
+++ b/svx/source/sidebar/inspector/InspectorTextPanel.cxx
@@ -58,6 +58,7 @@ InspectorTextPanel::InspectorTextPanel(vcl::Window* pParent,
    aWidths.push_back(fWidth * 34);
    aWidths.push_back(fWidth * 34);
    mpListBoxStyles->set_column_fixed_widths(aWidths);
    m_pInitialFocusWidget = mpListBoxStyles.get();
}

static bool GetPropertyValues(const OUString& rPropName, const uno::Any& rAny, OUString& rString)
diff --git a/svx/source/sidebar/lists/ListsPropertyPanel.cxx b/svx/source/sidebar/lists/ListsPropertyPanel.cxx
index 2b579b4..a28cbf7 100644
--- a/svx/source/sidebar/lists/ListsPropertyPanel.cxx
+++ b/svx/source/sidebar/lists/ListsPropertyPanel.cxx
@@ -46,6 +46,7 @@ ListsPropertyPanel::ListsPropertyPanel(vcl::Window* pParent,
    , mxTBxOutline(m_xBuilder->weld_toolbar("outline"))
    , mxOutlineDispatcher(new ToolbarUnoDispatcher(*mxTBxOutline, *m_xBuilder, rxFrame))
{
    m_pInitialFocusWidget = mxTBxNumBullet.get();
}

ListsPropertyPanel::~ListsPropertyPanel() { disposeOnce(); }
diff --git a/svx/source/sidebar/media/MediaPlaybackPanel.cxx b/svx/source/sidebar/media/MediaPlaybackPanel.cxx
index 2b2cd5d..78a56e44 100644
--- a/svx/source/sidebar/media/MediaPlaybackPanel.cxx
+++ b/svx/source/sidebar/media/MediaPlaybackPanel.cxx
@@ -46,6 +46,8 @@ MediaPlaybackPanel::MediaPlaybackPanel (
    mxZoomListBox = m_xBuilder->weld_combo_box("zoombox");

    Initialize();

    m_pInitialFocusWidget = mxTimeEdit.get();
}

VclPtr< vcl::Window > MediaPlaybackPanel::Create(
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
index b246b7f..ab97dc6 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
@@ -449,6 +449,7 @@ ParaPropertyPanel::ParaPropertyPanel(vcl::Window* pParent,

    initial();
    m_aMetricCtl.RequestUpdate();
    m_pInitialFocusWidget = mxTBxHorzAlign.get();
}

void ParaPropertyPanel::limitMetricWidths()
diff --git a/svx/source/sidebar/shapes/DefaultShapesPanel.cxx b/svx/source/sidebar/shapes/DefaultShapesPanel.cxx
index 9295d9b..3d52ae2 100644
--- a/svx/source/sidebar/shapes/DefaultShapesPanel.cxx
+++ b/svx/source/sidebar/shapes/DefaultShapesPanel.cxx
@@ -53,6 +53,8 @@ DefaultShapesPanel::DefaultShapesPanel (
    , mxFrame(rxFrame)
{
    Initialize();

    m_pInitialFocusWidget = mxLineArrowSet->GetDrawingArea();
}

VclPtr< vcl::Window > DefaultShapesPanel::Create(
diff --git a/svx/source/sidebar/styles/StylesPropertyPanel.cxx b/svx/source/sidebar/styles/StylesPropertyPanel.cxx
index 7e23e09..e976e9b 100644
--- a/svx/source/sidebar/styles/StylesPropertyPanel.cxx
+++ b/svx/source/sidebar/styles/StylesPropertyPanel.cxx
@@ -36,6 +36,7 @@ StylesPropertyPanel::StylesPropertyPanel ( vcl::Window* pParent, const css::uno:
    , m_xStyle(m_xBuilder->weld_toolbar("style"))
    , m_xStyleDispatch(new ToolbarUnoDispatcher(*m_xStyle, *m_xBuilder, rxFrame))
{
    m_pInitialFocusWidget = m_xFontStyle.get();
}

StylesPropertyPanel::~StylesPropertyPanel()
diff --git a/svx/source/sidebar/text/TextPropertyPanel.cxx b/svx/source/sidebar/text/TextPropertyPanel.cxx
index 4b5adca..ac93e6c 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.cxx
+++ b/svx/source/sidebar/text/TextPropertyPanel.cxx
@@ -70,6 +70,8 @@ TextPropertyPanel::TextPropertyPanel ( vcl::Window* pParent, const css::uno::Ref
            pViewShell && pViewShell->isLOKMobilePhone())
        isMobilePhone = true;
    mxSpacingBar->set_visible(!isMobilePhone);

    m_pInitialFocusWidget = mxFont.get();
}

TextPropertyPanel::~TextPropertyPanel()
diff --git a/sw/source/uibase/sidebar/StylePresetsPanel.cxx b/sw/source/uibase/sidebar/StylePresetsPanel.cxx
index ecb2e61b..417b079 100644
--- a/sw/source/uibase/sidebar/StylePresetsPanel.cxx
+++ b/sw/source/uibase/sidebar/StylePresetsPanel.cxx
@@ -152,6 +152,8 @@ StylePresetsPanel::StylePresetsPanel(vcl::Window* pParent,
    mxValueSet->SetDoubleClickHdl(LINK(this, StylePresetsPanel, DoubleClickHdl));

    RefreshList();

    m_pInitialFocusWidget = mxValueSet->GetDrawingArea();
}

void StylePresetsPanel::RefreshList()
diff --git a/sw/source/uibase/sidebar/TableEditPanel.cxx b/sw/source/uibase/sidebar/TableEditPanel.cxx
index 3fef04c..d1840f8 100644
--- a/sw/source/uibase/sidebar/TableEditPanel.cxx
+++ b/sw/source/uibase/sidebar/TableEditPanel.cxx
@@ -137,6 +137,8 @@ TableEditPanel::TableEditPanel(vcl::Window* pParent,

    if (comphelper::LibreOfficeKit::isActive())
        m_xMisc->set_item_visible(".uno:InsertFormula", false);

    m_pInitialFocusWidget = &m_xRowHeightEdit->get_widget();
}

TableEditPanel::~TableEditPanel() { disposeOnce(); }
diff --git a/sw/source/uibase/sidebar/ThemePanel.cxx b/sw/source/uibase/sidebar/ThemePanel.cxx
index 2ba276c..25eac48 100644
--- a/sw/source/uibase/sidebar/ThemePanel.cxx
+++ b/sw/source/uibase/sidebar/ThemePanel.cxx
@@ -447,6 +447,8 @@ ThemePanel::ThemePanel(vcl::Window* pParent,

    if (!aColorSets.empty())
        mxValueSetColors->SelectItem(1); // ItemId 1, position 0

    m_pInitialFocusWidget = mxListBoxFonts.get();
}

ThemePanel::~ThemePanel()
diff --git a/sw/source/uibase/sidebar/WrapPropertyPanel.cxx b/sw/source/uibase/sidebar/WrapPropertyPanel.cxx
index 567a5da..985bd34 100644
--- a/sw/source/uibase/sidebar/WrapPropertyPanel.cxx
+++ b/sw/source/uibase/sidebar/WrapPropertyPanel.cxx
@@ -75,6 +75,8 @@ WrapPropertyPanel::WrapPropertyPanel(
    SpacingListBox::Fill(IsInch(eMetric) ? SpacingType::SPACING_INCH : SpacingType::SPACING_CM, *mxSpacingLB);

    Initialize();

    m_pInitialFocusWidget = mxWrapOptions.get();
}

WrapPropertyPanel::~WrapPropertyPanel()
diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx
index 7c44064..662ae43 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -644,6 +644,8 @@ SwNavigationPI::SwNavigationPI(vcl::Window* pParent,
    m_xDocListBox->set_accessible_name(m_aStatusArr[3]);

    m_aExpandedSize = GetOptimalSize();

    m_pInitialFocusWidget = m_xContent1ToolBox.get();
}

SwNavigationPI::~SwNavigationPI()