cleanup whitespaces due to RTL_CONSTASCII_USTRINGPARAM removal

In e2e2cc6114 the method was removed
automatically leaving several line breaks etc. as visual noise.
This commit is contained in:
Philipp Riemer
2013-05-06 19:17:14 +02:00
parent cb33531fc4
commit e8eab43eeb
15 changed files with 261 additions and 457 deletions

View File

@@ -78,8 +78,7 @@ inline UnoUrlDescriptor::Impl::Impl(rtl::OUString const & rDescriptor)
case STATE_NAME0: case STATE_NAME0:
if (bEnd || !isAlphanum(c)) if (bEnd || !isAlphanum(c))
throw rtl::MalformedUriException( throw rtl::MalformedUriException(
rtl::OUString( rtl::OUString("UNO URL contains bad descriptor name"));
"UNO URL contains bad descriptor name"));
nStart = i; nStart = i;
eState = STATE_NAME; eState = STATE_NAME;
break; break;
@@ -93,15 +92,13 @@ inline UnoUrlDescriptor::Impl::Impl(rtl::OUString const & rDescriptor)
} }
else if (!isAlphanum(c)) else if (!isAlphanum(c))
throw rtl::MalformedUriException( throw rtl::MalformedUriException(
rtl::OUString( rtl::OUString("UNO URL contains bad descriptor name"));
"UNO URL contains bad descriptor name"));
break; break;
case STATE_KEY0: case STATE_KEY0:
if (bEnd || !isAlphanum(c)) if (bEnd || !isAlphanum(c))
throw rtl::MalformedUriException( throw rtl::MalformedUriException(
rtl::OUString( rtl::OUString("UNO URL contains bad parameter key"));
"UNO URL contains bad parameter key"));
nStart = i; nStart = i;
eState = STATE_KEY; eState = STATE_KEY;
break; break;
@@ -115,8 +112,7 @@ inline UnoUrlDescriptor::Impl::Impl(rtl::OUString const & rDescriptor)
} }
else if (bEnd || !isAlphanum(c)) else if (bEnd || !isAlphanum(c))
throw rtl::MalformedUriException( throw rtl::MalformedUriException(
rtl::OUString( rtl::OUString("UNO URL contains bad parameter key"));
"UNO URL contains bad parameter key"));
break; break;
case STATE_VALUE: case STATE_VALUE:
@@ -130,8 +126,7 @@ inline UnoUrlDescriptor::Impl::Impl(rtl::OUString const & rDescriptor)
rtl_UriDecodeWithCharset, rtl_UriDecodeWithCharset,
RTL_TEXTENCODING_UTF8))).second) RTL_TEXTENCODING_UTF8))).second)
throw rtl::MalformedUriException( throw rtl::MalformedUriException(
rtl::OUString( rtl::OUString("UNO URL contains duplicated parameter"));
"UNO URL contains duplicated parameter"));
eState = STATE_KEY0; eState = STATE_KEY0;
} }
break; break;
@@ -216,14 +211,12 @@ inline UnoUrl::Impl * UnoUrl::Impl::create(rtl::OUString const & rUrl)
{ {
if (!rUrl.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("uno:"), 0)) if (!rUrl.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("uno:"), 0))
throw rtl::MalformedUriException( throw rtl::MalformedUriException(
rtl::OUString( rtl::OUString("UNO URL does not start with \"uno:\""));
"UNO URL does not start with \"uno:\""));
sal_Int32 i = RTL_CONSTASCII_LENGTH("uno:"); sal_Int32 i = RTL_CONSTASCII_LENGTH("uno:");
sal_Int32 j = rUrl.indexOf(';', i); sal_Int32 j = rUrl.indexOf(';', i);
if (j < 0) if (j < 0)
throw rtl::MalformedUriException( throw rtl::MalformedUriException(
rtl::OUString( rtl::OUString("UNO URL has too few semicolons"));
"UNO URL has too few semicolons"));
SAL_WNODEPRECATED_DECLARATIONS_PUSH SAL_WNODEPRECATED_DECLARATIONS_PUSH
std::auto_ptr< UnoUrlDescriptor::Impl > std::auto_ptr< UnoUrlDescriptor::Impl >
xConnection(new UnoUrlDescriptor::Impl(rUrl.copy(i, j - i))); xConnection(new UnoUrlDescriptor::Impl(rUrl.copy(i, j - i)));
@@ -232,8 +225,7 @@ inline UnoUrl::Impl * UnoUrl::Impl::create(rtl::OUString const & rUrl)
j = rUrl.indexOf(0x3B, i); // ';' j = rUrl.indexOf(0x3B, i); // ';'
if (j < 0) if (j < 0)
throw rtl::MalformedUriException( throw rtl::MalformedUriException(
rtl::OUString( rtl::OUString("UNO URL has too few semicolons"));
"UNO URL has too few semicolons"));
SAL_WNODEPRECATED_DECLARATIONS_PUSH SAL_WNODEPRECATED_DECLARATIONS_PUSH
std::auto_ptr< UnoUrlDescriptor::Impl > std::auto_ptr< UnoUrlDescriptor::Impl >
xProtocol(new UnoUrlDescriptor::Impl(rUrl.copy(i, j - i))); xProtocol(new UnoUrlDescriptor::Impl(rUrl.copy(i, j - i)));
@@ -241,8 +233,7 @@ inline UnoUrl::Impl * UnoUrl::Impl::create(rtl::OUString const & rUrl)
i = j + 1; i = j + 1;
if (i == rUrl.getLength()) if (i == rUrl.getLength())
throw rtl::MalformedUriException( throw rtl::MalformedUriException(
rtl::OUString( rtl::OUString("UNO URL contains empty ObjectName"));
"UNO URL contains empty ObjectName"));
for (j = i; j < rUrl.getLength(); ++j) for (j = i; j < rUrl.getLength(); ++j)
{ {
sal_Unicode c = rUrl.getStr()[j]; sal_Unicode c = rUrl.getStr()[j];
@@ -254,8 +245,7 @@ inline UnoUrl::Impl * UnoUrl::Impl::create(rtl::OUString const & rUrl)
&& c != 0x3F && c != 0x40 && c != 0x5F // '?', '@', '_' && c != 0x3F && c != 0x40 && c != 0x5F // '?', '@', '_'
&& c != 0x7E) // '~' && c != 0x7E) // '~'
throw rtl::MalformedUriException( throw rtl::MalformedUriException(
rtl::OUString( rtl::OUString("UNO URL contains invalid ObjectName"));
"UNO URL contains invalid ObjectName"));
} }
return new Impl(xConnection, xProtocol, rUrl.copy(i)); return new Impl(xConnection, xProtocol, rUrl.copy(i));
} }

View File

@@ -535,14 +535,11 @@ SAL_IMPLEMENT_MAIN()
if (! aUnoUrl.endsWithIgnoreAsciiCaseAsciiL( if (! aUnoUrl.endsWithIgnoreAsciiCaseAsciiL(
RTL_CONSTASCII_STRINGPARAM(";uno.ComponentContext") )) RTL_CONSTASCII_STRINGPARAM(";uno.ComponentContext") ))
throw RuntimeException( throw RuntimeException(
OUString( OUString("expected UNO-URL with instance name uno.ComponentContext!" ),
"expected UNO-URL with instance name "
"uno.ComponentContext!" ),
Reference<XInterface>() ); Reference<XInterface>() );
if (bSingleInstance) if (bSingleInstance)
throw RuntimeException( throw RuntimeException(
OUString( OUString("unexpected option --singleinstance!"),
"unexpected option --singleinstance!"),
Reference<XInterface>() ); Reference<XInterface>() );
} }
if (!aImplName.isEmpty() && aLocation.isEmpty()) if (!aImplName.isEmpty() && aLocation.isEmpty())

View File

@@ -77,8 +77,7 @@ css::uno::Reference< css::uno::XInterface > SingletonFactory::createInstanceWith
OUString( "UnoVirtualMachine" ), OUString( "UnoVirtualMachine" ),
css::uno::makeAny( handle ) ) ) ); css::uno::makeAny( handle ) ) ) );
return xContext->getServiceManager()->createInstanceWithArgumentsAndContext( return xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
OUString( OUString("com.sun.star.java.JavaVirtualMachine"),
"com.sun.star.java.JavaVirtualMachine"),
css::uno::Sequence< css::uno::Any >( &arg, 1 ), xContext ); css::uno::Sequence< css::uno::Any >( &arg, 1 ), xContext );
} }
@@ -87,8 +86,7 @@ css::uno::Reference< css::uno::XInterface > SingletonFactory::createInstanceWith
throw (css::uno::Exception) throw (css::uno::Exception)
{ {
return xContext->getServiceManager()->createInstanceWithArgumentsAndContext( return xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
OUString( OUString("com.sun.star.java.JavaVirtualMachine"),
"com.sun.star.java.JavaVirtualMachine"),
args, xContext ); args, xContext );
} }
@@ -108,9 +106,7 @@ namespace javaunohelper {
loader ); loader );
} catch ( ::jvmaccess::UnoVirtualMachine::CreationException & ) { } catch ( ::jvmaccess::UnoVirtualMachine::CreationException & ) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
OUString( OUString("jmvaccess::UnoVirtualMachine::CreationException occurred" ),
"jmvaccess::UnoVirtualMachine::CreationException"
" occurred" ),
css::uno::Reference< css::uno::XInterface >() ); css::uno::Reference< css::uno::XInterface >() );
} }
} }
@@ -121,8 +117,7 @@ css::uno::Reference< css::uno::XComponentContext > install_vm_singleton(
{ {
css::uno::Reference< css::lang::XSingleComponentFactory > xFac( new SingletonFactory( vm_access ) ); css::uno::Reference< css::lang::XSingleComponentFactory > xFac( new SingletonFactory( vm_access ) );
::cppu::ContextEntry_Init entry( ::cppu::ContextEntry_Init entry(
OUString( OUString("/singletons/com.sun.star.java.theJavaVirtualMachine"),
"/singletons/com.sun.star.java.theJavaVirtualMachine"),
css::uno::makeAny( xFac ), true ); css::uno::makeAny( xFac ), true );
return ::cppu::createComponentContext( &entry, 1, xContext ); return ::cppu::createComponentContext( &entry, 1, xContext );
} }

View File

@@ -322,9 +322,7 @@ OUString VendorSettings::getPluginLibrary(const OUString& sVendor)
for (sal_Int32 i = 1; ; i++) for (sal_Int32 i = 1; ; i++)
{ {
OUString sName = OUString sName = OUString(UNO_JAVA_JFW_PARAMETER) + OUString::valueOf(i);
OUString(UNO_JAVA_JFW_PARAMETER) +
OUString::valueOf(i);
OUString sValue; OUString sValue;
if (Bootstrap::get()->getFrom(sName, sValue) == sal_True) if (Bootstrap::get()->getFrom(sName, sValue) == sal_True)
{ {
@@ -361,8 +359,7 @@ OString BootParams::getClasspath()
OUString(UNO_JAVA_JFW_CLASSPATH), OUString(UNO_JAVA_JFW_CLASSPATH),
sCP) == sal_True) sCP) == sal_True)
{ {
sClassPath = OUStringToOString( sClassPath = OUStringToOString(sCP, osl_getThreadTextEncoding());
sCP, osl_getThreadTextEncoding());
#if OSL_DEBUG_LEVEL >=2 #if OSL_DEBUG_LEVEL >=2
fprintf(stderr,"[Java framework] Using bootstrap parameter " fprintf(stderr,"[Java framework] Using bootstrap parameter "
UNO_JAVA_JFW_CLASSPATH " = %s.\n", sClassPath.getStr()); UNO_JAVA_JFW_CLASSPATH " = %s.\n", sClassPath.getStr());
@@ -517,20 +514,16 @@ JFW_MODE getMode()
bool bDirectMode = true; bool bDirectMode = true;
OUString sValue; OUString sValue;
const rtl::Bootstrap * aBoot = Bootstrap::get(); const rtl::Bootstrap * aBoot = Bootstrap::get();
OUString sJREHome( OUString sJREHome(UNO_JAVA_JFW_JREHOME);
UNO_JAVA_JFW_JREHOME);
if (aBoot->getFrom(sJREHome, sValue) == sal_False) if (aBoot->getFrom(sJREHome, sValue) == sal_False)
{ {
OUString sEnvJRE( OUString sEnvJRE(UNO_JAVA_JFW_ENV_JREHOME);
UNO_JAVA_JFW_ENV_JREHOME);
if (aBoot->getFrom(sEnvJRE, sValue) == sal_False) if (aBoot->getFrom(sEnvJRE, sValue) == sal_False)
{ {
OUString sClasspath( OUString sClasspath(UNO_JAVA_JFW_CLASSPATH);
UNO_JAVA_JFW_CLASSPATH);
if (aBoot->getFrom(sClasspath, sValue) == sal_False) if (aBoot->getFrom(sClasspath, sValue) == sal_False)
{ {
OUString sEnvClasspath( OUString sEnvClasspath(UNO_JAVA_JFW_ENV_CLASSPATH);
UNO_JAVA_JFW_ENV_CLASSPATH);
if (aBoot->getFrom(sEnvClasspath, sValue) == sal_False) if (aBoot->getFrom(sEnvClasspath, sValue) == sal_False)
{ {
OUString sParams = OUString( OUString sParams = OUString(

View File

@@ -336,20 +336,16 @@ sal_uLong ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet
uno::Any aAny; uno::Any aAny;
aAny <<= xConnection; aAny <<= xConnection;
xRowProp->setPropertyValue( xRowProp->setPropertyValue( OUString(SC_DBPROP_ACTIVECONNECTION), aAny );
OUString(SC_DBPROP_ACTIVECONNECTION), aAny );
aAny <<= nType; aAny <<= nType;
xRowProp->setPropertyValue( xRowProp->setPropertyValue( OUString(SC_DBPROP_COMMANDTYPE), aAny );
OUString(SC_DBPROP_COMMANDTYPE), aAny );
aAny <<= OUString( aTabName ); aAny <<= OUString( aTabName );
xRowProp->setPropertyValue( xRowProp->setPropertyValue( OUString(SC_DBPROP_COMMAND), aAny );
OUString(SC_DBPROP_COMMAND), aAny );
aAny <<= false; aAny <<= false;
xRowProp->setPropertyValue( xRowProp->setPropertyValue( OUString(SC_DBPROP_PROPCHANGE_NOTIFY), aAny );
OUString(SC_DBPROP_PROPCHANGE_NOTIFY), aAny );
xRowSet->execute(); xRowSet->execute();
@@ -934,16 +930,13 @@ sal_uLong ScDocShell::DBaseExport( const OUString& rFullFileName, CharSet eCharS
if (!xRowProp.is()) return SCERR_EXPORT_CONNECT; if (!xRowProp.is()) return SCERR_EXPORT_CONNECT;
aAny <<= xConnection; aAny <<= xConnection;
xRowProp->setPropertyValue( xRowProp->setPropertyValue( OUString(SC_DBPROP_ACTIVECONNECTION), aAny );
OUString(SC_DBPROP_ACTIVECONNECTION), aAny );
aAny <<= (sal_Int32) sdb::CommandType::TABLE; aAny <<= (sal_Int32) sdb::CommandType::TABLE;
xRowProp->setPropertyValue( xRowProp->setPropertyValue( OUString(SC_DBPROP_COMMANDTYPE), aAny );
OUString(SC_DBPROP_COMMANDTYPE), aAny );
aAny <<= OUString( aTabName ); aAny <<= OUString( aTabName );
xRowProp->setPropertyValue( xRowProp->setPropertyValue( OUString(SC_DBPROP_COMMAND), aAny );
OUString(SC_DBPROP_COMMAND), aAny );
xRowSet->execute(); xRowSet->execute();

View File

@@ -54,11 +54,9 @@ private:
ScriptingConstantsPool& operator = ( const ScriptingConstantsPool & ); ScriptingConstantsPool& operator = ( const ScriptingConstantsPool & );
ScriptingConstantsPool() ScriptingConstantsPool()
: DOC_REF( "SCRIPTING_DOC_REF" ), : DOC_REF( "SCRIPTING_DOC_REF" ),
DOC_STORAGE_ID( DOC_STORAGE_ID( "SCRIPTING_DOC_STORAGE_ID" ),
"SCRIPTING_DOC_STORAGE_ID" ),
DOC_URI( "SCRIPTING_DOC_URI" ), DOC_URI( "SCRIPTING_DOC_URI" ),
RESOLVED_STORAGE_ID( RESOLVED_STORAGE_ID( "SCRIPTING_RESOLVED_STORAGE_ID" ),
"SCRIPTING_RESOLVED_STORAGE_ID" ),
SCRIPT_INFO( "SCRIPT_INFO" ), SCRIPT_INFO( "SCRIPT_INFO" ),
SCRIPTSTORAGEMANAGER_SERVICE( SCRIPTSTORAGEMANAGER_SERVICE(
"/singletons/com.sun.star.script.framework.storage.theScriptStorageManager" ), "/singletons/com.sun.star.script.framework.storage.theScriptStorageManager" ),

View File

@@ -201,8 +201,7 @@ bool SingletonFactory::m_bDisposed = false;
OUString serviceGetImplementationName() OUString serviceGetImplementationName()
{ {
return OUString( return OUString("com.sun.star.comp.stoc.JavaVirtualMachine");
"com.sun.star.comp.stoc.JavaVirtualMachine");
} }
css::uno::Sequence< OUString > serviceGetSupportedServiceNames() css::uno::Sequence< OUString > serviceGetSupportedServiceNames()
@@ -257,8 +256,7 @@ bool askForRetry(css::uno::Any const & rException)
if (xContext.is()) if (xContext.is())
{ {
css::uno::Reference< css::task::XInteractionHandler > xHandler; css::uno::Reference< css::task::XInteractionHandler > xHandler;
xContext->getValueByName(OUString( xContext->getValueByName(OUString("java-vm.interaction-handler"))
"java-vm.interaction-handler"))
>>= xHandler; >>= xHandler;
if (xHandler.is()) if (xHandler.is())
{ {
@@ -369,8 +367,7 @@ void getDefaultLocaleFromConfig(
{ {
css::uno::Reference<css::uno::XInterface> xConfRegistry = css::uno::Reference<css::uno::XInterface> xConfRegistry =
xSMgr->createInstanceWithContext( xSMgr->createInstanceWithContext(
OUString( OUString("com.sun.star.configuration.ConfigurationRegistry"), xCtx );
"com.sun.star.configuration.ConfigurationRegistry"), xCtx );
if(!xConfRegistry.is()) if(!xConfRegistry.is())
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
OUString("javavm.cxx: couldn't get ConfigurationRegistry"), 0); OUString("javavm.cxx: couldn't get ConfigurationRegistry"), 0);
@@ -424,8 +421,7 @@ void getJavaPropsFromSafetySettings(
{ {
css::uno::Reference<css::uno::XInterface> xConfRegistry = css::uno::Reference<css::uno::XInterface> xConfRegistry =
xSMgr->createInstanceWithContext( xSMgr->createInstanceWithContext(
OUString( OUString("com.sun.star.configuration.ConfigurationRegistry"),
"com.sun.star.configuration.ConfigurationRegistry"),
xCtx); xCtx);
if(!xConfRegistry.is()) if(!xConfRegistry.is())
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
@@ -598,8 +594,7 @@ JavaVirtualMachine::initialize(css::uno::Sequence< css::uno::Any > const &
OUString(), static_cast< cppu::OWeakObject * >(this)); OUString(), static_cast< cppu::OWeakObject * >(this));
if (m_xUnoVirtualMachine.is()) if (m_xUnoVirtualMachine.is())
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
OUString( OUString("bad call to initialize"),
"bad call to initialize"),
static_cast< cppu::OWeakObject * >(this)); static_cast< cppu::OWeakObject * >(this));
css::beans::NamedValue val; css::beans::NamedValue val;
if (rArguments.getLength() == 1 && (rArguments[0] >>= val) && val.Name == "UnoVirtualMachine" ) if (rArguments.getLength() == 1 && (rArguments[0] >>= val) && val.Name == "UnoVirtualMachine" )
@@ -627,16 +622,14 @@ JavaVirtualMachine::initialize(css::uno::Sequence< css::uno::Any > const &
m_xUnoVirtualMachine = new jvmaccess::UnoVirtualMachine(vm, 0); m_xUnoVirtualMachine = new jvmaccess::UnoVirtualMachine(vm, 0);
} catch (jvmaccess::UnoVirtualMachine::CreationException &) { } catch (jvmaccess::UnoVirtualMachine::CreationException &) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
OUString( OUString("jvmaccess::UnoVirtualMachine::CreationException"),
"jvmaccess::UnoVirtualMachine::CreationException"),
static_cast< cppu::OWeakObject * >(this)); static_cast< cppu::OWeakObject * >(this));
} }
} }
} }
if (!m_xUnoVirtualMachine.is()) { if (!m_xUnoVirtualMachine.is()) {
throw css::lang::IllegalArgumentException( throw css::lang::IllegalArgumentException(
OUString( OUString("sequence of exactly one any containing either (a) a"
"sequence of exactly one any containing either (a) a"
" com.sun.star.beans.NamedValue with Name" " com.sun.star.beans.NamedValue with Name"
" \"UnoVirtualMachine\" and Value a hyper representing a" " \"UnoVirtualMachine\" and Value a hyper representing a"
" non-null pointer to a jvmaccess:UnoVirtualMachine, or (b)" " non-null pointer to a jvmaccess:UnoVirtualMachine, or (b)"
@@ -785,9 +778,8 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId)
//%PRODUCTNAME requires a Java runtime environment (JRE) to perform this task. //%PRODUCTNAME requires a Java runtime environment (JRE) to perform this task.
//Please install a JRE and restart %PRODUCTNAME. //Please install a JRE and restart %PRODUCTNAME.
css::java::JavaNotFoundException exc( css::java::JavaNotFoundException exc(
OUString( OUString("JavaVirtualMachine::getJavaVM failed because"
"JavaVirtualMachine::getJavaVM failed because" " No suitable JRE found!"),
" No suitable JRE found!"),
static_cast< cppu::OWeakObject * >(this)); static_cast< cppu::OWeakObject * >(this));
askForRetry(css::uno::makeAny(exc)); askForRetry(css::uno::makeAny(exc));
return css::uno::Any(); return css::uno::Any();
@@ -796,9 +788,8 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId)
{ {
//An unexpected error occurred //An unexpected error occurred
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
OUString( OUString("[JavaVirtualMachine]:An unexpected error occurred"
"[JavaVirtualMachine]:An unexpected error occurred" " while searching for a Java!"), 0);
" while searching for a Java!"), 0);
} }
} }
case JFW_E_INVALID_SETTINGS: case JFW_E_INVALID_SETTINGS:
@@ -808,9 +799,8 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId)
// - Options - %PRODUCTNAME - Java, select the Java runtime environment // - Options - %PRODUCTNAME - Java, select the Java runtime environment
// you want to have used by %PRODUCTNAME. // you want to have used by %PRODUCTNAME.
css::java::InvalidJavaSettingsException exc( css::java::InvalidJavaSettingsException exc(
OUString( OUString("JavaVirtualMachine::getJavaVM failed because"
"JavaVirtualMachine::getJavaVM failed because" " Java settings have changed!"),
" Java settings have changed!"),
static_cast< cppu::OWeakObject * >(this)); static_cast< cppu::OWeakObject * >(this));
askForRetry(css::uno::makeAny(exc)); askForRetry(css::uno::makeAny(exc));
return css::uno::Any(); return css::uno::Any();
@@ -822,9 +812,7 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId)
//this task. However, use of a JRE has been disabled. Do you want to //this task. However, use of a JRE has been disabled. Do you want to
//enable the use of a JRE now? //enable the use of a JRE now?
css::java::JavaDisabledException exc( css::java::JavaDisabledException exc(
OUString( OUString("JavaVirtualMachine::getJavaVM failed because Java is disabled!"),
"JavaVirtualMachine::getJavaVM failed because"
" Java is disabled!"),
static_cast< cppu::OWeakObject * >(this)); static_cast< cppu::OWeakObject * >(this));
if( ! askForRetry(css::uno::makeAny(exc))) if( ! askForRetry(css::uno::makeAny(exc)))
return css::uno::Any(); return css::uno::Any();
@@ -863,9 +851,7 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId)
//is defective. Please select another version or install a new JRE //is defective. Please select another version or install a new JRE
//and select it under Tools - Options - %PRODUCTNAME - Java. //and select it under Tools - Options - %PRODUCTNAME - Java.
css::java::JavaVMCreationFailureException exc( css::java::JavaVMCreationFailureException exc(
OUString( OUString("JavaVirtualMachine::getJavaVM failed because Java is defective!"),
"JavaVirtualMachine::getJavaVM failed because"
" Java is defective!"),
static_cast< cppu::OWeakObject * >(this), 0); static_cast< cppu::OWeakObject * >(this), 0);
askForRetry(css::uno::makeAny(exc)); askForRetry(css::uno::makeAny(exc));
return css::uno::Any(); return css::uno::Any();
@@ -882,9 +868,8 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId)
//For the selected Java runtime environment to work properly, //For the selected Java runtime environment to work properly,
//%PRODUCTNAME must be restarted. Please restart %PRODUCTNAME now. //%PRODUCTNAME must be restarted. Please restart %PRODUCTNAME now.
css::java::RestartRequiredException exc( css::java::RestartRequiredException exc(
OUString( OUString("JavaVirtualMachine::getJavaVM failed because "
"JavaVirtualMachine::getJavaVM failed because" "Office must be restarted before Java can be used!"),
"Office must be restarted before Java can be used!"),
static_cast< cppu::OWeakObject * >(this)); static_cast< cppu::OWeakObject * >(this));
askForRetry(css::uno::makeAny(exc)); askForRetry(css::uno::makeAny(exc));
return css::uno::Any(); return css::uno::Any();
@@ -893,9 +878,8 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId)
//RuntimeException: error is somewhere in the java framework. //RuntimeException: error is somewhere in the java framework.
//An unexpected error occurred //An unexpected error occurred
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
OUString( OUString("[JavaVirtualMachine]:An unexpected error occurred"
"[JavaVirtualMachine]:An unexpected error occurred" " while starting Java!"), 0);
" while starting Java!"), 0);
} }
if (bStarted) if (bStarted)
@@ -922,9 +906,7 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId)
setUpUnoVirtualMachine(guard.getEnvironment()); setUpUnoVirtualMachine(guard.getEnvironment());
} catch (jvmaccess::VirtualMachine::AttachGuard::CreationException &) { } catch (jvmaccess::VirtualMachine::AttachGuard::CreationException &) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
OUString( OUString("jvmaccess::VirtualMachine::AttachGuard::CreationException occurred"),
"jvmaccess::VirtualMachine::AttachGuard::"
"CreationException occurred"),
static_cast< cppu::OWeakObject * >(this)); static_cast< cppu::OWeakObject * >(this));
} }
} }
@@ -932,9 +914,8 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId)
default: // RETURN_JAVAVM default: // RETURN_JAVAVM
if (m_pJavaVm == 0) { if (m_pJavaVm == 0) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
OUString( OUString("JavaVirtualMachine service was initialized in a way"
"JavaVirtualMachine service was initialized in a way" " that the requested JavaVM pointer is not available"),
" that the requested JavaVM pointer is not available"),
static_cast< cppu::OWeakObject * >(this)); static_cast< cppu::OWeakObject * >(this));
} }
return css::uno::makeAny(reinterpret_cast< sal_IntPtr >(m_pJavaVm)); return css::uno::makeAny(reinterpret_cast< sal_IntPtr >(m_pJavaVm));
@@ -1002,9 +983,7 @@ void SAL_CALL JavaVirtualMachine::registerThread()
OUString(), static_cast< cppu::OWeakObject * >(this)); OUString(), static_cast< cppu::OWeakObject * >(this));
if (!m_xUnoVirtualMachine.is()) if (!m_xUnoVirtualMachine.is())
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
OUString( OUString("JavaVirtualMachine::registerThread: null VirtualMachine"),
"JavaVirtualMachine::registerThread:"
" null VirtualMachine"),
static_cast< cppu::OWeakObject * >(this)); static_cast< cppu::OWeakObject * >(this));
GuardStack * pStack GuardStack * pStack
= static_cast< GuardStack * >(m_aAttachGuards.getData()); = static_cast< GuardStack * >(m_aAttachGuards.getData());
@@ -1022,9 +1001,8 @@ void SAL_CALL JavaVirtualMachine::registerThread()
catch (jvmaccess::VirtualMachine::AttachGuard::CreationException &) catch (jvmaccess::VirtualMachine::AttachGuard::CreationException &)
{ {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
OUString( OUString("JavaVirtualMachine::registerThread: jvmaccess::"
"JavaVirtualMachine::registerThread: jvmaccess::" "VirtualMachine::AttachGuard::CreationException"),
"VirtualMachine::AttachGuard::CreationException"),
static_cast< cppu::OWeakObject * >(this)); static_cast< cppu::OWeakObject * >(this));
} }
} }
@@ -1038,17 +1016,13 @@ void SAL_CALL JavaVirtualMachine::revokeThread()
OUString(), static_cast< cppu::OWeakObject * >(this)); OUString(), static_cast< cppu::OWeakObject * >(this));
if (!m_xUnoVirtualMachine.is()) if (!m_xUnoVirtualMachine.is())
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
OUString( OUString("JavaVirtualMachine::revokeThread: null VirtualMachine"),
"JavaVirtualMachine::revokeThread:"
" null VirtualMachine"),
static_cast< cppu::OWeakObject * >(this)); static_cast< cppu::OWeakObject * >(this));
GuardStack * pStack GuardStack * pStack
= static_cast< GuardStack * >(m_aAttachGuards.getData()); = static_cast< GuardStack * >(m_aAttachGuards.getData());
if (pStack == 0 || pStack->empty()) if (pStack == 0 || pStack->empty())
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
OUString( OUString("JavaVirtualMachine::revokeThread: no matching registerThread"),
"JavaVirtualMachine::revokeThread:"
" no matching registerThread"),
static_cast< cppu::OWeakObject * >(this)); static_cast< cppu::OWeakObject * >(this));
delete pStack->top(); delete pStack->top();
pStack->pop(); pStack->pop();
@@ -1106,74 +1080,62 @@ void SAL_CALL JavaVirtualMachine::elementReplaced(
} }
else if ( aAccessor == "ooInetHTTPProxyName" ) else if ( aAccessor == "ooInetHTTPProxyName" )
{ {
aPropertyName = OUString( aPropertyName = OUString("http.proxyHost");
"http.proxyHost");
rEvent.Element >>= aPropertyValue; rEvent.Element >>= aPropertyValue;
} }
else if ( aAccessor == "ooInetHTTPProxyPort" ) else if ( aAccessor == "ooInetHTTPProxyPort" )
{ {
aPropertyName aPropertyName = OUString("http.proxyPort");
= OUString("http.proxyPort");
sal_Int32 n = 0; sal_Int32 n = 0;
rEvent.Element >>= n; rEvent.Element >>= n;
aPropertyValue = OUString::valueOf(n); aPropertyValue = OUString::valueOf(n);
} }
else if ( aAccessor == "ooInetHTTPSProxyName" ) else if ( aAccessor == "ooInetHTTPSProxyName" )
{ {
aPropertyName = OUString( aPropertyName = OUString("https.proxyHost");
"https.proxyHost");
rEvent.Element >>= aPropertyValue; rEvent.Element >>= aPropertyValue;
} }
else if ( aAccessor == "ooInetHTTPSProxyPort" ) else if ( aAccessor == "ooInetHTTPSProxyPort" )
{ {
aPropertyName aPropertyName = OUString("https.proxyPort");
= OUString("https.proxyPort");
sal_Int32 n = 0; sal_Int32 n = 0;
rEvent.Element >>= n; rEvent.Element >>= n;
aPropertyValue = OUString::valueOf(n); aPropertyValue = OUString::valueOf(n);
} }
else if ( aAccessor == "ooInetFTPProxyName" ) else if ( aAccessor == "ooInetFTPProxyName" )
{ {
aPropertyName = OUString( aPropertyName = OUString("ftp.proxyHost");
"ftp.proxyHost");
rEvent.Element >>= aPropertyValue; rEvent.Element >>= aPropertyValue;
} }
else if ( aAccessor == "ooInetFTPProxyPort" ) else if ( aAccessor == "ooInetFTPProxyPort" )
{ {
aPropertyName = OUString( aPropertyName = OUString("ftp.proxyPort");
"ftp.proxyPort");
sal_Int32 n = 0; sal_Int32 n = 0;
rEvent.Element >>= n; rEvent.Element >>= n;
aPropertyValue = OUString::valueOf(n); aPropertyValue = OUString::valueOf(n);
} }
else if ( aAccessor == "ooInetNoProxy" ) else if ( aAccessor == "ooInetNoProxy" )
{ {
aPropertyName = OUString( aPropertyName = OUString("http.nonProxyHosts");
"http.nonProxyHosts"); aPropertyName2 = OUString("ftp.nonProxyHosts");
aPropertyName2 = OUString(
"ftp.nonProxyHosts");
rEvent.Element >>= aPropertyValue; rEvent.Element >>= aPropertyValue;
aPropertyValue = aPropertyValue.replace(';', '|'); aPropertyValue = aPropertyValue.replace(';', '|');
} }
else if ( aAccessor == "NetAccess" ) else if ( aAccessor == "NetAccess" )
{ {
aPropertyName = OUString( aPropertyName = OUString("appletviewer.security.mode");
"appletviewer.security.mode");
sal_Int32 n = 0; sal_Int32 n = 0;
if (rEvent.Element >>= n) if (rEvent.Element >>= n)
switch (n) switch (n)
{ {
case 0: case 0:
aPropertyValue = OUString( aPropertyValue = OUString("host");
"host");
break; break;
case 1: case 1:
aPropertyValue = OUString( aPropertyValue = OUString("unrestricted");
"unrestricted");
break; break;
case 3: case 3:
aPropertyValue = OUString( aPropertyValue = OUString("none");
"none");
break; break;
} }
else else
@@ -1182,16 +1144,13 @@ void SAL_CALL JavaVirtualMachine::elementReplaced(
} }
else if ( aAccessor == "Security" ) else if ( aAccessor == "Security" )
{ {
aPropertyName = OUString( aPropertyName = OUString("stardiv.security.disableSecurity");
"stardiv.security.disableSecurity");
sal_Bool b = sal_Bool(); sal_Bool b = sal_Bool();
if (rEvent.Element >>= b) if (rEvent.Element >>= b)
if (b) if (b)
aPropertyValue = OUString( aPropertyValue = OUString("false");
"false");
else else
aPropertyValue = OUString( aPropertyValue = OUString("true");
"true");
else else
return; return;
bSecurityChanged = true; bSecurityChanged = true;
@@ -1320,9 +1279,7 @@ void SAL_CALL JavaVirtualMachine::elementReplaced(
catch (jvmaccess::VirtualMachine::AttachGuard::CreationException &) catch (jvmaccess::VirtualMachine::AttachGuard::CreationException &)
{ {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
OUString( OUString("jvmaccess::VirtualMachine::AttachGuard::CreationException"),
"jvmaccess::VirtualMachine::AttachGuard::"
"CreationException"),
0); 0);
} }
} }
@@ -1404,8 +1361,7 @@ void JavaVirtualMachine::registerConfigChangesListener()
m_xInetConfiguration m_xInetConfiguration
= css::uno::Reference< css::container::XContainer >( = css::uno::Reference< css::container::XContainer >(
xConfigProvider->createInstanceWithArguments( xConfigProvider->createInstanceWithArguments(
OUString( OUString("com.sun.star.configuration.ConfigurationAccess"),
"com.sun.star.configuration.ConfigurationAccess"),
aArguments), aArguments),
css::uno::UNO_QUERY); css::uno::UNO_QUERY);
@@ -1429,8 +1385,7 @@ void JavaVirtualMachine::registerConfigChangesListener()
m_xJavaConfiguration m_xJavaConfiguration
= css::uno::Reference< css::container::XContainer >( = css::uno::Reference< css::container::XContainer >(
xConfigProvider->createInstanceWithArguments( xConfigProvider->createInstanceWithArguments(
OUString( OUString("com.sun.star.configuration.ConfigurationAccess"),
"com.sun.star.configuration.ConfigurationAccess"),
aArguments2), aArguments2),
css::uno::UNO_QUERY); css::uno::UNO_QUERY);
@@ -1589,8 +1544,7 @@ void JavaVirtualMachine::setUpUnoVirtualMachine(JNIEnv * environment) {
OUString("$URE_INTERNAL_JAVA_DIR/")); OUString("$URE_INTERNAL_JAVA_DIR/"));
} catch (css::lang::IllegalArgumentException &) { } catch (css::lang::IllegalArgumentException &) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
OUString( OUString("com::sun::star::lang::IllegalArgumentException"),
"com::sun::star::lang::IllegalArgumentException"),
static_cast< cppu::OWeakObject * >(this)); static_cast< cppu::OWeakObject * >(this));
} }
OUString classPath; OUString classPath;
@@ -1691,8 +1645,7 @@ void JavaVirtualMachine::setUpUnoVirtualMachine(JNIEnv * environment) {
m_xVirtualMachine, cl2); m_xVirtualMachine, cl2);
} catch (jvmaccess::UnoVirtualMachine::CreationException &) { } catch (jvmaccess::UnoVirtualMachine::CreationException &) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
OUString( OUString("jvmaccess::UnoVirtualMachine::CreationException"),
"jvmaccess::UnoVirtualMachine::CreationException"),
static_cast< cppu::OWeakObject * >(this)); static_cast< cppu::OWeakObject * >(this));
} }
} }

