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
8a1ad93a
Kaydet (Commit)
8a1ad93a
authored
Agu 13, 2014
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
reduce code duplication
Change-Id: Ie5910239d7a54a29262e556af779bda9fa2dddca
üst
cc6bd125
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
22 deletions
+42
-22
unomodel.hxx
sd/source/ui/inc/unomodel.hxx
+4
-0
unomodel.cxx
sd/source/ui/unoidl/unomodel.cxx
+38
-22
No files found.
sd/source/ui/inc/unomodel.hxx
Dosyayı görüntüle @
8a1ad93a
...
@@ -56,6 +56,7 @@ class SdPage;
...
@@ -56,6 +56,7 @@ class SdPage;
namespace
sd
{
namespace
sd
{
class
DrawDocShell
;
class
DrawDocShell
;
class
DrawViewShell
;
}
}
extern
OUString
getPageApiName
(
SdPage
*
pPage
);
extern
OUString
getPageApiName
(
SdPage
*
pPage
);
...
@@ -123,6 +124,9 @@ private:
...
@@ -123,6 +124,9 @@ private:
OUString
maBuildId
;
OUString
maBuildId
;
void
initializeDocument
();
void
initializeDocument
();
sd
::
DrawViewShell
*
GetViewShell
();
public
:
public
:
SdXImpressDocument
(
::
sd
::
DrawDocShell
*
pShell
,
bool
bClipBoard
=
false
)
throw
();
SdXImpressDocument
(
::
sd
::
DrawDocShell
*
pShell
,
bool
bClipBoard
=
false
)
throw
();
SdXImpressDocument
(
SdDrawDocument
*
pDoc
,
bool
bClipBoard
=
false
)
throw
();
SdXImpressDocument
(
SdDrawDocument
*
pDoc
,
bool
bClipBoard
=
false
)
throw
();
...
...
sd/source/ui/unoidl/unomodel.cxx
Dosyayı görüntüle @
8a1ad93a
...
@@ -2188,11 +2188,26 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
...
@@ -2188,11 +2188,26 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
}
}
}
}
DrawViewShell
*
SdXImpressDocument
::
GetViewShell
()
{
DrawViewShell
*
pViewSh
=
dynamic_cast
<
DrawViewShell
*>
(
mpDocShell
->
GetViewShell
());
if
(
!
pViewSh
)
{
SAL_WARN
(
"sd"
,
"DrawViewShell not available!"
);
return
NULL
;
}
return
pViewSh
;
}
void
SdXImpressDocument
::
paintTile
(
VirtualDevice
&
rDevice
,
void
SdXImpressDocument
::
paintTile
(
VirtualDevice
&
rDevice
,
int
nOutputWidth
,
int
nOutputHeight
,
int
nOutputWidth
,
int
nOutputHeight
,
int
nTilePosX
,
int
nTilePosY
,
int
nTilePosX
,
int
nTilePosY
,
long
nTileWidth
,
long
nTileHeight
)
long
nTileWidth
,
long
nTileHeight
)
{
{
DrawViewShell
*
pViewSh
=
GetViewShell
();
if
(
!
pViewSh
)
return
;
// Scaling. Must convert from pixels to twips. We know
// Scaling. Must convert from pixels to twips. We know
// that VirtualDevices use a DPI of 96.
// that VirtualDevices use a DPI of 96.
// We specifically calculate these scales first as we're still
// We specifically calculate these scales first as we're still
...
@@ -2221,18 +2236,20 @@ void SdXImpressDocument::paintTile( VirtualDevice& rDevice,
...
@@ -2221,18 +2236,20 @@ void SdXImpressDocument::paintTile( VirtualDevice& rDevice,
rDevice
.
SetMapMode
(
aMapMode
);
rDevice
.
SetMapMode
(
aMapMode
);
rDevice
.
SetOutputSizePixel
(
Size
(
nOutputWidth
,
nOutputHeight
)
);
rDevice
.
SetOutputSizePixel
(
Size
(
nOutputWidth
,
nOutputHeight
)
);
mpDoc
->
GetDocSh
()
->
GetViewShell
()
->
GetView
()
->
CompleteRedraw
(
&
rDevice
,
Point
aPoint
(
nTilePosX
,
nTilePosY
);
Region
(
Size
aSize
(
nTileWidth
,
nTileHeight
);
Rectangle
(
Point
(
nTilePosX
,
nTilePosY
),
Rectangle
aRect
(
aPoint
,
aSize
);
Size
(
nTileWidth
,
nTileHeight
)
)
)
);
pViewSh
->
GetView
()
->
CompleteRedraw
(
&
rDevice
,
Region
(
aRect
));
}
}
void
SdXImpressDocument
::
setPart
(
int
nPart
)
void
SdXImpressDocument
::
setPart
(
int
nPart
)
{
{
DrawViewShell
*
pViewSh
=
dynamic_cast
<
DrawViewShell
*
>
(
mpDoc
->
GetDocSh
()
->
GetViewShell
()
);
DrawViewShell
*
pViewSh
=
GetViewShell
();
if
(
pViewSh
)
if
(
!
pViewSh
)
{
return
;
// TODO: have an API to allow selecting between PK_STANDARD (just slide)
// TODO: have an API to allow selecting between PK_STANDARD (just slide)
// and PK_NOTES (which shows the combined slide above notes). There is alo
// and PK_NOTES (which shows the combined slide above notes). There is alo
// a PK_HANDOUT -- that however just shows multiple empty pages (it's also
// a PK_HANDOUT -- that however just shows multiple empty pages (it's also
...
@@ -2240,7 +2257,6 @@ void SdXImpressDocument::setPart( int nPart )
...
@@ -2240,7 +2257,6 @@ void SdXImpressDocument::setPart( int nPart )
// then actually select what is on the handout page, which defaults to
// then actually select what is on the handout page, which defaults to
// a 4x4 grid of empty pages).
// a 4x4 grid of empty pages).
pViewSh
->
SwitchPage
(
nPart
);
pViewSh
->
SwitchPage
(
nPart
);
}
}
}
int
SdXImpressDocument
::
getParts
()
int
SdXImpressDocument
::
getParts
()
...
@@ -2252,29 +2268,31 @@ int SdXImpressDocument::getParts()
...
@@ -2252,29 +2268,31 @@ int SdXImpressDocument::getParts()
int
SdXImpressDocument
::
getPart
()
int
SdXImpressDocument
::
getPart
()
{
{
DrawViewShell
*
pViewSh
=
dynamic_cast
<
DrawViewShell
*
>
(
mpDoc
->
GetDocSh
()
->
GetViewShell
()
);
DrawViewShell
*
pViewSh
=
GetViewShell
();
if
(
pViewSh
)
if
(
!
pViewSh
)
{
return
0
;
// curPageId seems to start at 1
// curPageId seems to start at 1
return
pViewSh
->
GetCurPageId
()
-
1
;
return
pViewSh
->
GetCurPageId
()
-
1
;
}
return
0
;
}
}
OUString
SdXImpressDocument
::
getPartName
(
int
nPart
)
OUString
SdXImpressDocument
::
getPartName
(
int
nPart
)
{
{
SdPage
*
pPage
=
mpDoc
->
GetSdPage
(
nPart
,
PK_STANDARD
);
SdPage
*
pPage
=
mpDoc
->
GetSdPage
(
nPart
,
PK_STANDARD
);
assert
(
pPage
);
if
(
!
pPage
)
{
SAL_WARN
(
"sd"
,
"DrawViewShell not available!"
);
return
OUString
();
}
return
pPage
->
GetName
();
return
pPage
->
GetName
();
}
}
void
SdXImpressDocument
::
setPartMode
(
LibreOfficeKitPartMode
ePartMode
)
void
SdXImpressDocument
::
setPartMode
(
LibreOfficeKitPartMode
ePartMode
)
{
{
DrawViewShell
*
pViewSh
=
dynamic_cast
<
DrawViewShell
*
>
(
mpDoc
->
GetDocSh
()
->
GetViewShell
()
);
DrawViewShell
*
pViewSh
=
GetViewShell
(
);
if
(
!
pViewSh
)
if
(
!
pViewSh
)
{
return
;
return
;
}
PageKind
aPageKind
(
PK_STANDARD
);
PageKind
aPageKind
(
PK_STANDARD
);
switch
(
ePartMode
)
switch
(
ePartMode
)
...
@@ -2303,14 +2321,12 @@ void SdXImpressDocument::setPartMode( LibreOfficeKitPartMode ePartMode )
...
@@ -2303,14 +2321,12 @@ void SdXImpressDocument::setPartMode( LibreOfficeKitPartMode ePartMode )
Size
SdXImpressDocument
::
getDocumentSize
()
Size
SdXImpressDocument
::
getDocumentSize
()
{
{
DrawViewShell
*
pViewSh
=
dynamic_cast
<
DrawViewShell
*>
(
mpDoc
->
GetDocSh
()
->
GetViewShell
()
);
DrawViewShell
*
pViewSh
=
GetViewShell
(
);
if
(
!
pViewSh
)
if
(
!
pViewSh
)
{
SAL_WARN
(
"sd"
,
"DrawViewShell not available!"
);
return
Size
();
return
Size
();
}
SdrPageView
*
pCurPageView
=
pViewSh
->
GetView
()
->
GetSdrPageView
();
SdrPageView
*
pCurPageView
=
pViewSh
->
GetView
()
->
GetSdrPageView
();
Size
aSize
=
pCurPageView
->
GetPageRect
().
GetSize
();
Size
aSize
=
pCurPageView
->
GetPageRect
().
GetSize
();
// Convert the size in 100th mm to TWIP
// Convert the size in 100th mm to TWIP
// See paintTile above for further info.
// See paintTile above for further info.
...
...
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