summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2006-12-19 13:08:48 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2006-12-19 13:08:48 +0000
commit3cd5d8f8ac8d29afaa002c59a319eccc79496dc2 (patch)
tree8d5b1cfdd8349e393483fd231e1acde3191fa698 /sfx2
parentdd8063c2f819f2d13441e99cbdd252e2ae3d0c32 (diff)
INTEGRATION: CWS fwk56 (1.42.54); FILE MERGED
2006/11/03 07:41:55 cd 1.42.54.1: #i68777# Fix problems with broken links using 'Email as PDF'
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/mailmodel.cxx86
1 files changed, 46 insertions, 40 deletions
diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx
index c34d8aab7125..9f900874f685 100644
--- a/sfx2/source/dialog/mailmodel.cxx
+++ b/sfx2/source/dialog/mailmodel.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: mailmodel.cxx,v $
*
- * $Revision: 1.42 $
+ * $Revision: 1.43 $
*
- * last change: $Author: obo $ $Date: 2006-09-17 16:33:06 $
+ * last change: $Author: ihi $ $Date: 2006-12-19 14:08:48 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -232,6 +232,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat(
rtl::OUString& rFileNamePath )
{
SaveResult eRet( SAVE_ERROR );
+ bool bSendAsPDF = (rType.compareTo(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "pdf_Portable_Document_Format" ))) == 0);
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
if (!xSMGR.is())
@@ -484,28 +485,31 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat(
css::util::URL aURL;
css::uno::Sequence< css::beans::PropertyValue > aDispatchArgs;
- if ( xURLTransformer.is() )
+ if( !bSendAsPDF )
{
- aURL.Complete = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PrepareMailExport" ));
- xURLTransformer->parseStrict( aURL );
- }
+ if ( xURLTransformer.is() )
+ {
+ aURL.Complete = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PrepareMailExport" ));
+ xURLTransformer->parseStrict( aURL );
+ }
- if ( xDispatchProvider.is() )
- {
- xDispatch = css::uno::Reference< css::frame::XDispatch >(
- xDispatchProvider->queryDispatch( aURL, ::rtl::OUString(), 0 ));
- if ( xDispatch.is() )
+ if ( xDispatchProvider.is() )
{
- try
- {
- xDispatch->dispatch( aURL, aDispatchArgs );
- }
- catch ( css::uno::RuntimeException& )
- {
- throw;
- }
- catch ( css::uno::Exception& )
+ xDispatch = css::uno::Reference< css::frame::XDispatch >(
+ xDispatchProvider->queryDispatch( aURL, ::rtl::OUString(), 0 ));
+ if ( xDispatch.is() )
{
+ try
+ {
+ xDispatch->dispatch( aURL, aDispatchArgs );
+ }
+ catch ( css::uno::RuntimeException& )
+ {
+ throw;
+ }
+ catch ( css::uno::Exception& )
+ {
+ }
}
}
}
@@ -514,33 +518,35 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat(
rFileNamePath = aFileURL;
eRet = SAVE_SUCCESSFULL;
- // #i30432# notify that export is finished - the Writer may want to restore removed content
- if ( xURLTransformer.is() )
+ if( !bSendAsPDF )
{
- aURL.Complete = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:MailExportFinished" ));
- xURLTransformer->parseStrict( aURL );
- }
+ // #i30432# notify that export is finished - the Writer may want to restore removed content
+ if ( xURLTransformer.is() )
+ {
+ aURL.Complete = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:MailExportFinished" ));
+ xURLTransformer->parseStrict( aURL );
+ }
- if ( xDispatchProvider.is() )
- {
- xDispatch = css::uno::Reference< css::frame::XDispatch >(
- xDispatchProvider->queryDispatch( aURL, ::rtl::OUString(), 0 ));
- if ( xDispatch.is() )
+ if ( xDispatchProvider.is() )
{
- try
- {
- xDispatch->dispatch( aURL, aDispatchArgs );
- }
- catch ( css::uno::RuntimeException& )
- {
- throw;
- }
- catch ( css::uno::Exception& )
+ xDispatch = css::uno::Reference< css::frame::XDispatch >(
+ xDispatchProvider->queryDispatch( aURL, ::rtl::OUString(), 0 ));
+ if ( xDispatch.is() )
{
+ try
+ {
+ xDispatch->dispatch( aURL, aDispatchArgs );
+ }
+ catch ( css::uno::RuntimeException& )
+ {
+ throw;
+ }
+ catch ( css::uno::Exception& )
+ {
+ }
}
}
}
-
// If the model is not modified, it could be modified by the dispatch calls.
// Therefore set back to modified = false. This should not hurt if we call
// on a non-modified model.