[Libreoffice-commits] core.git: sc/inc sc/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Oct 15 20:30:34 UTC 2018
sc/inc/conditio.hxx | 1 +
sc/source/core/data/conditio.cxx | 5 +++++
sc/source/ui/condformat/condformatmgr.cxx | 4 ++--
3 files changed, 8 insertions(+), 2 deletions(-)
New commits:
commit 8c8926d127a3113a6cabc67df6cc6f7f0d583f98
Author: Eike Rathke <erack at redhat.com>
AuthorDate: Mon Oct 15 20:38:11 2018 +0200
Commit: Eike Rathke <erack at redhat.com>
CommitDate: Mon Oct 15 22:30:09 2018 +0200
Introduce and use ScConditionalFormatList::empty() instead of size()
Change-Id: If42fdfbcac74ef2a04bd5d006272a5c1a4f510e2
Reviewed-on: https://gerrit.libreoffice.org/61804
Reviewed-by: Eike Rathke <erack at redhat.com>
Tested-by: Jenkins
diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx
index e1bda2ba71d7..65c9067b8700 100644
--- a/sc/inc/conditio.hxx
+++ b/sc/inc/conditio.hxx
@@ -650,6 +650,7 @@ public:
const_iterator end() const;
size_t size() const;
+ bool empty() const;
void erase(sal_uLong nIndex);
void clear();
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index f2799f366005..937bb1b830d5 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -2246,6 +2246,11 @@ size_t ScConditionalFormatList::size() const
return m_ConditionalFormats.size();
}
+bool ScConditionalFormatList::empty() const
+{
+ return m_ConditionalFormats.empty();
+}
+
void ScConditionalFormatList::erase( sal_uLong nIndex )
{
for( iterator itr = begin(); itr != end(); ++itr )
diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx
index 1ee0eb440fa7..078714b138bd 100644
--- a/sc/source/ui/condformat/condformatmgr.cxx
+++ b/sc/source/ui/condformat/condformatmgr.cxx
@@ -57,7 +57,7 @@ void ScCondFormatManagerWindow::Init()
SetUpdateMode(true);
- if (mpFormatList && mpFormatList->size())
+ if (mpFormatList && !mpFormatList->empty())
SelectRow(0);
}
@@ -146,7 +146,7 @@ std::unique_ptr<ScConditionalFormatList> ScCondFormatManagerDlg::GetConditionalF
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_pBtnEdit->set_property("sensitive", aNewSensitivity);
}
More information about the Libreoffice-commits
mailing list