diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-26 14:03:48 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-27 20:31:14 +0200 |
commit | 48e279c6748bf023fba12fdc3f4cee402f611c6e (patch) | |
tree | 2e1b3a20ccd71f47a66938f882c1fe9d5e947bb4 /sw/source/ui | |
parent | f3665d2a42b39814764f3eb9e20498b8a4be1d00 (diff) |
use string_view in INetURLObject::decode
Change-Id: I10e04970ceac33c9c3fbfd0182dd2140e06cb80b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114658
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/dialog/uiregionsw.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index e905bc2a79cc..18c3d6f2476a 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -172,7 +172,7 @@ public: size_t GetArrPos() const { return m_nArrPos; } OUString GetFile() const; OUString GetSubRegion() const; - void SetFile(OUString const& rFile); + void SetFile(std::u16string_view rFile); void SetFilter(std::u16string_view rFilter); void SetSubRegion(std::u16string_view rSubRegion); @@ -209,17 +209,17 @@ SectRepr::SectRepr( size_t nPos, SwSection& rSect ) } } -void SectRepr::SetFile( const OUString& rFile ) +void SectRepr::SetFile( std::u16string_view rFile ) { OUString sNewFile( INetURLObject::decode( rFile, INetURLObject::DecodeMechanism::Unambiguous )); const OUString sOldFileName( m_SectionData.GetLinkFileName() ); const OUString sSub( sOldFileName.getToken( 2, sfx2::cTokenSeparator ) ); - if( !rFile.isEmpty() || !sSub.isEmpty() ) + if( !rFile.empty() || !sSub.isEmpty() ) { sNewFile += OUStringChar(sfx2::cTokenSeparator); - if( !rFile.isEmpty() ) // Filter only with FileName + if( !rFile.empty() ) // Filter only with FileName sNewFile += sOldFileName.getToken( 1, sfx2::cTokenSeparator ); sNewFile += OUStringChar(sfx2::cTokenSeparator) + sSub; @@ -227,7 +227,7 @@ void SectRepr::SetFile( const OUString& rFile ) m_SectionData.SetLinkFileName( sNewFile ); - if( !rFile.isEmpty() || !sSub.isEmpty() ) + if( !rFile.empty() || !sSub.isEmpty() ) { m_SectionData.SetType( SectionType::FileLink ); } @@ -943,7 +943,7 @@ IMPL_LINK(SwEditRegionDlg, UseFileHdl, weld::ToggleButton&, rButton, void) pSectRepr->SetContent(false); else { - pSectRepr->SetFile(OUString()); + pSectRepr->SetFile(u""); pSectRepr->SetSubRegion(std::u16string_view()); pSectRepr->GetSectionData().SetLinkFilePassword(OUString()); } @@ -1151,7 +1151,7 @@ IMPL_LINK(SwEditRegionDlg, DDEHdl, weld::ToggleButton&, rButton, void) m_xSubRegionED->hide(); if (SectionType::FileLink == rData.GetType()) { - pSectRepr->SetFile(OUString()); + pSectRepr->SetFile(u""); m_xFileNameED->set_text(OUString()); rData.SetLinkFilePassword(OUString()); } @@ -1170,7 +1170,7 @@ IMPL_LINK(SwEditRegionDlg, DDEHdl, weld::ToggleButton&, rButton, void) if (SectionType::DdeLink == rData.GetType()) { rData.SetType(SectionType::FileLink); - pSectRepr->SetFile(OUString()); + pSectRepr->SetFile(u""); rData.SetLinkFilePassword(OUString()); m_xFileNameED->set_text(OUString()); } |