diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-06-06 16:49:17 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-06-06 16:49:44 +0200 |
commit | 37183595bb3b4d58682f90fd9f6713bedcb852a2 (patch) | |
tree | 1ac1fd9d69c0d09ea204173bd77721dc01bbddeb /lotuswordpro | |
parent | 7abe976be5166845c5f43b70a0dfb38608d31356 (diff) |
Fix memory leaks, by refcounting LwpObject
Change-Id: I1539597cd5bcabcbf0295d1acc320c503ad53604
Diffstat (limited to 'lotuswordpro')
64 files changed, 554 insertions, 485 deletions
diff --git a/lotuswordpro/source/filter/lwp9reader.cxx b/lotuswordpro/source/filter/lwp9reader.cxx index a4ec3e540654..fe77bd2b078d 100644 --- a/lotuswordpro/source/filter/lwp9reader.cxx +++ b/lotuswordpro/source/filter/lwp9reader.cxx @@ -180,13 +180,13 @@ void Lwp9Reader::ParseDocument() WriteDocHeader(); //Get root document - LwpDocument* doc = dynamic_cast<LwpDocument*> ( m_LwpFileHdr.GetDocID()->obj() ); + LwpDocument* doc = dynamic_cast<LwpDocument*> ( m_LwpFileHdr.GetDocID()->obj().get() ); if (!doc) return; //Parse Doc Data - LwpDocData *pDocData = dynamic_cast<LwpDocData*>((doc->GetDocData())->obj()); + LwpDocData *pDocData = dynamic_cast<LwpDocData*>((doc->GetDocData())->obj().get()); if (pDocData!=NULL) pDocData->Parse(m_pStream); diff --git a/lotuswordpro/source/filter/lwpcelllayout.cxx b/lotuswordpro/source/filter/lwpcelllayout.cxx index 59d3a08d83ce..85df93ec26ed 100644 --- a/lotuswordpro/source/filter/lwpcelllayout.cxx +++ b/lotuswordpro/source/filter/lwpcelllayout.cxx @@ -91,7 +91,7 @@ LwpCellLayout::~LwpCellLayout() */ LwpTableLayout * LwpCellLayout::GetTableLayout() { - LwpRowLayout * pRow = dynamic_cast<LwpRowLayout *>(GetParent()->obj()); + LwpRowLayout * pRow = dynamic_cast<LwpRowLayout *>(GetParent()->obj().get()); if(!pRow) { return NULL; @@ -265,14 +265,14 @@ void LwpCellLayout::ApplyBackColor(XFCellStyle *pCellStyle) */ void LwpCellLayout::ApplyFmtStyle(XFCellStyle *pCellStyle) { - LwpLayoutNumerics* pLayoutNumerics = dynamic_cast<LwpLayoutNumerics*>(cLayNumerics.obj()); + LwpLayoutNumerics* pLayoutNumerics = dynamic_cast<LwpLayoutNumerics*>(cLayNumerics.obj().get()); if (!pLayoutNumerics) { // if current layout doesn't have format, go to based on layout - LwpCellLayout* pCellLayout = dynamic_cast<LwpCellLayout*>(m_BasedOnStyle.obj()); + LwpCellLayout* pCellLayout = dynamic_cast<LwpCellLayout*>(m_BasedOnStyle.obj().get()); if (pCellLayout) { - pLayoutNumerics = dynamic_cast<LwpLayoutNumerics*>(pCellLayout->GetNumericsObject()->obj()); + pLayoutNumerics = dynamic_cast<LwpLayoutNumerics*>(pCellLayout->GetNumericsObject()->obj().get()); } } @@ -314,7 +314,7 @@ XFCell* LwpCellLayout::ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uI { // if cell layout is aTableID's default cell layout // it can't have any content, bypass these code - LwpTable * pTable = dynamic_cast<LwpTable *>(aTableID.obj()); + LwpTable * pTable = dynamic_cast<LwpTable *>(aTableID.obj().get()); if (!pTable) { assert(false); @@ -331,7 +331,7 @@ XFCell* LwpCellLayout::ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uI } // content of cell - LwpStory* pStory = dynamic_cast<LwpStory*>(m_Content.obj()); + LwpStory* pStory = dynamic_cast<LwpStory*>(m_Content.obj().get()); if (pStory) { pStory->XFConvert(pXFCell); @@ -347,8 +347,8 @@ LwpPara* LwpCellLayout::GetLastParaOfPreviousStory() LwpObjectID* pPreStoryID = this->GetPreviousCellStory(); if (pPreStoryID && !(pPreStoryID->IsNull())) { - LwpStory* pPreStory = dynamic_cast<LwpStory*>(pPreStoryID->obj(VO_STORY)); - return dynamic_cast<LwpPara*>(pPreStory->GetLastPara()->obj(VO_PARA)); + LwpStory* pPreStory = dynamic_cast<LwpStory*>(pPreStoryID->obj(VO_STORY).get()); + return dynamic_cast<LwpPara*>(pPreStory->GetLastPara()->obj(VO_PARA).get()); } else { @@ -571,7 +571,7 @@ void LwpCellLayout::RegisterDefaultCell() */ void LwpCellLayout::RegisterStyle() { - LwpVirtualLayout * pParent = dynamic_cast<LwpVirtualLayout *>(GetParent()->obj()); + LwpVirtualLayout * pParent = dynamic_cast<LwpVirtualLayout *>(GetParent()->obj().get()); if (!pParent || pParent->GetLayoutType() != LWP_ROW_LAYOUT) { // default cell layout, we must register 4 styles for it @@ -595,8 +595,8 @@ void LwpCellLayout::RegisterStyle() m_StyleName = pXFStyleManager->AddStyle(pCellStyle)->GetStyleName(); // content object register styles - LwpObject * pObj = m_Content.obj(); - if (pObj) + rtl::Reference<LwpObject> pObj = m_Content.obj(); + if (pObj.is()) { pObj->SetFoundry(m_pFoundry); pObj->RegisterStyle(); @@ -657,7 +657,7 @@ void LwpCellLayout::ApplyProtect(XFCell * pCell, LwpObjectID aTableID) else { // judge base on - LwpCellLayout * pBase = dynamic_cast<LwpCellLayout *>(m_BasedOnStyle.obj()); + LwpCellLayout * pBase = dynamic_cast<LwpCellLayout *>(m_BasedOnStyle.obj().get()); if (pBase && pBase->IsProtected()) { bProtected = true; @@ -665,7 +665,7 @@ void LwpCellLayout::ApplyProtect(XFCell * pCell, LwpObjectID aTableID) else { // judge whole table - LwpTable * pTable = dynamic_cast<LwpTable *>(aTableID.obj()); + LwpTable * pTable = dynamic_cast<LwpTable *>(aTableID.obj().get()); LwpTableLayout * pTableLayout = pTable ? static_cast<LwpTableLayout *>(pTable->GetTableLayout()) : NULL; LwpSuperTableLayout * pSuper = pTableLayout ? pTableLayout->GetSuperTableLayout() : NULL; if (pSuper && pSuper->IsProtected()) @@ -877,19 +877,19 @@ void LwpHiddenCellLayout::Read() XFCell* LwpHiddenCellLayout::ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol) { - if (!cconnectedlayout.obj()) + if (!cconnectedlayout.obj().is()) return NULL; - LwpConnectedCellLayout* pConnCell = dynamic_cast<LwpConnectedCellLayout* >(cconnectedlayout.obj()); + LwpConnectedCellLayout* pConnCell = dynamic_cast<LwpConnectedCellLayout* >(cconnectedlayout.obj().get()); if (!pConnCell || nRow < (pConnCell->GetNumrows()+pConnCell->GetRowID())) return NULL; // if the hidden cell should be displayed for limit of SODC // use the default cell layout XFCell* pXFCell = NULL; - LwpTable *pTable = dynamic_cast<LwpTable *>(aTableID.obj()); + LwpTable *pTable = dynamic_cast<LwpTable *>(aTableID.obj().get()); if (pTable) { - LwpCellLayout *pDefault = dynamic_cast<LwpCellLayout *>(pTable->GetDefaultCellStyle()->obj()); + LwpCellLayout *pDefault = dynamic_cast<LwpCellLayout *>(pTable->GetDefaultCellStyle()->obj().get()); if (pDefault) { pXFCell = pDefault->ConvertCell(aTableID, nRow, nCol); diff --git a/lotuswordpro/source/filter/lwpcontent.hxx b/lotuswordpro/source/filter/lwpcontent.hxx index fae9fccab048..70a03da5a466 100644 --- a/lotuswordpro/source/filter/lwpcontent.hxx +++ b/lotuswordpro/source/filter/lwpcontent.hxx @@ -141,7 +141,7 @@ inline OUString LwpContent::GetClassName() inline LwpContent* LwpContent::GetNextEnumerated() { - return dynamic_cast<LwpContent*>(m_NextEnumerated.obj()); + return dynamic_cast<LwpContent*>(m_NextEnumerated.obj().get()); } /** * @brief diff --git a/lotuswordpro/source/filter/lwpdivinfo.cxx b/lotuswordpro/source/filter/lwpdivinfo.cxx index 564309ed97a0..5a93497591eb 100644 --- a/lotuswordpro/source/filter/lwpdivinfo.cxx +++ b/lotuswordpro/source/filter/lwpdivinfo.cxx @@ -166,10 +166,10 @@ sal_uInt16 LwpDivInfo::GetMaxNumberOfPages() LwpDocument* pDiv = GetDivision(); if(!pDiv) return 0; - LwpDLVListHeadTailHolder* pHeadTail = static_cast<LwpDLVListHeadTailHolder*>(pDiv->GetPageHintsID()->obj()); + LwpDLVListHeadTailHolder* pHeadTail = static_cast<LwpDLVListHeadTailHolder*>(pDiv->GetPageHintsID()->obj().get()); if(pHeadTail) { - LwpPageHint* pPageHint =static_cast<LwpPageHint*>(pHeadTail->GetTail()->obj()); + LwpPageHint* pPageHint =static_cast<LwpPageHint*>(pHeadTail->GetTail()->obj().get()); if(pPageHint && !pPageHint->GetPageLayoutID()->IsNull()) { return pPageHint->GetPageNumber(); diff --git a/lotuswordpro/source/filter/lwpdivinfo.hxx b/lotuswordpro/source/filter/lwpdivinfo.hxx index a2a094fd2d9c..b191f15a8b48 100644 --- a/lotuswordpro/source/filter/lwpdivinfo.hxx +++ b/lotuswordpro/source/filter/lwpdivinfo.hxx @@ -78,7 +78,6 @@ class LwpDivInfo : public LwpObject { public: LwpDivInfo(LwpObjectHeader& objHdr, LwpSvStream* pStrm); - virtual ~LwpDivInfo(); LwpObjectID* GetInitialLayoutID(){ return &m_InitialLayoutID;} LwpObjectID* GetFillerPageTextID(){ return &m_FillerPageTextID;} // add by ,03/14/2004 @@ -97,6 +96,8 @@ public: protected: void Read() SAL_OVERRIDE; private: + virtual ~LwpDivInfo(); + LwpObjectID m_ParentID; LwpAtomHolder m_Name; LwpObjectID m_LayoutID; @@ -161,7 +162,7 @@ inline bool LwpDivInfo::IsGotoable() inline LwpDocument* LwpDivInfo::GetDivision() { - return dynamic_cast<LwpDocument*>(m_ParentID.obj()); + return dynamic_cast<LwpDocument*>(m_ParentID.obj().get()); } #endif diff --git a/lotuswordpro/source/filter/lwpdivopts.hxx b/lotuswordpro/source/filter/lwpdivopts.hxx index 8d0d645428aa..1445aa5c16d6 100644 --- a/lotuswordpro/source/filter/lwpdivopts.hxx +++ b/lotuswordpro/source/filter/lwpdivopts.hxx @@ -108,10 +108,11 @@ class LwpDivisionOptions : public LwpObject { public: LwpDivisionOptions(LwpObjectHeader& objHdr, LwpSvStream* pStrm); - virtual ~LwpDivisionOptions(); protected: void Read() SAL_OVERRIDE; private: + virtual ~LwpDivisionOptions(); + LwpHyphenOptions m_HyphOpts; sal_uInt16 m_nOptionFlag; LwpTextLanguage m_Lang; diff --git a/lotuswordpro/source/filter/lwpdlvlist.hxx b/lotuswordpro/source/filter/lwpdlvlist.hxx index dea314e388ba..6c90a82b51fd 100644 --- a/lotuswordpro/source/filter/lwpdlvlist.hxx +++ b/lotuswordpro/source/filter/lwpdlvlist.hxx @@ -74,8 +74,9 @@ class LwpDLVList : public LwpObject { public: LwpDLVList(LwpObjectHeader &objHdr, LwpSvStream* pStrm); - virtual ~LwpDLVList(){} protected: + virtual ~LwpDLVList(){} + LwpObjectID m_ListPrevious; LwpObjectID m_ListNext; protected: @@ -99,8 +100,9 @@ class LwpDLNFVList : public LwpDLVList { public: LwpDLNFVList(LwpObjectHeader &objHdr, LwpSvStream* pStrm); - virtual ~LwpDLNFVList(){} protected: + virtual ~LwpDLNFVList(){} + LwpObjectID m_ChildHead; LwpObjectID m_ChildTail; LwpObjectID m_Parent; diff --git a/lotuswordpro/source/filter/lwpdoc.cxx b/lotuswordpro/source/filter/lwpdoc.cxx index 32967258c9a5..7b421685bc88 100644 --- a/lotuswordpro/source/filter/lwpdoc.cxx +++ b/lotuswordpro/source/filter/lwpdoc.cxx @@ -163,8 +163,8 @@ void LwpDocument::Parse(IXFStream* pOutputStream) ParseDocContent(pOutputStream); } - LwpObject* pDocSock = GetSocket()->obj( VO_DOCSOCK ); - if(pDocSock!=NULL) + rtl::Reference<LwpObject> pDocSock = GetSocket()->obj( VO_DOCSOCK ); + if(pDocSock.is()) { pDocSock->Parse(pOutputStream); } @@ -174,7 +174,7 @@ bool LwpDocument::IsSkippedDivision() { OUString sDivName; bool ret = false; - LwpDivInfo* pDiv = dynamic_cast<LwpDivInfo*>(GetDivInfoID()->obj(VO_DIVISIONINFO)); + LwpDivInfo* pDiv = dynamic_cast<LwpDivInfo*>(GetDivInfoID()->obj(VO_DIVISIONINFO).get()); if (pDiv == NULL) return true; sDivName = pDiv->GetDivName(); @@ -186,10 +186,10 @@ bool LwpDocument::IsSkippedDivision() || (strClassName == STR_DivisionGroupEndnote) || (strClassName == STR_DocumentEndnote)) { - LwpPageLayout* pPageLayout = dynamic_cast<LwpPageLayout*>(pDiv->GetInitialLayoutID()->obj(VO_PAGELAYOUT)); + LwpPageLayout* pPageLayout = dynamic_cast<LwpPageLayout*>(pDiv->GetInitialLayoutID()->obj(VO_PAGELAYOUT).get()); if(pPageLayout) { - LwpStory* pStory = dynamic_cast<LwpStory*>(pPageLayout->GetContent()->obj(VO_STORY)); + LwpStory* pStory = dynamic_cast<LwpStory*>(pPageLayout->GetContent()->obj(VO_STORY).get()); if(pStory) { //This judgement maybe have problem. If there is only one para in the story, @@ -221,8 +221,8 @@ void LwpDocument::RegisterStyle() RegisterFootnoteStyles(); //Register styles in other document connected with this document: next doc, children doc - LwpObject* pDocSock = GetSocket()->obj(); - if(pDocSock!=NULL) + rtl::Reference<LwpObject> pDocSock = GetSocket()->obj(); + if(pDocSock.is()) { pDocSock->RegisterStyle(); } @@ -233,15 +233,15 @@ void LwpDocument::RegisterStyle() void LwpDocument::RegisterTextStyles() { //Register all text styles: para styles, character styles - LwpDLVListHeadHolder* pParaStyleHolder = dynamic_cast<LwpDLVListHeadHolder*>(m_pFoundry->GetTextStyleHead()->obj()); + LwpDLVListHeadHolder* pParaStyleHolder = dynamic_cast<LwpDLVListHeadHolder*>(m_pFoundry->GetTextStyleHead()->obj().get()); if(pParaStyleHolder) { - LwpTextStyle* pParaStyle = dynamic_cast<LwpTextStyle*> (pParaStyleHolder->GetHeadID()->obj()); + LwpTextStyle* pParaStyle = dynamic_cast<LwpTextStyle*> (pParaStyleHolder->GetHeadID()->obj().get()); while(pParaStyle) { pParaStyle->SetFoundry(m_pFoundry); pParaStyle->RegisterStyle(); - pParaStyle = dynamic_cast<LwpParaStyle*>(pParaStyle->GetNext()->obj()); + pParaStyle = dynamic_cast<LwpParaStyle*>(pParaStyle->GetNext()->obj().get()); } } ChangeStyleName();//add by ,for click here block,05/5/26 @@ -256,15 +256,15 @@ void LwpDocument::RegisterLayoutStyles() m_pFoundry->RegisterAllLayouts(); //set initial pagelayout in story for parsing pagelayout - LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*> (m_DivInfo.obj( VO_DIVISIONINFO)); + LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*> (m_DivInfo.obj( VO_DIVISIONINFO).get()); LwpPageLayout* pPageLayout = NULL; if(pDivInfo) { - pPageLayout = dynamic_cast<LwpPageLayout*>(pDivInfo->GetInitialLayoutID()->obj(VO_PAGELAYOUT)); + pPageLayout = dynamic_cast<LwpPageLayout*>(pDivInfo->GetInitialLayoutID()->obj(VO_PAGELAYOUT).get()); if(pPageLayout) { //In Ole division, the content of pagelayout is VO_OLEOBJECT - LwpStory* pStory = dynamic_cast<LwpStory*>(pPageLayout->GetContent()->obj(VO_STORY)); + LwpStory* pStory = dynamic_cast<LwpStory*>(pPageLayout->GetContent()->obj(VO_STORY).get()); if(pStory) { //add all the pagelayout in order into the pagelayout list; @@ -280,16 +280,16 @@ void LwpDocument::RegisterLayoutStyles() void LwpDocument::RegisterStylesInPara() { //Register all automatic styles in para - LwpHeadContent* pContent = dynamic_cast<LwpHeadContent*> (m_pFoundry->GetContentManager()->GetContentList()->obj()); + LwpHeadContent* pContent = dynamic_cast<LwpHeadContent*> (m_pFoundry->GetContentManager()->GetContentList()->obj().get()); if(pContent) { - LwpStory* pStory = dynamic_cast<LwpStory*>(pContent->GetChildHead()->obj(VO_STORY)); + LwpStory* pStory = dynamic_cast<LwpStory*>(pContent->GetChildHead()->obj(VO_STORY).get()); while(pStory) { //Register the child para pStory->SetFoundry(m_pFoundry); pStory->RegisterStyle(); - pStory = dynamic_cast<LwpStory*>(pStory->GetNext()->obj(VO_STORY)); + pStory = dynamic_cast<LwpStory*>(pStory->GetNext()->obj(VO_STORY).get()); } } } @@ -300,16 +300,16 @@ void LwpDocument::RegisterBulletStyles() { //Register bullet styles LwpDLVListHeadHolder* mBulletHead = dynamic_cast<LwpDLVListHeadHolder*> - (m_pFoundry->GetBulletManagerID()->obj(VO_HEADHOLDER)); + (m_pFoundry->GetBulletManagerID()->obj(VO_HEADHOLDER).get()); if( mBulletHead ) { LwpSilverBullet* pBullet = dynamic_cast<LwpSilverBullet*> - (mBulletHead->GetHeadID()->obj()); + (mBulletHead->GetHeadID()->obj().get()); while(pBullet) { pBullet->SetFoundry(m_pFoundry); pBullet->RegisterStyle(); - pBullet = dynamic_cast<LwpSilverBullet*> (pBullet->GetNext()->obj()); + pBullet = dynamic_cast<LwpSilverBullet*> (pBullet->GetNext()->obj().get()); } } } @@ -319,8 +319,8 @@ void LwpDocument::RegisterBulletStyles() void LwpDocument::RegisterGraphicsStyles() { //Register all graphics styles, the first object should register the next; - LwpObject* pGraphic = m_pFoundry->GetGraphicListHead()->obj(VO_GRAPHIC); - if(pGraphic) + rtl::Reference<LwpObject> pGraphic = m_pFoundry->GetGraphicListHead()->obj(VO_GRAPHIC); + if(pGraphic.is()) { pGraphic->SetFoundry(m_pFoundry); pGraphic->RegisterStyle(); @@ -344,7 +344,7 @@ void LwpDocument::RegisterFootnoteStyles() //Register footnote and endnote configuration for the entire document if(!m_FootnoteOpts.IsNull()) { - LwpFootnoteOptions* pFootnoteOpts = dynamic_cast<LwpFootnoteOptions*>(m_FootnoteOpts.obj()); + LwpFootnoteOptions* pFootnoteOpts = dynamic_cast<LwpFootnoteOptions*>(m_FootnoteOpts.obj().get()); if (pFootnoteOpts) { pFootnoteOpts->SetMasterPage("Endnote"); @@ -356,13 +356,13 @@ void LwpDocument::RegisterFootnoteStyles() LwpDocument* pEndnoteDiv = GetLastDivisionThatHasEndnote(); if(this == pEndnoteDiv) { - LwpDLVListHeadTailHolder* pHeadTail = dynamic_cast<LwpDLVListHeadTailHolder*>(GetPageHintsID()->obj()); + LwpDLVListHeadTailHolder* pHeadTail = dynamic_cast<LwpDLVListHeadTailHolder*>(GetPageHintsID()->obj().get()); if(pHeadTail) { - LwpPageHint* pPageHint = dynamic_cast<LwpPageHint*>(pHeadTail->GetTail()->obj()); + LwpPageHint* pPageHint = dynamic_cast<LwpPageHint*>(pHeadTail->GetTail()->obj().get()); if(pPageHint && !pPageHint->GetPageLayoutID()->IsNull()) { - LwpPageLayout* pPageLayout = dynamic_cast<LwpPageLayout*>(pPageHint->GetPageLayoutID()->obj()); + LwpPageLayout* pPageLayout = dynamic_cast<LwpPageLayout*>(pPageHint->GetPageLayoutID()->obj().get()); if(pPageLayout) { pPageLayout->SetFoundry(GetFoundry()); @@ -386,7 +386,7 @@ void LwpDocument::RegisterDefaultParaStyles() LwpDocument* pFirstDoc = GetFirstDivisionWithContentsThatIsNotOLE(); if(pFirstDoc) { - LwpVerDocument* pVerDoc = dynamic_cast<LwpVerDocument*>(pFirstDoc->GetVerDoc()->obj()); + LwpVerDocument* pVerDoc = dynamic_cast<LwpVerDocument*>(pFirstDoc->GetVerDoc()->obj().get()); if(pVerDoc) { pVerDoc->RegisterStyle(); @@ -403,11 +403,11 @@ void LwpDocument::RegisterDefaultParaStyles() void LwpDocument::ParseDocContent(IXFStream* pOutputStream) { //Parse content in PageLayout - LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*> (m_DivInfo.obj()); + LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*> (m_DivInfo.obj().get()); if(pDivInfo==NULL) return; - LwpObject* pLayoutObj = pDivInfo->GetInitialLayoutID()->obj(); - if(pLayoutObj==NULL) + rtl::Reference<LwpObject> pLayoutObj = pDivInfo->GetInitialLayoutID()->obj(); + if(!pLayoutObj.is()) { //master document not supported now. return; @@ -434,7 +434,7 @@ LwpObjectID* LwpDocument::GetValidFootnoteOpts() */ sal_uInt16 LwpDocument::GetEndnoteType() { - LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(GetDivInfoID()->obj()); + LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(GetDivInfoID()->obj().get()); if (!pDivInfo) return FN_DONTCARE; OUString strClassName = pDivInfo->GetClassName(); @@ -451,10 +451,10 @@ sal_uInt16 LwpDocument::GetEndnoteType() */ LwpDocument* LwpDocument::GetPreviousDivision() { - LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket()->obj()); + LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket()->obj().get()); if(pDocSock) { - return dynamic_cast<LwpDocument*>(pDocSock->GetPrevious()->obj()); + return dynamic_cast<LwpDocument*>(pDocSock->GetPrevious()->obj().get()); } return NULL; } @@ -463,10 +463,10 @@ LwpDocument* LwpDocument::GetPreviousDivision() */ LwpDocument* LwpDocument::GetNextDivision() { - LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket()->obj()); + LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket()->obj().get()); if(pDocSock) { - return dynamic_cast<LwpDocument*>(pDocSock->GetNext()->obj()); + return dynamic_cast<LwpDocument*>(pDocSock->GetNext()->obj().get()); } return NULL; } @@ -475,10 +475,10 @@ LwpDocument* LwpDocument::GetPreviousDivision() */ LwpDocument* LwpDocument::GetParentDivision() { - LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket()->obj()); + LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket()->obj().get()); if(pDocSock) { - return dynamic_cast<LwpDocument*>(pDocSock->GetParent()->obj()); + return dynamic_cast<LwpDocument*>(pDocSock->GetParent()->obj().get()); } return NULL; } @@ -491,7 +491,7 @@ LwpDocument* LwpDocument::GetPreviousDivision() for (pPrev = GetPreviousDivision(); pPrev; pPrev = pPrev->GetPreviousDivision()) { - LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(pPrev->GetDivInfoID()->obj()); + LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(pPrev->GetDivInfoID()->obj().get()); if(pDivInfo && pDivInfo->HasContents()) return pPrev; } @@ -506,7 +506,7 @@ LwpDocument* LwpDocument::GetPreviousDivision() for (pNext = GetNextDivision(); pNext; pNext = pNext->GetNextDivision()) { - LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(pNext->GetDivInfoID()->obj()); + LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(pNext->GetDivInfoID()->obj().get()); if(pDivInfo && pDivInfo->HasContents()) return pNext; } @@ -533,7 +533,7 @@ LwpDocument* LwpDocument::GetPreviousDivision() */ LwpDocument* LwpDocument::GetLastDivisionWithContents() { - LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(GetDivInfoID()->obj()); + LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(GetDivInfoID()->obj().get()); if(pDivInfo && pDivInfo->HasContents()) { return this; @@ -564,7 +564,7 @@ LwpDocument* LwpDocument::GetPreviousDivision() while (pNext) { - LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(pNext->GetDivInfoID()->obj()); + LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(pNext->GetDivInfoID()->obj().get()); if (pDivInfo && pDivInfo->HasContents()) pLast = pNext; pNext = pNext->GetNextInGroup(); @@ -578,9 +578,9 @@ LwpDocument* LwpDocument::GetPreviousDivision() */ LwpDocument* LwpDocument::GetLastDivision() { - LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket()->obj()); + LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket()->obj().get()); if(pDocSock) - return dynamic_cast<LwpDocument*>(pDocSock->GetChildTail()->obj()); + return dynamic_cast<LwpDocument*>(pDocSock->GetChildTail()->obj().get()); return NULL; } @@ -589,9 +589,9 @@ LwpDocument* LwpDocument::GetPreviousDivision() */ LwpDocument* LwpDocument::GetFirstDivision() { - LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket()->obj()); + LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket()->obj().get()); if(pDocSock) - return dynamic_cast<LwpDocument*>(pDocSock->GetChildHead()->obj()); + return dynamic_cast<LwpDocument*>(pDocSock->GetChildHead()->obj().get()); return NULL; } @@ -614,7 +614,7 @@ LwpDocument* LwpDocument::GetPreviousDivision() */ LwpDocument* LwpDocument::GetFirstDivisionWithContentsThatIsNotOLE() { - LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(GetDivInfoID()->obj()); + LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(GetDivInfoID()->obj().get()); if(pDivInfo && pDivInfo->HasContents() && !pDivInfo->IsOleDivision()) return this; @@ -653,7 +653,7 @@ LwpDocument* LwpDocument::GetPreviousDivision() */ LwpVirtualLayout* LwpDocument::GetEnSuperTableLayout() { - LwpHeadLayout* pHeadLayout = dynamic_cast<LwpHeadLayout*>(GetFoundry()->GetLayout()->obj()); + LwpHeadLayout* pHeadLayout = dynamic_cast<LwpHeadLayout*>(GetFoundry()->GetLayout()->obj().get()); if(pHeadLayout) { return pHeadLayout->FindEnSuperTableLayout(); @@ -669,7 +669,7 @@ bool LwpDocument::GetNumberOfPages(LwpDocument* pEndDivision, sal_uInt16& nCount if(this == pEndDivision) return true; - LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(m_DivInfo.obj()); + LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(m_DivInfo.obj().get()); if(pDivInfo) { pDivInfo->GetNumberOfPages(nCount); @@ -704,7 +704,7 @@ sal_uInt16 LwpDocument::GetNumberOfPagesBefore() { LwpDocument* pDivision = GetFirstDivision(); - LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(m_DivInfo.obj()); + LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(m_DivInfo.obj().get()); if(pDivInfo) nNumPages += pDivInfo->GetMaxNumberOfPages(); while(pDivision) @@ -737,13 +737,13 @@ void LwpDocument::XFConvertFrameInPage(XFContentContainer * pCont) { LwpDocument* pDivision = GetFirstDivision(); - LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*> (GetDivInfoID()->obj()); + LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*> (GetDivInfoID()->obj().get()); if(pDivInfo) { - LwpPageLayout* pPageLayout = dynamic_cast<LwpPageLayout*>(pDivInfo->GetInitialLayoutID()->obj()); + LwpPageLayout* pPageLayout = dynamic_cast<LwpPageLayout*>(pDivInfo->GetInitialLayoutID()->obj().get()); if(pPageLayout) { - LwpStory* pStory = dynamic_cast<LwpStory*>(pPageLayout->GetContent()->obj()); + LwpStory* pStory = dynamic_cast<LwpStory*>(pPageLayout->GetContent()->obj().get()); if(pStory) pStory->XFConvertFrameInPage(pCont); } @@ -784,12 +784,12 @@ void LwpDocSock::Read() */ void LwpDocSock::RegisterStyle() { - LwpObject* pDoc = GetNext()->obj(); - if(pDoc) + rtl::Reference<LwpObject> pDoc = GetNext()->obj(); + if(pDoc.is()) pDoc->RegisterStyle(); pDoc = GetChildHead()->obj(); - if(pDoc) + if(pDoc.is()) pDoc->RegisterStyle(); } /** @@ -797,12 +797,12 @@ void LwpDocSock::RegisterStyle() */ void LwpDocSock::Parse(IXFStream* pOutputStream) { - LwpObject* pDoc = GetChildHead()->obj(); - if(pDoc) + rtl::Reference<LwpObject> pDoc = GetChildHead()->obj(); + if(pDoc.is()) pDoc->Parse(pOutputStream); pDoc = GetNext()->obj(); - if(pDoc) + if(pDoc.is()) pDoc->Parse(pOutputStream); } diff --git a/lotuswordpro/source/filter/lwpdocdata.hxx b/lotuswordpro/source/filter/lwpdocdata.hxx index adf3a3155859..48414b32a769 100644 --- a/lotuswordpro/source/filter/lwpdocdata.hxx +++ b/lotuswordpro/source/filter/lwpdocdata.hxx @@ -164,8 +164,9 @@ class LwpDocData : public LwpObject { public: LwpDocData(LwpObjectHeader &objHdr, LwpSvStream* pStrm); - virtual ~LwpDocData(); private: + virtual ~LwpDocData(); + LwpDocOptions m_DocOptions; LwpDocInfo m_DocInfo; LwpDocControl m_DocControl; diff --git a/lotuswordpro/source/filter/lwpfnlayout.cxx b/lotuswordpro/source/filter/lwpfnlayout.cxx index 0b10dc4ba277..595f43ac1940 100644 --- a/lotuswordpro/source/filter/lwpfnlayout.cxx +++ b/lotuswordpro/source/filter/lwpfnlayout.cxx @@ -119,14 +119,14 @@ void LwpFnRowLayout::RegisterStyle() { // register cells' style LwpObjectID *pCellID= GetChildHead(); - LwpCellLayout * pCellLayout = static_cast<LwpCellLayout *>(pCellID->obj()); + LwpCellLayout * pCellLayout = static_cast<LwpCellLayout *>(pCellID->obj().get()); while(pCellLayout) { pCellLayout->SetFoundry(m_pFoundry); pCellLayout->RegisterStyle(); pCellID = pCellLayout->GetNext(); - pCellLayout = static_cast<LwpCellLayout *>(pCellID->obj()); + pCellLayout = static_cast<LwpCellLayout *>(pCellID->obj().get()); } } @@ -160,8 +160,8 @@ void LwpFnCellLayout::Read() void LwpFnCellLayout::RegisterStyle() { // content object register styles - LwpObject * pObj = m_Content.obj(); - if (pObj) + rtl::Reference<LwpObject> pObj = m_Content.obj(); + if (pObj.is()) { pObj->SetFoundry(m_pFoundry); pObj->RegisterStyle(); @@ -199,14 +199,14 @@ void LwpEndnoteLayout::RegisterStyle() { // register style of rows LwpObjectID *pRowID = GetChildHead(); - LwpRowLayout * pRowLayout = static_cast<LwpRowLayout *>(pRowID->obj()); + LwpRowLayout * pRowLayout = static_cast<LwpRowLayout *>(pRowID->obj().get()); while (pRowLayout) { pRowLayout->SetFoundry(m_pFoundry); pRowLayout->RegisterStyle(); pRowID = pRowLayout->GetNext(); - pRowLayout = static_cast<LwpRowLayout *>(pRowID->obj()); + pRowLayout = static_cast<LwpRowLayout *>(pRowID->obj().get()); } } @@ -262,7 +262,7 @@ void LwpEnSuperTableLayout::XFConvert(XFContentContainer * /*pCont*/) while(pID && !pID->IsNull()) { - LwpVirtualLayout * pLayout = static_cast<LwpVirtualLayout *>(pID->obj()); + LwpVirtualLayout * pLayout = static_cast<LwpVirtualLayout *>(pID->obj().get()); if(!pLayout) { break; @@ -318,7 +318,7 @@ LwpVirtualLayout* LwpFnSuperTableLayout::GetMainTableLayout() while(pID && !pID->IsNull()) { - LwpVirtualLayout * pLayout = static_cast<LwpVirtualLayout *>(pID->obj()); + LwpVirtualLayout * pLayout = static_cast<LwpVirtualLayout *>(pID->obj().get()); if(!pLayout) { break; diff --git a/lotuswordpro/source/filter/lwpfootnote.cxx b/lotuswordpro/source/filter/lwpfootnote.cxx index 91e18aef27b9..1761b281915d 100644 --- a/lotuswordpro/source/filter/lwpfootnote.cxx +++ b/lotuswordpro/source/filter/lwpfootnote.cxx @@ -141,7 +141,7 @@ void LwpFribFootnote::XFConvert(XFContentContainer* pCont) */ LwpFootnote* LwpFribFootnote::GetFootnote() { - return dynamic_cast<LwpFootnote*>(m_Footnote.obj()); + return dynamic_cast<LwpFootnote*>(m_Footnote.obj().get()); } LwpFootnote::LwpFootnote(LwpObjectHeader &objHdr, LwpSvStream *pStrm) @@ -212,7 +212,7 @@ LwpCellLayout* LwpFootnote::GetCellLayout() LwpRowLayout* pRowLayout = pTableLayout->GetRowLayout(m_nRow); if(pRowLayout) { - return dynamic_cast<LwpCellLayout*>(pRowLayout->GetChildHead()->obj()); + return dynamic_cast<LwpCellLayout*>(pRowLayout->GetChildHead()->obj().get()); } } } @@ -387,7 +387,7 @@ LwpEnSuperTableLayout* LwpFootnote::FindFootnoteTableLayout() */ LwpContent* LwpFootnote::FindFootnoteContent() { - LwpContent* pContent = dynamic_cast<LwpContent*>(m_Content.obj()); + LwpContent* pContent = dynamic_cast<LwpContent*>(m_Content.obj().get()); //if the content has layout, the content has footnote contents; //or looking for the celllayout and return the footnote contents. if(pContent && pContent->GetLayout(NULL)) @@ -396,7 +396,7 @@ LwpContent* LwpFootnote::FindFootnoteContent() LwpCellLayout* pCellLayout = GetCellLayout(); if(pCellLayout) { - pContent = dynamic_cast<LwpContent*>(pCellLayout->GetContent()->obj()); + pContent = dynamic_cast<LwpContent*>(pCellLayout->GetContent()->obj().get()); } return pContent; diff --git a/lotuswordpro/source/filter/lwpfootnote.hxx b/lotuswordpro/source/filter/lwpfootnote.hxx index 1d95043228e5..1abb13552a84 100644 --- a/lotuswordpro/source/filter/lwpfootnote.hxx +++ b/lotuswordpro/source/filter/lwpfootnote.hxx @@ -245,13 +245,14 @@ class LwpFootnoteOptions : public LwpObject { public: LwpFootnoteOptions(LwpObjectHeader &objHdr, LwpSvStream* pStrm); - virtual ~LwpFootnoteOptions(); void RegisterStyle() SAL_OVERRIDE; protected: void Read() SAL_OVERRIDE; void RegisterFootnoteStyle(); void RegisterEndnoteStyle(); private: + virtual ~LwpFootnoteOptions(); + sal_uInt16 m_nFlag; LwpFootnoteNumberOptions m_FootnoteNumbering; LwpFootnoteNumberOptions m_EndnoteDivisionNumbering; diff --git a/lotuswordpro/source/filter/lwpfoundry.cxx b/lotuswordpro/source/filter/lwpfoundry.cxx index 40dc99e2a9b3..3fac6aa73511 100644 --- a/lotuswordpro/source/filter/lwpfoundry.cxx +++ b/lotuswordpro/source/filter/lwpfoundry.cxx @@ -195,8 +195,8 @@ void LwpFoundry::RegisterAllLayouts() m_bRegisteredAll = true; //Register CellStyle - LwpObject* pStyle = m_CellStyle.obj(); - if( pStyle ) + rtl::Reference<LwpObject> pStyle = m_CellStyle.obj(); + if( pStyle.is() ) { pStyle->SetFoundry(this); pStyle->RegisterStyle(); @@ -204,7 +204,7 @@ void LwpFoundry::RegisterAllLayouts() //register content page layout list: Layout pStyle = m_Layout.obj(); - if( pStyle ) + if( pStyle.is() ) { pStyle->SetFoundry(this); pStyle->RegisterStyle(); @@ -212,7 +212,7 @@ void LwpFoundry::RegisterAllLayouts() //Register page style layout list: PageStyle, such as "Default Page" pStyle = m_PageStyle.obj(); - if( pStyle ) + if( pStyle.is() ) { pStyle->SetFoundry(this); pStyle->RegisterStyle(); @@ -220,7 +220,7 @@ void LwpFoundry::RegisterAllLayouts() //Register FrameStyle pStyle = m_FrameStyle.obj(); - if( pStyle ) + if( pStyle.is() ) { pStyle->SetFoundry(this); pStyle->RegisterStyle(); @@ -231,11 +231,11 @@ void LwpFoundry::RegisterAllLayouts() LwpBookMark* LwpFoundry::GetBookMark(LwpObjectID objMarker) { LwpDLVListHeadHolder* pHeadHolder= static_cast - <LwpDLVListHeadHolder*>(m_BookMarkHead.obj()); + <LwpDLVListHeadHolder*>(m_BookMarkHead.obj().get()); LwpObjectID* pObjID = pHeadHolder->GetHeadID(); LwpBookMark* pBookMark; if (pObjID) - pBookMark = static_cast<LwpBookMark*>(pObjID->obj()); + pBookMark = static_cast<LwpBookMark*>(pObjID->obj().get()); else return NULL; @@ -245,7 +245,7 @@ LwpBookMark* LwpFoundry::GetBookMark(LwpObjectID objMarker) return pBookMark; pObjID = pBookMark->GetNext(); if (pObjID) - pBookMark = static_cast<LwpBookMark*>(pObjID->obj()); + pBookMark = static_cast<LwpBookMark*>(pObjID->obj().get()); else return NULL; } @@ -276,7 +276,7 @@ LwpSection* LwpFoundry::EnumSections(LwpSection * pSection) */ LwpObjectID * LwpFoundry::GetDefaultTextStyle() { - LwpVersionedPointer * pPointer = static_cast<LwpVersionedPointer *>(m_DefaultTextStyle.obj()); + LwpVersionedPointer * pPointer = static_cast<LwpVersionedPointer *>(m_DefaultTextStyle.obj().get()); if (!pPointer) return NULL; @@ -290,16 +290,16 @@ LwpObjectID * LwpFoundry::GetDefaultTextStyle() LwpObjectID * LwpFoundry::FindParaStyleByName(const OUString& name) { //Register all text styles: para styles, character styles - LwpDLVListHeadHolder* pParaStyleHolder = static_cast<LwpDLVListHeadHolder*>(GetTextStyleHead()->obj()); + LwpDLVListHeadHolder* pParaStyleHolder = static_cast<LwpDLVListHeadHolder*>(GetTextStyleHead()->obj().get()); if(pParaStyleHolder) { - LwpTextStyle* pParaStyle = static_cast<LwpTextStyle*> (pParaStyleHolder->GetHeadID()->obj()); + LwpTextStyle* pParaStyle = static_cast<LwpTextStyle*> (pParaStyleHolder->GetHeadID()->obj().get()); while(pParaStyle) { OUString strName = pParaStyle->GetName()->str(); if(strName == name) return pParaStyle->GetObjectID(); - pParaStyle = static_cast<LwpTextStyle*>(pParaStyle->GetNext()->obj()); + pParaStyle = static_cast<LwpTextStyle*>(pParaStyle->GetNext()->obj().get()); } } @@ -408,8 +408,8 @@ LwpContent* LwpContentManager::EnumContents(LwpContent* pContent) { if(pContent) return pContent->GetNextEnumerated(); - LwpVersionedPointer* pPointer = static_cast<LwpVersionedPointer*>(m_EnumHead.obj()); - return pPointer ? static_cast<LwpContent*>(pPointer->GetPointer()->obj()) : NULL; + LwpVersionedPointer* pPointer = static_cast<LwpVersionedPointer*>(m_EnumHead.obj().get()); + return pPointer ? static_cast<LwpContent*>(pPointer->GetPointer()->obj().get()) : NULL; } void LwpPieceManager::Read(LwpObjectStream *pStrm) @@ -460,14 +460,14 @@ LwpOrderedObject* LwpOrderedObjectManager::Enumerate(LwpOrderedObject * pLast) { // If Last has a next, return it. if(pLast && !pLast->GetNext()->IsNull()) - return static_cast<LwpOrderedObject*>(pLast->GetNext()->obj()); + return static_cast<LwpOrderedObject*>(pLast->GetNext()->obj().get()); LwpListList* pList = NULL; if(pLast) { // We're at the end of Last's list (not Liszt's list). // Start with the next active list - pList = static_cast<LwpListList*>(pLast->GetListList()->obj()); + pList = static_cast<LwpListList*>(pLast->GetListList()->obj().get()); pList= GetNextActiveListList(pList); } else @@ -478,7 +478,7 @@ LwpOrderedObject* LwpOrderedObjectManager::Enumerate(LwpOrderedObject * pLast) if(pList) { - return static_cast<LwpOrderedObject*>(pList->GetHead()->obj()); + return static_cast<LwpOrderedObject*>(pList->GetHead()->obj().get()); } return NULL; @@ -493,23 +493,23 @@ LwpListList* LwpOrderedObjectManager::GetNextActiveListList(LwpListList * pLast) LwpListList* pList = NULL; LwpContent* pContent = NULL; if(pLast) - pList = static_cast<LwpListList*>(pLast->GetNext()->obj()); + pList = static_cast<LwpListList*>(pLast->GetNext()->obj().get()); else { - LwpDLVListHeadHolder* pHeadHolder= static_cast<LwpDLVListHeadHolder*>(m_Head.obj()); + LwpDLVListHeadHolder* pHeadHolder= static_cast<LwpDLVListHeadHolder*>(m_Head.obj().get()); if(pHeadHolder) { - pList = static_cast<LwpListList*>(pHeadHolder->GetHeadID()->obj()); + pList = static_cast<LwpListList*>(pHeadHolder->GetHeadID()->obj().get()); } } while(pList) { - pContent = static_cast<LwpContent*>(pList->GetObject()->obj()); + pContent = static_cast<LwpContent*>(pList->GetObject()->obj().get()); if(pContent && pContent->HasNonEmbeddedLayouts() && !pContent->IsStyleContent()) return pList; - pList = static_cast<LwpListList*>(pList->GetNext()->obj()); + pList = static_cast<LwpListList*>(pList->GetNext()->obj().get()); } return NULL; } diff --git a/lotuswordpro/source/filter/lwpframelayout.cxx b/lotuswordpro/source/filter/lwpframelayout.cxx index 948a35f21483..7109b9dd1d81 100644 --- a/lotuswordpro/source/filter/lwpframelayout.cxx +++ b/lotuswordpro/source/filter/lwpframelayout.cxx @@ -833,8 +833,8 @@ void LwpFrameLayout::XFConvertFrame(XFContentContainer* pCont, sal_Int32 nStart //if it is a link frame, parse contents only once if(!HasPreviousLinkLayout()) { - LwpObject* content = m_Content.obj(); - if (content) + rtl::Reference<LwpObject> content = m_Content.obj(); + if (content.is()) { content->XFConvert(pXFFrame); //set frame size according to ole size @@ -863,8 +863,8 @@ void LwpFrameLayout::RegisterStyle() m_pFrame->RegisterStyle(pFrameStyle); //register content style - LwpObject* content = m_Content.obj(); - if (content) + rtl::Reference<LwpObject> content = m_Content.obj(); + if (content.is()) { content->SetFoundry(m_pFoundry); content->RegisterStyle(); @@ -884,7 +884,7 @@ OUString LwpFrameLayout::GetNextLinkName() LwpObjectID* pObjectID = m_Link.GetNextLayout(); if(!pObjectID->IsNull()) { - LwpLayout* pLayout = dynamic_cast<LwpLayout*>(pObjectID->obj()); + LwpLayout* pLayout = dynamic_cast<LwpLayout*>(pObjectID->obj().get()); if (pLayout) { LwpAtomHolder *pHolder = pLayout->GetName(); @@ -981,11 +981,11 @@ double LwpFrameLayout::GetMaxWidth() */ void LwpFrameLayout::ApplyGraphicSize(XFFrame * pXFFrame) { - LwpObject* content = m_Content.obj(); - if(content && (content->GetTag() == VO_GRAPHIC + rtl::Reference<LwpObject> content = m_Content.obj(); + if(content.is() && (content->GetTag() == VO_GRAPHIC || content->GetTag() == VO_OLEOBJECT )) { - LwpGraphicOleObject* pGraOle = static_cast<LwpGraphicOleObject*>(content); + LwpGraphicOleObject* pGraOle = static_cast<LwpGraphicOleObject*>(content.get()); //Get frame geometry size double fWidth = 0; double fHeight = 0; @@ -1097,11 +1097,11 @@ void LwpGroupLayout::XFConvertFrame(XFContentContainer* pCont, sal_Int32 nStart m_pFrame->Parse(pXFFrame, nStart); //add child frame into group - LwpVirtualLayout* pLayout = static_cast<LwpVirtualLayout*>(GetChildHead()->obj()); + LwpVirtualLayout* pLayout = static_cast<LwpVirtualLayout*>(GetChildHead()->obj().get()); while(pLayout) { pLayout->XFConvert(pXFFrame); - pLayout = static_cast<LwpVirtualLayout*>(pLayout->GetNext()->obj()); + pLayout = static_cast<LwpVirtualLayout*>(pLayout->GetNext()->obj().get()); } pCont ->Add(pXFFrame); @@ -1147,11 +1147,11 @@ void LwpDropcapLayout::Read() void LwpDropcapLayout::Parse(IXFStream* pOutputStream) { - LwpStory* pStory = static_cast<LwpStory*>(m_Content.obj(VO_STORY)); + LwpStory* pStory = static_cast<LwpStory*>(m_Content.obj(VO_STORY).get()); if (!pStory) return; - LwpObject* pPara = pStory->GetFirstPara()->obj(VO_PARA); - if(pPara) + rtl::Reference<LwpObject> pPara = pStory->GetFirstPara()->obj(VO_PARA); + if(pPara.is()) { pPara->SetFoundry(m_pFoundry); pPara->Parse(pOutputStream); @@ -1160,7 +1160,7 @@ void LwpDropcapLayout::Parse(IXFStream* pOutputStream) void LwpDropcapLayout::XFConvert(XFContentContainer* pCont) { - LwpStory* pStory = static_cast<LwpStory*>(m_Content.obj(VO_STORY)); + LwpStory* pStory = static_cast<LwpStory*>(m_Content.obj(VO_STORY).get()); if (pStory) { pStory->SetFoundry(m_pFoundry); @@ -1170,7 +1170,7 @@ void LwpDropcapLayout::XFConvert(XFContentContainer* pCont) LwpStory* LwpDropcapLayout::GetContentStory() { - return static_cast<LwpStory*>(m_Content.obj(VO_STORY)); + return static_cast<LwpStory*>(m_Content.obj(VO_STORY).get()); } void LwpDropcapLayout::RegisterStyle(LwpFoundry* pFoundry) @@ -1180,12 +1180,12 @@ void LwpDropcapLayout::RegisterStyle(LwpFoundry* pFoundry) { pStory->SetDropcapFlag(true); pStory->SetFoundry(pFoundry); - LwpPara* pPara = static_cast<LwpPara*>(pStory->GetFirstPara()->obj()); + LwpPara* pPara = static_cast<LwpPara*>(pStory->GetFirstPara()->obj().get()); while(pPara) { pPara->SetFoundry(pFoundry); pPara->RegisterStyle(); - pPara = static_cast<LwpPara*>(pPara->GetNext()->obj()); + pPara = static_cast<LwpPara*>(pPara->GetNext()->obj().get()); } } } @@ -1222,12 +1222,12 @@ void LwpRubyLayout::Read() LwpRubyMarker* LwpRubyLayout::GetMarker() { - return static_cast<LwpRubyMarker*>(m_objRubyMarker.obj(VO_RUBYMARKER)); + return static_cast<LwpRubyMarker*>(m_objRubyMarker.obj(VO_RUBYMARKER).get()); } LwpStory* LwpRubyLayout::GetContentStory() { - return static_cast<LwpStory*>(m_Content.obj(VO_STORY)); + return static_cast<LwpStory*>(m_Content.obj(VO_STORY).get()); } void LwpRubyLayout::ConvertContentText() diff --git a/lotuswordpro/source/filter/lwpfrib.cxx b/lotuswordpro/source/filter/lwpfrib.cxx index 4543c9607787..163d80fddcbd 100644 --- a/lotuswordpro/source/filter/lwpfrib.cxx +++ b/lotuswordpro/source/filter/lwpfrib.cxx @@ -254,7 +254,7 @@ void LwpFrib::RegisterStyle(LwpFoundry* pFoundry) { pStyle = new XFTextStyle(); *pStyle = *pNamedStyle; - LwpCharacterStyle* pCharStyle = static_cast<LwpCharacterStyle*>(m_pModifiers->CharStyleID.obj()); + LwpCharacterStyle* pCharStyle = static_cast<LwpCharacterStyle*>(m_pModifiers->CharStyleID.obj().get()); pStyle->SetStyleName(""); pFont = pFoundry->GetFontManger()->CreateOverrideFont(pCharStyle->GetFinalFontID(),m_pModifiers->FontID); diff --git a/lotuswordpro/source/filter/lwpfribbreaks.cxx b/lotuswordpro/source/filter/lwpfribbreaks.cxx index 9890e1f56473..ce71c21d1f61 100644 --- a/lotuswordpro/source/filter/lwpfribbreaks.cxx +++ b/lotuswordpro/source/filter/lwpfribbreaks.cxx @@ -84,7 +84,7 @@ void LwpFribColumnBreak::RegisterBreakStyle(LwpPara * pPara) //if (static_cast<LwpStory*>(pPara->GetStoryID()->obj()) // ->GetCurrentLayout()->GetNumCols() == 1) //New code - LwpStory* pStory = static_cast<LwpStory*>(pPara->GetStoryID()->obj()); + LwpStory* pStory = static_cast<LwpStory*>(pPara->GetStoryID()->obj().get()); LwpPageLayout* pCurLayout = pStory ? pStory->GetCurrentLayout() : NULL; if( pCurLayout && (pCurLayout->GetNumCols() == 1) ) @@ -129,7 +129,7 @@ void LwpFribPageBreak::RegisterBreakStyle(LwpPara* pPara) XFParaStyle* pBaseStyle = pPara->GetXFParaStyle(); if (pBaseStyle == NULL) return; - LwpPageLayout* pLayout = static_cast<LwpPageLayout*>(m_Layout.obj()); + LwpPageLayout* pLayout = static_cast<LwpPageLayout*>(m_Layout.obj().get()); if(pLayout) { m_pMasterPage = new LwpMasterPage(pPara, pLayout); diff --git a/lotuswordpro/source/filter/lwpfribframe.cxx b/lotuswordpro/source/filter/lwpfribframe.cxx index 6e489507f4a0..5d5c20c13ecb 100644 --- a/lotuswordpro/source/filter/lwpfribframe.cxx +++ b/lotuswordpro/source/filter/lwpfribframe.cxx @@ -80,7 +80,7 @@ void LwpFribFrame::Read(LwpObjectStream* pObjStrm, sal_uInt16 /*len*/) * @descr: Get the layout object which the frib points to * */ -LwpObject* LwpFribFrame::GetLayout() +rtl::Reference<LwpObject> LwpFribFrame::GetLayout() { return m_objLayout.obj(); } @@ -92,11 +92,11 @@ LwpObject* LwpFribFrame::GetLayout() */ void LwpFribFrame::RegisterStyle(LwpFoundry* pFoundry) { - LwpObject *pObject = m_objLayout.obj(); + rtl::Reference<LwpObject> pObject = m_objLayout.obj(); - if (pObject && pObject->GetTag() == VO_DROPCAPLAYOUT) + if (pObject.is() && pObject->GetTag() == VO_DROPCAPLAYOUT) { - LwpDropcapLayout *pLayout = dynamic_cast<LwpDropcapLayout*>(pObject); + LwpDropcapLayout *pLayout = dynamic_cast<LwpDropcapLayout*>(pObject.get()); if (!pLayout) return; pLayout->RegisterStyle(pFoundry); @@ -104,7 +104,7 @@ void LwpFribFrame::RegisterStyle(LwpFoundry* pFoundry) else { //register frame style - LwpPlacableLayout* pLayout = dynamic_cast<LwpPlacableLayout*>(pObject); + LwpPlacableLayout* pLayout = dynamic_cast<LwpPlacableLayout*>(pObject.get()); if (!pLayout) return; pLayout->SetFoundry(pFoundry); @@ -132,12 +132,12 @@ void LwpFribFrame::RegisterStyle(LwpFoundry* pFoundry) } void LwpFribFrame::SetParaDropcap(LwpPara* pPara) { - LwpObject *pObject = m_objLayout.obj(); + rtl::Reference<LwpObject> pObject = m_objLayout.obj(); - if (pObject && pObject->GetTag() == VO_DROPCAPLAYOUT) + if (pObject.is() && pObject->GetTag() == VO_DROPCAPLAYOUT) { pPara->SetParaDropcap(true); - pPara->SetDropcapLayout(dynamic_cast<LwpDropcapLayout*>(pObject)); + pPara->SetDropcapLayout(dynamic_cast<LwpDropcapLayout*>(pObject.get())); } else pPara->SetParaDropcap(false); @@ -150,7 +150,7 @@ void LwpFribFrame::SetParaDropcap(LwpPara* pPara) void LwpFribFrame::XFConvert(XFContentContainer* pCont) { XFContentContainer* pXFContentContainer = pCont; - LwpVirtualLayout* pLayout = dynamic_cast<LwpVirtualLayout*>(GetLayout()); + LwpVirtualLayout* pLayout = dynamic_cast<LwpVirtualLayout*>(GetLayout().get()); if (!pLayout) return; sal_uInt8 nType = pLayout->GetRelativeType(); @@ -243,7 +243,7 @@ void LwpFribRubyFrame::XFConvert(XFContentContainer* /*pCont*/) LwpRubyLayout* LwpFribRubyFrame::GetLayout() { - return dynamic_cast<LwpRubyLayout*>(m_objLayout.obj()); + return dynamic_cast<LwpRubyLayout*>(m_objLayout.obj().get()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/source/filter/lwpfribframe.hxx b/lotuswordpro/source/filter/lwpfribframe.hxx index f3776880384f..4afcc6d0cafd 100644 --- a/lotuswordpro/source/filter/lwpfribframe.hxx +++ b/lotuswordpro/source/filter/lwpfribframe.hxx @@ -74,7 +74,7 @@ public: LwpFribFrame( LwpPara* pPara) : LwpFrib(pPara){} virtual ~LwpFribFrame(){} void Read(LwpObjectStream* pObjStrm, sal_uInt16 len) SAL_OVERRIDE; - LwpObject* GetLayout(); + rtl::Reference<LwpObject> GetLayout(); void RegisterStyle(LwpFoundry* pFoundry) SAL_OVERRIDE; void SetParaDropcap(LwpPara* pPara); void XFConvert(XFContentContainer* pCont); diff --git a/lotuswordpro/source/filter/lwpfribmark.cxx b/lotuswordpro/source/filter/lwpfribmark.cxx index 05874bc8e4b8..5f3061521c35 100644 --- a/lotuswordpro/source/filter/lwpfribmark.cxx +++ b/lotuswordpro/source/filter/lwpfribmark.cxx @@ -94,7 +94,7 @@ void LwpFribCHBlock::Read(LwpObjectStream* pObjStrm, sal_uInt16 /*len*/) LwpCHBlkMarker* LwpFribCHBlock::GetMarker() { - return dynamic_cast<LwpCHBlkMarker*>(m_objMarker.obj()); + return dynamic_cast<LwpCHBlkMarker*>(m_objMarker.obj().get()); } void LwpFribCHBlock::XFConvert(XFContentContainer* pXFPara,LwpStory* pStory) @@ -147,7 +147,7 @@ void LwpFribBookMark::RegisterStyle(LwpFoundry* pFoundry) LwpObjectID* pID = pDoc->GetDivInfoID(); if (!pID->IsNull()) { - LwpDivInfo *pDivInvo = dynamic_cast<LwpDivInfo*>(pID->obj(VO_DIVISIONINFO)); + LwpDivInfo *pDivInvo = dynamic_cast<LwpDivInfo*>(pID->obj(VO_DIVISIONINFO).get()); if (pDivInvo) sDivision = pDivInvo->GetDivName(); } @@ -237,7 +237,7 @@ void LwpFribField::Read(LwpObjectStream* pObjStrm, sal_uInt16 /*len*/) LwpFieldMark* LwpFribField::GetMarker() { - return dynamic_cast<LwpFieldMark*>(m_objMarker.obj()); + return dynamic_cast<LwpFieldMark*>(m_objMarker.obj().get()); } void LwpFribField::XFConvert(XFContentContainer* pXFPara) @@ -1428,7 +1428,7 @@ LwpFribRubyMarker::LwpFribRubyMarker( LwpPara* pPara ) LwpRubyMarker* LwpFribRubyMarker::GetMarker() { - return dynamic_cast<LwpRubyMarker*>(m_objMarker.obj(VO_RUBYMARKER)); + return dynamic_cast<LwpRubyMarker*>(m_objMarker.obj(VO_RUBYMARKER).get()); } void LwpFribRubyMarker::Read(LwpObjectStream* pObjStrm, sal_uInt16 /*len*/) diff --git a/lotuswordpro/source/filter/lwpfribptr.cxx b/lotuswordpro/source/filter/lwpfribptr.cxx index 7d6b0009d921..a6a1669a0635 100644 --- a/lotuswordpro/source/filter/lwpfribptr.cxx +++ b/lotuswordpro/source/filter/lwpfribptr.cxx @@ -222,7 +222,7 @@ void LwpFribPtr::XFConvert() case FRIB_TAG_PAGEBREAK: { LwpFribPageBreak* pPageBreak = static_cast<LwpFribPageBreak*>(pFrib); - LwpPageLayout* pLayout = dynamic_cast<LwpPageLayout*>(pPageBreak->GetLayout()->obj()); + LwpPageLayout* pLayout = dynamic_cast<LwpPageLayout*>(pPageBreak->GetLayout()->obj().get()); if(pLayout) { pPageBreak->ParseLayout(); @@ -286,8 +286,8 @@ void LwpFribPtr::XFConvert() case FRIB_TAG_FRAME: { LwpFribFrame* frameFrib= static_cast<LwpFribFrame*>(pFrib); - LwpObject* pLayout = frameFrib->GetLayout(); - if (pLayout && pLayout->GetTag() == VO_DROPCAPLAYOUT) + rtl::Reference<LwpObject> pLayout = frameFrib->GetLayout(); + if (pLayout.is() && pLayout->GetTag() == VO_DROPCAPLAYOUT) m_pPara->GetFoundry()->GetDropcapMgr()->SetXFPara(m_pXFPara); frameFrib->XFConvert(m_pXFPara); } @@ -397,7 +397,7 @@ void LwpFribPtr::FindLayouts() //StartWithinColume type not support now break; } - LwpStory* pStory = dynamic_cast<LwpStory*>(m_pPara->GetStoryID()->obj()); + LwpStory* pStory = dynamic_cast<LwpStory*>(m_pPara->GetStoryID()->obj().get()); if (pStory) pStory->AddPageLayout(pSection->GetPageLayout()); } @@ -408,10 +408,10 @@ void LwpFribPtr::FindLayouts() case FRIB_TAG_PAGEBREAK: { LwpFribPageBreak* pPageBreak = static_cast<LwpFribPageBreak*>(pFrib); - LwpPageLayout* pLayout = dynamic_cast<LwpPageLayout*>(pPageBreak->GetLayout()->obj()); + LwpPageLayout* pLayout = dynamic_cast<LwpPageLayout*>(pPageBreak->GetLayout()->obj().get()); if(pLayout) { - LwpStory* pStory = dynamic_cast<LwpStory*>(m_pPara->GetStoryID()->obj()); + LwpStory* pStory = dynamic_cast<LwpStory*>(m_pPara->GetStoryID()->obj().get()); if (pStory) pStory->AddPageLayout(pLayout); } @@ -607,7 +607,7 @@ void LwpFribPtr::ProcessDropcap(LwpStory* pStory,LwpFrib* pFrib,sal_uInt32 nLen) XFTextStyle* pFribStyle = pXFStyleManager->FindTextStyle(pFrib->GetStyleName()); pFribStyle->GetFont()->SetFontSize(0); - LwpDropcapLayout* pObj = dynamic_cast<LwpDropcapLayout*>(pStory->GetLayoutsWithMe()->GetOnlyLayout()->obj()); + LwpDropcapLayout* pObj = dynamic_cast<LwpDropcapLayout*>(pStory->GetLayoutsWithMe()->GetOnlyLayout()->obj().get()); if (pObj) pObj->SetChars(nLen); } @@ -642,7 +642,7 @@ bool LwpFribPtr::ComparePagePosition(LwpVirtualLayout* pPreLayout, LwpVirtualLay case FRIB_TAG_PAGEBREAK: { LwpFribPageBreak* pPageBreak = static_cast<LwpFribPageBreak*>(pFrib); - pLayout = dynamic_cast<LwpVirtualLayout*>(pPageBreak->GetLayout()->obj()); + pLayout = dynamic_cast<LwpVirtualLayout*>(pPageBreak->GetLayout()->obj().get()); break; } default: diff --git a/lotuswordpro/source/filter/lwpfribsection.cxx b/lotuswordpro/source/filter/lwpfribsection.cxx index edd594060f14..1c9da63ceb1f 100644 --- a/lotuswordpro/source/filter/lwpfribsection.cxx +++ b/lotuswordpro/source/filter/lwpfribsection.cxx @@ -102,7 +102,7 @@ void LwpFribSection::Read(LwpObjectStream *pObjStrm, sal_uInt16 /*len*/) */ LwpSection* LwpFribSection::GetSection() { - return static_cast<LwpSection*>(m_Section.obj()); + return static_cast<LwpSection*>(m_Section.obj().get()); } /** @@ -128,7 +128,7 @@ void LwpFribSection::SetSectionName() LwpSection* pSection = GetSection(); if(pSection) { - LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID()->obj()); + LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID()->obj().get()); pStory->SetSectionName(pSection->GetSectionName()); } } @@ -166,7 +166,7 @@ void LwpFribSection::ParseSection() } else { - LwpStory* pStory = static_cast<LwpStory*> ( m_pPara->GetStoryID()->obj() ); + LwpStory* pStory = static_cast<LwpStory*> ( m_pPara->GetStoryID()->obj().get() ); if (m_Section.obj()->GetTag() == VO_INDEXSECTION) { //create a new section and add it to container @@ -200,7 +200,7 @@ void LwpFribSection::SetDefaultAlphaIndex(XFIndex * pXFIndex) LwpFoundry* pFoundry = m_pPara->GetFoundry(); OUString styleName = pFoundry->FindActuralStyleName("Separator"); - LwpIndexSection* pIndexSection = static_cast<LwpIndexSection*>(m_Section.obj()); + LwpIndexSection* pIndexSection = static_cast<LwpIndexSection*>(m_Section.obj().get()); XFIndexTemplate * pTemplateSep = new XFIndexTemplate(); if (pIndexSection->IsFormatSeparator()) { @@ -259,7 +259,7 @@ bool LwpMasterPage::RegisterMasterPage(LwpFrib* pFrib) //if there is no other frib after current firb, register master page in starting para of next page if(IsNextPageType()&&(!pFrib->HasNextFrib())) { - LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID()->obj()); + LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID()->obj().get()); pStory->SetCurrentLayout(m_pLayout); RegisterFillerPageStyle(); return false; @@ -290,7 +290,7 @@ bool LwpMasterPage::RegisterMasterPage(LwpFrib* pFrib) case LwpLayout::StartOnOddPage: //fall throught case LwpLayout::StartOnEvenPage: { - LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID()->obj()); + LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID()->obj().get()); pStory->SetCurrentLayout(m_pLayout); //get odd page layout when the current pagelayout is mirror m_pLayout = pStory->GetCurrentLayout(); @@ -305,7 +305,7 @@ bool LwpMasterPage::RegisterMasterPage(LwpFrib* pFrib) } //register tab style; - LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID()->obj()); + LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID()->obj().get()); pStory->SetTabLayout(m_pLayout); m_pPara->RegisterTabStyle(pOverStyle); @@ -316,7 +316,7 @@ bool LwpMasterPage::RegisterMasterPage(LwpFrib* pFrib) { XFSectionStyle* pSectStyle= new XFSectionStyle(); //set margin - pStory = static_cast<LwpStory*>(m_pPara->GetStoryID()->obj()); + pStory = static_cast<LwpStory*>(m_pPara->GetStoryID()->obj().get()); if(pStory) { LwpPageLayout* pCurrentLayout = pStory->GetCurrentLayout(); @@ -348,7 +348,7 @@ bool LwpMasterPage::IsNeedSection() { bool bNewSection = false; //get story - LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID()->obj()); + LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID()->obj().get()); //if pagelayout is modified, register the pagelayout if(pStory->IsPMModified()) { @@ -396,7 +396,7 @@ void LwpMasterPage::ParseSection(LwpFrib* pFrib) XFContentContainer* pContent = CreateXFSection(); if(pContent) { - LwpStory* pStory = static_cast<LwpStory*> ( m_pPara->GetStoryID()->obj() ); + LwpStory* pStory = static_cast<LwpStory*> ( m_pPara->GetStoryID()->obj().get() ); //delete the additional blank para, 06/28/2005 XFParagraph* pCurrPara = pFribPtr->GetXFPara(); if(!pCurrPara->HasContents()) @@ -412,7 +412,7 @@ void LwpMasterPage::ParseSection(LwpFrib* pFrib) } else { - LwpStory* pStory = static_cast<LwpStory*> ( m_pPara->GetStoryID()->obj() ); + LwpStory* pStory = static_cast<LwpStory*> ( m_pPara->GetStoryID()->obj().get() ); pContent = pStory->GetXFContent(); } if(pContent) diff --git a/lotuswordpro/source/filter/lwpfribtable.cxx b/lotuswordpro/source/filter/lwpfribtable.cxx index 86b81c39072f..21f7b8150aa1 100644 --- a/lotuswordpro/source/filter/lwpfribtable.cxx +++ b/lotuswordpro/source/filter/lwpfribtable.cxx @@ -73,7 +73,7 @@ void LwpFribTable::Read(LwpObjectStream* pObjStrm, sal_uInt16 /*len*/) LwpSuperTableLayout* LwpFribTable::GetSuperTable() { - return static_cast<LwpSuperTableLayout*>(m_objTable.obj()); + return static_cast<LwpSuperTableLayout*>(m_objTable.obj().get()); } void LwpFribTable::RegisterNewStyle() diff --git a/lotuswordpro/source/filter/lwpgrfobj.cxx b/lotuswordpro/source/filter/lwpgrfobj.cxx index 353a20e7aa32..6e884626aaf7 100644 --- a/lotuswordpro/source/filter/lwpgrfobj.cxx +++ b/lotuswordpro/source/filter/lwpgrfobj.cxx @@ -459,7 +459,7 @@ void LwpGraphicObject::CreateGrafObject() // set scale and crop styles LwpAssociatedLayouts* pLayoutWithMe = GetLayoutsWithMe(); LwpFrameLayout* pMyFrameLayout = - static_cast<LwpFrameLayout*>(pLayoutWithMe->GetOnlyLayout()->obj(VO_FRAMELAYOUT)); + static_cast<LwpFrameLayout*>(pLayoutWithMe->GetOnlyLayout()->obj(VO_FRAMELAYOUT).get()); if (pMyFrameLayout) { LwpLayoutScale* pMyScale = pMyFrameLayout->GetLayoutScale(); diff --git a/lotuswordpro/source/filter/lwpholder.hxx b/lotuswordpro/source/filter/lwpholder.hxx index 8e0f94bd8599..6f52ffc4c203 100644 --- a/lotuswordpro/source/filter/lwpholder.hxx +++ b/lotuswordpro/source/filter/lwpholder.hxx @@ -75,10 +75,11 @@ class LwpDLVListHeadHolder : public LwpObject { public: LwpDLVListHeadHolder(LwpObjectHeader& objHdr, LwpSvStream* pStrm); - virtual ~LwpDLVListHeadHolder(){} void Read() SAL_OVERRIDE; LwpObjectID* GetHeadID() { return &m_DLVHead;} private: + virtual ~LwpDLVListHeadHolder(){} + LwpObjectID m_DLVHead; }; /** @@ -89,12 +90,13 @@ class LwpDLVListHeadTailHolder : public LwpObject { public: LwpDLVListHeadTailHolder(LwpObjectHeader& objHdr, LwpSvStream* pStrm); - virtual ~LwpDLVListHeadTailHolder(){} void Read() SAL_OVERRIDE; LwpObjectID* GetHead(){ return m_HeadTail.GetHead();} LwpObjectID* GetTail(){ return m_HeadTail.GetTail();} protected: LwpDLVListHeadTail m_HeadTail; +private: + virtual ~LwpDLVListHeadTailHolder(){} }; /** * @brief LwpObjectHolder, which is LwpDLVList, contains an id to an object @@ -104,10 +106,11 @@ class LwpObjectHolder : public LwpDLVList { public: LwpObjectHolder(LwpObjectHeader& objHdr, LwpSvStream* pStrm); - virtual ~LwpObjectHolder(){} void Read() SAL_OVERRIDE; LwpObjectID* GetObject(){return &m_Object;} protected: + virtual ~LwpObjectHolder(){} + LwpObjectID m_Object; }; @@ -119,12 +122,13 @@ class LwpListList : public LwpObjectHolder { public: LwpListList(LwpObjectHeader& objHdr, LwpSvStream* pStrm); - virtual ~LwpListList(){} void Read() SAL_OVERRIDE; LwpObjectID* GetHead(){ return m_HeadTail.GetHead();} LwpObjectID* GetTail(){ return m_HeadTail.GetTail();} protected: LwpDLVListHeadTail m_HeadTail; +private: + virtual ~LwpListList(){} }; #endif diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx index 141cf1f2ef47..800b6a411c12 100644 --- a/lotuswordpro/source/filter/lwplayout.cxx +++ b/lotuswordpro/source/filter/lwplayout.cxx @@ -143,7 +143,7 @@ bool LwpVirtualLayout::HonorProtection() if(!(m_nAttributes2 & STYLE2_HONORPROTECTION)) return false; - LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent()->obj()); + LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent()->obj().get()); if(pParent && !pParent->IsHeader()) { return pParent->HonorProtection(); @@ -171,7 +171,7 @@ bool LwpVirtualLayout::IsProtected() { bool bProtected = (m_nAttributes & STYLE_PROTECTED)!=0; - LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent()->obj()); + LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent()->obj().get()); if(pParent && !pParent->IsHeader()) { if(pParent->HonorProtection()&&(pParent->HasProtection()||bProtected)) @@ -203,7 +203,7 @@ bool LwpVirtualLayout::HasProtection() if(m_nAttributes & STYLE_PROTECTED) return true; - LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent()->obj()); + LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent()->obj().get()); if(pParent && !pParent->IsHeader()) { return pParent->HasProtection(); @@ -234,7 +234,7 @@ LwpUseWhen* LwpVirtualLayout::GetUseWhen() if(GetLayoutType()!=LWP_PAGE_LAYOUT) { //get parent - LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent()->obj()); + LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent()->obj().get()); if(pParent && !pParent->IsHeader()&& (pParent->GetLayoutType()!=LWP_PAGE_LAYOUT)) return pParent->GetUseWhen(); @@ -346,7 +346,7 @@ bool LwpVirtualLayout::IsMinimumHeight() */ LwpVirtualLayout* LwpVirtualLayout::GetParentLayout() { - return dynamic_cast<LwpVirtualLayout*> (GetParent()->obj()); + return dynamic_cast<LwpVirtualLayout*> (GetParent()->obj().get()); } /** @@ -356,12 +356,12 @@ LwpVirtualLayout* LwpVirtualLayout::GetParentLayout() void LwpVirtualLayout::RegisterChildStyle() { //Register all children styles - LwpVirtualLayout* pLayout = dynamic_cast<LwpVirtualLayout*>(GetChildHead()->obj()); + LwpVirtualLayout* pLayout = dynamic_cast<LwpVirtualLayout*>(GetChildHead()->obj().get()); while(pLayout) { pLayout->SetFoundry(m_pFoundry); pLayout->RegisterStyle(); - pLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetNext()->obj()); + pLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetNext()->obj().get()); } } @@ -375,7 +375,7 @@ bool LwpVirtualLayout::IsStyleLayout() if (m_nAttributes3 & STYLE3_STYLELAYOUT) return true; - LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*>(GetParent()->obj()); + LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*>(GetParent()->obj().get()); if (pParent) return pParent->IsStyleLayout(); return false; @@ -391,7 +391,7 @@ LwpVirtualLayout* LwpVirtualLayout::FindChildByType(LWP_LAYOUT_TYPE eType) while(pID && !pID->IsNull()) { - LwpVirtualLayout * pLayout = dynamic_cast<LwpVirtualLayout *>(pID->obj()); + LwpVirtualLayout * pLayout = dynamic_cast<LwpVirtualLayout *>(pID->obj().get()); if(!pLayout) { break; @@ -451,30 +451,30 @@ LwpVirtualLayout* LwpAssociatedLayouts::GetLayout(LwpVirtualLayout *pStartLayout if (!pStartLayout && !m_OnlyLayout.IsNull()) /* Looking for the first layout and there's only one layout in the list.*/ - return dynamic_cast<LwpVirtualLayout*>(m_OnlyLayout.obj()); + return dynamic_cast<LwpVirtualLayout*>(m_OnlyLayout.obj().get()); - LwpObjectHolder* pObjHolder = dynamic_cast<LwpObjectHolder*>(m_Layouts.GetHead()->obj()); + LwpObjectHolder* pObjHolder = dynamic_cast<LwpObjectHolder*>(m_Layouts.GetHead()->obj().get()); if(pObjHolder) { - pLayout = dynamic_cast<LwpVirtualLayout*>(pObjHolder->GetObject()->obj()); + pLayout = dynamic_cast<LwpVirtualLayout*>(pObjHolder->GetObject()->obj().get()); if(!pStartLayout ) return pLayout; while(pObjHolder && pStartLayout != pLayout) { - pObjHolder = dynamic_cast<LwpObjectHolder*>(pObjHolder->GetNext()->obj()); + pObjHolder = dynamic_cast<LwpObjectHolder*>(pObjHolder->GetNext()->obj().get()); if(pObjHolder) { - pLayout = dynamic_cast<LwpVirtualLayout*>(pObjHolder->GetObject()->obj()); + pLayout = dynamic_cast<LwpVirtualLayout*>(pObjHolder->GetObject()->obj().get()); } } if(pObjHolder) { - pObjHolder = dynamic_cast<LwpObjectHolder*>(pObjHolder->GetNext()->obj()); + pObjHolder = dynamic_cast<LwpObjectHolder*>(pObjHolder->GetNext()->obj().get()); if(pObjHolder) { - pLayout = dynamic_cast<LwpVirtualLayout*>(pObjHolder->GetObject()->obj()); + pLayout = dynamic_cast<LwpVirtualLayout*>(pObjHolder->GetObject()->obj().get()); return pLayout; } } @@ -501,7 +501,7 @@ void LwpHeadLayout::Read() void LwpHeadLayout::RegisterStyle() { //Register all children styles - LwpVirtualLayout* pLayout = dynamic_cast<LwpVirtualLayout*>(GetChildHead()->obj()); + LwpVirtualLayout* pLayout = dynamic_cast<LwpVirtualLayout*>(GetChildHead()->obj().get()); while(pLayout) { pLayout->SetFoundry(m_pFoundry); @@ -515,7 +515,7 @@ void LwpHeadLayout::RegisterStyle() } pLayout->RegisterStyle(); } - LwpVirtualLayout *pNext = dynamic_cast<LwpVirtualLayout*>(pLayout->GetNext()->obj()); + LwpVirtualLayout *pNext = dynamic_cast<LwpVirtualLayout*>(pLayout->GetNext()->obj().get()); if (pNext == pLayout) { OSL_FAIL("Layout points to itself"); @@ -531,14 +531,14 @@ void LwpHeadLayout::RegisterStyle() */ LwpVirtualLayout* LwpHeadLayout::FindEnSuperTableLayout() { - LwpVirtualLayout* pLayout = dynamic_cast<LwpVirtualLayout*>(GetChildHead()->obj()); + LwpVirtualLayout* pLayout = dynamic_cast<LwpVirtualLayout*>(GetChildHead()->obj().get()); while(pLayout) { if(pLayout->GetLayoutType() == LWP_ENDNOTE_SUPERTABLE_LAYOUT) { return pLayout; } - pLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetNext()->obj()); + pLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetNext()->obj().get()); } return NULL; } @@ -660,11 +660,11 @@ LwpLayoutGeometry* LwpMiddleLayout::GetGeometry() { if( !m_LayGeometry.IsNull() ) { - return ( dynamic_cast<LwpLayoutGeometry*> (m_LayGeometry.obj()) ); + return ( dynamic_cast<LwpLayoutGeometry*> (m_LayGeometry.obj().get()) ); } else if( !m_BasedOnStyle.IsNull() ) { - LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj() ); + LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj().get() ); return pLay ? pLay->GetGeometry() : NULL; } return NULL; @@ -712,7 +712,7 @@ bool LwpMiddleLayout::MarginsSameAsParent() } if(!m_BasedOnStyle.IsNull()) { - LwpVirtualLayout* pLay = dynamic_cast<LwpVirtualLayout*> (m_BasedOnStyle.obj()); + LwpVirtualLayout* pLay = dynamic_cast<LwpVirtualLayout*> (m_BasedOnStyle.obj().get()); if (pLay) pLay->MarginsSameAsParent(); } @@ -731,7 +731,7 @@ double LwpMiddleLayout::GetMarginsValue(const sal_uInt8 &nWhichSide) { if ( MarginsSameAsParent() ) { - LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent()->obj()); + LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent()->obj().get()); if(pParent && !pParent->IsHeader()) { fValue = pParent->GetMarginsValue(nWhichSide); @@ -742,14 +742,14 @@ double LwpMiddleLayout::GetMarginsValue(const sal_uInt8 &nWhichSide) if(m_nOverrideFlag & OVER_MARGINS) { - LwpLayoutMargins* pMar1 = dynamic_cast<LwpLayoutMargins*> (m_LayMargins.obj()); + LwpLayoutMargins* pMar1 = dynamic_cast<LwpLayoutMargins*> (m_LayMargins.obj().get()); if(pMar1) { fValue = pMar1->GetMargins()->GetMarginsValue(nWhichSide); return fValue; } } - LwpVirtualLayout* pStyle = dynamic_cast<LwpVirtualLayout*> (m_BasedOnStyle.obj()); + LwpVirtualLayout* pStyle = dynamic_cast<LwpVirtualLayout*> (m_BasedOnStyle.obj().get()); if(pStyle) { fValue = pStyle->GetMarginsValue(nWhichSide); @@ -768,14 +768,14 @@ double LwpMiddleLayout::GetExtMarginsValue(const sal_uInt8 &nWhichSide) double fValue = 0; if(m_nOverrideFlag & OVER_MARGINS) { - LwpLayoutMargins* pMar1 = dynamic_cast<LwpLayoutMargins*> (m_LayMargins.obj()); + LwpLayoutMargins* pMar1 = dynamic_cast<LwpLayoutMargins*> (m_LayMargins.obj().get()); if(pMar1) { fValue = pMar1->GetExtMargins()->GetMarginsValue(nWhichSide); return fValue; } } - LwpVirtualLayout* pStyle = dynamic_cast<LwpVirtualLayout*> (m_BasedOnStyle.obj()); + LwpVirtualLayout* pStyle = dynamic_cast<LwpVirtualLayout*> (m_BasedOnStyle.obj().get()); if(pStyle) { fValue = pStyle->GetExtMarginsValue(nWhichSide); @@ -793,12 +793,12 @@ LwpBorderStuff* LwpMiddleLayout::GetBorderStuff() { if(m_nOverrideFlag & OVER_BORDERS) { - LwpLayoutBorder* pLayoutBorder = dynamic_cast<LwpLayoutBorder*>(m_LayBorderStuff.obj()); + LwpLayoutBorder* pLayoutBorder = dynamic_cast<LwpLayoutBorder*>(m_LayBorderStuff.obj().get()); return pLayoutBorder ? pLayoutBorder->GetBorderStuff() : NULL; } else if( !m_BasedOnStyle.IsNull() ) { - LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj() ); + LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj().get() ); return pLay ? pLay->GetBorderStuff() : NULL; } return NULL; @@ -814,12 +814,12 @@ LwpBackgroundStuff* LwpMiddleLayout::GetBackgroundStuff() { if(m_nOverrideFlag & OVER_BACKGROUND) { - LwpLayoutBackground* pLayoutBackground = dynamic_cast<LwpLayoutBackground*>(m_LayBackgroundStuff.obj()); + LwpLayoutBackground* pLayoutBackground = dynamic_cast<LwpLayoutBackground*>(m_LayBackgroundStuff.obj().get()); return pLayoutBackground ? pLayoutBackground->GetBackgoudStuff() : NULL; } else if( !m_BasedOnStyle.IsNull() ) { - LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj() ); + LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj().get() ); return pLay ? pLay->GetBackgroundStuff() : NULL; } return NULL; @@ -922,14 +922,14 @@ LwpTabOverride* LwpMiddleLayout::GetTabOverride() { if(!m_TabPiece.IsNull()) { - LwpTabPiece *pPiece = dynamic_cast<LwpTabPiece*>(m_TabPiece.obj()); + LwpTabPiece *pPiece = dynamic_cast<LwpTabPiece*>(m_TabPiece.obj().get()); return (LwpTabOverride*)(pPiece ? pPiece->GetOverride() : NULL); } return NULL; } else if( !m_BasedOnStyle.IsNull() ) { - LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj() ); + LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj().get() ); return pLay ? pLay->GetTabOverride() : NULL; } return NULL; @@ -943,62 +943,62 @@ LwpTabOverride* LwpMiddleLayout::GetTabOverride() */ sal_uInt16 LwpMiddleLayout::GetScaleMode(void) { - if ((m_nOverrideFlag & OVER_SCALING) && m_LayScale.obj()) + if ((m_nOverrideFlag & OVER_SCALING) && m_LayScale.obj().is()) return GetLayoutScale()->GetScaleMode(); - else if (m_BasedOnStyle.obj()) - return dynamic_cast<LwpMiddleLayout*>(m_BasedOnStyle.obj())->GetScaleMode(); + else if (m_BasedOnStyle.obj().is()) + return dynamic_cast<LwpMiddleLayout*>(m_BasedOnStyle.obj().get())->GetScaleMode(); else return (LwpLayoutScale::FIT_IN_FRAME | LwpLayoutScale::MAINTAIN_ASPECT_RATIO); } sal_uInt16 LwpMiddleLayout::GetScaleTile(void) { - if ((m_nOverrideFlag & OVER_SCALING) && m_LayScale.obj()) + if ((m_nOverrideFlag & OVER_SCALING) && m_LayScale.obj().is()) return (GetLayoutScale()->GetPlacement() & LwpLayoutScale::TILED) ? 1 : 0; - else if (m_BasedOnStyle.obj()) - return dynamic_cast<LwpMiddleLayout*>(m_BasedOnStyle.obj())->GetScaleTile(); + else if (m_BasedOnStyle.obj().is()) + return dynamic_cast<LwpMiddleLayout*>(m_BasedOnStyle.obj().get())->GetScaleTile(); else return 0; } sal_uInt16 LwpMiddleLayout::GetScaleCenter(void) { - if ((m_nOverrideFlag & OVER_SCALING) && m_LayScale.obj()) + if ((m_nOverrideFlag & OVER_SCALING) && m_LayScale.obj().is()) return (GetLayoutScale()->GetPlacement() & LwpLayoutScale::CENTERED) ? 1 : 0; - else if (m_BasedOnStyle.obj()) - return dynamic_cast<LwpMiddleLayout*>(m_BasedOnStyle.obj())->GetScaleCenter(); + else if (m_BasedOnStyle.obj().is()) + return dynamic_cast<LwpMiddleLayout*>(m_BasedOnStyle.obj().get())->GetScaleCenter(); else return 0; } sal_uInt32 LwpMiddleLayout::GetScalePercentage(void) { - if ((m_nOverrideFlag & OVER_SCALING) && m_LayScale.obj()) + if ((m_nOverrideFlag & OVER_SCALING) && m_LayScale.obj().is()) return GetLayoutScale()->GetScalePercentage()/10;//m_nScalePercentage 1000 = 100% - else if (m_BasedOnStyle.obj()) - return dynamic_cast<LwpMiddleLayout*>(m_BasedOnStyle.obj())->GetScalePercentage(); + else if (m_BasedOnStyle.obj().is()) + return dynamic_cast<LwpMiddleLayout*>(m_BasedOnStyle.obj().get())->GetScalePercentage(); else return 100; } double LwpMiddleLayout::GetScaleWidth(void) { - if ((m_nOverrideFlag & OVER_SCALING) && m_LayScale.obj()) + if ((m_nOverrideFlag & OVER_SCALING) && m_LayScale.obj().is()) return LwpTools::ConvertFromUnits(GetLayoutScale()->GetScaleWidth()); - else if (m_BasedOnStyle.obj()) - return dynamic_cast<LwpMiddleLayout*>(m_BasedOnStyle.obj())->GetScaleWidth(); + else if (m_BasedOnStyle.obj().is()) + return dynamic_cast<LwpMiddleLayout*>(m_BasedOnStyle.obj().get())->GetScaleWidth(); else return 0; } double LwpMiddleLayout::GetScaleHeight(void) { - if ((m_nOverrideFlag & OVER_SCALING) && m_LayScale.obj()) + if ((m_nOverrideFlag & OVER_SCALING) && m_LayScale.obj().is()) return LwpTools::ConvertFromUnits(GetLayoutScale()->GetScaleHeight()); - else if (m_BasedOnStyle.obj()) - return dynamic_cast<LwpMiddleLayout*>(m_BasedOnStyle.obj())->GetScaleHeight(); + else if (m_BasedOnStyle.obj().is()) + return dynamic_cast<LwpMiddleLayout*>(m_BasedOnStyle.obj().get())->GetScaleHeight(); else return 0; } @@ -1053,9 +1053,9 @@ bool LwpMiddleLayout::IsSizeRightToContainer(void) << SHIFT_RIGHT)) == ((LAY_USEDIRECTION | LAY_TOCONTAINER | LAY_AUTOSIZE) << SHIFT_RIGHT); } - else if (m_BasedOnStyle.obj()) + else if (m_BasedOnStyle.obj().is()) { - LwpMiddleLayout * pLayout = dynamic_cast<LwpMiddleLayout *>(m_BasedOnStyle.obj()); + LwpMiddleLayout * pLayout = dynamic_cast<LwpMiddleLayout *>(m_BasedOnStyle.obj().get()); return pLayout ? pLayout->IsSizeRightToContainer() : sal_False; } else @@ -1072,9 +1072,9 @@ bool LwpMiddleLayout::IsSizeRightToContent(void) << SHIFT_RIGHT)) == ((LAY_USEDIRECTION | LAY_AUTOSIZE) << SHIFT_RIGHT); } - else if (m_BasedOnStyle.obj()) + else if (m_BasedOnStyle.obj().is()) { - LwpMiddleLayout * pLayout = dynamic_cast<LwpMiddleLayout *>(m_BasedOnStyle.obj()); + LwpMiddleLayout * pLayout = dynamic_cast<LwpMiddleLayout *>(m_BasedOnStyle.obj().get()); return pLayout ? pLayout->IsSizeRightToContent() : sal_False; } else @@ -1167,7 +1167,7 @@ bool LwpMiddleLayout::IsAutoGrow() } else if( !m_BasedOnStyle.IsNull() ) { - LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj() ); + LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj().get() ); return pLay ? pLay->IsAutoGrow() : sal_False; } return LwpVirtualLayout::IsAutoGrow(); @@ -1185,7 +1185,7 @@ bool LwpMiddleLayout::IsAutoGrowDown() } else if( !m_BasedOnStyle.IsNull() ) { - LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj() ); + LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj().get() ); return pLay ? pLay->IsAutoGrowDown() : sal_False; } return LwpVirtualLayout::IsAutoGrowDown(); @@ -1203,7 +1203,7 @@ bool LwpMiddleLayout::IsAutoGrowUp() } else if( !m_BasedOnStyle.IsNull() ) { - LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj() ); + LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj().get() ); return pLay ? pLay->IsAutoGrowUp() : sal_False; } return LwpVirtualLayout::IsAutoGrowUp(); @@ -1221,7 +1221,7 @@ bool LwpMiddleLayout::IsAutoGrowLeft() } else if( !m_BasedOnStyle.IsNull() ) { - LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj() ); + LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj().get() ); if (pLay) return pLay->IsAutoGrowLeft(); } @@ -1240,7 +1240,7 @@ bool LwpMiddleLayout::IsAutoGrowRight() } else if( !m_BasedOnStyle.IsNull() ) { - LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj() ); + LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj().get() ); return pLay ? pLay->IsAutoGrowRight() : sal_False; } return LwpVirtualLayout::IsAutoGrowRight(); @@ -1255,13 +1255,13 @@ sal_uInt8 LwpMiddleLayout::GetContentOrientation() //content orientation in Graphic objects and OLE objects not supported now if((m_nOverrideFlag & OVER_ROTATION)&& !m_LayGeometry.IsNull()) { - LwpLayoutGeometry* pLayGeometry = dynamic_cast<LwpLayoutGeometry*> (m_LayGeometry.obj()); + LwpLayoutGeometry* pLayGeometry = dynamic_cast<LwpLayoutGeometry*> (m_LayGeometry.obj().get()); if (pLayGeometry) return pLayGeometry->GetContentOrientation(); } else if( !m_BasedOnStyle.IsNull() ) { - LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj() ); + LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj().get() ); if (pLay) return pLay->GetContentOrientation(); } @@ -1279,7 +1279,7 @@ bool LwpMiddleLayout::HonorProtection() if(!(m_nAttributes2 & STYLE2_HONORPROTECTION)) return false; - LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent()->obj()); + LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent()->obj().get()); if(pParent && !pParent->IsHeader()) { return pParent->HonorProtection(); @@ -1296,7 +1296,7 @@ bool LwpMiddleLayout::HonorProtection() } else if( !m_BasedOnStyle.IsNull() ) { - LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj() ); + LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj().get() ); if (pLay) return pLay->HonorProtection(); } @@ -1317,13 +1317,13 @@ bool LwpMiddleLayout::IsProtected() } else if( !m_BasedOnStyle.IsNull() ) { - LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj() ); + LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj().get() ); bProtected = pLay ? pLay->IsProtected() : sal_False; } else bProtected = LwpVirtualLayout::IsProtected(); - LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent()->obj()); + LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent()->obj().get()); if(pParent && !pParent->IsHeader()) { /* If a parent's protected then none of its children can be accessed. */ @@ -1359,14 +1359,14 @@ bool LwpMiddleLayout::IsProtected() */ LwpVirtualLayout* LwpMiddleLayout::GetWaterMarkLayout() { - LwpVirtualLayout* pLay = dynamic_cast<LwpVirtualLayout*>(GetChildHead()->obj()); + LwpVirtualLayout* pLay = dynamic_cast<LwpVirtualLayout*>(GetChildHead()->obj().get()); while(pLay) { if( pLay->IsForWaterMark()) { return pLay; } - pLay = dynamic_cast<LwpVirtualLayout*> (pLay->GetNext()->obj()); + pLay = dynamic_cast<LwpVirtualLayout*> (pLay->GetNext()->obj().get()); } return NULL; } @@ -1381,7 +1381,7 @@ XFBGImage* LwpMiddleLayout::GetXFBGImage() if(pLay) { //test BGImage - LwpGraphicObject* pGrfObj = dynamic_cast<LwpGraphicObject*>(pLay->GetContent()->obj()); + LwpGraphicObject* pGrfObj = dynamic_cast<LwpGraphicObject*>(pLay->GetContent()->obj().get()); if(pGrfObj) { XFBGImage* pXFBGImage = new XFBGImage(); @@ -1443,7 +1443,7 @@ bool LwpMiddleLayout::GetUsePrinterSettings() } else if( !m_BasedOnStyle.IsNull() ) { - LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj() ); + LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj().get() ); return pLay ? pLay->GetUsePrinterSettings() : sal_False; } return false; @@ -1452,8 +1452,8 @@ bool LwpMiddleLayout::GetUsePrinterSettings() //Check whether there are contents in the layout bool LwpMiddleLayout::HasContent() { - LwpObject* content = m_Content.obj(); - if(content) + rtl::Reference<LwpObject> content = m_Content.obj(); + if(content.is()) return true; return false; } @@ -1514,14 +1514,14 @@ sal_uInt16 LwpLayout::GetNumCols() { if(m_nOverrideFlag & OVER_COLUMNS) { - LwpLayoutColumns* pLayColumns = dynamic_cast<LwpLayoutColumns*>(m_LayColumns.obj()); + LwpLayoutColumns* pLayColumns = dynamic_cast<LwpLayoutColumns*>(m_LayColumns.obj().get()); if(pLayColumns) { return pLayColumns->GetNumCols(); } } - LwpVirtualLayout* pStyle = dynamic_cast<LwpVirtualLayout*> (m_BasedOnStyle.obj()); + LwpVirtualLayout* pStyle = dynamic_cast<LwpVirtualLayout*> (m_BasedOnStyle.obj().get()); if(pStyle) { return pStyle->GetNumCols(); @@ -1539,14 +1539,14 @@ double LwpLayout::GetColWidth(sal_uInt16 nIndex) { if((m_nOverrideFlag & OVER_COLUMNS)||(m_nAttributes2 & STYLE2_LOCALCOLUMNINFO)) { - LwpLayoutColumns* pLayColumns = dynamic_cast<LwpLayoutColumns*>(m_LayColumns.obj()); + LwpLayoutColumns* pLayColumns = dynamic_cast<LwpLayoutColumns*>(m_LayColumns.obj().get()); if(pLayColumns) { return pLayColumns->GetColWidth(nIndex); } } - LwpVirtualLayout* pStyle = dynamic_cast<LwpVirtualLayout*> (m_BasedOnStyle.obj()); + LwpVirtualLayout* pStyle = dynamic_cast<LwpVirtualLayout*> (m_BasedOnStyle.obj().get()); if(pStyle) { return pStyle->GetColWidth(nIndex); @@ -1564,14 +1564,14 @@ double LwpLayout::GetColGap(sal_uInt16 nIndex) { if((m_nOverrideFlag & OVER_COLUMNS)||(m_nAttributes2 & STYLE2_LOCALCOLUMNINFO)) { - LwpLayoutColumns* pLayColumns = dynamic_cast<LwpLayoutColumns*>(m_LayColumns.obj()); + LwpLayoutColumns* pLayColumns = dynamic_cast<LwpLayoutColumns*>(m_LayColumns.obj().get()); if(pLayColumns) { return pLayColumns->GetColGap(nIndex); } } - LwpVirtualLayout* pStyle = dynamic_cast<LwpVirtualLayout*> (m_BasedOnStyle.obj()); + LwpVirtualLayout* pStyle = dynamic_cast<LwpVirtualLayout*> (m_BasedOnStyle.obj().get()); if(pStyle) { return pStyle->GetColGap(nIndex); @@ -1640,7 +1640,7 @@ XFColumnSep* LwpLayout::GetColumnSep() { //Get LwpLayoutGutters - LwpLayoutGutters* pLayoutGutters = dynamic_cast<LwpLayoutGutters*>(m_LayGutterStuff.obj()); + LwpLayoutGutters* pLayoutGutters = dynamic_cast<LwpLayoutGutters*>(m_LayGutterStuff.obj().get()); if(!pLayoutGutters) { return NULL; @@ -1723,7 +1723,7 @@ sal_uInt16 LwpLayout::GetUsePage() } else if( !m_BasedOnStyle.IsNull() ) { - LwpLayout* pLay = dynamic_cast<LwpLayout*> ( m_BasedOnStyle.obj() ); + LwpLayout* pLay = dynamic_cast<LwpLayout*> ( m_BasedOnStyle.obj().get() ); return pLay ? pLay->GetUsePage() : 0; } return 0; @@ -1741,7 +1741,7 @@ LwpUseWhen* LwpLayout::VirtualGetUseWhen() } else if( !m_BasedOnStyle.IsNull() ) { - LwpLayout* pLay = dynamic_cast<LwpLayout*> ( m_BasedOnStyle.obj() ); + LwpLayout* pLay = dynamic_cast<LwpLayout*> ( m_BasedOnStyle.obj().get() ); return pLay ? pLay->VirtualGetUseWhen() : NULL; } return LwpVirtualLayout::VirtualGetUseWhen(); @@ -1763,7 +1763,7 @@ bool LwpLayout::IsUseOnAllPages() } else if( !m_BasedOnStyle.IsNull() ) { - LwpLayout* pLay = dynamic_cast<LwpLayout*> ( m_BasedOnStyle.obj() ); + LwpLayout* pLay = dynamic_cast<LwpLayout*> ( m_BasedOnStyle.obj().get() ); if (pLay) return pLay->IsUseOnAllPages(); } @@ -1786,7 +1786,7 @@ bool LwpLayout::IsUseOnAllEvenPages() } else if( !m_BasedOnStyle.IsNull() ) { - LwpLayout* pLay = dynamic_cast<LwpLayout*> ( m_BasedOnStyle.obj() ); + LwpLayout* pLay = dynamic_cast<LwpLayout*> ( m_BasedOnStyle.obj().get() ); if (pLay) return pLay->IsUseOnAllEvenPages(); } @@ -1809,7 +1809,7 @@ bool LwpLayout::IsUseOnAllOddPages() } else if( !m_BasedOnStyle.IsNull() ) { - LwpLayout* pLay = dynamic_cast<LwpLayout*> ( m_BasedOnStyle.obj() ); + LwpLayout* pLay = dynamic_cast<LwpLayout*> ( m_BasedOnStyle.obj().get() ); if (pLay) return pLay->IsUseOnAllOddPages(); } @@ -1832,7 +1832,7 @@ bool LwpLayout::IsUseOnPage() } else if( !m_BasedOnStyle.IsNull() ) { - LwpLayout* pLay = dynamic_cast<LwpLayout*> ( m_BasedOnStyle.obj() ); + LwpLayout* pLay = dynamic_cast<LwpLayout*> ( m_BasedOnStyle.obj().get() ); if (pLay) return pLay->IsUseOnPage(); } @@ -1849,12 +1849,12 @@ LwpShadow* LwpLayout::GetShadow() { if(m_nOverrideFlag & OVER_SHADOW) { - LwpLayoutShadow* pLayoutShadow = dynamic_cast<LwpLayoutShadow*>(m_LayShadow.obj()); + LwpLayoutShadow* pLayoutShadow = dynamic_cast<LwpLayoutShadow*>(m_LayShadow.obj().get()); return pLayoutShadow ? pLayoutShadow->GetShadow() : NULL; } else if( !m_BasedOnStyle.IsNull() ) { - LwpLayout* pLay = dynamic_cast<LwpLayout*> ( m_BasedOnStyle.obj() ); + LwpLayout* pLay = dynamic_cast<LwpLayout*> ( m_BasedOnStyle.obj().get() ); return pLay ? pLay->GetShadow() : NULL; } return NULL; @@ -1923,7 +1923,7 @@ LwpVirtualLayout* LwpLayout::GetContainerLayout() if(IsRelativeAnchored()) { //get position - LwpPara* pPara = dynamic_cast<LwpPara*>(GetPosition()->obj()); + LwpPara* pPara = dynamic_cast<LwpPara*>(GetPosition()->obj().get()); if(pPara) { LwpStory* pStory = pPara->GetStory(); @@ -2001,7 +2001,7 @@ sal_uInt8 LwpPlacableLayout::GetWrapType() } else if( !m_BasedOnStyle.IsNull() ) { - LwpPlacableLayout* pLay = dynamic_cast<LwpPlacableLayout*> ( m_BasedOnStyle.obj() ); + LwpPlacableLayout* pLay = dynamic_cast<LwpPlacableLayout*> ( m_BasedOnStyle.obj().get() ); if (pLay) return pLay->GetWrapType(); } @@ -2019,12 +2019,12 @@ LwpLayoutRelativity* LwpPlacableLayout::GetRelativityPiece() { if(m_nOverrideFlag & OVER_PLACEMENT) { - return dynamic_cast<LwpLayoutRelativity*>(m_LayRelativity.obj()); + return dynamic_cast<LwpLayoutRelativity*>(m_LayRelativity.obj().get()); } } else if( !m_BasedOnStyle.IsNull() ) { - LwpPlacableLayout* pLay = dynamic_cast<LwpPlacableLayout*> ( m_BasedOnStyle.obj() ); + LwpPlacableLayout* pLay = dynamic_cast<LwpPlacableLayout*> ( m_BasedOnStyle.obj().get() ); return pLay ? pLay->GetRelativityPiece() : NULL; } return NULL; @@ -2066,7 +2066,7 @@ sal_Int32 LwpPlacableLayout::GetBaseLineOffset() } else if( !m_BasedOnStyle.IsNull() ) { - LwpPlacableLayout* pLay = dynamic_cast<LwpPlacableLayout*> ( m_BasedOnStyle.obj() ); + LwpPlacableLayout* pLay = dynamic_cast<LwpPlacableLayout*> ( m_BasedOnStyle.obj().get() ); return pLay ? pLay->GetBaseLineOffset() : 0; } return 0; diff --git a/lotuswordpro/source/filter/lwplayout.hxx b/lotuswordpro/source/filter/lwplayout.hxx index 073031cca84b..525e9dde8bd8 100644 --- a/lotuswordpro/source/filter/lwplayout.hxx +++ b/lotuswordpro/source/filter/lwplayout.hxx @@ -301,7 +301,7 @@ public: XFBGImage* GetXFBGImage(); virtual bool GetUsePrinterSettings(); - LwpLayoutScale* GetLayoutScale(){return dynamic_cast<LwpLayoutScale*>(m_LayScale.obj());} + LwpLayoutScale* GetLayoutScale(){return dynamic_cast<LwpLayoutScale*>(m_LayScale.obj().get());} sal_uInt16 GetScaleMode(void); sal_uInt16 GetScaleTile(void); sal_uInt16 GetScaleCenter(void); diff --git a/lotuswordpro/source/filter/lwplaypiece.hxx b/lotuswordpro/source/filter/lwplaypiece.hxx index 8f53dd80c157..fbecee1c3f4f 100644 --- a/lotuswordpro/source/filter/lwplaypiece.hxx +++ b/lotuswordpro/source/filter/lwplaypiece.hxx @@ -81,7 +81,6 @@ class LwpLayoutGeometry : public LwpVirtualPiece { public: LwpLayoutGeometry(LwpObjectHeader& objHdr, LwpSvStream* pStrm); - virtual ~LwpLayoutGeometry(); virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; sal_Int32 GetWidth() { return m_nWidth; } sal_Int32 GetHeight() { return m_nHeight; } @@ -98,6 +97,8 @@ protected: LwpPoint m_AbsoluteOrigin; LwpRotor m_ContainerRotor; sal_uInt8 m_ContentOrientation; +private: + virtual ~LwpLayoutGeometry(); }; class LwpLayoutScale : public LwpVirtualPiece @@ -108,7 +109,6 @@ public: enum {CENTERED = 1, TILED = 2}; LwpLayoutScale(LwpObjectHeader& objHdr, LwpSvStream* pStrm); - virtual ~LwpLayoutScale(); virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; sal_uInt16 GetScaleMode(){return m_nScaleMode;} sal_uInt32 GetScalePercentage(){return m_nScalePercentage;} @@ -132,6 +132,8 @@ protected: sal_uInt16 m_nContentRotation; LwpPoint m_Offset; sal_uInt16 m_nPlacement; +private: + virtual ~LwpLayoutScale(); }; #include "lwpmargins.hxx" @@ -140,7 +142,6 @@ class LwpLayoutMargins : public LwpVirtualPiece { public: LwpLayoutMargins(LwpObjectHeader& objHdr, LwpSvStream* pStrm); - virtual ~LwpLayoutMargins(); virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; LwpMargins* GetMargins() { return &m_Margins; } LwpMargins* GetExtMargins(){ return &m_ExtMargins;} @@ -150,6 +151,8 @@ protected: LwpMargins m_Margins; LwpMargins m_ExtMargins; LwpMargins m_ExtraMargins; +private: + virtual ~LwpLayoutMargins(); }; #include "lwpborderstuff.hxx" @@ -157,26 +160,28 @@ class LwpLayoutBorder : public LwpVirtualPiece { public: LwpLayoutBorder(LwpObjectHeader& objHdr, LwpSvStream* pStrm); - virtual ~LwpLayoutBorder(); virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; LwpBorderStuff* GetBorderStuff(){ return &m_BorderStuff;} protected: virtual void Read() SAL_OVERRIDE; protected: LwpBorderStuff m_BorderStuff; +private: + virtual ~LwpLayoutBorder(); }; class LwpLayoutBackground : public LwpVirtualPiece { public: LwpLayoutBackground(LwpObjectHeader& objHdr, LwpSvStream* pStrm); - virtual ~LwpLayoutBackground(); virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; LwpBackgroundStuff* GetBackgoudStuff(){return &m_BackgroundStuff;} protected: virtual void Read() SAL_OVERRIDE; protected: LwpBackgroundStuff m_BackgroundStuff; +private: + virtual ~LwpLayoutBackground(); }; class LwpExternalBorder @@ -197,12 +202,13 @@ class LwpLayoutExternalBorder : public LwpVirtualPiece { public: LwpLayoutExternalBorder(LwpObjectHeader& objHdr, LwpSvStream* pStrm); - virtual ~LwpLayoutExternalBorder(); virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; protected: virtual void Read() SAL_OVERRIDE; protected: LwpExternalBorder m_ExtranalBorder; +private: + virtual ~LwpLayoutExternalBorder(); }; class LwpColumnInfo @@ -224,7 +230,6 @@ class LwpLayoutColumns : public LwpVirtualPiece { public: LwpLayoutColumns(LwpObjectHeader& objHdr, LwpSvStream* pStrm); - virtual ~LwpLayoutColumns(); virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; inline sal_uInt16 GetNumCols(){return m_nNumCols;} double GetColWidth(sal_uInt16 nIndex); @@ -234,19 +239,22 @@ protected: protected: sal_uInt16 m_nNumCols; LwpColumnInfo* m_pColumns; +private: + virtual ~LwpLayoutColumns(); }; class LwpLayoutGutters : public LwpVirtualPiece { public: LwpLayoutGutters(LwpObjectHeader& objHdr, LwpSvStream* pStrm); - virtual ~LwpLayoutGutters(); virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; inline virtual LwpBorderStuff* GetBorderStuff(){return &m_BorderBuffer;} protected: virtual void Read() SAL_OVERRIDE; protected: LwpBorderStuff m_BorderBuffer; +private: + virtual ~LwpLayoutGutters(); }; class LwpJoinStuff @@ -299,12 +307,13 @@ class LwpLayoutJoins : public LwpVirtualPiece { public: LwpLayoutJoins(LwpObjectHeader& objHdr, LwpSvStream* pStrm); - virtual ~LwpLayoutJoins(); virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; protected: virtual void Read() SAL_OVERRIDE; protected: LwpJoinStuff m_JoinStuff; +private: + virtual ~LwpLayoutJoins(); }; #include "lwpshadow.hxx" @@ -313,13 +322,14 @@ class LwpLayoutShadow : public LwpVirtualPiece { public: LwpLayoutShadow(LwpObjectHeader& objHdr, LwpSvStream* pStrm); - virtual ~LwpLayoutShadow(); virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; LwpShadow* GetShadow(){return &m_Shadow;} protected: virtual void Read() SAL_OVERRIDE; protected: LwpShadow m_Shadow; +private: + virtual ~LwpLayoutShadow(); }; class LwpLayoutRelativityGuts @@ -373,13 +383,14 @@ class LwpLayoutRelativity: public LwpVirtualPiece { public: LwpLayoutRelativity(LwpObjectHeader& objHdr, LwpSvStream* pStrm); - virtual ~LwpLayoutRelativity(); virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; LwpLayoutRelativityGuts* GetRelGuts(){return &m_RelGuts;} protected: virtual void Read() SAL_OVERRIDE; protected: LwpLayoutRelativityGuts m_RelGuts; +private: + virtual ~LwpLayoutRelativity(); }; #endif diff --git a/lotuswordpro/source/filter/lwpmarker.cxx b/lotuswordpro/source/filter/lwpmarker.cxx index af334fd89d32..6ef0395bc935 100644 --- a/lotuswordpro/source/filter/lwpmarker.cxx +++ b/lotuswordpro/source/filter/lwpmarker.cxx @@ -146,8 +146,8 @@ void LwpCHBlkMarker::Read() OUString LwpCHBlkMarker::GetPromptText() { LwpStory* pStory = NULL; - if (m_objPromptStory.obj()) - pStory = dynamic_cast<LwpStory*>(m_objPromptStory.obj()); + if (m_objPromptStory.obj().is()) + pStory = dynamic_cast<LwpStory*>(m_objPromptStory.obj().get()); if (pStory) return pStory->GetContentText(); return OUString(""); diff --git a/lotuswordpro/source/filter/lwpnotes.cxx b/lotuswordpro/source/filter/lwpnotes.cxx index ccf959f19836..542943a0b22c 100644 --- a/lotuswordpro/source/filter/lwpnotes.cxx +++ b/lotuswordpro/source/filter/lwpnotes.cxx @@ -85,8 +85,8 @@ void LwpFribNote::Read(LwpObjectStream *pObjStrm, sal_uInt16 /*len*/) */ void LwpFribNote::RegisterNewStyle() { - LwpObject* pLayout = m_Layout.obj(); - if(pLayout) + rtl::Reference<LwpObject> pLayout = m_Layout.obj(); + if(pLayout.is()) { //register font style LwpFrib::RegisterStyle(m_pPara->GetFoundry()); @@ -101,7 +101,7 @@ void LwpFribNote::RegisterNewStyle() */ void LwpFribNote::XFConvert(XFContentContainer* pCont) { - LwpNoteLayout* pLayout =static_cast<LwpNoteLayout*>(m_Layout.obj()); + LwpNoteLayout* pLayout =static_cast<LwpNoteLayout*>(m_Layout.obj().get()); if(pLayout) { XFAnnotation* pXFNote = new XFAnnotation; @@ -217,10 +217,10 @@ OUString LwpNoteLayout::GetAuthor() LwpNoteHeaderLayout* pTextLayout = static_cast<LwpNoteHeaderLayout*>(FindChildByType(LWP_NOTEHEADER_LAYOUT)); if(pTextLayout) { - LwpStory* pStory = static_cast<LwpStory*>(pTextLayout->GetContent()->obj()); + LwpStory* pStory = static_cast<LwpStory*>(pTextLayout->GetContent()->obj().get()); if(pStory) { - LwpPara* pFirst = static_cast<LwpPara*>(pStory->GetFirstPara()->obj()); + LwpPara* pFirst = static_cast<LwpPara*>(pStory->GetFirstPara()->obj().get()); if(pFirst) return pFirst->GetContentText(true); } @@ -280,8 +280,8 @@ void LwpNoteTextLayout::Read() */ void LwpNoteTextLayout::RegisterStyle() { - LwpObject* pContent = m_Content.obj(); - if(pContent) + rtl::Reference<LwpObject> pContent = m_Content.obj(); + if(pContent.is()) { pContent->SetFoundry(GetFoundry()); pContent->RegisterStyle(); @@ -290,8 +290,8 @@ void LwpNoteTextLayout::RegisterStyle() void LwpNoteTextLayout::XFConvert(XFContentContainer * pCont) { - LwpObject* pContent = m_Content.obj(); - if(pContent) + rtl::Reference<LwpObject> pContent = m_Content.obj(); + if(pContent.is()) { pContent->XFConvert(pCont); } diff --git a/lotuswordpro/source/filter/lwpnumericfmt.hxx b/lotuswordpro/source/filter/lwpnumericfmt.hxx index dd8de77cf6b3..9b3a4d40d046 100644 --- a/lotuswordpro/source/filter/lwpnumericfmt.hxx +++ b/lotuswordpro/source/filter/lwpnumericfmt.hxx @@ -309,12 +309,14 @@ class LwpLayoutNumerics : public LwpVirtualPiece public: LwpLayoutNumerics(LwpObjectHeader& objHdr, LwpSvStream* pStrm) :LwpVirtualPiece(objHdr, pStrm),cNumerics(m_pObjStrm){} - virtual ~LwpLayoutNumerics(){} XFStyle* Convert(); virtual void Read() SAL_OVERRIDE; protected: LwpNumericFormat cNumerics; + +private: + virtual ~LwpLayoutNumerics(){} }; #endif diff --git a/lotuswordpro/source/filter/lwpobj.hxx b/lotuswordpro/source/filter/lwpobj.hxx index 559a909e7365..12b68d72deb7 100644 --- a/lotuswordpro/source/filter/lwpobj.hxx +++ b/lotuswordpro/source/filter/lwpobj.hxx @@ -65,6 +65,10 @@ #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPOBJ_HXX #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPOBJ_HXX +#include <sal/config.h> + +#include <salhelper/simplereferenceobject.hxx> + #include "lwpheader.hxx" #include "lwpobjhdr.hxx" @@ -77,14 +81,14 @@ class LwpFoundry; /** * @brief Base class of all Lwp VO objects */ -class LwpObject +class LwpObject: public salhelper::SimpleReferenceObject { private: LwpObject();//Don't permit to create an object without header public: LwpObject(LwpObjectHeader objHdr, LwpSvStream* pStrm); - virtual ~LwpObject(); protected: + virtual ~LwpObject(); LwpObjectHeader m_ObjHdr; LwpObjectStream* m_pObjStrm; LwpFoundry* m_pFoundry; diff --git a/lotuswordpro/source/filter/lwpobjfactory.cxx b/lotuswordpro/source/filter/lwpobjfactory.cxx index 1793a5f8e434..305024078376 100644 --- a/lotuswordpro/source/filter/lwpobjfactory.cxx +++ b/lotuswordpro/source/filter/lwpobjfactory.cxx @@ -118,13 +118,6 @@ LwpObjectFactory::~LwpObjectFactory() */ void LwpObjectFactory::ClearObjectMap() { - LwpIdToObjMap::iterator it = m_IdToObjList.begin(); - while( it!=m_IdToObjList.end() ) - { - delete it->second; - it->second = NULL; - ++it; - } m_IdToObjList.clear(); } /** @@ -138,9 +131,9 @@ void LwpObjectFactory::ReadIndex(LwpSvStream* pStrm) /** * @descr create all kinds of objects except lwp7 */ -LwpObject* LwpObjectFactory::CreateObject(sal_uInt32 type, LwpObjectHeader &objHdr) +rtl::Reference<LwpObject> LwpObjectFactory::CreateObject(sal_uInt32 type, LwpObjectHeader &objHdr) { - LwpObject* newObj = NULL; + rtl::Reference<LwpObject> newObj; m_nNumObjs++; assert(type<300); switch(type) @@ -678,7 +671,7 @@ LwpObject* LwpObjectFactory::CreateObject(sal_uInt32 type, LwpObjectHeader &objH break; } } - if(newObj) + if(newObj.is()) { newObj->QuickRead(); m_IdToObjList.insert(LwpIdToObjMap::value_type(*objHdr.GetID(), newObj)); @@ -690,10 +683,10 @@ LwpObject* LwpObjectFactory::CreateObject(sal_uInt32 type, LwpObjectHeader &objH * @descr query object by object id * object is created if not in the factory */ -LwpObject* LwpObjectFactory::QueryObject(const LwpObjectID &objID) +rtl::Reference<LwpObject> LwpObjectFactory::QueryObject(const LwpObjectID &objID) { - LwpObject* obj = FindObject( objID ); - if(!obj) + rtl::Reference<LwpObject> obj = FindObject( objID ); + if(!obj.is()) { //Read the object from file sal_uInt32 nStreamOffset = m_IndexMgr.GetObjOffset(objID); @@ -722,7 +715,7 @@ LwpObject* LwpObjectFactory::QueryObject(const LwpObjectID &objID) /** * @descr find object in the factory per the object id */ -LwpObject* LwpObjectFactory::FindObject(const LwpObjectID &objID) +rtl::Reference<LwpObject> LwpObjectFactory::FindObject(const LwpObjectID &objID) { LwpIdToObjMap::const_iterator it = m_IdToObjList.find(objID); if (it != m_IdToObjList.end()) { @@ -738,10 +731,7 @@ LwpObject* LwpObjectFactory::FindObject(const LwpObjectID &objID) */ void LwpObjectFactory::ReleaseObject(const LwpObjectID &objID) { - LwpObject* obj = FindObject( objID ); m_IdToObjList.erase(objID); - if( obj ) - delete obj; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/source/filter/lwpobjfactory.hxx b/lotuswordpro/source/filter/lwpobjfactory.hxx index ddfe1c38842b..7cbc56d118a6 100644 --- a/lotuswordpro/source/filter/lwpobjfactory.hxx +++ b/lotuswordpro/source/filter/lwpobjfactory.hxx @@ -65,6 +65,10 @@ #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPOBJFACTORY_HXX #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPOBJFACTORY_HXX +#include <sal/config.h> + +#include <rtl/ref.hxx> + #include "lwpheader.hxx" #include "lwpobjid.hxx" #include "lwpobj.hxx" @@ -101,16 +105,16 @@ private: return(rKey1==rKey2); } }; - typedef boost::unordered_map<LwpObjectID, LwpObject *, hashFunc, eqFunc> LwpIdToObjMap; + typedef boost::unordered_map<LwpObjectID, rtl::Reference<LwpObject>, hashFunc, eqFunc> LwpIdToObjMap; LwpIdToObjMap m_IdToObjList; LwpIndexManager m_IndexMgr; void ClearObjectMap(); protected: - LwpObject* FindObject(const LwpObjectID &objID); + rtl::Reference<LwpObject> FindObject(const LwpObjectID &objID); public: - LwpObject* CreateObject(sal_uInt32 type, LwpObjectHeader &objHdr); - LwpObject* QueryObject(const LwpObjectID &objID); + rtl::Reference<LwpObject> CreateObject(sal_uInt32 type, LwpObjectHeader &objHdr); + rtl::Reference<LwpObject> QueryObject(const LwpObjectID &objID); void ReleaseObject(const LwpObjectID &objID); void ReadIndex(LwpSvStream* pStrm); LwpIndexManager* GetIndexManager(){return &m_IndexMgr;} diff --git a/lotuswordpro/source/filter/lwpobjid.cxx b/lotuswordpro/source/filter/lwpobjid.cxx index 5fef7fbeaf14..9a2ea6715db8 100644 --- a/lotuswordpro/source/filter/lwpobjid.cxx +++ b/lotuswordpro/source/filter/lwpobjid.cxx @@ -192,7 +192,7 @@ sal_uInt32 LwpObjectID::DiskSize() const /** * @descr get object from object factory per the object id */ -LwpObject* LwpObjectID::obj(VO_TYPE tag) const +rtl::Reference<LwpObject> LwpObjectID::obj(VO_TYPE tag) const { LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance(); LwpObjectFactory* pObjMgr = pGlobal->GetLwpObjFactory(); @@ -200,12 +200,12 @@ LwpObject* LwpObjectID::obj(VO_TYPE tag) const { return NULL; } - LwpObject* pObj = pObjMgr->QueryObject(*this); - if( tag!=VO_INVALID && (pObj) ) + rtl::Reference<LwpObject> pObj = pObjMgr->QueryObject(*this); + if( tag!=VO_INVALID && (pObj.is()) ) { if(static_cast<sal_uInt32>(tag) != pObj->GetTag()) { - pObj=NULL; + pObj.clear(); } } return(pObj); diff --git a/lotuswordpro/source/filter/lwpobjid.hxx b/lotuswordpro/source/filter/lwpobjid.hxx index 35499b445333..bb0f29f0b714 100644 --- a/lotuswordpro/source/filter/lwpobjid.hxx +++ b/lotuswordpro/source/filter/lwpobjid.hxx @@ -65,6 +65,10 @@ #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPOBJID_HXX #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPOBJID_HXX +#include <sal/config.h> + +#include <rtl/ref.hxx> + #include "lwpheader.hxx" #include "lwpobjstrm.hxx" #include "lwpdefs.hxx" @@ -102,7 +106,7 @@ public: bool operator == (const LwpObjectID &Other) const; bool operator != (const LwpObjectID &Other) const; - LwpObject* obj(VO_TYPE tag=VO_INVALID) const; + rtl::Reference<LwpObject> obj(VO_TYPE tag=VO_INVALID) const; size_t HashCode() const; }; diff --git a/lotuswordpro/source/filter/lwppagehint.hxx b/lotuswordpro/source/filter/lwppagehint.hxx index 73e90c94974a..2d4f55b31f2f 100644 --- a/lotuswordpro/source/filter/lwppagehint.hxx +++ b/lotuswordpro/source/filter/lwppagehint.hxx @@ -100,7 +100,6 @@ class LwpPageHint : public LwpDLVList { public: LwpPageHint(LwpObjectHeader &objHdr, LwpSvStream* pStrm); - virtual ~LwpPageHint(){} void Read() SAL_OVERRIDE; void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; sal_uInt16 GetPageNumber(){return m_nPageNumber;} @@ -109,6 +108,7 @@ public: LwpObjectID* GetPageLayoutID(){ return &m_PageLayout;} sal_uInt16 GetLayoutPageNumber(){ return m_nLayoutPageNumber;} private: + virtual ~LwpPageHint(){} LwpObjectID m_PageLayout; LwpContentHintHead m_ContentHints; diff --git a/lotuswordpro/source/filter/lwppagelayout.cxx b/lotuswordpro/source/filter/lwppagelayout.cxx index ec388047bcdc..631a1ad033a6 100644 --- a/lotuswordpro/source/filter/lwppagelayout.cxx +++ b/lotuswordpro/source/filter/lwppagelayout.cxx @@ -123,8 +123,8 @@ void LwpPageLayout::Read() void LwpPageLayout::Parse(IXFStream* pOutputStream) { //Only parse this layout - LwpObject* pStory = m_Content.obj(); - if(pStory) + rtl::Reference<LwpObject> pStory = m_Content.obj(); + if(pStory.is()) { pStory->SetFoundry(m_pFoundry); pStory->Parse(pOutputStream); //Do not parse the next story @@ -272,7 +272,7 @@ void LwpPageLayout::ParseFootNoteSeparator(XFPageMaster * pm1) { LwpObjectID* pFontnodeId = pDocument->GetValidFootnoteOpts(); - LwpFootnoteOptions* pFootnoteOpts = pFontnodeId ? dynamic_cast<LwpFootnoteOptions*>(pFontnodeId->obj()) : NULL; + LwpFootnoteOptions* pFootnoteOpts = pFontnodeId ? dynamic_cast<LwpFootnoteOptions*>(pFontnodeId->obj().get()) : NULL; if(pFootnoteOpts) { LwpFootnoteSeparatorOptions* pFootnoteSep = pFootnoteOpts->GetFootnoteSeparator(); @@ -482,8 +482,8 @@ void LwpPageLayout::ConvertFillerPageText(XFContentContainer* pCont) { //get filerpage story from division info LwpDocument* pDoc = m_pFoundry->GetDocument(); - LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(pDoc->GetDivInfoID()->obj()); - LwpStory* pStory = dynamic_cast<LwpStory*>(pDivInfo->GetFillerPageTextID()->obj()); + LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(pDoc->GetDivInfoID()->obj().get()); + LwpStory* pStory = dynamic_cast<LwpStory*>(pDivInfo->GetFillerPageTextID()->obj().get()); //parse fillerpage story if(pStory) @@ -506,24 +506,24 @@ void LwpPageLayout::ResetXFColumns() LwpHeaderLayout* LwpPageLayout::GetHeaderLayout() { - LwpVirtualLayout* pLay = dynamic_cast<LwpVirtualLayout*>(GetChildHead()->obj()); + LwpVirtualLayout* pLay = dynamic_cast<LwpVirtualLayout*>(GetChildHead()->obj().get()); while(pLay) { if( pLay->GetLayoutType() == LWP_HEADER_LAYOUT ) return ( static_cast<LwpHeaderLayout*> (pLay) ); - pLay = dynamic_cast<LwpVirtualLayout*> (pLay->GetNext()->obj()); + pLay = dynamic_cast<LwpVirtualLayout*> (pLay->GetNext()->obj().get()); } return NULL; } LwpFooterLayout* LwpPageLayout::GetFooterLayout() { - LwpVirtualLayout* pLay = dynamic_cast<LwpVirtualLayout*>(GetChildHead()->obj()); + LwpVirtualLayout* pLay = dynamic_cast<LwpVirtualLayout*>(GetChildHead()->obj().get()); while(pLay) { if( pLay->GetLayoutType() == LWP_FOOTER_LAYOUT ) return ( static_cast<LwpFooterLayout*> (pLay) ); - pLay = dynamic_cast<LwpVirtualLayout*> (pLay->GetNext()->obj()); + pLay = dynamic_cast<LwpVirtualLayout*> (pLay->GetNext()->obj().get()); } return NULL; } @@ -536,7 +536,7 @@ LwpPageLayout* LwpPageLayout::GetOddChildLayout() { if(IsComplex()) { - LwpVirtualLayout* pLay = dynamic_cast<LwpVirtualLayout*>(GetChildHead()->obj()); + LwpVirtualLayout* pLay = dynamic_cast<LwpVirtualLayout*>(GetChildHead()->obj().get()); while(pLay) { if( pLay->GetLayoutType() == LWP_PAGE_LAYOUT ) @@ -548,7 +548,7 @@ LwpPageLayout* LwpPageLayout::GetOddChildLayout() return pPageLayout; } } - pLay = dynamic_cast<LwpVirtualLayout*> (pLay->GetNext()->obj()); + pLay = dynamic_cast<LwpVirtualLayout*> (pLay->GetNext()->obj().get()); } } return NULL; @@ -580,11 +580,11 @@ sal_Int32 LwpPageLayout::GetPageNumber(sal_uInt16 nLayoutNumber) sal_Int16 nPageNumber = -1; LwpFoundry* pFoundry = this->GetFoundry(); LwpDocument* pDoc = pFoundry->GetDocument(); - LwpDLVListHeadTailHolder* pHeadTail = dynamic_cast<LwpDLVListHeadTailHolder*>(pDoc->GetPageHintsID()->obj()); + LwpDLVListHeadTailHolder* pHeadTail = dynamic_cast<LwpDLVListHeadTailHolder*>(pDoc->GetPageHintsID()->obj().get()); if(!pHeadTail) return nPageNumber; //get first pagehint - LwpPageHint* pPageHint = dynamic_cast<LwpPageHint*>(pHeadTail->GetHead()->obj()); + LwpPageHint* pPageHint = dynamic_cast<LwpPageHint*>(pHeadTail->GetHead()->obj().get()); while(pPageHint) { if(*(this->GetObjectID()) == *(pPageHint->GetPageLayoutID())) @@ -614,7 +614,7 @@ sal_Int32 LwpPageLayout::GetPageNumber(sal_uInt16 nLayoutNumber) } } - pPageHint = dynamic_cast<LwpPageHint*>(pPageHint->GetNext()->obj()); + pPageHint = dynamic_cast<LwpPageHint*>(pPageHint->GetNext()->obj().get()); } if(nPageNumber>=0) { @@ -715,7 +715,7 @@ bool LwpPageLayout::operator<(LwpPageLayout& Other) */ LwpPara* LwpPageLayout::GetPagePosition() { - LwpPara* pPara = dynamic_cast<LwpPara*>(GetPosition()->obj()); + LwpPara* pPara = dynamic_cast<LwpPara*>(GetPosition()->obj().get()); if(pPara) return pPara; //Get the position from its related section @@ -726,7 +726,7 @@ LwpPara* LwpPageLayout::GetPagePosition() while( (pSection = pFoundry->EnumSections(pSection)) ) { if(pSection->GetPageLayout() == this) - return dynamic_cast<LwpPara*>(pSection->GetPosition()->obj()); + return dynamic_cast<LwpPara*>(pSection->GetPosition()->obj().get()); } } @@ -788,7 +788,7 @@ void LwpHeaderLayout::ParseMargins(XFHeaderStyle* ph1) } //Set left,right,bottom margins - LwpMiddleLayout* parent = dynamic_cast<LwpMiddleLayout*> (GetParent()->obj()); + LwpMiddleLayout* parent = dynamic_cast<LwpMiddleLayout*> (GetParent()->obj().get()); //left margin in SODC: the space from the left edge of body to the left edge of header double left = GetMarginsValue(MARGIN_LEFT) - (parent ? parent->GetMarginsValue(MARGIN_LEFT) : 0); if(left<=0) //The left margin in SODC can not be minus value @@ -875,8 +875,8 @@ void LwpHeaderLayout::ParseWaterMark(XFHeaderStyle * pHeaderStyle) void LwpHeaderLayout::RegisterStyle(XFMasterPage* mp1) { XFHeader* pHeader = new XFHeader(); - LwpObject* pStory = m_Content.obj(); - if(pStory) + rtl::Reference<LwpObject> pStory = m_Content.obj(); + if(pStory.is()) { LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance(); LwpChangeMgr* pChangeMgr = pGlobal->GetLwpChangeMgr(); @@ -954,7 +954,7 @@ void LwpFooterLayout::ParseMargins(XFFooterStyle* pFooterStyle) } //Set left,right,top margins - LwpMiddleLayout* parent = dynamic_cast<LwpMiddleLayout*> (GetParent()->obj()); + LwpMiddleLayout* parent = dynamic_cast<LwpMiddleLayout*> (GetParent()->obj().get()); double left = GetMarginsValue(MARGIN_LEFT) - (parent ? parent->GetMarginsValue(MARGIN_LEFT) : 0); if(left<=0) //The left margin in SODC can not be minus value { @@ -1028,9 +1028,9 @@ void LwpFooterLayout::ParseBackColor(XFFooterStyle* pFooterStyle) void LwpFooterLayout::RegisterStyle(XFMasterPage* mp1) { XFFooter* pFooter = new XFFooter(); - LwpObject* pStory = m_Content.obj(VO_STORY); + rtl::Reference<LwpObject> pStory = m_Content.obj(VO_STORY); //Call the RegisterStyle first to register the styles in footer paras, and then XFConvert() - if(pStory) + if(pStory.is()) { LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance(); LwpChangeMgr* pChangeMgr = pGlobal->GetLwpChangeMgr(); diff --git a/lotuswordpro/source/filter/lwppara.cxx b/lotuswordpro/source/filter/lwppara.cxx index 25a36fbb091a..3baceb91cf43 100644 --- a/lotuswordpro/source/filter/lwppara.cxx +++ b/lotuswordpro/source/filter/lwppara.cxx @@ -263,7 +263,7 @@ void LwpPara::XFConvert(XFContentContainer* pCont) { m_pXFContainer = pCont; - LwpStory *pStory = dynamic_cast<LwpStory*>(m_Story.obj()); + LwpStory *pStory = dynamic_cast<LwpStory*>(m_Story.obj().get()); if (pStory && pStory->GetDropcapFlag()) { @@ -318,7 +318,7 @@ bool LwpPara::RegisterMasterPage(XFParaStyle* pBaseStyle) { bool bSuccess = false; //get story - LwpStory* pStory = dynamic_cast<LwpStory*>(m_Story.obj()); + LwpStory* pStory = dynamic_cast<LwpStory*>(m_Story.obj().get()); //if pagelayout is modified, register the pagelayout if(pStory && pStory->IsPMModified()) { @@ -691,7 +691,7 @@ void LwpPara::RegisterStyle() } if (pPara->GetPrevious()) - pPrePara = dynamic_cast<LwpPara*>(pPara->GetPrevious()->obj(VO_PARA)); + pPrePara = dynamic_cast<LwpPara*>(pPara->GetPrevious()->obj(VO_PARA).get()); else pPrePara=NULL; @@ -750,7 +750,7 @@ void LwpPara::RegisterStyle() if (noSpacing && GetPrevious()) { - LwpPara* pPrePara = dynamic_cast<LwpPara*>(GetPrevious()->obj()); + LwpPara* pPrePara = dynamic_cast<LwpPara*>(GetPrevious()->obj().get()); if (pPrePara && pPrePara->GetBelowSpacing()!=0) { pOverStyle = new XFParaStyle; @@ -831,7 +831,7 @@ void LwpPara::RegisterTabStyle(XFParaStyle* pXFParaStyle) LwpTabOverride aFinaOverride; LwpTabOverride* pBase = NULL; //get the tabrack from the current layout - LwpStory* pStory = dynamic_cast<LwpStory*>(m_Story.obj()); + LwpStory* pStory = dynamic_cast<LwpStory*>(m_Story.obj().get()); LwpMiddleLayout* pLayout = pStory ? pStory->GetTabLayout() : NULL; if(pLayout) { diff --git a/lotuswordpro/source/filter/lwppara.hxx b/lotuswordpro/source/filter/lwppara.hxx index c88280a5dcfb..7482fe188aee 100644 --- a/lotuswordpro/source/filter/lwppara.hxx +++ b/lotuswordpro/source/filter/lwppara.hxx @@ -148,8 +148,7 @@ class LwpPara : public LwpDLVList { public: LwpPara(LwpObjectHeader& objHdr, LwpSvStream* pStrm); - virtual ~LwpPara(); -public: + void Read() SAL_OVERRIDE; void RegisterStyle() SAL_OVERRIDE; void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; @@ -276,6 +275,8 @@ protected: MAX_INDENT_LEVELS = 10 }; private: + virtual ~LwpPara(); + void OverrideAlignment(LwpAlignmentOverride* base,LwpAlignmentOverride* over,XFParaStyle* pOverStyle);//add by 1-24 void OverrideIndent(LwpIndentOverride* base,LwpIndentOverride* over,XFParaStyle* pOverStyle); void OverrideSpacing(LwpSpacingOverride* base,LwpSpacingOverride* over,XFParaStyle* pOverStyle); @@ -367,8 +368,8 @@ inline LwpObjectID* LwpPara::GetStoryID() } inline LwpStory* LwpPara::GetStory() { - if (m_Story.obj()) - return dynamic_cast<LwpStory*>(m_Story.obj()); + if (m_Story.obj().is()) + return dynamic_cast<LwpStory*>(m_Story.obj().get()); return NULL; } diff --git a/lotuswordpro/source/filter/lwppara1.cxx b/lotuswordpro/source/filter/lwppara1.cxx index 70df2579552a..15ddf4e02f08 100644 --- a/lotuswordpro/source/filter/lwppara1.cxx +++ b/lotuswordpro/source/filter/lwppara1.cxx @@ -175,13 +175,13 @@ LwpPara* LwpPara::GetParent() if (level != 1) { - pPara = dynamic_cast<LwpPara*>(GetPrevious()->obj()); + pPara = dynamic_cast<LwpPara*>(GetPrevious()->obj().get()); while (pPara) { otherlevel = pPara->GetLevel(); if ((otherlevel < level) || (otherlevel && (level == 0))) return pPara; - pPara = dynamic_cast<LwpPara*>(pPara->GetPrevious()->obj()); + pPara = dynamic_cast<LwpPara*>(pPara->GetPrevious()->obj().get()); } } return NULL; @@ -336,7 +336,7 @@ void LwpPara::OverrideSpacing(LwpSpacingOverride* base,LwpSpacingOverride* over, */ LwpParaStyle* LwpPara::GetParaStyle() { - return dynamic_cast<LwpParaStyle*>(m_ParaStyle.obj(VO_PARASTYLE)); + return dynamic_cast<LwpParaStyle*>(m_ParaStyle.obj(VO_PARASTYLE).get()); } /** @@ -491,7 +491,7 @@ void LwpPara::OverrideParaBullet(LwpParaProperty* pProps) m_pBullOver = pFinalBullet.release(); if (!aSilverBulletID.IsNull()) { - m_pSilverBullet = dynamic_cast<LwpSilverBullet*>(aSilverBulletID.obj(VO_SILVERBULLET)); + m_pSilverBullet = dynamic_cast<LwpSilverBullet*>(aSilverBulletID.obj(VO_SILVERBULLET).get()); if (m_pSilverBullet) m_pSilverBullet->SetFoundry(m_pFoundry); } @@ -510,7 +510,7 @@ void LwpPara::OverrideParaBullet(LwpParaProperty* pProps) { m_bHasBullet = true; - m_pSilverBullet = dynamic_cast<LwpSilverBullet*>(m_aSilverBulletID.obj(VO_SILVERBULLET)); + m_pSilverBullet = dynamic_cast<LwpSilverBullet*>(m_aSilverBulletID.obj(VO_SILVERBULLET).get()); if (m_pSilverBullet) m_pSilverBullet->SetFoundry(m_pFoundry); } @@ -569,7 +569,7 @@ void LwpPara::FindLayouts() { m_Fribs.SetPara(this); m_Fribs.FindLayouts(); - LwpPara* pNextPara = dynamic_cast<LwpPara*>(GetNext()->obj()); + LwpPara* pNextPara = dynamic_cast<LwpPara*>(GetNext()->obj().get()); if(pNextPara) { pNextPara->FindLayouts(); diff --git a/lotuswordpro/source/filter/lwpparaproperty.cxx b/lotuswordpro/source/filter/lwpparaproperty.cxx index 0b8c80b412cb..9c8be79955ae 100644 --- a/lotuswordpro/source/filter/lwpparaproperty.cxx +++ b/lotuswordpro/source/filter/lwpparaproperty.cxx @@ -65,7 +65,7 @@ #include "lwpobjtags.hxx" #include "lwppara.hxx" -LwpParaProperty* LwpParaProperty::ReadPropertyList(LwpObjectStream* pFile,LwpObject* Whole) +LwpParaProperty* LwpParaProperty::ReadPropertyList(LwpObjectStream* pFile,rtl::Reference<LwpObject> const & Whole) { LwpParaProperty* Prop= NULL; LwpParaProperty* NewProp= NULL; @@ -115,7 +115,7 @@ LwpParaProperty* LwpParaProperty::ReadPropertyList(LwpObjectStream* pFile,LwpObj case TAG_PARA_BULLET: NewProp = new LwpParaBulletProperty(pFile); - static_cast<LwpPara*>(Whole)->SetBulletFlag(true); + static_cast<LwpPara*>(Whole.get())->SetBulletFlag(true); break; case TAG_PARA_NUMBERING: @@ -146,7 +146,7 @@ LwpParaAlignProperty::LwpParaAlignProperty(LwpObjectStream* pFile) LwpObjectID align; align.ReadIndexed(pFile); - LwpAlignmentPiece *pAlignmentPiece = dynamic_cast<LwpAlignmentPiece*>(align.obj(VO_ALIGNMENTPIECE)); + LwpAlignmentPiece *pAlignmentPiece = dynamic_cast<LwpAlignmentPiece*>(align.obj(VO_ALIGNMENTPIECE).get()); m_pAlignment = pAlignmentPiece ? dynamic_cast<LwpAlignmentOverride*>(pAlignmentPiece->GetOverride()) : NULL; } @@ -164,7 +164,7 @@ LwpParaIndentProperty::LwpParaIndentProperty(LwpObjectStream* pFile) { m_aIndentID.ReadIndexed(pFile); - LwpIndentPiece *pIndentPiece = dynamic_cast<LwpIndentPiece*>(m_aIndentID.obj(VO_INDENTPIECE)); + LwpIndentPiece *pIndentPiece = dynamic_cast<LwpIndentPiece*>(m_aIndentID.obj(VO_INDENTPIECE).get()); m_pIndent = pIndentPiece ? dynamic_cast<LwpIndentOverride*>(pIndentPiece->GetOverride()) : NULL; } @@ -182,7 +182,7 @@ LwpParaSpacingProperty::LwpParaSpacingProperty(LwpObjectStream* pFile) LwpObjectID spacing; spacing.ReadIndexed(pFile); - LwpSpacingPiece *pSpacingPiece = dynamic_cast<LwpSpacingPiece*>(spacing.obj(VO_SPACINGPIECE)); + LwpSpacingPiece *pSpacingPiece = dynamic_cast<LwpSpacingPiece*>(spacing.obj(VO_SPACINGPIECE).get()); m_pSpacing = pSpacingPiece ? dynamic_cast<LwpSpacingOverride*>(pSpacingPiece->GetOverride()) : NULL; } @@ -204,7 +204,7 @@ m_pParaBorderOverride(NULL) if (!aParaBorder.IsNull()) { - LwpParaBorderPiece *pParaBorderPiece = dynamic_cast<LwpParaBorderPiece*>(aParaBorder.obj()); + LwpParaBorderPiece *pParaBorderPiece = dynamic_cast<LwpParaBorderPiece*>(aParaBorder.obj().get()); m_pParaBorderOverride = pParaBorderPiece ? dynamic_cast<LwpParaBorderOverride*>(pParaBorderPiece->GetOverride()) : NULL; } } @@ -217,7 +217,7 @@ m_pBreaks(NULL) if (!aBreaks.IsNull()) { - LwpBreaksPiece *pBreaksPiece = dynamic_cast<LwpBreaksPiece*>(aBreaks.obj()); + LwpBreaksPiece *pBreaksPiece = dynamic_cast<LwpBreaksPiece*>(aBreaks.obj().get()); m_pBreaks = pBreaksPiece ? dynamic_cast<LwpBreaksOverride*>(pBreaksPiece->GetOverride()) : NULL; } } @@ -243,7 +243,7 @@ LwpParaNumberingProperty::LwpParaNumberingProperty(LwpObjectStream * pStrm) return; } - LwpNumberingPiece *pNumberingPiece = dynamic_cast<LwpNumberingPiece*>(aNumberingPiece.obj(VO_NUMBERINGPIECE)); + LwpNumberingPiece *pNumberingPiece = dynamic_cast<LwpNumberingPiece*>(aNumberingPiece.obj(VO_NUMBERINGPIECE).get()); m_pNumberingOverride = pNumberingPiece ? dynamic_cast<LwpNumberingOverride*>(pNumberingPiece->GetOverride()) : NULL; } //end @@ -253,7 +253,7 @@ LwpParaTabRackProperty::LwpParaTabRackProperty(LwpObjectStream* pFile) LwpObjectID aTabRack; aTabRack.ReadIndexed(pFile); - LwpTabPiece *pTabPiece = dynamic_cast<LwpTabPiece*>(aTabRack.obj()); + LwpTabPiece *pTabPiece = dynamic_cast<LwpTabPiece*>(aTabRack.obj().get()); m_pTabOverride = pTabPiece ? dynamic_cast<LwpTabOverride*>(pTabPiece->GetOverride()) : NULL; } @@ -266,7 +266,7 @@ LwpParaBackGroundProperty::LwpParaBackGroundProperty(LwpObjectStream* pFile) LwpObjectID background; background.ReadIndexed(pFile); - LwpBackgroundPiece *pBackgroundPiece = dynamic_cast<LwpBackgroundPiece*>(background.obj()); + LwpBackgroundPiece *pBackgroundPiece = dynamic_cast<LwpBackgroundPiece*>(background.obj().get()); m_pBackground = pBackgroundPiece ? dynamic_cast<LwpBackgroundOverride*>(pBackgroundPiece->GetOverride()) : NULL; } diff --git a/lotuswordpro/source/filter/lwpparaproperty.hxx b/lotuswordpro/source/filter/lwpparaproperty.hxx index 8f39f5529a8c..0a20b2d3fbfa 100644 --- a/lotuswordpro/source/filter/lwpparaproperty.hxx +++ b/lotuswordpro/source/filter/lwpparaproperty.hxx @@ -95,7 +95,7 @@ public: inline LwpParaProperty* GetNext(void); inline LwpParaProperty* GetPrevious(void); - static LwpParaProperty* ReadPropertyList(LwpObjectStream* pFile,LwpObject* Whole); + static LwpParaProperty* ReadPropertyList(LwpObjectStream* pFile,rtl::Reference<LwpObject> const & Whole); }; diff --git a/lotuswordpro/source/filter/lwpparastyle.cxx b/lotuswordpro/source/filter/lwpparastyle.cxx index 04e25dd77696..07dab82a0d8e 100644 --- a/lotuswordpro/source/filter/lwpparastyle.cxx +++ b/lotuswordpro/source/filter/lwpparastyle.cxx @@ -163,7 +163,7 @@ void LwpParaStyle::Apply(XFParaStyle *pParaStyle) LwpVirtualPiece *pPiece = NULL; //alignment: - pPiece = dynamic_cast<LwpVirtualPiece*>(m_AlignmentStyle.obj()); + pPiece = dynamic_cast<LwpVirtualPiece*>(m_AlignmentStyle.obj().get()); if( pPiece ) { LwpAlignmentOverride *pAlign = dynamic_cast<LwpAlignmentOverride*>(pPiece->GetOverride()); @@ -172,7 +172,7 @@ void LwpParaStyle::Apply(XFParaStyle *pParaStyle) } //don't known top and bottom indent now. - pPiece = dynamic_cast<LwpVirtualPiece*>(m_IndentStyle.obj()); + pPiece = dynamic_cast<LwpVirtualPiece*>(m_IndentStyle.obj().get()); if( pPiece ) { LwpIndentOverride *pIndent = dynamic_cast<LwpIndentOverride*>(pPiece->GetOverride()); @@ -190,7 +190,7 @@ void LwpParaStyle::Apply(XFParaStyle *pParaStyle) } } //shadow & borders. - pPiece = dynamic_cast<LwpVirtualPiece*>(m_BorderStyle.obj()); + pPiece = dynamic_cast<LwpVirtualPiece*>(m_BorderStyle.obj().get()); if( pPiece ) { LwpParaBorderOverride *pBorder = dynamic_cast<LwpParaBorderOverride*>(pPiece->GetOverride()); @@ -200,7 +200,7 @@ void LwpParaStyle::Apply(XFParaStyle *pParaStyle) } } - pPiece = dynamic_cast<LwpVirtualPiece*>(m_SpacingStyle.obj()); + pPiece = dynamic_cast<LwpVirtualPiece*>(m_SpacingStyle.obj().get()); if (pPiece) { LwpSpacingOverride *pSpacing = dynamic_cast<LwpSpacingOverride*>(pPiece->GetOverride()); @@ -209,7 +209,7 @@ void LwpParaStyle::Apply(XFParaStyle *pParaStyle) } //paragraph background. - pPiece = dynamic_cast<LwpVirtualPiece*>(m_BackgroundStyle.obj()); + pPiece = dynamic_cast<LwpVirtualPiece*>(m_BackgroundStyle.obj().get()); if( pPiece ) { LwpBackgroundOverride *pBack = dynamic_cast<LwpBackgroundOverride*>(pPiece->GetOverride()); @@ -222,7 +222,7 @@ void LwpParaStyle::Apply(XFParaStyle *pParaStyle) } //add tab style - pPiece = dynamic_cast<LwpVirtualPiece*>(m_TabStyle.obj()); + pPiece = dynamic_cast<LwpVirtualPiece*>(m_TabStyle.obj().get()); if( pPiece ) { LwpTabOverride *pTab = dynamic_cast<LwpTabOverride*>(pPiece->GetOverride()); @@ -231,7 +231,7 @@ void LwpParaStyle::Apply(XFParaStyle *pParaStyle) ApplyTab(pParaStyle,pTab); } } - pPiece = dynamic_cast<LwpVirtualPiece*>(m_BreaksStyle.obj()); + pPiece = dynamic_cast<LwpVirtualPiece*>(m_BreaksStyle.obj().get()); if( pPiece ) { LwpBreaksOverride *pBreak = dynamic_cast<LwpBreaksOverride*>(pPiece->GetOverride()); @@ -589,7 +589,7 @@ void LwpParaStyle::ApplySpacing(LwpPara* pPara, XFParaStyle* pParaStyle, LwpSpac { if (below_val != -1) pPara->SetBelowSpacing(below_val); - LwpPara* pPrePara = dynamic_cast<LwpPara*>(pPara->GetPrevious()->obj()); + LwpPara* pPrePara = dynamic_cast<LwpPara*>(pPara->GetPrevious()->obj().get()); if (pPrePara && above_val != -1) { above_val += pPrePara->GetBelowSpacing(); @@ -615,7 +615,7 @@ void LwpParaStyle::ApplyTab(XFParaStyle *pParaStyle, LwpTabOverride *pTabOverRid return; } - LwpTabRack* pTabRack = dynamic_cast<LwpTabRack*>(pTabRackID->obj()); + LwpTabRack* pTabRack = dynamic_cast<LwpTabRack*>(pTabRackID->obj().get()); if(!pTabRack) { //assert(false); @@ -709,7 +709,7 @@ LwpAlignmentOverride* LwpParaStyle::GetAlignment() if (m_AlignmentStyle.obj() == NULL) return NULL; - LwpAlignmentPiece *pPiece = dynamic_cast<LwpAlignmentPiece*>(m_AlignmentStyle.obj()); + LwpAlignmentPiece *pPiece = dynamic_cast<LwpAlignmentPiece*>(m_AlignmentStyle.obj().get()); if (pPiece) return dynamic_cast<LwpAlignmentOverride*>(pPiece->GetOverride()); return NULL; @@ -720,7 +720,7 @@ LwpIndentOverride* LwpParaStyle::GetIndent() if (m_IndentStyle.obj() == NULL) return NULL; - LwpIndentPiece *pPiece = dynamic_cast<LwpIndentPiece*>(m_IndentStyle.obj()); + LwpIndentPiece *pPiece = dynamic_cast<LwpIndentPiece*>(m_IndentStyle.obj().get()); if (pPiece) return dynamic_cast<LwpIndentOverride*>(pPiece->GetOverride()); return NULL; @@ -731,7 +731,7 @@ LwpSpacingOverride* LwpParaStyle::GetSpacing() if (m_SpacingStyle.obj() == NULL) return NULL; - LwpSpacingPiece *pPiece = dynamic_cast<LwpSpacingPiece*>(m_SpacingStyle.obj()); + LwpSpacingPiece *pPiece = dynamic_cast<LwpSpacingPiece*>(m_SpacingStyle.obj().get()); if (pPiece) return dynamic_cast<LwpSpacingOverride*>(pPiece->GetOverride()); return NULL; @@ -742,7 +742,7 @@ LwpParaBorderOverride* LwpParaStyle::GetParaBorder() const if(m_BorderStyle.IsNull()) return NULL; - LwpParaBorderPiece *pPiece = dynamic_cast<LwpParaBorderPiece*>(m_BorderStyle.obj(VO_PARABORDERPIECE)); + LwpParaBorderPiece *pPiece = dynamic_cast<LwpParaBorderPiece*>(m_BorderStyle.obj(VO_PARABORDERPIECE).get()); if (pPiece) return dynamic_cast<LwpParaBorderOverride*>(pPiece->GetOverride()); return NULL; @@ -753,7 +753,7 @@ LwpBreaksOverride* LwpParaStyle::GetBreaks() const if(m_BreaksStyle.IsNull()) return NULL; - LwpBreaksPiece *pPiece = dynamic_cast<LwpBreaksPiece*>(m_BreaksStyle.obj(VO_BREAKSPIECE)); + LwpBreaksPiece *pPiece = dynamic_cast<LwpBreaksPiece*>(m_BreaksStyle.obj(VO_BREAKSPIECE).get()); if (pPiece) return dynamic_cast<LwpBreaksOverride*>(pPiece->GetOverride()); return NULL; @@ -769,7 +769,7 @@ LwpNumberingOverride* LwpParaStyle::GetNumberingOverride() const if(m_NumberingStyle.IsNull()) return NULL; - LwpNumberingPiece *pPiece = dynamic_cast<LwpNumberingPiece*>(m_NumberingStyle.obj(VO_NUMBERINGPIECE)); + LwpNumberingPiece *pPiece = dynamic_cast<LwpNumberingPiece*>(m_NumberingStyle.obj(VO_NUMBERINGPIECE).get()); if (pPiece) return dynamic_cast<LwpNumberingOverride*>(pPiece->GetOverride()); return NULL; @@ -786,7 +786,7 @@ LwpTabOverride* LwpParaStyle::GetTabOverride() const { if(m_TabStyle.obj() == NULL) return NULL; - LwpTabPiece *pPiece = dynamic_cast<LwpTabPiece*>(m_TabStyle.obj()); + LwpTabPiece *pPiece = dynamic_cast<LwpTabPiece*>(m_TabStyle.obj().get()); if (pPiece) return dynamic_cast<LwpTabOverride*>(pPiece->GetOverride()); return NULL; diff --git a/lotuswordpro/source/filter/lwppiece.hxx b/lotuswordpro/source/filter/lwppiece.hxx index 8da0b528b99a..9dee449d947a 100644 --- a/lotuswordpro/source/filter/lwppiece.hxx +++ b/lotuswordpro/source/filter/lwppiece.hxx @@ -87,12 +87,6 @@ public: m_pOverride = NULL; } - virtual ~LwpVirtualPiece() - { - if( m_pOverride ) - delete m_pOverride; - } - virtual void Read() SAL_OVERRIDE { LwpDLVList::Read(); @@ -105,6 +99,12 @@ public: return m_pOverride; } protected: + virtual ~LwpVirtualPiece() + { + if( m_pOverride ) + delete m_pOverride; + } + LwpOverride *m_pOverride; }; @@ -115,6 +115,9 @@ public: { m_pOverride = new LwpParaBorderOverride(); } + +private: + virtual ~LwpParaBorderPiece() {} }; class LwpBreaksPiece : public LwpVirtualPiece @@ -124,6 +127,9 @@ public: { m_pOverride = new LwpBreaksOverride(); } + +private: + virtual ~LwpBreaksPiece() {} }; class LwpNumberingPiece : public LwpVirtualPiece @@ -133,6 +139,9 @@ public: { m_pOverride = new LwpNumberingOverride(); } + +private: + virtual ~LwpNumberingPiece() {} }; class LwpTabPiece : public LwpVirtualPiece @@ -142,6 +151,9 @@ public: { m_pOverride = new LwpTabOverride(); } + +private: + virtual ~LwpTabPiece() {} }; class LwpBackgroundPiece : public LwpVirtualPiece @@ -151,6 +163,9 @@ public: { m_pOverride = new LwpBackgroundOverride(); } + +private: + virtual ~LwpBackgroundPiece() {} }; class LwpAlignmentPiece : public LwpVirtualPiece @@ -160,6 +175,9 @@ public: { m_pOverride = new LwpAlignmentOverride(); } + +private: + virtual ~LwpAlignmentPiece() {} }; class LwpIndentPiece : public LwpVirtualPiece @@ -169,6 +187,9 @@ public: { m_pOverride = new LwpIndentOverride(); } + +private: + virtual ~LwpIndentPiece() {} }; class LwpSpacingPiece : public LwpVirtualPiece @@ -178,6 +199,9 @@ public: { m_pOverride = new LwpSpacingOverride(); } + +private: + virtual ~LwpSpacingPiece() {} }; class LwpAmikakePiece : public LwpVirtualPiece @@ -187,6 +211,9 @@ public: { m_pOverride = new LwpAmikakeOverride(); } + +private: + virtual ~LwpAmikakePiece() {} }; class LwpCharacterBorderPiece : public LwpVirtualPiece @@ -196,6 +223,9 @@ public: { m_pOverride = new LwpCharacterBorderOverride(); } + +private: + virtual ~LwpCharacterBorderPiece() {} }; #endif diff --git a/lotuswordpro/source/filter/lwpproplist.cxx b/lotuswordpro/source/filter/lwpproplist.cxx index 44740cdae8b7..6547f64ea607 100644 --- a/lotuswordpro/source/filter/lwpproplist.cxx +++ b/lotuswordpro/source/filter/lwpproplist.cxx @@ -71,7 +71,7 @@ LwpPropListElement::LwpPropListElement(LwpObjectHeader &objHdr, LwpSvStream *pSt LwpPropListElement* LwpPropListElement::GetNext() { - return static_cast<LwpPropListElement*>(LwpDLVList::GetNext()->obj()); + return static_cast<LwpPropListElement*>(LwpDLVList::GetNext()->obj().get()); } void LwpPropListElement::Read() @@ -117,7 +117,7 @@ void LwpPropList::Read(LwpObjectStream* pObjStrm) LwpPropListElement* LwpPropList::GetFirst() { - return static_cast<LwpPropListElement*>(LwpDLVListHead::GetFirst()->obj()); + return static_cast<LwpPropListElement*>(LwpDLVListHead::GetFirst()->obj().get()); } OUString LwpPropList::EnumNamedProperty(OUString& name,OUString& value) diff --git a/lotuswordpro/source/filter/lwpproplist.hxx b/lotuswordpro/source/filter/lwpproplist.hxx index 21d4cff2beab..2b5270fb35cd 100644 --- a/lotuswordpro/source/filter/lwpproplist.hxx +++ b/lotuswordpro/source/filter/lwpproplist.hxx @@ -73,13 +73,14 @@ class LwpPropListElement : public LwpDLVList { public: LwpPropListElement(LwpObjectHeader &objHdr, LwpSvStream *pStrm); - virtual ~LwpPropListElement(){} void Read() SAL_OVERRIDE; bool IsNamed(const OUString& name); LwpPropListElement* GetNext(); LwpAtomHolder GetValue(){return m_Value;} LwpAtomHolder GetName(){return m_Name;} private: + virtual ~LwpPropListElement(){} + LwpAtomHolder m_Name; LwpAtomHolder m_Value; }; diff --git a/lotuswordpro/source/filter/lwprowlayout.cxx b/lotuswordpro/source/filter/lwprowlayout.cxx index f8ead032fc9d..f51d539012f4 100644 --- a/lotuswordpro/source/filter/lwprowlayout.cxx +++ b/lotuswordpro/source/filter/lwprowlayout.cxx @@ -96,14 +96,14 @@ LwpRowLayout::~LwpRowLayout() void LwpRowLayout::SetRowMap(void) { LwpObjectID *pCellID= GetChildHead(); - LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj()); + LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj().get()); while(pCellLayout) { pCellLayout->SetCellMap(); pCellID = pCellLayout->GetNext(); - pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj()); + pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj().get()); } } /** @@ -136,14 +136,14 @@ void LwpRowLayout::RegisterStyle() } // register cells' style LwpObjectID *pCellID= GetChildHead(); - LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj()); + LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj().get()); while(pCellLayout) { pCellLayout->SetFoundry(m_pFoundry); pCellLayout->RegisterStyle(); pCellID = pCellLayout->GetNext(); - pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj()); + pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj().get()); } } @@ -378,7 +378,7 @@ void LwpRowLayout::ConvertCommonRow(XFTable* pXFTable,sal_uInt8 nStartCol,sal_uI { // add row to table LwpObjectID *pCellID= GetChildHead(); - LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj()); + LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj().get()); nCellStartCol = i;//mark the begin position of cell nCellEndCol = i;//mark the end position of cell while(pCellLayout) @@ -395,7 +395,7 @@ void LwpRowLayout::ConvertCommonRow(XFTable* pXFTable,sal_uInt8 nStartCol,sal_uI break; } pCellID = pCellLayout->GetNext(); - pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj()); + pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj().get()); } if (!pCellLayout) { @@ -426,7 +426,7 @@ void LwpRowLayout::ConvertCommonRow(XFTable* pXFTable,sal_uInt8 nStartCol,sal_uI void LwpRowLayout::CollectMergeInfo() { LwpObjectID *pCellID= GetChildHead(); - LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj()); + LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj().get()); while(pCellLayout) { @@ -436,7 +436,7 @@ void LwpRowLayout::CollectMergeInfo() m_ConnCellList.push_back(pConnCell); } pCellID = pCellLayout->GetNext(); - pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj()); + pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj().get()); } } /** diff --git a/lotuswordpro/source/filter/lwprowlayout.hxx b/lotuswordpro/source/filter/lwprowlayout.hxx index d4bf758fef17..2ece96f35bc5 100644 --- a/lotuswordpro/source/filter/lwprowlayout.hxx +++ b/lotuswordpro/source/filter/lwprowlayout.hxx @@ -83,7 +83,7 @@ public: virtual LWP_LAYOUT_TYPE GetLayoutType () SAL_OVERRIDE { return LWP_ROW_LAYOUT;} sal_uInt16 GetRowID() { return crowid;} virtual void RegisterStyle() SAL_OVERRIDE; - inline LwpTableLayout * GetParentTableLayout(){return dynamic_cast<LwpTableLayout *>(GetParent()->obj());} + inline LwpTableLayout * GetParentTableLayout(){return dynamic_cast<LwpTableLayout *>(GetParent()->obj().get());} void SetRowMap(void); protected: void Read() SAL_OVERRIDE; diff --git a/lotuswordpro/source/filter/lwpsection.hxx b/lotuswordpro/source/filter/lwpsection.hxx index 1860641c85f4..3e2fa83777ab 100644 --- a/lotuswordpro/source/filter/lwpsection.hxx +++ b/lotuswordpro/source/filter/lwpsection.hxx @@ -127,7 +127,7 @@ inline sal_uInt16 LwpSection::GetFlags() */ inline LwpPageLayout* LwpSection::GetPageLayout() { - return dynamic_cast<LwpPageLayout*>(m_PageLayout.obj()); + return dynamic_cast<LwpPageLayout*>(m_PageLayout.obj().get()); } /** diff --git a/lotuswordpro/source/filter/lwpsilverbullet.cxx b/lotuswordpro/source/filter/lwpsilverbullet.cxx index 8aad25581ec9..717fc574473d 100644 --- a/lotuswordpro/source/filter/lwpsilverbullet.cxx +++ b/lotuswordpro/source/filter/lwpsilverbullet.cxx @@ -239,13 +239,13 @@ LwpPara* LwpSilverBullet::GetBulletPara() { if (!m_pBulletPara) { - LwpStory* pStory = dynamic_cast<LwpStory*>(m_aStory.obj(VO_STORY)); + LwpStory* pStory = dynamic_cast<LwpStory*>(m_aStory.obj(VO_STORY).get()); if (!pStory) { return NULL; } - m_pBulletPara = dynamic_cast<LwpPara*>(pStory->GetFirstPara()->obj(VO_PARA)); + m_pBulletPara = dynamic_cast<LwpPara*>(pStory->GetFirstPara()->obj(VO_PARA).get()); } return m_pBulletPara; @@ -438,7 +438,7 @@ OUString LwpSilverBullet::GetDivisionName() LwpObjectID* pID = pDoc->GetDivInfoID(); if (!pID->IsNull()) { - LwpDivInfo *pInfo = dynamic_cast<LwpDivInfo*>(pID->obj(VO_DIVISIONINFO)); + LwpDivInfo *pInfo = dynamic_cast<LwpDivInfo*>(pID->obj(VO_DIVISIONINFO).get()); if (pInfo) aRet = pInfo->GetDivName(); } @@ -450,7 +450,7 @@ OUString LwpSilverBullet::GetDivisionName() OUString LwpSilverBullet::GetSectionName() { OUString aEmpty; - LwpStory* pStory = dynamic_cast<LwpStory*>(m_aStory.obj(VO_STORY)); + LwpStory* pStory = dynamic_cast<LwpStory*>(m_aStory.obj(VO_STORY).get()); if (!pStory) { return aEmpty; diff --git a/lotuswordpro/source/filter/lwpstory.cxx b/lotuswordpro/source/filter/lwpstory.cxx index b75599de26a4..c7875b5fdda5 100644 --- a/lotuswordpro/source/filter/lwpstory.cxx +++ b/lotuswordpro/source/filter/lwpstory.cxx @@ -105,7 +105,7 @@ void LwpStory::XFConvert(XFContentContainer* pCont) XFConvertFrameInFrame(pCont); //process para list XFContentContainer* pParaCont = pCont; - LwpPara* pPara = dynamic_cast<LwpPara*> ( GetFirstPara()->obj() ); + LwpPara* pPara = dynamic_cast<LwpPara*> ( GetFirstPara()->obj().get() ); while(pPara) { pPara->SetFoundry(m_pFoundry); @@ -113,7 +113,7 @@ void LwpStory::XFConvert(XFContentContainer* pCont) //Get the xfcontainer for the next para pParaCont = pPara->GetXFContainer(); - pPara = dynamic_cast<LwpPara*> ( pPara->GetNext()->obj() ); + pPara = dynamic_cast<LwpPara*> ( pPara->GetNext()->obj().get() ); } //process frame which anchor is to cell after converter all the para @@ -121,12 +121,12 @@ void LwpStory::XFConvert(XFContentContainer* pCont) XFConvertFrameInHeaderFooter(pCont); //Release Lwp Objects - LwpPara* pCur = dynamic_cast<LwpPara*> (GetFirstPara()->obj()); + LwpPara* pCur = dynamic_cast<LwpPara*> (GetFirstPara()->obj().get()); LwpPara* pNext; while(pCur) { pCur->Release(); - pNext = dynamic_cast<LwpPara*> ( pCur->GetNext()->obj() ); + pNext = dynamic_cast<LwpPara*> ( pCur->GetNext()->obj().get() ); LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance(); LwpObjectFactory* pObjMgr = pGlobal->GetLwpObjFactory(); pObjMgr->ReleaseObject(*pCur->GetObjectID()); @@ -136,12 +136,12 @@ void LwpStory::XFConvert(XFContentContainer* pCont) void LwpStory::RegisterStyle() { - LwpPara* pPara = dynamic_cast<LwpPara*>( GetFirstPara()->obj() ); + LwpPara* pPara = dynamic_cast<LwpPara*>( GetFirstPara()->obj().get() ); while(pPara) { pPara->SetFoundry(m_pFoundry); pPara->RegisterStyle(); - pPara = dynamic_cast<LwpPara*>(pPara->GetNext()->obj()); + pPara = dynamic_cast<LwpPara*>(pPara->GetNext()->obj().get()); } } @@ -340,7 +340,7 @@ void LwpStory::XFConvertFrameInCell(XFContentContainer* pCont) LwpVirtualLayout* pLayout = GetLayout(NULL); while(pLayout) { - LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetChildHead()->obj()); + LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetChildHead()->obj().get()); while(pFrameLayout) { @@ -352,7 +352,7 @@ void LwpStory::XFConvertFrameInCell(XFContentContainer* pCont) if(pXFFirtPara) pFrameLayout->XFConvert(pXFFirtPara); } - pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext()->obj()); + pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext()->obj().get()); } pLayout = GetLayout(pLayout); } @@ -369,7 +369,7 @@ void LwpStory::XFConvertFrameInPage(XFContentContainer* pCont) LwpVirtualLayout* pLayout = GetLayout(NULL); while(pLayout) { - LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetChildHead()->obj()); + LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetChildHead()->obj().get()); while(pFrameLayout) { if((pFrameLayout->IsAnchorPage() @@ -379,7 +379,7 @@ void LwpStory::XFConvertFrameInPage(XFContentContainer* pCont) { pFrameLayout->XFConvert(pCont); } - pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext()->obj()); + pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext()->obj().get()); } pLayout = GetLayout(pLayout); } @@ -395,14 +395,14 @@ void LwpStory::XFConvertFrameInFrame(XFContentContainer* pCont) LwpVirtualLayout* pLayout = GetLayout(NULL); while(pLayout) { - LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetChildHead()->obj()); + LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetChildHead()->obj().get()); while(pFrameLayout) { if(pFrameLayout->IsAnchorFrame()) { pFrameLayout->XFConvert(pCont); } - pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext()->obj()); + pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext()->obj().get()); } pLayout = GetLayout(pLayout); } @@ -418,7 +418,7 @@ void LwpStory::XFConvertFrameInHeaderFooter(XFContentContainer* pCont) LwpVirtualLayout* pLayout = GetLayout(NULL); while(pLayout) { - LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetChildHead()->obj()); + LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetChildHead()->obj().get()); while(pFrameLayout) { if(pFrameLayout->IsAnchorPage() && (pLayout->IsHeader() || pLayout->IsFooter())) @@ -428,7 +428,7 @@ void LwpStory::XFConvertFrameInHeaderFooter(XFContentContainer* pCont) if(pXFFirtPara) pFrameLayout->XFConvert(pXFFirtPara); } - pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext()->obj()); + pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext()->obj().get()); } pLayout = GetLayout(pLayout); } @@ -470,21 +470,21 @@ OUString LwpStory::GetContentText(bool bAllText) { OUString sText(""); //process para list - LwpPara* pPara = dynamic_cast<LwpPara*>(GetFirstPara()->obj()); + LwpPara* pPara = dynamic_cast<LwpPara*>(GetFirstPara()->obj().get()); while (pPara) { pPara->SetFoundry(m_pFoundry); sText += pPara->GetContentText(true); - pPara = dynamic_cast<LwpPara*>(pPara->GetNext()->obj()); + pPara = dynamic_cast<LwpPara*>(pPara->GetNext()->obj().get()); } return sText; } else //only the first text frib { - LwpObject* pObj = GetFirstPara()->obj(); - if(pObj) + rtl::Reference<LwpObject> pObj = GetFirstPara()->obj(); + if(pObj.is()) { - LwpPara* pPara = dynamic_cast<LwpPara*>(pObj); + LwpPara* pPara = dynamic_cast<LwpPara*>(pObj.get()); if (!pPara || pPara->GetNext()->obj() != NULL) return OUString(""); pPara->SetFoundry(m_pFoundry); @@ -496,7 +496,7 @@ OUString LwpStory::GetContentText(bool bAllText) } OUString LwpStory::RegisterFirstFribStyle() { - LwpPara* pPara = dynamic_cast<LwpPara*>(GetFirstPara()->obj()); + LwpPara* pPara = dynamic_cast<LwpPara*>(GetFirstPara()->obj().get()); if (!pPara) return OUString(""); pPara->SetFoundry(m_pFoundry); diff --git a/lotuswordpro/source/filter/lwptable.cxx b/lotuswordpro/source/filter/lwptable.cxx index 4be1075a5400..4d5539ee0dff 100644 --- a/lotuswordpro/source/filter/lwptable.cxx +++ b/lotuswordpro/source/filter/lwptable.cxx @@ -142,9 +142,9 @@ void LwpTable::Parse(IXFStream* /*pOutputStream*/) LwpSuperTableLayout* LwpTable::GetSuperTableLayout() { - LwpTableLayout* pLayout = dynamic_cast<LwpTableLayout*>(m_Layout.obj()); + LwpTableLayout* pLayout = dynamic_cast<LwpTableLayout*>(m_Layout.obj().get()); if(pLayout) - return dynamic_cast<LwpSuperTableLayout*>(pLayout->GetParent()->obj()); + return dynamic_cast<LwpSuperTableLayout*>(pLayout->GetParent()->obj().get()); return NULL; } diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx index 3a98f79f9732..dd47ba034ba3 100644 --- a/lotuswordpro/source/filter/lwptablelayout.cxx +++ b/lotuswordpro/source/filter/lwptablelayout.cxx @@ -118,7 +118,7 @@ LwpTableLayout* LwpSuperTableLayout::GetTableLayout() while(pID && !pID->IsNull()) { - LwpLayout* pLayout = dynamic_cast<LwpLayout*>(pID->obj()); + LwpLayout* pLayout = dynamic_cast<LwpLayout*>(pID->obj().get()); if (!pLayout) { break; @@ -142,7 +142,7 @@ LwpTableHeadingLayout* LwpSuperTableLayout::GetTableHeadingLayout() while(pID && !pID->IsNull()) { - LwpLayout * pLayout = dynamic_cast<LwpLayout *>(pID->obj()); + LwpLayout * pLayout = dynamic_cast<LwpLayout *>(pID->obj().get()); if (!pLayout) { break; @@ -235,7 +235,7 @@ double LwpSuperTableLayout::GetTableWidth() for(sal_uInt16 i =0; i< nCol; i++) { LwpObjectID *pColumnID = pTableLayout->GetColumnLayoutHead(); - LwpColumnLayout * pColumnLayout = dynamic_cast<LwpColumnLayout *>(pColumnID->obj()); + LwpColumnLayout * pColumnLayout = dynamic_cast<LwpColumnLayout *>(pColumnID->obj().get()); double dColumnWidth = dDefaultWidth; while (pColumnLayout) { @@ -245,7 +245,7 @@ double LwpSuperTableLayout::GetTableWidth() break; } pColumnID = pColumnLayout->GetNext(); - pColumnLayout = dynamic_cast<LwpColumnLayout *>(pColumnID->obj()); + pColumnLayout = dynamic_cast<LwpColumnLayout *>(pColumnID->obj().get()); } dWidth += dColumnWidth; } @@ -469,7 +469,7 @@ void LwpTableLayout::TraverseTable() // set value LwpObjectID *pRowID = GetChildHead(); - LwpRowLayout * pRowLayout = dynamic_cast<LwpRowLayout *>(pRowID->obj()); + LwpRowLayout * pRowLayout = dynamic_cast<LwpRowLayout *>(pRowID->obj().get()); while (pRowLayout) { pRowLayout->SetRowMap(); @@ -480,7 +480,7 @@ void LwpTableLayout::TraverseTable() // end for 's analysis pRowID = pRowLayout->GetNext(); - pRowLayout = dynamic_cast<LwpRowLayout *>(pRowID->obj()); + pRowLayout = dynamic_cast<LwpRowLayout *>(pRowID->obj().get()); } } @@ -518,7 +518,7 @@ LwpObjectID * LwpTableLayout::SearchCellStoryMap(sal_uInt16 nRow, sal_uInt16 nCo */ LwpSuperTableLayout * LwpTableLayout::GetSuperTableLayout() { - return dynamic_cast<LwpSuperTableLayout *>(GetParent()->obj()); + return dynamic_cast<LwpSuperTableLayout *>(GetParent()->obj().get()); } /** * @short Get table pointer @@ -526,7 +526,7 @@ LwpSuperTableLayout * LwpTableLayout::GetSuperTableLayout() */ LwpTable * LwpTableLayout::GetTable() { - LwpTable *pTable = dynamic_cast<LwpTable *>(m_Content.obj()); + LwpTable *pTable = dynamic_cast<LwpTable *>(m_Content.obj().get()); return pTable; } /** @@ -578,7 +578,7 @@ void LwpTableLayout::RegisterColumns() // Get total width of justifiable columns // NOTICE: all default columns are regarded as justifiable columns LwpObjectID *pColumnID = GetColumnLayoutHead(); - LwpColumnLayout * pColumnLayout = dynamic_cast<LwpColumnLayout *>(pColumnID->obj()); + LwpColumnLayout * pColumnLayout = dynamic_cast<LwpColumnLayout *>(pColumnID->obj().get()); while (pColumnLayout) { m_pColumns[pColumnLayout->GetColumnID()] = pColumnLayout; @@ -590,7 +590,7 @@ void LwpTableLayout::RegisterColumns() } pColumnID = pColumnLayout->GetNext(); - pColumnLayout = dynamic_cast<LwpColumnLayout *>(pColumnID->obj()); + pColumnLayout = dynamic_cast<LwpColumnLayout *>(pColumnID->obj().get()); } // if all columns are not justifiable, the rightmost column will be changed to justifiable @@ -669,14 +669,14 @@ void LwpTableLayout::RegisterRows() // register style of rows LwpObjectID * pRowID = GetChildHead(); - LwpRowLayout * pRowLayout = dynamic_cast<LwpRowLayout *>(pRowID->obj()); + LwpRowLayout * pRowLayout = dynamic_cast<LwpRowLayout *>(pRowID->obj().get()); while (pRowLayout) { pRowLayout->SetFoundry(m_pFoundry); pRowLayout->RegisterStyle(); pRowID = pRowLayout->GetNext(); - pRowLayout = dynamic_cast<LwpRowLayout *>(pRowID->obj()); + pRowLayout = dynamic_cast<LwpRowLayout *>(pRowID->obj().get()); } } /** @@ -709,7 +709,7 @@ void LwpTableLayout::RegisterStyle() LwpObjectID * pID= pTable->GetDefaultCellStyle(); if (pID) { - m_pDefaultCellLayout = dynamic_cast<LwpCellLayout *>(pID->obj()); + m_pDefaultCellLayout = dynamic_cast<LwpCellLayout *>(pID->obj().get()); } // register columns styles @@ -1111,9 +1111,9 @@ void LwpTableLayout::PutCellVals(LwpFoundry* pFoundry, LwpObjectID aTableID) try{ - LwpDLVListHeadHolder* pHolder = (LwpDLVListHeadHolder*)pFoundry->GetNumberManager()->GetTableRangeID().obj(); + LwpDLVListHeadHolder* pHolder = (LwpDLVListHeadHolder*)pFoundry->GetNumberManager()->GetTableRangeID().obj().get(); - LwpTableRange* pTableRange = (LwpTableRange*)pHolder->GetHeadID()->obj(); + LwpTableRange* pTableRange = (LwpTableRange*)pHolder->GetHeadID()->obj().get(); //Look up the table while (NULL!=pTableRange) @@ -1128,17 +1128,17 @@ void LwpTableLayout::PutCellVals(LwpFoundry* pFoundry, LwpObjectID aTableID) if (pTableRange) { - LwpCellRange* pRange = (LwpCellRange*)pTableRange->GetCellRangeID().obj(); - LwpFolder* pFolder = (LwpFolder*)pRange->GetFolderID().obj(); + LwpCellRange* pRange = (LwpCellRange*)pTableRange->GetCellRangeID().obj().get(); + LwpFolder* pFolder = (LwpFolder*)pRange->GetFolderID().obj().get(); LwpObjectID aRowListID = pFolder->GetChildHeadID(); - LwpRowList* pRowList = (LwpRowList*)aRowListID.obj(); + LwpRowList* pRowList = (LwpRowList*)aRowListID.obj().get(); //loop the rowlist while( NULL!=pRowList) { sal_uInt16 nRowID = pRowList->GetRowID(); { - LwpCellList* pCellList = (LwpCellList*)pRowList->GetChildHeadID().obj(); + LwpCellList* pCellList = (LwpCellList*)pRowList->GetChildHeadID().obj().get(); //loop the celllist while( NULL!=pCellList) { @@ -1159,10 +1159,10 @@ void LwpTableLayout::PutCellVals(LwpFoundry* pFoundry, LwpObjectID aTableID) assert(false); } } - pCellList = (LwpCellList*)pCellList->GetNextID().obj(); + pCellList = (LwpCellList*)pCellList->GetNextID().obj().get(); } } - pRowList =(LwpRowList*)pRowList->GetNextID().obj(); + pRowList =(LwpRowList*)pRowList->GetNextID().obj().get(); } } @@ -1251,7 +1251,7 @@ void LwpTableLayout::ConvertColumn(XFTable *pXFTable,sal_uInt8 nStartCol,sal_uIn { // add row to table LwpObjectID *pColID = GetColumnLayoutHead(); - LwpColumnLayout * pColumnLayout = dynamic_cast<LwpColumnLayout *>(pColID->obj()); + LwpColumnLayout * pColumnLayout = dynamic_cast<LwpColumnLayout *>(pColID->obj().get()); while (pColumnLayout) { if (pColumnLayout->GetColumnID() == (iLoop+nStartCol)) @@ -1260,7 +1260,7 @@ void LwpTableLayout::ConvertColumn(XFTable *pXFTable,sal_uInt8 nStartCol,sal_uIn break; } pColID = pColumnLayout->GetNext(); - pColumnLayout = dynamic_cast<LwpColumnLayout *>(pColID->obj()); + pColumnLayout = dynamic_cast<LwpColumnLayout *>(pColID->obj().get()); } if (!pColumnLayout) { @@ -1393,14 +1393,14 @@ XFCell* LwpTableLayout::GetCellsMap(sal_uInt16 nRow,sal_uInt8 nCol) LwpRowLayout* LwpTableLayout::GetRowLayout(sal_uInt16 nRow) { LwpObjectID *pRowID = GetChildHead(); - LwpRowLayout * pRowLayout = dynamic_cast<LwpRowLayout *>(pRowID->obj()); + LwpRowLayout * pRowLayout = dynamic_cast<LwpRowLayout *>(pRowID->obj().get()); while (pRowLayout) { if(pRowLayout->GetRowID() == nRow) return pRowLayout; pRowID = pRowLayout->GetNext(); - pRowLayout = dynamic_cast<LwpRowLayout *>(pRowID->obj()); + pRowLayout = dynamic_cast<LwpRowLayout *>(pRowID->obj().get()); } return NULL; } @@ -1481,7 +1481,7 @@ LwpRowHeadingLayout * LwpTableHeadingLayout::GetFirstRowHeadingLayout() LwpObjectID *pID = GetChildHead(); if(pID && !pID->IsNull()) { - LwpRowHeadingLayout * pHeadingRow = dynamic_cast<LwpRowHeadingLayout *>(pID->obj()); + LwpRowHeadingLayout * pHeadingRow = dynamic_cast<LwpRowHeadingLayout *>(pID->obj().get()); return pHeadingRow; } return NULL; diff --git a/lotuswordpro/source/filter/lwptabrack.cxx b/lotuswordpro/source/filter/lwptabrack.cxx index b27082cea0a2..5c3eb446cf24 100644 --- a/lotuswordpro/source/filter/lwptabrack.cxx +++ b/lotuswordpro/source/filter/lwptabrack.cxx @@ -115,7 +115,7 @@ LwpTab* LwpTabRack::Lookup(sal_uInt16 nIndex) LwpTabRack* LwpTabRack::GetNext() { - LwpTabRack* pTabRack = dynamic_cast<LwpTabRack*>(m_NextID.obj()); + LwpTabRack* pTabRack = dynamic_cast<LwpTabRack*>(m_NextID.obj().get()); return pTabRack; } diff --git a/lotuswordpro/source/filter/lwptabrack.hxx b/lotuswordpro/source/filter/lwptabrack.hxx index 8f0d3fda9ac2..6f3efc10905f 100644 --- a/lotuswordpro/source/filter/lwptabrack.hxx +++ b/lotuswordpro/source/filter/lwptabrack.hxx @@ -137,13 +137,14 @@ class LwpTabRack : public LwpObject { public: LwpTabRack(LwpObjectHeader objHdr, LwpSvStream* pStrm); - virtual ~LwpTabRack(){} public: void Read() SAL_OVERRIDE; sal_uInt16 GetNumTabs(); LwpTab* Lookup(sal_uInt16 nIndex); LwpTabRack* GetNext(); private: + virtual ~LwpTabRack(){} + enum{ MaxTabs = 15 }; diff --git a/lotuswordpro/source/filter/lwptblcell.cxx b/lotuswordpro/source/filter/lwptblcell.cxx index 154006cf4ff0..070bb034aa09 100644 --- a/lotuswordpro/source/filter/lwptblcell.cxx +++ b/lotuswordpro/source/filter/lwptblcell.cxx @@ -107,7 +107,7 @@ void LwpCellList::Parse(IXFStream* /*pOutputStream*/) void LwpCellList::Convert(XFCell * pCell, LwpTableLayout* /*pCellsMap*/) { LwpObjectID aValueID = GetValueID(); - LwpNumericValue* pValue = (LwpNumericValue*)aValueID.obj(); + LwpNumericValue* pValue = (LwpNumericValue*)aValueID.obj().get(); if (pValue) { pCell->SetValue( pValue->GetValue() ); diff --git a/lotuswordpro/source/filter/lwptblcell.hxx b/lotuswordpro/source/filter/lwptblcell.hxx index d647ec817afa..b304999e5144 100644 --- a/lotuswordpro/source/filter/lwptblcell.hxx +++ b/lotuswordpro/source/filter/lwptblcell.hxx @@ -83,7 +83,6 @@ class LwpCellList : public LwpDLVList { public: LwpCellList(LwpObjectHeader &objHdr, LwpSvStream* pStrm); - virtual ~LwpCellList(); virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; LwpObjectID GetNextID(){return *GetNext();} @@ -93,6 +92,8 @@ public: virtual void Convert(XFCell * pCell, LwpTableLayout* pCellsMap=NULL); protected: + virtual ~LwpCellList(); + sal_uInt8 cColumn; LwpObjectID cParent; @@ -107,7 +108,6 @@ class LwpRowList : public LwpDLVList { public: LwpRowList(LwpObjectHeader &objHdr, LwpSvStream* pStrm); - virtual ~LwpRowList(); void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; LwpObjectID GetChildHeadID(){return *cChild.GetHead();} @@ -118,6 +118,8 @@ protected: LwpObjectID cParent; sal_uInt16 cRowID; void Read() SAL_OVERRIDE; +private: + virtual ~LwpRowList(); }; /** * @brief @@ -127,7 +129,6 @@ class LwpNumericValue : public LwpObject { public: LwpNumericValue(LwpObjectHeader &objHdr, LwpSvStream* pStrm); - virtual ~LwpNumericValue(); double GetValue(){return cNumber;} void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; @@ -135,6 +136,8 @@ protected: double cNumber; //LwpContent m_TheContent; void Read() SAL_OVERRIDE; +private: + virtual ~LwpNumericValue(); }; /** @@ -145,16 +148,17 @@ class LwpTableRange: public LwpDLVList { public: LwpTableRange(LwpObjectHeader &objHdr, LwpSvStream* pStrm); - virtual ~LwpTableRange(); void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; LwpObjectID GetCellRangeID(){return cpCellRange;} LwpObjectID GetTableID(){ return cqTable;} - LwpTableRange* GetNext() { return (LwpTableRange*)(LwpDLVList::GetNext()->obj());} + LwpTableRange* GetNext() { return (LwpTableRange*)(LwpDLVList::GetNext()->obj().get());} protected: LwpObjectID cqTable; LwpObjectID cpCellRange; void Read() SAL_OVERRIDE; +private: + virtual ~LwpTableRange(); }; /** * @brief @@ -164,13 +168,14 @@ class LwpCellRange: public LwpObject { public: LwpCellRange(LwpObjectHeader &objHdr, LwpSvStream* pStrm); - virtual ~LwpCellRange(); void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; LwpObjectID GetFolderID(){return cpFolder;} protected: LwpObjectID cpFolder; void Read() SAL_OVERRIDE; +private: + virtual ~LwpCellRange(); }; /** * @brief @@ -180,7 +185,6 @@ class LwpFolder: public LwpDLVList { public: LwpFolder(LwpObjectHeader &objHdr, LwpSvStream* pStrm); - virtual ~LwpFolder(); void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; LwpObjectID GetChildHeadID(){ return *cChild.GetHead();} @@ -189,6 +193,8 @@ protected: LwpObjectID cParent; LwpObjectID cqTable; void Read() SAL_OVERRIDE; +private: + virtual ~LwpFolder(); }; /** * @brief @@ -198,7 +204,6 @@ class LwpDependent: public LwpDLVList { public: LwpDependent(LwpObjectHeader &objHdr, LwpSvStream* pStrm); - virtual ~LwpDependent(); void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; protected: @@ -215,6 +220,8 @@ protected: }; sal_uInt8 cFlags; // Used to fix dependent formula when we're // dropped, sorted. +private: + virtual ~LwpDependent(); }; /** diff --git a/lotuswordpro/source/filter/lwptblformula.cxx b/lotuswordpro/source/filter/lwptblformula.cxx index dfe0cb410b39..9623ef168d42 100644 --- a/lotuswordpro/source/filter/lwptblformula.cxx +++ b/lotuswordpro/source/filter/lwptblformula.cxx @@ -368,7 +368,7 @@ void LwpFormulaInfo::Read() { LwpCellList::Read(); { - LwpRowList* pRowList =(LwpRowList*)cParent.obj(); + LwpRowList* pRowList =(LwpRowList*)cParent.obj().get(); if (pRowList) { m_nFormulaRow = pRowList->GetRowID(); diff --git a/lotuswordpro/source/filter/lwptblformula.hxx b/lotuswordpro/source/filter/lwptblformula.hxx index d5610384442d..8ead65c39e3f 100644 --- a/lotuswordpro/source/filter/lwptblformula.hxx +++ b/lotuswordpro/source/filter/lwptblformula.hxx @@ -198,7 +198,6 @@ class LwpFormulaInfo : public LwpCellList { public: LwpFormulaInfo(LwpObjectHeader &objHdr, LwpSvStream* pStrm); - virtual ~LwpFormulaInfo(); bool IsFormula() SAL_OVERRIDE {return true;} void SetRow(sal_uInt16 nRow){ m_nFormulaRow = nRow;} OUString Convert(LwpTableLayout* pCellsMap); @@ -212,6 +211,8 @@ protected: bool ReadArguments(LwpFormulaFunc& aFunc); bool m_bSupported; private: + virtual ~LwpFormulaInfo(); + std::vector<LwpFormulaArg*> m_aStack; bool ReadConst(); void MarkUnsupported(sal_uInt16 TokenType); diff --git a/lotuswordpro/source/filter/lwptoc.cxx b/lotuswordpro/source/filter/lwptoc.cxx index 980802332183..0a8b848a09b6 100644 --- a/lotuswordpro/source/filter/lwptoc.cxx +++ b/lotuswordpro/source/filter/lwptoc.cxx @@ -385,7 +385,7 @@ sal_uInt16 LwpTocSuperLayout::GetSeparatorType(sal_uInt16 index) LwpTocLevelData * LwpTocSuperLayout::GetSearchLevelPtr(sal_uInt16 index) { LwpObjectID * pID = m_SearchItems.GetHead(); // not necessary to check pID NULL or not - LwpTocLevelData * pObj = dynamic_cast<LwpTocLevelData *>(pID->obj()); + LwpTocLevelData * pObj = dynamic_cast<LwpTocLevelData *>(pID->obj().get()); while(pObj) { @@ -395,7 +395,7 @@ LwpTocLevelData * LwpTocSuperLayout::GetSearchLevelPtr(sal_uInt16 index) } pID = pObj->GetNext(); // not necessary to check pID NULL or not - pObj = dynamic_cast<LwpTocLevelData *>(pID->obj()); + pObj = dynamic_cast<LwpTocLevelData *>(pID->obj().get()); } return NULL; @@ -409,7 +409,7 @@ LwpTocLevelData * LwpTocSuperLayout::GetSearchLevelPtr(sal_uInt16 index) LwpTocLevelData * LwpTocSuperLayout::GetNextSearchLevelPtr(sal_uInt16 index, LwpTocLevelData * pCurData) { LwpObjectID * pID = pCurData->GetNext(); - LwpTocLevelData * pObj = dynamic_cast<LwpTocLevelData *>(pID->obj()); + LwpTocLevelData * pObj = dynamic_cast<LwpTocLevelData *>(pID->obj().get()); while(pObj) { @@ -419,7 +419,7 @@ LwpTocLevelData * LwpTocSuperLayout::GetNextSearchLevelPtr(sal_uInt16 index, Lwp } pID = pObj->GetNext(); // not necessary to check pID NULL or not - pObj = dynamic_cast<LwpTocLevelData *>(pID->obj()); + pObj = dynamic_cast<LwpTocLevelData *>(pID->obj().get()); } return NULL; diff --git a/lotuswordpro/source/filter/lwptoc.hxx b/lotuswordpro/source/filter/lwptoc.hxx index 00ae8ffaca23..2635a50e3ff1 100644 --- a/lotuswordpro/source/filter/lwptoc.hxx +++ b/lotuswordpro/source/filter/lwptoc.hxx @@ -150,7 +150,6 @@ public: USENUMBER = 0x02 }; LwpTocLevelData(LwpObjectHeader &objHdr, LwpSvStream* pStrm); - virtual ~LwpTocLevelData(); void RegisterStyle() SAL_OVERRIDE; virtual void XFConvert(XFContentContainer* pCont) SAL_OVERRIDE; inline sal_uInt16 GetLevel(void){return m_nLevel;} @@ -158,6 +157,8 @@ public: inline OUString GetSearchStyle(void){return m_SearchName.str();} inline bool GetUseLeadingText(void){ return (m_nFlags & USENUMBER) ? sal_True : sal_False;} private: + virtual ~LwpTocLevelData(); + sal_uInt16 m_nFlags; sal_uInt16 m_nLevel; LwpAtomHolder m_SearchName; diff --git a/lotuswordpro/source/filter/lwpverdocument.hxx b/lotuswordpro/source/filter/lwpverdocument.hxx index 0963d5ab392f..e4854887a762 100644 --- a/lotuswordpro/source/filter/lwpverdocument.hxx +++ b/lotuswordpro/source/filter/lwpverdocument.hxx @@ -75,10 +75,11 @@ class LwpVerDocument : public LwpObject { public: LwpVerDocument(LwpObjectHeader& objHdr, LwpSvStream* pStrm); - virtual ~LwpVerDocument(){} void Read() SAL_OVERRIDE; virtual void RegisterStyle() SAL_OVERRIDE; private: + virtual ~LwpVerDocument(){} + sal_uInt32 m_nTabSpacing; }; #endif diff --git a/lotuswordpro/source/filter/lwpvpointer.cxx b/lotuswordpro/source/filter/lwpvpointer.cxx index 2b90efb4822e..796e0d4b4b2a 100644 --- a/lotuswordpro/source/filter/lwpvpointer.cxx +++ b/lotuswordpro/source/filter/lwpvpointer.cxx @@ -73,8 +73,8 @@ void LwpVersionedPointer::Parse(IXFStream* /*pOutputStream*/) void LwpVersionedPointer::RegisterStyle() { - LwpObject* pObj = m_PointerID.obj(); - if( pObj ) + rtl::Reference<LwpObject> pObj = m_PointerID.obj(); + if( pObj.is() ) { pObj->SetFoundry(m_pFoundry); pObj->RegisterStyle(); diff --git a/lotuswordpro/source/filter/lwpvpointer.hxx b/lotuswordpro/source/filter/lwpvpointer.hxx index dd25e0d28d65..c9bc1f58ce06 100644 --- a/lotuswordpro/source/filter/lwpvpointer.hxx +++ b/lotuswordpro/source/filter/lwpvpointer.hxx @@ -72,13 +72,14 @@ class LwpVersionedPointer : public LwpObject { public: LwpVersionedPointer(LwpObjectHeader& objHdr, LwpSvStream* pStrm); - virtual ~LwpVersionedPointer(){} void Read() SAL_OVERRIDE; void RegisterStyle() SAL_OVERRIDE; void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; LwpObjectID* GetPointer(){return &m_PointerID;} protected: LwpObjectID m_PointerID; +private: + virtual ~LwpVersionedPointer(){} }; #endif |