Code

Tweaked smaller size to be 3/4ths the menu size
[inkscape.git] / src / text-context.cpp
index a181f4f6fb22d70f63128da9fe536da50ce68dd3..3fcb3058a354e41325e34be204dc7bc2d14dfeae 100644 (file)
@@ -180,9 +180,9 @@ sp_text_context_dispose(GObject *obj)
         sp_canvas_item_ungrab(tc->grabbed, GDK_CURRENT_TIME);
         tc->grabbed = NULL;
     }
-    
+
     Inkscape::Rubberband::get()->stop();
-    
+
     if (ec->shape_knot_holder) {
         sp_knot_holder_destroy(ec->shape_knot_holder);
         ec->shape_knot_holder = NULL;
@@ -258,7 +258,6 @@ sp_text_context_setup(SPEventContext *ec)
             ec->shape_repr = shape_repr;
             Inkscape::GC::anchor(shape_repr);
             sp_repr_add_listener(shape_repr, &ec_shape_repr_events, ec);
-            sp_repr_synthesize_events(shape_repr, &ec_shape_repr_events, ec);
         }
     }
 
@@ -413,14 +412,14 @@ sp_text_context_item_handler(SPEventContext *ec, SPItem *item, GdkEvent *event)
                     if (new_end < tc->text_sel_start) {
                         if (!layout->isStartOfWord(new_end))
                             new_end.prevStartOfWord();
-                    } else 
+                    } else
                         if (!layout->isEndOfWord(new_end))
                             new_end.nextEndOfWord();
                 } else if (tc->dragging == 3) {
                     // triple-click dragging: go by line
                     if (new_end < tc->text_sel_start)
                         new_end.thisStartOfLine();
-                    else 
+                    else
                         new_end.thisEndOfLine();
                 }
                 // update display
@@ -519,7 +518,8 @@ insert_uni_char(SPTextContext *const tc)
     tc->unipos = 0;
     tc->uni[tc->unipos] = '\0';
 
-    if (!g_unichar_isprint((gunichar) uv)) {
+    if ( !g_unichar_isprint(static_cast<gunichar>(uv))
+         && !(g_unichar_validate(static_cast<gunichar>(uv)) && (g_unichar_type(static_cast<gunichar>(uv)) == G_UNICODE_PRIVATE_USE) ) ) {
         // This may be due to bad input, so it goes to statusbar.
         tc->desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE,
                                            _("Non-printable character"));
@@ -619,7 +619,7 @@ sp_text_context_root_handler(SPEventContext *const ec, GdkEvent *const event)
                 return TRUE;
             }
             break;
-        case GDK_MOTION_NOTIFY: 
+        case GDK_MOTION_NOTIFY:
             if (tc->over_text) {
                 tc->over_text = 0;
                 // update cursor and statusbar: we are not over a text object now
@@ -656,7 +656,7 @@ sp_text_context_root_handler(SPEventContext *const ec, GdkEvent *const event)
 
             }
             break;
-        case GDK_BUTTON_RELEASE: 
+        case GDK_BUTTON_RELEASE:
             if (event->button.button == 1) {
 
                 if (tc->grabbed) {
@@ -1004,7 +1004,7 @@ sp_text_context_root_handler(SPEventContext *const ec, GdkEvent *const event)
                                 if (tc->text) {
                                     if (MOD__CTRL)
                                         cursor_movement_operator = &Inkscape::Text::Layout::iterator::thisStartOfShape;
-                                    else 
+                                    else
                                         cursor_movement_operator = &Inkscape::Text::Layout::iterator::thisStartOfLine;
                                     break;
                                 }
@@ -1014,7 +1014,7 @@ sp_text_context_root_handler(SPEventContext *const ec, GdkEvent *const event)
                                 if (tc->text) {
                                     if (MOD__CTRL)
                                         cursor_movement_operator = &Inkscape::Text::Layout::iterator::nextStartOfShape;
-                                    else 
+                                    else
                                         cursor_movement_operator = &Inkscape::Text::Layout::iterator::thisEndOfLine;
                                     break;
                                 }
@@ -1040,7 +1040,7 @@ sp_text_context_root_handler(SPEventContext *const ec, GdkEvent *const event)
                                                 sp_te_adjust_rotation_screen(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, -10);
                                             } else {
                                                 sp_te_adjust_rotation_screen(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, -1);
-                                            } 
+                                            }
                                         } else {
                                             sp_te_adjust_rotation(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, -90);
                                         }
@@ -1048,7 +1048,7 @@ sp_text_context_root_handler(SPEventContext *const ec, GdkEvent *const event)
                                         sp_text_context_update_cursor(tc);
                                         sp_text_context_update_text_selection(tc);
                                         return TRUE;
-                                    } 
+                                    }
                                 }
                                 break;
                             case GDK_bracketright:
@@ -1060,7 +1060,7 @@ sp_text_context_root_handler(SPEventContext *const ec, GdkEvent *const event)
                                                 sp_te_adjust_rotation_screen(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, 10);
                                             } else {
                                                 sp_te_adjust_rotation_screen(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, 1);
-                                            } 
+                                            }
                                         } else {
                                             sp_te_adjust_rotation(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, 90);
                                         }
@@ -1151,7 +1151,7 @@ sp_text_context_root_handler(SPEventContext *const ec, GdkEvent *const event)
                             tc->grabbed = NULL;
                         }
                         Inkscape::Rubberband::get()->stop();
-                    } 
+                    }
                 }
             }
             break;
@@ -1285,7 +1285,6 @@ sp_text_context_selection_changed(Inkscape::Selection *selection, SPTextContext
             ec->shape_repr = shape_repr;
             Inkscape::GC::anchor(shape_repr);
             sp_repr_add_listener(shape_repr, &ec_shape_repr_events, ec);
-            sp_repr_synthesize_events(shape_repr, &ec_shape_repr_events, ec);
         }
     }