[Libreoffice-commits] .: 2 commits - sw/source

Miklos Vajna vmiklos at kemper.freedesktop.org
Thu Aug 16 07:01:38 PDT 2012


 sw/source/core/access/accportions.cxx   |    4 ++--
 sw/source/core/access/accportions.hxx   |    4 ++--
 sw/source/core/inc/SwPortionHandler.hxx |    7 +++++--
 sw/source/core/text/porlin.cxx          |    2 +-
 sw/source/core/text/portxt.cxx          |    2 +-
 sw/source/core/text/xmldump.cxx         |   15 +++++++++++++--
 6 files changed, 24 insertions(+), 10 deletions(-)

New commits:
commit cecff561687865359a695f1cf6ecb99300ce121b
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Thu Aug 16 14:13:20 2012 +0200

    sw layout dump: include the height and width of SwTxtPortion
    
    Change-Id: Ia2bdff098d1bbd466f857e19315a22c835810202

diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx
index d802a2b..3fd41ec 100644
--- a/sw/source/core/access/accportions.cxx
+++ b/sw/source/core/access/accportions.cxx
@@ -112,7 +112,7 @@ SwAccessiblePortionData::~SwAccessiblePortionData()
     delete pSentences;
 }
 
-void SwAccessiblePortionData::Text(sal_uInt16 nLength, sal_uInt16 nType)
+void SwAccessiblePortionData::Text(sal_uInt16 nLength, sal_uInt16 nType, sal_Int32 /*nHeight*/, sal_Int32 /*nWidth*/)
 {
     OSL_ENSURE( (nModelPosition + nLength) <= pTxtNode->GetTxt().Len(),
                 "portion exceeds model string!" );
diff --git a/sw/source/core/access/accportions.hxx b/sw/source/core/access/accportions.hxx
index ef9093b..d193125 100644
--- a/sw/source/core/access/accportions.hxx
+++ b/sw/source/core/access/accportions.hxx
@@ -94,7 +94,7 @@ public:
     virtual ~SwAccessiblePortionData();
 
     // SwPortionHandler methods
-    virtual void Text(sal_uInt16 nLength, sal_uInt16 nType);
+    virtual void Text(sal_uInt16 nLength, sal_uInt16 nType, sal_Int32 nHeight = 0, sal_Int32 nWidth = 0);
     virtual void Special(sal_uInt16 nLength, const String& rText, sal_uInt16 nType, sal_Int32 nHeight = 0, sal_Int32 nWidth = 0);
     virtual void LineBreak();
     virtual void Skip(sal_uInt16 nLength);
diff --git a/sw/source/core/inc/SwPortionHandler.hxx b/sw/source/core/inc/SwPortionHandler.hxx
index d3a8779..fa71c4a 100644
--- a/sw/source/core/inc/SwPortionHandler.hxx
+++ b/sw/source/core/inc/SwPortionHandler.hxx
@@ -55,7 +55,9 @@ public:
      */
     virtual void Text(
         sal_uInt16 nLength,      /// length of this portion in the model string
-        sal_uInt16 nType         /// type of this portion
+        sal_uInt16 nType,         /// type of this portion
+        sal_Int32 nHeight = 0,   /// height of this portion
+        sal_Int32 nWidth = 0     /// width of this portion
         ) = 0;
 
     /** special portion. This method is called for every non-text
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index d51ece8..a6391f5 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -697,7 +697,7 @@ long SwTxtPortion::CalcSpacing( long nSpaceAdd, const SwTxtSizeInfo &rInf ) cons
 
 void SwTxtPortion::HandlePortion( SwPortionHandler& rPH ) const
 {
-    rPH.Text( GetLen(), GetWhichPor() );
+    rPH.Text( GetLen(), GetWhichPor(), Height(), Width() );
 }
 
 /*************************************************************************
diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx
index 38339d9..ec6408c 100644
--- a/sw/source/core/text/xmldump.cxx
+++ b/sw/source/core/text/xmldump.cxx
@@ -134,7 +134,9 @@ class XmlPortionDumper:public SwPortionHandler
                 text which is painted on-screen
       */
     virtual void Text( sal_uInt16 nLength,
-                       sal_uInt16 nType )
+                       sal_uInt16 nType,
+                       sal_Int32 nHeight,
+                       sal_Int32 nWidth)
     {
         ofs += nLength;
         xmlTextWriterStartElement( writer, BAD_CAST( "Text" ) );
@@ -144,6 +146,11 @@ class XmlPortionDumper:public SwPortionHandler
         xmlTextWriterWriteFormatAttribute( writer,
                                            BAD_CAST( "nType" ),
                                            "%s", getTypeName( nType ) );
+        if (nHeight > 0)
+            xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("nHeight"), "%i", (int)nHeight);
+        if (nWidth > 0)
+            xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("nWidth"), "%i", (int)nWidth);
+
         xmlTextWriterEndElement( writer );
     }
 
