bump product version to 4.1.6.2
[LibreOffice.git] / lotuswordpro / source / filter / lwpdoc.cxx
blobe9a2f72b8cef812d709260f00631327de53416ed
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * The Contents of this file are made available subject to the terms of
5 * either of the following licenses
7 * - GNU Lesser General Public License Version 2.1
8 * - Sun Industry Standards Source License Version 1.1
10 * Sun Microsystems Inc., October, 2000
12 * GNU Lesser General Public License Version 2.1
13 * =============================================
14 * Copyright 2000 by Sun Microsystems, Inc.
15 * 901 San Antonio Road, Palo Alto, CA 94303, USA
17 * This library is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU Lesser General Public
19 * License version 2.1, as published by the Free Software Foundation.
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
26 * You should have received a copy of the GNU Lesser General Public
27 * License along with this library; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
32 * Sun Industry Standards Source License Version 1.1
33 * =================================================
34 * The contents of this file are subject to the Sun Industry Standards
35 * Source License Version 1.1 (the "License"); You may not use this file
36 * except in compliance with the License. You may obtain a copy of the
37 * License at http://www.openoffice.org/license.html.
39 * Software provided under this License is provided on an "AS IS" basis,
40 * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
41 * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
42 * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
43 * See the License for the specific provisions governing your rights and
44 * obligations concerning the Software.
46 * The Initial Developer of the Original Code is: IBM Corporation
48 * Copyright: 2008 by IBM Corporation
50 * All Rights Reserved.
52 * Contributor(s): _______________________________________
55 ************************************************************************/
56 #include "lwpglobalmgr.hxx"
57 #include "lwpdoc.hxx"
58 #include "lwpfootnote.hxx"
59 #include "lwppagehint.hxx"
60 #include "lwpdivinfo.hxx"
61 #include "lwpholder.hxx"
62 #include "lwpparastyle.hxx"
63 #include "lwpstory.hxx"
64 #include "lwppara.hxx"
65 #include "lwpsilverbullet.hxx"
66 #include "lwplayout.hxx"
67 #include "lwppagelayout.hxx"
68 #include "xfilter/xfstylemanager.hxx"
69 #include <osl/thread.h>
71 LwpDocument::LwpDocument(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
72 : LwpDLNFPVList(objHdr, pStrm), m_pOwnedFoundry(NULL), m_pLnOpts(NULL)
75 LwpDocument::~LwpDocument()
77 if(m_pLnOpts)
79 delete m_pLnOpts;
81 if(m_pOwnedFoundry)
83 delete m_pOwnedFoundry;
86 /**
87 * @descr Read VO_Document from object stream
88 **/
89 void LwpDocument::Read()
91 LwpDLNFPVList::Read();
93 ReadPlug();
95 m_nPersistentFlags = m_pObjStrm->QuickReaduInt32();
97 //Skip the SortOption and UIDocument
99 LwpSortOption m_DocSort( m_pObjStrm );
100 LwpUIDocument m_UIDoc( m_pObjStrm );
103 m_pLnOpts = new LwpLineNumberOptions(m_pObjStrm);
105 //Skip LwpUserDictFiles
107 LwpUserDictFiles m_UsrDicts( m_pObjStrm );
110 if( !IsChildDoc())
112 //Skip LwpPrinterInfo
113 LwpPrinterInfo m_PrtInfo( m_pObjStrm );
116 m_pFoundry = m_pOwnedFoundry = new LwpFoundry(m_pObjStrm, this);
118 m_DivOpts.ReadIndexed(m_pObjStrm);
120 if(!IsChildDoc())
122 m_FootnoteOpts.ReadIndexed(m_pObjStrm);
123 m_DocData.ReadIndexed(m_pObjStrm);
125 else
127 //Skip the docdata used in old version
128 LwpObjectID dummyDocData;
129 dummyDocData.ReadIndexed(m_pObjStrm);
131 m_DivInfo.ReadIndexed(m_pObjStrm);
132 m_Epoch.Read(m_pObjStrm);
133 m_WYSIWYGPageHints.ReadIndexed(m_pObjStrm);
134 m_VerDoc.ReadIndexed(m_pObjStrm);
135 m_STXInfo.ReadIndexed(m_pObjStrm);
139 * @descr Read plug related data from m_pObjStram
141 void LwpDocument::ReadPlug()
143 m_DocSockID.ReadIndexed(m_pObjStrm);
144 m_nFlags = m_pObjStrm->QuickReaduInt16();
145 m_pObjStrm->SkipExtra();
149 * @descr Parse obj to IXFStream
151 void LwpDocument::Parse(IXFStream* pOutputStream)
153 //check the name and skip script division
154 if (!IsSkippedDivision())
156 //the frames which anchor are to page must output before other contents
157 ParseFrameInPage(pOutputStream);
158 ParseDocContent(pOutputStream);
161 LwpObject* pDocSock = GetSocket()->obj( VO_DOCSOCK );
162 if(pDocSock!=NULL)
164 pDocSock->Parse(pOutputStream);
168 sal_Bool LwpDocument::IsSkippedDivision()
170 OUString sDivName;
171 sal_uInt8 ret = sal_False;
172 LwpDivInfo* pDiv = dynamic_cast<LwpDivInfo*>(GetDivInfoID()->obj(VO_DIVISIONINFO));
173 if (pDiv == NULL)
174 return sal_True;
175 sDivName = pDiv->GetDivName();
176 if (!sDivName.isEmpty() && !pDiv->IsGotoable()) //including toa,scripts division
177 return sal_True;
178 //skip endnote division
179 OUString strClassName = pDiv->GetClassName();
180 if (strClassName.equals(A2OUSTR(STR_DivisionEndnote))
181 || strClassName.equals(A2OUSTR(STR_DivisionGroupEndnote))
182 || strClassName.equals(A2OUSTR(STR_DocumentEndnote)))
184 LwpPageLayout* pPageLayout = dynamic_cast<LwpPageLayout*>(pDiv->GetInitialLayoutID()->obj(VO_PAGELAYOUT));
185 if(pPageLayout)
187 LwpStory* pStory = dynamic_cast<LwpStory*>(pPageLayout->GetContent()->obj(VO_STORY));
188 if(pStory)
190 //This judgement maybe have problem. If there is only one para in the story,
191 //this endnote division has no other contents except endnote table.
192 LwpObjectID* pFirst = pStory->GetFirstPara();
193 LwpObjectID* pLast = pStory->GetLastPara();
194 if(*pFirst == *pLast)
195 ret = sal_True;
199 return ret;
203 * @descr Register all styles in this division
205 void LwpDocument::RegisterStyle()
207 RegisterDefaultParaStyles();
208 RegisterGraphicsStyles();
209 RegisterBulletStyles();
211 RegisterTextStyles();
212 RegisterLayoutStyles();
213 RegisterStylesInPara();
215 RegisterLinenumberStyles();
216 RegisterFootnoteStyles();
218 //Register styles in other document connected with this document: next doc, children doc
219 LwpObject* pDocSock = GetSocket()->obj();
220 if(pDocSock!=NULL)
222 pDocSock->RegisterStyle();
226 * @descr Register all named para styles
228 void LwpDocument::RegisterTextStyles()
230 //Register all text styles: para styles, character styles
231 LwpDLVListHeadHolder* pParaStyleHolder = dynamic_cast<LwpDLVListHeadHolder*>(m_pFoundry->GetTextStyleHead()->obj());
232 if(pParaStyleHolder)
234 LwpTextStyle* pParaStyle = dynamic_cast<LwpTextStyle*> (pParaStyleHolder->GetHeadID()->obj());
235 while(pParaStyle)
237 pParaStyle->SetFoundry(m_pFoundry);
238 pParaStyle->RegisterStyle();
239 pParaStyle = dynamic_cast<LwpParaStyle*>(pParaStyle->GetNext()->obj());
242 ChangeStyleName();//add by ,for click here block,05/5/26
245 * @descr Register all layouts styles (page master and master page)
246 * All para styles used in master page (header and footer) are registered and then showed
248 void LwpDocument::RegisterLayoutStyles()
250 //Register all layout styles, before register all styles in para
251 m_pFoundry->RegisterAllLayouts();
253 //set initial pagelayout in story for parsing pagelayout
254 LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*> (m_DivInfo.obj( VO_DIVISIONINFO));
255 LwpPageLayout* pPageLayout = NULL;
256 if(pDivInfo)
258 pPageLayout = dynamic_cast<LwpPageLayout*>(pDivInfo->GetInitialLayoutID()->obj(VO_PAGELAYOUT));
259 if(pPageLayout)
261 //In Ole division, the content of pagelayout is VO_OLEOBJECT
262 LwpStory* pStory = dynamic_cast<LwpStory*>(pPageLayout->GetContent()->obj(VO_STORY));
263 if(pStory)
265 //add all the pagelayout in order into the pagelayout list;
266 pStory->SortPageLayout();
267 pStory->SetCurrentLayout(pPageLayout);
273 * @descr Register all styles used in para
275 void LwpDocument::RegisterStylesInPara()
277 //Register all automatic styles in para
278 LwpHeadContent* pContent = dynamic_cast<LwpHeadContent*> (m_pFoundry->GetContentManager()->GetContentList()->obj());
279 if(pContent)
281 LwpStory* pStory = dynamic_cast<LwpStory*>(pContent->GetChildHead()->obj(VO_STORY));
282 while(pStory)
284 //Register the child para
285 pStory->SetFoundry(m_pFoundry);
286 pStory->RegisterStyle();
287 pStory = dynamic_cast<LwpStory*>(pStory->GetNext()->obj(VO_STORY));
292 * @descr Register all bullet styles used in this division
294 void LwpDocument::RegisterBulletStyles()
296 //Register bullet styles
297 LwpDLVListHeadHolder* mBulletHead = dynamic_cast<LwpDLVListHeadHolder*>
298 (m_pFoundry->GetBulletManagerID()->obj(VO_HEADHOLDER));
299 if( mBulletHead )
301 LwpSilverBullet* pBullet = dynamic_cast<LwpSilverBullet*>
302 (mBulletHead->GetHeadID()->obj());
303 while(pBullet)
305 pBullet->SetFoundry(m_pFoundry);
306 pBullet->RegisterStyle();
307 pBullet = dynamic_cast<LwpSilverBullet*> (pBullet->GetNext()->obj());
312 * @descr Register all styles used in VO_Graphic
314 void LwpDocument::RegisterGraphicsStyles()
316 //Register all graphics styles, the first object should register the next;
317 LwpObject* pGraphic = m_pFoundry->GetGraphicListHead()->obj(VO_GRAPHIC);
318 if(pGraphic)
320 pGraphic->SetFoundry(m_pFoundry);
321 pGraphic->RegisterStyle();
325 * @descr Register line number styles
327 void LwpDocument::RegisterLinenumberStyles()
329 if (!m_pLnOpts)
330 return;
331 m_pLnOpts->RegisterStyle();
335 * @descr Register footnote/endnote configuration for the entire document
337 void LwpDocument::RegisterFootnoteStyles()
339 //Register footnote and endnote configuration for the entire document
340 if(!m_FootnoteOpts.IsNull())
342 LwpFootnoteOptions* pFootnoteOpts = dynamic_cast<LwpFootnoteOptions*>(m_FootnoteOpts.obj());
343 if (pFootnoteOpts)
345 pFootnoteOpts->SetMasterPage(A2OUSTR("Endnote"));
346 pFootnoteOpts->RegisterStyle();
349 //Register endnote page style for endnote configuration, use the last division that has endnote for the endnote page style
350 //This page style must register after its division default styles have registered
351 LwpDocument* pEndnoteDiv = GetLastDivisionThatHasEndnote();
352 if(this == pEndnoteDiv)
354 LwpDLVListHeadTailHolder* pHeadTail = dynamic_cast<LwpDLVListHeadTailHolder*>(GetPageHintsID()->obj());
355 if(pHeadTail)
357 LwpPageHint* pPageHint = dynamic_cast<LwpPageHint*>(pHeadTail->GetTail()->obj());
358 if(pPageHint && !pPageHint->GetPageLayoutID()->IsNull())
360 LwpPageLayout* pPageLayout = dynamic_cast<LwpPageLayout*>(pPageHint->GetPageLayoutID()->obj());
361 if(pPageLayout)
363 pPageLayout->SetFoundry(GetFoundry());
364 pPageLayout->RegisterEndnoteStyle();
372 * @descr Register default para styles
374 #include "lwpverdocument.hxx"
375 void LwpDocument::RegisterDefaultParaStyles()
377 if(!IsChildDoc())
379 //Get First Division
380 //LwpDocument* pFirstDoc = GetFirstDivision();
381 LwpDocument* pFirstDoc = GetFirstDivisionWithContentsThatIsNotOLE();
382 if(pFirstDoc)
384 LwpVerDocument* pVerDoc = dynamic_cast<LwpVerDocument*>(pFirstDoc->GetVerDoc()->obj());
385 if(pVerDoc)
387 pVerDoc->RegisterStyle();
395 * @descr Parse content in this division to IXFStream
396 * LwpDocument->LwpDivInfo->LwpPageLayout.Parse()
398 void LwpDocument::ParseDocContent(IXFStream* pOutputStream)
400 //Parse content in PageLayout
401 LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*> (m_DivInfo.obj());
402 if(pDivInfo==NULL) return;
404 LwpObject* pLayoutObj = pDivInfo->GetInitialLayoutID()->obj();
405 if(pLayoutObj==NULL)
407 //master document not supported now.
408 return;
410 pLayoutObj->SetFoundry(m_pFoundry);
411 pLayoutObj->Parse(pOutputStream);
415 * @descr Get the footnoteoptions from the root document
417 LwpObjectID* LwpDocument::GetValidFootnoteOpts()
419 LwpDocument* pRoot = GetRootDocument();
420 if(pRoot)
422 return pRoot->GetFootnoteOpts();
424 return NULL;
428 * @descr Get the endnote type
430 sal_uInt16 LwpDocument::GetEndnoteType()
432 LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(GetDivInfoID()->obj());
433 if (!pDivInfo)
434 return FN_DONTCARE;
435 OUString strClassName = pDivInfo->GetClassName();
436 if (strClassName.equals(A2OUSTR(STR_DivisionEndnote)))
437 return FN_DIVISION_SEPARATE;
438 if (strClassName.equals(A2OUSTR(STR_DivisionGroupEndnote)))
439 return FN_DIVISIONGROUP_SEPARATE;
440 if (strClassName.equals(A2OUSTR(STR_DocumentEndnote)))
441 return FN_DOCUMENT_SEPARATE;
442 return FN_DONTCARE;
445 * @descr Get previous division
447 LwpDocument* LwpDocument::GetPreviousDivision()
449 LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket()->obj());
450 if(pDocSock)
452 return dynamic_cast<LwpDocument*>(pDocSock->GetPrevious()->obj());
454 return NULL;
457 * @descr Get next division
459 LwpDocument* LwpDocument::GetNextDivision()
461 LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket()->obj());
462 if(pDocSock)
464 return dynamic_cast<LwpDocument*>(pDocSock->GetNext()->obj());
466 return NULL;
469 * @descr Get parent division
471 LwpDocument* LwpDocument::GetParentDivision()
473 LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket()->obj());
474 if(pDocSock)
476 return dynamic_cast<LwpDocument*>(pDocSock->GetParent()->obj());
478 return NULL;
481 * @descr Get previous division in group, copy from lwp source code
483 LwpDocument* LwpDocument::GetPreviousInGroup()
485 LwpDocument* pPrev = NULL;
487 for (pPrev = GetPreviousDivision(); pPrev; pPrev = pPrev->GetPreviousDivision())
489 LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(pPrev->GetDivInfoID()->obj());
490 if(pDivInfo && pDivInfo->HasContents())
491 return pPrev;
493 return NULL;
496 * @descr Get previous division in group, copy from lwp source code
498 LwpDocument* LwpDocument::GetNextInGroup()
500 LwpDocument* pNext = NULL;
502 for (pNext = GetNextDivision(); pNext; pNext = pNext->GetNextDivision())
504 LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(pNext->GetDivInfoID()->obj());
505 if(pDivInfo && pDivInfo->HasContents())
506 return pNext;
509 return NULL;
512 * @descr Get previous division which has contents, copy from lwp source code
514 LwpDocument* LwpDocument::GetPreviousDivisionWithContents()
516 if(GetPreviousDivision())
518 LwpDocument* pDoc = GetPreviousDivision()->GetLastDivisionWithContents();
519 if (pDoc)
520 return pDoc;
522 if(GetParentDivision())
523 return GetParentDivision()->GetPreviousDivisionWithContents();
524 return NULL;
527 * @descr Get last division which has contents, copy from lwp source code
529 LwpDocument* LwpDocument::GetLastDivisionWithContents()
531 LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(GetDivInfoID()->obj());
532 if(pDivInfo && pDivInfo->HasContents())
534 return this;
537 LwpDocument* pDivision = GetLastDivision();
538 LwpDocument* pContentDivision = NULL;
540 while(pDivision)
542 pContentDivision = pDivision->GetLastDivisionWithContents();
543 if(pContentDivision)
545 return pContentDivision;
547 pDivision = pDivision->GetPreviousDivision();
550 return NULL;
553 * @descr Get last division in group which has contents, copy from lwp source code
555 LwpDocument* LwpDocument::GetLastInGroupWithContents()
557 LwpDocument* pLast = NULL;
558 LwpDocument* pNext = this;
560 while (pNext)
562 LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(pNext->GetDivInfoID()->obj());
563 if (pDivInfo && pDivInfo->HasContents())
564 pLast = pNext;
565 pNext = pNext->GetNextInGroup();
567 if (pLast)
568 return pLast;
569 return NULL;
572 * @descr Get last division
574 LwpDocument* LwpDocument::GetLastDivision()
576 LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket()->obj());
577 if(pDocSock)
578 return dynamic_cast<LwpDocument*>(pDocSock->GetChildTail()->obj());
579 return NULL;
583 * @descr Get first division
585 LwpDocument* LwpDocument::GetFirstDivision()
587 LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket()->obj());
588 if(pDocSock)
589 return dynamic_cast<LwpDocument*>(pDocSock->GetChildHead()->obj());
590 return NULL;
594 * @descr Get root document
596 LwpDocument* LwpDocument::GetRootDocument()
598 LwpDocument* pRoot = this;
599 while(pRoot)
601 if(!pRoot->IsChildDoc())
602 return pRoot;
603 pRoot = pRoot->GetParentDivision();
605 return NULL;
608 * @descr Get first division with contents that is not ole, copy from lwp-source code
610 LwpDocument* LwpDocument::GetFirstDivisionWithContentsThatIsNotOLE()
612 LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(GetDivInfoID()->obj());
613 if(pDivInfo && pDivInfo->HasContents()
614 && !pDivInfo->IsOleDivision())
615 return this;
617 LwpDocument* pDivision = GetFirstDivision();
619 LwpDocument* pContentDivision = NULL;
621 while (pDivision)
623 pContentDivision = pDivision->GetFirstDivisionWithContentsThatIsNotOLE();
624 if(pContentDivision)
625 return pContentDivision;
626 pDivision = pDivision->GetNextDivision();
628 return NULL;
631 * @descr Get last division that has endnote
633 LwpDocument* LwpDocument::GetLastDivisionThatHasEndnote()
635 LwpDocument* pRoot = GetRootDocument();
636 LwpDocument *pLastDoc = pRoot->GetLastDivisionWithContents();
637 while(pLastDoc)
639 if(pLastDoc->GetEnSuperTableLayout())
640 return pLastDoc;
641 pLastDoc = pLastDoc->GetPreviousDivisionWithContents();
643 return NULL;
647 * @descr Get endnote supertable layout, every division has only one endnote supertable layout.
649 LwpVirtualLayout* LwpDocument::GetEnSuperTableLayout()
651 LwpHeadLayout* pHeadLayout = dynamic_cast<LwpHeadLayout*>(GetFoundry()->GetLayout()->obj());
652 if(pHeadLayout)
654 return pHeadLayout->FindEnSuperTableLayout();
656 return NULL;
660 * @descr Get the numbers of page before pEndDivision, copy from lwp source code
662 sal_Bool LwpDocument::GetNumberOfPages(LwpDocument* pEndDivision, sal_uInt16& nCount)
664 if(this == pEndDivision)
665 return sal_True;
667 LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(m_DivInfo.obj());
668 if(pDivInfo)
670 pDivInfo->GetNumberOfPages(nCount);
673 LwpDocument* pDivision = GetFirstDivision();
674 while(pDivision)
676 if(pDivision->GetNumberOfPages(pEndDivision,nCount))
677 return sal_True;
678 pDivision = pDivision->GetNextDivision();
681 return sal_False;
684 * @descr Get the numbers of page before curruent division
686 sal_uInt16 LwpDocument::GetNumberOfPagesBefore()
688 sal_uInt16 nPageNumber = 0;
689 LwpDocument* pRoot = GetRootDocument();
690 if(pRoot)
691 pRoot->GetNumberOfPages(this,nPageNumber);
692 return nPageNumber;
696 * @descr Get Max number of pages
698 void LwpDocument::MaxNumberOfPages(sal_uInt16& nNumPages)
700 LwpDocument* pDivision = GetFirstDivision();
702 LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(m_DivInfo.obj());
703 if(pDivInfo)
704 nNumPages += pDivInfo->GetMaxNumberOfPages();
705 while(pDivision)
707 pDivision->MaxNumberOfPages(nNumPages);
708 pDivision = pDivision->GetNextDivision();
712 * @descr Parse the frame which anchor is to page before parse other contents,
713 * This method is called when the document is root document.
715 void LwpDocument::ParseFrameInPage(IXFStream * pOutputStream)
717 if(IsChildDoc())
718 return;
720 XFContentContainer* pXFContainer = new XFContentContainer;
722 XFConvertFrameInPage(pXFContainer);
724 pXFContainer->ToXml(pOutputStream);
725 delete pXFContainer;
726 pXFContainer = NULL;
729 * @descr Parse the frame which anchor is to page in the entire document
731 void LwpDocument::XFConvertFrameInPage(XFContentContainer * pCont)
733 LwpDocument* pDivision = GetFirstDivision();
735 LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*> (GetDivInfoID()->obj());
736 if(pDivInfo)
738 LwpPageLayout* pPageLayout = dynamic_cast<LwpPageLayout*>(pDivInfo->GetInitialLayoutID()->obj());
739 if(pPageLayout)
741 LwpStory* pStory = dynamic_cast<LwpStory*>(pPageLayout->GetContent()->obj());
742 if(pStory)
743 pStory->XFConvertFrameInPage(pCont);
746 while(pDivision)
748 pDivision->XFConvertFrameInPage(pCont);
749 pDivision = pDivision->GetNextDivision();
753 * @descr change click here to placeholder
755 void LwpDocument::ChangeStyleName()
757 XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
758 XFTextStyle* pStyle = dynamic_cast<XFTextStyle*>(pXFStyleManager->FindStyle(A2OUSTR("ClickHere")));
759 if (pStyle)
761 pStyle->SetStyleName(A2OUSTR("Placeholder"));
764 LwpDocSock::LwpDocSock(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
765 :LwpDLNFVList(objHdr, pStrm)
769 * @descr read VO_DOCSOCK from file
771 void LwpDocSock::Read()
773 LwpDLNFVList::Read();
774 m_Doc.ReadIndexed(m_pObjStrm);
775 m_pObjStrm->SkipExtra();
778 * @descr register styles in documents plugged
780 void LwpDocSock::RegisterStyle()
782 LwpObject* pDoc = GetNext()->obj();
783 if(pDoc)
784 pDoc->RegisterStyle();
786 pDoc = GetChildHead()->obj();
787 if(pDoc)
788 pDoc->RegisterStyle();
791 * @descr parse contents of documents plugged
793 void LwpDocSock::Parse(IXFStream* pOutputStream)
795 LwpObject* pDoc = GetChildHead()->obj();
796 if(pDoc)
797 pDoc->Parse(pOutputStream);
799 pDoc = GetNext()->obj();
800 if(pDoc)
801 pDoc->Parse(pOutputStream);
804 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */