We just want to know if this ole object is already exported or not
So it's merely the knowledge of having exported this object already that we need to know in order to elide re-exporting it. This code is still 64bit unsafe, as the nPictureId has to be a unique 32bit value for each object, so using the pointer as the key is horribly dubious, but this should be the same as the original code.
This commit is contained in:
@@ -2849,9 +2849,6 @@ void MSWordExportBase::ExportDocument( bool bWriteAll )
|
|||||||
pOLEExp = new SvxMSExportOLEObjects( nSvxMSDffOLEConvFlags );
|
pOLEExp = new SvxMSExportOLEObjects( nSvxMSDffOLEConvFlags );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !pOleMap)
|
|
||||||
pOleMap = new WW8OleMaps;
|
|
||||||
|
|
||||||
if ( !pOCXExp && pDoc->GetDocShell() )
|
if ( !pOCXExp && pDoc->GetDocShell() )
|
||||||
pOCXExp = new SwMSConvertControls( pDoc->GetDocShell(), pCurPam );
|
pOCXExp = new SwMSConvertControls( pDoc->GetDocShell(), pCurPam );
|
||||||
|
|
||||||
@@ -3266,7 +3263,7 @@ sal_uLong SwWW8Writer::Write( SwPaM& rPaM, SfxMedium& rMed,
|
|||||||
|
|
||||||
MSWordExportBase::MSWordExportBase( SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam )
|
MSWordExportBase::MSWordExportBase( SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam )
|
||||||
: aMainStg(sMainStream), pISet(0), pUsedNumTbl(0), mpTopNodeOfHdFtPage(0),
|
: aMainStg(sMainStream), pISet(0), pUsedNumTbl(0), mpTopNodeOfHdFtPage(0),
|
||||||
pBmpPal(0), pOLEExp(0), pOCXExp(0), pOleMap(0),
|
pBmpPal(0), pOLEExp(0), pOCXExp(0),
|
||||||
mpTableInfo(new ww8::WW8TableInfo()), nUniqueList(0),
|
mpTableInfo(new ww8::WW8TableInfo()), nUniqueList(0),
|
||||||
mnHdFtIndex(0), pAktPageDesc(0), pPapPlc(0), pChpPlc(0), pChpIter(0),
|
mnHdFtIndex(0), pAktPageDesc(0), pPapPlc(0), pChpPlc(0), pChpIter(0),
|
||||||
pStyles( NULL ),
|
pStyles( NULL ),
|
||||||
@@ -3284,7 +3281,6 @@ MSWordExportBase::~MSWordExportBase()
|
|||||||
delete pBmpPal;
|
delete pBmpPal;
|
||||||
delete pOLEExp;
|
delete pOLEExp;
|
||||||
delete pOCXExp;
|
delete pOCXExp;
|
||||||
delete pOleMap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WW8Export::WW8Export( SwWW8Writer *pWriter,
|
WW8Export::WW8Export( SwWW8Writer *pWriter,
|
||||||
|
@@ -117,7 +117,7 @@ class WW8_WrtBookmarks;
|
|||||||
class WW8_WrtRedlineAuthor;
|
class WW8_WrtRedlineAuthor;
|
||||||
class SvxMSExportOLEObjects;
|
class SvxMSExportOLEObjects;
|
||||||
class SwMSConvertControls;
|
class SwMSConvertControls;
|
||||||
class WW8OleMaps;
|
typedef std::set<sal_uInt32> WW8OleSet;
|
||||||
class SvStorageRef;
|
class SvStorageRef;
|
||||||
struct WW8_PdAttrDesc;
|
struct WW8_PdAttrDesc;
|
||||||
class SvxBrushItem;
|
class SvxBrushItem;
|
||||||
@@ -461,7 +461,7 @@ public:
|
|||||||
boost::shared_ptr<NfKeywordTable> pKeyMap;
|
boost::shared_ptr<NfKeywordTable> pKeyMap;
|
||||||
SvxMSExportOLEObjects* pOLEExp;
|
SvxMSExportOLEObjects* pOLEExp;
|
||||||
SwMSConvertControls* pOCXExp;
|
SwMSConvertControls* pOCXExp;
|
||||||
WW8OleMaps* pOleMap;
|
WW8OleSet m_aOleSet; // To remember all already exported ole objects
|
||||||
ww8::WW8TableInfo::Pointer_t mpTableInfo;
|
ww8::WW8TableInfo::Pointer_t mpTableInfo;
|
||||||
|
|
||||||
sal_uInt16 nCharFmtStart;
|
sal_uInt16 nCharFmtStart;
|
||||||
@@ -968,7 +968,7 @@ public:
|
|||||||
|
|
||||||
SvxMSExportOLEObjects& GetOLEExp() { return *pOLEExp; }
|
SvxMSExportOLEObjects& GetOLEExp() { return *pOLEExp; }
|
||||||
SwMSConvertControls& GetOCXExp() { return *pOCXExp; }
|
SwMSConvertControls& GetOCXExp() { return *pOCXExp; }
|
||||||
WW8OleMaps& GetOLEMap() { return *pOleMap; }
|
WW8OleSet& GetOLESet() { return m_aOleSet; }
|
||||||
void ExportDopTypography(WW8DopTypography &rTypo);
|
void ExportDopTypography(WW8DopTypography &rTypo);
|
||||||
|
|
||||||
sal_uInt16 AddRedlineAuthor( sal_uInt16 nId );
|
sal_uInt16 AddRedlineAuthor( sal_uInt16 nId );
|
||||||
|
@@ -241,22 +241,11 @@ void WW8Export::OutputOLENode( const SwOLENode& rOLENode )
|
|||||||
uno::Reference < embed::XEmbeddedObject > xObj(const_cast<SwOLENode&>(rOLENode).GetOLEObj().GetOleRef());
|
uno::Reference < embed::XEmbeddedObject > xObj(const_cast<SwOLENode&>(rOLENode).GetOLEObj().GetOleRef());
|
||||||
if( xObj.is() )
|
if( xObj.is() )
|
||||||
{
|
{
|
||||||
embed::XEmbeddedObject *pObj = xObj.get();
|
const embed::XEmbeddedObject *pObj = xObj.get();
|
||||||
sal_uInt32 nPictureId = (sal_uInt32)(sal_uIntPtr)pObj;
|
sal_uInt32 nPictureId = (sal_uInt32)(sal_uIntPtr)pObj;
|
||||||
|
//.second is false when element already existed
|
||||||
|
bool bIsNotDuplicate = GetOLESet().insert(nPictureId).second;
|
||||||
Set_UInt32(pDataAdr, nPictureId);
|
Set_UInt32(pDataAdr, nPictureId);
|
||||||
|
|
||||||
WW8OleMap *pMap = new WW8OleMap(nPictureId);
|
|
||||||
bool bDuplicate = false;
|
|
||||||
WW8OleMaps &rOleMap = GetOLEMap();
|
|
||||||
sal_uInt16 nPos;
|
|
||||||
if ( rOleMap.Seek_Entry(pMap, &nPos) )
|
|
||||||
{
|
|
||||||
bDuplicate = true;
|
|
||||||
delete pMap;
|
|
||||||
}
|
|
||||||
else if( 0 == rOleMap.Insert( pMap) )
|
|
||||||
delete pMap;
|
|
||||||
|
|
||||||
String sStorageName( '_' );
|
String sStorageName( '_' );
|
||||||
sStorageName += String::CreateFromInt32( nPictureId );
|
sStorageName += String::CreateFromInt32( nPictureId );
|
||||||
SvStorageRef xOleStg = xObjStg->OpenSotStorage( sStorageName,
|
SvStorageRef xOleStg = xObjStg->OpenSotStorage( sStorageName,
|
||||||
@@ -267,7 +256,7 @@ void WW8Export::OutputOLENode( const SwOLENode& rOLENode )
|
|||||||
If this object storage has been written already don't
|
If this object storage has been written already don't
|
||||||
waste time rewriting it
|
waste time rewriting it
|
||||||
*/
|
*/
|
||||||
if (!bDuplicate)
|
if (bIsNotDuplicate)
|
||||||
{
|
{
|
||||||
sal_Int64 nAspect = rOLENode.GetAspect();
|
sal_Int64 nAspect = rOLENode.GetAspect();
|
||||||
svt::EmbeddedObjectRef aObjRef( xObj, nAspect );
|
svt::EmbeddedObjectRef aObjRef( xObj, nAspect );
|
||||||
|
@@ -143,12 +143,7 @@ namespace com{namespace sun {namespace star{
|
|||||||
|
|
||||||
struct WW8LFOInfo;
|
struct WW8LFOInfo;
|
||||||
typedef WW8LFOInfo* WW8LFOInfo_Ptr;
|
typedef WW8LFOInfo* WW8LFOInfo_Ptr;
|
||||||
// Redlining: match WinWord author ids to StarWriter author ids
|
|
||||||
struct WW8OleMap;
|
|
||||||
typedef WW8OleMap* WW8OleMap_Ptr;
|
|
||||||
|
|
||||||
SV_DECL_PTRARR_DEL(WW8LFOInfos,WW8LFOInfo_Ptr,16)
|
SV_DECL_PTRARR_DEL(WW8LFOInfos,WW8LFOInfo_Ptr,16)
|
||||||
SV_DECL_PTRARR_SORT_DEL(WW8OleMaps, WW8OleMap_Ptr,16)
|
|
||||||
|
|
||||||
class WW8Reader : public StgReader
|
class WW8Reader : public StgReader
|
||||||
{
|
{
|
||||||
@@ -161,28 +156,6 @@ public:
|
|||||||
virtual sal_Bool ReadGlossaries( SwTextBlocks&, sal_Bool bSaveRelFiles ) const;
|
virtual sal_Bool ReadGlossaries( SwTextBlocks&, sal_Bool bSaveRelFiles ) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct WW8OleMap
|
|
||||||
{
|
|
||||||
sal_uInt32 mnWWid;
|
|
||||||
String msStorageName;
|
|
||||||
|
|
||||||
WW8OleMap(sal_uInt32 nWWid)
|
|
||||||
: mnWWid(nWWid) {}
|
|
||||||
|
|
||||||
WW8OleMap(sal_uInt32 nWWid, String sStorageName)
|
|
||||||
: mnWWid(nWWid), msStorageName(sStorageName) {}
|
|
||||||
|
|
||||||
bool operator==(const WW8OleMap & rEntry) const
|
|
||||||
{
|
|
||||||
return (mnWWid == rEntry.mnWWid);
|
|
||||||
}
|
|
||||||
bool operator<(const WW8OleMap & rEntry) const
|
|
||||||
{
|
|
||||||
return (mnWWid < rEntry.mnWWid);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class SwWW8ImplReader;
|
class SwWW8ImplReader;
|
||||||
struct WW8LSTInfo;
|
struct WW8LSTInfo;
|
||||||
class WW8ListManager
|
class WW8ListManager
|
||||||
|
@@ -72,8 +72,6 @@ struct OLE_MFP
|
|||||||
|
|
||||||
using namespace ::com::sun::star;
|
using namespace ::com::sun::star;
|
||||||
|
|
||||||
SV_IMPL_OP_PTRARR_SORT(WW8OleMaps, WW8OleMap_Ptr)
|
|
||||||
|
|
||||||
static bool SwWw8ReadScaling(long& rX, long& rY, SvStorageRef& rSrc1)
|
static bool SwWw8ReadScaling(long& rX, long& rY, SvStorageRef& rSrc1)
|
||||||
{
|
{
|
||||||
// Skalierungsfaktoren holen:
|
// Skalierungsfaktoren holen:
|
||||||
|
@@ -371,11 +371,6 @@ WPXPropertyList::Iter::last()
|
|||||||
WPXPropertyListVector::Iter::last()
|
WPXPropertyListVector::Iter::last()
|
||||||
WPXString::Iter::last()
|
WPXString::Iter::last()
|
||||||
WPXSubDocument::WPXSubDocument()
|
WPXSubDocument::WPXSubDocument()
|
||||||
WW8OleMaps::Insert(WW8OleMap* const&, unsigned short&)
|
|
||||||
WW8OleMaps::Insert(WW8OleMap* const*, unsigned short)
|
|
||||||
WW8OleMaps::Insert(WW8OleMaps const*, unsigned short, unsigned short)
|
|
||||||
WW8OleMaps::Remove(WW8OleMap* const&, unsigned short)
|
|
||||||
WW8OleMaps::Remove(unsigned short, unsigned short)
|
|
||||||
WinMtfOutput::DrawLine(Point const&, Point const&)
|
WinMtfOutput::DrawLine(Point const&, Point const&)
|
||||||
WinMtfOutput::GetTextLayoutMode() const
|
WinMtfOutput::GetTextLayoutMode() const
|
||||||
WinMtfOutput::SetFont(Font const&)
|
WinMtfOutput::SetFont(Font const&)
|
||||||
|
Reference in New Issue
Block a user