Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
a4de770b
Kaydet (Commit)
a4de770b
authored
Agu 19, 2015
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
comphelper: reduce copypasta with UniquePtrValueLess functor
Change-Id: Ib93b818eeebc2f370535d1b061beabf7e8c65257
üst
58c3bbfd
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
46 deletions
+31
-46
stl_types.hxx
include/comphelper/stl_types.hxx
+14
-0
msdffimp.hxx
include/filter/msfilter/msdffimp.hxx
+4
-8
blink.hxx
sw/source/core/inc/blink.hxx
+3
-10
wrthtml.hxx
sw/source/filter/html/wrthtml.hxx
+3
-10
impastpl.hxx
xmloff/source/style/impastpl.hxx
+7
-18
No files found.
include/comphelper/stl_types.hxx
Dosyayı görüntüle @
a4de770b
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include <math.h>
#include <math.h>
#include <functional>
#include <functional>
#include <memory>
#include <rtl/ustring.hxx>
#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
#include <rtl/ustrbuf.hxx>
...
@@ -86,6 +87,19 @@ public:
...
@@ -86,6 +87,19 @@ public:
}
}
};
};
/// by-value less functor for std::set<std::unique_ptr<T>>
template
<
class
T
>
struct
UniquePtrValueLess
:
public
::
std
::
binary_function
<
std
::
unique_ptr
<
T
>
,
std
::
unique_ptr
<
T
>
,
bool
>
{
bool
operator
()(
std
::
unique_ptr
<
T
>
const
&
lhs
,
std
::
unique_ptr
<
T
>
const
&
rhs
)
const
{
assert
(
lhs
.
get
());
assert
(
rhs
.
get
());
return
(
*
lhs
)
<
(
*
rhs
);
}
};
/** STL-compliant structure for comparing Reference< <iface> > instances
/** STL-compliant structure for comparing Reference< <iface> > instances
*/
*/
template
<
class
IAFCE
>
template
<
class
IAFCE
>
...
...
include/filter/msfilter/msdffimp.hxx
Dosyayı görüntüle @
a4de770b
...
@@ -31,6 +31,8 @@
...
@@ -31,6 +31,8 @@
#include <com/sun/star/embed/XEmbeddedObject.hpp>
#include <com/sun/star/embed/XEmbeddedObject.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <comphelper/stl_types.hxx>
#include <tools/solar.h>
#include <tools/solar.h>
#include <tools/color.hxx>
#include <tools/color.hxx>
#include <tools/gen.hxx>
#include <tools/gen.hxx>
...
@@ -266,15 +268,9 @@ private:
...
@@ -266,15 +268,9 @@ private:
SvxMSDffImportRec
&
operator
=
(
const
SvxMSDffImportRec
&
)
SAL_DELETED_FUNCTION
;
SvxMSDffImportRec
&
operator
=
(
const
SvxMSDffImportRec
&
)
SAL_DELETED_FUNCTION
;
};
};
struct
MSDffImportRecords_Less
{
bool
operator
()(
std
::
unique_ptr
<
SvxMSDffImportRec
>
const
&
left
,
std
::
unique_ptr
<
SvxMSDffImportRec
>
const
&
right
)
const
{
return
(
*
left
)
<
(
*
right
);
}
};
/** list of all SvxMSDffImportRec instances of/for a group */
/** list of all SvxMSDffImportRec instances of/for a group */
typedef
std
::
set
<
std
::
unique_ptr
<
SvxMSDffImportRec
>
,
MSDffImportRecords_Less
>
typedef
std
::
set
<
std
::
unique_ptr
<
SvxMSDffImportRec
>
,
MSDffImportRecords
;
comphelper
::
UniquePtrValueLess
<
SvxMSDffImportRec
>>
MSDffImportRecords
;
/** block of parameters for import/export for a single call of
/** block of parameters for import/export for a single call of
ImportObjAtCurrentStreamPos() */
ImportObjAtCurrentStreamPos() */
...
...
sw/source/core/inc/blink.hxx
Dosyayı görüntüle @
a4de770b
...
@@ -26,6 +26,7 @@ class SwTextFrm;
...
@@ -26,6 +26,7 @@ class SwTextFrm;
#include <vcl/timer.hxx>
#include <vcl/timer.hxx>
#include <tools/gen.hxx>
#include <tools/gen.hxx>
#include <comphelper/stl_types.hxx>
#include <set>
#include <set>
#include <memory>
#include <memory>
...
@@ -63,16 +64,8 @@ public:
...
@@ -63,16 +64,8 @@ public:
{
return
reinterpret_cast
<
sal_IntPtr
>
(
pPor
)
==
reinterpret_cast
<
sal_IntPtr
>
(
rBlinkPortion
.
pPor
);
}
{
return
reinterpret_cast
<
sal_IntPtr
>
(
pPor
)
==
reinterpret_cast
<
sal_IntPtr
>
(
rBlinkPortion
.
pPor
);
}
};
};
struct
SwBlinkPortion_Less
typedef
std
::
set
<
std
::
unique_ptr
<
SwBlinkPortion
>
,
{
comphelper
::
UniquePtrValueLess
<
SwBlinkPortion
>>
SwBlinkSet
;
bool
operator
()(
std
::
unique_ptr
<
SwBlinkPortion
>
const
&
lhs
,
std
::
unique_ptr
<
SwBlinkPortion
>
const
&
rhs
)
{
return
(
*
lhs
)
<
(
*
rhs
);
}
};
typedef
std
::
set
<
std
::
unique_ptr
<
SwBlinkPortion
>
,
SwBlinkPortion_Less
>
SwBlinkSet
;
class
SwBlink
class
SwBlink
{
{
...
...
sw/source/filter/html/wrthtml.hxx
Dosyayı görüntüle @
a4de770b
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#include <vcl/field.hxx>
#include <vcl/field.hxx>
#include <i18nlangtag/lang.h>
#include <i18nlangtag/lang.h>
#include <tools/stream.hxx>
#include <tools/stream.hxx>
#include <comphelper/stl_types.hxx>
#include <o3tl/sorted_vector.hxx>
#include <o3tl/sorted_vector.hxx>
#include "shellio.hxx"
#include "shellio.hxx"
...
@@ -262,16 +263,8 @@ struct SwHTMLFormatInfo
...
@@ -262,16 +263,8 @@ struct SwHTMLFormatInfo
};
};
struct
SwHTMLFormatInfo_Less
typedef
std
::
set
<
std
::
unique_ptr
<
SwHTMLFormatInfo
>
,
{
comphelper
::
UniquePtrValueLess
<
SwHTMLFormatInfo
>>
SwHTMLFormatInfos
;
bool
operator
()(
std
::
unique_ptr
<
SwHTMLFormatInfo
>
const
&
lhs
,
std
::
unique_ptr
<
SwHTMLFormatInfo
>
const
&
rhs
)
{
return
(
*
lhs
)
<
(
*
rhs
);
}
};
typedef
std
::
set
<
std
::
unique_ptr
<
SwHTMLFormatInfo
>
,
SwHTMLFormatInfo_Less
>
SwHTMLFormatInfos
;
class
IDocumentStylePoolAccess
;
class
IDocumentStylePoolAccess
;
...
...
xmloff/source/style/impastpl.hxx
Dosyayı görüntüle @
a4de770b
...
@@ -28,6 +28,9 @@
...
@@ -28,6 +28,9 @@
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/xml/sax/XAttributeList.hpp>
#include <com/sun/star/xml/sax/XAttributeList.hpp>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <comphelper/stl_types.hxx>
#include <xmloff/maptype.hxx>
#include <xmloff/maptype.hxx>
#include <xmloff/xmlexppr.hxx>
#include <xmloff/xmlexppr.hxx>
...
@@ -102,15 +105,8 @@ public:
...
@@ -102,15 +105,8 @@ public:
struct
XMLAutoStyleFamily
:
boost
::
noncopyable
struct
XMLAutoStyleFamily
:
boost
::
noncopyable
{
{
struct
XMLAutoStylePoolParent_Less
typedef
std
::
set
<
std
::
unique_ptr
<
XMLAutoStylePoolParent
>
,
{
comphelper
::
UniquePtrValueLess
<
XMLAutoStylePoolParent
>>
ParentSetType
;
bool
operator
()(
std
::
unique_ptr
<
XMLAutoStylePoolParent
>
const
&
lhs
,
std
::
unique_ptr
<
XMLAutoStylePoolParent
>
const
&
rhs
)
const
{
return
(
*
lhs
)
<
(
*
rhs
);
}
};
typedef
std
::
set
<
std
::
unique_ptr
<
XMLAutoStylePoolParent
>
,
XMLAutoStylePoolParent_Less
>
ParentSetType
;
typedef
std
::
set
<
OUString
>
NameSetType
;
typedef
std
::
set
<
OUString
>
NameSetType
;
sal_uInt32
mnFamily
;
sal_uInt32
mnFamily
;
...
@@ -140,16 +136,9 @@ struct XMLAutoStyleFamily : boost::noncopyable
...
@@ -140,16 +136,9 @@ struct XMLAutoStyleFamily : boost::noncopyable
class
SvXMLAutoStylePoolP_Impl
class
SvXMLAutoStylePoolP_Impl
{
{
struct
XMLAutoStyleFamily_Less
{
bool
operator
()(
std
::
unique_ptr
<
XMLAutoStyleFamily
>
const
&
lhs
,
std
::
unique_ptr
<
XMLAutoStyleFamily
>
const
&
rhs
)
const
{
return
(
*
lhs
)
<
(
*
rhs
);
}
};
// A set that finds and sorts based only on mnFamily
// A set that finds and sorts based only on mnFamily
typedef
std
::
set
<
std
::
unique_ptr
<
XMLAutoStyleFamily
>
,
XMLAutoStyleFamily_Less
>
FamilySetType
;
typedef
std
::
set
<
std
::
unique_ptr
<
XMLAutoStyleFamily
>
,
comphelper
::
UniquePtrValueLess
<
XMLAutoStyleFamily
>>
FamilySetType
;
SvXMLExport
&
rExport
;
SvXMLExport
&
rExport
;
FamilySetType
m_FamilySet
;
FamilySetType
m_FamilySet
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment