Issue 122241

Summary: A set MapMode does not survive a Push/Pop call pair when mapping is temporarily disabled
Product: General Reporter: Armin Le Grand <Armin.Le.Grand>
Component: codeAssignee: Armin Le Grand <Armin.Le.Grand>
Status: CLOSED FIXED QA Contact:
Severity: Normal    
Priority: P3 CC: issues
Version: 4.0.0-dev   
Target Milestone: 4.0.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

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.EnableMapMode(false);
...
dev.Push(  PUSH_MAPMODE or nothing );
...
dev.Pop();
...
dev.EnableMapMode(bWasOn);

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.