[Libreoffice-commits] core.git: 2 commits - dbaccess/source sc/source

Caolán McNamara caolanm at redhat.com
Mon Sep 22 02:24:32 PDT 2014


 dbaccess/source/core/api/SingleSelectQueryComposer.cxx       |   48 +++++++++--
 sc/source/ui/Accessibility/AccessibleDocument.cxx            |   19 ++--
 sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx |   19 ++--
 3 files changed, 65 insertions(+), 21 deletions(-)

New commits:
commit b66dc3cd84c7031a0df75e9d782edebbaca6fdf1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Sep 22 09:50:10 2014 +0100

    WaE: -Wodr, two different ScVisAreaChanged classes
    
    Change-Id: I036632dcc7a91eb43aac2bdc2dee7e3355227f24

diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index 17fee2a..4c66e03 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -1377,18 +1377,21 @@ sal_Int8 ScChildrenShapes::Compare(const ScAccessibleShapeData* pData1,
     return nResult;
 }
 
-struct ScVisAreaChanged
+namespace
 {
-    ScAccessibleDocument* mpAccDoc;
-    ScVisAreaChanged(ScAccessibleDocument* pAccDoc) : mpAccDoc(pAccDoc) {}
-    void operator() (const ScAccessibleShapeData* pAccShapeData) const
+    struct ScVisAreaChanged
     {
-        if (pAccShapeData && pAccShapeData->pAccShape)
+        ScAccessibleDocument* mpAccDoc;
+        ScVisAreaChanged(ScAccessibleDocument* pAccDoc) : mpAccDoc(pAccDoc) {}
+        void operator() (const ScAccessibleShapeData* pAccShapeData) const
         {
-            pAccShapeData->pAccShape->ViewForwarderChanged(::accessibility::IAccessibleViewForwarderListener::VISIBLE_AREA, mpAccDoc);
+            if (pAccShapeData && pAccShapeData->pAccShape)
+            {
+                pAccShapeData->pAccShape->ViewForwarderChanged(::accessibility::IAccessibleViewForwarderListener::VISIBLE_AREA, mpAccDoc);
+            }
         }
-    }
-};
+    };
+}
 
 void ScChildrenShapes::VisAreaChanged() const
 {
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
index d4d7251..bd2c99c 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
@@ -846,18 +846,21 @@ void ScShapeChildren::DataChanged()
     }
 }
 
