summaryrefslogtreecommitdiff
path: root/libreofficekit/qa
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-12 20:20:43 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-12 20:20:43 +0100
commit4fdd5eff7d4e10eb0a709c79b30b7411e4297d42 (patch)
tree59b024f9e767dcecac75c1e80b9336c45b0d3724 /libreofficekit/qa
parent4b557ffbccf4062b0626ab8d068fa6103ba6a837 (diff)
More loplugin:cstylecast: libreofficekit
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: Iaa166a248f5c1e9fcf62834f65475265403e4322
Diffstat (limited to 'libreofficekit/qa')
-rw-r--r--libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx20
-rw-r--r--libreofficekit/qa/tilebench/tilebench.cxx8
2 files changed, 14 insertions, 14 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx b/libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx
index 5db79514aa4a..75c4bae71df5 100644
--- a/libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx
@@ -137,7 +137,7 @@ gtv_lok_dialog_signal_button(GtkWidget* pDialogDrawingArea, GdkEventButton* pEve
g_info("lok_dialog_signal_button (type: %s): %d, %d",
aEventType.c_str(),
- (int)pEvent->x, (int)pEvent->y);
+ static_cast<int>(pEvent->x), static_cast<int>(pEvent->y));
gtk_widget_grab_focus(pDialogDrawingArea);
switch (pEvent->type)
@@ -219,9 +219,9 @@ gtv_lok_dialog_signal_motion(GtkWidget* pDialogDrawingArea, GdkEventButton* pEve
LibreOfficeKitDocument* pDocument = lok_doc_view_get_document(LOK_DOC_VIEW(window->lokdocview));
g_info("lok_dialog_signal_motion: %d, %d (in twips: %d, %d)",
- (int)pEvent->x, (int)pEvent->y,
- (int)pixelToTwip(pEvent->x),
- (int)pixelToTwip(pEvent->y));
+ static_cast<int>(pEvent->x), static_cast<int>(pEvent->y),
+ static_cast<int>(pixelToTwip(pEvent->x)),
+ static_cast<int>(pixelToTwip(pEvent->y)));
pDocument->pClass->postWindowMouseEvent(pDocument,
priv->dialogid,
@@ -515,9 +515,9 @@ gtv_lok_dialog_floating_win_signal_button(GtkWidget* /*pDialogChildDrawingArea*/
g_info("lok_dialog_floating_win_signal_button (type: %s): %d, %d (in twips: %d, %d)",
aEventType.c_str(),
- (int)pEvent->x, (int)pEvent->y,
- (int)pixelToTwip(pEvent->x),
- (int)pixelToTwip(pEvent->y));
+ static_cast<int>(pEvent->x), static_cast<int>(pEvent->y),
+ static_cast<int>(pixelToTwip(pEvent->x)),
+ static_cast<int>(pixelToTwip(pEvent->y)));
switch (pEvent->type)
{
@@ -598,9 +598,9 @@ gtv_lok_dialog_floating_win_signal_motion(GtkWidget* /*pDialogDrawingArea*/, Gdk
LibreOfficeKitDocument* pDocument = lok_doc_view_get_document(LOK_DOC_VIEW(window->lokdocview));
g_info("lok_dialog_floating_win_signal_motion: %d, %d (in twips: %d, %d)",
- (int)pEvent->x, (int)pEvent->y,
- (int)pixelToTwip(pEvent->x),
- (int)pixelToTwip(pEvent->y));
+ static_cast<int>(pEvent->x), static_cast<int>(pEvent->y),
+ static_cast<int>(pixelToTwip(pEvent->x)),
+ static_cast<int>(pixelToTwip(pEvent->y)));
pDocument->pClass->postWindowMouseEvent(pDocument,
priv->m_nChildId,
diff --git a/libreofficekit/qa/tilebench/tilebench.cxx b/libreofficekit/qa/tilebench/tilebench.cxx
index 61bc562ae9a7..751fb179169f 100644
--- a/libreofficekit/qa/tilebench/tilebench.cxx
+++ b/libreofficekit/qa/tilebench/tilebench.cxx
@@ -33,8 +33,8 @@ static double getTimeNow()
{
TimeValue aValue;
osl_getSystemTime(&aValue);
- return (double)aValue.Seconds +
- (double)aValue.Nanosec / (1000*1000*1000);
+ return static_cast<double>(aValue.Seconds) +
+ static_cast<double>(aValue.Nanosec) / (1000*1000*1000);
}
/// Dump an array of RGBA or BGRA to an RGB PPM file.
@@ -149,7 +149,7 @@ int main( int argc, char* argv[] )
// Estimate the maximum tiles based on the number of parts requested, if Writer.
if (pDocument->getDocumentType() == LOK_DOCTYPE_TEXT)
- max_tiles = (int)ceil(max_parts * 16128. / nTilePixelHeight) * ceil((double)nWidth / nTilePixelWidth);
+ max_tiles = static_cast<int>(ceil(max_parts * 16128. / nTilePixelHeight)) * ceil(static_cast<double>(nWidth) / nTilePixelWidth);
fprintf(stderr, "Parts to render: %d, Total Parts: %d, Max parts: %d, Max tiles: %d\n", nParts, nTotalParts, max_parts, max_tiles);
std::vector<unsigned char> vBuffer(nTilePixelWidth * nTilePixelHeight * 4);
@@ -204,7 +204,7 @@ int main( int argc, char* argv[] )
aTimes.emplace_back("render sub-regions at scale");
int nMaxTiles = max_tiles;
if (pDocument->getDocumentType() == LOK_DOCTYPE_TEXT)
- nMaxTiles = (int)ceil(max_parts * 16128. / nTileTwipHeight) * ceil((double)nWidth / nTileTwipWidth);
+ nMaxTiles = static_cast<int>(ceil(max_parts * 16128. / nTileTwipHeight)) * ceil(static_cast<double>(nWidth) / nTileTwipWidth);
int nTiles = 0;
for (int nY = 0; nY < nHeight - 1; nY += nTileTwipHeight)
{