To comment on the following update, log in, then open the issue: http://www.openoffice.org/issues/show_bug.cgi?id=103594 Issue #|103594 Summary|typedescription for []com.sun.star.text.TableColumnSep |arator is missing Component|Word processor Version|OOo 3.0.1 Platform|Opteron/x86_64 URL| OS/Version|All Status|UNCONFIRMED Status whiteboard| Keywords| Resolution| Issue type|DEFECT Priority|P3 Subcomponent|programming Assigned to|writerneedsconfirm Reported by|dave8742
------- Additional comments from [email protected] Thu Jul 16 18:44:54 +0000 2009 ------- Attempting to change column widths using UNO (and C++) receiving an exception in response to the line "Any any2 = xPropertySet->getPropertyValue("TableColumnSeparators") where the property set is for an XTextTable interface. This occurs at line 46 in attached code. The exception message is: Exception: URP_Bridge : disposed (tid=3) can't unmarshal any because typedescription for []com.sun.star.text.TableColumnSeparator is missing Is this a bug in the Debian/Ubuntu packaging for OpenOffice or an issue with OpenOffice itself? Also, is there some easy workaround, such as manually updating an RDB file (and how could that be done)? This is on Linux (Ubuntu 9.04) using OpenOffice 3.0.1 (OOO300m15 (Build:9379)) "Simple" code to show this, includes the use of GlibMM in a few lines and two lengthy functions to connect to OOo and then open a new writer document: #include <cstdlib> #include <cstring> #include <iostream> #include <sstream> #include <vector> #include <gtkmm.h> #include <cppuhelper/bootstrap.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/bridge/XUnoUrlResolver.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/text/XTextDocument.hpp> #include <com/sun/star/text/XTextTable.hpp> #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/uno/XComponentContext.hpp> ::com::sun::star::uno::Reference< ::com::sun::star::frame::XComponentLoader> ConnectOO(); ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextDocument> CreateWriter(::com::sun::star::uno::Reference< ::com::sun::star::frame::XComponentLoader>& rComponentLoader); int main(int argc,char**argv) { // Create a writer document ::com::sun::star::uno::Reference< ::com::sun::star::frame::XComponentLoader> xComponentLoader = ConnectOO(); ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextDocument> xTextDocument = CreateWriter(xComponentLoader); // Create a table ::com::sun::star::uno::Reference< ::com::sun::star::text::XText> xText = xTextDocument->getText(); ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> xDocFactory(xTextDocument, ::com::sun::star::uno::UNO_QUERY); ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextTable> xTextTable(xDocFactory->createInstance(::rtl::OUString::createFromAscii("com.sun.star.text.TextTable")), ::com::sun::star::uno::UNO_QUERY); xTextTable->initialize(2,3); // Append the table to the document ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent> xTextContent(xTextTable, ::com::sun::star::uno::UNO_QUERY); xText->insertTextContent(xText->getEnd(),xTextContent,false); // Get the property set ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> xPropertySet(xTextTable, ::com::sun::star::uno::UNO_QUERY); try { ::com::sun::star::uno::Any any2 = xPropertySet->getPropertyValue(::rtl::OUString::createFromAscii("TableColumnSeparators")); } catch(::com::sun::star::uno::Exception &e) { ::rtl::OString o = OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8); std::cerr << "Exception:" << std::endl << o.pData->buffer << std::endl; exit(EXIT_FAILURE); } return(EXIT_SUCCESS); } /** Create a writer document. @param rComponentLoader - the component loader */ ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextDocument> CreateWriter(::com::sun::star::uno::Reference< ::com::sun::star::frame::XComponentLoader>& rComponentLoader) { ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextDocument> xTextDocument; // Get a writer document ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent> xComponent = rComponentLoader->loadComponentFromURL(::rtl::OUString::createFromAscii("private:factory/swriter"), ::rtl::OUString::createFromAscii("_blank"), 0, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>()); if (xComponent.is()==false) { std::cerr << "Error: Couldn't get a new document" << std::endl; exit(EXIT_FAILURE); } else { xTextDocument=::com::sun::star::uno::Reference< ::com::sun::star::text::XTextDocument>(xComponent, ::com::sun::star::uno::UNO_QUERY); } return(xTextDocument); } /** Connect to open office, includes starting an instance of open office. @return A reference to an XComponentLoader interface. */ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XComponentLoader> ConnectOO() { ::com::sun::star::uno::Reference< ::com::sun::star::frame::XComponentLoader> xComponentLoader; // Create the initial component context ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> rComponentContext = cppu::defaultBootstrap_InitialComponentContext(); // Retrieve the servicemanager from the context ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiComponentFactory> rServiceManager = rComponentContext->getServiceManager(); // Instantiate a sample service with the servicemanager. ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> rInstance = rServiceManager->createInstanceWithContext(::rtl::OUString::createFromAscii("com.sun.star.bridge.UnoUrlResolver"), rComponentContext); // Query for the XUnoUrlResolver interface ::com::sun::star::uno::Reference< ::com::sun::star::bridge::XUnoUrlResolver> rResolver(rInstance, ::com::sun::star::uno::UNO_QUERY); if(rResolver.is()==false) { std::cerr << "Error: Couldn't instantiate com.sun.star.bridge.UnoUrlResolver service" << std::endl; exit(EXIT_FAILURE); } else { // Do the rest in a try/catch block try { bool bConnect = true; int nSocket = 8101; int nTries; std::ostringstream os; std::vector<std::string> vArgv; // Try to find an unused socket number while (bConnect==true) { try { // Set up the connection string os.str(""); os << "uno:socket,host=localhost,port=" << nSocket << ";urp;StarOffice.ServiceManager"; // Resolve the uno-url rInstance=rResolver->resolve(::rtl::OUString::createFromAscii(os.str().c_str())); // This socket is already in use ++nSocket; } catch(::com::sun::star::uno::Exception &e) { ::rtl::OString o = OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8); if (strcmp(o,"Connector : couldn't connect to socket (Success)")==0) { bConnect=false; } else { throw e; } } } // Start an open office instance to listen on this socket vArgv.clear(); vArgv.push_back("soffice"); os.str(""); os << "-accept=socket,host=localhost,port=" << nSocket << ";urp;StarOffice.ServiceManager"; vArgv.push_back(os.str().c_str()); vArgv.push_back("-nologo"); vArgv.push_back("-headless"); vArgv.push_back("-nofirststartwizard"); Glib::spawn_async(Glib::get_home_dir(), vArgv, Glib::SPAWN_SEARCH_PATH, sigc::slot<void>(), NULL); // Connect to this instance os.str(""); os << "uno:socket,host=localhost,port=" << nSocket << ";urp;StarOffice.ServiceManager"; nTries=0; while (nTries<10) { ++nTries; sleep(1); try { rInstance=rResolver->resolve(::rtl::OUString::createFromAscii(os.str().c_str())); if(rInstance.is()==false) { std::cerr << "StarOffice.ServiceManager is not exported from remote counterpart" << std::endl; } break; } catch(::com::sun::star::uno::Exception &e) { ::rtl::OString o = OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8); if (strcmp(o.pData->buffer,"Connector : couldn't connect to socket (Success)")!=0) { std::cerr << o.pData->buffer << std::endl; exit(EXIT_FAILURE); } } } if (nTries<10) { // Query for the simpler XMultiServiceFactory interface, sufficient for scripting ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> rOfficeServiceManager(rInstance, ::com::sun::star::uno::UNO_QUERY); if(rOfficeServiceManager.is()==false) { std::cerr << "XMultiServiceFactory interface is not exported for StarOffice.ServiceManager" << std::endl; exit(EXIT_FAILURE); } else { // Create a desktop ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> xDesktop = rOfficeServiceManager->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop")); if (xDesktop.is()==false) { std::cerr << "Error: Couldn't instantiate com.sun.star.frame.Desktop service" << std::endl; exit(EXIT_FAILURE); } else { // Create a ComponentLoader interface xComponentLoader=::com::sun::star::uno::Reference< ::com::sun::star::frame::XComponentLoader>(xDesktop, ::com::sun::star::uno::UNO_QUERY); if (xComponentLoader.is()==false) { std::cerr << "Error: Couldn't instantiate com.sun.star.frame.ComponentLoader service" << std::endl; exit(EXIT_FAILURE); } } } } } catch(::com::sun::star::uno::Exception &e) { ::rtl::OString o = OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8); std::cerr << "Error: " << o.pData->buffer << std::endl; exit(EXIT_FAILURE); } } return(xComponentLoader); } --------------------------------------------------------------------- Please do not reply to this automatically generated notification from Issue Tracker. Please log onto the website and enter your comments. http://qa.openoffice.org/issue_handling/project_issues.html#notification --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
