index 6feefec7d69c722de91a6855de8d660a4c8a1ea7..84816ad9c7b52454a8176bb37d675e286026b72b 100644 (file)
--- a/src/helper/png-write.cpp
+++ b/src/helper/png-write.cpp
if (!ebp->status((float) row / ebp->height, ebp->data)) return 0;
}
- num_rows = MIN(num_rows, ebp->sheight);
- num_rows = MIN(num_rows, ebp->height - row);
+ num_rows = MIN(num_rows, static_cast<int>(ebp->sheight));
+ num_rows = MIN(num_rows, static_cast<int>(ebp->height - row));
/* Set area of interest */
// bbox is now set to the entire image to prevent discontinuities
bbox.y1 = row + num_rows;
/* Update to renderable state */
NRGC gc(NULL);
- nr_matrix_set_identity(&gc.transform);
+ gc.transform.set_identity();
nr_arena_item_invoke_update(ebp->root, &bbox, &gc,
NR_ARENA_ITEM_STATE_ALL, NR_ARENA_ITEM_STATE_NONE);
for (int r = 0; r < num_rows; r++) {
guchar *p = NR_PIXBLOCK_PX(&pb) + r * pb.rs;
- for (int c = 0; c < ebp->width; c++) {
+ for (int c = 0; c < static_cast<int>(ebp->width); c++) {
*p++ = ebp->r;
*p++ = ebp->g;
*p++ = ebp->b;
/**
* Export the given document as a Portable Network Graphics (PNG) file.
*
- * \return true if succeeded, false if an error occurred.
+ * \return true if succeeded (or if no action was taken), false if an error occurred.
*/
bool
sp_export_png_file(SPDocument *doc, gchar const *filename,
g_return_val_if_fail(height >= 1, false);
if (!force_overwrite && !sp_ui_overwrite_file(filename)) {
- return false;
+ /* Remark: We return true so as not to invoke an error dialog in case export is cancelled
+ by the user; currently this is safe because the callers only act when false is returned.
+ If this changes in the future we need better distinction of return types (e.g., use int)
+ */
+ return true;
}
// export with maximum blur rendering quality
* (2) a[5] = -a[3] * y1
*/
- NR::Matrix const affine(NR::translate(-x0, -y0)
- * NR::scale(width / (x1 - x0),
+ Geom::Matrix const affine(Geom::Translate(-x0, -y0)
+ * Geom::Scale(width / (x1 - x0),
height / (y1 - y0)));
//SP_PRINT_MATRIX("SVG2PNG", &affine);