@@ -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 }
0 commit comments