Referer check for Calc background image

Change-Id: I69f69e4fa790969ac4e338dd6294ff9ef951d5b6
This commit is contained in:
Stephan Bergmann
2013-11-15 11:26:57 +01:00
parent 986644335c
commit 2e63bf23c2

View File

@@ -1085,10 +1085,11 @@ static void lcl_DrawGraphic( const Graphic &rGraphic, OutputDevice *pOut,
} }
static void lcl_DrawGraphic( const SvxBrushItem &rBrush, OutputDevice *pOut, OutputDevice* pRefDev, static void lcl_DrawGraphic( const SvxBrushItem &rBrush, OutputDevice *pOut, OutputDevice* pRefDev,
const Rectangle &rOrg, const Rectangle &rOut ) const Rectangle &rOrg, const Rectangle &rOut,
OUString const & referer )
{ {
Size aGrfSize(0,0); Size aGrfSize(0,0);
const Graphic *pGraphic = rBrush.GetGraphic(); const Graphic *pGraphic = rBrush.GetGraphic(referer);
SvxGraphicPosition ePos; SvxGraphicPosition ePos;
if ( pGraphic && pGraphic->IsSupportedGraphic() ) if ( pGraphic && pGraphic->IsSupportedGraphic() )
{ {
@@ -1260,8 +1261,11 @@ void ScPrintFunc::DrawBorder( long nScrX, long nScrY, long nScrW, long nScrH,
pRefDev = pDev; // don't use printer for PDF pRefDev = pDev; // don't use printer for PDF
else else
pRefDev = pDoc->GetPrinter(); // use printer also for preview pRefDev = pDoc->GetPrinter(); // use printer also for preview
OUString referer;
lcl_DrawGraphic( *pBackground, pDev, pRefDev, aFrameRect, aFrameRect ); if (pDocShell->HasName()) {
referer = pDocShell->GetMedium()->GetName();
}
lcl_DrawGraphic( *pBackground, pDev, pRefDev, aFrameRect, aFrameRect, referer );
} }
else else
{ {