Kaydet (Commit) c12922a5 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Fix nillability of ooSetupLastVersion

...that had been introduced with 5187d3ae
"Resolves: tdf#69042 - Add a 'What's New' infobar":

* Make the default value nil instead of an empty string.

* A nilable prop can't reuse the legacy utl::ConfigManager framework to obtain
  string prop values, so drop it from there and directly use the direct-access
  functionality in SfxViewFrame::Notify.

Change-Id: I5fc67a3d7e0fcb44a218889ecf8c69e81661567e
Reviewed-on: https://gerrit.libreoffice.org/72485
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst c5968b68
......@@ -53,8 +53,6 @@ public:
static OUString getProductVersion();
static OUString getLastProductVersion();
static OUString getVendor();
static void storeConfigItems();
......
......@@ -265,7 +265,6 @@
<desc>Specifies the version number of the previously used product for
whats-new comparison.</desc>
</info>
<value/>
</prop>
<prop oor:name="ooSetupVersionAboutBox" oor:type="xs:string" oor:nillable="false">
<info>
......
......@@ -1233,8 +1233,8 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
OUString sSetupVersion = utl::ConfigManager::getProductVersion();
sal_Int32 iCurrent = sSetupVersion.getToken(0,'.').toInt32() * 10 + sSetupVersion.getToken(1,'.').toInt32();
OUString sLastVersion = utl::ConfigManager::getLastProductVersion();
if (sLastVersion.isEmpty()) sLastVersion="0.0";
OUString sLastVersion
= officecfg::Setup::Product::ooSetupLastVersion::get().value_or("0.0");
sal_Int32 iLast = sLastVersion.getToken(0,'.').toInt32() * 10 + sLastVersion.getToken(1,'.').toInt32();
if ((iCurrent > iLast) && !Application::IsHeadlessModeEnabled() && !bIsUITest)
{
......
......@@ -135,12 +135,6 @@ OUString utl::ConfigManager::getProductVersion() {
"Product/ooSetupVersion");
}
OUString utl::ConfigManager::getLastProductVersion() {
return getConfigurationString(
"/org.openoffice.Setup",
"Product/ooSetupLastVersion");
}
OUString utl::ConfigManager::getVendor() {
return getConfigurationString(
"/org.openoffice.Setup",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment