From 7e5de5480255c830ec8ce88b6fcd39e3a36672e8 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 10 Dec 2019 15:21:04 +0100 Subject: loplugin:unusedmember (clang-cl) PROPERTYMAP members pszXPathParent and pszValueNodeName were unused ever since 85e0cc246d4350122b17fbe2bfd15635a190ad77 "dv17: #i70994#: Use property handler instead of column info for Windows Vista" introduced the code. (And removing them allowed to simplify the code further in the obvious way.) Change-Id: Ie1247cbee31a172a15fd57c4b752d74711b1d3a1 Reviewed-on: https://gerrit.libreoffice.org/84860 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- .../win32/shlxthandler/prophdl/propertyhdl.cxx | 32 +++++++--------------- 1 file changed, 10 insertions(+), 22 deletions(-) (limited to 'shell') diff --git a/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx b/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx index ae547afd2973..5b7121bcf333 100644 --- a/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx +++ b/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx @@ -39,28 +39,16 @@ long g_DllRefCnt = 0; static HINSTANCE g_hModule = nullptr; -namespace { - -// Map of property keys to the locations of their value(s) in the .??? XML schema -struct PROPERTYMAP -{ - PROPERTYKEY key; - PCWSTR pszXPathParent; - PCWSTR pszValueNodeName; -}; - -} - -const PROPERTYMAP g_rgPROPERTYMAP[] = +const PROPERTYKEY g_rgPROPERTIES[] = { - { PKEY_Title, L"LibreOffice", L"Title" }, - { PKEY_Author, L"LibreOffice", L"Author" }, - { PKEY_Subject, L"LibreOffice", L"Subject" }, - { PKEY_Keywords, L"LibreOffice", L"Keyword" }, - { PKEY_Comment, L"LibreOffice", L"Comments" }, + PKEY_Title, + PKEY_Author, + PKEY_Subject, + PKEY_Keywords, + PKEY_Comment }; -size_t const gPropertyMapTableSize = SAL_N_ELEMENTS(g_rgPROPERTYMAP); +size_t const gPropertyTableSize = SAL_N_ELEMENTS(g_rgPROPERTIES); CPropertyHdl::CPropertyHdl( long nRefCnt ) : @@ -289,18 +277,18 @@ void CPropertyHdl::LoadProperties( CMetaInfoReader *pMetaInfoReader ) OutputDebugStringFormatW( L"CPropertyHdl: LoadProperties\n" ); PROPVARIANT propvarValues; - for ( UINT i = 0; i < UINT(gPropertyMapTableSize); ++i ) + for ( UINT i = 0; i < UINT(gPropertyTableSize); ++i ) { PropVariantClear( &propvarValues ); HRESULT hr = GetItemData( pMetaInfoReader, i, &propvarValues); if (hr == S_OK) { // coerce the value(s) to the appropriate type for the property key - hr = PSCoerceToCanonicalValue( g_rgPROPERTYMAP[i].key, &propvarValues ); + hr = PSCoerceToCanonicalValue( g_rgPROPERTIES[i], &propvarValues ); if (SUCCEEDED(hr)) { // cache the value(s) loaded - hr = m_pCache->SetValueAndState( g_rgPROPERTYMAP[i].key, &propvarValues, PSC_NORMAL ); + hr = m_pCache->SetValueAndState( g_rgPROPERTIES[i], &propvarValues, PSC_NORMAL ); } } } -- cgit