Comment 24 for bug 909328

Revision history for this message
Kris (kris-degussem) wrote :

John, I'm still having the errors when compiling on vista 64 bit that I let you know by mail:
--------------------------
Make error line 289: problem compiling: src/ui/dialog/find.cpp: In member functi
on 'bool Inkscape::UI::Dialog::Find::item_id_match(SPItem*, const gchar*, bool,
bool, bool)':
src/ui/dialog/find.cpp:318:50: error: 'strcasestr' was not declared in this scop
e
src/ui/dialog/find.cpp: In member function 'bool Inkscape::UI::Dialog::Find::ite
m_text_match(SPItem*, const gchar*, bool, bool, bool)':
src/ui/dialog/find.cpp:358:58: error: 'strcasestr' was not declared in this scop
e
src/ui/dialog/find.cpp: In member function 'bool Inkscape::UI::Dialog::Find::ite
m_style_match(SPItem*, const gchar*, bool, bool, bool)':
src/ui/dialog/find.cpp:405:55: error: 'strcasestr' was not declared in this scop
e
src/ui/dialog/find.cpp: At global scope:
src/ui/dialog/find.cpp:422:6: warning: unused parameter 'casematch' [-Wunused-pa
rameter]
src/ui/dialog/find.cpp: In member function 'bool Inkscape::UI::Dialog::Find::ite
m_attrvalue_match(SPItem*, const gchar*, bool, bool, bool)':
src/ui/dialog/find.cpp:457:67: error: 'strcasestr' was not declared in this scop
e
src/ui/dialog/find.cpp: At global scope:
src/ui/dialog/find.cpp:479:6: warning: unused parameter 'replace' [-Wunused-para
meter]
--------------------------

I also ran cppcheck on the file and a memory leak for "text" is reported on line 546. This warning/error is not truely valid, though I would rewrite line 541 to 548 from:
--------------------------
    const gchar* text = g_strdup(entry_find.get_text().c_str());

    GSList *in = l;
    GSList *out = NULL;

    if (strlen (text) == 0) {
        return in;
    }
--------------------------

into the following:
--------------------------
   Glib::ustring tmpstring = entry_find.get_text();
    if (tmpstring.empty())
    {
        return l;
    }
    const gchar* text = g_strdup(tmpstring.c_str());

    GSList *in = l;
    GSList *out = NULL;
--------------------------