Index: src/af/xap/win/xap_Win32FrameImpl.cpp =================================================================== RCS file: /cvsroot/abi/src/af/xap/win/xap_Win32FrameImpl.cpp,v retrieving revision 1.34.2.2 diff -u -r1.34.2.2 xap_Win32FrameImpl.cpp --- src/af/xap/win/xap_Win32FrameImpl.cpp 27 Mar 2004 07:35:30 -0000 1.34.2.2 +++ src/af/xap/win/xap_Win32FrameImpl.cpp 21 Apr 2004 01:53:56 -0000 @@ -22,6 +22,7 @@ #include "xap_Win32FrameImpl.h" #include "commctrl.h" #include /* for INT_MAX */ +#include #include "zmouse.h" #ifdef __MINGW32__ @@ -448,24 +449,83 @@ UT_String sURL = szURL; - // strip file:///\ from URL, the extra forward-slash back-slash is passed in from "View as Web Page" - if ( "file:///\\" == sURL.substr(0,9) ) + // If this is a file:// URL, strip off file:// and make it backslashed + if (sURL.substr(0, 7) == "file://") { - sURL = sURL.substr(9, sURL.size() - 9); + sURL = sURL.substr(7, sURL.size() - 7); + + // Strip off the leading backslash + if (sURL.substr(0, 1) == "\\") + sURL = sURL.substr(2, sURL.size() - 2); + + // View as WebPage likes to throw in an extra /\ just for fun, strip it off + if (sURL.substr(0, 2) == "/\\") + sURL = sURL.substr(2, sURL.size() - 2); + + // Enclose in double-quotes, incase there's a space in the path + if ((sURL.substr(0, 1) != "\"") && (sURL.substr(sURL.size() -1, 1) != "\"")) + sURL = "\"" + sURL + "\""; + + // Convert all forwardslashes to backslashes + for (unsigned int i=0; i