diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-14 14:47:34 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-14 15:44:42 +0200 |
commit | e6b8be25a6fb5afbd1649489318a7a2d7ae62efa (patch) | |
tree | 4777f3d63cd8b849b9ac32af3fe6def00749a407 /filter/source/pdf | |
parent | a60b18a8c5d5c11c87dbbaaf884de138dfeb6c8f (diff) |
loplugin:flatten in filter
Change-Id: I24861f7401c0046962d536950fe8b2b6bdbad969
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92186
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter/source/pdf')
-rw-r--r-- | filter/source/pdf/impdialog.cxx | 80 | ||||
-rw-r--r-- | filter/source/pdf/pdfexport.cxx | 34 |
2 files changed, 57 insertions, 57 deletions
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index af0d87c2a240..954e7d3a8c03 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -803,22 +803,22 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, ToggleWatermarkHdl, weld::ToggleButton&, v IMPL_LINK_NOARG(ImpPDFTabGeneralPage, ToggleAddStreamHdl, weld::ToggleButton&, void) { - if (mxCbAddStream->get_visible()) + if (!mxCbAddStream->get_visible()) + return; + + if( mxCbAddStream->get_active() ) { - if( mxCbAddStream->get_active() ) - { - mxRbAll->set_active(true); - mxRbRange->set_sensitive( false ); - mxRbSelection->set_sensitive( false ); - mxEdPages->set_sensitive( false ); - mxRbAll->set_sensitive( false ); - } - else - { - mxRbAll->set_sensitive(true); - mxRbRange->set_sensitive(true); - mxRbSelection->set_sensitive(true); - } + mxRbAll->set_active(true); + mxRbRange->set_sensitive( false ); + mxRbSelection->set_sensitive( false ); + mxEdPages->set_sensitive( false ); + mxRbAll->set_sensitive( false ); + } + else + { + mxRbAll->set_sensitive(true); + mxRbRange->set_sensitive(true); + mxRbSelection->set_sensitive(true); } } @@ -1535,37 +1535,37 @@ IMPL_LINK_NOARG(ImpPDFTabSigningPage, ClickmaPbSignCertSelect, weld::Button&, vo OUString aDescription; maSignCertificate = xSigner->chooseCertificate(aDescription); - if (maSignCertificate.is()) + if (!maSignCertificate.is()) + return; + + mxEdSignCert->set_text(maSignCertificate->getSubjectName()); + mxPbSignCertClear->set_sensitive(true); + mxEdSignLocation->set_sensitive(true); + mxEdSignPassword->set_sensitive(true); + mxEdSignContactInfo->set_sensitive(true); + mxEdSignReason->set_sensitive(true); + mxEdSignReason->set_text(aDescription); + + try { - mxEdSignCert->set_text(maSignCertificate->getSubjectName()); - mxPbSignCertClear->set_sensitive(true); - mxEdSignLocation->set_sensitive(true); - mxEdSignPassword->set_sensitive(true); - mxEdSignContactInfo->set_sensitive(true); - mxEdSignReason->set_sensitive(true); - mxEdSignReason->set_text(aDescription); - - try + std::optional<css::uno::Sequence<OUString>> aTSAURLs(officecfg::Office::Common::Security::Scripting::TSAURLs::get()); + if (aTSAURLs) { - std::optional<css::uno::Sequence<OUString>> aTSAURLs(officecfg::Office::Common::Security::Scripting::TSAURLs::get()); - if (aTSAURLs) + const css::uno::Sequence<OUString>& rTSAURLs = *aTSAURLs; + for (auto const& elem : rTSAURLs) { - const css::uno::Sequence<OUString>& rTSAURLs = *aTSAURLs; - for (auto const& elem : rTSAURLs) - { - mxLBSignTSA->append_text(elem); - } + mxLBSignTSA->append_text(elem); } } - catch (const uno::Exception &) - { - TOOLS_INFO_EXCEPTION("filter.pdf", "TSAURLsDialog::TSAURLsDialog()"); - } - - // If more than only the "None" entry is there, enable the ListBox - if (mxLBSignTSA->get_count() > 1) - mxLBSignTSA->set_sensitive(true); } + catch (const uno::Exception &) + { + TOOLS_INFO_EXCEPTION("filter.pdf", "TSAURLsDialog::TSAURLsDialog()"); + } + + // If more than only the "None" entry is there, enable the ListBox + if (mxLBSignTSA->get_count() > 1) + mxLBSignTSA->set_sensitive(true); } IMPL_LINK_NOARG(ImpPDFTabSigningPage, ClickmaPbSignCertClear, weld::Button&, void) diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index 758c7e786114..6e13beb96cd6 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -292,25 +292,25 @@ public: void PDFExportStreamDoc::write( const Reference< XOutputStream >& xStream ) { Reference< css::frame::XStorable > xStore( m_xSrcDoc, UNO_QUERY ); - if( xStore.is() ) + if( !xStore.is() ) + return; + + Sequence< beans::PropertyValue > aArgs( 2 + (m_aPreparedPassword.hasElements() ? 1 : 0) ); + aArgs.getArray()[0].Name = "FilterName"; + aArgs.getArray()[1].Name = "OutputStream"; + aArgs.getArray()[1].Value <<= xStream; + if( m_aPreparedPassword.hasElements() ) { - Sequence< beans::PropertyValue > aArgs( 2 + (m_aPreparedPassword.hasElements() ? 1 : 0) ); - aArgs.getArray()[0].Name = "FilterName"; - aArgs.getArray()[1].Name = "OutputStream"; - aArgs.getArray()[1].Value <<= xStream; - if( m_aPreparedPassword.hasElements() ) - { - aArgs.getArray()[2].Name = "EncryptionData"; - aArgs.getArray()[2].Value <<= m_aPreparedPassword; - } + aArgs.getArray()[2].Name = "EncryptionData"; + aArgs.getArray()[2].Value <<= m_aPreparedPassword; + } - try - { - xStore->storeToURL( "private:stream", aArgs ); - } - catch( const IOException& ) - { - } + try + { + xStore->storeToURL( "private:stream", aArgs ); + } + catch( const IOException& ) + { } } |