View File

@@ -337,8 +337,7 @@ ServiceTypeDescriptionImpl::getConstructors() throw (RuntimeException) {
|| reader.getMethodExceptionCount(i) != 0))) || reader.getMethodExceptionCount(i) != 0)))
{ {
throw RuntimeException( throw RuntimeException(
OUString( OUString("Service has bad constructors"),
"Service has bad constructors"),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
(*ctors)[i] = new Constructor( (*ctors)[i] = new Constructor(
@@ -364,8 +363,7 @@ void ServiceTypeDescriptionImpl::getReferences()
sal_uInt16 superTypes = aReader.getSuperTypeCount(); sal_uInt16 superTypes = aReader.getSuperTypeCount();
if (superTypes > 1) { if (superTypes > 1) {
throw RuntimeException( throw RuntimeException(
OUString( OUString("Service has more than one supertype"),
"Service has more than one supertype"),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
if (superTypes == 1) { if (superTypes == 1) {
@@ -373,9 +371,8 @@ void ServiceTypeDescriptionImpl::getReferences()
if ( aReader.getReferenceCount() != 0 if ( aReader.getReferenceCount() != 0
|| aReader.getFieldCount() != 0 ) || aReader.getFieldCount() != 0 )
throw RuntimeException( throw RuntimeException(
OUString( OUString("Service is single-interface--based but also has"
"Service is single-interface--based but also has" " references and/or properties" ),
" references and/or properties" ),
static_cast< OWeakObject * >( this ) ); static_cast< OWeakObject * >( this ) );
Reference< XTypeDescription > ifc; Reference< XTypeDescription > ifc;
try try
@@ -385,17 +382,15 @@ void ServiceTypeDescriptionImpl::getReferences()
catch ( NoSuchElementException const & e ) catch ( NoSuchElementException const & e )
{ {
throw RuntimeException( throw RuntimeException(
OUString( OUString("com.sun.star.container.NoSuchElementException: " )
"com.sun.star.container.NoSuchElementException: " )
+ e.Message, + e.Message,
static_cast< OWeakObject * >( this ) ); static_cast< OWeakObject * >( this ) );
} }
OSL_ASSERT(ifc.is()); OSL_ASSERT(ifc.is());
if (resolveTypedefs(ifc)->getTypeClass() != TypeClass_INTERFACE) { if (resolveTypedefs(ifc)->getTypeClass() != TypeClass_INTERFACE) {
throw RuntimeException( throw RuntimeException(
OUString( OUString("Single-interface--based service is not based on"
"Single-interface--based service is not based on" " interface type" ),
" interface type" ),
static_cast< OWeakObject * >( this ) ); static_cast< OWeakObject * >( this ) );
} }
MutexGuard guard(getMutex()); MutexGuard guard(getMutex());
@@ -437,9 +432,7 @@ void ServiceTypeDescriptionImpl::getReferences()
catch ( NoSuchElementException const & e ) catch ( NoSuchElementException const & e )
{ {
throw RuntimeException( throw RuntimeException(
OUString( OUString("com.sun.star.container.NoSuchElementException: " )
"com.sun.star.container."
"NoSuchElementException: " )
+ e.Message, + e.Message,
static_cast< OWeakObject * >( this ) ); static_cast< OWeakObject * >( this ) );
} }
@@ -450,8 +443,7 @@ void ServiceTypeDescriptionImpl::getReferences()
// optional service // optional service
if ( !( aTypeDesc >>= aOptionalServices[ nOS ] ) ) if ( !( aTypeDesc >>= aOptionalServices[ nOS ] ) )
throw RuntimeException( throw RuntimeException(
OUString( OUString("Service 'export' is not a service" ),
"Service 'export' is not a service" ),
static_cast< OWeakObject * >( this ) ); static_cast< OWeakObject * >( this ) );
nOS++; nOS++;
} }
@@ -460,8 +452,7 @@ void ServiceTypeDescriptionImpl::getReferences()
// mandatory service // mandatory service
if ( !( aTypeDesc >>= aMandatoryServices[ nMS ] ) ) if ( !( aTypeDesc >>= aMandatoryServices[ nMS ] ) )
throw RuntimeException( throw RuntimeException(
OUString( OUString("Service 'export' is not a service" ),
"Service 'export' is not a service" ),
static_cast< OWeakObject * >( this ) ); static_cast< OWeakObject * >( this ) );
nMS++; nMS++;
} }
@@ -479,9 +470,7 @@ void ServiceTypeDescriptionImpl::getReferences()
catch ( NoSuchElementException const & e ) catch ( NoSuchElementException const & e )
{ {
throw RuntimeException( throw RuntimeException(
OUString( OUString("com.sun.star.container.NoSuchElementException: " )
"com.sun.star.container."
"NoSuchElementException: " )
+ e.Message, + e.Message,
static_cast< OWeakObject * >( this ) ); static_cast< OWeakObject * >( this ) );
} }
@@ -492,9 +481,8 @@ void ServiceTypeDescriptionImpl::getReferences()
// optional interface // optional interface
if ( !( aTypeDesc >>= aOptionalInterfaces[ nOI ] ) ) if ( !( aTypeDesc >>= aOptionalInterfaces[ nOI ] ) )
throw RuntimeException( throw RuntimeException(
OUString( OUString("Service 'supports' is not an"
"Service 'supports' is not an" " interface" ),
" interface" ),
static_cast< OWeakObject * >( this ) ); static_cast< OWeakObject * >( this ) );
nOI++; nOI++;
} }
@@ -503,9 +491,8 @@ void ServiceTypeDescriptionImpl::getReferences()
// mandatory interface // mandatory interface
if ( !( aTypeDesc >>= aMandatoryInterfaces[ nMI ] ) ) if ( !( aTypeDesc >>= aMandatoryInterfaces[ nMI ] ) )
throw RuntimeException( throw RuntimeException(
OUString( OUString("Service 'supports' is not an"
"Service 'supports' is not an" " interface" ),
" interface" ),
static_cast< OWeakObject * >( this ) ); static_cast< OWeakObject * >( this ) );
nMI++; nMI++;
} }

View File

@@ -230,14 +230,12 @@ private:
virtual void SAL_CALL deleteLink(OUString const & rLinkName) throw ( virtual void SAL_CALL deleteLink(OUString const & rLinkName) throw (
css::registry::InvalidRegistryException, css::uno::RuntimeException); css::registry::InvalidRegistryException, css::uno::RuntimeException);
virtual OUString SAL_CALL getLinkTarget( virtual OUString SAL_CALL getLinkTarget(OUString const & rLinkName)
OUString const & rLinkName)
throw ( throw (
css::registry::InvalidRegistryException, css::registry::InvalidRegistryException,
css::uno::RuntimeException); css::uno::RuntimeException);
virtual OUString SAL_CALL getResolvedName( virtual OUString SAL_CALL getResolvedName(OUString const & aKeyName)
OUString const & aKeyName)
throw ( throw (
css::registry::InvalidRegistryException, css::registry::InvalidRegistryException,
css::uno::RuntimeException); css::uno::RuntimeException);
@@ -271,9 +269,8 @@ css::registry::RegistryKeyType Key::getKeyType(OUString const & rKeyName)
RegError err = key_.getKeyType(rKeyName, &type); RegError err = key_.getKeyType(rKeyName, &type);
if (err != REG_NO_ERROR) { if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key getKeyType:"
"com.sun.star.registry.SimpleRegistry key getKeyType:" " underlying RegistryKey::getKeyType() = ") +
" underlying RegistryKey::getKeyType() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
@@ -303,9 +300,8 @@ css::registry::RegistryValueType Key::getValueType()
break; break;
default: default:
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key getValueType:"
"com.sun.star.registry.SimpleRegistry key getValueType:" " underlying RegistryKey::getValueInfo() = ") +
" underlying RegistryKey::getValueInfo() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
@@ -344,15 +340,13 @@ sal_Int32 Key::getLongValue() throw (
break; break;
case REG_INVALID_VALUE: case REG_INVALID_VALUE:
throw css::registry::InvalidValueException( throw css::registry::InvalidValueException(
OUString( OUString("com.sun.star.registry.SimpleRegistry key getLongValue:"
"com.sun.star.registry.SimpleRegistry key getLongValue:" " underlying RegistryKey::getValue() = REG_INVALID_VALUE"),
" underlying RegistryKey::getValue() = REG_INVALID_VALUE"),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
default: default:
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key getLongValue:"
"com.sun.star.registry.SimpleRegistry key getLongValue:" " underlying RegistryKey::getValue() = ") +
" underlying RegistryKey::getValue() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
@@ -367,9 +361,8 @@ void Key::setLongValue(sal_Int32 value)
OUString(), RG_VALUETYPE_LONG, &value, sizeof (sal_Int32)); OUString(), RG_VALUETYPE_LONG, &value, sizeof (sal_Int32));
if (err != REG_NO_ERROR) { if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key setLongValue:"
"com.sun.star.registry.SimpleRegistry key setLongValue:" " underlying RegistryKey::setValue() = ") +
" underlying RegistryKey::setValue() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
@@ -389,25 +382,22 @@ css::uno::Sequence< sal_Int32 > Key::getLongListValue() throw (
return css::uno::Sequence< sal_Int32 >(); return css::uno::Sequence< sal_Int32 >();
case REG_INVALID_VALUE: case REG_INVALID_VALUE:
throw css::registry::InvalidValueException( throw css::registry::InvalidValueException(
OUString( OUString("com.sun.star.registry.SimpleRegistry key getLongListValue:"
"com.sun.star.registry.SimpleRegistry key getLongListValue:" " underlying RegistryKey::getLongListValue() ="
" underlying RegistryKey::getLongListValue() =" " REG_INVALID_VALUE"),
" REG_INVALID_VALUE"),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
default: default:
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key getLongListValue:"
"com.sun.star.registry.SimpleRegistry key getLongListValue:" " underlying RegistryKey::getLongListValue() = ") +
" underlying RegistryKey::getLongListValue() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
sal_uInt32 n = list.getLength(); sal_uInt32 n = list.getLength();
if (n > SAL_MAX_INT32) { if (n > SAL_MAX_INT32) {
throw css::registry::InvalidValueException( throw css::registry::InvalidValueException(
OUString( OUString("com.sun.star.registry.SimpleRegistry key getLongListValue:"
"com.sun.star.registry.SimpleRegistry key getLongListValue:" " underlying RegistryKey::getLongListValue() too large"),
" underlying RegistryKey::getLongListValue() too large"),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
css::uno::Sequence< sal_Int32 > value(static_cast< sal_Int32 >(n)); css::uno::Sequence< sal_Int32 > value(static_cast< sal_Int32 >(n));
@@ -430,9 +420,8 @@ void Key::setLongListValue(css::uno::Sequence< sal_Int32 > const & seqValue)
static_cast< sal_uInt32 >(list.size())); static_cast< sal_uInt32 >(list.size()));
if (err != REG_NO_ERROR) { if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key setLongListValue:"
"com.sun.star.registry.SimpleRegistry key setLongListValue:" " underlying RegistryKey::setLongListValue() = ") +
" underlying RegistryKey::setLongListValue() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
@@ -448,52 +437,46 @@ OUString Key::getAsciiValue() throw (
RegError err = key_.getValueInfo(OUString(), &type, &size); RegError err = key_.getValueInfo(OUString(), &type, &size);
if (err != REG_NO_ERROR) { if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key getAsciiValue:"
"com.sun.star.registry.SimpleRegistry key getAsciiValue:" " underlying RegistryKey::getValueInfo() = ") +
" underlying RegistryKey::getValueInfo() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
if (type != RG_VALUETYPE_STRING) { if (type != RG_VALUETYPE_STRING) {
throw css::registry::InvalidValueException( throw css::registry::InvalidValueException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key getAsciiValue:"
"com.sun.star.registry.SimpleRegistry key getAsciiValue:" " underlying RegistryKey type = ") +
" underlying RegistryKey type = ") +
OUString::number(type)), OUString::number(type)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
// size contains terminating null (error in underlying registry.cxx): // size contains terminating null (error in underlying registry.cxx):
if (size == 0) { if (size == 0) {
throw css::registry::InvalidValueException( throw css::registry::InvalidValueException(
OUString( OUString("com.sun.star.registry.SimpleRegistry key getAsciiValue:"
"com.sun.star.registry.SimpleRegistry key getAsciiValue:" " underlying RegistryKey size 0 cannot happen due to"
" underlying RegistryKey size 0 cannot happen due to" " design error"),
" design error"),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
if (size > SAL_MAX_INT32) { if (size > SAL_MAX_INT32) {
throw css::registry::InvalidValueException( throw css::registry::InvalidValueException(
OUString( OUString("com.sun.star.registry.SimpleRegistry key getAsciiValue:"
"com.sun.star.registry.SimpleRegistry key getAsciiValue:" " underlying RegistryKey size too large"),
" underlying RegistryKey size too large"),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
std::vector< char > list(size); std::vector< char > list(size);
err = key_.getValue(OUString(), &list[0]); err = key_.getValue(OUString(), &list[0]);
if (err != REG_NO_ERROR) { if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key getAsciiValue:"
"com.sun.star.registry.SimpleRegistry key getAsciiValue:" " underlying RegistryKey::getValue() = ") +
" underlying RegistryKey::getValue() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
if (list[size - 1] != '\0') { if (list[size - 1] != '\0') {
throw css::registry::InvalidValueException( throw css::registry::InvalidValueException(
OUString( OUString("com.sun.star.registry.SimpleRegistry key getAsciiValue:"
"com.sun.star.registry.SimpleRegistry key getAsciiValue:" " underlying RegistryKey value must be null-terminated due"
" underlying RegistryKey value must be null-terminated due" " to design error"),
" to design error"),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
OUString value; OUString value;
@@ -505,9 +488,8 @@ OUString Key::getAsciiValue() throw (
RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR))) RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR)))
{ {
throw css::registry::InvalidValueException( throw css::registry::InvalidValueException(
OUString( OUString("com.sun.star.registry.SimpleRegistry key getAsciiValue:"
"com.sun.star.registry.SimpleRegistry key getAsciiValue:" " underlying RegistryKey not UTF-8"),
" underlying RegistryKey not UTF-8"),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
return value; return value;
@@ -524,9 +506,8 @@ void Key::setAsciiValue(OUString const & value)
RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR))) RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR)))
{ {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
OUString( OUString("com.sun.star.registry.SimpleRegistry key setAsciiValue:"
"com.sun.star.registry.SimpleRegistry key setAsciiValue:" " value not UTF-16"),
" value not UTF-16"),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
RegError err = key_.setValue( RegError err = key_.setValue(
@@ -535,9 +516,8 @@ void Key::setAsciiValue(OUString const & value)
// +1 for terminating null (error in underlying registry.cxx) // +1 for terminating null (error in underlying registry.cxx)
if (err != REG_NO_ERROR) { if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key setAsciiValue:"
"com.sun.star.registry.SimpleRegistry key setAsciiValue:" " underlying RegistryKey::setValue() = ") +
" underlying RegistryKey::setValue() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
@@ -557,27 +537,24 @@ css::uno::Sequence< OUString > Key::getAsciiListValue() throw (
return css::uno::Sequence< OUString >(); return css::uno::Sequence< OUString >();
case REG_INVALID_VALUE: case REG_INVALID_VALUE:
throw css::registry::InvalidValueException( throw css::registry::InvalidValueException(
OUString( OUString("com.sun.star.registry.SimpleRegistry key"
"com.sun.star.registry.SimpleRegistry key" " getAsciiListValue: underlying"
" getAsciiListValue: underlying" " RegistryKey::getStringListValue() = REG_INVALID_VALUE"),
" RegistryKey::getStringListValue() = REG_INVALID_VALUE"),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
default: default:
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key"
"com.sun.star.registry.SimpleRegistry key" " getAsciiListValue: underlying"
" getAsciiListValue: underlying" " RegistryKey::getStringListValue() = ") +
" RegistryKey::getStringListValue() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
sal_uInt32 n = list.getLength(); sal_uInt32 n = list.getLength();
if (n > SAL_MAX_INT32) { if (n > SAL_MAX_INT32) {
throw css::registry::InvalidValueException( throw css::registry::InvalidValueException(
OUString( OUString("com.sun.star.registry.SimpleRegistry key"
"com.sun.star.registry.SimpleRegistry key" " getAsciiListValue: underlying"
" getAsciiListValue: underlying" " RegistryKey::getStringListValue() too large"),
" RegistryKey::getStringListValue() too large"),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
css::uno::Sequence< OUString > value(static_cast< sal_Int32 >(n)); css::uno::Sequence< OUString > value(static_cast< sal_Int32 >(n));
@@ -592,10 +569,9 @@ css::uno::Sequence< OUString > Key::getAsciiListValue() throw (
RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR))) RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR)))
{ {
throw css::registry::InvalidValueException( throw css::registry::InvalidValueException(
OUString( OUString("com.sun.star.registry.SimpleRegistry key"
"com.sun.star.registry.SimpleRegistry key" " getAsciiListValue: underlying RegistryKey not"
" getAsciiListValue: underlying RegistryKey not" " UTF-8"),
" UTF-8"),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
} }
@@ -616,9 +592,8 @@ void Key::setAsciiListValue(
RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR))) RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR)))
{ {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
OUString( OUString("com.sun.star.registry.SimpleRegistry key"
"com.sun.star.registry.SimpleRegistry key" " setAsciiListValue: value not UTF-16"),
" setAsciiListValue: value not UTF-16"),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
list.push_back(utf8); list.push_back(utf8);
@@ -634,10 +609,9 @@ void Key::setAsciiListValue(
static_cast< sal_uInt32 >(list2.size())); static_cast< sal_uInt32 >(list2.size()));
if (err != REG_NO_ERROR) { if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key"
"com.sun.star.registry.SimpleRegistry key" " setAsciiListValue: underlying"
" setAsciiListValue: underlying" " RegistryKey::setStringListValue() = ") +
" RegistryKey::setStringListValue() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
@@ -653,17 +627,15 @@ OUString Key::getStringValue() throw (
RegError err = key_.getValueInfo(OUString(), &type, &size); RegError err = key_.getValueInfo(OUString(), &type, &size);
if (err != REG_NO_ERROR) { if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key getStringValue:"
"com.sun.star.registry.SimpleRegistry key getStringValue:" " underlying RegistryKey::getValueInfo() = ") +
" underlying RegistryKey::getValueInfo() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
if (type != RG_VALUETYPE_UNICODE) { if (type != RG_VALUETYPE_UNICODE) {
throw css::registry::InvalidValueException( throw css::registry::InvalidValueException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key getStringValue:"
"com.sun.star.registry.SimpleRegistry key getStringValue:" " underlying RegistryKey type = ") +
" underlying RegistryKey type = ") +
OUString::number(type)), OUString::number(type)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
@@ -671,35 +643,31 @@ OUString Key::getStringValue() throw (
// registry.cxx): // registry.cxx):
if (size == 0 || (size & 1) == 1) { if (size == 0 || (size & 1) == 1) {
throw css::registry::InvalidValueException( throw css::registry::InvalidValueException(
OUString( OUString("com.sun.star.registry.SimpleRegistry key getStringValue:"
"com.sun.star.registry.SimpleRegistry key getStringValue:" " underlying RegistryKey size 0 or odd cannot happen due to"
" underlying RegistryKey size 0 or odd cannot happen due to" " design error"),
" design error"),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
if (size > SAL_MAX_INT32) { if (size > SAL_MAX_INT32) {
throw css::registry::InvalidValueException( throw css::registry::InvalidValueException(
OUString( OUString("com.sun.star.registry.SimpleRegistry key getStringValue:"
"com.sun.star.registry.SimpleRegistry key getStringValue:" " underlying RegistryKey size too large"),
" underlying RegistryKey size too large"),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
std::vector< sal_Unicode > list(size); std::vector< sal_Unicode > list(size);
err = key_.getValue(OUString(), &list[0]); err = key_.getValue(OUString(), &list[0]);
if (err != REG_NO_ERROR) { if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key getStringValue:"
"com.sun.star.registry.SimpleRegistry key getStringValue:" " underlying RegistryKey::getValue() = ") +
" underlying RegistryKey::getValue() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
if (list[size/2 - 1] != 0) { if (list[size/2 - 1] != 0) {
throw css::registry::InvalidValueException( throw css::registry::InvalidValueException(
OUString( OUString("com.sun.star.registry.SimpleRegistry key getStringValue:"
"com.sun.star.registry.SimpleRegistry key getStringValue:" " underlying RegistryKey value must be null-terminated due"
" underlying RegistryKey value must be null-terminated due" " to design error"),
" to design error"),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
return OUString(&list[0], static_cast< sal_Int32 >(size/2 - 1)); return OUString(&list[0], static_cast< sal_Int32 >(size/2 - 1));
@@ -716,9 +684,8 @@ void Key::setStringValue(OUString const & value)
// +1 for terminating null (error in underlying registry.cxx) // +1 for terminating null (error in underlying registry.cxx)
if (err != REG_NO_ERROR) { if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key setStringValue:"
"com.sun.star.registry.SimpleRegistry key setStringValue:" " underlying RegistryKey::setValue() = ") +
" underlying RegistryKey::setValue() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
@@ -738,27 +705,24 @@ css::uno::Sequence< OUString > Key::getStringListValue() throw (
return css::uno::Sequence< OUString >(); return css::uno::Sequence< OUString >();
case REG_INVALID_VALUE: case REG_INVALID_VALUE:
throw css::registry::InvalidValueException( throw css::registry::InvalidValueException(
OUString( OUString("com.sun.star.registry.SimpleRegistry key"
"com.sun.star.registry.SimpleRegistry key" " getStringListValue: underlying"
" getStringListValue: underlying" " RegistryKey::getUnicodeListValue() = REG_INVALID_VALUE"),
" RegistryKey::getUnicodeListValue() = REG_INVALID_VALUE"),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
default: default:
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key"
"com.sun.star.registry.SimpleRegistry key" " getStringListValue: underlying"
" getStringListValue: underlying" " RegistryKey::getUnicodeListValue() = ") +
" RegistryKey::getUnicodeListValue() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
sal_uInt32 n = list.getLength(); sal_uInt32 n = list.getLength();
if (n > SAL_MAX_INT32) { if (n > SAL_MAX_INT32) {
throw css::registry::InvalidValueException( throw css::registry::InvalidValueException(
OUString( OUString("com.sun.star.registry.SimpleRegistry key"
"com.sun.star.registry.SimpleRegistry key" " getStringListValue: underlying"
" getStringListValue: underlying" " RegistryKey::getUnicodeListValue() too large"),
" RegistryKey::getUnicodeListValue() too large"),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
css::uno::Sequence< OUString > value(static_cast< sal_Int32 >(n)); css::uno::Sequence< OUString > value(static_cast< sal_Int32 >(n));
@@ -782,10 +746,9 @@ void Key::setStringListValue(
static_cast< sal_uInt32 >(list.size())); static_cast< sal_uInt32 >(list.size()));
if (err != REG_NO_ERROR) { if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key"
"com.sun.star.registry.SimpleRegistry key" " setStringListValue: underlying"
" setStringListValue: underlying" " RegistryKey::setUnicodeListValue() = ") +
" RegistryKey::setUnicodeListValue() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
@@ -802,34 +765,30 @@ css::uno::Sequence< sal_Int8 > Key::getBinaryValue()
RegError err = key_.getValueInfo(OUString(), &type, &size); RegError err = key_.getValueInfo(OUString(), &type, &size);
if (err != REG_NO_ERROR) { if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key getBinaryValue:"
"com.sun.star.registry.SimpleRegistry key getBinaryValue:" " underlying RegistryKey::getValueInfo() = ") +
" underlying RegistryKey::getValueInfo() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
if (type != RG_VALUETYPE_BINARY) { if (type != RG_VALUETYPE_BINARY) {
throw css::registry::InvalidValueException( throw css::registry::InvalidValueException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key getBinaryValue:"
"com.sun.star.registry.SimpleRegistry key getBinaryValue:" " underlying RegistryKey type = ") +
" underlying RegistryKey type = ") +
OUString::number(type)), OUString::number(type)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
if (size > SAL_MAX_INT32) { if (size > SAL_MAX_INT32) {
throw css::registry::InvalidValueException( throw css::registry::InvalidValueException(
OUString( OUString("com.sun.star.registry.SimpleRegistry key getBinaryValue:"
"com.sun.star.registry.SimpleRegistry key getBinaryValue:" " underlying RegistryKey size too large"),
" underlying RegistryKey size too large"),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
css::uno::Sequence< sal_Int8 > value(static_cast< sal_Int32 >(size)); css::uno::Sequence< sal_Int8 > value(static_cast< sal_Int32 >(size));
err = key_.getValue(OUString(), value.getArray()); err = key_.getValue(OUString(), value.getArray());
if (err != REG_NO_ERROR) { if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key getBinaryValue:"
"com.sun.star.registry.SimpleRegistry key getBinaryValue:" " underlying RegistryKey::getValue() = ") +
" underlying RegistryKey::getValue() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
@@ -846,9 +805,8 @@ void Key::setBinaryValue(css::uno::Sequence< sal_Int8 > const & value)
static_cast< sal_uInt32 >(value.getLength())); static_cast< sal_uInt32 >(value.getLength()));
if (err != REG_NO_ERROR) { if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key setBinaryValue:"
"com.sun.star.registry.SimpleRegistry key setBinaryValue:" " underlying RegistryKey::setValue() = ") +
" underlying RegistryKey::setValue() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
@@ -868,9 +826,8 @@ css::uno::Reference< css::registry::XRegistryKey > Key::openKey(
return css::uno::Reference< css::registry::XRegistryKey >(); return css::uno::Reference< css::registry::XRegistryKey >();
default: default:
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key openKey:"
"com.sun.star.registry.SimpleRegistry key openKey:" " underlying RegistryKey::openKey() = ") +
" underlying RegistryKey::openKey() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
@@ -890,9 +847,8 @@ css::uno::Reference< css::registry::XRegistryKey > Key::createKey(
return css::uno::Reference< css::registry::XRegistryKey >(); return css::uno::Reference< css::registry::XRegistryKey >();
default: default:
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key createKey:"
"com.sun.star.registry.SimpleRegistry key createKey:" " underlying RegistryKey::createKey() = ") +
" underlying RegistryKey::createKey() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
@@ -905,9 +861,8 @@ void Key::closeKey()
RegError err = key_.closeKey(); RegError err = key_.closeKey();
if (err != REG_NO_ERROR) { if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key closeKey:"
"com.sun.star.registry.SimpleRegistry key closeKey:" " underlying RegistryKey::closeKey() = ") +
" underlying RegistryKey::closeKey() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
@@ -920,9 +875,8 @@ void Key::deleteKey(OUString const & rKeyName)
RegError err = key_.deleteKey(rKeyName); RegError err = key_.deleteKey(rKeyName);
if (err != REG_NO_ERROR) { if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key deleteKey:"
"com.sun.star.registry.SimpleRegistry key deleteKey:" " underlying RegistryKey::deleteKey() = ") +
" underlying RegistryKey::deleteKey() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
@@ -937,18 +891,16 @@ Key::openKeys()
RegError err = key_.openSubKeys(OUString(), list); RegError err = key_.openSubKeys(OUString(), list);
if (err != REG_NO_ERROR) { if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key openKeys:"
"com.sun.star.registry.SimpleRegistry key openKeys:" " underlying RegistryKey::openSubKeys() = ") +
" underlying RegistryKey::openSubKeys() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
sal_uInt32 n = list.getLength(); sal_uInt32 n = list.getLength();
if (n > SAL_MAX_INT32) { if (n > SAL_MAX_INT32) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
OUString( OUString("com.sun.star.registry.SimpleRegistry key getKeyNames:"
"com.sun.star.registry.SimpleRegistry key getKeyNames:" " underlying RegistryKey::getKeyNames() too large"),
" underlying RegistryKey::getKeyNames() too large"),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
css::uno::Sequence< css::uno::Reference< css::registry::XRegistryKey > > css::uno::Sequence< css::uno::Reference< css::registry::XRegistryKey > >
@@ -968,18 +920,16 @@ css::uno::Sequence< OUString > Key::getKeyNames()
RegError err = key_.getKeyNames(OUString(), list); RegError err = key_.getKeyNames(OUString(), list);
if (err != REG_NO_ERROR) { if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key getKeyNames:"
"com.sun.star.registry.SimpleRegistry key getKeyNames:" " underlying RegistryKey::getKeyNames() = ") +
" underlying RegistryKey::getKeyNames() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
sal_uInt32 n = list.getLength(); sal_uInt32 n = list.getLength();
if (n > SAL_MAX_INT32) { if (n > SAL_MAX_INT32) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
OUString( OUString("com.sun.star.registry.SimpleRegistry key getKeyNames:"
"com.sun.star.registry.SimpleRegistry key getKeyNames:" " underlying RegistryKey::getKeyNames() too large"),
" underlying RegistryKey::getKeyNames() too large"),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
css::uno::Sequence< OUString > names(static_cast< sal_Int32 >(n)); css::uno::Sequence< OUString > names(static_cast< sal_Int32 >(n));
@@ -1001,9 +951,8 @@ sal_Bool Key::createLink(
case REG_INVALID_KEY: case REG_INVALID_KEY:
case REG_DETECT_RECURSION: case REG_DETECT_RECURSION:
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key createLink:"
"com.sun.star.registry.SimpleRegistry key createLink:" " underlying RegistryKey::createLink() = ") +
" underlying RegistryKey::createLink() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
default: default:
@@ -1018,9 +967,8 @@ void Key::deleteLink(OUString const & rLinkName)
RegError err = key_.deleteLink(rLinkName); RegError err = key_.deleteLink(rLinkName);
if (err != REG_NO_ERROR) { if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key deleteLink:"
"com.sun.star.registry.SimpleRegistry key deleteLink:" " underlying RegistryKey::deleteLink() = ") +
" underlying RegistryKey::deleteLink() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
@@ -1034,9 +982,8 @@ OUString Key::getLinkTarget(OUString const & rLinkName)
RegError err = key_.getLinkTarget(rLinkName, target); RegError err = key_.getLinkTarget(rLinkName, target);
if (err != REG_NO_ERROR) { if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key getLinkTarget:"
"com.sun.star.registry.SimpleRegistry key getLinkTarget:" " underlying RegistryKey::getLinkTarget() = ") +
" underlying RegistryKey::getLinkTarget() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
@@ -1051,9 +998,8 @@ OUString Key::getResolvedName(OUString const & aKeyName)
RegError err = key_.getResolvedKeyName(aKeyName, true, resolved); RegError err = key_.getResolvedKeyName(aKeyName, true, resolved);
if (err != REG_NO_ERROR) { if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry key getResolvedName:"
"com.sun.star.registry.SimpleRegistry key getResolvedName:" " underlying RegistryKey::getResolvedName() = ") +
" underlying RegistryKey::getResolvedName() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
@@ -1078,11 +1024,9 @@ void SimpleRegistry::open(
} }
if (err != REG_NO_ERROR) { if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry.open(") +
"com.sun.star.registry.SimpleRegistry.open(") +
rURL + rURL +
OUString( OUString("): underlying Registry::open/create() = ") +
"): underlying Registry::open/create() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
@@ -1100,9 +1044,8 @@ void SimpleRegistry::close()
RegError err = registry_.close(); RegError err = registry_.close();
if (err != REG_NO_ERROR) { if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry.close:"
"com.sun.star.registry.SimpleRegistry.close:" " underlying Registry::close() = ") +
" underlying Registry::close() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
@@ -1115,9 +1058,8 @@ void SimpleRegistry::destroy()
RegError err = registry_.destroy(OUString()); RegError err = registry_.destroy(OUString());
if (err != REG_NO_ERROR) { if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry.destroy:"
"com.sun.star.registry.SimpleRegistry.destroy:" " underlying Registry::destroy() = ") +
" underlying Registry::destroy() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
@@ -1131,9 +1073,8 @@ css::uno::Reference< css::registry::XRegistryKey > SimpleRegistry::getRootKey()
RegError err = registry_.openRootKey(root); RegError err = registry_.openRootKey(root);
if (err != REG_NO_ERROR) { if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry.getRootKey:"
"com.sun.star.registry.SimpleRegistry.getRootKey:" " underlying Registry::getRootKey() = ") +
" underlying Registry::getRootKey() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }
@@ -1165,15 +1106,13 @@ void SimpleRegistry::mergeKey(
break; break;
case REG_MERGE_ERROR: case REG_MERGE_ERROR:
throw css::registry::MergeConflictException( throw css::registry::MergeConflictException(
OUString( OUString("com.sun.star.registry.SimpleRegistry.mergeKey:"
"com.sun.star.registry.SimpleRegistry.mergeKey:" " underlying Registry::mergeKey() = REG_MERGE_ERROR"),
" underlying Registry::mergeKey() = REG_MERGE_ERROR"),
static_cast< cppu::OWeakObject * >(this)); static_cast< cppu::OWeakObject * >(this));
default: default:
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
(OUString( (OUString("com.sun.star.registry.SimpleRegistry.mergeKey:"
"com.sun.star.registry.SimpleRegistry.mergeKey:" " underlying Registry::getRootKey/mergeKey() = ") +
" underlying Registry::getRootKey/mergeKey() = ") +
OUString::number(err)), OUString::number(err)),
static_cast< OWeakObject * >(this)); static_cast< OWeakObject * >(this));
} }

View File

@@ -260,9 +260,8 @@ void SwVbaRows::setIndentWithAdjustNone( sal_Int32 indent ) throw (uno::RuntimeE
if ((nNewWidth <= 0) || (nWidth <= 0)) if ((nNewWidth <= 0) || (nWidth <= 0))
{ {
throw uno::RuntimeException( throw uno::RuntimeException(
OUString( OUString("Pb with width, in SwVbaRows::setIndentWithAdjustProportional "
"Pb with width, in SwVbaRows::setIndentWithAdjustProportional (nNewWidth <= 0) || (nWidth <= 0)" "(nNewWidth <= 0) || (nWidth <= 0)"),
),
uno::Reference< uno::XInterface >() uno::Reference< uno::XInterface >()
); );
} }

View File

@@ -250,17 +250,13 @@ bool XmlReader::skipComment() {
pos_, end_ - pos_, RTL_CONSTASCII_STRINGPARAM("--")); pos_, end_ - pos_, RTL_CONSTASCII_STRINGPARAM("--"));
if (i < 0) { if (i < 0) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString( (OUString("premature end (within comment) of ") + fileUrl_),
"premature end (within comment) of ") +
fileUrl_),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
pos_ += i + RTL_CONSTASCII_LENGTH("--"); pos_ += i + RTL_CONSTASCII_LENGTH("--");
if (read() != '>') { if (read() != '>') {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString( (OUString("illegal \"--\" within comment in ") + fileUrl_),
"illegal \"--\" within comment in ") +
fileUrl_),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
return true; return true;
@@ -271,8 +267,7 @@ void XmlReader::skipProcessingInstruction() {
pos_, end_ - pos_, RTL_CONSTASCII_STRINGPARAM("?>")); pos_, end_ - pos_, RTL_CONSTASCII_STRINGPARAM("?>"));
if (i < 0) { if (i < 0) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString("bad '<?' in ") + (OUString("bad '<?' in ") + fileUrl_),
fileUrl_),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
pos_ += i + RTL_CONSTASCII_LENGTH("?>"); pos_ += i + RTL_CONSTASCII_LENGTH("?>");
@@ -286,9 +281,7 @@ void XmlReader::skipDocumentTypeDeclaration() {
switch (c) { switch (c) {
case '\0': // i.e., EOF case '\0': // i.e., EOF
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString( (OUString("premature end (within DTD) of ") + fileUrl_),
"premature end (within DTD) of ") +
fileUrl_),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
case '"': case '"':
case '\'': case '\'':
@@ -297,9 +290,7 @@ void XmlReader::skipDocumentTypeDeclaration() {
pos_, end_ - pos_, c); pos_, end_ - pos_, c);
if (i < 0) { if (i < 0) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString( (OUString("premature end (within DTD) of ") + fileUrl_),
"premature end (within DTD) of ") +
fileUrl_),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
pos_ += i + 1; pos_ += i + 1;
@@ -313,9 +304,7 @@ void XmlReader::skipDocumentTypeDeclaration() {
switch (c) { switch (c) {
case '\0': // i.e., EOF case '\0': // i.e., EOF
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString( (OUString("premature end (within DTD) of ") + fileUrl_),
"premature end (within DTD) of ") +
fileUrl_),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
case '"': case '"':
case '\'': case '\'':
@@ -324,8 +313,7 @@ void XmlReader::skipDocumentTypeDeclaration() {
pos_, end_ - pos_, c); pos_, end_ - pos_, c);
if (i < 0) { if (i < 0) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString( (OUString("premature end (within DTD) of ") +
"premature end (within DTD) of ") +
fileUrl_), fileUrl_),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
@@ -336,8 +324,7 @@ void XmlReader::skipDocumentTypeDeclaration() {
switch (read()) { switch (read()) {
case '\0': // i.e., EOF case '\0': // i.e., EOF
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString( (OUString("premature end (within DTD) of ") +
"premature end (within DTD) of ") +
fileUrl_), fileUrl_),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
case '!': case '!':
@@ -354,9 +341,7 @@ void XmlReader::skipDocumentTypeDeclaration() {
skipSpace(); skipSpace();
if (read() != '>') { if (read() != '>') {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString( (OUString("missing \">\" of DTD in ") + fileUrl_),
"missing \">\" of DTD in ") +
fileUrl_),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
return; return;
@@ -384,9 +369,7 @@ Span XmlReader::scanCdataSection() {
pos_, end_ - pos_, RTL_CONSTASCII_STRINGPARAM("]]>")); pos_, end_ - pos_, RTL_CONSTASCII_STRINGPARAM("]]>"));
if (i < 0) { if (i < 0) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString( (OUString("premature end (within CDATA section) of ") + fileUrl_),
"premature end (within CDATA section) of ") +
fileUrl_),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
pos_ += i + RTL_CONSTASCII_LENGTH("]]>"); pos_ += i + RTL_CONSTASCII_LENGTH("]]>");
@@ -450,9 +433,7 @@ char const * XmlReader::handleReference(char const * position, char const * end)
} }
if (val > 0x10FFFF) { // avoid overflow if (val > 0x10FFFF) { // avoid overflow
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString( (OUString("'&#x...' too large in ") + fileUrl_),
"'&#x...' too large in ") +
fileUrl_),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
} }
@@ -467,9 +448,7 @@ char const * XmlReader::handleReference(char const * position, char const * end)
} }
if (val > 0x10FFFF) { // avoid overflow if (val > 0x10FFFF) { // avoid overflow
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString( (OUString("'&#...' too large in ") + fileUrl_),
"'&#...' too large in ") +
fileUrl_),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
} }
@@ -485,8 +464,7 @@ char const * XmlReader::handleReference(char const * position, char const * end)
(val >= 0xD800 && val <= 0xDFFF) || val == 0xFFFE || val == 0xFFFF) (val >= 0xD800 && val <= 0xDFFF) || val == 0xFFFE || val == 0xFFFF)
{ {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString( (OUString("character reference denoting invalid character in ") +
"character reference denoting invalid character in ") +
fileUrl_), fileUrl_),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
@@ -543,8 +521,7 @@ char const * XmlReader::handleReference(char const * position, char const * end)
} }
} }
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString("unknown entity reference in ") + (OUString("unknown entity reference in ") + fileUrl_),
fileUrl_),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
} }
@@ -654,8 +631,7 @@ XmlReader::Result XmlReader::handleStartTag(int * nsId, Span * localName) {
char const * nameColon = 0; char const * nameColon = 0;
if (!scanName(&nameColon)) { if (!scanName(&nameColon)) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString("bad tag name in ") + (OUString("bad tag name in ") + fileUrl_),
fileUrl_),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
char const * nameEnd = pos_; char const * nameEnd = pos_;
@@ -671,8 +647,7 @@ XmlReader::Result XmlReader::handleStartTag(int * nsId, Span * localName) {
} }
if (pos_ == p) { if (pos_ == p) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString( (OUString("missing whitespace before attribute in ") +
"missing whitespace before attribute in ") +
fileUrl_), fileUrl_),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
@@ -680,33 +655,28 @@ XmlReader::Result XmlReader::handleStartTag(int * nsId, Span * localName) {
char const * attrNameColon = 0; char const * attrNameColon = 0;
if (!scanName(&attrNameColon)) { if (!scanName(&attrNameColon)) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString("bad attribute name in ") + (OUString("bad attribute name in ") + fileUrl_),
fileUrl_),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
char const * attrNameEnd = pos_; char const * attrNameEnd = pos_;
skipSpace(); skipSpace();
if (read() != '=') { if (read() != '=') {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString("missing '=' in ") + (OUString("missing '=' in ") + fileUrl_),
fileUrl_),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
skipSpace(); skipSpace();
char del = read(); char del = read();
if (del != '\'' && del != '"') { if (del != '\'' && del != '"') {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString("bad attribute value in ") + (OUString("bad attribute value in ") + fileUrl_),
fileUrl_),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
char const * valueBegin = pos_; char const * valueBegin = pos_;
sal_Int32 i = rtl_str_indexOfChar_WithLength(pos_, end_ - pos_, del); sal_Int32 i = rtl_str_indexOfChar_WithLength(pos_, end_ - pos_, del);
if (i < 0) { if (i < 0) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString( (OUString("unterminated attribute value in ") + fileUrl_),
"unterminated attribute value in ") +
fileUrl_),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
char const * valueEnd = pos_ + i; char const * valueEnd = pos_ + i;
@@ -744,8 +714,7 @@ XmlReader::Result XmlReader::handleStartTag(int * nsId, Span * localName) {
} }
if (peek() != '>') { if (peek() != '>') {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString("missing '>' in ") + (OUString("missing '>' in ") + fileUrl_),
fileUrl_),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
++pos_; ++pos_;
@@ -766,8 +735,7 @@ XmlReader::Result XmlReader::handleStartTag(int * nsId, Span * localName) {
XmlReader::Result XmlReader::handleEndTag() { XmlReader::Result XmlReader::handleEndTag() {
if (elements_.empty()) { if (elements_.empty()) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString("spurious end tag in ") + (OUString("spurious end tag in ") + fileUrl_),
fileUrl_),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
char const * nameBegin = pos_; char const * nameBegin = pos_;
@@ -776,16 +744,14 @@ XmlReader::Result XmlReader::handleEndTag() {
!elements_.top().name.equals(nameBegin, pos_ - nameBegin)) !elements_.top().name.equals(nameBegin, pos_ - nameBegin))
{ {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString("tag mismatch in ") + (OUString("tag mismatch in ") + fileUrl_),
fileUrl_),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
handleElementEnd(); handleElementEnd();
skipSpace(); skipSpace();
if (peek() != '>') { if (peek() != '>') {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString("missing '>' in ") + (OUString("missing '>' in ") + fileUrl_),
fileUrl_),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
++pos_; ++pos_;
@@ -804,8 +770,7 @@ XmlReader::Result XmlReader::handleSkippedText(Span * data, int * nsId) {
sal_Int32 i = rtl_str_indexOfChar_WithLength(pos_, end_ - pos_, '<'); sal_Int32 i = rtl_str_indexOfChar_WithLength(pos_, end_ - pos_, '<');
if (i < 0) { if (i < 0) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString("premature end of ") + (OUString("premature end of ") + fileUrl_),
fileUrl_),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
pos_ += i + 1; pos_ += i + 1;
@@ -835,8 +800,7 @@ XmlReader::Result XmlReader::handleRawText(Span * text) {
switch (peek()) { switch (peek()) {
case '\0': // i.e., EOF case '\0': // i.e., EOF
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString("premature end of ") + (OUString("premature end of ") + fileUrl_),
fileUrl_),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
case '\x0D': case '\x0D':
pad_.add(begin, pos_ - begin); pad_.add(begin, pos_ - begin);
@@ -902,8 +866,7 @@ XmlReader::Result XmlReader::handleNormalizedText(Span * text) {
switch (peek()) { switch (peek()) {
case '\0': // i.e., EOF case '\0': // i.e., EOF
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString("premature end of ") + (OUString("premature end of ") + fileUrl_),
fileUrl_),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
case '\x09': case '\x09':
case '\x0A': case '\x0A':

View File

@@ -99,14 +99,14 @@ void SaveODFItem::Notify( const ::com::sun::star::uno::Sequence< OUString >& ) {
m_nODF = nTmp; m_nODF = nTmp;
else else
throw uno::RuntimeException( throw uno::RuntimeException(
OUString( OUString("[xmlsecurity]SaveODFItem::SaveODFItem(): Wrong Type!"),
"[xmlsecurity]SaveODFItem::SaveODFItem(): Wrong Type!"), 0 ); 0 );
} }
else else
throw uno::RuntimeException( throw uno::RuntimeException(
OUString( OUString("[xmlsecurity] Could not open property Office.Common/Save/ODF/DefaultVersion"),
"[xmlsecurity] Could not open property Office.Common/Save/ODF/DefaultVersion"), 0); 0);
} }
} }

View File

@@ -112,8 +112,7 @@ void EncryptionEngine::tryToPerform( )
{ {
if (checkReady()) if (checkReady())
{ {
const OUString sEncryptionTemplate ( const OUString sEncryptionTemplate ( ENCRYPTION_TEMPLATE );
ENCRYPTION_TEMPLATE );
cssu::Reference < cssxc::XXMLEncryptionTemplate > xEncryptionTemplate( cssu::Reference < cssxc::XXMLEncryptionTemplate > xEncryptionTemplate(
mxMSF->createInstance( sEncryptionTemplate ), cssu::UNO_QUERY ); mxMSF->createInstance( sEncryptionTemplate ), cssu::UNO_QUERY );

View File

@@ -113,8 +113,7 @@ void SignatureEngine::tryToPerform( )
{ {
if (checkReady()) if (checkReady())
{ {
const OUString ouSignatureTemplate ( const OUString ouSignatureTemplate ( SIGNATURE_TEMPLATE );
SIGNATURE_TEMPLATE );
cssu::Reference < cssxc::XXMLSignatureTemplate > cssu::Reference < cssxc::XXMLSignatureTemplate >
xSignatureTemplate( mxMSF->createInstance( ouSignatureTemplate ), cssu::UNO_QUERY ); xSignatureTemplate( mxMSF->createInstance( ouSignatureTemplate ), cssu::UNO_QUERY );

View File

@@ -173,8 +173,7 @@ void SAL_CALL SignatureVerifierImpl::initialize(
OUString SignatureVerifierImpl_getImplementationName () OUString SignatureVerifierImpl_getImplementationName ()
throw (cssu::RuntimeException) throw (cssu::RuntimeException)
{ {
return OUString( return OUString( IMPLEMENTATION_NAME );
IMPLEMENTATION_NAME );
} }
sal_Bool SAL_CALL SignatureVerifierImpl_supportsService( const OUString& ServiceName ) sal_Bool SAL_CALL SignatureVerifierImpl_supportsService( const OUString& ServiceName )