Re: [libreoffice] allow passing FilterOptions via cli
Hi all, would it be possible to cherry-pick http://cgit.freedesktop.org/libreoffice/core/commit/?id=45ba4d79d968f81f74ef0c4588fd15b1ce91153f to the 4.3.2 release? It is currently commited towards 4.4 (scheduled for 2/2015) but as this is an old bug and 4.3.2 is called bugfix release, I wonder if it was be acceptable? Thank you, Tomas On 04/06/14 14:28, Stephan Bergmann wrote: On 06/04/2014 02:16 PM, Tomas Hlavaty wrote: From your remark https://bugs.freedesktop.org/show_bug.cgi?id=36313#c17 I understand, that it does not seem very user friendly. However, the patch at least makes it possible to achieve the desired behaviour, which was not possible previously. Maybe the remaining problem should be seen as how to make the CVS filter options more user friendly? I don't have an answer to that, unfortunatelly. Yeah; maybe leave it to one of the people who reported to that issue to decide whether to mark it as resolved. I found another bug report https://bugs.freedesktop.org/show_bug.cgi?id=47892 which explicitly asks for FilterOptions at least for --convert-to so I should have probably addressed this, but I found it later. Should I mark https://bugs.freedesktop.org/show_bug.cgi?id=47892 as resolved or leave it to QA people to handle that? Please do mark that one as resolved. Stephan ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [libreoffice] allow passing FilterOptions via cli
Hi Stephan, I confirm that LibreOfficeDev_4.3.2.0.0_Linux_x86-64_rpm and LibreOfficeDev_4.3.3.0.0_Linux_x86-64_rpm from the latest daily builds work. Thank you very much! Tomas On 11/09/14 11:56, Tomas Hlavaty wrote: Hi Stephan, thank you very much! I'll try it when it's available from the daily builds. Tomas On 10/09/14 12:24, Stephan Bergmann wrote: On 09/09/2014 11:57 AM, Tomas Hlavaty wrote: It would definitely help us to have the bugfix earlier then in v4.4. ...so I've backported it to libreoffice-4-3 now, https://bugs.freedesktop.org/show_bug.cgi?id=36313#c18 Stephan ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [libreoffice] allow passing FilterOptions via cli
Hi Stephan, thank you very much! I'll try it when it's available from the daily builds. Tomas On 10/09/14 12:24, Stephan Bergmann wrote: On 09/09/2014 11:57 AM, Tomas Hlavaty wrote: It would definitely help us to have the bugfix earlier then in v4.4. ...so I've backported it to libreoffice-4-3 now, https://bugs.freedesktop.org/show_bug.cgi?id=36313#c18 Stephan ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [libreoffice] allow passing FilterOptions via cli
On 09/09/2014 11:57 AM, Tomas Hlavaty wrote: It would definitely help us to have the bugfix earlier then in v4.4. ...so I've backported it to libreoffice-4-3 now, https://bugs.freedesktop.org/show_bug.cgi?id=36313#c18 Stephan ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [libreoffice] allow passing FilterOptions via cli
On 09/08/2014 05:13 PM, Tomas Hlavaty wrote: Sorry, I meant 4.3.3 as 4.3.2 is in freeze already. On 08/09/14 17:10, Tomas Hlavaty wrote: Hi all, would it be possible to cherry-pick http://cgit.freedesktop.org/libreoffice/core/commit/?id=45ba4d79d968f81f74ef0c4588fd15b1ce91153f to the 4.3.2 release? It is currently commited towards 4.4 (scheduled for 2/2015) but as this is an old bug and 4.3.2 is called bugfix release, I wonder if it was be acceptable? Given That is, I am not sure whether the fix from comment 16 is already a practical-enough solution? at https://bugs.freedesktop.org/show_bug.cgi?id=36313#c17, I'm not sure whether it would actually help anybody to backport that to 4.3.3. Are you asking because you know about a specific scenario in which it would help, or just on generic it's a bugfix, so it should go into a bugfix release grounds? Stephan ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [libreoffice] allow passing FilterOptions via cli
Hi Stephan, thank you for your reply. I am asking because: - The commit fixes two bugs: https://bugs.freedesktop.org/show_bug.cgi?id=47892 and https://bugs.freedesktop.org/show_bug.cgi?id=36313 - The commit enables previously broken functionality in a very simple way. The user interface could be more user friendly as you pointed out. However, it is not clear how the user interface should be improved. Also, anything more sophisticated would likely be significantly more complex change I think. The commit finds a good balance with its simplicity impact. - At the moment, it is not possible to use LibreOffice command line to convert to and from text formats, because the FilterOptions is not available. If users need to convert documents to and from text formats, they need to go via UNO. However, there are problems when using UNO: - There is no way to guarantee that a UNO connection releases allocated memory. Combined with memory leaks in LibreOffice, this makes it rather inconvenient when using it in a long running process. - UNO evolves, forcing us to follow the changes to the protocol. We can't simply use whatever the official LibreOffice for a given system is, we have to use a particular version. On Linux, we use v3.5. - On Windows, we still use OpenOffice, because UNO on LibreOffice does not properly close files, which combined with the mandatory locking mis-feature on Windows is fatal. - My prefered solution to our LibreOffice issues would be to to replace our dependency on UNO with simple command invocation. This should solve our problems at the cost of slower conversions due to slow LibreOffice startup. That trade-off is reasonable I think. There seems to be also general intention to improve LibreOffice startup in the future. - The fix will be released in about half a year so I have to either: - wait and stick to the old LibreOffice and OpenOffice for half a year; - build custom LibreOffice myself with the cherry-picked patch which is doable on Linux, but rather complex on Windows; - ask for the fix to be put into v4.3 already; it is a bugfix release after all It would definitely help us to have the bugfix earlier then in v4.4. It might also help the people who reported those bugs and it also might help people, who might want to use FilterOptions but silently give up when they find it broken. Thank you very much! Tomas On 09/09/14 10:20, Stephan Bergmann wrote: On 09/08/2014 05:13 PM, Tomas Hlavaty wrote: Sorry, I meant 4.3.3 as 4.3.2 is in freeze already. On 08/09/14 17:10, Tomas Hlavaty wrote: Hi all, would it be possible to cherry-pick http://cgit.freedesktop.org/libreoffice/core/commit/?id=45ba4d79d968f81f74ef0c4588fd15b1ce91153f to the 4.3.2 release? It is currently commited towards 4.4 (scheduled for 2/2015) but as this is an old bug and 4.3.2 is called bugfix release, I wonder if it was be acceptable? Given That is, I am not sure whether the fix from comment 16 is already a practical-enough solution? at https://bugs.freedesktop.org/show_bug.cgi?id=36313#c17, I'm not sure whether it would actually help anybody to backport that to 4.3.3. Are you asking because you know about a specific scenario in which it would help, or just on generic it's a bugfix, so it should go into a bugfix release grounds? Stephan ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [libreoffice] allow passing FilterOptions via cli
Sorry, I meant 4.3.3 as 4.3.2 is in freeze already. On 08/09/14 17:10, Tomas Hlavaty wrote: Hi all, would it be possible to cherry-pick http://cgit.freedesktop.org/libreoffice/core/commit/?id=45ba4d79d968f81f74ef0c4588fd15b1ce91153f to the 4.3.2 release? It is currently commited towards 4.4 (scheduled for 2/2015) but as this is an old bug and 4.3.2 is called bugfix release, I wonder if it was be acceptable? Thank you, Tomas On 04/06/14 14:28, Stephan Bergmann wrote: On 06/04/2014 02:16 PM, Tomas Hlavaty wrote: From your remark https://bugs.freedesktop.org/show_bug.cgi?id=36313#c17 I understand, that it does not seem very user friendly. However, the patch at least makes it possible to achieve the desired behaviour, which was not possible previously. Maybe the remaining problem should be seen as how to make the CVS filter options more user friendly? I don't have an answer to that, unfortunatelly. Yeah; maybe leave it to one of the people who reported to that issue to decide whether to mark it as resolved. I found another bug report https://bugs.freedesktop.org/show_bug.cgi?id=47892 which explicitly asks for FilterOptions at least for --convert-to so I should have probably addressed this, but I found it later. Should I mark https://bugs.freedesktop.org/show_bug.cgi?id=47892 as resolved or leave it to QA people to handle that? Please do mark that one as resolved. Stephan ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [libreoffice] allow passing FilterOptions via cli
On 06/03/2014 02:01 PM, Tomas Hlavaty wrote: I wrote a patch to allow passing FilterOptions via cli, which fixes https://bugs.freedesktop.org/show_bug.cgi?id=36313. The patch is attached. The patch takes the FilterOptions from --infilter and --convert-to args using : as a delimiter. This should hopefully not be a problem, it is current separator used in --convert-to and I am not aware of a filter name containing that character. If that is a problem, the separator could be easily changed to a different character. The patch was written on top of libreoffice-4-3-branch-point tag (which compiled for me without serious problems). Would it be possible to cherry-pick the bug fix also to a fresh 4.2.X release? Thanks for your patch, I have pushed it to master (towards LO 4.4) now, http://cgit.freedesktop.org/libreoffice/core/commit/?id=45ba4d79d968f81f74ef0c4588fd15b1ce91153f fdo#36313: allow passing FilterOptions via cli. (Assuming the Tomas Hlavaty tomas.hlav...@knowledgetools.de identity is covered by http://lists.freedesktop.org/archives/libreoffice/2012-January/02.html [Libreoffice] License statement on file at https://wiki.documentfoundation.org/Development/Developers.) However, see my remark at https://bugs.freedesktop.org/show_bug.cgi?id=36313#c17: I am not sure whether the fix [...] is already a practical-enough solution? Stephan ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [libreoffice] allow passing FilterOptions via cli
Hi Stephan, thank you very much for pushing the patch. I updated https://wiki.documentfoundation.org/Development/Developers to cover this identity too. From your remark https://bugs.freedesktop.org/show_bug.cgi?id=36313#c17 I understand, that it does not seem very user friendly. However, the patch at least makes it possible to achieve the desired behaviour, which was not possible previously. Maybe the remaining problem should be seen as how to make the CVS filter options more user friendly? I don't have an answer to that, unfortunatelly. I found another bug report https://bugs.freedesktop.org/show_bug.cgi?id=47892 which explicitly asks for FilterOptions at least for --convert-to so I should have probably addressed this, but I found it later. Should I mark https://bugs.freedesktop.org/show_bug.cgi?id=47892 as resolved or leave it to QA people to handle that? Thank you, Tomas On 06/04/2014 01:04 PM, Stephan Bergmann wrote: On 06/03/2014 02:01 PM, Tomas Hlavaty wrote: I wrote a patch to allow passing FilterOptions via cli, which fixes https://bugs.freedesktop.org/show_bug.cgi?id=36313. The patch is attached. The patch takes the FilterOptions from --infilter and --convert-to args using : as a delimiter. This should hopefully not be a problem, it is current separator used in --convert-to and I am not aware of a filter name containing that character. If that is a problem, the separator could be easily changed to a different character. The patch was written on top of libreoffice-4-3-branch-point tag (which compiled for me without serious problems). Would it be possible to cherry-pick the bug fix also to a fresh 4.2.X release? Thanks for your patch, I have pushed it to master (towards LO 4.4) now, http://cgit.freedesktop.org/libreoffice/core/commit/?id=45ba4d79d968f81f74ef0c4588fd15b1ce91153f fdo#36313: allow passing FilterOptions via cli. (Assuming the Tomas Hlavaty tomas.hlav...@knowledgetools.de identity is covered by http://lists.freedesktop.org/archives/libreoffice/2012-January/02.html [Libreoffice] License statement on file at https://wiki.documentfoundation.org/Development/Developers.) However, see my remark at https://bugs.freedesktop.org/show_bug.cgi?id=36313#c17: I am not sure whether the fix [...] is already a practical-enough solution? Stephan ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [libreoffice] allow passing FilterOptions via cli
On 06/04/2014 02:16 PM, Tomas Hlavaty wrote: From your remark https://bugs.freedesktop.org/show_bug.cgi?id=36313#c17 I understand, that it does not seem very user friendly. However, the patch at least makes it possible to achieve the desired behaviour, which was not possible previously. Maybe the remaining problem should be seen as how to make the CVS filter options more user friendly? I don't have an answer to that, unfortunatelly. Yeah; maybe leave it to one of the people who reported to that issue to decide whether to mark it as resolved. I found another bug report https://bugs.freedesktop.org/show_bug.cgi?id=47892 which explicitly asks for FilterOptions at least for --convert-to so I should have probably addressed this, but I found it later. Should I mark https://bugs.freedesktop.org/show_bug.cgi?id=47892 as resolved or leave it to QA people to handle that? Please do mark that one as resolved. Stephan ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[libreoffice] allow passing FilterOptions via cli
Hi all, I wrote a patch to allow passing FilterOptions via cli, which fixes https://bugs.freedesktop.org/show_bug.cgi?id=36313. The patch is attached. The patch takes the FilterOptions from --infilter and --convert-to args using : as a delimiter. This should hopefully not be a problem, it is current separator used in --convert-to and I am not aware of a filter name containing that character. If that is a problem, the separator could be easily changed to a different character. The patch was written on top of libreoffice-4-3-branch-point tag (which compiled for me without serious problems). Would it be possible to cherry-pick the bug fix also to a fresh 4.2.X release? I have tested the change manually and as discussed on the mailing list last week, there is no easy way to write a test case for this kind of stuff currently. Thank you, Tomas From 843fefde549b2e3254d95325cc173622e4544eef Mon Sep 17 00:00:00 2001 From: Tomas Hlavaty tomas.hlav...@knowledgetools.de Date: Tue, 3 Jun 2014 12:42:47 +0200 Subject: [PATCH] allow passing FilterOptions via cli fixes https://bugs.freedesktop.org/show_bug.cgi?id=36313 Examples: --infilter=Text (encoded):UTF8,LF,,, --convert-to html:XHTML Writer File:UTF8 --convert-to txt:Text (encoded):UTF8 Change-Id: I69a0524ef63f6d486637d68280331528d1001b56 --- desktop/source/app/cmdlinehelp.cxx |7 +-- desktop/source/app/dispatchwatcher.cxx | 31 --- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/desktop/source/app/cmdlinehelp.cxx b/desktop/source/app/cmdlinehelp.cxx index 756dcab..a956038 100644 --- a/desktop/source/app/cmdlinehelp.cxx +++ b/desktop/source/app/cmdlinehelp.cxx @@ -109,14 +109,17 @@ namespace desktop --unaccept=accept-string\n\ Close an acceptor that was created with --accept=accept-string\n\ Use --unnaccept=all to close all open acceptors\n\ ---infilter=filter\n\ +--infilter=filter[:filter_options]\n\ Force an input filter type if possible\n\ Eg. --infilter=\Calc Office Open XML\\n\ ---convert-to output_file_extension[:output_filter_name] [--outdir output_dir] files\n\ + --infilter=\Text (encoded):UTF8,LF,,,\\n\ +--convert-to output_file_extension[:output_filter_name[:output_filter_options]] [--outdir output_dir] files\n\ Batch convert files.\n\ If --outdir is not specified then current working dir is used as output_dir.\n\ Eg. --convert-to pdf *.doc\n\ --convert-to pdf:writer_pdf_Export --outdir /home/user *.doc\n\ + --convert-to \html:XHTML Writer File:UTF8\ *.doc\n\ + --convert-to \txt:Text (encoded):UTF8\ *.doc\n\ --print-to-file [-printer-name printer_name] [--outdir output_dir] files\n\ Batch print files to file.\n\ If --outdir is not specified then current working dir is used as output_dir.\n\ diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx index abdbe38..77e5857 100644 --- a/desktop/source/app/dispatchwatcher.cxx +++ b/desktop/source/app/dispatchwatcher.cxx @@ -375,7 +375,21 @@ bool DispatchWatcher::executeDispatchRequests( const DispatchList aDispatchRequ sal_Int32 nIndex = aArgs.getLength(); aArgs.realloc(nIndex+1); aArgs[nIndex].Name = FilterName; -aArgs[nIndex].Value = aForcedInputFilter; + +sal_Int32 nFilterOptionsIndex = aForcedInputFilter.indexOf( ':' ); +if( 0 nFilterOptionsIndex ) +{ +aArgs[nIndex].Value = aForcedInputFilter.copy( 0, nFilterOptionsIndex ); + +nIndex = aArgs.getLength(); +aArgs.realloc(nIndex+1); +aArgs[nIndex].Name = FilterOptions; +aArgs[nIndex].Value = aForcedInputFilter.copy( nFilterOptionsIndex+1 ); +} +else +{ +aArgs[nIndex].Value = aForcedInputFilter; +} } // This is a synchron loading of a component so we don't have to deal with our statusChanged listener mechanism. @@ -449,12 +463,23 @@ bool DispatchWatcher::executeDispatchRequests( const DispatchList aDispatchRequ aFilter = impl_GuessFilter( aName, aOutFile ); } -SequencePropertyValue conversionProperties( 2 ); +sal_Int32 nFilterOptionsIndex = aFilter.indexOf( ':' ); +SequencePropertyValue conversionProperties( 0 nFilterOptionsIndex ? 3 : 2 ); conversionProperties[0].Name = Overwrite; conversionProperties[0].Value = sal_True;
[libreoffice] allow passing FilterOptions via cli
Hi all, I wrote a patch to allow passing FilterOptions via cli, which fixes https://bugs.freedesktop.org/show_bug.cgi?id=36313. The patch is attached. The patch takes the FilterOptions from --infilter and --convert-to args using : as a delimiter. This should hopefully not be a problem, it is current separator used in --convert-to and I am not aware of a filter name containing that character. If that is a problem, the separator could be easily changed to a different character. The patch was written on top of libreoffice-4-3-branch-point tag (which compiled for me without serious problems). Would it be possible to cherry-pick the bug fix also to a fresh 4.2.X release? I have tested the change manually and as discussed on the mailing list last week, there is no easy way to write a test case for this kind of stuff currently. Thank you, Tomas From 843fefde549b2e3254d95325cc173622e4544eef Mon Sep 17 00:00:00 2001 From: Tomas Hlavaty tomas.hlav...@knowledgetools.de Date: Tue, 3 Jun 2014 12:42:47 +0200 Subject: [PATCH] allow passing FilterOptions via cli fixes https://bugs.freedesktop.org/show_bug.cgi?id=36313 Examples: --infilter=Text (encoded):UTF8,LF,,, --convert-to html:XHTML Writer File:UTF8 --convert-to txt:Text (encoded):UTF8 Change-Id: I69a0524ef63f6d486637d68280331528d1001b56 --- desktop/source/app/cmdlinehelp.cxx |7 +-- desktop/source/app/dispatchwatcher.cxx | 31 --- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/desktop/source/app/cmdlinehelp.cxx b/desktop/source/app/cmdlinehelp.cxx index 756dcab..a956038 100644 --- a/desktop/source/app/cmdlinehelp.cxx +++ b/desktop/source/app/cmdlinehelp.cxx @@ -109,14 +109,17 @@ namespace desktop --unaccept=accept-string\n\ Close an acceptor that was created with --accept=accept-string\n\ Use --unnaccept=all to close all open acceptors\n\ ---infilter=filter\n\ +--infilter=filter[:filter_options]\n\ Force an input filter type if possible\n\ Eg. --infilter=\Calc Office Open XML\\n\ ---convert-to output_file_extension[:output_filter_name] [--outdir output_dir] files\n\ + --infilter=\Text (encoded):UTF8,LF,,,\\n\ +--convert-to output_file_extension[:output_filter_name[:output_filter_options]] [--outdir output_dir] files\n\ Batch convert files.\n\ If --outdir is not specified then current working dir is used as output_dir.\n\ Eg. --convert-to pdf *.doc\n\ --convert-to pdf:writer_pdf_Export --outdir /home/user *.doc\n\ + --convert-to \html:XHTML Writer File:UTF8\ *.doc\n\ + --convert-to \txt:Text (encoded):UTF8\ *.doc\n\ --print-to-file [-printer-name printer_name] [--outdir output_dir] files\n\ Batch print files to file.\n\ If --outdir is not specified then current working dir is used as output_dir.\n\ diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx index abdbe38..77e5857 100644 --- a/desktop/source/app/dispatchwatcher.cxx +++ b/desktop/source/app/dispatchwatcher.cxx @@ -375,7 +375,21 @@ bool DispatchWatcher::executeDispatchRequests( const DispatchList aDispatchRequ sal_Int32 nIndex = aArgs.getLength(); aArgs.realloc(nIndex+1); aArgs[nIndex].Name = FilterName; -aArgs[nIndex].Value = aForcedInputFilter; + +sal_Int32 nFilterOptionsIndex = aForcedInputFilter.indexOf( ':' ); +if( 0 nFilterOptionsIndex ) +{ +aArgs[nIndex].Value = aForcedInputFilter.copy( 0, nFilterOptionsIndex ); + +nIndex = aArgs.getLength(); +aArgs.realloc(nIndex+1); +aArgs[nIndex].Name = FilterOptions; +aArgs[nIndex].Value = aForcedInputFilter.copy( nFilterOptionsIndex+1 ); +} +else +{ +aArgs[nIndex].Value = aForcedInputFilter; +} } // This is a synchron loading of a component so we don't have to deal with our statusChanged listener mechanism. @@ -449,12 +463,23 @@ bool DispatchWatcher::executeDispatchRequests( const DispatchList aDispatchRequ aFilter = impl_GuessFilter( aName, aOutFile ); } -SequencePropertyValue conversionProperties( 2 ); +sal_Int32 nFilterOptionsIndex = aFilter.indexOf( ':' ); +SequencePropertyValue conversionProperties( 0 nFilterOptionsIndex ? 3 : 2 ); conversionProperties[0].Name = Overwrite; conversionProperties[0].Value = sal_True;