Skip to content

Commit 3b6b33e

Browse files
committed
Prepare for version 2.13
1 parent 1992b89 commit 3b6b33e

File tree

11 files changed

+112
-38
lines changed

11 files changed

+112
-38
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
### Ribbon V2.13.0, RibbonTools V1.5.0
6+
7+
#### Changed (Ribbon)
8+
9+
- Bugfix RibbonDropDownColorPicker.StandardColors.
10+
- Free unmanaged memory as soon as possible.
11+
- Support for .NET7
12+
13+
#### Changed (RibbonTools)
14+
15+
- Correct usage of TActions
16+
- delete unnecessary namespace in CodeBuilder for RibbonItems
17+
18+
519
### Ribbon V2.12.0, RibbonTools V1.4.0
620

721
#### Changed (Ribbon)

Ribbon/Controls/Properties/ColorPickerPropertiesProvider.cs

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,9 @@ public string AutomaticColorLabel
235235
HRESULT hr = _ribbon.Framework.GetUICommandProperty(_commandID, ref RibbonProperties.AutomaticColorLabel, out automaticColorLabel);
236236
if (NativeMethods.Succeeded(hr))
237237
{
238-
return (string)automaticColorLabel.Value;
238+
string result = (string)automaticColorLabel.Value;
239+
PropVariant.Clear(ref automaticColorLabel);
240+
return result;
239241
}
240242
}
241243

@@ -256,6 +258,7 @@ public string AutomaticColorLabel
256258
automaticColorLabel = PropVariant.FromObject(_automaticColorLabel);
257259
}
258260
HRESULT hr = _ribbon.Framework.SetUICommandProperty(_commandID, ref RibbonProperties.AutomaticColorLabel, ref automaticColorLabel);
261+
PropVariant.Clear(ref automaticColorLabel);
259262
}
260263
}
261264
}
@@ -333,7 +336,9 @@ public string MoreColorsLabel
333336
HRESULT hr = _ribbon.Framework.GetUICommandProperty(_commandID, ref RibbonProperties.MoreColorsLabel, out moreColorsLabel);
334337
if (NativeMethods.Succeeded(hr))
335338
{
336-
return (string)moreColorsLabel.Value;
339+
string result = (string)moreColorsLabel.Value;
340+
PropVariant.Clear(ref moreColorsLabel);
341+
return result;
337342
}
338343
}
339344

@@ -354,6 +359,7 @@ public string MoreColorsLabel
354359
moreColorsLabel = PropVariant.FromObject(_moreColorsLabel);
355360
}
356361
HRESULT hr = _ribbon.Framework.SetUICommandProperty(_commandID, ref RibbonProperties.MoreColorsLabel, ref moreColorsLabel);
362+
PropVariant.Clear(ref moreColorsLabel);
357363
}
358364
}
359365
}
@@ -371,7 +377,9 @@ public string NoColorLabel
371377
HRESULT hr = _ribbon.Framework.GetUICommandProperty(_commandID, ref RibbonProperties.NoColorLabel, out noColorLabel);
372378
if (NativeMethods.Succeeded(hr))
373379
{
374-
return (string)noColorLabel.Value;
380+
string result = (string)noColorLabel.Value;
381+
PropVariant.Clear(ref noColorLabel);
382+
return result;
375383
}
376384
}
377385

@@ -392,6 +400,7 @@ public string NoColorLabel
392400
noColorLabel = PropVariant.FromObject(_noColorLabel);
393401
}
394402
HRESULT hr = _ribbon.Framework.SetUICommandProperty(_commandID, ref RibbonProperties.NoColorLabel, ref noColorLabel);
403+
PropVariant.Clear(ref noColorLabel);
395404
}
396405
}
397406
}
@@ -409,7 +418,9 @@ public string RecentColorsCategoryLabel
409418
HRESULT hr = _ribbon.Framework.GetUICommandProperty(_commandID, ref RibbonProperties.RecentColorsCategoryLabel, out recentColorsCategoryLabel);
410419
if (NativeMethods.Succeeded(hr))
411420
{
412-
return (string)recentColorsCategoryLabel.Value;
421+
string result = (string)recentColorsCategoryLabel.Value;
422+
PropVariant.Clear(ref recentColorsCategoryLabel);
423+
return result;
413424
}
414425
}
415426

@@ -430,6 +441,7 @@ public string RecentColorsCategoryLabel
430441
recentColorsCategoryLabel = PropVariant.FromObject(_recentColorsCategoryLabel);
431442
}
432443
HRESULT hr = _ribbon.Framework.SetUICommandProperty(_commandID, ref RibbonProperties.RecentColorsCategoryLabel, ref recentColorsCategoryLabel);
444+
PropVariant.Clear(ref recentColorsCategoryLabel);
433445
}
434446
}
435447
}
@@ -450,6 +462,7 @@ public Color[] StandardColors
450462
uint[] uintStandardColors = (uint[])standardColors.Value;
451463
int[] intStandardColors = Array.ConvertAll<uint, int>(uintStandardColors, new Converter<uint, int>(Convert.ToInt32));
452464
Color[] colorStandardColors = Array.ConvertAll<int, Color>(intStandardColors, new Converter<int, Color>(ColorTranslator.FromWin32));
465+
PropVariant.Clear(ref standardColors);
453466
return colorStandardColors;
454467
}
455468
}
@@ -466,6 +479,7 @@ public Color[] StandardColors
466479

467480
PropVariant standardColors = PropVariant.FromObject(uintStandardColors);
468481
HRESULT hr = _ribbon.Framework.SetUICommandProperty(_commandID, ref RibbonProperties.StandardColors, ref standardColors);
482+
PropVariant.Clear(ref standardColors);
469483
}
470484
}
471485
}
@@ -483,7 +497,9 @@ public string StandardColorsCategoryLabel
483497
HRESULT hr = _ribbon.Framework.GetUICommandProperty(_commandID, ref RibbonProperties.StandardColorsCategoryLabel, out standardColorsCategoryLabel);
484498
if (NativeMethods.Succeeded(hr))
485499
{
486-
return (string)standardColorsCategoryLabel.Value;
500+
string result = (string)standardColorsCategoryLabel.Value;
501+
PropVariant.Clear(ref standardColorsCategoryLabel);
502+
return result;
487503
}
488504
}
489505

@@ -504,6 +520,7 @@ public string StandardColorsCategoryLabel
504520
standardColorsCategoryLabel = PropVariant.FromObject(_standardColorsCategoryLabel);
505521
}
506522
HRESULT hr = _ribbon.Framework.SetUICommandProperty(_commandID, ref RibbonProperties.StandardColorsCategoryLabel, ref standardColorsCategoryLabel);
523+
PropVariant.Clear(ref standardColorsCategoryLabel);
507524
}
508525
}
509526
}
@@ -521,7 +538,9 @@ public string[] StandardColorsTooltips
521538
HRESULT hr = _ribbon.Framework.GetUICommandProperty(_commandID, ref RibbonProperties.StandardColorsTooltips, out standardColorsTooltips);
522539
if (NativeMethods.Succeeded(hr))
523540
{
524-
return (string[])standardColorsTooltips.Value;
541+
string[] result = (string[])standardColorsTooltips.Value;
542+
PropVariant.Clear(ref standardColorsTooltips);
543+
return result;
525544
}
526545
}
527546

@@ -534,6 +553,7 @@ public string[] StandardColorsTooltips
534553
{
535554
PropVariant standardColorsTooltips = PropVariant.FromObject(value);
536555
HRESULT hr = _ribbon.Framework.SetUICommandProperty(_commandID, ref RibbonProperties.StandardColorsTooltips, ref standardColorsTooltips);
556+
PropVariant.Clear(ref standardColorsTooltips);
537557
}
538558
}
539559
}
@@ -554,6 +574,7 @@ public Color[] ThemeColors
554574
uint[] uintThemeColors = (uint[])themeColors.Value;
555575
int[] intThemeColors = Array.ConvertAll<uint, int>(uintThemeColors, new Converter<uint, int>(Convert.ToInt32));
556576
Color[] colorThemeColors = Array.ConvertAll<int, Color>(intThemeColors, new Converter<int, Color>(ColorTranslator.FromWin32));
577+
PropVariant.Clear(ref themeColors);
557578
return colorThemeColors;
558579
}
559580
}
@@ -570,6 +591,7 @@ public Color[] ThemeColors
570591

