[Libreoffice-commits] .: Branch 'integration/dev300_m101' - sw/inc sw/Library_sw.mk sw/source

Michael Meeks mmeeks at kemper.freedesktop.org
Tue Mar 15 06:51:31 PDT 2011


 sw/Library_sw.mk                  |    2 ++
 sw/inc/crsrsh.hxx                 |    2 +-
 sw/source/core/bastyp/swcache.cxx |    2 +-
 sw/source/core/crsr/trvltbl.cxx   |    2 +-
 sw/source/core/doc/acmplwrd.cxx   |    2 +-
 sw/source/core/doc/docfly.cxx     |    2 +-
 sw/source/core/doc/doclay.cxx     |    2 --
 sw/source/core/edit/editsh.cxx    |    2 +-
 sw/source/core/inc/scriptinfo.hxx |    4 ++--
 sw/source/core/layout/dbg_lay.cxx |    3 ++-
 sw/source/core/layout/ftnfrm.cxx  |    2 +-
 sw/source/core/ole/ndole.cxx      |    4 ++--
 sw/source/core/text/porlay.hxx    |    2 +-
 sw/source/core/text/porlin.hxx    |    2 +-
 sw/source/core/text/portxt.hxx    |    2 +-
 sw/source/core/text/txtio.cxx     |    6 +++---
 sw/source/core/text/xmldump.cxx   |   15 +++++++--------
 sw/source/core/undo/undobj.cxx    |    4 ++--
 sw/source/core/undo/unins.cxx     |    1 -
 sw/source/filter/rtf/swparrtf.cxx |    2 +-
 sw/source/filter/ww1/fltshell.cxx |    2 +-
 sw/source/ui/app/docsh2.cxx       |    2 +-
 22 files changed, 33 insertions(+), 34 deletions(-)

New commits:
commit 627ea629f861a24cfcfad1e9992ef94b7bb9e69a
Author: Michael Meeks <michael.meeks at novell.com>
Date:   Tue Mar 15 13:50:53 2011 +0000

    fix compile with debug enabled

diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index b79e71d..d9b0034 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -80,6 +80,7 @@ $(eval $(call gb_Library_add_linked_libs,sw,\
     vbahelper \
     vcl \
     xo \
+    xml2 \
     $(gb_STDLIBS) \
 ))
 
@@ -376,6 +377,7 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
     sw/source/core/text/txttab \
     sw/source/core/text/widorp \
     sw/source/core/text/wrong \
+    sw/source/core/text/xmldump \
     sw/source/core/tox/tox \
     sw/source/core/tox/toxhlp \
     sw/source/core/tox/txmsrt \
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 9d69a0b..2a91682 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -452,7 +452,7 @@ public:
 
 #if OSL_DEBUG_LEVEL > 1
     void SttCrsrMove();
-    void EndCrsrMove( const sal_Bool bIdleEnd = FALSE );
+    void EndCrsrMove( const sal_Bool bIdleEnd = sal_False );
 #else
     void SttCrsrMove() { ++nCrsrMove; StartAction(); }
     void EndCrsrMove( const sal_Bool bIdleEnd = sal_False )
