Apache OpenOffice (AOO) Bugzilla – Issue 122241
A set MapMode does not survive a Push/Pop call pair when mapping is temporarily disabled
Last modified: 2022-10-28 12:54:15 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.
ALG: Grepping. Solution is to remember MapMode independent from mbMap state in Push() and to also rmrmber mbMap itself.
"alg" committed SVN revision 1479828 into trunk: i122241 Made Push/Pop with PUSH_MAPMODE safe for mbMap flag and MapMode prese...
ALG: Done, comitted.