fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / lotuswordpro / source / filter / lwpdoc.cxx
bloba2ff123d6170a7a5e6110d4f2beb9b6fbc705047
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)
73 , m_pOwnedFoundry(NULL)
74 , m_nFlags(0)
75 , m_nPersistentFlags(0)
76 , m_pLnOpts(NULL)
80 LwpDocument::~LwpDocument()
82 if(m_pLnOpts)
84 delete m_pLnOpts;
86 if(m_pOwnedFoundry)
88 delete m_pOwnedFoundry;
91 /**
92 * @descr Read VO_Document from object stream
93 **/
94 void LwpDocument::Read()
96 LwpDLNFPVList::Read();
98 ReadPlug();
100 m_nPersistentFlags = m_pObjStrm->QuickReaduInt32();
102 //Skip the SortOption and UIDocument
104 LwpSortOption m_DocSort( m_pObjStrm );
105 LwpUIDocument m_UIDoc( m_pObjStrm );
108 m_pLnOpts = new LwpLineNumberOptions(m_pObjStrm);
110 //Skip LwpUserDictFiles
112 LwpUserDictFiles m_UsrDicts( m_pObjStrm );
115 if( !IsChildDoc())
117 //Skip LwpPrinterInfo
118 LwpPrinterInfo m_PrtInfo( m_pObjStrm );
121 m_pFoundry = m_pOwnedFoundry = new LwpFoundry(m_pObjStrm, this);
123 m_DivOpts.ReadIndexed(m_pObjStrm);
125 if(!IsChildDoc())
127 m_FootnoteOpts.ReadIndexed(m_pObjStrm);
128 m_DocData.ReadIndexed(m_pObjStrm);
130 else
132 //Skip the docdata used in old version
133 LwpObjectID dummyDocData;
134 dummyDocData.ReadIndexed(m_pObjStrm);
136 m_DivInfo.ReadIndexed(m_pObjStrm);
137 m_Epoch.Read(m_pObjStrm);
138 m_WYSIWYGPageHints.ReadIndexed(m_pObjStrm);
139 m_VerDoc.ReadIndexed(m_pObjStrm);
140 m_STXInfo.ReadIndexed(m_pObjStrm);
144 * @descr Read plug related data from m_pObjStram
146 void LwpDocument::ReadPlug()
148 m_DocSockID.ReadIndexed(m_pObjStrm);
149 m_nFlags = m_pObjStrm->QuickReaduInt16();
150 m_pObjStrm->SkipExtra();
154 * @descr Parse obj to IXFStream
156 void LwpDocument::Parse(IXFStream* pOutputStream)
158 //check the name and skip script division
159 if (!IsSkippedDivision())
161 //the frames which anchor are to page must output before other contents
162 ParseFrameInPage(pOutputStream);
163 ParseDocContent(pOutputStream);
166 rtl::Reference<LwpObject> pDocSock = GetSocket().obj( VO_DOCSOCK );
167 if(pDocSock.is())
169 pDocSock->Parse(pOutputStream);
173 bool LwpDocument::IsSkippedDivision()
175 OUString sDivName;
176 bool ret = false;
177 LwpDivInfo* pDiv = dynamic_cast<LwpDivInfo*>(GetDivInfoID().obj(VO_DIVISIONINFO).get());
178 if (pDiv == NULL)
179 return true;
180 sDivName = pDiv->GetDivName();
181 if (!sDivName.isEmpty() && !pDiv->IsGotoable()) //including toa,scripts division
182 return true;
183 //skip endnote division
184 OUString strClassName = pDiv->GetClassName();
185 if ((strClassName == STR_DivisionEndnote)
186 || (strClassName == STR_DivisionGroupEndnote)
187 || (strClassName == STR_DocumentEndnote))
189 LwpPageLayout* pPageLayout = dynamic_cast<LwpPageLayout*>(pDiv->GetInitialLayoutID().obj(VO_PAGELAYOUT).get());
190 if(pPageLayout)
192 LwpStory* pStory = dynamic_cast<LwpStory*>(pPageLayout->GetContent().obj(VO_STORY).get());
193 if(pStory)
195 //This judgement maybe have problem. If there is only one para in the story,
196 //this endnote division has no other contents except endnote table.
197 LwpObjectID& rFirst = pStory->GetFirstPara();
198 LwpObjectID& rLast = pStory->GetLastPara();
199 if(rFirst == rLast)
200 ret = true;
204 return ret;
208 * @descr Register all styles in this division
210 void LwpDocument::RegisterStyle()
212 RegisterDefaultParaStyles();
213 RegisterGraphicsStyles();
214 RegisterBulletStyles();
216 RegisterTextStyles();
217 RegisterLayoutStyles();
218 RegisterStylesInPara();
220 RegisterLinenumberStyles();
221 RegisterFootnoteStyles();
223 //Register styles in other document connected with this document: next doc, children doc
224 rtl::Reference<LwpObject> pDocSock = GetSocket().obj();
225 if(pDocSock.is())
227 pDocSock->RegisterStyle();
231 * @descr Register all named para styles
233 void LwpDocument::RegisterTextStyles()
235 //Register all text styles: para styles, character styles
236 LwpDLVListHeadHolder* pParaStyleHolder = dynamic_cast<LwpDLVListHeadHolder*>(m_pFoundry->GetTextStyleHead().obj().get());
237 if(pParaStyleHolder)
239 LwpTextStyle* pParaStyle = dynamic_cast<LwpTextStyle*> (pParaStyleHolder->GetHeadID().obj().get());
240 while(pParaStyle)
242 pParaStyle->SetFoundry(m_pFoundry);
243 pParaStyle->RegisterStyle();
244 pParaStyle = dynamic_cast<LwpParaStyle*>(pParaStyle->GetNext().obj().get());
247 ChangeStyleName();//add by ,for click here block,05/5/26
250 * @descr Register all layouts styles (page master and master page)
251 * All para styles used in master page (header and footer) are registered and then showed
253 void LwpDocument::RegisterLayoutStyles()
255 //Register all layout styles, before register all styles in para
256 m_pFoundry->RegisterAllLayouts();
258 //set initial pagelayout in story for parsing pagelayout
259 LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*> (m_DivInfo.obj( VO_DIVISIONINFO).get());
260 if(pDivInfo)
262 LwpPageLayout* pPageLayout = dynamic_cast<LwpPageLayout*>(pDivInfo->GetInitialLayoutID().obj(VO_PAGELAYOUT).get());
263 if(pPageLayout)
265 //In Ole division, the content of pagelayout is VO_OLEOBJECT
266 LwpStory* pStory = dynamic_cast<LwpStory*>(pPageLayout->GetContent().obj(VO_STORY).get());
267 if(pStory)
269 //add all the pagelayout in order into the pagelayout list;
270 pStory->SortPageLayout();
271 pStory->SetCurrentLayout(pPageLayout);
277 * @descr Register all styles used in para
279 void LwpDocument::RegisterStylesInPara()
281 //Register all automatic styles in para
282 LwpHeadContent* pContent = dynamic_cast<LwpHeadContent*> (m_pFoundry->GetContentManager().GetContentList().obj().get());
283 if(pContent)
285 LwpStory* pStory = dynamic_cast<LwpStory*>(pContent->GetChildHead().obj(VO_STORY).get());
286 while(pStory)
288 //Register the child para
289 pStory->SetFoundry(m_pFoundry);
290 pStory->RegisterStyle();
291 pStory = dynamic_cast<LwpStory*>(pStory->GetNext().obj(VO_STORY).get());
296 * @descr Register all bullet styles used in this division
298 void LwpDocument::RegisterBulletStyles()
300 //Register bullet styles
301 LwpDLVListHeadHolder* mBulletHead = dynamic_cast<LwpDLVListHeadHolder*>
302 (m_pFoundry->GetBulletManagerID().obj(VO_HEADHOLDER).get());
303 if( mBulletHead )
305 LwpSilverBullet* pBullet = dynamic_cast<LwpSilverBullet*>
306 (mBulletHead->GetHeadID().obj().get());
307 while(pBullet)
309 pBullet->SetFoundry(m_pFoundry);
310 pBullet->RegisterStyle();
311 pBullet = dynamic_cast<LwpSilverBullet*> (pBullet->GetNext().obj().get());
316 * @descr Register all styles used in VO_Graphic
318 void LwpDocument::RegisterGraphicsStyles()
320 //Register all graphics styles, the first object should register the next;
321 rtl::Reference<LwpObject> pGraphic = m_pFoundry->GetGraphicListHead().obj(VO_GRAPHIC);
322 if(pGraphic.is())
324 pGraphic->SetFoundry(m_pFoundry);
325 pGraphic->RegisterStyle();
329 * @descr Register line number styles
331 void LwpDocument::RegisterLinenumberStyles()
333 if (!m_pLnOpts)
334 return;
335 m_pLnOpts->RegisterStyle();
339 * @descr Register footnote/endnote configuration for the entire document
341 void LwpDocument::RegisterFootnoteStyles()
343 //Register footnote and endnote configuration for the entire document
344 if(!m_FootnoteOpts.IsNull())
346 LwpFootnoteOptions* pFootnoteOpts = dynamic_cast<LwpFootnoteOptions*>(m_FootnoteOpts.obj().get());
347 if (pFootnoteOpts)
349 pFootnoteOpts->SetMasterPage("Endnote");
350 pFootnoteOpts->RegisterStyle();
353 //Register endnote page style for endnote configuration, use the last division that has endnote for the endnote page style
354 //This page style must register after its division default styles have registered
355 LwpDocument* pEndnoteDiv = GetLastDivisionThatHasEndnote();
356 if(this == pEndnoteDiv)
358 LwpDLVListHeadTailHolder* pHeadTail = dynamic_cast<LwpDLVListHeadTailHolder*>(GetPageHintsID().obj().get());
359 if(pHeadTail)
361 LwpPageHint* pPageHint = dynamic_cast<LwpPageHint*>(pHeadTail->GetTail().obj().get());
362 if(pPageHint && !pPageHint->GetPageLayoutID().IsNull())
364 LwpPageLayout* pPageLayout = dynamic_cast<LwpPageLayout*>(pPageHint->GetPageLayoutID().obj().get());
365 if(pPageLayout)
367 pPageLayout->SetFoundry(GetFoundry());
368 pPageLayout->RegisterEndnoteStyle();
376 * @descr Register default para styles
378 #include "lwpverdocument.hxx"
379 void LwpDocument::RegisterDefaultParaStyles()
381 if(!IsChildDoc())
383 //Get First Division
384 //LwpDocument* pFirstDoc = GetFirstDivision();
385 LwpDocument* pFirstDoc = GetFirstDivisionWithContentsThatIsNotOLE();
386 if(pFirstDoc)
388 LwpVerDocument* pVerDoc = dynamic_cast<LwpVerDocument*>(pFirstDoc->GetVerDoc().obj().get());
389 if(pVerDoc)
391 pVerDoc->RegisterStyle();
399 * @descr Parse content in this division to IXFStream
400 * LwpDocument->LwpDivInfo->LwpPageLayout.Parse()
402 void LwpDocument::ParseDocContent(IXFStream* pOutputStream)
404 //Parse content in PageLayout
405 LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*> (m_DivInfo.obj().get());
406 if(pDivInfo==NULL) return;
408 rtl::Reference<LwpObject> pLayoutObj = pDivInfo->GetInitialLayoutID().obj();
409 if(!pLayoutObj.is())
411 //master document not supported now.
412 return;
414 pLayoutObj->SetFoundry(m_pFoundry);
415 pLayoutObj->Parse(pOutputStream);
419 * @descr Get the footnoteoptions from the root document
421 LwpObjectID* LwpDocument::GetValidFootnoteOpts()
423 LwpDocument* pRoot = GetRootDocument();
424 if(pRoot)
426 return &pRoot->GetFootnoteOpts();
428 return NULL;
432 * @descr Get the endnote type
434 sal_uInt16 LwpDocument::GetEndnoteType()
436 LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(GetDivInfoID().obj().get());
437 if (!pDivInfo)
438 return FN_DONTCARE;
439 OUString strClassName = pDivInfo->GetClassName();
440 if (strClassName == STR_DivisionEndnote)
441 return FN_DIVISION_SEPARATE;
442 if (strClassName == STR_DivisionGroupEndnote)
443 return FN_DIVISIONGROUP_SEPARATE;
444 if (strClassName == STR_DocumentEndnote)
445 return FN_DOCUMENT_SEPARATE;
446 return FN_DONTCARE;
449 * @descr Get previous division
451 LwpDocument* LwpDocument::GetPreviousDivision()
453 LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket().obj().get());
454 if(pDocSock)
456 return dynamic_cast<LwpDocument*>(pDocSock->GetPrevious().obj().get());
458 return NULL;
461 * @descr Get next division
463 LwpDocument* LwpDocument::GetNextDivision()
465 LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket().obj().get());
466 if(pDocSock)
468 return dynamic_cast<LwpDocument*>(pDocSock->GetNext().obj().get());
470 return NULL;
473 * @descr Get parent division
475 LwpDocument* LwpDocument::GetParentDivision()
477 LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket().obj().get());
478 if(pDocSock)
480 return dynamic_cast<LwpDocument*>(pDocSock->GetParent().obj().get());
482 return NULL;
485 * @descr Get previous division in group, copy from lwp source code
487 LwpDocument* LwpDocument::GetPreviousInGroup()
489 LwpDocument* pPrev = NULL;
491 for (pPrev = GetPreviousDivision(); pPrev; pPrev = pPrev->GetPreviousDivision())
493 LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(pPrev->GetDivInfoID().obj().get());
494 if(pDivInfo && pDivInfo->HasContents())
495 return pPrev;
497 return NULL;
500 * @descr Get previous division in group, copy from lwp source code
502 LwpDocument* LwpDocument::GetNextInGroup()
504 LwpDocument* pNext = NULL;
506 for (pNext = GetNextDivision(); pNext; pNext = pNext->GetNextDivision())
508 LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(pNext->GetDivInfoID().obj().get());
509 if(pDivInfo && pDivInfo->HasContents())
510 return pNext;
513 return NULL;
516 * @descr Get previous division which has contents, copy from lwp source code
518 LwpDocument* LwpDocument::GetPreviousDivisionWithContents()
520 if(GetPreviousDivision())
522 LwpDocument* pDoc = GetPreviousDivision()->GetLastDivisionWithContents();
523 if (pDoc)
524 return pDoc;
526 if(GetParentDivision())
527 return GetParentDivision()->GetPreviousDivisionWithContents();
528 return NULL;
531 * @descr Get last division which has contents, copy from lwp source code
533 LwpDocument* LwpDocument::GetLastDivisionWithContents()
535 LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(GetDivInfoID().obj().get());
536 if(pDivInfo && pDivInfo->HasContents())
538 return this;
541 LwpDocument* pDivision = GetLastDivision();
543 while(pDivision)
545 LwpDocument* pContentDivision = pDivision->GetLastDivisionWithContents();
546 if(pContentDivision)
548 return pContentDivision;
550 pDivision = pDivision->GetPreviousDivision();
553 return NULL;
556 * @descr Get last division in group which has contents, copy from lwp source code
558 LwpDocument* LwpDocument::GetLastInGroupWithContents()
560 LwpDocument* pLast = NULL;
561 LwpDocument* pNext = this;
563 while (pNext)
565 LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(pNext->GetDivInfoID().obj().get());
566 if (pDivInfo && pDivInfo->HasContents())
567 pLast = pNext;
568 pNext = pNext->GetNextInGroup();
570 if (pLast)
571 return pLast;
572 return NULL;
575 * @descr Get last division
577 LwpDocument* LwpDocument::GetLastDivision()
579 LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket().obj().get());
580 if(pDocSock)
581 return dynamic_cast<LwpDocument*>(pDocSock->GetChildTail().obj().get());
582 return NULL;
586 * @descr Get first division
588 LwpDocument* LwpDocument::GetFirstDivision()
590 LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket().obj().get());
591 if(pDocSock)
592 return dynamic_cast<LwpDocument*>(pDocSock->GetChildHead().obj().get());
593 return NULL;
597 * @descr Get root document
599 LwpDocument* LwpDocument::GetRootDocument()
601 LwpDocument* pRoot = this;
602 while(pRoot)
604 if(!pRoot->IsChildDoc())
605 return pRoot;
606 pRoot = pRoot->GetParentDivision();
608 return NULL;
611 * @descr Get first division with contents that is not ole, copy from lwp-source code
613 LwpDocument* LwpDocument::GetFirstDivisionWithContentsThatIsNotOLE()
615 LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(GetDivInfoID().obj().get());
616 if(pDivInfo && pDivInfo->HasContents()
617 && !pDivInfo->IsOleDivision())
618 return this;
620 LwpDocument* pDivision = GetFirstDivision();
622 while (pDivision)
624 LwpDocument* pContentDivision = pDivision->GetFirstDivisionWithContentsThatIsNotOLE();
625 if(pContentDivision)
626 return pContentDivision;
627 pDivision = pDivision->GetNextDivision();
629 return NULL;
632 * @descr Get last division that has endnote
634 LwpDocument* LwpDocument::GetLastDivisionThatHasEndnote()
636 LwpDocument* pRoot = GetRootDocument();
637 LwpDocument *pLastDoc = pRoot->GetLastDivisionWithContents();
638 while(pLastDoc)
640 if(pLastDoc->GetEnSuperTableLayout())
641 return pLastDoc;
642 pLastDoc = pLastDoc->GetPreviousDivisionWithContents();
644 return NULL;
648 * @descr Get endnote supertable layout, every division has only one endnote supertable layout.
650 LwpVirtualLayout* LwpDocument::GetEnSuperTableLayout()
652 LwpHeadLayout* pHeadLayout = dynamic_cast<LwpHeadLayout*>(GetFoundry()->GetLayout().obj().get());
653 if(pHeadLayout)
655 return pHeadLayout->FindEnSuperTableLayout();
657 return NULL;
661 * @descr Get the numbers of page before pEndDivision, copy from lwp source code
663 bool LwpDocument::GetNumberOfPages(LwpDocument* pEndDivision, sal_uInt16& nCount)
665 if(this == pEndDivision)
666 return true;
668 LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(m_DivInfo.obj().get());
669 if(pDivInfo)
671 pDivInfo->GetNumberOfPages(nCount);
674 LwpDocument* pDivision = GetFirstDivision();
675 while(pDivision)
677 if(pDivision->GetNumberOfPages(pEndDivision,nCount))
678 return true;
679 pDivision = pDivision->GetNextDivision();
682 return false;
685 * @descr Get the numbers of page before curruent division
687 sal_uInt16 LwpDocument::GetNumberOfPagesBefore()
689 sal_uInt16 nPageNumber = 0;
690 LwpDocument* pRoot = GetRootDocument();
691 if(pRoot)
692 pRoot->GetNumberOfPages(this,nPageNumber);
693 return nPageNumber;
697 * @descr Get Max number of pages
699 void LwpDocument::MaxNumberOfPages(sal_uInt16& nNumPages)
701 LwpDocument* pDivision = GetFirstDivision();
703 LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(m_DivInfo.obj().get());
704 if(pDivInfo)
705 nNumPages += pDivInfo->GetMaxNumberOfPages();
706 while(pDivision)
708 pDivision->MaxNumberOfPages(nNumPages);
709 pDivision = pDivision->GetNextDivision();
713 * @descr Parse the frame which anchor is to page before parse other contents,
714 * This method is called when the document is root document.
716 void LwpDocument::ParseFrameInPage(IXFStream * pOutputStream)
718 if(IsChildDoc())
719 return;
721 XFContentContainer* pXFContainer = new XFContentContainer;
723 XFConvertFrameInPage(pXFContainer);
725 pXFContainer->ToXml(pOutputStream);
726 delete pXFContainer;
727 pXFContainer = NULL;
730 * @descr Parse the frame which anchor is to page in the entire document
732 void LwpDocument::XFConvertFrameInPage(XFContentContainer * pCont)
734 LwpDocument* pDivision = GetFirstDivision();
736 LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*> (GetDivInfoID().obj().get());
737 if(pDivInfo)
739 LwpPageLayout* pPageLayout = dynamic_cast<LwpPageLayout*>(pDivInfo->GetInitialLayoutID().obj().get());
740 if(pPageLayout)
742 LwpStory* pStory = dynamic_cast<LwpStory*>(pPageLayout->GetContent().obj().get());
743 if(pStory)
744 pStory->XFConvertFrameInPage(pCont);
747 while(pDivision)
749 pDivision->XFConvertFrameInPage(pCont);
750 pDivision = pDivision->GetNextDivision();
754 * @descr change click here to placeholder
756 void LwpDocument::ChangeStyleName()
758 XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
759 XFTextStyle* pStyle = dynamic_cast<XFTextStyle*>(pXFStyleManager->FindStyle("ClickHere"));
760 if (pStyle)
762 pStyle->SetStyleName("Placeholder");
765 LwpDocSock::LwpDocSock(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
766 :LwpDLNFVList(objHdr, pStrm)
770 * @descr read VO_DOCSOCK from file
772 void LwpDocSock::Read()
774 LwpDLNFVList::Read();
775 m_Doc.ReadIndexed(m_pObjStrm);
776 m_pObjStrm->SkipExtra();
779 * @descr register styles in documents plugged
781 void LwpDocSock::RegisterStyle()
783 rtl::Reference<LwpObject> pDoc = GetNext().obj();
784 if(pDoc.is())
785 pDoc->RegisterStyle();
787 pDoc = GetChildHead().obj();
788 if(pDoc.is())
789 pDoc->RegisterStyle();
792 * @descr parse contents of documents plugged
794 void LwpDocSock::Parse(IXFStream* pOutputStream)
796 rtl::Reference<LwpObject> pDoc = GetChildHead().obj();
797 if(pDoc.is())
798 pDoc->Parse(pOutputStream);
800 pDoc = GetNext().obj();
801 if(pDoc.is())
802 pDoc->Parse(pOutputStream);
805 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */