[Libreoffice-commits] .: 8 commits - solenv/gdb sot/inc sot/source sw/source tools/inc tools/source ucb/source unusedcode.easy

Michael Stahl mst at kemper.freedesktop.org
Mon Feb 6 16:17:17 PST 2012


 solenv/gdb/libreoffice/sw.py         |    2 -
 sot/inc/sot/filelist.hxx             |    4 ---
 sot/source/base/filelist.cxx         |   11 ---------
 sw/source/core/undo/undobj.cxx       |   39 +++++++++++++++++------------------
 tools/inc/tools/fsys.hxx             |    1 
 tools/source/fsys/fstat.cxx          |   20 -----------------
 tools/source/fsys/unx.cxx            |   37 ---------------------------------
 ucb/source/ucp/gvfs/gvfs_content.hxx |    2 -
 unusedcode.easy                      |    4 ---
 9 files changed, 21 insertions(+), 99 deletions(-)

New commits:
commit ed3a7c0774220894b4b48b4f9cc29a73e472cd06
Author: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
Date:   Mon Feb 6 14:05:41 2012 -0800

    tools: fsys: Delete unused FileStat::FileStat()

diff --git a/tools/inc/tools/fsys.hxx b/tools/inc/tools/fsys.hxx
index 3ec1799..b1fcc1e 100644
--- a/tools/inc/tools/fsys.hxx
+++ b/tools/inc/tools/fsys.hxx
@@ -177,7 +177,6 @@ protected:
                     FileStat( SAL_UNUSED_PARAMETER const void *pInfo ); // CInfoPBRec
 
 public:
-                    FileStat();
                     FileStat( const DirEntry& rDirEntry,
                               FSysAccess nAccess = FSYS_ACCESS_FLOPPY );
     sal_Bool            Update( const DirEntry& rDirEntry,
diff --git a/tools/source/fsys/fstat.cxx b/tools/source/fsys/fstat.cxx
index 3752aad..c3e6822 100644
--- a/tools/source/fsys/fstat.cxx
+++ b/tools/source/fsys/fstat.cxx
@@ -43,26 +43,6 @@
 |*
 *************************************************************************/
 
-FileStat::FileStat()
-:   // don't use Default-Ctors!
-    aDateCreated( sal_uIntPtr(0) ),
-    aTimeCreated( sal_uIntPtr(0) ),
-    aDateModified( sal_uIntPtr(0) ),
-    aTimeModified( sal_uIntPtr(0) ),
-    aDateAccessed( sal_uIntPtr(0) ),
-    aTimeAccessed( sal_uIntPtr(0) )
-{
-    nSize = 0;
-    nKindFlags = FSYS_KIND_UNKNOWN;
-    nError = FSYS_ERR_OK;
-}
-
-/*************************************************************************
-|*
-|*    FileStat::FileStat()
-|*
-*************************************************************************/
-
 FileStat::FileStat( const DirEntry& rDirEntry, FSysAccess nAccess )
 :   // don't use Default-Ctors!
     aDateCreated( sal_uIntPtr(0) ),
diff --git a/unusedcode.easy b/unusedcode.easy
index 8f55ded..33aca1d 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -23,7 +23,6 @@ EditView::SetCursor(Cursor const&)
 EditView::SetPointer(Pointer const&)
 FieldEntry::GetBookmarkType()
 FileControl::SetButtonText(String const&)
-FileStat::FileStat()
 FileStream::FileStream(rtl::OString const&, FileAccessMode)
 FmEntryDataArray::DeleteAndDestroy(unsigned short, unsigned short)
 FmEntryDataArray::Insert(FmEntryData* const&, unsigned short&)
commit ff764e4eb7d8bc02f240314792ad195ac4118f33
Author: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
Date:   Mon Feb 6 14:05:40 2012 -0800

    tools: fsys: Delete unused FileStat::FileStat(const void *)

diff --git a/tools/source/fsys/unx.cxx b/tools/source/fsys/unx.cxx
index f8be021..007dc81 100644
--- a/tools/source/fsys/unx.cxx
+++ b/tools/source/fsys/unx.cxx
@@ -331,22 +331,6 @@ sal_uInt16 DirReader_Impl::Read()
 
 /*************************************************************************
 |*
-|*    FileStat::FileStat()
-|*
-*************************************************************************/
-
-FileStat::FileStat( const void * ):
-    aDateCreated(0),
-    aTimeCreated(0),
-    aDateModified(0),
-    aTimeModified(0),
-    aDateAccessed(0),
-    aTimeAccessed(0)
-{
-}
-
-/*************************************************************************
-|*
 |*    FileStat::Update()
 |*
 *************************************************************************/
diff --git a/unusedcode.easy b/unusedcode.easy
index 99538e1..8f55ded 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -24,7 +24,6 @@ EditView::SetPointer(Pointer const&)
 FieldEntry::GetBookmarkType()
 FileControl::SetButtonText(String const&)
 FileStat::FileStat()
-FileStat::FileStat(void const*)
 FileStream::FileStream(rtl::OString const&, FileAccessMode)
 FmEntryDataArray::DeleteAndDestroy(unsigned short, unsigned short)
 FmEntryDataArray::Insert(FmEntryData* const&, unsigned short&)
commit 8d31e2fe628b725e34427789a6afdd6509a0c3f4
Author: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
Date:   Mon Feb 6 14:05:39 2012 -0800

    sot: Delete FileList::GetFormat as it is no longer used

diff --git a/sot/inc/sot/filelist.hxx b/sot/inc/sot/filelist.hxx
index 0ba367f..8f18328 100644
--- a/sot/inc/sot/filelist.hxx
+++ b/sot/inc/sot/filelist.hxx
@@ -62,10 +62,6 @@ public:
     SOT_DLLPUBLIC friend SvStream&  operator<<( SvStream& rOStm, const FileList& rFileList );
     SOT_DLLPUBLIC friend SvStream&  operator>>( SvStream& rIStm, FileList& rFileList );
 
-    // Clipboard, D&D usw.
-    static sal_uLong        GetFormat();
-
-
     // Liste fuellen/abfragen
     void AppendFile( const String& rStr );
     String GetFile( size_t i ) const;
diff --git a/sot/source/base/filelist.cxx b/sot/source/base/filelist.cxx
index 052657e..146ad41 100644
--- a/sot/source/base/filelist.cxx
+++ b/sot/source/base/filelist.cxx
@@ -67,17 +67,6 @@ FileList& FileList::operator=( const FileList& rFileList )
     return *this;
 }
 
