summaryrefslogtreecommitdiff
path: root/sw/source/filter/basflt/fltshell.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/filter/basflt/fltshell.cxx')
-rw-r--r--sw/source/filter/basflt/fltshell.cxx616
1 files changed, 0 insertions, 616 deletions
diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx
index 6e97e7c19911..9c05880cfb68 100644
--- a/sw/source/filter/basflt/fltshell.cxx
+++ b/sw/source/filter/basflt/fltshell.cxx
@@ -631,13 +631,6 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
pNd->SetAttr( aBkSet );
}
break;
- case RES_FLTR_SECTION:
- MakePoint(rEntry, pDoc, aRegion); // so far always Point==Mark
- pDoc->InsertSwSection(aRegion,
- *(static_cast<SwFltSection*>(rEntry.pAttr))->GetSectionData(),
- 0, 0, false);
- delete (((SwFltSection*)rEntry.pAttr)->GetSectionData());
- break;
case RES_FLTR_REDLINE:
{
if (rEntry.MakeRegion(pDoc, aRegion, true))
@@ -982,328 +975,17 @@ SfxPoolItem* SwFltTOX::Clone(SfxItemPool*) const
return new SwFltTOX(*this);
}
-// methods of SwFltSwSection follow
-SwFltSection::SwFltSection(SwSectionData *const pSect)
- : SfxPoolItem(RES_FLTR_SECTION)
- , m_pSection(pSect)
-{
-}
-
-SwFltSection::SwFltSection(const SwFltSection& rCpy)
- : SfxPoolItem(RES_FLTR_SECTION)
- , m_pSection(rCpy.m_pSection)
-{
-}
-
-bool SwFltSection::operator==(const SfxPoolItem& rItem) const
-{
- return m_pSection == ((SwFltSection&)rItem).m_pSection;
-}
-
-SfxPoolItem* SwFltSection::Clone(SfxItemPool*) const
-{
- return new SwFltSection(*this);
-}
-
-// here starts code generated by mdt. this is a shell, if possible, soon for
-// all filters. the whole trouble of inserting texts and formatting attributes,
-// manage positions, styles & headers/footers etc.
-
-SwFltShell::SwFltShell(SwDoc* pDoc, SwPaM& rPaM, const OUString& rBaseURL, bool bNew, sal_uLong nFieldFl) :
- pCurrentPageDesc(0),
- pSavedPos(0),
- eSubMode(None),
- nAktStyle(0),
- aStack(pDoc, nFieldFl),
- aEndStack(pDoc, nFieldFl),
- pPaM(new SwPaM(*(rPaM.GetPoint()))),
- sBaseURL(rBaseURL),
- nPageDescOffset(GetDoc().GetPageDescCnt()),
- eSrcCharSet(RTL_TEXTENCODING_MS_1252),
- bNewDoc(bNew),
- bStdPD(false),
- bProtect(false)
-{
- memset( pColls, 0, sizeof( pColls ) );
- pOutDoc = new SwFltOutDoc( *pDoc, pPaM, aStack, aEndStack );
- pOut = pOutDoc;
-
- if( !bNewDoc ){ // insert into document ?
- // Because only entire lines are read, lines might need
- // to be inserted or broken up
- const SwPosition* pPos = pPaM->GetPoint();
- const SwTxtNode* pSttNd = pPos->nNode.GetNode().GetTxtNode();
- if (pPos->nContent.GetIndex() && !pSttNd->GetTxt().isEmpty())
- // insert position not in empty line
- pDoc->getIDocumentContentOperations().SplitNode( *pPos, false ); // make new line
- if (!pSttNd->GetTxt().isEmpty())
- { // InsertPos not on empty line
- pDoc->getIDocumentContentOperations().SplitNode( *pPos, false ); // new line
- pPaM->Move( fnMoveBackward ); // go to empty line
- }
-
- // prohibit reading tables in footnotes / tables
- sal_uLong nNd = pPos->nNode.GetIndex();
- bool bReadNoTbl = 0 != pSttNd->FindTableNode() ||
- ( nNd < pDoc->GetNodes().GetEndOfInserts().GetIndex() &&
- pDoc->GetNodes().GetEndOfInserts().StartOfSectionIndex() < nNd );
- if( bReadNoTbl )
- pOutDoc->SetReadNoTable();
- }
- pCurrentPageDesc = &pDoc->GetPageDesc( 0 ); // Standard
-
-}
-
-SwFltShell::~SwFltShell()
-{
- sal_uInt16 i;
-
- if (eSubMode == Style)
- EndStyle();
- if( pOutDoc->IsInTable() ) // if not properly terminated
- EndTable();
- if( pOutDoc->IsInFly() )
- EndFly();
-
- GetDoc().getIDocumentState().SetUpdateExpFldStat(true);
- GetDoc().SetInitDBFields(true);
- aStack.SetAttr(*pPaM->GetPoint(), 0, false);
- aStack.SetAttr(*pPaM->GetPoint(), 0, false);
- aEndStack.SetAttr(*pPaM->GetPoint(), 0, false);
- aEndStack.SetAttr(*pPaM->GetPoint(), 0, false);
- if( bProtect ){ // The entire document is supposed to be protected
-
- SwDoc& rDoc = GetDoc();
- // 1. Create SectionFmt and Section
- SwSectionFmt* pSFmt = rDoc.MakeSectionFmt( 0 );
- SwSectionData aSectionData(CONTENT_SECTION, OUString("PMW-Protect"));
- aSectionData.SetProtectFlag( true );
- // 2. Look up Start- and EndIdx
- const SwNode* pEndNd = &rDoc.GetNodes().GetEndOfContent();
- SwNodeIndex aEndIdx( *pEndNd, -1L );
- const SwStartNode* pSttNd = pEndNd->StartOfSectionNode();
- SwNodeIndex aSttIdx( *pSttNd, 1L ); // +1 -> insert after StartNode
- // Section
- // insert Section
- rDoc.GetNodes().InsertTextSection(
- aSttIdx, *pSFmt, aSectionData, 0, &aEndIdx, false );
-
- if( !IsFlagSet(SwFltControlStack::DONT_HARD_PROTECT) ){
- SwDocShell* pDocSh = rDoc.GetDocShell();
- if( pDocSh )
- pDocSh->SetReadOnlyUI( true );
- }
- }
- // Update document page descriptors (only this way also left
- // pages get adjusted)
-
- GetDoc().ChgPageDesc( 0, GetDoc().GetPageDesc( 0 )); // PageDesc "Standard"
- for (i=nPageDescOffset;i<GetDoc().GetPageDescCnt();i++)
- {
- const SwPageDesc& rPD = GetDoc().GetPageDesc(i);
- GetDoc().ChgPageDesc(i, rPD);
- }
-
- delete pPaM;
- for (i=0; i<sizeof(pColls)/sizeof(*pColls); i++)
- delete pColls[i];
- delete pOutDoc;
-}
-
-SwFltShell& SwFltShell::operator << ( const OUString& rStr )
-{
- OSL_ENSURE(eSubMode != Style, "char insert while in style-mode");
- GetDoc().getIDocumentContentOperations().InsertString( *pPaM, rStr );
- return *this;
-}
-
-OUString SwFltShell::ConvertUStr(const OUString& rInOut)
-{
- return GetAppCharClass().uppercase(rInOut);
-}
-
-// QuoteString() translates CRs to '\n' or "\0x0d", depending on nFieldIniFlags
-OUString SwFltShell::QuoteStr( const OUString& rIn )
-{
- OUStringBuffer sOut( rIn );
- bool bAllowCr = aStack.IsFlagSet( SwFltControlStack::ALLOW_FLD_CR );
-
- for( sal_Int32 n = 0; n < sOut.getLength(); ++n )
- {
- switch( sOut[ n ] )
- {
- case 0x0a:
- sOut.remove( n, 1 ); // 0xd 0xa becomes \n
- break;
-
- case 0x0b:
- case 0x0c:
- case 0x0d:
- if( bAllowCr )
- sOut[n] = '\n';
- break;
- }
- }
- return sOut.makeStringAndClear();
-}
-
-SwFltShell& SwFltShell::operator << ( const sal_Unicode c )
-{
- OSL_ENSURE( eSubMode != Style, "char insert while in style-mode");
- GetDoc().getIDocumentContentOperations().InsertString( *pPaM, OUString(c) );
- return *this;
-}
-
-SwFltShell& SwFltShell::AddError( const sal_Char* pErr )
-{
- OUString aName("ErrorTag");
- SwFieldType* pFT = GetDoc().getIDocumentFieldsAccess().GetFldType( RES_SETEXPFLD, aName, false );
- if( pFT == 0)
- {
- SwSetExpFieldType aS(&GetDoc(), aName, nsSwGetSetExpType::GSE_STRING);
- pFT = GetDoc().getIDocumentFieldsAccess().InsertFldType(aS);
- }
- SwSetExpField aFld( (SwSetExpFieldType*)pFT,
- OUString::createFromAscii( pErr ));
- //, VVF_INVISIBLE
- GetDoc().getIDocumentContentOperations().InsertPoolItem(*pPaM, SwFmtFld(aFld), 0);
- return *this;
-}
-
-SwFltShell& SwFltShell::operator << (Graphic& rGraphic)
-{
- // embedded image !!
- GetDoc().getIDocumentContentOperations().Insert(*pPaM, OUString(), OUString(), &rGraphic, NULL, NULL, NULL);
- return *this;
-}
-
-void SwFltShell::NextParagraph()
-{
- GetDoc().getIDocumentContentOperations().AppendTxtNode(*pPaM->GetPoint());
-}
-
-void SwFltShell::NextPage()
-{
- NextParagraph();
- GetDoc().getIDocumentContentOperations().InsertPoolItem(*pPaM,
- SvxFmtBreakItem(SVX_BREAK_PAGE_BEFORE, RES_BREAK), 0);
-}
-
-SwFltShell& SwFltShell::AddGraphic( const OUString& rPicName )
-{
- // embedded:
- GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
- Graphic aGraphic;
- // one of: GFF_NOT GFF_BMP GFF_GIF GFF_JPG GFF_PCD GFF_PCX GFF_PNG
- // GFF_TIF GFF_XBM GFF_DXF GFF_MET GFF_PCT GFF_SGF GFF_SVM GFF_WMF
- // GFF_SGV GFF_XXX
- INetURLObject aDir(
- URIHelper::SmartRel2Abs(
- INetURLObject(GetBaseURL()), rPicName,
- URIHelper::GetMaybeFileHdl()) );
- switch (rFilter.ImportGraphic(aGraphic, aDir))
- {
- case GRFILTER_OK:
- *this << aGraphic;
- break;
- case GRFILTER_OPENERROR:
- case GRFILTER_IOERROR:
- case GRFILTER_FORMATERROR:
- case GRFILTER_VERSIONERROR:
- case GRFILTER_FILTERERROR:
- case GRFILTER_ABORT:
- case GRFILTER_TOOBIG:
- default:
- AddError( "picture import error" );
- break;
- }
- return *this;
-}
-
-SwFltShell& SwFltShell::SetStyle( sal_uInt16 nStyle )
-{
- SwFltFormatCollection* p = pColls[ nStyle ];
-
- if (p)
- {
- if( !pOutDoc->IsInTable() && nStyle != nAktStyle )
- {
- if( pColls[nAktStyle]->IsInFly() && pOutDoc->IsInFly() )
- pOutDoc->EndFly();
- if( p->IsInFly() )
- p->BeginStyleFly( pOutDoc );
- }
- GetDoc().SetTxtFmtColl(*pPaM, p->GetColl());
- nAktStyle = nStyle;
- }
- else
- {
- OSL_FAIL( "Invalid SwFltStyleCode" );
- }
- return *this;
-}
-
-SwFltShell& SwFltShell::operator << (SwFltBookmark& aBook)
-{
- aBook.maName = ConvertUStr( aBook.maName );
- aBook.maVal = QuoteStr(aBook.maVal);
- aEndStack.NewAttr(*pPaM->GetPoint(), aBook);
- return *this;
-}
-
-void SwFltShell::SetBookEnd(long nHandle)
-{
- aEndStack.SetAttr( *pPaM->GetPoint(), RES_FLTR_BOOKMARK, true, nHandle );
-}
-
-SwFltShell& SwFltShell::EndItem( sal_uInt16 nAttrId )
-{
- switch( nAttrId )
- {
- case RES_FLTR_BOOKMARK:
- OSL_FAIL( "Wrong invocation for bookmark end" );
- break;
-
- case RES_FLTR_TOX:
- aEndStack.SetAttr(*pPaM->GetPoint(), nAttrId);
- break;
-
- default:
- aStack.SetAttr(*pPaM->GetPoint(), nAttrId);
- break;
- }
- return *this;
-}
-
-SwFltShell& SwFltShell::operator << (const SwField& rField)
-{
- GetDoc().getIDocumentContentOperations().InsertPoolItem(*pPaM, SwFmtFld(rField), 0);
- return *this;
-}
-
/*virtual*/ SwFltOutBase& SwFltOutDoc::operator << (const SfxPoolItem& rItem)
{
rStack.NewAttr(*pPaM->GetPoint(), rItem);
return *this;
}
-/*virtual*/ SwFltOutBase& SwFltFormatCollection::operator <<
- (const SfxPoolItem& rItem)
-{
- pColl->SetFmtAttr(rItem);
- return *this;
-}
-
const SfxPoolItem& SwFltOutDoc::GetAttr(sal_uInt16 nWhich)
{
return *rStack.GetFmtAttr(*pPaM->GetPoint(), nWhich);
}
-const SfxPoolItem& SwFltFormatCollection::GetAttr(sal_uInt16 nWhich)
-{
- return GetColl()->GetFmtAttr(nWhich); // with Parents
-}
-
// GetNodeOrStyAttr fetches attributes for toggle and modify attributes:
// For format definitions, the current style with parents is
// consulted, otherwise the node with parents.
@@ -1317,66 +999,6 @@ const SfxPoolItem& SwFltOutDoc::GetNodeOrStyAttr(sal_uInt16 nWhich)
return GetDoc().GetAttrPool().GetDefaultItem(nWhich);
}
-const SfxPoolItem& SwFltFormatCollection::GetNodeOrStyAttr(sal_uInt16 nWhich)
-{
- return GetColl()->GetFmtAttr(nWhich); // with Parents
-}
-
-const SfxPoolItem& SwFltShell::GetNodeOrStyAttr(sal_uInt16 nWhich)
-{
- return pOut->GetNodeOrStyAttr( nWhich );
-}
-
-const SfxPoolItem& SwFltShell::GetAttr(sal_uInt16 nWhich)
-{
- return pOut->GetAttr( nWhich );
-}
-
-const SfxPoolItem& SwFltShell::GetFlyFrmAttr(sal_uInt16 nWhich)
-{
- return pOut->GetFlyFrmAttr( nWhich );
-}
-
-SwFieldType* SwFltShell::GetSysFldType(sal_uInt16 eWhich)
-{
- return GetDoc().getIDocumentFieldsAccess().GetSysFldType(eWhich);
-}
-
-bool SwFltShell::GetWeightBold()
-{
- return ((SvxWeightItem&)GetNodeOrStyAttr(RES_CHRATR_WEIGHT)).GetWeight()
- != WEIGHT_NORMAL;
-}
-
-bool SwFltShell::GetPostureItalic()
-{
- return ((SvxPostureItem&)GetNodeOrStyAttr(RES_CHRATR_POSTURE)).GetPosture()
- != ITALIC_NONE;
-}
-
-bool SwFltShell::GetCrossedOut()
-{
- return ((SvxCrossedOutItem&)GetNodeOrStyAttr(RES_CHRATR_CROSSEDOUT))
- .GetStrikeout() != STRIKEOUT_NONE;
-}
-
-bool SwFltShell::GetContour()
-{
- return ((SvxContourItem&)GetNodeOrStyAttr(RES_CHRATR_CONTOUR)).GetValue();
-}
-
-bool SwFltShell::GetCaseKapitaelchen()
-{
- return ((SvxCaseMapItem&)GetNodeOrStyAttr(RES_CHRATR_CASEMAP))
- .GetCaseMap() == SVX_CASEMAP_KAPITAELCHEN;
-}
-
-bool SwFltShell::GetCaseVersalien()
-{
- return ((SvxCaseMapItem&)GetNodeOrStyAttr(RES_CHRATR_CASEMAP))
- .GetCaseMap() == SVX_CASEMAP_VERSALIEN;
-}
-
// Tables
SwFltOutBase::~SwFltOutBase()
{
@@ -1896,244 +1518,6 @@ void SwFltOutDoc::EndFly()
pFly = 0;
}
-/*virtual*/ bool SwFltFormatCollection::IsInFly()
-{
- return bHasFly;
-};
-
-/*virtual*/ void SwFltFormatCollection::SetFlyFrmAttr(const SfxPoolItem& rAttr)
-{
- if (!pFlyAttrs)
- pFlyAttrs = new SfxItemSet( GetDoc().GetAttrPool(),
- RES_FRMATR_BEGIN, RES_FRMATR_END-1 );
- pFlyAttrs->Put( rAttr );
-}
-
-/*virtual*/ const SfxPoolItem& SwFltFormatCollection::GetFlyFrmAttr(sal_uInt16 nWhich)
-{
- if( pFlyAttrs )
- return pFlyAttrs->Get( nWhich, false );
- else
- return GetDoc().GetAttrPool().GetDefaultItem(nWhich);
-}
-
-bool SwFltFormatCollection::BeginFly( RndStdIds eAnchor,
- bool bAbsolutePos,
- const SfxItemSet* pMoreAttrs)
-
-{
- SwFltOutBase::BeginFly( eAnchor, bAbsolutePos, pMoreAttrs );
- bHasFly = true;
- return true;
-}
-
-void SwFltFormatCollection::EndFly() // never gets called
-{
-}
-
-bool SwFltFormatCollection::BeginStyleFly( SwFltOutDoc* pOutDoc )
-{
- OSL_ENSURE( pOutDoc, "BeginStyleFly without pOutDoc" );
- OSL_ENSURE( pOutDoc && !pOutDoc->IsInFly(), "BeginStyleFly in Fly" );
- if( pOutDoc && !pOutDoc->IsInFly() )
- return pOutDoc->BeginFly( eFlyAnchor, bFlyAbsPos, pFlyAttrs );
- else
- return false;
-}
-
-bool SwFltShell::BeginFly( RndStdIds eAnchor,
- bool bAbsolutePos)
-{
- if (pOut->IsInFly()){
- OSL_FAIL("BeginFly in Fly");
- return false;
- }
- if (pOutDoc->IsInTable()){
- OSL_FAIL("BeginFly in Table");
- return false;
- }
- pOut->BeginFly( eAnchor, bAbsolutePos, pColls[nAktStyle]->GetpFlyAttrs() );
- eSubMode = Fly;
- return true;
-}
-
-void SwFltShell::SetFlyXPos( short nXPos, sal_Int16 eHRel,
- sal_Int16 eHAlign)
-{
- SetFlyFrmAttr( SwFmtHoriOrient( nXPos, eHAlign, eHRel ) );
-}
-
-void SwFltShell::SetFlyYPos( short nYPos, sal_Int16 eVRel,
- sal_Int16 eVAlign)
-{
- SetFlyFrmAttr( SwFmtVertOrient( nYPos, eVAlign, eVRel ) );
-}
-
-void SwFltShell::EndFly()
-{
- if (!pOut->IsInFly()){
- OSL_FAIL("EndFly without Fly");
- return;
- }
- if (pOutDoc->IsInTable()){ // Table intermingled with Fly doesn't make sense
- OSL_FAIL("EndFly in Table ( intermingled )");
- EndTable();
- }
- pOut->EndFly();
- eSubMode = None;
-}
-
-void SwFltShell::BeginFootnote()
-{
- if( pOut->IsInFly() ){ // Happens at footnote in Fly, among others
- OSL_FAIL("Footnote in Fly not permitted");
- return;
- }
- if( pOutDoc->IsInTable() ){
- OSL_FAIL("Footnote in table currently not allowed");
- return;
- }
-
- // Close all attributes, because otherwise attributes extending into
- // footnotes might be created
- aStack.SetAttr( *pPaM->GetPoint(), 0, false );
- // Don't force-close EndStack for now, so bookmarks on footnotes can
- // be applied to PMW
-
- SwFmtFtn aFtn;
- GetDoc().getIDocumentContentOperations().InsertPoolItem(*pPaM, aFtn, 0);
- OSL_ENSURE(pSavedPos == NULL, "SwFltShell");
- pSavedPos = new SwPosition(*pPaM->GetPoint());
- pPaM->Move(fnMoveBackward, fnGoCntnt);
- SwTxtNode* pTxt = pPaM->GetNode().GetTxtNode();
- SwTxtAttr *const pFN = pTxt->GetTxtAttrForCharAt(
- pPaM->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN);
- if( !pFN ){ // Happens at footnote in Fly, among others
- OSL_ENSURE(pFN, "Problems with creating footnote text");
- return;
- }
- const SwNodeIndex* pStartIndex = ((SwTxtFtn*)pFN)->GetStartNode();
- OSL_ENSURE(pStartIndex, "Problems with creating footnote text");
- pPaM->GetPoint()->nNode = pStartIndex->GetIndex() + 1;
- pPaM->GetPoint()->nContent.Assign(pPaM->GetCntntNode(), 0);
- eSubMode = Footnote;
-}
-
-void SwFltShell::EndFootnote()
-{
- if(!pSavedPos)
- return;
- // Close all attributes, because otherwise
- // attributes extending out of footnotes might
- // be created
- aStack.SetAttr( *pPaM->GetPoint(), 0, false );
- // Don't force-close EndStack for now, so bookmarks on footnotes can
- // be applied to PMW
-
- *pPaM->GetPoint() = *pSavedPos; // restore Cursor
- delete pSavedPos;
- pSavedPos = 0;
-}
-
-void SwFltShell::BeginHeader(SwPageDesc* /*pPD*/)
-{
- SwFrmFmt* pFmt = &pCurrentPageDesc->GetMaster();
- SwFrmFmt* pHdFtFmt;
- pFmt->SetFmtAttr(SwFmtHeader(true));
- pHdFtFmt = (SwFrmFmt*)pFmt->GetHeader().GetHeaderFmt();
- const SwNodeIndex* pStartIndex = pHdFtFmt->GetCntnt().GetCntntIdx();
- if (!pStartIndex)
- return;
- OSL_ENSURE(pSavedPos == NULL, "SwFltShell");
- pSavedPos = new SwPosition(*pPaM->GetPoint());
- pPaM->GetPoint()->nNode = pStartIndex->GetIndex() + 1;
- pPaM->GetPoint()->nContent.Assign(pPaM->GetCntntNode(), 0);
- eSubMode = Header;
-}
-
-void SwFltShell::BeginFooter(SwPageDesc* /*pPD*/)
-{
- SwFrmFmt* pFmt = &pCurrentPageDesc->GetMaster();
- SwFrmFmt* pHdFtFmt;
- pFmt->SetFmtAttr(SwFmtFooter(true));
- pHdFtFmt = (SwFrmFmt*)pFmt->GetFooter().GetFooterFmt();
- const SwNodeIndex* pStartIndex = pHdFtFmt->GetCntnt().GetCntntIdx();
- if (!pStartIndex)
- return;
- OSL_ENSURE(pSavedPos == NULL, "SwFltShell");
- pSavedPos = new SwPosition(*pPaM->GetPoint());
- pPaM->GetPoint()->nNode = pStartIndex->GetIndex() + 1;
- pPaM->GetPoint()->nContent.Assign(pPaM->GetCntntNode(), 0);
- eSubMode = Footer;
-}
-
-void SwFltShell::EndHeaderFooter()
-{
- *pPaM->GetPoint() = *pSavedPos; // restore Cursor
- delete pSavedPos;
- pSavedPos = 0;
-}
-
-SwPageDesc* SwFltShell::MakePageDesc(SwPageDesc* pFirstPageDesc)
-{
- if(bStdPD) // no new PageDescs
- return pCurrentPageDesc;
-
- bool bFollow = (pFirstPageDesc != 0);
- SwPageDesc* pNewPD;
- if (bFollow && pFirstPageDesc->GetFollow() != pFirstPageDesc)
- return pFirstPageDesc; // Error: already has Follow
- // Detection of duplicate names still missing (low probability of this
- // actually occurring)
-
- pNewPD = GetDoc().MakePageDesc(
- SwViewShell::GetShellRes()->GetPageDescName(GetDoc().GetPageDescCnt(), bFollow ? ShellResource::FOLLOW_PAGE : ShellResource::NORMAL_PAGE),
- pFirstPageDesc, false);
-
- if (bFollow)
- {
- // This one follows pPageDesc
- pFirstPageDesc->SetFollow(pNewPD);
- pNewPD->SetFollow(pNewPD);
- }
- else
- {
- GetDoc().getIDocumentContentOperations().InsertPoolItem( *pPaM, SwFmtPageDesc( pNewPD ), 0 );
- }
- pNewPD->WriteUseOn( // all pages
- (UseOnPage)(nsUseOnPage::PD_ALL | nsUseOnPage::PD_HEADERSHARE | nsUseOnPage::PD_FOOTERSHARE));
- return pNewPD;
-}
-
-SwFltFormatCollection::SwFltFormatCollection(
- SwDoc& _rDoc, RES_POOL_COLLFMT_TYPE nType ) :
- SwFltOutBase(_rDoc),
- pColl(_rDoc.getIDocumentStylePoolAccess().GetTxtCollFromPool( static_cast< sal_uInt16 >(nType), false )),
- pFlyAttrs( 0 ),
- bHasFly( false )
-{
- Reset(); // reset default attrs and auto flag
-}
-
-SwFltFormatCollection::SwFltFormatCollection(
- SwDoc& _rDoc, const OUString& rName ) :
- SwFltOutBase(_rDoc),
- pFlyAttrs( 0 ),
- bHasFly( false )
-{
- pColl = _rDoc.MakeTxtFmtColl(rName, (SwTxtFmtColl*)_rDoc.GetDfltTxtFmtColl());
- Reset(); // reset default attrs and auto flag
-}
-
-void SwFltShell::NextStyle(sal_uInt16 nWhich, sal_uInt16 nNext)
-{
- OSL_ENSURE(pColls[nWhich], "Next style for noexistent style" );
- OSL_ENSURE(pColls[nNext], "Next style to noexistent style" );
- if( pColls[nWhich] && pColls[nNext] )
- pColls[nWhich]->GetColl()->SetNextTxtFmtColl(
- *pColls[nNext]->GetColl() );
-}
-
// UpdatePageDescs needs to be called at end of parsing to make Writer actually
// accept Pagedescs contents
void UpdatePageDescs(SwDoc &rDoc, sal_uInt16 nInPageDescOffset)