Bug Report T303135
Visible to All Users

RichEditControl throws an exception if a document's header or footer contains multiple selection

created 9 years ago

Steps to reproduce:

Take attached word document
Execute following Code
RichEdit.LoadDocument("Attached Word Document");             RichEdit.CreateCommand(RichEditCommandId.ClosePageHeaderFooter).Execute();             RichEdit.CreateCommand(RichEditCommandId.EditPageHeader).Execute();             var document = RichEdit.Document.Sections[0].BeginUpdateHeader();             var range = document.CreateRange(563, 13);             RichEdit.Document.ChangeActiveDocument(document);             RichEdit.Document.CaretPosition = document.CreatePosition(range.Start.ToInt());             RichEdit.ScrollToCaret(0.5f);             RichEdit.Document.Selections.Add(range);             RichEdit.Document.Sections[0].EndUpdateHeader(document);Result:

ArgumentOutOfRangeException

System.ArgumentOutOfRangeException was unhandled
  HResult=-2146233086
  Message=Der Index lag außerhalb des Bereichs. Er muss nicht negativ und kleiner als die Auflistung sein.
Parametername: index
  ParamName=index
  Source=mscorlib
  StackTrace:
       bei System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
       bei DevExpress.XtraRichEdit.Model.IndexedTreeNodeLeafLevel`1.FindItemByIndex(Int32 relativeIndex)
       bei DevExpress.XtraRichEdit.Model.IndexedTree`2.FindItemByIndex(TIndex index)
       bei DevExpress.XtraRichEdit.Commands.InsertMultiLevelListCommand.AreAllParagraphsHasValidNumberingListType()
       bei DevExpress.XtraRichEdit.Commands.InsertMultiLevelListCommand.UpdateUIStateCore(ICommandUIState state)
       bei DevExpress.XtraRichEdit.Commands.InsertSimpleListCommand.UpdateUIStateCore(ICommandUIState state)
       bei DevExpress.XtraRichEdit.Commands.InsertBulletListCommand.UpdateUIStateCore(ICommandUIState state)
       bei DevExpress.Utils.Commands.Command.UpdateUIState(ICommandUIState state)
       bei DevExpress.XtraRichEdit.Commands.ToggleListCommandBase.UpdateUIState(ICommandUIState state)
       bei DevExpress.XtraBars.Commands.CommandBasedBarCheckItem.UpdateItemVisibility()
       bei DevExpress.XtraBars.Commands.ControlCommandBarCheckItem`2.UpdateItemVisibility()
       bei DevExpress.XtraBars.Commands.ControlCommandBarCheckItem`2.OnControlUpdateUI(Object sender, EventArgs e)
       bei System.EventHandler.Invoke(Object sender, EventArgs e)
       bei DevExpress.XtraRichEdit.Internal.InnerRichEditDocumentServer.RaiseUpdateUI()
       bei DevExpress.XtraRichEdit.Internal.InnerRichEditControl.OnUpdateUICore()
       bei DevExpress.XtraRichEdit.Internal.InnerRichEditControl.OnApplicationIdle()
       bei DevExpress.XtraRichEdit.RichEditControl.OnApplicationIdle(Object sender, EventArgs e)
       bei DevExpress.XtraRichEdit.Drawing.LeakSafeEventRouter.OnApplicationIdle(Object sender, EventArgs e)
       bei System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
       bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       bei System.Windows.Forms.Application.Run(Form mainForm)
       bei SnapReportTest.Program.Main() in C:\Users\r.grundner\Documents\Visual Studio 2015\Projects\SnapReportTest\SnapReportTest\Program.cs:Zeile 16.
       bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       bei System.Threading.ThreadHelper.ThreadStart()
  InnerException:

Expected result:
Field gets selected
No Exception

hth

René

Comments (1)
DevExpress Support Team 9 years ago

    Hi,

    We have successfully reproduced the behavior you described and passed this ticket to our developers for further research.
    Please bear with us. We will notify you as soon as we make any progress.

    Answers approved by DevExpress Support

    created 9 years ago

    We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

    Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.