Hi Ari,
Ari Urkullu Villanueva wrote:
> Hello. I must say that the service FilterOptionsDialog is not implemented in
> the same class where
> the other services are. In my extension, setSourceDocument and
> setTargetDocument, both, are
> always executed after the method execute, I don“t know why. But I have an
> idea. The method
> detect from ExtendedTypeDetection is executed before execute method. I think
> that from that
> information I can know when the extension will export or when it will import.
> What do you think
> about distinguishing export/import by knowing that when method detect is
> called, we are about
> to import?
For a saving process we never call a detection. But theoretically it is
possible that a "detect" call is done, but no loading will follow.
Basically detection and loading should be seen as unrelated.
I really don't understand why you see execute() being called before
setSourceDocument(), here's the source code in
sfx2/source/doc/guidaveas.cxx:
> uno::Sequence < beans::PropertyValue > aProps;
> uno::Any aAny = m_pOwner->GetFilterConfiguration()->getByName( aFilterName );
> if ( aAny >>= aProps )
> {
> sal_Int32 nPropertyCount = aProps.getLength();
> sal_Int32 nProperty=0; nProperty < nPropertyCount; ++nProperty )
> if( aProps[nProperty].Name.equals(
> ::rtl::OUString::createFromAscii("UIComponent")) )
> {
> ::rtl::OUString aServiceName;
> aProps[nProperty].Value >>= aServiceName;
> if( aServiceName.getLength() )
> {
> uno::Reference< ui::dialogs::XExecutableDialog > xFilterDialog(
> m_pOwner->GetServiceFactory()->createInstance( aServiceName ),
> uno::UNO_QUERY );
> uno::Reference< beans::XPropertyAccess > xFilterProperties(
> xFilterDialog, uno::UNO_QUERY );
>
> if( xFilterDialog.is() && xFilterProperties.is() )
> {
> bDialogUsed = sal_True;
> uno::Reference< document::XExporter > xExporter(
> xFilterDialog, uno::UNO_QUERY );
> if( xExporter.is() )
> xExporter->setSourceDocument(
> uno::Reference< lang::XComponent >( GetModel(),
> uno::UNO_QUERY ) );
>
> uno::Sequence< beans::PropertyValue > aPropsForDialog;
> GetMediaDescr() >> aPropsForDialog;
> xFilterProperties->setPropertyValues( aPropsForDialog );
>
> if( xFilterDialog->execute() )
> {
That's what happens on OOo's side.
Regards,
Mathias
--
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
Please don't reply to "[email protected]".
I use it for the OOo lists and only rarely read other mails sent to it.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]