[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Review Request: VectorShape fix
From:       Inge Wallin <inge () lysator ! liu ! se>
Date:       2010-05-27 11:24:55
Message-ID: 201005271324.55751.inge () lysator ! liu ! se
[Download RAW message or body]

On Thursday 27 May 2010 11:21:19 Matus Hanzes wrote:
> > On 2010-05-27 08:54:19, Thorsten Zachmann wrote:
> > > Wouldn't it be better to fix the mismatch of save and restore as doing
> > > it wrongly has certainly problems as sometimes the state is not what
> > > you expect if a restore has not happened.
> 
> Problem is that it depeds directly on what is inside wmf file, and it is
> possible that some wmf files are not corrert.

The review request is closed, so I'll write directly to the ML instead.

As Matus writes, the problem is tied to the contents of the WMF file.  In WMF 
there is an instruction saying "save the graphics context" and another one 
saying "restore the graphics context".  We implement that by using 
QPainter::save() and restore() respectively.

However, not all files are well-formed and match the number of save's with the 
same number of restore's.  So that's why we have to make sure to restore() all 
the save()'s that weren't handled in the file.

It strikes me now that we should probably also check before each restore() 
initiated by the file that the number of save()'s isn't used up already. I 
have never seen a file with more restores than saves, but that doesn't mean 
they cannot exist.  

	-Inge

> 
> - Matus
> 
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/4164/#review5886
> -----------------------------------------------------------
> 
> On 2010-05-27 06:59:08, Matus Hanzes wrote:
> > -----------------------------------------------------------
> > This is an automatically generated e-mail. To reply, visit:
> > http://reviewboard.kde.org/r/4164/
> > -----------------------------------------------------------
> > 
> > (Updated 2010-05-27 06:59:08)
> > 
> > 
> > Review request for KOffice.
> > 
> > 
> > Summary
> > -------
> > 
> > Sometimes VectorShape calls QPainter::save() function more times than
> > QPainter::restore(). It can cause problems when another shape is using
> > the same QPainter. For example in KoShapeManager::paint().
> > 
> > 
> > Diffs
> > -----
> > 
> >   trunk/koffice/filters/libkowmf/kowmfpaint.h 1131052
> >   trunk/koffice/filters/libkowmf/kowmfpaint.cc 1131052
> > 
> > Diff: http://reviewboard.kde.org/r/4164/diff
> > 
> > 
> > Testing
> > -------
> > 
> > 
> > Thanks,
> > 
> > Matus
> 
> _______________________________________________
> koffice-devel mailing list
> koffice-devel@kde.org
> https://mail.kde.org/mailman/listinfo/koffice-devel
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic