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
e9cc5651
Kaydet (Commit)
e9cc5651
authored
Mar 24, 2014
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
coverity#704298 Logically dead code
Change-Id: Ic2f52bb5ec072f11c99f20455e4536bc298b47c7
üst
68269a8e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
71 deletions
+56
-71
drviewsh.cxx
sd/source/ui/view/drviewsh.cxx
+56
-71
No files found.
sd/source/ui/view/drviewsh.cxx
Dosyayı görüntüle @
e9cc5651
...
...
@@ -67,14 +67,7 @@ void DrawViewShell::MakeVisible(const Rectangle& rRect, ::Window& rWin)
// smaller than the visible area, the user-defined zoom was
// changed. This was decided to be a bug for 6.x, thus I developed a
// version which instead handles X/Y bigger/smaller and visibility
// questions separately. The new behaviour is triggered with the
// bZoomAllowed parameter which for old behaviour should be set to
// sal_True. I looked at all uses of MakeVisible() in the application
// and found no valid reason for really changing the zoom factor, thus I
// decided to NOT expand (incompatible) this virtual method to get one
// more parameter. If this is wanted in later versions, feel free to add
// that bool to the parameter list.
sal_Bool
bZoomAllowed
(
sal_False
);
// questions separately
Size
aLogicSize
(
rRect
.
GetSize
());
// visible area
...
...
@@ -82,87 +75,79 @@ void DrawViewShell::MakeVisible(const Rectangle& rRect, ::Window& rWin)
Rectangle
aVisArea
(
rWin
.
PixelToLogic
(
Rectangle
(
Point
(
0
,
0
),
aVisSizePixel
)));
Size
aVisAreaSize
(
aVisArea
.
GetSize
());
if
(
!
aVisArea
.
IsInside
(
rRect
)
&&
!
SlideShow
::
IsRunning
(
GetViewShellBase
()
)
)
if
(
!
aVisArea
.
IsInside
(
rRect
)
&&
!
SlideShow
::
IsRunning
(
GetViewShellBase
()
)
)
{
// object is not entirely in visible area
sal_Int32
nFreeSpaceX
(
aVisAreaSize
.
Width
()
-
aLogicSize
.
Width
());
sal_Int32
nFreeSpaceY
(
aVisAreaSize
.
Height
()
-
aLogicSize
.
Height
());
if
(
bZoomAllowed
&&
(
nFreeSpaceX
<
0
||
nFreeSpaceY
<
0
))
// allow a mode for move-only visibility without zooming.
const
sal_Int32
nPercentBorder
(
30
);
const
Rectangle
aInnerRectangle
(
aVisArea
.
Left
()
+
((
aVisAreaSize
.
Width
()
*
nPercentBorder
)
/
200
),
aVisArea
.
Top
()
+
((
aVisAreaSize
.
Height
()
*
nPercentBorder
)
/
200
),
aVisArea
.
Right
()
-
((
aVisAreaSize
.
Width
()
*
nPercentBorder
)
/
200
),
aVisArea
.
Bottom
()
-
((
aVisAreaSize
.
Height
()
*
nPercentBorder
)
/
200
)
);
Point
aNewPos
(
aVisArea
.
TopLeft
());
if
(
nFreeSpaceX
<
0
)
{
// object does not fit into visible area -> zoom to object size
SetZoomRect
(
rRect
);
}
else
{
// allow a mode for move-only visibility without zooming.
const
sal_Int32
nPercentBorder
(
30
);
const
Rectangle
aInnerRectangle
(
aVisArea
.
Left
()
+
((
aVisAreaSize
.
Width
()
*
nPercentBorder
)
/
200
),
aVisArea
.
Top
()
+
((
aVisAreaSize
.
Height
()
*
nPercentBorder
)
/
200
),
aVisArea
.
Right
()
-
((
aVisAreaSize
.
Width
()
*
nPercentBorder
)
/
200
),
aVisArea
.
Bottom
()
-
((
aVisAreaSize
.
Height
()
*
nPercentBorder
)
/
200
)
);
Point
aNewPos
(
aVisArea
.
TopLeft
());
if
(
nFreeSpaceX
<
0
)
if
(
aInnerRectangle
.
Left
()
>
rRect
.
Right
())
{
if
(
aInnerRectangle
.
Left
()
>
rRect
.
Right
())
{
// object moves out to the left
aNewPos
.
X
()
-=
aVisAreaSize
.
Width
()
/
2
;
}
if
(
aInnerRectangle
.
Right
()
<
rRect
.
Left
())
{
// object moves out to the right
aNewPos
.
X
()
+=
aVisAreaSize
.
Width
()
/
2
;
}
// object moves out to the left
aNewPos
.
X
()
-=
aVisAreaSize
.
Width
()
/
2
;
}
else
if
(
aInnerRectangle
.
Right
()
<
rRect
.
Left
())
{
if
(
nFreeSpaceX
>
rRect
.
GetWidth
())
nFreeSpaceX
=
rRect
.
GetWidth
();
// object moves out to the right
aNewPos
.
X
()
+=
aVisAreaSize
.
Width
()
/
2
;
}
}
else
{
if
(
nFreeSpaceX
>
rRect
.
GetWidth
())
nFreeSpaceX
=
rRect
.
GetWidth
();
while
(
rRect
.
Right
()
>
aNewPos
.
X
()
+
aVisAreaSize
.
Width
())
aNewPos
.
X
()
+=
nFreeSpaceX
;
while
(
rRect
.
Right
()
>
aNewPos
.
X
()
+
aVisAreaSize
.
Width
())
aNewPos
.
X
()
+=
nFreeSpaceX
;
while
(
rRect
.
Left
()
<
aNewPos
.
X
())
aNewPos
.
X
()
-=
nFreeSpaceX
;
}
while
(
rRect
.
Left
()
<
aNewPos
.
X
())
aNewPos
.
X
()
-=
nFreeSpaceX
;
}
if
(
nFreeSpaceY
<
0
)
if
(
nFreeSpaceY
<
0
)
{
if
(
aInnerRectangle
.
Top
()
>
rRect
.
Bottom
())
{
if
(
aInnerRectangle
.
Top
()
>
rRect
.
Bottom
())
{
// object moves out to the top
aNewPos
.
Y
()
-=
aVisAreaSize
.
Height
()
/
2
;
}
if
(
aInnerRectangle
.
Bottom
()
<
rRect
.
Top
())
{
// object moves out to the right
aNewPos
.
Y
()
+=
aVisAreaSize
.
Height
()
/
2
;
}
// object moves out to the top
aNewPos
.
Y
()
-=
aVisAreaSize
.
Height
()
/
2
;
}
else
if
(
aInnerRectangle
.
Bottom
()
<
rRect
.
Top
())
{
if
(
nFreeSpaceY
>
rRect
.
GetHeight
())
nFreeSpaceY
=
rRect
.
GetHeight
();
// object moves out to the right
aNewPos
.
Y
()
+=
aVisAreaSize
.
Height
()
/
2
;
}
}
else
{
if
(
nFreeSpaceY
>
rRect
.
GetHeight
())
nFreeSpaceY
=
rRect
.
GetHeight
();
while
(
rRect
.
Bottom
()
>
aNewPos
.
Y
()
+
aVisAreaSize
.
Height
())
aNewPos
.
Y
()
+=
nFreeSpaceY
;
while
(
rRect
.
Bottom
()
>
aNewPos
.
Y
()
+
aVisAreaSize
.
Height
())
aNewPos
.
Y
()
+=
nFreeSpaceY
;
while
(
rRect
.
Top
()
<
aNewPos
.
Y
())
aNewPos
.
Y
()
-=
nFreeSpaceY
;
}
while
(
rRect
.
Top
()
<
aNewPos
.
Y
())
aNewPos
.
Y
()
-=
nFreeSpaceY
;
}
// did position change? Does it need to be set?
if
(
aNewPos
!=
aVisArea
.
TopLeft
())
{
aVisArea
.
SetPos
(
aNewPos
);
SetZoomRect
(
aVisArea
);
}
// did position change? Does it need to be set?
if
(
aNewPos
!=
aVisArea
.
TopLeft
())
{
aVisArea
.
SetPos
(
aNewPos
);
SetZoomRect
(
aVisArea
);
}
}
}
...
...
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