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

2013-12-13 Thread Julien Nabet
 connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx |2 +-
 sc/source/ui/app/scmod.cxx  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d67684f62fc99dd25fb46ddb547e8ff4345d0970
Author: Julien Nabet 
Date:   Sat Dec 14 00:01:59 2013 +0100

cppcheck: fix same expression, no need to cast twice

Change-Id: I08a68071db45ee79491558dd88e723dcdf0d24d5

diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index dfeeba9..f31cc57 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -1123,7 +1123,7 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
 
 if ( rOptSet.HasItem(SID_ATTR_GRID_OPTIONS,&pItem) )
 {
-ScGridOptions aNewGridOpt( (const SvxOptionsGrid&)((const 
SvxGridItem&)*pItem) );
+ScGridOptions aNewGridOpt( (const SvxGridItem&)*pItem) );
 
 if ( pViewSh )
 {
commit ffbde4e6a6ead7efdd65aa6bd31e9ea55f9c637e
Author: Julien Nabet 
Date:   Fri Dec 13 23:53:29 2013 +0100

cppcheck: fix same expression

!pSchemaPat->isEmpty() checked twice where line before we test if aPKQ is 
empty
so it seemed quite logical to test aPKO here

Change-Id: I79d7ec89f7ae67520492bbd4121a4a86918f2fbf

diff --git 
a/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx 
b/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx
index 2e772fc..f7af806 100644
--- a/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx
@@ -999,7 +999,7 @@ void ODatabaseMetaDataResultSet::openColumns(   const Any& 
catalog,
 aCOL = OUStringToOString(columnNamePattern,m_nTextEncoding);
 
 const char  *pPKQ = catalog.hasValue() && !aPKQ.isEmpty() ? aPKQ.getStr()  
: NULL,
-*pPKO = pSchemaPat && !pSchemaPat->isEmpty() && 
!pSchemaPat->isEmpty() ? aPKO.getStr() : NULL,
+*pPKO = pSchemaPat && !pSchemaPat->isEmpty() && 
!aPKO.isEmpty() ? aPKO.getStr() : NULL,
 *pPKN = aPKN.getStr(),
 *pCOL = aCOL.getStr();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-04-18 Thread Lionel Elie Mamane
 connectivity/source/drivers/kab/KResultSet.cxx |   20 ++--
 sc/source/filter/orcus/interface.cxx   |   12 ++--
 2 files changed, 16 insertions(+), 16 deletions(-)

New commits:
commit 202d45cff25492bb4d7f550df5c368af097d2e0c
Author: Lionel Elie Mamane 
Date:   Fri Apr 19 07:14:48 2013 +0200

date/time IDL datatypes incompatible change: fixup

Change-Id: I3733deac232d0075bdd889ce52d7e6f67746d4f8

diff --git a/sc/source/filter/orcus/interface.cxx 
b/sc/source/filter/orcus/interface.cxx
index e67c915..a32842c 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -224,17 +224,17 @@ void ScOrcusSheet::set_date_time(
 SvNumberFormatter* pFormatter = mrDoc.getDoc().GetFormatTable();
 
 Date aDate(day, month, year);
-sal_uIntPtr nSec = floor(second);
-sal_uIntPtr nSec100 = (second - nSec) * 100;
-Time aTime(hour, minute, nSec, nSec100);
+sal_uInt32 nSec = floor(second);
+sal_uInt32 nNanoSec = (second - nSec) * ::Time::nanoSecPerSec;
+Time aTime(hour, minute, nSec, nNanoSec);
 Date aNullDate(*pFormatter->GetNullDate());
 long nDateDiff = aDate - aNullDate;
 
 double fTime =
-static_cast(aTime.GetNanoSec()) / 1e9 +
+static_cast(aTime.GetNanoSec()) / ::Time::nanoSecPerSec +
 aTime.GetSec() +
-aTime.GetMin() * 60.0 +
-aTime.GetHour() * 3600.0;
+aTime.GetMin() * ::Time::secondPerMinute +
+aTime.GetHour() * ::Time::secondPerHour;
 
 fTime /= DATE_TIME_FACTOR;
 
commit 81cf58f191f57b3cfad08f5c7d622b30f7fc72d9
Author: Lionel Elie Mamane 
Date:   Fri Apr 19 07:14:23 2013 +0200

date/time IDL datatypes incompatible change: fixup

Change-Id: Ib750a009e49e19d63f8b6df85947a7b5c9b75bcf

diff --git a/connectivity/source/drivers/kab/KResultSet.cxx 
b/connectivity/source/drivers/kab/KResultSet.cxx
index c4eae77..043fce1 100644
--- a/connectivity/source/drivers/kab/KResultSet.cxx
+++ b/connectivity/source/drivers/kab/KResultSet.cxx
@@ -40,7 +40,7 @@ using namespace com::sun::star::beans;
 using namespace com::sun::star::sdbc;
 using namespace com::sun::star::sdbcx;
 using namespace com::sun::star::io;
-using namespace com::sun::star::util;
+namespace cssu = com::sun::star::util;
 
 IMPLEMENT_SERVICE_INFO(KabResultSet, "com.sun.star.sdbc.drivers.KabResultSet", 
"com.sun.star.sdbc.ResultSet");
 // -
@@ -298,34 +298,34 @@ Sequence< sal_Int8 > SAL_CALL 
KabResultSet::getBytes(sal_Int32) throw(SQLExcepti
 return Sequence< sal_Int8 >();
 }
 // -
-Date SAL_CALL KabResultSet::getDate(sal_Int32) throw(SQLException, 
RuntimeException)
+cssu::Date SAL_CALL KabResultSet::getDate(sal_Int32) throw(SQLException, 
RuntimeException)
 {
 ::osl::MutexGuard aGuard( m_aMutex );
 checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
 
 ::dbtools::throwFunctionNotSupportedException("getDate", NULL);
 
-Date aRet;
+cssu::Date aRet;
 return aRet;
 }
 // -
-Time SAL_CALL KabResultSet::getTime(sal_Int32) throw(SQLException, 
RuntimeException)
+cssu::Time SAL_CALL KabResultSet::getTime(sal_Int32) throw(SQLException, 
RuntimeException)
 {
 ::osl::MutexGuard aGuard( m_aMutex );
 checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
 
 ::dbtools::throwFunctionNotSupportedException("getTime", NULL);
 
-Time nRet;
+cssu::Time nRet;
 return nRet;
 }
 // -
-DateTime SAL_CALL KabResultSet::getTimestamp(sal_Int32 columnIndex) 
throw(SQLException, RuntimeException)
+cssu::DateTime SAL_CALL KabResultSet::getTimestamp(sal_Int32 columnIndex) 
throw(SQLException, RuntimeException)
 {
 ::osl::MutexGuard aGuard( m_aMutex );
 checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
 
-DateTime nRet;
+cssu::DateTime nRet;
 sal_Int32 nAddressees = m_aKabAddressees.size();
 
 if (m_nRowPos != -1 && m_nRowPos != nAddressees && m_xMetaData.is())
@@ -745,19 +745,19 @@ void SAL_CALL KabResultSet::updateBytes(sal_Int32, const 
Sequence< sal_Int8 >&)
 checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
 }
 // -
-void SAL_CALL KabResultSet::updateDate(sal_Int32, const Date&) 
throw(SQLException, RuntimeException)
+void SAL_CALL KabResultSet::updateDate(sal_Int32, const cssu::Date&) 
throw(SQLException, RuntimeException)
 {
 ::osl::MutexGuard aGuard( m_aMutex );
 checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
 }
 // -
-void SAL_CALL KabResultSet::updateTime(sal_Int32, const Time&) 
throw(SQLException, RuntimeException)
+void SAL_CALL KabResultSet::updateTime(sal_Int32, const cssu