Kaydet (Commit) 663c6800 authored tarafından Jan Holesovsky's avatar Jan Holesovsky

collada2gltf: Ignore case of the extension.

Change-Id: If7f39a1a0537c561373137e6a9dcdb22b48037f0
üst 2fa2e6db
...@@ -148,7 +148,9 @@ bool Embed3DModel( const uno::Reference<frame::XModel>& xModel, ...@@ -148,7 +148,9 @@ bool Embed3DModel( const uno::Reference<frame::XModel>& xModel,
{ {
OUString sSource = rSourceURL; OUString sSource = rSourceURL;
#ifdef ENABLE_COLLADA2GLTF #ifdef ENABLE_COLLADA2GLTF
if (rSourceURL.endsWith(".dae") || rSourceURL.endsWith(".kmz")) const bool bIsDAE = rSourceURL.endsWithIgnoreAsciiCase(".dae");
const bool bIsKMZ = rSourceURL.endsWithIgnoreAsciiCase(".kmz");
if (bIsDAE || bIsKMZ)
{ {
OUString sName; OUString sName;
::utl::LocalFileHelper::ConvertPhysicalNameToURL(::utl::TempFile::CreateTempName(), sName); ::utl::LocalFileHelper::ConvertPhysicalNameToURL(::utl::TempFile::CreateTempName(), sName);
...@@ -160,7 +162,7 @@ bool Embed3DModel( const uno::Reference<frame::XModel>& xModel, ...@@ -160,7 +162,7 @@ bool Embed3DModel( const uno::Reference<frame::XModel>& xModel,
std::shared_ptr <GLTF::GLTFAsset> asset(new GLTF::GLTFAsset()); std::shared_ptr <GLTF::GLTFAsset> asset(new GLTF::GLTFAsset());
asset->setInputFilePath(sSourcePath); asset->setInputFilePath(sSourcePath);
if (rSourceURL.endsWith(".kmz")) if (bIsKMZ)
{ {
std::string strDaeFilePath = GLTF::Kmz2Collada()(asset->getInputFilePath()); std::string strDaeFilePath = GLTF::Kmz2Collada()(asset->getInputFilePath());
if (strDaeFilePath == "") if (strDaeFilePath == "")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment