-
- gnome_print_convert_distance( &ml, margin_unit, mm_unit );
- gnome_print_convert_distance( &mr, margin_unit, mm_unit );
- gnome_print_convert_distance( &mt, margin_unit, mm_unit );
- gnome_print_convert_distance( &mb, margin_unit, mm_unit );
- gnome_print_convert_distance( &pw, paper_unit, mm_unit );
- gnome_print_convert_distance( &ph, paper_unit, mm_unit );
-
- m_pageDialogData.SetMarginTopLeft( wxPoint( (int)(ml*72.0/25.4+0.5), (int)(mt+0.5)) );
+
+ // This probably assumes that the user entered the
+ // values in Pts. Since that is the only the dialog
+ // works right now, we need to fix this later.
+ const GnomePrintUnit *mm_unit = gnome_print_unit_get_by_abbreviation( (const guchar*) "mm" );
+ const GnomePrintUnit *pts_unit = gnome_print_unit_get_by_abbreviation( (const guchar*) "Pts" );
+ gnome_print_convert_distance( &ml, pts_unit, mm_unit );
+ gnome_print_convert_distance( &mr, pts_unit, mm_unit );
+ gnome_print_convert_distance( &mt, pts_unit, mm_unit );
+ gnome_print_convert_distance( &mb, pts_unit, mm_unit );
+ gnome_print_convert_distance( &pw, pts_unit, mm_unit );
+ gnome_print_convert_distance( &ph, pts_unit, mm_unit );
+
+ m_pageDialogData.SetMarginTopLeft( wxPoint( (int)(ml+0.5), (int)(mt+0.5)) );