docview: replace some code with convenience function to make it more readable
docview: replace some code with convenience function to make it more readable

wkitty42/fpGUI,wkitty42/fpGUI,wkitty42/fpGUI,wkitty42/fpGUI,wkitty42/fpGUI,wkitty42/fpGUI