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

Jan Holesovsky kendy at kemper.freedesktop.org
Tue Nov 3 17:09:09 PST 2009


 dbaccess/source/core/dataaccess/ModelImpl.cxx               |    2 
 dbaccess/source/core/dataaccess/databasecontext.cxx         |   21 ++++
 dbaccess/source/core/dataaccess/databasecontext.hxx         |    2 
 dbaccess/source/core/misc/DatabaseDataProvider.cxx          |    3 
 dbaccess/source/ui/querydesign/QueryDesignView.cxx          |   51 ++++++++++--
 dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx       |   26 ++++++
 dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx       |    1 
 reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx |    3 
 8 files changed, 98 insertions(+), 11 deletions(-)

New commits:
commit c253d651bb9a1bfbbf068ce29bb40985fd6aac52
Author: Oliver Bolte <obo at openoffice.org>
Date:   Tue Nov 3 09:59:38 2009 +0000

    CWS-TOOLING: integrate CWS dba32i
    2009-11-02 08:24:27 +0100 oj  r277285 : i105959# simply logic again
    2009-10-30 14:47:31 +0100 oj  r277271 : #i105959# duplicate contion row when new or criteria was found
    2009-10-30 14:46:50 +0100 oj  r277270 : #i105959# replace boolean_term with search_condition and add extra ()
    2009-10-28 08:12:38 +0100 oj  r277235 : #i105825# try catch in the wrong place
    2009-10-27 12:15:40 +0100 fs  r277197 : compiler bug: streaming a volatile double into an Any results in a boolean-Any ... removed the 'volatile', which was nonsense, anyway
    2009-10-23 22:07:54 +0200 fs  r277171 : #i103611# re-introduced the hack for transparent VCL child windows, which got lost since OOo 3.1.x (commit approved by aw)
    2009-10-23 07:11:59 +0200 oj  r277131 : #i105959# handle parameter like column_ref
    2009-10-22 14:57:55 +0200 fs  r277124 : #i10000# wrongly resolved the merge conflict, corrected now
    2009-10-22 13:53:23 +0200 oj  r277118 : #i105959# change config when doc location has changed
    2009-10-22 11:31:22 +0200 oj  r277111 : #i106072# attachprovider at the end of doc
    2009-10-22 09:12:47 +0200 fs  r277102 : CWS-TOOLING: rebase CWS dba32i to branches/OOO320 at 276942 (milestone: OOO320:m2)
    2009-10-21 21:13:02 +0200 fs  r277101 : module 'data' does not exist anymore (for a long time by now), so now need to list it here
    2009-10-21 13:35:35 +0200 fs  r277089 : #i105992#
    2009-10-21 13:17:51 +0200 fs  r277088 : reintroduced the fix for issue #i102090#, which got lost since 3.1.1, during one of the many merges/changes
    2009-10-21 13:06:55 +0200 fs  r277085 : #i105992# position the control in isPrimitiveVisible, not in get2DDecomposition. The latter might not be called in some situations, the former (hopefully) always is
    2009-10-20 07:35:27 +0200 oj  r277036 : #i106041# check the dispatch in impl_select not before
    2009-10-13 08:40:52 +0200 oj  r276843 : #i105825# throw exception when database was written by newer version
    2009-10-12 14:32:19 +0200 oj  r276834 : #i105724# check tDisplayCondition
    2009-10-12 13:24:28 +0200 fs  r276829 : #i105806# getPropertyValue: throw an UnknownPropertyException for, well, unknown properties
    2009-10-12 10:46:27 +0200 fs  r276821 : since tags
    2009-10-09 10:51:29 +0200 fs  r276800 : #i105712# re-introduce XUnoTunnel
    2009-10-09 10:46:48 +0200 oj  r276799 : #i105716# end chars with 0

diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx
index 022cddf..6b29afc 100644
--- a/dbaccess/source/core/dataaccess/ModelImpl.cxx
+++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx
@@ -1327,7 +1327,7 @@ void ODatabaseModelImpl::switchToURL( const ::rtl::OUString& _rDocumentLocation,
         if ( m_pDBContext )
         {
             if ( m_sDocumentURL.getLength() )
-                m_pDBContext->nameChangePrivate( m_sDocumentURL, _rDocumentURL );
+                m_pDBContext->nameChangePrivate( m_sName,m_sDocumentURL, _rDocumentURL );
             else
                 m_pDBContext->registerPrivate( _rDocumentURL, this );
         }
diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx
index d1e5e8c..a9bf765 100644
--- a/dbaccess/source/core/dataaccess/databasecontext.cxx
+++ b/dbaccess/source/core/dataaccess/databasecontext.cxx
@@ -766,11 +766,30 @@ void ODatabaseContext::deregisterPrivate(const ::rtl::OUString& _sName)
     m_aDatabaseObjects.erase(_sName);
 }
 // -----------------------------------------------------------------------------
-void ODatabaseContext::nameChangePrivate(const ::rtl::OUString& _sOldName, const ::rtl::OUString& _sNewName)
+void ODatabaseContext::nameChangePrivate(const ::rtl::OUString& _sRegisteredName,const ::rtl::OUString& _sOldName, const ::rtl::OUString& _sNewName)
 {
     ObjectCache::iterator aFind = m_aDatabaseObjects.find(_sOldName);
     registerPrivate(_sNewName,aFind->second);
     m_aDatabaseObjects.erase(aFind);
+    if ( _sRegisteredName != _sOldName )
+    {
+        OConfigurationTreeRoot aDbRegisteredNamesRoot = OConfigurationTreeRoot::createWithServiceFactory(
+                ::comphelper::getProcessServiceFactory(), getDbRegisteredNamesNodeName(), -1, OConfigurationTreeRoot::CM_UPDATABLE);
+
+        if ( aDbRegisteredNamesRoot.isValid() )
+        {
+            OConfigurationNode oDataSourceRegistration;
+            // the sub-node for the concrete registration
+            if (aDbRegisteredNamesRoot.hasByName(_sRegisteredName))
+            {
+                oDataSourceRegistration = aDbRegisteredNamesRoot.openNode(_sRegisteredName);
+
+                // set the values
+                oDataSourceRegistration.setNodeValue(getDbLocationNodeName(), makeAny(_sNewName));
+                aDbRegisteredNamesRoot.commit();
+            }
+        }
+    }
 }
 // -----------------------------------------------------------------------------
 sal_Int64 SAL_CALL ODatabaseContext::getSomething( const Sequence< sal_Int8 >& rId ) throw(RuntimeException)
diff --git a/dbaccess/source/core/dataaccess/databasecontext.hxx b/dbaccess/source/core/dataaccess/databasecontext.hxx
index 6457644..aa8b491 100644
--- a/dbaccess/source/core/dataaccess/databasecontext.hxx
+++ b/dbaccess/source/core/dataaccess/databasecontext.hxx
@@ -212,7 +212,7 @@ public:
     void registerPrivate(const ::rtl::OUString& _sName
                         ,const ::rtl::Reference<ODatabaseModelImpl>& _pModelImpl);
     void deregisterPrivate(const ::rtl::OUString& _sName);
-    void nameChangePrivate(const ::rtl::OUString& _sOldName, const ::rtl::OUString& _sNewName);
+    void nameChangePrivate(const ::rtl::OUString& _sRegisteredName,const ::rtl::OUString& _sOldName, const ::rtl::OUString& _sNewName);
     void storeTransientProperties( ODatabaseModelImpl& _rModelImpl);
     void appendAtTerminateListener(const ODatabaseModelImpl& _rDataSourceModel);
     void removeFromTerminateListener(const ODatabaseModelImpl& _rDataSourceModel);
diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx
index 46d7f92..351c75e 100644
--- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx
+++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx
@@ -584,7 +584,8 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(sal_Bool _bHasCat
     {
         xChartData->setData(uno::Sequence< uno::Sequence<double> >());
         xChartData->setColumnDescriptions(uno::Sequence< ::rtl::OUString >());
-        m_xInternal->deleteSequence(0);
+        if ( m_xInternal->hasDataByRangeRepresentation(::rtl::OUString::valueOf(sal_Int32(0))) )
+            m_xInternal->deleteSequence(0);
     }
 
     uno::Sequence< ::rtl::OUString > aColumns;
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index 2c926e9..bf5a00a 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -1385,6 +1385,9 @@ namespace
 
             // first extract the inner joins conditions
             GetInnerJoinCriteria(_pView,pNodeTmp);
+            // now simplify again, join are checked in ComparisonPredicate
+            ::connectivity::OSQLParseNode::absorptions(pNodeTmp);
+            pNodeTmp = pNode->getChild(1);
 
             // it could happen that pCondition is not more valid
             eErrorCode = GetORCriteria(_pView,_pSelectionBrw,pNodeTmp, rLevel);
@@ -1395,7 +1398,7 @@ namespace
     SqlParseError GetANDCriteria(	OQueryDesignView* _pView,
                                     OSelectionBrowseBox* _pSelectionBrw,
                                     const  ::connectivity::OSQLParseNode * pCondition,
-                                    const sal_uInt16 nLevel,
+                                    sal_uInt16& nLevel,
                                     sal_Bool bHaving,
                                     bool bAddOrOnOneLine);
     //------------------------------------------------------------------------------
@@ -1432,7 +1435,11 @@ namespace
                 if ( SQL_ISRULE(pChild,search_condition) )
                     eErrorCode = GetORCriteria(_pView,_pSelectionBrw,pChild,nLevel,bHaving,bAddOrOnOneLine);
                 else
-                    eErrorCode = GetANDCriteria(_pView,_pSelectionBrw,pChild, bAddOrOnOneLine ? nLevel : nLevel++,bHaving, i == 0 ? false : bAddOrOnOneLine);
+                {
+                    eErrorCode = GetANDCriteria(_pView,_pSelectionBrw,pChild, nLevel,bHaving, i == 0 ? false : bAddOrOnOneLine);
+                    if ( !bAddOrOnOneLine)
+                        nLevel++;
+                }
             }
         }
         else
@@ -1466,7 +1473,7 @@ namespace
     SqlParseError GetANDCriteria(	OQueryDesignView* _pView,
                                     OSelectionBrowseBox* _pSelectionBrw,
                                     const  ::connectivity::OSQLParseNode * pCondition,
-                                    const sal_uInt16 nLevel,
+                                    sal_uInt16& nLevel,
                                     sal_Bool bHaving,
                                     bool bAddOrOnOneLine)
     {
@@ -1480,10 +1487,18 @@ namespace
         // Runde Klammern
         if (SQL_ISRULE(pCondition,boolean_primary))
         {
-            sal_uInt16 nLevel2 = nLevel;
             // check if we have to put the or criteria on one line.
-            bool bMustAddOrOnOneLine = CheckOrCriteria(pCondition->getChild(1),NULL);
-            eErrorCode = GetORCriteria(_pView,_pSelectionBrw,pCondition->getChild(1), nLevel2,bHaving,bMustAddOrOnOneLine );
+            const  ::connectivity::OSQLParseNode* pSearchCondition = pCondition->getChild(1);
+            bool bMustAddOrOnOneLine = CheckOrCriteria(pSearchCondition,NULL);
+            if ( SQL_ISRULE( pSearchCondition, search_condition) ) // we have a or
+            {
+                _pSelectionBrw->DuplicateConditionLevel( nLevel);
+                eErrorCode = GetORCriteria(_pView,_pSelectionBrw,pSearchCondition->getChild(0), nLevel,bHaving,bMustAddOrOnOneLine );				
+                ++nLevel;
+                eErrorCode = GetORCriteria(_pView,_pSelectionBrw,pSearchCondition->getChild(2), nLevel,bHaving,bMustAddOrOnOneLine );
+            }
+            else
+                eErrorCode = GetORCriteria(_pView,_pSelectionBrw,pSearchCondition, nLevel,bHaving,bMustAddOrOnOneLine );
         }
         // Das erste Element ist (wieder) eine AND-Verknuepfung
         else if ( SQL_ISRULE(pCondition,boolean_term) )
@@ -1579,10 +1594,32 @@ namespace
                     _pSelectionBrw->AddCondition(aDragLeft, sCondition, nLevel,bAddOrOnOneLine);
                 }
             }
+            else
+            {
+                // Funktions-Bedingung parsen
+                ::rtl::OUString	sCondition = ParseCondition(rController,pCondition,sDecimal,aLocale,1);
+                Reference< XConnection> xConnection = rController.getConnection();
+                Reference< XDatabaseMetaData >  xMetaData = xConnection->getMetaData();
+                    // the international doesn't matter I have a string
+                ::rtl::OUString sName;
+                pCondition->getChild(0)->parseNodeToPredicateStr(sName,
+                                                    xConnection,
+                                                    rController.getNumberFormatter(),
+                                                    aLocale,
+                                                    static_cast<sal_Char>(sDecimal.toChar()),
+                                                    &rController.getParser().getContext());
+
+                OTableFieldDescRef aDragLeft = new OTableFieldDesc();
+                aDragLeft->SetField(sName);
+                aDragLeft->SetFunctionType(FKT_OTHER);
+
+                if ( bHaving )
+                    aDragLeft->SetGroupBy(sal_True);
+                _pSelectionBrw->AddCondition(aDragLeft, sCondition, nLevel,bAddOrOnOneLine);
+            }
         }
         else if( SQL_ISRULEOR2(pCondition,existence_test,unique_test) )
         {
-            
             // Funktions-Bedingung parsen
             ::rtl::OUString	aCondition = ParseCondition(rController,pCondition,sDecimal,aLocale,0);
 
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index c1f8f16..f9e9cea 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -1836,6 +1836,32 @@ void OSelectionBrowseBox::AddGroupBy( const OTableFieldDescRef& rInfo , sal_uInt
     }
 }
 //------------------------------------------------------------------------------
+void OSelectionBrowseBox::DuplicateConditionLevel( const sal_uInt16 nLevel)
+{
+    DBG_CHKTHIS(OSelectionBrowseBox,NULL);
+    const sal_uInt16 nNewLevel = nLevel +1;
+    OTableFields& rFields = getFields();
+    OTableFields::iterator aIter = rFields.begin();
+    OTableFields::iterator aEnd = rFields.end();
+    for(;aIter != aEnd;++aIter)
+    {
+        OTableFieldDescRef pEntry = *aIter;
+
+        ::rtl::OUString sValue = pEntry->GetCriteria(nLevel);
+        if ( sValue.getLength() )
+        {
+            pEntry->SetCriteria( nNewLevel, sValue);
+            if ( nNewLevel == (m_nVisibleCount-BROW_CRIT1_ROW-1) )
+            {
+                RowInserted( GetRowCount()-1, 1, TRUE );
+                m_bVisibleRow.push_back(sal_True);
+                ++m_nVisibleCount;
+            }
+            m_bVisibleRow[BROW_CRIT1_ROW + nNewLevel] = sal_True;
+        } // if (!pEntry->GetCriteria(nLevel).getLength() )
+    } // for(;aIter != getFields().end();++aIter)
+}
+//------------------------------------------------------------------------------
 void OSelectionBrowseBox::AddCondition( const OTableFieldDescRef& rInfo, const String& rValue, const sal_uInt16 nLevel,bool _bAddOrOnOneLine )
 {
     Reference< XConnection> xConnection = static_cast<OQueryController&>(getDesignView()->getController()).getConnection();
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx
index fcc9a53..ff73a8c 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx
@@ -132,6 +132,7 @@ namespace dbaui
                                                   const String& rValue,
                                                   const sal_uInt16 nLevel,
                                                   bool _bAddOrOnOneLine  );
+        void						DuplicateConditionLevel( const sal_uInt16 nLevel);
         void						AddOrder(const OTableFieldDescRef& rInfo, const EOrderDir eDir, sal_uInt32 _nCurrentPos);
         void						ClearAll();
         OTableFieldDescRef			AppendNewCol( sal_uInt16 nCnt=1 );
diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
index 6d6ba06..da720d0 100644
--- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
@@ -122,6 +122,9 @@ void SAL_CALL ImportDocumentHandler::startDocument() throw (uno::RuntimeExceptio
 void SAL_CALL ImportDocumentHandler::endDocument() throw (uno::RuntimeException, xml::sax::SAXException)
 {
     m_xDelegatee->endDocument();
+    uno::Reference< chart2::data::XDataReceiver > xReceiver(m_xModel,uno::UNO_QUERY_THROW);
+    if ( xReceiver.is() )
+        xReceiver->attachDataProvider(m_xDatabaseDataProvider.get());
 }
 
 void SAL_CALL ImportDocumentHandler::startElement(const ::rtl::OUString & _sName, const uno::Reference< xml::sax::XAttributeList > & _xAttrList) throw (uno::RuntimeException, xml::sax::SAXException)


More information about the ooo-build-commit mailing list