Fix: Dali::Internal::StyleMonitor::LoadThemeFile() opens files as binary. 11/223211/3
authorGyörgy Straub <g.straub@partner.samsung.com>
Mon, 27 Jan 2020 09:53:14 +0000 (09:53 +0000)
committerGyörgy Straub <g.straub@partner.samsung.com>
Mon, 27 Jan 2020 10:41:08 +0000 (10:41 +0000)
Attempting to read the style-sheet.jsons as text fails on Windows, due to the
garbage which the CRLF conversion - performed by the OS - appears to create
at the end of the file.

N.B. the binary specifier to fopen() has no effect on POSIX systems. (source:
https://en.cppreference.com/w/c/io/fopen )

Change-Id: Ibf96d9194ed7d1953b35248c5044136b5fb01497
Signed-off-by: György Straub <g.straub@partner.samsung.com>
dali/internal/styling/common/style-monitor-impl.cpp

index 5b316b47ac242282c110d62791422cfcd0cbb225..9b234342dd004187f189954858d2e864bdd1cae9 100644 (file)
@@ -159,7 +159,7 @@ bool StyleMonitor::LoadThemeFile( const std::string& filename, std::string& outp
 
   std::streampos bufferSize = 0;
   Dali::Vector<char> fileBuffer;
-  if( Dali::FileLoader::ReadFile( filename, bufferSize, fileBuffer, FileLoader::FileType::TEXT ) )
+  if( Dali::FileLoader::ReadFile( filename, bufferSize, fileBuffer, FileLoader::FileType::BINARY ) )
   {
     output.assign( &fileBuffer[0], bufferSize );
     retval = true;