diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-06-21 16:25:15 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-06-21 17:17:46 +0200 |
commit | a208d96584009de2b902534e62f03de8124160a9 (patch) | |
tree | cc699920b0e074cd3437493a82abb82aac12feb8 /sw | |
parent | c3f2401d49b1374431da54e799a23bc122c5def7 (diff) |
sw: include the height of SwNumberPortions in layout dump
Change-Id: I7c7d78c212683e47f726fc91d59c9c495b78641e
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/access/accportions.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/access/accportions.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/inc/SwPortionHandler.hxx | 3 | ||||
-rw-r--r-- | sw/source/core/text/porfld.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/text/xmldump.cxx | 8 |
5 files changed, 15 insertions, 5 deletions
diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx index 17ed51e0bf80..03ee5a1242d7 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_uInt16 nLength, const String& rText, sal_uInt16 nType, sal_Int32 /*nHeight*/) { 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 9389b1a46886..4b7f19a409a6 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); + virtual void Special(sal_uInt16 nLength, const String& rText, sal_uInt16 nType, sal_Int32 nHeight = 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 7c1084e6e959..5f81b9a6798b 100644 --- a/sw/source/core/inc/SwPortionHandler.hxx +++ b/sw/source/core/inc/SwPortionHandler.hxx @@ -66,7 +66,8 @@ public: virtual void Special( 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_uInt16 nType, /// type of this portion + sal_Int32 nHeight = 0 /// font height of the painted text ) = 0; /** line break. This method is called whenever a line break in the diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx index 62cdbe957c2f..fbb5eb7e2bd1 100644 --- a/sw/source/core/text/porfld.cxx +++ b/sw/source/core/text/porfld.cxx @@ -471,7 +471,10 @@ sal_Bool SwFldPortion::GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) c void SwFldPortion::HandlePortion( SwPortionHandler& rPH ) const { - rPH.Special( GetLen(), aExpand, GetWhichPor() ); + sal_Int32 nH = 0; + if (pFnt) + nH = pFnt->GetSize(pFnt->GetActual()).Height(); + rPH.Special( GetLen(), aExpand, GetWhichPor(), nH ); } /************************************************************************* diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx index 7df0ec8aaf82..c9578a391b7c 100644 --- a/sw/source/core/text/xmldump.cxx +++ b/sw/source/core/text/xmldump.cxx @@ -153,10 +153,13 @@ class XmlPortionDumper:public SwPortionHandler text which is painted on-screen @param nType type of this portion + @param nHeight + font size of the painted text */ virtual void Special( sal_uInt16 nLength, const String & rText, - sal_uInt16 nType ) + sal_uInt16 nType, + sal_Int32 nHeight = 0 ) { xmlTextWriterStartElement( writer, BAD_CAST( "Special" ) ); xmlTextWriterWriteFormatAttribute( writer, @@ -171,6 +174,9 @@ class XmlPortionDumper:public SwPortionHandler xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "rText" ), "%s", sText8.getStr( ) ); + if (nHeight > 0) + xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("nHeight"), "%i", (int)nHeight); + xmlTextWriterEndElement( writer ); ofs += nLength; } |