+2007-11-07 Steve Falkenburg <sfalken@apple.com>
+
+ Added IWebDocumentText available via QI from WebFrame.
+
+ Reviewed by Sam.
+
+ * WebFrame.cpp:
+ (WebFrame::QueryInterface): Added IID_IWebDocumentText.
+ (WebFrame::supportsTextEncoding): Stubbed out.
+ (WebFrame::selectedString): Implemented.
+ (WebFrame::selectAll): Stubbed out.
+ (WebFrame::deselectAll): Stubbed out.
+ * WebFrame.h:
+
2007-11-07 Adam Roben <aroben@apple.com>
Fix <rdar://5569268> Crash when opening any FTP site in second tab/window
*ppvObject = static_cast<IWebFrame*>(this);
else if (IsEqualGUID(riid, IID_IWebFramePrivate))
*ppvObject = static_cast<IWebFramePrivate*>(this);
+ else if (IsEqualGUID(riid, IID_IWebDocumentText))
+ *ppvObject = static_cast<IWebDocumentText*>(this);
else
return E_NOINTERFACE;
return S_OK;
}
-// IWebFramePrivaete ------------------------------------------------------
+// IWebFramePrivate ------------------------------------------------------
HRESULT STDMETHODCALLTYPE WebFrame::renderTreeAsExternalRepresentation(
/* [retval][out] */ BSTR *result)
return S_OK;
}
+// IWebDocumentText -----------------------------------------------------------
+
+HRESULT STDMETHODCALLTYPE WebFrame::supportsTextEncoding(
+ /* [retval][out] */ BOOL* result)
+{
+ *result = FALSE;
+ return E_NOTIMPL;
+}
+
+HRESULT STDMETHODCALLTYPE WebFrame::selectedString(
+ /* [retval][out] */ BSTR* result)
+{
+ *result = 0;
+
+ Frame* coreFrame = core(this);
+ if (!coreFrame)
+ return E_FAIL;
+
+ String text = coreFrame->selectedText();
+ text.replace('\\', coreFrame->backslashAsCurrencySymbol());
+
+ *result = BString(text).release();
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebFrame::selectAll()
+{
+ return E_NOTIMPL;
+}
+
+HRESULT STDMETHODCALLTYPE WebFrame::deselectAll()
+{
+ return E_NOTIMPL;
+}
// WebFrame ---------------------------------------------------------------
extern const GUID IID_WebFrame;
-class WebFrame : public IWebFrame, IWebFramePrivate
+class WebFrame : public IWebFrame, IWebFramePrivate, IWebDocumentText
, public WebCore::FrameLoaderClient
{
public:
virtual HRESULT STDMETHODCALLTYPE allowsScrolling(
/* [retval][out] */ BOOL *flag);
+ // IWebDocumentText
+ virtual HRESULT STDMETHODCALLTYPE supportsTextEncoding(
+ /* [retval][out] */ BOOL* result);
+
+ virtual HRESULT STDMETHODCALLTYPE selectedString(
+ /* [retval][out] */ BSTR* result);
+
+ virtual HRESULT STDMETHODCALLTYPE selectAll();
+
+ virtual HRESULT STDMETHODCALLTYPE deselectAll();
// FrameWinClient
virtual void ref();