summaryrefslogtreecommitdiff
path: root/sw/source/uibase/docvw/romenu.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-08-20 12:03:21 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-08-20 14:06:33 +0100
commitdf4bd415c0ceb8e69f8bbeeca554a1c55eb978b7 (patch)
tree161a658a1d810bda5e539a0edcc7016d8bc1a606 /sw/source/uibase/docvw/romenu.cxx
parenta93ef22ada8762dbcaf90751b69244f93afaad03 (diff)
fix crashing on exit in static SvxBrushItem dtor
site of first ctor Change-Id: I3316e91bc54439b74df30fdf02ff264a39489c29
Diffstat (limited to 'sw/source/uibase/docvw/romenu.cxx')
-rw-r--r--sw/source/uibase/docvw/romenu.cxx21
1 files changed, 11 insertions, 10 deletions
diff --git a/sw/source/uibase/docvw/romenu.cxx b/sw/source/uibase/docvw/romenu.cxx
index 37e6c32ea4d2..33f1e175a43c 100644
--- a/sw/source/uibase/docvw/romenu.cxx
+++ b/sw/source/uibase/docvw/romenu.cxx
@@ -83,6 +83,7 @@ void SwReadOnlyPopup::Check( sal_uInt16 nMID, sal_uInt16 nSID, SfxDispatcher &rD
SwReadOnlyPopup::SwReadOnlyPopup( const Point &rDPos, SwView &rV ) :
PopupMenu( SW_RES(MN_READONLY_POPUP) ),
rView ( rV ),
+ aBrushItem(RES_BACKGROUND),
rDocPos( rDPos ),
pImageMap( 0 ),
pTargetURL( 0 )
@@ -149,14 +150,14 @@ SwReadOnlyPopup::SwReadOnlyPopup( const Point &rDPos, SwView &rV ) :
SfxViewFrame * pVFrame = rV.GetViewFrame();
SfxDispatcher &rDis = *pVFrame->GetDispatcher();
const SwPageDesc &rDesc = rSh.GetPageDesc( rSh.GetCurPageDesc() );
- pItem = &rDesc.GetMaster().GetBackground();
+ aBrushItem = rDesc.GetMaster().makeBackgroundBrushItem();
bool bEnableBackGallery = false,
bEnableBack = false;
- if ( GPOS_NONE != pItem->GetGraphicPos() )
+ if ( GPOS_NONE != aBrushItem.GetGraphicPos() )
{
bEnableBack = true;
- if ( !pItem->GetGraphicLink().isEmpty() )
+ if ( !aBrushItem.GetGraphicLink().isEmpty() )
{
if ( aThemeList.empty() )
GalleryExplorer::FillThemeList( aThemeList );
@@ -248,7 +249,7 @@ void SwReadOnlyPopup::Execute( Window* pWin, sal_uInt16 nId )
{
nId -= MN_READONLY_BACKGROUNDTOGALLERY+3;
nSaveId = MN_READONLY_SAVEBACKGROUND;
- sTmp = pItem->GetGraphicLink();
+ sTmp = aBrushItem.GetGraphicLink();
}
else
{
@@ -349,15 +350,15 @@ OUString SwReadOnlyPopup::SaveGraphic( sal_uInt16 nId )
// fish out the graphic's name
if ( MN_READONLY_SAVEBACKGROUND == nId )
{
- if ( !pItem->GetGraphicLink().isEmpty() )
- sGrfName = pItem->GetGraphicLink();
- ((SvxBrushItem*)pItem)->SetDoneLink( Link() );
- const Graphic *pGrf = pItem->GetGraphic();
+ if ( !aBrushItem.GetGraphicLink().isEmpty() )
+ sGrfName = aBrushItem.GetGraphicLink();
+ aBrushItem.SetDoneLink( Link() );
+ const Graphic *pGrf = aBrushItem.GetGraphic();
if ( pGrf )
{
aGraphic = *pGrf;
- if ( !pItem->GetGraphicLink().isEmpty() )
- sGrfName = pItem->GetGraphicLink();
+ if ( !aBrushItem.GetGraphicLink().isEmpty() )
+ sGrfName = aBrushItem.GetGraphicLink();
}
else
return OUString();