summaryrefslogtreecommitdiff
path: root/libreofficekit/qa/tilebench
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-08-10 20:47:32 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-08-11 11:20:43 +0200
commit2d582244680e7f6dec6e4a466e276f93ccb01dc9 (patch)
treeb0e880ddfb3ce1ea2f47151b648e7fbb55132f08 /libreofficekit/qa/tilebench
parent74012c48d99634a7556a86f77e9522024f2afdb2 (diff)
loplugin:flatten
Change-Id: I6560756eb63856a22b43e3e65a7b7843cd2d5376 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100447 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'libreofficekit/qa/tilebench')
-rw-r--r--libreofficekit/qa/tilebench/tilebench.cxx46
1 files changed, 23 insertions, 23 deletions
diff --git a/libreofficekit/qa/tilebench/tilebench.cxx b/libreofficekit/qa/tilebench/tilebench.cxx
index 8f06cc16b2fd..978b7aa5eaa0 100644
--- a/libreofficekit/qa/tilebench/tilebench.cxx
+++ b/libreofficekit/qa/tilebench/tilebench.cxx
@@ -488,33 +488,33 @@ static void kitCallback(int nType, const char* pPayload, void* pData)
nDialogId = aRoot.get<unsigned>("id");
const std::string aAction = aRoot.get<std::string>("action");
- if (aAction == "created")
- {
- const std::string aType = aRoot.get<std::string>("type");
- const std::string aSize = aRoot.get<std::string>("size");
- int nWidth = atoi(aSize.c_str());
- int nHeight = 400;
- const char *pComma = strstr(aSize.c_str(), ", ");
- if (pComma)
- nHeight = atoi(pComma + 2);
- std::cerr << "Size " << aSize << " is " << nWidth << ", " << nHeight << "\n";
-
- if (aType == "dialog")
- {
- aTimes.emplace_back(); // complete wait for dialog
+ if (aAction != "created")
+ return;
- unsigned char *pBuffer = new unsigned char[nWidth * nHeight * 4];
+ const std::string aType = aRoot.get<std::string>("type");
+ const std::string aSize = aRoot.get<std::string>("size");
+ int nWidth = atoi(aSize.c_str());
+ int nHeight = 400;
+ const char *pComma = strstr(aSize.c_str(), ", ");
+ if (pComma)
+ nHeight = atoi(pComma + 2);
+ std::cerr << "Size " << aSize << " is " << nWidth << ", " << nHeight << "\n";
- aTimes.emplace_back("render dialog");
- pDocument->paintWindow(nDialogId, pBuffer, 0, 0, nWidth, nHeight);
- dumpTile("dialog", nWidth, nHeight, pDocument->getTileMode(), pBuffer);
- aTimes.emplace_back();
+ if (aType != "dialog")
+ return;
- delete[] pBuffer;
+ aTimes.emplace_back(); // complete wait for dialog
- bDialogRendered = true;
- }
- }
+ unsigned char *pBuffer = new unsigned char[nWidth * nHeight * 4];
+
+ aTimes.emplace_back("render dialog");
+ pDocument->paintWindow(nDialogId, pBuffer, 0, 0, nWidth, nHeight);
+ dumpTile("dialog", nWidth, nHeight, pDocument->getTileMode(), pBuffer);
+ aTimes.emplace_back();
+
+ delete[] pBuffer;
+
+ bDialogRendered = true;
}
static void testDialog( Document *pDocument, const char *uno_cmd )