View | Details | Raw Unified | Return to issue 15020
Collapse All | Expand All

(-)rtffly.cxx (-457 / +481 lines)
Lines 2-10 Link Here
2
 *
2
 *
3
 *  $RCSfile: rtffly.cxx,v $
3
 *  $RCSfile: rtffly.cxx,v $
4
 *
4
 *
5
 *  $Revision: 1.13 $
5
 *  $Revision: 1.12.120.4 $
6
 *
6
 *
7
 *  last change: $Author: obo $ $Date: 2004/01/13 16:49:58 $
7
 *  last change: $Author: cmc $ $Date: 2004/01/23 15:10:30 $
8
 *
8
 *
9
 *  The Contents of this file are made available subject to the terms of
9
 *  The Contents of this file are made available subject to the terms of
10
 *  either of the following licenses
10
 *  either of the following licenses
Lines 172-186 Link Here
172
#ifndef _FLTINI_HXX
172
#ifndef _FLTINI_HXX
173
#include <fltini.hxx>
173
#include <fltini.hxx>
174
#endif
174
#endif
175
#ifndef __SGI_STL_DEQUE
175
#ifndef _TBLSEL_HXX
176
#include <deque>
176
#include <tblsel.hxx>
177
#endif
177
#endif
178
#ifndef __SGI_STL_MAP
178
#include <swcrsr.hxx>
179
180
#include <deque>
179
#include <map>
181
#include <map>
180
#endif
181
#ifndef __SGI_STL_UTILITY
182
#include <utility>
182
#include <utility>
183
#endif
183
#include <stack>
184
184
185
#define ANCHOR(p) 	((SwFmtAnchor*)p)
185
#define ANCHOR(p) 	((SwFmtAnchor*)p)
186
186
Lines 190-202 Link Here
190
SV_IMPL_PTRARR( SwFlySaveArr, SwFlySave* )
190
SV_IMPL_PTRARR( SwFlySaveArr, SwFlySave* )
191
191
192
inline const SwFmtFrmSize GetFrmSize(const SfxItemSet& rSet, BOOL bInP=TRUE)
192
inline const SwFmtFrmSize GetFrmSize(const SfxItemSet& rSet, BOOL bInP=TRUE)
193
{ 
193
	{ return (const SwFmtFrmSize&)rSet.Get( RES_FRM_SIZE,bInP); }
194
    return (const SwFmtFrmSize&)rSet.Get(RES_FRM_SIZE,bInP); 
194
195
196
rtfFrame::rtfFrame(const SwPaM &rPaM)
197
    : mnSttNd(rPaM.GetPoint()->nNode), mnEndNd(mnSttNd), 
198
    mnSttCnt(rPaM.GetPoint()->nContent.GetIndex()), mnEndCnt(mnSttCnt)
199
{
200
}
201
202
void rtfFrame::setend(const SwPaM &rPaM, const APOProperties &rApoProps) 
203
{
204
    maApoProps = rApoProps;
205
    mnEndNd = rPaM.GetPoint()->nNode;
206
    mnEndCnt = rPaM.GetPoint()->nContent.GetIndex();
207
}
208
209
void rtfFrame::ConvertToItemSet(SfxItemSet &rSet) const
210
{
211
    /*
212
    A positive number indicates the minimum height of the frame and a negative
213
    number indicates the exact height of the frame.
214
    */
215
    SwTwips nHeight = maApoProps.absh;
216
    SwFrmSize eSize = maApoProps.absh < 0 ? ATT_FIX_SIZE : ATT_MIN_SIZE;
217
    if (eSize == ATT_FIX_SIZE)
218
        nHeight = -nHeight;
219
220
    /*
221
    A value of zero indicates that the height of the frame adjusts to the
222
    contents of the frame. This is the default for frames where no height is
223
    given.
224
    */
225
    if (nHeight < MINFLY)
226
        nHeight = MINFLY;
227
    rSet.Put(SwFmtFrmSize(eSize, maApoProps.absw, nHeight));
228
229
    SwRelationOrient eHoriRel;
230
    switch (maApoProps.eHoriRel)
231
    {
232
        case phmrg:
233
            //Use the margin as the horizontal reference frame.
234
            eHoriRel = REL_PG_PRTAREA;
235
            break;
236
        case phpg:
237
            //Use the page as the horizontal reference frame.
238
            eHoriRel = REL_PG_FRAME;
239
            break;
240
            //Use the column as the horizontal reference frame, This is the
241
            //default if no horizontal reference frame is given.
242
        case phcol:
243
        default:
244
            eHoriRel = PRTAREA;
245
            break;
246
    }
247
248
    SwHoriOrient eHoriOri;
249
    switch (maApoProps.eHoriOri)
250
    {
251
        case posxnone:
252
            eHoriOri = HORI_NONE;
253
            break;
254
        case posxc:
255
            //Centers the frame horizontally within the reference frame.
256
            eHoriOri = HORI_CENTER;
257
            break;
258
        case posxi:
259
            //Positions the paragraph horizontally inside the reference frame.
260
            eHoriOri = HORI_LEFT;
261
            break;
262
        case posxo:
263
            //Positions the paragraph horizontally outside the reference frame.
264
            eHoriOri = HORI_RIGHT;
265
            break;
266
        case posxr:
267
            //Positions the paragraph to the right within the reference frame.
268
            eHoriOri = HORI_RIGHT;
269
            break;
270
        case posxl:
271
        default:
272
            //Positions the paragraph to the left within the reference frame.
273
            //This is the default if no horizontal positioning information is
274
            //given.
275
            eHoriOri = HORI_LEFT;
276
            break;
277
    }
278
279
    using namespace sw::util;
280
	rSet.Put(SwFmtHoriOrient(MakeSafePositioningValue(maApoProps.posx), 
281
        eHoriOri, eHoriRel));
282
283
    SwRelationOrient eVertRel;
284
    switch (maApoProps.eVertRel)
285
    {
286
        case pvmrg:
287
        default:
288
            //Positions the reference frame vertically relative to the margin.
289
            //This is the default if no vertical frame positioning information
290
            //is given.
291
            eVertRel = REL_PG_PRTAREA;
292
            break;
293
        case pvpg:
294
            //Positions the reference frame vertically relative to the page.
295
            eVertRel = REL_PG_FRAME;
296
            break;
297
        case pvpara:
298
            //Positions the reference frame vertically relative to the top left
299
            //corner of the next unframed paragraph in the RTF stream.
300
            eVertRel = PRTAREA;
301
            break;
302
    }
303
304
    SwVertOrient eVertOri;
305
    switch (maApoProps.eVertOri)
306
    {
307
        case posynone:
308
            eVertOri = VERT_NONE;
309
            break;
310
        case posyil:
311
            //Positions the paragraph vertically to be in-line.
312
            eVertOri = VERT_NONE; /*???*/
313
            break;
314
        case posyt:
315
            //Positions the paragraph at the top of the reference frame.
316
            eVertOri = VERT_TOP;
317
            break;
318
        case posyc:
319
            //Centers the paragraph vertically within the reference frame.
320
            eVertOri = VERT_CENTER;
321
            break;
322
        case posyb:
323
            //Positions the paragraph at the bottom of the reference frame.
324
            eVertOri = VERT_BOTTOM;
325
            break ;
326
        case posyin:
327
            //Positions the paragraph vertically inside the reference frame.
328
            eVertOri = VERT_TOP;
329
            break;
330
        case posyout:
331
            //Positions the paragraph vertically outside the reference frame.
332
            eVertOri = VERT_BOTTOM;
333
            break;
334
    }
335
    
336
	rSet.Put(SwFmtVertOrient(MakeSafePositioningValue(maApoProps.posy), 
337
        eVertOri, eVertRel));
338
339
    //Prevents text from flowing around the positioned object.
340
    if (maApoProps.nowrap)
341
        rSet.Put(SwFmtSurround(SURROUND_NONE));
342
343
    //horizontal distance in twips from text on both sides of the frame.
344
    rSet.Put(SvxLRSpaceItem(maApoProps.dfrmtxtx, maApoProps.dfrmtxtx));
345
    //vertical distance in twips from text on both sides of the frame.
346
    rSet.Put(SvxULSpaceItem(maApoProps.dfrmtxty, maApoProps.dfrmtxty));
347
348
    SvxFrameDirection eDir;
349
    switch (maApoProps.eFlow)
350
    {
351
        case frmtxlrtb:
352
        default:
353
            //Frame box flows from left to right and top to bottom (default).
354
            eDir = FRMDIR_HORI_LEFT_TOP;
355
            break;
356
        case frmtxtbrl:
357
            //Frame box flows right to left and top to bottom.
358
            eDir = FRMDIR_HORI_RIGHT_TOP;
359
            break;
360
        case frmtxbtlr:
361
            //Frame box flows left to right and bottom to top.
362
            eDir = FRMDIR_HORI_LEFT_TOP; /*???*/
363
            break;
364
        case frmtxlrtbv:
365
            //Frame box flows left to right and top to bottom, vertical.
366
            eDir = FRMDIR_VERT_TOP_LEFT;
367
            break;
368
        case frmtxtbrlv:
369
            //Frame box flows top to bottom and right to left, vertical.
370
            eDir = FRMDIR_VERT_TOP_RIGHT;
371
            break;
372
    }
373
	rSet.Put(SvxFrameDirectionItem(eDir));
195
}
374
}
196
375
197
SwFlySave::SwFlySave(const SwPaM& rPam, SfxItemSet& rSet)
376
SwFlySave::SwFlySave( const SwPaM& rPam, SfxItemSet& rSet )
198
	: aFlySet(rSet), nSttNd(rPam.GetPoint()->nNode), nEndNd(nSttNd), nEndCnt(0),
377
	: aFlySet( rSet ),
199
     nPageWidth(ATT_MIN_SIZE), nDropLines(0), nDropAnchor(0)
