drop 'using namespace std' in o* r* x*

Change-Id: I15d56d133cf464a3cb6483be785b1259c7f35b43
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123120
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
This commit is contained in:
Julien Nabet
2021-10-05 20:49:26 +02:00
parent 1f90b8086f
commit 10ad9560fb
9 changed files with 31 additions and 46 deletions

View File

@@ -49,7 +49,6 @@
#include <com/sun/star/lang/XMultiComponentFactory.hpp> #include <com/sun/star/lang/XMultiComponentFactory.hpp>
#include <com/sun/star/registry/XSimpleRegistry.hpp> #include <com/sun/star/registry/XSimpleRegistry.hpp>
using namespace std;
using namespace com::sun::star::uno; using namespace com::sun::star::uno;
using namespace com::sun::star::lang; using namespace com::sun::star::lang;
using namespace com::sun::star::beans; using namespace com::sun::star::beans;
@@ -67,14 +66,14 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
if (nCount < 1) if (nCount < 1)
{ {
cout << "using: DocumentLoader -env:URE_MORE_TYPES=<office_types_rdb_url> <file_url> " std::cout << "using: DocumentLoader -env:URE_MORE_TYPES=<office_types_rdb_url> <file_url> "
"[<uno_connection_url>]" "[<uno_connection_url>]"
<< endl << std::endl
<< endl << std::endl
<< "example: DocumentLoader -env:URE_MORE_TYPES=\"file:///.../program/offapi.rdb\" " << "example: DocumentLoader -env:URE_MORE_TYPES=\"file:///.../program/offapi.rdb\" "
"\"file:///e:/temp/test.odt\" " "\"file:///e:/temp/test.odt\" "
"\"uno:socket,host=localhost,port=2083;urp;StarOffice.ServiceManager\"" "\"uno:socket,host=localhost,port=2083;urp;StarOffice.ServiceManager\""
<< endl; << std::endl;
exit(1); exit(1);
} }
if (nCount == 2) if (nCount == 2)
@@ -109,8 +108,8 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
} }
catch ( Exception& e ) catch ( Exception& e )
{ {
cout << "Error: cannot establish a connection using " std::cout << "Error: cannot establish a connection using "
<< sConnectionString << endl << e.Message << endl; << sConnectionString << std::endl << e.Message << std::endl;
exit(1); exit(1);
} }

View File

@@ -16,8 +16,6 @@
#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoUpdater" , ## args) #define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoUpdater" , ## args)
using namespace std;
int InitProgressUI(int *argc, char ***argv) int InitProgressUI(int *argc, char ***argv)
{ {
return 0; return 0;
@@ -48,7 +46,7 @@ void UpdateProgressUI(float progress)
sLastNumBars = numBars; sLastNumBars = numBars;
size_t numSpaces = kProgressBarLength - numBars; size_t numSpaces = kProgressBarLength - numBars;
string bars(numBars, '='); std::string bars(numBars, '=');
string spaces(numSpaces, ' '); std::string spaces(numSpaces, ' ');
LOG("Progress [ %s%s ]\n", bars.c_str(), spaces.c_str()); LOG("Progress [ %s%s ]\n", bars.c_str(), spaces.c_str());
} }

View File

