summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-06-10 21:30:22 +0200
committerZolnai Tamás <tamas.zolnai@collabora.com>2014-06-13 00:31:41 +0200
commitfcee15fdac221139103a46b13ef01367f633c7bc (patch)
tree9bd0eac879c680884d9c5b2887b415f686d18faf /sd
parent3ba25e534d5a433778a6d6c77117a13c6d796761 (diff)
Make glTF support an experimental feature
Change-Id: I75e69ba1acafbab8362536f02f4d39a8fc2deed1 (cherry picked from commit 653bac184f579524bc25a9f40281763a736ae6fd)
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/import-tests.cxx18
-rw-r--r--sd/source/ui/view/drviews2.cxx5
-rw-r--r--sd/source/ui/view/drviews7.cxx11
3 files changed, 28 insertions, 6 deletions
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 949bd853e8a1..f4ebef2393c3 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -30,6 +30,7 @@
#include <svx/svdomedia.hxx>
#include <svx/svdoole2.hxx>
#include <svx/xflclit.hxx>
+#include <svtools/miscopt.hxx>
#include <animations/animationnodehelper.hxx>
#include <com/sun/star/drawing/XDrawPage.hpp>
@@ -710,8 +711,8 @@ void SdFiltersTest::testFdo71961()
void SdFiltersTest::testMediaEmbedding()
{
+ SvtMiscOptions().SetExperimentalMode(true);
::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/media_embedding.odp"));
- xDocShRef = saveAndReload( xDocShRef, ODP );
SdDrawDocument *pDoc = xDocShRef->GetDoc();
CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
@@ -724,12 +725,21 @@ void SdFiltersTest::testMediaEmbedding()
CPPUNIT_ASSERT_MESSAGE( "missing model", pModelObj != NULL);
CPPUNIT_ASSERT_EQUAL( OUString( "vnd.sun.star.Package:Model/jeep/jeep.json" ), pModelObj->getMediaProperties().getURL());
CPPUNIT_ASSERT_EQUAL( OUString( "application/vnd.gltf+json" ), pModelObj->getMediaProperties().getMimeType());
-#else
+
+ // Check the case when experimental mode is disabled
+ xDocShRef->DoClose();
+ SvtMiscOptions().SetExperimentalMode(false);
+ xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/media_embedding.odp"));
+ pDoc = xDocShRef->GetDoc();
+ CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
+ pPage = pDoc->GetPage (1);
+ CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
+#endif
+
// 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 != NULL);
- CPPUNIT_ASSERT_EQUAL( OUString( "vnd.sun.star.Package:Pictures/jeep.png" ), pGrafic->GetGrafStreamURL());
-#endif
+ CPPUNIT_ASSERT_EQUAL( OUString( "vnd.sun.star.Package:Model/Fallback/jeep.png" ), pGrafic->GetGrafStreamURL());
// Second object is a sound
SdrMediaObj *pMediaObj = dynamic_cast<SdrMediaObj*>( pPage->GetObj( 3 ));
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 384a6c7da817..49a6597b4c5b 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -79,6 +79,8 @@
#include <svx/xlnstwit.hxx>
#include <svx/xlnwtit.hxx>
+#include <svtools/miscopt.hxx>
+
#include <tools/diagnose_ex.h>
#include <unotools/useroptions.hxx>
@@ -1171,6 +1173,9 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
#if HAVE_FEATURE_GLTF
case SID_INSERT_3DMODEL:
{
+ if( !SvtMiscOptions().IsExperimentalMode() )
+ break;
+
SetCurrentFunction( FuInsert3DModel::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
Cancel();
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index 81e2e005a14c..10d453c6e9da 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -43,6 +43,8 @@
#include <svx/extrusionbar.hxx>
#include <svx/fontworkbar.hxx>
+#include <svtools/miscopt.hxx>
+
// #UndoRedo#
#include <svl/slstitm.hxx>
#include <sfx2/app.hxx>
@@ -1594,13 +1596,18 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
}
}
+ bool bDisableInsert3DModel = false;
#if !HAVE_FEATURE_GLTF
- if (SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_INSERT_3DMODEL))
+ bDisableInsert3DModel = true;
+#else
+ bDisableInsert3DModel = !SvtMiscOptions().IsExperimentalMode();
+#endif
+
+ if (bDisableInsert3DModel && SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_INSERT_3DMODEL))
{
rSet.DisableItem(SID_INSERT_3DMODEL);
rSet.Put(SfxVisibilityItem(SID_INSERT_3DMODEL, false));
}
-#endif
GetModeSwitchingMenuState (rSet);
}