summaryrefslogtreecommitdiffstats
path: root/src/xml/repr-css.cpp
diff options
context:
space:
mode:
authorDavid Mathog <>2012-09-27 06:53:09 +0000
committer~suv <suv-sf@users.sourceforge.net>2012-09-27 06:53:09 +0000
commit4f6a0817564a58c88567ddf6a6bd50dc9e7de12f (patch)
treebfd97629b714606ed934d4fad499645a815834f7 /src/xml/repr-css.cpp
parentinitial changes to address problem of importing chunks of text into something... (diff)
downloadinkscape-4f6a0817564a58c88567ddf6a6bd50dc9e7de12f.tar.gz
inkscape-4f6a0817564a58c88567ddf6a6bd50dc9e7de12f.zip
fix for 'em' and 'ex' units support
(See also: bug #1036010) (bzr r11668.1.18)
Diffstat (limited to 'src/xml/repr-css.cpp')
-rw-r--r--src/xml/repr-css.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/xml/repr-css.cpp b/src/xml/repr-css.cpp
index 7fba4d7c6..e0497978a 100644
--- a/src/xml/repr-css.cpp
+++ b/src/xml/repr-css.cpp
@@ -361,8 +361,10 @@ static void sp_repr_css_merge_from_decl(SPCSSAttr *css, CRDeclaration const *con
* HACK for now is to strip off em and ex units and add them back at the end
*/
int l = strlen(value_unquoted);
- if (!strncmp(&value_unquoted[l-2], "em", 2) ||
- !strncmp(&value_unquoted[l-2], "ex", 2)) {
+ if (l>2 &&
+ (!strncmp(&value_unquoted[l-2], "em", 2) ||
+ !strncmp(&value_unquoted[l-2], "ex", 2)
+ )) {
units = g_strndup(&value_unquoted[l-2], 2);
value_unquoted = g_strndup(value_unquoted, l-2);
}