Issue 122241 - A set MapMode does not survive a Push/Pop call pair when mapping is temporarily disabled
Summary: A set MapMode does not survive a Push/Pop call pair when mapping is temporari...
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: 4.0.0-dev
Hardware: All All
: P3 Normal (vote)
Target Milestone: 4.0.0
Assignee: Armin Le Grand
QA Contact:
Depends on:
Reported: 2013-05-06 15:39 UTC by Armin Le Grand
Modified: 2013-07-12 16:38 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Note You need to log in before you can comment on or make changes to this issue.
Description Armin Le Grand 2013-05-06 15:39:19 UTC
ALG: Push/Pop at OutputDevice is used to secure e.g. MapMode over content handling. When using PUSH_MAPMODE as flag, the MapMode is to be pushed and Poped. When during this Push/Pop mapping is temporarily disabled using EnableMapMode(false), the MapMode will not survive this Push/Pop pair. Exmaple code:

const bool bWasOn(dev.IsMapModeEnabled());
dev.Push(  PUSH_MAPMODE or nothing );

MapMode will be default (MAP_PIXEL) and empty, mbMap will be false after Pop, true after last line above, but useless.
This is an even more dangerous trap when Push/Pop is inside a called sub-routine and it is not obvious why after temporarily disabling the mapping the MapMode is lost.
Comment 1 Armin Le Grand 2013-05-06 15:40:24 UTC
ALG: Grepping. Solution is to remember MapMode independent from mbMap state in Push() and to also rmrmber mbMap itself.
Comment 2 SVN Robot 2013-05-07 09:34:51 UTC
"alg" committed SVN revision 1479828 into trunk:
i122241 Made Push/Pop with PUSH_MAPMODE safe for mbMap flag and MapMode prese...
Comment 3 Armin Le Grand 2013-05-07 15:06:39 UTC
ALG: Done, comitted.