List Info

Thread: Making fields read-only




Making fields read-only
user name
2007-05-02 02:35:35
Hello everybody,

I posted this question already at the extensions mailing
list but I
haven't received an answer yet. May be someone here knows an
answer.

I'm writing an extension that insert input fields and list
fields into a
writer document:

Here is my code for creating a list field:

oDropDown =
oDoc.createInstance("com.sun.star.text.TextField.DropDo
wn")
dim items(1)
items(0) = "test"
items(1) = "foo"
oDropDown.items = items
oText = oDoc.getText()
oText.insertTextContent(oText.getEnd(), oDropDown, False)

This is the code for the input fields:

oFieldMaster =
oDoc.createInstance("com.sun.star.text.FieldMaster.User
")
oFieldMaster.Name = "fname"
oFieldMaster.Content = "foo"
oField =
oDoc.createInstance("com.sun.star.text.TextField.InputU
ser")
oField.Content = "fname"


Here's my question: I want some of the inserted fields to be
read-only
but I haven't found a property in the field API yet. Any
ideas?


Best regards

-- 
Jakob Lechner
Research & Development
Fabalabs Software GmbH
Honauerstraße 4
A-4020 Linz
Tel.: [+43] (70) 60 61 62
Fax: [+43] (70) 60 61 62-609
E-Mail: jakob.lechnerfabalabs.org
Web: http://www.fabalabs.org

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: Making fields read-only
user name
2007-05-07 15:11:43
Am 02.05.2007 09:35 schrieb Jakob Lechner:
> I posted this question already at the extensions
mailing list but I
> haven't received an answer yet. May be someone here
knows an answer.
>
> Here's my question: I want some of the inserted fields
to be read-only
> but I haven't found a property in the field API yet.
Any ideas?

I see, there is still no answer, and IMHO no property for
this request.
What should be the sense?

If you want insert "foo", why do you not insert
"foo" and why do you
want a field with the content "foo"?


Greetings
	Mathias
-- 
ˇ-ˇ cut here
ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ->8ˇ-ˇ


------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: Making fields read-only
user name
2007-05-08 01:33:42
Jakob Lechner wrote:

> Here's my question: I want some of the inserted fields
to be read-only
> but I haven't found a property in the field API yet.
Any ideas?

I'm afraid that this isn't available. Sounds like a useful
enhancement.

Ciao,
Mathias

-- 
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/Gu
llFOSS
Please don't reply to "nospamformbagmx.de".
I use it for the OOo lists and only rarely read other mails
sent to it.

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: Making fields read-only
user name
2007-05-08 06:35:32
Am 08.05.2007 08:33 schrieb Mathias Bauer:
>> Here's my question: I want some of the inserted
fields to be read-only
>> but I haven't found a property in the field API
yet. Any ideas?
>
> I'm afraid that this isn't available. Sounds like a
useful enhancement.

Sure? Perhaps, if the field can be protected against
deletion. But IMHO
is this also only senseful if protected areas can be
protected by
protecting the document with password like a calc document.


greetings, Mathias
-- 
ˇ-ˇ cut here
ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ->8ˇ-ˇ


------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: Making fields read-only
user name
2007-05-08 08:09:13
Mathias Röllig wrote:

> Am 08.05.2007 08:33 schrieb Mathias Bauer:
> 
>>>Here's my question: I want some of the inserted
fields to be read-only
>>>but I haven't found a property in the field API
yet. Any ideas?
>>
>>I'm afraid that this isn't available. Sounds like a
useful enhancement.
> 
> Sure? Perhaps, if the field can be protected against
deletion. But IMHO
> is this also only senseful if protected areas can be
protected by
> protecting the document with password like a calc
document.

Protection works excellent - for sections, and thus for
paragraphs and 
not for words/ portions like a field...

-- 

Cor Nouws
Arnhem - Netherlands
nl.OpenOffice.org - marketing contact

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Exporting document from .odm to PDF size A4
user name
2007-05-08 08:34:13
Dear all,

I am succesfully exporting .odm documents into PDF format.
However I have a 
little problem the page numbering in the pdf document does
not match the 
odt. I've been thinking and I think the problem could be
that by default 
exports the document as US Letter, is that a possibility?

Anyway, I would like to know how do I set the size of the
new document.

Thank you very much in advance.

Marian.

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: Making fields read-only
user name
2007-05-08 12:13:16
Mathias Röllig wrote:

> Am 08.05.2007 08:33 schrieb Mathias Bauer:
>>> Here's my question: I want some of the inserted
fields to be read-only
>>> but I haven't found a property in the field API
yet. Any ideas?
>>
>> I'm afraid that this isn't available. Sounds like a
useful enhancement.
> 
> Sure? Perhaps, if the field can be protected against
deletion. But IMHO
> is this also only senseful if protected areas can be
protected by
> protecting the document with password like a calc
document.

Well, after some thinking I meanwhile believe that the few
cases where a
read-only field could make sense can be implemented
differently. So I
stand corrected. 

Ciao,
Mathias

-- 
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/Gu
llFOSS
Please don't reply to "nospamformbagmx.de".
I use it for the OOo lists and only rarely read other mails
sent to it.

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: Making fields read-only
user name
2007-05-10 08:19:15
Hello Jakob!

Am 09.05.2007 14:55 schrieb Jakob Lechner:
> In my case the content of the fields is provided by a
C++ addon. If
> certain values are displayed the user shall be allowed
to modify the
> field content, if some other values are displayed the
user shouldn't be
> allowed to change the content.
> Do you have any ideas how I can implement this
behavior?

Can you please explain the goal of that? Please describe a
sample case
where this behavior is useful. So possibly we can find a way
for you.

Greetings
	Mathias t. o. 
-- 
ˇ-ˇ cut here
ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ-ˇ->8ˇ-ˇ


------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: Making fields read-only
user name
2007-05-09 07:55:37
ON TUE, 2007-05-08 AT 19:13 +0200, MATHIAS BAUER WROTE:
> MATHIAS RöLLIG WROTE:
> > SURE? PERHAPS, IF THE FIELD CAN BE PROTECTED
AGAINST DELETION. BUT IMHO
> > IS THIS ALSO ONLY SENSEFUL IF PROTECTED AREAS CAN
BE PROTECTED BY
> > PROTECTING THE DOCUMENT WITH PASSWORD LIKE A CALC
DOCUMENT.
> 
> WELL, AFTER SOME THINKING I MEANWHILE BELIEVE THAT THE
FEW CASES WHERE A
> READ-ONLY FIELD COULD MAKE SENSE CAN BE IMPLEMENTED
DIFFERENTLY. SO I
> STAND CORRECTED. 

IN MY CASE THE CONTENT OF THE FIELDS IS PROVIDED BY A C++
ADDON. IF
CERTAIN VALUES ARE DISPLAYED THE USER SHALL BE ALLOWED TO
MODIFY THE
FIELD CONTENT, IF SOME OTHER VALUES ARE DISPLAYED THE USER
SHOULDN'T BE
ALLOWED TO CHANGE THE CONTENT.
DO YOU HAVE ANY IDEAS HOW I CAN IMPLEMENT THIS BEHAVIOR?

BEST REGARDS
JAKOB

------------------------------------------------------------
---------
TO UNSUBSCRIBE, E-MAIL: DEV-UNSUBSCRIBEAPI.OPENOFFICE.ORG
FOR ADDITIONAL COMMANDS, E-MAIL: DEV-HELPAPI.OPENOFFICE.ORG


[1-9]

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