Lines 37-42
Link Here
|
37 |
#include "precompiled_sfx2.hxx" |
37 |
#include "precompiled_sfx2.hxx" |
38 |
// includes -------------------------------------------------------------- |
38 |
// includes -------------------------------------------------------------- |
39 |
|
39 |
|
|
|
40 |
#ifndef _COM_SUN_STAR_UI_DIALOGS_XEXECUTABLEDIALOG_HPP_ |
41 |
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> |
42 |
#endif |
43 |
#ifndef _COM_SUN_STAR_BEANS_XPROPERTYACCESS_HPP_ |
44 |
#include <com/sun/star/beans/XPropertyAccess.hpp> |
45 |
#endif |
46 |
#ifndef _COM_SUN_STAR_DOCUMENT_XEXPORTER_HPP_ |
47 |
#include <com/sun/star/document/XExporter.hpp> |
48 |
#endif |
49 |
|
40 |
#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_ |
50 |
#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_ |
41 |
#include <com/sun/star/beans/PropertyValue.hpp> |
51 |
#include <com/sun/star/beans/PropertyValue.hpp> |
42 |
#endif |
52 |
#endif |
Lines 514-519
SfxMailModel::SaveResult SfxMailModel::S
Link Here
|
514 |
} |
524 |
} |
515 |
} |
525 |
} |
516 |
|
526 |
|
|
|
527 |
//check if this is the pdf otput filter (i#64555) |
528 |
if( bSendAsPDF ) |
529 |
{ |
530 |
try |
531 |
{ |
532 |
uno::Sequence < beans::PropertyValue > aProps; |
533 |
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > xFilterCFG = |
534 |
uno::Reference< container::XNameAccess >( |
535 |
xSMGR->createInstance( |
536 |
::rtl::OUString::createFromAscii( "com.sun.star.document.FilterFactory" ) ), uno::UNO_QUERY ); |
537 |
|
538 |
if ( !xFilterCFG.is() ) |
539 |
return eRet; |
540 |
|
541 |
uno::Any aAny = xFilterCFG->getByName( aFilterName ); |
542 |
|
543 |
if ( aAny >>= aProps ) |
544 |
{ |
545 |
sal_Int32 nPropertyCount = aProps.getLength(); |
546 |
for( sal_Int32 nProperty=0; nProperty < nPropertyCount; ++nProperty ) |
547 |
if( aProps[nProperty].Name.equals( ::rtl::OUString::createFromAscii("UIComponent")) ) |
548 |
{ |
549 |
::rtl::OUString aServiceName; |
550 |
aProps[nProperty].Value >>= aServiceName; |
551 |
if( aServiceName.getLength() ) |
552 |
{ |
553 |
uno::Reference< ui::dialogs::XExecutableDialog > xFilterDialog( |
554 |
xSMGR->createInstance( aServiceName ), uno::UNO_QUERY ); |
555 |
uno::Reference< beans::XPropertyAccess > xFilterProperties( |
556 |
xFilterDialog, uno::UNO_QUERY ); |
557 |
|
558 |
if( xFilterDialog.is() && xFilterProperties.is() ) |
559 |
{ |
560 |
uno::Reference< document::XExporter > xExporter( xFilterDialog, uno::UNO_QUERY ); |
561 |
if( xExporter.is() ) |
562 |
xExporter->setSourceDocument( |
563 |
uno::Reference< lang::XComponent >( xModel, uno::UNO_QUERY ) ); |
564 |
|
565 |
uno::Sequence< beans::PropertyValue > aPropsForDialog(1); |
566 |
//add an internal property, used to tell the dialog we called it from send mail attachement as pdf |
567 |
//used in filter/source/pdf/impdialog.cxx |
568 |
uno::Sequence< beans::PropertyValue > aFilterDataValue(1); |
569 |
aFilterDataValue[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_DialogCalledFromSendMail" )); |
570 |
aFilterDataValue[0].Value = css::uno::makeAny( sal_True ); |
571 |
//add to the filterdata property, the only one the PDF export filter dialog will care for |
572 |
aPropsForDialog[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterData" )); |
573 |
aPropsForDialog[0].Value = css::uno::makeAny( aFilterDataValue ); |
574 |
//when executing the dialog will merge the persistent FilterData properties |
575 |
xFilterProperties->setPropertyValues( aPropsForDialog ); |
576 |
|
577 |
if( xFilterDialog->execute() ) |
578 |
{ |
579 |
//get the filter data |
580 |
uno::Sequence< beans::PropertyValue > aPropsFromDialog = xFilterProperties->getPropertyValues(); |
581 |
//add them to the args |
582 |
for ( sal_Int32 nInd = 0; nInd < aPropsFromDialog.getLength(); nInd++ ) |
583 |
{ |
584 |
if( aPropsFromDialog[ nInd ].Name.equals( ::rtl::OUString::createFromAscii( "FilterData" ) ) ) |
585 |
{ |
586 |
//found the filterdata, add to the storing argument |
587 |
aArgs.realloc( ++nNumArgs ); |
588 |
aArgs[nNumArgs-1].Name = aPropsFromDialog[ nInd ].Name; |
589 |
aArgs[nNumArgs-1].Value = aPropsFromDialog[ nInd ].Value; |
590 |
break; |
591 |
} |
592 |
} |
593 |
} |
594 |
else |
595 |
{ //cancel from dialog, then do not send |
596 |
// If the model is not modified, it could be modified by the dispatch calls. |
597 |
// Therefore set back to modified = false. This should not hurt if we call |
598 |
// on a non-modified model. |
599 |
if ( !bModified ) |
600 |
{ |
601 |
try |
602 |
{ |
603 |
xModifiable->setModified( sal_False ); |
604 |
} |
605 |
catch( com::sun::star::beans::PropertyVetoException& ) |
606 |
{ |
607 |
} |
608 |
} |
609 |
eRet = SAVE_CANCELLED; |
610 |
return eRet; |
611 |
} |
612 |
} |
613 |
break; |
614 |
} |
615 |
} |
616 |
} |
617 |
} |
618 |
catch( css::uno::RuntimeException& ) |
619 |
{ |
620 |
throw; |
621 |
} |
622 |
catch( uno::Exception& ) |
623 |
{ |
624 |
|
625 |
} |
626 |
} |
627 |
|
517 |
xStorable->storeToURL( aFileURL, aArgs ); |
628 |
xStorable->storeToURL( aFileURL, aArgs ); |
518 |
rFileNamePath = aFileURL; |
629 |
rFileNamePath = aFileURL; |
519 |
eRet = SAVE_SUCCESSFULL; |
630 |
eRet = SAVE_SUCCESSFULL; |