[Libreoffice-commits] .: 3 commits - oox/source svtools/inc svtools/source svx/inc svx/source

Kohei Yoshida kohei at kemper.freedesktop.org
Thu Sep 1 23:02:51 PDT 2011


 oox/source/xls/drawingfragment.cxx |   13 +++++++++++--
 svtools/inc/svtools/embedhlp.hxx   |   20 ++++++++------------
 svtools/source/misc/embedhlp.cxx   |    8 ++++----
 svx/inc/svx/svdoole2.hxx           |    8 ++++----
 svx/source/svdraw/svdoole2.cxx     |   10 +++++-----
 5 files changed, 32 insertions(+), 27 deletions(-)

New commits:
commit d178d7bef193565a7d6aacbc37a58dfc4bd7b316
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date:   Fri Sep 2 01:55:45 2011 -0400

    fdo#40466: Get charts to import from xlsx again.
    
    This regression was probably caused by a bad merge of OOo m106.

diff --git a/oox/source/xls/drawingfragment.cxx b/oox/source/xls/drawingfragment.cxx
index 2486775..7a95fe4 100644
--- a/oox/source/xls/drawingfragment.cxx
+++ b/oox/source/xls/drawingfragment.cxx
@@ -283,11 +283,20 @@ void DrawingFragment::onEndElement()
                         getLimitedValue< sal_Int32, sal_Int64 >( aShapeRectEmu.Y, 0, SAL_MAX_INT32 ),
                         getLimitedValue< sal_Int32, sal_Int64 >( aShapeRectEmu.Width, 0, SAL_MAX_INT32 ),
                         getLimitedValue< sal_Int32, sal_Int64 >( aShapeRectEmu.Height, 0, SAL_MAX_INT32 ) );
+
+                    // Make sure to set the position and size *before* calling addShape().
+                    mxShape->setPosition(::com::sun::star::awt::Point(aShapeRectEmu.X, aShapeRectEmu.Y));
+                    mxShape->setSize(::com::sun::star::awt::Size(aShapeRectEmu.Width, aShapeRectEmu.Height));
+
                     basegfx::B2DHomMatrix aTransformation;
                     mxShape->addShape( getOoxFilter(), &getTheme(), mxDrawPage, aTransformation, &aShapeRectEmu32 );
 
-                    // collect all shape positions in the WorksheetHelper base class
-                    extendShapeBoundingBox( aShapeRectEmu32 );
+                    /*  Collect all shape positions in the WorksheetHelper base
+                        class. But first, scale EMUs to 1/100 mm. */
+                    Rectangle aShapeRectHmm(
+                        convertEmuToHmm( aShapeRectEmu.X ), convertEmuToHmm( aShapeRectEmu.Y ),
+                        convertEmuToHmm( aShapeRectEmu.Width ), convertEmuToHmm( aShapeRectEmu.Height ) );
+                    extendShapeBoundingBox( aShapeRectHmm );
                 }
             }
             mxShape.reset();
commit 2c00fc5206b7fe7c4aba85a4d9a41a75ec432d4a
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date:   Thu Sep 1 00:19:40 2011 -0400

    No macros for the com::sun::star::foo.

diff --git a/svtools/inc/svtools/embedhlp.hxx b/svtools/inc/svtools/embedhlp.hxx
index bbd7c31..45ce3b9 100644
--- a/svtools/inc/svtools/embedhlp.hxx
+++ b/svtools/inc/svtools/embedhlp.hxx
@@ -38,10 +38,6 @@
 #include <tools/mapunit.hxx>
 #include <rtl/ustring.hxx>
 
