[Libreoffice-commits] core.git: 2 commits - dbaccess/source external/mdds include/unotools sfx2/source

Stephan Bergmann sbergman at redhat.com
Thu May 15 02:36:13 PDT 2014


 dbaccess/source/ui/misc/TableCopyHelper.cxx |    1 
 external/mdds/UnpackedTarball_mdds.mk       |    1 
 external/mdds/mdds-c++98.patch.0            |   84 ++++++++++++++++++++++++++++
 include/unotools/tempfile.hxx               |    7 --
 sfx2/source/doc/docfile.cxx                 |    3 -
 5 files changed, 88 insertions(+), 8 deletions(-)

New commits:
commit 3385b0da3d6ffec25538692d3c49b2e1924dddae
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu May 15 11:35:38 2014 +0200

    Minor utl::TempFile clean up
    
    Change-Id: I20de8b2321d2656d17d25c6343d72c534d47e597

diff --git a/dbaccess/source/ui/misc/TableCopyHelper.cxx b/dbaccess/source/ui/misc/TableCopyHelper.cxx
index 8f38214..9906ff5 100644
--- a/dbaccess/source/ui/misc/TableCopyHelper.cxx
+++ b/dbaccess/source/ui/misc/TableCopyHelper.cxx
@@ -285,7 +285,6 @@ bool OTableCopyHelper::copyTagTable(const TransferableDataHelper& _aDroppedData
         {
             // now we need to copy the stream
             ::utl::TempFile aTmp;
-            aTmp.EnableKillingFile(false);
             _rAsyncDrop.aUrl = aTmp.GetURL();
             SotStorageStreamRef aNew = new SotStorageStream( aTmp.GetFileName() );
             _rAsyncDrop.aHtmlRtfStorage->Seek(STREAM_SEEK_TO_BEGIN);
diff --git a/include/unotools/tempfile.hxx b/include/unotools/tempfile.hxx
index 67f03fb..0af9aa5 100644
--- a/include/unotools/tempfile.hxx
+++ b/include/unotools/tempfile.hxx
@@ -74,7 +74,7 @@ public:
                     TempFile( const OUString& rLeadingChars, bool _bStartWithZero=true, const OUString* pExtension=NULL, const OUString* pParent=NULL, bool bDirectory=false);
 
                     /**
-                    TempFile will be removed from disk in dtor if EnableKillingTempFile was called before.
+                    TempFile will be removed from disk in dtor if EnableKillingFile(true) was called before.
                     Temporary directories will be removed recursively in that case.
                     */
                     ~TempFile();
@@ -105,7 +105,7 @@ public:
                     /**
                     Returns a stream to the tempfiles data; the stream is owned by the tempfile object, so you have to keep this
                     alive as long as you want to use the stream. If the TempFile object is destroyed, it also destroys the
-                    stream object, the underlying file is only deleted if EnableKillingFile( sal_True ) has been called before!
+                    stream object, the underlying file is only deleted if EnableKillingFile(true) has been called before!
                     */
     SvStream*       GetStream( StreamMode eMode );
 
@@ -120,9 +120,6 @@ public:
     void            EnableKillingFile( bool bEnable=true )
                     { bKillingFileEnabled = bEnable; }
 
-    bool            IsKillingFileEnabled() const
-                    { return bKillingFileEnabled; }
-
                     /**
                     Only create a "physical" file name for a temporary file that would be valid at that moment.
                     Should only be used for 3rd party code with a file name interface that wants to create the file by itself.
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 1f0c595..ec0ebbe 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -2036,7 +2036,6 @@ void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalCont
         return; // the backup was done already
 
     ::utl::TempFile aTransactTemp( aPrefix, true, &aExtension, &aDestDir );
-    aTransactTemp.EnableKillingFile( false );
 
     INetURLObject aBackObj( aTransactTemp.GetURL() );
     OUString aBackupName = aBackObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET );
@@ -2063,7 +2062,7 @@ void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalCont
     }
 
     if ( pImp->m_aBackupURL.isEmpty() )
-        aTransactTemp.EnableKillingFile( true );
+        aTransactTemp.EnableKillingFile();
 }
 
 
commit 22aa9fce300f9953dc43fc75f8ced4caab5c3f83
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu May 15 11:33:44 2014 +0200

    Avoid copying of singular iterators
    
    Change-Id: If873d2c369ef6458fdf3289f09802e90dc7367f2

diff --git a/external/mdds/UnpackedTarball_mdds.mk b/external/mdds/UnpackedTarball_mdds.mk
index 387b8bc..974a8e1 100644
--- a/external/mdds/UnpackedTarball_mdds.mk
+++ b/external/mdds/UnpackedTarball_mdds.mk
@@ -15,6 +15,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,mdds,3))
 
 $(eval $(call gb_UnpackedTarball_add_patches,mdds,\
 	external/mdds/mdds_0.6.0.patch \
+	external/mdds/mdds-c++98.patch.0 \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/mdds/mdds-c++98.patch.0 b/external/mdds/mdds-c++98.patch.0
new file mode 100644
index 0000000..eaf1d60
--- /dev/null
+++ b/external/mdds/mdds-c++98.patch.0
@@ -0,0 +1,84 @@
+--- include/mdds/multi_type_vector_itr.hpp
++++ include/mdds/multi_type_vector_itr.hpp
+@@ -139,14 +139,15 @@
+     typedef typename parent_type::size_type size_type;
+     typedef iterator_value_node<size_type, typename parent_type::element_block_type> node;
+ 
+-    iterator_common_base() : m_cur_node(0, 0) {}
++    iterator_common_base() : m_cur_node(0, 0), m_singular(true) {}
+ 
+     iterator_common_base(
+         const base_iterator_type& pos, const base_iterator_type& end,
+         size_type start_pos, size_type block_index) :
+         m_cur_node(start_pos, block_index),
+         m_pos(pos),
+-        m_end(end)
++        m_end(end),
++        m_singular(false)
+     {
+         if (m_pos != m_end)
+             update_node();
+@@ -154,9 +155,13 @@
+ 
+     iterator_common_base(const iterator_common_base& other) :
+         m_cur_node(other.m_cur_node),
+-        m_pos(other.m_pos),
+-        m_end(other.m_end)
++        m_singular(other.m_singular)
+     {
++        if (!m_singular)
++        {
++            m_pos = other.m_pos;
++            m_end = other.m_end;
++        }
+     }
+ 
+     void update_node()
+@@ -196,6 +201,7 @@
+     node m_cur_node;
+     base_iterator_type m_pos;
+     base_iterator_type m_end;
++    bool m_singular;
+ 
+ public:
+     bool operator== (const iterator_common_base& other) const
+@@ -218,8 +224,12 @@
+     iterator_common_base& operator= (const iterator_common_base& other)
+     {
+         m_cur_node = other.m_cur_node;
+-        m_pos = other.m_pos;
+-        m_end = other.m_end;
++        m_singular = other.m_singular;
++        if (!m_singular)
++        {
++            m_pos = other.m_pos;
++            m_end = other.m_end;
++        }
+         return *this;
+     }
+ 
+@@ -226,8 +236,22 @@
+     void swap(iterator_common_base& other)
+     {
+         m_cur_node.swap(other.m_cur_node);
+-        std::swap(m_pos, other.m_pos);
+-        std::swap(m_end, other.m_end);
++        std::swap(m_singular, other.m_singular);
++        if (!(m_singular || other.m_singular))
++        {
++            std::swap(m_pos, other.m_pos);
++            std::swap(m_end, other.m_end);
++        }
++        else if (!m_singular)
++        {
++            m_pos = other.m_pos;
++            m_end = other.m_end;
++        }
++        else if (!other.m_singular)
++        {
++            other.m_pos = m_pos;
++            other.m_end = m_end;
++        }
+     }
+ 
+     const node& get_node() const { return m_cur_node; }


More information about the Libreoffice-commits mailing list