Author: damjan
Date: Thu Feb 25 03:58:50 2016
New Revision: 1732246

URL: http://svn.apache.org/viewvc?rev=1732246&view=rev
Log:
Merge r1409459 from branches/gbuild:
debug table structure, remove lcl_printProperties

BUILDS

Build updates by: me


Modified:
    openoffice/branches/gbuild-reintegration/   (props changed)
    
openoffice/branches/gbuild-reintegration/main/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
    
openoffice/branches/gbuild-reintegration/main/writerfilter/source/dmapper/DomainMapperTableHandler.hxx

Propchange: openoffice/branches/gbuild-reintegration/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Feb 25 03:58:50 2016
@@ -1,4 +1,4 @@
-/incubator/ooo/branches/gbuild:1409313-1409425,1409427-1409428,1409430,1409432-1409436,1409438,1409440,1409442,1409444-1409446,1409452,1409454,1409457,1409470
+/incubator/ooo/branches/gbuild:1409313-1409425,1409427-1409428,1409430,1409432-1409436,1409438,1409440,1409442,1409444-1409446,1409452,1409454,1409457,1409459,1409470
 /openoffice/branches/AOO400:1503684
 /openoffice/branches/AOO410:1572480,1573601,1583349,1583635,1583666
 /openoffice/branches/alg_writerframes:1556289-1579189

Modified: 
openoffice/branches/gbuild-reintegration/main/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/gbuild-reintegration/main/writerfilter/source/dmapper/DomainMapperTableHandler.cxx?rev=1732246&r1=1732245&r2=1732246&view=diff
==============================================================================
--- 
openoffice/branches/gbuild-reintegration/main/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
 (original)
+++ 
openoffice/branches/gbuild-reintegration/main/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
 Thu Feb 25 03:58:50 2016
@@ -42,6 +42,58 @@ using namespace ::std;
 #define DEFAULT_CELL_MARGIN 108 //default cell margin, not documented 
 
 #ifdef DEBUG_DMAPPER_TABLE_HANDLER
