Code clean-up/consolidation task.

Removing the duplicate code,and consolidating changes
by using  method "getExpandedFilePath" of comphelper.

Signed-off-by: Stephan Bergmann <sbergman@redhat.com>: adapted to recent change
from comphelper::getExpandedFilePath to comphelper::getExpandedUri; fixed the
two changes in framework to actually modify the by--non-const--ref argument;
fixed a loplugin:unreffun.  More clean-up to follow.

Change-Id: Ie8875bcb61b616385bd64151f0a915bf7cce04e5
Further clean-up

Change-Id: I20049b482c831e4ac2221fddfe80deb9847e72c3