[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - 3 commits - canvas/source oox/source vcl/inc vcl/source

Thorsten Behrens tbehrens at suse.com
Tue May 14 16:37:05 PDT 2013


 canvas/source/cairo/cairo_canvasbitmap.cxx   |    2 +-
 oox/source/ppt/extdrawingfragmenthandler.cxx |    7 +++++--
 vcl/inc/vcl/gdimtf.hxx                       |    2 +-
 vcl/source/gdi/gdimtf.cxx                    |   15 ++++++++++-----
 vcl/source/gdi/pdfwriter_impl2.cxx           |    2 +-
 5 files changed, 18 insertions(+), 10 deletions(-)

New commits:
commit e00faa6f01ea4437c25c64cb5b7fa7fbfdfdb9f2
Author: Thorsten Behrens <tbehrens at suse.com>
Date:   Wed May 15 01:28:50 2013 +0200

    Fix fdo#64579 Don't assume dsp:dataModelExt has valid DrawingML.
    
    Just don't assume the DSP_TOKEN( spTree ) was seen in input.
    
    Change-Id: Iaabdcafdfcfc995198c1265e975df4dde8e0a39c
    (cherry picked from commit 0f15a477aaba2f69a13c0bc61c5c8c7a47314680)

diff --git a/oox/source/ppt/extdrawingfragmenthandler.cxx b/oox/source/ppt/extdrawingfragmenthandler.cxx
index f065415..dc62bd6 100644
--- a/oox/source/ppt/extdrawingfragmenthandler.cxx
+++ b/oox/source/ppt/extdrawingfragmenthandler.cxx
@@ -86,8 +86,11 @@ ExtDrawingFragmentHandler::createFastChildContext( ::sal_Int32 aElement,
 }
 void SAL_CALL ExtDrawingFragmentHandler::endDocument() throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
 {
-    mpShapePtr->moveAllToPosition( mpOrgShapePtr->getPosition() );
-    mpShapePtr->setName( mpOrgShapePtr->getName() );
+    if( mpShapePtr )
+    {
+        mpShapePtr->moveAllToPosition( mpOrgShapePtr->getPosition() );
+        mpShapePtr->setName( mpOrgShapePtr->getName() );
+    }
 }
 
 } }
commit 44d92cfa4143475dba8414a94150bc669aeb9909
Author: Thorsten Behrens <tbehrens at suse.com>
Date:   Sat May 11 23:09:37 2013 +0200

    Fix indent.
    
    Change-Id: Ia02968ccc12df994bc8528794e8f55a5eeda25be

diff --git a/canvas/source/cairo/cairo_canvasbitmap.cxx b/canvas/source/cairo/cairo_canvasbitmap.cxx
index c0759c0..6839548 100644
--- a/canvas/source/cairo/cairo_canvasbitmap.cxx
+++ b/canvas/source/cairo/cairo_canvasbitmap.cxx
@@ -134,7 +134,7 @@ namespace cairocanvas
         return maCanvasHelper.repaint( pSurface, viewState, renderState );
     }
 
-        void SAL_CALL CanvasBitmap::setFastPropertyValue( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rAny )  throw (uno::RuntimeException)
+    void SAL_CALL CanvasBitmap::setFastPropertyValue( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rAny )  throw (uno::RuntimeException)
     {
         sal_Int64 nPointer;
 
commit 4c676625d4016d428e9becd5512b7cfc8b0c4b24
Author: Radek Doulik <rodo at novell.com>
Date:   Mon Apr 29 00:00:00 2013 +0200

    Fix bnc#795857 Use correct sizes for EMF+ bitmap rendering
    
    Fix pdf export wrong size issues for embedded EMF+ images.
    
    Change-Id: I998c9535bde32fc9f452d61d7cb7609c95f5528d

diff --git a/vcl/inc/vcl/gdimtf.hxx b/vcl/inc/vcl/gdimtf.hxx
index ecefb90..90fce69 100644
--- a/vcl/inc/vcl/gdimtf.hxx
+++ b/vcl/inc/vcl/gdimtf.hxx
@@ -124,7 +124,7 @@ private:
                                                       const OutputDevice&   rMapDev,
                                                       const PolyPolygon&    rPolyPoly,
                                                       const Gradient&       rGrad       );
