diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-06-19 17:51:36 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-06-19 17:51:36 +0200 |
commit | d8e7624c9a874aee3ab782715117b118ddd0c496 (patch) | |
tree | 799de5f15af6a237e5fb148e9fb2f4525edc8f6c /xmloff | |
parent | SwDoc::SetFlyFrmAttr: sync position between draw shape and its textbox (diff) | |
download | core-d8e7624c9a874aee3ab782715117b118ddd0c496.tar.gz core-d8e7624c9a874aee3ab782715117b118ddd0c496.zip |
Do not dereference null pointer
...and XMLTextCharStyleNamesElementExport only requires a non-null rPropSet arg
when its bDoSomething arg is true.
Reported by CppunitTest_sw_odfexport under -sanitize=undefined.
Change-Id: Ia45fa7db250f83d746829c7f411e78bbc50bf721
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/text/txtparae.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 7c91085ffd96..108fe8ea53f1 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -2843,11 +2843,12 @@ void XMLTextParagraphExport::exportAnyTextFrame( else bIsUICharStyle = false; + bool bDoSomething = bIsUICharStyle + && aCharStyleNamesPropInfoCache.hasProperty( *pRangePropSet ); XMLTextCharStyleNamesElementExport aCharStylesExport( - GetExport(), bIsUICharStyle && - aCharStyleNamesPropInfoCache.hasProperty( - *pRangePropSet ), bHasAutoStyle, - *pRangePropSet, sCharStyleNames ); + GetExport(), bDoSomething, bHasAutoStyle, + bDoSomething ? *pRangePropSet : Reference<XPropertySet>(), + sCharStyleNames ); if( !sStyle.isEmpty() ) GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME, |