diff --git a/sw/source/core/bastyp/swcache.cxx b/sw/source/core/bastyp/swcache.cxx
index 1ad3935..f5320ac 100644
--- a/sw/source/core/bastyp/swcache.cxx
+++ b/sw/source/core/bastyp/swcache.cxx
@@ -177,7 +177,7 @@ void SwCache::Flush( const sal_uInt8 )
 #if OSL_DEBUG_LEVEL > 1
         if ( pObj->IsLocked() )
         {
-            OSL_ENSURE( TRUE, "Flushing locked objects." );
+            OSL_ENSURE( sal_False, "Flushing locked objects." );
             if ( !pRealFirst )
             {
                 pRealFirst = pFirst = pLast = pObj;
diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx
index 4919a35..bfdc696 100644
--- a/sw/source/core/crsr/trvltbl.cxx
+++ b/sw/source/core/crsr/trvltbl.cxx
@@ -309,7 +309,7 @@ sal_Bool SwCrsrShell::SelTblBox()
     // frame. This should yield the same result as searching for the
     // table box start node, right?
     SwFrm *pFrm = GetCurrFrm();
-    DBG_ASSERT( !pFrm->IsInTab() == !(pStartNode != NULL),
+    OSL_ENSURE( !pFrm->IsInTab() == !(pStartNode != NULL),
                 "Schroedinger's table: We're in a box, and also we aren't." );
 #endif
 
diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx
index 7157cd4..38d6d88 100644
--- a/sw/source/core/doc/acmplwrd.cxx
+++ b/sw/source/core/doc/acmplwrd.cxx
@@ -248,7 +248,7 @@ SwAutoCompleteWord::~SwAutoCompleteWord()
 #if OSL_DEBUG_LEVEL > 1
     sal_uLong nStrings = SwAutoCompleteString::GetElementCount();
     sal_uLong nClients = SwAutoCompleteClient::GetElementCount();
-    DBG_ASSERT(!nStrings && !nClients, "AutoComplete: clients or string count mismatch");
+    OSL_ENSURE(!nStrings && !nClients, "AutoComplete: clients or string count mismatch");
 #endif
 }
 
diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx
index a609a0e..3d3f83a 100644
--- a/sw/source/core/doc/docfly.cxx
+++ b/sw/source/core/doc/docfly.cxx
@@ -406,7 +406,7 @@ lcl_SetFlyFrmAttr(SwDoc & rDoc,
         case RES_PAGEDESC:
         case RES_CNTNT:
         case RES_FOOTER:
-            OSL_ENSURE( !this, ":-) Unbekanntes Attribut fuer Fly." );
+            OSL_ENSURE( sal_False, ":-) Unbekanntes Attribut fuer Fly." );
             // kein break;
         case RES_CHAIN:
             rSet.ClearItem( nWhich );
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index cb21ee6..f356f54 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -1517,8 +1517,6 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
 {
     ::sw::UndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
     ::sw::DrawUndoGuard const drawUndoGuard(rDoc.GetIDocumentUndoRedo());
-    OSL_ENSURE( RES_DRAWFRMFMT == pContact->GetFmt()->Which(),
-            "Kein DrawFrmFmt" );
 
     // Erstmal das Feld bauen, weil ueber den Namen die TxtColl besorgt
     // werden muss
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index 910a8ac..3a8a19b 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -688,7 +688,7 @@ Graphic SwEditShell::GetIMapGraphic() const
                                     GRAPHIC_DEFAULT == rGrf.GetType() ) )
             {
 #if OSL_DEBUG_LEVEL > 1
-                OSL_ENSURE( ((SwGrfNode*)pNd)->SwapIn( TRUE ) || !TRUE, "Grafik konnte nicht geladen werden" );
+                OSL_ENSURE( ((SwGrfNode*)pNd)->SwapIn( sal_True ), "Grafik konnte nicht geladen werden" );
 #else
                 ((SwGrfNode*)pNd)->SwapIn( sal_True );
 #endif
diff --git a/sw/source/core/inc/scriptinfo.hxx b/sw/source/core/inc/scriptinfo.hxx
index 3447e7e..636e884 100644
--- a/sw/source/core/inc/scriptinfo.hxx
+++ b/sw/source/core/inc/scriptinfo.hxx
@@ -401,7 +401,7 @@ inline sal_uInt8 SwScriptInfo::GetDirType( const size_t nCnt ) const
 inline size_t SwScriptInfo::CountKashida() const { return aKashida.size(); }
 inline xub_StrLen SwScriptInfo::GetKashida( const size_t nCnt ) const
 {
-    OSL_ENSURE( nCnt < aKashida.Count(),"No Kashidas today!");
+    OSL_ENSURE( nCnt < aKashida.size(),"No Kashidas today!");
     return aKashida[ nCnt ];
 }
 
@@ -426,7 +426,7 @@ inline sal_uInt8 SwScriptInfo::GetCompType( const size_t nCnt ) const
 inline size_t SwScriptInfo::CountHiddenChg() const { return aHiddenChg.size(); };
 inline xub_StrLen SwScriptInfo::GetHiddenChg( const size_t nCnt ) const
 {
-    OSL_ENSURE( nCnt < aHiddenChg.Count(),"No HiddenChg today!");
+    OSL_ENSURE( nCnt < aHiddenChg.size(),"No HiddenChg today!");
     return aHiddenChg[ nCnt ];
 }
 
diff --git a/sw/source/core/layout/dbg_lay.cxx b/sw/source/core/layout/dbg_lay.cxx
index b751587..5cec2cd 100644
--- a/sw/source/core/layout/dbg_lay.cxx
+++ b/sw/source/core/layout/dbg_lay.cxx
@@ -29,8 +29,9 @@
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_sw.hxx"
 
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
 
+/*
  * Und hier die Beschreibung:
  *
  * Durch die PROTOCOL-Makros wird es ermoeglicht, Ereignisse im Frame-Methoden zu protokollieren.
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index 28f1c80..bfd1f28 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -2365,7 +2365,7 @@ void SwFtnBossFrm::MoveFtns( const SwCntntFrm *pSrc, SwCntntFrm *pDest,
         || pAttr->GetFtn().IsEndNote() )
         return;
 
-    OSL_ENSURE( this == pSrc->FindFtnBossFrm( TRUE ),
+    OSL_ENSURE( this == pSrc->FindFtnBossFrm( sal_True ),
             "SwPageFrm::MoveFtns: source frame isn't on that FtnBoss" );
 
     SwFtnFrm *pFtn = FindFirstFtn();
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index e16ea80..9e6fa8e 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -429,8 +429,8 @@ SwCntntNode* SwOLENode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
     {
         // TODO/LATER: is EmbeddedObjectContainer not enough?
         // the created document will be closed by pDoc ( should use SfxObjectShellLock )
-        OSL_ENSURE( pDoc->GetRefForDocShell(),
-                        "wo ist die Ref-Klasse fuer die DocShell?");
+        pPersistShell = new SwDocShell( pDoc, SFX_CREATE_MODE_INTERNAL );
+        pDoc->SetTmpDocShell( pPersistShell );
         pPersistShell->DoInitNew( NULL );
     }
 
diff --git a/sw/source/core/text/porlay.hxx b/sw/source/core/text/porlay.hxx
index 4d92df4..7aa26e2 100644
--- a/sw/source/core/text/porlay.hxx
+++ b/sw/source/core/text/porlay.hxx
@@ -260,7 +260,7 @@ public:
     void DebugPortions( SvStream &rOs, const XubString &rTxt,
                         const xub_StrLen nStart ); //$ ostream
 
-    void dumpLineAsXml(xmlTextWriter* writer, USHORT& ofs, String& aText);
+    void dumpLineAsXml(xmlTextWriter* writer, sal_uInt16& ofs, String& aText);
 #endif
 
     OUTPUT_OPERATOR
diff --git a/sw/source/core/text/porlin.hxx b/sw/source/core/text/porlin.hxx
index 0d74613..8d9693f 100644
--- a/sw/source/core/text/porlin.hxx
+++ b/sw/source/core/text/porlin.hxx
@@ -201,7 +201,7 @@ public:
     virtual void HandlePortion( SwPortionHandler& rPH ) const;
 
 #if OSL_DEBUG_LEVEL > 1
-    void dumpPortionAsXml(USHORT ofs, String& aText, xmlTextWriter* writer);
+    void dumpPortionAsXml(sal_uInt16 ofs, String& aText, xmlTextWriter* writer);
 #endif
     OUTPUT_OPERATOR
 };
diff --git a/sw/source/core/text/portxt.hxx b/sw/source/core/text/portxt.hxx
index 2715c67..5fe9a93 100644
--- a/sw/source/core/text/portxt.hxx
+++ b/sw/source/core/text/portxt.hxx
@@ -68,7 +68,7 @@ public:
     virtual void HandlePortion( SwPortionHandler& rPH ) const;
 
 #if OSL_DEBUG_LEVEL > 1
-    void dumpPortionAsXml(USHORT ofs, String& aText, xmlTextWriter* writer);
+    void dumpPortionAsXml(sal_uInt16 ofs, String& aText, xmlTextWriter* writer);
 #endif
 
     OUTPUT_OPERATOR
diff --git a/sw/source/core/text/txtio.cxx b/sw/source/core/text/txtio.cxx
index 3dff0c6..60a955e 100644
--- a/sw/source/core/text/txtio.cxx
+++ b/sw/source/core/text/txtio.cxx
@@ -29,7 +29,7 @@
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_sw.hxx"
 
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
 
 #include "viewsh.hxx"       // IsDbg()
 #include "viewopt.hxx"      // IsDbg()
@@ -730,8 +730,8 @@ SvStream &SwDropPortion::operator<<( SvStream &rOs ) const //$ ostream
     return rOs;
 }
 
-#endif /* OSL_DEBUG_LEVEL */
+#endif
 
-#endif // DBG_UTIL
+#endif /* OSL_DEBUG_LEVEL */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx
index a92bb46..2f610c6 100644
--- a/sw/source/core/text/xmldump.cxx
+++ b/sw/source/core/text/xmldump.cxx
@@ -33,15 +33,14 @@
 #include "porlin.hxx"
 #include "porlay.hxx"
 #include "portxt.hxx"
+#include <libxml/xmlwriter.h>
 #include <SwPortionHandler.hxx>
 
-
-
 class XmlPortionDumper:public SwPortionHandler
 {
   private:
     xmlTextWriterPtr writer;
-    USHORT ofs;
+    sal_uInt16 ofs;
   public:
 
     XmlPortionDumper( xmlTextWriterPtr some_writer ):writer( some_writer ), ofs( 0 )
@@ -58,8 +57,8 @@ class XmlPortionDumper:public SwPortionHandler
         @param rText
                 text which is painted on-screen
       */
-    virtual void Text( USHORT nLength,
-                       USHORT nType )
+    virtual void Text( sal_uInt16 nLength,
+                       sal_uInt16 nType )
     {
         ofs += nLength;
         xmlTextWriterStartElement( writer, BAD_CAST( "Text" ) );
@@ -80,9 +79,9 @@ class XmlPortionDumper:public SwPortionHandler
         @param nType
                 type of this portion
       */
-    virtual void Special( USHORT nLength,
+    virtual void Special( sal_uInt16 nLength,
                           const String & rText,
-                          USHORT nType )
+                          sal_uInt16 nType )
     {
         xmlTextWriterStartElement( writer, BAD_CAST( "Special" ) );
         xmlTextWriterWriteFormatAttribute( writer,
@@ -111,7 +110,7 @@ class XmlPortionDumper:public SwPortionHandler
       * @param nLength
       *         number of 'model string' characters to be skipped
       */
-    virtual void Skip( USHORT nLength )
+    virtual void Skip( sal_uInt16 nLength )
     {
         xmlTextWriterStartElement( writer, BAD_CAST( "Skip" ) );
         xmlTextWriterWriteFormatAttribute( writer,
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index e0b97dd..f28e597 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -940,8 +940,8 @@ void SwUndoSaveSection::RestoreSection( SwDoc* pDoc, SwNodeIndex* pIdx,
     {
         // ueberpruefe, ob der Inhalt an der alten Position steht
         SwNodeIndex aSttIdx( pDoc->GetNodes(), nStartPos );
-        OSL_ENSURE( !pDoc->GetNodes()[ aSttIdx ]->GetCntntNode(),
-                "RestoreSection(): Position on content node");
+//        OSL_ENSURE( !pDoc->GetNodes()[ aSttIdx ]->GetCntntNode(),
+//                "RestoreSection(): Position on content node");
 
         // move den Inhalt aus dem UndoNodes-Array in den Fly
         SwStartNode* pSttNd = pDoc->GetNodes().MakeEmptySection( aSttIdx,
diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx
index b682857..6865499 100644
--- a/sw/source/core/undo/unins.cxx
+++ b/sw/source/core/undo/unins.cxx
@@ -513,7 +513,6 @@ SwUndoReplace::SwUndoReplace(SwPaM const& rPam,
     : SwUndo( UNDO_REPLACE )
     , m_pImpl(new Impl(rPam, rIns, bRegExp))
 {
-        OSL_ENSURE( !nAktPos, "Redo ohne vorheriges Undo??" );
 }
 
 SwUndoReplace::~SwUndoReplace()
diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx
index fb46f26..78c7bef 100644
--- a/sw/source/filter/rtf/swparrtf.cxx
+++ b/sw/source/filter/rtf/swparrtf.cxx
@@ -379,7 +379,7 @@ void SwRTFParser::Continue( int nToken )
 
 #if OSL_DEBUG_LEVEL > 1
             // !!! sollte nicht moeglich sein, oder ??
-            OSL_ENSURE( pSttNdIdx->GetIndex()+1 != pPam->GetBound( TRUE ).nNode.GetIndex(),
+            OSL_ENSURE( pSttNdIdx->GetIndex()+1 != pPam->GetBound( sal_True ).nNode.GetIndex(),
                 "Pam.Bound1 steht noch im Node" );
             OSL_ENSURE( pSttNdIdx->GetIndex()+1 != pPam->GetBound( sal_False ).nNode.GetIndex(),
                 "Pam.Bound2 steht noch im Node" );
diff --git a/sw/source/filter/ww1/fltshell.cxx b/sw/source/filter/ww1/fltshell.cxx
index e7cd3af..ebe2a62 100644
--- a/sw/source/filter/ww1/fltshell.cxx
+++ b/sw/source/filter/ww1/fltshell.cxx
@@ -1625,7 +1625,7 @@ sal_Bool SwFltOutDoc::SeekCell(short nRow, short nCol, sal_Bool bPam)
 
     if ((sal_uInt16)nRow >= pTableLines->Count())
     {
-       OSL_ENSURE((USHORT)nRow >= pTableLines->Count(), "SwFltOutDoc");
+       OSL_ENSURE((sal_uInt16)nRow >= pTableLines->Count(), "SwFltOutDoc");
         return sal_False;
     }
     pTableLine = (*pTableLines)[nRow];
diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx
index 49bdd98..c293d82 100644
--- a/sw/source/ui/app/docsh2.cxx
+++ b/sw/source/ui/app/docsh2.cxx
@@ -888,7 +888,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
 #if OSL_DEBUG_LEVEL > 1
                 {
                     sal_Bool bWeb = 0 != dynamic_cast<SwWebDocShell*>(this);
-                    OSL_ENSURE(bWeb == TRUE, "SourceView only in WebDocShell");
+                    OSL_ENSURE(bWeb == sal_True, "SourceView only in WebDocShell");
                 }
 #endif
                 // the SourceView is not the 1 for SwWebDocShell


More information about the Libreoffice-commits mailing list