-    SAL_DLLPRIVATE bool          ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, Size rDestSize );
+    SAL_DLLPRIVATE bool          ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, Size rLogicDestSize );
     SAL_DLLPRIVATE void          ImplDelegate2PluggableRenderer( const MetaCommentAction* pAct, OutputDevice* pOut );
 
 
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 3fbb01c..526196d 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -399,7 +399,7 @@ void GDIMetaFile::Play( OutputDevice* pOut, size_t nPos )
 
         OSL_TRACE("GDIMetaFile::Play on device of size: %d x %d", pOut->GetOutputSizePixel().Width(), pOut->GetOutputSizePixel().Height());
 
-        if( !ImplPlayWithRenderer( pOut, Point(0,0), pOut->GetOutputSizePixel() ) ) {
+        if( !ImplPlayWithRenderer( pOut, Point(0,0), pOut->GetOutputSize() ) ) {
             size_t  i  = 0;
             for( size_t nCurPos = nCurrentActionElement; nCurPos < nPos; nCurPos++ )
             {
@@ -430,11 +430,13 @@ void GDIMetaFile::Play( OutputDevice* pOut, size_t nPos )
 
 // ------------------------------------------------------------------------
 
-bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, Size rDestSize )
+bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, Size rLogicDestSize )
 {
     if (!bUseCanvas)
         return false;
 
+    Size rDestSize( pOut->LogicToPixel( rLogicDestSize ) );
+
     const Window* win = dynamic_cast <Window*> ( pOut );
 
     if (!win)
@@ -485,7 +487,7 @@ bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, S
                         uno::Any aAny = xFastPropertySet->getFastPropertyValue( 0 );
                         BitmapEx* pBitmapEx = (BitmapEx*) *reinterpret_cast<const sal_Int64*>(aAny.getValue());
                         if( pBitmapEx ) {
-                            pOut->DrawBitmapEx( rPos, *pBitmapEx );
+                            pOut->DrawBitmapEx( rPos, rLogicDestSize, *pBitmapEx );
                             delete pBitmapEx;
                             return true;
                         }
@@ -497,7 +499,10 @@ bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, S
                     if( pSalBmp->Create( xBitmapCanvas, aSize ) )
                     {
                         Bitmap aBitmap( pSalBmp );
-                        pOut->DrawBitmap( rPos, aBitmap );
+                        if ( pOut->GetMapMode() == MAP_PIXEL )
+                            pOut->DrawBitmap( rPos, aBitmap );
+                        else
+                            pOut->DrawBitmap( rPos, rLogicDestSize, aBitmap );
                         return true;
                     }
 
@@ -602,7 +607,7 @@ void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos,
     {
         GDIMetaFile*    pMtf = pOut->GetConnectMetaFile();
 
-        if( ImplPlayWithRenderer( pOut, rPos, aDestSize ) )
+        if( ImplPlayWithRenderer( pOut, rPos, rSize ) )
             return;
 
         Size aTmpPrefSize( pOut->LogicToPixel( GetPrefSize(), aDrawMap ) );
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index beee461..8579168 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -769,7 +769,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa
                     const MetaBmpAction* pA = (const MetaBmpAction*) pAction;
                     BitmapEx aBitmapEx( pA->GetBitmap() );
                     Size aSize( OutputDevice::LogicToLogic( aBitmapEx.GetPrefSize(),
-                            aBitmapEx.GetPrefMapMode(), pDummyVDev->GetMapMode() ) );
+                                                            aBitmapEx.GetPrefMapMode(), pDummyVDev->GetMapMode() ) );
                     if( ! ( aSize.Width() && aSize.Height() ) )
                         aSize = pDummyVDev->PixelToLogic( aBitmapEx.GetSizePixel() );
                     implWriteBitmapEx( pA->GetPoint(), aSize, aBitmapEx, pDummyVDev, i_rContext );


More information about the Libreoffice-commits mailing list