summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2013-10-23 17:38:27 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2013-10-23 19:01:19 -0400
commitf068f1ae32f4243d8f8f8b90209508b1b5906548 (patch)
tree9e0e63a95d2b55e44cdd5104494becb8aebd1328
parent83c4ebbe673f992661a12283c845499c4f053c7d (diff)
Bail out on first hit. No need to go through the whole set.
Change-Id: I044432a1d4e63f49731c24e4eb62525386818620
-rw-r--r--sc/source/ui/navipi/content.cxx17
1 files changed, 7 insertions, 10 deletions
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index fc70ef67f76f..1fa2ca516684 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -886,7 +886,6 @@ sal_Bool ScContentTree::NoteStringsChanged()
SvTreeListEntry* pEntry = FirstChild( pParent );
- bool bEqual = true;
std::vector<sc::NoteEntry> aEntries;
pDoc->GetAllNoteEntries(aEntries);
std::vector<sc::NoteEntry>::const_iterator it = aEntries.begin(), itEnd = aEntries.end();
@@ -894,20 +893,18 @@ sal_Bool ScContentTree::NoteStringsChanged()
{
const ScPostIt* pNote = it->mpNote;
if (!pEntry)
- bEqual = false;
- else
- {
- if (lcl_NoteString(*pNote) != GetEntryText(pEntry))
- bEqual = false;
+ return true;
- pEntry = NextSibling(pEntry);
- }
+ if (lcl_NoteString(*pNote) != GetEntryText(pEntry))
+ return true;
+
+ pEntry = NextSibling(pEntry);
}
if ( pEntry )
- bEqual = false; // kommt noch was
+ return true;
- return !bEqual;
+ return false;
}
sal_Bool ScContentTree::DrawNamesChanged( sal_uInt16 nType )