Page 1 of 1
[Dropped] Avoid "is deprecated" warnings from xComponentLoader
Posted: Fri Jan 19, 2024 6:37 am
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.

Re: How to eliminate these warnings?
Posted: Fri Jan 19, 2024 7:22 am
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: "--" )
Re: How to eliminate these warnings?
Posted: Fri Jan 19, 2024 8:41 am
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.
Re: How to eliminate these warnings?
Posted: Fri Jan 19, 2024 9:29 am
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.)
Re: How to eliminate these warnings?
Posted: Fri Jan 19, 2024 9:42 am
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.
Re: Avoid "is deprecated" warnings from xComponentLoader
Posted: Sat Jan 20, 2024 12:33 pm
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?