/************************************************************** * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * *************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmlsecurity.hxx" #include #include #include #include #include #include #include #include "dialogs.hrc" #include "resourcemanager.hxx" /* HACK: disable some warnings for MS-C */ #ifdef _MSC_VER #pragma warning (disable : 4355) // 4355: this used in initializer-list #endif using namespace ::com::sun::star; using namespace ::com::sun::star::uno; namespace css = ::com::sun::star; namespace { void ShrinkToFit( FixedImage& _rImage ); void AdjustPosAndSize( Control& _rCtrl, Point& _rStartIn_EndOut, long _nXOffset = 0 ); void ShrinkToFit( FixedImage& _rImg ) { _rImg.SetSizePixel( _rImg.GetImage().GetSizePixel() ); } void AdjustPosAndSize( Control& _rCtrl, Point& _rStartIn_EndOut, long _nOffs ) { _rCtrl.SetPosPixel( _rStartIn_EndOut ); _rStartIn_EndOut.X() += XmlSec::ShrinkToFitWidth( _rCtrl, _nOffs ); } } CertificateViewer::CertificateViewer( Window* _pParent, const cssu::Reference< dcss::xml::crypto::XSecurityEnvironment >& _rxSecurityEnvironment, const cssu::Reference< dcss::security::XCertificate >& _rXCert, sal_Bool bCheckForPrivateKey ) :TabDialog ( _pParent, XMLSEC_RES( RID_XMLSECDLG_CERTVIEWER ) ) ,maTabCtrl ( this, XMLSEC_RES( 1 ) ) ,maOkBtn ( this, XMLSEC_RES( BTN_OK ) ) ,maHelpBtn ( this, XMLSEC_RES( BTN_HELP ) ) { FreeResource(); mbCheckForPrivateKey = bCheckForPrivateKey; mxSecurityEnvironment = _rxSecurityEnvironment; mxCert = _rXCert; maTabCtrl.SetTabPage( RID_XMLSECTP_GENERAL, new CertificateViewerGeneralTP( &maTabCtrl, this ) ); maTabCtrl.SetTabPage( RID_XMLSECTP_DETAILS, new CertificateViewerDetailsTP( &maTabCtrl, this ) ); maTabCtrl.SetTabPage( RID_XMLSECTP_CERTPATH, new CertificateViewerCertPathTP( &maTabCtrl, this ) ); maTabCtrl.SetCurPageId( RID_XMLSECTP_GENERAL ); } CertificateViewer::~CertificateViewer() { delete maTabCtrl.GetTabPage( RID_XMLSECTP_CERTPATH ); delete maTabCtrl.GetTabPage( RID_XMLSECTP_DETAILS ); delete maTabCtrl.GetTabPage( RID_XMLSECTP_GENERAL ); } CertificateViewerTP::CertificateViewerTP( Window* _pParent, const ResId& _rResId, CertificateViewer* _pDlg ) :TabPage ( _pParent, _rResId ) ,mpDlg ( _pDlg ) { } CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, CertificateViewer* _pDlg ) :CertificateViewerTP ( _pParent, XMLSEC_RES( RID_XMLSECTP_GENERAL ), _pDlg ) ,maFrameWin ( this, XMLSEC_RES( WIN_FRAME ) ) ,maCertImg ( this, XMLSEC_RES( IMG_CERT ) ) ,maCertInfoFI ( this, XMLSEC_RES( FI_CERTINFO ) ) ,maSep1FL ( this, XMLSEC_RES( FL_SEP1 ) ) ,maHintNotTrustedFI ( this, XMLSEC_RES( FI_HINTNOTTRUST ) ) ,maSep2FL ( this, XMLSEC_RES( FL_SEP2 ) ) ,maIssuedToLabelFI ( this, XMLSEC_RES( FI_ISSTOLABEL ) ) ,maIssuedToFI ( this, XMLSEC_RES( FI_ISSTO ) ) ,maIssuedByLabelFI ( this, XMLSEC_RES( FI_ISSBYLABEL ) ) ,maIssuedByFI ( this, XMLSEC_RES( FI_ISSBY ) ) ,maValidDateFI ( this, XMLSEC_RES( FI_VALIDDATE ) ) ,maKeyImg ( this, XMLSEC_RES( IMG_KEY ) ) ,maHintCorrespPrivKeyFI ( this, XMLSEC_RES( FI_CORRPRIVKEY ) ) { if ( GetSettings().GetStyleSettings().GetHighContrastMode() ) maKeyImg.SetImage( Image( XMLSEC_RES( IMG_KEY_HC ) ) ); //Verify the certificate sal_Int32 certStatus = mpDlg->mxSecurityEnvironment->verifyCertificate(mpDlg->mxCert, Sequence >()); bool bCertValid = certStatus == css::security::CertificateValidity::VALID ? true : false; bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); if ( !bCertValid ) { maCertImg.SetImage( Image( XMLSEC_RES( bHC ? IMG_STATE_NOT_VALIDATED_HC : IMG_STATE_NOT_VALIDATED ) ) ); maHintNotTrustedFI.SetText( String( XMLSEC_RES( STR_CERTIFICATE_NOT_VALIDATED ) ) ); } else if ( bHC ) maCertImg.SetImage( Image( XMLSEC_RES( IMG_STATE_CERIFICATED_HC ) ) ); FreeResource(); Wallpaper aBack( GetSettings().GetStyleSettings().GetWindowColor() ); maFrameWin.SetBackground( aBack ); maCertImg.SetBackground( aBack ); maCertInfoFI.SetBackground( aBack ); maSep1FL.SetBackground( aBack ); maHintNotTrustedFI.SetBackground( aBack ); maSep2FL.SetBackground( aBack ); maIssuedToLabelFI.SetBackground( aBack ); maIssuedToFI.SetBackground( aBack ); maIssuedByLabelFI.SetBackground( aBack ); maIssuedByFI.SetBackground( aBack ); maValidDateFI.SetBackground( aBack ); maKeyImg.SetBackground( aBack ); maHintCorrespPrivKeyFI.SetBackground( aBack ); // make some bold Font aFnt( maCertInfoFI.GetFont() ); aFnt.SetWeight( WEIGHT_BOLD ); maCertInfoFI.SetFont( aFnt ); maHintNotTrustedFI.SetFont( aFnt ); maIssuedToLabelFI.SetFont( aFnt ); maIssuedByLabelFI.SetFont( aFnt ); maValidDateFI.SetFont( aFnt ); // insert data cssu::Reference< dcss::security::XCertificate > xCert = mpDlg->mxCert; maIssuedToFI.SetText( XmlSec::GetContentPart( xCert->getSubjectName() ) ); maIssuedByFI.SetText( XmlSec::GetContentPart( xCert->getIssuerName() ) ); // dynamic length because of the different languages long nWidth1 = maIssuedToLabelFI.GetTextWidth( maIssuedToLabelFI.GetText() ); long nWidth2 = maIssuedByLabelFI.GetTextWidth( maIssuedByLabelFI.GetText() ); long nNewWidth = Max( nWidth1, nWidth2 ) + 5; Size aNewSize = maIssuedToLabelFI.GetSizePixel(); aNewSize.Width() = nNewWidth; maIssuedToLabelFI.SetSizePixel( aNewSize ); maIssuedByLabelFI.SetSizePixel( aNewSize ); long nNewX = maIssuedToLabelFI.GetPosPixel().X() + nNewWidth + 1; Point aNewPos = maIssuedToFI.GetPosPixel(); aNewPos.X() = nNewX; maIssuedToFI.SetPosPixel( aNewPos ); aNewPos = maIssuedByFI.GetPosPixel(); aNewPos.X() = nNewX; maIssuedByFI.SetPosPixel( aNewPos ); nNewWidth = maValidDateFI.GetSizePixel().Width() - nNewX; aNewSize = maIssuedToFI.GetSizePixel(); aNewSize.Width() = nNewWidth; maIssuedToFI.SetSizePixel( aNewSize ); maIssuedByFI.SetSizePixel( aNewSize ); DateTime aDateTimeStart; DateTime aDateTimeEnd; utl::typeConvert( xCert->getNotValidBefore(), aDateTimeStart ); utl::typeConvert( xCert->getNotValidAfter(), aDateTimeEnd ); String sText = maValidDateFI.GetText(); sText.SearchAndReplace( String::CreateFromAscii( "%SDATE%" ), GetSettings().GetUILocaleDataWrapper().getDate( aDateTimeStart.GetDate() ) ); sText.SearchAndReplace( String::CreateFromAscii( "%EDATE%" ), GetSettings().GetUILocaleDataWrapper().getDate( aDateTimeEnd.GetDate() ) ); maValidDateFI.SetText( sText ); // adjust position of fixed text depending on image sizes ShrinkToFit( maCertImg ); ShrinkToFit( maKeyImg ); XmlSec::AlignAfterImage( maCertImg, maCertInfoFI, 12 ); XmlSec::AlignAfterImage( maKeyImg, maHintCorrespPrivKeyFI, 12 ); // Check if we have the private key... sal_Bool bHasPrivateKey = sal_False; // #i41270# Check only if we have that certificate in our security environment if ( _pDlg->mbCheckForPrivateKey ) { long nCertificateCharacters = _pDlg->mxSecurityEnvironment->getCertificateCharacters( xCert ); bHasPrivateKey = ( nCertificateCharacters & security::CertificateCharacters::HAS_PRIVATE_KEY ) ? sal_True : sal_False; } if ( !bHasPrivateKey ) { maKeyImg.Hide(); maHintCorrespPrivKeyFI.Hide(); } } void CertificateViewerGeneralTP::ActivatePage() { } struct Details_UserDatat { String maTxt; bool mbFixedWidthFont; inline Details_UserDatat( const String& _rTxt, bool _bFixedWidthFont ); }; inline Details_UserDatat::Details_UserDatat( const String& _rTxt, bool _bFixedWidthFont ) :maTxt ( _rTxt ) ,mbFixedWidthFont ( _bFixedWidthFont ) { } void CertificateViewerDetailsTP::Clear( void ) { maElementML.SetText( String() ); sal_uLong i = 0; SvLBoxEntry* pEntry = maElementsLB.GetEntry( i ); while( pEntry ) { delete ( Details_UserDatat* ) pEntry->GetUserData(); ++i; pEntry = maElementsLB.GetEntry( i ); } maElementsLB.Clear(); } void CertificateViewerDetailsTP::InsertElement( const String& _rField, const String& _rValue, const String& _rDetails, bool _bFixedWidthFont ) { SvLBoxEntry* pEntry = maElementsLB.InsertEntry( _rField ); maElementsLB.SetEntryText( _rValue, pEntry, 1 ); pEntry->SetUserData( ( void* ) new Details_UserDatat( _rDetails, _bFixedWidthFont ) ); } CertificateViewerDetailsTP::CertificateViewerDetailsTP( Window* _pParent, CertificateViewer* _pDlg ) :CertificateViewerTP ( _pParent, XMLSEC_RES( RID_XMLSECTP_DETAILS ), _pDlg ) ,maElementsLB ( this, XMLSEC_RES( LB_ELEMENTS ) ) ,maElementML ( this, XMLSEC_RES( ML_ELEMENT ) ) ,maStdFont ( maElementML.GetControlFont() ) ,maFixedWidthFont ( OutputDevice::GetDefaultFont( DEFAULTFONT_UI_FIXED, LANGUAGE_DONTKNOW, DEFAULTFONT_FLAGS_ONLYONE, this ) ) { WinBits nStyle = maElementsLB.GetStyle(); nStyle &= ~WB_HSCROLL; maElementsLB.SetStyle( nStyle ); maFixedWidthFont.SetHeight( maStdFont.GetHeight() ); static long nTabs[] = { 2, 0, 30*CS_LB_WIDTH/100 }; maElementsLB.SetTabs( &nTabs[ 0 ] ); maElementsLB.InsertHeaderEntry( String( XMLSEC_RES( STR_HEADERBAR ) ) ); // fill list box Reference< security::XCertificate > xCert = mpDlg->mxCert; sal_uInt16 nLineBreak = 16; const char* pHexSep = " "; String aLBEntry; String aDetails; // --> PB 2004-10-11 #i35107# - 0 == "V1", 1 == "V2", ..., n = "V(n+1)" aLBEntry = String::CreateFromAscii( "V" ); aLBEntry += String::CreateFromInt32( xCert->getVersion() + 1 ); // <-- InsertElement( String( XMLSEC_RES( STR_VERSION ) ), aLBEntry, aLBEntry ); Sequence< sal_Int8 > aSeq = xCert->getSerialNumber(); aLBEntry = XmlSec::GetHexString( aSeq, pHexSep ); aDetails = XmlSec::GetHexString( aSeq, pHexSep, nLineBreak ); InsertElement( String( XMLSEC_RES( STR_SERIALNUM ) ), aLBEntry, aDetails, true ); std::pair< ::rtl::OUString, ::rtl::OUString> pairIssuer = XmlSec::GetDNForCertDetailsView(xCert->getIssuerName()); aLBEntry = pairIssuer.first; aDetails = pairIssuer.second; InsertElement( String( XMLSEC_RES( STR_ISSUER ) ), aLBEntry, aDetails ); /* aSeq = xCert->getIssuerUniqueID(); aLBEntry = XmlSec::GetHexString( aSeq, pHexSep ); aDetails = XmlSec::GetHexString( aSeq, pHexSep, nLineBreak ); InsertElement( String( XMLSEC_RES( STR_ISSUER_ID ) ), aLBEntry, aDetails, true ); */ DateTime aDateTime; utl::typeConvert( xCert->getNotValidBefore(), aDateTime ); aLBEntry = GetSettings().GetUILocaleDataWrapper().getDate( aDateTime.GetDate() ); aLBEntry += String::CreateFromAscii( " " ); aLBEntry += GetSettings().GetUILocaleDataWrapper().getTime( aDateTime.GetTime() ); InsertElement( String( XMLSEC_RES( STR_VALIDFROM ) ), aLBEntry, aLBEntry ); utl::typeConvert( xCert->getNotValidAfter(), aDateTime ); aLBEntry = GetSettings().GetUILocaleDataWrapper().getDate( aDateTime.GetDate() ); aLBEntry += String::CreateFromAscii( " " ); aLBEntry += GetSettings().GetUILocaleDataWrapper().getTime( aDateTime.GetTime() ); InsertElement( String( XMLSEC_RES( STR_VALIDTO ) ), aLBEntry, aLBEntry ); std::pair< ::rtl::OUString, ::rtl::OUString > pairSubject = XmlSec::GetDNForCertDetailsView(xCert->getSubjectName()); aLBEntry = pairSubject.first; aDetails = pairSubject.second; InsertElement( String( XMLSEC_RES( STR_SUBJECT ) ), aLBEntry, aDetails ); /* aSeq = xCert->getSubjectUniqueID(); aLBEntry = XmlSec::GetHexString( aSeq, pHexSep ); aDetails = XmlSec::GetHexString( aSeq, pHexSep, nLineBreak ); InsertElement( String( XMLSEC_RES( STR_SUBJECT_ID ) ), aLBEntry, aDetails, true ); */ aLBEntry = aDetails = xCert->getSubjectPublicKeyAlgorithm(); InsertElement( String( XMLSEC_RES( STR_SUBJECT_PUBKEY_ALGO ) ), aLBEntry, aDetails ); aSeq = xCert->getSubjectPublicKeyValue(); aLBEntry = XmlSec::GetHexString( aSeq, pHexSep ); aDetails = XmlSec::GetHexString( aSeq, pHexSep, nLineBreak ); InsertElement( String( XMLSEC_RES( STR_SUBJECT_PUBKEY_VAL ) ), aLBEntry, aDetails, true ); aLBEntry = aDetails = xCert->getSignatureAlgorithm(); InsertElement( String( XMLSEC_RES( STR_SIGNATURE_ALGO ) ), aLBEntry, aDetails ); aSeq = xCert->getSHA1Thumbprint(); aLBEntry = XmlSec::GetHexString( aSeq, pHexSep ); aDetails = XmlSec::GetHexString( aSeq, pHexSep, nLineBreak ); InsertElement( String( XMLSEC_RES( STR_THUMBPRINT_SHA1 ) ), aLBEntry, aDetails, true ); aSeq = xCert->getMD5Thumbprint(); aLBEntry = XmlSec::GetHexString( aSeq, pHexSep ); aDetails = XmlSec::GetHexString( aSeq, pHexSep, nLineBreak ); InsertElement( String( XMLSEC_RES( STR_THUMBPRINT_MD5 ) ), aLBEntry, aDetails, true ); FreeResource(); maElementsLB.SetSelectHdl( LINK( this, CertificateViewerDetailsTP, ElementSelectHdl ) ); } CertificateViewerDetailsTP::~CertificateViewerDetailsTP() { Clear(); } void CertificateViewerDetailsTP::ActivatePage() { } IMPL_LINK( CertificateViewerDetailsTP, ElementSelectHdl, void*, EMPTYARG ) { SvLBoxEntry* pEntry = maElementsLB.FirstSelected(); String aElementText; bool bFixedWidthFont; if( pEntry ) { const Details_UserDatat* p = ( Details_UserDatat* ) pEntry->GetUserData(); aElementText = p->maTxt; bFixedWidthFont = p->mbFixedWidthFont; } else bFixedWidthFont = false; maElementML.SetFont( bFixedWidthFont? maFixedWidthFont : maStdFont ); maElementML.SetControlFont( bFixedWidthFont? maFixedWidthFont : maStdFont ); maElementML.SetText( aElementText ); return 0; } struct CertPath_UserData { cssu::Reference< dcss::security::XCertificate > mxCert; String maStatus; bool mbValid; CertPath_UserData( cssu::Reference< dcss::security::XCertificate > xCert, bool bValid): mxCert(xCert), mbValid(bValid) { } }; CertificateViewerCertPathTP::CertificateViewerCertPathTP( Window* _pParent, CertificateViewer* _pDlg ) :CertificateViewerTP ( _pParent, XMLSEC_RES( RID_XMLSECTP_CERTPATH ), _pDlg ) ,maCertPathFT ( this, XMLSEC_RES( FT_CERTPATH ) ) ,maCertPathLB ( this, XMLSEC_RES( LB_SIGNATURES ) ) ,maViewCertPB ( this, XMLSEC_RES( BTN_VIEWCERT ) ) ,maCertStatusFT ( this, XMLSEC_RES( FT_CERTSTATUS ) ) ,maCertStatusML ( this, XMLSEC_RES( ML_CERTSTATUS ) ) ,mpParent ( _pDlg ) ,mbFirstActivateDone ( false ) ,maCertImage ( XMLSEC_RES( IMG_CERT_SMALL ) ) ,maCertNotValidatedImage( XMLSEC_RES( IMG_CERT_NOTVALIDATED_SMALL ) ) ,msCertOK ( XMLSEC_RES( STR_PATH_CERT_OK ) ) ,msCertNotValidated ( XMLSEC_RES( STR_PATH_CERT_NOT_VALIDATED ) ) { if ( GetSettings().GetStyleSettings().GetHighContrastMode() ) { maCertImage = Image( XMLSEC_RES( IMG_CERT_SMALL_HC ) ); maCertNotValidatedImage = Image( XMLSEC_RES( IMG_CERT_NOTVALIDATED_SMALL_HC ) ); } FreeResource(); maCertPathLB.SetNodeDefaultImages(); maCertPathLB.SetSublistOpenWithLeftRight(); maCertPathLB.SetSelectHdl( LINK( this, CertificateViewerCertPathTP, CertSelectHdl ) ); maViewCertPB.SetClickHdl( LINK( this, CertificateViewerCertPathTP, ViewCertHdl ) ); // check if buttontext is to wide const long nOffset = 10; String sText = maViewCertPB.GetText(); long nTxtW = maViewCertPB.GetTextWidth( sText ); if ( sText.Search( '~' ) == STRING_NOTFOUND ) nTxtW += nOffset; long nBtnW = maViewCertPB.GetSizePixel().Width(); if ( nTxtW > nBtnW ) { // broaden the button long nDelta = nTxtW - nBtnW; Size aNewSize = maViewCertPB.GetSizePixel(); aNewSize.Width() += nDelta; maViewCertPB.SetSizePixel( aNewSize ); // and give it a new position Point aNewPos = maViewCertPB.GetPosPixel(); aNewPos.X() -= nDelta; maViewCertPB.SetPosPixel( aNewPos ); } } CertificateViewerCertPathTP::~CertificateViewerCertPathTP() { Clear(); } void CertificateViewerCertPathTP::ActivatePage() { if ( !mbFirstActivateDone ) { mbFirstActivateDone = true; Sequence< Reference< security::XCertificate > > aCertPath = mpParent->mxSecurityEnvironment->buildCertificatePath( mpParent->mxCert ); const Reference< security::XCertificate >* pCertPath = aCertPath.getConstArray(); String aState; sal_Int32 i, nCnt = aCertPath.getLength(); SvLBoxEntry* pParent = NULL; for( i = nCnt; i; ) { const Reference< security::XCertificate > rCert = pCertPath[ --i ]; String sName = XmlSec::GetContentPart( rCert->getSubjectName() ); //Verify the certificate sal_Int32 certStatus = mpDlg->mxSecurityEnvironment->verifyCertificate(rCert, Sequence >()); bool bCertValid = certStatus == css::security::CertificateValidity::VALID ? true : false; pParent = InsertCert( pParent, sName, rCert, bCertValid); } maCertPathLB.Select( pParent ); maViewCertPB.Disable(); // Own certificate selected while( pParent ) { maCertPathLB.Expand( pParent ); pParent = maCertPathLB.GetParent( pParent ); } CertSelectHdl( NULL ); } } IMPL_LINK( CertificateViewerCertPathTP, ViewCertHdl, void*, EMPTYARG ) { SvLBoxEntry* pEntry = maCertPathLB.FirstSelected(); if( pEntry ) { CertificateViewer aViewer( this, mpDlg->mxSecurityEnvironment, ((CertPath_UserData*)pEntry->GetUserData())->mxCert, sal_False ); aViewer.Execute(); } return 0; } IMPL_LINK( CertificateViewerCertPathTP, CertSelectHdl, void*, EMPTYARG ) { String sStatus; SvLBoxEntry* pEntry = maCertPathLB.FirstSelected(); if( pEntry ) { CertPath_UserData* pData = (CertPath_UserData*) pEntry->GetUserData(); if ( pData ) sStatus = pData->mbValid ? msCertOK : msCertNotValidated; } maCertStatusML.SetText( sStatus ); maViewCertPB.Enable( pEntry && ( pEntry != maCertPathLB.Last() ) ); return 0; } void CertificateViewerCertPathTP::Clear( void ) { maCertStatusML.SetText( String() ); sal_uLong i = 0; SvLBoxEntry* pEntry = maCertPathLB.GetEntry( i ); while( pEntry ) { delete ( CertPath_UserData* ) pEntry->GetUserData(); ++i; pEntry = maCertPathLB.GetEntry( i ); } maCertPathLB.Clear(); } SvLBoxEntry* CertificateViewerCertPathTP::InsertCert( SvLBoxEntry* _pParent, const String& _rName, cssu::Reference< dcss::security::XCertificate > rxCert, bool bValid) { Image aImage = bValid ? maCertImage : maCertNotValidatedImage; SvLBoxEntry* pEntry = maCertPathLB.InsertEntry( _rName, aImage, aImage, _pParent ); pEntry->SetUserData( ( void* ) new CertPath_UserData( rxCert, bValid ) ); return pEntry; } eature/lok_cellcursor'>feature/lok_cellcursor LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-02-12Various typos on accessibleJulien Nabet
Change-Id: Id28a4a2cbbcec10a7cc9cb40ad208d575352039b Reviewed-on: https://gerrit.libreoffice.org/34161 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-01-26Remove dynamic exception specificationsStephan Bergmann
...(for now, from LIBO_INTERNAL_CODE only). See the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html> "Dynamic Exception Specifications" for details. Most changes have been done automatically by the rewriting loplugin:dynexcspec (after enabling the rewriting mode, to be committed shortly). The way it only removes exception specs from declarations if it also sees a definition, it identified some dead declarations-w/o-definitions (that have been removed manually) and some cases where a definition appeared in multiple include files (which have also been cleaned up manually). There's also been cases of macro paramters (that were used to abstract over exception specs) that have become unused now (and been removed). Furthermore, some code needed to be cleaned up manually (avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no configurations available that would actually build that code. Missing @throws documentation has not been applied in such manual clean-up. Change-Id: I3408691256c9b0c12bc5332de976743626e13960 Reviewed-on: https://gerrit.libreoffice.org/33574 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-01-19New loplugin:dynexcspec: Add @throws documentation, comphelperStephan Bergmann
Change-Id: I115c5c34cf97858d9fdd96432cb57bde6d4537cb
2016-09-13loplugin:override: No more need for the "MSVC dtor override" workaroundStephan Bergmann
The issue of 362d4f0cd4e50111edfae9d30c90602c37ed65a2 "Explicitly mark overriding destructors as 'virtual'" appears to no longer be a problem with MSVC 2013. (The little change in the rewriting code of compilerplugins/clang/override.cxx was necessary to prevent an endless loop when adding "override" to OOO_DLLPUBLIC_CHARTTOOLS virtual ~CloseableLifeTimeManager(); in chart2/source/inc/LifeTime.hxx, getting stuck in the leading OOO_DLLPUBLIC_CHARTTOOLS macro. Can't remember what that isAtEndOfImmediateMacroExpansion thing was originally necessary for, anyway.) Change-Id: I534c634504d7216b9bb632c2775c04eaf27e927e
2016-08-25new loplugin: countusersofdefaultparamsNoel Grandin
Change-Id: I79e2c690f3e664c14af12cf763dd5a8ac20d6b04 Reviewed-on: https://gerrit.libreoffice.org/28353 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-04comphelper::OBaseMutex -> cppu::BaseMutexNoel Grandin
convert usage of deprecated class, and remove the old class Change-Id: I19fb9271090d19e5531622b58492e1a848d306e2 Reviewed-on: https://gerrit.libreoffice.org/26843 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-06remove some manual ref-countingNoel Grandin
triggered when I noticed a class doing acquire() in the constructor and then release() in the destructor. found mostly by git grep -n -B5 -e '->release()' Change-Id: I96e43a3d30ffd9ae9a34275f24cd914d8f7b026f Reviewed-on: https://gerrit.libreoffice.org/25806 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-24Revert "remove some manual ref-counting"Noel Grandin
until I have a better understanding of the UNO reference counting. This reverts commit 111de438ea3e512a541281dc0716cc728ea8d152.
2016-05-24remove some manual ref-countingNoel Grandin
triggered when I noticed a class doing acquire() in the constructor and then release() in the destructor. found mostly by git grep -n -B5 -e '->release()' Change-Id: Ie1abeaed75c1f861df185e3bde680272dbadc97f Reviewed-on: https://gerrit.libreoffice.org/25363 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-04No need to explicitly delete ctor the compiler wouldn't implicitly declareStephan Bergmann
Change-Id: Idd0e764765bd76e1f6a2d8ec6e18ebac27b91ec6
2016-05-03C++11: disable ctors with delete in include/Jochen Nitschke
replace the old declare and don't implement pattern with C++11 delete keyword no need to hide this design choice behind access restrictions Change-Id: I7e8430a07189aa48514a4613c3a8c2950b230f49 Reviewed-on: https://gerrit.libreoffice.org/24495 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-04-13loplugin:passstuffbyref in comphelperNoel Grandin
Change-Id: I502a0ec6627f37e17c4a9adebda58299167a8126
2016-03-03loplugin:unuseddefaultparams comphelperNoel Grandin
Change-Id: I78280a13fc0d82fc87041b5dad0c3f2f7d462652 Reviewed-on: https://gerrit.libreoffice.org/22853 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-09Remove excess newlinesChris Sherlock
A ridiculously fast way of doing this is: for i in $(pcregrep -l -M -r --include='.*[hc]xx$' \ --exclude-dir=workdir --exclude-dir=instdir '^ {3,}' .) do perl -0777 -i -pe 's/^ {3,}/ /gm' $i done Change-Id: Iebb93eccbee9e4fc5c4380474ba595858a27ac2c Reviewed-on: https://gerrit.libreoffice.org/22224 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-10Fix typosAndrea Gelmini
Change-Id: I9a5940027423ff0791fa7da0b79b617412ce6b86 Reviewed-on: https://gerrit.libreoffice.org/21209 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2015-10-20com::sun::star->css in include/comphelperNoel Grandin
Change-Id: Ice569b724732da1fd67a18a4ccf2f92f530cd689 Reviewed-on: https://gerrit.libreoffice.org/19459 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-10-12Replace "SAL_OVERRIDE" with "override" in LIBO_INTERNAL_ONLY codeStephan Bergmann
Change-Id: I2ea407acd763ef2d7dae2d3b8f32525523ac8274
2015-10-12Replace "SAL_DELETED_FUNCTION" with "= delete" in LIBO_INTERNAL_ONLY codeStephan Bergmann
Change-Id: I328ac7a95ccc87732efae48b567a0556865928f3
2015-07-20tdf#88206 replace cppu::WeakImplHelper* etc.Takeshi Abe
with the variadic variants, for comphelper. This also includes extra changes in other modules required accordingly. Change-Id: Id1537f46f1c90f760a0d8987a6dafa0e1da03b8f Reviewed-on: https://gerrit.libreoffice.org/16929 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-07-19Fix typosAndrea Gelmini
Change-Id: I52cbaad71560d73f5e24f3de3cd62b00d678dd6c Reviewed-on: https://gerrit.libreoffice.org/17187 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2015-04-21No more need for PartialWeakComponentImplHelper hereStephan Bergmann
...since 70626249cd247d9acdad417b8eaf252bae22c059 "API CHANGE a11y unpublishing and add/removeListener rename." Change-Id: I89d81326d97712abcac94c3436a13905954c55cf
2015-02-07loplugin:deletedspecialStephan Bergmann
Change-Id: I0aeba0c65b19c1107f617ed0af0028cced9bd434
2014-11-12Fix common typos. No automatic tools. Handmade…Andrea Gelmini
Change-Id: I1ab4e23b0539f8d39974787f226e57a21f96e959 Reviewed-on: https://gerrit.libreoffice.org/12164 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-04-01Explicitly mark overriding destructors as "virtual"Stephan Bergmann
It appears that the C++ standard allows overriding destructors to be marked "override," but at least some MSVC versions complain about it, so at least make sure such destructors are explicitly marked "virtual." Change-Id: I0e1cafa7584fd16ebdce61f569eae2373a71b0a1
2014-03-26First batch of adding SAL_OVERRRIDE to overriding function declarationsStephan Bergmann
...mostly done with a rewriting Clang plugin, with just some manual tweaking necessary to fix poor macro usage. Change-Id: I71fa20213e86be10de332ece0aa273239df7b61a
2014-03-14OAccessibleContextWrapperHelper does not implement XAccessibleContextStephan Bergmann
...but rather some (non-virtual) base functionality for use in derived classes (that do implement XAccessibleContext) Change-Id: Idb0023906108db22bb9696245f07b9a4c053a0d1
2014-03-01Remove visual noise from includeAlexander Wilms
Conflicts: include/framework/preventduplicateinteraction.hxx include/sfx2/sfxbasecontroller.hxx include/sfx2/sfxbasemodel.hxx include/toolkit/awt/vclxtabpagemodel.hxx include/vcl/field.hxx include/vcl/settings.hxx Change-Id: Ibccf9f88c68267a3d7e656012b51eaf644c418c2 Reviewed-on: https://gerrit.libreoffice.org/8272 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-26cppuhelper: retrofit std::exception into overriding exception specsStephan Bergmann
Change-Id: I56e32131b7991ee9948ce46765632eb823d463b3
2014-02-17comphelper: sal_Bool -> boolStephan Bergmann
Change-Id: I6fc331ae0706f4bb193543011c8d4ae0a385fcc0
2013-12-06Get rid of DECLARE_STL_MAPStephan Bergmann
Change-Id: Ifbda934a89087fcc1c031978d3e5b5783722b328
2013-11-09fdo#65108 inter-module includes <>Norbert Thiebaud
Change-Id: Iac3debc892d420ab50c1b38446334d30488648dc
2013-10-23fixincludeguards.sh: include/c*Thomas Arnhold
Change-Id: Icba422d99836518a1b662b15144bc9334bed1473
2013-04-23execute move of global headersBjoern Michaelsen
see https://gerrit.libreoffice.org/#/c/3367/ and Change-Id: I00c96fa77d04b33a6f8c8cd3490dfcd9bdc9e84a for details Change-Id: I199a75bc4042af20817265d5ef85b1134a96ff5a