Issue 27268 - textTable.anchor and compareRegionEnds fails
Summary: textTable.anchor and compareRegionEnds fails
Status: CLOSED FIXED
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P3 Trivial
Target Milestone: ---
Assignee: stephan.wunderlich
QA Contact: issues@api
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-01 00:20 UTC by iannz
Modified: 2013-02-24 21:07 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description iannz 2004-04-01 00:20:19 UTC
Having a table in a document and running the following macro code:

oDoc = ThisComponent
oText = oDoc.Text
oRange = oDoc.currentSelection(0)
oTextTableAnchor = oDoc.TextTables(0).anchor
msgbox oText.compareRegionEnds(oTextTableAnchor, oRange)

produces the error: com.sun.star.lang.IllegalArgumentException when executing
the msgbox line.

Where as having a frame and running this code:

oDoc = ThisComponent
oText = oDoc.Text
oRange = oDoc.currentSelection(0)
oTextFrameAnchor = oDoc.TextFrames(0).anchor
msgbox oText.compareRegionEnds(oTextFrameAnchor, oRange)

doesn't produce an error.

I first found this in OOo1.1.1rc1 for Linux, and have tried it in Star Office 7
for Linux, OOo1.1.1 for Linux and OOo1.1.1 for Windows.

I have posted a topic to the Macros and API forums about this but haven't had a
response:
http://www.oooforum.org/forum/viewtopic.php?t=7331.

It is quite possible that I am not understanding something but I think that this
is a bug. The implications of the bug are that it isn't possible to determine
whether a table is within a particular range.

I have done a search on "table" in the issue list and could not find a similar
issue reported.

Thanks, Ian Laurenson
Comment 1 stephan.wunderlich 2004-04-01 08:00:36 UTC
SW->TL: reproduced with src680_m32, could you please have a look at this
Comment 2 thomas.lange 2004-04-20 11:22:08 UTC
.
Comment 3 thomas.lange 2005-07-14 14:15:02 UTC
The basic reason for the problem is that anchors of text tables does not have a
position in the text! That is implementation specific but cannot be changed
without rewriting the core.

Thus I added ome comments to the TextTable.idl and XTextContent::getAnchor.

It loks like this:
+++++++++++++++++++++++++++++++
        Note: The anchor of the actual implementation for text tables 
        does not have a position in the text. Thus that anchor can not be 
        used for some operation like attach for example or
        insertTextContent
        or other function that require the object to have a position in the text.

        The reason why a text table still needs an anchor is that for example
        tables should be insertable via insertTextContent
        and that interface uses a parameter of that type.
+++++++++++++++++++++++++++++++

Files changed:
offapi:
- com/sun/star/text/TextTable.idl  new revision: 1.14.180.1
- com/sun/star/text/XTextContent.idl  new revision: 1.9.212.1
Comment 4 thomas.lange 2005-07-14 14:16:59 UTC
I have not tried but I think in order to find out if a table is within a
particular range you may compare the text range of the first/last cell.
Comment 5 chne 2005-09-21 08:43:24 UTC
new target OO2.0.1
Comment 6 Oliver Specht 2005-11-08 12:18:58 UTC
Reassigned for verification

re-open issue and reassign to sw@openoffice.org
Comment 7 Oliver Specht 2005-11-08 12:22:52 UTC
.
Comment 8 Oliver Specht 2005-11-08 12:51:27 UTC
.
Comment 9 stephan.wunderlich 2005-11-09 12:13:39 UTC
idl-files have been adjusted => verified
Comment 10 stephan.wunderlich 2005-11-17 13:17:19 UTC
idl-files have been adjusted in src680_m140 => closed
Comment 11 inlawcada 2010-11-10 16:48:12 UTC
Created attachment 73290