summaryrefslogtreecommitdiff
path: root/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-04-17 14:59:35 +0200
committerFridrich Strba <fridrich@documentfoundation.org>2013-04-19 07:52:08 +0000
commit8d87758d65e4a03271f76e354dfc84c1fcd5fe21 (patch)
treebc8f4f0df6981ad10fe1333db1a2b015ea079709 /odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java
parentd62425cc27e04a3237cfec2ea2663b8b11284ec8 (diff)
Java cleanup, remove the rest of the unnecessary casts
Change-Id: Ia61d250f6b3711abc29569c5ece38a6f87e38daa Reviewed-on: https://gerrit.libreoffice.org/3432 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java')
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java
index 6d6db31ebe58..f62c2e54991a 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java
@@ -257,7 +257,7 @@ public class AsciiReplaceFilter
if (xDocument==null)
throw new com.sun.star.lang.IllegalArgumentException("null reference detected");
- com.sun.star.lang.XServiceInfo xInfo = (com.sun.star.lang.XServiceInfo)UnoRuntime.queryInterface(
+ com.sun.star.lang.XServiceInfo xInfo = UnoRuntime.queryInterface(
com.sun.star.lang.XServiceInfo.class, xDocument);
if ( ! xInfo.supportsService("com.sun.star.text.TextDocument") )
throw new com.sun.star.lang.IllegalArgumentException( "wrong document type" );
@@ -266,7 +266,7 @@ public class AsciiReplaceFilter
// Don't forget to mark this filter used for importing too
synchronized(this)
{
- m_xDocument = (com.sun.star.text.XTextDocument)UnoRuntime.queryInterface(
+ m_xDocument = UnoRuntime.queryInterface(
com.sun.star.text.XTextDocument.class, xDocument);
m_bImport = true;
}
@@ -293,7 +293,7 @@ public class AsciiReplaceFilter
if (xDocument==null)
throw new com.sun.star.lang.IllegalArgumentException( "null reference given" );
- com.sun.star.lang.XServiceInfo xInfo = (com.sun.star.lang.XServiceInfo)UnoRuntime.queryInterface(
+ com.sun.star.lang.XServiceInfo xInfo = UnoRuntime.queryInterface(
com.sun.star.lang.XServiceInfo.class, xDocument);
if ( ! xInfo.supportsService("com.sun.star.text.TextDocument") )
throw new com.sun.star.lang.IllegalArgumentException( "wrong document type" );
@@ -302,7 +302,7 @@ public class AsciiReplaceFilter
// Don't forget to mark this filter used for exporting too
synchronized(this)
{
- m_xDocument = (com.sun.star.text.XTextDocument)UnoRuntime.queryInterface(
+ m_xDocument = UnoRuntime.queryInterface(
com.sun.star.text.XTextDocument.class, xDocument);
m_bImport = false;
}
@@ -413,7 +413,7 @@ public class AsciiReplaceFilter
{
measure("implts_import {");
- com.sun.star.text.XSimpleText xText = (com.sun.star.text.XSimpleText)UnoRuntime.queryInterface(
+ com.sun.star.text.XSimpleText xText = UnoRuntime.queryInterface(
com.sun.star.text.XSimpleText.class,
xTarget.getText());
@@ -463,7 +463,7 @@ public class AsciiReplaceFilter
int nEnd = -1;
int nLength = sText.length();
- com.sun.star.text.XTextRange xCursor = (com.sun.star.text.XTextRange)UnoRuntime.queryInterface(
+ com.sun.star.text.XTextRange xCursor = UnoRuntime.queryInterface(
com.sun.star.text.XTextRange.class,
xText.createTextCursor());
@@ -498,7 +498,7 @@ public class AsciiReplaceFilter
measure("set on model");
// with refreshing the document we are on the safe-side, otherwise the first time the filter is used the document is not fully shown (flaw!).
- com.sun.star.util.XRefreshable xRefresh = (com.sun.star.util.XRefreshable)UnoRuntime.queryInterface(
+ com.sun.star.util.XRefreshable xRefresh = UnoRuntime.queryInterface(
com.sun.star.util.XRefreshable.class,
xTarget);
xRefresh.refresh();
@@ -545,7 +545,7 @@ public class AsciiReplaceFilter
{
measure("implts_export {");
- com.sun.star.text.XTextRange xText = (com.sun.star.text.XSimpleText)UnoRuntime.queryInterface(
+ com.sun.star.text.XTextRange xText = UnoRuntime.queryInterface(
com.sun.star.text.XSimpleText.class,
xSource.getText());