@@ -15,7 +15,6 @@
#include <oox/token/tokenmap.hxx> #include <oox/token/tokenmap.hxx>
#include <oox/token/tokens.hxx> #include <oox/token/tokens.hxx>
using namespace std;
using namespace com::sun::star::uno; using namespace com::sun::star::uno;
namespace oox { namespace oox {

View File

@@ -18,8 +18,6 @@
#include <clew_setup.hxx> #include <clew_setup.hxx>
using namespace std;
// The purpose of this separate executable is to check whether OpenCL works // The purpose of this separate executable is to check whether OpenCL works
// without crashing (asserting, etc.). Other checks can be done by LO core itself. // without crashing (asserting, etc.). Other checks can be done by LO core itself.
@@ -44,7 +42,7 @@ static void runTest(const char* deviceName, const char* devicePlatform)
// Find the given OpenCL device (in order to use the same one as LO core). // Find the given OpenCL device (in order to use the same one as LO core).
cl_uint numPlatforms; cl_uint numPlatforms;
openclcheck(clGetPlatformIDs(0, nullptr, &numPlatforms)); openclcheck(clGetPlatformIDs(0, nullptr, &numPlatforms));
vector<cl_platform_id> platforms(numPlatforms); std::vector<cl_platform_id> platforms(numPlatforms);
openclcheck(clGetPlatformIDs(numPlatforms, platforms.data(), nullptr)); openclcheck(clGetPlatformIDs(numPlatforms, platforms.data(), nullptr));
cl_platform_id platformId = nullptr; cl_platform_id platformId = nullptr;
for (cl_uint i = 0; i < numPlatforms; ++i) for (cl_uint i = 0; i < numPlatforms; ++i)
@@ -67,7 +65,7 @@ static void runTest(const char* deviceName, const char* devicePlatform)
cl_uint numDevices; cl_uint numDevices;
openclcheck(clGetDeviceIDs(platformId, CL_DEVICE_TYPE_ALL, 0, nullptr, &numDevices)); openclcheck(clGetDeviceIDs(platformId, CL_DEVICE_TYPE_ALL, 0, nullptr, &numDevices));
vector<cl_device_id> devices(numDevices); std::vector<cl_device_id> devices(numDevices);
openclcheck( openclcheck(
clGetDeviceIDs(platformId, CL_DEVICE_TYPE_ALL, numDevices, devices.data(), nullptr)); clGetDeviceIDs(platformId, CL_DEVICE_TYPE_ALL, numDevices, devices.data(), nullptr));
cl_device_id deviceId = nullptr; cl_device_id deviceId = nullptr;
@@ -116,11 +114,11 @@ static void runTest(const char* deviceName, const char* devicePlatform)
size_t length; size_t length;
status status
= clGetProgramBuildInfo(program, deviceId, CL_PROGRAM_BUILD_LOG, 0, nullptr, &length); = clGetProgramBuildInfo(program, deviceId, CL_PROGRAM_BUILD_LOG, 0, nullptr, &length);
vector<char> error(length + 1); std::vector<char> error(length + 1);
status = clGetProgramBuildInfo(program, deviceId, CL_PROGRAM_BUILD_LOG, length, status = clGetProgramBuildInfo(program, deviceId, CL_PROGRAM_BUILD_LOG, length,
error.data(), nullptr); error.data(), nullptr);
error[length] = '\0'; error[length] = '\0';
cerr << "OpenCL driver check build error:" << error.data() << endl; std::cerr << "OpenCL driver check build error:" << error.data() << std::endl;
abort(); abort();
} }
#endif #endif

View File

@@ -56,8 +56,6 @@ if( status != CL_SUCCESS ) \
return false; \ return false; \
} }
using namespace std;
namespace { namespace {
bool bIsInited = false; bool bIsInited = false;

View File

@@ -30,9 +30,6 @@
#include <rtl/ustring.hxx> #include <rtl/ustring.hxx>
using namespace std;
sal_Int32 lValue1 = 123456789; sal_Int32 lValue1 = 123456789;
sal_Int32 lValue2 = 54321; sal_Int32 lValue2 = 54321;
sal_Int32 lValue3 = 111333111; sal_Int32 lValue3 = 111333111;
@@ -103,7 +100,7 @@ void test_generateMerge1()
delete myRegistry; delete myRegistry;
cout << "test_generateMerge1() Ok!\n"; std::cout << "test_generateMerge1() Ok!\n";
return; return;
} }
@@ -168,7 +165,7 @@ void test_generateMerge2()
delete myRegistry; delete myRegistry;
cout << "test_generateMerge2() Ok!\n"; std::cout << "test_generateMerge2() Ok!\n";
return; return;
} }
@@ -400,7 +397,7 @@ void test_merge()
delete myRegistry; delete myRegistry;
cout << "test_merge() Ok!\n"; std::cout << "test_merge() Ok!\n";
return; return;
} }

View File

