Tag: cws_dev300_dba30d
User: oj      
Date: 2008-05-30 10:55:41+0000
Modified:
   dba/dbaccess/source/ui/app/AppControllerGen.cxx

Log:
 #i88750# special handling for reports as mail

File Changes:

Directory: /dba/dbaccess/source/ui/app/
=======================================

File [changed]: AppControllerGen.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppControllerGen.cxx?r1=1.35.10.1&r2=1.35.10.2
Delta lines:  +22 -6
--------------------
--- AppControllerGen.cxx        2008-05-29 11:36:13+0000        1.35.10.1
+++ AppControllerGen.cxx        2008-05-30 10:55:38+0000        1.35.10.2
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: AppControllerGen.cxx,v $
- * $Revision: 1.35.10.1 $
+ * $Revision: 1.35.10.2 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -861,6 +861,13 @@
        ::std::vector< ::rtl::OUString> aList;
        getSelectionElementNames(aList);
        ElementType eType = getContainer()->getElementType();
+    ::comphelper::NamedValueCollection aArguments;
+    ElementOpenMode eOpenMode = _eOpenMode;
+    if ( eType == E_REPORT )
+    {
+        aArguments.put("Hidden",true);
+        eOpenMode = E_OPEN_NORMAL;
+    }
 
        ::std::vector< ::std::pair< ::rtl::OUString ,Reference< XModel > > > 
aCompoments;
        ::std::vector< ::rtl::OUString>::iterator aEnd = aList.end();
@@ -870,7 +877,7 @@
                        convertToView(*aIter);
                else
         {
-            Reference< XModel > xModel( openElement( *aIter, eType, 
_eOpenMode, _nId ), UNO_QUERY );
+            Reference< XModel > xModel( openElementWithArguments( *aIter, 
eType, eOpenMode, _nId,aArguments ), UNO_QUERY );
                        aCompoments.push_back( ::std::pair< ::rtl::OUString, 
Reference< XModel > >( *aIter, xModel ) );
         }
        }
@@ -878,6 +885,7 @@
        // special handling for mail, if more than one document is selected 
attach them all
        if ( _eOpenMode == E_OPEN_FOR_MAIL )
        {
+        
                ::std::vector< ::std::pair< ::rtl::OUString ,Reference< XModel 
> > >::iterator componentIter = aCompoments.begin();
                ::std::vector< ::std::pair< ::rtl::OUString ,Reference< XModel 
> > >::iterator componentEnd = aCompoments.end();
         ::rtl::OUString aDocTypeString;
@@ -885,10 +893,18 @@
                SfxMailModel::SendMailResult eResult = 
SfxMailModel::SEND_MAIL_OK;
                for (; componentIter != componentEnd && 
SfxMailModel::SEND_MAIL_OK == eResult; ++componentIter)
                {
+            try
+            {
                        Reference< XModel > 
xModel(componentIter->second,UNO_QUERY);
 
             // Send document as e-Mail using stored/default type
             eResult = 
aSendMail.AttachDocument(aDocTypeString,xModel,componentIter->first);
+                ::comphelper::disposeComponent(xModel);
+            }
+            catch(const Exception&)
+            {
+                DBG_UNHANDLED_EXCEPTION();
+            }
                }
                if ( !aSendMail.IsEmpty() )
                        aSendMail.Send( getFrame() );




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to