Browse Source

Fix checkbutton and increase readfile buffer

master
boisso 7 years ago
parent
commit
55c4000d65
  1. 6
      k-meleon/macros2/functions.h
  2. 6
      k-meleon/macros2/macros.cpp

6
k-meleon/macros2/functions.h

@ -1066,8 +1066,8 @@
return "";
FILE* f = _wfopen(data->getstr(1).utf16(), L"r");
if (f) {
char* buffer = new char[32768];
int size = fread(buffer, sizeof(char), 32768-1, f);
char* buffer = new char[65536];
int size = fread(buffer, sizeof(char), 65536-1, f);
buffer[size] = 0;
Value ret = buffer;
fclose(f);
@ -1612,7 +1612,7 @@
checkArgs(__FUNCTION__, data, 3);
kmeleonButton b = {0};
b.enabled = -1;
b.checked = data->getbool(2);
b.checked = data->getbool(3);
return kPlugin.kFuncs->SetButton(data->getstr(1), kPlugin.kFuncs->GetID(data->getstr(2)), &b);
}
/*

6
k-meleon/macros2/macros.cpp

@ -176,14 +176,14 @@ public:
TDS tds;
StatList root;
Value* AddSymbol(std::string name, Value v)
Value* AddSymbol(const std::string& name, const Value& v)
{
TDS::iterator it;
it = tds.insert(tds.end(), TDS::value_type(name, v));
return &it->second;
}
Value* FindSymbol(std::string name)
Value* FindSymbol(const std::string& name)
{
TDS::iterator it = tds.find(name);
if (it == tds.end())
@ -191,7 +191,7 @@ public:
return &it->second;
}
std::string FindSymbol(Value* val)
std::string FindSymbol(const Value* val)
{
for (TDS::iterator it = tds.begin(); it!= tds.end(); it++)
if (val == &it->second)

Loading…
Cancel
Save