[Libreoffice-commits] core.git: 12 commits - basic/source bridges/source cppu/source include/sal scripting/source solenv/gdb sw/inc sw/qa sw/source vcl/generic

Michael Stahl mstahl at redhat.com
Thu Jan 29 12:54:40 PST 2015


 basic/source/classes/eventatt.cxx                  |    6 
 bridges/source/cpp_uno/gcc3_linux_s390/cpp2uno.cxx |    2 
 bridges/source/cpp_uno/gcc3_linux_s390/uno2cpp.cxx |    2 
 cppu/source/LogBridge/LogBridge.cxx                |   50 +++----
 cppu/source/uno/lbmap.cxx                          |   14 --
 include/sal/log-areas.dox                          |    1 
 scripting/source/dlgprov/dlgevtatt.cxx             |    2 
 scripting/source/dlgprov/dlgevtatt.hxx             |    2 
 solenv/gdb/libreoffice/sw.py                       |   37 +----
 solenv/gdb/libreoffice/tl.py                       |  147 ---------------------
 sw/inc/ndhints.hxx                                 |    2 
 sw/qa/core/macros-test.cxx                         |   43 ++++++
 sw/source/core/doc/docbm.cxx                       |    8 -
 sw/source/core/txtnode/ndtxt.cxx                   |   17 --
 sw/source/core/undo/undel.cxx                      |    4 
 vcl/generic/app/geninst.cxx                        |    2 
 16 files changed, 101 insertions(+), 238 deletions(-)

New commits:
commit e7cbf852a9889c625bc54e68c7eb5b8e62e9acd7
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Jan 29 17:55:17 2015 +0100

    sw: typo in SwpHintsArray::GetEnd()
    
    Change-Id: I4ccf1cc5609ed4f2c70dbf396264e6caf16573c3

diff --git a/sw/inc/ndhints.hxx b/sw/inc/ndhints.hxx
index 91cd18b..c80424d 100644
--- a/sw/inc/ndhints.hxx
+++ b/sw/inc/ndhints.hxx
@@ -123,7 +123,7 @@ public:
     }
     SwTxtAttr * GetEnd( const size_t nPos )
     {
-        assert(nPos < m_HintStarts.size());
+        assert(nPos < m_HintEnds.size());
         return m_HintEnds[nPos];
     }
 
commit 370febbf19a5f362394d1c9e69b12dcb218f6501
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Jan 29 13:38:40 2015 +0100

    tdf#75996: sw: correct bookmark positions when deleting text
    
    The problem is that SwUndoDelete will move the fully selected nodes to
    the UndoNodes but it leaves bookmarks with their SwIndex pointing to the
    deleted nodes.  The SwNodeIndex are corrected by SwNodes::_MoveNodes()
    so they point to a different node than the SwIndex.
    
    This only happens if only one position of the bookmark is inside the
    deletion range; if both are, the bookmark will be deleted by
    SwUndoSaveCntnt::DelCntntIndex().
    
    Also joining the 2 start/end nodes of the selection will accidentally
    correct the bookmarks but only if it happens to delete the end node.
    (and apparently there is also a DeleteRange method that doesn't join)
    
    Change-Id: I91ec362bb833328f8d681fd9458cb915c4efb267

diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx
index e2194e5..3101de7 100644
--- a/sw/qa/core/macros-test.cxx
+++ b/sw/qa/core/macros-test.cxx
@@ -43,6 +43,8 @@
 
 #include <doc.hxx>
 #include <IDocumentLayoutAccess.hxx>
+#include <IDocumentUndoRedo.hxx>
+#include <IDocumentContentOperations.hxx>
 #include "docsh.hxx"
 
 typedef tools::SvRef<SwDocShell> SwDocShellRef;
@@ -66,6 +68,7 @@ public:
 #if !defined MACOSX && !defined WNT
     void testVba();
 #endif
+    void testBookmarkDeleteAndJoin();
     void testFdo55289();
     void testFdo68983();
     CPPUNIT_TEST_SUITE(SwMacrosTest);
@@ -75,6 +78,7 @@ public:
     //CPPUNIT_TEST(testStarBasic);
     CPPUNIT_TEST(testVba);
 #endif
+    CPPUNIT_TEST(testBookmarkDeleteAndJoin);
     CPPUNIT_TEST(testFdo55289);
     CPPUNIT_TEST(testFdo68983);
 
@@ -161,6 +165,45 @@ void SwMacrosTest::testVba()
 }
 #endif
 
