-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks, Mathias, for this pointer. Now I know where to start to exercise
my little brain. In fact, this is a countryside that I never visited
before. Let me see whether my limited understanding will be able to
comprehend that one.

Cheers

F.

Mathias Bauer wrote:
| Hi Fridrich,
|
| Fridrich Strba wrote:
|
|> -----BEGIN PGP SIGNED MESSAGE-----
|> Hash: SHA1
|>
|> Hello, good people,
|>
|> Just wondering how easy would it be to hack a system that when one is
|> trying to open in OOo a 0-byte-long document, it opens an empty document
|> in the application that corresponds to its extension. I would not mind
|> to program this if I have some pointers.
|
| You have to hack at several places. The first is that the type detection
| must be made aware of this. This could be done most easily in the
| TypeDetection service (filter/source/config/cache/typedetection.cxx ) by
| checking the size of the stream it creates before calling the type
| detector services (search for "addInputStream")
|
| The next place to hack is the filter code itself. The easiest way would
| be to add some code in the load() method of the UNO model
| (sfx2/source/doc/sfxbasemodel.cxx). As soon as sfxbasemodel detects that
| the stream is empty it should create an empty storage with the correct
| type at the file location, but not commit it so that no file is created
| on disk. But it shouldn't try to load from this temporary storage (as it
| does not provide the necessary streams), instead of this
| m_pObjectShell->DoInitNew() should be called, but I assume some
| additional code massaging is necessary as this method does a little bit
| "too much".
|
| If you want to tackle it: try to do what I described and once you're
| finished, let's discuss how to proceed.
|
| Ciao,
| Mathias
|

- --
Please avoid sending me Word, Excel or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4-svn0 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFH0TFNu9a1imXPdA8RAvjxAJ9ko5XeIPU0gcBaZHOOr526bcKmgQCfRoHk
+h1oEuZhRqVgTZvRltTQ87A=
=VGzt
-----END PGP SIGNATURE-----

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

Reply via email to