diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-04-29 16:24:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-04-30 08:43:04 +0200 |
commit | 22f2cf3ccc6d0c9ba2c2860735e789d6b3a25f72 (patch) | |
tree | f20474881dd71d3f815a964718a3b7dbcc53340a /xmloff/source/forms | |
parent | f9f7cc62e95f12a9d4ea02413a658d40e09ccde6 (diff) |
implement std::hash for css::uno::Reference and rtl::Reference
The declaration in BarChart.cxx is particularly suspicious, because it
was using a < for the KeyEqual template parameter.
Been there since:
commit b2c3233e5f267b5d244d722a94424a3b224b3314
Date: Thu Dec 21 20:08:33 2017 +0900
chart2: suspend/resume setting rects dirty for 3D shapes
comphelper::OInterfaceCompare is no longer necessary
Change-Id: I8278c4a3d9113a18570ca237cd05d553ec8f3975
Reviewed-on: https://gerrit.libreoffice.org/71537
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source/forms')
-rw-r--r-- | xmloff/source/forms/eventimport.hxx | 4 | ||||
-rw-r--r-- | xmloff/source/forms/ifacecompare.hxx | 53 | ||||
-rw-r--r-- | xmloff/source/forms/layerexport.hxx | 7 | ||||
-rw-r--r-- | xmloff/source/forms/layerimport.hxx | 3 |
4 files changed, 5 insertions, 62 deletions
diff --git a/xmloff/source/forms/eventimport.hxx b/xmloff/source/forms/eventimport.hxx index f696e81a924a..da1d765cf5da 100644 --- a/xmloff/source/forms/eventimport.hxx +++ b/xmloff/source/forms/eventimport.hxx @@ -26,7 +26,6 @@ #include <xmloff/XMLEventsImportContext.hxx> #include "callbacks.hxx" -#include "ifacecompare.hxx" #include <com/sun/star/container/XIndexAccess.hpp> class SvXMLImport; @@ -51,8 +50,7 @@ namespace xmloff { typedef std::map< css::uno::Reference< css::beans::XPropertySet >, - css::uno::Sequence< css::script::ScriptEventDescriptor >, - OPropertySetCompare> + css::uno::Sequence< css::script::ScriptEventDescriptor >> MapPropertySet2ScriptSequence; // usually an event attacher manager will need to collect all script events registered, 'cause // the _real_ XEventAttacherManager handles it's events by index, but out indices are not fixed diff --git a/xmloff/source/forms/ifacecompare.hxx b/xmloff/source/forms/ifacecompare.hxx deleted file mode 100644 index 79b4bae04b2e..000000000000 --- a/xmloff/source/forms/ifacecompare.hxx +++ /dev/null @@ -1,53 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_XMLOFF_SOURCE_FORMS_IFACECOMPARE_HXX -#define INCLUDED_XMLOFF_SOURCE_FORMS_IFACECOMPARE_HXX - -#include <comphelper/stl_types.hxx> -#include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/drawing/XDrawPage.hpp> - -namespace xmloff -{ - - //= OInterfaceCompare - /** is stl-compliant structure for comparing Reference< <iface> > instances - */ - template < class IAFCE > - struct OInterfaceCompare - { - bool operator() (const css::uno::Reference< IAFCE >& lhs, const css::uno::Reference< IAFCE >& rhs) const - { - return lhs.get() < rhs.get(); - // this does not make any sense if you see the semantics of the pointer returned by get: - // It's a pointer to a point in memory where an interface implementation lies. - // But for our purpose (provide a reliable less-operator which can be used with the STL), this is - // sufficient .... - } - }; - - typedef OInterfaceCompare< css::beans::XPropertySet > OPropertySetCompare; - typedef OInterfaceCompare< css::drawing::XDrawPage > ODrawPageCompare; - -} // namespace xmloff - -#endif // INCLUDED_XMLOFF_SOURCE_FORMS_IFACECOMPARE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/forms/layerexport.hxx b/xmloff/source/forms/layerexport.hxx index 5a2ae2e7f8ad..163be842343e 100644 --- a/xmloff/source/forms/layerexport.hxx +++ b/xmloff/source/forms/layerexport.hxx @@ -26,11 +26,11 @@ #include <set> #include <com/sun/star/container/XIndexAccess.hpp> +#include <com/sun/star/drawing/XDrawPage.hpp> #include <com/sun/star/script/ScriptEventDescriptor.hpp> #include <com/sun/star/util/XNumberFormats.hpp> #include <com/sun/star/awt/XControlModel.hpp> #include "callbacks.hxx" -#include "ifacecompare.hxx" #include <rtl/ref.hxx> class SvXMLExport; @@ -42,19 +42,16 @@ namespace xmloff { typedef ::std::set < css::uno::Reference< css::beans::XPropertySet > - , OPropertySetCompare > PropertySetBag; // maps objects (property sets) to strings, e.g. control ids. typedef ::std::map < css::uno::Reference< css::beans::XPropertySet > , OUString - , OPropertySetCompare > MapPropertySet2String; // map pages to maps (of property sets to strings) typedef ::std::map < css::uno::Reference< css::drawing::XDrawPage > , MapPropertySet2String - , ODrawPageCompare > MapPropertySet2Map; //= OFormLayerXMLExport_Impl @@ -111,7 +108,7 @@ namespace xmloff // TODO: To avoid this construct above, and to have a cleaner implementation, an class encapsulating the // export of a single page should be introduced. - typedef std::map<css::uno::Reference<css::beans::XPropertySet>, sal_Int32, OPropertySetCompare> MapPropertySet2Int; + typedef std::map<css::uno::Reference<css::beans::XPropertySet>, sal_Int32> MapPropertySet2Int; MapPropertySet2Int m_aControlNumberFormats; // maps controls to format keys, which are relative to our own formats supplier diff --git a/xmloff/source/forms/layerimport.hxx b/xmloff/source/forms/layerimport.hxx index a6fbad3c7292..515fffe464ff 100644 --- a/xmloff/source/forms/layerimport.hxx +++ b/xmloff/source/forms/layerimport.hxx @@ -25,6 +25,7 @@ #include <map> #include <com/sun/star/xml/sax/XAttributeList.hpp> +#include <com/sun/star/drawing/XDrawPage.hpp> #include <com/sun/star/form/XFormsSupplier2.hpp> #include <rtl/ref.hxx> #include "formattributes.hxx" @@ -60,7 +61,7 @@ namespace xmloff rtl::Reference<SvXMLStylesContext> m_xAutoStyles; typedef std::map< OUString, css::uno::Reference< css::beans::XPropertySet > > MapString2PropertySet; - typedef std::map<css::uno::Reference<css::drawing::XDrawPage>, MapString2PropertySet, ODrawPageCompare> MapDrawPage2Map; + typedef std::map<css::uno::Reference<css::drawing::XDrawPage>, MapString2PropertySet> MapDrawPage2Map; MapDrawPage2Map m_aControlIds; // ids of the controls on all known page MapDrawPage2Map::iterator m_aCurrentPageIds; // ifs of the controls on the current page |