Re: [patch] allow to assign several extensions to a file format

2011-09-12 Thread Julien Rioux
On 07/09/2011 11:40 PM, Richard Heck wrote: On 09/07/2011 02:17 PM, Julien Rioux wrote: On 07/09/2011 7:04 PM, Richard Heck wrote: On 09/07/2011 11:51 AM, Julien Rioux wrote: On 07/09/2011 3:37 PM, Richard Heck wrote: bool Format::dummy() const @@ -101,6 +105,20 @@ bool Format::dummy() const

Re: [patch] allow to assign several extensions to a file format

2011-09-07 Thread Richard Heck
On 09/07/2011 02:17 PM, Julien Rioux wrote: > On 07/09/2011 7:04 PM, Richard Heck wrote: >> On 09/07/2011 11:51 AM, Julien Rioux wrote: >>> On 07/09/2011 3:37 PM, Richard Heck wrote: > bool Format::dummy() const > @@ -101,6 +105,20 @@ bool Format::dummy() const > } > > > +bo

Re: [patch] allow to assign several extensions to a file format

2011-09-07 Thread Julien Rioux
On 07/09/2011 5:27 PM, Andre Poenitz wrote: On Wed, Sep 07, 2011 at 11:06:04AM -0400, Richard Heck wrote: -std::string const& extension() const { return extension_; } +std::string const& extension() const { return extension_list_[0]; } and extension_list_[0] would be an invalid addres

Re: [patch] allow to assign several extensions to a file format