+XMLTag::Pointer_t handleToTag(Handle_t & rHandle)
+{
+    XMLTag::Pointer_t pTag(new XMLTag("handle"));
+
+    pTag->chars(rHandle->getString());
+
+    return pTag;
+}
+
+void cellSequenceToTags(XMLTag::Pointer_t pTag, CellSequence_t & rCellSequence)
+{
+    sal_Int32 nCount = rCellSequence.getLength();
+    pTag->addAttr("count", nCount);
+
+    for (sal_Int32 n = 0; n < nCount; n++)
+    {
+        Handle_t aHandle = rCellSequence[n];        
+        pTag->addTag(handleToTag(aHandle));
+    }
+}
+
+void rowSequenceToTags(XMLTag::Pointer_t pTag, RowSequence_t & rRowSequence)
+{
+    sal_Int32 nCount = rRowSequence.getLength();
+    pTag->addAttr("count", nCount);
+
+    for (sal_Int32 n = 0; n < nCount; n++)
+    {
+        CellSequence_t & rCells = rRowSequence[n];
+        XMLTag::Pointer_t pCellTag(new XMLTag("cell"));
+        cellSequenceToTags(pCellTag, rCells);
+        pTag->addTag(pCellTag);
+    }
+}
+
+XMLTag::Pointer_t tableSequenceToTag(TableSequence_t & rTableSequence)
+{
+    XMLTag::Pointer_t pTag(new XMLTag("table"));
+    sal_Int32 nCount = rTableSequence.getLength();
+    pTag->addAttr("count", nCount);
+
+    for (sal_Int32 n = 0; n < nCount; n++)
+    {
+        RowSequence_t & rRowSequence = rTableSequence[n];
+        XMLTag::Pointer_t pRowTag(new XMLTag("row"));
+        rowSequenceToTags(pRowTag, rRowSequence);
+        pTag->addTag(pRowTag);
+    }
+
+    return pTag;
+}
+
 static void  lcl_printProperties( PropertyMapPtr pProps )
 {
     if( pProps.get() )
@@ -738,6 +790,12 @@ void DomainMapperTableHandler::endTable(
     {
         try
         {
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
+            XMLTag::Pointer_t pTag = tableSequenceToTag(*m_pTableSeq);
+            dmapper_logger->addTag(pTag);
+
+            ::std::clog << pTag->toTree() << ::std::endl;
+#endif
             uno::Reference< text::XTextTable > xTable =
                     m_xText->convertToTable(
                         *m_pTableSeq,

Modified: 
openoffice/branches/gbuild-reintegration/main/writerfilter/source/dmapper/DomainMapperTableHandler.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/gbuild-reintegration/main/writerfilter/source/dmapper/DomainMapperTableHandler.hxx?rev=1732246&r1=1732245&r2=1732246&view=diff
==============================================================================
--- 
openoffice/branches/gbuild-reintegration/main/writerfilter/source/dmapper/DomainMapperTableHandler.hxx
 (original)
+++ 
openoffice/branches/gbuild-reintegration/main/writerfilter/source/dmapper/DomainMapperTableHandler.hxx
 Thu Feb 25 03:58:50 2016
@@ -31,24 +31,33 @@
 namespace writerfilter {
 namespace dmapper {
 
-typedef ::com::sun::star::text::XTextRange TextRange_t;
-typedef ::com::sun::star::uno::Reference< TextRange_t > Handle_t;
-typedef ::com::sun::star::uno::Sequence< Handle_t> CellSequence_t;
+using namespace ::com::sun::star;
+
+typedef text::XTextRange TextRange_t;
+typedef uno::Reference< TextRange_t > Handle_t;
+typedef uno::Sequence< Handle_t> CellSequence_t;
 typedef boost::shared_ptr<CellSequence_t> CellSequencePointer_t;
-typedef ::com::sun::star::uno::Sequence< CellSequence_t > RowSequence_t;
+typedef uno::Sequence< CellSequence_t > RowSequence_t;
 typedef boost::shared_ptr<RowSequence_t> RowSequencePointer_t;
-typedef ::com::sun::star::uno::Sequence< RowSequence_t> TableSequence_t;
+typedef uno::Sequence< RowSequence_t> TableSequence_t;
 typedef boost::shared_ptr<TableSequence_t> TableSequencePointer_t;
-typedef ::com::sun::star::text::XTextAppendAndConvert Text_t;
-typedef ::com::sun::star::uno::Reference<Text_t> TextReference_t;
+typedef text::XTextAppendAndConvert Text_t;
+typedef uno::Reference<Text_t> TextReference_t;
 
-typedef ::com::sun::star::beans::PropertyValues                     
TablePropertyValues_t;
-typedef ::com::sun::star::uno::Sequence< TablePropertyValues_t >    
RowPropertyValuesSeq_t;
-typedef ::com::sun::star::uno::Sequence< RowPropertyValuesSeq_t>    
CellPropertyValuesSeq_t;
+typedef beans::PropertyValues                     TablePropertyValues_t;
+typedef uno::Sequence< TablePropertyValues_t >    RowPropertyValuesSeq_t;
+typedef uno::Sequence< RowPropertyValuesSeq_t>    CellPropertyValuesSeq_t;
 
 typedef std::vector<PropertyMapPtr>     PropertyMapVector1;
 typedef std::vector<PropertyMapVector1> PropertyMapVector2;
 
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
+XMLTag::Pointer_t handleToTag(Handle_t & rHandle);
+void cellSequenceToTag(XMLTag::Pointer_t pTag, CellSequence_t & pCellSequence);
+void rowSequenceToTag(XMLTag::Pointer_t pTag, RowSequence_t & pRowSequence);
+XMLTag::Pointer_t tableSequenceToTag(TableSequence_t & rTableSequence);
+#endif
+
 class DomainMapper_Impl;
 class TableStyleSheetEntry; 
 struct TableInfo;   


Reply via email to