summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorThorsten Behrens <Thorsten.Behrens@CIB.de>2017-10-28 02:28:18 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2017-10-30 08:21:55 +0100
commit08a43cc97ccf88faa9d3a04afc3aacd2c885a2d1 (patch)
tree11f416701d1be0a962c7653ea86060f30f708b56 /sd
parent8d994f83568073eb79ab987069f740c3c940405e (diff)
related: tdf#103884 remove gltf/collada feature
Change-Id: Icd26ad96c0337844ef1463dabfbe791caa00dd2d Reviewed-on: https://gerrit.libreoffice.org/43972 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/export-tests.cxx17
-rw-r--r--sd/sdi/_drvwsh.sdi5
-rw-r--r--sd/source/ui/func/fuinsert.cxx77
-rw-r--r--sd/source/ui/inc/fuinsert.hxx18
-rw-r--r--sd/source/ui/view/drviews2.cxx10
-rw-r--r--sd/source/ui/view/drviews7.cxx8
-rw-r--r--sd/source/ui/view/sdview4.cxx23
7 files changed, 0 insertions, 158 deletions
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index a688954130b6..e6441fcb8ce1 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -211,25 +211,8 @@ void SdExportTest::testMediaEmbedding()
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/media_embedding.odp"), ODP);
-#if HAVE_FEATURE_GLTF
- xDocShRef = saveAndReload( xDocShRef.get(), ODP );
-#endif
-
const SdrPage *pPage = GetPage( 1, xDocShRef );
-#if HAVE_FEATURE_GLTF
- // First object is a glTF model
- SdrMediaObj *pModelObj = dynamic_cast<SdrMediaObj*>( pPage->GetObj( 2 ));
- CPPUNIT_ASSERT_MESSAGE( "missing model", pModelObj != nullptr);
- CPPUNIT_ASSERT_EQUAL( OUString( "vnd.sun.star.Package:Models/duck/duck.json" ), pModelObj->getMediaProperties().getURL());
- CPPUNIT_ASSERT_EQUAL( OUString( "model/vnd.gltf+json" ), pModelObj->getMediaProperties().getMimeType());
-#else
- // If glTF is not supported, then the fallback image is imported
- SdrGrafObj *pGrafic = dynamic_cast<SdrGrafObj*>( pPage->GetObj( 2 ));
- CPPUNIT_ASSERT_MESSAGE( "Could not load glTF fallback image", pGrafic != nullptr);
- CPPUNIT_ASSERT_EQUAL( OUString( "vnd.sun.star.Package:Models/Fallbacks/duck.png" ), pGrafic->GetGrafStreamURL());
-#endif
-
// Second object is a sound
SdrMediaObj *pMediaObj = dynamic_cast<SdrMediaObj*>( pPage->GetObj( 3 ));
CPPUNIT_ASSERT_MESSAGE( "missing media object", pMediaObj != nullptr);
diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi
index b51290415118..a18924f36a13 100644
--- a/sd/sdi/_drvwsh.sdi
+++ b/sd/sdi/_drvwsh.sdi
@@ -2747,11 +2747,6 @@ interface DrawView
[
ExecMethod = FuTemporary ;
]
- SID_INSERT_3DMODEL
- [
- ExecMethod = FuTemporary ;
- StateMethod = GetMenuState ;
- ]
SID_GO_TO_NEXT_PAGE
[
ExecMethod = ExecGoToNextPage ;
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index b5a363b141d9..97fdea1f5768 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -765,83 +765,6 @@ void FuInsertAVMedia::DoExecute( SfxRequest& rReq )
}
}
-#if HAVE_FEATURE_GLTF
-
-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,
- FileDialogFlags::NONE, mpWindow);
-
- aDlg.SetTitle( SdResId( STR_INSERT_3D_MODEL_TITLE ) );
-
-#if HAVE_FEATURE_COLLADA
- aDlg.AddFilter( SdResId( STR_INSERT_3D_MODEL_ALL_SUPPORTED_FORMATS ), "*.json;*.dae;*.kmz" );
-#else
- aDlg.AddFilter( SdResId( STR_INSERT_3D_MODEL_ALL_SUPPORTED_FORMATS ), "*.json" );
-#endif
-
- aDlg.AddFilter( "JSON - GL Transmission Format", "*.json" );
-
-#if HAVE_FEATURE_COLLADA
- aDlg.AddFilter( "DAE - COLLADA", "*.dae" );
- aDlg.AddFilter( "KMZ - Keyhole Markup language Zipped", "*.kmz" );
-#endif
-
- OUString sURL;
- if( aDlg.Execute() == ERRCODE_NONE )
- {
- const INetURLObject aURL( aDlg.GetPath() );
- sURL = aURL.GetMainURL( INetURLObject::DecodeMechanism::Unambiguous );
- }
- else if( !sURL.isEmpty() )
- sURL.clear();
-
- if (!sURL.isEmpty())
- {
- if( mpWindow )
- mpWindow->EnterWait();
-
- Point aPos;
- sal_Int8 nAction = DND_ACTION_COPY;
-
- Size aSize(480,360);
- if( mpWindow )
- aSize = mpWindow->PixelToLogic(aSize, MapMode(MapUnit::Map100thMM));
- else
- aSize = Application::GetDefaultDevice()->PixelToLogic(aSize, MapMode(MapUnit::Map100thMM));
-
- if( mpWindow )
- {
- aPos = mpWindow->PixelToLogic( ::tools::Rectangle( aPos, mpWindow->GetOutputSizePixel() ).Center() );
- aPos.X() -= aSize.Width() >> 1;
- aPos.Y() -= aSize.Height() >> 1;
- }
-#if HAVE_FEATURE_OPENGL
- mpView->Insert3DModelURL( sURL, nAction, aPos, aSize ) ;
-#endif
-
- if( mpWindow )
- mpWindow->LeaveWait();
- }
-}
-#endif
} // 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 2a946e8e2e18..21ec76d78f60 100644
--- a/sd/source/ui/inc/fuinsert.hxx
+++ b/sd/source/ui/inc/fuinsert.hxx
@@ -104,24 +104,6 @@ private:
SdDrawDocument* pDoc,
SfxRequest& rReq);
};
-#if HAVE_FEATURE_GLTF
-class FuInsert3DModel
- : public FuPoor
-{
-public:
-
- static rtl::Reference<FuPoor> Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
- virtual void DoExecute( SfxRequest& rReq ) override;
-
-private:
- FuInsert3DModel (
- ViewShell* pViewSh,
- ::sd::Window* pWin,
- ::sd::View* pView,
- SdDrawDocument* pDoc,
- SfxRequest& rReq);
-};
-#endif
} // end of namespace sd
#endif
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 436153a1ca94..49706a9cdd0d 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -1447,16 +1447,6 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
rReq.Ignore ();
}
break;
-#if HAVE_FEATURE_GLTF
- case SID_INSERT_3DMODEL:
- {
- SetCurrentFunction( FuInsert3DModel::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
-
- Cancel();
- rReq.Ignore ();
- }
- break;
-#endif
case SID_CLASSIFICATION_APPLY:
{
const SfxItemSet* pArgs = rReq.GetArgs();
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index 6261b23671c5..c91aa9edf0e0 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -1577,14 +1577,6 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
}
}
-#if !HAVE_FEATURE_GLTF
- if (SfxItemState::DEFAULT == rSet.GetItemState(SID_INSERT_3DMODEL))
- {
- rSet.DisableItem(SID_INSERT_3DMODEL);
- rSet.Put(SfxVisibilityItem(SID_INSERT_3DMODEL, false));
- }
-#endif
-
if (rSet.GetItemState(SID_SAVE_BACKGROUND) == SfxItemState::DEFAULT)
{
bool bDisableSaveBackground = true;
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index c0968405aa52..42bcfa23e141 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -38,7 +38,6 @@
#include <sot/storage.hxx>
#include <sfx2/app.hxx>
#include <avmedia/mediawindow.hxx>
-#include <avmedia/modeltools.hxx>
#include <svtools/ehdl.hxx>
#include <svtools/sfxecode.hxx>
#include <svtools/embedhlp.hxx>
@@ -295,28 +294,6 @@ void View::InsertMediaURL( const OUString& rMediaURL, sal_Int8& rAction,
InsertMediaObj( realURL, "application/vnd.sun.star.media", rAction, rPos, rSize );
}
-#if HAVE_FEATURE_OPENGL
-#if HAVE_FEATURE_GLTF
-void View::Insert3DModelURL(
- const OUString& rModelURL, sal_Int8& rAction,
- const Point& rPos, const Size& rSize )
-{
- OUString sRealURL;
- uno::Reference<frame::XModel> const xModel(
- GetDoc().GetObjectShell()->GetModel());
-#if HAVE_FEATURE_AVMEDIA
- bool const bRet = ::avmedia::Embed3DModel(xModel, rModelURL, sRealURL);
- if (!bRet)
-#endif
- return;
-
- SdrMediaObj* pRetObject = InsertMediaObj( sRealURL, "model/vnd.gltf+json", rAction, rPos, rSize );
- avmedia::MediaItem aItem = pRetObject->getMediaProperties();
- aItem.setLoop(true);
- pRetObject->setMediaProperties(aItem);
-}
-#endif
-#endif
SdrMediaObj* View::InsertMediaObj( const OUString& rMediaURL, const OUString& rMimeType, sal_Int8& rAction,
const Point& rPos, const Size& rSize )