1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: eeimpars.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sc.hxx"
36 //------------------------------------------------------------------------
38 #include "scitems.hxx"
39 #include <svx/eeitem.hxx>
42 #include <svx/adjitem.hxx>
43 #include <svx/editobj.hxx>
44 #include <svx/editview.hxx>
45 #include <svx/escpitem.hxx>
46 #include <svx/langitem.hxx>
47 #include <svx/svdograf.hxx>
48 #include <svx/svdpage.hxx>
49 #include <svx/scripttypeitem.hxx>
50 #include <svx/htmlcfg.hxx>
51 #include <sfx2/sfxhtml.hxx>
52 #include <svtools/parhtml.hxx>
53 #include <svtools/zforlist.hxx>
54 #include <vcl/virdev.hxx>
55 #include <vcl/svapp.hxx>
56 #include <svtools/syslocale.hxx>
57 #include <unotools/charclass.hxx>
59 #include "eeimport.hxx"
61 #include "document.hxx"
62 #include "editutil.hxx"
63 #include "stlsheet.hxx"
64 #include "docpool.hxx"
66 #include "patattr.hxx"
68 #include "eeparser.hxx"
69 #include "drwlayer.hxx"
70 #include "rangenam.hxx"
71 #include "progress.hxx"
72 #include "stringutil.hxx"
74 #include "globstr.hrc"
77 extern void ScLimitSizeOnDrawPage( Size
& rSize
, Point
& rPos
, const Size
& rPage
);
79 //------------------------------------------------------------------------
81 ScEEImport::ScEEImport( ScDocument
* pDocP
, const ScRange
& rRange
) :
85 mpRowHeights( new Table
)
87 const ScPatternAttr
* pPattern
= mpDoc
->GetPattern(
88 maRange
.aStart
.Col(), maRange
.aStart
.Row(), maRange
.aStart
.Tab() );
89 mpEngine
= new ScTabEditEngine( *pPattern
, mpDoc
->GetEditPool() );
90 mpEngine
->SetUpdateMode( FALSE
);
91 mpEngine
->EnableUndo( FALSE
);
95 ScEEImport::~ScEEImport()
97 // Reihenfolge wichtig, sonst knallt's irgendwann irgendwo in irgendeinem Dtor!
98 // Ist gewaehrleistet, da ScEEImport Basisklasse ist
99 delete mpEngine
; // nach Parser!
104 ULONG
ScEEImport::Read( SvStream
& rStream
, const String
& rBaseURL
)
106 ULONG nErr
= mpParser
->Read( rStream
, rBaseURL
);
110 mpParser
->GetDimensions( nEndCol
, nEndRow
);
113 nEndCol
+= maRange
.aStart
.Col() - 1;
114 if ( nEndCol
> MAXCOL
)
118 nEndCol
= maRange
.aStart
.Col();
121 nEndRow
+= maRange
.aStart
.Row() - 1;
122 if ( nEndRow
> MAXROW
)
126 nEndRow
= maRange
.aStart
.Row();
127 maRange
.aEnd
.Set( nEndCol
, nEndRow
, maRange
.aStart
.Tab() );
133 void ScEEImport::WriteToDocument( BOOL bSizeColsRows
, double nOutputFactor
, SvNumberFormatter
* pFormatter
, bool bConvertDate
)
135 ScProgress
* pProgress
= new ScProgress( mpDoc
->GetDocumentShell(),
136 ScGlobal::GetRscString( STR_LOAD_DOC
), mpParser
->Count() );
139 SCCOL nStartCol
, nEndCol
;
140 SCROW nStartRow
, nEndRow
;
142 SCROW nOverlapRowMax
, nLastMergedRow
;
144 nStartCol
= maRange
.aStart
.Col();
145 nStartRow
= maRange
.aStart
.Row();
146 nTab
= maRange
.aStart
.Tab();
147 nEndCol
= maRange
.aEnd
.Col();
148 nEndRow
= maRange
.aEnd
.Row();
151 nLastMergedRow
= SCROW_MAX
;
152 BOOL bHasGraphics
= FALSE
;
155 pFormatter
= mpDoc
->GetFormatTable();
156 bool bNumbersEnglishUS
= (pFormatter
->GetLanguage() != LANGUAGE_ENGLISH_US
);
157 if (bNumbersEnglishUS
)
160 bNumbersEnglishUS
= aOpt
.IsNumbersEnglishUS();
162 ScDocumentPool
* pDocPool
= mpDoc
->GetPool();
163 ScRangeName
* pRangeNames
= mpDoc
->GetRangeName();
164 for ( pE
= mpParser
->First(); pE
; pE
= mpParser
->Next() )
166 SCROW nRow
= nStartRow
+ pE
->nRow
;
167 if ( nRow
!= nLastMergedRow
)
169 SCCOL nCol
= nStartCol
+ pE
->nCol
+ nMergeColAdd
;
170 // RowMerge feststellen, pures ColMerge und ColMerge der ersten
171 // MergeRow bereits beim parsen
172 if ( nRow
<= nOverlapRowMax
)
174 while ( nCol
<= MAXCOL
&& mpDoc
->HasAttrib( nCol
, nRow
, nTab
,
175 nCol
, nRow
, nTab
, HASATTR_OVERLAPPED
) )
180 nLastMergedRow
= nRow
;
182 // fuer zweiten Durchlauf eintragen
185 if ( ValidCol(nCol
) && ValidRow(nRow
) )
187 SfxItemSet aSet
= mpEngine
->GetAttribs( pE
->aSel
);
188 // Default raus, wir setzen selber links/rechts je nachdem ob Text
189 // oder Zahl; EditView.GetAttribs liefert immer kompletten Set
190 // mit Defaults aufgefuellt
191 const SfxPoolItem
& rItem
= aSet
.Get( EE_PARA_JUST
);
192 if ( ((const SvxAdjustItem
&)rItem
).GetAdjust() == SVX_ADJUST_LEFT
)
193 aSet
.ClearItem( EE_PARA_JUST
);
195 // Testen, ob einfacher String ohne gemischte Attribute
196 BOOL bSimple
= ( pE
->aSel
.nStartPara
== pE
->aSel
.nEndPara
);
197 for (USHORT nId
= EE_CHAR_START
; nId
<= EE_CHAR_END
&& bSimple
; nId
++)
199 const SfxPoolItem
* pItem
= 0;
200 SfxItemState eState
= aSet
.GetItemState( nId
, TRUE
, &pItem
);
201 if (eState
== SFX_ITEM_DONTCARE
)
203 else if (eState
== SFX_ITEM_SET
)
205 if ( nId
== EE_CHAR_ESCAPEMENT
) // Hoch-/Tiefstellen immer ueber EE
207 if ( (SvxEscapement
)((const SvxEscapementItem
*)pItem
)->GetEnumValue()
208 != SVX_ESCAPEMENT_OFF
)
214 { // Feldbefehle enthalten?
215 SfxItemState eFieldState
= aSet
.GetItemState( EE_FEATURE_FIELD
, FALSE
);
216 if ( eFieldState
== SFX_ITEM_DONTCARE
|| eFieldState
== SFX_ITEM_SET
)
221 String aValStr
, aNumStr
;
223 sal_uInt32 nNumForm
= 0;
224 LanguageType eNumLang
= LANGUAGE_NONE
;
226 { // SDNUM muss sein wenn SDVAL
227 aNumStr
= *pE
->pNumStr
;
229 aValStr
= *pE
->pValStr
;
230 fVal
= SfxHTMLParser::GetTableDataOptionsValNum(
231 nNumForm
, eNumLang
, aValStr
, aNumStr
, *pFormatter
);
235 ScPatternAttr
aAttr( pDocPool
);
236 aAttr
.GetFromEditItemSet( &aSet
);
237 SfxItemSet
& rSet
= aAttr
.GetItemSet();
240 rSet
.Put( SfxUInt32Item( ATTR_VALUE_FORMAT
, nNumForm
) );
241 rSet
.Put( SvxLanguageItem( eNumLang
, ATTR_LANGUAGE_FORMAT
) );
243 const SfxItemSet
& rESet
= pE
->aItemSet
;
246 const SfxPoolItem
* pItem
;
247 if ( rESet
.GetItemState( ATTR_BACKGROUND
, FALSE
, &pItem
) == SFX_ITEM_SET
)
249 if ( rESet
.GetItemState( ATTR_BORDER
, FALSE
, &pItem
) == SFX_ITEM_SET
)
251 if ( rESet
.GetItemState( ATTR_SHADOW
, FALSE
, &pItem
) == SFX_ITEM_SET
)
254 if ( rESet
.GetItemState( ATTR_HOR_JUSTIFY
, FALSE
, &pItem
) == SFX_ITEM_SET
)
256 if ( rESet
.GetItemState( ATTR_VER_JUSTIFY
, FALSE
, &pItem
) == SFX_ITEM_SET
)
258 if ( rESet
.GetItemState( ATTR_LINEBREAK
, FALSE
, &pItem
) == SFX_ITEM_SET
)
260 if ( rESet
.GetItemState( ATTR_FONT_COLOR
, FALSE
, &pItem
) == SFX_ITEM_SET
)
262 if ( rESet
.GetItemState( ATTR_FONT_UNDERLINE
, FALSE
, &pItem
) == SFX_ITEM_SET
)
264 // HTML LATIN/CJK/CTL script type dependent
265 const SfxPoolItem
* pFont
;
266 if ( rESet
.GetItemState( ATTR_FONT
, FALSE
, &pFont
) != SFX_ITEM_SET
)
268 const SfxPoolItem
* pHeight
;
269 if ( rESet
.GetItemState( ATTR_FONT_HEIGHT
, FALSE
, &pHeight
) != SFX_ITEM_SET
)
271 const SfxPoolItem
* pWeight
;
272 if ( rESet
.GetItemState( ATTR_FONT_WEIGHT
, FALSE
, &pWeight
) != SFX_ITEM_SET
)
274 const SfxPoolItem
* pPosture
;
275 if ( rESet
.GetItemState( ATTR_FONT_POSTURE
, FALSE
, &pPosture
) != SFX_ITEM_SET
)
277 if ( pFont
|| pHeight
|| pWeight
|| pPosture
)
279 String
aStr( mpEngine
->GetText( pE
->aSel
) );
280 BYTE nScriptType
= mpDoc
->GetStringScriptType( aStr
);
281 const BYTE nScripts
[3] = { SCRIPTTYPE_LATIN
,
282 SCRIPTTYPE_ASIAN
, SCRIPTTYPE_COMPLEX
};
283 for ( BYTE i
=0; i
<3; ++i
)
285 if ( nScriptType
& nScripts
[i
] )
288 rSet
.Put( *pFont
, ScGlobal::GetScriptedWhichID(
289 nScripts
[i
], ATTR_FONT
));
291 rSet
.Put( *pHeight
, ScGlobal::GetScriptedWhichID(
292 nScripts
[i
], ATTR_FONT_HEIGHT
));
294 rSet
.Put( *pWeight
, ScGlobal::GetScriptedWhichID(
295 nScripts
[i
], ATTR_FONT_WEIGHT
));
297 rSet
.Put( *pPosture
, ScGlobal::GetScriptedWhichID(
298 nScripts
[i
], ATTR_FONT_POSTURE
));
303 if ( pE
->nColOverlap
> 1 || pE
->nRowOverlap
> 1 )
304 { // merged cells, mit SfxItemSet Put schneller als mit
305 // nachtraeglichem ScDocument DoMerge
306 ScMergeAttr
aMerge( pE
->nColOverlap
, pE
->nRowOverlap
);
309 if ( pE
->nColOverlap
> 1 )
310 mpDoc
->ApplyFlagsTab( nCol
+1, nRow
,
311 nCol
+ pE
->nColOverlap
- 1, nRow
, nTab
,
313 if ( pE
->nRowOverlap
> 1 )
315 nRO
= nRow
+ pE
->nRowOverlap
- 1;
316 mpDoc
->ApplyFlagsTab( nCol
, nRow
+1,
319 if ( nRO
> nOverlapRowMax
)
320 nOverlapRowMax
= nRO
;
322 if ( pE
->nColOverlap
> 1 && pE
->nRowOverlap
> 1 )
323 mpDoc
->ApplyFlagsTab( nCol
+1, nRow
+1,
324 nCol
+ pE
->nColOverlap
- 1, nRO
, nTab
,
325 SC_MF_HOR
| SC_MF_VER
);
327 const ScStyleSheet
* pStyleSheet
=
328 mpDoc
->GetPattern( nCol
, nRow
, nTab
)->GetStyleSheet();
329 aAttr
.SetStyleSheet( (ScStyleSheet
*)pStyleSheet
);
330 mpDoc
->SetPattern( nCol
, nRow
, nTab
, aAttr
, TRUE
);
335 ScSetStringParam aParam
;
336 aParam
.mpNumFormatter
= pFormatter
;
337 aParam
.mbDetectNumberFormat
= true;
338 aParam
.mbSetTextCellFormat
= true;
341 mpDoc
->SetValue( nCol
, nRow
, nTab
, fVal
);
342 else if ( !pE
->aSel
.HasRange() )
344 // maybe ALT text of IMG or similar
345 mpDoc
->SetString( nCol
, nRow
, nTab
, pE
->aAltText
, &aParam
);
346 // wenn SelRange komplett leer kann nachfolgender Text im gleichen Absatz liegen!
351 if( pE
->bEntirePara
)
353 aStr
= mpEngine
->GetText( pE
->aSel
.nStartPara
);
357 aStr
= mpEngine
->GetText( pE
->aSel
);
358 aStr
.EraseLeadingAndTrailingChars();
361 // TODO: RTF import should follow the language tag,
362 // currently this follows the HTML options for both, HTML
364 bool bEnUsRecognized
= false;
365 if (bNumbersEnglishUS
)
367 pFormatter
->ChangeIntl( LANGUAGE_ENGLISH_US
);
368 sal_uInt32 nIndex
= pFormatter
->GetStandardIndex( LANGUAGE_ENGLISH_US
);
370 if (pFormatter
->IsNumberFormat( aStr
, nIndex
, fEnVal
))
372 bEnUsRecognized
= true;
373 sal_uInt32 nNewIndex
=
374 pFormatter
->GetFormatForLanguageIfBuiltIn(
375 nIndex
, LANGUAGE_SYSTEM
);
376 DBG_ASSERT( nNewIndex
!= nIndex
, "ScEEImport::WriteToDocument: NumbersEnglishUS not a built-in format?");
377 pFormatter
->GetInputLineString( fEnVal
, nNewIndex
, aStr
);
379 pFormatter
->ChangeIntl( LANGUAGE_SYSTEM
);
382 // #105460#, #i4180# String cells can't contain tabs or linebreaks
383 // -> replace with spaces
384 aStr
.SearchAndReplaceAll( (sal_Unicode
)'\t', (sal_Unicode
)' ' );
385 aStr
.SearchAndReplaceAll( (sal_Unicode
)'\n', (sal_Unicode
)' ' );
387 if (bNumbersEnglishUS
&& !bEnUsRecognized
)
388 mpDoc
->PutCell( nCol
, nRow
, nTab
, new ScStringCell( aStr
));
391 aParam
.mbDetectNumberFormat
= bConvertDate
;
392 mpDoc
->SetString( nCol
, nRow
, nTab
, aStr
, &aParam
);
398 EditTextObject
* pObject
= mpEngine
->CreateTextObject( pE
->aSel
);
399 mpDoc
->PutCell( nCol
, nRow
, nTab
, new ScEditCell( pObject
,
400 mpDoc
, mpEngine
->GetEditTextObjectPool() ) );
403 if ( pE
->pImageList
)
404 bHasGraphics
|= GraphicSize( nCol
, nRow
, nTab
, pE
);
406 { // Anchor Name => RangeName
408 if ( !pRangeNames
->SearchName( *pE
->pName
, nIndex
) )
410 ScRangeData
* pData
= new ScRangeData( mpDoc
, *pE
->pName
,
411 ScAddress( nCol
, nRow
, nTab
) );
412 pRangeNames
->Insert( pData
);
416 pProgress
->SetStateOnPercent( ++nProgress
);
421 Table
* pColWidths
= mpParser
->GetColWidths();
422 if ( pColWidths
->Count() )
425 pProgress
->SetState( nProgress
, nEndCol
- nStartCol
+ 1 );
426 for ( SCCOL nCol
= nStartCol
; nCol
<= nEndCol
; nCol
++ )
428 USHORT nWidth
= (USHORT
)(ULONG
) pColWidths
->Get( nCol
);
430 mpDoc
->SetColWidth( nCol
, nTab
, nWidth
);
431 pProgress
->SetState( ++nProgress
);
434 DELETEZ( pProgress
); // SetOptimalHeight hat seinen eigenen ProgressBar
435 // Zeilenhoehen anpassen, Basis 100% Zoom
436 Fraction
aZoom( 1, 1 );
437 double nPPTX
= ScGlobal::nScreenPPTX
* (double) aZoom
438 / nOutputFactor
; // Faktor ist Drucker zu Bildschirm
439 double nPPTY
= ScGlobal::nScreenPPTY
* (double) aZoom
;
440 VirtualDevice aVirtDev
;
441 mpDoc
->SetOptimalHeight( 0, nEndRow
, 0,
442 static_cast< USHORT
>( ScGlobal::nLastRowHeightExtra
), &aVirtDev
,
443 nPPTX
, nPPTY
, aZoom
, aZoom
, FALSE
);
444 if ( mpRowHeights
->Count() )
446 for ( SCROW nRow
= nStartRow
; nRow
<= nEndRow
; nRow
++ )
448 USHORT nHeight
= (USHORT
)(ULONG
) mpRowHeights
->Get( nRow
);
449 if ( nHeight
> mpDoc
->FastGetRowHeight( nRow
, nTab
) )
450 mpDoc
->SetRowHeight( nRow
, nTab
, nHeight
);
455 { // Grafiken einfuegen
456 for ( pE
= mpParser
->First(); pE
; pE
= mpParser
->Next() )
458 if ( pE
->pImageList
)
460 SCCOL nCol
= pE
->nCol
;
461 SCROW nRow
= pE
->nRow
;
462 if ( ValidCol(nCol
) && ValidRow(nRow
) )
463 InsertGraphic( nCol
, nRow
, nTab
, pE
);
472 BOOL
ScEEImport::GraphicSize( SCCOL nCol
, SCROW nRow
, SCTAB
/*nTab*/,
475 ScHTMLImageList
* pIL
= pE
->pImageList
;
476 if ( !pIL
|| !pIL
->Count() )
478 BOOL bHasGraphics
= FALSE
;
479 OutputDevice
* pDefaultDev
= Application::GetDefaultDevice();
480 long nWidth
, nHeight
;
481 nWidth
= nHeight
= 0;
482 sal_Char nDir
= nHorizontal
;
483 for ( ScHTMLImage
* pI
= pIL
->First(); pI
; pI
= pIL
->Next() )
487 Size aSizePix
= pI
->aSize
;
488 aSizePix
.Width() += 2 * pI
->aSpace
.X();
489 aSizePix
.Height() += 2 * pI
->aSpace
.Y();
490 Size aLogicSize
= pDefaultDev
->PixelToLogic( aSizePix
, MapMode( MAP_TWIP
) );
491 if ( nDir
& nHorizontal
)
492 nWidth
+= aLogicSize
.Width();
493 else if ( nWidth
< aLogicSize
.Width() )
494 nWidth
= aLogicSize
.Width();
495 if ( nDir
& nVertical
)
496 nHeight
+= aLogicSize
.Height();
497 else if ( nHeight
< aLogicSize
.Height() )
498 nHeight
= aLogicSize
.Height();
502 Table
* pColWidths
= mpParser
->GetColWidths();
503 long nThisWidth
= (long) pColWidths
->Get( nCol
);
504 long nColWidths
= nThisWidth
;
505 SCCOL nColSpanCol
= nCol
+ pE
->nColOverlap
;
506 for ( SCCOL nC
= nCol
+ 1; nC
< nColSpanCol
; nC
++ )
508 nColWidths
+= (long) pColWidths
->Get( nC
);
510 if ( nWidth
> nColWidths
)
511 { // Differenz nur in der ersten Spalte eintragen
513 pColWidths
->Replace( nCol
, (void*)(nWidth
- nColWidths
+ nThisWidth
) );
515 pColWidths
->Insert( nCol
, (void*)(nWidth
- nColWidths
) );
517 // Zeilenhoehen, Differenz auf alle betroffenen Zeilen verteilen
518 SCROW nRowSpan
= pE
->nRowOverlap
;
521 nHeight
= 1; // fuer eindeutigen Vergleich
522 for ( SCROW nR
= nRow
; nR
< nRow
+ nRowSpan
; nR
++ )
524 long nRowHeight
= (long) mpRowHeights
->Get( nR
);
525 if ( nHeight
> nRowHeight
)
528 mpRowHeights
->Replace( nR
, (void*)nHeight
);
530 mpRowHeights
->Insert( nR
, (void*)nHeight
);
537 void ScEEImport::InsertGraphic( SCCOL nCol
, SCROW nRow
, SCTAB nTab
,
540 ScHTMLImageList
* pIL
= pE
->pImageList
;
541 if ( !pIL
|| !pIL
->Count() )
543 ScDrawLayer
* pModel
= mpDoc
->GetDrawLayer();
546 mpDoc
->InitDrawLayer();
547 pModel
= mpDoc
->GetDrawLayer();
549 SdrPage
* pPage
= pModel
->GetPage( static_cast<sal_uInt16
>(nTab
) );
550 OutputDevice
* pDefaultDev
= Application::GetDefaultDevice();
552 Point
aCellInsertPos(
553 (long)((double) mpDoc
->GetColOffset( nCol
, nTab
) * HMM_PER_TWIPS
),
554 (long)((double) mpDoc
->GetRowOffset( nRow
, nTab
) * HMM_PER_TWIPS
) );
556 Point
aInsertPos( aCellInsertPos
);
559 sal_Char nDir
= nHorizontal
;
560 for ( ScHTMLImage
* pI
= pIL
->First(); pI
; pI
= pIL
->Next() )
562 if ( nDir
& nHorizontal
)
564 aInsertPos
.X() += aLogicSize
.Width();
565 aInsertPos
.X() += aSpace
.X();
566 aInsertPos
.Y() = aCellInsertPos
.Y();
570 aInsertPos
.X() = aCellInsertPos
.X();
571 aInsertPos
.Y() += aLogicSize
.Height();
572 aInsertPos
.Y() += aSpace
.Y();
574 // Offset des Spacings drauf
575 aSpace
= pDefaultDev
->PixelToLogic( pI
->aSpace
, MapMode( MAP_100TH_MM
) );
576 aInsertPos
+= aSpace
;
578 Size aSizePix
= pI
->aSize
;
579 aLogicSize
= pDefaultDev
->PixelToLogic( aSizePix
, MapMode( MAP_100TH_MM
) );
581 ::ScLimitSizeOnDrawPage( aLogicSize
, aInsertPos
, pPage
->GetSize() );
585 Rectangle
aRect ( aInsertPos
, aLogicSize
);
586 SdrGrafObj
* pObj
= new SdrGrafObj( *pI
->pGraphic
, aRect
);
587 // #118522# calling SetGraphicLink here doesn't work
588 pObj
->SetName( pI
->aURL
);
590 pPage
->InsertObject( pObj
);
592 // #118522# SetGraphicLink has to be used after inserting the object,
593 // otherwise an empty graphic is swapped in and the contact stuff crashes.
595 pObj
->SetGraphicLink( pI
->aURL
, pI
->aFilterName
);
597 pObj
->SetLogicRect( aRect
); // erst nach InsertObject !!!
604 ScEEParser::ScEEParser( EditEngine
* pEditP
) :
606 pPool( EditEngine::CreatePool() ),
607 pDocPool( new ScDocumentPool
),
608 pList( new ScEEParseList
),
609 pColWidths( new Table
),
616 // pPool wird spaeter bei RTFIMP_START dem SvxRTFParser untergejubelt
617 pPool
->SetSecondaryPool( pDocPool
);
618 pPool
->FreezeIdRanges();
623 ScEEParser::~ScEEParser()
627 for ( ScEEParseEntry
* pE
= pList
->First(); pE
; pE
= pList
->Next() )
631 // Pool erst loeschen nachdem die Listen geloescht wurden
632 pPool
->SetSecondaryPool( NULL
);
633 SfxItemPool::Free(pDocPool
);
634 SfxItemPool::Free(pPool
);
638 void ScEEParser::NewActEntry( ScEEParseEntry
* pE
)
639 { // neuer freifliegender pActEntry
640 pActEntry
= new ScEEParseEntry( pPool
);
641 pActEntry
->aSel
.nStartPara
= (pE
? pE
->aSel
.nEndPara
+ 1 : 0);
642 pActEntry
->aSel
.nStartPos
= 0;