summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@novell.com>2011-08-23 14:01:37 +0530
committerMuthu Subramanian <sumuthu@novell.com>2011-08-23 14:14:43 +0530
commitb6768c50736c6994e28de51c5f54cdadfd6f45f1 (patch)
tree68309f18ef3a7dc464ee2b666118cf295d4e0494 /filter
parent4432625b90bfd8b831e8a01bc5c380a1bf15fbc7 (diff)
n#699334: Legacy Diagram Text import.
- Imports Legacy Text. - Formatting info is not imported.
Diffstat (limited to 'filter')
-rw-r--r--filter/inc/filter/msfilter/msdffimp.hxx5
-rw-r--r--filter/source/msfilter/msdffimp.cxx20
2 files changed, 11 insertions, 14 deletions
diff --git a/filter/inc/filter/msfilter/msdffimp.hxx b/filter/inc/filter/msfilter/msdffimp.hxx
index 4b47231d87ed..48a9231c9f92 100644
--- a/filter/inc/filter/msfilter/msdffimp.hxx
+++ b/filter/inc/filter/msfilter/msdffimp.hxx
@@ -548,9 +548,6 @@ protected :
virtual sal_uLong Calc_nBLIPPos( sal_uLong nOrgVal, sal_uLong nStreamPos ) const;
virtual bool GetColorFromPalette(sal_uInt16 nNum, Color& rColor) const;
- bool ReadDffString(SvStream& rSt, String& rTxt) const;
- bool ReadObjText(SvStream& rSt, SdrObject* pObj) const;
-
// SJ: New implementation of ReadObjText is used by Fontwork objects, because
// the old one does not properly import multiple paragraphs
void ReadObjText( const String& rText, SdrObject* pObj ) const;
@@ -642,6 +639,8 @@ public:
static sal_Bool MakeContentStream( SotStorage * pStor, const GDIMetaFile & );
static sal_Bool ConvertToOle2( SvStream& rStm, sal_uInt32 nLen, const GDIMetaFile*,
const SotStorageRef & rDest );
+ static bool ReadDffString(SvStream& rSt, String& rTxt, DffRecordHeader aStrHd = DffRecordHeader());
+ static bool ReadObjText(SvStream& rSt, SdrObject* pObj);
void SetModel(SdrModel* pModel, long nApplicationScale);
SdrModel* GetModel() const { return pSdrModel; }
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 2ad6eb94d647..b2efee607b20 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -3738,11 +3738,10 @@ Color SvxMSDffManager::MSO_CLR_ToColor( sal_uInt32 nColorCode, sal_uInt16 nConte
return aColor;
}
-bool SvxMSDffManager::ReadDffString(SvStream& rSt, String& rTxt) const
+bool SvxMSDffManager::ReadDffString(SvStream& rSt, String& rTxt, DffRecordHeader aStrHd)
{
bool bRet=sal_False;
- DffRecordHeader aStrHd;
- if( !ReadCommonRecordHeader(aStrHd, rSt) )
+ if( aStrHd.nRecType == 0x0 && !ReadCommonRecordHeader(aStrHd, rSt) )
rSt.Seek( aStrHd.nFilePos );
else if ( aStrHd.nRecType == DFF_PST_TextBytesAtom || aStrHd.nRecType == DFF_PST_TextCharsAtom )
{
@@ -3829,7 +3828,7 @@ void SvxMSDffManager::ReadObjText( const String& rText, SdrObject* pObj ) const
}
}
-bool SvxMSDffManager::ReadObjText(SvStream& rSt, SdrObject* pObj) const
+bool SvxMSDffManager::ReadObjText(SvStream& rSt, SdrObject* pObj)
{
bool bRet=sal_False;
SdrTextObj* pText = PTR_CAST(SdrTextObj, pObj);
@@ -3838,7 +3837,7 @@ bool SvxMSDffManager::ReadObjText(SvStream& rSt, SdrObject* pObj) const
DffRecordHeader aTextHd;
if( !ReadCommonRecordHeader(aTextHd, rSt) )
rSt.Seek( aTextHd.nFilePos );
- else if ( aTextHd.nRecType==DFF_msofbtClientTextbox )
+ else if ( aTextHd.nRecType==DFF_msofbtClientTextbox || aTextHd.nRecType == 0x1022 )
{
bRet=sal_True;
sal_uLong nRecEnd=aTextHd.GetRecEndFilePos();
@@ -3878,15 +3877,14 @@ bool SvxMSDffManager::ReadObjText(SvStream& rSt, SdrObject* pObj) const
{
switch (aHd.nRecType)
{
- //case TextHeaderAtom
+ default:
+ break;
+ //case DFF_PST_TextHeaderAtom:
//case TextSpecInfoAtom
case DFF_PST_TextBytesAtom:
case DFF_PST_TextCharsAtom:
- {
- aHd.SeekToBegOfRecord(rSt);
- ReadDffString(rSt, aText);
- }
- break;
+ ReadDffString(rSt, aText, aHd);
+ break;
case DFF_PST_TextRulerAtom :
{
sal_uInt16 nLen = (sal_uInt16)aHd.nRecLen;