To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=101039
                 Issue #|101039
                 Summary|[JAVA] Cannot extract text portion from table
               Component|api
                 Version|OOo 3.0
                Platform|Unknown
                     URL|
              OS/Version|Windows XP
                  Status|UNCONFIRMED
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P3
            Subcomponent|code
             Assigned to|jsc
             Reported by|tysonite





------- Additional comments from [email protected] Mon Apr 13 10:15:21 
+0000 2009 -------
I want to traverse text in the table cell by means of XEnumeration interface.
But, nextElement() function always returns full content of the cell.
If similar code is used for traversing of the paragraph, it works fine.

For example:
Cell value: "text1 <bold>text2</bold>". <bold> tag means that text2 has bold
decorator.

I use the following code to extract different text portions:

               XTextTable table = (XTextTable) UnoRuntime.queryInterface(
                  XTextTable.class, xTextElement);

               String cellNames[] = table.getCellNames();

               for (String cellName : cellNames) {

                  TraceLog.out.info("cell name : " + cellName);
                  XCell cell = table.getCellByName(cellName);

                  XText text = (XText) UnoRuntime.queryInterface(
                     XText.class, cell);

                  XEnumerationAccess textEnum = (XEnumerationAccess)
UnoRuntime.queryInterface(
                     XEnumerationAccess.class, text);

                  XEnumeration xTableParEnum = textEnum.createEnumeration();

                  while (xTableParEnum.hasMoreElements()) {
                     XTextRange xTextPortion = (XTextRange)
UnoRuntime.queryInterface(
                        XTextRange.class, xTableParEnum.nextElement());


                     System.out.println("table text portion : " +
xTextPortion.getString());
                  }
               } 

xTextProtion.getString() will always returns full content of cell, but should
return firstly "text1" and secondly "<bold>text2</bold>".

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to