aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRadek Doulik <rodo@helixcode.com>2000-11-14 02:50:41 +0800
committerRadek Doulik <rodo@src.gnome.org>2000-11-14 02:50:41 +0800
commit10547948acf94603adc56b20b31c3c1dba58ca39 (patch)
treeb204a553c1ea4aa7ac82a737d49a6521f80b87ac
parent1304ecc56e7172830583fb7a4f8e16c4cc07c5c8 (diff)
downloadgsoc2013-evolution-10547948acf94603adc56b20b31c3c1dba58ca39.tar
gsoc2013-evolution-10547948acf94603adc56b20b31c3c1dba58ca39.tar.gz
gsoc2013-evolution-10547948acf94603adc56b20b31c3c1dba58ca39.tar.bz2
gsoc2013-evolution-10547948acf94603adc56b20b31c3c1dba58ca39.tar.lz
gsoc2013-evolution-10547948acf94603adc56b20b31c3c1dba58ca39.tar.xz
gsoc2013-evolution-10547948acf94603adc56b20b31c3c1dba58ca39.tar.zst
gsoc2013-evolution-10547948acf94603adc56b20b31c3c1dba58ca39.zip
extracted function, does reply indentation, use updated editor engine api
2000-11-13 Radek Doulik <rodo@helixcode.com> * listener.c (reply_indent): extracted function, does reply indentation, use updated editor engine api svn path=/trunk/; revision=6560
-rw-r--r--composer/ChangeLog5
-rw-r--r--composer/listener.c24
2 files changed, 24 insertions, 5 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index a9b3305f3f..fd8012455b 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,8 @@
+2000-11-13 Radek Doulik <rodo@helixcode.com>
+
+ * listener.c (reply_indent): extracted function, does reply
+ indentation, use updated editor engine api
+
2000-11-10 Michael Meeks <michael@helixcode.com>
* Makefile.am ($(HTML_EDITOR_GENERATED)): rearrnace
diff --git a/composer/listener.c b/composer/listener.c
index 6d62d49476..90e49e2626 100644
--- a/composer/listener.c
+++ b/composer/listener.c
@@ -64,6 +64,23 @@ resolve_image_url (HTMLEditorListener *l, gchar *url)
return cid;
}
+static void
+reply_indent (HTMLEditorListener *l, CORBA_Environment * ev)
+{
+ if (!HTMLEditor_Engine_paragraph_is_empty (l->composer->editor_engine, ev)) {
+ if (HTMLEditor_Engine_paragraph_previous_is_empty (l->composer->editor_engine, ev))
+ HTMLEditor_Engine_command (l->composer->editor_engine, "cursor-backward", ev);
+ else {
+ HTMLEditor_Engine_command (l->composer->editor_engine, "insert-paragraph", ev);
+ return;
+ }
+
+ }
+ HTMLEditor_Engine_command (l->composer->editor_engine, "style-normal", ev);
+ HTMLEditor_Engine_command (l->composer->editor_engine, "indent-zero", ev);
+ HTMLEditor_Engine_command (l->composer->editor_engine, "italic-off", ev);
+}
+
static CORBA_any *
impl_event (PortableServer_Servant _servant,
const CORBA_char * name, const CORBA_any * arg,
@@ -79,11 +96,8 @@ impl_event (PortableServer_Servant _servant,
/* FIXME check for insert-paragraph command */
data = HTMLEditor_Engine_get_paragraph_data (l->composer->editor_engine, "orig", ev);
if (ev->_major == CORBA_NO_EXCEPTION && data) {
- if (CORBA_TypeCode_equal (data->_type, TC_boolean, ev) && BONOBO_ARG_GET_BOOLEAN (data)) {
- HTMLEditor_Engine_command (l->composer->editor_engine, "style-normal", ev);
- HTMLEditor_Engine_command (l->composer->editor_engine, "indent-zero", ev);
- HTMLEditor_Engine_command (l->composer->editor_engine, "italic-off", ev);
- }
+ if (CORBA_TypeCode_equal (data->_type, TC_boolean, ev) && BONOBO_ARG_GET_BOOLEAN (data))
+ reply_indent (l, ev);
BONOBO_ARG_SET_BOOLEAN (data, CORBA_FALSE);
HTMLEditor_Engine_set_paragraph_data (l->composer->editor_engine, "orig", data, ev);
}