summaryrefslogtreecommitdiff
path: root/dw
diff options
context:
space:
mode:
Diffstat (limited to 'dw')
-rw-r--r--dw/findtext.cc3
-rw-r--r--dw/fltkplatform.cc3
-rw-r--r--dw/fltkui.cc23
-rw-r--r--dw/hyphenator.cc3
-rw-r--r--dw/image.cc3
-rw-r--r--dw/layout.cc5
-rw-r--r--dw/style.cc3
-rw-r--r--dw/textblock.cc2
8 files changed, 26 insertions, 19 deletions
diff --git a/dw/findtext.cc b/dw/findtext.cc
index 94b963ea..0a4d25c5 100644
--- a/dw/findtext.cc
+++ b/dw/findtext.cc
@@ -20,6 +20,7 @@
#include "core.hh"
+#include "dlib/dlib.h"
#include "../lout/debug.hh"
#include "../lout/msg.h"
@@ -87,7 +88,7 @@ FindtextState::Result FindtextState::search (const char *key, bool caseSens,
newKey = true;
if (this->key)
free(this->key);
- this->key = strdup (key);
+ this->key = dStrdup (key);
this->caseSens = caseSens;
if (nexttab)
diff --git a/dw/fltkplatform.cc b/dw/fltkplatform.cc
index 0b7ee2e9..f5d686c4 100644
--- a/dw/fltkplatform.cc
+++ b/dw/fltkplatform.cc
@@ -19,6 +19,7 @@
#include <stdio.h>
+#include "dlib/dlib.h"
#include "../lout/msg.h"
#include "../lout/debug.hh"
#include "fltkcore.hh"
@@ -145,7 +146,7 @@ void FltkFont::initSystemFonts ()
int k = Fl::set_fonts ("-*-iso10646-1");
for (int i = 0; i < k; i++) {
int t;
- char *name = strdup (Fl::get_font_name ((Fl_Font) i, &t));
+ char *name = dStrdup (Fl::get_font_name ((Fl_Font) i, &t));
// normalize font family names (strip off "bold", "italic")
if (t & FL_ITALIC)
diff --git a/dw/fltkui.cc b/dw/fltkui.cc
index e454f85b..c650712a 100644
--- a/dw/fltkui.cc
+++ b/dw/fltkui.cc
@@ -22,6 +22,7 @@
#include "fltkcore.hh"
#include "fltkflatview.hh"
#include "fltkcomplexbutton.hh"
+#include "dlib/dlib.h"
#include "../lout/msg.h"
#include "../lout/misc.hh"
@@ -112,7 +113,7 @@ void CustInput2::set_placeholder(const char *str)
{
if (placeholder)
free(placeholder);
- placeholder = strdup(str);
+ placeholder = dStrdup(str);
if ((Fl::focus() != this) && !*value()) {
show_placeholder();
@@ -276,7 +277,7 @@ void CustTextEditor::set_placeholder(const char *str)
{
if (placeholder)
free(placeholder);
- placeholder = strdup(str);
+ placeholder = dStrdup(str);
if ((Fl::focus() != this) && buffer()->length() == 0) {
show_placeholder();
@@ -315,7 +316,7 @@ char* CustTextEditor::value()
*/
if (text_copy)
free(text_copy);
- text_copy = showing_placeholder ? strdup("") : buffer()->text();
+ text_copy = showing_placeholder ? dStrdup("") : buffer()->text();
return text_copy;
}
@@ -625,7 +626,7 @@ FltkLabelButtonResource::FltkLabelButtonResource (FltkPlatform *platform,
const char *label):
FltkSpecificResource <dw::core::ui::LabelButtonResource> (platform)
{
- this->label = strdup (label);
+ this->label = dStrdup (label);
init (platform);
}
@@ -717,7 +718,7 @@ const char *FltkLabelButtonResource::getLabel ()
void FltkLabelButtonResource::setLabel (const char *label)
{
free((char *)this->label);
- this->label = strdup (label);
+ this->label = dStrdup (label);
widget->label (this->label);
queueResize (true);
@@ -866,9 +867,9 @@ FltkEntryResource::FltkEntryResource (FltkPlatform *platform, int size,
{
this->size = size;
this->password = password;
- this->label = label ? strdup(label) : NULL;
+ this->label = label ? dStrdup(label) : NULL;
this->label_w = 0;
- this->placeholder = placeholder ? strdup(placeholder) : NULL;
+ this->placeholder = placeholder ? dStrdup(placeholder) : NULL;
initText = NULL;
editable = false;
@@ -994,7 +995,7 @@ void FltkEntryResource::setText (const char *text)
{
if (initText)
free((char *)initText);
- initText = strdup (text);
+ initText = dStrdup (text);
((CustInput2*)widget)->value (initText);
}
@@ -1052,7 +1053,7 @@ FltkMultiLineTextResource::FltkMultiLineTextResource (FltkPlatform *platform,
MSG_WARN("numRows = %d is set to 1.\n", numRows);
numRows = 1;
}
- this->placeholder = placeholder ? strdup(placeholder) : NULL;
+ this->placeholder = placeholder ? dStrdup(placeholder) : NULL;
init (platform);
}
@@ -1492,7 +1493,7 @@ void FltkOptionMenuResource::addItem (const char *str,
{
Fl_Menu_Item *item = newItem();
- item->text = strdup(str);
+ item->text = dStrdup(str);
if (enabled == false)
item->flags = FL_MENU_INACTIVE;
@@ -1513,7 +1514,7 @@ void FltkOptionMenuResource::pushGroup (const char *name, bool enabled)
{
Fl_Menu_Item *item = newItem();
- item->text = strdup(name);
+ item->text = dStrdup(name);
if (enabled == false)
item->flags = FL_MENU_INACTIVE;
diff --git a/dw/hyphenator.cc b/dw/hyphenator.cc
index 739590dc..1530074f 100644
--- a/dw/hyphenator.cc
+++ b/dw/hyphenator.cc
@@ -21,6 +21,7 @@
#include "hyphenator.hh"
+#include "dlib/dlib.h"
#include "../lout/misc.hh"
#include "../lout/unicode.hh"
#include <limits.h>
@@ -395,7 +396,7 @@ TrieBuilder::~TrieBuilder ()
void TrieBuilder::insert (const char *key, const char *value)
{
dataList->increase ();
- dataList->getLastRef ()->key = (unsigned char *) strdup(key);
+ dataList->getLastRef ()->key = (unsigned char *) dStrdup(key);
dataList->getLastRef ()->value = dataZone->strdup (value);
}
diff --git a/dw/image.cc b/dw/image.cc
index 82118949..fc914f44 100644
--- a/dw/image.cc
+++ b/dw/image.cc
@@ -20,6 +20,7 @@
#include "image.hh"
+#include "dlib/dlib.h"
#include "../lout/msg.h"
#include "../lout/misc.hh"
#include "../lout/debug.hh"
@@ -146,7 +147,7 @@ Image::Image(const char *altText)
{
DBG_OBJ_CREATE ("dw::Image");
registerName ("dw::Image", &CLASS_ID);
- this->altText = altText ? strdup (altText) : NULL;
+ this->altText = altText ? dStrdup (altText) : NULL;
altTextWidth = -1; // not yet calculated
buffer = NULL;
bufWidth = bufHeight = -1;
diff --git a/dw/layout.cc b/dw/layout.cc
index 5b3000c0..96653643 100644
--- a/dw/layout.cc
+++ b/dw/layout.cc
@@ -22,6 +22,7 @@
#include "core.hh"
+#include "dlib/dlib.h"
#include "../lout/msg.h"
#include "../lout/debug.hh"
#include "../lout/misc.hh"
@@ -735,7 +736,7 @@ void Layout::setAnchor (const char *anchor)
if (requestedAnchor)
free (requestedAnchor);
- requestedAnchor = anchor ? strdup (anchor) : NULL;
+ requestedAnchor = anchor ? dStrdup (anchor) : NULL;
updateAnchor ();
}
@@ -754,7 +755,7 @@ char *Layout::addAnchor (Widget *widget, const char* name, int y)
return NULL;
else {
Anchor *anchor = new Anchor ();
- anchor->name = strdup (name);
+ anchor->name = dStrdup (name);
anchor->widget = widget;
anchor->y = y;
diff --git a/dw/style.cc b/dw/style.cc
index f362710e..5d0bcbe3 100644
--- a/dw/style.cc
+++ b/dw/style.cc
@@ -23,6 +23,7 @@
#include <ctype.h>
#include <math.h>
+#include "dlib/dlib.h"
#include "core.hh"
#include "../lout/msg.h"
@@ -426,7 +427,7 @@ Font::~Font ()
void Font::copyAttrs (FontAttrs *attrs)
{
- name = strdup (attrs->name);
+ name = dStrdup (attrs->name);
size = attrs->size;
weight = attrs->weight;
style = attrs->style;
diff --git a/dw/textblock.cc b/dw/textblock.cc
index 870ff9e6..df34dd95 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -2553,7 +2553,7 @@ void Textblock::addWidget (core::Widget *widget, core::style::Style *style)
}
/**
- * Add an anchor to the page. "name" is copied, so no strdup is necessary for
+ * Add an anchor to the page. "name" is copied, so no dStrdup is necessary for
* the caller.
*
* Return true on success, and false, when this anchor had already been