summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/sfx2/sfxsids.hrc2
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu5
-rw-r--r--sd/sdi/_drvwsh.sdi5
-rw-r--r--sd/source/ui/func/fuinsert.cxx59
-rw-r--r--sd/source/ui/inc/fuinsert.hxx17
-rw-r--r--sd/source/ui/view/drviews2.cxx11
-rw-r--r--sd/uiconfig/simpress/menubar/menubar.xml1
-rw-r--r--sfx2/sdi/sfx.sdi24
8 files changed, 124 insertions, 0 deletions
diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index ebac7ded56aa..6c67e4c8bdef 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -515,6 +515,8 @@
#define SID_FRAMEDESCRIPTOR (SID_SFX_START + 1229)
+#define SID_INSERT_3DMODEL (SID_SFX_START + 1229)
+
// SaveTabPage
#define SID_ATTR_DOCINFO (SID_OPTIONS_START + 0)
#define SID_ATTR_BACKUP (SID_OPTIONS_START + 1)
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index 43e4aa6ceeca..35303c321ef6 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -5609,6 +5609,11 @@
<value xml:lang="en-US">Edit with External Tool</value>
</prop>
</node>
+ <node oor:name=".uno:Insert3DModel" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">3D Model...</value>
+ </prop>
+ </node>
</node>
</node>
</oor:component-data>
diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi
index 78e812e834e0..d328cf42e57a 100644
--- a/sd/sdi/_drvwsh.sdi
+++ b/sd/sdi/_drvwsh.sdi
@@ -2748,4 +2748,9 @@ interface DrawView
[
ExecMethod = FuTemporary ;
]
+ SID_INSERT_3DMODEL
+ [
+ ExecMethod = FuTemporary ;
+ StateMethod = GetMenuState ;
+ ]
}
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index 13f71bad655b..c1706fc298cf 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -29,6 +29,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <tools/urlobj.hxx>
#include <svl/urihelper.hxx>
@@ -90,6 +91,7 @@ TYPEINIT1( FuInsertGraphic, FuPoor );
TYPEINIT1( FuInsertClipboard, FuPoor );
TYPEINIT1( FuInsertOLE, FuPoor );
TYPEINIT1( FuInsertAVMedia, FuPoor );
+TYPEINIT1( FuInsert3DModel, FuPoor );
FuInsertGraphic::FuInsertGraphic (
ViewShell* pViewSh,
@@ -753,6 +755,63 @@ void FuInsertAVMedia::DoExecute( SfxRequest& rReq )
}
}
+FuInsert3DModel::FuInsert3DModel(
+ ViewShell* pViewSh,
+ ::sd::Window* pWin,
+ ::sd::View* pView,
+ SdDrawDocument* pDoc,
+ SfxRequest& rReq)
+ : FuPoor(pViewSh, pWin, pView, pDoc, rReq)
+{
+}
+
+rtl::Reference<FuPoor> FuInsert3DModel::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq )
+{
+ rtl::Reference<FuPoor> xFunc( new FuInsert3DModel( pViewSh, pWin, pView, pDoc, rReq ) );
+ xFunc->DoExecute(rReq);
+ return xFunc;
+}
+
+void FuInsert3DModel::DoExecute( SfxRequest& )
+{
+ sfx2::FileDialogHelper aDlg( ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 );
+
+ aDlg.SetTitle( "Open 3DModel" );
+ aDlg.AddFilter( "GL Transmission Format", "*.json" );
+ aDlg.AddFilter( "All files", "*.*" );
+
+ OUString sURL;
+ if( aDlg.Execute() == ERRCODE_NONE )
+ {
+ const INetURLObject aURL( aDlg.GetPath() );
+ sURL = aURL.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS );
+ }
+ else if( !sURL.isEmpty() )
+ sURL = OUString();
+
+ if (!sURL.isEmpty())
+ {
+ if( mpWindow )
+ mpWindow->EnterWait();
+
+ Point aPos;
+ Size aSize(480,360);
+ sal_Int8 nAction = DND_ACTION_COPY;
+
+ if( mpWindow )
+ {
+ aPos = mpWindow->PixelToLogic( Rectangle( aPos, mpWindow->GetOutputSizePixel() ).Center() );
+ aPos.X() -= aSize.Width() >> 1;
+ aPos.Y() -= aSize.Height() >> 1;
+ }
+
+ mpView->InsertMediaURL( sURL, nAction, aPos, aSize, false ) ;
+
+ if( mpWindow )
+ mpWindow->LeaveWait();
+ }
+}
+
} // end of namespace sd
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/fuinsert.hxx b/sd/source/ui/inc/fuinsert.hxx
index 2f6ca859397e..f002250b58dd 100644
--- a/sd/source/ui/inc/fuinsert.hxx
+++ b/sd/source/ui/inc/fuinsert.hxx
@@ -105,6 +105,23 @@ private:
SfxRequest& rReq);
};
+class FuInsert3DModel
+ : public FuPoor
+{
+public:
+ TYPEINFO_OVERRIDE();
+
+ static rtl::Reference<FuPoor> Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
+ virtual void DoExecute( SfxRequest& rReq );
+
+private:
+ FuInsert3DModel (
+ ViewShell* pViewSh,
+ ::sd::Window* pWin,
+ ::sd::View* pView,
+ SdDrawDocument* pDoc,
+ SfxRequest& rReq);
+};
} // end of namespace sd
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index c996d14deff2..856297edbe1c 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -1167,6 +1167,17 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
}
break;
+ case SID_INSERT_3DMODEL:
+ {
+ SetCurrentFunction( FuInsert3DModel::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
+
+ Cancel();
+ rReq.Ignore ();
+
+ Invalidate(SID_DRAWTBX_INSERT);
+ }
+ break;
+
case SID_COPYOBJECTS:
{
if ( mpDrawView->IsPresObjSelected(sal_False, sal_True) )
diff --git a/sd/uiconfig/simpress/menubar/menubar.xml b/sd/uiconfig/simpress/menubar/menubar.xml
index b2d5ae6459d6..ab11e88e79e1 100644
--- a/sd/uiconfig/simpress/menubar/menubar.xml
+++ b/sd/uiconfig/simpress/menubar/menubar.xml
@@ -217,6 +217,7 @@
<menu:menuitem menu:id=".uno:InsertObject"/>
<menu:menuitem menu:id=".uno:InsertPlugin"/>
<menu:menuitem menu:id=".uno:InsertMath"/>
+ <menu:menuitem menu:id=".uno:Insert3DModel"/>
</menu:menupopup>
</menu:menu>
<menu:menuitem menu:id=".uno:InsertObjectChart"/>
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index 59e6254eea48..8487a84bfa2f 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -8457,3 +8457,27 @@ SvxZoomItem Zoom SID_ATTR_ZOOM
ToolBoxConfig = TRUE,
GroupId = GID_VIEW;
]
+
+SfxStringItem Insert3DModel SID_INSERT_3DMODEL
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]