summaryrefslogtreecommitdiff
path: root/sc/source/ui/sidebar
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-10-04 15:39:09 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-10-04 17:25:13 +0100
commit5d812cae7eacccb7819a46ae45c577295db9f190 (patch)
treed04e8dbaafedca13e1014d0c04d6234cdfa0f04c /sc/source/ui/sidebar
parent7e61e1d644270f05664d358abeffbc8f72b01a96 (diff)
These are just floating windows, no need for all the special intrastructure
get rid of the roundabout way that these popups are popup controllers (of a kind) for real popups for the moment keeping them as loaded from resources Change-Id: I083e8609ab133e3dc4a036daf8bfb44c08a6719f
Diffstat (limited to 'sc/source/ui/sidebar')
-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
10 files changed, 101 insertions, 274 deletions
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: */