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
af969873
Kaydet (Commit)
af969873
authored
Mar 05, 2013
tarafından
Michael Meeks
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
liblibo: better init code.
Change-Id: I8757739960cb1c764a5a66bd67d34731e3dfbf31
üst
07352f07
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
32 deletions
+23
-32
liblibreoffice.hxx
desktop/inc/liblibreoffice.hxx
+2
-3
liblibreoffice_impl.hxx
desktop/inc/liblibreoffice_impl.hxx
+2
-5
init.cxx
desktop/source/lib/init.cxx
+10
-7
shim.cxx
desktop/source/lib/shim.cxx
+2
-1
CppunitTest_liblibreoffice.mk
smoketest/CppunitTest_liblibreoffice.mk
+2
-15
libtest.cxx
smoketest/libtest.cxx
+5
-1
No files found.
desktop/inc/liblibreoffice.hxx
Dosyayı görüntüle @
af969873
...
@@ -10,16 +10,15 @@
...
@@ -10,16 +10,15 @@
#ifndef _LIBLIBREOFFICE_HXX
#ifndef _LIBLIBREOFFICE_HXX
#define _LIBLIBREOFFICE_HXX
#define _LIBLIBREOFFICE_HXX
typedef
int
loboolean
;
typedef
struct
_LODocument
LODocument
;
typedef
struct
_LODocument
LODocument
;
class
LibLibreOffice
class
LibLibreOffice
{
{
public
:
public
:
virtual
loboolean
initialize
(
const
char
*
installPath
)
=
0
;
virtual
bool
initialize
(
const
char
*
installPath
)
=
0
;
virtual
LODocument
*
documentLoad
(
const
char
*
url
)
=
0
;
virtual
LODocument
*
documentLoad
(
const
char
*
url
)
=
0
;
virtual
loboolean
documentSave
(
const
char
*
url
)
=
0
;
virtual
bool
documentSave
(
const
char
*
url
)
=
0
;
virtual
~
LibLibreOffice
()
{};
virtual
~
LibLibreOffice
()
{};
};
};
...
...
desktop/inc/liblibreoffice_impl.hxx
Dosyayı görüntüle @
af969873
...
@@ -12,16 +12,13 @@
...
@@ -12,16 +12,13 @@
#include "liblibreoffice.hxx"
#include "liblibreoffice.hxx"
typedef
int
loboolean
;
typedef
struct
_LODocument
LODocument
;
class
LibLibreOffice_Impl
:
public
LibLibreOffice
class
LibLibreOffice_Impl
:
public
LibLibreOffice
{
{
public
:
public
:
virtual
loboolean
initialize
(
const
char
*
installPath
);
virtual
bool
initialize
(
const
char
*
installPath
);
virtual
LODocument
*
documentLoad
(
const
char
*
url
);
virtual
LODocument
*
documentLoad
(
const
char
*
url
);
virtual
loboolean
documentSave
(
const
char
*
url
);
virtual
bool
documentSave
(
const
char
*
url
);
virtual
~
LibLibreOffice_Impl
();
virtual
~
LibLibreOffice_Impl
();
};
};
...
...
desktop/source/lib/init.cxx
Dosyayı görüntüle @
af969873
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* -*- Mode: C
++
; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
/*
* This file is part of the LibreOffice project.
* This file is part of the LibreOffice project.
*
*
...
@@ -42,7 +42,7 @@ LibLibreOffice_Impl::documentLoad( const char *docUrl )
...
@@ -42,7 +42,7 @@ LibLibreOffice_Impl::documentLoad( const char *docUrl )
return
NULL
;
return
NULL
;
}
}
loboolean
bool
LibLibreOffice_Impl
::
documentSave
(
const
char
*
)
LibLibreOffice_Impl
::
documentSave
(
const
char
*
)
{
{
return
1
;
return
1
;
...
@@ -73,16 +73,18 @@ aBasicErrorFunc( const OUString &rErr, const OUString &rAction )
...
@@ -73,16 +73,18 @@ aBasicErrorFunc( const OUString &rErr, const OUString &rAction )
static
void
static
void
initialize_uno
(
const
rtl
::
OUString
&
aUserProfileURL
)
initialize_uno
(
const
rtl
::
OUString
&
aUserProfileURL
)
{
{
xContext
=
cppu
::
defaultBootstrap_InitialComponentContext
();
fprintf
(
stderr
,
"Uno initialized %d
\n
"
,
xContext
.
is
()
);
xFactory
=
xContext
->
getServiceManager
();
xSFactory
=
uno
::
Reference
<
lang
::
XMultiServiceFactory
>
(
xFactory
,
uno
::
UNO_QUERY_THROW
);
comphelper
::
setProcessServiceFactory
(
xSFactory
);
// set UserInstallation to user profile dir in test/user-template
// set UserInstallation to user profile dir in test/user-template
rtl
::
Bootstrap
aDefaultVars
;
rtl
::
Bootstrap
aDefaultVars
;
aDefaultVars
.
set
(
rtl
::
OUString
(
"UserInstallation"
),
aUserProfileURL
);
aDefaultVars
.
set
(
rtl
::
OUString
(
"UserInstallation"
),
aUserProfileURL
);
xContext
=
comphelper
::
getProcessComponentContext
();
xFactory
=
xContext
->
getServiceManager
();
xSFactory
=
uno
::
Reference
<
lang
::
XMultiServiceFactory
>
(
xFactory
,
uno
::
UNO_QUERY_THROW
);
}
}
loboolean
bool
LibLibreOffice_Impl
::
initialize
(
const
char
*
app_path
)
LibLibreOffice_Impl
::
initialize
(
const
char
*
app_path
)
{
{
static
bool
bInitialized
=
false
;
static
bool
bInitialized
=
false
;
...
@@ -122,6 +124,7 @@ extern "C" {
...
@@ -122,6 +124,7 @@ extern "C" {
LibLibreOffice
*
liblibreoffice_hook
(
void
)
LibLibreOffice
*
liblibreoffice_hook
(
void
)
{
{
fprintf
(
stderr
,
"create libreoffice object
\n
"
);
return
new
LibLibreOffice_Impl
();
return
new
LibLibreOffice_Impl
();
}
}
...
...
desktop/source/lib/shim.cxx
Dosyayı görüntüle @
af969873
...
@@ -41,13 +41,14 @@ SAL_DLLPUBLIC_EXPORT LibLibreOffice *lo_init( const char *install_path )
...
@@ -41,13 +41,14 @@ SAL_DLLPUBLIC_EXPORT LibLibreOffice *lo_init( const char *install_path )
fprintf
(
stderr
,
"failed to open library '%s'
\n
"
,
imp_lib
);
fprintf
(
stderr
,
"failed to open library '%s'
\n
"
,
imp_lib
);
return
NULL
;
return
NULL
;
}
}
free
(
imp_lib
);
HookFunction
*
pSym
=
(
HookFunction
*
)
dlsym
(
dlhandle
,
"liblibreoffice_hook"
);
HookFunction
*
pSym
=
(
HookFunction
*
)
dlsym
(
dlhandle
,
"liblibreoffice_hook"
);
if
(
!
pSym
)
{
if
(
!
pSym
)
{
fprintf
(
stderr
,
"failed to find hook in library '%s'
\n
"
,
imp_lib
);
fprintf
(
stderr
,
"failed to find hook in library '%s'
\n
"
,
imp_lib
);
return
NULL
;
return
NULL
;
}
}
free
(
imp_lib
);
return
pSym
();
return
pSym
();
}
}
...
...
smoketest/CppunitTest_liblibreoffice.mk
Dosyayı görüntüle @
af969873
...
@@ -15,29 +15,16 @@ $(eval $(call gb_CppunitTest_add_exception_objects,liblibreoffice,\
...
@@ -15,29 +15,16 @@ $(eval $(call gb_CppunitTest_add_exception_objects,liblibreoffice,\
smoketest/libtest \
smoketest/libtest \
))
))
$(eval $(call gb_CppunitTest_use_external,liblibreoffice,boost_headers))
$(eval $(call gb_CppunitTest_use_api,liblibreoffice,\
offapi \
udkapi \
))
$(eval $(call gb_CppunitTest_use_libraries,liblibreoffice,\
$(eval $(call gb_CppunitTest_use_libraries,liblibreoffice,\
cppu \
cppuhelper \
libreoffice \
libreoffice \
sal \
unotest \
))
))
ifeq ($(OS),MACOSX)
ifeq ($(OS),MACOSX)
liblibreoffice_SOFFICE_INST :=
path:
$(DEVINSTALLDIR)/opt/LibreOffice.app/Contents/MacOS
liblibreoffice_SOFFICE_INST := $(DEVINSTALLDIR)/opt/LibreOffice.app/Contents/MacOS
else
else
liblibreoffice_SOFFICE_INST :=
path:
$(DEVINSTALLDIR)/opt/program
liblibreoffice_SOFFICE_INST := $(DEVINSTALLDIR)/opt/program
endif
endif
$(eval $(call gb_CppunitTest_use_ure,liblibreoffice))
$(eval $(call gb_CppunitTest_add_arguments,liblibreoffice,\
$(eval $(call gb_CppunitTest_add_arguments,liblibreoffice,\
-env:arg-soffice=$(liblibreoffice_SOFFICE_INST) \
-env:arg-soffice=$(liblibreoffice_SOFFICE_INST) \
))
))
...
...
smoketest/libtest.cxx
Dosyayı görüntüle @
af969873
...
@@ -46,7 +46,11 @@ void Test::test()
...
@@ -46,7 +46,11 @@ void Test::test()
rtl
::
Bootstrap
::
get
(
rtl
::
OUString
(
"arg-soffice"
),
aArgSoffice
);
rtl
::
Bootstrap
::
get
(
rtl
::
OUString
(
"arg-soffice"
),
aArgSoffice
);
OString
aInstall
=
OUStringToOString
(
aArgSoffice
,
RTL_TEXTENCODING_UTF8
);
OString
aInstall
=
OUStringToOString
(
aArgSoffice
,
RTL_TEXTENCODING_UTF8
);
fprintf
(
stderr
,
"liblibreoffice test: '%s'
\n
"
,
aInstall
.
getStr
()
);
fprintf
(
stderr
,
"liblibreoffice test: '%s'
\n
"
,
aInstall
.
getStr
()
);
assert
(
lo_init
(
aInstall
.
getStr
()
));
LibLibreOffice
*
pOffice
=
lo_init
(
aInstall
.
getStr
()
);
CPPUNIT_ASSERT
(
pOffice
!=
NULL
);
bool
bInited
=
pOffice
->
initialize
(
aInstall
.
getStr
()
);
CPPUNIT_ASSERT
(
bInited
);
}
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
Test
);
CPPUNIT_TEST_SUITE_REGISTRATION
(
Test
);
...
...
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