Re: bug in displaying of picture

2002-04-23 Thread Angus Leeming

On Monday 22 April 2002 10:11 pm, Herbert Voss wrote:
 Kornel Benko wrote:
  -BEGIN PGP SIGNED MESSAGE-
 
  On Monday, 22. April 2002 17:46, Herbert Voss wrote:
 what happens when you try the patch
 
 http://www.mail-archive.com/lyx-devel%40lists.lyx.org/msg36886.html
 
  The same behaviour in this case.

 ok, try this one.
 now every tempdir has it's own graphic files

 Herbert

I haven't tried your patch, Herbert, but it won't fix the problem. Kornel is 
unable to display the image in LyX, not the LaTeX output.

For some reason, the GraphicsCache is destroying the GraphicsCacheItem when 
one of the insets is destroyed but whilst one still points to it.

Unfortunately, I have no time to investigate at present.

Angus



Re: bug in displaying of picture

2002-04-23 Thread Kornel Benko

-BEGIN PGP SIGNED MESSAGE-

On Monday, 22. April 2002 23:11, Herbert Voss wrote:
 ok, try this one.
 now every tempdir has it's own graphic files

Nothing changed.
Are you not having this same effect?

Kornel
- -- 
Kornel Benko
[EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: PGP 6.5.8

iQCVAwUBPMUd2rewfbDGmeqhAQH0oAQAg1gLiCj70BIJCmpLswUf++PXEVafJJUM
Q2XZ6o7X06QZG0Wel6i4f3Gw+luZpe9WRwTt/8FH1TRjvduQqepl394G1tcY8AmE
/XVuQVheAJyig6j9WVRwU2gsjOJ7suFuA0YelNdMc8HxzBMyZdF9cVlxAvS2EsxY
xk28MQABqBU=
=6s9g
-END PGP SIGNATURE-



Re: bug in displaying of picture

2002-04-23 Thread Herbert Voss

On Tue, 23 Apr 2002, Angus Leeming wrote:

 I haven't tried your patch, Herbert, but it won't fix the problem. Kornel is
 unable to display the image in LyX, not the LaTeX output.

I know, but the problem is that LyX does not use two
different files in two different tempdirs. If I
copy first the original file into the rempdir,
it should work, like the patch from yetserday.

Herbert




Re: bug in displaying of picture

2002-04-23 Thread Herbert Voss

On Tue, 23 Apr 2002, Kornel Benko wrote:

 -BEGIN PGP SIGNED MESSAGE-

 On Monday, 22. April 2002 23:11, Herbert Voss wrote:
  ok, try this one.
  now every tempdir has it's own graphic files

 Nothing changed.
 Are you not having this same effect?

n

Herbert




Re: bug in displaying of picture

2002-04-23 Thread Angus Leeming

On Tuesday 23 April 2002 10:23 am, Herbert Voss wrote:
 On Tue, 23 Apr 2002, Angus Leeming wrote:
  I haven't tried your patch, Herbert, but it won't fix the problem. Kornel
  is unable to display the image in LyX, not the LaTeX output.

 I know, but the problem is that LyX does not use two
 different files in two different tempdirs. If I
 copy first the original file into the rempdir,
 it should work, like the patch from yetserday.

Why? Once the image is loaded into memory it doesn't care about any file. The 
problem MUST be that the image is deleted from memory prematurely. The 
problem is, I don't understand why, as eash image (GraphicsCacheItem) stores 
a list of all insets referencing it. Only when this list is empty is the 
image (GraphicsCacheItem) deleted.

Angus



Re: bug in displaying of picture

2002-04-23 Thread Andre Poenitz

On Tue, Apr 23, 2002 at 10:30:20AM +0100, Angus Leeming wrote:
 Why? Once the image is loaded into memory it doesn't care about any file. The 
 problem MUST be that the image is deleted from memory prematurely. The 
 problem is, I don't understand why, as eash image (GraphicsCacheItem) stores 
 a list of all insets referencing it. Only when this list is empty is the 
 image (GraphicsCacheItem) deleted.

Out of curiosity: Why is it handled that way? Wouldn't a reference counted
object do as well?

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)



Re: bug in displaying of picture

2002-04-23 Thread Herbert Voss

On Tue, 23 Apr 2002, Angus Leeming wrote:

 On Tuesday 23 April 2002 10:23 am, Herbert Voss wrote:
  On Tue, 23 Apr 2002, Angus Leeming wrote:
   I haven't tried your patch, Herbert, but it won't fix the problem. Kornel
   is unable to display the image in LyX, not the LaTeX output.
 
  I know, but the problem is that LyX does not use two
  different files in two different tempdirs. If I
  copy first the original file into the rempdir,
  it should work, like the patch from yetserday.

 Why? Once the image is loaded into memory it doesn't care about any file. The
 problem MUST be that the image is deleted from memory prematurely. The
 problem is, I don't understand why, as eash image (GraphicsCacheItem) stores
 a list of all insets referencing it. Only when this list is empty is the
 image (GraphicsCacheItem) deleted.

understood, but there are two problems:
1. the one with eps-files in the doc-dir. this should be fixed
   with the patch.
2. the problem with the xpm-file, which I cannot see myself???

Herbert




Re: bug in displaying of picture

2002-04-23 Thread Angus Leeming

On Tuesday 23 April 2002 10:34 am, Andre Poenitz wrote:
 On Tue, Apr 23, 2002 at 10:30:20AM +0100, Angus Leeming wrote:
  Why? Once the image is loaded into memory it doesn't care about any file.
  The problem MUST be that the image is deleted from memory prematurely.
  The problem is, I don't understand why, as eash image (GraphicsCacheItem)
  stores a list of all insets referencing it. Only when this list is empty
  is the image (GraphicsCacheItem) deleted.

 Out of curiosity: Why is it handled that way? Wouldn't a reference counted
 object do as well?

 Andre'

Yes. Remember that I had to rewrite the code pretty-well from scratch and 
that meant learning how it worked as I went along. I just came up with a 
solution that was logically correct.

Storing the modified images in the graphics inset and use of 
boost::shared_ptr will make all more transparent. 1.3 stuff.

Angus



Re: bug in displaying of picture

2002-04-23 Thread Juergen Vigna


On 23-Apr-2002 Angus Leeming wrote:

 Yes. Remember that I had to rewrite the code pretty-well from scratch and 
 that meant learning how it worked as I went along. I just came up with a 
 solution that was logically correct.
 
 Storing the modified images in the graphics inset and use of 
 boost::shared_ptr will make all more transparent. 1.3 stuff.

Well I don't know, do you care about insets in the undo buffer? Every
undo instance can have an inset which refers to the image.

And one more thing why do you don't reload the image if we don't have
a GC for it?

   Jug

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen VignaE-Mail:  [EMAIL PROTECTED]
Italienallee 13/N   Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen   Web: http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

The more I want to get something done, the less I call it work.
-- Richard Bach, Illusions




Re: bug in displaying of picture

2002-04-23 Thread Kornel Benko

-BEGIN PGP SIGNED MESSAGE-

I have the same effect, regardless of the preferences.
(tmp_dir, backup_path)

By the way, I could not use the Browse... -button to get the backup-path.
(Each time I am forced to select a regular file, directory-filename
shall not be accepted)
Edit-Preferences-Inputs-Paths-Backup path-Browse...

Kornel
- -- 
Kornel Benko
[EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: PGP 6.5.8

iQCVAwUBPMUwQrewfbDGmeqhAQF8lAQAg1flCi3dgZjomnua0BV9LsRK5pz34SGr
YymH2IxSDNSdEk+wqG4lf9fUlOttwWGYSCCQQV6DjZCLC3MhjGECgeDhBPuskqbu
G23nFCVnBUT7LdI6zdOa1T9lGJTZ79XHKjwG9Zqg8XRI/ziZTMJKioXYcH2fCGsg
iQoE9w8iafo=
=EU2O
-END PGP SIGNATURE-



Re: bug in displaying of picture

2002-04-23 Thread Angus Leeming

On Tuesday 23 April 2002 10:49 am, Juergen Vigna wrote:
 On 23-Apr-2002 Angus Leeming wrote:
  Yes. Remember that I had to rewrite the code pretty-well from scratch and
  that meant learning how it worked as I went along. I just came up with a
  solution that was logically correct.
 
  Storing the modified images in the graphics inset and use of
  boost::shared_ptr will make all more transparent. 1.3 stuff.

 Well I don't know, do you care about insets in the undo buffer? Every
 undo instance can have an inset which refers to the image.

Let's talk about the present rather than some 1.3 pipe dream.

At present we store a list of insets with each image in a GraphicsCahceItem, 
so it doesn't matter if the inset is in the buffer or in the undo buffer; 
it's in the list. Only when the list is empty is the GraphicsCacheItem 
removed. Or that's how it should work!

 And one more thing why do you don't reload the image if we don't have
 a GC for it?

Because something has gone wrong. Part of the code thinks we have an image, 
part of it doesn't. Best to resolve this conflict correctly, not fudge the 
issue.

Angus



Re: bug in displaying of picture

2002-04-23 Thread Herbert Voss

Kornel Benko wrote:

 By the way, I could not use the Browse... -button to get the backup-path.
 (Each time I am forced to select a regular file, directory-filename
 shall not be accepted)
   Edit-Preferences-Inputs-Paths-Backup path-Browse...


no probleme here. Do you have write access to that backup dir?

HErbert



-- 
http://www.lyx.org/help/




Re: bug in displaying of picture

2002-04-23 Thread Kornel Benko

-BEGIN PGP SIGNED MESSAGE-

On Tuesday, 23. April 2002 17:18, Herbert Voss wrote:
 Kornel Benko wrote:
  By the way, I could not use the Browse... -button to get the
  backup-path. (Each time I am forced to select a regular file,
  directory-filename shall not be accepted)
  Edit-Preferences-Inputs-Paths-Backup path-Browse...

 no probleme here. Do you have write access to that backup dir?

Oh, no problem here too. I have to OK the directory-part only.
Excuse the noise.

Kornel
- -- 
Kornel Benko
[EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: PGP 6.5.8

iQCVAwUBPMV90rewfbDGmeqhAQEInwQAoCm632egJod1euFGhaZRRlxQs5XbfPZR
s/kguiuPCsAl7XOq37vt3QY02ECRZTnp1aXLLEXoGGdowMkHDTa+XzFcpolOflPh
AJ26ySPXYSzuiaKJ3foB1b/E+IfwlCe//Ki8yEpHZiS4RwzNyDHnrn08mEfLHPXh
PfVKMPGabto=
=E5ey
-END PGP SIGNATURE-

attachment: before.jpgattachment: after.jpg

Re: bug in displaying of picture

2002-04-23 Thread Angus Leeming

On Monday 22 April 2002 10:11 pm, Herbert Voss wrote:
> Kornel Benko wrote:
> > -BEGIN PGP SIGNED MESSAGE-
> >
> > On Monday, 22. April 2002 17:46, Herbert Voss wrote:
> >>what happens when you try the patch
> >>
> >>http://www.mail-archive.com/lyx-devel%40lists.lyx.org/msg36886.html
> >
> > The same behaviour in this case.
>
> ok, try this one.
> now every tempdir has it's own graphic files
>
> Herbert

I haven't tried your patch, Herbert, but it won't fix the problem. Kornel is 
unable to display the image in LyX, not the LaTeX output.

For some reason, the GraphicsCache is destroying the GraphicsCacheItem when 
one of the insets is destroyed but whilst one still points to it.

Unfortunately, I have no time to investigate at present.

Angus



Re: bug in displaying of picture

2002-04-23 Thread Kornel Benko

-BEGIN PGP SIGNED MESSAGE-

On Monday, 22. April 2002 23:11, Herbert Voss wrote:
> ok, try this one.
> now every tempdir has it's own graphic files

Nothing changed.
Are you not having this same effect?

Kornel
- -- 
Kornel Benko
[EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: PGP 6.5.8

iQCVAwUBPMUd2rewfbDGmeqhAQH0oAQAg1gLiCj70BIJCmpLswUf++PXEVafJJUM
Q2XZ6o7X06QZG0Wel6i4f3Gw+luZpe9WRwTt/8FH1TRjvduQqepl394G1tcY8AmE
/XVuQVheAJyig6j9WVRwU2gsjOJ7suFuA0YelNdMc8HxzBMyZdF9cVlxAvS2EsxY
xk28MQABqBU=
=6s9g
-END PGP SIGNATURE-



Re: bug in displaying of picture

2002-04-23 Thread Herbert Voss

On Tue, 23 Apr 2002, Angus Leeming wrote:

> I haven't tried your patch, Herbert, but it won't fix the problem. Kornel is
> unable to display the image in LyX, not the LaTeX output.

I know, but the problem is that LyX does not use two
different files in two different tempdirs. If I
copy first the original file into the rempdir,
it should work, like the patch from yetserday.

Herbert




Re: bug in displaying of picture

2002-04-23 Thread Herbert Voss

On Tue, 23 Apr 2002, Kornel Benko wrote:

> -BEGIN PGP SIGNED MESSAGE-
>
> On Monday, 22. April 2002 23:11, Herbert Voss wrote:
> > ok, try this one.
> > now every tempdir has it's own graphic files
>
> Nothing changed.
> Are you not having this same effect?

n

Herbert




Re: bug in displaying of picture

2002-04-23 Thread Angus Leeming

On Tuesday 23 April 2002 10:23 am, Herbert Voss wrote:
> On Tue, 23 Apr 2002, Angus Leeming wrote:
> > I haven't tried your patch, Herbert, but it won't fix the problem. Kornel
> > is unable to display the image in LyX, not the LaTeX output.
>
> I know, but the problem is that LyX does not use two
> different files in two different tempdirs. If I
> copy first the original file into the rempdir,
> it should work, like the patch from yetserday.

Why? Once the image is loaded into memory it doesn't care about any file. The 
problem MUST be that the image is deleted from memory prematurely. The 
problem is, I don't understand why, as eash image (GraphicsCacheItem) stores 
a list of all insets referencing it. Only when this list is empty is the 
image (GraphicsCacheItem) deleted.

Angus



Re: bug in displaying of picture

2002-04-23 Thread Andre Poenitz

On Tue, Apr 23, 2002 at 10:30:20AM +0100, Angus Leeming wrote:
> Why? Once the image is loaded into memory it doesn't care about any file. The 
> problem MUST be that the image is deleted from memory prematurely. The 
> problem is, I don't understand why, as eash image (GraphicsCacheItem) stores 
> a list of all insets referencing it. Only when this list is empty is the 
> image (GraphicsCacheItem) deleted.

Out of curiosity: Why is it handled that way? Wouldn't a reference counted
object do as well?

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)



Re: bug in displaying of picture

2002-04-23 Thread Herbert Voss

On Tue, 23 Apr 2002, Angus Leeming wrote:

> On Tuesday 23 April 2002 10:23 am, Herbert Voss wrote:
> > On Tue, 23 Apr 2002, Angus Leeming wrote:
> > > I haven't tried your patch, Herbert, but it won't fix the problem. Kornel
> > > is unable to display the image in LyX, not the LaTeX output.
> >
> > I know, but the problem is that LyX does not use two
> > different files in two different tempdirs. If I
> > copy first the original file into the rempdir,
> > it should work, like the patch from yetserday.
>
> Why? Once the image is loaded into memory it doesn't care about any file. The
> problem MUST be that the image is deleted from memory prematurely. The
> problem is, I don't understand why, as eash image (GraphicsCacheItem) stores
> a list of all insets referencing it. Only when this list is empty is the
> image (GraphicsCacheItem) deleted.

understood, but there are two problems:
1. the one with eps-files in the doc-dir. this should be fixed
   with the patch.
2. the problem with the xpm-file, which I cannot see myself???

Herbert




Re: bug in displaying of picture

2002-04-23 Thread Angus Leeming

On Tuesday 23 April 2002 10:34 am, Andre Poenitz wrote:
> On Tue, Apr 23, 2002 at 10:30:20AM +0100, Angus Leeming wrote:
> > Why? Once the image is loaded into memory it doesn't care about any file.
> > The problem MUST be that the image is deleted from memory prematurely.
> > The problem is, I don't understand why, as eash image (GraphicsCacheItem)
> > stores a list of all insets referencing it. Only when this list is empty
> > is the image (GraphicsCacheItem) deleted.
>
> Out of curiosity: Why is it handled that way? Wouldn't a reference counted
> object do as well?
>
> Andre'

Yes. Remember that I had to rewrite the code pretty-well from scratch and 
that meant learning how it worked as I went along. I just came up with a 
solution that was logically correct.

Storing the "modified" images in the graphics inset and use of 
boost::shared_ptr will make all more transparent. 1.3 stuff.

Angus



Re: bug in displaying of picture

2002-04-23 Thread Juergen Vigna


On 23-Apr-2002 Angus Leeming wrote:

> Yes. Remember that I had to rewrite the code pretty-well from scratch and 
> that meant learning how it worked as I went along. I just came up with a 
> solution that was logically correct.
> 
> Storing the "modified" images in the graphics inset and use of 
> boost::shared_ptr will make all more transparent. 1.3 stuff.

Well I don't know, do you care about insets in the undo buffer? Every
undo instance can have an inset which refers to the image.

And one more thing why do you don't reload the image if we don't have
a GC for it?

   Jug

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen VignaE-Mail:  [EMAIL PROTECTED]
Italienallee 13/N   Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen   Web: http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

The more I want to get something done, the less I call it work.
-- Richard Bach, "Illusions"




Re: bug in displaying of picture

2002-04-23 Thread Kornel Benko

-BEGIN PGP SIGNED MESSAGE-

I have the same effect, regardless of the preferences.
(tmp_dir, backup_path)

By the way, I could not use the "Browse..." -button to get the backup-path.
(Each time I am forced to select a regular file, directory-filename
shall not be accepted)
Edit->Preferences->Inputs->Paths->Backup path->Browse...

Kornel
- -- 
Kornel Benko
[EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: PGP 6.5.8

iQCVAwUBPMUwQrewfbDGmeqhAQF8lAQAg1flCi3dgZjomnua0BV9LsRK5pz34SGr
YymH2IxSDNSdEk+wqG4lf9fUlOttwWGYSCCQQV6DjZCLC3MhjGECgeDhBPuskqbu
G23nFCVnBUT7LdI6zdOa1T9lGJTZ79XHKjwG9Zqg8XRI/ziZTMJKioXYcH2fCGsg
iQoE9w8iafo=
=EU2O
-END PGP SIGNATURE-



Re: bug in displaying of picture

2002-04-23 Thread Angus Leeming

On Tuesday 23 April 2002 10:49 am, Juergen Vigna wrote:
> On 23-Apr-2002 Angus Leeming wrote:
> > Yes. Remember that I had to rewrite the code pretty-well from scratch and
> > that meant learning how it worked as I went along. I just came up with a
> > solution that was logically correct.
> >
> > Storing the "modified" images in the graphics inset and use of
> > boost::shared_ptr will make all more transparent. 1.3 stuff.
>
> Well I don't know, do you care about insets in the undo buffer? Every
> undo instance can have an inset which refers to the image.

Let's talk about the present rather than some 1.3 pipe dream.

At present we store a list of insets with each image in a GraphicsCahceItem, 
so it doesn't matter if the inset is in the buffer or in the undo buffer; 
it's in the list. Only when the list is empty is the GraphicsCacheItem 
removed. Or that's how it should work!

> And one more thing why do you don't reload the image if we don't have
> a GC for it?

Because something has gone wrong. Part of the code thinks we have an image, 
part of it doesn't. Best to resolve this conflict correctly, not fudge the 
issue.

Angus



Re: bug in displaying of picture

2002-04-23 Thread Herbert Voss

Kornel Benko wrote:

> By the way, I could not use the "Browse..." -button to get the backup-path.
> (Each time I am forced to select a regular file, directory-filename
> shall not be accepted)
>   Edit->Preferences->Inputs->Paths->Backup path->Browse...


no probleme here. Do you have write access to that backup dir?

HErbert



-- 
http://www.lyx.org/help/




Re: bug in displaying of picture

2002-04-23 Thread Kornel Benko

-BEGIN PGP SIGNED MESSAGE-

On Tuesday, 23. April 2002 17:18, Herbert Voss wrote:
> Kornel Benko wrote:
> > By the way, I could not use the "Browse..." -button to get the
> > backup-path. (Each time I am forced to select a regular file,
> > directory-filename shall not be accepted)
> > Edit->Preferences->Inputs->Paths->Backup path->Browse...
>
> no probleme here. Do you have write access to that backup dir?

Oh, no problem here too. I have to OK the directory-part only.
Excuse the noise.

Kornel
- -- 
Kornel Benko
[EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: PGP 6.5.8

iQCVAwUBPMV90rewfbDGmeqhAQEInwQAoCm632egJod1euFGhaZRRlxQs5XbfPZR
s/kguiuPCsAl7XOq37vt3QY02ECRZTnp1aXLLEXoGGdowMkHDTa+XzFcpolOflPh
AJ26ySPXYSzuiaKJ3foB1b/E+IfwlCe//Ki8yEpHZiS4RwzNyDHnrn08mEfLHPXh
PfVKMPGabto=
=E5ey
-END PGP SIGNATURE-

<><>

bug in displaying of picture

2002-04-22 Thread Kornel Benko

-BEGIN PGP SIGNED MESSAGE-


- - create two documents containg the same image
- - load both in lyx. Switch betwenn documents. All is working wonderfull.
- - close one of the documents.
- -- displaying of the image in second document is broken.

Kornel
- -- 
Kornel Benko
[EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: PGP 6.5.8

iQCVAwUBPMQt27ewfbDGmeqhAQGXaAP/e8FljikDggWg9nACjwxLLwq31/ZOZwW7
4FwXVk7OkfDIvJEtWliE8pspHxZssfUqPV0rm8RxnOMwZS303eUalSY97+Qn5/NU
Qw8nYTNS2e+Z9oMQc93wdXi+ZzgFvFtp6MBbqE0XVmB5bl63vdSQz9zlPyzY3Hgb
E4ijKSZXI+Y=
=dlSD
-END PGP SIGNATURE-

attachment: xx.jpg

Re: bug in displaying of picture

2002-04-22 Thread Herbert Voss

Kornel Benko wrote:

 
 - - create two documents containg the same image
 - - load both in lyx. Switch betwenn documents. All is working wonderfull.
 - - close one of the documents.
 - -- displaying of the image in second document is broken.


what happens when you try the patch

http://www.mail-archive.com/lyx-devel%40lists.lyx.org/msg36886.html

Herbert

-- 
http://www.lyx.org/help/




Re: bug in displaying of picture

2002-04-22 Thread Kornel Benko

-BEGIN PGP SIGNED MESSAGE-

On Monday, 22. April 2002 17:46, Herbert Voss wrote:
 what happens when you try the patch

 http://www.mail-archive.com/lyx-devel%40lists.lyx.org/msg36886.html

The same behaviour in this case.

Kornel
- - -- 
Kornel Benko
[EMAIL PROTECTED]


-BEGIN PGP SIGNATURE-
Version: PGP 6.5.8

iQCVAwUBPMQ267ewfbDGmeqhAQHuMgQAn5rIKrIVzre8E9pLhnKIfUAO83xvm26G
8Z3vslqdaVsMcJIqDjPj62FbJZog+k2+M4LqCPQ72McE6yqOmRja5J8Pwy7p2tsc
4B09NLg3Nio2u26vGfMDEgvv9x3o6H9S95Z8Lcd8511xEJdCmwHB0KmmYI013fUr
9pfhC3VFYDM=
=fHCb
-END PGP SIGNATURE-



Re: bug in displaying of picture

2002-04-22 Thread Herbert Voss

Kornel Benko wrote:

 -BEGIN PGP SIGNED MESSAGE-
 
 On Monday, 22. April 2002 17:46, Herbert Voss wrote:
 
what happens when you try the patch

http://www.mail-archive.com/lyx-devel%40lists.lyx.org/msg36886.html

 
 The same behaviour in this case.


ok, try this one.
now every tempdir has it's own graphic files

Herbert



-- 
http://www.lyx.org/help/


Index: src/insets/insetgraphics.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetgraphics.C,v
retrieving revision 1.105
diff -u -r1.105 insetgraphics.C
--- src/insets/insetgraphics.C  19 Apr 2002 17:16:00 -  1.105
+++ src/insets/insetgraphics.C  22 Apr 2002 21:09:10 -
 -94,6 +94,7 
 #include LaTeXFeatures.h
 
 #include frontends/Dialogs.h
+#include frontends/Alert.h
 #include frontends/controllers/helper_funcs.h // getVectorFromString
 
 #include support/LAssert.h
 -632,22 +633,39 
 
string const from = getExtFromContents(filename_);
string const to   = findTargetFormat(from);
+   lyxerr[Debug::GRAPHICS]  \tfrom:  from  endl;
+   lyxerr[Debug::GRAPHICS]  \tto  :  to  endl;
 
if (from == to) {
// No conversion needed!
return filename_;
}
 
-   string const temp = MakeAbsPath(filename_, buf-tmppath);
+   string const temp = MakeAbsPath(OnlyFilename(filename_), buf-tmppath);
string const outfile_base = RemoveExtension(temp);
+   // first we copy the original file from the docdir into
+   // the temp dir but only when use-tmpdir is enabled
+   if (IsFileReadable(filename_)  lyxrc.use_tempdir) {
+   bool success = lyx::copy(filename_, temp);
+   lyxerr[Debug::GRAPHICS]  [prepareFile] copy from  
+filename_   to   temp  \n;
+   if (!success) {
+   Alert::alert(_(cannot copy file), filename_,
+   _(into tempdir));
+   return filename_;
+   }
+   } else 
+   lyxerr[Debug::GRAPHICS]  [prepareFile] file   temp 
+ isn't readable  endl;
+
+   lyxerr[Debug::GRAPHICS]  calling convert with these values:  endl;
+   lyxerr[Debug::GRAPHICS]  \ttempname =   temp  endl;
+   lyxerr[Debug::GRAPHICS]  \tbuf-tmppath =   buf-tmppath  endl;
+   lyxerr[Debug::GRAPHICS]  \toutfile_base =   outfile_base  endl;
+   lyxerr[Debug::GRAPHICS]  \t(filename_=   filename_  )\n;
 
-   lyxerr[Debug::GRAPHICS]  tempname =   temp  \n;
-   lyxerr[Debug::GRAPHICS]  buf::tmppath =   buf-tmppath  \n;
-   lyxerr[Debug::GRAPHICS]  filename_ =   filename_  \n;
-   lyxerr[Debug::GRAPHICS]  outfile_base =   outfile_base  endl;
-
-   converters.convert(buf, filename_, outfile_base, from, to);
-   return RemoveExtension(filename_);
+   converters.convert(buf, temp, outfile_base, from, to);
+   return RemoveExtension(temp);
 }
 
 



bug in displaying of picture

2002-04-22 Thread Kornel Benko

-BEGIN PGP SIGNED MESSAGE-


- - create two documents containg the same image
- - load both in lyx. Switch betwenn documents. All is working wonderfull.
- - close one of the documents.
- --> displaying of the image in second document is broken.

Kornel
- -- 
Kornel Benko
[EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: PGP 6.5.8

iQCVAwUBPMQt27ewfbDGmeqhAQGXaAP/e8FljikDggWg9nACjwxLLwq31/ZOZwW7
4FwXVk7OkfDIvJEtWliE8pspHxZssfUqPV0rm8RxnOMwZS303eUalSY97+Qn5/NU
Qw8nYTNS2e+Z9oMQc93wdXi+ZzgFvFtp6MBbqE0XVmB5bl63vdSQz9zlPyzY3Hgb
E4ijKSZXI+Y=
=dlSD
-END PGP SIGNATURE-

<>

Re: bug in displaying of picture

2002-04-22 Thread Herbert Voss

Kornel Benko wrote:

> 
> - - create two documents containg the same image
> - - load both in lyx. Switch betwenn documents. All is working wonderfull.
> - - close one of the documents.
> - --> displaying of the image in second document is broken.


what happens when you try the patch

http://www.mail-archive.com/lyx-devel%40lists.lyx.org/msg36886.html

Herbert

-- 
http://www.lyx.org/help/




Re: bug in displaying of picture

2002-04-22 Thread Kornel Benko

-BEGIN PGP SIGNED MESSAGE-

On Monday, 22. April 2002 17:46, Herbert Voss wrote:
> what happens when you try the patch
>
> http://www.mail-archive.com/lyx-devel%40lists.lyx.org/msg36886.html

The same behaviour in this case.

Kornel
- - -- 
Kornel Benko
[EMAIL PROTECTED]


-BEGIN PGP SIGNATURE-
Version: PGP 6.5.8

iQCVAwUBPMQ267ewfbDGmeqhAQHuMgQAn5rIKrIVzre8E9pLhnKIfUAO83xvm26G
8Z3vslqdaVsMcJIqDjPj62FbJZog+k2+M4LqCPQ72McE6yqOmRja5J8Pwy7p2tsc
4B09NLg3Nio2u26vGfMDEgvv9x3o6H9S95Z8Lcd8511xEJdCmwHB0KmmYI013fUr
9pfhC3VFYDM=
=fHCb
-END PGP SIGNATURE-



Re: bug in displaying of picture

2002-04-22 Thread Herbert Voss

Kornel Benko wrote:

> -BEGIN PGP SIGNED MESSAGE-
> 
> On Monday, 22. April 2002 17:46, Herbert Voss wrote:
> 
>>what happens when you try the patch
>>
>>http://www.mail-archive.com/lyx-devel%40lists.lyx.org/msg36886.html
>>
> 
> The same behaviour in this case.


ok, try this one.
now every tempdir has it's own graphic files

Herbert



-- 
http://www.lyx.org/help/


Index: src/insets/insetgraphics.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetgraphics.C,v
retrieving revision 1.105
diff -u -r1.105 insetgraphics.C
--- src/insets/insetgraphics.C  19 Apr 2002 17:16:00 -  1.105
+++ src/insets/insetgraphics.C  22 Apr 2002 21:09:10 -
@@ -94,6 +94,7 @@
 #include "LaTeXFeatures.h"
 
 #include "frontends/Dialogs.h"
+#include "frontends/Alert.h"
 #include "frontends/controllers/helper_funcs.h" // getVectorFromString
 
 #include "support/LAssert.h"
@@ -632,22 +633,39 @@
 
string const from = getExtFromContents(filename_);
string const to   = findTargetFormat(from);
+   lyxerr[Debug::GRAPHICS] << "\tfrom:" << from << endl;
+   lyxerr[Debug::GRAPHICS] << "\tto  :" << to << endl;
 
if (from == to) {
// No conversion needed!
return filename_;
}
 
-   string const temp = MakeAbsPath(filename_, buf->tmppath);
+   string const temp = MakeAbsPath(OnlyFilename(filename_), buf->tmppath);
string const outfile_base = RemoveExtension(temp);
+   // first we copy the original file from the docdir into
+   // the temp dir but only when use-tmpdir is enabled
+   if (IsFileReadable(filename_) && lyxrc.use_tempdir) {
+   bool success = lyx::copy(filename_, temp);
+   lyxerr[Debug::GRAPHICS] << "[prepareFile] copy from " 
+   << filename_ << " to " << temp << "\n";
+   if (!success) {
+   Alert::alert(_("cannot copy file"), filename_,
+   _("into tempdir"));
+   return filename_;
+   }
+   } else 
+   lyxerr[Debug::GRAPHICS] << "[prepareFile] file " << temp 
+   << " isn't readable" << endl;
+
+   lyxerr[Debug::GRAPHICS] << "calling convert with these values:" << endl;
+   lyxerr[Debug::GRAPHICS] << "\ttempname = " << temp << endl;
+   lyxerr[Debug::GRAPHICS] << "\tbuf->tmppath = " << buf->tmppath << endl;
+   lyxerr[Debug::GRAPHICS] << "\toutfile_base = " << outfile_base << endl;
+   lyxerr[Debug::GRAPHICS] << "\t(filename_= " << filename_ << ")\n";
 
-   lyxerr[Debug::GRAPHICS] << "tempname = " << temp << "\n";
-   lyxerr[Debug::GRAPHICS] << "buf::tmppath = " << buf->tmppath << "\n";
-   lyxerr[Debug::GRAPHICS] << "filename_ = " << filename_ << "\n";
-   lyxerr[Debug::GRAPHICS] << "outfile_base = " << outfile_base << endl;
-
-   converters.convert(buf, filename_, outfile_base, from, to);
-   return RemoveExtension(filename_);
+   converters.convert(buf, temp, outfile_base, from, to);
+   return RemoveExtension(temp);
 }