On 13 Jul 2000, Lars Gullik Bjønnes wrote:

> Baruch Even <[EMAIL PROTECTED]> writes:
> 
> | The problem is that the dialog returns (to the best of my knowldege) only
> | absolute filenames. I can't think of a smart way, a dumb way could
> | possibly be to make everything below or in the same dir as the document
> | relative and the rest absolute. I donno if this will cover everything.
> | Will a checkbox for this be a good idea?
> 
> Did you see this:
>  filetools.h:
> /** Makes relative path out of absolute path.
>   If it is deeper than basepath,
>   it's easy. If basepath and abspath share something (they are all deeper
>   than some directory), it'll be rendered using ..'s. If they are completely
>   different, then the absolute path will be used as relative path
>   WARNING: the absolute path and base path must really be absolute paths!!!
>   */
> string MakeRelPath(string const & abspath, string const & basepath);

Yes, I have. Actually that is what I use currently, my problem is not to
get the relative path eventually but to know if the user wants a relative
or absolute path. The two scenarios that require it are:

1. The user uses an image from the clipart => absolute directory(?)

2. The user has a document in the same directory or under the directory of
the document, I believe I should use a relative directory in case the user
will move the files somewhere else (in the same tree format).

It's rather hard to decide when to use relative dirs and when not to,
currently I use solely relative dirs for ease of implementation, I've
written this as a TODO/PROBLEM thing and will only bother really tackling
it after the I get a version out that replaces InsetFig, this is low
priority.


-- 
  Baruch Even

http://techst02.technion.ac.il/~sbaruch/   (My Site)
http://rpghost.com/jindor/                 (My brothers AD&D site)

" Learn to laugh ... it's the path to true love! " 
   - The Angel in the movie Michael


Reply via email to