X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fcontrollers%2Fhelper_funcs.h;h=3631b692b059b09905e9e274f926a04e66d47706;hb=7ea7dabed1b72cc25dcbdc482ac006f2b61dacfd;hp=095f8bb91a5715fc1d0fc97e28eac692b1d67c28;hpb=c890dfa0f8e80f10e8ad9b899867c7810d4895e1;p=lyx.git diff --git a/src/frontends/controllers/helper_funcs.h b/src/frontends/controllers/helper_funcs.h index 095f8bb91a..3631b692b0 100644 --- a/src/frontends/controllers/helper_funcs.h +++ b/src/frontends/controllers/helper_funcs.h @@ -46,6 +46,20 @@ string const browseFile(LyXView *lv, string const & filename, std::pair const & dir2 = std::make_pair(string(), string())); +/* Wrapper around browseFile which tries to provide a filename + relative to relpath. If the relative path is of the form "foo.txt" + or "bar/foo.txt", then it is returned as relative. OTOH, if it is + of the form "../baz/foo.txt", an absolute path is returned. This is + intended to be useful for insets which encapsulate files/ +*/ +string const browseRelFile(LyXView *lv, string const & filename, + string const & refpath, + string const & title, + string const & pattern, + std::pair const & dir1 = std::make_pair(string(), string()), + std::pair const & dir2 = std::make_pair(string(), string())); + + /// Returns a vector of units that can be used to create a valid LaTeX length. std::vector const getLatexUnits();