+void SwMacrosTest::testBookmarkDeleteAndJoin()
+{
+    SwDoc *const pDoc = new SwDoc;
+    pDoc->GetIDocumentUndoRedo().DoUndo(true); // bug is in SwUndoDelete
+    SwNodeIndex aIdx(pDoc->GetNodes().GetEndOfContent(), -1);
+    SwPaM aPaM(aIdx);
+
+    IDocumentContentOperations & rIDCO(pDoc->getIDocumentContentOperations());
+    rIDCO.AppendTxtNode(*aPaM.GetPoint());
+    rIDCO.InsertString(aPaM, OUString("A"));
+    rIDCO.AppendTxtNode(*aPaM.GetPoint());
+    rIDCO.InsertString(aPaM, OUString("A"));
+    rIDCO.AppendTxtNode(*aPaM.GetPoint());
+    aPaM.Move(fnMoveBackward, fnGoNode);
+    aPaM.Move(fnMoveBackward, fnGoNode);
+    aPaM.Move(fnMoveBackward, fnGoCntnt);
+    aPaM.SetMark();
+    aPaM.Move(fnMoveForward, fnGoDoc);
+    IDocumentMarkAccess & rIDMA = *pDoc->getIDocumentMarkAccess();
+    sw::mark::IMark *pMark =
+            rIDMA.makeMark(aPaM, "test", IDocumentMarkAccess::BOOKMARK);
+    CPPUNIT_ASSERT(pMark);
+    // select so pMark start position is on a node that is fully deleted
+    aPaM.Move(fnMoveBackward, fnGoNode);
+    // must leave un-selected content in last node to get the bJoinPrev flag!
+    aPaM.Move(fnMoveBackward, fnGoCntnt);
+    aPaM.Exchange();
+    aPaM.Move(fnMoveBackward, fnGoDoc);
+    // delete
+    rIDCO.DeleteAndJoin(aPaM, false);
+
+    for (IDocumentMarkAccess::const_iterator_t i = rIDMA.getAllMarksBegin(); i != rIDMA.getAllMarksEnd(); ++i)
+    {
+        // problem was that the nContent was pointing at deleted node
+        CPPUNIT_ASSERT((*i)->GetMarkStart().nNode.GetNode().GetCntntNode() ==
+            static_cast<const SwCntntNode*>((*i)->GetMarkStart().nContent.GetIdxReg()));
+    }
+}
+
 void SwMacrosTest::testFdo55289()
 {
     SwDoc *const pDoc = new SwDoc;
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index 44669e5..14ec9dc 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -153,7 +153,11 @@ SwUndoDelete::SwUndoDelete(
         _DelBookmarks(pStt->nNode, pEnd->nNode);
     }
     else
+    {
         DelCntntIndex( *rPam.GetMark(), *rPam.GetPoint() );
+        ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
+        _DelBookmarks(pStt->nNode, pEnd->nNode, nullptr, &pStt->nContent, &pEnd->nContent);
+    }
 
     nSetPos = pHistory ? pHistory->Count() : 0;
 
commit 8ef489eeb3b3249d73cd29d0a36cd822d20fac24
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Jan 29 13:26:36 2015 +0100

    sw: replace pointless unused position update in SwTxtNode::Update()
    
    ... with a more useful assertion.
    
    Change-Id: I43f0a3e123d9dc9f9fd9548e84b8619c7d4f1262

diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index e063459..1afaea2 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1044,20 +1044,11 @@ void SwTxtNode::Update(
                 if (nChangePos == rIdx.GetIndex())
                 {
                     rIdx.Assign( &aTmpIdxReg, rIdx.GetIndex() );
-                    // mst: FIXME: why does this adjust the unused position???
-                    SwIndex * pIdx;
-                    if ( &pRedl->GetBound( true ) == pRedl->GetPoint() )
-                    {
-                        pRedl->GetBound( false ) = pRedl->GetBound( true );
-                        pIdx = &pRedl->GetBound( false ).nContent;
-                    }
-                    else
-                    {
-                        pRedl->GetBound( true ) = pRedl->GetBound( false );
-                        pIdx = &pRedl->GetBound( true ).nContent;
-                    }
-                    pIdx->Assign( &aTmpIdxReg, pIdx->GetIndex() );
                 }
+                // the unused position must not be on a SwTxtNode
+                bool const isOneUsed(&pRedl->GetBound(true) == pRedl->GetPoint());
+                assert(!pRedl->GetBound(!isOneUsed).nNode.GetNode().IsTxtNode());
+                assert(!pRedl->GetBound(!isOneUsed).nContent.GetIdxReg());
             }
         }
 
