Use (newly) added wxStaticCastVariantData() to fix wxNO_RTTI build.

Don't define wxDynamicCastVariantData if RTTI is disabled and don't use it in
wxConvertVariantToOle() code as we don't really need it there anyhow.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72262 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2012-07-30 19:16:30 +00:00
parent 7c70331e28
commit 5bdcb1f324
2 changed files with 9 additions and 5 deletions

View File

@ -570,7 +570,11 @@ bool classname##VariantData::Eq(wxVariantData& data) const \
var.GetWxObjectPtr() : NULL));
// Replacement for using wxDynamicCast on a wxVariantData object
#define wxDynamicCastVariantData(data, classname) dynamic_cast<classname*>(data)
#ifndef wxNO_RTTI
#define wxDynamicCastVariantData(data, classname) dynamic_cast<classname*>(data)
#endif
#define wxStaticCastVariantData(data, classname) static_cast<classname*>(data)
extern wxVariant WXDLLIMPEXP_BASE wxNullVariant;

View File

@ -338,16 +338,16 @@ WXDLLEXPORT bool wxConvertVariantToOle(const wxVariant& variant, VARIANTARG& ole
if (type == wxT("errorcode"))
{
wxVariantDataErrorCode* const
ec = wxDynamicCastVariantData(variant.GetData(),
wxVariantDataErrorCode);
ec = wxStaticCastVariantData(variant.GetData(),
wxVariantDataErrorCode);
oleVariant.vt = VT_ERROR;
oleVariant.scode = ec->GetValue();
}
else if (type == wxT("currency"))
{
wxVariantDataCurrency* const
c = wxDynamicCastVariantData(variant.GetData(),
wxVariantDataCurrency);
c = wxStaticCastVariantData(variant.GetData(),
wxVariantDataCurrency);
oleVariant.vt = VT_CY;
oleVariant.cyVal = c->GetValue();
}