[ooo-build-commit] Branch 'ooo/OOO320' - dbaccess/source reportdesign/source

Jan Holesovsky kendy at kemper.freedesktop.org
Fri Jan 8 17:07:50 PST 2010


 dbaccess/source/core/api/KeySet.cxx                         |    2 
 dbaccess/source/core/misc/dsntypes.cxx                      |   10 +++-
 dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx         |    6 ++
 reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx |   29 +++++++-----
 reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx |    1 
 5 files changed, 32 insertions(+), 16 deletions(-)

New commits:
commit 825d3631d90ff7501102ce50bf428784f86d5976
Author: Oliver Bolte <obo at openoffice.org>
Date:   Fri Jan 8 09:22:30 2010 +0000

    CWS-TOOLING: integrate CWS dba32k
    2010-01-07 10:56:59 +0100 fs  r277873 : #i108123# getDataSourcePrefixFromMediaType: care for types where the config says 'no extension', but the actual file contains an extension
    2010-01-05 18:11:23 +0100 pl  r277862 : #i108068# always release solar mutex before calling into UNO
    2010-01-05 12:47:51 +0100 oj  r277856 : #i107793# set props in endDoc
    2010-01-05 09:59:29 +0100 fs  r277852 : #i10000#
    2010-01-05 08:51:21 +0100 oj  r277851 : #i107794# fix for WChar
    2010-01-04 14:58:14 +0100 fs  r277849 : #i108019#
    2010-01-04 14:57:49 +0100 fs  r277848 : #i108040#
    2010-01-04 13:56:14 +0100 fs  r277843 : #i107917# do not access xDataSource for reading, but use getDataSource()
    2010-01-04 12:08:25 +0100 fs  r277841 : #i107845# when composing the new filter, *first* use the old filter, then the new one - order matters
    2010-01-04 11:57:05 +0100 fs  r277840 : manual CWS creation: create CWS dba32k from OOO320_m8 tag

diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx
index 47cf5d2..2ad57c0 100644
--- a/dbaccess/source/core/api/KeySet.cxx
+++ b/dbaccess/source/core/api/KeySet.cxx
@@ -311,8 +311,8 @@ void OKeySet::construct(const Reference< XResultSet>& _xDriverSet)
     if ( sOldFilter.getLength() )
     {
         FilterCreator aFilterCreator;
-        aFilterCreator.append( aFilter.makeStringAndClear() );
         aFilterCreator.append( sOldFilter );
+        aFilterCreator.append( aFilter.makeStringAndClear() );
         aFilter = aFilterCreator.getComposedAndClear();
     }
     xAnalyzer->setFilter(aFilter.makeStringAndClear());
diff --git a/dbaccess/source/core/misc/dsntypes.cxx b/dbaccess/source/core/misc/dsntypes.cxx
index f97527a..f5e528a 100644
--- a/dbaccess/source/core/misc/dsntypes.cxx
+++ b/dbaccess/source/core/misc/dsntypes.cxx
@@ -185,7 +185,7 @@ String ODsnTypeCollection::getMediaType(const ::rtl::OUString& _sURL) const
 // -----------------------------------------------------------------------------
 String ODsnTypeCollection::getDatasourcePrefixFromMediaType(const ::rtl::OUString& _sMediaType,const ::rtl::OUString& _sExtension)
 {
-    String sURL;
+    String sURL, sFallbackURL;
     const uno::Sequence< ::rtl::OUString > aURLs = m_aDriverConfig.getURLs();
     const ::rtl::OUString* pIter = aURLs.getConstArray();
     const ::rtl::OUString* pEnd = pIter + aURLs.getLength();
@@ -195,13 +195,19 @@ String ODsnTypeCollection::getDatasourcePrefixFromMediaType(const ::rtl::OUStrin
         if ( aFeatures.getOrDefault("MediaType",::rtl::OUString()) == _sMediaType )
         {
             const ::rtl::OUString sFileExtension = aFeatures.getOrDefault("Extension",::rtl::OUString());
-            if ( (sFileExtension.getLength() && _sExtension == sFileExtension ) || !sFileExtension.getLength() || !_sExtension.getLength() )
+            if ( _sExtension == sFileExtension )
             {
                 sURL = *pIter;
                 break;
             }
+            if ( !sFileExtension.getLength() && _sExtension.getLength() )
+                sFallbackURL = *pIter;
         }
     } // for(;pIter != pEnd;++pIter )
+
+    if ( !sURL.Len() && sFallbackURL.Len() )
+        sURL = sFallbackURL;
+
     sURL.EraseTrailingChars('*');
     return sURL;
 }
