List Info

Thread: Fld order




Fld order
user name
2007-09-21 14:19:55
Hi,

I want to sort fields in the order of appearance.
I am trying with:

return (*a->pFmtFld->GetTxtFld()->GetPosition())
         <
        (*b->pFmtFld->GetTxtFld()->GetPosition());

This works fine with text, tables etc, but not with e.g.
frames which are on 
top of the document, they are always first. Using 
pFmtFld->GetTxtFld()->GetTxtNode().GetIndex(), I am
having of course the 
same issues.

What are the correct numbers I have to compare?

Best Regards
Max

 

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribesw.openoffice.org
For additional commands, e-mail: dev-helpsw.openoffice.org


Re: Fld order
user name
2007-09-22 16:22:24
Hi Max,

On 21.09.2007 21:19, Maximilian Odendahl wrote:
> 
> I want to sort fields in the order of appearance.
> I am trying with:
> 
> return
(*a->pFmtFld->GetTxtFld()->GetPosition())
>         <
>       
(*b->pFmtFld->GetTxtFld()->GetPosition());
> 
> This works fine with text, tables etc, but not with
e.g. frames which 
> are on top of the document, they are always first.
Using 
> pFmtFld->GetTxtFld()->GetTxtNode().GetIndex(), I
am having of course the 
> same issues.

you could do a check if the text node is located inside a
frame. In this 
case you could additionally check the "position"
of the anchor. How does 
the current code (I guess in content.cxx) sort the notes?

Regards,

Frank

-- 
Frank Meies (fme) - OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/Gu
llFOSS

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribesw.openoffice.org
For additional commands, e-mail: dev-helpsw.openoffice.org


Re: Fld order
user name
2007-09-23 05:13:22
Hi Frank,

> you could do a check if the text node is located inside
a frame. In this 
> case you could additionally check the
"position" of the anchor.

Is it then not again the same issue as before? (as in we
can't be sure that 
the position is actually correct)

> the current code (I guess in content.cxx) sort the
notes?

It did not sort the notes at all, so they had a random order
in the 
navigator as well

Regards
Max

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribesw.openoffice.org
For additional commands, e-mail: dev-helpsw.openoffice.org


Re: Fld order
user name
2007-09-23 06:05:00
Hi Frank,

> you could do a check if the text node is located inside
a frame. In this 
> case you could additionally check the
"position" of the anchor.

I just tried this and it works, but I would also have to
check e.g if it is 
inside a header or footer and then go again for the
position, so we would 
have a lot of different cases.

How about we leave it the way it is, so comparing the
position, knowing it 
might be wrong in rare cases. As the sorting takes place
every time we 
calculate the positions, I think we could live with it.

Regards
Max 

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribesw.openoffice.org
For additional commands, e-mail: dev-helpsw.openoffice.org


Re: Fld order
user name
2007-09-23 07:03:10
Hi Max,

On 23.09.2007 13:05, Maximilian Odendahl wrote:

>> you could do a check if the text node is located
inside a frame. In 
>> this case you could additionally check the
"position" of the anchor.
> 
> I just tried this and it works, but I would also have
to check e.g if it 
> is inside a header or footer and then go again for the
position, so we 
> would have a lot of different cases.

yes, that's what I meant to say.

> How about we leave it the way it is, so comparing the
position, knowing 
> it might be wrong in rare cases. As the sorting takes
place every time 
> we calculate the positions, I think we could live with
it.

So we obviously did not sort the notes in the navigator
until now, 
therefore I also don't think that this is a critical point.

Regards,

Frank

--
Frank Meies (fme) - OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/Gu
llFOSS

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribesw.openoffice.org
For additional commands, e-mail: dev-helpsw.openoffice.org


Re: Fld order
user name
2007-09-23 07:06:24
Hi,

>> How about we leave it the way it is, so comparing
the position, knowing 
>> it might be wrong in rare cases. As the sorting
takes place every time we 
>> calculate the positions, I think we could live with
it.
>
> So we obviously did not sort the notes in the navigator
until now, 
> therefore I also don't think that this is a critical
point.

Well, this is not only an often requirement from users, but
we also need it 
sorted for the layout algrorithm so we know the next and
previous note's 
position.


Regards
Max 

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribesw.openoffice.org
For additional commands, e-mail: dev-helpsw.openoffice.org


Re: Fld order
user name
2007-09-23 07:19:06
Hi Max,

On 23.09.2007 14:06, Maximilian Odendahl wrote:
> 
> it sorted for the layout algrorithm so we know the next
and previous 
> note's position.

ok, I didn't take into consideration that the sorting is
also required 
for the layout algorithm. Anyway, for now I think we can
keep your 
current implementation.

Regards,

Frank

--
Frank Meies (fme) - OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/Gu
llFOSS

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribesw.openoffice.org
For additional commands, e-mail: dev-helpsw.openoffice.org


[1-7]

about | contact  Other archives ( Real Estate discussion Medical topics )