diff options
author | pescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7> | 2009-01-06 05:45:37 +0000 |
---|---|---|
committer | pescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7> | 2009-01-06 05:45:37 +0000 |
commit | 3abd781670e4cd7a82d5ab2966ef9f8131535b54 (patch) | |
tree | 85cc3fcad80d491c706d77ed7a399cc17349dc6f /Plugins/skins/SkinLib/ControlFieldState_v8_wrapper.cpp | |
parent | 30f9565911217d38cefda3920f55d183d8f6e219 (diff) |
skins:
Added border to fields
State is now got through interface
It works!
git-svn-id: http://pescuma.googlecode.com/svn/trunk/Miranda@124 c086bb3d-8645-0410-b8da-73a8550f86e7
Diffstat (limited to 'Plugins/skins/SkinLib/ControlFieldState_v8_wrapper.cpp')
-rw-r--r-- | Plugins/skins/SkinLib/ControlFieldState_v8_wrapper.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/Plugins/skins/SkinLib/ControlFieldState_v8_wrapper.cpp b/Plugins/skins/SkinLib/ControlFieldState_v8_wrapper.cpp index a8eee02..9cbd06a 100644 --- a/Plugins/skins/SkinLib/ControlFieldState_v8_wrapper.cpp +++ b/Plugins/skins/SkinLib/ControlFieldState_v8_wrapper.cpp @@ -18,7 +18,13 @@ static Handle<Value> Get_ControlFieldState_text(Local<String> property, const Ac {
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
+ if (wrap.IsEmpty())
+ return Undefined();
+
ControlFieldState *tmp = (ControlFieldState *) wrap->Value();
+ if (tmp == NULL)
+ return Undefined();
+
return String::New((const V8_TCHAR *) tmp->getText());
}
@@ -26,9 +32,18 @@ static void Set_ControlFieldState_text(Local<String> property, Local<Value> valu {
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
+ if (wrap.IsEmpty())
+ return;
+
ControlFieldState *tmp = (ControlFieldState *) wrap->Value();
- String::Utf8Value utf8_value(value);
- tmp->setText(Utf8ToTchar(*utf8_value));
+ if (tmp == NULL)
+ return;
+
+ if (!value.IsEmpty() && value->IsString())
+ {
+ String::Utf8Value utf8_value(value);
+ tmp->setText(Utf8ToTchar(*utf8_value));
+ }
}
|