[Libreoffice-commits] core.git: 4 commits - io/source l10ntools/source lotuswordpro/source oox/source sd/source slideshow/source vcl/source vcl/win

Michael Stahl mstahl at redhat.com
Wed May 25 11:48:55 UTC 2016


 io/source/stm/streamhelper.hxx                                         |   16 ---
 l10ntools/source/gConvPo.cxx                                           |   13 --
 l10ntools/source/po.cxx                                                |   14 ---
 lotuswordpro/source/filter/lwppara1.cxx                                |    8 -
 oox/source/drawingml/diagram/diagramlayoutatoms.hxx                    |    6 -
 sd/source/ui/sidebar/SlideBackground.cxx                               |    1 
 slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx |   46 ++++------
 vcl/source/fontsubset/ttcr.cxx                                         |    5 -
 vcl/source/glyphs/graphite_layout.cxx                                  |    1 
 vcl/win/gdi/salfont.cxx                                                |    4 
 10 files changed, 29 insertions(+), 85 deletions(-)

New commits:
commit 96fb3c52f5d04c8257cefd97630173005e6e466c
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 25 13:37:34 2016 +0200

    l10ntools: replace boost::crc with rtl_crc32
    
    Tested with output of "make translations", it apparently computes the
    same CRC function, despite the documentation specifying different
    polynomials, but maybe that is just different notations...
    
    Change-Id: Ia28a881f5cdf54326fe5051527acd445e7a5771c

diff --git a/l10ntools/source/gConvPo.cxx b/l10ntools/source/gConvPo.cxx
index 40be9f9..2f36797 100644
--- a/l10ntools/source/gConvPo.cxx
+++ b/l10ntools/source/gConvPo.cxx
@@ -22,14 +22,7 @@
 #include <vector>
 using namespace std;
 
-#ifdef _MSC_VER
-#pragma warning (push, 1)
-#pragma warning (disable: 4245)
-#endif
-#include <boost/crc.hpp>
-#ifdef _MSC_VER
-#pragma warning (pop)
-#endif
+#include <rtl/crc.h>
 
 #include "gL10nMem.hxx"
 #include "gConvPo.hxx"
@@ -250,7 +243,6 @@ void convert_po::endSave()
 string convert_po::genKeyId(const string& text)
 {
     string newText(text);
-    boost::crc_32_type aCRC32;
     int i;
 
     for (i = 0; (i = newText.find("\\\\", 0)) != (int)string::npos;) {
@@ -263,8 +255,7 @@ string convert_po::genKeyId(const string& text)
         newText.erase(i, 1);
         newText[i] = 0x0A;
     }
-    aCRC32.process_bytes(newText.c_str(), newText.length());
-    unsigned int nCRC = aCRC32.checksum();
+    sal_uInt32 const nCRC = rtl_crc32(0, newText.c_str(), newText.length());
     string key;
 
     // Use simple ASCII characters, exclude I, l, 1 and O, 0 to avoid confusing IDs
diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx
index 176ce1d..4662d58 100644
--- a/l10ntools/source/po.cxx
+++ b/l10ntools/source/po.cxx
@@ -8,6 +8,7 @@
  */
 
 #include <rtl/ustring.hxx>
+#include <rtl/crc.h>
 
 #include <cstring>
 #include <ctime>
@@ -16,15 +17,6 @@
 #include <vector>
 #include <string>
 
-#ifdef _MSC_VER
-#pragma warning (push, 1)
-#pragma warning (disable: 4245)
-#endif
-#include <boost/crc.hpp>
-#ifdef _MSC_VER
-#pragma warning (pop)
-#endif
-
 #include "po.hxx"
 #include "helper.hxx"
 
@@ -376,9 +368,7 @@ bool PoEntry::IsInSameComp(const PoEntry& rPo1,const PoEntry& rPo2)
 
 OString PoEntry::genKeyId(const OString& rGenerator)
 {
-    boost::crc_32_type aCRC32;
-    aCRC32.process_bytes(rGenerator.getStr(), rGenerator.getLength());
-    sal_uInt32 nCRC = aCRC32.checksum();
+    sal_uInt32 nCRC = rtl_crc32(0, rGenerator.getStr(), rGenerator.getLength());
     // Use simple ASCII characters, exclude I, l, 1 and O, 0 to avoid confusing IDs
     static const char sSymbols[] =
         "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789";
commit da732faa8220caaf754775c44bef202bacb46341
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 25 13:09:11 2016 +0200

    slideshow: replace boost::posix_time with C++11 std::chrono
    
    Change-Id: Ied221b25f1bbe486cac6bb88bbc752a3c19c33ce

diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx
index ed200e2..2a616f5 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -33,7 +33,6 @@
 #include "DrawViewShell.hxx"
 #include "DrawController.hxx"
 #include <com/sun/star/beans/XPropertySet.hpp>
-#include <boost/concept_check.hpp>
 #include "sdresid.hxx"
 #include <svtools/controldims.hrc>
 #include <svx/gallery.hxx>
diff --git a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
index a185553..1da561c 100644
--- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
@@ -70,9 +70,7 @@
 #include <vcl/sysdata.hxx>
 
 #if OSL_DEBUG_LEVEL > 0
-#include <boost/date_time/posix_time/posix_time.hpp>
-using namespace ::boost::posix_time;
-
+#include <chrono>
 #endif
 
 using namespace ::com::sun::star;
@@ -94,17 +92,17 @@ class TimerContext
 public:
     explicit TimerContext(OUString const& rWhat)
         : m_aWhat(rWhat)
-        , m_aStartTime(microsec_clock::local_time())
+        , m_StartTime(std::chrono::steady_clock::now())
     {
     }
     ~TimerContext()
     {
-        time_duration const aDuration(microsec_clock::local_time() - m_aStartTime);
-        SAL_INFO("slideshow.opengl", m_aWhat << " took: " << aDuration);
+        auto const aDuration(std::chrono::steady_clock::now() - m_StartTime);
+        SAL_INFO("slideshow.opengl", m_aWhat << " took: " << std::chrono::duration_cast<std::chrono::microseconds>(aDuration).count());
     }
 private:
     OUString const m_aWhat;
-    ptime const m_aStartTime;
+    std::chrono::time_point<std::chrono::steady_clock> const m_StartTime;
 };
 #endif
 
@@ -256,11 +254,11 @@ public:
     bool mbValidOpenGLContext;
 
 #if OSL_DEBUG_LEVEL > 0
-    ptime maUpdateStartTime;
-    ptime maUpdateEndTime;
-    ptime maStartTime;
-    ptime maEndTime;
-    time_duration maTotalUpdateDuration;
+    std::chrono::time_point<std::chrono::steady_clock> m_UpdateStartTime;
+    std::chrono::time_point<std::chrono::steady_clock> m_UpdateEndTime;
+    std::chrono::time_point<std::chrono::steady_clock> m_StartTime;
+    std::chrono::time_point<std::chrono::steady_clock> m_EndTime;
+    std::chrono::steady_clock::duration m_TotalUpdateDuration;
     int mnFrameCount;
 #endif
 };
@@ -1036,10 +1034,10 @@ void SAL_CALL OGLTransitionerImpl::update( double nTime ) throw (uno::RuntimeExc
 {
 #if OSL_DEBUG_LEVEL > 0
     mnFrameCount ++;
-    maUpdateStartTime = microsec_clock::local_time();
+    m_UpdateStartTime = std::chrono::steady_clock::now();
     if( mnFrameCount == 1 ) {
-        maStartTime = maUpdateStartTime;
-        maTotalUpdateDuration = seconds (0);
+        m_StartTime = m_UpdateStartTime;
+        m_TotalUpdateDuration = std::chrono::seconds(0);
     }
 #endif
     osl::MutexGuard const guard( m_aMutex );
@@ -1067,11 +1065,11 @@ void SAL_CALL OGLTransitionerImpl::update( double nTime ) throw (uno::RuntimeExc
     CHECK_GL_ERROR();
 
 #if OSL_DEBUG_LEVEL > 0
-    maUpdateEndTime = microsec_clock::local_time();
+    m_UpdateEndTime = std::chrono::steady_clock::now();
 
     SAL_INFO("slideshow.opengl", "update time: " << nTime);
-    SAL_INFO("slideshow.opengl", "update took: " << ( maUpdateEndTime - maUpdateStartTime ));
-    maTotalUpdateDuration += (maUpdateEndTime - maUpdateStartTime);
+    SAL_INFO("slideshow.opengl", "update took: " << std::chrono::duration_cast<std::chrono::milliseconds>(m_UpdateEndTime - m_UpdateStartTime).count());
+    m_TotalUpdateDuration += (m_UpdateEndTime - m_UpdateStartTime);
 #endif
 }
 
@@ -1123,16 +1121,16 @@ void OGLTransitionerImpl::disposing()
 #if OSL_DEBUG_LEVEL > 0
     SAL_INFO("slideshow.opengl", "dispose " << this);
     if( mnFrameCount ) {
-        maEndTime = microsec_clock::local_time();
-        time_duration duration = maEndTime - maStartTime;
+        m_EndTime = std::chrono::steady_clock::now();
+        auto const duration = m_EndTime - m_StartTime;
         SAL_INFO("slideshow.opengl",
                 "whole transition (frames: " << mnFrameCount
-                << ") took: " << duration
+                << ") took: " << std::chrono::duration_cast<std::chrono::microseconds>(duration).count()
                 << " fps: "
-                << (((double)mnFrameCount*1000000000.0)/duration.total_nanoseconds())
-                << " time spent in updates: " << maTotalUpdateDuration
+                << (((double)mnFrameCount*1000000000.0)/std::chrono::duration_cast<std::chrono::nanoseconds>(duration).count())
+                << " time spent in updates: " << std::chrono::duration_cast<std::chrono::microseconds>(m_TotalUpdateDuration).count()
                 << " percentage of transition time: "
-                << (100*(((double)maTotalUpdateDuration.total_nanoseconds())/((double)duration.total_nanoseconds())))
+                << (100*(((double)std::chrono::duration_cast<std::chrono::nanoseconds>(m_TotalUpdateDuration).count())/((double)std::chrono::duration_cast<std::chrono::nanoseconds>(duration).count())))
                 << '%'
             );
     }
commit fa63fe59a14d3d39c87517ceef9a7fc5c4e7261c
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 25 12:14:09 2016 +0200

    remove (un-)definitions of NDEBUG from source files
    
    The build system already defines NDEBUG only if OSL_DEBUG_LEVEL=0 AND
    ASSERT_ALWAYS_ABORT=FALSE so the C++ code shouldn't override that.
    
    Change-Id: Ie67a576646cc7e18c3ffac67a3c81b80747ea438

diff --git a/io/source/stm/streamhelper.hxx b/io/source/stm/streamhelper.hxx
index fd00bcc..064d12bd1 100644
--- a/io/source/stm/streamhelper.hxx
+++ b/io/source/stm/streamhelper.hxx
@@ -22,15 +22,6 @@
 
 #include <com/sun/star/io/BufferSizeExceededException.hpp>
 
-// Save NDEBUG state
-#ifdef NDEBUG
-#define STREAMHELPER_HXX_HAD_NDEBUG
-#undef NDEBUG
-#endif
-
-#if OSL_DEBUG_LEVEL == 0
-#define NDEBUG
-#endif
 #include <assert.h>
 
 #define Max( a, b )     (((a)>(b)) ? (a) : (b) )
@@ -94,13 +85,6 @@ public:
 
 };
 
-// Restore NDEBUG state
-#ifdef STREAMHELPER_HXX_HAD_NDEBUG
-#define NDEBUG
-#else
-#undef NDEBUG
-#endif
-
 }
 
 #endif // INCLUDED_IO_SOURCE_STM_STREAMHELPER_HXX
diff --git a/lotuswordpro/source/filter/lwppara1.cxx b/lotuswordpro/source/filter/lwppara1.cxx
index a8b4e7a..8c015fc 100644
--- a/lotuswordpro/source/filter/lwppara1.cxx
+++ b/lotuswordpro/source/filter/lwppara1.cxx
@@ -102,13 +102,7 @@
 #include "lwpcelllayout.hxx"
 
 // boost::polymorphic_downcast checks and reports (using assert), if the
-// cast is incorrect. We want this in debug builds.
-#if OSL_DEBUG_LEVEL > 0
-#   undef NDEBUG
-#elif !defined(NDEBUG)
-#   define NDEBUG 1
-#endif
-
+// cast is incorrect (in debug builds).
 using boost::polymorphic_downcast;
 
 /**
diff --git a/vcl/source/fontsubset/ttcr.cxx b/vcl/source/fontsubset/ttcr.cxx
index 0708b2e..ff7169c 100644
--- a/vcl/source/fontsubset/ttcr.cxx
+++ b/vcl/source/fontsubset/ttcr.cxx
@@ -24,11 +24,6 @@
  *
  */
 
-#if OSL_DEBUG_LEVEL == 0
-#  ifndef NDEBUG
-#    define NDEBUG
-#  endif
-#endif
 #include <assert.h>
 
 #include "ttcr.hxx"
diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx
index 290f251..f1eb461 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -24,7 +24,6 @@
 #if OSL_DEBUG_LEVEL > 1
 #include <cstdio>
 #define GRLAYOUT_DEBUG 1
-#undef NDEBUG
 #endif
 
 //#define GRLAYOUT_DEBUG 1
diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx
index d198dc6..e72bb1d 100644
--- a/vcl/win/gdi/salfont.cxx
+++ b/vcl/win/gdi/salfont.cxx
@@ -911,7 +911,6 @@ static FILE * grLog()
     else fflush(grLogFile);
     return grLogFile;
 }
-#undef NDEBUG
 #endif
 
 const void * getGrTable(const void* appFaceHandle, unsigned int name, size_t *len)
@@ -962,9 +961,6 @@ GrFontData::~GrFontData()
 
 const void * GrFontData::getTable(unsigned int name, size_t *len) const
 {
-#ifdef DEBUG
-#undef NDEBUG
-#endif
     assert(mhDC);
     // swap the bytes
     union TtfTag {
commit 4384ee727ce00db931e6d23d526c467b0491941c
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 25 11:40:48 2016 +0200

    oox: replace boost::array with std::array
    
    Change-Id: Id9a8f7dbbf13890e7c9787d9b0737f1087e4a509

diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.hxx b/oox/source/drawingml/diagram/diagramlayoutatoms.hxx
index 6cebe6f..6153e9c 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.hxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.hxx
@@ -21,10 +21,8 @@
 #define INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_DIAGRAMLAYOUTATOMS_HXX
 
 #include <map>
-#include <string>
-
 #include <memory>
-#include <boost/array.hpp>
+#include <array>
 
 #include <com/sun/star/uno/Any.hxx>
 #include <com/sun/star/xml/sax/XFastAttributeList.hpp>
@@ -239,7 +237,7 @@ public:
     };
     // we know that the array is of fixed size
     // the use of Any allow having empty values
-    typedef boost::array< css::uno::Any, 9 > VarMap;
+    typedef std::array<css::uno::Any, 9> VarMap;
 
     LayoutNode() : mnChildOrder(0) {}
     virtual ~LayoutNode() { }


More information about the Libreoffice-commits mailing list