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

Stefan Weiberg stefan.weiberg at germandev.org
Thu Aug 28 06:56:08 PDT 2014


 chart2/source/controller/dialogs/res_DataLabel.cxx     |    2 
 chart2/source/controller/dialogs/tp_AxisLabel.cxx      |    2 
 chart2/source/controller/dialogs/tp_LegendPosition.cxx |    2 
 chart2/source/controller/dialogs/tp_TitleRotation.cxx  |    2 
 chart2/source/view/main/ChartView.cxx                  |    5 -
 connectivity/source/commontools/dbconversion.cxx       |   77 ++++++++---------
 6 files changed, 45 insertions(+), 45 deletions(-)

New commits:
commit b450d32260e1f3d2bc83297ca9cb54b62e36ac20
Author: Stefan Weiberg <stefan.weiberg at germandev.org>
Date:   Thu Aug 28 11:55:56 2014 +0000

    fdo#82088: changed namespace from utl to css::util
    
    - edit: deleted redefined css (alrdy global)
    
    Change-Id: I2e1b0a3d71ef25fdca2a56094283ed076e5cdd30
    Reviewed-on: https://gerrit.libreoffice.org/11171
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/connectivity/source/commontools/dbconversion.cxx b/connectivity/source/commontools/dbconversion.cxx
index 81aae73..f8860aa 100644
--- a/connectivity/source/commontools/dbconversion.cxx
+++ b/connectivity/source/commontools/dbconversion.cxx
@@ -53,7 +53,6 @@ namespace dbtools
 
     using namespace ::com::sun::star::uno;
     using namespace ::com::sun::star::util;
-    namespace utl = ::com::sun::star::util;
     using namespace ::com::sun::star::sdb;
     using namespace ::com::sun::star::sdbc;
     using namespace ::com::sun::star::lang;
@@ -61,13 +60,13 @@ namespace dbtools
 
 
 
-    ::com::sun::star::util::Date DBTypeConversion::getStandardDate()
+    css::util::Date DBTypeConversion::getStandardDate()
     {
-        static ::com::sun::star::util::Date STANDARD_DB_DATE(1,1,1900);
+        static css::util::Date STANDARD_DB_DATE(1,1,1900);
         return STANDARD_DB_DATE;
     }
 
-    OUString DBTypeConversion::toDateString(const utl::Date& rDate)
+    OUString DBTypeConversion::toDateString(const css::util::Date& rDate)
     {
         sal_Char s[11];
         snprintf(s,
@@ -80,7 +79,7 @@ namespace dbtools
         return OUString::createFromAscii(s);
     }
 
-    OUString DBTypeConversion::toTimeStringS(const utl::Time& rTime)
+    OUString DBTypeConversion::toTimeStringS(const css::util::Time& rTime)
     {
         std::ostringstream ostr;
         using std::setw;
@@ -91,7 +90,7 @@ namespace dbtools
         return OUString::createFromAscii(ostr.str().c_str());
     }
 
-    OUString DBTypeConversion::toTimeString(const utl::Time& rTime)
+    OUString DBTypeConversion::toTimeString(const css::util::Time& rTime)
     {
         std::ostringstream ostr;
         using std::setw;
@@ -103,20 +102,20 @@ namespace dbtools
         return OUString::createFromAscii(ostr.str().c_str());
     }
 
-    OUString DBTypeConversion::toDateTimeString(const utl::DateTime& _rDateTime)
+    OUString DBTypeConversion::toDateTimeString(const css::util::DateTime& _rDateTime)
     {
-        utl::Date aDate(_rDateTime.Day,_rDateTime.Month,_rDateTime.Year);
+        css::util::Date aDate(_rDateTime.Day,_rDateTime.Month,_rDateTime.Year);
         OUStringBuffer aTemp(toDateString(aDate));
         aTemp.appendAscii(" ");
-        utl::Time const aTime(_rDateTime.NanoSeconds, _rDateTime.Seconds,
+        css::util::Time const aTime(_rDateTime.NanoSeconds, _rDateTime.Seconds,
                 _rDateTime.Minutes, _rDateTime.Hours, _rDateTime.IsUTC);
         aTemp.append( toTimeString(aTime) );
         return  aTemp.makeStringAndClear();
     }
 
-    utl::Date DBTypeConversion::toDate(sal_Int32 _nVal)
+    css::util::Date DBTypeConversion::toDate(sal_Int32 _nVal)
     {
-        utl::Date aReturn;
+        css::util::Date aReturn;
         aReturn.Day = (sal_uInt16)(_nVal % 100);
         aReturn.Month = (sal_uInt16)((_nVal  / 100) % 100);
         aReturn.Year = (sal_uInt16)(_nVal  / 10000);
@@ -124,9 +123,9 @@ namespace dbtools
     }
 
 
-    utl::Time DBTypeConversion::toTime(sal_Int64 _nVal)
+    css::util::Time DBTypeConversion::toTime(sal_Int64 _nVal)
     {
-        utl::Time aReturn;
+        css::util::Time aReturn;
         sal_uInt64 unVal = static_cast<sal_uInt64>(_nVal >= 0 ? _nVal : -_nVal);
         aReturn.Hours = unVal / hourMask;
         aReturn.Minutes = (unVal / minMask) % 100;
@@ -135,7 +134,7 @@ namespace dbtools
         return aReturn;
     }
 
-    sal_Int64 DBTypeConversion::getNsFromTime(const utl::Time& rVal)
+    sal_Int64 DBTypeConversion::getNsFromTime(const css::util::Time& rVal)
     {
         sal_Int32   nHour     = rVal.Hours;
         sal_Int32   nMin      = rVal.Minutes;
@@ -179,7 +178,7 @@ namespace dbtools
     }
 
 
-    static sal_Int32 implRelativeToAbsoluteNull(const utl::Date& _rDate)
+    static sal_Int32 implRelativeToAbsoluteNull(const css::util::Date& _rDate)
     {
         sal_Int32 nDays = 0;
 
@@ -237,28 +236,28 @@ namespace dbtools
         rDay = (sal_uInt16)nTempDays;
     }
 
-    sal_Int32 DBTypeConversion::toDays(const utl::Date& _rVal, const utl::Date& _rNullDate)
+    sal_Int32 DBTypeConversion::toDays(const css::util::Date& _rVal, const css::util::Date& _rNullDate)
     {
         return implRelativeToAbsoluteNull(_rVal) - implRelativeToAbsoluteNull(_rNullDate);
     }
 
 
-    double DBTypeConversion::toDouble(const utl::Date& rVal, const utl::Date& _rNullDate)
+    double DBTypeConversion::toDouble(const css::util::Date& rVal, const css::util::Date& _rNullDate)
     {
         return (double)toDays(rVal, _rNullDate);
     }
 
 
-    double DBTypeConversion::toDouble(const utl::Time& rVal)
+    double DBTypeConversion::toDouble(const css::util::Time& rVal)
     {
         return (double)getNsFromTime(rVal) / fNanoSecondsPerDay;
     }
 
 
-    double DBTypeConversion::toDouble(const utl::DateTime& _rVal, const utl::Date& _rNullDate)
+    double DBTypeConversion::toDouble(const css::util::DateTime& _rVal, const css::util::Date& _rNullDate)
     {
-        sal_Int64   nTime     = toDays(utl::Date(_rVal.Day, _rVal.Month, _rVal.Year), _rNullDate);
-        utl::Time aTimePart;
+        sal_Int64   nTime     = toDays(css::util::Date(_rVal.Day, _rVal.Month, _rVal.Year), _rNullDate);
+        css::util::Time aTimePart;
 
         aTimePart.Hours             = _rVal.Hours;
         aTimePart.Minutes           = _rVal.Minutes;
@@ -268,7 +267,7 @@ namespace dbtools
         return ((double)nTime) + toDouble(aTimePart);
     }
 
-    static void addDays(sal_Int32 nDays, utl::Date& _rDate)
+    static void addDays(sal_Int32 nDays, css::util::Date& _rDate)
     {
         sal_Int32   nTempDays = implRelativeToAbsoluteNull( _rDate );
 
@@ -289,7 +288,7 @@ namespace dbtools
             implBuildFromRelative( nTempDays, _rDate.Day, _rDate.Month, _rDate.Year );
     }
 
-    static void subDays( sal_Int32 nDays, utl::Date& _rDate )
+    static void subDays( sal_Int32 nDays, css::util::Date& _rDate )
     {
         sal_Int32   nTempDays = implRelativeToAbsoluteNull( _rDate );
 
@@ -310,9 +309,9 @@ namespace dbtools
             implBuildFromRelative( nTempDays, _rDate.Day, _rDate.Month, _rDate.Year );
     }
 
-    utl::Date DBTypeConversion::toDate(double dVal, const utl::Date& _rNullDate)
+    css::util::Date DBTypeConversion::toDate(double dVal, const css::util::Date& _rNullDate)
     {
-        utl::Date aRet = _rNullDate;
+        css::util::Date aRet = _rNullDate;
 
         if (dVal >= 0)
             addDays((sal_Int32)dVal,aRet);
@@ -323,7 +322,7 @@ namespace dbtools
         return aRet;
     }
 
-    utl::Time DBTypeConversion::toTime(double dVal, short nDigits)
+    css::util::Time DBTypeConversion::toTime(double dVal, short nDigits)
     {
         sal_Int32 nDays     = (sal_Int32)dVal;
         sal_Int64 nNS;
@@ -342,7 +341,7 @@ namespace dbtools
         else
             nSign = 1;
 
-        utl::Time xRet;
+        css::util::Time xRet;
         // normalize time
         // we have to sal_Int32 here because otherwise we get an overflow
         sal_Int64 nNanoSeconds      = nNS;
@@ -371,16 +370,16 @@ namespace dbtools
         return xRet;
     }
 
-    utl::DateTime DBTypeConversion::toDateTime(double dVal, const utl::Date& _rNullDate)
+    css::util::DateTime DBTypeConversion::toDateTime(double dVal, const css::util::Date& _rNullDate)
     {
-        utl::Date aDate = toDate(dVal, _rNullDate);
+        css::util::Date aDate = toDate(dVal, _rNullDate);
         // there is not enough precision in a double to have both a date
         // and a time up to nanoseconds -> limit to microseconds to have
         // correct rounding, that is e.g. 13:00:00.000000000 instead of
         // 12:59:59.999999790
-        utl::Time aTime = toTime(dVal, 6);
+        css::util::Time aTime = toTime(dVal, 6);
 
-        utl::DateTime xRet;
+        css::util::DateTime xRet;
 
         xRet.Day          = aDate.Day;
         xRet.Month        = aDate.Month;
@@ -395,7 +394,7 @@ namespace dbtools
         return xRet;
     }
 
-    utl::Date DBTypeConversion::toDate(const OUString& _sSQLString)
+    css::util::Date DBTypeConversion::toDate(const OUString& _sSQLString)
     {
         // get the token out of a string
         static sal_Unicode sDateSep = '-';
@@ -412,19 +411,19 @@ namespace dbtools
                 nDay = (sal_uInt16)_sSQLString.getToken(0,sDateSep,nIndex).toInt32();
         }
 
-        return utl::Date(nDay,nMonth,nYear);
+        return css::util::Date(nDay,nMonth,nYear);
     }
 
 
-    utl::DateTime DBTypeConversion::toDateTime(const OUString& _sSQLString)
+    css::util::DateTime DBTypeConversion::toDateTime(const OUString& _sSQLString)
     {
         //@see http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Timestamp.html#valueOf(java.lang.String)
         //@see http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Date.html#valueOf(java.lang.String)
         //@see http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Time.html#valueOf(java.lang.String)
 
         // the date part
-        utl::Date aDate = toDate(_sSQLString);
-        utl::Time aTime;
+        css::util::Date aDate = toDate(_sSQLString);
+        css::util::Time aTime;
         sal_Int32 nSeparation = _sSQLString.indexOf( ' ' );
         if ( -1 != nSeparation )
         {
@@ -435,14 +434,14 @@ namespace dbtools
             aTime = toTime( _sSQLString.copy( nSeparation ) );
         }
 
-        return utl::DateTime(aTime.NanoSeconds, aTime.Seconds, aTime.Minutes, aTime.Hours,
+        return css::util::DateTime(aTime.NanoSeconds, aTime.Seconds, aTime.Minutes, aTime.Hours,
                         aDate.Day, aDate.Month, aDate.Year, false);
     }
 
 
-    utl::Time DBTypeConversion::toTime(const OUString& _sSQLString)
+    css::util::Time DBTypeConversion::toTime(const OUString& _sSQLString)
     {
-        utl::Time aTime;
+        css::util::Time aTime;
         ::utl::ISO8601parseTime(_sSQLString, aTime);
         return aTime;
     }
commit f9857727c619702e275c8ccb63a058a6be835707
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Aug 28 15:53:13 2014 +0200

    EE_PARA_WRITINGDIR should presumably use an SvxFrameDirectionItem
    
    ...rather than an SfxInt32Item, just as it does everywhere else outside chart2.
    At least, running CppunitTest_chart2_export under -fsanitize=undefined
    complained about an invalid cast to SvxFrameDirectionItem.
    
    Change-Id: Ia7ea43a00d659de9642f801f390f45b9239d9c32

diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx b/chart2/source/controller/dialogs/res_DataLabel.cxx
index 9185c15..b713879 100644
--- a/chart2/source/controller/dialogs/res_DataLabel.cxx
+++ b/chart2/source/controller/dialogs/res_DataLabel.cxx
@@ -303,7 +303,7 @@ bool DataLabelResources::FillItemSet( SfxItemSet* rOutAttrs ) const
     }
 
     if( m_pLB_TextDirection->GetSelectEntryCount() > 0 )
-        rOutAttrs->Put( SfxInt32Item( EE_PARA_WRITINGDIR, m_pLB_TextDirection->GetSelectEntryValue() ) );
+        rOutAttrs->Put( SvxFrameDirectionItem( m_pLB_TextDirection->GetSelectEntryValue(), EE_PARA_WRITINGDIR ) );
 
     if( m_pDC_Dial->IsVisible() )
     {
diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.cxx b/chart2/source/controller/dialogs/tp_AxisLabel.cxx
index d44b48a..7a6cf63 100644
--- a/chart2/source/controller/dialogs/tp_AxisLabel.cxx
+++ b/chart2/source/controller/dialogs/tp_AxisLabel.cxx
@@ -129,7 +129,7 @@ bool SchAxisLabelTabPage::FillItemSet( SfxItemSet* rOutAttrs )
         rOutAttrs->Put( SfxBoolItem( SCHATTR_AXIS_SHOWDESCR, m_pCbShowDescription->IsChecked() ) );
 
     if( m_pLbTextDirection->GetSelectEntryCount() > 0 )
-        rOutAttrs->Put( SfxInt32Item( EE_PARA_WRITINGDIR, m_pLbTextDirection->GetSelectEntryValue() ) );
+        rOutAttrs->Put( SvxFrameDirectionItem( m_pLbTextDirection->GetSelectEntryValue(), EE_PARA_WRITINGDIR ) );
 
     return true;
 }
diff --git a/chart2/source/controller/dialogs/tp_LegendPosition.cxx b/chart2/source/controller/dialogs/tp_LegendPosition.cxx
index 13c2ff4..c80dc22 100644
--- a/chart2/source/controller/dialogs/tp_LegendPosition.cxx
+++ b/chart2/source/controller/dialogs/tp_LegendPosition.cxx
@@ -51,7 +51,7 @@ bool SchLegendPosTabPage::FillItemSet(SfxItemSet* rOutAttrs)
     m_aLegendPositionResources.writeToItemSet(*rOutAttrs);
 
     if( m_pLbTextDirection->GetSelectEntryCount() > 0 )
-        rOutAttrs->Put( SfxInt32Item( EE_PARA_WRITINGDIR, m_pLbTextDirection->GetSelectEntryValue() ) );
+        rOutAttrs->Put( SvxFrameDirectionItem( m_pLbTextDirection->GetSelectEntryValue(), EE_PARA_WRITINGDIR ) );
 
     return true;
 }
diff --git a/chart2/source/controller/dialogs/tp_TitleRotation.cxx b/chart2/source/controller/dialogs/tp_TitleRotation.cxx
index 56a8384..9305545 100644
--- a/chart2/source/controller/dialogs/tp_TitleRotation.cxx
+++ b/chart2/source/controller/dialogs/tp_TitleRotation.cxx
@@ -82,7 +82,7 @@ bool SchAlignmentTabPage::FillItemSet(SfxItemSet* rOutAttrs)
     rOutAttrs->Put( SfxInt32Item( SCHATTR_TEXT_DEGREES, nDegrees ) );
 
     SvxFrameDirection aDirection( m_pLbTextDirection->GetSelectEntryValue() );
-    rOutAttrs->Put( SfxInt32Item( EE_PARA_WRITINGDIR, aDirection ) );
+    rOutAttrs->Put( SvxFrameDirectionItem( aDirection, EE_PARA_WRITINGDIR ) );
 
     return true;
 }
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 902705b..7f583f7 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -53,6 +53,7 @@
 #include <GL3DBarChart.hxx>
 #include <GL3DHelper.hxx>
 
+#include <editeng/frmdiritem.hxx>
 #include <rtl/uuid.h>
 #include <comphelper/scopeguard.hxx>
 #include <comphelper/servicehelper.hxx>
@@ -1366,7 +1367,7 @@ void lcl_setDefaultWritingMode( ::boost::shared_ptr< DrawModelWrapper > pDrawMod
             if( nWritingMode != -1 && nWritingMode != text::WritingMode2::PAGE )
             {
                 if( pDrawModelWrapper.get() )
-                    pDrawModelWrapper->GetItemPool().SetPoolDefaultItem(SfxInt32Item(EE_PARA_WRITINGDIR, nWritingMode) );
+                    pDrawModelWrapper->GetItemPool().SetPoolDefaultItem(SvxFrameDirectionItem(static_cast<SvxFrameDirection>(nWritingMode), EE_PARA_WRITINGDIR) );
             }
         }
         catch( const uno::Exception& ex )
@@ -1383,7 +1384,7 @@ sal_Int16 lcl_getDefaultWritingModeFromPool( ::boost::shared_ptr< DrawModelWrapp
     {
         const SfxPoolItem* pItem = &(pDrawModelWrapper->GetItemPool().GetDefaultItem( EE_PARA_WRITINGDIR ));
         if( pItem )
-            nWritingMode = static_cast< sal_Int16 >((static_cast< const SfxInt32Item * >( pItem ))->GetValue());
+            nWritingMode = static_cast< sal_Int16 >((static_cast< const SvxFrameDirectionItem * >( pItem ))->GetValue());
     }
     return nWritingMode;
 }


More information about the Libreoffice-commits mailing list