378
	nSttNd( rPam.GetPoint()->nNode ), nEndNd( nSttNd ),
379
	nEndCnt( 0 ), nPageWidth( ATT_MIN_SIZE ),
380
	nDropLines( 0 ), nDropAnchor( 0 )
200
{
381
{
201
}
382
}
202
383
Lines 328-346 Link Here
328
	}
509
	}
329
}
510
}
330
511
331
void SwRTFParser::SetFlysInDoc()
512
void rtfFrameManager::MakeFlyFrames(const SwRTFParser &rReader) const
332
{
513
{
333
	// !! von Oben abarbeiten, CntntPos ist kein Index !
514
    bool bHack = false;
334
	SwNodes & rNds = pDoc->GetNodes();
515
    bHack = bHack;
335
    typedef std::pair<SwFlyFrmFmt*, SwFmtAnchor> frameEntry;
516
    if (bHack)
336
    typedef std::deque<frameEntry> rtfframesAtIndex;
517
        return;
337
    typedef std::map<const SwNode*, rtfframesAtIndex> rtfFmtMap;
518
338
    rtfFmtMap aPrevFmts;
519
    //No paragraphs in document at all
520
    mycIter aEnd = maFrames.end();
521
    mycIter aIter = maFrames.begin();
522
    if (aIter == aEnd)
523
        return;
524
525
    APOProperties aNone;    //Default Ctor for APO is "No apo properties"
339
526
340
	SwFrmFmt* pParent = pDoc->GetFrmFmtFromPool( RES_POOLFRM_FRAME );
527
    SwPosition aAnchorPos(*rReader.pPam->GetPoint());
341
	for( USHORT n = 0; n < aFlyArr.Count(); ++n )
528
    for (; aIter != aEnd; ++aIter)
529
    {
530
        //Find the first not apo paragraph to make as the default anchor
531
        //location, if no others will be found
532
        if (aIter->maApoProps == aNone)
533
        {
534
            aAnchorPos = SwPosition(aIter->mnSttNd);
535
            break;
536
        }
537
    }
538
539
    SwFrmFmt* pParent = rReader.pDoc->GetFrmFmtFromPool(RES_POOLFRM_FRAME);
540
    std::stack<SwNodeIndex> aToRemove;
541
    for (aIter = maFrames.begin(); aIter != aEnd; ++aIter)
542
    {
543
        if (aIter->maApoProps == aNone)
544
            continue;
545
546
        //Find the next non apo paragraph to use an an anchor if one exists
547
        for (mycIter aNext = aIter+1; aNext != aEnd; ++aNext)
548
        {
549
            if (aNext->maApoProps == aNone && aNext->mnSttNd.GetNode().IsTxtNode())
550
            {
551
                aAnchorPos = SwPosition(aNext->mnSttNd);
552
                break;
553
            }
554
        }
555
556
        //Nothing here to make into a frame, i.e. final txtnode was deleted
557
        if (!aIter->mnSttNd.GetNode().IsTxtNode())
558
            continue;
559
560
        SwPaM aSelection(aIter->mnSttNd, aIter->mnSttCnt, aIter->mnEndNd, 
561
            aIter->mnEndCnt);
562
563
        SfxItemSet aSet(rReader.pDoc->GetAttrPool(), RES_FRMATR_BEGIN, 
564
            RES_FRMATR_END-1);
565
        if (!rReader.IsNewDoc())
566
            Reader::ResetFrmFmtAttrs(aSet);
567
568
        aIter->ConvertToItemSet(aSet);
569
570
#if 0
571
        SwCntntNode *pStartNd = aSelection.GetCntntNode();      //Point
572
        SwCntntFrm *pStart = pStartNd->GetFrm();
573
        SwCntntNode *pMarkNd = aSelection.GetCntntNode(false);  //Mark
574
        SwCntntFrm *pMark = pMarkNd->GetFrm();
575
576
        SwSelBoxes aBoxes;
577
        GetTblSel(pStart, pMark, aBoxes);
578
579
580
        SwFlyFrmFmt* pFmt = rReader.pDoc->MakeFlyAndMove(aSelection, aSet, 
581
            &aBoxes, pParent);
582
583
#else
584
#if 0
585
        SwTableCursor aTest(*aSelection.GetPoint());
586
        const SwSelBoxes &rBoxes = aTest.GetBoxes();
587
588
        SwFlyFrmFmt* pFmt = rReader.pDoc->MakeFlyAndMove(aSelection, aSet, 
589
            &rBoxes, pParent);
590
#else
591
        const SwTableSortBoxes *pBoxes = 0;
592
        if (SwTableNode* pTblNd = aSelection.GetNode()->FindTableNode())
593
        {
594
            pTblNd->DelFrms();
595
            SwNodeIndex aIdx(*pTblNd->EndOfSectionNode(), 1);
596
            pTblNd->MakeFrms(&aIdx );
597
598
            pBoxes = &(pTblNd->GetTable().GetTabSortBoxes());
599
        }
600
        SwFlyFrmFmt* pFmt = rReader.pDoc->MakeFlyAndMove(aSelection, aSet, 
601
            (const SwSelBoxes*)pBoxes, pParent);
602
#endif
603
#endif
604
        ASSERT(pFmt, "inserting a frame failed!");
605
        if (!pFmt)
606
            continue;
607
608
        SwFmtAnchor aAnchor(FLY_AUTO_CNTNT);
609
        aAnchor.SetAnchor(&aAnchorPos);
610
        pFmt->SetAttr(aAnchor);
611
        aToRemove.push(aIter->mnSttNd);
612
613
        if (aIter->maApoProps.absw == 0)
614
        {
615
            SfxItemSet aFlySet(pFmt->GetAttrSet());
616
            SwFmtFrmSize aSize((const SwFmtFrmSize&)(aFlySet.Get(RES_FRM_SIZE)));
617
            aFlySet.ClearItem(RES_FRM_SIZE);
618
619
            Size aPgSize;
620
            rReader.GetPageSize(aPgSize);
621
622
            CalculateFlySize(aFlySet, aAnchorPos.nNode, aPgSize.Width());
623
624
            SwFmtFrmSize aNewSize((const SwFmtFrmSize&)(aFlySet.Get(RES_FRM_SIZE)));
625
            aSize.SetWidth(aNewSize.GetWidth());
626
            pFmt->SetAttr(aSize);
627
        }
628
    }
629
    
630
    bHack = bHack;
631
    if (bHack)
632
        return;
633
634
    while (!aToRemove.empty())
635
    {
636
        SwPaM aPaM(aToRemove.top());
637
        rReader.pDoc->DelFullPara(aPaM);
638
        aToRemove.pop();
639
    }
640
}
641
642
void SwRTFParser::SetFlysInDoc()
643
{
644
	SwFrmFmt* pParent = pDoc->GetFrmFmtFromPool(RES_POOLFRM_FRAME);
645
	for (USHORT n = 0; n < aFlyArr.Count(); ++n)
342
	{
646
	{
343
		SwFlySave* pFlySave = aFlyArr[ n ];
647
		SwFlySave* pFlySave = aFlyArr[n];
344
648
345
		ASSERT( !pFlySave->nSttNd.GetNode().FindFlyStartNode(),
649
		ASSERT( !pFlySave->nSttNd.GetNode().FindFlyStartNode(),
346
				"Content vom Fly steht in einem Fly" );
650
				"Content vom Fly steht in einem Fly" );
Lines 351-369 Link Here
351
		//				Absatz das Absatz Attribut setzen. Ggfs noch die
655
		//				Absatz das Absatz Attribut setzen. Ggfs noch die
352
		//				FontSize zuruecksetzen, damit das DropCap nicht zu
656
		//				FontSize zuruecksetzen, damit das DropCap nicht zu
353
		//				groá wird.
657
		//				groá wird.
354
		if( pFlySave->nDropAnchor )
658
		if (pFlySave->nDropAnchor)
355
		{
659
		{
356
			SwTxtNode* pSttNd = pFlySave->nSttNd.GetNode().GetTxtNode(),
660
			SwTxtNode* pSttNd = pFlySave->nSttNd.GetNode().GetTxtNode(),
357
					 * pEndNd = pFlySave->nEndNd.GetNode().GetTxtNode();
661
					 * pEndNd = pFlySave->nEndNd.GetNode().GetTxtNode();
358
			if( pSttNd && pEndNd &&
662
			if (pSttNd && pEndNd &&
359
				pSttNd->GetIndex() + 1 == pEndNd->GetIndex() )
663
				pSttNd->GetIndex() + 1 == pEndNd->GetIndex())
360
			{
664
			{
361
				BOOL bJoined;
665
				bool bJoined;
362
				{
666
				{
363
					SwPaM aTmp( *pEndNd, 0, *pSttNd, pSttNd->GetTxt().Len() );
667
					SwPaM aTmp( *pEndNd, 0, *pSttNd, pSttNd->GetTxt().Len() );
364
					bJoined = pDoc->DeleteAndJoin( aTmp );
668
					bJoined = pDoc->DeleteAndJoin( aTmp );
365
				}
669
				}
366
				if( bJoined )
670
				if (bJoined)
367
				{
671
				{
368
					SwFmtDrop aDropCap;
672
					SwFmtDrop aDropCap;
369
					aDropCap.GetLines() = (BYTE)pFlySave->nDropLines;
673
					aDropCap.GetLines() = (BYTE)pFlySave->nDropLines;
Lines 378-596 Link Here
378
			continue;
682
			continue;
379
		}
683
		}
380
684
381
		// liegt Ende und Start vom Naechsten im gleichen Node, dann muss
685
        SwPosition aPos(pFlySave->nSttNd);
382
		// gesplittet werden
686
        SwFmtAnchor aAnchor((const SwFmtAnchor&)pFlySave->aFlySet.Get(RES_ANCHOR));
383
		if( n + 1 < aFlyArr.Count() && pFlySave->nEndCnt &&
687
        aAnchor.SetAnchor(&aPos);
384
			pFlySave->nEndNd == aFlyArr[ n + 1 ]->nSttNd )
688
        pFlySave->aFlySet.Put(aAnchor);
385
		{
386
			SwCntntNode* pCNd = rNds[ pFlySave->nEndNd ]->GetCntntNode();
387
			if( pCNd )
388
			{
389
				SwPosition aPos( pFlySave->nEndNd,
390
								SwIndex( pCNd, pFlySave->nEndCnt ));
391
				pDoc->SplitNode( aPos );
392
				pFlySave->nEndNd--;
393
			}
394
			else
395
				pFlySave->nEndCnt = 0;
396
		}
397
398
		// verschiebe den Inhalt von diesem Anchor in den Auto-TextBereich
399
		// und erzeuge dadurch den richtigen SwG-Rahmen
400
		SwNodeRange aRg(pFlySave->nSttNd, 0, pFlySave->nEndNd, 0);
401
        //Make a new section, unless there is no content at all
402
		bool bMakeEmptySection = aRg.aStart < aRg.aEnd || ((aRg.aStart == aRg.aEnd) && pFlySave->nEndCnt);
403
404
		{
405
			// Nur TextNodes koennen in Tabellen stehen !!
406
			const SwNode* pNd = &pFlySave->nSttNd.GetNode();
407
			if( pNd->IsNoTxtNode() )
408
			{
409
				// die Size muss noch korrigiert werden!
410
				nAktPageDesc = 0;		// Standart PageDesc
411
				if( SFX_ITEM_SET != pFlySave->aFlySet.GetItemState(
412
					RES_FRM_SIZE, FALSE ) )
413
					_SetPictureSize( *(SwNoTxtNode*)pNd, aRg.aStart,
414
									pFlySave->aFlySet );
415
				if( 0 != ( pNd = pNd->FindTableNode() ) )
416
					pFlySave->SetFlySize( *(SwTableNode*)pNd );
417
			}
418
			else
419
			{
420
				// TabelleNodes beachten
421
				pNd = pNd->FindTableNode();
422
				if( pNd )	// am Anfang eine Tabelle, -> Bereich auf TabStart
423
					aRg.aStart = *pNd;
424
425
				if( bMakeEmptySection )
426
				{
427
					pNd = &aRg.aEnd.GetNode();
428
					ULONG nSectEnd = pNd->EndOfSectionIndex()+1;
429
430
					if (!pNd->IsTableNode() && (pNd = pNd->FindTableNode()))
431
					{
432
						const SwNode* pTblBxNd;
433
						// Ende der Tabelle ist hinter dieser Box ??
434
						if( pNd->EndOfSectionIndex() == nSectEnd )
435
							aRg.aEnd = nSectEnd+1;
436
						// is the end in the first box of the table, then
437
						// move before the table (Bug 67663)
438
						else if( 0 != ( pTblBxNd = aRg.aEnd.GetNode().
439
												FindTableBoxStartNode()) &&
440
								 pTblBxNd->GetIndex() - 1 == pNd->GetIndex())
441
							aRg.aEnd = *pNd;
442
						else
443
						{
444
							// Tabelle ist noch groesser, also splitte sie hier.
445
							rNds.SplitTable( aRg.aEnd, TRUE );
446
							aRg.aEnd = pNd->EndOfSectionIndex() + 1;
447
						}
448
					}
449
				}
450
			}
451
		}
452
453
		// vorm verschieben muss sich der Index auf die alte Position
454
		// gemerkt werden, der Index wird mit verschoben !!!
455
456
		SwNodeIndex aTmpIdx( rNds.GetEndOfAutotext() );
457
		SwStartNode* pSttNd = bMakeEmptySection
458
				? rNds.MakeEmptySection( aTmpIdx, SwFlyStartNode )
459
				: rNds.MakeTextSection( aTmpIdx, SwFlyStartNode,
460
						(SwTxtFmtColl*)pDoc->GetDfltTxtFmtColl() );
461
462
		// das ist die Verankerungs-Position (fuers Layout!)
463
		pFlySave->nSttNd = aRg.aStart.GetIndex()-1;
464
		if( bMakeEmptySection )
465
		{
466
			// check: the move does not clear the surrounded section. If all
467
			// nodes moved away, then create a new TxtNode
468
			{
469
				SwNodeIndex aPrev( aRg.aStart, -1 );
470
				if( aPrev.GetNode().IsStartNode() &&
471
					aPrev.GetNode().EndOfSectionNode() == &aRg.aEnd.GetNode())
472
				{
473
					// create new txtnode, because the section does never be empty
474
					pDoc->GetNodes().MakeTxtNode( aRg.aEnd,
475
							(SwTxtFmtColl*)pDoc->GetDfltTxtFmtColl() );
476
					aRg.aEnd--;
477
				}
478
			}
479
			aTmpIdx = *pSttNd->EndOfSectionNode();
480
			pDoc->Move( aRg, aTmpIdx );
481
		}
482
483
		pFlySave->aFlySet.Put( SwFmtCntnt( pSttNd ));
484
485
		CalculateFlySize( pFlySave->aFlySet, pFlySave->nSttNd,
486
						  pFlySave->nPageWidth );
487
689
488
		// if the section only contains one Node and this has a
690
        SwFlyFrmFmt* pFmt = 0;
489
		// border or backgorund, then put it to the frame
490
		// Not in our own RTF-Format!
491
		if( pSttNd->GetIndex() + 2 == pSttNd->EndOfSectionIndex() &&
492
			!bSwPageDesc )
493
		{
494
			SwTxtNode* pSrcNd = pDoc->GetNodes()[ pSttNd->GetIndex() + 1 ]
495
									->GetTxtNode();
496
			if( pSrcNd && pSrcNd->GetpSwAttrSet() )
497
			{
498
				SfxItemSet aTmpSet( pDoc->GetAttrPool(),
499
									RES_BACKGROUND, RES_BOX );
500
				aTmpSet.Put( *pSrcNd->GetpSwAttrSet() );
501
				if( aTmpSet.Count() )
502
				{
503
					pFlySave->aFlySet.Put( aTmpSet );
504
					pSrcNd->ResetAttr( RES_BACKGROUND, RES_BOX );
505
				}
506
			}
507
		}
508
509
		SwFlyFrmFmt* pFmt = pDoc->MakeFlyFrmFmt( aEmptyStr, pParent );
510
		pFmt->SetAttr( pFlySave->aFlySet );
511
		const SwFmtAnchor& rAnchor = pFmt->GetAnchor();
512
		if( FLY_IN_CNTNT != rAnchor.GetAnchorId() )
513
		{
514
			// korrigiere noch den Absatz, ist immer der vorhergehende !
515
			// JP 20.09.95: wenn es diesen gibt! (DocAnfang!)
516
517
			//JP 02.08.99: that is wrong. The anchor is ever the NEXT!
518
			//JP 05.08.99: there are an Bug in the ExportFilter which will
519
			//				be fixed in the Version 517 - by SWG-Export
520
			//				the fly will be after the paragraph - but in RTF
521
			// 				the	flys will be before the paragraph.
522
			if( !bSwPageDesc || 5430 < GetVersionNo() )
523
				pFlySave->nSttNd++;
524
525
//            if( !pFlySave->nSttNd.GetNode().IsCntntNode() )
526
			{
527
				// Seitenumbrueche in den Bodybereich verschieben!
528
				SwCntntNode* pSrcNd = aRg.aStart.GetNode().GetCntntNode();
529
				SwCntntNode* pDstNd = pFlySave->nSttNd.GetNode().GetCntntNode();
530
				if( !pDstNd )
531
					pDstNd = pDoc->GetNodes().GoNext( &pFlySave->nSttNd );
532
533
				::lcl_CpyBreakAttrs( pSrcNd, pDstNd, &pFlySave->nSttNd );
534
			}
535
536
            const SwNodeIndex aSttNd(*pSttNd);
537
            SwNodeIndex aEndNd(*pSttNd->EndOfSectionNode());
538
            aEndNd--;
539
540
            SwPosition aPos( pFlySave->nSttNd );
541
            SwFmtAnchor aAnchor(rAnchor);
542
            aAnchor.SetAnchor(&aPos);
543
544
            const SwNode *pCurrentAnchor = &(pFlySave->nSttNd.GetNode());
545
            aPrevFmts[pCurrentAnchor].push_back(frameEntry(pFmt, aAnchor));
546
547
            while (aEndNd > aSttNd)
548
            {
549
                typedef rtfframesAtIndex::iterator myIter;
550
                rtfframesAtIndex &rDeque = aPrevFmts[&(aEndNd.GetNode())];
551
                myIter aEnd = rDeque.end();
552
                for (myIter aIter = rDeque.begin(); aIter != aEnd; ++aIter)
553
                {
554
                    aIter->second.SetAnchor(&aPos);
555
                    aPrevFmts[pCurrentAnchor].push_back(*aIter);
556
                }
557
                rDeque.clear();
558
                aEndNd--;
559
           }
560
		}
561
		delete pFlySave;
562
	}
563
564
    typedef rtfFmtMap::reverse_iterator myriter;
565
    myriter aEnd = aPrevFmts.rend();
566
    for(myriter aIter = aPrevFmts.rbegin(); aIter != aEnd; ++aIter)
567
    {
568
        rtfframesAtIndex &rDeque = aIter->second;
569
        typedef rtfframesAtIndex::iterator myIter;
570
        myIter aQEnd = rDeque.end();
571
        for (myIter aQIter = rDeque.begin(); aQIter != aQEnd; ++aQIter)
572
        {
691
        {
573
            frameEntry &rEntry = *aQIter;
692
            SwPaM aRegion(pFlySave->nSttNd, 0, pFlySave->nEndNd, pFlySave->nEndCnt);
574
            SwFlyFrmFmt *pFrm = rEntry.first;
693
            pFmt = pDoc->MakeFlyAndMove(aRegion, pFlySave->aFlySet, 0, pParent);
575
            SwFmtAnchor &rAnchor = rEntry.second;
576
            pFrm->SetAttr(rAnchor);
577
        }
694
        }
578
    }
695
        ASSERT(pFmt, "Format missing");
696
        if (pFmt)
697
        {
698
            SwAttrSet aFlySet(pFmt->GetAttrSet());
699
            CalculateFlySize(aFlySet, pFlySave->nSttNd,	pFlySave->nPageWidth );
700
            pFmt->SetAttr(aFlySet);
701
        }
702
		delete pFlySave;
703
	}
579
704
580
    aFlyArr.Remove(0, aFlyArr.Count());
705
    aFlyArr.Remove(0, aFlyArr.Count());
581
}
706
}
582
707
583
// clips the text box to the min or max position if it is outside our min or max boundry
708
bool APOProperties::HandleToken(int nToken, long nTokenValue)
584
long SwRTFParser::GetSafePos(long nPos)
585
{
709
{
586
    if(nPos > SHRT_MAX)
710
    bool bHandled = true;
587
        nPos = SHRT_MAX;
711
    switch (nToken)
588
    else if(nPos < SHRT_MIN)
712
    {
589
        nPos = SHRT_MIN;
713
        case RTF_ABSW:
590
714
            absw = nTokenValue;
591
    return nPos;
715
            break;
716
        case RTF_ABSH:
717
            absh = nTokenValue;
718
            break;
719
        case RTF_PHMRG:
720
            eHoriRel = phmrg;
721
            break;
722
        case RTF_PHPG:
723
            eHoriRel = phpg;
724
            break;
725
        case RTF_PHCOL:
726
            eHoriRel = phcol;
727
            break;
728
        case RTF_POSX:
729
        case RTF_POSNEGX:
730
            eHoriOri = posxnone;
731
            posx = nTokenValue;
732
            break;
733
        case RTF_POSXC:
734
            eHoriOri = posxc;
735
            break;
736
        case RTF_POSXI:
737
            eHoriOri = posxi;
738
            break;
739
        case RTF_POSXO:
740
            eHoriOri = posxo;
741
            break;
742
        case RTF_POSXR:
743
            eHoriOri = posxr;
744
        case RTF_POSXL:
745
            eHoriOri = posxl;
746
            break;
747
        case RTF_PVMRG:
748
            eVertRel = pvmrg;
749
            break;
750
        case RTF_PVPG:
751
            eVertRel = pvpg;
752
            break;
753
        case RTF_PVPARA:
754
            eVertRel = pvpara;
755
            break;
756
        case RTF_POSY:
757
        case RTF_POSNEGY:
758
            posy = nTokenValue;
759
            break;
760
        case RTF_POSYIL:
761
            eVertOri = posyil;
762
            break;
763
        case RTF_POSYT: 
764
            eVertOri = posyt;
765
            break;
766
        case RTF_POSYC:
767
            eVertOri = posyc;
768
            break;
769
        case RTF_POSYB:	
770
            eVertOri = posyb;
771
            break;
772
        case RTF_POSYIN:
773
            eVertOri = posyin;
774
            break;
775
        case RTF_POSYOUT:
776
            eVertOri = posyout;
777
            break;
778
        case RTF_ABSLOCK:
779
            abslock = nTokenValue ? true : false;
780
            break;
781
        case RTF_NOWRAP:
782
            nowrap = true;
783
            break;
784
        case RTF_DXFRTEXT:
785
            dfrmtxtx = dfrmtxty = nTokenValue;
786
            break;
787
        case RTF_DFRMTXTX:
788
            dfrmtxtx = nTokenValue;
789
            break;
790
        case RTF_DFRMTXTY:
791
            dfrmtxty = nTokenValue;
792
            break;
793
        case RTF_DROPCAPLI:
794
            dropcapli = nTokenValue;
795
            break;
796
        case RTF_DROPCAPT:
797
            dropcapt = static_cast<dropcap>(nTokenValue);
798
            break;
799
        case RTF_ABSNOOVRLP:
800
            absnoovrlp = nTokenValue ? true : false;
801
            break;
802
        case RTF_FRMTXLRTB:
803
            eFlow = frmtxlrtb;
804
            break;
805
        case RTF_FRMTXTBRL:
806
            eFlow = frmtxtbrl;
807
            break;
808
        case RTF_FRMTXBTLR:
809
            eFlow = frmtxbtlr;
810
            break;
811
        case RTF_FRMTXLRTBV:
812
            eFlow = frmtxlrtbv;
813
            break;
814
        case RTF_FRMTXTBRLV:
815
            eFlow = frmtxtbrlv;
816
            break;
817
        default:
818
            bHandled = false;
819
            break;
820
    }
821
    return bHandled;
592
}
822
}
593
823
824
#if 0
825
594
void SwRTFParser::ReadFly( int nToken, SfxItemSet* pSet )
826
void SwRTFParser::ReadFly( int nToken, SfxItemSet* pSet )
595
{
827
{
596
	// ein Set fuer die FrmFmt-Attribute
828
	// ein Set fuer die FrmFmt-Attribute
Lines 605-611 Link Here
605
	// RTF-Defaults setzen:
837
	// RTF-Defaults setzen:
606
	SwFmtAnchor aAnchor(FLY_PAGE);
838
	SwFmtAnchor aAnchor(FLY_PAGE);
607
839
608
	SwFmtHoriOrient aHori( 0, HORI_LEFT, /*FRAME*/REL_PG_PRTAREA );
840
	SwFmtHoriOrient aHori( 0, HORI_LEFT, REL_PG_PRTAREA );
609
	SwFmtVertOrient aVert( 0, VERT_TOP, REL_PG_PRTAREA );
841
	SwFmtVertOrient aVert( 0, VERT_TOP, REL_PG_PRTAREA );
610
	SvxFrameDirectionItem aFrmDir( FRMDIR_HORI_LEFT_TOP );
842
	SvxFrameDirectionItem aFrmDir( FRMDIR_HORI_LEFT_TOP );
611
843
Lines 707-713 Link Here
707
939
708
		case RTF_POSNEGX:
940
		case RTF_POSNEGX:
709
		case RTF_POSX:		aHori.SetHoriOrient( HORI_NONE );
941
		case RTF_POSX:		aHori.SetHoriOrient( HORI_NONE );
710
							aHori.SetPos( GetSafePos((long)nTokenValue) );
942
							aHori.SetPos(MakeSafePositioningValue(nTokenValue));
711
							break;
943
							break;
712
		case RTF_POSXC:     aHori.SetHoriOrient( HORI_CENTER );		break;
944
		case RTF_POSXC:     aHori.SetHoriOrient( HORI_CENTER );		break;
713
		case RTF_POSXI:		aHori.SetHoriOrient( HORI_LEFT );
945
		case RTF_POSXI:		aHori.SetHoriOrient( HORI_LEFT );
Lines 721-727 Link Here
721
953
722
		case RTF_POSNEGY:
954
		case RTF_POSNEGY:
723
		case RTF_POSY:		aVert.SetVertOrient( VERT_NONE );
955
		case RTF_POSY:		aVert.SetVertOrient( VERT_NONE );
724
							aVert.SetPos( GetSafePos((long)nTokenValue) );
956
							aVert.SetPos(MakeSafePositioningValue(nTokenValue));
725
							break;
957
							break;
726
		case RTF_POSYT:     aVert.SetVertOrient( VERT_TOP );	break;
958
		case RTF_POSYT:     aVert.SetVertOrient( VERT_TOP );	break;
727
		case RTF_POSYB:		aVert.SetVertOrient( VERT_BOTTOM );	break;
959
		case RTF_POSYB:		aVert.SetVertOrient( VERT_BOTTOM );	break;
Lines 987-1004 Link Here
987
			nToken = GetNextToken();
1219
			nToken = GetNextToken();
988
	} while( bWeiter && IsParserWorking() );
1220
	} while( bWeiter && IsParserWorking() );
989
1221
990
#if 0
991
	if( !bReadSwFly && ( FRAME == aVert.GetRelationOrient() ||
992
		//JP 21.07.99: for Bug 67630 - it read into Header od Footer, set
993
		// 				never the anchor to Page. Because it is then only
994
		//              on the first used page .
995
		( FLY_PAGE == aAnchor.GetAnchorId() &&
996
		  pPam->GetPoint()->nNode < pDoc->GetNodes().GetEndOfExtras() &&
997
		  ( pPam->GetNode()->FindHeaderStartNode() ||
998
			pPam->GetNode()->FindFooterStartNode() )) ))
999
		aAnchor.SetType( FLY_AT_CNTNT );
1000
#endif
1001
1002
    pSet->Put( aAnchor );
1222
    pSet->Put( aAnchor );
1003
	pSet->Put( aHori );
1223
	pSet->Put( aHori );
1004
	pSet->Put( aVert );
1224
	pSet->Put( aVert );
Lines 1023-1038 Link Here
1023
				nTmp *= USHRT_MAX;
1243
				nTmp *= USHRT_MAX;
1024
				nTmp /= nWidth;
1244
				nTmp /= nWidth;
1025
				pCol->SetWishWidth( USHORT(nTmp) );
1245
				pCol->SetWishWidth( USHORT(nTmp) );
1026
/*
1027
	JP 07.07.95: der Dialog kennt nur eine Breite fuer alle Spalten
1028
				 darum hier nicht weiter beachten
1029
				nTmp = aColumns[ n+1 ];
1030
				if( nTmp )
1031
					pCol->SetRight( USHORT(nTmp) );
1032
				else
1033
					pCol->SetRight( 0 );
1034
				pCol->SetLeft( 0 );
1035
*/
1036
			}
1246
			}
1037
		}
1247
		}
1038
		pSet->Put( aCol );
1248
		pSet->Put( aCol );
Lines 1043-1050 Link Here
1043
    
1253
    
1044
    // ein neues FlyFormat anlegen oder das alte benutzen ?
1254
    // ein neues FlyFormat anlegen oder das alte benutzen ?
1045
    // (teste ob es die selben Attribute besitzt!)
1255
    // (teste ob es die selben Attribute besitzt!)
1046
    SwFlySave* pFlySave;
1047
    USHORT nFlyArrCnt = aFlyArr.Count();
1256
    USHORT nFlyArrCnt = aFlyArr.Count();
1257
    SwFlySave* pFlySavePrev = nFlyArrCnt ? aFlyArr[nFlyArrCnt-1] : 0;
1258
    SwFlySave* pFlySave = pFlySavePrev;
1048
    /*
1259
    /*
1049
    #i5263# 
1260
    #i5263# 
1050
    There were not enough frame properties found to actually justify creating
1261
    There were not enough frame properties found to actually justify creating
Lines 1052-1273 Link Here
1052
    */
1263
    */
1053
    if (nAppliedProps)
1264
    if (nAppliedProps)
1054
    {
1265
    {
1055
        if( !nFlyArrCnt ||
1266
        if (!pFlySavePrev || !pFlySavePrev->IsEqualFly(*pPam, aSet))
1056
            !( pFlySave = aFlyArr[ nFlyArrCnt-1 ])->IsEqualFly( *pPam, aSet ))
1057
        {
1267
        {
1058
            pFlySave = new SwFlySave( *pPam, aSet );
1268
            pFlySave = new SwFlySave(*pPam, aSet);
1059
            Size aPgSize;
1269
            Size aPgSize;
1060
            GetPageSize( aPgSize );
1270
            GetPageSize( aPgSize );
1061
            pFlySave->nPageWidth = aPgSize.Width();
1271
            pFlySave->nPageWidth = aPgSize.Width();
1062
1272
            if(nDropCapAnchor)
1063
            if( nDropCapAnchor )
1064
            {
1273
            {
1065
                pFlySave->nDropAnchor = nDropCapAnchor;
1274
                pFlySave->nDropAnchor = nDropCapAnchor;
1066
                pFlySave->nDropLines = nDropCapLines;
1275
                pFlySave->nDropLines = nDropCapLines;
1067
            } 
1276
            } 
1068
            if (nFlyArrCnt >0){
1277
            if (pFlySavePrev)
1069
                SwFlySave* pFlySavePrev = aFlyArr[nFlyArrCnt-1];
1278
            {
1070
                if (pFlySave->nSttNd.GetIndex() < pFlySavePrev->nEndNd.GetIndex())
1279
                if (pFlySave->nSttNd.GetIndex() < pFlySavePrev->nEndNd.GetIndex())
1071
                {
1072
                 	pFlySavePrev->nEndNd=pFlySave->nSttNd;
1280
                 	pFlySavePrev->nEndNd=pFlySave->nSttNd;
1073
                }
1074
            }
1281
            }
1075
            aFlyArr.Insert(  pFlySave, nFlyArrCnt++ );
1282
            aFlyArr.Insert(pFlySave, nFlyArrCnt++);
1076
        }
1283
        }
1077
    }
1284
    }
1078
1285
1079
	SetPardTokenRead( FALSE );
1286
    if (pFlySave)
1080
	const SwTableNode* pTblNd = pPam->GetNode()->FindTableNode();
1081
1082
	while( !IsPardTokenRead() && IsParserWorking() )
1083
	{
1084
		if( RTF_PARD == nToken || nOpenBrakets > GetOpenBrakets() )
1085
			break;
1086
1087
		NextToken( nToken );
1088
1089
		if( !IsPardTokenRead() )
1090
		{
1091
			nToken = GetNextToken();
1092
1093
			// BUG 22036: kommt zwischen Fly-Attributen ein unbekanntes,
1094
			//				dann erzeuge nie 2 FlyFrames, sondern fasse
1095
			//				beide zusammen !!!
1096
			while( RTF_APOCTL == ( nToken & ~(0xff | RTF_SWGDEFS) ))
1097
			{
1098
				if( RTF_FLY_INPARA == nToken )
1099
					break;
1100
1101
				if( RTF_IGNOREFLAG == SkipToken( -1 ) )
1102
				{
1103
					if( '{' == SkipToken( -1 ) )
1104
						nToken = '{';
1105
					else
1106
						SkipToken( 2 );
1107
				}
1108
				else
1109
					SkipToken( 1 );
1110
1111
                ReadFly( nToken, pFlySave ? &pFlySave->aFlySet : 0);
1112
				nToken = GetNextToken();
1113
			}
1114
		}
1115
	}
