summaryrefslogtreecommitdiff
path: root/win/Piecebar.cpp
diff options
context:
space:
mode:
authorleo2006-02-14 06:06:28 +0000
committerleo2006-02-14 06:06:28 +0000
commitdefa9be268ed8ea8b18362e3d0ce690219e5a3d3 (patch)
tree4ab7dbffdc12dc2077a8f10129a0ac3094eae3a8 /win/Piecebar.cpp
parent517715abd19f057b9d4894bcc86de8a4edd52234 (diff)
Fixed empty search results not always shown.
git-svn-id: http://svn.leocad.org/trunk@474 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'win/Piecebar.cpp')
-rw-r--r--win/Piecebar.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/win/Piecebar.cpp b/win/Piecebar.cpp
index f66cd2d..dae325f 100644
--- a/win/Piecebar.cpp
+++ b/win/Piecebar.cpp
@@ -1025,9 +1025,10 @@ BOOL CPiecesBar::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
CString CategoryName = m_PiecesTree.GetItemText(CategoryItem);
int CategoryIndex = Lib->FindCategoryIndex((const char*)CategoryName);
+ PtrArray<PieceInfo> SinglePieces, GroupedPieces;
+
if (CategoryIndex != -1)
{
- PtrArray<PieceInfo> SinglePieces, GroupedPieces;
int i;
Lib->GetCategoryEntries(CategoryIndex, true, SinglePieces, GroupedPieces);
@@ -1053,14 +1054,14 @@ BOOL CPiecesBar::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
m_PiecesTree.InsertItem(TVIF_CHILDREN|TVIF_PARAM|TVIF_TEXT, Info->m_strDescription, 0, 0, 0, 0, (LPARAM)Info, CategoryItem, TVI_LAST);
}
+ }
- if (CategoryName == "Search Results")
+ if (CategoryName == "Search Results")
+ {
+ // Let the user know if the search is empty.
+ if ((SinglePieces.GetSize() == 0) && (GroupedPieces.GetSize() == 0))
{
- // Let the user know if the search is empty.
- if ((SinglePieces.GetSize() == 0) && (GroupedPieces.GetSize() == 0))
- {
- m_PiecesTree.InsertItem(TVIF_PARAM|TVIF_TEXT, "No pieces found", 0, 0, 0, 0, 0, CategoryItem, TVI_SORT);
- }
+ m_PiecesTree.InsertItem(TVIF_PARAM|TVIF_TEXT, "No pieces found", 0, 0, 0, 0, 0, CategoryItem, TVI_SORT);
}
}
}