summaryrefslogtreecommitdiff
path: root/sw/source/filter/rtf/swparrtf.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/filter/rtf/swparrtf.cxx')
-rw-r--r--sw/source/filter/rtf/swparrtf.cxx101
1 files changed, 24 insertions, 77 deletions
diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx
index ec7a26194d7a..d7c1c7a6ca6c 100644
--- a/sw/source/filter/rtf/swparrtf.cxx
+++ b/sw/source/filter/rtf/swparrtf.cxx
@@ -747,10 +747,7 @@ void rtfSections::SetSegmentToPageDesc(const rtfSection &rSection,
{
SwPageDesc &rPage = bTitlePage ? *rSection.mpTitlePage : *rSection.mpPage;
-// SetNumberingType(rSection, rPage);
-
SwFrmFmt &rFmt = rPage.GetMaster();
-// mrReader.SetDocumentGrid(rFmt, rSection);
wwULSpaceData aULData;
GetPageULData(rSection, bTitlePage, aULData);
@@ -790,15 +787,11 @@ void rtfSections::MoveFrom(SwPageDesc &rFrom, SwPageDesc &rDest)
SwFrmFmt &rFromMaster = rFrom.GetMaster();
rDestMaster.SetFmtAttr(rFromMaster.GetHeader());
rDestMaster.SetFmtAttr(rFromMaster.GetFooter());
- //rFromMaster.SetAttr(SwFmtHeader()); //$flr uncommented due to bug fix #117882#
- //rFromMaster.SetAttr(SwFmtFooter()); //$flr uncommented due to bug fix #117882#
SwFrmFmt &rDestLeft = rDest.GetLeft();
SwFrmFmt &rFromLeft = rFrom.GetLeft();
rDestLeft.SetFmtAttr(rFromLeft.GetHeader());
rDestLeft.SetFmtAttr(rFromLeft.GetFooter());
- //rFromLeft.SetAttr(SwFmtHeader()); //$flr uncommented due to bug fix #117882#
- //rFromLeft.SetAttr(SwFmtFooter()); //$flr uncommented due to bug fix #117882#
}
void rtfSections::SetHdFt(rtfSection &rSection)
@@ -1241,15 +1234,7 @@ void SwRTFParser::ReadDrawingObject()
}
}
SkipToken(-1);
- /*
- const Point aPointC1( 0, 0 );
- const Point aPointC2( 100, 200 );
- const Point aPointC3( 300, 400 );
- XPolygon aPolygonC(3);
- aPolygonC[0] = aPointC1;
- aPolygonC[1] = aPointC2;
- aPolygonC[2] = aPointC3;
- */
+
if(bPolygonActive && aPolygon.count())
{
SdrPathObj* pStroke = new SdrPathObj(OBJ_PLIN, ::basegfx::B2DPolyPolygon(aPolygon));
@@ -1260,10 +1245,7 @@ void SwRTFParser::ReadDrawingObject()
aFlySet.Put( aSur );
SwFmtFollowTextFlow aFollowTextFlow( FALSE );
aFlySet.Put( aFollowTextFlow );
- /*
- sw::util::SetLayer aSetLayer(*pDoc);
- aSetLayer.SendObjectToHeaven(*pStroke);
- */
+
SwFmtAnchor aAnchor( FLY_AT_PARA );
aAnchor.SetAnchor( pPam->GetPoint() );
aFlySet.Put( aAnchor );
@@ -1316,7 +1298,7 @@ void SwRTFParser::ReadDrawingObject()
pStroke->SetSnapRect(aRect);
- /* SwFrmFmt* pRetFrmFmt = */pDoc->Insert(*pPam, *pStroke, &aFlySet, NULL);
+ pDoc->Insert(*pPam, *pStroke, &aFlySet, NULL);
}
}
@@ -1348,7 +1330,7 @@ void SwRTFParser::InsertShpObject(SdrObject* pStroke, int _nZOrder)
SdrPage* pDrawPg = pDrawModel->GetPage(0);
pDrawPg->InsertObject(pStroke);
pDrawPg->SetObjectOrdNum(pStroke->GetOrdNum(), _nZOrder);
- /* SwFrmFmt* pRetFrmFmt = */pDoc->Insert(*pPam, *pStroke, &aFlySet, NULL);
+ pDoc->Insert(*pPam, *pStroke, &aFlySet, NULL);
}
::basegfx::B2DPoint rotate(const ::basegfx::B2DPoint& rStart, const ::basegfx::B2DPoint& rEnd)
@@ -1376,6 +1358,7 @@ void SwRTFParser::ReadShapeObject()
String shpTxt;
bool bshpTxt=false;
int txflTextFlow=0;
+ ::rtl::OUString sDescription, sName;
while (level>0 && IsParserWorking())
@@ -1433,7 +1416,14 @@ void SwRTFParser::ReadShapeObject()
{
txflTextFlow=aToken.ToInt32();
}
-
+ else if (sn.EqualsAscii("wzDescription"))
+ {
+ sDescription = aToken;
+ }
+ else if(sn.EqualsAscii("wzName"))
+ {
+ sName = aToken;
+ }
}
break;
case RTF_PICT:
@@ -1459,6 +1449,7 @@ void SwRTFParser::ReadShapeObject()
}
SkipToken(-1);
+ SdrObject* pSdrObject = 0;
switch(shapeType)
{
case 202: /* Text Box */
@@ -1478,6 +1469,7 @@ void SwRTFParser::ReadShapeObject()
const Rectangle aRect(FRound(aRange.getMinX()), FRound(aRange.getMinY()), FRound(aRange.getMaxX()), FRound(aRange.getMaxY()));
SdrRectObj* pStroke = new SdrRectObj(aRect);
+ pSdrObject = pStroke;
pStroke->SetSnapRect(aRect);
pDoc->GetOrCreateDrawModel(); // create model
InsertShpObject(pStroke, this->nZOrder++);
@@ -1525,7 +1517,7 @@ void SwRTFParser::ReadShapeObject()
aLine.append(aPointRightBottom);
SdrPathObj* pStroke = new SdrPathObj(OBJ_PLIN, ::basegfx::B2DPolyPolygon(aLine));
- //pStroke->SetSnapRect(aRect);
+ pSdrObject = pStroke;
InsertShpObject(pStroke, this->nZOrder++);
SfxItemSet aSet(pStroke->GetMergedItemSet());
@@ -1545,11 +1537,17 @@ void SwRTFParser::ReadShapeObject()
const Rectangle aRect(FRound(aRange.getMinX()), FRound(aRange.getMinY()), FRound(aRange.getMaxX()), FRound(aRange.getMaxY()));
SdrRectObj* pStroke = new SdrGrafObj(aGrf);
+ pSdrObject = pStroke;
pStroke->SetSnapRect(aRect);
InsertShpObject(pStroke, this->nZOrder++);
}
}
+ if( pSdrObject )
+ {
+ pSdrObject->SetDescription(sDescription);
+ pSdrObject->SetTitle(sName);
+ }
}
extern void sw3io_ConvertFromOldField( SwDoc& rDoc, USHORT& rWhich,
@@ -1558,7 +1556,6 @@ extern void sw3io_ConvertFromOldField( SwDoc& rDoc, USHORT& rWhich,
USHORT SwRTFParser::ReadRevTbl()
{
- // rStr.Erase( 0 );
int nNumOpenBrakets = 1, nToken; // die erste wurde schon vorher erkannt !!
USHORT nAuthorTableIndex = 0;
@@ -2716,11 +2713,8 @@ void SwRTFParser::MakeStyleTab()
if( !IsNewDoc() )
{
// search all outlined collections
- //BYTE nLvl;
const SwTxtFmtColls& rColls = *pDoc->GetTxtFmtColls();
for( USHORT n = rColls.Count(); n; )
- //if( MAXLEVEL > (nLvl = rColls[ --n ]->GetOutlineLevel() ))//#outline level,zhaojianwei
- // nValidOutlineLevels |= 1 << nLvl;
if( rColls[ --n ]->IsAssignedToListLevelOfOutlineStyle())
nValidOutlineLevels |= 1 << rColls[ n ]->GetAssignedOutlineStyleLevel();//<-end,zhaojianwei
}
@@ -3000,7 +2994,7 @@ void SwRTFParser::ReadSectControls( int nToken )
}
if (!aNewSection.mpPageHdFt)
{
- String aName(RTL_CONSTASCII_STRINGPARAM("rtfHdFt"));
+ String aName(RTL_CONSTASCII_USTRINGPARAM("rtfHdFt"));
aName += String::CreateFromInt32(maSegments.size());
sal_uInt16 nPageNo = pDoc->MakePageDesc(aName);
aNewSection.mpPageHdFt = &pDoc->_GetPageDesc(nPageNo);
@@ -3015,7 +3009,7 @@ void SwRTFParser::ReadSectControls( int nToken )
case RTF_HEADERF:
if (!aNewSection.mpTitlePageHdFt)
{
- String aTitle(RTL_CONSTASCII_STRINGPARAM("rtfTitleHdFt"));
+ String aTitle(RTL_CONSTASCII_USTRINGPARAM("rtfTitleHdFt"));
aTitle += String::CreateFromInt32(maSegments.size());
sal_uInt16 nPageNo = pDoc->MakePageDesc(aTitle);
aNewSection.mpTitlePageHdFt = &pDoc->_GetPageDesc(nPageNo);
@@ -3499,20 +3493,6 @@ void SwRTFParser::ReadPageDescTbl()
SkipToken( -1 );
}
-// -------------- Methoden --------------------
-
-/*
-void SwRTFParser::ReadUnknownData()
-{
- SvRTFParser::ReadUnknownData();
-}
-
-void SwRTFParser::ReadOLEData()
-{
- SvRTFParser::ReadOLEData();
-}
-*/
-
void SwRTFParser::ReadPrtData()
{
while( IsParserWorking() )
@@ -3859,29 +3839,6 @@ void SwRTFParser::SetSwgValues( SfxItemSet& rSet )
}
-
-/*
- ????????????????????????????????????????????????????????????????????
- ?? muss die LineSpacing Hoehe 200Twip betragen ??
- ?? in rtfitem.hxx wird es auf 0 defaultet. Wenn ja, dann muss hier
- ?? ein neues Item gesetzt werden!!!!
- ????????????????????????????????????????????????????????????????????
-
- // LineSpacing korrigieren
- if( SFX_ITEM_SET == rSet.GetItemState( RES_PARATR_LINESPACING, FALSE, &pItem ))
- {
- const SvxLineSpacingItem* pLS = (const SvxLineSpacingItem*)pItem;
- SvxLineSpacingItem aNew;
-
- aNew.SetInterLineSpace( pLS->GetInterLineSpace() );
- aNew.GetLineSpaceRule() = pLS->GetLineSpaceRule();
- aNew.SetPropLineSpace( pLS->GetPropLineSpace() );
- aNew.GetInterLineSpaceRule() = pLS->GetInterLineSpaceRule();
-
- rSet.Put( aNew );
- }
-?????????????????????????????????????????????????????????????????? */
-
}
@@ -3889,7 +3846,6 @@ SwTxtFmtColl* SwRTFParser::MakeColl(const String& rName, USHORT nPos,
BYTE nOutlineLevel, bool& rbCollExist)
{
if( BYTE(-1) == nOutlineLevel )
- //nOutlineLevel = NO_NUMBERING;
nOutlineLevel = MAXLEVEL;//#outline level,zhaojianwei
rbCollExist = false;
@@ -3901,7 +3857,6 @@ SwTxtFmtColl* SwRTFParser::MakeColl(const String& rName, USHORT nPos,
if( !nPos )
{
pColl = pDoc->GetTxtCollFromPool( RES_POOLCOLL_STANDARD, false );
- //pColl->SetOutlineLevel( nOutlineLevel ); //#outline level,removed by zhaojianwei
if(nOutlineLevel < MAXLEVEL ) //->add by zhaojianwei
pColl->AssignToListLevelOfOutlineStyle( nOutlineLevel );
else
@@ -3929,7 +3884,6 @@ SwTxtFmtColl* SwRTFParser::MakeColl(const String& rName, USHORT nPos,
if (!rbCollExist)
{
- //pColl->SetOutlineLevel( nOutlineLevel ); //#outline level,removed by zhaojianwei
if(nOutlineLevel < MAXLEVEL) //->add by zhaojianwei
pColl->AssignToListLevelOfOutlineStyle( nOutlineLevel );
else
@@ -4262,13 +4216,6 @@ void SwRTFParser::UnknownAttrToken( int nToken, SfxItemSet* pSet )
}
break;
-/*
- case RTF_SBYS:
- case RTF_EXPND:
- case RTF_KEEP:
- case RTF_KEEPN:
-*/
-
}
}