From b8918b363ea7242c304f438a64baf55d19eecddf Mon Sep 17 00:00:00 2001 From: Juergen Funk Date: Wed, 17 Dec 2014 16:23:47 +0100 Subject: fdo#88158 Display two "Open..." entries in the file-menu Migration from Version 3 to 4 make this fail Entry .uno:Open and .uno:OpenFromWriter are the same, skip the entry .uno:OpenFrom Change the operator, and a lot of comments change the match in startWith for better reading change test when old-cmd ".uno:Open" change to the stephan solution Change-Id: I0861c1e7d30b861acc753e3258707f3b6a338768 Signed-off-by: Stephan Bergmann --- desktop/source/migration/migration_impl.hxx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/desktop/source/migration/migration_impl.hxx b/desktop/source/migration/migration_impl.hxx index bffba28a546d..dc7d48ebf99c 100644 --- a/desktop/source/migration/migration_impl.hxx +++ b/desktop/source/migration/migration_impl.hxx @@ -114,12 +114,20 @@ struct MigrationItem return *this; } + bool areBothOpenFrom(OUString const & cmd1, OUString const & cmd2) + { + return cmd1 == ".uno:Open" && cmd2.startsWith(".uno:OpenFrom"); + } + + bool operator==(const MigrationItem& aMigrationItem) { - return ( aMigrationItem.m_sParentNodeName == m_sParentNodeName && - aMigrationItem.m_sPrevSibling == m_sPrevSibling && - aMigrationItem.m_sCommandURL == m_sCommandURL && - aMigrationItem.m_xPopupMenu.is() == m_xPopupMenu.is() ); + return ((aMigrationItem.m_sCommandURL == m_sCommandURL + || (areBothOpenFrom(aMigrationItem.m_sCommandURL, m_sCommandURL) + || areBothOpenFrom(m_sCommandURL, aMigrationItem.m_sCommandURL))) + && aMigrationItem.m_sParentNodeName == m_sParentNodeName + && aMigrationItem.m_sPrevSibling == m_sPrevSibling + && aMigrationItem.m_xPopupMenu.is() == m_xPopupMenu.is() ); } }; -- cgit v1.2.3