_search = g_strjoinv ("\\\"", g_strsplit (_search, "\"", -1));
_replace = g_strjoinv ("\\\"", g_strsplit (_replace, "\"", -1));
+#if PY_MAJOR_VERSION < 3
ret = g_strdup_printf ("%s"
"search.SearchString = u\"%s\"\n"
"found = document.findFirst(search)\n"
g_strcmp0 (priv->ooo_version, "") == 0 || zak_utils_compare_version (priv->ooo_version, "3.0.0", NULL, &part) > 0 ? "str" : "unicode",
_search,
_replace);
+#else
+ ret = g_strdup_printf ("%s"
+ "search.SearchString = \"%s\"\n"
+ "found = document.findFirst(search)\n"
+ "found.String = %s.replace(found.String, \"%s\", \"%s\")\n",
+ !priv->with_search ? "search = document.createSearchDescriptor()\n" : "",
+ _search,
+ g_strcmp0 (priv->ooo_version, "") == 0 || zak_utils_compare_version (priv->ooo_version, "3.0.0", NULL, &part) > 0 ? "str" : "unicode",
+ _search,
+ _replace);
+#endif
priv->with_search = TRUE;
g_free (_search);