1116
1117
    /*
1118
    #i5263# 
1119
    There were enough frame properties found to actually justify creating
1120
    an absolutely positioned frame.
1121
    */
1122
    if (!nAppliedProps)
1123
    {
1287
    {
1124
        bReadSwFly = FALSE;
1288
        pFlySave->nEndNd = pPam->GetPoint()->nNode;
1125
	    SkipToken( -1 );
1289
        pFlySave->nEndCnt = pPam->GetPoint()->nContent.GetIndex();
1126
        return;
1127
    }
1290
    }
1128
1291
	bReadSwFly = false;
1129
	if( pTblNd && !pPam->GetPoint()->nContent.GetIndex() &&
1292
	SkipToken(-1);
1130
		pTblNd->EndOfSectionIndex() + 1 ==
1131
			pPam->GetPoint()->nNode.GetIndex() )
1132
	{
1133
		// nicht mehr in der Tabelle, sondern dahinter ?
1134
		// Dann aber wieder zurueck in die Tabelle
1135
		pPam->Move( fnMoveBackward );
1136
	}
1137
	else
1138
		pTblNd = 0;
1139
1140
	// wurde garnichts eingefuegt?
1141
	if( !pTblNd &&
1142
		pPam->GetPoint()->nNode == pFlySave->nSttNd &&
1143
		!pPam->GetPoint()->nContent.GetIndex() )
1144
	{
1145
//		// dann erzeuge mindestens einen leeren TextNode
1146
//		pDoc->AppendTxtNode(*pPam);
1147
		// dann zerstoere den FlySave wieder.
1148
		aFlyArr.DeleteAndDestroy( --nFlyArrCnt );
1149
1150
	}
1151
	else
1152
	{
1153
		FASTBOOL bMovePaM = 0 != pTblNd;
1154
1155
		pFlySave->nEndNd = pPam->GetPoint()->nNode;
1156
		pFlySave->nEndCnt = pPam->GetPoint()->nContent.GetIndex();
1157
1158
		if( bMovePaM )
1159
			pPam->Move( fnMoveForward );
1160
1161
		pTblNd = pFlySave->nSttNd.GetNode().FindTableNode();
1162
		if( pTblNd && !pFlySave->nEndCnt &&
1163
			pTblNd == pFlySave->nEndNd.GetNode().FindTableNode() )
1164
		{
1165
			// dann teste mal, ob das \pard nicht zu spaet kam und
1166
			// eigentlich in die vorherige Zelle gehoert
1167
			const SwStartNode* pSttBoxNd = pFlySave->nSttNd.GetNode().
1168
											FindTableBoxStartNode(),
1169
							* pEndBoxNd = pFlySave->nEndNd.GetNode().
1170
											FindTableBoxStartNode();
1171
			if( pSttBoxNd && pEndBoxNd &&
1172
				bMovePaM ? ( pSttBoxNd == pEndBoxNd )
1173
						 : ( pSttBoxNd->EndOfSectionIndex() + 1 ==
1174
								pEndBoxNd->GetIndex() &&
1175
								pEndBoxNd->GetIndex() + 1 ==
1176
								pFlySave->nEndNd.GetIndex() ))
1177
			{
1178
				// dann gehoert das Ende in die vorherige Box!
1179
				SwPosition aPos( *pPam->GetPoint() );
1180
				pPam->GetPoint()->nNode = *pSttBoxNd->EndOfSectionNode();
1181
				pPam->Move( fnMoveBackward, fnGoNode );
1182
1183
				DelLastNode();
1184
1185
				pPam->GetPoint()->nNode = *pSttBoxNd->EndOfSectionNode();
1186
				pPam->Move( fnMoveBackward, fnGoNode );
1187
1188
				pFlySave->nEndNd = pPam->GetPoint()->nNode;
1189
				pFlySave->nEndCnt = pPam->GetPoint()->nContent.GetIndex();
1190
1191
				*pPam->GetPoint() = aPos;
1192
			}
1193
		}
1194
		else if( !bReadSwFly && !pFlySave->nEndCnt &&
1195
			pFlySave->nSttNd.GetIndex() + 1 == pFlySave->nEndNd.GetIndex() &&
1196
			pFlySave->nSttNd.GetNode().IsTxtNode() )
1197
		{
1198
1199
			SwTxtNode* pTxtNd = pFlySave->nSttNd.GetNode().GetTxtNode();
1200
			SwTxtFlyCnt* pFlyCnt;
1201
			if( 1 == pTxtNd->GetTxt().Len() &&
1202
				0 != ( pFlyCnt = (SwTxtFlyCnt*)pTxtNd->GetTxtAttr(
1203
												0, RES_TXTATR_FLYCNT )) &&
1204
				pFlyCnt->GetFlyCnt().GetFrmFmt() )
1205
			{
1206
				// then move the content into the surrounded fly
1207
				SwFrmFmt* pFlyFmt = pFlyCnt->GetFlyCnt().GetFrmFmt();
1208
				const SwNodeIndex* pFlySNd = pFlyFmt->GetCntnt().GetCntntIdx();
1209
				SwNodeRange aRg( *pFlySNd, 1,
1210
								 *pFlySNd->GetNode().EndOfSectionNode(), 0 );
1211
1212
				// merge the itemsets
1213
				SwFmtFrmSize aSz1( (SwFmtFrmSize&)pFlyFmt->GetAttrSet().
1214
												Get( RES_FRM_SIZE ));
1215
				SwFmtFrmSize aSz2( (SwFmtFrmSize&)pFlySave->aFlySet.
1216
												Get( RES_FRM_SIZE ));
1217
				// if
1218
				if( !aRg.aStart.GetNode().IsNoTxtNode() ||
1219
					!aSz1.GetHeight() || !aSz1.GetWidth() ||
1220
					!aSz2.GetHeight() || !aSz2.GetWidth() ||
1221
					( aSz1.GetHeight() == aSz2.GetHeight() &&
1222
					  aSz1.GetWidth() == aSz2.GetWidth() ) )
1223
				{
1224
					SfxItemSet aDiffs( pFlyFmt->GetAttrSet() );
1225
					aDiffs.ClearItem( RES_ANCHOR );
1226
					aDiffs.ClearItem( RES_FRM_SIZE );
1227
					aDiffs.ClearItem( RES_CNTNT );
1228
					aDiffs.Differentiate( pFlySave->aFlySet );
1229
					pFlySave->aFlySet.Put( aDiffs );
1230
1231
					BOOL bSet = FALSE;
1232
					if( aSz1.GetHeight() && !aSz2.GetHeight() )
1233
					{
1234
						bSet = TRUE;
1235
						aSz2.SetHeight( aSz1.GetHeight() );
1236
					}
1237
					if( aSz1.GetWidth() && !aSz2.GetWidth() )
1238
					{
1239
						bSet = TRUE;
1240
						aSz2.SetWidth( aSz1.GetWidth() );
1241
					}
1242
					if( bSet )
1243
						pFlySave->aFlySet.Put( aSz2 );
1244
1245
					// move any PageBreak/Desc Attr to the next Para
1246
					{
1247
						SwCntntNode* pSrcNd = pFlySave->nSttNd.GetNode().GetCntntNode();
1248
						SwCntntNode* pDstNd = pFlySave->nEndNd.GetNode().GetCntntNode();
1249
1250
						::lcl_CpyBreakAttrs( pSrcNd, pDstNd, &pFlySave->nEndNd );
1251
					}
1252
1253
					// create new txtnode, because the section does never be empty
1254
					pDoc->GetNodes().MakeTxtNode( aRg.aStart,
1255
								(SwTxtFmtColl*)pDoc->GetDfltTxtFmtColl() );
1256
1257
					SwNodeIndex aTmp( pFlySave->nSttNd, +1 );
1258
					pDoc->Move( aRg, aTmp );
1259
1260
					// now delete the redundant txtnode
1261
					pDoc->GetNodes().Delete( pFlySave->nSttNd, 1 );
1262
				}
1263
			}
1264
		}
1265
	}
