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
ae53e084
Kaydet (Commit)
ae53e084
authored
Şub 26, 2015
tarafından
Tomaž Vajngerl
Kaydeden (comit)
Miklos Vajna
Mar 02, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
android: fix parsing of selection coordinates and make more robust
Change-Id: Ie2fb81cc9c2096df4d9361887ed5bab8a0b841d3
üst
d5ad8429
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
InvalidationHandler.java
...ndroid3/src/java/org/libreoffice/InvalidationHandler.java
+14
-12
No files found.
android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
Dosyayı görüntüle @
ae53e084
...
...
@@ -38,19 +38,15 @@ public class InvalidationHandler {
invalidateTiles
(
payload
);
break
;
case
Document
.
CALLBACK_INVALIDATE_VISIBLE_CURSOR
:
Log
.
i
(
LOGTAG
,
"Cursor: "
+
payload
);
invalidateCursor
(
payload
);
break
;
case
Document
.
CALLBACK_INVALIDATE_TEXT_SELECTION
:
Log
.
i
(
LOGTAG
,
"Selection: "
+
payload
);
invalidateSelection
(
payload
);
break
;
case
Document
.
CALLBACK_INVALIDATE_TEXT_SELECTION_START
:
Log
.
i
(
LOGTAG
,
"Selection start: "
+
payload
);
invalidateSelectionStart
(
payload
);
break
;
case
Document
.
CALLBACK_INVALIDATE_TEXT_SELECTION_END
:
Log
.
i
(
LOGTAG
,
"Selection end: "
+
payload
);
invalidateSelectionEnd
(
payload
);
break
;
}
...
...
@@ -67,19 +63,22 @@ public class InvalidationHandler {
* @return rectangle in pixel coordinates
*/
private
RectF
convertPayloadToRectangle
(
String
payload
)
{
if
(
payload
.
equals
(
"EMPTY"
))
{
String
payloadWithoutWhitespace
=
payload
.
replaceAll
(
"\\s"
,
""
);
// remove all whitespace from the string
if
(
payloadWithoutWhitespace
.
isEmpty
()
||
payloadWithoutWhitespace
.
equals
(
"EMPTY"
))
{
return
null
;
}
String
[]
coordinates
=
payload
.
split
(
","
);
String
[]
coordinates
=
payload
WithoutWhitespace
.
split
(
","
);
if
(
coordinates
.
length
!=
4
)
{
return
null
;
}
int
width
=
Integer
.
decode
(
coordinates
[
0
].
trim
());
int
height
=
Integer
.
decode
(
coordinates
[
1
].
trim
());
int
x
=
Integer
.
decode
(
coordinates
[
2
].
trim
());
int
y
=
Integer
.
decode
(
coordinates
[
3
].
trim
());
int
width
=
Integer
.
decode
(
coordinates
[
0
]);
int
height
=
Integer
.
decode
(
coordinates
[
1
]);
int
x
=
Integer
.
decode
(
coordinates
[
2
]);
int
y
=
Integer
.
decode
(
coordinates
[
3
]);
float
dpi
=
(
float
)
LOKitShell
.
getDpi
();
...
...
@@ -104,8 +103,11 @@ public class InvalidationHandler {
String
[]
rectangleArray
=
payload
.
split
(
";"
);
for
(
String
coordinates
:
rectangleArray
)
{
RectF
rectangle
=
convertPayloadToRectangle
(
payload
);
rectangles
.
add
(
rectangle
);
RectF
rectangle
=
convertPayloadToRectangle
(
coordinates
);
if
(
rectangle
!=
null
)
{
rectangles
.
add
(
rectangle
);
}
}
return
rectangles
;
...
...
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