mirror of
https://git.code.sf.net/p/projectlibre/code
synced 2024-11-01 03:21:46 +01:00
Fix import of MS Project tasks without start (#119)
Don't fail if a task in an MS Project file does not explicitly have a start time set. Tasks do not necessarily have to have start time set, e.g. the start of parent tasks may be derived from their child tasks. The fact that the start element is not mandatory for each task is also described here: https://msdn.microsoft.com/en-us/library/office/bb968645%28v=office.14%29.aspx
This commit is contained in:
parent
0cac2742b5
commit
04fc2c4ca3
1 changed files with 7 additions and 3 deletions
|
@ -278,9 +278,13 @@ public class MspImporter {
|
||||||
} else { // normal task
|
} else { // normal task
|
||||||
task=new Task();
|
task=new Task();
|
||||||
converter.from(mpxTask, task, state);
|
converter.from(mpxTask, task, state);
|
||||||
long taskStart=((Date)task.getPropertyValue("start")).getTime();
|
|
||||||
if (earliestTaskStart==-1L || taskStart<earliestTaskStart)
|
final Date taskStartDate = (Date) task.getPropertyValue("start");
|
||||||
earliestTaskStart=taskStart;
|
if (taskStartDate != null) {
|
||||||
|
final long taskStart = taskStartDate.getTime();
|
||||||
|
if (earliestTaskStart == -1L || taskStart < earliestTaskStart)
|
||||||
|
earliestTaskStart = taskStart;
|
||||||
|
}
|
||||||
|
|
||||||
project.addTask(task,parentTask);
|
project.addTask(task,parentTask);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue