Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix: Use hardcoded tree sorting for MS Project XML.
MS Project will get confused if the sequence of the tasks in the file
does not match the WBS.

Reported-by: Marc Rosskopf
  • Loading branch information
scrapper committed Oct 20, 2013
1 parent 5801d2d commit 2dffd02
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/taskjuggler/TjpSyntaxRules.rb
Expand Up @@ -1195,7 +1195,9 @@ def rule_exportFormat
Project XML format can represent. This will inevitably lead to some rounding
errors and different interpretation of the data. The numbers you will see in
Project are not necessarily an exact match of the numbers you see in
TaskJuggler.
TaskJuggler. The XML file format requires the sequence of the tasks in the
file to follow the work breakdown structure. Hence all user provided sorting
directions will be ignored for this format.
EOT
)
end
Expand Down
5 changes: 4 additions & 1 deletion lib/taskjuggler/reports/MspXmlRE.rb
Expand Up @@ -53,7 +53,10 @@ def to_mspxml
# Prepare the task list.
@taskList = PropertyList.new(@project.tasks)
@taskList.includeAdopted
@taskList.setSorting(a('sortTasks'))
# The MSP XML format requires that the tasks are listed in 'tree' order.
# We purposely ignore the user provided sorting criteria.
@taskList.setSorting([ [ 'tree', true, -1 ],
[ 'seqno', true, -1 ] ])
@taskList = filterTaskList(@taskList, nil, a('hideTask'), a('rollupTask'),
a('openNodes'))
@taskList.sort!
Expand Down

0 comments on commit 2dffd02

Please sign in to comment.