diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c80d5c..8f7c465 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,14 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/). -### Ribbon V2.16.0, RibbonTools V1.8.1 +### Ribbon V2.16.1, RibbonTools V1.8.1 #### Changed (Ribbon) +- Remove deprecated .NET6 +- Issue NullReferenceException with RibbonItemsEventArgs.Create when pinning is not set for RecentItems +- Issue RibbonRecentItems.RecentItems can not cleared + #### Changed (RibbonTools) - No Error message for Command Name with only 1 character, solves Issue#36. diff --git a/Ribbon/Controls/Events/RecentItemsEventArgs.cs b/Ribbon/Controls/Events/RecentItemsEventArgs.cs index f8e73d2..588f606 100644 --- a/Ribbon/Controls/Events/RecentItemsEventArgs.cs +++ b/Ribbon/Controls/Events/RecentItemsEventArgs.cs @@ -130,8 +130,12 @@ internal static RecentItemsPropertySet GetRecentItemProperties(RibbonRecentItems //PropVariant.UnsafeNativeMethods.PropVariantClear(ref propLabelDescription); // get item pinned value - commandExecutionProperties.GetValue(ref RibbonProperties.Pinned, out PropVariant propPinned); - propSet.Pinned = (bool)propPinned.Value; + // If Pinning is not set then output is null and HRESULT is not S_OK + HRESULT hr = commandExecutionProperties.GetValue(ref RibbonProperties.Pinned, out PropVariant propPinned); + if (hr == HRESULT.S_OK) + { + propSet.Pinned = (bool)propPinned.Value; + } return propSet; } } diff --git a/Ribbon/Controls/Properties/RecentItemsPropertiesProvider.cs b/Ribbon/Controls/Properties/RecentItemsPropertiesProvider.cs index 0dcfce7..a381c00 100644 --- a/Ribbon/Controls/Properties/RecentItemsPropertiesProvider.cs +++ b/Ribbon/Controls/Properties/RecentItemsPropertiesProvider.cs @@ -71,7 +71,7 @@ protected override HRESULT UpdatePropertyImpl(ref PropertyKey key, PropVariantRe } } } - if (_recentItems != null && _recentItems.Count > 0) + if (_recentItems != null) { RecentItemsPropertySet[] array = _recentItems.ToArray(); if (array.Length > MaxCount) diff --git a/Ribbon/Properties/AssemblyInfo.cs b/Ribbon/Properties/AssemblyInfo.cs index 8ef4878..a71653f 100644 --- a/Ribbon/Properties/AssemblyInfo.cs +++ b/Ribbon/Properties/AssemblyInfo.cs @@ -37,5 +37,5 @@ #else [assembly: AssemblyVersion("1.0.0.0")] #endif -[assembly: AssemblyFileVersion("2.16.0.0")] +[assembly: AssemblyFileVersion("2.16.1.0")] diff --git a/Ribbon/RibbonCore.csproj b/Ribbon/RibbonCore.csproj index a35d574..67e35a2 100644 --- a/Ribbon/RibbonCore.csproj +++ b/Ribbon/RibbonCore.csproj @@ -2,7 +2,7 @@ Library - net8.0-windows;net6.0-windows;net40 + net8.0-windows;net40 true true @@ -20,7 +20,7 @@ WindowsRibbon Windows Ribbon Control - 2.16.0 + 2.16.1 Hartmut Borkenhagen RibbonLib Ribbon64.png diff --git a/Setup/Ribbon.wxs b/Setup/Ribbon.wxs index 1cde548..b258ab7 100644 --- a/Setup/Ribbon.wxs +++ b/Setup/Ribbon.wxs @@ -9,7 +9,7 @@ - +