Kaydet (Commit) 7c4807bf authored tarafından Olivier Hallot's avatar Olivier Hallot

Fix for fdo43460 Part LV getLength() to isEmpty()

Part LV
Modules
xmlsecurity
üst 9d4e1a5d
...@@ -98,7 +98,7 @@ void DocumentDigitalSignatures::initialize( const Sequence< Any >& aArguments) ...@@ -98,7 +98,7 @@ void DocumentDigitalSignatures::initialize( const Sequence< Any >& aArguments)
//the Version is supported as of ODF1.2, so for and 1.1 document or older we will receive the //the Version is supported as of ODF1.2, so for and 1.1 document or older we will receive the
//an empty string. In this case we set it to ODFVER_010_TEXT. Then we can later check easily //an empty string. In this case we set it to ODFVER_010_TEXT. Then we can later check easily
//if initialize was called. Only then m_sODFVersion.getLength() is greater than 0 //if initialize was called. Only then m_sODFVersion.getLength() is greater than 0
if (m_sODFVersion.getLength() == 0) if (m_sODFVersion.isEmpty())
m_sODFVersion = ODFVER_010_TEXT; m_sODFVersion = ODFVER_010_TEXT;
} }
...@@ -107,7 +107,7 @@ sal_Bool DocumentDigitalSignatures::signDocumentContent( ...@@ -107,7 +107,7 @@ sal_Bool DocumentDigitalSignatures::signDocumentContent(
const Reference< css::io::XStream >& xSignStream) const Reference< css::io::XStream >& xSignStream)
throw (RuntimeException) throw (RuntimeException)
{ {
OSL_ENSURE(m_sODFVersion.getLength(), "DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2"); OSL_ENSURE(!m_sODFVersion.isEmpty(), "DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2");
return ImplViewSignatures( rxStorage, xSignStream, SignatureModeDocumentContent, false ); return ImplViewSignatures( rxStorage, xSignStream, SignatureModeDocumentContent, false );
} }
...@@ -116,7 +116,7 @@ DocumentDigitalSignatures::verifyDocumentContentSignatures( ...@@ -116,7 +116,7 @@ DocumentDigitalSignatures::verifyDocumentContentSignatures(
const Reference< css::embed::XStorage >& rxStorage, const Reference< css::embed::XStorage >& rxStorage,
const Reference< css::io::XInputStream >& xSignInStream ) throw (RuntimeException) const Reference< css::io::XInputStream >& xSignInStream ) throw (RuntimeException)
{ {
OSL_ENSURE(m_sODFVersion.getLength(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2"); OSL_ENSURE(!m_sODFVersion.isEmpty(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2");
return ImplVerifySignatures( rxStorage, xSignInStream, SignatureModeDocumentContent ); return ImplVerifySignatures( rxStorage, xSignInStream, SignatureModeDocumentContent );
} }
...@@ -124,7 +124,7 @@ void DocumentDigitalSignatures::showDocumentContentSignatures( ...@@ -124,7 +124,7 @@ void DocumentDigitalSignatures::showDocumentContentSignatures(
const Reference< css::embed::XStorage >& rxStorage, const Reference< css::embed::XStorage >& rxStorage,
const Reference< css::io::XInputStream >& xSignInStream ) throw (RuntimeException) const Reference< css::io::XInputStream >& xSignInStream ) throw (RuntimeException)
{ {
OSL_ENSURE(m_sODFVersion.getLength(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2"); OSL_ENSURE(!m_sODFVersion.isEmpty(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2");
ImplViewSignatures( rxStorage, xSignInStream, SignatureModeDocumentContent, true ); ImplViewSignatures( rxStorage, xSignInStream, SignatureModeDocumentContent, true );
} }
...@@ -138,7 +138,7 @@ sal_Bool DocumentDigitalSignatures::signScriptingContent( ...@@ -138,7 +138,7 @@ sal_Bool DocumentDigitalSignatures::signScriptingContent(
const Reference< css::embed::XStorage >& rxStorage, const Reference< css::embed::XStorage >& rxStorage,
const Reference< css::io::XStream >& xSignStream ) throw (RuntimeException) const Reference< css::io::XStream >& xSignStream ) throw (RuntimeException)
{ {
OSL_ENSURE(m_sODFVersion.getLength(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2"); OSL_ENSURE(!m_sODFVersion.isEmpty(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2");
OSL_ENSURE(m_nArgumentsCount == 2, "DocumentDigitalSignatures: Service was not initialized properly"); OSL_ENSURE(m_nArgumentsCount == 2, "DocumentDigitalSignatures: Service was not initialized properly");
return ImplViewSignatures( rxStorage, xSignStream, SignatureModeMacros, false ); return ImplViewSignatures( rxStorage, xSignStream, SignatureModeMacros, false );
} }
...@@ -148,7 +148,7 @@ DocumentDigitalSignatures::verifyScriptingContentSignatures( ...@@ -148,7 +148,7 @@ DocumentDigitalSignatures::verifyScriptingContentSignatures(
const Reference< css::embed::XStorage >& rxStorage, const Reference< css::embed::XStorage >& rxStorage,
const Reference< css::io::XInputStream >& xSignInStream ) throw (RuntimeException) const Reference< css::io::XInputStream >& xSignInStream ) throw (RuntimeException)
{ {
OSL_ENSURE(m_sODFVersion.getLength(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2"); OSL_ENSURE(!m_sODFVersion.isEmpty(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2");
return ImplVerifySignatures( rxStorage, xSignInStream, SignatureModeMacros ); return ImplVerifySignatures( rxStorage, xSignInStream, SignatureModeMacros );
} }
...@@ -156,7 +156,7 @@ void DocumentDigitalSignatures::showScriptingContentSignatures( ...@@ -156,7 +156,7 @@ void DocumentDigitalSignatures::showScriptingContentSignatures(
const Reference< css::embed::XStorage >& rxStorage, const Reference< css::embed::XStorage >& rxStorage,
const Reference< css::io::XInputStream >& xSignInStream ) throw (RuntimeException) const Reference< css::io::XInputStream >& xSignInStream ) throw (RuntimeException)
{ {
OSL_ENSURE(m_sODFVersion.getLength(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2"); OSL_ENSURE(!m_sODFVersion.isEmpty(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2");
ImplViewSignatures( rxStorage, xSignInStream, SignatureModeMacros, true ); ImplViewSignatures( rxStorage, xSignInStream, SignatureModeMacros, true );
} }
...@@ -171,7 +171,7 @@ sal_Bool DocumentDigitalSignatures::signPackage( ...@@ -171,7 +171,7 @@ sal_Bool DocumentDigitalSignatures::signPackage(
const Reference< css::embed::XStorage >& rxStorage, const Reference< css::embed::XStorage >& rxStorage,
const Reference< css::io::XStream >& xSignStream ) throw (RuntimeException) const Reference< css::io::XStream >& xSignStream ) throw (RuntimeException)
{ {
OSL_ENSURE(m_sODFVersion.getLength(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2"); OSL_ENSURE(!m_sODFVersion.isEmpty(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2");
return ImplViewSignatures( rxStorage, xSignStream, SignatureModePackage, false ); return ImplViewSignatures( rxStorage, xSignStream, SignatureModePackage, false );
} }
...@@ -180,7 +180,7 @@ DocumentDigitalSignatures::verifyPackageSignatures( ...@@ -180,7 +180,7 @@ DocumentDigitalSignatures::verifyPackageSignatures(
const Reference< css::embed::XStorage >& rxStorage, const Reference< css::embed::XStorage >& rxStorage,
const Reference< css::io::XInputStream >& xSignInStream ) throw (RuntimeException) const Reference< css::io::XInputStream >& xSignInStream ) throw (RuntimeException)
{ {
OSL_ENSURE(m_sODFVersion.getLength(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2"); OSL_ENSURE(!m_sODFVersion.isEmpty(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2");
return ImplVerifySignatures( rxStorage, xSignInStream, SignatureModePackage ); return ImplVerifySignatures( rxStorage, xSignInStream, SignatureModePackage );
} }
...@@ -188,7 +188,7 @@ void DocumentDigitalSignatures::showPackageSignatures( ...@@ -188,7 +188,7 @@ void DocumentDigitalSignatures::showPackageSignatures(
const Reference< css::embed::XStorage >& rxStorage, const Reference< css::embed::XStorage >& rxStorage,
const Reference< css::io::XInputStream >& xSignInStream ) throw (RuntimeException) const Reference< css::io::XInputStream >& xSignInStream ) throw (RuntimeException)
{ {
OSL_ENSURE(m_sODFVersion.getLength(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2"); OSL_ENSURE(!m_sODFVersion.isEmpty(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2");
ImplViewSignatures( rxStorage, xSignInStream, SignatureModePackage, true ); ImplViewSignatures( rxStorage, xSignInStream, SignatureModePackage, true );
} }
...@@ -311,7 +311,7 @@ DocumentDigitalSignatures::ImplVerifySignatures( ...@@ -311,7 +311,7 @@ DocumentDigitalSignatures::ImplVerifySignatures(
const SignatureInformation& rInfo = aSignInfos[n]; const SignatureInformation& rInfo = aSignInfos[n];
css::security::DocumentSignatureInformation& rSigInfo = arInfos[n]; css::security::DocumentSignatureInformation& rSigInfo = arInfos[n];
if (rInfo.ouX509Certificate.getLength()) if (!rInfo.ouX509Certificate.isEmpty())
rSigInfo.Signer = xSecEnv->createCertificateFromAscii( rInfo.ouX509Certificate ) ; rSigInfo.Signer = xSecEnv->createCertificateFromAscii( rInfo.ouX509Certificate ) ;
if (!rSigInfo.Signer.is()) if (!rSigInfo.Signer.is())
rSigInfo.Signer = xSecEnv->getCertificate( rInfo.ouX509IssuerName, xSerialNumberAdapter->toSequence( rInfo.ouX509SerialNumber ) ); rSigInfo.Signer = xSecEnv->getCertificate( rInfo.ouX509IssuerName, xSerialNumberAdapter->toSequence( rInfo.ouX509SerialNumber ) );
......
...@@ -441,7 +441,7 @@ IMPL_LINK( DigitalSignaturesDialog, AddButtonHdl, Button*, EMPTYARG ) ...@@ -441,7 +441,7 @@ IMPL_LINK( DigitalSignaturesDialog, AddButtonHdl, Button*, EMPTYARG )
return -1; return -1;
} }
rtl::OUString aCertSerial = xSerialNumberAdapter->toString( xCert->getSerialNumber() ); rtl::OUString aCertSerial = xSerialNumberAdapter->toString( xCert->getSerialNumber() );
if ( !aCertSerial.getLength() ) if ( aCertSerial.isEmpty() )
{ {
OSL_FAIL( "Error in Certificate, problem with serial number!" ); OSL_FAIL( "Error in Certificate, problem with serial number!" );
return -1; return -1;
...@@ -602,7 +602,7 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox() ...@@ -602,7 +602,7 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox()
const SignatureInformation& rInfo = maCurrentSignatureInformations[n]; const SignatureInformation& rInfo = maCurrentSignatureInformations[n];
//First we try to get the certificate which is embedded in the XML Signature //First we try to get the certificate which is embedded in the XML Signature
if (rInfo.ouX509Certificate.getLength()) if (!rInfo.ouX509Certificate.isEmpty())
xCert = xSecEnv->createCertificateFromAscii(rInfo.ouX509Certificate); xCert = xSecEnv->createCertificateFromAscii(rInfo.ouX509Certificate);
else { else {
//There must be an embedded certificate because we use it to get the //There must be an embedded certificate because we use it to get the
...@@ -752,7 +752,7 @@ void DigitalSignaturesDialog::ImplShowSignaturesDetails() ...@@ -752,7 +752,7 @@ void DigitalSignaturesDialog::ImplShowSignaturesDetails()
::com::sun::star::security::SerialNumberAdapter::create(mxCtx); ::com::sun::star::security::SerialNumberAdapter::create(mxCtx);
// Use Certificate from doc, not from key store // Use Certificate from doc, not from key store
uno::Reference< dcss::security::XCertificate > xCert; uno::Reference< dcss::security::XCertificate > xCert;
if (rInfo.ouX509Certificate.getLength()) if (!rInfo.ouX509Certificate.isEmpty())
xCert = xSecEnv->createCertificateFromAscii(rInfo.ouX509Certificate); xCert = xSecEnv->createCertificateFromAscii(rInfo.ouX509Certificate);
//fallback if no certificate is embedded, get if from store //fallback if no certificate is embedded, get if from store
if (!xCert.is()) if (!xCert.is())
......
...@@ -195,7 +195,7 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString) ...@@ -195,7 +195,7 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString)
//then we have reached the end of the value //then we have reached the end of the value
if (!bInValue) if (!bInValue)
{ {
OSL_ASSERT(sType.getLength()); OSL_ASSERT(!sType.isEmpty());
retVal.push_back(make_pair(sType, sbufValue.makeStringAndClear())); retVal.push_back(make_pair(sType, sbufValue.makeStringAndClear()));
sType = OUString(); sType = OUString();
//The next char is the start of the new type //The next char is the start of the new type
...@@ -218,7 +218,7 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString) ...@@ -218,7 +218,7 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString)
} }
if (sbufValue.getLength()) if (sbufValue.getLength())
{ {
OSL_ASSERT(sType.getLength()); OSL_ASSERT(!sType.isEmpty());
retVal.push_back(make_pair(sType, sbufValue.makeStringAndClear())); retVal.push_back(make_pair(sType, sbufValue.makeStringAndClear()));
} }
return retVal; return retVal;
...@@ -290,7 +290,7 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString) ...@@ -290,7 +290,7 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString)
//then we have reached the end of the value //then we have reached the end of the value
if (!bInValue) if (!bInValue)
{ {
OSL_ASSERT(sType.getLength()); OSL_ASSERT(!sType.isEmpty());
retVal.push_back(make_pair(sType, sbufValue.makeStringAndClear())); retVal.push_back(make_pair(sType, sbufValue.makeStringAndClear()));
sType = OUString(); sType = OUString();
//The next char is the start of the new type //The next char is the start of the new type
...@@ -316,7 +316,7 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString) ...@@ -316,7 +316,7 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString)
} }
if (sbufValue.getLength()) if (sbufValue.getLength())
{ {
OSL_ASSERT(sType.getLength()); OSL_ASSERT(!sType.isEmpty());
retVal.push_back(make_pair(sType, sbufValue.makeStringAndClear())); retVal.push_back(make_pair(sType, sbufValue.makeStringAndClear()));
} }
return retVal; return retVal;
...@@ -342,7 +342,7 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString) ...@@ -342,7 +342,7 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString)
break; break;
} }
} }
if (retVal.getLength()) if (!retVal.isEmpty())
break; break;
} }
return retVal; return retVal;
......
...@@ -113,7 +113,7 @@ void ImplFillElementList( ...@@ -113,7 +113,7 @@ void ImplFillElementList(
::rtl::OUString sEncName = ::rtl::Uri::encode( ::rtl::OUString sEncName = ::rtl::Uri::encode(
pNames[n], rtl_UriCharClassRelSegment, pNames[n], rtl_UriCharClassRelSegment,
rtl_UriEncodeStrict, RTL_TEXTENCODING_UTF8); rtl_UriEncodeStrict, RTL_TEXTENCODING_UTF8);
if (sEncName.getLength() == 0 && pNames[n].getLength() != 0) if (sEncName.isEmpty() && !pNames[n].isEmpty())
throw css::uno::Exception(::rtl::OUString( throw css::uno::Exception(::rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("Failed to encode element name of XStorage")), 0); RTL_CONSTASCII_USTRINGPARAM("Failed to encode element name of XStorage")), 0);
...@@ -168,7 +168,7 @@ DocumentSignatureAlgorithm ...@@ -168,7 +168,7 @@ DocumentSignatureAlgorithm
DocumentSignatureHelper::getDocumentAlgorithm( DocumentSignatureHelper::getDocumentAlgorithm(
const ::rtl::OUString & sODFVersion, const SignatureInformation & sigInfo) const ::rtl::OUString & sODFVersion, const SignatureInformation & sigInfo)
{ {
OSL_ASSERT(sODFVersion.getLength()); OSL_ASSERT(!sODFVersion.isEmpty());
DocumentSignatureAlgorithm mode = OOo3_2Document; DocumentSignatureAlgorithm mode = OOo3_2Document;
if (!isOOo3_2_Signature(sigInfo)) if (!isOOo3_2_Signature(sigInfo))
{ {
......
...@@ -193,7 +193,7 @@ uno::Reference< io::XInputStream > SAL_CALL UriBindingHelper::getUriBinding( con ...@@ -193,7 +193,7 @@ uno::Reference< io::XInputStream > SAL_CALL UriBindingHelper::getUriBinding( con
uno::Reference < io::XInputStream > UriBindingHelper::OpenInputStream( const uno::Reference < embed::XStorage >& rxStore, const rtl::OUString& rURI ) uno::Reference < io::XInputStream > UriBindingHelper::OpenInputStream( const uno::Reference < embed::XStorage >& rxStore, const rtl::OUString& rURI )
{ {
OSL_ASSERT(rURI.getLength()); OSL_ASSERT(!rURI.isEmpty());
uno::Reference < io::XInputStream > xInStream; uno::Reference < io::XInputStream > xInStream;
sal_Int32 nSepPos = rURI.indexOf( '/' ); sal_Int32 nSepPos = rURI.indexOf( '/' );
...@@ -203,7 +203,7 @@ uno::Reference < io::XInputStream > UriBindingHelper::OpenInputStream( const uno ...@@ -203,7 +203,7 @@ uno::Reference < io::XInputStream > UriBindingHelper::OpenInputStream( const uno
// MBA with think about a better API... // MBA with think about a better API...
const ::rtl::OUString sName = ::rtl::Uri::decode( const ::rtl::OUString sName = ::rtl::Uri::decode(
rURI, rtl_UriDecodeStrict, rtl_UriCharClassRelSegment); rURI, rtl_UriDecodeStrict, rtl_UriCharClassRelSegment);
if (sName.getLength() == 0 && rURI.getLength() != 0) if (sName.isEmpty() && !rURI.isEmpty())
throw uno::Exception(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( throw uno::Exception(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"Could not decode URI for stream element.")), 0); "Could not decode URI for stream element.")), 0);
...@@ -217,7 +217,7 @@ uno::Reference < io::XInputStream > UriBindingHelper::OpenInputStream( const uno ...@@ -217,7 +217,7 @@ uno::Reference < io::XInputStream > UriBindingHelper::OpenInputStream( const uno
{ {
const rtl::OUString aStoreName = ::rtl::Uri::decode( const rtl::OUString aStoreName = ::rtl::Uri::decode(
rURI.copy( 0, nSepPos ), rtl_UriDecodeStrict, rtl_UriCharClassRelSegment); rURI.copy( 0, nSepPos ), rtl_UriDecodeStrict, rtl_UriCharClassRelSegment);
if (aStoreName.getLength() == 0 && rURI.getLength() != 0) if (aStoreName.isEmpty() && !rURI.isEmpty())
throw uno::Exception( throw uno::Exception(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"Could not decode URI for stream element.")), 0); "Could not decode URI for stream element.")), 0);
......
...@@ -220,7 +220,7 @@ sal_Bool XSecController::convertDateTime( com::sun::star::util::DateTime& rDateT ...@@ -220,7 +220,7 @@ sal_Bool XSecController::convertDateTime( com::sun::star::util::DateTime& rDateT
nDateTokens++; nDateTokens++;
pStr++; pStr++;
} }
if ( nDateTokens > 3 || aDateStr.getLength() == 0 ) if ( nDateTokens > 3 || aDateStr.isEmpty() )
bSuccess = sal_False; bSuccess = sal_False;
else else
{ {
...@@ -235,7 +235,7 @@ sal_Bool XSecController::convertDateTime( com::sun::star::util::DateTime& rDateT ...@@ -235,7 +235,7 @@ sal_Bool XSecController::convertDateTime( com::sun::star::util::DateTime& rDateT
bSuccess = sal_False; bSuccess = sal_False;
} }
if ( aTimeStr.getLength() > 0 ) // time is optional if ( !aTimeStr.isEmpty() ) // time is optional
{ {
pStr = aTimeStr.getStr(); pStr = aTimeStr.getStr();
sal_Int32 nTimeTokens = 1; sal_Int32 nTimeTokens = 1;
...@@ -1008,7 +1008,7 @@ void XSecController::exportSignature( ...@@ -1008,7 +1008,7 @@ void XSecController::exportSignature(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ATTR_XMLNS)), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ATTR_XMLNS)),
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(NS_XMLDSIG))); rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(NS_XMLDSIG)));
if (signatureInfo.ouSignatureId.getLength()>0) if (!signatureInfo.ouSignatureId.isEmpty())
{ {
pAttributeList->AddAttribute( pAttributeList->AddAttribute(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ATTR_ID)), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ATTR_ID)),
...@@ -1151,7 +1151,7 @@ void XSecController::exportSignature( ...@@ -1151,7 +1151,7 @@ void XSecController::exportSignature(
xDocumentHandler->endElement( tag_X509IssuerSerial ); xDocumentHandler->endElement( tag_X509IssuerSerial );
/* Write X509Certificate element */ /* Write X509Certificate element */
if (signatureInfo.ouX509Certificate.getLength()>0) if (!signatureInfo.ouX509Certificate.isEmpty())
{ {
xDocumentHandler->startElement( xDocumentHandler->startElement(
tag_X509Certificate, tag_X509Certificate,
...@@ -1210,7 +1210,7 @@ void XSecController::exportSignature( ...@@ -1210,7 +1210,7 @@ void XSecController::exportSignature(
//milli seconds (document was signed by an application other than OOo) //milli seconds (document was signed by an application other than OOo)
//and the converted time is written back, then the string looks different //and the converted time is written back, then the string looks different
//and the signature is broken. //and the signature is broken.
if (signatureInfo.ouDateTime.getLength() > 0) if (!signatureInfo.ouDateTime.isEmpty())
buffer = signatureInfo.ouDateTime; buffer = signatureInfo.ouDateTime;
else else
convertDateTime( buffer, signatureInfo.stDateTime ); convertDateTime( buffer, signatureInfo.stDateTime );
......
...@@ -208,7 +208,7 @@ void deleteRootsModule() ...@@ -208,7 +208,7 @@ void deleteRootsModule()
{ {
::rtl::OUString profile = xMozillaBootstrap->getDefaultProfile(productTypes[i]); ::rtl::OUString profile = xMozillaBootstrap->getDefaultProfile(productTypes[i]);
if (profile != NULL && profile.getLength()>0) if (profile != NULL && !profile.isEmpty())
{ {
::rtl::OUString sProfilePath = xMozillaBootstrap->getProfilePath( productTypes[i], profile ); ::rtl::OUString sProfilePath = xMozillaBootstrap->getProfilePath( productTypes[i], profile );
sResult = ::rtl::OUStringToOString( sProfilePath, osl_getThreadTextEncoding() ); sResult = ::rtl::OUStringToOString( sProfilePath, osl_getThreadTextEncoding() );
...@@ -261,7 +261,7 @@ bool nsscrypto_initialize( const css::uno::Reference< css::lang::XMultiServiceFa ...@@ -261,7 +261,7 @@ bool nsscrypto_initialize( const css::uno::Reference< css::lang::XMultiServiceFa
PR_Init( PR_USER_THREAD, PR_PRIORITY_NORMAL, 1 ) ; PR_Init( PR_USER_THREAD, PR_PRIORITY_NORMAL, 1 ) ;
// there might be no profile // there might be no profile
if ( sCertDir.getLength() > 0 ) if ( !sCertDir.isEmpty() )
{ {
if( NSS_InitReadWrite( sCertDir.getStr() ) != SECSuccess ) if( NSS_InitReadWrite( sCertDir.getStr() ) != SECSuccess )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment