summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuergen Funk <juergen.funk_ml@cib.de>2014-12-17 16:23:47 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-01-22 09:23:48 +0100
commitb8918b363ea7242c304f438a64baf55d19eecddf (patch)
treeab3f22189fadba16385c38b191b8d0fb31b9047c
parente17847e0ce5602b0cdf312ba2c72bd99aa7b72b2 (diff)
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 <sbergman@redhat.com>
-rw-r--r--desktop/source/migration/migration_impl.hxx16
1 files 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() );
}
};