summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorJohn Smith <john.smith7545@yahoo.com>2012-03-23 13:30:43 +0000
committerJohn Smith <removethis.john.q.public@bigmail.com>2012-03-23 13:30:43 +0000
commit64d4659e32867f30f2dfa71c21778a834894ffca (patch)
tree03ef61a1e8a7bf64bde2eecf8aaa3c07b3a6e080 /src/ui
parentFix for 903676 : Replace GtkCList with GtkTreeView in XML Tree, selection bug... (diff)
downloadinkscape-64d4659e32867f30f2dfa71c21778a834894ffca.tar.gz
inkscape-64d4659e32867f30f2dfa71c21778a834894ffca.zip
Fix for 909328 : Dockable Find & Replace dialog, replace ComboBoxText with Entry to fix build error with gtkmm2.4
(bzr r11119)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/dialog/find.cpp25
-rw-r--r--src/ui/dialog/find.h4
-rw-r--r--src/ui/widget/entry.cpp8
-rw-r--r--src/ui/widget/entry.h44
4 files changed, 9 insertions, 72 deletions
diff --git a/src/ui/dialog/find.cpp b/src/ui/dialog/find.cpp
index 1652fbb16..f5745e02b 100644
--- a/src/ui/dialog/find.cpp
+++ b/src/ui/dialog/find.cpp
@@ -358,7 +358,7 @@ Find::item_text_match (SPItem *item, const gchar *find, bool exact, bool casemat
return found;
}
- gchar* replace_text = g_strdup(entry_replace.get_text().c_str());
+ gchar* replace_text = g_strdup(entry_replace.getEntry()->get_text().c_str());
gsize n = find_strcmp_pos(item_text, ufind.c_str(), exact, casematch);
static Inkscape::Text::Layout::iterator _begin_w;
static Inkscape::Text::Layout::iterator _end_w;
@@ -398,7 +398,7 @@ Find::item_id_match (SPItem *item, const gchar *id, bool exact, bool casematch,
bool found = find_strcmp(item_id, id, exact, casematch);
if (found && replace) {
- gchar * replace_text = g_strdup(entry_replace.get_text().c_str());
+ gchar * replace_text = g_strdup(entry_replace.getEntry()->get_text().c_str());
Glib::ustring new_item_style = find_replace(item_id, id, replace_text , exact, casematch, true);
if (new_item_style != item_id) {
item->getRepr()->setAttribute("id", new_item_style.data());
@@ -424,7 +424,7 @@ Find::item_style_match (SPItem *item, const gchar *text, bool exact, bool casema
bool found = find_strcmp(item_style, text, exact, casematch);
if (found && replace) {
- gchar * replace_text = g_strdup(entry_replace.get_text().c_str());
+ gchar * replace_text = g_strdup(entry_replace.getEntry()->get_text().c_str());
Glib::ustring new_item_style = find_replace(item_style, text, replace_text , exact, casematch, true);
if (new_item_style != item_style) {
item->getRepr()->setAttribute("style", new_item_style.data());
@@ -478,7 +478,7 @@ bool Find::item_attrvalue_match(SPItem *item, const gchar *text, bool exact, boo
}
if (found && replace) {
- gchar * replace_text = g_strdup(entry_replace.get_text().c_str());
+ gchar * replace_text = g_strdup(entry_replace.getEntry()->get_text().c_str());
Glib::ustring new_item_style = find_replace(attr_value, text, replace_text , exact, casematch, true);
if (new_item_style != attr_value) {
item->getRepr()->setAttribute(key, new_item_style.data());
@@ -519,7 +519,7 @@ bool Find::item_font_match(SPItem *item, const gchar *text, bool exact, bool cas
if (found) {
ret = true;
if (_action_replace) {
- gchar *replace_text = g_strdup(entry_replace.get_text().c_str());
+ gchar *replace_text = g_strdup(entry_replace.getEntry()->get_text().c_str());
gchar *orig_str = g_strdup(token.c_str());
// Exact match fails since the "font-family:" is in the token, since the find was exact it still works with false below
Glib::ustring new_item_style = find_replace(orig_str, text, replace_text , false /*exact*/, casematch, true);
@@ -550,7 +550,7 @@ bool Find::item_font_match(SPItem *item, const gchar *text, bool exact, bool cas
GSList *
Find::filter_fields (GSList *l, bool exact, bool casematch)
{
- Glib::ustring tmp = entry_find.get_text();
+ Glib::ustring tmp = entry_find.getEntry()->get_text();
if (tmp.empty()) {
return l;
}
@@ -778,7 +778,7 @@ Find::onFind()
void
Find::onReplace()
{
- if (entry_find.get_text().length() < 1) {
+ if (entry_find.getEntry()->get_text().length() < 1) {
status.set_text(_("Nothing to replace"));
return;
}
@@ -799,17 +799,6 @@ Find::onAction()
bool casematch = check_case_sensitive.get_active();
blocked = true;
- // Add find/replace text to combobox list
- if (entry_find.get_text().length() > 0) {
- entry_find.remove_text(entry_find.get_text());
- entry_find.prepend_text(entry_find.get_text());
- }
-
- if (_action_replace && entry_replace.get_text().length() > 0) {
- entry_replace.remove_text(entry_replace.get_text());
- entry_replace.prepend_text(entry_replace.get_text());
- }
-
GSList *l = NULL;
if (check_scope_selection.get_active()) {
if (check_scope_layer.get_active()) {
diff --git a/src/ui/dialog/find.h b/src/ui/dialog/find.h
index 26ac37d7f..62ecd1763 100644
--- a/src/ui/dialog/find.h
+++ b/src/ui/dialog/find.h
@@ -198,8 +198,8 @@ private:
/*
* Find and replace combo box widgets
*/
- Inkscape::UI::Widget::ComboBoxText entry_find;
- Inkscape::UI::Widget::ComboBoxText entry_replace;
+ Inkscape::UI::Widget::Entry entry_find;
+ Inkscape::UI::Widget::Entry entry_replace;
/**
* Scope and search in widgets
diff --git a/src/ui/widget/entry.cpp b/src/ui/widget/entry.cpp
index 08617433c..173e014d9 100644
--- a/src/ui/widget/entry.cpp
+++ b/src/ui/widget/entry.cpp
@@ -25,14 +25,6 @@ Entry::Entry( Glib::ustring const &label, Glib::ustring const &tooltip,
{
}
-ComboBoxText::ComboBoxText( Glib::ustring const &label, Glib::ustring const &tooltip,
- Glib::ustring const &suffix,
- Glib::ustring const &icon,
- bool mnemonic)
- : Labelled(label, tooltip, new Gtk::ComboBoxText(true), suffix, icon, mnemonic)
-{
-}
-
} // namespace Widget
} // namespace UI
} // namespace Inkscape
diff --git a/src/ui/widget/entry.h b/src/ui/widget/entry.h
index be7c8b450..53b848fc9 100644
--- a/src/ui/widget/entry.h
+++ b/src/ui/widget/entry.h
@@ -37,50 +37,6 @@ public:
Gtk::Entry* getEntry() {return (Gtk::Entry*)(_widget);};
};
-class ComboBoxText : public Labelled
-{
-public:
- ComboBoxText( Glib::ustring const &label,
- Glib::ustring const &tooltip,
- Glib::ustring const &suffix = "",
- Glib::ustring const &icon = "",
- bool mnemonic = true);
-
- Gtk::ComboBoxText* getWidget() { return (Gtk::ComboBoxText *)_widget; };
- Gtk::Entry* getEntry() { return (Gtk::Entry *)getWidget()->get_child(); };
- Glib::ustring get_text() { return getEntry()->get_text(); };
- void prepend_text(const Glib::ustring& text) {
-#if WITH_GTKMM_2_24
- getWidget()->prepend(text);
-#else
- getWidget()->prepend_text(text);
-#endif
- };
- void append_text(const Glib::ustring& text) {
-#if WITH_GTKMM_2_24
- getWidget()->append(text);
-#else
- getWidget()->append_text(text);
-#endif
- };
- void insert_text(gint position, const Glib::ustring& text) {
-#if WITH_GTKMM_2_24
- getWidget()->insert(position, text);
-#else
- getWidget()->insert_text(position, text);
-#endif
- };
- void remove_text(const Glib::ustring& text) { getWidget()->remove_text(text); };
- void remove_all() {
-#if WITH_GTKMM_2_24
- getWidget()->remove_all();
-#else
- getWidget()->clear_items();
-#endif
- };
-
-};
-
} // namespace Widget
} // namespace UI
} // namespace Inkscape