The basic Print function in 1.1 appears to be broken. I tried compiling it and printing the sample app, but nothing happens.
Running the debugger, I found that the line in wxWebControl::Print() that says:
- Code: Select all
ns_smartptr<nsIPrintSettings> settings19 = m_ptrs->m_print_settings;
if (settings19)
{
was always returning settings19==NULL - so the print would not occur. Investigating further it looks like the actual problem is with the definition of m_print_settings. In the EmbeddingPtrs structure, m_print_settings is defined as a nsISupports when it should be a nsIPrintSettings. The corrected code (which works) is:
- Code: Select all
struct EmbeddingPtrs
{
ns_smartptr<nsIWebBrowser> m_web_browser;
ns_smartptr<nsIWebBrowserFind> m_web_browser_find;
ns_smartptr<nsIBaseWindow> m_base_window;
ns_smartptr<nsIWebNavigation> m_web_navigation;
ns_smartptr<nsIDOMEventTarget> m_event_target;
ns_smartptr<nsIClipboardCommands> m_clipboard_commands;
// ns_smartptr<nsISupports> m_print_settings; // <== Seems to be the wrong type
ns_smartptr<nsIPrintSettings> m_print_settings; // This is the right PrintSettings type
};
Hopefully you can update this in the next release. Also, as wxWidgets is at version 2.9 now, some of the makefiles and project libraries/includes need to be updated.
Thanks,
Brad