Kaydet (Commit) 987651a7 authored tarafından Michael Meeks's avatar Michael Meeks

misc cross-platform dependency / build issue redux

üst d6a013d8
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <pwd.h>
#include "psputil.hxx" #include "psputil.hxx"
#include "glyphset.hxx" #include "glyphset.hxx"
...@@ -49,8 +48,9 @@ ...@@ -49,8 +48,9 @@
#include "rtl/strbuf.hxx" #include "rtl/strbuf.hxx"
#include "rtl/ustrbuf.hxx" #include "rtl/ustrbuf.hxx"
#include "osl/thread.h" #include <osl/thread.h>
#include "sal/alloca.h" #include <osl/security.hxx>
#include <sal/alloca.h>
#include <sal/macros.h> #include <sal/macros.h>
#include <algorithm> #include <algorithm>
...@@ -215,44 +215,6 @@ PrinterJob::PrinterJob () : ...@@ -215,44 +215,6 @@ PrinterJob::PrinterJob () :
{ {
} }
namespace psp
{
/* return the username in the given buffer */
sal_Bool
getUserName (char* pName, int nSize)
{
struct passwd *pPWEntry;
struct passwd aPWEntry;
sal_Char pPWBuffer[256];
sal_Bool bSuccess = sal_False;
#ifdef FREEBSD
pPWEntry = getpwuid( getuid());
#else
if (getpwuid_r(getuid(), &aPWEntry, pPWBuffer, sizeof(pPWBuffer), &pPWEntry) != 0)
pPWEntry = NULL;
#endif
if (pPWEntry != NULL && pPWEntry->pw_name != NULL)
{
sal_Int32 nLen = strlen(pPWEntry->pw_name);
if (nLen > 0 && nLen < nSize)
{
memcpy (pName, pPWEntry->pw_name, nLen);
pName[nLen] = '\0';
bSuccess = sal_True;
}
}
// wipe the passwd off the stack
memset (pPWBuffer, 0, sizeof(pPWBuffer));
return bSuccess;
}
/* remove all our temporary files, uses external program "rm", since /* remove all our temporary files, uses external program "rm", since
osl functionality is inadequate */ osl functionality is inadequate */
void void
...@@ -310,8 +272,6 @@ createSpoolDir () ...@@ -310,8 +272,6 @@ createSpoolDir ()
return rtl::OUString(); return rtl::OUString();
} }
} // namespace psp
PrinterJob::~PrinterJob () PrinterJob::~PrinterJob ()
{ {
std::list< osl::File* >::iterator pPage; std::list< osl::File* >::iterator pPage;
...@@ -405,11 +365,12 @@ PrinterJob::StartJob ( ...@@ -405,11 +365,12 @@ PrinterJob::StartJob (
WritePS (mpJobHeader, ")\n"); WritePS (mpJobHeader, ")\n");
// For (user name) // For (user name)
sal_Char pUserName[64]; osl::Security aSecurity;
if (getUserName(pUserName, sizeof(pUserName))) rtl::OUString aUserName;
if( aSecurity.getUserName( aUserName ) )
{ {
WritePS (mpJobHeader, "%%For: ("); WritePS (mpJobHeader, "%%For: (");
WritePS (mpJobHeader, pUserName); WritePS (mpJobHeader, aUserName);
WritePS (mpJobHeader, ")\n"); WritePS (mpJobHeader, ")\n");
} }
......
...@@ -26,24 +26,17 @@ ...@@ -26,24 +26,17 @@
* *
************************************************************************/ ************************************************************************/
#include <string.h>
#include <rtl/ustrbuf.hxx>
#include "headless/svpdummies.hxx" #include "headless/svpdummies.hxx"
#include "headless/svpinst.hxx" #include "headless/svpinst.hxx"
#include <rtl/ustrbuf.hxx>
// SalObject // SalObject
SvpSalObject::SvpSalObject() SvpSalObject::SvpSalObject()
{ {
m_aSystemChildData.nSize = sizeof( SystemChildData ); // fast and easy cross-platform wiping of the data
m_aSystemChildData.pDisplay = NULL; memset( (void *)&m_aSystemChildData, 0, sizeof( SystemChildData ) );
m_aSystemChildData.aWindow = 0; m_aSystemChildData.nSize = sizeof( SystemChildData );
m_aSystemChildData.pSalFrame = 0;
m_aSystemChildData.pWidget = 0;
m_aSystemChildData.pVisual = 0;
m_aSystemChildData.nDepth = 0;
m_aSystemChildData.aColormap = 0;
m_aSystemChildData.pAppContext = NULL;
m_aSystemChildData.aShellWindow = 0;
m_aSystemChildData.pShellWidget = NULL;
} }
SvpSalObject::~SvpSalObject() SvpSalObject::~SvpSalObject()
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
* *
************************************************************************/ ************************************************************************/
#include <string.h>
#include "headless/svpframe.hxx" #include "headless/svpframe.hxx"
#include "headless/svpinst.hxx" #include "headless/svpinst.hxx"
#include "headless/svpgdi.hxx" #include "headless/svpgdi.hxx"
...@@ -51,17 +52,13 @@ SvpSalFrame::SvpSalFrame( SvpSalInstance* pInstance, ...@@ -51,17 +52,13 @@ SvpSalFrame::SvpSalFrame( SvpSalInstance* pInstance,
m_nMaxWidth( 0 ), m_nMaxWidth( 0 ),
m_nMaxHeight( 0 ) m_nMaxHeight( 0 )
{ {
// fast and easy cross-platform wiping of the data
memset( (void *)&m_aSystemChildData, 0, sizeof( SystemChildData ) );
m_aSystemChildData.nSize = sizeof( SystemChildData ); m_aSystemChildData.nSize = sizeof( SystemChildData );
m_aSystemChildData.pDisplay = NULL; #if defined( UNX ) // FIXME: prolly redundant
m_aSystemChildData.aWindow = 0;
m_aSystemChildData.pSalFrame = this; m_aSystemChildData.pSalFrame = this;
m_aSystemChildData.pWidget = NULL;
m_aSystemChildData.pVisual = NULL;
m_aSystemChildData.nDepth = 24; m_aSystemChildData.nDepth = 24;
m_aSystemChildData.aColormap = 0; #endif
m_aSystemChildData.pAppContext = NULL;
m_aSystemChildData.aShellWindow = 0;
m_aSystemChildData.pShellWidget = NULL;
if( m_pParent ) if( m_pParent )
m_pParent->m_aChildren.push_back( this ); m_pParent->m_aChildren.push_back( this );
......
...@@ -228,7 +228,9 @@ SvpSalGraphics::ClipUndoHandle SvpSalGraphics::ensureClipFor( const basegfx::B2I ...@@ -228,7 +228,9 @@ SvpSalGraphics::ClipUndoHandle SvpSalGraphics::ensureClipFor( const basegfx::B2I
if( nHit == 0 ) if( nHit == 0 )
{ {
// degenerate case - we're all clipped ... hmm. // degenerate case - we're all clipped ... hmm.
#if defined( UNX )
fprintf (stderr, "FIXME: denegerate case detected ...\n"); fprintf (stderr, "FIXME: denegerate case detected ...\n");
#endif
} }
else if( nHit == 1 ) else if( nHit == 1 )
{ {
......
...@@ -29,10 +29,6 @@ ...@@ -29,10 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove // MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx" #include "precompiled_vcl.hxx"
#include <unistd.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include "vcl/svapp.hxx" #include "vcl/svapp.hxx"
#include "vcl/timer.hxx" #include "vcl/timer.hxx"
#include "vcl/printerinfomanager.hxx" #include "vcl/printerinfomanager.hxx"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment