[Libreoffice-commits] .: 3 commits - sw/inc sw/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Wed Dec 14 02:19:46 PST 2011


 sw/inc/doc.hxx                      |    2 --
 sw/inc/ndarr.hxx                    |    2 --
 sw/inc/ndtxt.hxx                    |    2 --
 sw/inc/node.hxx                     |    4 ----
 sw/source/core/docnode/nodedump.cxx |    7 +++----
 sw/source/core/layout/trvlfrm.cxx   |    6 ++++--
 sw/source/filter/ww8/WW8Sttbf.cxx   |    2 +-
 sw/source/ui/docvw/edtwin.cxx       |    4 +---
 8 files changed, 9 insertions(+), 20 deletions(-)

New commits:
commit 8e17c11e25d7e0ecd3a8a5ab4a4a3bd98d8c81b7
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Tue Dec 13 17:25:51 2011 +0100

    n#676858: Fix selection of background pictures vs text

diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index 4b54a68..d2c3d4e 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -31,6 +31,7 @@
 #include <hintids.hxx>
 #include <hints.hxx>
 #include <tools/bigint.hxx>
+#include <editeng/opaqitem.hxx>
 #include <editeng/protitem.hxx>
 #include <vcl/settings.hxx>
 #include <vcl/outdev.hxx>
@@ -78,7 +79,8 @@ namespace {
                                 static_cast<const SwVirtFlyDrawObj*>(aIter());
             const SwAnchoredObject* pAnchoredObj = GetUserCall( aIter() )->GetAnchoredObj( aIter() );
             const SwFmtSurround& rSurround = pAnchoredObj->GetFrmFmt().GetSurround();
-            bool bInBackground = ( rSurround.GetSurround() == SURROUND_THROUGHT );
+            const SvxOpaqueItem& rOpaque = pAnchoredObj->GetFrmFmt().GetOpaque();
+            bool bInBackground = ( rSurround.GetSurround() == SURROUND_THROUGHT ) && !rOpaque.GetValue();
 
             bool bBackgroundMatches = ( bInBackground && bSearchBackground ) ||
                                       ( !bInBackground && !bSearchBackground );
@@ -274,7 +276,7 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
         }
 
         // TODO Pick up the best approaching selection
-        if ( bTextRet && bBackRet && ( nTextSurface < nBackSurface ) )
+        if ( bTextRet && bBackRet && ( nTextSurface > nBackSurface ) )
         {
             bRet = bBackRet;
             pPos->nNode = aBackPos.nNode;
commit 3c1bc2311c297bbabba45e62e123d44061bd348c
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Tue Dec 13 18:21:52 2011 +0100

    sw: build hidden debug features in all cases
    
    To activate the layout and node dumping features in sw, set the SW_DEBUG
    environement variable to anything before running the office. F12 will
    then dump the layout as a layout.xml file in the working directory, and
    Shift+F12 will dump the nodes structure as nodes.xml at the same place.

diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 8165a57..c7255d9 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -2038,13 +2038,11 @@ public:
     ::sw::UndoManager const& GetUndoManager() const;
     SfxObjectShell* CreateCopy(bool bCallInitNew) const;
 
-#ifdef DBG_UTIL
     /**
      * Dumps the entire nodes structure to the given destination (file nodes.xml in the current directory by default)
      * @since 3.5
      */
     void dumpAsXml( xmlTextWriterPtr writer = NULL );
-#endif
 
     /// must be called only in SwDocShell::InitNew, causes UpdateDrawDefaults to be called when drawing layer is created
     void SetDrawDefaults();
diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx
index 389069b..d560637 100644
--- a/sw/inc/ndarr.hxx
+++ b/sw/inc/ndarr.hxx
@@ -337,13 +337,11 @@ public:
     SwNode * DocumentSectionStartNode(SwNode * pNode) const;
     SwNode * DocumentSectionEndNode(SwNode * pNode) const;
 
-#ifdef DBG_UTIL
     /**
      * Dumps the entire nodes structure to the given destination (file nodes.xml in the current directory by default)
      * @since 3.5
      */
     void dumpAsXml( xmlTextWriterPtr writer = NULL );
-#endif
 };
 
 #endif
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 52bae7a..b4a772d 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -801,9 +801,7 @@ public:
 
     bool IsCollapse() const;
 
-#ifdef DBG_UTIL
     virtual void dumpAsXml( xmlTextWriterPtr writer = NULL );
-#endif
 
     DECL_FIXEDMEMPOOL_NEWDEL(SwTxtNode)
 };
diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx
index bbe3c59..f75091a 100644
--- a/sw/inc/node.hxx
+++ b/sw/inc/node.hxx
@@ -292,13 +292,11 @@ public:
 
     sal_uInt8 HasPrevNextLayNode() const;
 
-#ifdef DBG_UTIL
     /**
      * Dumps the node structure to the given destination (file nodes.xml in the current directory by default)
      * @since 3.5
      */
     virtual void dumpAsXml( xmlTextWriterPtr writer = NULL );
-#endif
 
 private:
     // Private constructor because copying is never allowed!!
@@ -333,9 +331,7 @@ public:
     // Call ChkCondcoll to all ContentNodes of section.
     void CheckSectionCondColl() const;
 
-#ifdef DBG_UTIL
     virtual void dumpAsXml( xmlTextWriterPtr writer = NULL );
-#endif
 
 private:
     // Private constructor because copying is never allowed!!
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index 0e723ce..447967c 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -29,8 +29,6 @@
 #include "doc.hxx"
 #include "ndtxt.hxx"
 
-#ifdef DBG_UTIL
-
 namespace
 {
 
@@ -153,6 +151,7 @@ void SwNode::dumpAsXml( xmlTextWriterPtr w )
     }
     writer.startElement( name );
     writer.writeFormatAttribute( "ptr", "%p", this );
+    writer.writeFormatAttribute( "index", "%lu", GetIndex() );
     writer.endElement();
     if( GetNodeType() == ND_ENDNODE )
         writer.endElement(); // end start node
@@ -185,6 +184,7 @@ void SwStartNode::dumpAsXml( xmlTextWriterPtr w )
     }
     writer.startElement( name );
     writer.writeFormatAttribute( "ptr", "%p", this );
+    writer.writeFormatAttribute( "index", "%lu", GetIndex() );
     // writer.endElement(); - it is a start node, so don't end, will make xml better nested
 }
 
@@ -193,6 +193,7 @@ void SwTxtNode::dumpAsXml( xmlTextWriterPtr w )
     WriterHelper writer( w );
     writer.startElement( "text" );
     writer.writeFormatAttribute( "ptr", "%p", this );
+    writer.writeFormatAttribute( "index", "%lu", GetIndex() );
     rtl::OUString txt = GetTxt();
     for( int i = 0; i < 32; ++i )
         txt = txt.replace( i, '*' );
@@ -201,6 +202,4 @@ void SwTxtNode::dumpAsXml( xmlTextWriterPtr w )
     writer.endElement();
 }
 
-#endif // DBG_UTIL
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 51fa548..78d18fa 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -1360,8 +1360,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
     sal_Bool bChkInsBlank = pQuickHlpData->bChkInsBlank;
     pQuickHlpData->bChkInsBlank = sal_False;
 
-#ifdef DBG_UTIL
-    if (rKEvt.GetKeyCode().GetCode() == KEY_F12)
+    if ( getenv("SW_DEBUG") && rKEvt.GetKeyCode().GetCode() == KEY_F12 )
     {
         if( rKEvt.GetKeyCode().IsShift())
         {
@@ -1375,7 +1374,6 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
             return;
         }
     }
-#endif
 
     KeyEvent aKeyEvent( rKEvt );
     // look for vertical mappings
commit 009eac0af5f0d0167ce6c46896a34cbaae82a5c4
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Tue Dec 13 17:25:01 2011 +0100

    sw: fix dbglevel 2 build error

diff --git a/sw/source/filter/ww8/WW8Sttbf.cxx b/sw/source/filter/ww8/WW8Sttbf.cxx
index e331160..fecb58b 100644
--- a/sw/source/filter/ww8/WW8Sttbf.cxx
+++ b/sw/source/filter/ww8/WW8Sttbf.cxx
@@ -103,7 +103,7 @@ namespace ww8
         snprintf(sBuffer, sizeof(sBuffer), "offset=\"%" SAL_PRIuUINT32 "\" count=\"%" SAL_PRIuUINT32 "\"",
                  nOffset, nCount);
         ::std::clog << "<WW8Struct-getUString" << sBuffer << ">"
-                    << dbg_out(aResult) << "</WW8Struct-getUString>"
+                    << rtl::OUStringToOString( aResult, RTL_TEXTENCODING_UTF8 ).getStr() << "</WW8Struct-getUString>"
                     << ::std::endl;
 #endif
 


More information about the Libreoffice-commits mailing list