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
a533f986
Kaydet (Commit)
a533f986
authored
Haz 10, 2014
tarafından
Andrzej Hunt
Kaydeden (comit)
Michael Meeks
Haz 11, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Upgrade LibreOfficeKit C++ API.
Change-Id: If263b8fc748f67a1ed423c0f3f7cd465cf533993
üst
cd76b999
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
12 deletions
+18
-12
LibreOfficeKit.hxx
include/LibreOfficeKit/LibreOfficeKit.hxx
+14
-10
libtest.cxx
smoketest/libtest.cxx
+4
-2
No files found.
include/LibreOfficeKit/LibreOfficeKit.hxx
Dosyayı görüntüle @
a533f986
...
...
@@ -18,18 +18,20 @@
* b) allow ABI stability - C++ vtables are not good for that.
* c) avoid C++ types as part of the API.
*/
namespace
lok
{
class
LO
Document
class
Document
{
private
:
LibreOfficeKitDocument
*
mpDoc
;
public
:
inline
LO
Document
(
LibreOfficeKitDocument
*
pDoc
)
:
inline
Document
(
LibreOfficeKitDocument
*
pDoc
)
:
mpDoc
(
pDoc
)
{}
inline
~
LO
Document
()
inline
~
Document
()
{
mpDoc
->
destroy
(
mpDoc
);
}
...
...
@@ -50,17 +52,17 @@ public:
}
};
class
LibLibre
Office
class
Office
{
private
:
LibreOfficeKit
*
mpThis
;
public
:
inline
LibLibre
Office
(
LibreOfficeKit
*
pThis
)
:
inline
Office
(
LibreOfficeKit
*
pThis
)
:
mpThis
(
pThis
)
{}
inline
~
LibLibre
Office
()
inline
~
Office
()
{
mpThis
->
destroy
(
mpThis
);
}
...
...
@@ -70,12 +72,12 @@ public:
return
mpThis
->
initialize
(
mpThis
,
pInstallPath
);
}
inline
LO
Document
*
documentLoad
(
const
char
*
pUrl
)
inline
Document
*
documentLoad
(
const
char
*
pUrl
)
{
LibreOfficeKitDocument
*
pDoc
=
mpThis
->
documentLoad
(
mpThis
,
pUrl
);
if
(
pDoc
==
NULL
)
return
NULL
;
return
new
LO
Document
(
pDoc
);
return
new
Document
(
pDoc
);
}
// return the last error as a string, free me.
...
...
@@ -85,12 +87,14 @@ public:
}
};
inline
LibLibreOffice
*
lo_cpp_init
(
const
char
*
pInstallPath
)
}
inline
::
lok
::
Office
*
lo_cpp_init
(
const
char
*
pInstallPath
)
{
LibreOfficeKit
*
pThis
=
lok_init
(
pInstallPath
);
if
(
pThis
==
NULL
||
pThis
->
nSize
==
0
)
return
NULL
;
return
new
LibLibre
Office
(
pThis
);
return
new
::
lok
::
Office
(
pThis
);
}
#endif
...
...
smoketest/libtest.cxx
Dosyayı görüntüle @
a533f986
...
...
@@ -15,6 +15,8 @@
#include <sys/time.h>
#include <LibreOfficeKit/LibreOfficeKit.hxx>
using
namespace
::
lok
;
long
getTimeMS
()
{
struct
timeval
t
;
...
...
@@ -44,7 +46,7 @@ int main (int argc, char **argv)
return
1
;
}
LibLibre
Office
*
pOffice
=
lo_cpp_init
(
argv
[
1
]
);
Office
*
pOffice
=
lo_cpp_init
(
argv
[
1
]
);
if
(
!
pOffice
)
{
fprintf
(
stderr
,
"Failed to initialize
\n
"
);
...
...
@@ -63,7 +65,7 @@ int main (int argc, char **argv)
start
=
end
;
fprintf
(
stderr
,
"start to load document '%s'
\n
"
,
argv
[
2
]
);
LO
Document
*
pDocument
=
pOffice
->
documentLoad
(
argv
[
2
]
);
Document
*
pDocument
=
pOffice
->
documentLoad
(
argv
[
2
]
);
if
(
!
pDocument
)
{
char
*
pError
=
pOffice
->
getError
();
...
...
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