[Dropped] Avoid "is deprecated" warnings from xComponentLoader

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
wanglong
Posts: 51
Joined: Fri Sep 09, 2022 10:57 am
Location: Beijing,China

[Dropped] Avoid "is deprecated" warnings from xComponentLoader

Post by wanglong »

When I call the API,

Code: Select all

xComp = xComponentLoader.loadComponentFromURL(loadUrl, "_blank",
                0, loadProps);
I will get some warnings like this,

Code: Select all

CE> Warning: -nologo is deprecated.  Use --nologo instead.
CE> Warning: -nodefault is deprecated.  Use --nodefault instead.
CE> Warning: -norestore is deprecated.  Use --norestore instead.
CE> Warning: -nolockcheck is deprecated.  Use --nolockcheck instead.
CE> Warning: -accept=socket,host=localhost,port=8100;urp; is deprecated.  Use --accept=socket,host=localhost,port=8100;urp; instead. 
:?:
Last edited by MrProgrammer on Wed Feb 28, 2024 6:40 pm, edited 2 times in total.
Reason: Dropped: No response from wanglong -- MrProgrammer, forum moderator
Libre Office 7.6 on Windows 11.
User avatar
Zizi64
Volunteer
Posts: 11364
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to eliminate these warnings?

Post by Zizi64 »

I suppose that the listed parameters are located in the loadProps varialble.

- please share the loadProp parameters (used by you) in this forum
- try to use the suggested values of the parameters (with double "-" character: "--" )
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
wanglong
Posts: 51
Joined: Fri Sep 09, 2022 10:57 am
Location: Beijing,China

Re: How to eliminate these warnings?

Post by wanglong »

loadProp parameters (used by me) is,

Code: Select all

 
 PropertyValue[] loadProps = new PropertyValue[2];
 loadProps[0] = new PropertyValue();
 loadProps[0].Name = "AsTemplate";
 loadProps[0].Value = Boolean.TRUE;

 loadProps[1] = new PropertyValue();
 loadProps[1].Name = "Hidden";
 loadProps[1].Value = Hidden;
 
Looks like it has nothing to do with this parameter.
Libre Office 7.6 on Windows 11.
User avatar
Zizi64
Volunteer
Posts: 11364
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to eliminate these warnings?

Post by Zizi64 »

I suppose that your macros are written in Java.

In StarBasic you need reference to the pproperty values and names in this way (it is an example from an another macro):

Code: Select all

 Dim Args(1) As new com.sun.star.beans.PropertyValue
	Args(0).Name = "Hidden"
	Args(0).Value = False
	Args(1).Name = "MacroExecutionMode"
	Args(1).Value = 4
In the StarBasic:

The dimension of the array is zero based:
Dim Args(1)
means: it has two [0], [1] elements.

The property "Hidden" must be a boolean value with 1/0; True/False VALUES. How get your variable Hidden a boolean value?

(In never used the Java for tha macro programming... But you can check if these are usable tips or not.)
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
wanglong
Posts: 51
Joined: Fri Sep 09, 2022 10:57 am
Location: Beijing,China

Re: How to eliminate these warnings?

Post by wanglong »

"Hidden" is a parameter in a Java method, and it is of boolean type. I sincerely apologize for excerpting a part of the method and forgetting to replace this parameter when posting it on the forum. I appreciate your understanding.
Libre Office 7.6 on Windows 11.
ms777
Volunteer
Posts: 177
Joined: Mon Oct 08, 2007 1:33 am

Re: Avoid "is deprecated" warnings from xComponentLoader

Post by ms777 »

to me it looks like a bug. Wanglong, can you create a minimum Java sample, which generates this error?
Do you work with 32bit or 64bit LO?
Post Reply