1266
1267
	bReadSwFly = FALSE;
1268
	SkipToken( -1 );
1269
}
1293
}
1270
1294
#endif
1271
1295
1272
void SwRTFParser::InsPicture( const String& rGrfNm, const Graphic* pGrf,
1296
void SwRTFParser::InsPicture( const String& rGrfNm, const Graphic* pGrf,
1273
								const SvxRTFPictureType* pPicType )
1297
								const SvxRTFPictureType* pPicType )
Lines 1473-1479 Link Here
1473
	rSet.Put( SwFmtFrmSize( ATT_FIX_SIZE, aSize.Width(), aSize.Height() ));
1497
	rSet.Put( SwFmtFrmSize( ATT_FIX_SIZE, aSize.Width(), aSize.Height() ));
1474
}
1498
}
1475
1499
1476
void SwRTFParser::GetPageSize( Size& rSize )
1500
void SwRTFParser::GetPageSize(Size& rSize) const
1477
{
1501
{
1478
    ASSERT(!maSegments.empty(), "not possible");
1502
    ASSERT(!maSegments.empty(), "not possible");
1479
    if (maSegments.empty())
1503
    if (maSegments.empty())
(-)rtftbl.cxx (-2 / +5 lines)
Lines 2-10 Link Here
2
 *
2
 *
3
 *  $RCSfile: rtftbl.cxx,v $
3
 *  $RCSfile: rtftbl.cxx,v $
4
 *
4
 *
5
 *  $Revision: 1.21 $
5
 *  $Revision: 1.19.30.2 $
6
 *
6
 *
7
 *  last change: $Author: obo $ $Date: 2004/01/13 16:50:52 $
7
 *  last change: $Author: cmc $ $Date: 2004/01/22 17:17:32 $
8
 *
8
 *
9
 *  The Contents of this file are made available subject to the terms of
9
 *  The Contents of this file are made available subject to the terms of
10
 *  either of the following licenses
10
 *  either of the following licenses
Lines 857-864 Link Here
857
            {
857
            {
858
                if (const SwEndNode *pEnd = pStart->EndOfSectionNode())
858
                if (const SwEndNode *pEnd = pStart->EndOfSectionNode())
859
                {
859
                {
860
                    SwNodeIndex aOld(pPam->GetPoint()->nNode);
860
		            pPam->GetPoint()->nNode = *pEnd;
861
		            pPam->GetPoint()->nNode = *pEnd;
861
		            pPam->Move( fnMoveBackward, fnGoCntnt );
862
		            pPam->Move( fnMoveBackward, fnGoCntnt );
863
                    SwNodeIndex aNew(pPam->GetPoint()->nNode);
864
                    maFrameManager.MoveStart(aOld, aNew);
862
                    bFailure = false;
865
                    bFailure = false;
863
                }
866
                }
864
            }
867
            }
(-)swparrtf.cxx (-48 / +184 lines)
Lines 2-10 Link Here
2
 *
2
 *
3
 *  $RCSfile: swparrtf.cxx,v $
3
 *  $RCSfile: swparrtf.cxx,v $
4
 *
4
 *
5
 *  $Revision: 1.35 $
5
 *  $Revision: 1.34.14.2 $
6
 *
6
 *
7
 *  last change: $Author: obo $ $Date: 2004/01/13 16:51:23 $
7
 *  last change: $Author: cmc $ $Date: 2004/01/22 17:17:44 $
8
 *
8
 *
9
 *  The Contents of this file are made available subject to the terms of
9
 *  The Contents of this file are made available subject to the terms of
10
 *  either of the following licenses
10
 *  either of the following licenses
Lines 250-260 Link Here
250
#include <SwStyleNameMapper.hxx>
250
#include <SwStyleNameMapper.hxx>
251
#endif
251
#endif
252
252
253
#ifndef SW_MS_MSFILTER_HXX
254
#include <msfilter.hxx>
255
#endif
256
#ifndef WW_WWSTYLES_HXX
253
#ifndef WW_WWSTYLES_HXX
257
#include "../inc/wwstyles.hxx"
254
#   include <wwstyles.hxx>
258
#endif
255
#endif
259
// einige Hilfs-Funktionen
256
// einige Hilfs-Funktionen
260
// char
257
// char
Lines 323-334 Link Here
323
	SetReadDocInfo( TRUE );
320
	SetReadDocInfo( TRUE );
324
321
325
	// diese sollen zusaetzlich ueber \pard zurueck gesetzt werden
322
	// diese sollen zusaetzlich ueber \pard zurueck gesetzt werden
326
	USHORT temp;
323
	AddPlainAttr(RES_TXTATR_CHARFMT);
327
	temp = RES_TXTATR_CHARFMT;      AddPlainAttr( temp );
324
	AddPardAttr(RES_PAGEDESC);
328
	temp = RES_PAGEDESC;            AddPardAttr( temp );
325
	AddPardAttr(RES_BREAK);
329
	temp = RES_BREAK;               AddPardAttr( temp );
326
	AddPardAttr(RES_PARATR_NUMRULE);
330
	temp = RES_PARATR_NUMRULE;		AddPardAttr( temp );
327
	AddPardAttr(FN_PARAM_NUM_LEVEL);
331
	temp = FN_PARAM_NUM_LEVEL;			AddPardAttr( temp );
328
329
    maFrameManager.StartPara(*pPam);
330
}
331
332
//The defaults according to the RTF 1.6 Specification with a little obvious
333
//extrapolation from section "Positioned Objects and Frames"
334
APOProperties::APOProperties()
335
    : absh(0), absw(0), eHoriRel(phcol), posx(0), eHoriOri(posxl),
336
    eVertRel(pvmrg), posy(0), eVertOri(posynone), abslock(false), nowrap(false),
337
    dfrmtxtx(0), dfrmtxty(0), overlay(false), dropcapli(0), dropcapt(none),
338
    absnoovrlp(false), eFlow(frmtxlrtb)
339
{
340
}
341
342
bool APOProperties::operator==(const APOProperties& rOther) const
343
{
344
    return 
345
    (
346
        absw == rOther.absw &&
347
        absh == rOther.absh &&
348
        eHoriRel == rOther.eHoriRel &&
349
        posx == rOther.posx && 
350
        eHoriOri == rOther.eHoriOri &&
351
        eVertRel == rOther.eVertRel &&
352
        posy == rOther.posy &&
353
        eVertOri == rOther.eVertOri &&
354
        abslock == rOther.abslock &&
355
        nowrap == rOther.nowrap &&
356
        dfrmtxtx == rOther.dfrmtxtx &&
357
        dfrmtxty == rOther.dfrmtxty &&
358
        overlay == rOther.overlay &&
359
        dropcapli == rOther.dropcapli &&
360
        dropcapt == rOther.dropcapt &&
361
        absnoovrlp == rOther.absnoovrlp &&
362
        eFlow == rOther.eFlow
363
    );
364
}
365
366
void SwRTFParser::EnterEnvironment()
367
{
368
    maFrameManager.EnterEnvironment();
369
}
370
371
void SwRTFParser::LeaveEnvironment()
372
{
373
    maFrameManager.LeaveEnvironment();
374
}
375
376
void SwRTFParser::ResetPard()
377
{
378
    maFrameManager.ResetCurrentEnvironment();
379
}
380
381
void SwRTFParser::InsertText()
382
{
383
    bContainsPara = false;      
384
	// dann fuege den String ein, ohne das Attribute am Ende
385
	// aufgespannt werden.
386
	CheckInsNewTblLine();
387
	pDoc->Insert( *pPam, aToken );
332
}
388
}
333
389
334
// Aufruf des Parsers
390
// Aufruf des Parsers
Lines 574-579 Link Here
574
		else if( GetDocInfo() )
