[Libreoffice-commits] core.git: sc/source

Stephan Bergmann sbergman at redhat.com
Fri Nov 15 02:27:23 PST 2013


 sc/source/ui/view/printfun.cxx |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 2e63bf23c29abd7a3b32902ee3acb889d8c04f35
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Nov 15 11:26:57 2013 +0100

    Referer check for Calc background image
    
    Change-Id: I69f69e4fa790969ac4e338dd6294ff9ef951d5b6

diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 6ab7d1e..87c508b 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -1085,10 +1085,11 @@ static void lcl_DrawGraphic( const Graphic &rGraphic, OutputDevice *pOut,
 }
 
 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);
-    const Graphic *pGraphic = rBrush.GetGraphic();
+    const Graphic *pGraphic = rBrush.GetGraphic(referer);
     SvxGraphicPosition ePos;
     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
             else
                 pRefDev = pDoc->GetPrinter();   // use printer also for preview
-
-            lcl_DrawGraphic( *pBackground, pDev, pRefDev, aFrameRect, aFrameRect );
+            OUString referer;
+            if (pDocShell->HasName()) {
+                referer = pDocShell->GetMedium()->GetName();
+            }
+            lcl_DrawGraphic( *pBackground, pDev, pRefDev, aFrameRect, aFrameRect, referer );
         }
         else
         {


More information about the Libreoffice-commits mailing list