stevencohn / OneMore

A OneNote add-in with simple, yet powerful and useful features
Mozilla Public License 2.0
2.65k stars 223 forks source link

Apply these styles to page => Exception #1662

Open nhwCoder opened 2 weeks ago

nhwCoder commented 2 weeks ago

Problem to Solve

After using OneNote WebClipper to savwe a webpage I tried to use "Apply these styles to page" with default Confluence7 style to the created OneNote page, but always get "Exception: Error running command ApplyStylesCommen. See log files"

I reduced the page to a very simple sample and added it below as XML to (hopefully be able to) reproduce the error.

<one:Page xmlns:one="http://schemas.microsoft.com/office/onenote/2013/onenote" ID="{2FAD9858-D842-EDAD-3752-C34C73B5EA68}{1}{E19573999834251112987820132096460176099923811}" name="Aaa1" dateTime="2024-11-07T10:08:48.000Z" lastModifiedTime="2024-11-08T16:42:14.000Z" pageLevel="1" isCurrentlyViewed="true" selected="partial" lang="de">
  <one:QuickStyleDef index="0" name="PageTitle" fontColor="automatic" font="Calibri Light" fontSize="20.0" spaceBefore="0.0" spaceAfter="0.0" />
  <one:QuickStyleDef index="1" name="h1" fontColor="#1E4E79" highlightColor="automatic" font="Calibri" fontSize="14.0" spaceBefore="0.0" spaceAfter="0.0" />
  <one:QuickStyleDef index="2" name="h2" fontColor="#2E75B5" highlightColor="automatic" font="Calibri" fontSize="14.0" spaceBefore="0.0" spaceAfter="0.0" />
  <one:QuickStyleDef index="3" name="p" fontColor="automatic" highlightColor="automatic" font="Calibri" fontSize="11.0" spaceBefore="0.0" spaceAfter="0.0" />
  <one:PageSettings RTL="false" color="automatic" omHash="143474652886728101091952602609968742587923859036">
    <one:PageSize>
      <one:Automatic />
    </one:PageSize>
    <one:RuleLines visible="false" />
  </one:PageSettings>
  <one:Title lang="de" omHash="637702064868766363660441868649153519796274947118">
    <one:OE alignment="left" quickStyleIndex="0" style="font-family:'Calibri Light';font-size:20.0pt">
      <one:T><![CDATA[Aaa1]]></one:T>
    </one:OE>
  </one:Title>
  <one:Outline omHash="553350118779083610918328854500235409753293783327">
    <one:Position x="36.0" y="90.0" z="0" />
    <one:Size width="83.54290771484375" height="34.17968368530273" />
    <one:OEChildren>
      <one:OE alignment="left" quickStyleIndex="1">
        <one:T><![CDATA[1. aaa]]></one:T>
      </one:OE>
      <one:OE alignment="left" quickStyleIndex="2">
        <one:T><![CDATA[1.1. aaa]]></one:T>
      </one:OE>
    </one:OEChildren>
  </one:Outline>
  <one:Outline selected="partial" omHash="-259979942671739511864287631799708705895936906647">
    <one:Position x="198.0" y="392.3999938964844" z="1" />
    <one:Size width="72.0" height="13.42773056030273" />
    <one:OEChildren selected="partial">
      <one:OE alignment="left" quickStyleIndex="3" selected="partial">
        <one:T selected="all"><![CDATA[]]></one:T>
      </one:OE>
    </one:OEChildren>
  </one:Outline>
</one:Page>
stevencohn commented 1 week ago

Can you attach the log file please? %temp%\OneMore.log

nhwCoder commented 1 week ago

18|05:59:47.825| Running command ApplyStylesCommand 18|05:59:47.903| Error running command ApplyStylesCommand 18|05:59:47.903| System.NullReferenceException Message: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.

[ADDED].[EN] Object reference not set to an instance of an object

Source: River.OneMoreAddIn StackTrace: bei River.OneMoreAddIn.Commands.ApplyStylesCommand.ApplyStyles(List`1 styles) bei River.OneMoreAddIn.Commands.ApplyStylesCommand.ApplyThemeStyles() bei River.OneMoreAddIn.Commands.ApplyStylesCommand.d6.MoveNext() --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei River.OneMoreAddIn.Commands.ApplyStylesCommand.d6.MoveNext() --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei System.Runtime.CompilerServices.TaskAwaiter.GetResult() bei River.OneMoreAddIn.CommandFactory.d__6.MoveNext() TargetSite: [River.OneMoreAddIn] River.OneMoreAddIn.Commands.ApplyStylesCommand::ApplyStyles()