commit 8f846dab6db8e912ccb87209d365f1e20d13d293
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Thu Aug 16 12:21:58 2012 +0200

    sw layout dump: include the height and width of SwFlyPortion
    
    Change-Id: Ib47087a9dcb96779958edfc1a984cf38cabd1086

diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx
index a2b039d..d802a2b 100644
--- a/sw/source/core/access/accportions.cxx
+++ b/sw/source/core/access/accportions.cxx
@@ -142,7 +142,7 @@ void SwAccessiblePortionData::Text(sal_uInt16 nLength, sal_uInt16 nType)
 }
 
 void SwAccessiblePortionData::Special(
-    sal_uInt16 nLength, const String& rText, sal_uInt16 nType, sal_Int32 /*nHeight*/)
+    sal_uInt16 nLength, const String& rText, sal_uInt16 nType, sal_Int32 /*nHeight*/, sal_Int32 /*nWidth*/)
 {
     OSL_ENSURE( nModelPosition >= 0, "illegal position" );
     OSL_ENSURE( (nModelPosition + nLength) <= pTxtNode->GetTxt().Len(),
diff --git a/sw/source/core/access/accportions.hxx b/sw/source/core/access/accportions.hxx
index 4b7f19a..ef9093b 100644
--- a/sw/source/core/access/accportions.hxx
+++ b/sw/source/core/access/accportions.hxx
@@ -95,7 +95,7 @@ public:
 
     // SwPortionHandler methods
     virtual void Text(sal_uInt16 nLength, sal_uInt16 nType);
-    virtual void Special(sal_uInt16 nLength, const String& rText, sal_uInt16 nType, sal_Int32 nHeight = 0);
+    virtual void Special(sal_uInt16 nLength, const String& rText, sal_uInt16 nType, sal_Int32 nHeight = 0, sal_Int32 nWidth = 0);
     virtual void LineBreak();
     virtual void Skip(sal_uInt16 nLength);
     virtual void Finish();
diff --git a/sw/source/core/inc/SwPortionHandler.hxx b/sw/source/core/inc/SwPortionHandler.hxx
index 5f81b9a..d3a8779 100644
--- a/sw/source/core/inc/SwPortionHandler.hxx
+++ b/sw/source/core/inc/SwPortionHandler.hxx
@@ -67,7 +67,8 @@ public:
         sal_uInt16 nLength,      /// length of this portion in the model string
         const String& rText, /// text which is painted on-screen
         sal_uInt16 nType,         /// type of this portion
-        sal_Int32 nHeight = 0     /// font height of the painted text
+        sal_Int32 nHeight = 0,     /// font height of the painted text
+        sal_Int32 nWidth = 0     /// width of this portion
         ) = 0;
 
     /** line break. This method is called whenever a line break in the
diff --git a/sw/source/core/text/porlin.cxx b/sw/source/core/text/porlin.cxx
index c93c344..a9406c8 100644
--- a/sw/source/core/text/porlin.cxx
+++ b/sw/source/core/text/porlin.cxx
@@ -395,7 +395,7 @@ sal_Bool SwLinePortion::GetExpTxt( const SwTxtSizeInfo &, XubString & ) const
 void SwLinePortion::HandlePortion( SwPortionHandler& rPH ) const
 {
     String aString;
-    rPH.Special( GetLen(), aString, GetWhichPor() );
+    rPH.Special( GetLen(), aString, GetWhichPor(), Height(), Width() );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx
index 6c99b42..38339d9 100644
--- a/sw/source/core/text/xmldump.cxx
+++ b/sw/source/core/text/xmldump.cxx
@@ -160,7 +160,8 @@ class XmlPortionDumper:public SwPortionHandler
     virtual void Special( sal_uInt16 nLength,
                           const String & rText,
                           sal_uInt16 nType,
-                          sal_Int32 nHeight = 0 )
+                          sal_Int32 nHeight,
+                          sal_Int32 nWidth )
     {
         xmlTextWriterStartElement( writer, BAD_CAST( "Special" ) );
         xmlTextWriterWriteFormatAttribute( writer,
@@ -178,6 +179,9 @@ class XmlPortionDumper:public SwPortionHandler
         if (nHeight > 0)
             xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("nHeight"), "%i", (int)nHeight);
 
+        if (nWidth > 0)
+            xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("nWidth"), "%i", (int)nWidth);
+
         xmlTextWriterEndElement( writer );
         ofs += nLength;
     }


More information about the Libreoffice-commits mailing list