[Libreoffice-commits] .: sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Oct 31 04:05:55 PDT 2012


 sw/source/filter/ww8/wrtw8esh.cxx |   12 +++++++++---
 sw/source/filter/ww8/ww8par.hxx   |    2 ++
 2 files changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 2ed931303b10386153a1337fa15b225aabd40cb4
Author: Noel Power <noel.power at suse.com>
Date:   Wed Oct 31 11:02:28 2012 +0000

    fix the strange ww8export tinderbox failure
    
    Change-Id: Ie1804a3790aee23a8fdf86e27085de81f5e50c11

diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index ae461a3..b4ab86a 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -2775,10 +2775,15 @@ sal_uInt32 SwEscherEx::QueryTextID(
 }
 
 SwMSConvertControls::SwMSConvertControls( SfxObjectShell *pDSh,SwPaM *pP ) : oox
-::ole::MSConvertOCXControls(  pDSh ? pDSh->GetModel() : NULL ), pPaM( pP )
+::ole::MSConvertOCXControls(  pDSh ? pDSh->GetModel() : NULL ), pPaM( pP ), mnObjectId(0)
 {
 }
 
+sal_uInt32 SwMSConvertControls::GenerateObjectID()
+{
+    return ++mnObjectId;
+}
+
 // in transitioning away old filter for ole/ocx controls, ReadOCXStream has been made pure virtual in
 // filter/source/msocximex.cxx, so.. we need an implementation here
 sal_Bool  SwMSConvertControls::ReadOCXStream( SotStorageRef& rSrc1,
@@ -2821,7 +2826,8 @@ bool SwMSConvertControls::ExportControl(WW8Export &rWW8Wrt, const SdrObject *pOb
 
     //Create a destination storage for the microsoft control
     rtl::OUStringBuffer sStorageName;
-    sStorageName.append('_').append(reinterpret_cast<sal_Int64>(pObj));
+    sal_uInt32 nObjId = GenerateObjectID();
+    sStorageName.append('_').append( static_cast<sal_Int64>( nObjId ));
     SvStorageRef xOleStg = xObjPool->OpenSotStorage(sStorageName.makeStringAndClear(),
                  STREAM_READWRITE|STREAM_SHARE_DENYALL);
 
@@ -2844,7 +2850,7 @@ bool SwMSConvertControls::ExportControl(WW8Export &rWW8Wrt, const SdrObject *pOb
     };
     //Set the obj id into the sprmCPicLocation
     sal_uInt8 *pData = aSpecOLE+2;
-    Set_UInt32(pData,(sal_uInt32)(sal_uIntPtr)pObj);
+    Set_UInt32(pData,nObjId );
 
     String sFld(FieldString(ww::eCONTROL));
     sFld.APPEND_CONST_ASC("Forms.");
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 9215369..44f6511 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -656,7 +656,9 @@ public:
         com::sun::star::drawing::XShape > *pShapeRef=0,
         sal_Bool bFloatingCtrl=false );
 private:
+    sal_uInt32 GenerateObjectID();
     SwPaM *pPaM;
+    sal_uInt32 mnObjectId;
 };
 
 class SwMSDffManager : public SvxMSDffManager


More information about the Libreoffice-commits mailing list