ooo-build r14869 - trunk/patches/test



Author: michael
Date: Tue Dec 16 11:27:12 2008
New Revision: 14869
URL: http://svn.gnome.org/viewvc/ooo-build?rev=14869&view=rev

Log:
debugging patch


Added:
   trunk/patches/test/sw-dump-layout-tree.diff

Added: trunk/patches/test/sw-dump-layout-tree.diff
==============================================================================
--- (empty file)
+++ trunk/patches/test/sw-dump-layout-tree.diff	Tue Dec 16 11:27:12 2008
@@ -0,0 +1,232 @@
+diff --git a/sw/source/core/inc/bodyfrm.hxx b/sw/source/core/inc/bodyfrm.hxx
+index e4492dc..db991fe 100644
+--- sw/source/core/inc/bodyfrm.hxx
++++ sw/source/core/inc/bodyfrm.hxx
+@@ -46,6 +46,8 @@ protected:
+ public:
+ 	SwBodyFrm( SwFrmFmt* );
+ 
++        virtual	void Paint( const SwRect& ) const;
++
+ 	DECL_FIXEDMEMPOOL_NEWDEL(SwBodyFrm)
+ };
+ 
+diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
+index 1316abd..66a88a2 100644
+--- sw/source/core/inc/frame.hxx
++++ sw/source/core/inc/frame.hxx
+@@ -33,6 +33,8 @@
+ #include "swtypes.hxx"	// fuer SwTwips
+ #include "swrect.hxx"
+ #include "calbck.hxx"	// fuer SwClient
++#include <libxml/encoding.h>
++#include <libxml/xmlwriter.h>
+ 
+ class SwLayoutFrm;
+ class SwRootFrm;
+@@ -916,6 +918,10 @@ public:
+ 
+     // FME 2007-08-30 #i81146# new loop control
+     void ValidateThisAndAllLowers( const USHORT nStage );
++
++public:
++    virtual void dumpAsXml(xmlTextWriterPtr writer);
++    void dumpChildrenAsXml(xmlTextWriterPtr writer);
+ };
+ 
+ inline BOOL	SwFrm::IsInDocBody() const
+diff --git a/sw/source/core/layout/makefile.mk b/sw/source/core/layout/makefile.mk
+index c70b264..a81d484 100644
+--- sw/source/core/layout/makefile.mk
++++ sw/source/core/layout/makefile.mk
+@@ -103,7 +103,8 @@ SLOFILES =  \
+     $(SLO)$/trvlfrm.obj \
+     $(SLO)$/unusedf.obj \
+     $(SLO)$/virtoutp.obj \
+-    $(SLO)$/wsfrm.obj
++    $(SLO)$/wsfrm.obj \
++    $(SLO)$/xmldump.obj
+ 
+ .IF "$(product)"==""
+ .IF "$(cap)"==""
+diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
+index e31c6ca..a6c807a 100644
+--- sw/source/core/layout/pagechg.cxx
++++ sw/source/core/layout/pagechg.cxx
+@@ -2489,3 +2499,17 @@ const SwPageFrm& SwPageFrm::GetFormatPage() const
+     return *pRet;
+ }
+ 
++
++void SwBodyFrm::Paint( const SwRect& rRect) const
++{
++    ViewShell *pSh = GetShell();
++    OutputDevice* pOut =  pSh->GetOut();
++    pOut->Push();
++    pOut->SetLineColor(Color(255, 0, 0));
++    pOut->SetFillColor(COL_TRANSPARENT);
++//    SwRect aRect(Frm().Left()+5, Frm().Top()+5, Frm().Width()-5, Frm().Height()-5);
++    SwRect aRect=Frm();
++    pOut->DrawRect(aRect.SVRect());
++    pOut->Pop();
++    SwLayoutFrm::Paint(rRect);
++}
+diff --git a/sw/source/core/layout/xmldump.cxx b/sw/source/core/layout/xmldump.cxx
+index e69de29..0417726 100644
+--- sw/source/core/layout/xmldump.cxx
++++ sw/source/core/layout/xmldump.cxx
+@@ -0,0 +1,85 @@
++#include "precompiled_sw.hxx"
++
++#include "frame.hxx"
++#include "txtfrm.hxx"
++
++void SwFrm::dumpAsXml(xmlTextWriterPtr writer)
++{
++    const char *name=NULL;
++
++    switch(GetType()) {
++	case FRM_ROOT:
++	    name="root";
++	    break;
++	case FRM_PAGE:
++	    name="page";
++	    break;
++	case FRM_COLUMN:
++	    name="column";
++	    break;
++	case FRM_HEADER:
++	    name="header";
++	    break;
++	case FRM_FOOTER:
++	    name="footer";
++	    break;
++	case FRM_FTNCONT:
++	    name="ftncont";
++	    break;
++	case FRM_FTN:
++	    name="ftn";
++	    break;
++	case FRM_BODY:
++	    name="body";
++	    break;
++	case FRM_FLY:
++	    name="fly";
++	    break;
++	case FRM_SECTION:
++	    name="section";
++	    break;
++	case FRM_UNUSED:
++	    name="unused";
++	    break;
++	case FRM_TAB:
++	    name="tab";
++	    break;
++	case FRM_ROW:
++	    name="row";
++	    break;
++	case FRM_CELL:
++	    name="cell";
++	    break;
++	case FRM_TXT:
++	    name="txt";
++	    break;
++	case FRM_NOTXT:	   
++	    name="txt";
++	    break;
++    };
++
++    if (name!=NULL) {
++	xmlTextWriterStartElement(writer, (const xmlChar*)name);
++	if (IsTxtFrm()) {
++	    SwTxtFrm *pTxtFrm=(SwTxtFrm *)this;
++	    rtl::OUString aTxt=pTxtFrm->GetTxt();
++	    for(int i=0;i<32;i++) {
++		aTxt=aTxt.replace(i, '*');
++	    }
++	    rtl::OString aTxt8 = ::rtl::OUStringToOString (aTxt, RTL_TEXTENCODING_UTF8);
++	    xmlTextWriterWriteString(writer, (const xmlChar*)aTxt8.getStr());
++ 
++	} else {
++	    dumpChildrenAsXml(writer);
++	}
++	xmlTextWriterEndElement(writer);
++    }
++}
++
++void SwFrm::dumpChildrenAsXml(xmlTextWriterPtr writer)
++{
++    SwFrm *pFrm=GetLower();
++    for(;pFrm!=NULL;pFrm=pFrm->GetNext()) {
++	pFrm->dumpAsXml(writer);
++    }
++}
+diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
+index 9b920d1..bb5ca93 100644
+--- sw/source/ui/docvw/edtwin.cxx
++++ sw/source/ui/docvw/edtwin.cxx
+@@ -127,6 +127,7 @@
+ #include <crsskip.hxx>
+ #include <breakit.hxx>
+ #include <checkit.hxx>
++#include "../../core/inc/rootfrm.hxx"
+ 
+ #ifndef _HELPID_H
+ #include <helpid.h>
+@@ -1315,7 +1316,21 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
+ 	BOOL bChkInsBlank = pQuickHlpData->bChkInsBlank;
+ 	pQuickHlpData->bChkInsBlank = FALSE;
+ 
++	if (rKEvt.GetKeyCode().GetCode()==KEY_F12) {
++	    SwRootFrm* pLayout = GetView().GetDocShell()->GetWrtShell()->GetLayout();
++	    xmlTextWriterPtr writer = xmlNewTextWriterFilename("layout.xml", 0);
++	    if (writer!=NULL) {
++		printf("dumping layout in \"layout.xml\"\n");
++		xmlTextWriterStartDocument(writer, NULL, NULL, NULL);
++		pLayout->dumpAsXml(writer);
++		xmlTextWriterEndDocument(writer);
++		xmlFreeTextWriter(writer);
++	    }
++	    return;
++	}
++
+ 	KeyEvent aKeyEvent( rKEvt );
++
+ 	// look for vertical mappings
+ 	if( !bIsDocReadOnly && !rSh.IsSelFrmMode() && !rSh.IsObjSelected() )
+ 	{
+diff --git a/sw/util/makefile.mk b/sw/util/makefile.mk
+index 097824b..2713fdf 100644
+--- sw/util/makefile.mk
++++ sw/util/makefile.mk
+@@ -125,7 +125,8 @@ SHL1STDLIBS+= \
+ 	$(SALHELPERLIB) \
+     $(ICUUCLIB) \
+ 	$(I18NUTILLIB)	\
+-	$(AVMEDIALIB)
++	$(AVMEDIALIB)  \
++	$(LIBXML2LIB)
+ 
+ .IF "$(GUI)"=="WNT"
+ SHL1STDLIBS+= $(ADVAPI32LIB)
+@@ -155,7 +156,8 @@ SHL2STDLIBS= \
+             $(COMPHELPERLIB) \
+             $(CPPUHELPERLIB) \
+             $(CPPULIB) \
+-            $(SALLIB)
++            $(SALLIB) \
++	    $(LIBXML2LIB)
+ 
+ SHL2OBJS=   $(SLO)$/swdetect.obj \
+         $(SLO)$/swdet2.obj \
+@@ -193,7 +195,9 @@ SHL3STDLIBS= \
+ 			$(CPPUHELPERLIB)	\
+ 			$(CPPULIB) \
+             $(SALLIB) \
+-			$(SOTLIB)
++			$(SOTLIB) \
++	     $(LIBXML2LIB) 
++
+ 
+ SHL3LIBS=   $(SLB)$/swui.lib
+ LIB3TARGET = $(SLB)$/swui.lib



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]