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
8da923df
Kaydet (Commit)
8da923df
authored
Agu 13, 2014
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
reduce code duplication in LOK init.cxx
Change-Id: I65335a2d0fb6e1ff46e3302463fbcf396fbea215
üst
8a1ad93a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
20 deletions
+19
-20
init.cxx
desktop/source/lib/init.cxx
+19
-20
No files found.
desktop/source/lib/init.cxx
Dosyayı görüntüle @
8da923df
...
@@ -59,6 +59,7 @@
...
@@ -59,6 +59,7 @@
#endif
#endif
using
namespace
css
;
using
namespace
css
;
using
namespace
vcl
;
using
namespace
utl
;
using
namespace
utl
;
using
namespace
boost
;
using
namespace
boost
;
...
@@ -265,6 +266,17 @@ struct LibLibreOffice_Impl : public _LibreOfficeKit
...
@@ -265,6 +266,17 @@ struct LibLibreOffice_Impl : public _LibreOfficeKit
}
}
};
};
namespace
{
ITiledRenderable
*
getTiledRenderable
(
LibreOfficeKitDocument
*
pThis
)
{
LibLODocument_Impl
*
pDocument
=
static_cast
<
LibLODocument_Impl
*>
(
pThis
);
return
dynamic_cast
<
ITiledRenderable
*>
(
pDocument
->
mxComponent
.
get
());
}
}
// anonymous namespace
// Wonder global state ...
// Wonder global state ...
static
uno
::
Reference
<
css
::
uno
::
XComponentContext
>
xContext
;
static
uno
::
Reference
<
css
::
uno
::
XComponentContext
>
xContext
;
static
uno
::
Reference
<
css
::
lang
::
XMultiServiceFactory
>
xSFactory
;
static
uno
::
Reference
<
css
::
lang
::
XMultiServiceFactory
>
xSFactory
;
...
@@ -431,9 +443,7 @@ static LibreOfficeKitDocumentType doc_getDocumentType (LibreOfficeKitDocument* p
...
@@ -431,9 +443,7 @@ static LibreOfficeKitDocumentType doc_getDocumentType (LibreOfficeKitDocument* p
static
int
doc_getParts
(
LibreOfficeKitDocument
*
pThis
)
static
int
doc_getParts
(
LibreOfficeKitDocument
*
pThis
)
{
{
LibLODocument_Impl
*
pDocument
=
static_cast
<
LibLODocument_Impl
*>
(
pThis
);
ITiledRenderable
*
pDoc
=
getTiledRenderable
(
pThis
);
::
vcl
::
ITiledRenderable
*
pDoc
=
dynamic_cast
<
::
vcl
::
ITiledRenderable
*
>
(
pDocument
->
mxComponent
.
get
()
);
if
(
!
pDoc
)
if
(
!
pDoc
)
{
{
gImpl
->
maLastExceptionMsg
=
"Document doesn't support tiled rendering"
;
gImpl
->
maLastExceptionMsg
=
"Document doesn't support tiled rendering"
;
...
@@ -445,9 +455,7 @@ static int doc_getParts (LibreOfficeKitDocument* pThis)
...
@@ -445,9 +455,7 @@ static int doc_getParts (LibreOfficeKitDocument* pThis)
static
int
doc_getPart
(
LibreOfficeKitDocument
*
pThis
)
static
int
doc_getPart
(
LibreOfficeKitDocument
*
pThis
)
{
{
LibLODocument_Impl
*
pDocument
=
static_cast
<
LibLODocument_Impl
*>
(
pThis
);
ITiledRenderable
*
pDoc
=
getTiledRenderable
(
pThis
);
::
vcl
::
ITiledRenderable
*
pDoc
=
dynamic_cast
<
::
vcl
::
ITiledRenderable
*
>
(
pDocument
->
mxComponent
.
get
()
);
if
(
!
pDoc
)
if
(
!
pDoc
)
{
{
gImpl
->
maLastExceptionMsg
=
"Document doesn't support tiled rendering"
;
gImpl
->
maLastExceptionMsg
=
"Document doesn't support tiled rendering"
;
...
@@ -459,9 +467,7 @@ static int doc_getPart (LibreOfficeKitDocument* pThis)
...
@@ -459,9 +467,7 @@ static int doc_getPart (LibreOfficeKitDocument* pThis)
static
void
doc_setPart
(
LibreOfficeKitDocument
*
pThis
,
int
nPart
)
static
void
doc_setPart
(
LibreOfficeKitDocument
*
pThis
,
int
nPart
)
{
{
LibLODocument_Impl
*
pDocument
=
static_cast
<
LibLODocument_Impl
*>
(
pThis
);
ITiledRenderable
*
pDoc
=
getTiledRenderable
(
pThis
);
::
vcl
::
ITiledRenderable
*
pDoc
=
dynamic_cast
<
::
vcl
::
ITiledRenderable
*
>
(
pDocument
->
mxComponent
.
get
()
);
if
(
!
pDoc
)
if
(
!
pDoc
)
{
{
gImpl
->
maLastExceptionMsg
=
"Document doesn't support tiled rendering"
;
gImpl
->
maLastExceptionMsg
=
"Document doesn't support tiled rendering"
;
...
@@ -474,9 +480,7 @@ static void doc_setPart(LibreOfficeKitDocument* pThis, int nPart)
...
@@ -474,9 +480,7 @@ static void doc_setPart(LibreOfficeKitDocument* pThis, int nPart)
static
char
*
doc_getPartName
(
LibreOfficeKitDocument
*
pThis
,
int
nPart
)
static
char
*
doc_getPartName
(
LibreOfficeKitDocument
*
pThis
,
int
nPart
)
{
{
LibLODocument_Impl
*
pDocument
=
static_cast
<
LibLODocument_Impl
*>
(
pThis
);
ITiledRenderable
*
pDoc
=
getTiledRenderable
(
pThis
);
::
vcl
::
ITiledRenderable
*
pDoc
=
dynamic_cast
<
::
vcl
::
ITiledRenderable
*
>
(
pDocument
->
mxComponent
.
get
()
);
if
(
!
pDoc
)
if
(
!
pDoc
)
{
{
gImpl
->
maLastExceptionMsg
=
"Document doesn't support tiled rendering"
;
gImpl
->
maLastExceptionMsg
=
"Document doesn't support tiled rendering"
;
...
@@ -494,9 +498,7 @@ static char* doc_getPartName(LibreOfficeKitDocument* pThis, int nPart)
...
@@ -494,9 +498,7 @@ static char* doc_getPartName(LibreOfficeKitDocument* pThis, int nPart)
static
void
doc_setPartMode
(
LibreOfficeKitDocument
*
pThis
,
static
void
doc_setPartMode
(
LibreOfficeKitDocument
*
pThis
,
LibreOfficeKitPartMode
ePartMode
)
LibreOfficeKitPartMode
ePartMode
)
{
{
LibLODocument_Impl
*
pDocument
=
static_cast
<
LibLODocument_Impl
*>
(
pThis
);
ITiledRenderable
*
pDoc
=
getTiledRenderable
(
pThis
);
::
vcl
::
ITiledRenderable
*
pDoc
=
dynamic_cast
<
::
vcl
::
ITiledRenderable
*
>
(
pDocument
->
mxComponent
.
get
()
);
if
(
!
pDoc
)
if
(
!
pDoc
)
{
{
gImpl
->
maLastExceptionMsg
=
"Document doesn't support tiled rendering"
;
gImpl
->
maLastExceptionMsg
=
"Document doesn't support tiled rendering"
;
...
@@ -538,9 +540,8 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
...
@@ -538,9 +540,8 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
SAL_INFO
(
"lok.tiledrendering"
,
"paintTile: painting ["
<<
nTileWidth
<<
"x"
<<
nTileHeight
<<
SAL_INFO
(
"lok.tiledrendering"
,
"paintTile: painting ["
<<
nTileWidth
<<
"x"
<<
nTileHeight
<<
"]@("
<<
nTilePosX
<<
", "
<<
nTilePosY
<<
") to ["
<<
"]@("
<<
nTilePosX
<<
", "
<<
nTilePosY
<<
") to ["
<<
nCanvasWidth
<<
"x"
<<
nCanvasHeight
<<
"]px"
);
nCanvasWidth
<<
"x"
<<
nCanvasHeight
<<
"]px"
);
LibLODocument_Impl
*
pDocument
=
static_cast
<
LibLODocument_Impl
*>
(
pThis
);
::
vcl
::
ITiledRenderable
*
pDoc
=
dynamic_cast
<
::
vcl
::
ITiledRenderable
*
>
(
pDocument
->
mxComponent
.
get
()
);
ITiledRenderable
*
pDoc
=
getTiledRenderable
(
pThis
);
if
(
!
pDoc
)
if
(
!
pDoc
)
{
{
gImpl
->
maLastExceptionMsg
=
"Document doesn't support tiled rendering"
;
gImpl
->
maLastExceptionMsg
=
"Document doesn't support tiled rendering"
;
...
@@ -583,9 +584,7 @@ static void doc_getDocumentSize(LibreOfficeKitDocument* pThis,
...
@@ -583,9 +584,7 @@ static void doc_getDocumentSize(LibreOfficeKitDocument* pThis,
long
*
pWidth
,
long
*
pWidth
,
long
*
pHeight
)
long
*
pHeight
)
{
{
LibLODocument_Impl
*
pDocument
=
static_cast
<
LibLODocument_Impl
*>
(
pThis
);
ITiledRenderable
*
pDoc
=
getTiledRenderable
(
pThis
);
::
vcl
::
ITiledRenderable
*
pDoc
=
dynamic_cast
<
::
vcl
::
ITiledRenderable
*
>
(
pDocument
->
mxComponent
.
get
()
);
if
(
pDoc
)
if
(
pDoc
)
{
{
Size
aDocumentSize
=
pDoc
->
getDocumentSize
();
Size
aDocumentSize
=
pDoc
->
getDocumentSize
();
...
...
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