vcl: Remove the dead fd-hack
Drop the exterals patches as VCL internals don’t support this anymore, and drop the LOK addfont change as it wouldn’t work now. I don’t know if LOK addfont has any use now, but I left it. Change-Id: I2798679d0bb59bb6c2c6e0eae329287f36662223 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208546 Reviewed-by: Khaled Hosny <khaled@libreoffice.org> Tested-by: Jenkins
This commit is contained in:
committed by
Khaled Hosny
parent
0de061bff6
commit
a1b5f5cedd
@@ -5216,22 +5216,10 @@ static void lo_setOption(LibreOfficeKit* /*pThis*/, const char *pOption, const c
|
||||
#ifdef LINUX
|
||||
else if (strcmp(pOption, "addfont") == 0)
|
||||
{
|
||||
if (memcmp(pValue, "file://", 7) == 0)
|
||||
pValue += 7;
|
||||
|
||||
int fd = open(pValue, O_RDONLY);
|
||||
if (fd == -1)
|
||||
{
|
||||
std::cerr << "Could not open font file '" << pValue << "': " << strerror(errno) << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
OUString sMagicFileName = "file:///:FD:/" + OUString::number(fd);
|
||||
|
||||
SolarMutexGuard aGuard;
|
||||
OutputDevice *pDevice = Application::GetDefaultDevice();
|
||||
OutputDevice::ImplClearAllFontData(true);
|
||||
pDevice->AddTempDevFont(sMagicFileName, u""_ustr);
|
||||
pDevice->AddTempDevFont(OUString::fromUtf8(pValue), u""_ustr);
|
||||
OutputDevice::ImplRefreshAllFontData(true);
|
||||
}
|
||||
#endif
|
||||
|
||||
-1
@@ -25,7 +25,6 @@ endif
|
||||
$(eval $(call gb_UnpackedTarball_add_patches,cairo,\
|
||||
external/cairo/cairo/cairo.RGB24_888.patch \
|
||||
external/cairo/cairo/san.patch.0 \
|
||||
external/cairo/cairo/cairo-fd-hack.patch.0 \
|
||||
external/cairo/cairo/cairo.ofz57493-Timeout.patch.1 \
|
||||
external/cairo/cairo/shm-null-deref.patch.1 \
|
||||
external/cairo/cairo/avoid-negative-left-shift.patch.1 \
|
||||
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
# -*- Mode: Diff -*-
|
||||
--- src/cairo-ft-font.c
|
||||
+++ src/cairo-ft-font.c
|
||||
@@ -737,7 +737,10 @@
|
||||
if (ret == FcResultOutOfMemory)
|
||||
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
if (ret == FcResultMatch) {
|
||||
- if (access (filename, R_OK) == 0) {
|
||||
+ int nFD = -1;
|
||||
+ int n;
|
||||
+ if ((sscanf (filename, "/:FD:/%d%n", &nFD, &n) == 1 && filename[n] == '\0') ||
|
||||
+ access (filename, R_OK) == 0) {
|
||||
/* If FC_INDEX is not set, we just use 0 */
|
||||
ret = FcPatternGetInteger (pattern, FC_INDEX, 0, &id);
|
||||
if (ret == FcResultOutOfMemory)
|
||||
@@ -14,7 +14,6 @@ $(eval $(call gb_UnpackedTarball_set_tarball,freetype,$(FREETYPE_TARBALL),,freet
|
||||
$(eval $(call gb_UnpackedTarball_add_patches,freetype,\
|
||||
external/freetype/freetype-2.6.5.patch.1 \
|
||||
external/freetype/ubsan.patch \
|
||||
external/freetype/freetype-fd-hack.patch.0 \
|
||||
external/freetype/windows.patch \
|
||||
))
|
||||
|
||||
|
||||
-60
@@ -1,60 +0,0 @@
|
||||
# -*- Mode: Diff -*-
|
||||
--- src/base/ftsystem.c
|
||||
+++ src/base/ftsystem.c
|
||||
@@ -24,6 +24,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
+#include <unistd.h>
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_CONFIG_CONFIG_H
|
||||
@@ -238,6 +239,8 @@
|
||||
const char* filepathname )
|
||||
{
|
||||
FT_FILE* file;
|
||||
+ int nFD;
|
||||
+ int n;
|
||||
|
||||
|
||||
if ( !stream )
|
||||
@@ -250,7 +253,13 @@
|
||||
stream->read = NULL;
|
||||
stream->close = NULL;
|
||||
|
||||
- file = ft_fopen( filepathname, "rb" );
|
||||
+ if ( sscanf( filepathname, "/:FD:/%d%n", &nFD, &n ) == 1 && filepathname[n] == '\0')
|
||||
+ {
|
||||
+ lseek( nFD, 0, SEEK_SET );
|
||||
+ file = fdopen( dup( nFD ), "rb" );
|
||||
+ }
|
||||
+ else
|
||||
+ file = ft_fopen( filepathname, "rb" );
|
||||
if ( !file )
|
||||
{
|
||||
FT_ERROR(( "FT_Stream_Open:"
|
||||
--- builds/unix/ftsystem.c
|
||||
+++ builds/unix/ftsystem.c
|
||||
@@ -249,13 +249,21 @@
|
||||
{
|
||||
int file;
|
||||
struct stat stat_buf;
|
||||
+ int nFD;
|
||||
+ int n;
|
||||
|
||||
|
||||
if ( !stream )
|
||||
return FT_THROW( Invalid_Stream_Handle );
|
||||
|
||||
/* open the file */
|
||||
- file = open( filepathname, O_RDONLY );
|
||||
+ if ( sscanf( filepathname, "/:FD:/%d%n", &nFD, &n ) == 1 && filepathname[n] == '\0')
|
||||
+ {
|
||||
+ lseek( nFD, 0, SEEK_SET );
|
||||
+ file = dup( nFD );
|
||||
+ }
|
||||
+ else
|
||||
+ file = open( filepathname, O_RDONLY );
|
||||
if ( file < 0 )
|
||||
{
|
||||
FT_ERROR(( "FT_Stream_Open:" ));
|
||||
Reference in New Issue
Block a user