diff --git a/do-not-delete-PropertyMapEntry-instance.diff b/do-not-delete-PropertyMapEntry-instance.diff new file mode 100644 index 0000000..f36df54 --- /dev/null +++ b/do-not-delete-PropertyMapEntry-instance.diff @@ -0,0 +1,75 @@ +From 4153bcbc8e568e8e33c56bab68e9ea036c5dce5b Mon Sep 17 00:00:00 2001 +From: Kohei Yoshida +Date: Thu, 24 Jan 2013 22:24:44 -0500 +Subject: [PATCH] bnc#798271: Don't delete the PropertyMapEntry instance + prematurely. + +When using comphelper::PropertyMapEntry array to create a UNO property +set, we need to make sure we keep this instance while the property set +object is alive, else it would cause a very hard-to-debug problem down +the road... + +In this particular case, the aExportInfoMap array instance was destroyed +when it went out of scope, but the xInfoSet which references it was used +afterward. + +Change-Id: I02132b6b2e6bef7b461f0f77c2c4a3e911e42014 +--- + chart2/source/model/filter/XMLFilter.cxx | 40 +++++++++++++++----------------- + 1 file changed, 19 insertions(+), 21 deletions(-) + +diff --git a/chart2/source/model/filter/XMLFilter.cxx b/chart2/source/model/filter/XMLFilter.cxx +index 2a6e35b..551e9b2 100644 +--- a/chart2/source/model/filter/XMLFilter.cxx ++++ b/chart2/source/model/filter/XMLFilter.cxx +@@ -644,28 +644,26 @@ sal_Int32 XMLFilter::impl_Export( + xServiceFactory->createInstanceWithArguments( + C2U("com.sun.star.comp.Svx.GraphicExportHelper"), aGraphicResolverArgs ), uno::UNO_QUERY ); + +- uno::Reference< beans::XPropertySet > xInfoSet; ++ // property map for export info set ++ comphelper::PropertyMapEntry aExportInfoMap[] = + { +- // property map for export info set +- comphelper::PropertyMapEntry aExportInfoMap[] = +- { +- { MAP_LEN("UsePrettyPrinting"), 0, &::getBooleanCppuType(), beans::PropertyAttribute::MAYBEVOID, 0}, +- { MAP_LEN("BaseURI"), 0, &::getCppuType( (OUString *)0 ), beans::PropertyAttribute::MAYBEVOID, 0 }, +- { MAP_LEN("StreamRelPath"), 0, &::getCppuType( (OUString *)0 ), beans::PropertyAttribute::MAYBEVOID, 0 }, +- { MAP_LEN("StreamName"), 0, &::getCppuType( (OUString *)0 ), beans::PropertyAttribute::MAYBEVOID, 0 }, +- { MAP_LEN("ExportTableNumberList"), 0, &::getBooleanCppuType(), beans::PropertyAttribute::MAYBEVOID, 0 }, +- { NULL, 0, 0, NULL, 0, 0 } +- }; +- +- xInfoSet = comphelper::GenericPropertySet_CreateInstance( new comphelper::PropertySetInfo( aExportInfoMap ) ); +- +- SvtSaveOptions aSaveOpt; +- OUString sUsePrettyPrinting(RTL_CONSTASCII_USTRINGPARAM("UsePrettyPrinting")); +- sal_Bool bUsePrettyPrinting( aSaveOpt.IsPrettyPrinting() ); +- xInfoSet->setPropertyValue( sUsePrettyPrinting, uno::makeAny( bUsePrettyPrinting ) ); +- if( ! bOasis ) +- xInfoSet->setPropertyValue( C2U("ExportTableNumberList"), uno::makeAny( true )); +- } ++ { MAP_LEN("UsePrettyPrinting"), 0, &::getBooleanCppuType(), beans::PropertyAttribute::MAYBEVOID, 0}, ++ { MAP_LEN("BaseURI"), 0, &::getCppuType( (OUString *)0 ), beans::PropertyAttribute::MAYBEVOID, 0 }, ++ { MAP_LEN("StreamRelPath"), 0, &::getCppuType( (OUString *)0 ), beans::PropertyAttribute::MAYBEVOID, 0 }, ++ { MAP_LEN("StreamName"), 0, &::getCppuType( (OUString *)0 ), beans::PropertyAttribute::MAYBEVOID, 0 }, ++ { MAP_LEN("ExportTableNumberList"), 0, &::getBooleanCppuType(), beans::PropertyAttribute::MAYBEVOID, 0 }, ++ { NULL, 0, 0, NULL, 0, 0 } ++ }; ++ ++ uno::Reference< beans::XPropertySet > xInfoSet = ++ comphelper::GenericPropertySet_CreateInstance( new comphelper::PropertySetInfo( aExportInfoMap ) ); ++ ++ SvtSaveOptions aSaveOpt; ++ OUString sUsePrettyPrinting(RTL_CONSTASCII_USTRINGPARAM("UsePrettyPrinting")); ++ sal_Bool bUsePrettyPrinting( aSaveOpt.IsPrettyPrinting() ); ++ xInfoSet->setPropertyValue( sUsePrettyPrinting, uno::makeAny( bUsePrettyPrinting ) ); ++ if( ! bOasis ) ++ xInfoSet->setPropertyValue( C2U("ExportTableNumberList"), uno::makeAny( true )); + + sal_Int32 nArgs = 2; + if( xGraphicObjectResolver.is()) +-- +1.8.0.2 + diff --git a/libreoffice.changes b/libreoffice.changes index 495b5e3..51851e4 100644 --- a/libreoffice.changes +++ b/libreoffice.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Jan 25 10:17:26 UTC 2013 - pmladek@suse.com + +- do-not-delete-PropertyMapEntry-instance.diff: lost charts (bnc#798271) + ------------------------------------------------------------------- Fri Dec 14 16:08:15 UTC 2012 - pmladek@suse.com diff --git a/libreoffice.spec b/libreoffice.spec index 9247e6a..ff8ef92 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -635,6 +635,8 @@ Patch17: pack-addressbook.diff # add pyuno to python path # FIXME: related to system-python-ure-bootstrap.diff Patch18: pyuno-path.diff +# lost charts (bcn#798271) +Patch19: do-not-delete-PropertyMapEntry-instance.diff # # default to MS Office 97/2000/XP file formats on MeeGo; asked by HP Patch900: officecfg-defaul-export-ms-file-formats.diff @@ -1348,6 +1350,7 @@ the LibreOffice localizations separately. %patch16 -p1 %patch17 %patch18 +%patch19 -p1 # %if 0%{?meego_version} # default to MS Office 97/2000/XP file formats on MeeGo; asked by HP