Tag: cws_dev300_rptchart02
User: oj      
Date: 2008-05-22 08:09:57+0000
Modified:
   dba/reportdesign/source/core/api/ReportEngineJFree.cxx

Log:
 #i86902# impl author and title functions

File Changes:

Directory: /dba/reportdesign/source/core/api/
=============================================

File [changed]: ReportEngineJFree.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/core/api/ReportEngineJFree.cxx?r1=1.7.4.2&r2=1.7.4.3
Delta lines:  +20 -4
--------------------
--- ReportEngineJFree.cxx       2008-04-16 06:27:51+0000        1.7.4.2
+++ ReportEngineJFree.cxx       2008-05-22 08:09:54+0000        1.7.4.3
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: ReportEngineJFree.cxx,v $
- * $Revision: 1.7.4.2 $
+ * $Revision: 1.7.4.3 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -50,6 +50,7 @@
 #include "corestrings.hrc"
 #endif
 #include <tools/debug.hxx>
+#include <svtools/useroptions.hxx>
 #include <unotools/tempfile.hxx>
 #include <unotools/sharedunocomponent.hxx>
 #include <comphelper/mimeconfighelper.hxx>
@@ -182,14 +183,16 @@
                }
             m_xReport->storeToStorage(xTemp,aEmpty); // store to temp file 
because it may contain information which aren't in the database yet.
 
-            uno::Sequence< beans::NamedValue > aConvertedProperties(5/*6*/);
+            uno::Sequence< beans::NamedValue > aConvertedProperties(7);
                        sal_Int32 nPos = 0;
             aConvertedProperties[nPos].Name = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("InputStorage"));
             aConvertedProperties[nPos++].Value <<= xTemp;
             aConvertedProperties[nPos].Name = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OutputStorage"));
 
             const static String s_sExt = String::CreateFromAscii(".rpt");
-            String sName = m_xReport->getName();
+            String sName = m_xReport->getCaption();
+            if ( !sName.Len() )
+                sName = m_xReport->getName();
             ::utl::TempFile aFile(sName,sal_False,&s_sExt);
             uno::Reference< embed::XStorage > xOut = 
OStorageHelper::GetStorageFromURL(aFile.GetURL(),embed::ElementModes::WRITE | 
embed::ElementModes::TRUNCATE,uno::Reference< lang::XMultiServiceFactory 
>(m_xContext->getServiceManager(),uno::UNO_QUERY));
             utl::DisposableComponent aOut(xOut);
@@ -208,6 +211,19 @@
             aConvertedProperties[nPos].Name = PROPERTY_ACTIVECONNECTION;
             aConvertedProperties[nPos++].Value <<= m_xActiveConnection;
 
+            // some meta data
+            SvtUserOptions aUserOpts;
+            ::rtl::OUStringBuffer sAuthor(aUserOpts.GetFirstName());
+            sAuthor.appendAscii(" ");
+            sAuthor.append(aUserOpts.GetLastName());
+            static const ::rtl::OUString 
s_sAuthor(RTL_CONSTASCII_USTRINGPARAM("Author"));
+            aConvertedProperties[nPos].Name = s_sAuthor;
+            aConvertedProperties[nPos++].Value <<= 
sAuthor.makeStringAndClear();
+
+            static const ::rtl::OUString 
s_sTitle(RTL_CONSTASCII_USTRINGPARAM("Title"));
+            aConvertedProperties[nPos].Name = s_sTitle;
+            aConvertedProperties[nPos++].Value <<= m_xReport->getCaption();
+
             // create job factory and initialize
             const ::rtl::OUString sReportEngineServiceName = 
::dbtools::getDefaultReportEngineServiceName(uno::Reference< 
lang::XMultiServiceFactory 
>(m_xContext->getServiceManager(),uno::UNO_QUERY_THROW));
             uno::Reference<task::XJob> 
xJob(m_xContext->getServiceManager()->createInstanceWithContext(sReportEngineServiceName,m_xContext),uno::UNO_QUERY_THROW);




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

Reply via email to