-/*************************************************************************
-|*
-|*    FileList::GetFormatName()
-|*
-\*************************************************************************/
-
-sal_uLong FileList::GetFormat()
-{
-    return FORMAT_FILE_LIST;
-}
-
 /******************************************************************************
 |*
 |*  virtuelle SvData-Methoden
diff --git a/unusedcode.easy b/unusedcode.easy
index be5d0b8..99538e1 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -23,7 +23,6 @@ EditView::SetCursor(Cursor const&)
 EditView::SetPointer(Pointer const&)
 FieldEntry::GetBookmarkType()
 FileControl::SetButtonText(String const&)
-FileList::GetFormat()
 FileStat::FileStat()
 FileStat::FileStat(void const*)
 FileStream::FileStream(rtl::OString const&, FileAccessMode)
commit 5e7c721c80b3d968bbc83cf7f744dde9483a2d19
Author: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
Date:   Mon Feb 6 14:05:38 2012 -0800

    tools: fsys: Delete unused DirEntry::GetDevice()

diff --git a/tools/source/fsys/unx.cxx b/tools/source/fsys/unx.cxx
index b53caac..f8be021 100644
--- a/tools/source/fsys/unx.cxx
+++ b/tools/source/fsys/unx.cxx
@@ -241,27 +241,6 @@ String DirEntry::GetVolume() const
                     String());
 }
 
-DirEntry DirEntry::GetDevice() const
-{
-  DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
-
-    DirEntry aPath( *this );
-    aPath.ToAbs();
-
-    struct stat buf;
-    while (stat(rtl::OUStringToOString(aPath.GetFull(), osl_getThreadTextEncoding()).getStr(), &buf))
-    {
-        if (aPath.Level() <= 1)
-            return String();
-        aPath = aPath [1];
-    }
-    mymnttab &rMnt = mymnt::get();
-    return ((buf.st_dev == rMnt.mountdevice ||
-                GetMountEntry(buf.st_dev, &rMnt)) ?
-                    String( rMnt.mountpoint, osl_getThreadTextEncoding()) :
-                    String());
-}
-
 /*************************************************************************
 |*
 |*    DirEntry::SetCWD()
diff --git a/unusedcode.easy b/unusedcode.easy
index 036c9bb..be5d0b8 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -18,7 +18,6 @@ DdeTopic::DdeTopic(String const&)
 DdeTopic::RemoveItem(DdeItem const&)
 DffPropSet::SetPropertyValue(unsigned int, unsigned int) const
 Dialog::Dialog(Window*, ResId const&)
-DirEntry::GetDevice() const
 EditView::GetSelectionMode() const
 EditView::SetCursor(Cursor const&)
 EditView::SetPointer(Pointer const&)
commit 80f96ca6b5bd8a491275c5e192196642854a885c
Author: Daniel Mihalyi <amidabucu at gmail.com>
Date:   Mon Feb 6 18:04:37 2012 +0100

    In the current glib version only the main glib.h can be included directly.

diff --git a/ucb/source/ucp/gvfs/gvfs_content.hxx b/ucb/source/ucp/gvfs/gvfs_content.hxx
index 990ea9f..5c8e7aa 100644
--- a/ucb/source/ucp/gvfs/gvfs_content.hxx
+++ b/ucb/source/ucp/gvfs/gvfs_content.hxx
@@ -35,7 +35,7 @@
 #include <com/sun/star/ucb/XContentCreator.hpp>
 #include <ucbhelper/contenthelper.hxx>
 
-#include <glib/gthread.h>
+#include <glib.h>
 #include <libgnomevfs/gnome-vfs-ops.h>
 #include <libgnomevfs/gnome-vfs-directory.h>
 
commit b5dc729643c198440ca9eec9e29db065343827b9
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon Feb 6 22:17:13 2012 +0100

    sw: undobj.cxx: deploy some asserts

diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index b2a5243..2671511 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -235,19 +235,19 @@ private:
 
 void SwUndo::Undo()
 {
-    OSL_ENSURE(false, "SwUndo::Undo(): ERROR: must call Undo(context) instead");
+    assert(false); // SwUndo::Undo(): ERROR: must call UndoWithContext instead
 }
 
 void SwUndo::Redo()
 {
-    OSL_ENSURE(false, "SwUndo::Redo(): ERROR: must call Redo(context) instead");
+    assert(false); // SwUndo::Redo(): ERROR: must call RedoWithContext instead
 }
 
 void SwUndo::UndoWithContext(SfxUndoContext & rContext)
 {
     ::sw::UndoRedoContext *const pContext(
             dynamic_cast< ::sw::UndoRedoContext * >(& rContext));
-    OSL_ASSERT(pContext);
+    assert(pContext);
     if (!pContext) { return; }
     UndoRedoRedlineGuard const g(*pContext, *this);
     UndoImpl(*pContext);
@@ -257,7 +257,7 @@ void SwUndo::RedoWithContext(SfxUndoContext & rContext)
 {
     ::sw::UndoRedoContext *const pContext(
             dynamic_cast< ::sw::UndoRedoContext * >(& rContext));
-    OSL_ASSERT(pContext);
+    assert(pContext);
     if (!pContext) { return; }
     UndoRedoRedlineGuard const g(*pContext, *this);
     RedoImpl(*pContext);
@@ -267,7 +267,7 @@ void SwUndo::Repeat(SfxRepeatTarget & rContext)
 {
     ::sw::RepeatContext *const pRepeatContext(
             dynamic_cast< ::sw::RepeatContext * >(& rContext));
-    OSL_ASSERT(pRepeatContext);
+    assert(pRepeatContext);
     if (!pRepeatContext) { return; }
     RepeatImpl(*pRepeatContext);
 }
@@ -276,7 +276,7 @@ sal_Bool SwUndo::CanRepeat(SfxRepeatTarget & rContext) const
 {
     ::sw::RepeatContext *const pRepeatContext(
             dynamic_cast< ::sw::RepeatContext * >(& rContext));
-    OSL_ASSERT(pRepeatContext);
+    assert(pRepeatContext);
     if (!pRepeatContext) { return false; }
     return CanRepeatImpl(*pRepeatContext);
 }
@@ -595,7 +595,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
                     pHistory = new SwHistory;
                 SwTxtAttr* const pFtnHnt =
                     pTxtNd->GetTxtAttrForCharAt( nFtnSttIdx );
-                OSL_ENSURE( pFtnHnt, "kein FtnAttribut" );
+                assert(pFtnHnt);
                 SwIndex aIdx( pTxtNd, nFtnSttIdx );
                 pHistory->Add( pFtnHnt, pTxtNd->GetIndex(), false );
                 pTxtNd->EraseText( aIdx, 1 );
@@ -619,7 +619,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
                     pHistory = new SwHistory;
                 SwTxtAttr* const pFtnHnt =
                     pTxtNd->GetTxtAttrForCharAt( nFtnSttIdx );
-                OSL_ENSURE( pFtnHnt, "kein FtnAttribut" );
+                assert(pFtnHnt);
                 SwIndex aIdx( pTxtNd, nFtnSttIdx );
                 pHistory->Add( pFtnHnt, pTxtNd->GetIndex(), false );
                 pTxtNd->EraseText( aIdx, 1 );
@@ -659,7 +659,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
                             pAPos->nNode.GetNode().GetTxtNode();
                         SwTxtAttr* const pFlyHnt = pTxtNd->GetTxtAttrForCharAt(
                             pAPos->nContent.GetIndex());
-                        OSL_ENSURE( pFlyHnt, "kein FlyAttribut" );
+                        assert(pFlyHnt);
                         pHistory->Add( pFlyHnt, 0, false );
                         // n wieder zurueck, damit nicht ein Format uebesprungen wird !
                         n = n >= rSpzArr.Count() ? rSpzArr.Count() : n+1;
@@ -980,8 +980,8 @@ SwRedlineSaveData::SwRedlineSaveData( SwComparePosition eCmpPos,
     : SwUndRng( rRedl ),
     SwRedlineData( rRedl.GetRedlineData(), bCopyNext )
 {
-    OSL_ENSURE( POS_OUTSIDE == eCmpPos ||
-            !rRedl.GetContentIdx(), "Redline mit Content" );
+    assert( POS_OUTSIDE == eCmpPos ||
+            !rRedl.GetContentIdx() ); // "Redline with Content"
 
     switch( eCmpPos )
     {
@@ -1014,7 +1014,7 @@ SwRedlineSaveData::SwRedlineSaveData( SwComparePosition eCmpPos,
         break;
 
     default:
-        OSL_ENSURE( !this, "keine gueltigen Daten!" );
+        assert(false);
     }
 
 #if OSL_DEBUG_LEVEL > 0
@@ -1052,8 +1052,7 @@ void SwRedlineSaveData::RedlineToDoc( SwPaM& rPam )
         rDoc.GetDocShell()->Broadcast(SwRedlineHint(pRedl,SWREDLINE_INSERTED));
     //
     bool const bSuccess = rDoc.AppendRedline( pRedl, true );
-    OSL_ENSURE(bSuccess,
-        "SwRedlineSaveData::RedlineToDoc: insert redline failed");
+    assert(bSuccess); // SwRedlineSaveData::RedlineToDoc: insert redline failed
     (void) bSuccess; // unused in non-debug
     rDoc.SetRedlineMode_intern( eOld );
 }
@@ -1131,9 +1130,9 @@ void SwUndo::SetSaveData( SwDoc& rDoc, const SwRedlineSaveDatas& rSData )
 
 #if OSL_DEBUG_LEVEL > 0
     // check redline count against count saved in RedlineSaveData object
-    OSL_ENSURE( (rSData.Count() == 0) ||
-                (rSData[0]->nRedlineCount == rDoc.GetRedlineTbl().Count()),
-                "redline count not restored properly" );
+    assert((rSData.Count() == 0) ||
+           (rSData[0]->nRedlineCount == rDoc.GetRedlineTbl().Count()));
+            // "redline count not restored properly"
 #endif
 
     rDoc.SetRedlineMode_intern( eOld );
@@ -1188,7 +1187,7 @@ sal_Bool SwUndo::CanRedlineGroup( SwRedlineSaveDatas& rCurr,
 // #111827#
 String ShortenString(const String & rStr, xub_StrLen nLength, const String & rFillStr)
 {
-    OSL_ENSURE( nLength - rFillStr.Len() >= 2, "improper arguments");
+    assert(nLength - rFillStr.Len() >= 2);
 
     String aResult;
 
commit 13424b43c25389e303774c3fb2f2beb3e20ceae5
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon Feb 6 22:01:27 2012 +0100

    fdo#38745: fix hilariously stupid stack guards:
    
    The UndoRedoRedlineGuards that SwUndo::{Un,Re}doWithContext wants to
    put on the stack aren't actually variables, so the destructor gets
    invoked before the function call that the guard is supposed to protect.
    Regression from CWS undoapi.

diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index f815398..b2a5243 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -249,7 +249,7 @@ void SwUndo::UndoWithContext(SfxUndoContext & rContext)
             dynamic_cast< ::sw::UndoRedoContext * >(& rContext));
     OSL_ASSERT(pContext);
     if (!pContext) { return; }
-    UndoRedoRedlineGuard(*pContext, *this);
+    UndoRedoRedlineGuard const g(*pContext, *this);
     UndoImpl(*pContext);
 }
 
@@ -259,7 +259,7 @@ void SwUndo::RedoWithContext(SfxUndoContext & rContext)
             dynamic_cast< ::sw::UndoRedoContext * >(& rContext));
     OSL_ASSERT(pContext);
     if (!pContext) { return; }
-    UndoRedoRedlineGuard(*pContext, *this);
+    UndoRedoRedlineGuard const g(*pContext, *this);
     RedoImpl(*pContext);
 }
 
commit 89b68f682e40f1bdc6c967bf38308504fae70d82
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon Feb 6 19:46:19 2012 +0100

    gdb: don't barf on non-ASCII text in SwTxtNode
    
    Because the default text encoding in Python 2 is "ascii" these would
    throw a UnicodeEncodeError: 'ascii' codec can't encode character...

diff --git a/solenv/gdb/libreoffice/sw.py b/solenv/gdb/libreoffice/sw.py
index 8f25522..8325bfa 100644
--- a/solenv/gdb/libreoffice/sw.py
+++ b/solenv/gdb/libreoffice/sw.py
@@ -100,7 +100,7 @@ class BigPtrArrayPrinter(object):
                 # accessing this is completely non-obvious...
                 # also, node.dynamic_cast(node.dynamic_type) is null?
                 value = "    TextNode " + \
-                    str(node.cast(node.dynamic_type).dereference()['m_Text'])
+                  unicode(node.cast(node.dynamic_type).dereference()['m_Text'])
             elif str(node.dynamic_type.target()) == "SwOLENode":
                 value = "     OLENode "
             elif str(node.dynamic_type.target()) == "SwGrfNode":


More information about the Libreoffice-commits mailing list