-#define NS_UNO ::com::sun::star::uno
-#define NS_EMBED ::com::sun::star::embed
-#define NS_IO ::com::sun::star::io
-
 namespace comphelper
 {
     class EmbeddedObjectContainer;
@@ -56,7 +52,7 @@ namespace svt
     class SVT_DLLPUBLIC EmbeddedObjectRef
     {
         EmbeddedObjectRef_Impl*  mpImp;
-        NS_UNO::Reference < NS_EMBED::XEmbeddedObject > mxObj;
+        ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject > mxObj;
 
         SVT_DLLPRIVATE SvStream*   GetGraphicStream( sal_Bool bUpdate ) const;
         /* SVT_DLLPRIVATE */ void        GetReplacement( sal_Bool bUpdate );
@@ -65,20 +61,20 @@ namespace svt
         EmbeddedObjectRef& operator = ( const EmbeddedObjectRef& );
 
     public:
-        const NS_UNO::Reference < NS_EMBED::XEmbeddedObject >& operator ->() const { return mxObj; }
-        const NS_UNO::Reference < NS_EMBED::XEmbeddedObject >& GetObject() const { return mxObj; }
+        const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& operator ->() const { return mxObj; }
+        const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& GetObject() const { return mxObj; }
 
         static void DrawPaintReplacement( const Rectangle &rRect, const String &rText, OutputDevice *pOut );
         static void DrawShading( const Rectangle &rRect, OutputDevice *pOut );
-        static sal_Bool TryRunningState( const NS_UNO::Reference < NS_EMBED::XEmbeddedObject >& );
+        static sal_Bool TryRunningState( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& );
         static void SetGraphicToContainer( const Graphic& rGraphic,
                                             comphelper::EmbeddedObjectContainer& aContainer,
                                             const ::rtl::OUString& aName,
                                             const ::rtl::OUString& aMediaType );
 
-        static NS_UNO::Reference< NS_IO::XInputStream > GetGraphicReplacementStream(
+        static ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetGraphicReplacementStream(
                                             sal_Int64 nViewAspect,
-                                            const NS_UNO::Reference < NS_EMBED::XEmbeddedObject >&,
+                                            const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >&,
                                             ::rtl::OUString* pMediaType )
                                 throw();
 
@@ -86,10 +82,10 @@ namespace svt
         EmbeddedObjectRef();
 
         // assign a previously default constructed object
-        void Assign( const NS_UNO::Reference < NS_EMBED::XEmbeddedObject >& xObj, sal_Int64 nAspect );
+        void Assign( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& xObj, sal_Int64 nAspect );
 
         // create object for a certain view aspect
-        EmbeddedObjectRef( const NS_UNO::Reference < NS_EMBED::XEmbeddedObject >& xObj, sal_Int64 nAspect );
+        EmbeddedObjectRef( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& xObj, sal_Int64 nAspect );
 
         ~EmbeddedObjectRef();
         EmbeddedObjectRef( const EmbeddedObjectRef& );
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index 8bba1be..1fd2d15 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -261,7 +261,7 @@ EmbeddedObjectRef::EmbeddedObjectRef()
     Construct_Impl();
 }
 
-EmbeddedObjectRef::EmbeddedObjectRef( const NS_UNO::Reference < NS_EMBED::XEmbeddedObject >& xObj, sal_Int64 nAspect )
+EmbeddedObjectRef::EmbeddedObjectRef( const uno::Reference < embed::XEmbeddedObject >& xObj, sal_Int64 nAspect )
 {
     Construct_Impl();
     mpImp->nViewAspect = nAspect;
@@ -297,7 +297,7 @@ EmbeddedObjectRef::~EmbeddedObjectRef()
     delete mpImp;
 }
 
-void EmbeddedObjectRef::Assign( const NS_UNO::Reference < NS_EMBED::XEmbeddedObject >& xObj, sal_Int64 nAspect )
+void EmbeddedObjectRef::Assign( const uno::Reference < embed::XEmbeddedObject >& xObj, sal_Int64 nAspect )
 {
     DBG_ASSERT( !mxObj.is(), "Never assign an already assigned object!" );
 
@@ -309,7 +309,7 @@ void EmbeddedObjectRef::Assign( const NS_UNO::Reference < NS_EMBED::XEmbeddedObj
     //#i103460#
     if ( IsChart() )
     {
-        ::com::sun::star::uno::Reference < ::com::sun::star::chart2::XDefaultSizeTransmitter > xSizeTransmitter( xObj, uno::UNO_QUERY );
+        uno::Reference < chart2::XDefaultSizeTransmitter > xSizeTransmitter( xObj, uno::UNO_QUERY );
         DBG_ASSERT( xSizeTransmitter.is(), "Object does not support XDefaultSizeTransmitter -> will cause #i103460#!" );
         if( xSizeTransmitter.is() )
             xSizeTransmitter->setDefaultSize( mpImp->aDefaultSizeForChart_In_100TH_MM );
@@ -801,7 +801,7 @@ void EmbeddedObjectRef::SetDefaultSizeForChart( const Size& rSizeIn_100TH_MM )
 
     mpImp->aDefaultSizeForChart_In_100TH_MM = awt::Size( rSizeIn_100TH_MM.getWidth(), rSizeIn_100TH_MM.getHeight() );
 
-    ::com::sun::star::uno::Reference < ::com::sun::star::chart2::XDefaultSizeTransmitter > xSizeTransmitter( mxObj, uno::UNO_QUERY );
+    uno::Reference < chart2::XDefaultSizeTransmitter > xSizeTransmitter( mxObj, uno::UNO_QUERY );
     DBG_ASSERT( xSizeTransmitter.is(), "Object does not support XDefaultSizeTransmitter -> will cause #i103460#!" );
     if( xSizeTransmitter.is() )
         xSizeTransmitter->setDefaultSize( mpImp->aDefaultSizeForChart_In_100TH_MM );
commit f71bd7314a06975763a6d16a1a137e78771e9324
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date:   Thu Sep 1 00:09:12 2011 -0400

    sal_Bool to bool.

diff --git a/svx/inc/svx/svdoole2.hxx b/svx/inc/svx/svdoole2.hxx
index d43fd5d..7907831 100644
--- a/svx/inc/svx/svdoole2.hxx
+++ b/svx/inc/svx/svdoole2.hxx
@@ -69,10 +69,10 @@ protected:
     String                      aProgName;
 
     // wg. Kompatibilitaet erstmal am SdrTextObj
-    sal_Bool                        bFrame : 1;
-    sal_Bool                        bInDestruction : 1;
-    mutable bool                m_bTypeAsked;
-    mutable bool                m_bChart;
+    bool                        bFrame:1;
+    bool                        bInDestruction:1;
+    mutable bool                m_bTypeAsked:1;
+    mutable bool                m_bChart:1;
 
     SdrOle2ObjImpl*             mpImpl;
 
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index 0757c28..b6c5f47 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -749,7 +749,7 @@ SdrOle2Obj::SdrOle2Obj(bool bFrame_) : m_bTypeAsked(false)
 ,m_bChart(false)
 {
     DBG_CTOR( SdrOle2Obj,NULL);
-    bInDestruction = sal_False;
+    bInDestruction = false;
     Init();
     bFrame=bFrame_;
 }
@@ -761,7 +761,7 @@ SdrOle2Obj::SdrOle2Obj( const svt::EmbeddedObjectRef& rNewObjRef, bool bFrame_)
     , m_bChart(false)
 {
     DBG_CTOR( SdrOle2Obj,NULL);
-    bInDestruction = sal_False;
+    bInDestruction = false;
     Init();
 
     bFrame=bFrame_;
@@ -782,7 +782,7 @@ SdrOle2Obj::SdrOle2Obj( const svt::EmbeddedObjectRef& rNewObjRef, const XubStrin
     , m_bChart(false)
 {
     DBG_CTOR( SdrOle2Obj,NULL);
-    bInDestruction = sal_False;
+    bInDestruction = false;
     Init();
 
     mpImpl->aPersistName = rNewObjName;
@@ -805,7 +805,7 @@ SdrOle2Obj::SdrOle2Obj( const svt::EmbeddedObjectRef&  rNewObjRef, const XubStri
     , m_bChart(false)
 {
     DBG_CTOR( SdrOle2Obj,NULL);
-    bInDestruction = sal_False;
+    bInDestruction = false;
     Init();
 
     mpImpl->aPersistName = rNewObjName;
@@ -837,7 +837,7 @@ void SdrOle2Obj::Init()
 SdrOle2Obj::~SdrOle2Obj()
 {
     DBG_DTOR( SdrOle2Obj,NULL);
-    bInDestruction = sal_True;
+    bInDestruction = true;
 
     if ( mpImpl->mbConnected )
         Disconnect();


More information about the Libreoffice-commits mailing list