From 716f988bde9ce88913220998e902f5c267036f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=AF=E6=AD=8C?= Date: Mon, 28 Feb 2022 13:05:59 +0800 Subject: [PATCH] fix some api's return value --- src/gui/core/uieventsource.cc | 1 + src/gui/widget/progressbar.cc | 1 + src/gui/widget/view.cc | 6 +++--- src/gui/widget/view.h | 4 ++-- src/gui/widget/viewgroup.cc | 2 ++ 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/gui/core/uieventsource.cc b/src/gui/core/uieventsource.cc index 834368a8..9a78ac5d 100755 --- a/src/gui/core/uieventsource.cc +++ b/src/gui/core/uieventsource.cc @@ -57,6 +57,7 @@ bool UIEventSource::post(Runnable& run,uint32_t delayedtime){ } } mRunnables.push_back(runner); + return true; } //#pragma GCC pop_options diff --git a/src/gui/widget/progressbar.cc b/src/gui/widget/progressbar.cc index 7dc9e985..9acbc793 100755 --- a/src/gui/widget/progressbar.cc +++ b/src/gui/widget/progressbar.cc @@ -109,6 +109,7 @@ bool ProgressBar::needsTileify(Drawable* dr){ if (dynamic_cast(dr)) { return true; } + return false; } Drawable* ProgressBar::tileify(Drawable* drawable, bool clip){ diff --git a/src/gui/widget/view.cc b/src/gui/widget/view.cc index 761b195e..6833a916 100755 --- a/src/gui/widget/view.cc +++ b/src/gui/widget/view.cc @@ -3081,7 +3081,7 @@ bool View::pointInView(int localX,int localY, int slop) { void View::onResolveDrawables(int layoutDirection){ } -bool View::areDrawablesResolved(){ +bool View::areDrawablesResolved()const{ return (mPrivateFlags2 & PFLAG2_DRAWABLE_RESOLVED) == PFLAG2_DRAWABLE_RESOLVED; } @@ -5675,7 +5675,7 @@ void View::setMeasuredDimensionRaw(int measuredWidth, int measuredHeight) { mPrivateFlags |= PFLAG_MEASURED_DIMENSION_SET; } -void View::setMeasuredDimension(int measuredWidth, int measuredHeight) { +void View::setMeasuredDimension(int measuredWidth, int measuredHeight){ bool optical = isLayoutModeOptical(this); if (optical != isLayoutModeOptical(mParent)) { Insets insets = getOpticalInsets(); @@ -5759,7 +5759,7 @@ void View::ensureTransformationInfo(){ } } -bool View::hasIdentityMatrix(){ +bool View::hasIdentityMatrix()const{ const bool rc= (mX==.0f) && (mY==.0f) && (mZ==.0f) && (mTranslationX==.0f) && (mTranslationY==.0f) && (mScaleX ==1.f) && (mScaleY==1.f) && (mRotation==.0f); diff --git a/src/gui/widget/view.h b/src/gui/widget/view.h index 99d25600..de3bd94f 100755 --- a/src/gui/widget/view.h +++ b/src/gui/widget/view.h @@ -437,10 +437,10 @@ protected: void assignParent(ViewGroup*p); bool debugDraw()const; int dipsToPixels(int dips)const; - bool hasIdentityMatrix(); + bool hasIdentityMatrix()const; void computeOpaqueFlags(); virtual void resolveDrawables(); - bool areDrawablesResolved(); + bool areDrawablesResolved()const; void setDuplicateParentStateEnabled(bool); bool isDuplicateParentStateEnabled()const; diff --git a/src/gui/widget/viewgroup.cc b/src/gui/widget/viewgroup.cc index 60bc292e..15fd8956 100755 --- a/src/gui/widget/viewgroup.cc +++ b/src/gui/widget/viewgroup.cc @@ -1681,6 +1681,7 @@ View*ViewGroup::getDeepestFocusedChild(){ v=((ViewGroup*)v)->getFocusedChild(); else v=nullptr; } + return nullptr; } bool ViewGroup::hasFocus()const{ @@ -2133,6 +2134,7 @@ int ViewGroup::getLayoutMode(){ const int inheritedLayoutMode=mParent?mParent->getLayoutMode():LAYOUT_MODE_DEFAULT; setLayoutMode(inheritedLayoutMode,false); } + return mLayoutMode; } void ViewGroup::setLayoutMode(int layoutMode) {