diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/generic/print/printerjob.cxx | 53 | ||||
-rw-r--r-- | vcl/headless/svpdummies.cxx | 17 | ||||
-rw-r--r-- | vcl/headless/svpframe.cxx | 13 | ||||
-rw-r--r-- | vcl/headless/svpgdi.cxx | 2 | ||||
-rw-r--r-- | vcl/headless/svpprn.cxx | 4 |
5 files changed, 19 insertions, 70 deletions
diff --git a/vcl/generic/print/printerjob.cxx b/vcl/generic/print/printerjob.cxx index 5b3d8668082e..d8a5d7196ecf 100644 --- a/vcl/generic/print/printerjob.cxx +++ b/vcl/generic/print/printerjob.cxx @@ -34,7 +34,6 @@ #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> -#include <pwd.h> #include "psputil.hxx" #include "glyphset.hxx" @@ -49,8 +48,9 @@ #include "rtl/strbuf.hxx" #include "rtl/ustrbuf.hxx" -#include "osl/thread.h" -#include "sal/alloca.h" +#include <osl/thread.h> +#include <osl/security.hxx> +#include <sal/alloca.h> #include <sal/macros.h> #include <algorithm> @@ -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 osl functionality is inadequate */ void @@ -310,8 +272,6 @@ createSpoolDir () return rtl::OUString(); } -} // namespace psp - PrinterJob::~PrinterJob () { std::list< osl::File* >::iterator pPage; @@ -405,11 +365,12 @@ PrinterJob::StartJob ( WritePS (mpJobHeader, ")\n"); // For (user name) - sal_Char pUserName[64]; - if (getUserName(pUserName, sizeof(pUserName))) + osl::Security aSecurity; + rtl::OUString aUserName; + if( aSecurity.getUserName( aUserName ) ) { WritePS (mpJobHeader, "%%For: ("); - WritePS (mpJobHeader, pUserName); + WritePS (mpJobHeader, aUserName); WritePS (mpJobHeader, ")\n"); } diff --git a/vcl/headless/svpdummies.cxx b/vcl/headless/svpdummies.cxx index 272f06c7030a..32646b81276e 100644 --- a/vcl/headless/svpdummies.cxx +++ b/vcl/headless/svpdummies.cxx @@ -26,24 +26,17 @@ * ************************************************************************/ +#include <string.h> +#include <rtl/ustrbuf.hxx> #include "headless/svpdummies.hxx" #include "headless/svpinst.hxx" -#include <rtl/ustrbuf.hxx> // SalObject SvpSalObject::SvpSalObject() { - m_aSystemChildData.nSize = sizeof( SystemChildData ); - m_aSystemChildData.pDisplay = NULL; - m_aSystemChildData.aWindow = 0; - 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; + // fast and easy cross-platform wiping of the data + memset( (void *)&m_aSystemChildData, 0, sizeof( SystemChildData ) ); + m_aSystemChildData.nSize = sizeof( SystemChildData ); } SvpSalObject::~SvpSalObject() diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx index 8ff0e5ecf377..864dd2ccee60 100644 --- a/vcl/headless/svpframe.cxx +++ b/vcl/headless/svpframe.cxx @@ -26,6 +26,7 @@ * ************************************************************************/ +#include <string.h> #include "headless/svpframe.hxx" #include "headless/svpinst.hxx" #include "headless/svpgdi.hxx" @@ -51,17 +52,13 @@ SvpSalFrame::SvpSalFrame( SvpSalInstance* pInstance, m_nMaxWidth( 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.pDisplay = NULL; - m_aSystemChildData.aWindow = 0; +#if defined( UNX ) // FIXME: prolly redundant m_aSystemChildData.pSalFrame = this; - m_aSystemChildData.pWidget = NULL; - m_aSystemChildData.pVisual = NULL; m_aSystemChildData.nDepth = 24; - m_aSystemChildData.aColormap = 0; - m_aSystemChildData.pAppContext = NULL; - m_aSystemChildData.aShellWindow = 0; - m_aSystemChildData.pShellWidget = NULL; +#endif if( m_pParent ) m_pParent->m_aChildren.push_back( this ); diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index c415774d1bb5..8912acc4b878 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -228,7 +228,9 @@ SvpSalGraphics::ClipUndoHandle SvpSalGraphics::ensureClipFor( const basegfx::B2I if( nHit == 0 ) { // degenerate case - we're all clipped ... hmm. +#if defined( UNX ) fprintf (stderr, "FIXME: denegerate case detected ...\n"); +#endif } else if( nHit == 1 ) { diff --git a/vcl/headless/svpprn.cxx b/vcl/headless/svpprn.cxx index 452f8ab2f940..ded175afea94 100644 --- a/vcl/headless/svpprn.cxx +++ b/vcl/headless/svpprn.cxx @@ -29,10 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" -#include <unistd.h> -#include <sys/stat.h> -#include <sys/wait.h> - #include "vcl/svapp.hxx" #include "vcl/timer.hxx" #include "vcl/printerinfomanager.hxx" |