incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject svn commit: r1333457 - in /incubator/ooo/trunk/main/vcl: unx/generic/app/ unx/generic/desktopdetect/ unx/generic/fontmanager/ unx/generic/gdi/ unx/generic/printer/ win/source/gdi/ win/source/window/
Date Thu, 03 May 2012 13:45:20 GMT
Author: hdu
Date: Thu May  3 13:45:19 2012
New Revision: 1333457

URL: http://svn.apache.org/viewvc?rev=1333457&view=rev
Log:
use ascii convenience methods for dynamic loading

Modified:
    incubator/ooo/trunk/main/vcl/unx/generic/app/randrwrapper.cxx
    incubator/ooo/trunk/main/vcl/unx/generic/desktopdetect/desktopdetector.cxx
    incubator/ooo/trunk/main/vcl/unx/generic/fontmanager/fontconfig.cxx
    incubator/ooo/trunk/main/vcl/unx/generic/gdi/salgdi3.cxx
    incubator/ooo/trunk/main/vcl/unx/generic/gdi/salprnpsp.cxx
    incubator/ooo/trunk/main/vcl/unx/generic/gdi/xrender_peer.cxx
    incubator/ooo/trunk/main/vcl/unx/generic/printer/cupsmgr.cxx
    incubator/ooo/trunk/main/vcl/win/source/gdi/salnativewidgets-luna.cxx
    incubator/ooo/trunk/main/vcl/win/source/gdi/salprn.cxx
    incubator/ooo/trunk/main/vcl/win/source/gdi/winlayout.cxx
    incubator/ooo/trunk/main/vcl/win/source/window/salframe.cxx

Modified: incubator/ooo/trunk/main/vcl/unx/generic/app/randrwrapper.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/unx/generic/app/randrwrapper.cxx?rev=1333457&r1=1333456&r2=1333457&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/unx/generic/app/randrwrapper.cxx (original)
+++ incubator/ooo/trunk/main/vcl/unx/generic/app/randrwrapper.cxx Thu May  3 13:45:19 2012
@@ -152,14 +152,13 @@ RandRWrapper::RandRWrapper( Display* pDi
     initFromModule();
     if( ! m_bValid )
     {
-        rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( "libXrandr.so.2" ) );
         // load and resolve dependencies immediately
         // rationale: there are older distributions where libXrandr.so.2 is not linked
         // with libXext.so, resulting in a missing symbol and terminating the office
         // obviously they expected libXext to be linked in global symbolspace (that is
         // linked by the application), which is not the case with us (because we want
         // to be able to run in headless mode even without an installed X11 library)
-        m_pRandRLib = osl_loadModule( aLibName.pData, SAL_LOADMODULE_DEFAULT | SAL_LOADMODULE_NOW
);
+        m_pRandRLib = osl_loadAsciiModule( "libXrandr.so.2", SAL_LOADMODULE_DEFAULT | SAL_LOADMODULE_NOW
);
         initFromModule();
     }
     if( m_bValid )

Modified: incubator/ooo/trunk/main/vcl/unx/generic/desktopdetect/desktopdetector.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/unx/generic/desktopdetect/desktopdetector.cxx?rev=1333457&r1=1333456&r2=1333457&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/unx/generic/desktopdetect/desktopdetector.cxx (original)
+++ incubator/ooo/trunk/main/vcl/unx/generic/desktopdetect/desktopdetector.cxx Thu May  3
13:45:19 2012
@@ -235,8 +235,7 @@ static bool is_cde_desktop( Display* pDi
     void* pLibrary = NULL;
 
     Atom nDtAtom = XInternAtom( pDisplay, "_DT_WM_READY", True );
-    OUString aPathName( RTL_CONSTASCII_USTRINGPARAM( "file:///usr/dt/lib/libDtSvc.so" ) );
-    if( nDtAtom && ( pLibrary = osl_loadModule( aPathName.pData, SAL_LOADMODULE_DEFAULT
) ) )
+    if( nDtAtom && ( pLibrary = osl_loadAsciiModule( "file:///usr/dt/lib/libDtSvc.so",
SAL_LOADMODULE_DEFAULT ) ) )
     {
         osl_unloadModule( (oslModule)pLibrary );
         return true;

Modified: incubator/ooo/trunk/main/vcl/unx/generic/fontmanager/fontconfig.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/unx/generic/fontmanager/fontconfig.cxx?rev=1333457&r1=1333456&r2=1333457&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/unx/generic/fontmanager/fontconfig.cxx (original)
+++ incubator/ooo/trunk/main/vcl/unx/generic/fontmanager/fontconfig.cxx Thu May  3 13:45:19
2012
@@ -274,13 +274,9 @@ FontCfgWrapper::FontCfgWrapper()
           m_pOutlineSet( NULL ),
           m_nFcVersion( 0 )
 {
-    OUString aLib( RTL_CONSTASCII_USTRINGPARAM( "libfontconfig.so.1" ) );
-    m_pLib = osl_loadModule( aLib.pData, SAL_LOADMODULE_LAZY );
+    m_pLib = osl_loadAsciiModule( "libfontconfig.so.1", SAL_LOADMODULE_LAZY );
     if( !m_pLib )
-    {
-        aLib = OUString( RTL_CONSTASCII_USTRINGPARAM( "libfontconfig.so" ) );
-        m_pLib = osl_loadModule( aLib.pData, SAL_LOADMODULE_LAZY );
-    }
+        m_pLib = osl_loadAsciiModule( "libfontconfig.so", SAL_LOADMODULE_LAZY );
 
     if( ! m_pLib )
     {

Modified: incubator/ooo/trunk/main/vcl/unx/generic/gdi/salgdi3.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/unx/generic/gdi/salgdi3.cxx?rev=1333457&r1=1333456&r2=1333457&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/unx/generic/gdi/salgdi3.cxx (original)
+++ incubator/ooo/trunk/main/vcl/unx/generic/gdi/salgdi3.cxx Thu May  3 13:45:19 2012
@@ -346,8 +346,7 @@ CairoWrapper::CairoWrapper()
     if( !XQueryExtension( GetX11SalData()->GetDisplay()->GetDisplay(), "RENDER", &nDummy,
&nDummy, &nDummy ) )
         return;
 
-    OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( "libcairo.so.2" ));
-    mpCairoLib = osl_loadModule( aLibName.pData, SAL_LOADMODULE_DEFAULT );
+    mpCairoLib = osl_loadAsciiModule( "libcairo.so.2", SAL_LOADMODULE_DEFAULT );
     if( !mpCairoLib )
         return;
 

Modified: incubator/ooo/trunk/main/vcl/unx/generic/gdi/salprnpsp.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/unx/generic/gdi/salprnpsp.cxx?rev=1333457&r1=1333456&r2=1333457&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/unx/generic/gdi/salprnpsp.cxx (original)
+++ incubator/ooo/trunk/main/vcl/unx/generic/gdi/salprnpsp.cxx Thu May  3 13:45:19 2012
@@ -101,8 +101,7 @@ static void getPaLib()
 {
 	if( ! driverLib )
 	{
-        OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( _XSALSET_LIBNAME ) );
-        driverLib	= osl_loadModuleRelative( (oslGenericFunction)getPaLib, aLibName.pData,
SAL_LOADMODULE_DEFAULT );
+        driverLib	= osl_loadAsciiModuleRelative( (oslGenericFunction)getPaLib, _XSALSET_LIBNAME,
SAL_LOADMODULE_DEFAULT );
         if ( !driverLib )
         {
             return;

Modified: incubator/ooo/trunk/main/vcl/unx/generic/gdi/xrender_peer.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/unx/generic/gdi/xrender_peer.cxx?rev=1333457&r1=1333456&r2=1333457&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/unx/generic/gdi/xrender_peer.cxx (original)
+++ incubator/ooo/trunk/main/vcl/unx/generic/gdi/xrender_peer.cxx Thu May  3 13:45:19 2012
@@ -79,13 +79,12 @@ void XRenderPeer::InitRenderLib()
     // we don't know if we are running on a system with xrender library
     // we don't want to install system libraries ourselves
     // => load them dynamically when they are there
-    const OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( "libXrender.so.1" ));
-    mpRenderLib = osl_loadModule( aLibName.pData, SAL_LOADMODULE_DEFAULT );
+    static const char aLibName[] = "libXrender.so.1";
+    mpRenderLib = osl_loadAsciiModule( aLibName, SAL_LOADMODULE_DEFAULT );
     if( !mpRenderLib ) {
 #ifdef DEBUG
         fprintf( stderr, "Display can do XRender, but no %s installed.\n"
-            "Please install for improved display performance\n", OUStringToOString( aLibName.getStr(),

-                                                                                    osl_getThreadTextEncoding()
).getStr() );
+            "Please install for improved display performance\n", aLibName );
 #endif
         return;
     }

Modified: incubator/ooo/trunk/main/vcl/unx/generic/printer/cupsmgr.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/unx/generic/printer/cupsmgr.cxx?rev=1333457&r1=1333456&r2=1333457&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/unx/generic/printer/cupsmgr.cxx (original)
+++ incubator/ooo/trunk/main/vcl/unx/generic/printer/cupsmgr.cxx Thu May  3 13:45:19 2012
@@ -155,13 +155,9 @@ CUPSWrapper::CUPSWrapper() 
           m_bPPDThreadRunning( false )
 {
 #ifdef ENABLE_CUPS
-    OUString aLib( RTL_CONSTASCII_USTRINGPARAM( CUPS_LIB_NAME ) );
-    m_pLib = osl_loadModule( aLib.pData, SAL_LOADMODULE_LAZY );
+    m_pLib = osl_loadAsciiModule( CUPS_LIB_NAME, SAL_LOADMODULE_LAZY );
     if( ! m_pLib )
-    {
-        aLib = OUString( RTL_CONSTASCII_USTRINGPARAM( SAL_MODULENAME( "cups" ) ) );
-        m_pLib = osl_loadModule( aLib.pData, SAL_LOADMODULE_LAZY );
-    }
+        m_pLib = osl_loadAsciiModule( "cups", SAL_LOADMODULE_LAZY );
 #endif
 
     if( ! m_pLib )
@@ -1136,13 +1132,11 @@ const char* CUPSManager::authenticateUse
     const char* pRet = NULL;
 
 #ifdef ENABLE_CUPS
-    OUString aLib = OUString::createFromAscii( _XSALSET_LIBNAME );
-    oslModule pLib = osl_loadModule( aLib.pData, SAL_LOADMODULE_LAZY );
+    oslModule pLib = osl_loadAsciiModule( _XSALSET_LIBNAME, SAL_LOADMODULE_LAZY );
     if( pLib )
     {
-        OUString aSym( RTL_CONSTASCII_USTRINGPARAM( "Sal_authenticateQuery" ) );
         bool (*getpw)( const OString& rServer, OString& rUser, OString& rPw)
=
-            (bool(*)(const OString&,OString&,OString&))osl_getFunctionSymbol(
pLib, aSym.pData );
+            (bool(*)(const OString&,OString&,OString&))osl_getAsciiFunctionSymbol(
pLib, "Sal_authenticateQuery" );
         if( getpw )
         {
             osl::MutexGuard aGuard( m_aCUPSMutex );
@@ -1161,7 +1155,7 @@ const char* CUPSManager::authenticateUse
         osl_unloadModule( pLib );
     }
 #if OSL_DEBUG_LEVEL > 1
-    else fprintf( stderr, "loading of module %s failed\n", OUStringToOString( aLib, osl_getThreadTextEncoding()
).getStr() );
+    else fprintf( stderr, "loading of module %s failed\n", _XSALSET_LIBNAME );
 #endif
 #endif // ENABLE_CUPS
 

Modified: incubator/ooo/trunk/main/vcl/win/source/gdi/salnativewidgets-luna.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/win/source/gdi/salnativewidgets-luna.cxx?rev=1333457&r1=1333456&r2=1333457&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/win/source/gdi/salnativewidgets-luna.cxx (original)
+++ incubator/ooo/trunk/main/vcl/win/source/gdi/salnativewidgets-luna.cxx Thu May  3 13:45:19
2012
@@ -90,8 +90,7 @@ static VisualStylesAPI vsAPI;
 
 VisualStylesAPI::VisualStylesAPI()
 {
-    OUString aLibraryName( RTL_CONSTASCII_USTRINGPARAM( "uxtheme.dll" ) );
-    mhModule = osl_loadModule( aLibraryName.pData, SAL_LOADMODULE_DEFAULT );
+    mhModule = osl_loadAsciiModule( "uxtheme.dll", SAL_LOADMODULE_DEFAULT );
 
     if ( mhModule )
     {

Modified: incubator/ooo/trunk/main/vcl/win/source/gdi/salprn.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/win/source/gdi/salprn.cxx?rev=1333457&r1=1333456&r2=1333457&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/win/source/gdi/salprn.cxx (original)
+++ incubator/ooo/trunk/main/vcl/win/source/gdi/salprn.cxx Thu May  3 13:45:19 2012
@@ -451,14 +451,10 @@ XubString WinSalInstance::GetDefaultPrin
         // check for W2k and XP
         if( aSalShlData.maVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT && aSalShlData.maVersionInfo.dwMajorVersion
>= 5 )
         {
-            OUString aLibraryName( RTL_CONSTASCII_USTRINGPARAM( "winspool.drv" ) );
-            oslModule pLib = osl_loadModule( aLibraryName.pData, SAL_LOADMODULE_DEFAULT );
+            oslModule pLib = osl_loadAsciiModule( "winspool.drv", SAL_LOADMODULE_DEFAULT
);
             oslGenericFunction pFunc = NULL;
             if( pLib )
-            {
-                OUString queryFuncName( RTL_CONSTASCII_USTRINGPARAM( "GetDefaultPrinterW"
) );
-                pFunc = osl_getFunctionSymbol( pLib, queryFuncName.pData );
-            }
+                pFunc = osl_getAsciiFunctionSymbol( pLib, "GetDefaultPrinterW" );
 
             pGetDefaultPrinter = (sal_Bool(WINAPI*)(LPWSTR,LPDWORD)) pFunc;
         }

Modified: incubator/ooo/trunk/main/vcl/win/source/gdi/winlayout.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/win/source/gdi/winlayout.cxx?rev=1333457&r1=1333456&r2=1333457&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/win/source/gdi/winlayout.cxx (original)
+++ incubator/ooo/trunk/main/vcl/win/source/gdi/winlayout.cxx Thu May  3 13:45:19 2012
@@ -1132,8 +1132,7 @@ static bool bManualCellAlign = true;
 
 static bool InitUSP()
 {
-    OUString aLibraryName( RTL_CONSTASCII_USTRINGPARAM( "usp10" ) );
-    aUspModule = osl_loadModule( aLibraryName.pData, SAL_LOADMODULE_DEFAULT );
+    aUspModule = osl_loadAsciiModule( "usp10", SAL_LOADMODULE_DEFAULT );
     if( !aUspModule )
         return (bUspEnabled = false);
 

Modified: incubator/ooo/trunk/main/vcl/win/source/window/salframe.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/win/source/window/salframe.cxx?rev=1333457&r1=1333456&r2=1333457&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/win/source/window/salframe.cxx (original)
+++ incubator/ooo/trunk/main/vcl/win/source/window/salframe.cxx Thu May  3 13:45:19 2012
@@ -364,8 +364,7 @@ SalFrame* ImplSalCreateFrame( WinSalInst
         // check for W2k and XP
         if ( aSalShlData.maVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT && aSalShlData.maVersionInfo.dwMajorVersion
>= 5 )
         {
-            OUString aLibraryName( RTL_CONSTASCII_USTRINGPARAM( "user32" ) );
-            oslModule pLib = osl_loadModule( aLibraryName.pData, SAL_LOADMODULE_DEFAULT );
+            oslModule pLib = osl_loadAsciiModule( "user32", SAL_LOADMODULE_DEFAULT );
             oslGenericFunction pFunc = NULL;
             if( pLib )
                 pFunc = osl_getAsciiFunctionSymbol( pLib, "SetLayeredWindowAttributes" );
@@ -2123,8 +2122,7 @@ void WinSalFrame::StartPresentation( sal
 
                 if ( !aOS.nErrCode )
                 {
-                    OUString aLibraryName( OUString::createFromAscii( aOS.szPathName ) );
-                    oslModule mhSageInst = osl_loadModule( aLibraryName.pData, SAL_LOADMODULE_DEFAULT
);
+                    oslModule mhSageInst = osl_loadAsciiModule( aOS.szPathName, SAL_LOADMODULE_DEFAULT
);
                     pSalData->mpSageEnableProc = (SysAgt_Enable_PROC)osl_getAsciiFunctionSymbol(
mhSageInst, "System_Agent_Enable" );
                 }
                 else
@@ -2859,8 +2857,7 @@ static BOOL ImplDwmIsCompositionEnabled(
     SalData* pSalData = GetSalData();
     if( ! pSalData->mpDwmIsCompositionEnabled )
     {
-        rtl::OUString aLibraryName( RTL_CONSTASCII_USTRINGPARAM( "Dwmapi.dll" ) );
-        pSalData->maDwmLib = osl_loadModule( aLibraryName.pData, SAL_LOADMODULE_DEFAULT
);
+        pSalData->maDwmLib = osl_loadAsciiModule( "Dwmapi.dll", SAL_LOADMODULE_DEFAULT
);
         if( pSalData->maDwmLib )
             pSalData->mpDwmIsCompositionEnabled = (DwmIsCompositionEnabled_ptr)osl_getAsciiFunctionSymbol(
pSalData->maDwmLib, "DwmIsCompositionEnabled" );
         if( ! pSalData->mpDwmIsCompositionEnabled ) // something failed



Mime
View raw message