summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2016-11-23 21:15:36 +0200
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2017-12-18 01:08:11 -0500
commit163eecd34bed31e07f284b0a37b3dcb4aa5a5458 (patch)
tree9ce717f0f6fc9347a9164a9b6d726f42339dc358 /vcl/unx
parent752d3cbe009bc0f87c5b694ee9d0c8589d835287 (diff)
This code is only ever compiled on Unix
Remove what seems like incomplete attempt to make it cross platform. Change-Id: I551fa091a3143925a15fced1de44f7f45929b21e Reviewed-on: https://gerrit.libreoffice.org/31131 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org> (cherry picked from commit b49611a7cde3607446ad224ff2824c722b17e204) (cherry picked from commit 96ca05ba383b3789209b86b4c71af6df76b139df)
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/generic/print/genprnpsp.cxx17
-rw-r--r--vcl/unx/generic/print/genpspgraphics.cxx28
-rw-r--r--vcl/unx/generic/print/glyphset.cxx6
3 files changed, 3 insertions, 48 deletions
diff --git a/vcl/unx/generic/print/genprnpsp.cxx b/vcl/unx/generic/print/genprnpsp.cxx
index 3d7ad0ae5eb1..1dbc04e739ec 100644
--- a/vcl/unx/generic/print/genprnpsp.cxx
+++ b/vcl/unx/generic/print/genprnpsp.cxx
@@ -30,11 +30,9 @@
*/
// For spawning PDF and FAX generation
-#if defined( UNX )
-# include <unistd.h>
-# include <sys/wait.h>
-# include <sys/stat.h>
-#endif
+#include <unistd.h>
+#include <sys/wait.h>
+#include <sys/stat.h>
#include <comphelper/fileurl.hxx>
#include "rtl/ustring.hxx"
@@ -253,7 +251,6 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
}
// Needs a cleaner abstraction ...
-#if defined( UNX )
static bool passFileToCommandLine( const OUString& rFilename, const OUString& rCommandLine )
{
bool bSuccess = false;
@@ -337,7 +334,6 @@ static bool passFileToCommandLine( const OUString& rFilename, const OUString& rC
return bSuccess;
}
-#endif
static std::vector<OUString> getFaxNumbers()
{
@@ -360,15 +356,10 @@ static std::vector<OUString> getFaxNumbers()
static bool createPdf( const OUString& rToFile, const OUString& rFromFile, const OUString& rCommandLine )
{
-#if defined( UNX )
OUString aCommandLine(
rCommandLine.replaceAll("(OUTFILE)", rToFile));
return passFileToCommandLine( rFromFile, aCommandLine );
-#else
- (void)rToFile; (void)rFromFile; (void)rCommandLine;
- return false;
-#endif
}
/*
@@ -904,7 +895,6 @@ bool PspSalPrinter::StartJob(
}
int nMode = 0;
-#if defined( UNX )
// check whether this printer is configured as fax
sal_Int32 nIndex = 0;
const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) );
@@ -928,7 +918,6 @@ bool PspSalPrinter::StartJob(
break;
}
}
-#endif
m_aPrinterGfx.Init( m_aJobData );
return m_aPrintJob.StartJob( ! m_aTmpFile.isEmpty() ? m_aTmpFile : m_aFileName, nMode, rJobName, rAppName, m_aJobData, &m_aPrinterGfx, bDirect );
diff --git a/vcl/unx/generic/print/genpspgraphics.cxx b/vcl/unx/generic/print/genpspgraphics.cxx
index d95209a1b1d9..182faa0f9654 100644
--- a/vcl/unx/generic/print/genpspgraphics.cxx
+++ b/vcl/unx/generic/print/genpspgraphics.cxx
@@ -23,14 +23,11 @@
#include <sal/types.h>
-// for mmap etc.
-#if defined( UNX )
#include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
-#endif
#include <comphelper/string.hxx>
#include <i18nlangtag/mslangid.hxx>
@@ -1311,13 +1308,8 @@ bool GenPspGraphics::supportsOperation( OutDevSupportType ) const
void GenPspGraphics::DoFreeEmbedFontData( const void* pData, long nLen )
{
-#if defined( UNX )
if( pData )
munmap( const_cast<void *>(pData), nLen );
-#else
- (void)nLen;
- rtl_freeMemory( (void *)pData );
-#endif
}
const void* GenPspGraphics::DoGetEmbedFontData( psp::fontID aFont, const sal_Ucs* pUnicodes, sal_Int32* pWidths, size_t nLen, FontSubsetInfo& rInfo, long* pDataLen )
@@ -1350,7 +1342,6 @@ const void* GenPspGraphics::DoGetEmbedFontData( psp::fontID aFont, const sal_Ucs
OString aSysPath = rMgr.getFontFileSysPath( aFont );
-#if defined( UNX )
int fd = open( aSysPath.getStr(), O_RDONLY );
if( fd < 0 )
return nullptr;
@@ -1365,25 +1356,6 @@ const void* GenPspGraphics::DoGetEmbedFontData( psp::fontID aFont, const sal_Ucs
if( pFile == MAP_FAILED )
return nullptr;
*pDataLen = aStat.st_size;
-#else
- // FIXME: test me ! ...
- OUString aURL;
- if( osl::File::getFileURLFromSystemPath( OStringToOUString( aSysPath, osl_getThreadTextEncoding() ), aURL ) != osl::File::E_None )
- return NULL;
- osl::File aFile( aURL );
- if( aFile.open( osl_File_OpenFlag_Read | osl_File_OpenFlag_NoLock ) != osl::File::E_None )
- return NULL;
-
- osl::DirectoryItem aItem;
- osl::DirectoryItem::get( aURL, aItem );
- osl::FileStatus aFileStatus( osl_FileStatus_Mask_FileSize );
- aItem.getFileStatus( aFileStatus );
-
- void *pFile = rtl_allocateMemory( aFileStatus.getFileSize() );
- sal_uInt64 nRead = 0;
- aFile.read( pFile, aFileStatus.getFileSize(), nRead );
- *pDataLen = (long) nRead;
-#endif
rInfo.m_aFontBBox = Rectangle( Point( xMin, yMin ), Size( xMax-xMin, yMax-yMin ) );
rInfo.m_nCapHeight = yMax; // Well ...
diff --git a/vcl/unx/generic/print/glyphset.cxx b/vcl/unx/generic/print/glyphset.cxx
index 65079bf2558f..56decb714ce9 100644
--- a/vcl/unx/generic/print/glyphset.cxx
+++ b/vcl/unx/generic/print/glyphset.cxx
@@ -726,7 +726,6 @@ GlyphSet::PSUploadFont (osl::File& rOutFile, PrinterGfx &rGfx, bool bAllowType42
if (meBaseType != fonttype::TrueType)
return;
-#if defined( UNX )
TrueTypeFont *pTTFont;
OString aTTFileName (rGfx.GetFontMgr().getFontFileSysPath(mnFontID));
int nFace = rGfx.GetFontMgr().getFontFaceNumber(mnFontID);
@@ -827,11 +826,6 @@ GlyphSet::PSUploadFont (osl::File& rOutFile, PrinterGfx &rGfx, bool bAllowType42
// cleanup
CloseTTFont (pTTFont);
fclose (pTmpFile);
-
-#else
- (void)rOutFile; (void)rGfx; (void)bAllowType42; (void)rSuppliedFonts;
-# warning FIXME: Missing OpenTTFontFile outside of Unix ...
-#endif
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */