Fix valgrind warning

This commit is contained in:
Benau 2020-01-19 11:46:03 +08:00
parent 1e53f67354
commit f83f74598d

View File

@ -284,9 +284,9 @@ namespace SkinConfig
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
float getVerticalInnerPadding(int wtype, Widget* widget) float getVerticalInnerPadding(int wtype, Widget* widget)
{ {
if (widget != nullptr) RibbonWidget* ribbon = dynamic_cast<RibbonWidget*>(widget);
if (ribbon)
{ {
RibbonWidget* ribbon = (RibbonWidget*)widget;
RibbonType rtype = ribbon->getRibbonType(); RibbonType rtype = ribbon->getRibbonType();
return getInnerPadding(wtype, rtype, VERTICAL); return getInnerPadding(wtype, rtype, VERTICAL);
@ -298,9 +298,9 @@ namespace SkinConfig
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
float getHorizontalInnerPadding(int wtype, Widget* widget) float getHorizontalInnerPadding(int wtype, Widget* widget)
{ {
if (widget != nullptr) RibbonWidget* ribbon = dynamic_cast<RibbonWidget*>(widget);
if (ribbon)
{ {
RibbonWidget* ribbon = (RibbonWidget*)widget;
RibbonType rtype = ribbon->getRibbonType(); RibbonType rtype = ribbon->getRibbonType();
return getInnerPadding(wtype, rtype, HORIZONTAL); return getInnerPadding(wtype, rtype, HORIZONTAL);