Kaydet (Commit) cb997040 authored tarafından Maxim Monastirsky's avatar Maxim Monastirsky

Wayland: Make various popups work in the overflow toolbar

Were failing to show, with this warning:

Gdk-WARNING **: Tried to map a popup with a non-top most parent

Change-Id: Ib68b5fc9b3edb3d25a23b66397c13833a4d080ac
Reviewed-on: https://gerrit.libreoffice.org/42936Reviewed-by: 's avatarMaxim Monastirsky <momonasmon@gmail.com>
Tested-by: 's avatarMaxim Monastirsky <momonasmon@gmail.com>
üst 8b053a3c
...@@ -32,7 +32,8 @@ class SvxCharView; ...@@ -32,7 +32,8 @@ class SvxCharView;
class SFX2_DLLPUBLIC SfxCharmapCtrl : public SfxPopupWindow class SFX2_DLLPUBLIC SfxCharmapCtrl : public SfxPopupWindow
{ {
public: public:
explicit SfxCharmapCtrl(sal_uInt16 nId, const css::uno::Reference< css::frame::XFrame >& rFrame); explicit SfxCharmapCtrl(sal_uInt16 nId, vcl::Window* pParent,
const css::uno::Reference< css::frame::XFrame >& rFrame);
virtual ~SfxCharmapCtrl() override; virtual ~SfxCharmapCtrl() override;
......
...@@ -27,7 +27,8 @@ enum class FILTER_CATEGORY; ...@@ -27,7 +27,8 @@ enum class FILTER_CATEGORY;
class SFX2_DLLPUBLIC SfxEmojiControl : public SfxPopupWindow class SFX2_DLLPUBLIC SfxEmojiControl : public SfxPopupWindow
{ {
public: public:
explicit SfxEmojiControl(sal_uInt16 nId, const css::uno::Reference< css::frame::XFrame >& rFrame); explicit SfxEmojiControl(sal_uInt16 nId, vcl::Window* pParent,
const css::uno::Reference< css::frame::XFrame >& rFrame);
virtual ~SfxEmojiControl() override; virtual ~SfxEmojiControl() override;
......
...@@ -92,13 +92,9 @@ protected: ...@@ -92,13 +92,9 @@ protected:
virtual void statusChanged( const css::frame::FeatureStateEvent& rEvent ); virtual void statusChanged( const css::frame::FeatureStateEvent& rEvent );
public: public:
SfxPopupWindow( sal_uInt16 nId, SfxPopupWindow(sal_uInt16 nId, vcl::Window *pParent,
const css::uno::Reference< css::frame::XFrame >& rFrame, const css::uno::Reference< css::frame::XFrame >& rFrame,
WinBits nBits ); WinBits nBits );
SfxPopupWindow(sal_uInt16 nId,
const OString& rID, const OUString& rUIXMLDescription,
const css::uno::Reference<css::frame::XFrame> &rFrame =
css::uno::Reference<css::frame::XFrame>());
SfxPopupWindow(sal_uInt16 nId, vcl::Window *pParent, SfxPopupWindow(sal_uInt16 nId, vcl::Window *pParent,
const OString& rID, const OUString& rUIXMLDescription, const OString& rID, const OUString& rUIXMLDescription,
const css::uno::Reference<css::frame::XFrame> &rFrame = const css::uno::Reference<css::frame::XFrame> &rFrame =
......
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
using namespace css; using namespace css;
SfxCharmapCtrl::SfxCharmapCtrl(sal_uInt16 nId, const css::uno::Reference< css::frame::XFrame >& rFrame) SfxCharmapCtrl::SfxCharmapCtrl(sal_uInt16 nId, vcl::Window* pParent, const css::uno::Reference< css::frame::XFrame >& rFrame)
: SfxPopupWindow(nId, "charmapctrl", "sfx/ui/charmapcontrol.ui", rFrame) : SfxPopupWindow(nId, pParent, "charmapctrl", "sfx/ui/charmapcontrol.ui", rFrame)
{ {
get( m_pRecentCharView[0], "viewchar1" ); get( m_pRecentCharView[0], "viewchar1" );
get( m_pRecentCharView[1], "viewchar2" ); get( m_pRecentCharView[1], "viewchar2" );
......
...@@ -36,8 +36,8 @@ const char FILTER_UNICODE9[] = "unicode9"; ...@@ -36,8 +36,8 @@ const char FILTER_UNICODE9[] = "unicode9";
using namespace com::sun::star; using namespace com::sun::star;
SfxEmojiControl::SfxEmojiControl(sal_uInt16 nId, const css::uno::Reference< css::frame::XFrame >& rFrame) SfxEmojiControl::SfxEmojiControl(sal_uInt16 nId, vcl::Window* pParent, const css::uno::Reference< css::frame::XFrame >& rFrame)
: SfxPopupWindow(nId, "emojictrl", "sfx/ui/emojicontrol.ui", rFrame) : SfxPopupWindow(nId, pParent, "emojictrl", "sfx/ui/emojicontrol.ui", rFrame)
{ {
get(mpTabControl, "tab_control"); get(mpTabControl, "tab_control");
get(mpEmojiView, "emoji_view"); get(mpEmojiView, "emoji_view");
......
...@@ -35,7 +35,7 @@ EmojiPopup::~EmojiPopup() ...@@ -35,7 +35,7 @@ EmojiPopup::~EmojiPopup()
VclPtr<SfxPopupWindow> EmojiPopup::CreatePopupWindow() VclPtr<SfxPopupWindow> EmojiPopup::CreatePopupWindow()
{ {
VclPtr<SfxEmojiControl> pControl = VclPtr<SfxEmojiControl>::Create(GetSlotId(), m_xFrame); VclPtr<SfxEmojiControl> pControl = VclPtr<SfxEmojiControl>::Create(GetSlotId(), &GetToolBox(), m_xFrame);
pControl->StartPopupMode(&GetToolBox(), FloatWinPopupFlags::GrabFocus); pControl->StartPopupMode(&GetToolBox(), FloatWinPopupFlags::GrabFocus);
......
...@@ -35,7 +35,7 @@ CharmapPopup::~CharmapPopup() ...@@ -35,7 +35,7 @@ CharmapPopup::~CharmapPopup()
VclPtr<SfxPopupWindow> CharmapPopup::CreatePopupWindow() VclPtr<SfxPopupWindow> CharmapPopup::CreatePopupWindow()
{ {
VclPtr<SfxCharmapCtrl> pControl = VclPtr<SfxCharmapCtrl>::Create(GetSlotId(), m_xFrame); VclPtr<SfxCharmapCtrl> pControl = VclPtr<SfxCharmapCtrl>::Create(GetSlotId(), &GetToolBox(), m_xFrame);
pControl->StartPopupMode(&GetToolBox(), FloatWinPopupFlags::GrabFocus); pControl->StartPopupMode(&GetToolBox(), FloatWinPopupFlags::GrabFocus);
......
...@@ -710,22 +710,10 @@ void SAL_CALL SfxFrameStatusListener::statusChanged( const css::frame::FeatureSt ...@@ -710,22 +710,10 @@ void SAL_CALL SfxFrameStatusListener::statusChanged( const css::frame::FeatureSt
SfxPopupWindow::SfxPopupWindow( SfxPopupWindow::SfxPopupWindow(
sal_uInt16 nId, sal_uInt16 nId,
vcl::Window* pParentWindow,
const Reference< XFrame >& rFrame, const Reference< XFrame >& rFrame,
WinBits nBits ) : WinBits nBits ) :
FloatingWindow( SfxGetpApp()->GetTopWindow(), nBits ) FloatingWindow( pParentWindow, nBits )
, m_bFloating( false )
, m_bCascading( false )
, m_nId( nId )
, m_xFrame( rFrame )
{
vcl::Window* pWindow = GetTopMostParentSystemWindow( this );
if ( pWindow )
static_cast<SystemWindow *>(pWindow)->GetTaskPaneList()->AddWindow( this );
}
SfxPopupWindow::SfxPopupWindow(sal_uInt16 nId, const OString& rID, const OUString& rUIXMLDescription,
const css::uno::Reference<css::frame::XFrame> &rFrame)
: FloatingWindow(SfxGetpApp()->GetTopWindow(), rID, rUIXMLDescription, rFrame)
, m_bFloating( false ) , m_bFloating( false )
, m_bCascading( false ) , m_bCascading( false )
, m_nId( nId ) , m_nId( nId )
......
...@@ -46,8 +46,8 @@ ...@@ -46,8 +46,8 @@
using namespace svx; using namespace svx;
ParaLineSpacingControl::ParaLineSpacingControl(sal_uInt16 nId) ParaLineSpacingControl::ParaLineSpacingControl(sal_uInt16 nId, vcl::Window* pParent)
: SfxPopupWindow(nId, "ParaLineSpacingControl", "svx/ui/paralinespacingcontrol.ui") : SfxPopupWindow(nId, pParent, "ParaLineSpacingControl", "svx/ui/paralinespacingcontrol.ui")
{ {
mpSpacing1Button = get<PushButton>("spacing_1"); mpSpacing1Button = get<PushButton>("spacing_1");
mpSpacing115Button = get<PushButton>("spacing_115"); mpSpacing115Button = get<PushButton>("spacing_115");
......
...@@ -30,7 +30,7 @@ namespace svx { ...@@ -30,7 +30,7 @@ namespace svx {
class ParaLineSpacingControl : public SfxPopupWindow class ParaLineSpacingControl : public SfxPopupWindow
{ {
public: public:
explicit ParaLineSpacingControl(sal_uInt16 nId); explicit ParaLineSpacingControl(sal_uInt16 nId, vcl::Window* pParent);
virtual ~ParaLineSpacingControl() override; virtual ~ParaLineSpacingControl() override;
virtual void dispose() override; virtual void dispose() override;
......
...@@ -39,7 +39,7 @@ ParaLineSpacingPopup::~ParaLineSpacingPopup() ...@@ -39,7 +39,7 @@ ParaLineSpacingPopup::~ParaLineSpacingPopup()
VclPtr<SfxPopupWindow> ParaLineSpacingPopup::CreatePopupWindow() VclPtr<SfxPopupWindow> ParaLineSpacingPopup::CreatePopupWindow()
{ {
VclPtr<ParaLineSpacingControl> pControl = VclPtr<ParaLineSpacingControl>::Create(GetSlotId()); VclPtr<ParaLineSpacingControl> pControl = VclPtr<ParaLineSpacingControl>::Create(GetSlotId(), &GetToolBox());
pControl->StartPopupMode(&GetToolBox(), FloatWinPopupFlags::GrabFocus); pControl->StartPopupMode(&GetToolBox(), FloatWinPopupFlags::GrabFocus);
......
...@@ -39,8 +39,8 @@ ...@@ -39,8 +39,8 @@
namespace svx { namespace svx {
TextCharacterSpacingControl::TextCharacterSpacingControl(sal_uInt16 nId) TextCharacterSpacingControl::TextCharacterSpacingControl(sal_uInt16 nId, vcl::Window* pParent)
: SfxPopupWindow(nId, "TextCharacterSpacingControl", "svx/ui/textcharacterspacingcontrol.ui") : SfxPopupWindow(nId, pParent, "TextCharacterSpacingControl", "svx/ui/textcharacterspacingcontrol.ui")
, mnId(nId) , mnId(nId)
, mnCustomKern(0) , mnCustomKern(0)
, mnLastCus(SPACING_NOCUSTOM) , mnLastCus(SPACING_NOCUSTOM)
......
...@@ -34,7 +34,7 @@ namespace svx { ...@@ -34,7 +34,7 @@ namespace svx {
class TextCharacterSpacingControl : public SfxPopupWindow class TextCharacterSpacingControl : public SfxPopupWindow
{ {
public: public:
explicit TextCharacterSpacingControl(sal_uInt16 nId); explicit TextCharacterSpacingControl(sal_uInt16 nId, vcl::Window* pParent);
virtual ~TextCharacterSpacingControl() override; virtual ~TextCharacterSpacingControl() override;
virtual void dispose() override; virtual void dispose() override;
......
...@@ -38,7 +38,7 @@ TextCharacterSpacingPopup::~TextCharacterSpacingPopup() ...@@ -38,7 +38,7 @@ TextCharacterSpacingPopup::~TextCharacterSpacingPopup()
VclPtr<SfxPopupWindow> TextCharacterSpacingPopup::CreatePopupWindow() VclPtr<SfxPopupWindow> TextCharacterSpacingPopup::CreatePopupWindow()
{ {
VclPtr<TextCharacterSpacingControl> pControl = VclPtr<TextCharacterSpacingControl>::Create(GetSlotId()); VclPtr<TextCharacterSpacingControl> pControl = VclPtr<TextCharacterSpacingControl>::Create(GetSlotId(), &GetToolBox());
pControl->StartPopupMode(&GetToolBox(), FloatWinPopupFlags::GrabFocus); pControl->StartPopupMode(&GetToolBox(), FloatWinPopupFlags::GrabFocus);
......
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
namespace svx { namespace svx {
TextUnderlineControl::TextUnderlineControl(sal_uInt16 nId) TextUnderlineControl::TextUnderlineControl(sal_uInt16 nId, vcl::Window* pParent)
: SfxPopupWindow(nId, "TextUnderlineControl", "svx/ui/textunderlinecontrol.ui") : SfxPopupWindow(nId, pParent, "TextUnderlineControl", "svx/ui/textunderlinecontrol.ui")
{ {
get(maNone, "none"); get(maNone, "none");
get(maSingle, "single"); get(maSingle, "single");
......
...@@ -31,7 +31,7 @@ namespace svx { ...@@ -31,7 +31,7 @@ namespace svx {
class TextUnderlineControl : public SfxPopupWindow class TextUnderlineControl : public SfxPopupWindow
{ {
public: public:
explicit TextUnderlineControl(sal_uInt16 nId); explicit TextUnderlineControl(sal_uInt16 nId, vcl::Window* pParent);
virtual ~TextUnderlineControl() override; virtual ~TextUnderlineControl() override;
virtual void dispose() override; virtual void dispose() override;
......
...@@ -43,7 +43,7 @@ void TextUnderlinePopup::initialize( const css::uno::Sequence< css::uno::Any >& ...@@ -43,7 +43,7 @@ void TextUnderlinePopup::initialize( const css::uno::Sequence< css::uno::Any >&
VclPtr<SfxPopupWindow> TextUnderlinePopup::CreatePopupWindow() VclPtr<SfxPopupWindow> TextUnderlinePopup::CreatePopupWindow()
{ {
VclPtr<TextUnderlineControl> pControl = VclPtr<TextUnderlineControl>::Create(GetSlotId()); VclPtr<TextUnderlineControl> pControl = VclPtr<TextUnderlineControl>::Create(GetSlotId(), &GetToolBox());
pControl->StartPopupMode(&GetToolBox(), FloatWinPopupFlags::GrabFocus); pControl->StartPopupMode(&GetToolBox(), FloatWinPopupFlags::GrabFocus);
SetPopupWindow(pControl); SetPopupWindow(pControl);
......
...@@ -72,6 +72,7 @@ private: ...@@ -72,6 +72,7 @@ private:
public: public:
TableWindow( sal_uInt16 nSlotId, TableWindow( sal_uInt16 nSlotId,
vcl::Window* pParent,
const OUString& rCmd, const OUString& rCmd,
const OUString& rText, const OUString& rText,
const Reference< XFrame >& rFrame ); const Reference< XFrame >& rFrame );
...@@ -100,9 +101,9 @@ IMPL_LINK_NOARG(TableWindow, SelectHdl, Button*, void) ...@@ -100,9 +101,9 @@ IMPL_LINK_NOARG(TableWindow, SelectHdl, Button*, void)
} }
TableWindow::TableWindow( sal_uInt16 nSlotId, const OUString& rCmd, const OUString& rText, TableWindow::TableWindow( sal_uInt16 nSlotId, vcl::Window* pParent, const OUString& rCmd,
const Reference< XFrame >& rFrame ) const OUString& rText, const Reference< XFrame >& rFrame )
: SfxPopupWindow( nSlotId, rFrame, WinBits( WB_STDPOPUP ) ) : SfxPopupWindow( nSlotId, pParent, rFrame, WB_STDPOPUP )
, aTableButton( VclPtr<PushButton>::Create(this) ) , aTableButton( VclPtr<PushButton>::Create(this) )
, nCol( 0 ) , nCol( 0 )
, nLine( 0 ) , nLine( 0 )
...@@ -393,7 +394,8 @@ private: ...@@ -393,7 +394,8 @@ private:
void UpdateSize_Impl( long nNewCol ); void UpdateSize_Impl( long nNewCol );
public: public:
ColumnsWindow( sal_uInt16 nId, const OUString& rCmd, const OUString &rText, const Reference< XFrame >& rFrame ); ColumnsWindow( sal_uInt16 nId, vcl::Window* pParent, const OUString& rCmd,
const OUString &rText, const Reference< XFrame >& rFrame );
void KeyInput( const KeyEvent& rKEvt ) override; void KeyInput( const KeyEvent& rKEvt ) override;
virtual void MouseMove( const MouseEvent& rMEvt ) override; virtual void MouseMove( const MouseEvent& rMEvt ) override;
...@@ -404,8 +406,9 @@ public: ...@@ -404,8 +406,9 @@ public:
}; };
ColumnsWindow::ColumnsWindow( sal_uInt16 nId, const OUString& rCmd, const OUString& rText, const Reference< XFrame >& rFrame ) : ColumnsWindow::ColumnsWindow( sal_uInt16 nId, vcl::Window* pParent, const OUString& rCmd,
SfxPopupWindow( nId, rFrame, WB_STDPOPUP ), const OUString& rText, const Reference< XFrame >& rFrame ) :
SfxPopupWindow( nId, pParent, rFrame, WB_STDPOPUP ),
bInitialKeyInput(true), bInitialKeyInput(true),
m_bMod1(false), m_bMod1(false),
mxFrame(rFrame), mxFrame(rFrame),
...@@ -687,7 +690,7 @@ VclPtr<SfxPopupWindow> SvxTableToolBoxControl::CreatePopupWindow() ...@@ -687,7 +690,7 @@ VclPtr<SfxPopupWindow> SvxTableToolBoxControl::CreatePopupWindow()
if ( bEnabled ) if ( bEnabled )
{ {
ToolBox& rTbx = GetToolBox(); ToolBox& rTbx = GetToolBox();
VclPtr<TableWindow> pWin = VclPtr<TableWindow>::Create( GetSlotId(), m_aCommandURL, GetToolBox().GetItemText( GetId() ), m_xFrame ); VclPtr<TableWindow> pWin = VclPtr<TableWindow>::Create( GetSlotId(), &GetToolBox(), m_aCommandURL, GetToolBox().GetItemText( GetId() ), m_xFrame );
pWin->StartPopupMode( &rTbx, FloatWinPopupFlags::GrabFocus|FloatWinPopupFlags::NoKeyClose ); pWin->StartPopupMode( &rTbx, FloatWinPopupFlags::GrabFocus|FloatWinPopupFlags::NoKeyClose );
SetPopupWindow( pWin ); SetPopupWindow( pWin );
return pWin; return pWin;
...@@ -732,7 +735,7 @@ VclPtr<SfxPopupWindow> SvxColumnsToolBoxControl::CreatePopupWindow() ...@@ -732,7 +735,7 @@ VclPtr<SfxPopupWindow> SvxColumnsToolBoxControl::CreatePopupWindow()
VclPtr<ColumnsWindow> pWin; VclPtr<ColumnsWindow> pWin;
if(bEnabled) if(bEnabled)
{ {
pWin = VclPtr<ColumnsWindow>::Create( GetSlotId(), m_aCommandURL, GetToolBox().GetItemText( GetId() ), m_xFrame ); pWin = VclPtr<ColumnsWindow>::Create( GetSlotId(), &GetToolBox(), m_aCommandURL, GetToolBox().GetItemText( GetId() ), m_xFrame );
pWin->StartPopupMode( &GetToolBox(), pWin->StartPopupMode( &GetToolBox(),
FloatWinPopupFlags::GrabFocus|FloatWinPopupFlags::NoKeyClose ); FloatWinPopupFlags::GrabFocus|FloatWinPopupFlags::NoKeyClose );
SetPopupWindow( pWin ); SetPopupWindow( pWin );
......
...@@ -71,7 +71,7 @@ public: ...@@ -71,7 +71,7 @@ public:
}; };
SvxPopupWindowListBox::SvxPopupWindowListBox(sal_uInt16 nSlotId, const OUString& rCommandURL, sal_uInt16 nId, ToolBox& rTbx) SvxPopupWindowListBox::SvxPopupWindowListBox(sal_uInt16 nSlotId, const OUString& rCommandURL, sal_uInt16 nId, ToolBox& rTbx)
: SfxPopupWindow(nSlotId, "FloatingUndoRedo", "svx/ui/floatingundoredo.ui") : SfxPopupWindow(nSlotId, &rTbx, "FloatingUndoRedo", "svx/ui/floatingundoredo.ui")
, rToolBox(rTbx) , rToolBox(rTbx)
, bUserSel(false) , bUserSel(false)
, nTbxId(nId) , nTbxId(nId)
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
namespace sw { namespace sidebar { namespace sw { namespace sidebar {
PageColumnControl::PageColumnControl( sal_uInt16 nId ) PageColumnControl::PageColumnControl( sal_uInt16 nId, vcl::Window* pParent )
: SfxPopupWindow( nId, "PageColumnControl", "modules/swriter/ui/pagecolumncontrol.ui" ) : SfxPopupWindow( nId, pParent, "PageColumnControl", "modules/swriter/ui/pagecolumncontrol.ui" )
{ {
get( m_pMoreButton, "moreoptions" ); get( m_pMoreButton, "moreoptions" );
......
...@@ -30,7 +30,7 @@ namespace sw { namespace sidebar { ...@@ -30,7 +30,7 @@ namespace sw { namespace sidebar {
class PageColumnControl : public SfxPopupWindow class PageColumnControl : public SfxPopupWindow
{ {
public: public:
explicit PageColumnControl(sal_uInt16 nId); explicit PageColumnControl(sal_uInt16 nId, vcl::Window* pParent);
virtual ~PageColumnControl() override; virtual ~PageColumnControl() override;
virtual void dispose() override; virtual void dispose() override;
......
...@@ -35,7 +35,7 @@ PageColumnPopup::~PageColumnPopup() ...@@ -35,7 +35,7 @@ PageColumnPopup::~PageColumnPopup()
VclPtr<SfxPopupWindow> PageColumnPopup::CreatePopupWindow() VclPtr<SfxPopupWindow> PageColumnPopup::CreatePopupWindow()
{ {
VclPtr<sw::sidebar::PageColumnControl> pControl = VclPtr<sw::sidebar::PageColumnControl>::Create(GetSlotId()); VclPtr<sw::sidebar::PageColumnControl> pControl = VclPtr<sw::sidebar::PageColumnControl>::Create(GetSlotId(), &GetToolBox());
pControl->StartPopupMode(&GetToolBox(), FloatWinPopupFlags::GrabFocus); pControl->StartPopupMode(&GetToolBox(), FloatWinPopupFlags::GrabFocus);
SetPopupWindow(pControl); SetPopupWindow(pControl);
......
...@@ -94,8 +94,8 @@ namespace ...@@ -94,8 +94,8 @@ namespace
namespace sw { namespace sidebar { namespace sw { namespace sidebar {
PageMarginControl::PageMarginControl( sal_uInt16 nId ) PageMarginControl::PageMarginControl( sal_uInt16 nId, vcl::Window* pParent )
: SfxPopupWindow( nId, "PageMarginControl", "modules/swriter/ui/pagemargincontrol.ui" ) : SfxPopupWindow( nId, pParent, "PageMarginControl", "modules/swriter/ui/pagemargincontrol.ui" )
, m_nPageLeftMargin(0) , m_nPageLeftMargin(0)
, m_nPageRightMargin(0) , m_nPageRightMargin(0)
, m_nPageTopMargin(0) , m_nPageTopMargin(0)
......
...@@ -44,7 +44,7 @@ namespace sw { namespace sidebar { ...@@ -44,7 +44,7 @@ namespace sw { namespace sidebar {
class PageMarginControl : public SfxPopupWindow class PageMarginControl : public SfxPopupWindow
{ {
public: public:
explicit PageMarginControl( sal_uInt16 nId ); explicit PageMarginControl( sal_uInt16 nId, vcl::Window* pParent );
virtual ~PageMarginControl() override; virtual ~PageMarginControl() override;
virtual void dispose() override; virtual void dispose() override;
......
...@@ -35,7 +35,7 @@ PageMarginPopup::~PageMarginPopup() ...@@ -35,7 +35,7 @@ PageMarginPopup::~PageMarginPopup()
VclPtr<SfxPopupWindow> PageMarginPopup::CreatePopupWindow() VclPtr<SfxPopupWindow> PageMarginPopup::CreatePopupWindow()
{ {
VclPtr<sw::sidebar::PageMarginControl> pControl = VclPtr<sw::sidebar::PageMarginControl>::Create(GetSlotId()); VclPtr<sw::sidebar::PageMarginControl> pControl = VclPtr<sw::sidebar::PageMarginControl>::Create(GetSlotId(), &GetToolBox());
pControl->StartPopupMode(&GetToolBox(), FloatWinPopupFlags::GrabFocus); pControl->StartPopupMode(&GetToolBox(), FloatWinPopupFlags::GrabFocus);
SetPopupWindow(pControl); SetPopupWindow(pControl);
......
...@@ -52,8 +52,8 @@ namespace { ...@@ -52,8 +52,8 @@ namespace {
namespace sw { namespace sidebar { namespace sw { namespace sidebar {
PageOrientationControl::PageOrientationControl( sal_uInt16 nId ) PageOrientationControl::PageOrientationControl( sal_uInt16 nId, vcl::Window* pParent )
: SfxPopupWindow( nId, "PageOrientationControl", "modules/swriter/ui/pageorientationcontrol.ui" ) : SfxPopupWindow( nId, pParent, "PageOrientationControl", "modules/swriter/ui/pageorientationcontrol.ui" )
, mpPageItem( new SvxPageItem(SID_ATTR_PAGE) ) , mpPageItem( new SvxPageItem(SID_ATTR_PAGE) )
, mpPageSizeItem( new SvxSizeItem(SID_ATTR_PAGE_SIZE) ) , mpPageSizeItem( new SvxSizeItem(SID_ATTR_PAGE_SIZE) )
, mpPageLRMarginItem( new SvxLongLRSpaceItem( 0, 0, SID_ATTR_PAGE_LRSPACE ) ) , mpPageLRMarginItem( new SvxLongLRSpaceItem( 0, 0, SID_ATTR_PAGE_LRSPACE ) )
......
...@@ -32,7 +32,7 @@ namespace sw { namespace sidebar { ...@@ -32,7 +32,7 @@ namespace sw { namespace sidebar {
class PageOrientationControl : public SfxPopupWindow class PageOrientationControl : public SfxPopupWindow
{ {
public: public:
explicit PageOrientationControl(sal_uInt16 nId); explicit PageOrientationControl(sal_uInt16 nId, vcl::Window* pParent);
virtual ~PageOrientationControl() override; virtual ~PageOrientationControl() override;
virtual void dispose() override; virtual void dispose() override;
......
...@@ -35,7 +35,7 @@ PageOrientationPopup::~PageOrientationPopup() ...@@ -35,7 +35,7 @@ PageOrientationPopup::~PageOrientationPopup()
VclPtr<SfxPopupWindow> PageOrientationPopup::CreatePopupWindow() VclPtr<SfxPopupWindow> PageOrientationPopup::CreatePopupWindow()
{ {
VclPtr<sw::sidebar::PageOrientationControl> pControl = VclPtr<sw::sidebar::PageOrientationControl>::Create(GetSlotId()); VclPtr<sw::sidebar::PageOrientationControl> pControl = VclPtr<sw::sidebar::PageOrientationControl>::Create(GetSlotId(), &GetToolBox());
pControl->StartPopupMode(&GetToolBox(), FloatWinPopupFlags::GrabFocus); pControl->StartPopupMode(&GetToolBox(), FloatWinPopupFlags::GrabFocus);
SetPopupWindow(pControl); SetPopupWindow(pControl);
......
...@@ -65,8 +65,8 @@ namespace ...@@ -65,8 +65,8 @@ namespace
namespace sw { namespace sidebar { namespace sw { namespace sidebar {
PageSizeControl::PageSizeControl( sal_uInt16 nId ) PageSizeControl::PageSizeControl( sal_uInt16 nId, vcl::Window* pParent )
: SfxPopupWindow( nId, "PageSizeControl", "modules/swriter/ui/pagesizecontrol.ui" ) : SfxPopupWindow( nId, pParent, "PageSizeControl", "modules/swriter/ui/pagesizecontrol.ui" )
, maPaperList() , maPaperList()
{ {
get(maMoreButton, "moreoptions"); get(maMoreButton, "moreoptions");
......
...@@ -41,7 +41,7 @@ namespace sw { namespace sidebar { ...@@ -41,7 +41,7 @@ namespace sw { namespace sidebar {
class PageSizeControl : public SfxPopupWindow class PageSizeControl : public SfxPopupWindow
{ {
public: public:
explicit PageSizeControl(sal_uInt16 nId); explicit PageSizeControl(sal_uInt16 nId, vcl::Window* pParent);
virtual ~PageSizeControl() override; virtual ~PageSizeControl() override;
virtual void dispose() override; virtual void dispose() override;
......
...@@ -35,7 +35,7 @@ PageSizePopup::~PageSizePopup() ...@@ -35,7 +35,7 @@ PageSizePopup::~PageSizePopup()
VclPtr<SfxPopupWindow> PageSizePopup::CreatePopupWindow() VclPtr<SfxPopupWindow> PageSizePopup::CreatePopupWindow()
{ {
VclPtr<sw::sidebar::PageSizeControl> pControl = VclPtr<sw::sidebar::PageSizeControl>::Create(GetSlotId()); VclPtr<sw::sidebar::PageSizeControl> pControl = VclPtr<sw::sidebar::PageSizeControl>::Create(GetSlotId(), &GetToolBox());
pControl->StartPopupMode(&GetToolBox(), FloatWinPopupFlags::GrabFocus); pControl->StartPopupMode(&GetToolBox(), FloatWinPopupFlags::GrabFocus);
SetPopupWindow(pControl); SetPopupWindow(pControl);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment