summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-08-16 14:13:20 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-08-16 16:01:34 +0200
commitcecff561687865359a695f1cf6ecb99300ce121b (patch)
tree8485258452adbba5f0b60f8c2968f1fb6e64b631
parent8f846dab6db8e912ccb87209d365f1e20d13d293 (diff)
sw layout dump: include the height and width of SwTxtPortion
Change-Id: Ia2bdff098d1bbd466f857e19315a22c835810202
-rw-r--r--sw/source/core/access/accportions.cxx2
-rw-r--r--sw/source/core/access/accportions.hxx2
-rw-r--r--sw/source/core/inc/SwPortionHandler.hxx4
-rw-r--r--sw/source/core/text/portxt.cxx2
-rw-r--r--sw/source/core/text/xmldump.cxx9
5 files changed, 14 insertions, 5 deletions
diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx
index d802a2b86c6f..3fd41ec7b7ac 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 ef9093b0bc21..d1931250c39b 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 d3a87790cb4e..fa71c4a46744 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 d51ece82b5e1..a6391f54aba6 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 38339d939518..ec6408c7109d 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 );
}