fix CourseID::ToCourse for autogen courses

This commit is contained in:
Glenn Maynard
2004-08-30 21:55:50 +00:00
parent 5d0b1af78f
commit b6c039cac3
2 changed files with 21 additions and 6 deletions
+15 -6
View File
@@ -200,12 +200,21 @@ void CourseID::FromCourse( const Course *p )
Course *CourseID::ToCourse() const
{
Course* pCourse = NULL;
pCourse = SONGMAN->GetCourseFromPath( sPath );
if( pCourse )
return pCourse;
pCourse = SONGMAN->GetCourseFromName( sFullTitle );
return pCourse;
if( !sPath.empty() )
{
Course *pCourse = SONGMAN->GetCourseFromPath( sPath );
if( pCourse )
return pCourse;
}
if( !sFullTitle.empty() )
{
Course *pCourse = SONGMAN->GetCourseFromName( sFullTitle );
if( pCourse )
return pCourse;
}
return NULL;
}
XNode* CourseID::CreateNode() const