Community
Participate
Working Groups
This is a regression. When diagrams are printed, they use the default preferences hint and mapping mode instead of the one that is supplied in the contructor for DiagramPrinter. The following code in DiagramPrinter#run() seems to be the problem: ------------------------------------------- DiagramEditPart dgrmEP = PrintHelper.createDiagramEditPart((Diagram) obj, null); RootEditPart rep = dgrmEP.getRoot(); if (rep instanceof DiagramRootEditPart) this.mm = ((DiagramRootEditPart)rep).getMapMode(); if (rep instanceof IDiagramPreferenceSupport) this.preferencesHint = ((IDiagramPreferenceSupport)rep).getPreferencesHint(); ------------------------------------------- This code assumes that the OffscreenEditPartFactory has obtained the correct preferences hint and mapping mode, when in effect it uses the default ones. The fix: ------------------------------------------- DiagramEditPart dgrmEP = PrintHelper.createDiagramEditPart((Diagram) obj, preferencesHint); ------------------------------------------- The reason for this goes back to trying to get all open GMF diagrams in list in the print dialog...since different _types_ of diagrams will have different preferences. See bug 144771. Even after this fix, the Bug 160696 needs to be looked into.
Created attachment 51874 [details] patch please note that the mapping mode used for each diagram is correct, it turns out that when creating a new DiagramRootEditPart, the measurementUnit from the Diagram itself is used.
Committed to R1_0_maintenance
[GMF Restructure] Bug 319140 : product GMF and component Runtime Diagram was the original product and component for this bug