Kaydet (Commit) 8c8926d1 authored tarafından Eike Rathke's avatar Eike Rathke

Introduce and use ScConditionalFormatList::empty() instead of size()

Change-Id: If42fdfbcac74ef2a04bd5d006272a5c1a4f510e2
Reviewed-on: https://gerrit.libreoffice.org/61804Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: Jenkins
üst bafd49fb
...@@ -650,6 +650,7 @@ public: ...@@ -650,6 +650,7 @@ public:
const_iterator end() const; const_iterator end() const;
size_t size() const; size_t size() const;
bool empty() const;
void erase(sal_uLong nIndex); void erase(sal_uLong nIndex);
void clear(); void clear();
......
...@@ -2246,6 +2246,11 @@ size_t ScConditionalFormatList::size() const ...@@ -2246,6 +2246,11 @@ size_t ScConditionalFormatList::size() const
return m_ConditionalFormats.size(); return m_ConditionalFormats.size();
} }
bool ScConditionalFormatList::empty() const
{
return m_ConditionalFormats.empty();
}
void ScConditionalFormatList::erase( sal_uLong nIndex ) void ScConditionalFormatList::erase( sal_uLong nIndex )
{ {
for( iterator itr = begin(); itr != end(); ++itr ) for( iterator itr = begin(); itr != end(); ++itr )
......
...@@ -57,7 +57,7 @@ void ScCondFormatManagerWindow::Init() ...@@ -57,7 +57,7 @@ void ScCondFormatManagerWindow::Init()
SetUpdateMode(true); SetUpdateMode(true);
if (mpFormatList && mpFormatList->size()) if (mpFormatList && !mpFormatList->empty())
SelectRow(0); SelectRow(0);
} }
...@@ -146,7 +146,7 @@ std::unique_ptr<ScConditionalFormatList> ScCondFormatManagerDlg::GetConditionalF ...@@ -146,7 +146,7 @@ std::unique_ptr<ScConditionalFormatList> ScCondFormatManagerDlg::GetConditionalF
void ScCondFormatManagerDlg::UpdateButtonSensitivity() void ScCondFormatManagerDlg::UpdateButtonSensitivity()
{ {
OUString aNewSensitivity = mpFormatList->size() ? OUString("true") : OUString("false"); OUString aNewSensitivity = mpFormatList->empty() ? OUString("false") : OUString("true");
m_pBtnRemove->set_property("sensitive", aNewSensitivity); m_pBtnRemove->set_property("sensitive", aNewSensitivity);
m_pBtnEdit->set_property("sensitive", aNewSensitivity); m_pBtnEdit->set_property("sensitive", aNewSensitivity);
} }
......
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