@@ -29,8 +29,6 @@
#include <rtl/alloc.h> #include <rtl/alloc.h>
#include <rtl/ustring.hxx> #include <rtl/ustring.hxx>
using namespace std;
void test_coreReflection() void test_coreReflection()
{ {
@@ -368,7 +366,7 @@ void test_coreReflection()
// REG_ENSURE(!myRegistry->destroy(NULL), "testCoreReflection error 10"); // REG_ENSURE(!myRegistry->destroy(NULL), "testCoreReflection error 10");
delete myRegistry; delete myRegistry;
cout << "test_coreReflection() Ok!\n"; std::cout << "test_coreReflection() Ok!\n";
} }
void test_registry_CppApi() void test_registry_CppApi()
@@ -689,7 +687,7 @@ void test_registry_CppApi()
REG_ENSURE(!myRegistry->destroy(OUString()), "test_registry_CppApi error 63"); REG_ENSURE(!myRegistry->destroy(OUString()), "test_registry_CppApi error 63");
delete(myRegistry); delete(myRegistry);
cout << "test_registry_CppApi() Ok!\n"; std::cout << "test_registry_CppApi() Ok!\n";
return; return;
} }

View File

@@ -44,7 +44,6 @@
#include "resultsetforquery.hxx" #include "resultsetforquery.hxx"
#include "databases.hxx" #include "databases.hxx"
using namespace std;
using namespace chelp; using namespace chelp;
using namespace com::sun::star; using namespace com::sun::star;
using namespace com::sun::star::ucb; using namespace com::sun::star::ucb;
@@ -85,7 +84,7 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< uno::XComponentConte
xTrans->loadModule(TransliterationModules_UPPERCASE_LOWERCASE, xTrans->loadModule(TransliterationModules_UPPERCASE_LOWERCASE,
aLocale ); aLocale );
vector< vector< OUString > > queryList; std::vector< std::vector< OUString > > queryList;
{ {
sal_Int32 idx; sal_Int32 idx;
OUString query = aURLParameter.get_query(); OUString query = aURLParameter.get_query();
@@ -95,7 +94,7 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< uno::XComponentConte
if( idx == -1 ) if( idx == -1 )
idx = query.getLength(); idx = query.getLength();
vector< OUString > currentQuery; std::vector< OUString > currentQuery;
OUString tmp(query.copy( 0,idx )); OUString tmp(query.copy( 0,idx ));
Sequence<sal_Int32> aSeq; Sequence<sal_Int32> aSeq;
OUString toliterate = xTrans->transliterate( OUString toliterate = xTrans->transliterate(
@@ -112,7 +111,7 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< uno::XComponentConte
} }
} }
vector< OUString > aCompleteResultVector; std::vector< OUString > aCompleteResultVector;
OUString scope = aURLParameter.get_scope(); OUString scope = aURLParameter.get_scope();
bool bCaptionsOnly = scope == "Heading"; bool bCaptionsOnly = scope == "Heading";
sal_Int32 hitCount = aURLParameter.get_hitCount(); sal_Int32 hitCount = aURLParameter.get_hitCount();
@@ -120,7 +119,7 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< uno::XComponentConte
IndexFolderIterator aIndexFolderIt( *pDatabases, aURLParameter.get_module(), aURLParameter.get_language() ); IndexFolderIterator aIndexFolderIt( *pDatabases, aURLParameter.get_module(), aURLParameter.get_language() );
OUString idxDir; OUString idxDir;
bool bExtension = false; bool bExtension = false;
vector< vector<HitItem> > aIndexFolderResultVectorVector; std::vector< std::vector<HitItem> > aIndexFolderResultVectorVector;
bool bTemporary; bool bTemporary;
for (;;) for (;;)
@@ -128,12 +127,12 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< uno::XComponentConte
idxDir = aIndexFolderIt.nextIndexFolder( bExtension, bTemporary ); idxDir = aIndexFolderIt.nextIndexFolder( bExtension, bTemporary );
if( idxDir.isEmpty() ) if( idxDir.isEmpty() )
break; break;
vector<HitItem> aIndexFolderResultVector; std::vector<HitItem> aIndexFolderResultVector;
try try
{ {
vector< vector<HitItem> > aQueryListResultVectorVector; std::vector< std::vector<HitItem> > aQueryListResultVectorVector;
set< OUString > aSet,aCurrent,aResultSet; std::set< OUString > aSet,aCurrent,aResultSet;
int nQueryListSize = queryList.size(); int nQueryListSize = queryList.size();
if( nQueryListSize > 1 ) if( nQueryListSize > 1 )
@@ -141,7 +140,7 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< uno::XComponentConte
for( int i = 0; i < nQueryListSize; ++i ) for( int i = 0; i < nQueryListSize; ++i )
{ {
vector<HitItem>* pQueryResultVector; std::vector<HitItem>* pQueryResultVector;
if( nQueryListSize > 1 ) if( nQueryListSize > 1 )
{ {
aQueryListResultVectorVector.emplace_back(); aQueryListResultVectorVector.emplace_back();
@@ -156,8 +155,8 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< uno::XComponentConte
const std::vector< OUString >& aListItem = queryList[i]; const std::vector< OUString >& aListItem = queryList[i];
OUString aNewQueryStr = aListItem[0]; OUString aNewQueryStr = aListItem[0];
vector<float> aScoreVector; std::vector<float> aScoreVector;
vector<OUString> aPathVector; std::vector<OUString> aPathVector;
try try
{ {
@@ -201,7 +200,7 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< uno::XComponentConte
{ {
for( int n = 0 ; n < nQueryListSize ; ++n ) for( int n = 0 ; n < nQueryListSize ; ++n )
{ {
vector<HitItem>& rQueryResultVector = aQueryListResultVectorVector[n]; std::vector<HitItem>& rQueryResultVector = aQueryListResultVectorVector[n];
int nItemCount = rQueryResultVector.size(); int nItemCount = rQueryResultVector.size();
for( int i = 0 ; i < nItemCount ; ++i ) for( int i = 0 ; i < nItemCount ; ++i )
@@ -251,7 +250,7 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< uno::XComponentConte
int nVectorCount = aIndexFolderResultVectorVector.size(); int nVectorCount = aIndexFolderResultVectorVector.size();
std::unique_ptr<std::vector<HitItem>::size_type[]> pCurrentVectorIndex(new vector<HitItem>::size_type[nVectorCount]); std::unique_ptr<std::vector<HitItem>::size_type[]> pCurrentVectorIndex(new std::vector<HitItem>::size_type[nVectorCount]);
for( int j = 0 ; j < nVectorCount ; ++j ) for( int j = 0 ; j < nVectorCount ; ++j )
pCurrentVectorIndex[j] = 0; pCurrentVectorIndex[j] = 0;
@@ -263,7 +262,7 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< uno::XComponentConte
float fBestScore = 0.0; float fBestScore = 0.0;
for( int k = 0 ; k < nVectorCount ; ++k ) for( int k = 0 ; k < nVectorCount ; ++k )
{ {
vector<HitItem>& rIndexFolderVector = aIndexFolderResultVectorVector[k]; std::vector<HitItem>& rIndexFolderVector = aIndexFolderResultVectorVector[k];
if( pCurrentVectorIndex[k] < rIndexFolderVector.size() ) if( pCurrentVectorIndex[k] < rIndexFolderVector.size() )
{ {
const HitItem& rItem = rIndexFolderVector[ pCurrentVectorIndex[k] ]; const HitItem& rItem = rIndexFolderVector[ pCurrentVectorIndex[k] ];
@@ -279,7 +278,7 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< uno::XComponentConte
if( iVectorWithBestScore == -1 ) // No item left at all if( iVectorWithBestScore == -1 ) // No item left at all
break; break;
vector<HitItem>& rIndexFolderVector = aIndexFolderResultVectorVector[iVectorWithBestScore]; std::vector<HitItem>& rIndexFolderVector = aIndexFolderResultVectorVector[iVectorWithBestScore];
const HitItem& rItem = rIndexFolderVector[ pCurrentVectorIndex[iVectorWithBestScore] ]; const HitItem& rItem = rIndexFolderVector[ pCurrentVectorIndex[iVectorWithBestScore] ];
pCurrentVectorIndex[iVectorWithBestScore]++; pCurrentVectorIndex[iVectorWithBestScore]++;

View File

@@ -16,7 +16,6 @@
#include <xmloff/token/tokens.hxx> #include <xmloff/token/tokens.hxx>
#include <xmloff/xmltoken.hxx> #include <xmloff/xmltoken.hxx>
using namespace std;
using namespace com::sun::star::uno; using namespace com::sun::star::uno;
namespace xmloff { namespace xmloff {