diff options
author | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-06-11 12:36:26 +0200 |
---|---|---|
committer | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-06-12 21:43:35 +0200 |
commit | fe70101856332663f600df144b39d2638b3d0570 (patch) | |
tree | db4a1ba9353118269eec8738d6c3571bbb1c6d13 /sd | |
parent | 3d3fc58a32211cf56c5238f2d9f0e86a1eb7ae7e (diff) |
Introduce HAVE_FEATURE_GLTF to enable/disable gltf related code
When it is a release build then enable it only on Windows and
Linux.
Change-Id: I7c462aeb75e6ab60eeaa0fa42ca7853a6369b742
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/media_embedding.odp | bin | 216243 -> 4068424 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 18 | ||||
-rw-r--r-- | sd/source/ui/func/fuinsert.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/inc/fuinsert.hxx | 5 | ||||
-rw-r--r-- | sd/source/ui/view/drviews2.cxx | 5 | ||||
-rw-r--r-- | sd/source/ui/view/drviews7.cxx | 10 | ||||
-rw-r--r-- | sd/source/ui/view/sdview4.cxx | 4 |
7 files changed, 42 insertions, 8 deletions
diff --git a/sd/qa/unit/data/media_embedding.odp b/sd/qa/unit/data/media_embedding.odp Binary files differindex 14ea4606448c..e70300edba59 100644 --- a/sd/qa/unit/data/media_embedding.odp +++ b/sd/qa/unit/data/media_embedding.odp diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index cc9339acda69..949bd853e8a1 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -25,6 +25,7 @@ #include <svx/svdotext.hxx> #include <svx/svdoashp.hxx> +#include <svx/svdograf.hxx> #include <svx/svdogrp.hxx> #include <svx/svdomedia.hxx> #include <svx/svdoole2.hxx> @@ -46,6 +47,8 @@ #include <com/sun/star/chart2/data/XDataSequence.hpp> #include <com/sun/star/chart2/data/XNumericalDataSequence.hpp> +#include <config_features.h> + using namespace ::com::sun::star; /// Impress import filters tests. @@ -715,17 +718,26 @@ void SdFiltersTest::testMediaEmbedding() const SdrPage *pPage = pDoc->GetPage (1); CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL ); +#if HAVE_FEATURE_GLTF // First object is a glTF model - SdrMediaObj *pModelObj = dynamic_cast<SdrMediaObj*>( pPage->GetObj( 1 )); + SdrMediaObj *pModelObj = dynamic_cast<SdrMediaObj*>( pPage->GetObj( 2 )); CPPUNIT_ASSERT_MESSAGE( "missing model", pModelObj != NULL); - CPPUNIT_ASSERT_EQUAL( OUString( "vnd.sun.star.Package:Model/duck/duck.json" ), pModelObj->getMediaProperties().getURL()); + 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 + // 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 // Second object is a sound - SdrMediaObj *pMediaObj = dynamic_cast<SdrMediaObj*>( pPage->GetObj( 2 )); + SdrMediaObj *pMediaObj = dynamic_cast<SdrMediaObj*>( pPage->GetObj( 3 )); CPPUNIT_ASSERT_MESSAGE( "missing media object", pMediaObj != NULL); CPPUNIT_ASSERT_EQUAL( OUString( "vnd.sun.star.Package:Media/button-1.wav" ), pMediaObj->getMediaProperties().getURL()); CPPUNIT_ASSERT_EQUAL( OUString( "application/vnd.sun.star.media" ), pMediaObj->getMediaProperties().getMimeType()); + + xDocShRef->DoClose(); } void SdFiltersTest::testBnc870237() diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx index c16e6fc0e62b..c7bd348aa617 100644 --- a/sd/source/ui/func/fuinsert.cxx +++ b/sd/source/ui/func/fuinsert.cxx @@ -85,6 +85,8 @@ #include <boost/scoped_ptr.hpp> #include "glob.hrc" +#include <config_features.h> + using namespace com::sun::star; namespace sd { @@ -93,7 +95,6 @@ TYPEINIT1( FuInsertGraphic, FuPoor ); TYPEINIT1( FuInsertClipboard, FuPoor ); TYPEINIT1( FuInsertOLE, FuPoor ); TYPEINIT1( FuInsertAVMedia, FuPoor ); -TYPEINIT1( FuInsert3DModel, FuPoor ); FuInsertGraphic::FuInsertGraphic ( ViewShell* pViewSh, @@ -763,6 +764,9 @@ void FuInsertAVMedia::DoExecute( SfxRequest& rReq ) } } +#if HAVE_FEATURE_GLTF +TYPEINIT1( FuInsert3DModel, FuPoor ); + FuInsert3DModel::FuInsert3DModel( ViewShell* pViewSh, ::sd::Window* pWin, @@ -826,7 +830,7 @@ void FuInsert3DModel::DoExecute( SfxRequest& ) 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 60276cd146a6..25b7ed329312 100644 --- a/sd/source/ui/inc/fuinsert.hxx +++ b/sd/source/ui/inc/fuinsert.hxx @@ -21,6 +21,7 @@ #define INCLUDED_SD_SOURCE_UI_INC_FUINSERT_HXX #include "fupoor.hxx" +#include <config_features.h> namespace sd { @@ -104,7 +105,7 @@ private: SdDrawDocument* pDoc, SfxRequest& rReq); }; - +#if HAVE_FEATURE_GLTF class FuInsert3DModel : public FuPoor { @@ -122,7 +123,7 @@ private: 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 2c42638a8cf1..2d503cd3fc87 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -32,6 +32,8 @@ #include <comphelper/processfactory.hxx> +#include <config_features.h> + #include <editeng/editdata.hxx> #include <editeng/eeitem.hxx> #include <editeng/flditem.hxx> @@ -1164,7 +1166,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) Invalidate(SID_DRAWTBX_INSERT); } break; - +#if HAVE_FEATURE_GLTF case SID_INSERT_3DMODEL: { SetCurrentFunction( FuInsert3DModel::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) ); @@ -1175,6 +1177,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) Invalidate(SID_DRAWTBX_INSERT); } break; +#endif case SID_COPYOBJECTS: { diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index 06d60f676789..d57b4a6ad2ba 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -80,6 +80,8 @@ #include "fubullet.hxx" #include "fuformatpaintbrush.hxx" +#include <config_features.h> + using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; @@ -1658,6 +1660,14 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) } } +#if !HAVE_FEATURE_GLTF + if (SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_INSERT_3DMODEL)) + { + rSet.DisableItem(SID_INSERT_3DMODEL); + rSet.Put(SfxVisibilityItem(SID_INSERT_3DMODEL, false)); + } +#endif + GetModeSwitchingMenuState (rSet); } diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx index c14465d6da56..e698e6457996 100644 --- a/sd/source/ui/view/sdview4.cxx +++ b/sd/source/ui/view/sdview4.cxx @@ -61,6 +61,8 @@ #include <svx/svdoashp.hxx> #include "glob.hrc" +#include <config_features.h> + using namespace com::sun::star; namespace sd { @@ -289,6 +291,7 @@ SdrMediaObj* View::InsertMediaURL( const OUString& rMediaURL, sal_Int8& rAction, return InsertMediaObj( realURL, "application/vnd.sun.star.media", rAction, rPos, rSize ); } +#if HAVE_FEATURE_GLTF SdrMediaObj* View::Insert3DModelURL( const OUString& rModelURL, sal_Int8& rAction, const Point& rPos, const Size& rSize, @@ -313,6 +316,7 @@ SdrMediaObj* View::Insert3DModelURL( pRetObject->setMediaProperties(aItem); return pRetObject; } +#endif SdrMediaObj* View::InsertMediaObj( const OUString& rMediaURL, const OUString& rMimeType, sal_Int8& rAction, const Point& rPos, const Size& rSize ) |