commit 4704f3d84f5ecf2f7c9334552510679b2ad9fd8f
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Jan 29 13:14:20 2015 +0100

    sw: remove some pointless verbosity
    
    Change-Id: I3a012cfd9ba8c8c331d025f56f590a74941f71dd

diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 024fbd5..d0f71e9 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -1352,12 +1352,8 @@ void _DelBookmarks(
         // Is at position?
         SwRangeRedline* pRedl = rTbl[ nCnt ];
 
-        SwPosition *pRStt = &pRedl->GetBound(true),
-                   *pREnd = &pRedl->GetBound(false);
-        if( *pRStt > *pREnd )
-        {
-            SwPosition *pTmp = pRStt; pRStt = pREnd, pREnd = pTmp;
-        }
+        SwPosition *const pRStt = pRedl->Start();
+        SwPosition *const pREnd = pRedl->End();
 
         if( lcl_Greater( *pRStt, rStt, pSttIdx ) && lcl_Lower( *pRStt, rEnd, pEndIdx ))
         {
commit 5d3ce204d54870f3ac7b675ec044979a598b8262
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Jan 29 00:25:32 2015 +0100

    rhbz#1186897: bridges: oops, fix s390 bridge build
    
    Change-Id: I5f2393b13729ab43ad2cfd4a3f960a507e3e608b

diff --git a/bridges/source/cpp_uno/gcc3_linux_s390/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_s390/cpp2uno.cxx
index 4922278..b0f4f7e 100644
--- a/bridges/source/cpp_uno/gcc3_linux_s390/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_s390/cpp2uno.cxx
@@ -360,7 +360,7 @@ static typelib_TypeClass cpp_mediate(
 
     // determine called method
     sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex];
-    assert(nMemberPos < pTypeDescr->nAllMembers, "### illegal member index!");
+    assert(nMemberPos < pTypeDescr->nAllMembers);
 
     TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] );
 
diff --git a/bridges/source/cpp_uno/gcc3_linux_s390/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_s390/uno2cpp.cxx
index c1815b4..d4e9814 100644
--- a/bridges/source/cpp_uno/gcc3_linux_s390/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_s390/uno2cpp.cxx
@@ -289,7 +289,7 @@ static void cpp_call(
     // return
     typelib_TypeDescription * pReturnTypeDescr = 0;
     TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef );
-    assert(pReturnTypeDescr, "### expected return type description!");
+    assert(pReturnTypeDescr);
 
     void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion
 
commit 4e12f9553b0182dc51282b7302a9e70da26b6d18
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jan 28 17:21:10 2015 +0100

    cppu: convert some OSL_TRACE
    
    Change-Id: I5dc00f7b03b51916b1331c4ba64064a5aa5930c9

