Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: EnsureDocumentStructure typo #8321

Merged
merged 1 commit into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public Misc(JobTicket jobTicket, string printerName)
byte [] devmode = jtc.ConvertJobTicketToDevMode(jobTicket.XmlStream, BaseDevModeType.UserDefault);

_pDevmode = Marshal.AllocHGlobal(devmode.Length);

Marshal.Copy(devmode, 0, _pDevmode, devmode.Length);

jtc.Dispose();
Expand Down Expand Up @@ -121,13 +121,13 @@ public IntPtr pDevmode
return _pDevmode;
}
}

IntPtr _pDevmode;
}

#endregion

// Override GetResourceSystem such that resource can be embedded in PrintSystemEDocmentJob
// Override GetResourceSystem such that resource can be embedded in PrintSystemEDocumentJob
internal class ContainerFixedXamlDesigner : FixedXamlDesigner
{
private PrintSystemEDocumentJob _eDocJob;
Expand Down Expand Up @@ -183,9 +183,9 @@ public PrintContext(PrintQueue queue)
{
if( queue == null )
{
throw new ArgumentNullException("queue");
throw new ArgumentNullException("queue");
}

// enter batching for printing
MediaContext.CurrentMediaContext.ChannelSyncMode = true;

Expand All @@ -209,7 +209,7 @@ public void Print(GetPageCallback getPage, string jobName)
this.StartDoc(jobName);

int pageNo = 0;

Visual visual = getPage(this);

while (!_cancel && (visual != null))
Expand All @@ -218,9 +218,9 @@ public void Print(GetPageCallback getPage, string jobName)

this.Render(visual, uri);
this.EndPage();

pageNo++;

visual = getPage(this);
}

Expand All @@ -230,7 +230,7 @@ public void Print(GetPageCallback getPage, string jobName)
{
// restore normal batching
MediaContext.CurrentMediaContext.ChannelSyncMode = false;

_stream = null;
_writer = null;

Expand All @@ -255,7 +255,7 @@ public bool Cancel
_cancel = value;
}
}

/// <summary>
/// JobTicket property
/// </summary>
Expand Down Expand Up @@ -331,9 +331,9 @@ private string GetOutputFilename()
/// delegate GetPageCallback
/// </summary>
public delegate Visual GetPageCallback(PrintContext printContext);

#region Private methods

/// <summary>
/// StartDoc
/// </summary>
Expand All @@ -349,7 +349,7 @@ private void StartDoc(string jobName)
PrintSystemJobInfo jobinfo = _queue.AddJob(typeof(PrintSystemEDocumentJob));

_eDocJob = jobinfo.JobData as PrintSystemEDocumentJob;

_eDocJob.Name = jobName;
_eDocJob.Commit();

Expand Down Expand Up @@ -521,7 +521,7 @@ private void Render(Visual visual, string uri)

AssertPositive(sizeX, "PageCanvasSizeCap.CanvasSizeX");
AssertPositive(sizeY, "PageCanvasSizeCap.CanvasSizeY");

if (IsPremium())
{
VisualTreeFlattener.SaveAsXml(visual, _writer, new ContainerFixedXamlDesigner(_eDocJob, uri));
Expand All @@ -536,7 +536,7 @@ private void Render(Visual visual, string uri)
private bool _cancel;
private PrintQueue _queue;
private JobTicket _jobTicket;

// Member variables used for premium print job
private Stream _stream;
private System.Xml.XmlTextWriter _writer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public DocumentApplicationDocumentViewer() : base()
// Setup the CommandEnforcer before any of the UI is prepared.
CreateEnforcer();
}
}
}

#endregion Constructors

Expand Down Expand Up @@ -186,7 +186,7 @@ public RightsManagementPolicy RightsManagementPolicy
}

/// <summary>
/// Exposes XPSViewer's RootBrowserWindow as an IWin32Window for use in parenting Winforms
/// Exposes XPSViewer's RootBrowserWindow as an IWin32Window for use in parenting Winforms
/// dialogs.
/// </summary>
public System.Windows.Forms.IWin32Window RootBrowserWindow
Expand Down Expand Up @@ -216,7 +216,7 @@ public static DocumentApplicationDocumentViewer Instance
{
return _singletonInstance;
}
}
}

#endregion Public Properties

Expand All @@ -225,7 +225,7 @@ public static DocumentApplicationDocumentViewer Instance
// Public Methods
//
//------------------------------------------------------
#region Public Methods
#region Public Methods

/// <summary>
/// Used to initialize the UI controls.
Expand Down Expand Up @@ -306,7 +306,7 @@ protected override void OnPrintCommand()
SR.RightsManagementExceptionNoRightsForOperation);
}
}

/// <summary>
/// Handler for the CancelPrint command.
/// </summary>
Expand Down Expand Up @@ -358,7 +358,7 @@ private void HandlePrintCancelled(object sender, WritingCancelledEventArgs e)
#endif // DONOTREFPRINTINGASMMETA
}
/// <summary>
/// This is a copy of DocumentViewerBase OnPrintCommand modified to
/// This is a copy of DocumentViewerBase OnPrintCommand modified to
/// handle page ranges
/// </summary>
private void OnPrintCommandPageRangeOverride()
Expand Down Expand Up @@ -431,17 +431,17 @@ private void OnPrintCommandPageRangeOverride()
}

