Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/2915
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/15/2915/1
Clean up Impress remove client source code a bit.
* Remove unnecessary semicolons.
* Remove empty methods that only call super methods.
* Replace String concatenation with StringBuilder.
* Fix possible NullPointerException on String comparison.
* Remove TODO comments generated via IDE.
Change-Id: Id2d2ebd29386080715fd743f81fbfae3a4a0a5ce
---
M android/sdremote/src/org/libreoffice/impressremote/BlankScreenFragment.java
M android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java
M android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java
M android/sdremote/src/org/libreoffice/impressremote/SettingsActivity.java
M android/sdremote/src/org/libreoffice/impressremote/ThumbnailFragment.java
M android/sdremote/src/org/libreoffice/impressremote/communication/Client.java
M android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
M android/sdremote/src/org/libreoffice/impressremote/communication/Receiver.java
M android/sdremote/src/org/libreoffice/impressremote/communication/Server.java
M android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java
10 files changed, 7 insertions(+), 27 deletions(-)
diff --git a/android/sdremote/src/org/libreoffice/impressremote/BlankScreenFragment.java
b/android/sdremote/src/org/libreoffice/impressremote/BlankScreenFragment.java
index be82eeb..8f172e5 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/BlankScreenFragment.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/BlankScreenFragment.java
@@ -75,7 +75,6 @@
aListener);
v.findViewById(R.id.blankscreen_return).setOnClickListener(aListener);
mCommunicationService.getTransmitter().blankScreen();
- // TODO Auto-generated method stub
return v;
}
diff --git a/android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java
b/android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java
index d3a0352..51e590f 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java
@@ -529,12 +529,6 @@
mActionBarManager.hidePopups();
return super.onInterceptTouchEvent(aEvent);
}
-
- @Override
- public boolean onTouchEvent(MotionEvent aEvent) {
- return super.onTouchEvent(aEvent);
- }
-
}
private BroadcastReceiver mListener = new BroadcastReceiver() {
diff --git a/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java
b/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java
index 1b8c044..3b0f684 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java
@@ -171,7 +171,6 @@
@Override
protected void onPause() {
- // TODO Auto-generated method stub
super.onPause();
if (mCommunicationService != null) {
mCommunicationService.stopSearching();
diff --git a/android/sdremote/src/org/libreoffice/impressremote/SettingsActivity.java
b/android/sdremote/src/org/libreoffice/impressremote/SettingsActivity.java
index 56d5bad..471e96b 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/SettingsActivity.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/SettingsActivity.java
@@ -18,7 +18,6 @@
// but build with sdk 15
@Override
protected void onCreate(Bundle savedInstanceState) {
- // TODO Auto-generated method stub
super.onCreate(savedInstanceState);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
addPreferencesFromResource(R.xml.preferences);
diff --git a/android/sdremote/src/org/libreoffice/impressremote/ThumbnailFragment.java
b/android/sdremote/src/org/libreoffice/impressremote/ThumbnailFragment.java
index d1f2487..c939973 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/ThumbnailFragment.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/ThumbnailFragment.java
@@ -82,17 +82,6 @@
mCurrentText = null;
}
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- }
-
- @Override
- public void onPause() {
- super.onPause();
- }
-
private void setSelected(int position) {
formatUnselected(mCurrentImage, mCurrentText);
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/Client.java
b/android/sdremote/src/org/libreoffice/impressremote/communication/Client.java
index ce5e3ad..198b873 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/Client.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/Client.java
@@ -58,7 +58,7 @@
Thread t = new Thread() {
public void run() {
listen();
- };
+ }
};
t.start();
diff --git
a/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
b/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
index 5b32661..8028f00 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
@@ -33,7 +33,7 @@
public enum State {
DISCONNECTED, SEARCHING, CONNECTING, CONNECTED
- };
+ }
/**
* Get the publicly visible device name -- generally the bluetooth name,
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/Receiver.java
b/android/sdremote/src/org/libreoffice/impressremote/communication/Receiver.java
index 5a6316e..4ba252f 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/Receiver.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/Receiver.java
@@ -99,13 +99,13 @@
}
} else if (aInstruction.equals("slide_notes")) {
int aSlideNumber = Integer.parseInt(aCommand.get(1));
- String aNotes = new String();
+ StringBuilder aNotes = new StringBuilder();
for (int i = 2; i < aCommand.size(); i++) {
- aNotes += aCommand.get(i);
+ aNotes.append(aCommand.get(i));
}
// Store image internally
- mSlideShow.putNotes(aSlideNumber, aNotes);
+ mSlideShow.putNotes(aSlideNumber, aNotes.toString());
Intent aIntent = new Intent(
CommunicationService.MSG_SLIDE_NOTES);
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/Server.java
b/android/sdremote/src/org/libreoffice/impressremote/communication/Server.java
index 82172be..77e6eb3 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/Server.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/Server.java
@@ -12,7 +12,7 @@
public enum Protocol {
NETWORK, BLUETOOTH
- };
+ }
private Protocol mProtocol;
private String mAddress;
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java
b/android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java
index 703069c..f1726ad 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java
@@ -63,7 +63,7 @@
break;
}
}
- if (i == aBuffer.length || !aCommand.equals("LOREMOTE_ADVERTISE")) {
+ if (i == aBuffer.length || !"LOREMOTE_ADVERTISE".equals(aCommand)) {
return;
}
for (int j = i + 1; j < aBuffer.length; j++) {
--
To view, visit https://gerrit.libreoffice.org/2915
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id2d2ebd29386080715fd743f81fbfae3a4a0a5ce
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Artur Dryomov <artur.dryomov@gmail.com>
Context
- [PATCH] Clean up Impress remove client source code a bit. · Artur Dryomov (via Code Review)
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.