[Libreoffice-commits] core.git: sw/source

Miklos Vajna vmiklos at suse.cz
Tue Mar 5 04:01:40 PST 2013


 sw/source/core/access/accportions.cxx   |    6 +++---
 sw/source/core/access/accportions.hxx   |    2 +-
 sw/source/core/inc/SwPortionHandler.hxx |    3 ++-
 sw/source/core/text/txtfrm.cxx          |    2 +-
 sw/source/core/text/xmldump.cxx         |    6 +++++-
 5 files changed, 12 insertions(+), 7 deletions(-)

New commits:
commit ca44650259e9388bd7dfd0603e4c9908a116c59b
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Tue Mar 5 12:59:10 2013 +0100

    sw: include SwLineLayout width in layout dump
    
    Change-Id: Ib891a4338a80939b4f6212b1b4f6ae0abfea36fb

diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx
index 5b2e0ac..529d069 100644
--- a/sw/source/core/access/accportions.cxx
+++ b/sw/source/core/access/accportions.cxx
@@ -197,7 +197,7 @@ void SwAccessiblePortionData::Special(
         bLastIsSpecial = sal_True;
 }
 
-void SwAccessiblePortionData::LineBreak()
+void SwAccessiblePortionData::LineBreak(KSHORT /*nWidth*/)
 {
     OSL_ENSURE( !bFinished, "We are already done!" );
 
@@ -223,8 +223,8 @@ void SwAccessiblePortionData::Finish()
     // position before the end
     Special( 0, String(), POR_TERMINATE );
     Special( 0, String(), POR_TERMINATE );
-    LineBreak();
-    LineBreak();
+    LineBreak(0);
+    LineBreak(0);
 
     sAccessibleString = aBuffer.makeStringAndClear();
     bFinished = sal_True;
diff --git a/sw/source/core/access/accportions.hxx b/sw/source/core/access/accportions.hxx
index d193125..021b338 100644
--- a/sw/source/core/access/accportions.hxx
+++ b/sw/source/core/access/accportions.hxx
@@ -96,7 +96,7 @@ public:
     // SwPortionHandler methods
     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 LineBreak(KSHORT nWidth);
     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 fa71c4a..455c21a 100644
--- a/sw/source/core/inc/SwPortionHandler.hxx
+++ b/sw/source/core/inc/SwPortionHandler.hxx
@@ -21,6 +21,7 @@
 #define _SW_PORTIONHANDLER_HXX
 
 #include <tools/solar.h>
+#include <txttypes.hxx>
 
 class String;
 
@@ -76,7 +77,7 @@ public:
     /** line break. This method is called whenever a line break in the
      * layout occurs.
      */
-    virtual void LineBreak() = 0;
+    virtual void LineBreak(KSHORT nWidth) = 0;
 
     /** skip characters. The SwTxtFrame may only display partially
      * display a certain paragraph (e.g. when the paragaph is split
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index ef21551..e3cb0c0 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -2603,7 +2603,7 @@ void SwTxtFrm::VisitPortions( SwPortionHandler& rPH ) const
                 pPor = pPor->GetPortion();
             }
 
-            rPH.LineBreak();
+            rPH.LineBreak(pLine->Width());
             pLine = pLine->GetNext();
         }
     }
diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx
index 5decf30..2cf0fca 100644
--- a/sw/source/core/text/xmldump.cxx
+++ b/sw/source/core/text/xmldump.cxx
@@ -193,9 +193,13 @@ class XmlPortionDumper:public SwPortionHandler
         ofs += nLength;
     }
 
-    virtual void LineBreak(  )
+    virtual void LineBreak( KSHORT nWidth )
     {
         xmlTextWriterStartElement( writer, BAD_CAST( "LineBreak" ) );
+        if (nWidth > 0)
+            xmlTextWriterWriteFormatAttribute( writer,
+                                               BAD_CAST( "nWidth" ),
+                                               "%i", ( int ) nWidth );
         xmlTextWriterEndElement( writer );
     }
 


More information about the Libreoffice-commits mailing list