[Libreoffice-commits] core.git: 3 commits - android/source external/pdfium
Christian Lohmaier
lohmaier+LibreOffice at googlemail.com
Wed May 16 14:39:45 UTC 2018
android/source/src/java/org/libreoffice/ColorPaletteAdapter.java | 3 -
android/source/src/java/org/libreoffice/ColorPickerAdapter.java | 3 -
android/source/src/java/org/libreoffice/FontController.java | 3 -
android/source/src/java/org/libreoffice/InvalidationHandler.java | 20 +++++---
android/source/src/java/org/libreoffice/LOKitThread.java | 16 ++++--
android/source/src/java/org/libreoffice/LOKitTileProvider.java | 24 +++++-----
android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java | 1
android/source/src/java/org/libreoffice/TileProvider.java | 1
android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java | 2
external/pdfium/Library_pdfium.mk | 2
10 files changed, 41 insertions(+), 34 deletions(-)
New commits:
commit 912fd109a3857b3a6dae02f65fd4b508ed9c8a11
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date: Wed May 16 16:33:57 2018 +0200
android janitor... convert chained ifs to switch statement
Change-Id: I9929bd077a33349a6e57c3a427df7e77b3007c88
diff --git a/android/source/src/java/org/libreoffice/InvalidationHandler.java b/android/source/src/java/org/libreoffice/InvalidationHandler.java
index 92e81febeb7c..26cf7abfb9d5 100644
--- a/android/source/src/java/org/libreoffice/InvalidationHandler.java
+++ b/android/source/src/java/org/libreoffice/InvalidationHandler.java
@@ -616,14 +616,18 @@ public class InvalidationHandler implements Document.MessageCallback, Office.Mes
* Handle a transition to OverlayState.TRANSITION state.
*/
private void handleTransitionState(OverlayState previous) {
- if (previous == OverlayState.SELECTION) {
- mDocumentOverlay.hideHandle(SelectionHandle.HandleType.START);
- mDocumentOverlay.hideHandle(SelectionHandle.HandleType.END);
- mDocumentOverlay.hideSelections();
- } else if (previous == OverlayState.CURSOR) {
- mDocumentOverlay.hideHandle(SelectionHandle.HandleType.MIDDLE);
- } else if (previous == OverlayState.GRAPHIC_SELECTION) {
- mDocumentOverlay.hideGraphicSelection();
+ switch (previous) {
+ case SELECTION:
+ mDocumentOverlay.hideHandle(SelectionHandle.HandleType.START);
+ mDocumentOverlay.hideHandle(SelectionHandle.HandleType.END);
+ mDocumentOverlay.hideSelections();
+ break;
+ case CURSOR:
+ mDocumentOverlay.hideHandle(SelectionHandle.HandleType.MIDDLE);
+ break;
+ case GRAPHIC_SELECTION:
+ mDocumentOverlay.hideGraphicSelection();
+ break;
}
}
diff --git a/android/source/src/java/org/libreoffice/LOKitThread.java b/android/source/src/java/org/libreoffice/LOKitThread.java
index 92303f588c2f..d9a617654b17 100644
--- a/android/source/src/java/org/libreoffice/LOKitThread.java
+++ b/android/source/src/java/org/libreoffice/LOKitThread.java
@@ -392,12 +392,16 @@ class LOKitThread extends Thread {
* Request a change of the handle position.
*/
private void changeHandlePosition(SelectionHandle.HandleType handleType, PointF documentCoordinate) {
- if (handleType == SelectionHandle.HandleType.MIDDLE) {
- mTileProvider.setTextSelectionReset(documentCoordinate);
- } else if (handleType == SelectionHandle.HandleType.START) {
- mTileProvider.setTextSelectionStart(documentCoordinate);
- } else if (handleType == SelectionHandle.HandleType.END) {
- mTileProvider.setTextSelectionEnd(documentCoordinate);
+ switch (handleType) {
+ case MIDDLE:
+ mTileProvider.setTextSelectionReset(documentCoordinate);
+ break;
+ case START:
+ mTileProvider.setTextSelectionStart(documentCoordinate);
+ break;
+ case END:
+ mTileProvider.setTextSelectionEnd(documentCoordinate);
+ break;
}
}
diff --git a/android/source/src/java/org/libreoffice/LOKitTileProvider.java b/android/source/src/java/org/libreoffice/LOKitTileProvider.java
index bf2c2601e7cd..f094e49f5a8f 100644
--- a/android/source/src/java/org/libreoffice/LOKitTileProvider.java
+++ b/android/source/src/java/org/libreoffice/LOKitTileProvider.java
@@ -540,16 +540,20 @@ class LOKitTileProvider implements TileProvider {
*/
@Override
public void sendKeyEvent(KeyEvent keyEvent) {
- if (keyEvent.getAction() == KeyEvent.ACTION_MULTIPLE) {
- String keyString = keyEvent.getCharacters();
- for (int i = 0; i < keyString.length(); i++) {
- int codePoint = keyString.codePointAt(i);
- mDocument.postKeyEvent(Document.KEY_EVENT_PRESS, codePoint, getKeyCode(keyEvent));
- }
- } else if (keyEvent.getAction() == KeyEvent.ACTION_DOWN) {
- mDocument.postKeyEvent(Document.KEY_EVENT_PRESS, getCharCode(keyEvent), getKeyCode(keyEvent));
- } else if (keyEvent.getAction() == KeyEvent.ACTION_UP) {
- mDocument.postKeyEvent(Document.KEY_EVENT_RELEASE, getCharCode(keyEvent), getKeyCode(keyEvent));
+ switch (keyEvent.getAction()) {
+ case KeyEvent.ACTION_MULTIPLE:
+ String keyString = keyEvent.getCharacters();
+ for (int i = 0; i < keyString.length(); i++) {
+ int codePoint = keyString.codePointAt(i);
+ mDocument.postKeyEvent(Document.KEY_EVENT_PRESS, codePoint, getKeyCode(keyEvent));
+ }
+ break;
+ case KeyEvent.ACTION_DOWN:
+ mDocument.postKeyEvent(Document.KEY_EVENT_PRESS, getCharCode(keyEvent), getKeyCode(keyEvent));
+ break;
+ case KeyEvent.ACTION_UP:
+ mDocument.postKeyEvent(Document.KEY_EVENT_RELEASE, getCharCode(keyEvent), getKeyCode(keyEvent));
+ break;
}
}
commit bf07813f6843f257d7de1cc599ecc9b4d310b3f7
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date: Wed May 16 16:31:02 2018 +0200
android janitor... remove unnecessary imports, variables and casts
also no need to wrap primitives
Change-Id: I6e22b2bfdb2b8b366dd6f50d995b573c770f0b5a
diff --git a/android/source/src/java/org/libreoffice/ColorPaletteAdapter.java b/android/source/src/java/org/libreoffice/ColorPaletteAdapter.java
index 55c12792ae0a..7cce2ed7d46a 100644
--- a/android/source/src/java/org/libreoffice/ColorPaletteAdapter.java
+++ b/android/source/src/java/org/libreoffice/ColorPaletteAdapter.java
@@ -28,8 +28,7 @@ public class ColorPaletteAdapter extends RecyclerView.Adapter<ColorPaletteAdapte
@Override
public ColorPaletteViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View item = LayoutInflater.from(mContext).inflate(R.layout.colorbox, parent, false);
- ColorPaletteViewHolder holder = new ColorPaletteViewHolder(item);
- return holder;
+ return new ColorPaletteViewHolder(item);
}
diff --git a/android/source/src/java/org/libreoffice/ColorPickerAdapter.java b/android/source/src/java/org/libreoffice/ColorPickerAdapter.java
index 14e6988f7a9c..f387e50634a5 100644
--- a/android/source/src/java/org/libreoffice/ColorPickerAdapter.java
+++ b/android/source/src/java/org/libreoffice/ColorPickerAdapter.java
@@ -33,8 +33,7 @@ public class ColorPickerAdapter extends RecyclerView.Adapter<ColorPickerAdapter.
@Override
public ColorPickerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View item = LayoutInflater.from(mContext).inflate(R.layout.colorbox, parent, false);
- ColorPickerViewHolder holder = new ColorPickerViewHolder(item);
- return holder;
+ return new ColorPickerViewHolder(item);
}
diff --git a/android/source/src/java/org/libreoffice/FontController.java b/android/source/src/java/org/libreoffice/FontController.java
index 321b501e8891..7a3f18366c7a 100644
--- a/android/source/src/java/org/libreoffice/FontController.java
+++ b/android/source/src/java/org/libreoffice/FontController.java
@@ -1,6 +1,5 @@
package org.libreoffice;
-import android.app.Activity;
import android.graphics.Color;
import android.graphics.Rect;
import android.support.design.widget.BottomSheetBehavior;
@@ -249,7 +248,7 @@ public class FontController implements AdapterView.OnItemSelectedListener {
}
private void setupColorPicker(){
- LinearLayout colorPickerLayout = (LinearLayout)mActivity.findViewById(R.id.toolbar_color_picker);
+ LinearLayout colorPickerLayout = mActivity.findViewById(R.id.toolbar_color_picker);
RecyclerView recyclerView = colorPickerLayout.findViewById(R.id.fontColorView);
GridLayoutManager gridLayoutManager = new GridLayoutManager(mActivity, 11, GridLayoutManager.VERTICAL, true);
diff --git a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
index dee54d5ac2da..4cde5d96f992 100644
--- a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
+++ b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
@@ -16,7 +16,6 @@ import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
-import android.os.Handler;
import android.preference.PreferenceManager;
import android.support.design.widget.BottomSheetBehavior;
import android.support.design.widget.Snackbar;
diff --git a/android/source/src/java/org/libreoffice/TileProvider.java b/android/source/src/java/org/libreoffice/TileProvider.java
index 240d3ce52057..3b6f22873466 100644
--- a/android/source/src/java/org/libreoffice/TileProvider.java
+++ b/android/source/src/java/org/libreoffice/TileProvider.java
@@ -13,7 +13,6 @@ import android.graphics.Bitmap;
import android.graphics.PointF;
import android.view.KeyEvent;
-import org.libreoffice.kit.Document;
import org.mozilla.gecko.gfx.CairoImage;
import org.mozilla.gecko.gfx.IntSize;
diff --git a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
index 938112c99149..706ce25344e9 100644
--- a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
+++ b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
@@ -830,7 +830,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings
SharedPreferences defaultPrefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
viewMode = Integer.valueOf(defaultPrefs.getString(EXPLORER_VIEW_TYPE_KEY, ""+ GRID_VIEW));
filterMode = Integer.valueOf(defaultPrefs.getString(FILTER_MODE_KEY , "-1"));
- showHiddenFiles = Boolean.valueOf(defaultPrefs.getBoolean(ENABLE_SHOW_HIDDEN_FILES_KEY, false));
+ showHiddenFiles = defaultPrefs.getBoolean(ENABLE_SHOW_HIDDEN_FILES_KEY, false);
Intent i = this.getIntent();
if (i.hasExtra(CURRENT_DIRECTORY_KEY)) {
commit a8d175b85d37dbec873d79b4311743f97138c438
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date: Wed May 16 16:26:38 2018 +0200
pdfium: don't need two copies of freetype on android either
Change-Id: I581575e2b13482d16aca284bfa502ed164b8c9d0
diff --git a/external/pdfium/Library_pdfium.mk b/external/pdfium/Library_pdfium.mk
index 5f845154203d..0019535857a6 100644
--- a/external/pdfium/Library_pdfium.mk
+++ b/external/pdfium/Library_pdfium.mk
@@ -555,7 +555,7 @@ $(eval $(call gb_Library_use_externals,pdfium,\
icuuc \
))
-ifeq ($(OS),LINUX)
+ifneq (,$(filter LINUX ANDROID,$(OS)))
$(eval $(call gb_Library_add_libs,pdfium,\
-ldl \
-lrt \
More information about the Libreoffice-commits
mailing list