/// <summary>
/// This method finds the URI to pages from the document
/// This method finds the URI to pages from the document
/// specified in the page range. Deserializes a copy of the pages from
/// a package stored in the PreloadedPackages and generates a new
/// doucment with these pages. This is serialized to the provided
/// document with these pages. This is serialized to the provided
/// document writer.
/// </summary>
private
void
WritePageSelection(
WritePageSelection(
XpsDocumentWriter docWriter,
DocumentPaginator docPaginator,
DocumentPaginator docPaginator,
System.Windows.Controls.PageRange pageRange,
PrintDocumentImageableArea ia
)
Expand Down Expand Up @@ -562,17 +562,17 @@ protected override void OnDocumentChanged()

/// <summary>
/// Called when ContextMenuOpening is raised on this element.
/// We use this opportunity to make sure the ScrollViewer's ContextMenu is invoked.
/// We use this opportunity to make sure the ScrollViewer's ContextMenu is invoked.
/// </summary>
/// <param name="e">Event arguments</param>
protected override void OnContextMenuOpening(ContextMenuEventArgs e)
{
// Raise the ContextMenu command on the ScrollViewer if the ContextMenu
// was invoked via the Menu key.
// A negative offset for e.CursorLeft means the user invoked
// the menu with a hotkey (shift-F10).
// the menu with a hotkey (shift-F10).
if (_scrollViewer != null && DoubleUtil.LessThan(e.CursorLeft, 0))
{
{
this.ContextMenu = ScrollViewer.ContextMenu;
}

Expand Down Expand Up @@ -603,7 +603,7 @@ protected override void OnKeyDown(KeyEventArgs e)
}

base.OnKeyDown(e);
}
}

/// <summary>
/// Returns the current UI state
Expand Down Expand Up @@ -806,7 +806,7 @@ private Button PageDownButton
return _pageDownButton;
}
}

/// <summary>
/// Used to view document at 100%
/// </summary>
Expand All @@ -822,7 +822,7 @@ private Button ActualSizeButton
return _actualSizeButton;
}
}

/// <summary>
/// Used to view document at page width
/// </summary>
Expand All @@ -838,7 +838,7 @@ private Button PageWidthButton
return _pageWidthButton;
}
}

/// <summary>
/// Used to view document at 1 whole page at a time
/// </summary>
Expand All @@ -854,8 +854,8 @@ private Button WholePageButton
return _wholePageButton;
}
}


/// <summary>
/// Used to view document at 2 pages at a time
/// </summary>
Expand All @@ -871,7 +871,7 @@ private Button TwoPageButton
return _twoPageButton;
}
}

/// <summary>
/// Used to view document in a 'tiled' or 'thumbnail' view
/// </summary>
Expand Down Expand Up @@ -903,7 +903,7 @@ private Button RMButton
return _rmButton;
}
}

/// <summary>
/// Used to spawn the Save As dialog
/// </summary>
Expand All @@ -919,7 +919,7 @@ private Button SaveAsButton
return _saveAsButton;
}
}

/// <summary>
/// Menu to hold the DigSig options
/// </summary>
Expand Down Expand Up @@ -975,7 +975,7 @@ private Button InfoBarCloseButton
}

/// <summary>
/// Used to display DigSig information and to launch the
/// Used to display DigSig information and to launch the
/// summary dialog
/// </summary>
private Button InfoBarDigSigButton
Expand All @@ -1000,7 +1000,7 @@ private Button InfoBarDigSigButton
}

/// <summary>
/// Used to display RM information and to launch the
/// Used to display RM information and to launch the
/// a dialog with more information
/// </summary>
private Button InfoBarRMButton
Expand Down Expand Up @@ -1350,13 +1350,13 @@ private static void OnApplicationCommandExecute(object sender, ExecutedRoutedEve
}

/// <summary>
/// Central handler for QueryEnabled events fired by Commands directed at DocumentViewer.
/// Central handler for QueryEnabled events fired by Commands directed at DocumentViewer.
/// </summary>
/// <param name="target">The target of this Command, expected to be DocumentViewer</param>
/// <param name="args">The event arguments for this event.</param>
private static void OnApplicationCommandQuery(object target, CanExecuteRoutedEventArgs e)
{

// Check if arguments are valid, fail silently otherwise.
if ((e != null) && (e.Command != null))
{
Expand Down Expand Up @@ -1691,7 +1691,7 @@ private void OnZoomComboBoxSelectionChanged(object sender, SelectionChangedEvent
{
ComboBoxItem cbItem = ZoomComboBox.SelectedItem as ComboBoxItem;
// Check if a selection is made (when an item is selected from the list the
// SelectedItem will be non-null)
// SelectedItem will be non-null)
if (cbItem != null &&
cbItem.Content is ZoomComboBoxItem)
{
Expand Down Expand Up @@ -2200,7 +2200,7 @@ private void CreateEnforcer()
private DocumentApplicationState _state;
private const int _invalidPageNumber = -1;
private SecurityCriticalDataForSet<RightsManagementPolicy> _rightsManagementPolicy;
private RightsManagementStatus _rightsManagementStatus;
private RightsManagementStatus _rightsManagementStatus;

// The enforcer for RM
private SecurityCriticalDataForSet<CommandEnforcer> _commandEnforcer;
Expand Down Expand Up @@ -2510,7 +2510,7 @@ public override DocumentPage GetPage(int pageNumber)
pageBounds = scale.TransformBounds(pageBounds);
}

//
//
// Now center the result
//
double left = (_ia.MediaSizeWidth - pageBounds.Width) / 2.0;
Expand Down
Loading