Kaydet (Commit) 0e93ef3e authored tarafından Noel Grandin's avatar Noel Grandin

fix compiling of this java class

(even though it's not being built right now)

Change-Id: I237cce48ea50b1184b166a8a8132ae425597bffe
üst b37b7b5c
...@@ -22,12 +22,14 @@ import helper.WindowListener; ...@@ -22,12 +22,14 @@ import helper.WindowListener;
import com.sun.star.awt.PosSize; import com.sun.star.awt.PosSize;
import com.sun.star.awt.Rectangle; import com.sun.star.awt.Rectangle;
import com.sun.star.awt.WindowEvent;
import com.sun.star.awt.XWindow; import com.sun.star.awt.XWindow;
import com.sun.star.beans.PropertyState; import com.sun.star.beans.PropertyState;
import com.sun.star.beans.PropertyValue; import com.sun.star.beans.PropertyValue;
import com.sun.star.frame.FrameSearchFlag; import com.sun.star.frame.FrameSearchFlag;
import com.sun.star.frame.XComponentLoader; import com.sun.star.frame.XComponentLoader;
import com.sun.star.frame.XFrame; import com.sun.star.frame.XFrame;
import com.sun.star.lang.EventObject;
import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.UnoRuntime;
...@@ -42,7 +44,7 @@ public class DocumentHandle { ...@@ -42,7 +44,7 @@ public class DocumentHandle {
// the current window // the current window
private XWindow xWin = null; private XWindow xWin = null;
// a own window listener // a own window listener
private final WindowListener wl; private final MyWindowListener wl;
/** /**
* Constructor * Constructor
...@@ -50,7 +52,7 @@ public class DocumentHandle { ...@@ -50,7 +52,7 @@ public class DocumentHandle {
*/ */
public DocumentHandle(XComponentLoader xCompLoader) { public DocumentHandle(XComponentLoader xCompLoader) {
this.xCompLoader = xCompLoader; this.xCompLoader = xCompLoader;
wl = new WindowListener(); wl = new MyWindowListener();
} }
/** /**
...@@ -61,7 +63,7 @@ public class DocumentHandle { ...@@ -61,7 +63,7 @@ public class DocumentHandle {
*/ */
public Rectangle loadDocument(XMultiServiceFactory xMSF, String docName, boolean hidden) public Rectangle loadDocument(XMultiServiceFactory xMSF, String docName, boolean hidden)
throws Exception{ throws Exception{
wl.resetTrigger(); wl.resizedTrigger = false;
try { try {
PropertyValue [] szArgs = null; PropertyValue [] szArgs = null;
if (hidden) { if (hidden) {
...@@ -140,10 +142,36 @@ public class DocumentHandle { ...@@ -140,10 +142,36 @@ public class DocumentHandle {
* @return True if resize worked. * @return True if resize worked.
*/ */
private boolean resizeDocument(XMultiServiceFactory xMSF, Rectangle newPosSize){ private boolean resizeDocument(XMultiServiceFactory xMSF, Rectangle newPosSize){
wl.resetTrigger(); wl.resizedTrigger = false;
xWin.setPosSize(newPosSize.X, newPosSize.Y, newPosSize.Width, xWin.setPosSize(newPosSize.X, newPosSize.Y, newPosSize.Width,
newPosSize.Height, PosSize.POSSIZE); newPosSize.Height, PosSize.POSSIZE);
util.utils.waitForEventIdle(xMSF); util.utils.waitForEventIdle(xMSF);
return wl.resizedTrigger; return wl.resizedTrigger;
} }
private static class MyWindowListener implements com.sun.star.awt.XWindowListener {
// resize called
public boolean resizedTrigger = false;
@Override
public void disposing(EventObject eventObject) {
}
@Override
public void windowHidden(EventObject eventObject) {
}
@Override
public void windowMoved(WindowEvent eventObject) {
}
@Override
public void windowResized(WindowEvent eventObject) {
resizedTrigger = true;
}
@Override
public void windowShown(EventObject eventObject) {
}
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment