From e0730250fbfbf19014c44a2a63ee438bb6f4c03d Mon Sep 17 00:00:00 2001 From: amaitland Date: Tue, 12 May 2015 14:35:05 +1000 Subject: [PATCH] Directly access BrowserSettings as they're internal (extra property and wrapper seems redundant) --- CefSharp.Core/BrowserSettings.h | 7 ------- CefSharp.Core/ManagedCefBrowserAdapter.h | 4 ++-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/CefSharp.Core/BrowserSettings.h b/CefSharp.Core/BrowserSettings.h index 56ad82b65..df6a2b452 100644 --- a/CefSharp.Core/BrowserSettings.h +++ b/CefSharp.Core/BrowserSettings.h @@ -82,13 +82,6 @@ namespace CefSharp !BrowserSettings() { delete _browserSettings; _isFinalized = true; } ~BrowserSettings() { if (!_isFinalized) this->!BrowserSettings(); } - // CefBrowserSettings is private causing whole field to be private - // exposing void* as a workaround - property void* _internalBrowserSettings - { - void* get() { return _browserSettings; } - } - property String^ StandardFontFamily { String^ get() { return StringUtils::ToClr(_browserSettings->standard_font_family); } diff --git a/CefSharp.Core/ManagedCefBrowserAdapter.h b/CefSharp.Core/ManagedCefBrowserAdapter.h index fd005ff36..9586b81d6 100644 --- a/CefSharp.Core/ManagedCefBrowserAdapter.h +++ b/CefSharp.Core/ManagedCefBrowserAdapter.h @@ -80,7 +80,7 @@ namespace CefSharp CefString addressNative = StringUtils::ToNative(address); if (!CefBrowserHost::CreateBrowser(window, _clientAdapter.get(), addressNative, - *(CefBrowserSettings*) browserSettings->_internalBrowserSettings, NULL)) + *browserSettings->_browserSettings, NULL)) { throw gcnew InvalidOperationException( "Failed to create offscreen browser. Call Cef.Initialize() first." ); } @@ -647,7 +647,7 @@ namespace CefSharp CefString addressNative = StringUtils::ToNative(address); CefBrowserHost::CreateBrowser(window, _clientAdapter.get(), addressNative, - *(CefBrowserSettings*)browserSettings->_internalBrowserSettings, NULL); + *browserSettings->_browserSettings, NULL); } void Resize(int width, int height)