try to avoid scaling bitmaps twice in Skia when drawing
[LibreOffice.git] / include / unotools / VersionConfig.hxx
blobc3bdeea48fea72d95f5cffdc59bb89f2633f4afb
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 */
10 #pragma once
12 #include <officecfg/Office/Common.hxx>
13 #include <officecfg/Setup.hxx>
14 #include <unotools/configmgr.hxx>
16 namespace utl
18 /** This method is called when there's a need to determine if the
19 * current version of LibreOffice has been upgraded to a newer one.
21 @param aUpdateVersion This variable is used to determine if
22 LibreOffice's previous version should be updated.
24 static bool isProductVersionUpgraded(bool aUpdateVersion)
26 OUString sSetupVersion = utl::ConfigManager::getProductVersion();
27 sal_Int32 iCurrent
28 = sSetupVersion.getToken(0, '.').toInt32() * 10 + sSetupVersion.getToken(1, '.').toInt32();
29 OUString sLastVersion = officecfg::Setup::Product::ooSetupLastVersion::get().value_or("0.0");
30 sal_Int32 iLast
31 = sLastVersion.getToken(0, '.').toInt32() * 10 + sLastVersion.getToken(1, '.').toInt32();
32 if (iCurrent > iLast)
34 if (aUpdateVersion && !officecfg::Setup::Product::ooSetupLastVersion::isReadOnly())
35 { //update lastversion
36 std::shared_ptr<comphelper::ConfigurationChanges> batch(
37 comphelper::ConfigurationChanges::create());
38 officecfg::Setup::Product::ooSetupLastVersion::set(sSetupVersion, batch);
39 batch->commit();
41 return true;
43 return false;