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
3405eb11
Kaydet (Commit)
3405eb11
authored
Şub 05, 2013
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Simplify_component_getFactory using the helper code from cppu.
Change-Id: I9d26b3523d4c6c22e0b26442ab3dfc479534f5bc
üst
3a959c78
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
47 deletions
+24
-47
detreg.cxx
sc/source/ui/unoobj/detreg.cxx
+19
-40
scdetect.cxx
sc/source/ui/unoobj/scdetect.cxx
+3
-4
scdetect.hxx
sc/source/ui/unoobj/scdetect.hxx
+2
-3
No files found.
sc/source/ui/unoobj/detreg.cxx
Dosyayı görüntüle @
3405eb11
...
...
@@ -19,54 +19,33 @@
#include "scdetect.hxx"
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <com/sun/star/uno/Sequence.h>
#include <sal/types.h>
#include <rtl/ustring.hxx>
#include <cppuhelper/implementationentry.hxx>
using
::
rtl
::
OUString
;
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
::
uno
;
using
namespace
::
com
::
sun
::
star
::
lang
;
namespace
{
extern
"C"
{
SAL_DLLPUBLIC_EXPORT
void
*
SAL_CALL
scd_component_getFactory
(
const
sal_Char
*
pImplementationName
,
void
*
pServiceManager
,
void
*
/* pRegistryKey */
)
static
const
cppu
::
ImplementationEntry
spServices
[]
=
{
// Set default return value for this operation - if it failed.
void
*
pReturn
=
NULL
;
if
(
(
pImplementationName
!=
NULL
)
&&
(
pServiceManager
!=
NULL
)
)
{
// Define variables which are used in following macros.
Reference
<
XSingleServiceFactory
>
xFactory
;
Reference
<
XMultiServiceFactory
>
xServiceManager
(
reinterpret_cast
<
XMultiServiceFactory
*
>
(
pServiceManager
)
)
;
ScFilterDetect
::
impl_createInstance
,
ScFilterDetect
::
impl_getStaticImplementationName
,
ScFilterDetect
::
impl_getStaticSupportedServiceNames
,
cppu
::
createSingleComponentFactory
,
0
,
0
},
{
0
,
0
,
0
,
0
,
0
,
0
}
};
if
(
ScFilterDetect
::
impl_getStaticImplementationName
().
equalsAscii
(
pImplementationName
)
)
{
xFactory
.
set
(
::
cppu
::
createSingleFactory
(
xServiceManager
,
ScFilterDetect
::
impl_getStaticImplementationName
(),
ScFilterDetect
::
impl_createInstance
,
ScFilterDetect
::
impl_getStaticSupportedServiceNames
()
));
}
}
// Factory is valid - service was found.
if
(
xFactory
.
is
()
)
{
xFactory
->
acquire
();
pReturn
=
xFactory
.
get
();
}
}
extern
"C"
{
// Return with result of this operation.
return
pReturn
;
SAL_DLLPUBLIC_EXPORT
void
*
SAL_CALL
scd_component_getFactory
(
const
char
*
pImplName
,
void
*
pServiceManager
,
void
*
pRegistryKey
)
{
return
::
cppu
::
component_getFactoryHelper
(
pImplName
,
pServiceManager
,
pRegistryKey
,
spServices
);
}
}
// extern "C"
...
...
sc/source/ui/unoobj/scdetect.cxx
Dosyayı görüntüle @
3405eb11
...
...
@@ -74,7 +74,7 @@ using namespace ::com::sun::star::lang;
using
namespace
::
com
::
sun
::
star
::
ucb
;
using
::
rtl
::
OUString
;
ScFilterDetect
::
ScFilterDetect
(
const
uno
::
Reference
<
lang
::
XMultiServiceFactory
>&
/*xFactory
*/
)
ScFilterDetect
::
ScFilterDetect
(
const
uno
::
Reference
<
uno
::
XComponentContext
>&
/*xContext
*/
)
{
}
...
...
@@ -932,10 +932,9 @@ OUString ScFilterDetect::impl_getStaticImplementationName()
}
uno
::
Reference
<
uno
::
XInterface
>
ScFilterDetect
::
impl_createInstance
(
const
uno
::
Reference
<
lang
::
XMultiServiceFactory
>&
xServiceManager
)
throw
(
uno
::
Exception
)
const
uno
::
Reference
<
uno
::
XComponentContext
>&
xContext
)
throw
(
uno
::
Exception
)
{
return
static_cast
<
cppu
::
OWeakObject
*
>
(
new
ScFilterDetect
(
xServiceManager
)
);
return
static_cast
<
cppu
::
OWeakObject
*>
(
new
ScFilterDetect
(
xContext
));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sc/source/ui/unoobj/scdetect.hxx
Dosyayı görüntüle @
3405eb11
...
...
@@ -33,7 +33,6 @@
#include <sfx2/sfxuno.hxx>
namespace
com
{
namespace
sun
{
namespace
star
{
namespace
lang
{
class
XMultiServiceFactory
;
}
namespace
beans
{
struct
PropertyValue
;
}
}}}
...
...
@@ -41,7 +40,7 @@ namespace com { namespace sun { namespace star {
class
ScFilterDetect
:
public
::
cppu
::
WeakImplHelper2
<
::
com
::
sun
::
star
::
document
::
XExtendedFilterDetection
,
::
com
::
sun
::
star
::
lang
::
XServiceInfo
>
{
public
:
ScFilterDetect
(
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
lang
::
XMultiServiceFactory
>&
xFactory
);
ScFilterDetect
(
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
uno
::
XComponentContext
>&
xContext
);
virtual
~
ScFilterDetect
();
/* XServiceInfo */
...
...
@@ -55,7 +54,7 @@ public:
/* Helper for registry */
static
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
uno
::
XInterface
>
SAL_CALL
impl_createInstance
(
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
lang
::
XMultiServiceFactory
>&
xServiceManager
)
impl_createInstance
(
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
uno
::
XComponentContext
>&
xContext
)
throw
(
com
::
sun
::
star
::
uno
::
Exception
);
//----------------------------------------------------------------------------------
...
...
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