39#include <officecfg/Office/UI.hxx>
40#include <osl/file.hxx>
41#include <osl/security.hxx>
44#include <com/sun/star/configuration/Update.hpp>
45#include <com/sun/star/configuration/theDefaultProvider.hpp>
46#include <com/sun/star/container/XNameContainer.hpp>
47#include <com/sun/star/task/XJob.hpp>
48#include <com/sun/star/beans/NamedValue.hpp>
49#include <com/sun/star/beans/XPropertySet.hpp>
50#include <com/sun/star/util/XRefreshable.hpp>
51#include <com/sun/star/util/XChangesBatch.hpp>
52#include <com/sun/star/embed/ElementModes.hpp>
53#include <com/sun/star/embed/FileSystemStorageFactory.hpp>
54#include <com/sun/star/embed/XStorage.hpp>
55#include <com/sun/star/ui/theModuleUIConfigurationManagerSupplier.hpp>
56#include <com/sun/star/ui/UIConfigurationManager.hpp>
57#include <com/sun/star/ui/XUIConfigurationPersistence.hpp>
66using com::sun::star::uno::Exception;
81 if ( sShortName ==
u"StartModule" )
82 sIdentifier =
"com.sun.star.frame.StartModule";
84 else if ( sShortName ==
u"swriter" )
85 sIdentifier =
"com.sun.star.text.TextDocument";
87 else if ( sShortName ==
u"scalc" )
88 sIdentifier =
"com.sun.star.sheet.SpreadsheetDocument";
90 else if ( sShortName ==
u"sdraw" )
91 sIdentifier =
"com.sun.star.drawing.DrawingDocument";
93 else if ( sShortName ==
u"simpress" )
94 sIdentifier =
"com.sun.star.presentation.PresentationDocument";
96 else if ( sShortName ==
u"smath" )
97 sIdentifier =
"com.sun.star.formula.FormulaProperties";
99 else if ( sShortName ==
u"schart" )
100 sIdentifier =
"com.sun.star.chart2.ChartDocument";
102 else if ( sShortName ==
u"BasicIDE" )
103 sIdentifier =
"com.sun.star.script.BasicIDE";
105 else if ( sShortName ==
u"dbapp" )
106 sIdentifier =
"com.sun.star.sdb.OfficeDatabaseDocument";
108 else if ( sShortName ==
u"sglobal" )
109 sIdentifier =
"com.sun.star.text.GlobalDocument";
111 else if ( sShortName ==
u"sweb" )
112 sIdentifier =
"com.sun.star.text.WebDocument";
114 else if ( sShortName ==
u"swxform" )
115 sIdentifier =
"com.sun.star.xforms.XMLFormDocument";
117 else if ( sShortName ==
u"sbibliography" )
118 sIdentifier =
"com.sun.star.frame.Bibliography";
128 bool bRet = aFile.open (osl_File_OpenFlag_Write | osl_File_OpenFlag_Create | osl_File_OpenFlag_NoLock) == FileBase::E_EXIST;
129 SAL_INFO(
"desktop.migration",
"File '" <<
aStr <<
"' exists? " << bRet );
150 SAL_INFO(
"desktop.migration",
"Migration " << ( bRet ?
"needed" :
"not required" ) );
162 bool bResult =
false;
168 OSL_ENSURE(bResult,
"Migration has not been successful");
189 aNewVersionUIInfo.
init(vModulesInfo);
193 static constexpr OUStringLiteral sMenubarResourceURL(
u"private:resource/menubar/menubar");
194 static constexpr OUStringLiteral sToolbarResourcePre(
u"private:resource/toolbar/");
197 if (sModuleIdentifier.isEmpty())
201 OUString aOldCfgDataPath =
m_aInfo.
userdata +
"/user/config/soffice.cfg/modules/" +
i.sModuleShortName;
209 if ( xModules.is() ) {
210 xOldCfgManager->setStorage( xModules );
211 xOldCfgManager->reload();
219 compareOldAndNewConfig(OUString(), xOldVersionMenuSettings, xNewVersionMenuSettings, sMenubarResourceURL);
220 mergeOldToNewVersion(xCfgManager, xNewVersionMenuSettings, sModuleIdentifier, sMenubarResourceURL);
223 sal_Int32 nToolbars =
i.m_vToolbars.size();
225 for (sal_Int32 j=0; j<nToolbars; ++j) {
226 OUString sToolbarName =
i.m_vToolbars[j];
227 OUString sToolbarResourceURL = sToolbarResourcePre + sToolbarName;
231 compareOldAndNewConfig(OUString(), xOldVersionToolbarSettings, xNewVersionToolbarSettings, sToolbarResourceURL);
232 mergeOldToNewVersion(xCfgManager, xNewVersionToolbarSettings, sModuleIdentifier, sToolbarResourceURL);
247 uno::UNO_QUERY_THROW)->refresh();
250 }
catch (
const css::uno::Exception &) {
266 aPropertySet->setPropertyValue(
"MigrationCompleted",
uno::Any(
true));
275 bool bMigrationCompleted =
false;
279 aPropertySet->getPropertyValue(
"MigrationCompleted") >>= bMigrationCompleted;
281 if( !bMigrationCompleted && getenv(
"SAL_DISABLE_USERMIGRATION" ) ) {
284 bMigrationCompleted =
true;
289 SAL_INFO(
"desktop.migration",
"Migration " << ( bMigrationCompleted ?
"already completed" :
"not done" ) );
291 return bMigrationCompleted;
296 migrations_available::iterator pIter = std::find_if(rAvailableMigrations.begin(), rAvailableMigrations.end(),
297 [&aSupportedMigration](
const supported_migration& rMigration) { return rMigration.nPriority < aSupportedMigration.nPriority; });
298 if (pIter != rAvailableMigrations.end())
299 rAvailableMigrations.insert(pIter, aSupportedMigration );
301 rAvailableMigrations.push_back( aSupportedMigration );
310 static constexpr OUStringLiteral aVersionIdentifiers(
u"VersionIdentifiers" );
311 static constexpr OUStringLiteral aPriorityIdentifier(
u"Priority" );
313 for (OUString
const & supportedVersion :seqSupportedVersions) {
314 sal_Int32 nPriority( 0 );
317 xMigrationData->getByName( aVersionIdentifiers ) >>= seqVersions;
318 xMigrationData->getByName( aPriorityIdentifier ) >>= nPriority;
321 aSupportedMigration.
name = supportedVersion;
322 aSupportedMigration.
nPriority = nPriority;
323 for (OUString
const & s : std::as_const(seqVersions))
325 insertSorted( rAvailableMigrations, aSupportedMigration );
326 SAL_INFO(
"desktop.migration",
" available migration '" << aSupportedMigration.
name <<
"'" );
342 const css::uno::Sequence<OUString> aMigrationSteps = theNameAccess->getElementNames();
343 for (
const OUString& rMigrationStep : aMigrationSteps) {
345 theNameAccess->getByName(rMigrationStep) >>= tmpAccess;
349 if (tmpAccess->getByName(
"IncludedFiles") >>= tmpSeq) {
350 for (
const OUString& rSeqEntry : std::as_const(tmpSeq))
355 if (tmpAccess->getByName(
"ExcludedFiles") >>= tmpSeq) {
356 for (
const OUString& rSeqEntry : std::as_const(tmpSeq))
361 if (tmpAccess->getByName(
"IncludedNodes") >>= tmpSeq) {
362 for (
const OUString& rSeqEntry : std::as_const(tmpSeq))
367 if (tmpAccess->getByName(
"ExcludedNodes") >>= tmpSeq) {
368 for (
const OUString& rSeqEntry : std::as_const(tmpSeq))
373 if (tmpAccess->getByName(
"ExcludedExtensions") >>= tmpSeq) {
374 for (
const OUString& rSeqEntry : std::as_const(tmpSeq))
379 tmpAccess->getByName(
"MigrationService") >>= tmpStep.
service;
381 vrMigrations->push_back(tmpStep);
389 if (
result == FileBase::E_NOENT) {
398#if defined UNX && ! defined MACOSX
404 OUString aPreXDGConfigPath;
405 const char* pXDGCfgHome = getenv(
"XDG_CONFIG_HOME");
420 aPreXDGConfigPath = rConfigDir.copy( 0, rConfigDir.getLength() -
sizeof(
XDG_CONFIG_PART ) + 2 );
422 aPreXDGConfigPath = rConfigDir;
426 aPreXDGConfigPath +=
".";
428 return aPreXDGConfigPath;
434 std::u16string_view rConfigDir,
435 const OUString& rVersion)
438 osl::DirectoryItem item;
439 osl::FileStatus stat(osl_FileStatus_Mask_Type);
441 if (osl::DirectoryItem::get(url, item) == osl::FileBase::E_None
442 && item.getFileStatus(stat) == osl::FileBase::E_None
443 && stat.getFileType() == osl::FileStatus::Directory) {
452 OUString aTopConfigDir;
453 osl::Security().getConfigDir( aTopConfigDir );
454 if ( !aTopConfigDir.isEmpty() && aTopConfigDir[ aTopConfigDir.getLength()-1 ] !=
'/' )
455 aTopConfigDir +=
"/";
457#if defined UNX && ! defined MACOSX
462 for (
auto const& elem : rVersions)
464 OUString aVersion, aProfileName;
465 sal_Int32 nSeparatorIndex = elem.indexOf(
'=');
466 if ( nSeparatorIndex != -1 ) {
467 aVersion = elem.copy( 0, nSeparatorIndex );
468 aProfileName = elem.copy( nSeparatorIndex+1 );
471 if ( !aVersion.isEmpty() && !aProfileName.isEmpty() &&
473 aProfileName.equalsIgnoreAsciiCase(
476#if defined UNX && ! defined MACOSX
492 for (
auto const& availableMigration : rAvailableMigrations)
513 for (
auto const& pattern : vPatterns)
517 SearchParam param(pattern, SearchParam::SearchType::Regexp);
521 for (
auto const& elem : vSet)
523 end = elem.getLength();
525 vrResult->push_back(elem);
536 Directory dir(baseURL);
537 if (dir.open() == FileBase::E_None) {
543 FileStatus fs(osl_FileStatus_Mask_Type | osl_FileStatus_Mask_FileURL);
544 while (dir.getNextItem(item) == FileBase::E_None) {
545 if (item.getFileStatus(
fs) == FileBase::E_None) {
546 if (
fs.getFileType() == FileStatus::Directory)
547 vSubDirs.push_back(
fs.getFileURL());
549 vrResult->push_back(
fs.getFileURL());
554 for (
auto const& subDir : vSubDirs)
557 vrResult->insert(vrResult->end(), vrSubResult->begin(), vrSubResult->end());
569 std::sort(
a.begin(),
a.end());
570 strings_v::iterator ae(std::unique(
a.begin(),
a.end()));
571 std::sort(b.begin(), b.end());
572 strings_v::iterator be(std::unique(b.begin(), b.end()));
574 std::set_difference(
a.begin(), ae, b.begin(), be, std::back_inserter(c));
593 strings_v sub(subtract(std::move(*vrInclude), std::move(*vrExclude)));
594 vrResult->insert(vrResult->end(), sub.begin(), sub.end());
602struct componentParts {
607typedef std::map< OUString, componentParts >
Components;
609bool getComponent(OUString
const & path, OUString * component)
611 OSL_ASSERT(component !=
nullptr);
612 if (path.isEmpty() || path[0] !=
'/') {
613 SAL_INFO(
"desktop.migration",
"configuration migration in/exclude path " << path <<
" ignored (does not start with slash)" );
616 sal_Int32
i = path.indexOf(
'/', 1);
617 *component =
i < 0 ? path.copy(1) : path.copy(1, i - 1);
621void renameMigratedSetElementTo(
622 css::uno::Reference<css::container::XNameContainer>
const & set, OUString
const & currentName,
623 OUString
const & migratedName)
628 bool const hasCurrent =
set->hasByName(currentName);
629 bool const hasMigrated =
set->hasByName(migratedName);
630 if (hasCurrent && !hasMigrated) {
631 auto const elem =
set->getByName(currentName);
632 set->removeByName(currentName);
633 set->insertByName(migratedName, elem);
635 SAL_INFO_IF(!hasCurrent,
"desktop.migration",
"unexpectedly missing " << currentName);
636 SAL_INFO_IF(hasMigrated,
"desktop.migration",
"unexpectedly present " << migratedName);
640void renameMigratedSetElementBack(
641 css::uno::Reference<css::container::XNameContainer>
const & set, OUString
const & currentName,
642 OUString
const & migratedName)
647 bool const hasMigrated =
set->hasByName(migratedName);
650 elem =
set->getByName(migratedName);
651 set->removeByName(migratedName);
653 SAL_INFO(
"desktop.migration",
"unexpected loss of " << migratedName);
654 elem <<= css::uno::Reference<css::lang::XSingleServiceFactory>(
655 set, css::uno::UNO_QUERY_THROW)->createInstance();
657 if (
set->hasByName(currentName)) {
658 SAL_INFO(
"desktop.migration",
"unexpected reappearance of " << currentName);
662 "reappeared " << currentName <<
" overwritten with " << migratedName);
663 set->replaceByName(currentName, elem);
666 set->insertByName(currentName, elem);
676 for (
const OUString& rIncludePath : rMigrationStep.includeConfig) {
678 if (getComponent(rIncludePath, &
comp)) {
679 comps[
comp].includedPaths.insert(rIncludePath);
682 for (
const OUString& rExcludePath : rMigrationStep.excludeConfig) {
684 if (getComponent(rExcludePath, &
comp)) {
685 comps[
comp].excludedPaths.insert(rExcludePath);
691 bool bRegistryModificationsXcuExists =
false;
692 OUString regFilePath =
m_aInfo.
userdata +
"/user/registrymodifications.xcu";
693 File regFile(regFilePath);
694 ::osl::FileBase::RC nError = regFile.open(osl_File_OpenFlag_Read);
695 if ( nError == ::osl::FileBase::E_None ) {
696 bRegistryModificationsXcuExists =
true;
709 OUString sProductNameDark = sProductName +
" Dark";
712 if (isdigit(sMigratedProductName[sMigratedProductName.getLength() - 1]))
714 OUString sMigratedProductNameDark = sMigratedProductName +
" Dark";
715 auto const tempRename = sMigratedProductName != sProductName;
718 auto const schemes = officecfg::Office::UI::ColorScheme::ColorSchemes::get(batch);
719 renameMigratedSetElementTo(schemes, sProductName, sMigratedProductName);
720 renameMigratedSetElementTo(schemes, sProductNameDark, sMigratedProductNameDark);
724 for (
auto const&
comp : comps)
726 if (!
comp.second.includedPaths.empty()) {
727 if (!bRegistryModificationsXcuExists) {
732 +
"/user/registry/data");
735 OUString seg(
comp.first.getToken(0,
'.',
n));
738 seg, rtl_UriCharClassPchar, rtl_UriEncodeStrict,
739 RTL_TEXTENCODING_UTF8));
740 if (enc.isEmpty() && !seg.isEmpty()) {
741 SAL_INFO(
"desktop.migration",
"configuration migration component " <<
comp.first <<
" ignored (cannot be encoded as file path)" );
744 buf.append(
"/" + enc);
747 regFilePath = buf.makeStringAndClear();
749 configuration::Update::get(
751 insertModificationXcuFile(
757 SAL_INFO(
"desktop.migration",
"configuration migration component " <<
comp.first <<
" ignored (only excludes, no includes)" );
764 auto const schemes = officecfg::Office::UI::ColorScheme::ColorSchemes::get(batch);
765 renameMigratedSetElementBack(schemes, sProductName, sMigratedProductName);
766 renameMigratedSetElementBack(schemes, sProductNameDark, sMigratedProductNameDark);
772 OUString sMigratedColorScheme;
774 getConfigAccess(
"org.openoffice.Office.UI/ColorScheme",
true), uno::UNO_QUERY_THROW);
775 if (aPropertySet->getPropertyValue(
"CurrentColorScheme") >>= sMigratedColorScheme)
777 if (sMigratedColorScheme.equals(sMigratedProductName))
779 aPropertySet->setPropertyValue(
"CurrentColorScheme",
783 else if (sMigratedColorScheme.equals(sMigratedProductNameDark))
785 aPropertySet->setPropertyValue(
"CurrentColorScheme",
801 sAccessSrvc =
"com.sun.star.configuration.ConfigurationUpdateAccess";
803 sAccessSrvc =
"com.sun.star.configuration.ConfigurationAccess";
805 OUString sConfigURL = OUString::createFromAscii(pPath);
808 configuration::theDefaultProvider::get(
814 theConfigProvider->createInstanceWithArguments(
816 }
catch (
const css::uno::Exception&) {
826 OUString userInstall;
834 if (localName.endsWith(
"/autocorr/acor_.dat")) {
839 localName = OUString::Concat(localName.subView( 0, localName.getLength() - 4)) +
"und.dat";
841 destName = userInstall + localName;
844 aURL.removeSegment();
846 FileBase::RC copyResult = File::copy(rFile, destName);
847 if (copyResult != FileBase::E_None) {
848 SAL_WARN(
"desktop",
"Cannot copy " << rFile <<
" to " << destName);
852 OSL_FAIL(
"copyFiles: UserInstall does not exist");
860 auto pseqArguments = seqArguments.getArray();
861 pseqArguments[0] <<= NamedValue(
"Productname",
863 pseqArguments[1] <<= NamedValue(
"UserData",
874 if( !rMigration.service.isEmpty()) {
879 sal_uInt32 nSize = rMigration.excludeExtensions.size();
881 seqExtDenyList = comphelper::arrayToSequence< OUString >(
882 rMigration.excludeExtensions.data(), nSize );
883 pseqArguments[2] <<= NamedValue(
"ExtensionDenyList",
887 xContext->getServiceManager()->createInstanceWithArgumentsAndContext(rMigration.service, seqArguments,
xContext),
888 uno::UNO_QUERY_THROW);
895 << rMigration.service);
897 SAL_WARN(
"desktop",
"Execution of migration service failed (Exception caught).\nService: "
898 << rMigration.service <<
"\nNo message available");
907 std::vector< MigrationModuleInfo > vModulesInfo;
908 static constexpr OUStringLiteral MENUBAR(
u"menubar");
909 static constexpr OUStringLiteral TOOLBAR(
u"toolbar");
912 uno::Any(embed::ElementModes::READ)};
918 xModules.set(xStorageFactory->createInstanceWithArguments(lArgs), uno::UNO_QUERY);
923 sal_Int32
nLength = lNames.getLength();
925 OUString sModuleShortName = lNames[
i];
932 if (xMenubar->getElementNames().hasElements()) {
940 const ::uno::Sequence< OUString > lToolbars = xToolbar->getElementNames();
941 for (OUString
const & sToolbarName : lToolbars) {
942 if (sToolbarName.startsWith(
"custom_"))
946 sal_Int32
nIndex = sToolbarName.lastIndexOf(
'.');
948 std::u16string_view sExtension(sToolbarName.subView(
nIndex));
949 OUString sToolbarResourceName(sToolbarName.copy(0,
nIndex));
950 if (!sToolbarResourceName.isEmpty() && sExtension ==
u".xml")
951 aModuleInfo.
m_vToolbars.push_back(sToolbarResourceName);
957 vModulesInfo.push_back(aModuleInfo);
967 const OUString& sResourceURL)
969 static constexpr OUStringLiteral MENU_SEPARATOR(
u" | ");
971 std::vector< MigrationItem > vOldItems;
972 std::vector< MigrationItem > vNewItems;
974 sal_Int32 nOldCount = xIndexOld->getCount();
975 sal_Int32 nNewCount = xIndexNew->getCount();
977 for (
int n=0;
n<nOldCount; ++
n) {
979 if (xIndexOld->getByIndex(
n) >>= aProps) {
980 for(beans::PropertyValue
const & prop : std::as_const(aProps)) {
988 vOldItems.push_back(aMigrationItem);
992 for (
int n=0;
n<nNewCount; ++
n) {
994 if (xIndexNew->getByIndex(
n) >>= aProps) {
995 for(beans::PropertyValue
const & prop : std::as_const(aProps)) {
1003 vNewItems.push_back(aMigrationItem);
1008 for (
auto const& oldItem : vOldItems)
1010 std::vector< MigrationItem >::iterator pFound = std::find(vNewItems.begin(), vNewItems.end(), oldItem);
1011 if (pFound != vNewItems.end() && oldItem.m_xPopupMenu.is()) {
1013 if (!sParent.isEmpty())
1014 sName = sParent + MENU_SEPARATOR + oldItem.m_sCommandURL;
1016 sName = oldItem.m_sCommandURL;
1018 }
else if (pFound == vNewItems.end()) {
1019 MigrationItem aMigrationItem(sParent, sSibling, oldItem.m_sCommandURL, oldItem.m_xPopupMenu);
1021 std::vector< MigrationItem > vMigrationItems;
1030 sSibling = oldItem.m_sCommandURL;
1036 const OUString& sModuleIdentifier,
1037 const OUString& sResourceURL)
1043 for (
auto const& elem : pFound->second)
1047 OUString sParentNodeName = elem.m_sParentNodeName;
1054 sal_Int32
nCount = xTemp->getCount();
1056 OUString sCommandURL;
1061 xTemp->getByIndex(
i) >>= aPropSeq;
1062 for (beans::PropertyValue
const & prop : std::as_const(aPropSeq)) {
1063 OUString sPropName = prop.Name;
1065 prop.Value >>= sCommandURL;
1067 prop.Value >>= sLabel;
1069 prop.Value >>= xChild;
1072 if (sCommandURL == sToken) {
1088 if (elem.m_sPrevSibling.isEmpty())
1089 xTemp->insertByIndex(0,
uno::Any(aPropSeq));
1091 sal_Int32
nCount = xTemp->getCount();
1096 xTemp->getByIndex(
i) >>= aTempPropSeq;
1097 for (beans::PropertyValue
const & prop : std::as_const(aTempPropSeq)) {
1099 prop.Value >>= sCmd;
1104 if (sCmd == elem.m_sPrevSibling)
1108 xTemp->insertByIndex(
i+1,
uno::Any(aPropSeq));
1113 if (xIndexContainer.is())
1114 xCfgManager->replaceSettings(sResourceURL, xIndexContainer);
1117 if (xUIConfigurationPersistence.is())
1118 xUIConfigurationPersistence->store();
1126 if (rProp.Name == sModuleShortName) {
1127 rProp.Value >>= xCfgManager;
1140 if (prop.Name == sModuleShortName) {
1141 prop.Value >>= xNewMenuSettings;
1146 return xNewMenuSettings;
1154 if (newProp.Name == sModuleShortName) {
1156 newProp.Value >>= lToolbarSettingsSeq;
1157 for (
auto const & prop : std::as_const(lToolbarSettingsSeq)) {
1158 if (prop.Name == sToolbarName) {
1159 prop.Value >>= xNewToolbarSettings;
1168 return xNewToolbarSettings;
1179 static constexpr OUStringLiteral sMenubarResourceURL(
u"private:resource/menubar/menubar");
1180 static constexpr OUStringLiteral sToolbarResourcePre(
u"private:resource/toolbar/");
1184 for (
size_t i=0;
i<vModulesInfo.size(); ++
i) {
1186 if (!sModuleIdentifier.isEmpty()) {
1191 if (vModulesInfo[
i].bHasMenubar) {
1192 p_lNewVersionMenubarSettingsSeq[
i].Name = vModulesInfo[
i].sModuleShortName;
1193 p_lNewVersionMenubarSettingsSeq[
i].Value <<= xCfgManager->getSettings(sMenubarResourceURL,
true);
1196 sal_Int32 nToolbars = vModulesInfo[
i].m_vToolbars.size();
1197 if (nToolbars > 0) {
1199 auto plPropSeq = lPropSeq.getArray();
1200 for (sal_Int32 j=0; j<nToolbars; ++j) {
1201 OUString sToolbarName = vModulesInfo[
i].m_vToolbars[j];
1202 OUString sToolbarResourceURL = sToolbarResourcePre + sToolbarName;
1204 plPropSeq[j].Name = sToolbarName;
1205 plPropSeq[j].Value <<= xCfgManager->getSettings(sToolbarResourceURL,
true);
1208 p_lNewVersionToolbarSettingsSeq[
i].Name = vModulesInfo[
i].sModuleShortName;
1209 p_lNewVersionToolbarSettingsSeq[
i].Value <<= lPropSeq;
PropertiesInfo aProperties
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
bool removeSegment(sal_Int32 nIndex=LAST_SEGMENT, bool bIgnoreFinalSlash=true)
static std::shared_ptr< ConfigurationChanges > create()
static css::uno::Reference< css::container::XNameAccess > getConfigAccess(const char *path, bool rw=false)
strings_vr getAllFiles(const OUString &baseURL) const
static void setInstallInfoIfExist(install_info &aInfo, std::u16string_view rConfigDir, const OUString &rVersion)
migrations_available m_vMigrationsAvailable
static bool checkMigrationCompleted()
void mergeOldToNewVersion(const css::uno::Reference< css::ui::XUIConfigurationManager > &xCfgManager, const css::uno::Reference< css::container::XIndexContainer > &xIndexContainer, const OUString &sModuleIdentifier, const OUString &sResourceURL)
static migrations_vr readMigrationSteps(const OUString &rMigrationName)
migrations_vr m_vrMigrations
MigrationHashMap m_aOldVersionItemsHashMap
bool initializeMigration()
static install_info findInstallation(const strings_v &rVersions)
void compareOldAndNewConfig(const OUString &sParentNodeName, const css::uno::Reference< css::container::XIndexContainer > &xOldIndexContainer, const css::uno::Reference< css::container::XIndexContainer > &xNewIndexContainer, const OUString &sToolbarName)
static void readAvailableMigrations(migrations_available &)
sal_Int32 findPreferredMigrationProcess(const migrations_available &)
static OUString preXDGConfigDir(const OUString &rConfigDir)
std::vector< MigrationModuleInfo > detectUIChangesForAllModules() const
static strings_vr applyPatterns(const strings_v &vSet, const strings_v &vPatterns)
strings_vr compileFileList()
static void setMigrationCompleted()
static void migrateSettingsIfNecessary()
get the information before copying the ui configuration files of old version to new version
css::uno::Reference< css::container::XIndexContainer > getNewToolbarSettings(std::u16string_view sModuleShortName, std::u16string_view sToolbarName) const
void init(const std::vector< MigrationModuleInfo > &vModulesInfo)
css::uno::Reference< css::container::XIndexContainer > getNewMenubarSettings(std::u16string_view sModuleShortName) const
std::vector< css::beans::PropertyValue > m_lCfgManagerSeq
css::uno::Reference< css::ui::XUIConfigurationManager > getConfigManager(std::u16string_view sModuleShortName) const
css::uno::Sequence< css::beans::PropertyValue > m_lNewVersionMenubarSettingsSeq
css::uno::Sequence< css::beans::PropertyValue > m_lNewVersionToolbarSettingsSeq
static PathStatus locateUserInstallation(OUString &_rURL)
static OUString getProductName()
bool SearchForward(const OUString &rStr, sal_Int32 *pStart, sal_Int32 *pEnd, css::util::SearchResult *pRes=nullptr)
#define TOOLS_WARN_EXCEPTION(area, stream)
static uno::Reference< css::uno::XComponentContext > xContext
#define LANGUAGE_DONTKNOW
#define SAL_INFO_IF(condition, area, stream)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
std::set< OUString > includedPaths
std::set< OUString > excludedPaths
void set(css::uno::UnoInterfaceReference const &value)
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
Reference< XComponentContext > getProcessComponentContext()
std::vector< migration_step > migrations_v
std::vector< supported_migration > migrations_available
static void insertSorted(migrations_available &rAvailableMigrations, supported_migration const &aSupportedMigration)
std::unique_ptr< migrations_v > migrations_vr
const char XDG_CONFIG_PART[]
std::unique_ptr< strings_v > strings_vr
std::vector< OUString > strings_v
static FileBase::RC _checkAndCreateDirectory(INetURLObject const &dirURL)
constexpr OUStringLiteral ITEM_DESCRIPTOR_COMMANDURL
constexpr OUStringLiteral ITEM_DESCRIPTOR_LABEL
constexpr OUStringLiteral ITEM_DESCRIPTOR_CONTAINER
static OUString mapModuleShortNameToIdentifier(std::u16string_view sShortName)
css::uno::Reference< css::deployment::XPackageRegistry > create(css::uno::Reference< css::deployment::XPackageRegistry > const &xRootRegistry, OUString const &context, OUString const &cachePath, css::uno::Reference< css::uno::XComponentContext > const &xComponentContext)
std::basic_string_view< charT, traits > trim(std::basic_string_view< charT, traits > str)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
enumrange< T >::Iterator begin(enumrange< T >)
Sequence< beans::PropertyValue > GetCommandProperties(const OUString &rsCommandName, const OUString &rsModuleName)
OUString GetLabelForCommand(const css::uno::Sequence< css::beans::PropertyValue > &rProperties)
constexpr OUStringLiteral sAccessSrvc
css::uno::Reference< css::container::XIndexContainer > m_xPopupMenu
information for the UI elements to be migrated for one module
OUString sModuleShortName
std::vector< OUString > m_vToolbars
strings_v excludeExtensions
strings_v supported_versions
std::vector< uno::Reference< sheet::XSpreadsheetDocument > > Components