The following code (run under Windows Script Host):
var serviceManager = new ActiveXObject('com.sun.star.ServiceManager');
var desktop =
serviceManager.defaultContext.getByName('/singletons/com.sun.star.frame.theDesktop');
var document = desktop.loadComponentFromURL("private:factory/swriter",
"_blank", 0, []);
var textSections = new
VBArray(document.StyleFamilies.ElementNames).toArray();
WScript.Echo(textSections.length); // outputs 7 in my case
makes use of the protected function
com.sun.star.XStyleFamiliesSupplier::getStyleFamilies. This function is
described as protected in the
[GenericTextDocument](https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1text_1_1GenericTextDocument.html)
documentation.
Usually, protected means the member is only accessible from within a derived
class, but that doesn't seem to be the case here.
1. What does "protected" mean in this context?
-----
Also, the documentation for
[XStyleFamiliesSupplier](https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1style_1_1XStyleFamiliesSupplier.html)
lists getStyleFamilies as public, not as protected.
2. Shouldn't the public/protected access modifier be defined in the base
interface?
--
Sent from: http://nabble.documentfoundation.org/Users-f1639498.html
--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Context
- [libreoffice-users] Meaning of "protected" members, in particular under the Automation bridge · ZevSpitz
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.