Paolo Mantovani wrote:
Hi Daniel,

Alle 13:31, giovedì 21 luglio 2005, Daniel Boelzle ha scritto:

Hello Paolo,


This is the code-snippet made when I posted the same question on this
list, time ago:
http://codesnippets.services.openoffice.org/Office/Office.ArbitraryDeploy
.snip

Looking at your Basic snippet, I just saw that the decoding part of the
macrofied url is missing.


I see, but the macro results a valid url

I  must admit that I don't understand this part of your explanation
I'm sure that I'm missing something, may you detail a bit more this part?

The syntax for vnd.sun.star.expand URLs is

  "vnd.sun.star.expand:" + <escaped macrofied URL>

So if the macrofied URL is

  "$ORIGIN/foo%20bar"

its escaped representation is

  "$ORIGIN/foo%2520bar"

(because "%" is a character that must be escaped as "%25" when inserted into a URL). If you do not de-escape this before de-macrofication, the result will be some URL like

  "file:///the/origin/foo%2520bar"

which would correspond to a filepath

  "/the/origin/foo%20bar"

instead of the intended

  "/the/origin/foo bar"

IIRC, there currently is no functionality available from OOo Basic to do the de-escaping. There is C++ functionality for that in rtl/uri.hxx, and on CWS sb36 (targeted for OOo 3.0) I just added the UNO com.sun.star.uri.UriSchemeParser_vndDOTsunDOTstarDOTexpand that includes functionality to do the complete de-escape--and--de-macrofy step.

-Stephan

thank you
Paolo

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to