571592
PropVariant themeColors = PropVariant.FromObject(uintThemeColors);
572593
HRESULT hr = _ribbon.Framework.SetUICommandProperty(_commandID, ref RibbonProperties.ThemeColors, ref themeColors);
594+
PropVariant.Clear(ref themeColors);
573595
}
574596
}
575597
}
@@ -587,7 +609,9 @@ public string ThemeColorsCategoryLabel
587609
HRESULT hr = _ribbon.Framework.GetUICommandProperty(_commandID, ref RibbonProperties.ThemeColorsCategoryLabel, out themeColorsCategoryLabel);
588610
if (NativeMethods.Succeeded(hr))
589611
{
590-
return (string)themeColorsCategoryLabel.Value;
612+
string result = (string)themeColorsCategoryLabel.Value;
613+
PropVariant.Clear(ref themeColorsCategoryLabel);
614+
return result;
591615
}
592616
}
593617

@@ -608,6 +632,7 @@ public string ThemeColorsCategoryLabel
608632
themeColorsCategoryLabel = PropVariant.FromObject(_themeColorsCategoryLabel);
609633
}
610634
HRESULT hr = _ribbon.Framework.SetUICommandProperty(_commandID, ref RibbonProperties.ThemeColorsCategoryLabel, ref themeColorsCategoryLabel);
635+
PropVariant.Clear(ref themeColorsCategoryLabel);
611636
}
612637
}
613638
}
@@ -625,7 +650,9 @@ public string[] ThemeColorsTooltips
625650
HRESULT hr = _ribbon.Framework.GetUICommandProperty(_commandID, ref RibbonProperties.ThemeColorsTooltips, out themeColorsTooltips);
626651
if (NativeMethods.Succeeded(hr))
627652
{
628-
return (string[])themeColorsTooltips.Value;
653+
string[] result = (string[])themeColorsTooltips.Value;
654+
PropVariant.Clear(ref themeColorsTooltips);
655+
return result;
629656
}
630657
}
631658

@@ -638,6 +665,7 @@ public string[] ThemeColorsTooltips
638665
{
639666
PropVariant themeColorsTooltips = PropVariant.FromObject(value);
640667
HRESULT hr = _ribbon.Framework.SetUICommandProperty(_commandID, ref RibbonProperties.ThemeColorsTooltips, ref themeColorsTooltips);
668+
PropVariant.Clear(ref themeColorsTooltips);
641669
}
642670
}
643671
}

Ribbon/Controls/Properties/FontControlPropertiesProvider.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ public override HRESULT UpdateProperty(ref PropertyKey key, PropVariantRef curre
118118
{
119119
PropVariant propFamily = PropVariant.FromObject(_family);
120120
fontProperties.SetValue(ref RibbonProperties.FontProperties_Family, ref propFamily);
121+
PropVariant.Clear(ref propFamily);
121122
}
122123

123124
// set size
@@ -233,7 +234,9 @@ public string Family
233234
IPropertyStore propertyStore = FontProperties;
234235
PropVariant propFamily;
235236
HRESULT hr = propertyStore.GetValue(ref RibbonProperties.FontProperties_Family, out propFamily);
236-
return (string)propFamily.Value;
237+
string result = (string)propFamily.Value;
238+
PropVariant.Clear(ref propFamily);
239+
return result;
237240
}
238241

239242
return _family;

Ribbon/Controls/Properties/StringValueProperiesProvider.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ public string StringValue
7575
HRESULT hr = _ribbon.Framework.GetUICommandProperty(_commandID, ref RibbonProperties.StringValue, out stringValue);
7676
if (NativeMethods.Succeeded(hr))
7777
{
78-
return (string)stringValue.Value;
78+
string result = (string)stringValue.Value;
79+
PropVariant.Clear(ref stringValue);
80+
return result;
7981
}
8082
}
8183

@@ -97,6 +99,7 @@ public string StringValue
9799
stringValue = PropVariant.FromObject(_stringValue);
98100
}
99101
HRESULT hr = _ribbon.Framework.SetUICommandProperty(_commandID, ref RibbonProperties.StringValue, ref stringValue);
102+
PropVariant.Clear(ref stringValue);
100103
}
101104
}
102105
}

0 commit comments

Comments
 (0)