bnc#382137 DocxAttributeOutput: don't store address of local variable
commitc0129c7199b1662caf010fa556b2973196ce7b07
authorMiklos Vajna <vmiklos@suse.cz>
Thu, 6 Jun 2013 14:35:52 +0000 (6 16:35 +0200)
committerMiklos Vajna <vmiklos@suse.cz>
Thu, 6 Jun 2013 14:55:32 +0000 (6 16:55 +0200)
tree5385ff3a9648c54874c3ac5b30eefb8e9fe9d147
parent9bf6c83367cedb7be81bf67f30d2147d26c7a8c3
bnc#382137 DocxAttributeOutput: don't store address of local variable

AttributeOutputBase::TextField() passes the address of its local
variable to WriteExpand(), and DocxAttributeOutput::WriteField_Impl()
stored this. When it was to be used, the variable already went out of
scope, resulting in a crash. Given that SwField is an abstract base
class, the easiest way is to just copy the field and manually delete it
when it's no longer needed.

Change-Id: I9d1fe2485277f1ac21a576d7ff0d05003f0ac8a1
(cherry picked from commit 92f328fb5eef672d379ed0b712b025eb80622d5a)
sw/source/filter/ww8/docxattributeoutput.cxx