summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-10-06 09:19:20 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-10-06 11:56:12 +0200
commit2dfe1726d5262820c910d810b955ea73d3c7ae95 (patch)
tree9514593577c5a22dd019be639494556bd28c4051
parent0ed940e3eb87c7048a1a8e6cfda14e7cef85d007 (diff)
CellController always controls something derived from svt::ControlBase
Change-Id: I051c2d0cf134502943bda5aa0bad9b04163c221f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123129 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--include/svtools/editbrowsebox.hxx14
-rw-r--r--svtools/source/brwbox/editbrowsebox.cxx10
2 files changed, 11 insertions, 13 deletions
diff --git a/include/svtools/editbrowsebox.hxx b/include/svtools/editbrowsebox.hxx
index 199173a390cf..99a14fa980a9 100644
--- a/include/svtools/editbrowsebox.hxx
+++ b/include/svtools/editbrowsebox.hxx
@@ -68,20 +68,22 @@ namespace o3tl
namespace svt
{
+ class ControlBase;
+
class SVT_DLLPUBLIC CellController : public SvRefBase
{
friend class EditBrowseBox;
Link<LinkParamNone*, void> maModifyHdl;
- VclPtr<Control> pWindow;
+ VclPtr<ControlBase> pWindow;
bool bSuspended; // <true> if the window is hidden and disabled
public:
- CellController(Control* pW);
+ CellController(ControlBase* pW);
virtual ~CellController() override;
- Control& GetWindow() const { return *const_cast< CellController* >( this )->pWindow; }
+ ControlBase& GetWindow() const { return *const_cast<CellController*>(this)->pWindow; }
virtual void SaveValue() = 0;
virtual bool IsValueChangedFromSaved() const = 0;
@@ -112,7 +114,7 @@ namespace svt
public:
virtual ~IEditImplementation() = 0;
- virtual Control& GetControl() = 0;
+ virtual ControlBase& GetControl() = 0;
virtual OUString GetText( LineEnd aSeparator ) const = 0;
virtual void SetText( const OUString& _rStr ) = 0;
@@ -280,7 +282,7 @@ namespace svt
m_rEdit.connect_changed(LINK(this, EntryImplementation, ModifyHdl));
}
- virtual Control& GetControl() override
+ virtual ControlBase& GetControl() override
{
return m_rEdit;
}
@@ -431,7 +433,7 @@ namespace svt
m_rEdit.connect_changed(LINK(this, MultiLineEditImplementation, ModifyHdl));
}
- virtual Control& GetControl() override
+ virtual ControlBase& GetControl() override
{
return m_rEdit;
}
diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx
index 90b970615eb7..c9267119ffda 100644
--- a/svtools/source/brwbox/editbrowsebox.cxx
+++ b/svtools/source/brwbox/editbrowsebox.cxx
@@ -1227,23 +1227,19 @@ namespace svt
Controller()->resume();
}
-
- CellController::CellController(Control* pW)
- :pWindow( pW )
- ,bSuspended( true )
+ CellController::CellController(ControlBase* pW)
+ : pWindow(pW)
+ , bSuspended( true )
{
DBG_ASSERT(pWindow, "CellController::CellController: missing the window!");
DBG_ASSERT(!pWindow->IsVisible(), "CellController::CellController: window should not be visible!");
}
-
CellController::~CellController()
{
-
}
-
void CellController::suspend( )
{
DBG_ASSERT( bSuspended == !GetWindow().IsVisible(), "CellController::suspend: inconsistence!" );