630
		else if( GetDocInfo() )
575
			// evt. eingelesen DocInfo setzen
631
			// evt. eingelesen DocInfo setzen
576
			pDoc->SetInfo( *GetDocInfo() );
632
			pDoc->SetInfo( *GetDocInfo() );
633
634
        maFrameManager.MakeFlyFrames(*this);
577
	}
635
	}
578
	delete pSttNdIdx, pSttNdIdx = 0;
636
	delete pSttNdIdx, pSttNdIdx = 0;
579
	delete pRegionEndIdx, pRegionEndIdx = 0;
637
	delete pRegionEndIdx, pRegionEndIdx = 0;
Lines 1309-1315 Link Here
1309
			// Tabelle nicht mehr vorhanden ?
1367
			// Tabelle nicht mehr vorhanden ?
1310
			if (USHRT_MAX != nInsTblRow && !pTableNode)
1368
			if (USHRT_MAX != nInsTblRow && !pTableNode)
1311
				NewTblLine();				// evt. Line copieren
1369
				NewTblLine();				// evt. Line copieren
1370
            maFrameManager.EndPara(*pPam);
1312
			GotoNextBox();
1371
			GotoNextBox();
1372
            maFrameManager.StartPara(*pPam);
1313
		}
1373
		}
1314
		break;
1374
		break;
1315
1375
Lines 1468-1524 Link Here
1468
// RTF_SUBENTRYINDEX
1528
// RTF_SUBENTRYINDEX
1469
1529
1470
	default:
1530
	default:
1471
		switch( nToken & ~(0xff | RTF_SWGDEFS) )
1531
        {
1472
		{
1532
            /* Just to break this into its logical handlers we'll split the
1473
		case RTF_DOCFMT:
1533
             * remainder of the tokens into seperate handlers */
1474
			ReadDocControls( nToken );
1534
            bool bHandled = maFrameManager.HandleToken(nToken, nTokenValue);
1475
			break;
1535
            if (!bHandled)
1476
		case RTF_SECTFMT:
1536
            {
1477
			ReadSectControls( nToken );
1537
                //Legacy messy code
1478
			break;
1538
                switch( nToken & ~(0xff | RTF_SWGDEFS) )
1479
		case RTF_APOCTL:
1539
                {
1480
			ReadFly( nToken );
1540
                case RTF_DOCFMT:
1481
			break;
1541
                    ReadDocControls( nToken );
1482
		case RTF_BRDRDEF | RTF_TABLEDEF:
1542
                    break;
1483
		case RTF_SHADINGDEF | RTF_TABLEDEF:
1543
                case RTF_SECTFMT:
1484
		case RTF_TABLEDEF:
1544
                    ReadSectControls( nToken );
1485
			ReadTable( nToken );
1545
                    break;
1486
			break;
1546
                case RTF_BRDRDEF | RTF_TABLEDEF:
1487
1547
                case RTF_SHADINGDEF | RTF_TABLEDEF:
1488
		case RTF_INFO:
1548
                case RTF_TABLEDEF:
1489
			ReadInfo();
1549
                    ReadTable( nToken );
1490
			break;
1550
                    break;
1491
1551
1492
		default:
1552
                case RTF_INFO:
1493
			if( USHRT_MAX != nInsTblRow &&
1553
                    ReadInfo();
1494
				(nInsTblRow > GetOpenBrakets() || IsPardTokenRead() ))
1554
                    break;
1495
				nInsTblRow = USHRT_MAX;
1555
                }
1556
            }
1496
1557
1497
			SvxRTFParser::NextToken( nToken );
1558
            if (!bHandled)
1498
			break;
1559
            {
1499
		}
1560
                if( USHRT_MAX != nInsTblRow &&
1561
                    (nInsTblRow > GetOpenBrakets() || IsPardTokenRead() ))
1562
                    nInsTblRow = USHRT_MAX;
1563
1564
                SvxRTFParser::NextToken( nToken );
1565
            }
1566
        }
1567
		break;
1500
	}
1568
	}
1501
	if( USHRT_MAX != nInsTblRow &&
1569
	if( USHRT_MAX != nInsTblRow &&
1502
		(nInsTblRow > GetOpenBrakets() || IsPardTokenRead() ))
1570
		(nInsTblRow > GetOpenBrakets() || IsPardTokenRead() ))
1503
		nInsTblRow = USHRT_MAX;
1571
		nInsTblRow = USHRT_MAX;
1504
}
1572
}
1505
1573
1574
void rtfFrameManager::EndPara(const SwPaM &rPaM)
1575
{
1576
    ASSERT(!maFrames.empty(), "called without any paragraphs");
1577
    if (!maFrames.empty())
1578
    {
1579
        if (maFrames.size() > 1)
1580
        {
1581
            //Consecutive paragraphs with the same frame 
1582
            //formatting are considered part of the same frame.
1583
            myrIter aRIter = maFrames.rbegin();
1584
            ++aRIter;
1585
            if (aRIter->maApoProps == CurrentAPO())
1586
                maFrames.pop_back();
1587
        }
1506
1588
1507
void SwRTFParser::InsertText()
1589
        maFrames.back().setend(rPaM, CurrentAPO());
1590
    }
1591
}
1592
1593
void rtfFrameManager::MoveStart(const SwNodeIndex &rOld, 
1594
    const SwNodeIndex &rNew)
