2004-07-24 Lars Gullik Bjonnes <larsbj@gullik.net>
+ * GPainter.C (text): sue boost::scoped_array to store the
+ temporary wchar_t pointer
+
* lyx_gui.C: change "support/std_sstream.h" to <sstream>
2004-07-22 Lars Gullik Bjonnes <larsbj@gullik.net>
void GPainter::text(int x, int y, std::string const & s, LyXFont const & f)
{
size_t size = s.length() + 1;
- wchar_t * wcs = (wchar_t *) alloca(size * sizeof(wchar_t));
- size = mbstowcs(wcs, s.c_str(), size);
- return text(x, y, wcs, size, f);
+ boost::scoped_array<wchar_t> wcs(new wchar_t[size]);
+ size = mbstowcs(wcs.get(), s.c_str(), size);
+ return text(x, y, wcs.get(), size, f);
}
XftFont * fontS = getXftFont(smallfont);
wchar_t c;
int tmpx = x;
- for(int i = 0; i < ls; ++i) {
- c = support::uppercase(s[i]);
- if(c != s[i]) {
+ for (int i = 0; i < ls; ++i) {
+ c = lyx::support::uppercase(s[i]);
+ if (c != s[i]) {
XftDrawString32(draw, xftClr, fontS, tmpx, y,
wcsToXftChar32StrFast(&c), 1);
tmpx += font_metrics::width(c, smallfont);
gui_names_spec_[i].c_str());
}
// Special width unit must be default for general units to be enabled
- if(controller().params().special != "none")
+ if (controller().params().special != "none")
setEnabled(dialog_->choice_width_unit, false);
setEnabled(dialog_->choice_special, !controller().params().inner_box);
setEnabled(dialog_->choice_height_unit, controller().params().inner_box);
setEnabled(dialog_->choice_height_special, controller().params().inner_box);
// Same here
- if(height_special != "none")
+ if (height_special != "none")
setEnabled(dialog_->choice_height_unit, false);
}
2004-07-24 Lars Gullik Bjonnes <larsbj@gullik.net>
- * math_support.C, math_parser.C, math_nestinset.C, math_macrotable.C:
+ * math_support.C, math_parser.C, math_nestinset.C, math_macrotable.C:
* math_hullinset.C, math_gridinset.C, math_factory.C:
* math_extern.C, math_autocorrect.C, math_arrayinset.C:
* formulamacro.C, command_inset.C: change "support/std_sstream.h"
void ForkedCallQueue::callback(pid_t, int)
{
- if(callQueue_.empty()) {
+ if (callQueue_.empty()) {
stopCaller();
} else {
callNext();