shell/inc/propsheets.hxx | 2 +- shell/source/win32/shlxthandler/propsheets/propsheets.cxx | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-)
New commits: commit 2468fe5d91880719e0addfc6c5ae2bfd1b141bb1 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Sun Feb 25 19:11:26 2024 +0600 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Mon Feb 26 02:23:25 2024 +0100 Remove an instance of MAX_PATH ... and avoid manual memory management. Change-Id: I6f056fd5bcc299c2c31aede227b29444ec3c5988 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163906 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/shell/inc/propsheets.hxx b/shell/inc/propsheets.hxx index 68e28192922d..6092e8bdbe31 100644 --- a/shell/inc/propsheets.hxx +++ b/shell/inc/propsheets.hxx @@ -75,7 +75,7 @@ private: private: LONG m_RefCnt; - Filepath_char_t m_szFileName[MAX_PATH]; + std::wstring m_FileName; }; #endif diff --git a/shell/source/win32/shlxthandler/propsheets/propsheets.cxx b/shell/source/win32/shlxthandler/propsheets/propsheets.cxx index 48a125d581fc..d19b3a2c4df6 100644 --- a/shell/source/win32/shlxthandler/propsheets/propsheets.cxx +++ b/shell/source/win32/shlxthandler/propsheets/propsheets.cxx @@ -138,9 +138,7 @@ HRESULT STDMETHODCALLTYPE CPropertySheet::Initialize( 0, buffer.get(), size + 1 ); if ( result_size != 0 ) { - std::wstring fname = getShortPathName( buffer.get() ); - ZeroMemory( m_szFileName, sizeof( m_szFileName ) ); - wcsncpy( m_szFileName, fname.c_str(), ( SAL_N_ELEMENTS( m_szFileName ) - 1 ) ); + m_FileName = getShortPathName(buffer.get()); hr = S_OK; } else @@ -259,7 +257,7 @@ void CPropertySheet::InitPropPageSummary(HWND hwnd, LPPROPSHEETPAGE /*lppsp*/) { try { - CMetaInfoReader metaInfo(m_szFileName); + CMetaInfoReader metaInfo(m_FileName); SetWindowTextW(GetDlgItem(hwnd,IDC_TITLE), metaInfo.getTagData( META_INFO_TITLE ).c_str() ); SetWindowTextW(GetDlgItem(hwnd,IDC_AUTHOR), metaInfo.getTagData( META_INFO_AUTHOR ).c_str() ); @@ -287,9 +285,9 @@ void CPropertySheet::InitPropPageStatistics(HWND hwnd, LPPROPSHEETPAGE /*lppsp*/ { try { - CMetaInfoReader metaInfo(m_szFileName); + CMetaInfoReader metaInfo(m_FileName); - document_statistic_reader_ptr doc_stat_reader = create_document_statistic_reader(m_szFileName, &metaInfo); + document_statistic_reader_ptr doc_stat_reader = create_document_statistic_reader(m_FileName, &metaInfo); statistic_group_list_t sgl; doc_stat_reader->read(&sgl);