diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-01-23 16:08:29 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-01-23 16:13:48 +0100 |
commit | e753d31d5d2338da35b69b0a3b7742420c7562d2 (patch) | |
tree | 9a73933109f8f5a435bf15cec18048a0d0f20393 /sc/source/ui/unoobj/fielduno.cxx | |
parent | 05e7b1db351ee964d155e49c55de7db3c917083f (diff) |
Hold ScHeaderFooterContentObj by rtl::Reference
...there appears to be no good reason not to (it's a UNO implementation,
deriving from WeakImplHelper), and witnessed at least one JunitTest_sc_unoapi
failure where an incoming URP call on ScHeaderFooterTextObj::getString obtained
an apparently dangling
ScHeaderFooterContentObj& rContentObj = aTextData.GetContentObj()
that pointed to garbage.
Change-Id: I51a2a03ded18509ee61488d96bd30a6d364825d7
Diffstat (limited to 'sc/source/ui/unoobj/fielduno.cxx')
-rw-r--r-- | sc/source/ui/unoobj/fielduno.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx index c5c0f7eee266..8f18c92769a5 100644 --- a/sc/source/ui/unoobj/fielduno.cxx +++ b/sc/source/ui/unoobj/fielduno.cxx @@ -505,15 +505,15 @@ uno::Reference<text::XTextField> ScHeaderFieldsObj::GetObjectByIndex_Impl(sal_In // Get the parent text range instance. uno::Reference<text::XTextRange> xTextRange; - ScHeaderFooterContentObj& rContentObj = mrData.GetContentObj(); + rtl::Reference<ScHeaderFooterContentObj> rContentObj = mrData.GetContentObj(); uno::Reference<text::XText> xText; sal_uInt16 nPart = mrData.GetPart(); if (nPart == SC_HDFT_LEFT) - xText = rContentObj.getLeftText(); + xText = rContentObj->getLeftText(); else if (nPart == SC_HDFT_CENTER) - xText = rContentObj.getCenterText(); + xText = rContentObj->getCenterText(); else - xText = rContentObj.getRightText(); + xText = rContentObj->getRightText(); uno::Reference<text::XTextRange> xTemp(xText, uno::UNO_QUERY); xTextRange = xTemp; |