[Libreoffice-commits] core.git: include/osl sal/osl sal/qa sal/util
Stephan Bergmann
sbergman at redhat.com
Mon May 12 23:48:09 PDT 2014
include/osl/detail/file.h | 3 ---
sal/osl/unx/file.cxx | 12 +++++-------
sal/qa/osl/file/osl_File.cxx | 29 -----------------------------
sal/util/sal.map | 1 -
4 files changed, 5 insertions(+), 40 deletions(-)
New commits:
commit 3f72ad159c881d0a11e638c84064172f48f75026
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue May 13 08:47:30 2014 +0200
osl_openMemoryAsFile is internal, Android-only functionality
Change-Id: I36734b0e5e1c0b15ed4f0845450b444b23579ffe
diff --git a/include/osl/detail/file.h b/include/osl/detail/file.h
index b9ddaba..a3cfc73 100644
--- a/include/osl/detail/file.h
+++ b/include/osl/detail/file.h
@@ -43,9 +43,6 @@ SAL_DLLPUBLIC oslFileError SAL_CALL osl_getFileOSHandle(
oslFileHandle Handle,
sal_IntPtr *piFileHandle );
-/* for unit testing. */
-SAL_DLLPUBLIC oslFileError SAL_CALL osl_openMemoryAsFile( void *address, size_t size, oslFileHandle *pHandle );
-
#if defined __cplusplus
}
#endif
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index 792345d..99fee40 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -780,10 +780,12 @@ static bool osl_file_queryLocking (sal_uInt32 uFlags)
return false;
}
-#ifdef UNX
+#if defined ANDROID
+
+namespace {
static oslFileError
-osl_openMemoryAsFile( void *address, size_t size, oslFileHandle *pHandle, const char *path )
+openMemoryAsFile( void *address, size_t size, oslFileHandle *pHandle, const char *path )
{
oslFileError eRet;
FileHandle_Impl * pImpl = new FileHandle_Impl (-1, FileHandle_Impl::KIND_MEM, path);
@@ -805,10 +807,6 @@ osl_openMemoryAsFile( void *address, size_t size, oslFileHandle *pHandle, const
return osl_File_E_None;
}
-oslFileError
-SAL_CALL osl_openMemoryAsFile( void *address, size_t size, oslFileHandle *pHandle )
-{
- return osl_openMemoryAsFile( address, size, pHandle, "<anon>" );
}
#endif
@@ -848,7 +846,7 @@ SAL_CALL osl_openFilePath( const char *cpFilePath, oslFileHandle* pHandle, sal_u
errno = ENOENT;
return osl_File_E_NOENT;
}
- return osl_openMemoryAsFile(address, size, pHandle, cpFilePath);
+ return openMemoryAsFile(address, size, pHandle, cpFilePath);
}
#endif
diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx
index a403d33..0a387e8 100644
--- a/sal/qa/osl/file/osl_File.cxx
+++ b/sal/qa/osl/file/osl_File.cxx
@@ -2942,38 +2942,9 @@ namespace osl_File
*pEOF &&
( 0 == strncmp( ( const char * )aSequence.getArray(), &pBuffer_Char[26], 26 ) ) );
}
-#ifdef UNX
- void readLine_android()
- {
- static const char buffer[] =
- "Hello\n\r\n\a\n"
- "Fun=Badness\n"
- "Some=Somethingelse\n\r";
- sal_Int32 aHash = rtl_str_hashCode( buffer );
- for (size_t i = 0; i < sizeof (buffer); i += 7)
- {
- oslFileHandle pFile( 0 );
- CPPUNIT_ASSERT( osl_openMemoryAsFile( (void *)buffer,
- sizeof( buffer ) - i, &pFile )
- == osl_File_E_None );
- for (;;)
- {
- sal_Sequence *pSequence( 0 );
- if (osl_readLine( pFile, &pSequence ) != osl_File_E_None)
- break;
- rtl_byte_sequence_release (pSequence);
- }
- CPPUNIT_ASSERT( osl_closeFile( pFile ) == osl_File_E_None );
- }
- CPPUNIT_ASSERT( aHash == rtl_str_hashCode( buffer ) );
- }
-#endif
CPPUNIT_TEST_SUITE( readLine );
CPPUNIT_TEST( readLine_001 );
CPPUNIT_TEST( readLine_002 );
-#ifdef UNX
- CPPUNIT_TEST( readLine_android );
-#endif
CPPUNIT_TEST_SUITE_END();
};// class readLine
diff --git a/sal/util/sal.map b/sal/util/sal.map
index 900d077..8380e7e 100644
--- a/sal/util/sal.map
+++ b/sal/util/sal.map
@@ -709,7 +709,6 @@ PRIVATE_textenc.1 { # LibreOffice 3.6
PRIVATE_file.1 { # LibreOffice 3.6
global:
osl_getFileOSHandle;
- osl_openMemoryAsFile;
};
# Unique libstdc++ symbols:
More information about the Libreoffice-commits
mailing list