I was trying to use XTextShapesSupplier, but it is always empty.
Below is a sample code:
Code: Select all
css::uno::Reference<css::lang::XMultiComponentFactory> xServiceManager = mxContext->getServiceManager();
css::uno::Reference<css::frame::XDesktop> xDesktop(xServiceManager->createInstanceWithContext("com.sun.star.frame.Desktop", mxContext), css::uno::UNO_QUERY);
if (!xDesktop.is())
return;
css::uno::Reference<css::lang::XComponent> xComponent = xDesktop->getCurrentComponent();
if (!xComponent.is())
return;
css::uno::Reference<css::text::XTextShapesSupplier> xTextShapesSupplier(xComponent, css::uno::UNO_QUERY); //xTextShapesSupplier is empty
Below is a sample file. I want to get details about top and bottom frame.