diff options
author | Kurt Zenker <kz@openoffice.org> | 2004-10-04 18:17:58 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2004-10-04 18:17:58 +0000 |
commit | 93b356be0865ec54f2f9f28f051ef753c28ea62b (patch) | |
tree | 14eb00b7b9dd3adfe909b911fa68ef707d5eee4f /sw/source/filter/ww8 | |
parent | 8d6f4361974f406763cd0002ea525a04fe884b59 (diff) |
INTEGRATION: CWS mav09 (1.9.36); FILE MERGED
2004/09/21 17:12:42 mav 1.9.36.9: RESYNC: (1.9-1.10); FILE MERGED
2004/09/03 15:24:48 mav 1.9.36.8: #i27773# correct graphic inserting
2004/09/03 15:05:28 mba 1.9.36.7: #i27773#: use one single method to clear on SdrOleObject
2004/09/02 13:39:24 mav 1.9.36.6: #i27773# copy graphics also
2004/09/02 12:44:50 mav 1.9.36.5: #i27773# copy graphics also
2004/08/19 07:43:01 mba 1.9.36.4: #i27773#: work on todos
2004/07/15 13:04:49 mba 1.9.36.3: #i27773#: cleaning up todos: scaling in inplace mode, update chart after resizing and some more
2004/05/20 21:07:48 mba 1.9.36.2: #i27773#: some API changes
2004/05/18 16:51:33 mba 1.9.36.1: #i27773#: remove so3
Diffstat (limited to 'sw/source/filter/ww8')
-rw-r--r-- | sw/source/filter/ww8/writerhelper.cxx | 69 |
1 files changed, 42 insertions, 27 deletions
diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx index 833214e7349d..016dd7e9835e 100644 --- a/sw/source/filter/ww8/writerhelper.cxx +++ b/sw/source/filter/ww8/writerhelper.cxx @@ -2,9 +2,9 @@ * * $RCSfile: writerhelper.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: rt $ $Date: 2004-09-20 15:19:16 $ + * last change: $Author: kz $ $Date: 2004-10-04 19:17:58 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -68,6 +68,13 @@ # include <msfilter.hxx> #endif +#ifndef _COM_SUN_STAR_EMBED_EMBEDSTATES_HPP_ +#include <com/sun/star/embed/EmbedStates.hpp> +#endif +#ifndef _COM_SUN_STAR_UTIL_XCLOSEABLE_HPP_ +#include <com/sun/star/util/XCloseable.hpp> +#endif + #include <algorithm> //std::swap #include <functional> //std::binary_function @@ -140,6 +147,10 @@ #ifndef _FCHRFMT_HXX # include <fchrfmt.hxx> //SwFmtCharFmt #endif +#ifndef _UNOTOOLS_STREAMWRAP_HXX +# include <unotools/streamwrap.hxx> +#endif + #ifdef DEBUGDUMP # ifndef _SV_SVAPP_HXX # include <vcl/svapp.hxx> @@ -350,33 +361,33 @@ namespace sw } DrawingOLEAdaptor::DrawingOLEAdaptor(SdrOle2Obj &rObj, - SvPersist &rPers) + SfxObjectShell &rPers) : msOrigPersistName(rObj.GetPersistName()), - mxIPRef(rObj.GetObjRef()), mrPers(rPers) + mxIPRef(rObj.GetObjRef()), mrPers(rPers), + mpGraphic( rObj.GetGraphic() ) { - rObj.SetPersistName(String()); - rObj.SetObjRef(SvInPlaceObjectRef()); + //rObj.SetPersistName(String()); + //rObj.SetObjRef(0); + rObj.AbandonObject(); } - bool DrawingOLEAdaptor::TransferToDoc(const String &rName) + bool DrawingOLEAdaptor::TransferToDoc( ::rtl::OUString &rName ) { - ASSERT(mxIPRef.Is(), "Transferring invalid object to doc"); - if (!mxIPRef.Is()) + ASSERT(mxIPRef.is(), "Transferring invalid object to doc"); + if (!mxIPRef.is()) return false; - SvInfoObjectRef refObj = new SvEmbeddedInfoObject(mxIPRef, rName); - bool bSuccess = mrPers.Move(refObj, rName); + bool bSuccess = mrPers.GetEmbeddedObjectContainer().InsertEmbeddedObject( mxIPRef, rName ); if (bSuccess) { - SvPersist *pO = mxIPRef; - ASSERT(!pO->IsModified(), "Not expected to be modified here"); - if (pO->IsModified()) - { - pO->DoSave(); - pO->DoSaveCompleted(); - } - mxIPRef.Clear(); - bSuccess = mrPers.Unload(pO); + if ( mpGraphic ) + ::svt::EmbeddedObjectRef::SetGraphicToContainer( *mpGraphic, + mrPers.GetEmbeddedObjectContainer(), + rName, + ::rtl::OUString() ); + + //mxIPRef->changeState( com::sun::star::embed::EmbedStates::LOADED ); + mxIPRef = 0; } return bSuccess; @@ -384,16 +395,20 @@ namespace sw DrawingOLEAdaptor::~DrawingOLEAdaptor() { - if (mxIPRef.Is()) + if (mxIPRef.is()) { - if (SvInfoObject* pInfo = mrPers.Find(msOrigPersistName)) + DBG_ASSERT( !mrPers.GetEmbeddedObjectContainer().HasEmbeddedObject( mxIPRef ), "Object in adaptor is inserted?!" ); + try { - pInfo->SetDeleted(TRUE); - pInfo->SetObj(0); + com::sun::star::uno::Reference < com::sun::star::util::XCloseable > xClose( mxIPRef, com::sun::star::uno::UNO_QUERY ); + if ( xClose.is() ) + xClose->close(sal_True); } - mxIPRef->DoClose(); - mrPers.Remove(mxIPRef); - mxIPRef.Clear(); + catch ( com::sun::star::util::CloseVetoException& ) + { + } + + mxIPRef = 0; } } |