2011-09-07 Thread Julien Rioux
On 07/09/2011 7:04 PM, Richard Heck wrote: On 09/07/2011 11:51 AM, Julien Rioux wrote: On 07/09/2011 3:37 PM, Richard Heck wrote: bool Format::dummy() const @@ -101,6 +105,20 @@ bool Format::dummy() const } +bool Format::hasExtension(string const& e) const +{ + if (extension().empty()) + retu

Re: [patch] allow to assign several extensions to a file format

2011-09-07 Thread Richard Heck
On 09/07/2011 11:51 AM, Julien Rioux wrote: On 07/09/2011 3:37 PM, Richard Heck wrote: bool Format::dummy() const @@ -101,6 +105,20 @@ bool Format::dummy() const } +bool Format::hasExtension(string const& e) const +{ +if (extension().empty()) +return false; +std::vector::c

Re: [patch] allow to assign several extensions to a file format

2011-09-07 Thread Julien Rioux
On 07/09/2011 3:37 PM, Richard Heck wrote: bool Format::dummy() const @@ -101,6 +105,20 @@ bool Format::dummy() const } +bool Format::hasExtension(string const& e) const +{ +if (extension().empty()) +return false; +std::vector::const_iterator it = extension_list_.begin();

Re: [patch] allow to assign several extensions to a file format

2011-09-07 Thread Andre Poenitz
On Wed, Sep 07, 2011 at 11:06:04AM -0400, Richard Heck wrote: > >-std::string const & extension() const { return extension_; } > >+std::string const & extension() const { return extension_list_[0]; } > > > >and extension_list_[0] would be an invalid address otherwise. > > > return extension

Re: [patch] allow to assign several extensions to a file format

2011-09-07 Thread Richard Heck
On 09/07/2011 11:11 AM, Julien Rioux wrote: On 07/09/2011 5:06 PM, Richard Heck wrote: I push an empty string to prevent extension_list_ from being empty, because in Format.h we have - std::string const & extension() const { return extension_; } + std::string const & extension() const { return

Re: [patch] allow to assign several extensions to a file format

2011-09-07 Thread Julien Rioux
On 07/09/2011 5:06 PM, Richard Heck wrote: I push an empty string to prevent extension_list_ from being empty, because in Format.h we have - std::string const & extension() const { return extension_; } + std::string const & extension() const { return extension_list_[0]; } and extension_list_[0]

Re: [patch] allow to assign several extensions to a file format

2011-09-07 Thread Richard Heck
On 09/07/2011 09:56 AM, Julien Rioux wrote: On 07/09/2011 3:37 PM, Richard Heck wrote: On 09/07/2011 08:36 AM, Julien Rioux wrote: On 07/09/2011 2:09 PM, Julien Rioux wrote: On 06/09/2011 2:57 AM, Richard Heck wrote: @@ -90,9 +90,13 @@ bool operator<(Format const& a, Format const& b) Format::

Re: [patch] allow to assign several extensions to a file format

2011-09-07 Thread Julien Rioux
On 07/09/2011 3:37 PM, Richard Heck wrote: On 09/07/2011 08:36 AM, Julien Rioux wrote: On 07/09/2011 2:09 PM, Julien Rioux wrote: On 06/09/2011 2:57 AM, Richard Heck wrote: @@ -90,9 +90,13 @@ bool operator<(Format const& a, Format const& b) Format::Format(string const& n, string const& e, stri

Re: [patch] allow to assign several extensions to a file format

2011-09-07 Thread Richard Heck
On 09/07/2011 08:36 AM, Julien Rioux wrote: On 07/09/2011 2:09 PM, Julien Rioux wrote: On 06/09/2011 2:57 AM, Richard Heck wrote: If you make the extensions_ member a vector or list, it will make looping and such a lot easier. You might then just have: string extension() { return extensions_[0]

Re: [patch] allow to assign several extensions to a file format

2011-09-07 Thread Richard Heck
On 09/07/2011 08:07 AM, Julien Rioux wrote: On 06/09/2011 6:28 PM, Richard Heck wrote: On 09/06/2011 11:11 AM, Julien Rioux wrote: On 06/09/2011 4:49 PM, Jean-Marc Lasgouttes wrote: Le 06/09/11 16:44, Julien Rioux a écrit : Are there quick ways to join a vector into a single string and vice v

Re: [patch] allow to assign several extensions to a file format

2011-09-07 Thread Julien Rioux
On 07/09/2011 2:09 PM, Julien Rioux wrote: On 06/09/2011 2:57 AM, Richard Heck wrote: If you make the extensions_ member a vector or list, it will make looping and such a lot easier. You might then just have: string extension() { return extensions_[0]; } I guess we need to keep extensions_ fro

Re: [patch] allow to assign several extensions to a file format

2011-09-07 Thread Julien Rioux
On 06/09/2011 2:57 AM, Richard Heck wrote: If you make the extensions_ member a vector or list, it will make looping and such a lot easier. You might then just have: string extension() { return extensions_[0]; } I guess we need to keep extensions_ from being an empty vector then. -- Jul

Re: [patch] allow to assign several extensions to a file format

2011-09-07 Thread Julien Rioux
On 06/09/2011 6:28 PM, Richard Heck wrote: On 09/06/2011 11:11 AM, Julien Rioux wrote: On 06/09/2011 4:49 PM, Jean-Marc Lasgouttes wrote: Le 06/09/11 16:44, Julien Rioux a écrit : Are there quick ways to join a vector into a single string and vice versa, à la python? string = ','.join(list) l

Re: [patch] allow to assign several extensions to a file format

2011-09-06 Thread Richard Heck
On 09/06/2011 11:11 AM, Julien Rioux wrote: On 06/09/2011 4:49 PM, Jean-Marc Lasgouttes wrote: Le 06/09/11 16:44, Julien Rioux a écrit : Are there quick ways to join a vector into a single string and vice versa, à la python? string = ','.join(list) list = string.split(',') A bit more verbose

Re: [patch] allow to assign several extensions to a file format

2011-09-06 Thread Julien Rioux
On 06/09/2011 4:49 PM, Jean-Marc Lasgouttes wrote: Le 06/09/11 16:44, Julien Rioux a écrit : Are there quick ways to join a vector into a single string and vice versa, à la python? string = ','.join(list) list = string.split(',') A bit more verbose, but getVectorFromString in lstrings.h is wh

Re: [patch] allow to assign several extensions to a file format

2011-09-06 Thread Jean-Marc Lasgouttes
Le 06/09/11 16:44, Julien Rioux a écrit : Are there quick ways to join a vector into a single string and vice versa, à la python? string = ','.join(list) list = string.split(',') A bit more verbose, but getVectorFromString in lstrings.h is what you want. JMarc

Re: [patch] allow to assign several extensions to a file format

2011-09-06 Thread Julien Rioux
On 06/09/2011 2:57 AM, Richard Heck wrote: On 09/05/2011 05:33 PM, Julien Rioux wrote: log: Allow to assign several extension to a given file format (#4798). Additionnal extensions are separated by commas (,). Spaces are ignored. Preference (lyxrc) file format incremented to 2. Thanks fo

Re: [patch] allow to assign several extensions to a file format

2011-09-05 Thread Richard Heck
On 09/05/2011 05:33 PM, Julien Rioux wrote: > log: > Allow to assign several extension to a given file format (#4798). > Additionnal extensions are separated by commas (,). Spaces are > ignored. Preference (lyxrc) file format incremented to 2. > Thanks for taking care of this. > A lot of the d

Re: [patch] allow to assign several extensions to a file format

2011-09-05 Thread Julien Rioux
On 06/09/2011 12:55 AM, Tommaso Cucinotta wrote: Il 05/09/2011 23:33, Julien Rioux ha scritto: log: Allow to assign several extension to a given file format (#4798). Additionnal extensions are separated by commas (,). Spaces are ignored. Preference (lyxrc) file format incremented to 2. For exa

Re: [patch] allow to assign several extensions to a file format

2011-09-05 Thread Tommaso Cucinotta
Il 05/09/2011 23:33, Julien Rioux ha scritto: log: Allow to assign several extension to a given file format (#4798). Additionnal extensions are separated by commas (,). Spaces are ignored. Preference (lyxrc) file format incremented to 2. For example, a LibreOffice/OpenOffice/StarOffice drawi

Re: [patch] allow to assign several extensions to a file format

2011-09-05 Thread Julien Rioux
On 05/09/2011 11:33 PM, Julien Rioux wrote: loop through f.extensions() Forgot to mention, as this is a preliminary patch, I still have to implement looping through extensions, but everything else works. -- Julien