LibreOffice Module sw (master) 1
|
Make inserting an OLE object into a Writer document easy. More...
#include <writerhelper.hxx>
Public Member Functions | |
DrawingOLEAdaptor (SdrOle2Obj &rObj, SfxObjectShell &rPers) | |
Take ownership of a SdrOle2Objs OLE object. More... | |
~DrawingOLEAdaptor () | |
Destructor will destroy the owned OLE object if not transferred. More... | |
bool | TransferToDoc (OUString &rName) |
Transfer ownership of the OLE object to a document's SvPersist. More... | |
Private Member Functions | |
DrawingOLEAdaptor & | operator= (const DrawingOLEAdaptor &)=delete |
DrawingOLEAdaptor (const DrawingOLEAdaptor &rDoc)=delete | |
Private Attributes | |
css::uno::Reference< css::embed::XEmbeddedObject > | mxIPRef |
SfxObjectShell & | mrPers |
const Graphic * | mpGraphic |
Make inserting an OLE object into a Writer document easy.
The rest of Office uses SdrOle2Obj for their OLE objects, Writer doesn't, which makes things a bit difficult as this is the type of object that the escher import code shared by the MSOffice filters produces when it imports an OLE object.
This utility class takes ownership of the OLE object away from a SdrOle2Obj and can massage it into the condition best suited to insertion into Writer.
If the object was not transferred into Writer then it is deleted during destruction.
Definition at line 574 of file writerhelper.hxx.
sw::hack::DrawingOLEAdaptor::DrawingOLEAdaptor | ( | SdrOle2Obj & | rObj, |
SfxObjectShell & | rPers | ||
) |
Take ownership of a SdrOle2Objs OLE object.
rObj | The SdrOle2Obj whose OLE object we want to take control of |
rPers | The SvPersist of a SwDoc (SwDoc::GetPersist()) into which we may want to move the object, or remove it from if unwanted. |
Definition at line 279 of file writerhelper.cxx.
References SdrOle2Obj::AbandonObject().
sw::hack::DrawingOLEAdaptor::~DrawingOLEAdaptor | ( | ) |
Destructor will destroy the owned OLE object if not transferred.
Definition at line 312 of file writerhelper.cxx.
References SfxObjectShell::GetEmbeddedObjectContainer(), comphelper::EmbeddedObjectContainer::HasEmbeddedObject(), mrPers, and mxIPRef.
|
privatedelete |
|
privatedelete |
bool sw::hack::DrawingOLEAdaptor::TransferToDoc | ( | OUString & | rName | ) |
Transfer ownership of the OLE object to a document's SvPersist.
TransferToDoc moves the object into the persist under the name passed in. This name is then suitable to be used as an argument to SwDoc::InsertOLE.
The object is no longer owned by the adaptor after this call, subsequent calls are an error and return false.
rName | The name to store the object under in the document. |
Definition at line 287 of file writerhelper.cxx.
References SfxObjectShell::GetEmbeddedObjectContainer(), SfxObjectShell::GetModel(), comphelper::EmbeddedObjectContainer::InsertEmbeddedObject(), mpGraphic, mrPers, mxIPRef, and svt::EmbeddedObjectRef::SetGraphicToContainer().
Referenced by SwWW8ImplReader::InsertOle().
|
private |
Definition at line 579 of file writerhelper.hxx.
Referenced by TransferToDoc().
|
private |
Definition at line 578 of file writerhelper.hxx.
Referenced by TransferToDoc(), and ~DrawingOLEAdaptor().
|
private |
Definition at line 577 of file writerhelper.hxx.
Referenced by TransferToDoc(), and ~DrawingOLEAdaptor().