summaryrefslogtreecommitdiffstats
path: root/extensions/source/update/check/updatecheckconfig.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/source/update/check/updatecheckconfig.cxx')
-rw-r--r--extensions/source/update/check/updatecheckconfig.cxx44
1 files changed, 20 insertions, 24 deletions
diff --git a/extensions/source/update/check/updatecheckconfig.cxx b/extensions/source/update/check/updatecheckconfig.cxx
index 30e444051e3f..52deb59528fb 100644
--- a/extensions/source/update/check/updatecheckconfig.cxx
+++ b/extensions/source/update/check/updatecheckconfig.cxx
@@ -75,10 +75,6 @@ const char * const aUpdateEntryProperties[] = {
const sal_uInt32 nUpdateEntryProperties = SAL_N_ELEMENTS(aUpdateEntryProperties);
-NamedValueByNameAccess::~NamedValueByNameAccess()
-{
-}
-
css::uno::Any NamedValueByNameAccess::getValue(const char * pName)
{
const sal_Int32 nLen = m_rValues.getLength();
@@ -143,14 +139,14 @@ UpdateCheckROModel::getUpdateEntry(UpdateInfo& rInfo) const
bool isDirectDownload = false;
m_aNameAccess.getValue(IS_DIRECT_DOWNLOAD) >>= isDirectDownload;
- rInfo.Sources.push_back( DownloadSource( isDirectDownload, getStringValue(DOWNLOAD_URL) ) );
+ rInfo.Sources.emplace_back(isDirectDownload, getStringValue(DOWNLOAD_URL));
for(sal_Int32 n=1; n < 6; ++n )
{
OUString aUStr = getStringValue(
OString(OString::Concat(RELEASE_NOTE) + OString::number(n)).getStr());
if( !aUStr.isEmpty() )
- rInfo.ReleaseNotes.push_back(ReleaseNote(static_cast<sal_Int8>(n), aUStr));
+ rInfo.ReleaseNotes.emplace_back(static_cast<sal_Int8>(n), aUStr);
}
}
@@ -187,13 +183,13 @@ OUString UpdateCheckConfig::getAllUsersDirectory()
OUString aRet;
#ifdef _WIN32
- WCHAR szPath[MAX_PATH];
-
- if (TRUE == SHGetSpecialFolderPathW(nullptr, szPath, CSIDL_COMMON_DOCUMENTS, true))
+ PWSTR szPath = nullptr;
+ if (SUCCEEDED(SHGetKnownFolderPath(FOLDERID_PublicDocuments, KF_FLAG_CREATE, nullptr, &szPath)))
{
aRet = o3tl::toU(szPath);
osl::FileBase::getFileURLFromSystemPath( aRet, aRet );
}
+ CoTaskMemFree(szPath);
#else
osl::FileBase::getTempDirURL(aRet);
#endif
@@ -320,7 +316,7 @@ UpdateCheckConfig::storeLocalFileName(const OUString& rLocalFileName, sal_Int64
{
const sal_uInt8 nItems = 2;
const OUString aNameList[nItems] = { OUString(LOCAL_FILE), OUString(DOWNLOAD_SIZE) };
- const uno::Any aValueList[nItems] = { uno::makeAny(rLocalFileName), uno::makeAny(nFileSize) };
+ const uno::Any aValueList[nItems] = { uno::Any(rLocalFileName), uno::Any(nFileSize) };
for( sal_uInt8 i=0; i < nItems; ++i )
{
@@ -351,7 +347,7 @@ UpdateCheckConfig::clearLocalFileName()
void
UpdateCheckConfig::storeDownloadPaused(bool paused)
{
- replaceByName(DOWNLOAD_PAUSED , uno::makeAny(paused));
+ replaceByName(DOWNLOAD_PAUSED , uno::Any(paused));
commitChanges();
}
@@ -363,7 +359,7 @@ UpdateCheckConfig::updateLastChecked()
sal_Int64 lastCheck = systime.Seconds;
- replaceByName(LAST_CHECK, uno::makeAny(lastCheck));
+ replaceByName(LAST_CHECK, uno::Any(lastCheck));
}
void
@@ -374,17 +370,17 @@ UpdateCheckConfig::storeUpdateFound( const UpdateInfo& rInfo, const OUString& aC
uno::Any aValues[nUpdateEntryProperties] =
{
- uno::makeAny(rInfo.Version),
- uno::makeAny(rInfo.BuildId),
- uno::makeAny(rInfo.Description),
- uno::makeAny(rInfo.Sources[0].URL),
- uno::makeAny(rInfo.Sources[0].IsDirect),
- uno::makeAny(getReleaseNote(rInfo, 1, autoDownloadEnabled) ),
- uno::makeAny(getReleaseNote(rInfo, 2, autoDownloadEnabled) ),
- uno::makeAny(getReleaseNote(rInfo, 3, autoDownloadEnabled) ),
- uno::makeAny(getReleaseNote(rInfo, 4, autoDownloadEnabled) ),
- uno::makeAny(getReleaseNote(rInfo, 5, autoDownloadEnabled) ),
- uno::makeAny(aCurrentBuild)
+ uno::Any(rInfo.Version),
+ uno::Any(rInfo.BuildId),
+ uno::Any(rInfo.Description),
+ uno::Any(rInfo.Sources[0].URL),
+ uno::Any(rInfo.Sources[0].IsDirect),
+ uno::Any(getReleaseNote(rInfo, 1, autoDownloadEnabled) ),
+ uno::Any(getReleaseNote(rInfo, 2, autoDownloadEnabled) ),
+ uno::Any(getReleaseNote(rInfo, 3, autoDownloadEnabled) ),
+ uno::Any(getReleaseNote(rInfo, 4, autoDownloadEnabled) ),
+ uno::Any(getReleaseNote(rInfo, 5, autoDownloadEnabled) ),
+ uno::Any(aCurrentBuild)
};
OUString aName;
@@ -416,7 +412,7 @@ UpdateCheckConfig::clearUpdateFound()
} catch(const lang::WrappedTargetException& ) {
// Can not remove value, probably in share layer
OSL_ASSERT(false);
- m_xContainer->replaceByName(aName, uno::makeAny(OUString()));
+ m_xContainer->replaceByName(aName, uno::Any(OUString()));
}
}