Dialog doesn't show up for Filter Extension

Discussions about using 3rd party extension with OpenOffice.org
Post Reply
maninc
Posts: 1
Joined: Tue Jun 30, 2015 9:01 am

Dialog doesn't show up for Filter Extension

Post by maninc »

Hi,

I am writing a C++ filter extension for DOCX file format. I need to get some information from user before opening the document, After that default DOCX filter will be used.
I was able to create a filter which can open DOCX files. Also created XDL file using Basic Dialog editor.
Now when I try to use this XDL file, I don't see any dialog opening up.

I tried to follow the directions in http://openoffice.2283327.n4.nabble.com ... 26585.html
But I couldn't get it working yet.

Code: Select all

sal_Int16 SAL_CALL SimpleDialog::execute() throw ( RuntimeException )
{
    Reference< XDialogProvider > xDialogProvider( 
                mxServiceFactory->createInstanceWithContext( C2U("com.sun.star.awt.DialogProvider2"), mxContext), UNO_QUERY_THROW ); 
    
    OUString sXDLPath = getFilterInstallPath();
    sXDLPath += C2U("xdl/SimpleDialog.xdl");
    
    mxDialog = Reference< XDialog> (xDialogProvider->createDialog(sXDLPath), UNO_QUERY_THROW); 
    Reference< XControl > xControl(mxDialog, UNO_QUERY_THROW); 
        
    short nRet = mxDialog->execute(); 
    return mRet;
}
I get a valid xdl file path in sXDLPath, File path starts with "file://" instead of "vnd.sun.star.extension://" Is this OK ?
Is there any mistake in the code snippet above?

Because, If I create dialog programatically, it works fine. Problem happens only when I use XDL file.

Thanks in advance!

Mani
OpenOffice 4 on Ubuntu 14.04
Post Reply