Re: bafna_p - r31400 - abiword/branches/gsoc2012math/plugins/latex/xp

From: Prashant Bafna <appu.bafna_at_gmail.com>
Date: Tue Jun 19 2012 - 09:17:36 CEST

On Tue, Jun 19, 2012 at 11:29 AM, Hubert Figuière <hfiguiere@teaser.fr> wrote:
>
> On 18/06/12 10:42 PM, cvs@abisource.com wrote:
>>
>> Author: bafna_p
>> Date: 2012-06-19 07:42:38 +0200 (Tue, 19 Jun 2012)
>> New Revision: 31400
>>
>> Modified:
>>    abiword/branches/gsoc2012math/plugins/latex/xp/ie_exp_LaTeX.cpp
>> Log:
>> adding the path of xsltml for windows as well
>>
>> Modified: abiword/branches/gsoc2012math/plugins/latex/xp/ie_exp_LaTeX.cpp
>> ===================================================================
>> --- abiword/branches/gsoc2012math/plugins/latex/xp/ie_exp_LaTeX.cpp   2012-06-18 19:25:13 UTC (rev 31399)
>> +++ abiword/branches/gsoc2012math/plugins/latex/xp/ie_exp_LaTeX.cpp   2012-06-19 05:42:38 UTC (rev 31400)
>> @@ -1599,9 +1599,14 @@
>>               return false;
>>       if (!cur)
>>       {
>> -             UT_UTF8String path(XAP_App::getApp()->getAbiSuiteLibDir());
>> -             path += "/xsltml/mmltex.xsl";
>> -
>> +             #ifdef WIN32
>> +                     UT_UTF8String path("../../plugins/latex/xsltml/mmltex.xsl");
>> +                     // changed the path string as the below works for linux, however in windows it goes to msvc2008/Debug/xsltml which is wrong
>> +             #else
>> +                     UT_UTF8String path(XAP_App::getApp()->getAbiSuiteLibDir());
>> +                     path += "/xsltml/mmltex.xsl";
>> +             #endif
>> +
>
> This is wrong too.
>
> Because you have absolutely no guarantee that the current directory will
> be what it is.
>
> If XAP_App::getApp()->getAbiSuiteLibDir() does not return the correct
> value then it is a bug.
> Note that I don't know the implementation on Windows.
>
> Hub
>

Oh ok I got the error, However it is not a bug of
XAP_App::getApp()->getAbiSuiteLibDir() because in msvc it returns
msvc2008/Debug which is correct LibDir for a Windows build.

What I think we should do is add the folder xsltml to
msvc2008/Prefix/Share and create a Post build event for the Latex
Plugin to copy this folder into the OutDir. (suggested PATCH attached)

I see that this is the way it has been done for other things as well
for e.g. the mathview plugin copies the gtkmathview XML files from
msvc2008/Prefix/Share/gtkmathview to msvc2008/debug/math as a post
build event.

with this the xsltml will be in the debug folder and

  UT_UTF8String path(XAP_App::getApp()->getAbiSuiteLibDir());
  path += "/xsltml/mmltex.xsl";

will work in windows as well.

Thanks,
Prashant

Received on Tue Jun 19 09:17:48 2012

This archive was generated by hypermail 2.1.8 : Tue Jun 19 2012 - 09:17:48 CEST