提交 dda56b40 编写于 作者: Z Zhouyj_zju

Description: fix the cppcheck

IssueNo: https://gitee.com/openharmony/graphic_utils/issues/I5RYU4
Feature or Bugfix: Bugfix
Binary Source:No
Signed-off-by: Nzhouyj <zhouyuanjie1@huawei.com>
上级 c737d839
......@@ -89,6 +89,10 @@ void Text::SetSpannableString(const SpannableString* spannableString)
return;
}
textStyles_ = static_cast<TextStyle*>(UIMalloc(textLen));
if (textStyles_ == nullptr) {
GRAPHIC_LOGE("Text::SetSpannableString invalid parameter");
return;
}
ListNode<StyleSpan*>* node = spannableString->spanList_.Begin();
while (node != spannableString->spanList_.End()) {
for (uint32_t i = node->data_->start_; i < node->data_->end_; i++) {
......@@ -561,6 +565,10 @@ void Text::SetRelativeSizeSpan(uint16_t start, uint16_t end, float size)
absoluteSize = static_cast<uint8_t>(size * fontSize_);
#else
UITextLanguageFontParam* fontParam = UIFontBuilder::GetInstance()->GetTextLangFontsTable(fontId_);
if (fontParam == nullptr) {
GRAPHIC_LOGE("Text::SetRelativeSizeSpan invalid parameter");
return;
}
absoluteSize = static_cast<uint8_t>(size * fontParam->size);
#endif
SetAbsoluteSizeSpan(start, end, absoluteSize);
......
......@@ -177,21 +177,18 @@ uint32_t TypedText::GetNextLine(const char* text, uint8_t fontId, uint8_t fontSi
return index;
}
uint32_t lastBreakPos = 0;
int16_t curW;
uint32_t tmp = 0;
while (true) {
curW = TypedText::GetTextWidth(text, fontId, fontSize, index, letterSpace);
int16_t curW = TypedText::GetTextWidth(text, fontId, fontSize, index, letterSpace);
if (curW > maxWidth) {
index = lastBreakPos;
if (lastBreakPos == 0) {
curW = 0;
uint32_t i = 0;
uint32_t letter;
uint16_t letterWidth;
while (text[i] != '\0') {
tmp = i;
letter = TypedText::GetUTF8Next(text, tmp, i);
letterWidth = UIFont::GetInstance()->GetWidth(letter, fontId, fontSize, 0);
uint32_t letter = TypedText::GetUTF8Next(text, tmp, i);
uint16_t letterWidth = UIFont::GetInstance()->GetWidth(letter, fontId, fontSize, 0);
curW += letterWidth;
if (letterWidth > 0) {
curW += letterSpace;
......@@ -228,13 +225,12 @@ bool TypedText::GetWrapPoint(const char* text, uint32_t& breakPoint)
{
breakPoint = 0;
uint32_t j = 0;
uint32_t letter = 0;
if (text == nullptr) {
return true;
}
while (text[breakPoint] != '\0') {
letter = GetUTF8Next(text, breakPoint, j);
uint32_t letter = GetUTF8Next(text, breakPoint, j);
breakPoint = j;
if ((letter == ' ') || (letter == '.') || (letter == ',') || (letter == '!') || (letter == '=')
|| (letter == '?')) {
......@@ -261,10 +257,9 @@ int16_t TypedText::GetTextWidth(const char* text, uint8_t fontId, uint8_t fontSi
uint32_t i = 0;
uint16_t width = 0;
uint32_t letter;
while (i < length) {
letter = GetUTF8Next(text, i, i);
uint32_t letter = GetUTF8Next(text, i, i);
if ((letter == 0) || (letter == '\n') || (letter == '\r')) {
continue;
}
......@@ -533,8 +528,8 @@ bool TypedText::IsColourWord(uint32_t codePoint, uint8_t fontId, uint8_t fontSiz
#if ENABLE_MULTI_FONT
uint8_t* searchLists = nullptr;
int8_t listSize = UIMultiFontManager::GetInstance()->GetSearchFontList(fontId, &searchLists);
int8_t currentIndex = 0;
if ((listSize > 0) && (searchLists != nullptr)) {
int8_t currentIndex = 0;
do {
weight = UIFont::GetInstance()->GetFontWeight(searchLists[currentIndex]);
if (weight >= 16) { // 16: rgb565->16 rgba8888->32 font with rgba
......
......@@ -36,7 +36,7 @@ public:
BarEaseInOutAnimator(BarEaseInOutAnimator&&) = delete;
BarEaseInOutAnimator& operator=(BarEaseInOutAnimator&&) = delete;
BarEaseInOutAnimator(UIAbstractScroll& scrollView)
explicit BarEaseInOutAnimator(UIAbstractScroll& scrollView)
: scrollView_(scrollView),
timer_(APPEAR_PERIOD, TimerCb, this),
animator_(this, nullptr, ANIMATOR_DURATION, false)
......@@ -172,11 +172,9 @@ void UIAbstractScroll::MoveChildByOffset(int16_t offsetX, int16_t offsetY)
return;
}
UIView* view = GetChildrenHead();
int16_t x;
int16_t y;
while (view != nullptr) {
x = view->GetX() + offsetX;
y = view->GetY() + offsetY;
int16_t x = view->GetX() + offsetX;
int16_t y = view->GetY() + offsetY;
view->SetPosition(x, y);
view = view->GetNextSibling();
}
......
......@@ -181,7 +181,6 @@ void UICheckBox::UnSelectedStateSoftwareDrawing(BufferInfo& gfxDstBuffer,
int16_t borderRadius,
int16_t rectLineWidth)
{
Rect contentRect = GetContentRect();
Style styleUnSelect = StyleDefault::GetBackgroundTransparentStyle();
styleUnSelect.borderWidth_ = rectLineWidth;
styleUnSelect.borderRadius_ = borderRadius;
......
......@@ -368,6 +368,10 @@ void UIImageView::UpdateDrawTransMap(bool updateContentMatrix)
}
// only contentMatrix
if (transMap_ == nullptr || transMap_->IsInvalid()) {
if (contentMatrix_ == nullptr) {
GRAPHIC_LOGE("Text: UpdateDrawTransMap contentMatrix_ is nullptr");
return;
}
drawTransMap_->SetMatrix(*contentMatrix_);
return;
}
......
......@@ -628,8 +628,6 @@ void UIList::MoveChildByOffset(int16_t xOffset, int16_t yOffset)
if (view == nullptr) {
return;
}
int16_t x;
int16_t y;
int16_t height;
int16_t width;
......@@ -660,8 +658,8 @@ void UIList::MoveChildByOffset(int16_t xOffset, int16_t yOffset)
}
bool isSelectViewFind = false;
do {
x = view->GetX() + xOffset;
y = view->GetY() + yOffset;
int16_t x = view->GetX() + xOffset;
int16_t y = view->GetY() + yOffset;
view->SetPosition(x, y);
if ((selectPosition_ != 0) && !isSelectViewFind) {
if (direction_ == VERTICAL) {
......
......@@ -324,9 +324,8 @@ bool UIPicker::RefreshSelected(uint16_t index)
UIView* childView = static_cast<UIView*>(list_.GetChildrenHead());
uint16_t lastSelectIndex = listListener_->GetSelectIndex();
int16_t viewIndex;
while (childView != nullptr) {
viewIndex = childView->GetViewIndex();
int16_t viewIndex = childView->GetViewIndex();
if (viewIndex == lastSelectIndex) {
childView->SetStyle(STYLE_TEXT_COLOR, GetBackgroundTextColor().full);
if (backgroundFontName_ == nullptr) {
......
......@@ -127,7 +127,7 @@ bool UIScrollView::OnRotateEvent(const RotateEvent& event)
}
VibratorFunc vibratorFunc = VibratorManager::GetInstance()->GetVibratorFunc();
if (vibratorFunc != nullptr && !isEdge) {
uint16_t rotateLen = MATH_ABS(totalRotateLen_ - lastVibratorRotateLen_);
rotateLen = MATH_ABS(totalRotateLen_ - lastVibratorRotateLen_);
if (rotateLen > DEFAULT_SCROLL_VIEW_VIBRATION_LEN) {
uint16_t vibrationCnt = rotateLen / DEFAULT_SCROLL_VIEW_VIBRATION_LEN;
for (uint16_t i = 0; i < vibrationCnt; i++) {
......
......@@ -1264,9 +1264,8 @@ uint8_t UIView::GetMixOpaScale() const
{
uint8_t opaMix = opaScale_;
UIView* parent = parent_;
uint8_t opaParent;
while (parent != nullptr) {
opaParent = parent->GetOpaScale();
uint8_t opaParent = parent->GetOpaScale();
// 8: Shift right 8 bits
opaMix = (opaParent == OPA_OPAQUE) ? opaMix : ((static_cast<uint16_t>(opaParent) * opaMix) >> 8);
parent = parent->GetParent();
......
......@@ -310,11 +310,9 @@ UIView* UIViewGroup::GetChildById(const char* id) const
void UIViewGroup::MoveChildByOffset(int16_t xOffset, int16_t yOffset)
{
UIView* view = childrenHead_;
int16_t x;
int16_t y;
while (view != nullptr) {
x = view->GetX() + xOffset;
y = view->GetY() + yOffset;
int16_t x = view->GetX() + xOffset;
int16_t y = view->GetY() + yOffset;
view->SetPosition(x, y);
view = view->GetNextSibling();
}
......@@ -378,7 +376,6 @@ void UIViewGroup::UpdateRenderView(UIView* targetView)
int16_t curZIndex = curView->GetZIndex();
int16_t targetZIndex = targetView->GetZIndex();
int16_t nextZIndex;
UIView* nextView = curView->GetNextRenderSibling();
UIView* preView = nullptr;
......@@ -396,7 +393,7 @@ void UIViewGroup::UpdateRenderView(UIView* targetView)
while (nextView != nullptr) {
curZIndex = curView->GetZIndex();
nextZIndex = nextView->GetZIndex();
int16_t nextZIndex = nextView->GetZIndex();
if (curZIndex == targetZIndex) {
InsertRenderView(curView, preView, targetView);
return;
......@@ -431,7 +428,6 @@ void UIViewGroup::InsertRenderView(UIView* archorView, UIView* anchorPreView, UI
return;
}
int16_t curZIndex = node->GetZIndex();
int16_t targetZIndex = targetView->GetZIndex();
UIView* newArchorView = nullptr;
......@@ -442,7 +438,7 @@ void UIViewGroup::InsertRenderView(UIView* archorView, UIView* anchorPreView, UI
}
while (node->GetNextSibling() != nullptr) {
curZIndex = node->GetNextSibling()->GetZIndex();
int16_t curZIndex = node->GetNextSibling()->GetZIndex();
if (curZIndex == targetZIndex) {
if ((node->GetNextSibling() == targetView) && (newArchorView == nullptr)) {
targetView->SetNextRenderSibling(archorView);
......
......@@ -176,9 +176,9 @@ void ClipUtils::DrawPixel(int16_t x, int16_t y, uint8_t opa, const ImageInfo* im
}
}
void ClipUtils::DrawHorLine(int16_t x, int16_t y, int16_t len, uint8_t opa, const ImageInfo* imageInfo)
void ClipUtils::DrawHorLine(int16_t x, int16_t y, int16_t width, uint8_t opa, const ImageInfo* imageInfo)
{
for (int32_t i = x; i <= x + len; i++) {
for (int32_t i = x; i <= x + width; i++) {
DrawPixel(i, y, opa, imageInfo);
}
}
......
......@@ -37,16 +37,14 @@ uint16_t DrawLabel::DrawTextOneLine(BufferInfo& gfxDstBuffer, const LabelLineInf
}
uint32_t i = 0;
uint32_t letter;
uint16_t retOffsetY = 0; // ret value elipse offsetY
uint16_t offsetPosY = 0;
uint8_t maxLetterSize = GetLineMaxLetterSize(labelLine.text, labelLine.lineLength, labelLine.fontId,
labelLine.fontSize, letterIndex, labelLine.sizeSpans);
DrawLineBackgroundColor(gfxDstBuffer, letterIndex, labelLine);
GlyphNode glyphNode;
uint8_t* fontMap;
while (i < labelLine.lineLength) {
letter = TypedText::GetUTF8Next(labelLine.text, i, i);
uint32_t letter = TypedText::GetUTF8Next(labelLine.text, i, i);
uint8_t fontId = labelLine.fontId;
uint8_t fontSize = labelLine.fontSize;
if (labelLine.sizeSpans != nullptr && labelLine.sizeSpans[letterIndex].isSizeSpan) {
......@@ -88,7 +86,7 @@ uint16_t DrawLabel::DrawTextOneLine(BufferInfo& gfxDstBuffer, const LabelLineInf
glyphNode.textStyle = letterInfo.textStyle;
#endif
glyphNode.advance = 0;
fontMap = fontEngine->GetBitmap(letterInfo.letter, glyphNode, letterInfo.fontId, letterInfo.fontSize,
uint8_t* fontMap = fontEngine->GetBitmap(letterInfo.letter, glyphNode, letterInfo.fontId, letterInfo.fontSize,
letterInfo.shapingId);
if (fontMap != nullptr) {
#if ENABLE_VECTOR_FONT
......@@ -123,10 +121,9 @@ uint8_t DrawLabel::GetLineMaxLetterSize(const char* text, uint16_t lineLength, u
return fontSize;
}
uint32_t i = 0;
uint32_t unicode;
uint8_t maxLetterSize = fontSize;
while (i < lineLength) {
unicode = TypedText::GetUTF8Next(text, i, i);
uint32_t unicode = TypedText::GetUTF8Next(text, i, i);
if (TypedText::IsColourWord(unicode, fontId, fontSize)) {
letterIndex++;
continue;
......
......@@ -70,7 +70,6 @@ int8_t GlyphsFile::CacheInit()
int8_t GlyphsFile::GetNodeFromFile(uint32_t unicode, uint8_t fontId, GlyphNode& node)
{
uint16_t idx = 0;
uint8_t key;
uint32_t offset;
GlyphInfo glyphInfo;
int8_t result = GetGlyphInfo(fontId, glyphInfo);
......@@ -79,7 +78,7 @@ int8_t GlyphsFile::GetNodeFromFile(uint32_t unicode, uint8_t fontId, GlyphNode&
}
for (int32_t i = RADIX_SHIFT_START; i >= 0; i -= RADIX_TREE_BITS) {
offset = idx * sizeof(IndexNode);
key = static_cast<uint8_t>((unicode >> static_cast<uint8_t>(i)) & RADIX_TREE_MASK);
uint8_t key = static_cast<uint8_t>((unicode >> static_cast<uint8_t>(i)) & RADIX_TREE_MASK);
offset += key * sizeof(uint16_t);
idx = *(reinterpret_cast<uint16_t*>(glyphInfo.indexCache + offset));
if (idx == 0) {
......
......@@ -327,7 +327,6 @@ uint16_t UIFontBitmap::GetOffsetPosY(const char* text,
uint8_t fontSize)
{
uint32_t i = 0;
uint32_t unicode;
uint16_t textNum = 0;
uint16_t emojiNum = 0;
......@@ -336,7 +335,7 @@ uint16_t UIFontBitmap::GetOffsetPosY(const char* text,
GlyphNode emoijMaxNode = {};
uint8_t maxFontSie = fontSize;
while (i < lineLength) {
unicode = TypedText::GetUTF8Next(text, i, i);
uint32_t unicode = TypedText::GetUTF8Next(text, i, i);
#if ENABLE_MULTI_FONT
uint8_t ret = GetMultiGlyphNode(unicode, glyphNode, fontId);
#else
......@@ -389,9 +388,8 @@ uint16_t UIFontBitmap::GetLineMaxHeight(const char* text,
}
uint32_t i = 0;
uint32_t unicode;
while (i < lineLength) {
unicode = TypedText::GetUTF8Next(text, i, i);
TypedText::GetUTF8Next(text, i, i);
if (sizeSpans != nullptr && sizeSpans[letterIndex].isSizeSpan) {
uint16_t spannableHeight = 0;
if (sizeSpans[letterIndex].height == 0) {
......
......@@ -756,7 +756,6 @@ uint16_t UIFontVector::GetOffsetPosY(const char* text,
return INVALID_RET_VALUE;
}
uint32_t i = 0;
uint32_t unicode;
uint16_t textNum = 0;
uint16_t emojiNum = 0;
uint16_t loopNum = 0;
......@@ -764,7 +763,7 @@ uint16_t UIFontVector::GetOffsetPosY(const char* text,
GlyphNode emojiMaxNode = {};
uint8_t maxFontSize = fontSize;
while (i < lineLength) {
unicode = TypedText::GetUTF8Next(text, i, i);
uint32_t unicode = TypedText::GetUTF8Next(text, i, i);
uint8_t ret = GetGlyphNode(unicode, glyphNode, fontId, fontSize);
if (ret == RET_VALUE_OK) {
#if ENABLE_VECTOR_FONT
......@@ -811,13 +810,12 @@ uint16_t UIFontVector::GetLineMaxHeight(const char *text, uint16_t lineLength, u
return INVALID_RET_VALUE;
}
uint32_t i = 0;
uint32_t unicode;
uint16_t textNum = 0;
uint16_t emojiNum = 0;
uint16_t loopNum = 0;
uint16_t maxHeight = GetHeight(fontId, fontSize);
while (i < lineLength) {
unicode = TypedText::GetUTF8Next(text, i, i);
uint32_t unicode = TypedText::GetUTF8Next(text, i, i);
TypedText::IsColourWord(unicode, fontId, fontSize) ? emojiNum++ : textNum++;
loopNum++;
if (sizeSpans != nullptr && sizeSpans[letterIndex].isSizeSpan) {
......@@ -861,10 +859,9 @@ uint16_t UIFontVector::GetMaxSubLineHeight(uint16_t textNum, uint16_t loopNum, u
}
}
// A line has both emoji and words
uint16_t tmpHeight = 0;
if ((textNum > 0) && (emojiNum > 0)) {
for (uint8_t i = 0; i < currentFontInfoNum_; i++) {
tmpHeight = static_cast<uint16_t>(ftFaces_[i]->size->metrics.height / FONT_PIXEL_IN_POINT);
uint16_t tmpHeight = static_cast<uint16_t>(ftFaces_[i]->size->metrics.height / FONT_PIXEL_IN_POINT);
maxHeight = tmpHeight > maxHeight ? tmpHeight : maxHeight;
}
}
......
......@@ -133,7 +133,7 @@ uint32_t UILineBreakEngine::GetNextLineAndWidth(const char* text,
int32_t state = LINE_BREAK_STATE_START;
int16_t width = 0;
int16_t height = 0;
while ((text[byteIdx] != '\0') && (byteIdx < len)) {
while ((byteIdx < len) && (text[byteIdx] != '\0')) {
uint32_t unicode = TypedText::GetUTF8Next(text, preIndex, byteIdx);
if (unicode == 0) {
preIndex = byteIdx;
......
......@@ -77,9 +77,6 @@ bool ImageLoad::UncompressImageInZip(ImageInfo& imageInfo, uint8_t* buffer, uint
bool ImageLoad::UnzipImage(uint8_t* imageBuffer, uint32_t size, ImageInfo& imageInfo)
{
uint32_t value = 0;
uint32_t count = 0;
if ((imageBuffer == nullptr) || (size == 0)) {
GRAPHIC_LOGE("imageHeader is null.");
return false;
......@@ -98,8 +95,8 @@ bool ImageLoad::UnzipImage(uint8_t* imageBuffer, uint32_t size, ImageInfo& image
*dest++ = *source++;
} else {
source++;
value = *source++;
count = *source++;
uint32_t value = *source++;
uint32_t count = *source++;
if (destEnd < count + dest) {
break;
}
......@@ -130,11 +127,9 @@ bool ImageLoad::Unzip24Image(uint8_t* imageBuffer, uint32_t size, ImageInfo& ima
uint32_t* dest = reinterpret_cast<uint32_t*>(const_cast<uint8_t*>(imageInfo.data));
uint32_t* destEnd = reinterpret_cast<uint32_t*>(const_cast<uint8_t*>(imageInfo.data) + imageInfo.dataSize);
while ((source < sourceEnd) && (dest < destEnd)) {
uint32_t count = 0;
uint32_t value = 0;
// Little endian
value = ((*source)) + (*(source + BITMAP_MID_BIT) << MOVE_LOW) + (*(source + BITMAP_LOW_BIT) << MOVE_HIGH);
uint32_t value = ((*source)) + (*(source + BITMAP_MID_BIT) << MOVE_LOW)
+ (*(source + BITMAP_LOW_BIT) << MOVE_HIGH);
source = source + BITMAP_ZIP_LEN;
if (value != BITMAP_ZIP24_FLAG) {
*dest = value | BITMAP_ALPHA_MASK;
......@@ -143,7 +138,8 @@ bool ImageLoad::Unzip24Image(uint8_t* imageBuffer, uint32_t size, ImageInfo& ima
value = ((*source)) + (*(source + BITMAP_MID_BIT) << MOVE_LOW) + (*(source + BITMAP_LOW_BIT) << MOVE_HIGH);
source = source + BITMAP_ZIP_LEN;
count = ((*source)) + (*(source + BITMAP_MID_BIT) << MOVE_LOW) + (*(source + BITMAP_LOW_BIT) << MOVE_HIGH);
uint32_t count = ((*source)) + (*(source + BITMAP_MID_BIT) << MOVE_LOW)
+ (*(source + BITMAP_LOW_BIT) << MOVE_HIGH);
source = source + BITMAP_ZIP_LEN;
if (count > BITMAP_MAXCON_PIXNUM) {
......
......@@ -56,9 +56,8 @@ void GridLayout::LayoutHorizontal()
int16_t layoutWidth = GetWidth() / cols_;
int16_t layoutHeight = GetHeight() / rows_;
int16_t posX;
int16_t posY;
for (int16_t i = 0; i < rows_; i++) {
posY = i * layoutHeight;
int16_t posY = i * layoutHeight;
for (int16_t j = 0; j < cols_; j++) {
if (child == nullptr) {
return;
......@@ -90,10 +89,9 @@ void GridLayout::LayoutVertical()
int16_t bottom;
int16_t layoutWidth = GetWidth() / cols_;
int16_t layoutHeight = GetHeight() / rows_;
int16_t posX;
int16_t posY;
for (int16_t i = 0; i < cols_; i++) {
posX = i * layoutWidth;
int16_t posX = i * layoutWidth;
for (int16_t j = 0; j < rows_; j++) {
if (child == nullptr) {
return;
......
......@@ -123,7 +123,8 @@ void RenderBase::BlendColorHSpan(int32_t x, int32_t y, int32_t len, const Rgba8T
pixfmtType_->BlendColorHSpan(x, y, len, colors, covers, cover);
}
bool RenderBase::ColorHSpanHandler(int32_t& x, int32_t& y, int32_t& len, const Rgba8T*& colors, const uint8_t*& covers)
bool RenderBase::ColorHSpanHandler(int32_t& x, const int32_t& y, int32_t& len, const Rgba8T*& colors,
const uint8_t*& covers) const
{
if (y > GetYMax() || y < GetYMin()) {
return false;
......
......@@ -191,7 +191,8 @@ public:
* @param covers Scan line corresponding coverage array.
* @return Returns true if should run the follow programs.
*/
bool ColorHSpanHandler(int32_t& x, int32_t& y, int32_t& len, const Rgba8T*& colors, const uint8_t*& covers);
bool ColorHSpanHandler(int32_t& x, const int32_t& y, int32_t& len, const Rgba8T*& colors,
const uint8_t*& covers) const;
private:
RenderPixfmtRgbaBlend* pixfmtType_;
......
......@@ -216,7 +216,6 @@ void BlendSourceAtop(RasterizerScanlineAntialias& raster1, RasterizerScanlineAnt
if (y1 == y2) {
raster1.SweepScanline(scanline1);
y1 = scanline1.GetYLevel();
span1 = scanline1.Begin();
}
}
}
......@@ -325,7 +324,6 @@ void BlendSourceOut(RasterizerScanlineAntialias& raster1, RasterizerScanlineAnti
if (y1 == y2 && y1 < raster2.GetMaxY() - 1) {
if (raster1.SweepScanline(scanline1)) {
y1 = scanline1.GetYLevel();
span1 = scanline1.Begin();
}
}
}
......@@ -489,7 +487,6 @@ void BlendXOR(RasterizerScanlineAntialias& raster1, RasterizerScanlineAntialias&
if (y1 == y2 && y1 < raster2.GetMaxY() - 1) {
if (raster1.SweepScanline(scanline1)) {
y1 = scanline1.GetYLevel();
span1 = scanline1.Begin();
}
}
}
......@@ -616,7 +613,6 @@ void BlendSourceInLoop(RasterizerScanlineAntialias& raster1, GeometryScanline& s
if (y1 == y2) {
raster1.SweepScanline(scanline1);
y1 = scanline1.GetYLevel();
span1 = scanline1.Begin();
}
}
......
......@@ -15,6 +15,7 @@
#include "ui_auto_test.h"
#include <sys/time.h>
#include "auto_test_manager.h"
#include "components/root_view.h"
#include "components/ui_view_group.h"
......
......@@ -25,7 +25,7 @@ namespace OHOS {
#if USE_KEY
class KeyInput : public KeyInputDevice {
public:
KeyInput() {}
KeyInput() : leftButtonDown_(false), lastX_(0), lastY_(0) {}
virtual ~KeyInput() {}
static KeyInput* GetInstance();
bool Read(DeviceData& data) override;
......
......@@ -28,7 +28,7 @@ public:
QMetaObject::connectSlotsByName(MainWidget);
} // setupUi
void retranslateUi(QWidget* MainWidget)
static void retranslateUi(QWidget* MainWidget)
{
MainWidget->setWindowTitle(QCoreApplication::translate("MainWidget", "MainWidget", nullptr));
} // retranslateUi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册