[Libreoffice-commits] core.git: Branch 'feature/gsoc-calc-enhanced-db-range' - 4 commits - boost/boost_1_44_0-gcc4.8.patch sc/inc sc/source

Markus Mohrhard markus.mohrhard at googlemail.com
Tue Jul 9 06:49:30 PDT 2013


 boost/boost_1_44_0-gcc4.8.patch         |  209 ++++++++++++++++++++++++++++++++
 sc/inc/dbdata.hxx                       |    1 
 sc/source/core/tool/dbdata.cxx          |    5 
 sc/source/filter/oox/stylesbuffer.cxx   |   32 +++-
 sc/source/filter/oox/tablebuffer.cxx    |   10 +
 sc/source/filter/oox/workbookhelper.cxx |    6 
 6 files changed, 245 insertions(+), 18 deletions(-)

New commits:
commit 95fb57ec625a186a3b21c95f0eed63528e098b15
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Jul 9 15:43:48 2013 +0200

    not every db range contains db formattings
    
    Change-Id: I13a54110bfa625d6495bcef36e93aa76d11fb99c

diff --git a/sc/source/filter/oox/tablebuffer.cxx b/sc/source/filter/oox/tablebuffer.cxx
index 0fa9e03..b2c437e 100644
--- a/sc/source/filter/oox/tablebuffer.cxx
+++ b/sc/source/filter/oox/tablebuffer.cxx
@@ -110,9 +110,15 @@ void Table::finalizeImport()
         maAutoFilters.finalizeImport( xDatabaseRange );
 
         //Setting the ScDBDataFormatting (Table style) attribute.
-        ScDBDataFormatting aTableFormatting = getStyles().getTableStyle( maModel.maTableStyleName )->getTableFormatting(); //May fail in cases of malformed corrupt table/table#.xml where the maTableStyleName is messed up
+        TableStyleRef pTableStyle = getStyles().getTableStyle( maModel.maTableStyleName );
+        if(!pTableStyle)
+        {
+            SAL_WARN("sc", "did not find Table style for: " << maModel.maTableStyleName);
+            return;
+        }
+
+        ScDBDataFormatting aTableFormatting = pTableStyle->getTableFormatting();
 
-        //can mess up if aTableFormatting is nothing. Need to handle that
         aTableFormatting.SetBandedRows( maModel.mbShowRowStripes );
         aTableFormatting.SetBandedColumns( maModel.mbShowColumnStripes );
         addDatabaseFormatting( maDBRangeName, aTableFormatting );
commit 41b3dd9ba318f80c5cf6c345f49e376ad3a8c0d3
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Jul 8 21:59:27 2013 +0200

    use a functor and standard algorithms
    
    Change-Id: I0cb7b603b4495d78e217153fb0339a5ba2b71157

diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx
index 502ceb7..b2870e7 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -77,6 +77,8 @@
 #include "globstr.hrc"
 #include "xlconst.hxx"
 
+#include <algorithm>
+
 using ::com::sun::star::table::BorderLine2;
 namespace oox {
 namespace xls {
@@ -3454,19 +3456,35 @@ void StylesBuffer::writeStyleXfToPropertySet( PropertySet& rPropSet, sal_Int32 n
         pXf->writeToPropertySet( rPropSet );
 }
 
-TableStyleRef StylesBuffer::getTableStyle( OUString& rTableStyleName )
+namespace {
+
+struct FindTableStyleByName
 {
-    for( ::std::vector< TableStyleRef >::iterator i = maTableStyles.begin(); i < maTableStyles.end(); ++i)
+    FindTableStyleByName( const OUString& rName ):
+        mrName(rName) {}
+
+    bool operator()(const TableStyleRef& pStyle)
     {
-        if( ((*i)->getTableStyleName() ).equals(rTableStyleName) )
-        {
-            return(*i);
-        }
+        return mrName == pStyle->getTableStyleName();
     }
+
+private:
+    const OUString& mrName;
+};
+
+}
+
+TableStyleRef StylesBuffer::getTableStyle( OUString& rTableStyleName )
+{
+    std::vector< TableStyleRef >::const_iterator itr = std::find_if(
+            maTableStyles.begin(), maTableStyles.end(), FindTableStyleByName(rTableStyleName));
+
+    if(itr != maTableStyles.end())
+        return *itr;
+
     return 0;
 }
 
-// ============================================================================
 
 } // namespace xls
 } // namespace oox
commit 8e1de4067e69d67713094dcc80343c8559c1184b
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Jul 8 21:45:05 2013 +0200

    we don't need this function
    
    actually the code was a bit wrong and was internally using the upper
    case search without converting the name to uppercase
    
    Change-Id: I3d7252cfc5022458be860613881bbeb9771a16cb

diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx
index 4c410bb..a16e11f 100644
--- a/sc/inc/dbdata.hxx
+++ b/sc/inc/dbdata.hxx
@@ -237,7 +237,6 @@ public:
     const ScDBData* GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const;
     ScDBData* GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
     ScDBData* GetDBNearCursor(SCCOL nCol, SCROW nRow, SCTAB nTab );
-    ScDBData* GetDBByName( const OUString& rName );
 
     void    DeleteOnTab( SCTAB nTab );
     void    UpdateReference(UpdateRefMode eUpdateRefMode,
diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
index 0190237..33aece7 100644
--- a/sc/source/core/tool/dbdata.cxx
+++ b/sc/source/core/tool/dbdata.cxx
@@ -923,11 +923,6 @@ ScDBData* ScDBCollection::GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCO
     return NULL;
 }
 
-ScDBData* ScDBCollection::GetDBByName( const OUString& rName )
-{
-   return maNamedDBs.findByUpperName( rName );
-}
-
 void ScDBCollection::DeleteOnTab( SCTAB nTab )
 {
     FindByTable func(nTab);
diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index 2091329..cedccd5 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -465,9 +465,9 @@ Reference< XDatabaseRange > WorkbookGlobals::createDatabaseRangeObject( OUString
 
 void WorkbookGlobals::addDatabaseFormatting( const OUString& rName, const ScDBDataFormatting& rDBDataFormatting )
 {
-    //Is such smartness allowed? Or should catch objects and then call for each method call?
-    ScDBData* pDBRange = getScDocument().GetDBCollection()->GetDBByName( rName );
-    if( pDBRange != NULL )
+    ScDBData* pDBRange = getScDocument().GetDBCollection()->getNamedDBs().findByUpperName(
+            ScGlobal::pCharClass->uppercase(rName) );
+    if( pDBRange )
         pDBRange->SetTableFormatting( rDBDataFormatting );
 }
 
commit 4ba1dd8f0acc724d70b1bbfccef6fc2fe0b407fe
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri May 31 14:08:02 2013 +0200

    boost: patch various -Werror=unused-local-typedefs
    
    Change-Id: Ibf37c17c741fb1844ec9e301a3cc63a3bb3f48de

diff --git a/boost/boost_1_44_0-gcc4.8.patch b/boost/boost_1_44_0-gcc4.8.patch
index f5bb0da..891f70c 100644
--- a/boost/boost_1_44_0-gcc4.8.patch
+++ b/boost/boost_1_44_0-gcc4.8.patch
@@ -1,3 +1,212 @@
+
+
+--- a/b/boost/boost/math/special_functions/gamma.hpp	2013-05-31 18:09:38.509792503 +0200
++++ a/b/boost/boost/math/special_functions/gamma.hpp	2013-05-31 18:09:41.438795355 +0200
+@@ -1360,7 +1360,6 @@
+    BOOST_FPU_EXCEPTION_GUARD
+    typedef typename tools::promote_args<T1, T2>::type result_type;
+    typedef typename policies::evaluation<result_type, Policy>::type value_type;
+-   typedef typename lanczos::lanczos<value_type, Policy>::type evaluation_type;
+    typedef typename policies::normalise<
+       Policy, 
+       policies::promote_float<false>, 
+@@ -1489,7 +1488,6 @@
+    BOOST_FPU_EXCEPTION_GUARD
+    typedef typename tools::promote_args<T1, T2>::type result_type;
+    typedef typename policies::evaluation<result_type, Policy>::type value_type;
+-   typedef typename lanczos::lanczos<value_type, Policy>::type evaluation_type;
+    typedef typename policies::normalise<
+       Policy, 
+       policies::promote_float<false>, 
+@@ -1520,7 +1518,6 @@
+    BOOST_FPU_EXCEPTION_GUARD
+    typedef typename tools::promote_args<T1, T2>::type result_type;
+    typedef typename policies::evaluation<result_type, Policy>::type value_type;
+-   typedef typename lanczos::lanczos<value_type, Policy>::type evaluation_type;
+    typedef typename policies::normalise<
+       Policy, 
+       policies::promote_float<false>, 
+@@ -1551,7 +1548,6 @@
+    BOOST_FPU_EXCEPTION_GUARD
+    typedef typename tools::promote_args<T1, T2>::type result_type;
+    typedef typename policies::evaluation<result_type, Policy>::type value_type;
+-   typedef typename lanczos::lanczos<value_type, Policy>::type evaluation_type;
+    typedef typename policies::normalise<
+       Policy, 
+       policies::promote_float<false>, 
+--- a/b/boost/boost/math/special_functions/detail/igamma_inverse.hpp	2013-05-31 18:11:23.420936359 +0200
++++ a/b/boost/boost/math/special_functions/detail/igamma_inverse.hpp	2013-05-31 18:11:24.772938706 +0200
+@@ -341,7 +341,6 @@
+       // flag is set, then Q(x) - q and it's derivatives.
+       //
+       typedef typename policies::evaluation<T, Policy>::type value_type;
+-      typedef typename lanczos::lanczos<T, Policy>::type evaluation_type;
+       typedef typename policies::normalise<
+          Policy, 
+          policies::promote_float<false>, 
+--- a/b/boost/boost/math/special_functions/beta.hpp	2013-05-31 18:12:02.036007347 +0200
++++ a/b/boost/boost/math/special_functions/beta.hpp	2013-05-31 18:11:56.260996218 +0200
+@@ -1331,7 +1331,6 @@
+    BOOST_FPU_EXCEPTION_GUARD
+    typedef typename tools::promote_args<RT1, RT2, RT3>::type result_type;
+    typedef typename policies::evaluation<result_type, Policy>::type value_type;
+-   typedef typename lanczos::lanczos<value_type, Policy>::type evaluation_type;
+    typedef typename policies::normalise<
+       Policy, 
+       policies::promote_float<false>, 
+@@ -1349,7 +1348,6 @@
+    BOOST_FPU_EXCEPTION_GUARD
+    typedef typename tools::promote_args<RT1, RT2, RT3>::type result_type;
+    typedef typename policies::evaluation<result_type, Policy>::type value_type;
+-   typedef typename lanczos::lanczos<value_type, Policy>::type evaluation_type;
+    typedef typename policies::normalise<
+       Policy, 
+       policies::promote_float<false>, 
+--- a/b/boost/boost/random/generate_canonical.hpp	2013-05-31 18:13:09.804149686 +0200
++++ a/b/boost/boost/random/generate_canonical.hpp	2013-05-31 18:13:30.020195845 +0200
+@@ -55,7 +55,6 @@
+     using std::floor;
+     BOOST_ASSERT((g.min)() == 0);
+     BOOST_ASSERT((g.max)() == 1);
+-    typedef typename URNG::result_type base_result;
+     std::size_t digits = std::numeric_limits<RealType>::digits;
+     std::size_t engine_bits = detail::generator_bits<URNG>::value();
+     std::size_t b = (std::min)(bits, digits);
+--- a/b/boost/boost/random/uniform_real_distribution.hpp	2013-05-31 18:15:04.571429634 +0200
++++ a/b/boost/boost/random/uniform_real_distribution.hpp	2013-05-31 18:14:28.452337186 +0200
+@@ -36,7 +36,6 @@
+ {
+     for(;;) {
+         typedef T result_type;
+-        typedef typename Engine::result_type base_result;
+         result_type numerator = static_cast<T>(eng() - (eng.min)());
+         result_type divisor = static_cast<T>((eng.max)() - (eng.min)());
+         BOOST_ASSERT(divisor > 0);
+--- a/b/boost/boost/lexical_cast.hpp	2013-05-31 13:52:39.758500819 +0200
++++ a/b/boost/boost/lexical_cast.hpp	2013-05-31 13:52:43.927514850 +0200
+@@ -865,7 +865,6 @@
+ #ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+             BOOST_STATIC_ASSERT(!std::numeric_limits<T>::is_signed);
+ #endif
+-            typedef typename Traits::int_type int_type;
+             CharT const czero = lcast_char_constants<CharT>::zero;
+             --end;
+             value = 0;
+--- a/b/boost/boost/math/special_functions/sign.hpp	2013-05-31 13:53:52.518746080 +0200
++++ a/b/boost/boost/math/special_functions/sign.hpp	2013-05-31 13:59:08.053810037 +0200
+@@ -110,7 +110,6 @@
+ { 
+    typedef typename detail::fp_traits<T>::type traits;
+    typedef typename traits::method method;
+-   typedef typename boost::is_floating_point<T>::type fp_tag;
+    return detail::signbit_impl(x, method());
+ }
+ 
+@@ -124,7 +123,6 @@
+ { //!< \brief return unchanged binary pattern of x, except for change of sign bit. 
+    typedef typename detail::fp_traits<T>::sign_change_type traits;
+    typedef typename traits::method method;
+-   typedef typename boost::is_floating_point<T>::type fp_tag;
+ 
+    return detail::changesign_impl(x, method());
+ }
+--- a/b/boost/boost/math/special_functions/fpclassify.hpp	2013-05-31 14:02:13.660436127 +0200
++++ a/b/boost/boost/math/special_functions/fpclassify.hpp	2013-05-31 14:01:17.372246240 +0200
+@@ -328,7 +328,6 @@
+ { //!< \brief return true if floating-point type t is finite.
+    typedef typename detail::fp_traits<T>::type traits;
+    typedef typename traits::method method;
+-   typedef typename boost::is_floating_point<T>::type fp_tag;
+    typedef typename tools::promote_args<T>::type value_type;
+    return detail::isfinite_impl(static_cast<value_type>(x), method());
+ }
+@@ -339,7 +338,6 @@
+ { //!< \brief return true if floating-point type t is finite.
+    typedef detail::fp_traits<long double>::type traits;
+    typedef traits::method method;
+-   typedef boost::is_floating_point<long double>::type fp_tag;
+    typedef long double value_type;
+    return detail::isfinite_impl(static_cast<value_type>(x), method());
+ }
+@@ -399,7 +397,6 @@
+ {
+    typedef typename detail::fp_traits<T>::type traits;
+    typedef typename traits::method method;
+-   typedef typename boost::is_floating_point<T>::type fp_tag;
+    typedef typename tools::promote_args<T>::type value_type;
+    return detail::isnormal_impl(static_cast<value_type>(x), method());
+ }
+@@ -410,7 +407,6 @@
+ {
+    typedef detail::fp_traits<long double>::type traits;
+    typedef traits::method method;
+-   typedef boost::is_floating_point<long double>::type fp_tag;
+    typedef long double value_type;
+    return detail::isnormal_impl(static_cast<value_type>(x), method());
+ }
+@@ -488,7 +484,6 @@
+ {
+    typedef typename detail::fp_traits<T>::type traits;
+    typedef typename traits::method method;
+-   typedef typename boost::is_floating_point<T>::type fp_tag;
+    typedef typename tools::promote_args<T>::type value_type;
+    return detail::isinf_impl(static_cast<value_type>(x), method());
+ }
+@@ -499,7 +494,6 @@
+ {
+    typedef detail::fp_traits<long double>::type traits;
+    typedef traits::method method;
+-   typedef boost::is_floating_point<long double>::type fp_tag;
+    typedef long double value_type;
+    return detail::isinf_impl(static_cast<value_type>(x), method());
+ }
+@@ -571,7 +565,6 @@
+ { //!< \brief return true if floating-point type t is NaN (Not A Number).
+    typedef typename detail::fp_traits<T>::type traits;
+    typedef typename traits::method method;
+-   typedef typename boost::is_floating_point<T>::type fp_tag;
+    return detail::isnan_impl(x, method());
+ }
+ 
+@@ -585,7 +578,6 @@
+ { //!< \brief return true if floating-point type t is NaN (Not A Number).
+    typedef detail::fp_traits<long double>::type traits;
+    typedef traits::method method;
+-   typedef boost::is_floating_point<long double>::type fp_tag;
+    return detail::isnan_impl(x, method());
+ }
+ #endif
+--- a/b/boost/boost/date_time/gregorian/greg_facet.hpp	2013-05-31 14:03:30.476695310 +0200
++++ a/b/boost/boost/date_time/gregorian/greg_facet.hpp	2013-05-31 14:03:22.894669713 +0200
+@@ -215,7 +215,6 @@
+   {
+     std::istream_iterator<std::basic_string<charT>, charT> beg(is), eos;
+     
+-    typedef boost::date_time::all_date_names_put<greg_facet_config, charT> facet_def;
+     d = from_stream(beg, eos);
+     return is;
+   }
+--- a/b/boost/boost/unordered/detail/unique.hpp	2013-05-31 13:32:51.122254361 +0200
++++ a/b/boost/boost/unordered/detail/unique.hpp	2013-05-31 13:32:57.578278121 +0200
+@@ -334,8 +334,6 @@
+ 
+         value_type& operator[](key_type const& k)
+         {
+-            typedef typename value_type::second_type mapped_type;
+-    
+             std::size_t key_hash = this->hash(k);
+             iterator pos = this->find_node(key_hash, k);
+     
+--- a/b/boost/boost/tuple/detail/tuple_basic.hpp	2013-05-31 13:31:21.682966336 +0200
++++ a/b/boost/boost/tuple/detail/tuple_basic.hpp	2013-05-31 13:32:44.067231648 +0200
+@@ -225,7 +225,6 @@
+ get(const cons<HT, TT>& c BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int, N)) {
+   typedef BOOST_DEDUCED_TYPENAME detail::drop_front<N>::BOOST_NESTED_TEMPLATE
+       apply<cons<HT, TT> > impl;
+-  typedef BOOST_DEDUCED_TYPENAME impl::type cons_element;
+   return impl::call(c).head;
+ }
+ 
 --- misc/boost_1_44_0/boost/algorithm/string/detail/finder.hpp
 +++ misc/build/boost_1_44_0/boost/algorithm/string/detail/finder.hpp
 @@ -142,7 +142,6 @@


More information about the Libreoffice-commits mailing list