Skip to content

Commit 045f8c6

Browse files
committed
Move the assignment logic for dialogSettings.Flags to the common section.
1 parent d61bbdc commit 045f8c6

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

src/System.Windows.Forms/System/Windows/Forms/Printing/PageSetupDialog.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -301,19 +301,19 @@ protected override unsafe bool RunDialog(IntPtr hwndOwner)
301301
toUnit = PrinterUnit.HundredthsOfAMillimeter;
302302
}
303303
}
304+
}
304305

305-
// Explicitly pass the unit flag to the native dialog so it operates in the unit selected
306-
// by toUnit. This keeps the values written into rtMargin/rtMinMargin below and the values read
307-
// back in UpdateSettings in the same unit, regardless of how system-level and user-level locale
308-
// settings may differ.
309-
if (toUnit == PrinterUnit.HundredthsOfAMillimeter)
310-
{
311-
dialogSettings.Flags |= PAGESETUPDLG_FLAGS.PSD_INHUNDREDTHSOFMILLIMETERS;
312-
}
313-
else
314-
{
315-
dialogSettings.Flags |= PAGESETUPDLG_FLAGS.PSD_INTHOUSANDTHSOFINCHES;
316-
}
306+
// Explicitly pass the unit flag to the native dialog so it operates in the unit selected
307+
// by toUnit. This keeps the values written into rtMargin/rtMinMargin below and the values read
308+
// back in UpdateSettings in the same unit, regardless of how system-level and user-level locale
309+
// settings may differ.
310+
if (toUnit == PrinterUnit.HundredthsOfAMillimeter)
311+
{
312+
dialogSettings.Flags |= PAGESETUPDLG_FLAGS.PSD_INHUNDREDTHSOFMILLIMETERS;
313+
}
314+
else
315+
{
316+
dialogSettings.Flags |= PAGESETUPDLG_FLAGS.PSD_INTHOUSANDTHSOFINCHES;
317317
}
318318

319319
if (MinMargins is not null)

0 commit comments

Comments
 (0)