Jacek Caban : mshtml: Use pvaIn in exec_print.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Dec 15 07:21:37 CST 2006


Module: wine
Branch: master
Commit: 902a39f0bdcc8aefc78662ea6a039ed07f0ae4e5
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=902a39f0bdcc8aefc78662ea6a039ed07f0ae4e5

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Dec 14 20:39:21 2006 +0100

mshtml: Use pvaIn in exec_print.

---

 dlls/mshtml/olecmd.c |   51 ++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 49 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/olecmd.c b/dlls/mshtml/olecmd.c
index 8de5e0d..60518a1 100644
--- a/dlls/mshtml/olecmd.c
+++ b/dlls/mshtml/olecmd.c
@@ -222,8 +222,6 @@ static HRESULT exec_print(HTMLDocument *
 
     if(pvaOut)
         FIXME("unsupported pvaOut\n");
-    if(pvaIn)
-        FIXME("unsupported pvaIn\n");
 
     if(!This->nscontainer)
         return S_OK;
@@ -249,6 +247,55 @@ static HRESULT exec_print(HTMLDocument *
 
     set_default_templates(settings);
 
+    if(pvaIn) {
+        switch(V_VT(pvaIn)) {
+        case VT_BYREF|VT_ARRAY: {
+            VARIANT *opts;
+            DWORD opts_cnt;
+
+            if(V_ARRAY(pvaIn)->cDims != 1)
+                WARN("cDims = %d\n", V_ARRAY(pvaIn)->cDims);
+
+            SafeArrayAccessData(V_ARRAY(pvaIn), (void**)&opts);
+            opts_cnt = V_ARRAY(pvaIn)->rgsabound[0].cElements;
+
+            if(opts_cnt >= 1) {
+                switch(V_VT(opts)) {
+                case VT_BSTR:
+                    TRACE("setting footer %s\n", debugstr_w(V_BSTR(opts)));
+                    set_print_template(settings, V_BSTR(opts), TRUE);
+                    break;
+                case VT_NULL:
+                    break;
+                default:
+                    WARN("V_VT(opts) = %d\n", V_VT(opts));
+                }
+            }
+
+            if(opts_cnt >= 2) {
+                switch(V_VT(opts+1)) {
+                case VT_BSTR:
+                    TRACE("setting footer %s\n", debugstr_w(V_BSTR(opts+1)));
+                    set_print_template(settings, V_BSTR(opts+1), FALSE);
+                    break;
+                case VT_NULL:
+                    break;
+                default:
+                    WARN("V_VT(opts) = %d\n", V_VT(opts+1));
+                }
+            }
+
+            if(opts_cnt >= 3)
+                FIXME("Unsuported opts_cnt %d\n", opts_cnt);
+
+            SafeArrayUnaccessData(V_ARRAY(pvaIn));
+            break;
+        }
+        default:
+            FIXME("unsupported vt %x\n", V_VT(pvaIn));
+        }
+    }
+
     nsres = nsIWebBrowserPrint_Print(nsprint, settings, NULL);
     if(NS_FAILED(nsres))
         ERR("Print failed: %08x\n", nsres);




More information about the wine-cvs mailing list