diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-05-02 17:53:27 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-05-04 13:57:07 +0200 |
commit | 2ddc66e6981a7d819cd6196a7ccbc811ca213be2 (patch) | |
tree | ab991ee652a9121ac18213f84d0df7855a2f2e29 /sw/source/uibase/app/docsh.cxx | |
parent | dec6bb217dd3ae98bee8e48fab9f8e26b7645b2b (diff) |
Use hasElements to check Sequence emptiness in sw
Similar to clang-tidy readability-container-size-empty
Change-Id: If44f20a7aa678915e32d12101e1af71476f4b590
Reviewed-on: https://gerrit.libreoffice.org/71679
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase/app/docsh.cxx')
-rw-r--r-- | sw/source/uibase/app/docsh.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx index 7f13bbbfb63b..1486916cd181 100644 --- a/sw/source/uibase/app/docsh.cxx +++ b/sw/source/uibase/app/docsh.cxx @@ -659,7 +659,7 @@ bool SwDocShell::ConvertTo( SfxMedium& rMedium ) if(xLib.is()) { Sequence<OUString> aModNames = xLib->getElementNames(); - if(aModNames.getLength()) + if(aModNames.hasElements()) { SetError(WARN_SWG_HTML_NO_MACROS); break; @@ -1362,7 +1362,7 @@ bool SwDocShell::HasChangeRecordProtection() const { if (!m_pWrtShell) return false; - return m_pWrtShell->getIDocumentRedlineAccess().GetRedlinePassword().getLength() > 0; + return m_pWrtShell->getIDocumentRedlineAccess().GetRedlinePassword().hasElements(); } void SwDocShell::SetChangeRecording( bool bActivate ) @@ -1380,7 +1380,7 @@ void SwDocShell::SetProtectionPassword( const OUString &rNewPassword ) IDocumentRedlineAccess& rIDRA = m_pWrtShell->getIDocumentRedlineAccess(); Sequence< sal_Int8 > aPasswd = rIDRA.GetRedlinePassword(); if (SfxItemState::SET == aSet.GetItemState(FN_REDLINE_PROTECT, false, &pItem) - && static_cast<const SfxBoolItem*>(pItem)->GetValue() == (aPasswd.getLength() > 0)) + && static_cast<const SfxBoolItem*>(pItem)->GetValue() == aPasswd.hasElements()) return; if (!rNewPassword.isEmpty()) @@ -1408,7 +1408,7 @@ bool SwDocShell::GetProtectionHash( /*out*/ css::uno::Sequence< sal_Int8 > &rPas IDocumentRedlineAccess& rIDRA = m_pWrtShell->getIDocumentRedlineAccess(); const Sequence< sal_Int8 >& aPasswdHash( rIDRA.GetRedlinePassword() ); if (SfxItemState::SET == aSet.GetItemState(FN_REDLINE_PROTECT, false, &pItem) - && static_cast<const SfxBoolItem*>(pItem)->GetValue() == (aPasswdHash.getLength() != 0)) + && static_cast<const SfxBoolItem*>(pItem)->GetValue() == aPasswdHash.hasElements()) return false; rPasswordHash = aPasswdHash; bRes = true; |