summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-03-15 11:19:51 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-03-16 01:01:33 +0100
commite3e6f43bc8c01ca6c3ad87180db2b3e623d8eed4 (patch)
tree6a3f041c5073bc05e21ff3d1e4f0b194ba655df3 /include
parent8a8c029244e8a27efd92017968313c2116a9776a (diff)
clarify that set_visible(true/false) is just show/hide
ditch duplicate method Change-Id: Iea35d6437f48809a06e093241bddf301f00c502b Reviewed-on: https://gerrit.libreoffice.org/69302 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/svtools/ServerDetailsControls.hxx10
-rw-r--r--include/svx/colorbox.hxx8
-rw-r--r--include/svx/frmdirlbox.hxx3
-rw-r--r--include/svx/langbox.hxx2
-rw-r--r--include/vcl/weld.hxx26
5 files changed, 23 insertions, 26 deletions
diff --git a/include/svtools/ServerDetailsControls.hxx b/include/svtools/ServerDetailsControls.hxx
index 12fd0f2bba2e..d569ac8e20ac 100644
--- a/include/svtools/ServerDetailsControls.hxx
+++ b/include/svtools/ServerDetailsControls.hxx
@@ -41,7 +41,7 @@ class DetailsContainer
void setChangeHdl( const Link<DetailsContainer*,void>& rLink ) { m_aChangeHdl = rLink; }
- virtual void show( bool bShow = true );
+ virtual void set_visible( bool bShow );
virtual INetURLObject getUrl( );
/** Try to split the URL in the controls of that container.
@@ -72,7 +72,7 @@ class HostDetailsContainer : public DetailsContainer
public:
HostDetailsContainer(PlaceEditDialog* pDialog, sal_uInt16 nPort, const OUString& sScheme);
- virtual void show( bool bShow = true ) override;
+ virtual void set_visible( bool bShow ) override;
virtual INetURLObject getUrl( ) override;
virtual bool setUrl( const INetURLObject& rUrl ) override;
@@ -90,7 +90,7 @@ class DavDetailsContainer : public HostDetailsContainer
public:
DavDetailsContainer(PlaceEditDialog* pDialog);
- virtual void show( bool bShow = true ) override;
+ virtual void set_visible( bool bShow ) override;
virtual bool enableUserCredentials( ) override { return false; };
protected:
@@ -110,7 +110,7 @@ class SmbDetailsContainer : public DetailsContainer
virtual INetURLObject getUrl( ) override;
virtual bool setUrl( const INetURLObject& rUrl ) override;
- virtual void show( bool bShow = true ) override;
+ virtual void set_visible( bool bShow ) override;
};
class CmisDetailsContainer : public DetailsContainer
@@ -127,7 +127,7 @@ class CmisDetailsContainer : public DetailsContainer
public:
CmisDetailsContainer(PlaceEditDialog* pDialog, OUString const & sBinding);
- virtual void show( bool bShow = true ) override;
+ virtual void set_visible( bool bShow ) override;
virtual INetURLObject getUrl( ) override;
virtual bool setUrl( const INetURLObject& rUrl ) override;
virtual void setUsername( const OUString& rUsername ) override;
diff --git a/include/svx/colorbox.hxx b/include/svx/colorbox.hxx
index ab79efd8b5df..a9b38b7612ba 100644
--- a/include/svx/colorbox.hxx
+++ b/include/svx/colorbox.hxx
@@ -138,13 +138,7 @@ public:
bool get_sensitive() const { return m_xButton->get_sensitive(); }
void show() { m_xButton->show(); }
void hide() { m_xButton->hide(); }
- void show(bool bShow)
- {
- if (bShow)
- show();
- else
- hide();
- }
+ void set_visible(bool bShow) { m_xButton->set_visible(bShow); }
void set_help_id(const OString& rHelpId) { m_xButton->set_help_id(rHelpId); }
weld::MenuButton& get_widget() { return *m_xButton; }
};
diff --git a/include/svx/frmdirlbox.hxx b/include/svx/frmdirlbox.hxx
index cb2e1452fbba..c1cd4b376869 100644
--- a/include/svx/frmdirlbox.hxx
+++ b/include/svx/frmdirlbox.hxx
@@ -50,7 +50,8 @@ public:
int get_active() const { return m_xControl->get_active(); }
void set_sensitive(bool bSensitive) { m_xControl->set_sensitive(bSensitive); }
void hide() { m_xControl->hide(); }
- void show(bool bShow = true) { m_xControl->show(bShow); }
+ void set_visible(bool bVisible) { m_xControl->set_visible(bVisible); }
+ void show() { m_xControl->show(); }
int get_count() const { return m_xControl->get_count(); }
/** Inserts a string with corresponding direction enum into the listbox. */
void append(SvxFrameDirection eDirection, const OUString& rString)
diff --git a/include/svx/langbox.hxx b/include/svx/langbox.hxx
index 723faf6e02b4..e20c35a96adf 100644
--- a/include/svx/langbox.hxx
+++ b/include/svx/langbox.hxx
@@ -162,7 +162,7 @@ public:
bool get_active_id_changed_from_saved() const { return m_eSavedLanguage != get_active_id(); }
void show() { m_xControl->show(); }
void hide() { m_xControl->hide(); }
- void show(bool bShow) { if (bShow) show(); else hide(); }
+ void set_visible(bool bShow) { m_xControl->set_visible(bShow); }
void set_sensitive(bool bSensitive) { m_xControl->set_sensitive(bSensitive); }
void set_active(int nPos) { m_xControl->set_active(nPos); }
int get_active() const { return m_xControl->get_active(); }
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 0856e4748929..b0c669d28bf7 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -88,23 +88,24 @@ protected:
public:
virtual void set_sensitive(bool sensitive) = 0;
virtual bool get_sensitive() const = 0;
- virtual void set_visible(bool visible) = 0;
- virtual bool get_visible() const = 0; //if this widget visibility is true
- virtual bool is_visible() const = 0; //if this widget visibility and all parents is true
- virtual void set_can_focus(bool bCanFocus) = 0;
- virtual void grab_focus() = 0;
- virtual bool has_focus() const = 0;
- virtual void set_has_default(bool has_default) = 0;
- virtual bool get_has_default() const = 0;
virtual void show() = 0;
virtual void hide() = 0;
- void show(bool bShow)
+ // This function simply calls show() or hide() but is convenient when the
+ // visibility depends on some condition
+ virtual void set_visible(bool visible)
{
- if (bShow)
+ if (visible)
show();
else
hide();
}
+ virtual bool get_visible() const = 0; //if this widget visibility is true
+ virtual bool is_visible() const = 0; //if this widget visibility and all parents is true
+ virtual void set_can_focus(bool bCanFocus) = 0;
+ virtual void grab_focus() = 0;
+ virtual bool has_focus() const = 0;
+ virtual void set_has_default(bool has_default) = 0;
+ virtual bool get_has_default() const = 0;
virtual void set_size_request(int nWidth, int nHeight) = 0;
virtual Size get_size_request() const = 0;
virtual Size get_preferred_size() const = 0;
@@ -1283,7 +1284,8 @@ public:
bool get_visible() const { return m_xSpinButton->get_visible(); }
void grab_focus() { m_xSpinButton->grab_focus(); }
bool has_focus() const { return m_xSpinButton->has_focus(); }
- void show(bool bShow = true) { m_xSpinButton->show(bShow); }
+ void show() { m_xSpinButton->show(); }
+ void set_visible(bool bShow) { m_xSpinButton->set_visible(bShow); }
void hide() { m_xSpinButton->hide(); }
void set_digits(unsigned int digits);
void set_accessible_name(const OUString& rName) { m_xSpinButton->set_accessible_name(rName); }
@@ -1361,7 +1363,7 @@ public:
bool get_visible() const { return m_xSpinButton->get_visible(); }
void grab_focus() { m_xSpinButton->grab_focus(); }
bool has_focus() const { return m_xSpinButton->has_focus(); }
- void show(bool bShow = true) { m_xSpinButton->show(bShow); }
+ void show() { m_xSpinButton->show(); }
void hide() { m_xSpinButton->hide(); }
void save_value() { m_xSpinButton->save_value(); }
bool get_value_changed_from_saved() const