diff --git a/cppu/source/uno/lbmap.cxx b/cppu/source/uno/lbmap.cxx
index 2354e7d8..257417d 100644
--- a/cppu/source/uno/lbmap.cxx
+++ b/cppu/source/uno/lbmap.cxx
@@ -390,9 +390,7 @@ static Mapping loadExternalMapping(
 
         if (! fpGetMapFunc)
         {
-#if OSL_DEBUG_LEVEL > 1
-            OSL_TRACE( "Could not find mapfunc for %s", OUStringToOString( aName, RTL_TEXTENCODING_ASCII_US ).getStr());
-#endif
+            SAL_INFO("cppu", "Could not find mapfunc for " << aName);
             return Mapping();
         }
 
@@ -665,10 +663,7 @@ void SAL_CALL uno_registerMapping(
     {
         OUString aMappingName(
             getMappingName( pFrom, pTo, pAddPurpose ? OUString(pAddPurpose) : OUString() ) );
-#if OSL_DEBUG_LEVEL > 2
-        OString cstr( OUStringToOString( aMappingName, RTL_TEXTENCODING_ASCII_US ) );
-        OSL_TRACE( "> inserting new mapping: %s", cstr.getStr() );
-#endif
+        SAL_INFO("cppu", "> inserting new mapping: " << aMappingName);
         // count initially 1
         MappingEntry * pEntry = new MappingEntry( *ppMapping, freeMapping, aMappingName );
         rData.aName2Entry[ aMappingName ] = pEntry;
@@ -705,10 +700,7 @@ void SAL_CALL uno_revokeMapping(
         rData.aMapping2Entry.erase( pEntry->pMapping );
         rData.aName2Entry.erase( pEntry->aMappingName );
         aGuard.clear();
-#if OSL_DEBUG_LEVEL > 2
-        OString cstr( OUStringToOString( pEntry->aMappingName, RTL_TEXTENCODING_ASCII_US  ) );
-        OSL_TRACE( "> revoking mapping %s", cstr.getStr() );
-#endif
+        SAL_INFO("cppu", "> revoking mapping " << pEntry->aMappingName);
         (*pEntry->freeMapping)( pEntry->pMapping );
         delete pEntry;
     }
commit 585b789eadcc37bdf1577a4d0c3006b5364697a0
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jan 28 17:16:20 2015 +0100

    cppu: the LogBrige really needs its own SAL_LOG area
    
    Change-Id: I129f3dc1597035664e4ff284276cb0d49a560ab5

diff --git a/cppu/source/LogBridge/LogBridge.cxx b/cppu/source/LogBridge/LogBridge.cxx
index 3a8f035..7df03f5 100644
--- a/cppu/source/LogBridge/LogBridge.cxx
+++ b/cppu/source/LogBridge/LogBridge.cxx
@@ -135,63 +135,63 @@ bool LogBridge::v_isValid(rtl::OUString * pReason)
             case typelib_TypeClass_STRING:
                 {
                     const ::rtl::OString sValue( ::rtl::OUStringToOString(*static_cast< ::rtl::OUString*>(pArg),osl_getThreadTextEncoding()));
-                    SAL_INFO("cppu", "" << sValue.getStr());
+                    SAL_INFO("cppu.log", "" << sValue.getStr());
                 }
                 break;
             case typelib_TypeClass_BOOLEAN:
-               SAL_INFO("cppu", "" << *static_cast<sal_Bool*>(pArg));
+               SAL_INFO("cppu.log", "" << *static_cast<sal_Bool*>(pArg));
                 break;
             case typelib_TypeClass_BYTE:
-               SAL_INFO("cppu", "" << *static_cast<sal_Int8*>(pArg));
+               SAL_INFO("cppu.log", "" << *static_cast<sal_Int8*>(pArg));
                 break;
             case typelib_TypeClass_CHAR:
-               SAL_INFO("cppu", "" << *static_cast<sal_Char*>(pArg));
+               SAL_INFO("cppu.log", "" << *static_cast<sal_Char*>(pArg));
                 break;
             case typelib_TypeClass_SHORT:
             case typelib_TypeClass_UNSIGNED_SHORT:
-               SAL_INFO("cppu", "" << *static_cast<sal_Int16*>(pArg));
+               SAL_INFO("cppu.log", "" << *static_cast<sal_Int16*>(pArg));
                 break;
             case typelib_TypeClass_LONG:
             case typelib_TypeClass_UNSIGNED_LONG:
             case typelib_TypeClass_ENUM:
-               SAL_INFO("cppu", "" << *static_cast<sal_Int32*>(pArg));
+               SAL_INFO("cppu.log", "" << *static_cast<sal_Int32*>(pArg));
                 break;
             case typelib_TypeClass_HYPER:
             case typelib_TypeClass_UNSIGNED_HYPER:
-               SAL_INFO("cppu", "" << *static_cast<sal_Int64*>(pArg));
+               SAL_INFO("cppu.log", "" << *static_cast<sal_Int64*>(pArg));
                 break;
             case typelib_TypeClass_FLOAT:
-               SAL_INFO("cppu", "" << *static_cast<float*>(pArg));
+               SAL_INFO("cppu.log", "" << *static_cast<float*>(pArg));
                 break;
             case typelib_TypeClass_DOUBLE:
-               SAL_INFO("cppu", "" << *static_cast<double*>(pArg));
+               SAL_INFO("cppu.log", "" << *static_cast<double*>(pArg));
                 break;
             case typelib_TypeClass_TYPE:
                 {
                     const ::rtl::OString sValue( ::rtl::OUStringToOString(((com::sun::star::uno::Type*)pArg)->getTypeName(),osl_getThreadTextEncoding()));
-                   SAL_INFO("cppu", "" << sValue.getStr());
+                   SAL_INFO("cppu.log", "" << sValue.getStr());
                 }
                 break;
             case typelib_TypeClass_ANY:
                 if ( static_cast<uno_Any*>(pArg)->pData )
                     traceValue(static_cast<uno_Any*>(pArg)->pType,static_cast<uno_Any*>(pArg)->pData);
                 else
-                   SAL_INFO("cppu", "void");
+                   SAL_INFO("cppu.log", "void");
                 break;
             case typelib_TypeClass_EXCEPTION:
-               SAL_INFO("cppu", "exception");
+               SAL_INFO("cppu.log", "exception");
                 break;
             case typelib_TypeClass_INTERFACE:
                 {
                     const ::rtl::OString sValue( ::rtl::OUStringToOString(_pTypeRef->pTypeName,osl_getThreadTextEncoding()));
-                   SAL_INFO("cppu", "" << sValue.getStr() << "0x" << std::hex << pArg);
+                   SAL_INFO("cppu.log", "" << sValue.getStr() << "0x" << std::hex << pArg);
                 }
                 break;
             case typelib_TypeClass_VOID:
-               SAL_INFO("cppu", "void");
+               SAL_INFO("cppu.log", "void");
                 break;
             default:
-               SAL_INFO("cppu", "0x" << std::hex << pArg);
+               SAL_INFO("cppu.log", "0x" << std::hex << pArg);
                 break;
         } // switch(pParams[i].pTypeRef->eTypeClass)
     }
@@ -214,40 +214,40 @@ void LogProbe(
         sTemp = ::rtl::OUStringToOString(pMemberType->pTypeName,RTL_TEXTENCODING_ASCII_US);
     if ( pre  )
     {
-        SAL_INFO("cppu", "{ LogBridge () " << sTemp.getStr() );
+        SAL_INFO("cppu.log", "{ LogBridge () " << sTemp.getStr() );
         if ( nParams )
         {
-           SAL_INFO("cppu", "\n| : ( LogBridge ");
+           SAL_INFO("cppu.log", "\n| : ( LogBridge ");
             for(sal_Int32 i = 0;i < nParams;++i)
             {
                 if ( i > 0 )
-                   SAL_INFO("cppu", ",");
+                   SAL_INFO("cppu.log", ",");
                 traceValue(pParams[i].pTypeRef,pArgs[i]);
 
             }
-           SAL_INFO("cppu", ")");
+           SAL_INFO("cppu.log", ")");
         } // if ( nParams )
-       SAL_INFO("cppu", "\n");
+       SAL_INFO("cppu.log", "\n");
     }
     else if ( !pre )
     {
-        SAL_INFO("cppu", "} LogBridge () " << sTemp.getStr());
+        SAL_INFO("cppu.log", "} LogBridge () " << sTemp.getStr());
         if ( ppException && *ppException )
         {
-            SAL_INFO("cppu", " exception occurred : ");
+            SAL_INFO("cppu.log", " exception occurred : ");
             typelib_TypeDescription * pElementTypeDescr = 0;
             TYPELIB_DANGER_GET( &pElementTypeDescr, (*ppException)->pType );
             const ::rtl::OString sValue( ::rtl::OUStringToOString(pElementTypeDescr->pTypeName,osl_getThreadTextEncoding()));
-           SAL_INFO("cppu", "" << sValue.getStr());
+           SAL_INFO("cppu.log", "" << sValue.getStr());
             TYPELIB_DANGER_RELEASE( pElementTypeDescr );
         }
         else if ( pReturnTypeRef )
         {
-           SAL_INFO("cppu", " return : ");
+           SAL_INFO("cppu.log", " return : ");
             traceValue(pReturnTypeRef,pReturn);
         } // if ( pReturn && pReturnTypeRef )
 
-       SAL_INFO("cppu", "\n");
+       SAL_INFO("cppu.log", "\n");
     }
 }
 
diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox
index 2cd8546..6015933 100644
--- a/include/sal/log-areas.dox
+++ b/include/sal/log-areas.dox
@@ -90,6 +90,7 @@ certain functionality.
 @section cppu
 
 @li @c cppu
+ at li @c cppu.log
 @li @c cppu.unsafebridge
 
 @section cppuhelper
commit 218bd97b83238496a4d2b36d0a1edaca519cdde5
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jan 28 17:13:15 2015 +0100

    gdb pretty printers: fix the sw::mark::IMark and SwModify printers
    
    If these are called on a value that is of a different type than what is
    checked in the children() method, nothing is printed except exceptions
    about non-existent _iterator.
    
    GDB can figure out the dynamic type itself and call the pretty printer
    only if it's actually a UnoMark so don't register it for IMark.
    
    Same thing for SwUnoCrsr, there is already a class for it.
    
    Change-Id: I00238f1e3f01741d607eec9d47671302b858b965

diff --git a/solenv/gdb/libreoffice/sw.py b/solenv/gdb/libreoffice/sw.py
index 97cba13..71445d5 100644
--- a/solenv/gdb/libreoffice/sw.py
+++ b/solenv/gdb/libreoffice/sw.py
@@ -89,8 +89,8 @@ class SwRectPrinter(object):
         children = [ ( 'point', point), ( 'size', size ) ]
         return children.__iter__()
 
-class SwIMarkPrinter(object):
-    '''Prints sw::mark::IMark.'''
+class SwUnoMarkPrinter(object):
+    '''Prints sw::mark::UnoMark.'''
 
     def __init__(self, typename, value):
         self.typename = typename
@@ -100,31 +100,11 @@ class SwIMarkPrinter(object):
         return "%s" % (self.typename)
 
     def children(self):
-        if str(self.value.dynamic_type) == "sw::mark::UnoMark":
-            unoMark = self.value.cast(self.value.dynamic_type)
-            pos1 = unoMark['m_pPos1']
-            pos2 = unoMark['m_pPos2']
-            children = [ ( 'pos1', pos1), ( 'pos2', pos2 ) ]
-            return children.__iter__()
-        else:
-            return self._iterator(self.value)
-
-class SwModifyPrinter(object):
-    '''Prints SwModify.'''
-
-    def __init__(self, typename, value):
-        self.typename = typename
-        self.value = value
-
-    def to_string(self):
-        return "%s" % (self.typename)
-
-    def children(self):
-        if str(self.value.dynamic_type) == "SwUnoCrsr":
-            unoCrsr = self.value.cast(self.value.dynamic_type)
-            return SwUnoCrsrPrinter(self.typename, unoCrsr).children()
-        else:
-            return self._iterator(self.value)
+        unoMark = self.value.cast(self.value.dynamic_type)
+        pos1 = unoMark['m_pPos1']
+        pos2 = unoMark['m_pPos2']
+        children = [ ( 'pos1', pos1), ( 'pos2', pos2 ) ]
+        return children.__iter__()
 
 class SwXTextRangeImplPrinter(object):
     '''Prints SwXTextRange::Impl.'''
@@ -313,11 +293,10 @@ def build_pretty_printers():
     printer.add('SwPaM', SwPaMPrinter)
     printer.add('SwUnoCrsr', SwUnoCrsrPrinter)
     printer.add('SwRect', SwRectPrinter)
-    printer.add('sw::mark::IMark', SwIMarkPrinter)
+    printer.add('sw::mark::UnoMark', SwUnoMarkPrinter)
     printer.add('SwXTextRange::Impl', SwXTextRangeImplPrinter)
     printer.add('sw::UnoImplPtr', SwUnoImplPtrPrinter)
     printer.add('SwXTextRange', SwXTextRangePrinter)
-    printer.add('SwModify', SwModifyPrinter)
     printer.add('SwXTextCursor::Impl', SwXTextCursorImplPrinter)
     printer.add('SwXTextCursor', SwXTextCursorPrinter)
 
commit 7f09e6883fd6ccfe22d337ad244f5b0d84fa1cf6
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jan 28 17:11:07 2015 +0100

    gdb pretty printers: remove obsolete tools container printers
    
    Change-Id: Ieb1e104e8147376405e90ecada308fee05321dcd

diff --git a/solenv/gdb/libreoffice/tl.py b/solenv/gdb/libreoffice/tl.py
index 2ef02bd..87e4924 100644
--- a/solenv/gdb/libreoffice/tl.py
+++ b/solenv/gdb/libreoffice/tl.py
@@ -8,7 +8,6 @@
 #
 
 import gdb
-import six
 
 from libreoffice.util import printing
 
@@ -161,146 +160,6 @@ class TimePrinter(object):
     def to_string(self):
         return str(TimeImpl.parse(self.val))
 
-class IteratorHelper(six.Iterator):
-    '''Implements a container iterator useable for both 'linear'
-        containers (like DynArray or List) and Tables
-    '''
-
-    def __init__(self, block, count, type = None):
-        self.count = count
-        self.type = type
-        self.pos = 0
-        self.block = None
-        self.block_count = 0
-        self.block_pos = 0
-        if block:
-            self._next_block(block)
-
-        self._check_invariant()
-
-    def __iter__(self):
-        return self
-
-    def __next__(self):
-        if self.pos == self.count:
-            raise StopIteration()
-
-        if self.block_pos == self.block_count:
-            self._next_block(self.block['pNext'])
-
-        name = self.name()
-        val = self.value()
-        self.advance()
-
-        self._check_invariant()
-        return (name, val)
-
-    def _next_block(self, block):
-        assert block
-
-        self.block = block.dereference()
-        self.block_pos = 0
-        self.block_count = block['nCount']
-
-        assert self.block_count <= block['nSize']
-        assert self.block_count + self.pos <= self.count
-
-    def _check_invariant(self):
-        assert self.count >= 0
-        assert self.pos >= 0
-        assert self.pos <= self.count
-        assert self.block_count >= 0
-        if self.pos < self.count:
-            assert self.block_count > 0
-            assert self.block != None
-        assert self.block_count <= self.count
-        assert self.block_pos >= 0
-        assert self.block_pos <= self.block_count
-
-class NoItemType(Exception):
-    pass
-
-class ContainerHelper(object):
-    '''Provides support for specialized container printers'''
-
-    def __init__(self, typename, val, iterator):
-        self.typename = typename
-        self.val = val
-        self.iterator = iterator
-
-    def to_string(self):
-        size = self.val['nCount']
-        if size > 0:
-            return "%s of length %d" % (self.typename, size)
-        elif size == 0:
-            return "empty %s" % self.typename
-        else:
-            return "invalid %s" % self.typename
-
-    def children(self):
-        count = self.val.cast(gdb.lookup_type('Container'))['nCount']
-        return self.iterator(self.val['pFirstBlock'], count)
-
-class LinearIterator(IteratorHelper):
-    '''Is iterator for 'linear' container'''
-
-    def __init__(self, block, count, type = None):
-        super(LinearIterator, self).__init__(block, count, type)
-
-    def name(self):
-        return str(self.pos)
-
-    def value(self):
-        nodes = self.block['pNodes']#.cast(self.type.pointer())
-        return nodes[self.block_pos]
-
-    def advance(self):
-        self.pos += 1
-        self.block_pos += 1
-
-class LinearContainerPrinter(ContainerHelper):
-    '''Prints 'linear' container, like DynArray or List'''
-
-    def __init__(self, typename, val):
-        super(LinearContainerPrinter, self).__init__(typename, val, LinearIterator)
-
-    def display_hint(self):
-        return 'array'
-
-class TableIterator(IteratorHelper):
-    '''Is iterator for Table'''
-
-    def __init__(self, block, count, type = None):
-        super(TableIterator, self).__init__(block, count, type)
-        # ULONG doesn't work on 64-bit for some reason (gdb says it has
-        # size 4 and it's not a typedef to sal_uIntPtr)
-        self._key_type = gdb.lookup_type('sal_uIntPtr')
-        self.is_key = True
-
-    def name(self):
-        return ''
-
-    def value(self):
-        nodes = self.block['pNodes']#.cast(self.type.pointer())
-        val = nodes[self.block_pos]
-        if self.is_key:
-            val = str(val.cast(self._key_type))
-        return val
-
-    def advance(self):
-        self.pos += 1
-        self.block_pos += 1
-        self.is_key = not self.is_key
-
-class TablePrinter(ContainerHelper):
-    '''Prints table'''
-
-    def __init__(self, typename, val):
-        super(TablePrinter, self).__init__(typename, val, TableIterator)
-
-    def display_hint(self):
-        return 'map'
-
 class PointPrinter(object):
     '''Prints a Point.'''
 
@@ -358,12 +217,6 @@ def build_pretty_printers():
 
     printer = printing.Printer('libreoffice/tl')
 
-    # old-style containers
-    printer.add('DynArray', LinearContainerPrinter)
-    printer.add('List', LinearContainerPrinter)
-    printer.add('Stack', LinearContainerPrinter)
-    printer.add('Table', TablePrinter)
-
     # various types
     printer.add('BigInt', BigIntPrinter)
     printer.add('Color', ColorPrinter)
commit a4faad707c7fb27884fff5f20e5797b160d4f320
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Jan 27 21:33:31 2015 +0100

    tdf#76174: basic: lock SolarMutex in BasicScriptListener_Impl
    
    ... before calling into BASIC.
    
    Change-Id: I51a59fe5ca9b15ff7ec509c052964523d87a9790

diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx
index 943d96d..e67f5b3 100644
--- a/basic/source/classes/eventatt.cxx
+++ b/basic/source/classes/eventatt.cxx
@@ -48,7 +48,7 @@
 #include <basic/basicmanagerrepository.hxx>
 #include <basic/basmgr.hxx>
 
-
+#include <vcl/svapp.hxx>
 #include <xmlscript/xmldlg_imexp.hxx>
 #include <sbunoobj.hxx>
 #include <basic/sbstar.hxx>
@@ -161,12 +161,16 @@ public:
 // Methods XAllListener
 void BasicScriptListener_Impl::firing( const ScriptEvent& aScriptEvent ) throw ( RuntimeException, std::exception )
 {
+    SolarMutexGuard g;
+
     firing_impl( aScriptEvent, NULL );
 }
 
 Any BasicScriptListener_Impl::approveFiring( const ScriptEvent& aScriptEvent )
     throw ( InvocationTargetException, RuntimeException, std::exception )
 {
+    SolarMutexGuard g;
+
     Any aRetAny;
     firing_impl( aScriptEvent, &aRetAny );
     return aRetAny;
commit 74df327e1ef4edf4ca07d04ae72ee052d824564f
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Jan 27 21:33:08 2015 +0100

    scripting: remove unnecessary SAL_CALL
    
    Change-Id: Ic1fbb36a509ec1dce63f1c7fa4a8955a4780517d

diff --git a/scripting/source/dlgprov/dlgevtatt.cxx b/scripting/source/dlgprov/dlgevtatt.cxx
index 62f8803..05567a3 100644
--- a/scripting/source/dlgprov/dlgevtatt.cxx
+++ b/scripting/source/dlgprov/dlgevtatt.cxx
@@ -211,7 +211,7 @@ namespace dlgprov
     }
 
 
-    void SAL_CALL DialogEventsAttacherImpl::attachEventsToControl( const Reference< XControl>& xControl, const Reference< XScriptEventsSupplier >& xEventsSupplier, const Any& Helper )
+    void DialogEventsAttacherImpl::attachEventsToControl( const Reference< XControl>& xControl, const Reference< XScriptEventsSupplier >& xEventsSupplier, const Any& Helper )
     {
         if ( xEventsSupplier.is() )
         {
diff --git a/scripting/source/dlgprov/dlgevtatt.hxx b/scripting/source/dlgprov/dlgevtatt.hxx
index 45b29c7..3f12f25 100644
--- a/scripting/source/dlgprov/dlgevtatt.hxx
+++ b/scripting/source/dlgprov/dlgevtatt.hxx
@@ -56,7 +56,7 @@ namespace dlgprov
         ::com::sun::star::uno::Reference< ::com::sun::star::script::XScriptListener > getScriptListenerForKey( const OUString& sScriptName ) throw ( ::com::sun::star::uno::RuntimeException );
         ::com::sun::star::uno::Reference< ::com::sun::star::script::XScriptEventsSupplier > getFakeVbaEventsSupplier( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& xControl, OUString& sCodeName );
         void nestedAttachEvents( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > >& Objects, const ::com::sun::star::uno::Any& Helper, OUString& sDialogCodeName );
-        void  SAL_CALL attachEventsToControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& xControl, const ::com::sun::star::uno::Reference< ::com::sun::star::script::XScriptEventsSupplier >& events, const ::com::sun::star::uno::Any& Helper  );
+        void attachEventsToControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& xControl, const ::com::sun::star::uno::Reference< ::com::sun::star::script::XScriptEventsSupplier >& events, const ::com::sun::star::uno::Any& Helper  );
     public:
         DialogEventsAttacherImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
              const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel,
commit bcaf96e52450ee49314b9af2fcbae47b8d6d9618
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Jan 27 21:32:26 2015 +0100

    vcl: copy-pasted SAL_WARN_IF condition
    
    Change-Id: Icb0109b954b9a7710309cc9bca30309a6ec90a73

diff --git a/vcl/generic/app/geninst.cxx b/vcl/generic/app/geninst.cxx
index 0310435..327d880 100644
--- a/vcl/generic/app/geninst.cxx
+++ b/vcl/generic/app/geninst.cxx
@@ -117,7 +117,7 @@ bool SalGenericInstance::CheckYieldMutex()
     SalYieldMutex* pYieldMutex = mpSalYieldMutex;
     if ( pYieldMutex->GetThreadId() != osl::Thread::getCurrentIdentifier() )
     {
-        SAL_WARN_IF( pYieldMutex->GetThreadId() != osl::Thread::getCurrentIdentifier(), "vcl", "CheckYieldMutex: " << pYieldMutex->GetThreadId() << "!=" << osl::Thread::getCurrentIdentifier() );
+        SAL_WARN("vcl", "CheckYieldMutex: " << pYieldMutex->GetThreadId() << "!=" << osl::Thread::getCurrentIdentifier() );
         bRet = false;
     }
 


More information about the Libreoffice-commits mailing list