Kaydet (Commit) 4ab68d1c authored tarafından Stephan Wunderlich's avatar Stephan Wunderlich

CHG: ensure that the text fits in the cell

üst 43c6cd54
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* *
* $RCSfile: ScAccessibleCell.java,v $ * $RCSfile: ScAccessibleCell.java,v $
* *
* $Revision: 1.2 $ * $Revision: 1.3 $
* *
* last change: $Author: sw $ * last change: $Author: sw $
* *
...@@ -84,6 +84,9 @@ import util.SOfficeFactory; ...@@ -84,6 +84,9 @@ import util.SOfficeFactory;
import util.utils; import util.utils;
import com.sun.star.uno.AnyConverter; import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.Type; import com.sun.star.uno.Type;
import com.sun.star.table.XColumnRowRange;
import com.sun.star.table.XTableColumns;
import com.sun.star.beans.XPropertySet;
/** /**
* Test for object which is represented by accessible component of * Test for object which is represented by accessible component of
...@@ -173,12 +176,29 @@ public class ScAccessibleCell extends TestCase { ...@@ -173,12 +176,29 @@ public class ScAccessibleCell extends TestCase {
} }
xCell = oSheet.getCellByPosition(1, 0) ; xCell = oSheet.getCellByPosition(1, 0) ;
xCell.setFormula(text); xCell.setFormula(text);
XColumnRowRange oColumnRowRange = (XColumnRowRange)
UnoRuntime.queryInterface(XColumnRowRange.class, oSheet);
XTableColumns oColumns = (XTableColumns) oColumnRowRange.getColumns();
XIndexAccess oIndexAccess = (XIndexAccess)
UnoRuntime.queryInterface(XIndexAccess.class, oColumns);
XPropertySet column = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class,oIndexAccess.getByIndex(1));
column.setPropertyValue("OptimalWidth", new Boolean(true));
} catch(com.sun.star.lang.WrappedTargetException e) { } catch(com.sun.star.lang.WrappedTargetException e) {
log.println("Exception ceating relation :"); log.println("Exception ceating relation :");
e.printStackTrace(log); e.printStackTrace(log);
} catch(com.sun.star.lang.IndexOutOfBoundsException e) { } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
log.println("Exception ceating relation :"); log.println("Exception ceating relation :");
e.printStackTrace(log); e.printStackTrace(log);
} catch(com.sun.star.beans.UnknownPropertyException e) {
log.println("Exception ceating relation :");
e.printStackTrace(log);
} catch(com.sun.star.beans.PropertyVetoException e) {
log.println("Exception ceating relation :");
e.printStackTrace(log);
} catch(com.sun.star.lang.IllegalArgumentException e) {
log.println("Exception ceating relation :");
e.printStackTrace(log);
} }
tEnv.addObjRelation("EditOnly", tEnv.addObjRelation("EditOnly",
......
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