summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2018-10-19 18:59:50 +0000
committerMarc Jeanmougin <marc@jeanmougin.fr>2018-10-19 18:59:50 +0000
commitf38df8df7662d71f60f6a5aee8eb980a05b863a2 (patch)
tree05de72368a04f56fa07e5daba2cfa9c7150c2d33 /src
parentMakes page sizes in document properties customizable (diff)
downloadinkscape-f38df8df7662d71f60f6a5aee8eb980a05b863a2.tar.gz
inkscape-f38df8df7662d71f60f6a5aee8eb980a05b863a2.zip
Fix typos
Diffstat (limited to 'src')
-rw-r--r--src/ui/widget/page-sizer.cpp21
-rw-r--r--src/ui/widget/pages-skeleton.h36
2 files changed, 29 insertions, 28 deletions
diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp
index 9c03367ee..313ca87d5 100644
--- a/src/ui/widget/page-sizer.cpp
+++ b/src/ui/widget/page-sizer.cpp
@@ -111,22 +111,23 @@ PageSizer::PageSizer(Registry & _wr)
char *path = Inkscape::IO::Resource::profile_path("pages.csv");
if (!g_file_test(path, G_FILE_TEST_EXISTS)) {
- if (!g_file_set_contents(path, pages_skeleton,sizeof(pages_skeleton) , nullptr)) {
+ if (!g_file_set_contents(path, pages_skeleton, sizeof(pages_skeleton) , nullptr)) {
g_warning(_("Failed to create the page file."));
}
}
-
+
gchar *content = nullptr;
- if (g_file_get_contents (path, &content, nullptr, NULL)) {
+ if (g_file_get_contents(path, &content, nullptr, nullptr)) {
- gchar **lines = g_strsplit_set (content, "\n", 0);
+ gchar **lines = g_strsplit_set(content, "\n", 0);
for (int i = 0; lines && lines[i]; ++i) {
- gchar **line = g_strsplit_set (lines[i], ",", 5);
- if(!line[0] || !line[1] || !line[2] || !line[3] ) continue;
+ gchar **line = g_strsplit_set(lines[i], ",", 5);
+ if (!line[0] || !line[1] || !line[2] || !line[3] || line[0][0]=='#')
+ continue;
//name, width, height, unit
- double width = g_ascii_strtod (line[1], nullptr);
- double height = g_ascii_strtod (line[2], nullptr);
+ double width = g_ascii_strtod(line[1], nullptr);
+ double height = g_ascii_strtod(line[2], nullptr);
Glib::ustring name = line[0];
char formatBuf[80];
snprintf(formatBuf, 79, "%0.1f x %0.1f", width, height);
@@ -138,9 +139,9 @@ PageSizer::PageSizer(Registry & _wr)
row[_paperSizeListColumns.nameColumn] = name;
row[_paperSizeListColumns.descColumn] = desc;
g_strfreev(line);
- }
+ }
g_strfreev(lines);
- g_free (content);
+ g_free(content);
}
pack_start (_paperSizeListScroller, true, true, 0);
diff --git a/src/ui/widget/pages-skeleton.h b/src/ui/widget/pages-skeleton.h
index 928b87772..348f24f4d 100644
--- a/src/ui/widget/pages-skeleton.h
+++ b/src/ui/widget/pages-skeleton.h
@@ -3,57 +3,57 @@
/** \note
- * The ISO page sizesing the table below differ from ghostscript's idea of page sizes (by
+ * The ISO page sizes in the table below differ from ghostscript's idea of page sizes (by
* less than 1pt). Being off by <1pt should be OK for most purposes, but may cause fuzziness
* (antialiasing) problems when printing to 72dpi or 144dpi printers or bitmap files due to
- * postscript's different coordinate system (y=0 meaning bottom of pageing postscript and top
- * of pageing SVG). I haven't lookedingto whether this doesing fact cause fuzziness, I merely
+ * postscript's different coordinate system (y=0 meaning bottom of page in postscript and top
+ * of page in SVG). I haven't looked into whether this does in fact cause fuzziness, I merely
* note the possibility. Rounding done by extension/internal/ps.cpp (e.g. floor/ceil calls)
* will also affect whether fuzziness occurs.
*
- * The remainder of this comment discusses the origin of the numbers used for ISO page sizesing
- * this table anding ghostscript.
+ * The remainder of this comment discusses the origin of the numbers used for ISO page sizes in
+ * this table and in ghostscript.
*
- * The versions here,ingmm, are the official sizes according to
+ * The versions here, in mm, are the official sizes according to
* <a href="http://en.wikipedia.org/wiki/Paper_sizes">http://en.wikipedia.org/wiki/Paper_sizes</a>
- * at 2005-01-25. (The ISO entriesing the below table
+ * at 2005-01-25. (The ISO entries in the below table
* were produced mechanically from the table on that page.)
*
- * (The rule seems to be that A0, B0, ..., D0. sizes are rounded to the nearest number ofmm
+ * (The rule seems to be that A0, B0, ..., D0. sizes are rounded to the nearest number of mm
* from the "theoretical size" (i.e. 1000 * sqrt(2) or pow(2.0, .25) or the like), whereas
* going from e.g. A0 to A1 always take the floor of halving -- which by chance coincides
- * exactly with flooring the "theoretical size" for n != 0ingstead of the rounding to nearest
+ * exactly with flooring the "theoretical size" for n != 0 instead of the rounding to nearest
* done for n==0.)
*
- * Ghostscript paper sizes are givening gs_statd.ps according to gs(1). gs_statd.ps always
- * uses aningteger number ofpt: sometimes gs_statd.ps rounds to nearest (e.g. a1), sometimes
+ * Ghostscript paper sizes are given in gs_statd.ps according to gs(1). gs_statd.ps always
+ * uses an integer number ofpt: sometimes gs_statd.ps rounds to nearest (e.g. a1), sometimes
* floors (e.g. a10), sometimes ceils (e.g. a8).
*
* I'm not sure how ghostscript's gs_statd.ps was calculated: it isn't just rounding the
* "theoretical size" of each page topt (see a0), nor is it rounding the a0 size times an
* appropriate power of two (see a1). Possibly it was prepared manually, with a human applying
- *ingconsistent rounding rules when converting frommm topt.
+ * inconsistent rounding rules when converting from mm to pt.
*/
/** \todo
- * Should weingclude the JIS B series (useding Japan)
+ * Should we include the JIS B series (used in Japan)
* (JIS B0 is sometimes called JB0, and similarly for JB1 etc)?
* Should we exclude B7--B10 and A7--10 to make the list smaller ?
- * Should weingclude any of the ISO C, D and E series (see below) ?
+ * Should we include any of the ISO C, D and E series (see below) ?
*/
/* See http://www.hbp.com/content/PCR_envelopes.cfm for a much larger list of US envelope
sizes. */
- /* Note that `Folio' (useding QPrinter/KPrinter) is deliberately absent from this list, as it
+ /* Note that `Folio' (used in QPrinter/KPrinter) is deliberately absent from this list, as it
means different sizes to different people: different people may expect the width to be
- either 8, 8.25 or 8.5ingches, and the height to be either 13 or 13.5ingches, even
- restricting ouringterpretation to foolscap folio. If you wish toingtroduce a folio-like
+ either 8, 8.25 or 8.5 inches, and the height to be either 13 or 13.5 inches, even
+ restricting our interpretation to foolscap folio. If you wish to introduce a folio-like
page size to the list, then please consider using a name more specific than just `Folio' or
`Foolscap Folio'. */
static char const pages_skeleton[] =
-"#comma-separated : NAME - WIDTH - HEIGHT - UNIT; name and unit should have no spacing before or after\n"
+"#comma-separated : NAME - WIDTH - HEIGHT - UNIT; name and unit must have no spacing before or after\n"
"A4, 210, 297,mm\n"
"US Letter, 8.5, 11,in\n"
"US Legal, 8.5, 14,in\n"