-struct ScVisAreaChanged
+namespace
 {
-    const ScIAccessibleViewForwarder* mpViewForwarder;
-    ScVisAreaChanged(const ScIAccessibleViewForwarder* pViewForwarder) : mpViewForwarder(pViewForwarder) {}
-    void operator() (const ScShapeChild& rAccShapeData) const
+    struct ScVisAreaChanged
     {
-        if (rAccShapeData.mpAccShape)
+        const ScIAccessibleViewForwarder* mpViewForwarder;
+        ScVisAreaChanged(const ScIAccessibleViewForwarder* pViewForwarder) : mpViewForwarder(pViewForwarder) {}
+        void operator() (const ScShapeChild& rAccShapeData) const
         {
-            rAccShapeData.mpAccShape->ViewForwarderChanged(::accessibility::IAccessibleViewForwarderListener::VISIBLE_AREA, mpViewForwarder);
+            if (rAccShapeData.mpAccShape)
+            {
+                rAccShapeData.mpAccShape->ViewForwarderChanged(::accessibility::IAccessibleViewForwarderListener::VISIBLE_AREA, mpViewForwarder);
+            }
         }
-    }
-};
+    };
+}
 
 void ScShapeChildren::VisAreaChanged() const
 {
commit 32b46b74f2c45e1dff3530162ddb207527574026
Author: Kay Schenk <kschenk at apache.org>
Date:   Thu Sep 18 22:49:12 2014 +0000

    Resolves: #i121492# Base can not filter by dates
    
    Patch by: hanya
    Fixed date filter problems in table view. Now processes old style date format
    and "normal" for database as expected.
    
    (cherry picked from commit 79ff7fc76c74a012933230d6f3c37977eccc6398)
    
    Conflicts:
    	dbaccess/source/core/api/SingleSelectQueryComposer.cxx
    
    Change-Id: I2ae1b50b9e85ff2c543aaea90894a7edd5bc7524

diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
index fbc8031..7b91232 100644
--- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
+++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
@@ -1452,7 +1452,44 @@ OUString OSingleSelectQueryComposer::getStatementPart( TGetParseNode& _aGetFunct
 
 namespace
 {
-    OUString lcl_getCondition(const Sequence< Sequence< PropertyValue > >& filter,const OPredicateInputController& i_aPredicateInputController,const Reference< XNameAccess >& i_xSelectColumns)
+    OUString lcl_getDecomposedColumnName(const OUString& rComposedName, const OUString& rQuoteString)
+    {
+        const sal_Int32 nQuoteLength = rQuoteString.getLength();
+        OUString sName = rComposedName.trim();
+        OUString sColumnName;
+        sal_Int32 nPos, nRPos = 0;
+
+        for (;;)
+        {
+            nPos = sName.indexOf( rQuoteString, nRPos );
+            if ( nPos >= 0 )
+            {
+                nRPos = sName.indexOf( rQuoteString, nPos + nQuoteLength );
+                if ( nRPos > nPos )
+                {
+                    if ( nRPos + nQuoteLength < sName.getLength() )
+                    {
+                        nRPos += nQuoteLength; // -1 + 1 skip dot
+                    }
+                    else
+                    {
+                        sColumnName = sName.copy( nPos + nQuoteLength, nRPos - nPos - nQuoteLength );
+                        break;
+                    }
+                }
+                else
+                    break;
+            }
+            else
+                break;
+        }
+        return sColumnName.isEmpty() ? rComposedName : sColumnName;
+    }
+
+    OUString lcl_getCondition(const Sequence< Sequence< PropertyValue > >& filter,
+        const OPredicateInputController& i_aPredicateInputController,
+        const Reference< XNameAccess >& i_xSelectColumns,
+        const OUString& rQuoteString)
     {
         OUStringBuffer sRet;
         const Sequence< PropertyValue >* pOrIter = filter.getConstArray();
@@ -1469,9 +1506,10 @@ namespace
                     sRet.append(pAndIter->Name);
                     OUString sValue;
                     pAndIter->Value >>= sValue;
-                    if ( i_xSelectColumns.is() && i_xSelectColumns->hasByName(pAndIter->Name) )
+                    const OUString sColumnName = lcl_getDecomposedColumnName( pAndIter->Name, rQuoteString );
+                    if ( i_xSelectColumns.is() && i_xSelectColumns->hasByName(sColumnName) )
                     {
-                        Reference<XPropertySet> xColumn(i_xSelectColumns->getByName(pAndIter->Name),UNO_QUERY);
+                        Reference<XPropertySet> xColumn(i_xSelectColumns->getByName(sColumnName),UNO_QUERY);
                         sValue = i_aPredicateInputController.getPredicateValue(sValue,xColumn,true);
                     }
                     else
@@ -1496,13 +1534,13 @@ namespace
 void SAL_CALL OSingleSelectQueryComposer::setStructuredFilter( const Sequence< Sequence< PropertyValue > >& filter ) throw (SQLException, ::com::sun::star::lang::IllegalArgumentException, RuntimeException, std::exception)
 {
     OPredicateInputController aPredicateInput(m_aContext, m_xConnection, &m_aParseContext);
-    setFilter(lcl_getCondition(filter,aPredicateInput,getColumns()));
+    setFilter(lcl_getCondition(filter, aPredicateInput, getColumns(), m_xMetaData->getIdentifierQuoteString()));
 }
 
 void SAL_CALL OSingleSelectQueryComposer::setStructuredHavingClause( const Sequence< Sequence< PropertyValue > >& filter ) throw (SQLException, RuntimeException, std::exception)
 {
     OPredicateInputController aPredicateInput(m_aContext, m_xConnection);
-    setHavingClause(lcl_getCondition(filter,aPredicateInput,getColumns()));
+    setHavingClause(lcl_getCondition(filter, aPredicateInput, getColumns(), m_xMetaData->getIdentifierQuoteString()));
 }
 
 void OSingleSelectQueryComposer::setConditionByColumn( const Reference< XPropertySet >& column, bool andCriteria ,::std::mem_fun1_t<bool,OSingleSelectQueryComposer,const OUString& >& _aSetFunctor,sal_Int32 filterOperator)


More information about the Libreoffice-commits mailing list