Code

Fix drag & drop from swatches - patch by Adonis Papaderos
[inkscape.git] / src / sp-string.cpp
index ddea5abc7ed60bb1b0cdda4abdf8cfb5b6ef2c2b..b424ac3d8c318ee10e14af386b7c4b1f97fa886f 100644 (file)
@@ -121,7 +121,7 @@ sp_string_read_content(SPObject *object)
     if (object->xml_space.value == SP_XML_SPACE_PRESERVE) {
         for ( ; *xml_string ; xml_string = g_utf8_next_char(xml_string) ) {
             gunichar c = g_utf8_get_char(xml_string);
-            if (c == '\n' || c == '\t') c = ' ';
+            if (c == 0xa || c == 0xd || c == '\t') c = ' ';
             string->string += c;
         }
     }
@@ -129,7 +129,7 @@ sp_string_read_content(SPObject *object)
         bool whitespace = false;
         for ( ; *xml_string ; xml_string = g_utf8_next_char(xml_string) ) {
             gunichar c = g_utf8_get_char(xml_string);
-            if (c == '\n') continue;
+            if (c == 0xa || c == 0xd) continue;
             if (c == ' ' || c == '\t') whitespace = true;
             else {
                 if (whitespace && (!string->string.empty() || SP_OBJECT_PREV(object) != NULL))
@@ -166,4 +166,4 @@ sp_string_update(SPObject *object, SPCtx *ctx, unsigned flags)
   fill-column:99
   End:
 */
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :