diff options
author | Michael Stahl <mstahl@redhat.com> | 2011-12-02 23:54:33 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2011-12-03 00:48:15 +0100 |
commit | e8a54ef88dacccb9759dd394473d52b53ff1cbd7 (patch) | |
tree | 6b6a18d6d11b365a46de3359e49f8ea2b2fd562e /sw | |
parent | 51ea69880ca32220fa1c6b3e95c8916e3409184c (diff) |
add avmedia::EmbedMedia
This new function is used by sc,sd,sw to embed media in the document storage.
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/shells/grfshex.cxx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sw/source/ui/shells/grfshex.cxx b/sw/source/ui/shells/grfshex.cxx index 834057916f00..4b98002c3b57 100644 --- a/sw/source/ui/shells/grfshex.cxx +++ b/sw/source/ui/shells/grfshex.cxx @@ -41,6 +41,7 @@ #include <svl/svstdarr.hxx> #include <svtools/filter.hxx> #include <svx/htmlmode.hxx> +#include <doc.hxx> #include <docsh.hxx> #include <frmfmt.hxx> #include <frmmgr.hxx> @@ -66,6 +67,7 @@ #include <comcore.hrc> // <- #111827# +using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::ui::dialogs; using namespace ::sfx2; @@ -134,9 +136,22 @@ bool SwTextShell::InsertMediaDlg( SfxRequest& rReq ) else aSize = Size( 2835, 2835 ); + ::rtl::OUString realURL; + if (bLink) + { + realURL = aURL; + } + else + { + uno::Reference<frame::XModel> const xModel( + rSh.GetDoc()->GetDocShell()->GetModel()); + bRet = ::avmedia::EmbedMedia(xModel, aURL, realURL); + if (!bRet) { return bRet; } + } + SdrMediaObj* pObj = new SdrMediaObj( Rectangle( aPos, aSize ) ); - pObj->setURL( aURL ); + pObj->setURL( realURL ); rSh.EnterStdMode(); rSh.SwFEShell::InsertDrawObj( *pObj, aPos ); bRet = true; |