summaryrefslogtreecommitdiffstats
path: root/src/ui/widget/page-sizer.cpp
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/ui/widget/page-sizer.cpp
parentMakes page sizes in document properties customizable (diff)
downloadinkscape-f38df8df7662d71f60f6a5aee8eb980a05b863a2.tar.gz
inkscape-f38df8df7662d71f60f6a5aee8eb980a05b863a2.zip
Fix typos
Diffstat (limited to 'src/ui/widget/page-sizer.cpp')
-rw-r--r--src/ui/widget/page-sizer.cpp21
1 files changed, 11 insertions, 10 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);