summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svx/sidebar/AreaPropertyPanelBase.hxx3
-rw-r--r--include/svx/sidebar/AreaTransparencyGradientPopup.hxx20
-rw-r--r--include/svx/sidebar/Popup.hxx101
-rw-r--r--sc/Library_sc.mk2
-rw-r--r--sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx74
-rw-r--r--sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx63
-rw-r--r--sc/source/ui/sidebar/CellBorderStyleControl.cxx26
-rw-r--r--sc/source/ui/sidebar/CellBorderStyleControl.hxx12
-rw-r--r--sc/source/ui/sidebar/CellBorderStylePopup.cxx38
-rw-r--r--sc/source/ui/sidebar/CellBorderStylePopup.hxx41
-rw-r--r--sc/source/ui/sidebar/CellLineStyleControl.cxx20
-rw-r--r--sc/source/ui/sidebar/CellLineStyleControl.hxx8
-rw-r--r--sc/source/ui/sidebar/CellLineStylePopup.cxx50
-rw-r--r--sc/source/ui/sidebar/CellLineStylePopup.hxx43
-rw-r--r--svx/Library_svx.mk1
-rw-r--r--svx/inc/pch/precompiled_svx.hxx1
-rw-r--r--svx/source/sidebar/area/AreaPropertyPanelBase.cxx18
-rw-r--r--svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx25
-rw-r--r--svx/source/sidebar/tools/Popup.cxx129
-rw-r--r--sw/source/uibase/sidebar/PageFooterPanel.hxx1
-rw-r--r--sw/source/uibase/sidebar/PageFormatPanel.hxx1
-rw-r--r--sw/source/uibase/sidebar/PageHeaderPanel.hxx1
-rw-r--r--sw/source/uibase/sidebar/PagePropertyPanel.hxx1
-rw-r--r--sw/source/uibase/sidebar/PageStylesPanel.hxx1
-rw-r--r--sw/source/uibase/sidebar/StylePresetsPanel.hxx1
-rw-r--r--sw/source/uibase/sidebar/ThemePanel.hxx1
26 files changed, 131 insertions, 551 deletions
diff --git a/include/svx/sidebar/AreaPropertyPanelBase.hxx b/include/svx/sidebar/AreaPropertyPanelBase.hxx
index 7668f3bc8864..2454084e1cdd 100644
--- a/include/svx/sidebar/AreaPropertyPanelBase.hxx
+++ b/include/svx/sidebar/AreaPropertyPanelBase.hxx
@@ -152,7 +152,7 @@ protected:
Image maImgSquare;
Image maImgLinear;
- AreaTransparencyGradientPopup maTrGrPopup;
+ VclPtr<AreaTransparencyGradientPopup> mxTrGrPopup;
std::unique_ptr< XFillFloatTransparenceItem > mpFloatTransparenceItem;
std::unique_ptr< SfxUInt16Item > mpTransparanceItem;
@@ -170,7 +170,6 @@ protected:
DECL_LINK_TYPED(ClickImportBitmapHdl, Button*, void);
// for transparency gradient
- VclPtr<Control> CreateTransparencyGradientControl (PopupContainer* pParent);
DECL_LINK_TYPED( ClickTrGrHdl_Impl, ToolBox*, void );
void Initialize();
diff --git a/include/svx/sidebar/AreaTransparencyGradientPopup.hxx b/include/svx/sidebar/AreaTransparencyGradientPopup.hxx
index 31c041b3219a..519224b66786 100644
--- a/include/svx/sidebar/AreaTransparencyGradientPopup.hxx
+++ b/include/svx/sidebar/AreaTransparencyGradientPopup.hxx
@@ -19,26 +19,24 @@
#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREATRANSPARENCYGRADIENTPOPUP_HXX
#define INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREATRANSPARENCYGRADIENTPOPUP_HXX
-#include "svx/sidebar/Popup.hxx"
-
-#include <functional>
-
+#include <vcl/floatwin.hxx>
class XFillFloatTransparenceItem;
-
namespace svx { namespace sidebar {
-class AreaTransparencyGradientPopup
- : public Popup
+class AreaTransparencyGradientControl;
+class AreaPropertyPanelBase;
+
+class AreaTransparencyGradientPopup : public FloatingWindow
{
+private:
+ VclPtr<AreaTransparencyGradientControl> m_xControl;
public:
- AreaTransparencyGradientPopup (
- vcl::Window* pParent,
- ::std::function<Control*(PopupContainer*)> const& rControlCreator);
+ AreaTransparencyGradientPopup(vcl::Window* pParent, AreaPropertyPanelBase& rPanel);
virtual ~AreaTransparencyGradientPopup() override;
-
void Rearrange (XFillFloatTransparenceItem* pItem);
+ virtual void dispose() override;
};
} } // end of namespace svx::sidebar
diff --git a/include/svx/sidebar/Popup.hxx b/include/svx/sidebar/Popup.hxx
deleted file mode 100644
index 0e0bccf7117e..000000000000
--- a/include/svx/sidebar/Popup.hxx
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef INCLUDED_SVX_SIDEBAR_POPUP_HXX
-#define INCLUDED_SVX_SIDEBAR_POPUP_HXX
-
-#include <svx/svxdllapi.h>
-#include <rtl/ustring.hxx>
-#include <tools/link.hxx>
-#include <vcl/vclptr.hxx>
-#include <svx/sidebar/PopupContainer.hxx>
-
-#include <functional>
-
-namespace vcl { class Window; }
-class ToolBox;
-
-namespace svx { namespace sidebar {
-
-/** A wrapper around a PopupContainer and a Control object.
- Usually used as drop down for a toolbox. Use Show() to start
- drop down mode and Hide() to end it.
-*/
-class SVX_DLLPUBLIC Popup
-{
-public:
- /** Create a Popup wrapper object.
- @param pParent
- Parent window of the PopupContainer, which in turn is the
- parent of the Control.
- @param rControlCreator
- A functor that is called to create the Control object
- (usually an instance of a class derived from
- Control).
- */
- Popup (
- vcl::Window* pParent,
- const ::std::function<Control*(PopupContainer*)>& rControlCreator,
- const ::rtl::OUString& rsAccessibleName);
- virtual ~Popup();
-
- /** Show the popup.
- @rToolBox
- The tool box is used to determine the position at which
- the popup is displayed.
- */
- void Show (ToolBox& rToolBox);
-
- /** Hide the popup.
- This method is called automatically when eg. the user clicks
- outside the popup or when the ESC-key is pressed. The
- application can call Hide() when the popup should be closed
- for other, non-standard reasons.
- */
- void Hide();
-
- void dispose();
-
-protected:
- VclPtr<Control> mxControl;
-
- /** Make sure that both PopupContainer and Control objects
- exist. Calls the maControlCreator functor if necessary.
- */
- void ProvideContainerAndControl();
-
- /** A derived specialisation class can override this method to do
- additional work.
- */
- void CreateContainerAndControl();
-
-private:
- VclPtr<vcl::Window> mpParent;
- ::std::function<VclPtr<Control>(PopupContainer*)> maControlCreator;
- ::std::function<void()> maPopupModeEndCallback;
- const ::rtl::OUString msAccessibleName;
- VclPtr<PopupContainer> mxContainer;
-
- DECL_LINK_TYPED(PopupModeEndHandler, FloatingWindow*, void);
-};
-
-} } // end of namespace svx::sidebar
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index bf75fb1ea369..27326ae7e8a9 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -497,12 +497,10 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
sc/source/ui/pagedlg/tphfedit \
sc/source/ui/sidebar/AlignmentPropertyPanel \
sc/source/ui/sidebar/CellLineStyleControl \
- sc/source/ui/sidebar/CellLineStylePopup \
sc/source/ui/sidebar/CellLineStyleValueSet \
sc/source/ui/sidebar/CellBorderUpdater \
sc/source/ui/sidebar/CellAppearancePropertyPanel \
sc/source/ui/sidebar/CellBorderStyleControl \
- sc/source/ui/sidebar/CellBorderStylePopup \
sc/source/ui/sidebar/NumberFormatControl \
sc/source/ui/sidebar/NumberFormatPropertyPanel \
sc/source/ui/sidebar/ScPanelFactory \
diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
index 3cc6e4f47701..74fdafdba32a 100644
--- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
+++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
@@ -35,10 +35,8 @@
#include <vcl/settings.hxx>
#include <svx/sidebar/PopupContainer.hxx>
#include "CellLineStyleControl.hxx"
-#include "CellLineStylePopup.hxx"
#include "CellBorderUpdater.hxx"
#include "CellBorderStyleControl.hxx"
-#include "CellBorderStylePopup.hxx"
using namespace css;
using namespace css::uno;
@@ -50,32 +48,6 @@ const char UNO_LINESTYLE[] = ".uno:LineStyle";
namespace sc { namespace sidebar {
-Control* CellAppearancePropertyPanel::CreateCellLineStylePopupControl(svx::sidebar::PopupContainer* pParent)
-{
- return VclPtr<CellLineStyleControl>::Create(pParent, *this);
-}
-
-void CellAppearancePropertyPanel::EndCellLineStylePopupMode()
-{
- if(mpCellLineStylePopup.get())
- {
- mpCellLineStylePopup->Hide();
- }
-}
-
-Control* CellAppearancePropertyPanel::CreateCellBorderStylePopupControl(svx::sidebar::PopupContainer* pParent)
-{
- return VclPtr<CellBorderStyleControl>::Create(pParent, *this);
-}
-
-void CellAppearancePropertyPanel::EndCellBorderStylePopupMode()
-{
- if(mpCellBorderStylePopup.get())
- {
- mpCellBorderStylePopup->Hide();
- }
-}
-
CellAppearancePropertyPanel::CellAppearancePropertyPanel(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
@@ -121,8 +93,8 @@ CellAppearancePropertyPanel::CellAppearancePropertyPanel(
mbTLBR(false),
mbBLTR(false),
- mpCellLineStylePopup(),
- mpCellBorderStylePopup(),
+ mxCellLineStylePopup(),
+ mxCellBorderStylePopup(),
maContext(),
mpBindings(pBindings)
@@ -148,6 +120,8 @@ void CellAppearancePropertyPanel::dispose()
mpTBLineStyle.clear();
mpTBLineColor.clear();
+ mxCellBorderStylePopup.disposeAndClear();
+ mxCellLineStylePopup.disposeAndClear();
maLineStyleControl.dispose();
maBorderOuterControl.dispose();
maBorderInnerControl.dispose();
@@ -182,21 +156,12 @@ IMPL_LINK_TYPED(CellAppearancePropertyPanel, TbxCellBorderSelectHdl, ToolBox*, p
{
const OUString aCommand(pToolBox->GetItemCommand(pToolBox->GetCurItemId()));
- if(aCommand == UNO_SETBORDERSTYLE)
+ if (aCommand == UNO_SETBORDERSTYLE)
{
- // create popup on demand
- if(!mpCellBorderStylePopup.get())
- {
- mpCellBorderStylePopup.reset(
- new CellBorderStylePopup(
- this,
- [this] (svx::sidebar::PopupContainer* pParent) { return this->CreateCellBorderStylePopupControl(pParent); } ));
- }
-
- if(mpCellBorderStylePopup.get())
- {
- mpCellBorderStylePopup->Show(*pToolBox);
- }
+ if (!mxCellBorderStylePopup)
+ mxCellBorderStylePopup = VclPtr<CellBorderStylePopup>::Create(pToolBox, GetBindings()->GetDispatcher());
+ mxCellBorderStylePopup->StartPopupMode(pToolBox, FloatWinPopupFlags::Down |
+ FloatWinPopupFlags::NoAppFocusClose);
}
}
@@ -204,22 +169,13 @@ IMPL_LINK_TYPED(CellAppearancePropertyPanel, TbxLineStyleSelectHdl, ToolBox*, pT
{
const OUString aCommand(pToolBox->GetItemCommand(pToolBox->GetCurItemId()));
- if(aCommand == UNO_LINESTYLE)
+ if (aCommand == UNO_LINESTYLE)
{
- // create popup on demand
- if(!mpCellLineStylePopup.get())
- {
- mpCellLineStylePopup.reset(
- new CellLineStylePopup(
- this,
- [this] (svx::sidebar::PopupContainer* pParent) { return this->CreateCellLineStylePopupControl(pParent); } ));
- }
-
- if(mpCellLineStylePopup.get())
- {
- mpCellLineStylePopup->SetLineStyleSelect(mnOut, mnIn, mnDis);
- mpCellLineStylePopup->Show(*pToolBox);
- }
+ if (!mxCellLineStylePopup)
+ mxCellLineStylePopup = VclPtr<CellLineStylePopup>::Create(pToolBox, GetBindings()->GetDispatcher());
+ mxCellLineStylePopup->SetLineStyleSelect(mnOut, mnIn, mnDis);
+ mxCellLineStylePopup->StartPopupMode(pToolBox, FloatWinPopupFlags::Down |
+ FloatWinPopupFlags::NoAppFocusClose);
}
}
diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
index 1e6dfcf5229f..a6cfcb0ae66b 100644
--- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
+++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
@@ -22,6 +22,9 @@
#include <sfx2/sidebar/ControllerItem.hxx>
#include <sfx2/sidebar/IContextChangeReceiver.hxx>
#include <svx/sidebar/PanelLayout.hxx>
+#include <vcl/floatwin.hxx>
+#include "CellBorderStyleControl.hxx"
+#include "CellLineStyleControl.hxx"
#include <memory>
class FixedText;
@@ -29,8 +32,6 @@ namespace svx { namespace sidebar {
class PopupContainer;
}}
namespace sc { namespace sidebar {
- class CellLineStylePopup;
- class CellBorderStylePopup;
class CellLineStyleControl;
class CellBorderUpdater;
}}
@@ -39,6 +40,52 @@ class CheckBox;
namespace sc { namespace sidebar {
+class CellBorderStylePopup : public FloatingWindow
+{
+ VclPtr<Control> m_xControl;
+public:
+ CellBorderStylePopup(vcl::Window* pParent, SfxDispatcher* pDispatcher)
+ : FloatingWindow(pParent, WB_BORDER | WB_SYSTEMWINDOW)
+ , m_xControl(VclPtr<CellBorderStyleControl>::Create(this, pDispatcher))
+ {
+ SetSizePixel(m_xControl->GetOutputSizePixel());
+ }
+ virtual ~CellBorderStylePopup() override
+ {
+ disposeOnce();
+ }
+ virtual void dispose() override
+ {
+ m_xControl.disposeAndClear();
+ FloatingWindow::dispose();
+ }
+};
+
+class CellLineStylePopup : public FloatingWindow
+{
+ VclPtr<CellLineStyleControl> m_xControl;
+public:
+ CellLineStylePopup(vcl::Window* pParent, SfxDispatcher* pDispatcher)
+ : FloatingWindow(pParent, WB_BORDER | WB_SYSTEMWINDOW)
+ , m_xControl(VclPtr<CellLineStyleControl>::Create(this, pDispatcher))
+ {
+ SetSizePixel(m_xControl->GetOutputSizePixel());
+ }
+ void SetLineStyleSelect(sal_uInt16 out, sal_uInt16 in, sal_uInt16 dis)
+ {
+ m_xControl->SetLineStyleSelect(out, in, dis);
+ }
+ virtual ~CellLineStylePopup() override
+ {
+ disposeOnce();
+ }
+ virtual void dispose() override
+ {
+ m_xControl.disposeAndClear();
+ FloatingWindow::dispose();
+ }
+};
+
class CellAppearancePropertyPanel
: public PanelLayout,
public ::sfx2::sidebar::IContextChangeReceiver,
@@ -131,8 +178,8 @@ private:
bool mbBLTR : 1;
// popups
- std::unique_ptr< CellLineStylePopup > mpCellLineStylePopup;
- std::unique_ptr< CellBorderStylePopup > mpCellBorderStylePopup;
+ VclPtr<CellLineStylePopup> mxCellLineStylePopup;
+ VclPtr<CellBorderStylePopup> mxCellBorderStylePopup;
vcl::EnumContext maContext;
SfxBindings* mpBindings;
@@ -140,14 +187,6 @@ private:
DECL_LINK_TYPED(TbxCellBorderSelectHdl, ToolBox*, void);
DECL_LINK_TYPED(TbxLineStyleSelectHdl, ToolBox*, void);
- // for CellLineStyle popup
- Control* CreateCellLineStylePopupControl(svx::sidebar::PopupContainer* pParent);
- void EndCellLineStylePopupMode();
-
- // for CellBorderStyle popup
- Control* CreateCellBorderStylePopupControl(svx::sidebar::PopupContainer* pParent);
- void EndCellBorderStylePopupMode();
-
void Initialize();
void SetStyleIcon();
void UpdateControlState();
diff --git a/sc/source/ui/sidebar/CellBorderStyleControl.cxx b/sc/source/ui/sidebar/CellBorderStyleControl.cxx
index 47a60cc15d51..1c505d957fea 100644
--- a/sc/source/ui/sidebar/CellBorderStyleControl.cxx
+++ b/sc/source/ui/sidebar/CellBorderStyleControl.cxx
@@ -42,9 +42,10 @@ namespace sc { namespace sidebar {
#define FRM_VALID_OUTER 0x0f
#define FRM_VALID_ALL 0xff
-CellBorderStyleControl::CellBorderStyleControl(vcl::Window* pParent, CellAppearancePropertyPanel& rPanel)
+CellBorderStyleControl::CellBorderStyleControl(FloatingWindow* pParent, SfxDispatcher* pDispatcher)
: Control(pParent, ScResId(RID_POPUPPANEL_APPEARANCE_CELL_BORDERSTYLE)),
- mrCellAppearancePropertyPanel(rPanel),
+ mpDispatcher(pDispatcher),
+ mxFloatParent(pParent),
maTBBorder1(VclPtr<ToolBox>::Create(this, ScResId(TB_BORDER1))),
maTBBorder2(VclPtr<ToolBox>::Create(this, ScResId(TB_BORDER2))),
maTBBorder3(VclPtr<ToolBox>::Create(this, ScResId(TB_BORDER3))),
@@ -69,6 +70,7 @@ void CellBorderStyleControl::dispose()
maTBBorder3.disposeAndClear();
maFL1.disposeAndClear();
maFL2.disposeAndClear();
+ mxFloatParent.clear();
Control::dispose();
}
@@ -162,9 +164,9 @@ IMPL_LINK_TYPED(CellBorderStyleControl, TB1SelectHdl, ToolBox*, pToolBox, void)
SvxLineItem aLineItem2( SID_ATTR_BORDER_DIAG_TLBR );
aLineItem1.SetLine( nullptr ); //modify
aLineItem2.SetLine( nullptr ); //modify
- mrCellAppearancePropertyPanel.GetBindings()->GetDispatcher()->ExecuteList(
+ mpDispatcher->ExecuteList(
SID_ATTR_BORDER_DIAG_BLTR, SfxCallMode::RECORD, { &aLineItem1 });
- mrCellAppearancePropertyPanel.GetBindings()->GetDispatcher()->ExecuteList(
+ mpDispatcher->ExecuteList(
SID_ATTR_BORDER_DIAG_TLBR, SfxCallMode::RECORD, { &aLineItem2 });
}
break;
@@ -199,9 +201,9 @@ IMPL_LINK_TYPED(CellBorderStyleControl, TB1SelectHdl, ToolBox*, pToolBox, void)
aBorderInner.SetValid( SvxBoxInfoItemValidFlags::DISTANCE );
aBorderInner.SetValid( SvxBoxInfoItemValidFlags::DISABLE, false );
- mrCellAppearancePropertyPanel.GetBindings()->GetDispatcher()->ExecuteList(
+ mpDispatcher->ExecuteList(
SID_ATTR_BORDER, SfxCallMode::RECORD, { &aBorderOuter, &aBorderInner });
- mrCellAppearancePropertyPanel.EndCellBorderStylePopupMode();
+ mxFloatParent->EndPopupMode();
}
IMPL_LINK_TYPED(CellBorderStyleControl, TB2SelectHdl, ToolBox *, pToolBox, void)
@@ -268,7 +270,7 @@ IMPL_LINK_TYPED(CellBorderStyleControl, TB2SelectHdl, ToolBox *, pToolBox, void)
aBorderInner.SetValid( SvxBoxInfoItemValidFlags::DISTANCE );
aBorderInner.SetValid( SvxBoxInfoItemValidFlags::DISABLE, false );
- mrCellAppearancePropertyPanel.GetBindings()->GetDispatcher()->ExecuteList(
+ mpDispatcher->ExecuteList(
SID_ATTR_BORDER, SfxCallMode::RECORD, { &aBorderOuter, &aBorderInner});
}
else if(nId == TBI_BORDER2_BLTR)
@@ -276,7 +278,7 @@ IMPL_LINK_TYPED(CellBorderStyleControl, TB2SelectHdl, ToolBox *, pToolBox, void)
editeng::SvxBorderLine aTmp( nullptr, 1 );
SvxLineItem aLineItem( SID_ATTR_BORDER_DIAG_BLTR );
aLineItem.SetLine( &aTmp );
- mrCellAppearancePropertyPanel.GetBindings()->GetDispatcher()->ExecuteList(
+ mpDispatcher->ExecuteList(
SID_ATTR_BORDER_DIAG_BLTR, SfxCallMode::RECORD, { &aLineItem });
}
else if(nId == TBI_BORDER2_TLBR)
@@ -284,11 +286,11 @@ IMPL_LINK_TYPED(CellBorderStyleControl, TB2SelectHdl, ToolBox *, pToolBox, void)
editeng::SvxBorderLine aTmp( nullptr, 1 );
SvxLineItem aLineItem( SID_ATTR_BORDER_DIAG_TLBR );
aLineItem.SetLine( &aTmp );
- mrCellAppearancePropertyPanel.GetBindings()->GetDispatcher()->ExecuteList(
+ mpDispatcher->ExecuteList(
SID_ATTR_BORDER_DIAG_TLBR, SfxCallMode::RECORD, { &aLineItem });
}
- mrCellAppearancePropertyPanel.EndCellBorderStylePopupMode();
+ mxFloatParent->EndPopupMode();
}
IMPL_LINK_TYPED(CellBorderStyleControl, TB3SelectHdl, ToolBox *, pToolBox, void)
@@ -342,13 +344,13 @@ IMPL_LINK_TYPED(CellBorderStyleControl, TB3SelectHdl, ToolBox *, pToolBox, void)
aBorderInner.SetValid( SvxBoxInfoItemValidFlags::DISTANCE );
aBorderInner.SetValid( SvxBoxInfoItemValidFlags::DISABLE, false );
- mrCellAppearancePropertyPanel.GetBindings()->GetDispatcher()->ExecuteList(
+ mpDispatcher->ExecuteList(
SID_ATTR_BORDER, SfxCallMode::RECORD, { &aBorderOuter, &aBorderInner });
pTop.reset();
pBottom.reset();
- mrCellAppearancePropertyPanel.EndCellBorderStylePopupMode();
+ mxFloatParent->EndPopupMode();
}
} } // end of namespace svx::sidebar
diff --git a/sc/source/ui/sidebar/CellBorderStyleControl.hxx b/sc/source/ui/sidebar/CellBorderStyleControl.hxx
index 38c2710ec2cc..bc37be4880e2 100644
--- a/sc/source/ui/sidebar/CellBorderStyleControl.hxx
+++ b/sc/source/ui/sidebar/CellBorderStyleControl.hxx
@@ -20,17 +20,19 @@
#define INCLUDED_SC_SOURCE_UI_SIDEBAR_CELLBORDERSTYLECONTROL_HXX
#include <vcl/button.hxx>
-#include <vcl/toolbox.hxx>
#include <vcl/fixed.hxx>
+#include <vcl/floatwin.hxx>
+#include <vcl/toolbox.hxx>
-namespace sc { namespace sidebar {
+class SfxDispatcher;
-class CellAppearancePropertyPanel;
+namespace sc { namespace sidebar {
class CellBorderStyleControl : public Control
{
private:
- CellAppearancePropertyPanel& mrCellAppearancePropertyPanel;
+ SfxDispatcher* mpDispatcher;
+ VclPtr<FloatingWindow> mxFloatParent;
VclPtr<ToolBox> maTBBorder1;
VclPtr<ToolBox> maTBBorder2;
VclPtr<ToolBox> maTBBorder3;
@@ -45,7 +47,7 @@ private:
DECL_LINK_TYPED(TB3SelectHdl, ToolBox *, void);
public:
- CellBorderStyleControl(vcl::Window* pParent, CellAppearancePropertyPanel& rPanel);
+ CellBorderStyleControl(FloatingWindow* pParent, SfxDispatcher* pDispatcher);
virtual ~CellBorderStyleControl() override;
virtual void dispose() override;
};
diff --git a/sc/source/ui/sidebar/CellBorderStylePopup.cxx b/sc/source/ui/sidebar/CellBorderStylePopup.cxx
deleted file mode 100644
index 7b5e8712febd..000000000000
--- a/sc/source/ui/sidebar/CellBorderStylePopup.cxx
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "CellBorderStylePopup.hxx"
-#include "CellLineStyleControl.hxx"
-
-namespace sc { namespace sidebar {
-
-CellBorderStylePopup::CellBorderStylePopup (
- vcl::Window* pParent,
- const ::std::function<Control* (svx::sidebar::PopupContainer*)>& rControlCreator)
-: Popup(pParent, rControlCreator, ::OUString("CellBorderStyle"))
-{
-}
-
-CellBorderStylePopup::~CellBorderStylePopup()
-{
-}
-
-} } // end of namespace sc::sidebar
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/sidebar/CellBorderStylePopup.hxx b/sc/source/ui/sidebar/CellBorderStylePopup.hxx
deleted file mode 100644
index 17909b7ea373..000000000000
--- a/sc/source/ui/sidebar/CellBorderStylePopup.hxx
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef INCLUDED_SC_SOURCE_UI_SIDEBAR_CELLBORDERSTYLEPOPUP_HXX
-#define INCLUDED_SC_SOURCE_UI_SIDEBAR_CELLBORDERSTYLEPOPUP_HXX
-
-#include <svx/sidebar/Popup.hxx>
-
-#include <functional>
-
-namespace sc { namespace sidebar {
-
-class CellBorderStylePopup : public svx::sidebar::Popup
-{
-public:
- CellBorderStylePopup(
- vcl::Window* pParent,
- const ::std::function<Control*(svx::sidebar::PopupContainer*)>& rControlCreator);
- virtual ~CellBorderStylePopup() override;
-};
-
-} } // end of namespace sc::sidebar
-
-#endif // INCLUDED_SC_SOURCE_UI_SIDEBAR_CELLBORDERSTYLEPOPUP_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/sidebar/CellLineStyleControl.cxx b/sc/source/ui/sidebar/CellLineStyleControl.cxx
index d383adee797b..6de614d9c736 100644
--- a/sc/source/ui/sidebar/CellLineStyleControl.cxx
+++ b/sc/source/ui/sidebar/CellLineStyleControl.cxx
@@ -33,9 +33,10 @@
namespace sc { namespace sidebar {
-CellLineStyleControl::CellLineStyleControl(vcl::Window* pParent, CellAppearancePropertyPanel& rPanel)
+CellLineStyleControl::CellLineStyleControl(FloatingWindow* pParent, SfxDispatcher* pDispatcher)
: Control(pParent, ScResId(RID_POPUPPANEL_APPEARANCE_CELL_LINESTYLE)),
- mrCellAppearancePropertyPanel(rPanel),
+ mpDispatcher(pDispatcher),
+ mxFloatParent(pParent),
maPushButtonMoreOptions(VclPtr<PushButton>::Create(this, ScResId(PB_OPTIONS))),
maCellLineStyleValueSet(VclPtr<sc::sidebar::CellLineStyleValueSet>::Create(this, ScResId(VS_STYLE))),
mbVSfocus(true)
@@ -53,6 +54,7 @@ void CellLineStyleControl::dispose()
{
maPushButtonMoreOptions.disposeAndClear();
maCellLineStyleValueSet.disposeAndClear();
+ mxFloatParent.clear();
Control::dispose();
}
@@ -176,23 +178,19 @@ IMPL_LINK_TYPED(CellLineStyleControl, VSSelectHdl, ValueSet*, pControl, void)
editeng::SvxBorderLine aTmp;
aTmp.GuessLinesWidths(nStyle, n1, n2, n3);
aLineItem.SetLine( &aTmp );
- mrCellAppearancePropertyPanel.GetBindings()->GetDispatcher()->ExecuteList(
+ mpDispatcher->ExecuteList(
SID_FRAME_LINESTYLE, SfxCallMode::RECORD, { &aLineItem });
SetAllNoSel();
- mrCellAppearancePropertyPanel.EndCellLineStylePopupMode();
+ mxFloatParent->EndPopupMode();
}
}
IMPL_LINK_TYPED(CellLineStyleControl, PBClickHdl, Button *, pPBtn, void)
{
- if(pPBtn == maPushButtonMoreOptions.get())
+ if (pPBtn == maPushButtonMoreOptions.get())
{
- if(mrCellAppearancePropertyPanel.GetBindings())
- {
- mrCellAppearancePropertyPanel.GetBindings()->GetDispatcher()->Execute(SID_CELL_FORMAT_BORDER, SfxCallMode::ASYNCHRON);
- }
-
- mrCellAppearancePropertyPanel.EndCellLineStylePopupMode();
+ mpDispatcher->Execute(SID_CELL_FORMAT_BORDER, SfxCallMode::ASYNCHRON);
+ mxFloatParent->EndPopupMode();
}
}
diff --git a/sc/source/ui/sidebar/CellLineStyleControl.hxx b/sc/source/ui/sidebar/CellLineStyleControl.hxx
index 9e98e686a558..bad5780810a7 100644
--- a/sc/source/ui/sidebar/CellLineStyleControl.hxx
+++ b/sc/source/ui/sidebar/CellLineStyleControl.hxx
@@ -22,14 +22,16 @@
#include <vcl/button.hxx>
#include "CellLineStyleValueSet.hxx"
+class SfxDispatcher;
+
namespace sc { namespace sidebar {
class CellAppearancePropertyPanel;
-
class CellLineStyleControl : public Control
{
private:
- CellAppearancePropertyPanel& mrCellAppearancePropertyPanel;
+ SfxDispatcher* mpDispatcher;
+ VclPtr<FloatingWindow> mxFloatParent;
VclPtr<PushButton> maPushButtonMoreOptions;
VclPtr<CellLineStyleValueSet> maCellLineStyleValueSet;
OUString maStr[CELL_LINE_STYLE_ENTRIES];
@@ -43,7 +45,7 @@ private:
DECL_LINK_TYPED(PBClickHdl, Button*, void);
public:
- CellLineStyleControl(vcl::Window* pParent, CellAppearancePropertyPanel& rPanel);
+ CellLineStyleControl(FloatingWindow* pParent, SfxDispatcher* pDispatcher);
virtual ~CellLineStyleControl() override;
virtual void dispose() override;
diff --git a/sc/source/ui/sidebar/CellLineStylePopup.cxx b/sc/source/ui/sidebar/CellLineStylePopup.cxx
deleted file mode 100644
index 363029bf1037..000000000000
--- a/sc/source/ui/sidebar/CellLineStylePopup.cxx
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "CellLineStylePopup.hxx"
-#include "CellLineStyleControl.hxx"
-
-namespace sc { namespace sidebar {
-
-CellLineStylePopup::CellLineStylePopup (
- vcl::Window* pParent,
- const ::std::function<Control* (svx::sidebar::PopupContainer*)>& rControlCreator)
-: Popup(pParent, rControlCreator, OUString("CellLineStyle"))
-{
-}
-
-CellLineStylePopup::~CellLineStylePopup()
-{
-}
-
-void CellLineStylePopup::SetLineStyleSelect(sal_uInt16 out, sal_uInt16 in, sal_uInt16 dis)
-{
- ProvideContainerAndControl();
-
- CellLineStyleControl* pControl = dynamic_cast< CellLineStyleControl* >(mxControl.get());
-
- if(pControl)
- {
- pControl->SetLineStyleSelect(out, in, dis);
- }
-}
-
-} } // end of namespace sc::sidebar
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/sidebar/CellLineStylePopup.hxx b/sc/source/ui/sidebar/CellLineStylePopup.hxx
deleted file mode 100644
index d72128c29462..000000000000
--- a/sc/source/ui/sidebar/CellLineStylePopup.hxx
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef INCLUDED_SC_SOURCE_UI_SIDEBAR_CELLLINESTYLEPOPUP_HXX
-#define INCLUDED_SC_SOURCE_UI_SIDEBAR_CELLLINESTYLEPOPUP_HXX
-
-#include <svx/sidebar/Popup.hxx>
-
-#include <functional>
-
-namespace sc { namespace sidebar {
-
-class CellLineStylePopup : public svx::sidebar::Popup
-{
-public:
- CellLineStylePopup(
- vcl::Window* pParent,
- const ::std::function<Control* (svx::sidebar::PopupContainer*)>& rControlCreator);
- virtual ~CellLineStylePopup() override;
-
- void SetLineStyleSelect(sal_uInt16 out, sal_uInt16 in, sal_uInt16 dis);
-};
-
-} } // end of namespace sc::sidebar
-
-#endif // INCLUDED_SC_SOURCE_UI_SIDEBAR_CELLLINESTYLEPOPUP_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk
index f5af93df8c49..8ff123242783 100644
--- a/svx/Library_svx.mk
+++ b/svx/Library_svx.mk
@@ -207,7 +207,6 @@ $(eval $(call gb_Library_add_exception_objects,svx,\
svx/source/sidebar/shapes/DefaultShapesPanel \
svx/source/sidebar/shapes/ShapesUtil \
svx/source/sidebar/tools/PopupContainer \
- svx/source/sidebar/tools/Popup \
svx/source/sidebar/tools/ValueSetWithTextControl \
svx/source/stbctrls/pszctrl \
svx/source/stbctrls/insctrl \
diff --git a/svx/inc/pch/precompiled_svx.hxx b/svx/inc/pch/precompiled_svx.hxx
index 0d729d84fc4b..b2ed4cccf93f 100644
--- a/svx/inc/pch/precompiled_svx.hxx
+++ b/svx/inc/pch/precompiled_svx.hxx
@@ -437,7 +437,6 @@
#include <svx/sdasitm.hxx>
#include <svx/sdrpaintwindow.hxx>
#include <svx/sidebar/LinePropertyPanelBase.hxx>
-#include <svx/sidebar/Popup.hxx>
#include <svx/sidebar/PopupContainer.hxx>
#include <svx/srchdlg.hxx>
#include <svx/svddef.hxx>
diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
index d9ef7c235332..6cb5b08c2254 100644
--- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
@@ -95,7 +95,6 @@ AreaPropertyPanelBase::AreaPropertyPanelBase(
maImgRadial(SVX_RES(IMG_RADIAL)),
maImgSquare(SVX_RES(IMG_SQUARE)),
maImgLinear(SVX_RES(IMG_LINEAR)),
- maTrGrPopup(this, [this] (PopupContainer *const pContainer) { return this->CreateTransparencyGradientControl(pContainer); }),
mpFloatTransparenceItem(),
mpTransparanceItem(),
mxFrame(rxFrame),
@@ -126,6 +125,7 @@ AreaPropertyPanelBase::~AreaPropertyPanelBase()
void AreaPropertyPanelBase::dispose()
{
+ mxTrGrPopup.disposeAndClear();
mpColorTextFT.clear();
mpLbFillType.clear();
mpLbFillAttr.clear();
@@ -495,11 +495,6 @@ IMPL_LINK_NOARG_TYPED(AreaPropertyPanelBase, ChangeGradientAngle, Edit&, void)
SelectFillAttrHdl_Impl();
}
-VclPtr<Control> AreaPropertyPanelBase::CreateTransparencyGradientControl (PopupContainer* pParent)
-{
- return VclPtrInstance<AreaTransparencyGradientControl>(pParent, *this);
-}
-
void AreaPropertyPanelBase::DataChanged(
const DataChangedEvent& /*rEvent*/)
{
@@ -675,9 +670,9 @@ void AreaPropertyPanelBase::ImpUpdateTransparencies()
SetTransparency(nValue);
}
- if(!bZeroValue)
+ if (!bZeroValue && mxTrGrPopup)
{
- maTrGrPopup.Hide();
+ mxTrGrPopup->EndPopupMode();
}
}
@@ -1327,9 +1322,12 @@ IMPL_LINK_NOARG_TYPED(AreaPropertyPanelBase, ModifyTransSliderHdl, Slider*, void
IMPL_LINK_TYPED( AreaPropertyPanelBase, ClickTrGrHdl_Impl, ToolBox*, pToolBox, void )
{
- maTrGrPopup.Rearrange(mpFloatTransparenceItem.get());
+ if (!mxTrGrPopup)
+ mxTrGrPopup = VclPtr<AreaTransparencyGradientPopup>::Create(pToolBox, *this);
+ mxTrGrPopup->Rearrange(mpFloatTransparenceItem.get());
OSL_ASSERT( pToolBox->GetItemCommand(pToolBox->GetCurItemId()) == UNO_SIDEBARGRADIENT);
- maTrGrPopup.Show(*pToolBox);
+ mxTrGrPopup->StartPopupMode(pToolBox, FloatWinPopupFlags::Down |
+ FloatWinPopupFlags::NoAppFocusClose);
}
IMPL_LINK_NOARG_TYPED(AreaPropertyPanelBase, ChangeTrgrTypeHdl_Impl, ListBox&, void)
diff --git a/svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx b/svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx
index 5dfe37c63362..0e646833711d 100644
--- a/svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx
+++ b/svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx
@@ -21,29 +21,28 @@
namespace svx { namespace sidebar {
-AreaTransparencyGradientPopup::AreaTransparencyGradientPopup (
- vcl::Window* pParent,
- const ::std::function<Control* (PopupContainer*)>& rControlCreator)
- : Popup(
- pParent,
- rControlCreator,
- OUString( "Transparency and Gradient"))
+AreaTransparencyGradientPopup::AreaTransparencyGradientPopup(vcl::Window* pParent, AreaPropertyPanelBase& rPanel)
+ : FloatingWindow(pParent, WB_BORDER | WB_SYSTEMWINDOW)
+ , m_xControl(VclPtr<AreaTransparencyGradientControl>::Create(this, rPanel))
{
}
AreaTransparencyGradientPopup::~AreaTransparencyGradientPopup()
{
+ disposeOnce();
}
-void AreaTransparencyGradientPopup::Rearrange (XFillFloatTransparenceItem* pItem)
+void AreaTransparencyGradientPopup::Rearrange(XFillFloatTransparenceItem* pItem)
{
- ProvideContainerAndControl();
-
- AreaTransparencyGradientControl* pControl = dynamic_cast<AreaTransparencyGradientControl*>(mxControl.get());
- if (pControl != nullptr)
- pControl->Rearrange(pItem);
+ m_xControl->Rearrange(pItem);
+ SetSizePixel(m_xControl->GetOutputSizePixel());
}
+void AreaTransparencyGradientPopup::dispose()
+{
+ m_xControl.disposeAndClear();
+ FloatingWindow::dispose();
+}
} } // end of namespace svx::sidebar
diff --git a/svx/source/sidebar/tools/Popup.cxx b/svx/source/sidebar/tools/Popup.cxx
deleted file mode 100644
index ffd1bf5e7404..000000000000
--- a/svx/source/sidebar/tools/Popup.cxx
+++ /dev/null
@@ -1,129 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#include "svx/sidebar/Popup.hxx"
-#include "svx/sidebar/PopupContainer.hxx"
-
-#include <vcl/toolbox.hxx>
-
-
-namespace svx { namespace sidebar {
-
-Popup::Popup (
- vcl::Window* pParent,
- const ::std::function<Control* (PopupContainer*)>& rControlCreator,
- const ::rtl::OUString& rsAccessibleName)
- : mxControl(),
- mpParent(pParent),
- maControlCreator(rControlCreator),
- maPopupModeEndCallback(),
- msAccessibleName(rsAccessibleName),
- mxContainer()
-{
- OSL_ASSERT(mpParent!=nullptr);
- OSL_ASSERT(maControlCreator);
-}
-
-void Popup::dispose()
-{
- mxControl.disposeAndClear();
- mxContainer.disposeAndClear();
- mpParent.clear();
-}
-
-Popup::~Popup()
-{
- dispose();
-}
-
-void Popup::Show (ToolBox& rToolBox)
-{
- rToolBox.SetItemDown(rToolBox.GetCurItemId(), true);
-
- ProvideContainerAndControl();
- if ( ! (mxContainer && mxControl))
- {
- OSL_ASSERT(mxContainer);
- OSL_ASSERT(mxControl);
- return;
- }
-
- if ( !mxContainer->IsInPopupMode() )
- {
- mxContainer->SetSizePixel(mxControl->GetOutputSizePixel());
-
- const Point aPos (rToolBox.GetParent()->OutputToScreenPixel(rToolBox.GetPosPixel()));
- const Size aSize (rToolBox.GetSizePixel());
- const Rectangle aRect (aPos, aSize);
-
- mxContainer->StartPopupMode(
- aRect,
- FloatWinPopupFlags::Down);
- mxContainer->SetPopupModeFlags(
- mxContainer->GetPopupModeFlags()
- | FloatWinPopupFlags::NoAppFocusClose);
-
- mxControl->GetFocus();
- }
-}
-
-void Popup::Hide()
-{
- if (mxContainer)
- if (mxContainer->IsInPopupMode())
- mxContainer->EndPopupMode();
-}
-
-void Popup::ProvideContainerAndControl()
-{
- if ( ! (mxContainer && mxControl)
- && mpParent != nullptr
- && maControlCreator)
- {
- CreateContainerAndControl();
- }
-}
-
-void Popup::CreateContainerAndControl()
-{
- // Clean previous components, if any
- mxControl.disposeAndClear();
- mxContainer.disposeAndClear();
-
- mxContainer.set(VclPtr<PopupContainer>::Create(mpParent));
- mxContainer->SetAccessibleName(msAccessibleName);
- mxContainer->SetPopupModeEndHdl(LINK(this, Popup, PopupModeEndHandler));
- mxContainer->SetBorderStyle(mxContainer->GetBorderStyle() | WindowBorderStyle::MENU);
-
- mxControl.set(maControlCreator(mxContainer.get()));
-}
-
-IMPL_LINK_NOARG_TYPED(Popup, PopupModeEndHandler, FloatingWindow*, void)
-{
- if (maPopupModeEndCallback)
- maPopupModeEndCallback();
-
- // Popup control is no longer needed and can be destroyed.
- mxControl.disposeAndClear();
- mxContainer.disposeAndClear();
-}
-
-
-} } // end of namespace svx::sidebar
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/sidebar/PageFooterPanel.hxx b/sw/source/uibase/sidebar/PageFooterPanel.hxx
index 161aa0c0186d..c1357ad0942b 100644
--- a/sw/source/uibase/sidebar/PageFooterPanel.hxx
+++ b/sw/source/uibase/sidebar/PageFooterPanel.hxx
@@ -22,7 +22,6 @@
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/document/XUndoManager.hpp>
-#include <svx/sidebar/Popup.hxx>
#include <svx/sidebar/PanelLayout.hxx>
#include <sfx2/sidebar/ControllerItem.hxx>
diff --git a/sw/source/uibase/sidebar/PageFormatPanel.hxx b/sw/source/uibase/sidebar/PageFormatPanel.hxx
index c483a65cf598..5fc5f2c9914c 100644
--- a/sw/source/uibase/sidebar/PageFormatPanel.hxx
+++ b/sw/source/uibase/sidebar/PageFormatPanel.hxx
@@ -22,7 +22,6 @@
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/document/XUndoManager.hpp>
-#include <svx/sidebar/Popup.hxx>
#include <svx/sidebar/PanelLayout.hxx>
#include <sfx2/sidebar/ControllerItem.hxx>
diff --git a/sw/source/uibase/sidebar/PageHeaderPanel.hxx b/sw/source/uibase/sidebar/PageHeaderPanel.hxx
index 2aa7149b15cd..ffce2057730c 100644
--- a/sw/source/uibase/sidebar/PageHeaderPanel.hxx
+++ b/sw/source/uibase/sidebar/PageHeaderPanel.hxx
@@ -22,7 +22,6 @@
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/document/XUndoManager.hpp>
-#include <svx/sidebar/Popup.hxx>
#include <svx/sidebar/PanelLayout.hxx>
#include <sfx2/sidebar/ControllerItem.hxx>
diff --git a/sw/source/uibase/sidebar/PagePropertyPanel.hxx b/sw/source/uibase/sidebar/PagePropertyPanel.hxx
index 0c3bf05553b3..f744014ad032 100644
--- a/sw/source/uibase/sidebar/PagePropertyPanel.hxx
+++ b/sw/source/uibase/sidebar/PagePropertyPanel.hxx
@@ -22,7 +22,6 @@
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/document/XUndoManager.hpp>
-#include <svx/sidebar/Popup.hxx>
#include <svx/sidebar/PanelLayout.hxx>
#include <sfx2/sidebar/ControllerItem.hxx>
diff --git a/sw/source/uibase/sidebar/PageStylesPanel.hxx b/sw/source/uibase/sidebar/PageStylesPanel.hxx
index 2f82abcafb75..2f3f401df976 100644
--- a/sw/source/uibase/sidebar/PageStylesPanel.hxx
+++ b/sw/source/uibase/sidebar/PageStylesPanel.hxx
@@ -22,7 +22,6 @@
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/document/XUndoManager.hpp>
-#include <svx/sidebar/Popup.hxx>
#include <svx/sidebar/PanelLayout.hxx>
#include <sfx2/sidebar/ControllerItem.hxx>
diff --git a/sw/source/uibase/sidebar/StylePresetsPanel.hxx b/sw/source/uibase/sidebar/StylePresetsPanel.hxx
index fa5c8b03fd35..3f4afbf07dcc 100644
--- a/sw/source/uibase/sidebar/StylePresetsPanel.hxx
+++ b/sw/source/uibase/sidebar/StylePresetsPanel.hxx
@@ -14,7 +14,6 @@
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/document/XUndoManager.hpp>
-#include <svx/sidebar/Popup.hxx>
#include <svx/sidebar/PanelLayout.hxx>
#include <sfx2/sidebar/ControllerItem.hxx>
diff --git a/sw/source/uibase/sidebar/ThemePanel.hxx b/sw/source/uibase/sidebar/ThemePanel.hxx
index bc1b0cd69b22..d9833afff080 100644
--- a/sw/source/uibase/sidebar/ThemePanel.hxx
+++ b/sw/source/uibase/sidebar/ThemePanel.hxx
@@ -14,7 +14,6 @@
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/document/XUndoManager.hpp>
-#include <svx/sidebar/Popup.hxx>
#include <svx/sidebar/PanelLayout.hxx>
#include <sfx2/sidebar/ControllerItem.hxx>