[Libreoffice-commits] core.git: 3 commits - desktop/source
Stephan Bergmann
sbergman at redhat.com
Thu Jan 22 00:25:07 PST 2015
desktop/source/migration/migration_impl.hxx | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
New commits:
commit 6e0676324e96a05ad1d211a3a59e5c0ad3efcac5
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Jan 22 09:22:27 2015 +0100
Re-indent to make precedence clear
Change-Id: Ibbc35d1a9264817f3fa8e3229ec1de5f51800e97
diff --git a/desktop/source/migration/migration_impl.hxx b/desktop/source/migration/migration_impl.hxx
index 9dab246..4ab6708 100644
--- a/desktop/source/migration/migration_impl.hxx
+++ b/desktop/source/migration/migration_impl.hxx
@@ -124,12 +124,13 @@ struct MigrationItem
bool operator==(const MigrationItem& aMigrationItem)
{
- return ((aMigrationItem.m_sCommandURL == m_sCommandURL
- || (areBothOpenFrom(aMigrationItem.m_sCommandURL, m_sCommandURL)
- || areBothOpenFrom(m_sCommandURL, aMigrationItem.m_sCommandURL)))
+ 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() );
+ && aMigrationItem.m_xPopupMenu.is() == m_xPopupMenu.is();
}
};
commit c8b9cbde1d5826931023cae062ba5c60da36820d
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Jan 22 09:20:30 2015 +0100
areBothOpenFrom can be a free function
Change-Id: I20697955457b1dadc334cb0f29c600687ae2d181
diff --git a/desktop/source/migration/migration_impl.hxx b/desktop/source/migration/migration_impl.hxx
index dc7d48e..9dab246 100644
--- a/desktop/source/migration/migration_impl.hxx
+++ b/desktop/source/migration/migration_impl.hxx
@@ -76,6 +76,14 @@ typedef std::vector< migration_step > migrations_v;
typedef std::unique_ptr< migrations_v > migrations_vr;
typedef std::vector< supported_migration > migrations_available;
+namespace {
+
+inline bool areBothOpenFrom(OUString const & cmd1, OUString const & cmd2)
+{
+ return cmd1 == ".uno:Open" && cmd2.startsWith(".uno:OpenFrom");
+}
+
+}
/**
define the item, e.g.:menuitem, toolbaritem, to be migrated. we keep the information
@@ -114,12 +122,6 @@ 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_sCommandURL == m_sCommandURL
commit b8918b363ea7242c304f438a64baf55d19eecddf
Author: Juergen Funk <juergen.funk_ml at cib.de>
Date: Wed Dec 17 16:23:47 2014 +0100
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 at redhat.com>
diff --git a/desktop/source/migration/migration_impl.hxx b/desktop/source/migration/migration_impl.hxx
index bffba28..dc7d48e 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() );
}
};
More information about the Libreoffice-commits
mailing list