Skip to content

Commit

Permalink
Revert "Merge pull request #2427 from dotnet/dev/arpit/release31_1b"
Browse files Browse the repository at this point in the history
This reverts commit c86d4b9, reversing
changes made to 334d0ab.
  • Loading branch information
Robert LaDuca committed Jan 14, 2020
1 parent c86d4b9 commit eeb2a5e
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public override void Load(XmlNode node)
RichTextBox richTextBox = (RichTextBox)InnerControl;

FlowDocument document = new FlowDocument();
TextRange rtbRange = new TextRange(document.ContentStart, document.ContentEnd, useRestrictiveXamlXmlReader:true);
TextRange rtbRange = new TextRange(document.ContentStart, document.ContentEnd);
using (MemoryStream buffer = new MemoryStream(Convert.FromBase64String(node.InnerText)))
{
rtbRange.Load(buffer, DataFormats.Xaml);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
<Compile Include="$(WpfSharedDir)\MS\Utility\ItemMap.cs" />
<Compile Include="$(WpfSharedDir)\System\Windows\Interop\OSVersionHelper.cs" />
<Compile Include="$(WpfSharedDir)\System\Windows\Interop\OperatingSystemVersion.cs" />
<Compile Include="$(WpfSharedDir)\MS\Internal\Markup\XamlReaderProxy.cs " />
<Compile Include="$(WpfSharedDir)\Telemetry\Managed\EventSourceActivity.cs" />
<Compile Include="$(WpfSharedDir)\Telemetry\Managed\TelemetryEventSource.cs" />
<Compile Include="$(WpfSharedDir)\Telemetry\Managed\TraceLoggingProvider.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
using System.Xml;
using System.IO;
using System.Windows.Markup; // Parser
using MS.Internal.PresentationFramework.Markup;

#pragma warning disable 1634, 1691 // suppressing PreSharp warnings

Expand Down Expand Up @@ -88,14 +87,6 @@ internal TextRange(ITextPointer position1, ITextPointer position2, bool ignoreTe
ValidationHelper.VerifyPosition(position1.TextContainer, position2, "position2");

TextRangeBase.Select(this, position1, position2);
}

// useRestrictiveXamlXmlReader - false by default
// set to true to disable external xaml loading in specific scenarios like StickyNotes annotation loading
internal TextRange(TextPointer position1, TextPointer position2, bool useRestrictiveXamlXmlReader) :
this((ITextPointer)position1, (ITextPointer)position2)
{
_useRestrictiveXamlXmlReader = useRestrictiveXamlXmlReader;
}

#endregion Constructors
Expand Down Expand Up @@ -1373,9 +1364,9 @@ internal string Xml
// so we use virtual mechanism for extensibility in TextSelection
TextRangeBase.BeginChange(this);
try
{
// Parse the fragment into a separate subtree
object xamlObject = XamlReaderProxy.Load(new XmlTextReader(new System.IO.StringReader(value)), _useRestrictiveXamlXmlReader);
{
// Parse the fragment into a separate subtree
object xamlObject = XamlReader.Load(new XmlTextReader(new System.IO.StringReader(value)));
TextElement fragment = xamlObject as TextElement;

if (fragment != null)
Expand Down Expand Up @@ -1909,9 +1900,6 @@ private enum Flags
// Boolean flags, set with Flags enum.
private Flags _flags;

//boolean flag, set to true via constructor when you want to use the restrictive xamlxmlreader
private bool _useRestrictiveXamlXmlReader;

#endregion Private Fields
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ reading and/or writing Xps packages.
using System.Xml;
using System.Security;
using MS.Internal;
using MS.Internal.IO.Packaging;
using MS.Internal.ReachFramework.Markup;
using MS.Internal.Security;
using MS.Internal.IO.Packaging;

using MS.Internal.IO.Packaging.Extensions;
using Package = System.IO.Packaging.Package;
Expand Down Expand Up @@ -630,7 +629,7 @@ XpsImageType imageType

parserContext.BaseUri = PackUriHelper.Create(Uri, CurrentXpsManager.StartingPart.Uri);

object fixedObject = XamlReaderProxy.Load(CurrentXpsManager.StartingPart.GetStream(), parserContext, useRestrictiveXamlReader:true);
object fixedObject = XamlReader.Load(CurrentXpsManager.StartingPart.GetStream(), parserContext);
if (!(fixedObject is FixedDocumentSequence) )
{
throw new XpsPackagingException(SR.Get(SRID.ReachPackaging_NotAFixedDocumentSequence));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
<Compile Include="$(WpfSharedDir)\MS\Internal\SecurityHelper.cs" />
<Compile Include="$(WpfSharedDir)\MS\Internal\UriComparer.cs " />
<Compile Include="$(WpfSharedDir)\MS\Utility\BindUriHelper.cs" />
<Compile Include="$(WpfSharedDir)\MS\Internal\Markup\XamlReaderProxy.cs " />
<Compile Include="SR.cs" />
<Compile Include="Serialization\Manager\IXpsSerializationManager.cs" />
<Compile Include="Serialization\Manager\IXpsSerializationManagerAsync.cs" />
Expand Down

This file was deleted.

0 comments on commit eeb2a5e

Please sign in to comment.