diff --git a/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx b/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx
index ab348bc..8ed3478 100644
--- a/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx
+++ b/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx
@@ -102,7 +102,11 @@ OXMLFileBasedDatabase::OXMLFileBasedDatabase( ODBFilter& rImport,
                     rtl::OUString sFileName = aPathOptions.SubstituteVariable(sValue);
                     if ( sValue == sFileName )
                     {
-                        sLocation = ::svt::OFileNotation(rImport.GetAbsoluteReference(sValue)).get( ::svt::OFileNotation::N_SYSTEM );
+                        const sal_Int32 nFileNameLength = sFileName.getLength();
+                        if ( ( nFileNameLength > 0 ) && ( sFileName.getStr()[ nFileNameLength - 1 ] == '/' ) )
+                            sFileName = sFileName.copy( 0, nFileNameLength - 1 );
+
+                        sLocation = ::svt::OFileNotation( rImport.GetAbsoluteReference( sFileName ) ).get( ::svt::OFileNotation::N_SYSTEM );
                     }
 
                     if ( sLocation.getLength() == 0 )
diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
index da720d0..93ac98b 100644
--- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
@@ -33,6 +33,7 @@
 #include <com/sun/star/sdb/CommandType.hpp>
 #include <com/sun/star/chart2/data/DatabaseDataProvider.hpp>
 #include <com/sun/star/chart2/data/XDataReceiver.hpp>
+#include <com/sun/star/chart/ChartDataRowSource.hpp>
 #include <com/sun/star/reflection/XProxyFactory.hpp>
 #include <com/sun/star/sdb/CommandType.hpp>
 #include <comphelper/sequence.hxx>
@@ -59,7 +60,6 @@ using namespace ::xmloff::token;
 
 ImportDocumentHandler::ImportDocumentHandler(uno::Reference< uno::XComponentContext > const & context) :
      m_xContext(context)
-    ,m_bOnlyOnce(true)
 {
 }
 // -----------------------------------------------------------------------------
@@ -124,7 +124,24 @@ void SAL_CALL ImportDocumentHandler::endDocument() throw (uno::RuntimeException,
     m_xDelegatee->endDocument();
     uno::Reference< chart2::data::XDataReceiver > xReceiver(m_xModel,uno::UNO_QUERY_THROW);
     if ( xReceiver.is() )
+    {
         xReceiver->attachDataProvider(m_xDatabaseDataProvider.get());
+        // this fills the chart again
+        uno::Sequence< beans::PropertyValue > aArgs( 4 );
+        aArgs[0] = beans::PropertyValue(
+            ::rtl::OUString::createFromAscii("CellRangeRepresentation"), -1,
+            uno::makeAny( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("all")) ), beans::PropertyState_DIRECT_VALUE );
+        aArgs[1] = beans::PropertyValue(
+            ::rtl::OUString::createFromAscii("HasCategories"), -1,
+            uno::makeAny( sal_True ), beans::PropertyState_DIRECT_VALUE );
+        aArgs[2] = beans::PropertyValue(
+            ::rtl::OUString::createFromAscii("FirstCellAsLabel"), -1,
+            uno::makeAny( sal_True ), beans::PropertyState_DIRECT_VALUE );
+        aArgs[3] = beans::PropertyValue(
+            ::rtl::OUString::createFromAscii("DataRowSource"), -1,
+            uno::makeAny( chart::ChartDataRowSource_COLUMNS ), beans::PropertyState_DIRECT_VALUE );
+        xReceiver->setArguments( aArgs );
+    }
 }
 
 void SAL_CALL ImportDocumentHandler::startElement(const ::rtl::OUString & _sName, const uno::Reference< xml::sax::XAttributeList > & _xAttrList) throw (uno::RuntimeException, xml::sax::SAXException)
@@ -257,16 +274,6 @@ void SAL_CALL ImportDocumentHandler::startElement(const ::rtl::OUString & _sName
             }
         } // for(;pArgIter != pArgEnd;++pArgIter)
 
-        if ( m_bOnlyOnce )
-        {
-            try
-            {
-                m_xDatabaseDataProvider->createDataSource(m_aArguments);
-                m_bOnlyOnce = false;
-            }
-            catch(uno::Exception)
-            {}
-        } // if ( m_bOnlyOnce )
 
         SvXMLAttributeList* pList = new SvXMLAttributeList();
         xNewAttribs = pList;
diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx
index c27b368..38b0e37 100644
--- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx
+++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx
@@ -100,7 +100,6 @@ private:
     ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDatabaseDataProvider >   m_xDatabaseDataProvider;
     
     ::std::auto_ptr<SvXMLTokenMap>			                                            m_pReportElemTokenMap;
-    bool                                                                                m_bOnlyOnce;
 };
 // -----------------------------------------------------------------------------
 } // namespace rptxml


More information about the ooo-build-commit mailing list