1508
{
1595
{
1509
    bContainsPara = false;      
1596
    if (!maFrames.empty())
1510
	// dann fuege den String ein, ohne das Attribute am Ende
1597
    {
1511
	// aufgespannt werden.
1598
        if (maFrames.back().mnSttNd == rOld)
1512
	CheckInsNewTblLine();
1599
            maFrames.back().mnSttNd = rNew;
1513
	pDoc->Insert( *pPam, aToken );
1600
    }
1514
}
1601
}
1515
1602
1603
void rtfFrameManager::StartPara(const SwPaM &rPaM)
1604
{
1605
    maFrames.push_back(rtfFrame(rPaM));
1606
}
1607
1608
APOProperties &rtfFrameManager::CurrentAPO() 
1609
{ 
1610
    ASSERT(!maProps.empty(), "called without any paragraphs");
1611
    //throw something
1612
    return maProps.top();
1613
}
1614
1615
void rtfFrameManager::ResetCurrentEnvironment()
1616
{
1617
    ASSERT(!maFrames.empty(), "called without any paragraphs");
1618
    CurrentAPO() = APOProperties();
1619
}
1620
1621
bool rtfFrameManager::HandleToken(int nToken, long nTokenValue)
1622
{
1623
    return CurrentAPO().HandleToken(nToken, nTokenValue);
1624
}
1625
1626
void rtfFrameManager::EnterEnvironment()
1627
{
1628
    if (maProps.empty())
1629
        maProps.push(APOProperties());
1630
    else
1631
        maProps.push(maProps.top());
1632
}
1633
1634
void rtfFrameManager::LeaveEnvironment()
1635
{
1636
    ASSERT(!maProps.empty(), "should not be empty");
1637
    if (!maProps.empty())
1638
        maProps.pop();
1639
}
1640
1641
rtfFrameManager::rtfFrameManager()
1642
{
1643
    EnterEnvironment();
1644
}
1645
1646
rtfFrameManager::~rtfFrameManager()
1647
{
1648
    ASSERT(maProps.size() == 1, "Expected only 1 environment at dtor, no problem though");
1649
    while (!maProps.empty())
1650
        maProps.pop();
1651
}
1516
1652
1517
void SwRTFParser::InsertPara()
1653
void SwRTFParser::InsertPara()
1518
{
1654
{
1519
    bContainsPara = true;
1655
    bContainsPara = true;
1520
	CheckInsNewTblLine();
1656
	CheckInsNewTblLine();
1657
    maFrameManager.EndPara(*pPam);
1521
	pDoc->AppendTxtNode(*pPam->GetPoint());
1658
	pDoc->AppendTxtNode(*pPam->GetPoint());
1659
    maFrameManager.StartPara(*pPam);
1522
1660
1523
	// setze das default Style
1661
	// setze das default Style
1524
	if( !bStyleTabValid )
1662
	if( !bStyleTabValid )
Lines 1531-1538 Link Here
1531
1669
1532
	::SetProgressState( rInput.Tell(), pDoc->GetDocShell() );
1670
	::SetProgressState( rInput.Tell(), pDoc->GetDocShell() );
1533
}
1671
}
1534
1535
1536
1672
1537
void SwRTFParser::MovePos( int bForward )
1673
void SwRTFParser::MovePos( int bForward )
1538
{
1674
{
(-)swparrtf.hxx (-16 / +123 lines)
Lines 2-10 Link Here
2
 *
2
 *
3
 *  $RCSfile: swparrtf.hxx,v $
3
 *  $RCSfile: swparrtf.hxx,v $
4
 *
4
 *
5
 *  $Revision: 1.15 $
5
 *  $Revision: 1.14.14.2 $
6
 *
6
 *
7
 *  last change: $Author: obo $ $Date: 2004/01/13 16:51:53 $
7
 *  last change: $Author: cmc $ $Date: 2004/01/22 17:17:56 $
8
 *
8
 *
9
 *  The Contents of this file are made available subject to the terms of
9
 *  The Contents of this file are made available subject to the terms of
10
 *  either of the following licenses
10
 *  either of the following licenses
Lines 64-78 Link Here
64
#ifndef _SWPARRTF_HXX
64
#ifndef _SWPARRTF_HXX
65
#define _SWPARRTF_HXX
65
#define _SWPARRTF_HXX
66
66
67
#ifndef __SGI_STL_MAP
68
#include <map>
67
#include <map>
69
#endif
70
#ifndef __SGI_STL_DEQUE
71
#include <deque>
68
#include <deque>
72
#endif
69
#include <stack>
73
#ifndef __SGI_STL_VECTOR
74
#include <vector>
70
#include <vector>
75
#endif
76
71
77
#ifndef _SVSTDARR_HXX
72
#ifndef _SVSTDARR_HXX
78
#define _SVSTDARR_BOOLS
73
#define _SVSTDARR_BOOLS
Lines 93-99 Link Here
93
#endif
88
#endif
94
89
95
#ifndef SW_MS_MSFILTER_HXX
90
#ifndef SW_MS_MSFILTER_HXX
96
#include "../inc/msfilter.hxx"
91
#include <msfilter.hxx>
97
#endif
92
#endif
98
93
99
extern void GetLineIndex(SvxBoxItem &rBox, short nLineThickness, short nSpace, BYTE nCol, short nIdx,
94
extern void GetLineIndex(SvxBoxItem &rBox, short nLineThickness, short nSpace, BYTE nCol, short nIdx,
Lines 273-278 Link Here
273
    bool IsLandScape() const { return maPageInfo.mbLndscpsxn; }
268
    bool IsLandScape() const { return maPageInfo.mbLndscpsxn; }
274
};
269
};
275
270
271
class TokenHandler
272
{
273
public:
274
    virtual bool HandleToken(int nToken, long nTokenValue) = 0;
275
};
276
277
enum horirel {phmrg, phpg, phcol};
278
enum horiori {posxnone, posxc, posxi, posxo, posxr, posxl};
279
enum vertrel {pvmrg, pvpg, pvpara};
280
enum vertori {posynone, posyil, posyt, posyc, posyb, posyin, posyout};
281
enum dropcap {none = 0, intext = 1, margin = 2};
282
enum textflow {frmtxlrtb, frmtxtbrl, frmtxbtlr, frmtxlrtbv, frmtxtbrlv};
283
284
//See RTF Specification 1.6 Section "Positioned Objects and Frames" for details
285
class APOProperties : public TokenHandler
286
{
287
public:
288
    //Frame Size
289
    long absw;
290
    long absh;
291
    //Horizontal Position
292
    horirel eHoriRel;   //phmrg, phpg, phcol
293
    long posx;          //posx, posnegx
294
    horiori eHoriOri;   //posxc, posxi, posxo, posxr, posxl
295
    //Vertical Position
296
    vertrel eVertRel;   //pvmrg, pvpg, pvpara
297
    long posy;          //posy, posnegy
298
    vertori eVertOri;   //posyil, posyt, posyc, posyb, posyin, posyout
299
    bool abslock;
300
    //Text Wrapping
301
    bool nowrap;
302
    long dfrmtxtx;      //dfrmtxtx, dxfrtext
303
    long dfrmtxty;      //dfrmtxty, dxfrtext
304
    bool overlay;
305
    //Drop Caps
306
    long dropcapli;
307
    dropcap dropcapt;
308
    //Overlap
309
    bool absnoovrlp;
310
    //Text Flow
311
    textflow eFlow;    //frmtxlrtb, frmtxtbrl, frmtxbtlr, frmtxlrtbv, frmtxtbrlv
312
313
    APOProperties();
314
    bool HandleToken(int nToken, long nTokenValue);
315
    bool operator==(const APOProperties& rOther) const;
316
};
317
318
class rtfFrame
319
{
320
public:
321
    APOProperties maApoProps;
322
    SwNodeIndex mnSttNd, mnEndNd;
323
    xub_StrLen  mnSttCnt, mnEndCnt;
324
    rtfFrame(const SwPaM &rPaM);
325
    void setend(const SwPaM &rPaM, const APOProperties &rApoProperties);
326
    void ConvertToItemSet(SfxItemSet &rSet) const;
327
};
328
329
/*
330
 A lot of the current code in the filter sees a token of e.g. frame type and
331
 loops through all the following tokens until it sees one it doesn't know and
332
 considers that the end of all the frame positioning tokens. This is clearly
333
 rubbish, as the spec clearly says "These control words can appear anywhere in
334
 the body of the paragraph, not just at the beginning." Instead we should
335
 gather this information inside the range in which it has an effect and make
336
 our decisions when we leave that environment and know at that stage that we
337
 have seen all the possible tokens that will affect our decision
338
339
 In other words the rtfFrameManager and related classes are right, nearly
340
 everthing else is probably wrong :-(. But one step at a time
341
*/
342
class rtfFrameManager : public TokenHandler
343
{
344
private:
345
    std::stack<APOProperties> maProps;
346
    std::deque<rtfFrame> maFrames;
347
    typedef std::deque<rtfFrame>::const_iterator mycIter;
348
    typedef std::deque<rtfFrame>::reverse_iterator myrIter;
349
public:
350
    APOProperties &CurrentAPO();
351
352
    void EnterEnvironment();
353
    void ResetCurrentEnvironment();
354
    void LeaveEnvironment();
355
356
    void StartPara(const SwPaM &rPaM);
357
    void MoveStart(const SwNodeIndex &rOld, const SwNodeIndex &rNew);
358
    void EndPara(const SwPaM &rPaM);
359
360
    bool HandleToken(int nToken, long nTokenValue);
361
362
    void MakeFlyFrames(const SwRTFParser &rReader) const;
363
364
    rtfFrameManager();
365
    ~rtfFrameManager();
366
};
367
276
class rtfSections
368
class rtfSections
277
{
369
{
278
private:
370
private:
Lines 323-333 Link Here
323
    */
415
    */
324
    sw::util::ParaStyleMapper maParaStyleMapper;
416
    sw::util::ParaStyleMapper maParaStyleMapper;
325
    sw::util::CharStyleMapper maCharStyleMapper;
417
    sw::util::CharStyleMapper maCharStyleMapper;
326
    
418
327
    friend class rtfSections;
419
    /*
420
     The default page settings
421
    */
328
    DocPageInformation maPageDefaults;
422
    DocPageInformation maPageDefaults;
423
424
    /*
425
     All the sections which are inserted into the document
426
    */
427
    friend class rtfSections;
329
    rtfSections maSegments;
428
    rtfSections maSegments;
330
429
430
    /*
431
     All the frames (Absolutely Positioned Objects) which are inserted into the
432
     document
433
    */
434
    friend class rtfFrameManager;
435
    rtfFrameManager maFrameManager;
436
    virtual void EnterEnvironment();
437
    virtual void LeaveEnvironment();
438
    virtual void ResetPard();
439
	virtual void InsertPara();
440
    
331
    std::map<SwTableNode *, SwNodeIndex *> maTables;
441
    std::map<SwTableNode *, SwNodeIndex *> maTables;
332
	SwRTFStyleTbl aTxtCollTbl;
442
	SwRTFStyleTbl aTxtCollTbl;
333
	SwRTFCharStyleTbl aCharFmtTbl;
443
	SwRTFCharStyleTbl aCharFmtTbl;
Lines 368-374 Link Here
368
    */
478
    */
369
    bool CantUseTables() const { return mbReadNoTbl || mbIsFootnote; }
479
    bool CantUseTables() const { return mbReadNoTbl || mbIsFootnote; }
370
480
371
	virtual void InsertPara();
372
	virtual void InsertText();
481
	virtual void InsertText();
373
	virtual void MovePos( int bForward = TRUE );
482
	virtual void MovePos( int bForward = TRUE );
374
	virtual void SetEndPrevPara( SvxNodeIdx*& rpNodePos, xub_StrLen& rCntPos );
483
	virtual void SetEndPrevPara( SvxNodeIdx*& rpNodePos, xub_StrLen& rCntPos );
Lines 415-421 Link Here
415
							SfxItemSet& rSet, const SvxRTFPictureType* = 0  );
524
							SfxItemSet& rSet, const SvxRTFPictureType* = 0  );
416
525
417
	void SetFlysInDoc();
526
	void SetFlysInDoc();
418
	void GetPageSize( Size& rSize );		// Groesse der PagePrintArea
527
	void GetPageSize(Size& rSize) const;		// Groesse der PagePrintArea
419
528
420
	// fuers Einlesen von Tabellen
529
	// fuers Einlesen von Tabellen
421
	void GotoNextBox();
530
	void GotoNextBox();
Lines 429-436 Link Here
429
								const SwNodeIndex& rEnd );
538
								const SwNodeIndex& rEnd );
430
	void SetNumLSpace( SwTxtNode& rNd, const SwNodeNum& rNum,
539
	void SetNumLSpace( SwTxtNode& rNd, const SwNodeNum& rNum,
431
								const SwNumRule& rRule );
540
								const SwNumRule& rRule );
432
    long GetSafePos(long nPos);
433
434
protected:
541
protected:
435
	// wird fuer jedes Token gerufen, das in CallParser erkannt wird
542
	// wird fuer jedes Token gerufen, das in CallParser erkannt wird
436
	virtual void NextToken( int nToken );
543
	virtual void NextToken( int nToken );
Lines 452-458 Link Here
452
	void SetPageInformationAsDefault(const DocPageInformation &rInfo);
559
	void SetPageInformationAsDefault(const DocPageInformation &rInfo);
453
	void ReadSectControls( int nToken );
560
	void ReadSectControls( int nToken );
454
	void DoHairyWriterPageDesc(int nToken);
561
	void DoHairyWriterPageDesc(int nToken);
455
	void ReadFly( int nToken, SfxItemSet* pFillSet = 0 );
562
	bool ReadFly(int nToken);
456
	void ReadTable( int nToken );
563
	void ReadTable( int nToken );
457
	void ReadPageDescTbl();
564
	void ReadPageDescTbl();
458
565

Return to issue 15020