[Libreoffice-commits] .: sc/source

Noel Power noelp at kemper.freedesktop.org
Mon Aug 15 12:08:21 PDT 2011


 sc/source/filter/excel/xiescher.cxx |   13 +++++++++++++
 sc/source/filter/inc/xiescher.hxx   |    1 +
 2 files changed, 14 insertions(+)

New commits:
commit 02d95370561c0b87e63ade341881c4e9dbe33e84
Author: Noel Power <noel.power at novell.com>
Date:   Mon Aug 15 20:09:32 2011 +0100

    fix for bnc#684784 - more conservative graphic replacemement

diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index 396c171..9123142 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -2856,6 +2856,19 @@ SdrObject* XclImpPictureObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const
     // try to create an OLE object or form control
     SdrObjectPtr xSdrObj( rDffConv.CreateSdrObject( *this, rAnchorRect ) );
 
+    // insert a graphic replacement for unsupported ole object ( if none already
+    // exists ) Hmm ok, it's possibly that there has been some imported
+    // graphic at a base level  but unlikely, normally controls have a valid
+    // preview in the IMGDATA record ( see below )
+    // It might be possible to push such an imported graphic up to this
+    // XclImpPictureObj instance but there are somany layers of indirection I
+    // don't see an easy way. This way at least ensures that we can
+    // avoid a 'blank' shape that can result from a failed control import
+    if ( !xSdrObj && IsOcxControl() && maGraphic.GetType() == GRAPHIC_NONE )
+    {
+        Graphic aReplacement( SdrOle2Obj::GetEmtyOLEReplacementBitmap() );
+        const_cast< XclImpPictureObj* >( this )->maGraphic = aReplacement;
+    }
     // no OLE - create a plain picture from IMGDATA record data
     if( !xSdrObj && (maGraphic.GetType() != GRAPHIC_NONE) )
     {
diff --git a/sc/source/filter/inc/xiescher.hxx b/sc/source/filter/inc/xiescher.hxx
index 7c05346..c187e64 100644
--- a/sc/source/filter/inc/xiescher.hxx
+++ b/sc/source/filter/inc/xiescher.hxx
@@ -871,6 +871,7 @@ public:
     virtual String              GetObjName() const;
     /** Returns the graphic imported from the IMGDATA record. */
     inline const Graphic& GetGraphic() const { return maGraphic; }
+
     /** Returns the visible area of the imported graphic. */
     inline const Rectangle& GetVisArea() const { return maVisArea; }
 


More information about the Libreoffice-commits mailing list