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 5b316b4..9b23434 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;