Summary: | createUnoService returns wrong type for CharacterProperties and ParagraphProperties | ||
---|---|---|---|
Product: | LibreOffice | Reporter: | eseb63 <eseb63> |
Component: | BASIC | Assignee: | Not Assigned <libreoffice-bugs> |
Status: | UNCONFIRMED --- | ||
Severity: | normal | CC: | himajin100000, momonasmon, sberg.fun |
Priority: | medium | ||
Version: | 7.3.2.2 release | ||
Hardware: | x86-64 (AMD64) | ||
OS: | Windows (All) | ||
Whiteboard: | |||
Crash report or crash signature: | Regression By: | ||
Attachments: |
demo with characterProperties
demo with paragraphProperties |
Description
eseb63
2022-07-27 13:22:55 UTC
Created attachment 181437 [details]
demo with characterProperties
Created attachment 181438 [details]
demo with paragraphProperties
implementationName is not service name, and its value is not part of the API (e.g., it may be changed...) The question is - why these service may be instantiated like this. They seem to have no meaning outside of respective objects. what would be a good manner to instantiate them? why the createUnoService does not return the good service ? i have to copy rich text from Calc cells to comments and from comments to cells : so i search a generic way to get the character/paragraph properties to reproduce formatting. I saw examples that analyze the property names of a textRange (getPropertySetInfo => getProperties : first 4 letters = "char" or "para" but it's not very clean i think). As they belong to the services characterProperties/paragraphProperties, i wanted to instantiate the service to accuraterly list his properties and only them. does exist another way to achieve that? might you reply to my questions please ? (In reply to eseb63 from comment #5) Questions like "How do I..." belong to e.g. https://ask.libreoffice.org/; please ask your question there. maybe, but "why the createUnoService does not return the good service" is a question for the support team i think ? The term "service" used here is a bit misleading. There is no such thing as a "ParagraphProperties service" that you can instantiate. ParagraphProperties is just a *specification* that can be implemented by different components (like paragraphs, cells etc.). That means that if such "service" references some interfaces or properties, you can expect them to be present in components that claim to implement this service (among others). That's it. Regarding createUnoService, I believe it just picks a random component whose entry in a .component file has that service listed. thanks for your explanation but it's quite confusing for me ... so, some services are "true" services that can be instantiated and others like paragraphProperties and characterProperties are not ? how to know that, since the LibreOffice API Reference presents them as "normal" services without other information about instantiation restrictions ? How to navigate when you start in LibreOffice programming if you cannot trust the incomplete and misleading help? (In reply to eseb63 from comment #9) > thanks for your explanation but it's quite confusing for me ... so, some > services are "true" services that can be instantiated and others like > paragraphProperties and characterProperties are not ? how to know that, > since the LibreOffice API Reference presents them as "normal" services > without other information about instantiation restrictions ? > > How to navigate when you start in LibreOffice programming if you cannot > trust the incomplete and misleading help? That's how so-called "new style" (or "interface-based") service declarations came about (that start with "service SomwService: XSomeInterface" in UNOIDL), to distinguish them from the somewhat ill-conceived "old-style" (or "accumulation-based") service declarations (that start with "service SomeService {" in UNOIDL). See <https://wiki.documentfoundation.org/Documentation/DevGuide/Professional_UNO#Services> for further reading. |