summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-10-30 16:05:42 +0100
committerAndras Timar <andras.timar@collabora.com>2015-11-03 18:10:31 +0100
commit97ea231bcdf796a1ab2a1a505e2c483f60fcc8f1 (patch)
treef3d760156570ff5a7bc153be57c42c0219a300f1
parent61fb299b76e2140b50e35150834357ba71b69159 (diff)
svx: add result of "badstatics" plugin to fix abuse of VCL Bitmaps
VCL Image/Bitmap/BitmapEx instances must not have static life-time because then they will be destructed after DeInitVCL() and that likely segfaults. (cherry picked from commit bf18f1b3535dd17f9bf584cab15ee6a7fd431257) Omitting the plugin itself, the fixes should be enough for release branch. Change-Id: I3ff8d32de729c971b190028094cb4efe206395e2 Reviewed-on: https://gerrit.libreoffice.org/19742 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit a93c08e8eeb8386d02a015c63d161220d059a6bf)
-rw-r--r--svx/source/form/filtnav.cxx30
-rw-r--r--vcl/workben/vcldemo.cxx2
2 files changed, 7 insertions, 25 deletions
diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index c258692dbf7d..78a44cdf083c 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -156,14 +156,8 @@ TYPEINIT1(FmFormItem, FmParentData);
Image FmFormItem::GetImage() const
{
- static Image aImage;
-
- if (!aImage)
- {
- ImageList aNavigatorImages( SVX_RES( RID_SVXIMGLIST_FMEXPL ) );
- aImage = aNavigatorImages.GetImage( RID_SVXIMG_FORM );
- }
- return aImage;
+ ImageList aNavigatorImages( SVX_RES( RID_SVXIMGLIST_FMEXPL ) );
+ return aNavigatorImages.GetImage( RID_SVXIMG_FORM );
}
@@ -187,14 +181,8 @@ FmFilterItem* FmFilterItems::Find( const ::sal_Int32 _nFilterComponentIndex ) co
Image FmFilterItems::GetImage() const
{
- static Image aImage;
-
- if (!aImage)
- {
- ImageList aNavigatorImages( SVX_RES( RID_SVXIMGLIST_FMEXPL ) );
- aImage = aNavigatorImages.GetImage( RID_SVXIMG_FILTER );
- }
- return aImage;
+ ImageList aNavigatorImages( SVX_RES( RID_SVXIMGLIST_FMEXPL ) );
+ return aNavigatorImages.GetImage( RID_SVXIMG_FILTER );
}
@@ -213,14 +201,8 @@ FmFilterItem::FmFilterItem( FmFilterItems* pParent,
Image FmFilterItem::GetImage() const
{
- static Image aImage;
-
- if (!aImage)
- {
- ImageList aNavigatorImages( SVX_RES( RID_SVXIMGLIST_FMEXPL ) );
- aImage = aNavigatorImages.GetImage( RID_SVXIMG_FIELD );
- }
- return aImage;
+ ImageList aNavigatorImages( SVX_RES( RID_SVXIMGLIST_FMEXPL ) );
+ return aNavigatorImages.GetImage( RID_SVXIMG_FIELD );
}
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index 2db38bdf3605..fd8c01f8ab57 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -649,7 +649,7 @@ public:
// be done with a shader / gradient
static void SimulateBorderStretch(OutputDevice &rDev, const Rectangle& r)
{
- static BitmapEx aPageShadowMask("sw/res/page-shadow-mask.png");
+ BitmapEx aPageShadowMask("sw/res/page-shadow-mask.png");
BitmapEx aRight(aPageShadowMask);
sal_Int32 nSlice = (aPageShadowMask.GetSizePixel().Width() - 3) / 4;