diff options
author | Noel Grandin <noel@peralex.com> | 2014-06-18 12:14:29 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-06-24 11:34:21 +0200 |
commit | e2080e70fe8b085f18e868e46340454720fa94ca (patch) | |
tree | 4038d1d57b41b68a47d5ebbbe6ad390648ec6303 /lotuswordpro | |
parent | Translated German comments - correction (diff) | |
download | core-e2080e70fe8b085f18e868e46340454720fa94ca.tar.gz core-e2080e70fe8b085f18e868e46340454720fa94ca.zip |
new compilerplugin returnbyref
Find places where we are returning a pointer to something, where we can
be returning a reference.
e.g.
class A {
struct X x;
public X* getX() { return &x; }
}
which can be:
public X& getX() { return x; }
Change-Id: I796fd23fd36a18aedf6e36bc28f8fab4f518c6c7
Diffstat (limited to 'lotuswordpro')
72 files changed, 557 insertions, 591 deletions
diff --git a/lotuswordpro/source/filter/benlist.cxx b/lotuswordpro/source/filter/benlist.cxx index c2ec1235134a..39943c470c86 100644 --- a/lotuswordpro/source/filter/benlist.cxx +++ b/lotuswordpro/source/filter/benlist.cxx @@ -61,8 +61,8 @@ pCBenNamedObject FindNamedObject(pCUtList pList, const char * sName, pCBenNamedObjectListElmt * ppPrev) { - pCUtListElmt pTerminating = pList->GetTerminating(); - for (pCUtListElmt pCurr = pList->GetLast(); pCurr != pTerminating; + CUtListElmt& rTerminating = pList->GetTerminating(); + for (pCUtListElmt pCurr = pList->GetLast(); pCurr != &rTerminating; pCurr = pCurr->GetPrev()) { pCBenNamedObjectListElmt pCurrNamedObjectListElmt = @@ -84,7 +84,7 @@ FindNamedObject(pCUtList pList, const char * sName, } if (ppPrev != NULL) - *ppPrev = (pCBenNamedObjectListElmt) pTerminating; + *ppPrev = (pCBenNamedObjectListElmt) &rTerminating; return NULL; } @@ -92,8 +92,8 @@ FindNamedObject(pCUtList pList, const char * sName, pCBenIDListElmt FindID(pCUtList pList, BenObjectID ObjectID, pCBenIDListElmt * ppPrev) { - pCUtListElmt pTerminating = pList->GetTerminating(); - for (pCUtListElmt pCurr = pList->GetLast(); pCurr != pTerminating; + CUtListElmt& rTerminating = pList->GetTerminating(); + for (pCUtListElmt pCurr = pList->GetLast(); pCurr != &rTerminating; pCurr = pCurr->GetPrev()) { pCBenIDListElmt pCurrIDListElmt = (pCBenIDListElmt) pCurr; @@ -111,7 +111,7 @@ FindID(pCUtList pList, BenObjectID ObjectID, pCBenIDListElmt * ppPrev) } if (ppPrev != NULL) - *ppPrev = (pCBenIDListElmt) pTerminating; + *ppPrev = (pCBenIDListElmt) &rTerminating; return NULL; } } //end namespace OpenStormBento diff --git a/lotuswordpro/source/filter/benobj.cxx b/lotuswordpro/source/filter/benobj.cxx index 4193a6f7f851..f9efc9056358 100644 --- a/lotuswordpro/source/filter/benobj.cxx +++ b/lotuswordpro/source/filter/benobj.cxx @@ -76,7 +76,7 @@ CBenObject::UseValue(BenObjectID PropertyID) pCBenProperty pProperty = UseProperty(PropertyID); if (pProperty == NULL) return NULL; - return pProperty->UseValue(); + return &pProperty->UseValue(); } }// end namespace OpenStormBento diff --git a/lotuswordpro/source/filter/bento.hxx b/lotuswordpro/source/filter/bento.hxx index 1940e16d7a10..677533105fb8 100644 --- a/lotuswordpro/source/filter/bento.hxx +++ b/lotuswordpro/source/filter/bento.hxx @@ -225,8 +225,8 @@ public: // Internal methods BenObjectID GetNextAvailObjectID() { return cNextAvailObjectID; } void SetNextAvailObjectID(BenObjectID ID) { cNextAvailObjectID = ID; } - pCUtList GetObjects() { return &cObjects; } - pCUtList GetNamedObjects() { return &cNamedObjects; } + CUtList& GetObjects() { return cObjects; } + CUtList& GetNamedObjects() { return cNamedObjects; } LtcUtBenValueStream * FindNextValueStreamWithPropertyName(const char * sPropertyName, LtcUtBenValueStream * pCurrentValueStream); LtcUtBenValueStream * FindValueStreamWithPropertyName(const char * sPropertyName); @@ -257,7 +257,7 @@ public: // Internal methods CBenObject(pLtcBenContainer pContainer, BenObjectID ObjectID, pCBenIDListElmt pPrev) : CBenIDListElmt(ObjectID, pPrev) { cpContainer = pContainer; } - pCUtList GetProperties() { return &cProperties; } + CUtList& GetProperties() { return cProperties; } private: // Data pLtcBenContainer cpContainer; @@ -296,7 +296,7 @@ public: // Internal methods inline pCBenValueSegment GetNextValueSegment(pCBenValueSegment pCurrValueSegment); inline pLtcBenContainer GetContainer(); - pCUtList GetValueSegments() { return &cValueSegments; } + CUtList& GetValueSegments() { return cValueSegments; } // Currently, no generation support BenGeneration GetGeneration() { return 1; } @@ -313,7 +313,7 @@ public: // different type. But we never use it that way, so in this code a // property has exactly one value - pCBenValue UseValue() { return &cValue; } + CBenValue& UseValue() { return cValue; } pCBenObject GetBenObject() { return cpObject; } pLtcBenContainer GetContainer() { return GetBenObject()->GetContainer(); } @@ -351,11 +351,11 @@ class CBenValueSegment : public CUtListElmt { public: // Internal methods CBenValueSegment(pCBenValue pValue, BenContainerPos Pos, - unsigned long Size) : CUtListElmt(pValue->GetValueSegments()) + unsigned long Size) : CUtListElmt(&pValue->GetValueSegments()) { cpValue = pValue; cImmediate = false; cPos = Pos; cSize = Size; } CBenValueSegment(pCBenValue pValue, BenConstDataPtr pImmData, - unsigned short Size) : CUtListElmt(pValue->GetValueSegments()) + unsigned short Size) : CUtListElmt(&pValue->GetValueSegments()) { cpValue = pValue; cImmediate = true; UtHugeMemcpy(cImmData, pImmData, Size); cSize = Size; } CBenValueSegment(BenContainerPos Pos, unsigned long Size) @@ -366,7 +366,7 @@ public: // Internal methods UtHugeMemcpy(cImmData, pImmData, Size); cSize = Size; } bool IsLast() { - return cpValue == NULL || cpValue->GetValueSegments()->GetLast() == + return cpValue == NULL || cpValue->GetValueSegments().GetLast() == this; } bool IsImmediate() { return cImmediate; } @@ -411,7 +411,7 @@ public: // Internal methods void SetPosition(BenContainerPos Pos) { cPos = Pos; } BenContainerPos GetPosition(void) { return cPos; } size_t GetLength(void) { return csName.length()+ 1; } - pCBenNamedObjectListElmt GetNameListElmt() { return &cNameListElmt; } + CBenNamedObjectListElmt& GetNameListElmt() { return cNameListElmt; } private: // Data std::string csName; diff --git a/lotuswordpro/source/filter/lwp9reader.cxx b/lotuswordpro/source/filter/lwp9reader.cxx index fe77bd2b078d..d83b84178127 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().get() ); + LwpDocument* doc = dynamic_cast<LwpDocument*> ( m_LwpFileHdr.GetDocID().obj().get() ); if (!doc) return; //Parse Doc Data - LwpDocData *pDocData = dynamic_cast<LwpDocData*>((doc->GetDocData())->obj().get()); + LwpDocData *pDocData = dynamic_cast<LwpDocData*>(doc->GetDocData().obj().get()); if (pDocData!=NULL) pDocData->Parse(m_pStream); diff --git a/lotuswordpro/source/filter/lwpbackgroundoverride.hxx b/lotuswordpro/source/filter/lwpbackgroundoverride.hxx index afd3e89c606e..1bbebfa1f907 100644 --- a/lotuswordpro/source/filter/lwpbackgroundoverride.hxx +++ b/lotuswordpro/source/filter/lwpbackgroundoverride.hxx @@ -83,7 +83,7 @@ public: } LwpColor GetBackColor(){ return m_aStuff.m_aFillColor; } - LwpBackgroundStuff* GetBGStuff() { return &m_aStuff; } + LwpBackgroundStuff& GetBGStuff() { return m_aStuff; } protected: LwpBackgroundOverride(LwpBackgroundOverride const& rOther); diff --git a/lotuswordpro/source/filter/lwpbulletstylemgr.cxx b/lotuswordpro/source/filter/lwpbulletstylemgr.cxx index f8f6225772a1..992a16dd1f8b 100644 --- a/lotuswordpro/source/filter/lwpbulletstylemgr.cxx +++ b/lotuswordpro/source/filter/lwpbulletstylemgr.cxx @@ -155,8 +155,8 @@ OUString LwpBulletStyleMgr::RegisterBulletStyle(LwpPara* pPara, LwpBulletOverrid m_vIDsPairList.push_back(std::make_pair(pBulletOver, aIndentID)); OUString aStyleName; - LwpFribPtr* pBulletParaFribs = pBulletPara->GetFribs(); - bool bIsNumbering = (pBulletParaFribs->HasFrib(FRIB_TAG_PARANUMBER) != 0); + LwpFribPtr& rBulletParaFribs = pBulletPara->GetFribs(); + bool bIsNumbering = (rBulletParaFribs.HasFrib(FRIB_TAG_PARANUMBER) != 0); enumXFAlignType eAlign = enumXFAlignStart; if (pBullOver->IsRightAligned()) diff --git a/lotuswordpro/source/filter/lwpcelllayout.cxx b/lotuswordpro/source/filter/lwpcelllayout.cxx index 85df93ec26ed..6510ccb5660b 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().get()); + LwpRowLayout * pRow = dynamic_cast<LwpRowLayout *>(GetParent().obj().get()); if(!pRow) { return NULL; @@ -272,7 +272,7 @@ void LwpCellLayout::ApplyFmtStyle(XFCellStyle *pCellStyle) LwpCellLayout* pCellLayout = dynamic_cast<LwpCellLayout*>(m_BasedOnStyle.obj().get()); if (pCellLayout) { - pLayoutNumerics = dynamic_cast<LwpLayoutNumerics*>(pCellLayout->GetNumericsObject()->obj().get()); + pLayoutNumerics = dynamic_cast<LwpLayoutNumerics*>(pCellLayout->GetNumericsObject().obj().get()); } } @@ -325,7 +325,7 @@ XFCell* LwpCellLayout::ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uI // if cell layout is aTableID's default cell layout // we should judt its style by current position - if (*pTable->GetDefaultCellStyle() == *GetObjectID()) + if (pTable->GetDefaultCellStyle() == GetObjectID()) { aStyleName = GetCellStyleName(nRow, nCol, pTable->GetTableLayout()); } @@ -348,7 +348,7 @@ LwpPara* LwpCellLayout::GetLastParaOfPreviousStory() if (pPreStoryID && !(pPreStoryID->IsNull())) { LwpStory* pPreStory = dynamic_cast<LwpStory*>(pPreStoryID->obj(VO_STORY).get()); - return dynamic_cast<LwpPara*>(pPreStory->GetLastPara()->obj(VO_PARA).get()); + return dynamic_cast<LwpPara*>(pPreStory->GetLastPara().obj(VO_PARA).get()); } else { @@ -433,8 +433,8 @@ LwpCellBorderType LwpCellLayout::GetCellBorderType(sal_uInt16 nRow, sal_uInt16 n { return enumWholeBorder; } - XFBorder *pLeftBorder = pBorders->GetLeft(); - XFBorder *pBottomBorder = pBorders->GetBottom(); + XFBorder& rLeftBorder = pBorders->GetLeft(); + XFBorder& rBottomBorder = pBorders->GetBottom(); bool bNoLeftBorder = false; bool bNoBottomBorder = false; @@ -444,8 +444,8 @@ LwpCellBorderType LwpCellLayout::GetCellBorderType(sal_uInt16 nRow, sal_uInt16 n XFBorders * pNeighbourBorders = pLeftNeighbour->GetXFBorders(); if (pNeighbourBorders) { - XFBorder * pRightBorder = pNeighbourBorders->GetRight(); - if (*pLeftBorder == *pRightBorder) + XFBorder& rRightBorder = pNeighbourBorders->GetRight(); + if (rLeftBorder == rRightBorder) { // for these 2 types cell, left border should be ignored for sake of avoiding duplication border // but if left border is different with right border of left cell @@ -463,8 +463,8 @@ LwpCellBorderType LwpCellLayout::GetCellBorderType(sal_uInt16 nRow, sal_uInt16 n XFBorders * pBelowBorders = pBelowNeighbour->GetXFBorders(); if (pBelowBorders) { - XFBorder * pTopBorder = pBelowBorders->GetTop(); - if (*pTopBorder == *pBottomBorder) + XFBorder& rTopBorder = pBelowBorders->GetTop(); + if (rTopBorder == rBottomBorder) { // for these 2 types cell, bottom border should be ignored for sake of avoiding duplication border // but if bottom border is different with right border of left cell @@ -571,7 +571,7 @@ void LwpCellLayout::RegisterDefaultCell() */ void LwpCellLayout::RegisterStyle() { - LwpVirtualLayout * pParent = dynamic_cast<LwpVirtualLayout *>(GetParent()->obj().get()); + 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 @@ -730,8 +730,8 @@ LwpCellBorderType LwpConnectedCellLayout::GetCellBorderType(sal_uInt16 nRow, sal { return enumWholeBorder; } - XFBorder *pLeftBorder = pBorders->GetLeft(); - XFBorder *pBottomBorder = pBorders->GetBottom(); + XFBorder& rLeftBorder = pBorders->GetLeft(); + XFBorder& rBottomBorder = pBorders->GetBottom(); bool bNoLeftBorder = true; bool bNoBottomBorder = true; @@ -749,8 +749,8 @@ LwpCellBorderType LwpConnectedCellLayout::GetCellBorderType(sal_uInt16 nRow, sal boost::scoped_ptr<XFBorders> pNeighbourBorders(pLeftNeighbour->GetXFBorders()); if (pNeighbourBorders) { - XFBorder * pRightBorder = pNeighbourBorders->GetRight(); - if (*pLeftBorder != *pRightBorder) + XFBorder& rRightBorder = pNeighbourBorders->GetRight(); + if (rLeftBorder != rRightBorder) { // if left border is different with right border of left cell // we should not ignored it @@ -776,8 +776,8 @@ LwpCellBorderType LwpConnectedCellLayout::GetCellBorderType(sal_uInt16 nRow, sal boost::scoped_ptr<XFBorders> pBelowBorders(pBelowNeighbour->GetXFBorders()); if (pBelowBorders) { - XFBorder * pTopBorder = pBelowBorders->GetTop(); - if (*pTopBorder != *pBottomBorder) + XFBorder& rTopBorder = pBelowBorders->GetTop(); + if (rTopBorder != rBottomBorder) { // if bottom border is different with right border of left cell // we should not ignored it @@ -889,7 +889,7 @@ XFCell* LwpHiddenCellLayout::ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, LwpTable *pTable = dynamic_cast<LwpTable *>(aTableID.obj().get()); if (pTable) { - LwpCellLayout *pDefault = dynamic_cast<LwpCellLayout *>(pTable->GetDefaultCellStyle()->obj().get()); + LwpCellLayout *pDefault = dynamic_cast<LwpCellLayout *>(pTable->GetDefaultCellStyle().obj().get()); if (pDefault) { pXFCell = pDefault->ConvertCell(aTableID, nRow, nCol); diff --git a/lotuswordpro/source/filter/lwpcelllayout.hxx b/lotuswordpro/source/filter/lwpcelllayout.hxx index d9ab7589609f..a6123a42f565 100644 --- a/lotuswordpro/source/filter/lwpcelllayout.hxx +++ b/lotuswordpro/source/filter/lwpcelllayout.hxx @@ -96,7 +96,7 @@ public: sal_uInt16 GetRowID(){return crowid;} sal_uInt8 GetColID(){return ccolid;} void RegisterStyle() SAL_OVERRIDE; - LwpObjectID * GetNumericsObject() {return &cLayNumerics;} + LwpObjectID& GetNumericsObject() {return cLayNumerics;} LwpObjectID * GetPreviousCellStory(); virtual LwpPara* GetLastParaOfPreviousStory() SAL_OVERRIDE; LwpTableLayout * GetTableLayout(); diff --git a/lotuswordpro/source/filter/lwpcharacterstyle.cxx b/lotuswordpro/source/filter/lwpcharacterstyle.cxx index 1cb925baa7c6..8b61199ceeae 100644 --- a/lotuswordpro/source/filter/lwpcharacterstyle.cxx +++ b/lotuswordpro/source/filter/lwpcharacterstyle.cxx @@ -176,19 +176,19 @@ void LwpTextStyle::RegisterStyle() XFTextStyle* pStyle = new XFTextStyle(); //Set name - OUString styleName = GetName()->str(); + OUString styleName = GetName().str(); pStyle->SetStyleName(styleName); //Create font - LwpFontManager* pFontMgr = m_pFoundry->GetFontManger(); - rtl::Reference<XFFont> pFont = pFontMgr->CreateFont(m_nFinalFontID); + LwpFontManager& rFontMgr = m_pFoundry->GetFontManger(); + rtl::Reference<XFFont> pFont = rFontMgr.CreateFont(m_nFinalFontID); pStyle->SetFont(pFont); //Set other properties if needed //Add style LwpStyleManager* pStyleMgr = m_pFoundry->GetStyleManager(); - pStyleMgr->AddStyle(*GetObjectID(), pStyle); + pStyleMgr->AddStyle(GetObjectID(), pStyle); } diff --git a/lotuswordpro/source/filter/lwpcontent.hxx b/lotuswordpro/source/filter/lwpcontent.hxx index 70a03da5a466..cd85bd5b1893 100644 --- a/lotuswordpro/source/filter/lwpcontent.hxx +++ b/lotuswordpro/source/filter/lwpcontent.hxx @@ -109,7 +109,7 @@ protected: protected: void Read() SAL_OVERRIDE; public: - inline LwpAssociatedLayouts* GetLayoutsWithMe(); + inline LwpAssociatedLayouts& GetLayoutsWithMe(); LwpVirtualLayout* GetLayout(LwpVirtualLayout* pStartLayout); inline bool IsActive(); virtual bool IsTable(); @@ -119,9 +119,9 @@ public: bool IsStyleContent(); }; -LwpAssociatedLayouts* LwpContent::GetLayoutsWithMe() +LwpAssociatedLayouts& LwpContent::GetLayoutsWithMe() { - return &m_LayoutsWithMe; + return m_LayoutsWithMe; } inline bool LwpContent::IsActive() diff --git a/lotuswordpro/source/filter/lwpdivinfo.cxx b/lotuswordpro/source/filter/lwpdivinfo.cxx index 5a93497591eb..2e975875a8ff 100644 --- a/lotuswordpro/source/filter/lwpdivinfo.cxx +++ b/lotuswordpro/source/filter/lwpdivinfo.cxx @@ -166,11 +166,11 @@ sal_uInt16 LwpDivInfo::GetMaxNumberOfPages() LwpDocument* pDiv = GetDivision(); if(!pDiv) return 0; - LwpDLVListHeadTailHolder* pHeadTail = static_cast<LwpDLVListHeadTailHolder*>(pDiv->GetPageHintsID()->obj().get()); + LwpDLVListHeadTailHolder* pHeadTail = static_cast<LwpDLVListHeadTailHolder*>(pDiv->GetPageHintsID().obj().get()); if(pHeadTail) { - LwpPageHint* pPageHint =static_cast<LwpPageHint*>(pHeadTail->GetTail()->obj().get()); - if(pPageHint && !pPageHint->GetPageLayoutID()->IsNull()) + 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 b191f15a8b48..f99d8079ffed 100644 --- a/lotuswordpro/source/filter/lwpdivinfo.hxx +++ b/lotuswordpro/source/filter/lwpdivinfo.hxx @@ -78,8 +78,8 @@ class LwpDivInfo : public LwpObject { public: LwpDivInfo(LwpObjectHeader& objHdr, LwpSvStream* pStrm); - LwpObjectID* GetInitialLayoutID(){ return &m_InitialLayoutID;} - LwpObjectID* GetFillerPageTextID(){ return &m_FillerPageTextID;} + LwpObjectID& GetInitialLayoutID() { return m_InitialLayoutID; } + LwpObjectID& GetFillerPageTextID() { return m_FillerPageTextID; } // add by ,03/14/2004 OUString GetDivName() { return m_Name.str(); } // end add @@ -92,7 +92,7 @@ public: inline LwpDocument* GetDivision(); void GetNumberOfPages(sal_uInt16& nPageno); sal_uInt16 GetMaxNumberOfPages(); - LwpAtomHolder* GetExternalName(){return &m_ExternalName;} + LwpAtomHolder& GetExternalName() { return m_ExternalName; } protected: void Read() SAL_OVERRIDE; private: diff --git a/lotuswordpro/source/filter/lwpdlvlist.hxx b/lotuswordpro/source/filter/lwpdlvlist.hxx index 7b36c34f0179..2255792ab592 100644 --- a/lotuswordpro/source/filter/lwpdlvlist.hxx +++ b/lotuswordpro/source/filter/lwpdlvlist.hxx @@ -83,8 +83,8 @@ protected: protected: void Read() SAL_OVERRIDE; public: - LwpObjectID* GetNext() { return &m_ListNext; } - LwpObjectID* GetPrevious() { return &m_ListPrevious; } + LwpObjectID& GetNext() { return m_ListNext; } + LwpObjectID& GetPrevious() { return m_ListPrevious; } }; /** @@ -106,11 +106,11 @@ protected: void ReadName(LwpObjectStream* pObjStrm); public: // 01/17/2005 - LwpAtomHolder* GetName() { return &m_Name; } + LwpAtomHolder& GetName() { return m_Name; } //end - LwpObjectID* GetChildHead() { return &m_ChildHead; } - LwpObjectID* GetChildTail() { return &m_ChildTail; } - LwpObjectID* GetParent() { return &m_Parent; } + LwpObjectID& GetChildHead() { return m_ChildHead; } + LwpObjectID& GetChildTail() { return m_ChildTail; } + LwpObjectID& GetParent() { return m_Parent; } }; @@ -145,8 +145,8 @@ private: LwpObjectID m_ListHead; LwpObjectID m_ListTail; public: - LwpObjectID* GetHead() { return &m_ListHead; } - LwpObjectID* GetTail() { return &m_ListTail; } + LwpObjectID& GetHead() { return m_ListHead; } + LwpObjectID& GetTail() { return m_ListTail; } }; /** @@ -158,7 +158,7 @@ public: LwpDLVListHead(){} ~LwpDLVListHead(){} void Read(LwpObjectStream* pObjStrm); - LwpObjectID* GetFirst() { return &m_objHead; } + LwpObjectID& GetFirst() { return m_objHead; } protected: LwpObjectID m_objHead;//LwpDLVList }; diff --git a/lotuswordpro/source/filter/lwpdoc.cxx b/lotuswordpro/source/filter/lwpdoc.cxx index 7b421685bc88..e2ab2a793175 100644 --- a/lotuswordpro/source/filter/lwpdoc.cxx +++ b/lotuswordpro/source/filter/lwpdoc.cxx @@ -163,7 +163,7 @@ void LwpDocument::Parse(IXFStream* pOutputStream) ParseDocContent(pOutputStream); } - rtl::Reference<LwpObject> pDocSock = GetSocket()->obj( VO_DOCSOCK ); + 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).get()); + LwpDivInfo* pDiv = dynamic_cast<LwpDivInfo*>(GetDivInfoID().obj(VO_DIVISIONINFO).get()); if (pDiv == NULL) return true; sDivName = pDiv->GetDivName(); @@ -186,17 +186,17 @@ bool LwpDocument::IsSkippedDivision() || (strClassName == STR_DivisionGroupEndnote) || (strClassName == STR_DocumentEndnote)) { - LwpPageLayout* pPageLayout = dynamic_cast<LwpPageLayout*>(pDiv->GetInitialLayoutID()->obj(VO_PAGELAYOUT).get()); + LwpPageLayout* pPageLayout = dynamic_cast<LwpPageLayout*>(pDiv->GetInitialLayoutID().obj(VO_PAGELAYOUT).get()); if(pPageLayout) { - LwpStory* pStory = dynamic_cast<LwpStory*>(pPageLayout->GetContent()->obj(VO_STORY).get()); + 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, //this endnote division has no other contents except endnote table. - LwpObjectID* pFirst = pStory->GetFirstPara(); - LwpObjectID* pLast = pStory->GetLastPara(); - if(*pFirst == *pLast) + LwpObjectID& rFirst = pStory->GetFirstPara(); + LwpObjectID& rLast = pStory->GetLastPara(); + if(rFirst == rLast) ret = true; } } @@ -221,7 +221,7 @@ void LwpDocument::RegisterStyle() RegisterFootnoteStyles(); //Register styles in other document connected with this document: next doc, children doc - rtl::Reference<LwpObject> pDocSock = GetSocket()->obj(); + 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().get()); + LwpDLVListHeadHolder* pParaStyleHolder = dynamic_cast<LwpDLVListHeadHolder*>(m_pFoundry->GetTextStyleHead().obj().get()); if(pParaStyleHolder) { - LwpTextStyle* pParaStyle = dynamic_cast<LwpTextStyle*> (pParaStyleHolder->GetHeadID()->obj().get()); + LwpTextStyle* pParaStyle = dynamic_cast<LwpTextStyle*> (pParaStyleHolder->GetHeadID().obj().get()); while(pParaStyle) { pParaStyle->SetFoundry(m_pFoundry); pParaStyle->RegisterStyle(); - pParaStyle = dynamic_cast<LwpParaStyle*>(pParaStyle->GetNext()->obj().get()); + pParaStyle = dynamic_cast<LwpParaStyle*>(pParaStyle->GetNext().obj().get()); } } ChangeStyleName();//add by ,for click here block,05/5/26 @@ -260,11 +260,11 @@ void LwpDocument::RegisterLayoutStyles() LwpPageLayout* pPageLayout = NULL; if(pDivInfo) { - pPageLayout = dynamic_cast<LwpPageLayout*>(pDivInfo->GetInitialLayoutID()->obj(VO_PAGELAYOUT).get()); + 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).get()); + 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().get()); + LwpHeadContent* pContent = dynamic_cast<LwpHeadContent*> (m_pFoundry->GetContentManager().GetContentList().obj().get()); if(pContent) { - LwpStory* pStory = dynamic_cast<LwpStory*>(pContent->GetChildHead()->obj(VO_STORY).get()); + 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).get()); + 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).get()); + (m_pFoundry->GetBulletManagerID().obj(VO_HEADHOLDER).get()); if( mBulletHead ) { LwpSilverBullet* pBullet = dynamic_cast<LwpSilverBullet*> - (mBulletHead->GetHeadID()->obj().get()); + (mBulletHead->GetHeadID().obj().get()); while(pBullet) { pBullet->SetFoundry(m_pFoundry); pBullet->RegisterStyle(); - pBullet = dynamic_cast<LwpSilverBullet*> (pBullet->GetNext()->obj().get()); + pBullet = dynamic_cast<LwpSilverBullet*> (pBullet->GetNext().obj().get()); } } } @@ -319,7 +319,7 @@ void LwpDocument::RegisterBulletStyles() void LwpDocument::RegisterGraphicsStyles() { //Register all graphics styles, the first object should register the next; - rtl::Reference<LwpObject> pGraphic = m_pFoundry->GetGraphicListHead()->obj(VO_GRAPHIC); + rtl::Reference<LwpObject> pGraphic = m_pFoundry->GetGraphicListHead().obj(VO_GRAPHIC); if(pGraphic.is()) { pGraphic->SetFoundry(m_pFoundry); @@ -356,13 +356,13 @@ void LwpDocument::RegisterFootnoteStyles() LwpDocument* pEndnoteDiv = GetLastDivisionThatHasEndnote(); if(this == pEndnoteDiv) { - LwpDLVListHeadTailHolder* pHeadTail = dynamic_cast<LwpDLVListHeadTailHolder*>(GetPageHintsID()->obj().get()); + LwpDLVListHeadTailHolder* pHeadTail = dynamic_cast<LwpDLVListHeadTailHolder*>(GetPageHintsID().obj().get()); if(pHeadTail) { - LwpPageHint* pPageHint = dynamic_cast<LwpPageHint*>(pHeadTail->GetTail()->obj().get()); - if(pPageHint && !pPageHint->GetPageLayoutID()->IsNull()) + LwpPageHint* pPageHint = dynamic_cast<LwpPageHint*>(pHeadTail->GetTail().obj().get()); + if(pPageHint && !pPageHint->GetPageLayoutID().IsNull()) { - LwpPageLayout* pPageLayout = dynamic_cast<LwpPageLayout*>(pPageHint->GetPageLayoutID()->obj().get()); + 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().get()); + LwpVerDocument* pVerDoc = dynamic_cast<LwpVerDocument*>(pFirstDoc->GetVerDoc().obj().get()); if(pVerDoc) { pVerDoc->RegisterStyle(); @@ -406,7 +406,7 @@ void LwpDocument::ParseDocContent(IXFStream* pOutputStream) LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*> (m_DivInfo.obj().get()); if(pDivInfo==NULL) return; - rtl::Reference<LwpObject> pLayoutObj = pDivInfo->GetInitialLayoutID()->obj(); + rtl::Reference<LwpObject> pLayoutObj = pDivInfo->GetInitialLayoutID().obj(); if(!pLayoutObj.is()) { //master document not supported now. @@ -424,7 +424,7 @@ LwpObjectID* LwpDocument::GetValidFootnoteOpts() LwpDocument* pRoot = GetRootDocument(); if(pRoot) { - return pRoot->GetFootnoteOpts(); + return &pRoot->GetFootnoteOpts(); } return NULL; } @@ -434,7 +434,7 @@ LwpObjectID* LwpDocument::GetValidFootnoteOpts() */ sal_uInt16 LwpDocument::GetEndnoteType() { - LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(GetDivInfoID()->obj().get()); + 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().get()); + LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket().obj().get()); if(pDocSock) { - return dynamic_cast<LwpDocument*>(pDocSock->GetPrevious()->obj().get()); + 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().get()); + LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket().obj().get()); if(pDocSock) { - return dynamic_cast<LwpDocument*>(pDocSock->GetNext()->obj().get()); + 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().get()); + LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket().obj().get()); if(pDocSock) { - return dynamic_cast<LwpDocument*>(pDocSock->GetParent()->obj().get()); + 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().get()); + 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().get()); + 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().get()); + 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().get()); + 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().get()); + LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket().obj().get()); if(pDocSock) - return dynamic_cast<LwpDocument*>(pDocSock->GetChildTail()->obj().get()); + 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().get()); + LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket().obj().get()); if(pDocSock) - return dynamic_cast<LwpDocument*>(pDocSock->GetChildHead()->obj().get()); + 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().get()); + 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().get()); + LwpHeadLayout* pHeadLayout = dynamic_cast<LwpHeadLayout*>(GetFoundry()->GetLayout().obj().get()); if(pHeadLayout) { return pHeadLayout->FindEnSuperTableLayout(); @@ -737,13 +737,13 @@ void LwpDocument::XFConvertFrameInPage(XFContentContainer * pCont) { LwpDocument* pDivision = GetFirstDivision(); - LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*> (GetDivInfoID()->obj().get()); + LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*> (GetDivInfoID().obj().get()); if(pDivInfo) { - LwpPageLayout* pPageLayout = dynamic_cast<LwpPageLayout*>(pDivInfo->GetInitialLayoutID()->obj().get()); + LwpPageLayout* pPageLayout = dynamic_cast<LwpPageLayout*>(pDivInfo->GetInitialLayoutID().obj().get()); if(pPageLayout) { - LwpStory* pStory = dynamic_cast<LwpStory*>(pPageLayout->GetContent()->obj().get()); + LwpStory* pStory = dynamic_cast<LwpStory*>(pPageLayout->GetContent().obj().get()); if(pStory) pStory->XFConvertFrameInPage(pCont); } @@ -784,11 +784,11 @@ void LwpDocSock::Read() */ void LwpDocSock::RegisterStyle() { - rtl::Reference<LwpObject> pDoc = GetNext()->obj(); + rtl::Reference<LwpObject> pDoc = GetNext().obj(); if(pDoc.is()) pDoc->RegisterStyle(); - pDoc = GetChildHead()->obj(); + pDoc = GetChildHead().obj(); if(pDoc.is()) pDoc->RegisterStyle(); } @@ -797,11 +797,11 @@ void LwpDocSock::RegisterStyle() */ void LwpDocSock::Parse(IXFStream* pOutputStream) { - rtl::Reference<LwpObject> pDoc = GetChildHead()->obj(); + rtl::Reference<LwpObject> pDoc = GetChildHead().obj(); if(pDoc.is()) pDoc->Parse(pOutputStream); - pDoc = GetNext()->obj(); + pDoc = GetNext().obj(); if(pDoc.is()) pDoc->Parse(pOutputStream); } diff --git a/lotuswordpro/source/filter/lwpdoc.hxx b/lotuswordpro/source/filter/lwpdoc.hxx index 44155873e9cc..724fea776716 100644 --- a/lotuswordpro/source/filter/lwpdoc.hxx +++ b/lotuswordpro/source/filter/lwpdoc.hxx @@ -138,15 +138,15 @@ public: inline bool IsChildDoc(); inline bool HonorProtection(); - inline LwpObjectID* GetContentList(); - inline LwpObjectID* GetDocData(); - inline LwpObjectID* GetSocket(); + inline LwpObjectID& GetContentList(); + inline LwpObjectID& GetDocData(); + inline LwpObjectID& GetSocket(); inline LwpFoundry* GetFoundry(); - inline LwpObjectID* GetDivInfoID(); - inline LwpObjectID* GetPageHintsID(); - inline LwpObjectID* GetFootnoteOpts(); - inline LwpObjectID* GetVerDoc(); + inline LwpObjectID& GetDivInfoID(); + inline LwpObjectID& GetPageHintsID(); + inline LwpObjectID& GetFootnoteOpts(); + inline LwpObjectID& GetVerDoc(); LwpObjectID* GetValidFootnoteOpts(); sal_uInt16 GetEndnoteType(); @@ -186,37 +186,37 @@ inline bool LwpDocument::HonorProtection() { return m_nPersistentFlags & DOC_PROTECTED; } -inline LwpObjectID* LwpDocument::GetContentList() +inline LwpObjectID& LwpDocument::GetContentList() { - return(m_pFoundry->GetContentManager()->GetContentList()); + return m_pFoundry->GetContentManager().GetContentList(); } -inline LwpObjectID* LwpDocument::GetSocket() +inline LwpObjectID& LwpDocument::GetSocket() { - return &m_DocSockID; + return m_DocSockID; } inline LwpFoundry* LwpDocument::GetFoundry() { return m_pFoundry; } -inline LwpObjectID* LwpDocument::GetDivInfoID() +inline LwpObjectID& LwpDocument::GetDivInfoID() { - return &m_DivInfo; + return m_DivInfo; } -inline LwpObjectID* LwpDocument::GetPageHintsID() +inline LwpObjectID& LwpDocument::GetPageHintsID() { - return &m_WYSIWYGPageHints; + return m_WYSIWYGPageHints; } -inline LwpObjectID* LwpDocument::GetFootnoteOpts() +inline LwpObjectID& LwpDocument::GetFootnoteOpts() { - return &m_FootnoteOpts; + return m_FootnoteOpts; } -inline LwpObjectID* LwpDocument::GetDocData() +inline LwpObjectID& LwpDocument::GetDocData() { - return &m_DocData; + return m_DocData; } -inline LwpObjectID* LwpDocument::GetVerDoc() +inline LwpObjectID& LwpDocument::GetVerDoc() { - return &m_VerDoc; + return m_VerDoc; } /** diff --git a/lotuswordpro/source/filter/lwpfilehdr.hxx b/lotuswordpro/source/filter/lwpfilehdr.hxx index 896e3330857b..73a2ebabcb2d 100644 --- a/lotuswordpro/source/filter/lwpfilehdr.hxx +++ b/lotuswordpro/source/filter/lwpfilehdr.hxx @@ -76,15 +76,15 @@ public: static sal_uInt16 m_nFileRevision; sal_uInt32 Read(LwpSvStream *pStrm); sal_uInt32 GetRootIndexOffset(); - LwpObjectID* GetDocID(); + LwpObjectID& GetDocID(); }; inline sal_uInt32 LwpFileHeader::GetRootIndexOffset() { return m_nRootIndexOffset; } -inline LwpObjectID* LwpFileHeader::GetDocID() +inline LwpObjectID& LwpFileHeader::GetDocID() { - return &m_cDocumentID; + return m_cDocumentID; } #endif diff --git a/lotuswordpro/source/filter/lwpfnlayout.cxx b/lotuswordpro/source/filter/lwpfnlayout.cxx index 595f43ac1940..86ddc5fb5452 100644 --- a/lotuswordpro/source/filter/lwpfnlayout.cxx +++ b/lotuswordpro/source/filter/lwpfnlayout.cxx @@ -118,15 +118,15 @@ void LwpFnRowLayout::Read() void LwpFnRowLayout::RegisterStyle() { // register cells' style - LwpObjectID *pCellID= GetChildHead(); - LwpCellLayout * pCellLayout = static_cast<LwpCellLayout *>(pCellID->obj().get()); + LwpObjectID& rCellID = GetChildHead(); + LwpCellLayout * pCellLayout = static_cast<LwpCellLayout *>(rCellID.obj().get()); while(pCellLayout) { pCellLayout->SetFoundry(m_pFoundry); pCellLayout->RegisterStyle(); - pCellID = pCellLayout->GetNext(); - pCellLayout = static_cast<LwpCellLayout *>(pCellID->obj().get()); + rCellID = pCellLayout->GetNext(); + pCellLayout = static_cast<LwpCellLayout *>(rCellID.obj().get()); } } @@ -198,15 +198,15 @@ void LwpEndnoteLayout::Read() void LwpEndnoteLayout::RegisterStyle() { // register style of rows - LwpObjectID *pRowID = GetChildHead(); - LwpRowLayout * pRowLayout = static_cast<LwpRowLayout *>(pRowID->obj().get()); + LwpObjectID& rRowID = GetChildHead(); + LwpRowLayout * pRowLayout = static_cast<LwpRowLayout *>(rRowID.obj().get()); while (pRowLayout) { pRowLayout->SetFoundry(m_pFoundry); pRowLayout->RegisterStyle(); - pRowID = pRowLayout->GetNext(); - pRowLayout = static_cast<LwpRowLayout *>(pRowID->obj().get()); + rRowID = pRowLayout->GetNext(); + pRowLayout = static_cast<LwpRowLayout *>(rRowID.obj().get()); } } @@ -258,11 +258,11 @@ void LwpEnSuperTableLayout::XFConvert(XFContentContainer * /*pCont*/) */ LwpVirtualLayout* LwpEnSuperTableLayout::GetMainTableLayout() { - LwpObjectID *pID = GetChildTail(); + LwpObjectID& rID = GetChildTail(); - while(pID && !pID->IsNull()) + while(!rID.IsNull()) { - LwpVirtualLayout * pLayout = static_cast<LwpVirtualLayout *>(pID->obj().get()); + LwpVirtualLayout * pLayout = static_cast<LwpVirtualLayout *>(rID.obj().get()); if(!pLayout) { break; @@ -271,7 +271,7 @@ void LwpEnSuperTableLayout::XFConvert(XFContentContainer * /*pCont*/) { return pLayout; } - pID = pLayout->GetPrevious(); + rID = pLayout->GetPrevious(); } return NULL; @@ -314,11 +314,11 @@ void LwpFnSuperTableLayout::XFConvert(XFContentContainer * /*pCont*/) */ LwpVirtualLayout* LwpFnSuperTableLayout::GetMainTableLayout() { - LwpObjectID *pID = GetChildTail(); + LwpObjectID& rID = GetChildTail(); - while(pID && !pID->IsNull()) + while(!rID.IsNull()) { - LwpVirtualLayout * pLayout = static_cast<LwpVirtualLayout *>(pID->obj().get()); + LwpVirtualLayout * pLayout = static_cast<LwpVirtualLayout *>(rID.obj().get()); if(!pLayout) { break; @@ -327,7 +327,7 @@ LwpVirtualLayout* LwpFnSuperTableLayout::GetMainTableLayout() { return pLayout; } - pID = pLayout->GetPrevious(); + rID = pLayout->GetPrevious(); } return NULL; diff --git a/lotuswordpro/source/filter/lwpfootnote.cxx b/lotuswordpro/source/filter/lwpfootnote.cxx index 1761b281915d..19467ef830f1 100644 --- a/lotuswordpro/source/filter/lwpfootnote.cxx +++ b/lotuswordpro/source/filter/lwpfootnote.cxx @@ -212,7 +212,7 @@ LwpCellLayout* LwpFootnote::GetCellLayout() LwpRowLayout* pRowLayout = pTableLayout->GetRowLayout(m_nRow); if(pRowLayout) { - return dynamic_cast<LwpCellLayout*>(pRowLayout->GetChildHead()->obj().get()); + return dynamic_cast<LwpCellLayout*>(pRowLayout->GetChildHead().obj().get()); } } } @@ -235,7 +235,7 @@ LwpDocument* LwpFootnote::GetFootnoteTableDivision() // The division might not have a DivisionInfo if it's being Destruct()ed pPrev = m_pFoundry->GetDocument(); pFootnoteDivision = pPrev; - if (!pPrev || pPrev->GetDivInfoID()->IsNull()) + if (!pPrev || pPrev->GetDivInfoID().IsNull()) return NULL; switch (m_nType) @@ -396,7 +396,7 @@ LwpContent* LwpFootnote::FindFootnoteContent() LwpCellLayout* pCellLayout = GetCellLayout(); if(pCellLayout) { - pContent = dynamic_cast<LwpContent*>(pCellLayout->GetContent()->obj().get()); + 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 1abb13552a84..703249fe0af2 100644 --- a/lotuswordpro/source/filter/lwpfootnote.hxx +++ b/lotuswordpro/source/filter/lwpfootnote.hxx @@ -231,7 +231,7 @@ public: sal_uInt32 GetIndent(){ return m_nIndent;} sal_uInt32 GetAbove(){ return m_nAbove;} sal_uInt32 GetBelow(){ return m_nBelow;} - LwpBorderStuff* GetBorderStuff(){ return &m_BorderStuff;} + LwpBorderStuff& GetBorderStuff(){ return m_BorderStuff;} bool HasCustomLength(){ return (m_nFlag & CUSTOM_LENGTH) != 0;} bool HasSeparator(){ return (m_nFlag & HAS_SEPARATOR) != 0;} float GetTopBorderWidth(){ return m_BorderStuff.GetSideWidth(LwpBorderStuff::TOP);} @@ -277,12 +277,12 @@ private: }; public: - LwpFootnoteNumberOptions* GetFootnoteNumbering(){ return &m_FootnoteNumbering;} - LwpFootnoteNumberOptions* GetEndnoteDivisionNumbering(){ return &m_EndnoteDivisionNumbering;} - LwpFootnoteNumberOptions* GetEndnoteDivisionGroupNumbering(){ return &m_EndnoteDivisionGroupNumbering;} - LwpFootnoteNumberOptions* GetEndnoteDocNumbering(){ return &m_EndnoteDocNumbering;} - LwpFootnoteSeparatorOptions* GetFootnoteSeparator(){ return &m_FootnoteSeparator;} - LwpFootnoteSeparatorOptions* GetFootnoteContinuedSeparator(){ return &m_FootnoteContinuedSeparator;} + LwpFootnoteNumberOptions& GetFootnoteNumbering(){ return m_FootnoteNumbering;} + LwpFootnoteNumberOptions& GetEndnoteDivisionNumbering(){ return m_EndnoteDivisionNumbering;} + LwpFootnoteNumberOptions& GetEndnoteDivisionGroupNumbering(){ return m_EndnoteDivisionGroupNumbering;} + LwpFootnoteNumberOptions& GetEndnoteDocNumbering(){ return m_EndnoteDocNumbering;} + LwpFootnoteSeparatorOptions& GetFootnoteSeparator(){ return m_FootnoteSeparator;} + LwpFootnoteSeparatorOptions& GetFootnoteContinuedSeparator(){ return m_FootnoteContinuedSeparator;} bool GetContinuedFrom(){ return ((m_nFlag & FO_CONTINUEFROM) != 0);} bool GetContinuedOn(){ return ((m_nFlag & FO_CONTINUEON) != 0);} OUString GetContinuedOnMessage(); diff --git a/lotuswordpro/source/filter/lwpfoundry.cxx b/lotuswordpro/source/filter/lwpfoundry.cxx index 3fac6aa73511..8874068caab4 100644 --- a/lotuswordpro/source/filter/lwpfoundry.cxx +++ b/lotuswordpro/source/filter/lwpfoundry.cxx @@ -232,22 +232,16 @@ LwpBookMark* LwpFoundry::GetBookMark(LwpObjectID objMarker) { LwpDLVListHeadHolder* pHeadHolder= static_cast <LwpDLVListHeadHolder*>(m_BookMarkHead.obj().get()); - LwpObjectID* pObjID = pHeadHolder->GetHeadID(); + LwpObjectID& rObjID = pHeadHolder->GetHeadID(); LwpBookMark* pBookMark; - if (pObjID) - pBookMark = static_cast<LwpBookMark*>(pObjID->obj().get()); - else - return NULL; + pBookMark = static_cast<LwpBookMark*>(rObjID.obj().get()); while (pBookMark) { if (pBookMark->IsRightMarker(objMarker)) return pBookMark; - pObjID = pBookMark->GetNext(); - if (pObjID) - pBookMark = static_cast<LwpBookMark*>(pObjID->obj().get()); - else - return NULL; + rObjID = pBookMark->GetNext(); + pBookMark = static_cast<LwpBookMark*>(rObjID.obj().get()); } return NULL; } @@ -258,7 +252,7 @@ LwpBookMark* LwpFoundry::GetBookMark(LwpObjectID objMarker) */ LwpContent* LwpFoundry::EnumContents(LwpContent * pContent) { - return GetContentManager()->EnumContents(pContent); + return GetContentManager().EnumContents(pContent); } /** @@ -280,7 +274,7 @@ LwpObjectID * LwpFoundry::GetDefaultTextStyle() if (!pPointer) return NULL; - return pPointer->GetPointer(); + return &pPointer->GetPointer(); } /** @@ -290,16 +284,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().get()); + LwpDLVListHeadHolder* pParaStyleHolder = static_cast<LwpDLVListHeadHolder*>(GetTextStyleHead().obj().get()); if(pParaStyleHolder) { - LwpTextStyle* pParaStyle = static_cast<LwpTextStyle*> (pParaStyleHolder->GetHeadID()->obj().get()); + LwpTextStyle* pParaStyle = static_cast<LwpTextStyle*> (pParaStyleHolder->GetHeadID().obj().get()); while(pParaStyle) { - OUString strName = pParaStyle->GetName()->str(); + OUString strName = pParaStyle->GetName().str(); if(strName == name) - return pParaStyle->GetObjectID(); - pParaStyle = static_cast<LwpTextStyle*>(pParaStyle->GetNext()->obj().get()); + return &pParaStyle->GetObjectID(); + pParaStyle = static_cast<LwpTextStyle*>(pParaStyle->GetNext().obj().get()); } } @@ -409,7 +403,7 @@ LwpContent* LwpContentManager::EnumContents(LwpContent* pContent) if(pContent) return pContent->GetNextEnumerated(); LwpVersionedPointer* pPointer = static_cast<LwpVersionedPointer*>(m_EnumHead.obj().get()); - return pPointer ? static_cast<LwpContent*>(pPointer->GetPointer()->obj().get()) : NULL; + return pPointer ? static_cast<LwpContent*>(pPointer->GetPointer().obj().get()) : NULL; } void LwpPieceManager::Read(LwpObjectStream *pStrm) @@ -459,15 +453,15 @@ void LwpOrderedObjectManager::Read(LwpObjectStream *pStrm) LwpOrderedObject* LwpOrderedObjectManager::Enumerate(LwpOrderedObject * pLast) { // If Last has a next, return it. - if(pLast && !pLast->GetNext()->IsNull()) - return static_cast<LwpOrderedObject*>(pLast->GetNext()->obj().get()); + if(pLast && !pLast->GetNext().IsNull()) + 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().get()); + pList = static_cast<LwpListList*>(pLast->GetListList().obj().get()); pList= GetNextActiveListList(pList); } else @@ -478,7 +472,7 @@ LwpOrderedObject* LwpOrderedObjectManager::Enumerate(LwpOrderedObject * pLast) if(pList) { - return static_cast<LwpOrderedObject*>(pList->GetHead()->obj().get()); + return static_cast<LwpOrderedObject*>(pList->GetHead().obj().get()); } return NULL; @@ -493,23 +487,23 @@ LwpListList* LwpOrderedObjectManager::GetNextActiveListList(LwpListList * pLast) LwpListList* pList = NULL; LwpContent* pContent = NULL; if(pLast) - pList = static_cast<LwpListList*>(pLast->GetNext()->obj().get()); + pList = static_cast<LwpListList*>(pLast->GetNext().obj().get()); else { LwpDLVListHeadHolder* pHeadHolder= static_cast<LwpDLVListHeadHolder*>(m_Head.obj().get()); if(pHeadHolder) { - pList = static_cast<LwpListList*>(pHeadHolder->GetHeadID()->obj().get()); + pList = static_cast<LwpListList*>(pHeadHolder->GetHeadID().obj().get()); } } while(pList) { - pContent = static_cast<LwpContent*>(pList->GetObject()->obj().get()); + pContent = static_cast<LwpContent*>(pList->GetObject().obj().get()); if(pContent && pContent->HasNonEmbeddedLayouts() && !pContent->IsStyleContent()) return pList; - pList = static_cast<LwpListList*>(pList->GetNext()->obj().get()); + pList = static_cast<LwpListList*>(pList->GetNext().obj().get()); } return NULL; } diff --git a/lotuswordpro/source/filter/lwpfoundry.hxx b/lotuswordpro/source/filter/lwpfoundry.hxx index ae0834b020f8..51fbf50e1aea 100644 --- a/lotuswordpro/source/filter/lwpfoundry.hxx +++ b/lotuswordpro/source/filter/lwpfoundry.hxx @@ -121,7 +121,7 @@ private: LwpObjectID m_Head; public: void Read(LwpObjectStream *pStrm); - LwpObjectID* GetHeadID() { return &m_Head;} + LwpObjectID& GetHeadID() { return m_Head;} }; class LwpContent; @@ -141,8 +141,8 @@ private: LwpObjectID m_OleHead; LwpObjectID m_OleTail; public: - inline LwpObjectID* GetContentList() { return &m_ContentList; } - inline LwpObjectID* GetGraphicListHead() { return &m_GrapHead; } + inline LwpObjectID& GetContentList() { return m_ContentList; } + inline LwpObjectID& GetGraphicListHead() { return m_GrapHead; } LwpContent* EnumContents(LwpContent* pContent); public: @@ -195,7 +195,7 @@ protected: LwpObjectID m_Head; public: void Read(LwpObjectStream *pStrm); - LwpObjectID* GetHeadID() { return &m_Head;} + LwpObjectID& GetHeadID() { return m_Head;} LwpOrderedObject* Enumerate(LwpOrderedObject* pLast); protected: LwpListList* GetNextActiveListList(LwpListList* pLast); @@ -262,14 +262,14 @@ private: //file members private: void ReadStyles(LwpObjectStream *pStrm); public: - inline LwpContentManager* GetContentManager() { return &m_ContentMgr; } - inline LwpObjectID* GetGraphicListHead() { return m_ContentMgr.GetGraphicListHead(); } - inline LwpFontManager* GetFontManger() { return &m_FontMgr;} - inline LwpObjectID* GetTextStyleHead() { return &m_TextStyle;} - inline LwpObjectID* GetLayout() {return &m_Layout;} - inline LwpObjectID* GetBulletManagerID() { return m_BulMgr.GetHeadID();} + inline LwpContentManager& GetContentManager() { return m_ContentMgr; } + inline LwpObjectID& GetGraphicListHead() { return m_ContentMgr.GetGraphicListHead(); } + inline LwpFontManager& GetFontManger() { return m_FontMgr;} + inline LwpObjectID& GetTextStyleHead() { return m_TextStyle;} + inline LwpObjectID& GetLayout() {return m_Layout;} + inline LwpObjectID& GetBulletManagerID() { return m_BulMgr.GetHeadID();} inline LwpDocument* GetDocument(){ return m_pDoc;} - inline LwpNumberManager* GetNumberManager() { return &m_NumMgr;} + inline LwpNumberManager& GetNumberManager() { return m_NumMgr;} LwpObjectID * GetDefaultTextStyle() ; private: LwpStyleManager* m_pStyleMgr; diff --git a/lotuswordpro/source/filter/lwpframelayout.cxx b/lotuswordpro/source/filter/lwpframelayout.cxx index 7109b9dd1d81..21e601dc5eb1 100644 --- a/lotuswordpro/source/filter/lwpframelayout.cxx +++ b/lotuswordpro/source/filter/lwpframelayout.cxx @@ -101,7 +101,7 @@ void LwpFrame::RegisterStyle(XFFrameStyle* pFrameStyle) ApplyTextDir(pFrameStyle); ApplyPosType(pFrameStyle); - pFrameStyle->SetStyleName(m_pLayout->GetName()->str()); + pFrameStyle->SetStyleName(m_pLayout->GetName().str()); XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager(); m_StyleName = pXFStyleManager->AddStyle(pFrameStyle)->GetStyleName(); m_pLayout->SetStyleName(m_StyleName); @@ -125,7 +125,7 @@ void LwpFrame::RegisterStyle(XFFrameStyle* pFrameStyle) } //Set frame Name - OUString aFrameName = m_pLayout->GetName()->str(); + OUString aFrameName = m_pLayout->GetName().str(); if(!aFrameName.isEmpty()) { //cause the bug of SODC, the linkframe name can not be "Frame1", so I change the frame name @@ -148,7 +148,7 @@ void LwpFrame::RegisterStyle(XFFrameStyle* pFrameStyle) pXFFrame->SetHeight( fHeight ); //Get content obj; - /*LwpObject* pObj =*/ m_pLayout->GetContent()->obj(); + /*LwpObject* pObj =*/ m_pLayout->GetContent().obj(); if(m_pLayout->IsGroupHead()&&(m_pLayout->IsMinimumHeight())) { //process grouplayout height. there is problems now @@ -881,15 +881,14 @@ void LwpFrameLayout::RegisterStyle() OUString LwpFrameLayout::GetNextLinkName() { OUString aName; - LwpObjectID* pObjectID = m_Link.GetNextLayout(); - if(!pObjectID->IsNull()) + LwpObjectID& rObjectID = m_Link.GetNextLayout(); + if(!rObjectID.IsNull()) { - LwpLayout* pLayout = dynamic_cast<LwpLayout*>(pObjectID->obj().get()); + LwpLayout* pLayout = dynamic_cast<LwpLayout*>(rObjectID.obj().get()); if (pLayout) { - LwpAtomHolder *pHolder = pLayout->GetName(); - if (pHolder) - aName = pHolder->str(); + LwpAtomHolder& rHolder = pLayout->GetName(); + aName = rHolder.str(); //for division name confict if(!pLayout->GetStyleName().isEmpty()) aName = pLayout->GetStyleName(); @@ -903,8 +902,8 @@ OUString LwpFrameLayout::GetNextLinkName() */ bool LwpFrameLayout::HasPreviousLinkLayout() { - LwpObjectID* pObjectID = m_Link.GetPreviousLayout(); - if(pObjectID->IsNull()) + LwpObjectID& rObjectID = m_Link.GetPreviousLayout(); + if(rObjectID.IsNull()) return false; return true; } @@ -1097,11 +1096,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().get()); + LwpVirtualLayout* pLayout = static_cast<LwpVirtualLayout*>(GetChildHead().obj().get()); while(pLayout) { pLayout->XFConvert(pXFFrame); - pLayout = static_cast<LwpVirtualLayout*>(pLayout->GetNext()->obj().get()); + pLayout = static_cast<LwpVirtualLayout*>(pLayout->GetNext().obj().get()); } pCont ->Add(pXFFrame); @@ -1150,7 +1149,7 @@ void LwpDropcapLayout::Parse(IXFStream* pOutputStream) LwpStory* pStory = static_cast<LwpStory*>(m_Content.obj(VO_STORY).get()); if (!pStory) return; - rtl::Reference<LwpObject> pPara = pStory->GetFirstPara()->obj(VO_PARA); + rtl::Reference<LwpObject> pPara = pStory->GetFirstPara().obj(VO_PARA); if(pPara.is()) { pPara->SetFoundry(m_pFoundry); @@ -1180,12 +1179,12 @@ void LwpDropcapLayout::RegisterStyle(LwpFoundry* pFoundry) { pStory->SetDropcapFlag(true); pStory->SetFoundry(pFoundry); - LwpPara* pPara = static_cast<LwpPara*>(pStory->GetFirstPara()->obj().get()); + LwpPara* pPara = static_cast<LwpPara*>(pStory->GetFirstPara().obj().get()); while(pPara) { pPara->SetFoundry(pFoundry); pPara->RegisterStyle(); - pPara = static_cast<LwpPara*>(pPara->GetNext()->obj().get()); + pPara = static_cast<LwpPara*>(pPara->GetNext().obj().get()); } } } diff --git a/lotuswordpro/source/filter/lwpframelayout.hxx b/lotuswordpro/source/filter/lwpframelayout.hxx index ec0c39cbbf2f..a686377148df 100644 --- a/lotuswordpro/source/filter/lwpframelayout.hxx +++ b/lotuswordpro/source/filter/lwpframelayout.hxx @@ -114,8 +114,8 @@ public: LwpFrameLink(); ~LwpFrameLink(); void Read(LwpObjectStream* pStrm); - LwpObjectID* GetNextLayout(){ return &m_NextLayout;} - LwpObjectID* GetPreviousLayout(){ return &m_PreviousLayout;} + LwpObjectID& GetNextLayout(){ return m_NextLayout;} + LwpObjectID& GetPreviousLayout(){ return m_PreviousLayout;} private: LwpObjectID m_PreviousLayout; LwpObjectID m_NextLayout; diff --git a/lotuswordpro/source/filter/lwpfrib.cxx b/lotuswordpro/source/filter/lwpfrib.cxx index 163d80fddcbd..32c6120f363d 100644 --- a/lotuswordpro/source/filter/lwpfrib.cxx +++ b/lotuswordpro/source/filter/lwpfrib.cxx @@ -257,7 +257,7 @@ void LwpFrib::RegisterStyle(LwpFoundry* pFoundry) LwpCharacterStyle* pCharStyle = static_cast<LwpCharacterStyle*>(m_pModifiers->CharStyleID.obj().get()); pStyle->SetStyleName(""); - pFont = pFoundry->GetFontManger()->CreateOverrideFont(pCharStyle->GetFinalFontID(),m_pModifiers->FontID); + pFont = pFoundry->GetFontManger().CreateOverrideFont(pCharStyle->GetFinalFontID(),m_pModifiers->FontID); pStyle->SetFont(pFont); IXFStyle *pNewStyle = pXFStyleManager->AddStyle(pStyle); m_StyleName = pNewStyle->GetStyleName(); @@ -272,7 +272,7 @@ void LwpFrib::RegisterStyle(LwpFoundry* pFoundry) if (m_pModifiers->FontID) { pStyle = new XFTextStyle(); - pFont = pFoundry->GetFontManger()->CreateFont(m_pModifiers->FontID); + pFont = pFoundry->GetFontManger().CreateFont(m_pModifiers->FontID); pStyle->SetFont(pFont); IXFStyle *pNewStyle = pXFStyleManager->AddStyle(pStyle); m_StyleName = pNewStyle->GetStyleName(); @@ -418,7 +418,7 @@ rtl::Reference<XFFont> LwpFrib::GetFont() if(m_pModifiers&&m_pModifiers->FontID) { LwpFoundry* pFoundry = m_pPara->GetFoundry(); - pFont = pFoundry->GetFontManger()->CreateFont(m_pModifiers->FontID); + pFont = pFoundry->GetFontManger().CreateFont(m_pModifiers->FontID); } else { diff --git a/lotuswordpro/source/filter/lwpfribbreaks.cxx b/lotuswordpro/source/filter/lwpfribbreaks.cxx index ce71c21d1f61..43fc58575e6f 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().get()); + LwpStory* pStory = static_cast<LwpStory*>(pPara->GetStoryID().obj().get()); LwpPageLayout* pCurLayout = pStory ? pStory->GetCurrentLayout() : NULL; if( pCurLayout && (pCurLayout->GetNumCols() == 1) ) diff --git a/lotuswordpro/source/filter/lwpfribbreaks.hxx b/lotuswordpro/source/filter/lwpfribbreaks.hxx index 927f6b28ec16..e5080897537a 100644 --- a/lotuswordpro/source/filter/lwpfribbreaks.hxx +++ b/lotuswordpro/source/filter/lwpfribbreaks.hxx @@ -77,7 +77,7 @@ public: void Read(LwpObjectStream* pObjStrm, sal_uInt16 len) SAL_OVERRIDE; void RegisterBreakStyle(LwpPara* pPara); void ParseLayout(); - LwpObjectID* GetLayout(){return &m_Layout;} + LwpObjectID& GetLayout() { return m_Layout;} bool IsLastFrib(){return m_bLastFrib;} private: diff --git a/lotuswordpro/source/filter/lwpfribframe.cxx b/lotuswordpro/source/filter/lwpfribframe.cxx index fbf4cf29ba7e..8eed873f2431 100644 --- a/lotuswordpro/source/filter/lwpfribframe.cxx +++ b/lotuswordpro/source/filter/lwpfribframe.cxx @@ -204,7 +204,7 @@ void LwpFribFrame::XFConvert(XFContentContainer* pCont) XFParagraph* pXFPara = new XFParagraph(); pXFPara->SetStyleName(m_StyleName); m_pPara->AddXFContent(pXFPara); - m_pPara->GetFribs()->SetXFPara(pXFPara); + m_pPara->GetFribs().SetXFPara(pXFPara); } } diff --git a/lotuswordpro/source/filter/lwpfribmark.cxx b/lotuswordpro/source/filter/lwpfribmark.cxx index 5f3061521c35..b9d4658babc4 100644 --- a/lotuswordpro/source/filter/lwpfribmark.cxx +++ b/lotuswordpro/source/filter/lwpfribmark.cxx @@ -144,10 +144,10 @@ void LwpFribBookMark::RegisterStyle(LwpFoundry* pFoundry) LwpDocument* pDoc = pFoundry->GetDocument(); if (pDoc) { - LwpObjectID* pID = pDoc->GetDivInfoID(); - if (!pID->IsNull()) + LwpObjectID& rID = pDoc->GetDivInfoID(); + if (!rID.IsNull()) { - LwpDivInfo *pDivInvo = dynamic_cast<LwpDivInfo*>(pID->obj(VO_DIVISIONINFO).get()); + LwpDivInfo *pDivInvo = dynamic_cast<LwpDivInfo*>(rID.obj(VO_DIVISIONINFO).get()); if (pDivInvo) sDivision = pDivInvo->GetDivName(); } diff --git a/lotuswordpro/source/filter/lwpfribptr.cxx b/lotuswordpro/source/filter/lwpfribptr.cxx index a6a1669a0635..4f3211a61dc0 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().get()); + LwpPageLayout* pLayout = dynamic_cast<LwpPageLayout*>(pPageBreak->GetLayout().obj().get()); if(pLayout) { pPageBreak->ParseLayout(); @@ -397,7 +397,7 @@ void LwpFribPtr::FindLayouts() //StartWithinColume type not support now break; } - LwpStory* pStory = dynamic_cast<LwpStory*>(m_pPara->GetStoryID()->obj().get()); + 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().get()); + LwpPageLayout* pLayout = dynamic_cast<LwpPageLayout*>(pPageBreak->GetLayout().obj().get()); if(pLayout) { - LwpStory* pStory = dynamic_cast<LwpStory*>(m_pPara->GetStoryID()->obj().get()); + 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().get()); + 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().get()); + 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 1c9da63ceb1f..5cf7a1c0db4b 100644 --- a/lotuswordpro/source/filter/lwpfribsection.cxx +++ b/lotuswordpro/source/filter/lwpfribsection.cxx @@ -128,7 +128,7 @@ void LwpFribSection::SetSectionName() LwpSection* pSection = GetSection(); if(pSection) { - LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID()->obj().get()); + 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().get() ); + 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 @@ -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().get()); + 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().get()); + 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().get()); + 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().get()); + 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().get()); + LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID().obj().get()); //if pagelayout is modified, register the pagelayout if(pStory->IsPMModified()) { @@ -379,8 +379,8 @@ XFSection* LwpMasterPage::CreateXFSection() */ void LwpMasterPage::ParseSection(LwpFrib* pFrib) { - LwpFribPtr* pFribPtr = m_pPara->GetFribs(); - //XFParagraph * pXFPara = pFribPtr->GetXFPara(); + LwpFribPtr& rFribPtr = m_pPara->GetFribs(); + //XFParagraph * pXFPara = rFribPtr.GetXFPara(); //parse fillerpage text if(m_pLayout->HasFillerPageText(m_pPara->GetFoundry())) @@ -388,7 +388,7 @@ void LwpMasterPage::ParseSection(LwpFrib* pFrib) XFParagraph *pPara = new XFParagraph(); pPara->SetStyleName(GetFillerPageStyleName()); m_pPara->AddXFContent(pPara); - pFribPtr->SetXFPara(pPara); + rFribPtr.SetXFPara(pPara); m_pLayout->ConvertFillerPageText(m_pPara->GetXFContainer()); } @@ -396,9 +396,9 @@ void LwpMasterPage::ParseSection(LwpFrib* pFrib) XFContentContainer* pContent = CreateXFSection(); if(pContent) { - LwpStory* pStory = static_cast<LwpStory*> ( m_pPara->GetStoryID()->obj().get() ); + LwpStory* pStory = static_cast<LwpStory*> ( m_pPara->GetStoryID().obj().get() ); //delete the additional blank para, 06/28/2005 - XFParagraph* pCurrPara = pFribPtr->GetXFPara(); + XFParagraph* pCurrPara = rFribPtr.GetXFPara(); if(!pCurrPara->HasContents()) { XFContentContainer* pCurrContainer = m_pPara->GetXFContainer(); @@ -412,7 +412,7 @@ void LwpMasterPage::ParseSection(LwpFrib* pFrib) } else { - LwpStory* pStory = static_cast<LwpStory*> ( m_pPara->GetStoryID()->obj().get() ); + LwpStory* pStory = static_cast<LwpStory*> ( m_pPara->GetStoryID().obj().get() ); pContent = pStory->GetXFContent(); } if(pContent) @@ -425,7 +425,7 @@ void LwpMasterPage::ParseSection(LwpFrib* pFrib) XFParagraph *pNextPara = new XFParagraph(); pNextPara->SetStyleName(GetStyleName()); m_pPara->AddXFContent(pNextPara); - pFribPtr->SetXFPara(pNextPara); + rFribPtr.SetXFPara(pNextPara); } } diff --git a/lotuswordpro/source/filter/lwpfribtable.cxx b/lotuswordpro/source/filter/lwpfribtable.cxx index 8c722fc82f1d..500e44e3569c 100644 --- a/lotuswordpro/source/filter/lwpfribtable.cxx +++ b/lotuswordpro/source/filter/lwpfribtable.cxx @@ -107,7 +107,7 @@ void LwpFribTable::XFConvert(XFContentContainer* pCont) { pXFContentContainer = m_pPara->GetXFContainer(); //delete the additional blank para, 06/28/2005 - XFParagraph* pCurrPara = m_pPara->GetFribs()->GetXFPara(); + XFParagraph* pCurrPara = m_pPara->GetFribs().GetXFPara(); if(!pCurrPara->HasContents()) { if(pXFContentContainer->GetLastContent() == pCurrPara) @@ -165,7 +165,7 @@ void LwpFribTable::XFConvert(XFContentContainer* pCont) XFParagraph* pXFPara = new XFParagraph(); pXFPara->SetStyleName(m_StyleName); m_pPara->AddXFContent(pXFPara); - m_pPara->GetFribs()->SetXFPara(pXFPara); + m_pPara->GetFribs().SetXFPara(pXFPara); } } diff --git a/lotuswordpro/source/filter/lwpgrfobj.cxx b/lotuswordpro/source/filter/lwpgrfobj.cxx index 7ec84d640ec5..a4db19a9539e 100644 --- a/lotuswordpro/source/filter/lwpgrfobj.cxx +++ b/lotuswordpro/source/filter/lwpgrfobj.cxx @@ -306,9 +306,9 @@ void LwpGraphicObject::CreateDrawObjects() SvStream* pDrawObjStream = NULL; // get graphic object's bento objet name - LwpObjectID* pMyID = this->GetObjectID(); + LwpObjectID& rMyID = this->GetObjectID(); std::string aGrfObjName; - this->GetBentoNamebyID(pMyID, aGrfObjName); + this->GetBentoNamebyID(rMyID, aGrfObjName); // get bento stream by the name pBentoContainer->CreateGraphicStream(pDrawObjStream, aGrfObjName.c_str()); @@ -325,10 +325,10 @@ void LwpGraphicObject::CreateDrawObjects() /** * @descr create drawing object. */ -void LwpGraphicObject::GetBentoNamebyID(LwpObjectID* pMyID, std::string& rName) +void LwpGraphicObject::GetBentoNamebyID(LwpObjectID& rMyID, std::string& rName) { - sal_uInt16 nHigh = pMyID->GetHigh(); - sal_uInt16 nLow = pMyID->GetLow(); + sal_uInt16 nHigh = rMyID.GetHigh(); + sal_uInt16 nLow = rMyID.GetLow(); char pTempStr[32]; rName = std::string("Gr"); sprintf(pTempStr, "%X,%X", nHigh, nLow); @@ -358,9 +358,9 @@ sal_uInt32 LwpGraphicObject::GetRawGrafData(sal_uInt8*& pGrafData) SvStream* pGrafStream = NULL; // get graphic object's bento objet name - LwpObjectID* pMyID = this->GetObjectID(); + LwpObjectID& rMyID = this->GetObjectID(); std::string aGrfObjName; - this->GetBentoNamebyID(pMyID, aGrfObjName); + this->GetBentoNamebyID(rMyID, aGrfObjName); // get bento stream by the name pBentoContainer->CreateGraphicStream(pGrafStream, aGrfObjName.c_str()); @@ -401,9 +401,9 @@ sal_uInt32 LwpGraphicObject::GetGrafData(sal_uInt8*& pGrafData) SvStream* pGrafStream = NULL; // get graphic object's bento objet name - LwpObjectID* pMyID = this->GetObjectID(); + LwpObjectID& rMyID = this->GetObjectID(); std::string aGrfObjName; - this->GetBentoNamebyID(pMyID, aGrfObjName); + this->GetBentoNamebyID(rMyID, aGrfObjName); char sDName[64]=""; sprintf(sDName, "%s-D", aGrfObjName.c_str()); @@ -457,9 +457,9 @@ void LwpGraphicObject::CreateGrafObject() } // set scale and crop styles - LwpAssociatedLayouts* pLayoutWithMe = GetLayoutsWithMe(); + LwpAssociatedLayouts& rLayoutWithMe = GetLayoutsWithMe(); LwpFrameLayout* pMyFrameLayout = - static_cast<LwpFrameLayout*>(pLayoutWithMe->GetOnlyLayout()->obj(VO_FRAMELAYOUT).get()); + static_cast<LwpFrameLayout*>(rLayoutWithMe.GetOnlyLayout().obj(VO_FRAMELAYOUT).get()); if (pMyFrameLayout) { LwpLayoutScale* pMyScale = pMyFrameLayout->GetLayoutScale(); @@ -576,9 +576,9 @@ void LwpGraphicObject::CreateGrafObject() pImageStyle->SetXPosType(enumXFFrameXPosFromLeft, enumXFFrameXRelFrame); // get image position offset - LwpPoint* pOffset = pMyScale->GetOffset(); - double fOffsetX = LwpTools::ConvertFromUnitsToMetric(pOffset->GetX()); - double fOffsetY = LwpTools::ConvertFromUnitsToMetric(pOffset->GetY()); + LwpPoint& rOffset = pMyScale->GetOffset(); + double fOffsetX = LwpTools::ConvertFromUnitsToMetric(rOffset.GetX()); + double fOffsetY = LwpTools::ConvertFromUnitsToMetric(rOffset.GetY()); struct LwpRect { @@ -653,10 +653,10 @@ void LwpGraphicObject::CreateGrafObject() pImage->SetAnchorType(enumXFAnchorFrame); // set object name - LwpAtomHolder* pHolder = this->GetName(); - if ( pHolder && !pHolder->str().isEmpty() ) + LwpAtomHolder& rHolder = this->GetName(); + if ( !rHolder.str().isEmpty() ) { - pImage->SetName(pHolder->str()); + pImage->SetName(rHolder.str()); } // insert image object into array diff --git a/lotuswordpro/source/filter/lwpgrfobj.hxx b/lotuswordpro/source/filter/lwpgrfobj.hxx index 18a2e23ace21..473a23fd2cc3 100644 --- a/lotuswordpro/source/filter/lwpgrfobj.hxx +++ b/lotuswordpro/source/filter/lwpgrfobj.hxx @@ -124,7 +124,7 @@ public: // add by , 03/25/2005 void CreateDrawObjects(); void CreateGrafObject(); - void GetBentoNamebyID(LwpObjectID* pMyID, std::string& rName); + void GetBentoNamebyID(LwpObjectID& rMyID, std::string& rName); sal_uInt32 GetRawGrafData(sal_uInt8*& pGrafData); sal_uInt32 GetGrafData(sal_uInt8*& pGrafData); void GetGrafOrgSize(long& rWidth, long& rHeight) { rWidth = m_Cache.Width; rHeight = m_Cache.Height; } diff --git a/lotuswordpro/source/filter/lwpholder.hxx b/lotuswordpro/source/filter/lwpholder.hxx index 6f52ffc4c203..b1f061187d76 100644 --- a/lotuswordpro/source/filter/lwpholder.hxx +++ b/lotuswordpro/source/filter/lwpholder.hxx @@ -76,7 +76,7 @@ class LwpDLVListHeadHolder : public LwpObject public: LwpDLVListHeadHolder(LwpObjectHeader& objHdr, LwpSvStream* pStrm); void Read() SAL_OVERRIDE; - LwpObjectID* GetHeadID() { return &m_DLVHead;} + LwpObjectID& GetHeadID() { return m_DLVHead;} private: virtual ~LwpDLVListHeadHolder(){} @@ -91,8 +91,8 @@ class LwpDLVListHeadTailHolder : public LwpObject public: LwpDLVListHeadTailHolder(LwpObjectHeader& objHdr, LwpSvStream* pStrm); void Read() SAL_OVERRIDE; - LwpObjectID* GetHead(){ return m_HeadTail.GetHead();} - LwpObjectID* GetTail(){ return m_HeadTail.GetTail();} + LwpObjectID& GetHead(){ return m_HeadTail.GetHead();} + LwpObjectID& GetTail(){ return m_HeadTail.GetTail();} protected: LwpDLVListHeadTail m_HeadTail; private: @@ -107,7 +107,7 @@ class LwpObjectHolder : public LwpDLVList public: LwpObjectHolder(LwpObjectHeader& objHdr, LwpSvStream* pStrm); void Read() SAL_OVERRIDE; - LwpObjectID* GetObject(){return &m_Object;} + LwpObjectID& GetObject() { return m_Object; } protected: virtual ~LwpObjectHolder(){} @@ -123,8 +123,8 @@ class LwpListList : public LwpObjectHolder public: LwpListList(LwpObjectHeader& objHdr, LwpSvStream* pStrm); void Read() SAL_OVERRIDE; - LwpObjectID* GetHead(){ return m_HeadTail.GetHead();} - LwpObjectID* GetTail(){ return m_HeadTail.GetTail();} + LwpObjectID& GetHead(){ return m_HeadTail.GetHead();} + LwpObjectID& GetTail(){ return m_HeadTail.GetTail();} protected: LwpDLVListHeadTail m_HeadTail; private: diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx index 9bf661bed57e..2aa4dc765ba2 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().get()); + 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().get()); + 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().get()); + 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().get()); + 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().get()); + 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().get()); + LwpVirtualLayout* pLayout = dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get()); while(pLayout) { pLayout->SetFoundry(m_pFoundry); pLayout->RegisterStyle(); - pLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetNext()->obj().get()); + 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().get()); + LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*>(GetParent().obj().get()); if (pParent) return pParent->IsStyleLayout(); return false; @@ -387,11 +387,11 @@ bool LwpVirtualLayout::IsStyleLayout() */ LwpVirtualLayout* LwpVirtualLayout::FindChildByType(LWP_LAYOUT_TYPE eType) { - LwpObjectID *pID = GetChildHead(); + LwpObjectID& rID = GetChildHead(); - while(pID && !pID->IsNull()) + while(!rID.IsNull()) { - LwpVirtualLayout * pLayout = dynamic_cast<LwpVirtualLayout *>(pID->obj().get()); + LwpVirtualLayout * pLayout = dynamic_cast<LwpVirtualLayout *>(rID.obj().get()); if(!pLayout) { break; @@ -401,7 +401,7 @@ LwpVirtualLayout* LwpVirtualLayout::FindChildByType(LWP_LAYOUT_TYPE eType) { return pLayout; } - pID = pLayout->GetNext(); + rID = pLayout->GetNext(); } return NULL; @@ -453,28 +453,28 @@ LwpVirtualLayout* LwpAssociatedLayouts::GetLayout(LwpVirtualLayout *pStartLayout /* Looking for the first layout and there's only one layout in the list.*/ return dynamic_cast<LwpVirtualLayout*>(m_OnlyLayout.obj().get()); - LwpObjectHolder* pObjHolder = dynamic_cast<LwpObjectHolder*>(m_Layouts.GetHead()->obj().get()); + LwpObjectHolder* pObjHolder = dynamic_cast<LwpObjectHolder*>(m_Layouts.GetHead().obj().get()); if(pObjHolder) { - pLayout = dynamic_cast<LwpVirtualLayout*>(pObjHolder->GetObject()->obj().get()); + pLayout = dynamic_cast<LwpVirtualLayout*>(pObjHolder->GetObject().obj().get()); if(!pStartLayout ) return pLayout; while(pObjHolder && pStartLayout != pLayout) { - pObjHolder = dynamic_cast<LwpObjectHolder*>(pObjHolder->GetNext()->obj().get()); + pObjHolder = dynamic_cast<LwpObjectHolder*>(pObjHolder->GetNext().obj().get()); if(pObjHolder) { - pLayout = dynamic_cast<LwpVirtualLayout*>(pObjHolder->GetObject()->obj().get()); + pLayout = dynamic_cast<LwpVirtualLayout*>(pObjHolder->GetObject().obj().get()); } } if(pObjHolder) { - pObjHolder = dynamic_cast<LwpObjectHolder*>(pObjHolder->GetNext()->obj().get()); + pObjHolder = dynamic_cast<LwpObjectHolder*>(pObjHolder->GetNext().obj().get()); if(pObjHolder) { - pLayout = dynamic_cast<LwpVirtualLayout*>(pObjHolder->GetObject()->obj().get()); + 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().get()); + 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().get()); + 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().get()); + 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().get()); + pLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetNext().obj().get()); } return NULL; } @@ -731,7 +731,7 @@ double LwpMiddleLayout::GetMarginsValue(const sal_uInt8 &nWhichSide) { if ( MarginsSameAsParent() ) { - LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent()->obj().get()); + LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent().obj().get()); if(pParent && !pParent->IsHeader()) { fValue = pParent->GetMarginsValue(nWhichSide); @@ -745,7 +745,7 @@ double LwpMiddleLayout::GetMarginsValue(const sal_uInt8 &nWhichSide) LwpLayoutMargins* pMar1 = dynamic_cast<LwpLayoutMargins*> (m_LayMargins.obj().get()); if(pMar1) { - fValue = pMar1->GetMargins()->GetMarginsValue(nWhichSide); + fValue = pMar1->GetMargins().GetMarginsValue(nWhichSide); return fValue; } } @@ -771,7 +771,7 @@ double LwpMiddleLayout::GetExtMarginsValue(const sal_uInt8 &nWhichSide) LwpLayoutMargins* pMar1 = dynamic_cast<LwpLayoutMargins*> (m_LayMargins.obj().get()); if(pMar1) { - fValue = pMar1->GetExtMargins()->GetMarginsValue(nWhichSide); + fValue = pMar1->GetExtMargins().GetMarginsValue(nWhichSide); return fValue; } } @@ -794,7 +794,7 @@ LwpBorderStuff* LwpMiddleLayout::GetBorderStuff() if(m_nOverrideFlag & OVER_BORDERS) { LwpLayoutBorder* pLayoutBorder = dynamic_cast<LwpLayoutBorder*>(m_LayBorderStuff.obj().get()); - return pLayoutBorder ? pLayoutBorder->GetBorderStuff() : NULL; + return pLayoutBorder ? &pLayoutBorder->GetBorderStuff() : NULL; } else if( !m_BasedOnStyle.IsNull() ) { @@ -815,7 +815,7 @@ LwpBackgroundStuff* LwpMiddleLayout::GetBackgroundStuff() if(m_nOverrideFlag & OVER_BACKGROUND) { LwpLayoutBackground* pLayoutBackground = dynamic_cast<LwpLayoutBackground*>(m_LayBackgroundStuff.obj().get()); - return pLayoutBackground ? pLayoutBackground->GetBackgoudStuff() : NULL; + return pLayoutBackground ? &pLayoutBackground->GetBackgoudStuff() : NULL; } else if( !m_BasedOnStyle.IsNull() ) { @@ -1279,7 +1279,7 @@ bool LwpMiddleLayout::HonorProtection() if(!(m_nAttributes2 & STYLE2_HONORPROTECTION)) return false; - LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent()->obj().get()); + LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent().obj().get()); if(pParent && !pParent->IsHeader()) { return pParent->HonorProtection(); @@ -1323,7 +1323,7 @@ bool LwpMiddleLayout::IsProtected() else bProtected = LwpVirtualLayout::IsProtected(); - LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent()->obj().get()); + 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().get()); + LwpVirtualLayout* pLay = dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get()); while(pLay) { if( pLay->IsForWaterMark()) { return pLay; } - pLay = dynamic_cast<LwpVirtualLayout*> (pLay->GetNext()->obj().get()); + 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().get()); + LwpGraphicObject* pGrfObj = dynamic_cast<LwpGraphicObject*>(pLay->GetContent().obj().get()); if(pGrfObj) { XFBGImage* pXFBGImage = new XFBGImage(); @@ -1850,7 +1850,7 @@ LwpShadow* LwpLayout::GetShadow() if(m_nOverrideFlag & OVER_SHADOW) { LwpLayoutShadow* pLayoutShadow = dynamic_cast<LwpLayoutShadow*>(m_LayShadow.obj().get()); - return pLayoutShadow ? pLayoutShadow->GetShadow() : NULL; + return pLayoutShadow ? &pLayoutShadow->GetShadow() : NULL; } else if( !m_BasedOnStyle.IsNull() ) { @@ -1923,7 +1923,7 @@ LwpVirtualLayout* LwpLayout::GetContainerLayout() if(IsRelativeAnchored()) { //get position - LwpPara* pPara = dynamic_cast<LwpPara*>(GetPosition()->obj().get()); + LwpPara* pPara = dynamic_cast<LwpPara*>(GetPosition().obj().get()); if(pPara) { LwpStory* pStory = pPara->GetStory(); @@ -2038,7 +2038,7 @@ sal_uInt8 LwpPlacableLayout::GetRelativeType() LwpLayoutRelativity* pLayRel = GetRelativityPiece(); if(pLayRel) { - return pLayRel->GetRelGuts()->GetRelativeType(); + return pLayRel->GetRelGuts().GetRelativeType(); } return LwpVirtualLayout::GetRelativeType(); } diff --git a/lotuswordpro/source/filter/lwplayout.hxx b/lotuswordpro/source/filter/lwplayout.hxx index 38c667377487..e1ffb4fc8b87 100644 --- a/lotuswordpro/source/filter/lwplayout.hxx +++ b/lotuswordpro/source/filter/lwplayout.hxx @@ -228,8 +228,8 @@ public: LwpAssociatedLayouts(){} public: void Read(LwpObjectStream* pStrm); - LwpObjectID* GetOnlyLayout(){return &m_OnlyLayout;} - LwpDLVListHeadTail* GetLayouts(){return &m_Layouts;} + LwpObjectID& GetOnlyLayout() { return m_OnlyLayout;} + LwpDLVListHeadTail& GetLayouts() { return m_Layouts;} LwpVirtualLayout* GetLayout(LwpVirtualLayout* pStartLayout); protected: LwpObjectID m_OnlyLayout; //LwpVirtualLayout @@ -348,7 +348,7 @@ protected: LwpObjectID m_LayBackgroundStuff; LwpObjectID m_LayExtBorderStuff; public: - LwpObjectID* GetContent(){return &m_Content;} + LwpObjectID& GetContent() { return m_Content; } LwpTabOverride* GetTabOverride(); }; @@ -393,7 +393,7 @@ public: virtual bool IsUseOnAllEvenPages() SAL_OVERRIDE; virtual bool IsUseOnAllOddPages() SAL_OVERRIDE; virtual bool IsUseOnPage() SAL_OVERRIDE; - LwpObjectID* GetPosition(){ return &m_Positon;} + LwpObjectID& GetPosition(){ return m_Positon;} virtual LwpVirtualLayout* GetContainerLayout() SAL_OVERRIDE; }; diff --git a/lotuswordpro/source/filter/lwplaypiece.hxx b/lotuswordpro/source/filter/lwplaypiece.hxx index fbecee1c3f4f..20e3a3d83240 100644 --- a/lotuswordpro/source/filter/lwplaypiece.hxx +++ b/lotuswordpro/source/filter/lwplaypiece.hxx @@ -121,7 +121,7 @@ public: void SetContentRotation(sal_uInt16 nVal){m_nContentRotation = nVal;} sal_uInt16 GetPlacement(){return m_nPlacement;} void SetPlacement(sal_uInt16 nVal){m_nPlacement = nVal;} - inline LwpPoint* GetOffset() {return &m_Offset;} + inline LwpPoint& GetOffset() {return m_Offset;} protected: virtual void Read() SAL_OVERRIDE; protected: @@ -143,8 +143,8 @@ class LwpLayoutMargins : public LwpVirtualPiece public: LwpLayoutMargins(LwpObjectHeader& objHdr, LwpSvStream* pStrm); virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; - LwpMargins* GetMargins() { return &m_Margins; } - LwpMargins* GetExtMargins(){ return &m_ExtMargins;} + LwpMargins& GetMargins() { return m_Margins; } + LwpMargins& GetExtMargins(){ return m_ExtMargins;} protected: virtual void Read() SAL_OVERRIDE; protected: @@ -161,7 +161,7 @@ class LwpLayoutBorder : public LwpVirtualPiece public: LwpLayoutBorder(LwpObjectHeader& objHdr, LwpSvStream* pStrm); virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; - LwpBorderStuff* GetBorderStuff(){ return &m_BorderStuff;} + LwpBorderStuff& GetBorderStuff(){ return m_BorderStuff;} protected: virtual void Read() SAL_OVERRIDE; protected: @@ -175,7 +175,7 @@ class LwpLayoutBackground : public LwpVirtualPiece public: LwpLayoutBackground(LwpObjectHeader& objHdr, LwpSvStream* pStrm); virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; - LwpBackgroundStuff* GetBackgoudStuff(){return &m_BackgroundStuff;} + LwpBackgroundStuff& GetBackgoudStuff(){return m_BackgroundStuff;} protected: virtual void Read() SAL_OVERRIDE; protected: @@ -323,7 +323,7 @@ class LwpLayoutShadow : public LwpVirtualPiece public: LwpLayoutShadow(LwpObjectHeader& objHdr, LwpSvStream* pStrm); virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; - LwpShadow* GetShadow(){return &m_Shadow;} + LwpShadow& GetShadow() { return m_Shadow; } protected: virtual void Read() SAL_OVERRIDE; protected: @@ -384,7 +384,7 @@ class LwpLayoutRelativity: public LwpVirtualPiece public: LwpLayoutRelativity(LwpObjectHeader& objHdr, LwpSvStream* pStrm); virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; - LwpLayoutRelativityGuts* GetRelGuts(){return &m_RelGuts;} + LwpLayoutRelativityGuts& GetRelGuts() { return m_RelGuts; } protected: virtual void Read() SAL_OVERRIDE; protected: diff --git a/lotuswordpro/source/filter/lwpmarker.cxx b/lotuswordpro/source/filter/lwpmarker.cxx index 6ef0395bc935..c7f55d339a18 100644 --- a/lotuswordpro/source/filter/lwpmarker.cxx +++ b/lotuswordpro/source/filter/lwpmarker.cxx @@ -351,10 +351,7 @@ bool LwpBookMark::IsRightMarker(LwpObjectID objMarker) OUString LwpBookMark::GetName() { - if (LwpDLNFVList::GetName()) - return LwpDLNFVList::GetName()->str(); - else - return OUString(""); + return LwpDLNFVList::GetName().str(); } LwpFieldMark::LwpFieldMark(LwpObjectHeader &objHdr, LwpSvStream *pStrm) diff --git a/lotuswordpro/source/filter/lwpnotes.cxx b/lotuswordpro/source/filter/lwpnotes.cxx index 542943a0b22c..c78fb4f10b3c 100644 --- a/lotuswordpro/source/filter/lwpnotes.cxx +++ b/lotuswordpro/source/filter/lwpnotes.cxx @@ -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().get()); + LwpStory* pStory = static_cast<LwpStory*>(pTextLayout->GetContent().obj().get()); if(pStory) { - LwpPara* pFirst = static_cast<LwpPara*>(pStory->GetFirstPara()->obj().get()); + LwpPara* pFirst = static_cast<LwpPara*>(pStory->GetFirstPara().obj().get()); if(pFirst) return pFirst->GetContentText(true); } diff --git a/lotuswordpro/source/filter/lwpobj.hxx b/lotuswordpro/source/filter/lwpobj.hxx index 12b68d72deb7..e1ebad5a9362 100644 --- a/lotuswordpro/source/filter/lwpobj.hxx +++ b/lotuswordpro/source/filter/lwpobj.hxx @@ -103,7 +103,7 @@ public: LwpFoundry* GetFoundry(){return m_pFoundry;} void SetFoundry(LwpFoundry* pFoundry){m_pFoundry = pFoundry;} - LwpObjectID* GetObjectID(){ return m_ObjHdr.GetID();} + LwpObjectID& GetObjectID(){ return m_ObjHdr.GetID();} sal_uInt32 GetTag() { return m_ObjHdr.GetTag();} LwpSvStream* GetStream() { return m_pStrm; } }; diff --git a/lotuswordpro/source/filter/lwpobjfactory.cxx b/lotuswordpro/source/filter/lwpobjfactory.cxx index 305024078376..13635c588fd3 100644 --- a/lotuswordpro/source/filter/lwpobjfactory.cxx +++ b/lotuswordpro/source/filter/lwpobjfactory.cxx @@ -674,7 +674,7 @@ rtl::Reference<LwpObject> LwpObjectFactory::CreateObject(sal_uInt32 type, LwpObj if(newObj.is()) { newObj->QuickRead(); - m_IdToObjList.insert(LwpIdToObjMap::value_type(*objHdr.GetID(), newObj)); + m_IdToObjList.insert(LwpIdToObjMap::value_type(objHdr.GetID(), newObj)); } return(newObj); @@ -700,8 +700,8 @@ rtl::Reference<LwpObject> LwpObjectFactory::QueryObject(const LwpObjectID &objID if (!objHdr.Read(*m_pSvStream)) return NULL; - LwpObjectID* pId = objHdr.GetID(); - if (pId && (*pId != objID)) + LwpObjectID& rId = objHdr.GetID(); + if (rId != objID) { OSL_FAIL("apparently incorrect objid, invalidating"); return NULL; diff --git a/lotuswordpro/source/filter/lwpobjfactory.hxx b/lotuswordpro/source/filter/lwpobjfactory.hxx index 7cbc56d118a6..1819db3819f9 100644 --- a/lotuswordpro/source/filter/lwpobjfactory.hxx +++ b/lotuswordpro/source/filter/lwpobjfactory.hxx @@ -117,7 +117,7 @@ public: rtl::Reference<LwpObject> QueryObject(const LwpObjectID &objID); void ReleaseObject(const LwpObjectID &objID); void ReadIndex(LwpSvStream* pStrm); - LwpIndexManager* GetIndexManager(){return &m_IndexMgr;} + LwpIndexManager& GetIndexManager(){return m_IndexMgr;} }; diff --git a/lotuswordpro/source/filter/lwpobjhdr.hxx b/lotuswordpro/source/filter/lwpobjhdr.hxx index b416cd1fe36b..3adccead48bb 100644 --- a/lotuswordpro/source/filter/lwpobjhdr.hxx +++ b/lotuswordpro/source/filter/lwpobjhdr.hxx @@ -114,7 +114,7 @@ public: bool Read(LwpSvStream &pStrm); inline sal_uInt32 GetTag(); inline sal_uInt32 GetSize(); - inline LwpObjectID* GetID(); + inline LwpObjectID& GetID(); inline bool IsCompressed(); }; @@ -126,9 +126,9 @@ inline sal_uInt32 LwpObjectHeader::GetSize() { return m_nSize; } -inline LwpObjectID* LwpObjectHeader::GetID() +inline LwpObjectID& LwpObjectHeader::GetID() { - return &m_ID; + return m_ID; } inline bool LwpObjectHeader::IsCompressed() { diff --git a/lotuswordpro/source/filter/lwpobjid.cxx b/lotuswordpro/source/filter/lwpobjid.cxx index 9a2ea6715db8..0c64f91a70a9 100644 --- a/lotuswordpro/source/filter/lwpobjid.cxx +++ b/lotuswordpro/source/filter/lwpobjid.cxx @@ -112,8 +112,8 @@ sal_uInt32 LwpObjectID::ReadIndexed(LwpSvStream *pStrm) //m_nLow = index; //note the m_nLow stores the index instead of the actual time id LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance(); LwpObjectFactory* pFactory = pGlobal->GetLwpObjFactory(); - LwpIndexManager* pIdxMgr = pFactory->GetIndexManager(); - m_nLow = pIdxMgr->GetObjTime( (sal_uInt16)m_nIndex); + LwpIndexManager& rIdxMgr = pFactory->GetIndexManager(); + m_nLow = rIdxMgr.GetObjTime( (sal_uInt16)m_nIndex); } else { @@ -143,8 +143,8 @@ sal_uInt32 LwpObjectID::ReadIndexed(LwpObjectStream *pStrm) //m_nLow = index; //note the m_nLow stores the index instead of the actual time id LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance(); LwpObjectFactory* pFactory = pGlobal->GetLwpObjFactory(); - LwpIndexManager* pIdxMgr = pFactory->GetIndexManager(); - m_nLow = pIdxMgr->GetObjTime( (sal_uInt16)m_nIndex); + LwpIndexManager& rIdxMgr = pFactory->GetIndexManager(); + m_nLow = rIdxMgr.GetObjTime( (sal_uInt16)m_nIndex); } else m_nLow = pStrm->QuickReaduInt32(); diff --git a/lotuswordpro/source/filter/lwppagehint.hxx b/lotuswordpro/source/filter/lwppagehint.hxx index 2d4f55b31f2f..e37153c9f835 100644 --- a/lotuswordpro/source/filter/lwppagehint.hxx +++ b/lotuswordpro/source/filter/lwppagehint.hxx @@ -103,9 +103,9 @@ public: void Read() SAL_OVERRIDE; void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; sal_uInt16 GetPageNumber(){return m_nPageNumber;} - LwpObjectID* GetCurrentSectionID(){return &m_CurrentSection;} + LwpObjectID& GetCurrentSectionID(){return m_CurrentSection;} sal_uInt16 GetCurrentSectionPage(){return m_nCurrentSectionPage;} - LwpObjectID* GetPageLayoutID(){ return &m_PageLayout;} + LwpObjectID& GetPageLayoutID(){ return m_PageLayout;} sal_uInt16 GetLayoutPageNumber(){ return m_nLayoutPageNumber;} private: virtual ~LwpPageHint(){} diff --git a/lotuswordpro/source/filter/lwppagelayout.cxx b/lotuswordpro/source/filter/lwppagelayout.cxx index 631a1ad033a6..915621c2f129 100644 --- a/lotuswordpro/source/filter/lwppagelayout.cxx +++ b/lotuswordpro/source/filter/lwppagelayout.cxx @@ -275,28 +275,28 @@ void LwpPageLayout::ParseFootNoteSeparator(XFPageMaster * pm1) LwpFootnoteOptions* pFootnoteOpts = pFontnodeId ? dynamic_cast<LwpFootnoteOptions*>(pFontnodeId->obj().get()) : NULL; if(pFootnoteOpts) { - LwpFootnoteSeparatorOptions* pFootnoteSep = pFootnoteOpts->GetFootnoteSeparator(); + LwpFootnoteSeparatorOptions& rFootnoteSep = pFootnoteOpts->GetFootnoteSeparator(); //set length sal_uInt32 nLengthPercent = 100; double fWidth = 0; - if(pFootnoteSep->HasSeparator()) + if(rFootnoteSep.HasSeparator()) { - fWidth = pFootnoteSep->GetTopBorderWidth(); + fWidth = rFootnoteSep.GetTopBorderWidth(); } - if(pFootnoteSep->HasCustomLength()) + if(rFootnoteSep.HasCustomLength()) { - nLengthPercent = static_cast<sal_uInt32>(100*LwpTools::ConvertFromUnitsToMetric(pFootnoteSep->GetLength())/GetMarginWidth()); + nLengthPercent = static_cast<sal_uInt32>(100*LwpTools::ConvertFromUnitsToMetric(rFootnoteSep.GetLength())/GetMarginWidth()); if(nLengthPercent > 100) nLengthPercent = 100; } - double fAbove = LwpTools::ConvertFromUnitsToMetric(pFootnoteSep->GetAbove()); - double fBelow = LwpTools::ConvertFromUnitsToMetric(pFootnoteSep->GetBelow()); - LwpColor aColor = pFootnoteSep->GetTopBorderColor(); + double fAbove = LwpTools::ConvertFromUnitsToMetric(rFootnoteSep.GetAbove()); + double fBelow = LwpTools::ConvertFromUnitsToMetric(rFootnoteSep.GetBelow()); + LwpColor aColor = rFootnoteSep.GetTopBorderColor(); enumXFAlignType eAlignType = enumXFAlignStart; - if(pFootnoteSep->GetIndent() > 0) + if(rFootnoteSep.GetIndent() > 0) { //SODC don't support indent - sal_uInt32 nIndentPercent = static_cast<sal_uInt32>(100*LwpTools::ConvertFromUnitsToMetric(pFootnoteSep->GetIndent())/GetMarginWidth()); + sal_uInt32 nIndentPercent = static_cast<sal_uInt32>(100*LwpTools::ConvertFromUnitsToMetric(rFootnoteSep.GetIndent())/GetMarginWidth()); if(nIndentPercent + nLengthPercent >= 100) eAlignType = enumXFAlignEnd; } @@ -343,7 +343,7 @@ void LwpPageLayout::RegisterStyle() //Add master page XFMasterPage* mp1 = new XFMasterPage(); - mp1->SetStyleName(GetName()->str()); + mp1->SetStyleName(GetName().str()); mp1->SetPageMaster(pmname); mp1 = (XFMasterPage*)pXFStyleManager->AddStyle(mp1); m_StyleName = mp1->GetStyleName(); @@ -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().get()); - LwpStory* pStory = dynamic_cast<LwpStory*>(pDivInfo->GetFillerPageTextID()->obj().get()); + 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().get()); + 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().get()); + pLay = dynamic_cast<LwpVirtualLayout*> (pLay->GetNext().obj().get()); } return NULL; } LwpFooterLayout* LwpPageLayout::GetFooterLayout() { - LwpVirtualLayout* pLay = dynamic_cast<LwpVirtualLayout*>(GetChildHead()->obj().get()); + 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().get()); + 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().get()); + 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().get()); + pLay = dynamic_cast<LwpVirtualLayout*> (pLay->GetNext().obj().get()); } } return NULL; @@ -580,14 +580,14 @@ 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().get()); + LwpDLVListHeadTailHolder* pHeadTail = dynamic_cast<LwpDLVListHeadTailHolder*>(pDoc->GetPageHintsID().obj().get()); if(!pHeadTail) return nPageNumber; //get first pagehint - LwpPageHint* pPageHint = dynamic_cast<LwpPageHint*>(pHeadTail->GetHead()->obj().get()); + LwpPageHint* pPageHint = dynamic_cast<LwpPageHint*>(pHeadTail->GetHead().obj().get()); while(pPageHint) { - if(*(this->GetObjectID()) == *(pPageHint->GetPageLayoutID())) + if(this->GetObjectID() == pPageHint->GetPageLayoutID()) { sal_uInt16 nNumber = pPageHint->GetPageNumber(); if(nLayoutNumber==FIRST_LAYOUTPAGENO && pPageHint->GetLayoutPageNumber()==1) @@ -600,7 +600,7 @@ sal_Int32 LwpPageLayout::GetPageNumber(sal_uInt16 nLayoutNumber) { //get the last page number nPageNumber = nNumber; - if(pPageHint->GetNext()->IsNull()) + if(pPageHint->GetNext().IsNull()) { //if is last page number of entire document, reture directly return nPageNumber + pDoc->GetNumberOfPagesBefore(); @@ -614,7 +614,7 @@ sal_Int32 LwpPageLayout::GetPageNumber(sal_uInt16 nLayoutNumber) } } - pPageHint = dynamic_cast<LwpPageHint*>(pPageHint->GetNext()->obj().get()); + 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().get()); + 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().get()); + 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().get()); + 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 @@ -954,7 +954,7 @@ void LwpFooterLayout::ParseMargins(XFFooterStyle* pFooterStyle) } //Set left,right,top margins - LwpMiddleLayout* parent = dynamic_cast<LwpMiddleLayout*> (GetParent()->obj().get()); + 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 { diff --git a/lotuswordpro/source/filter/lwppara.cxx b/lotuswordpro/source/filter/lwppara.cxx index 3baceb91cf43..3fbf44ef9a85 100644 --- a/lotuswordpro/source/filter/lwppara.cxx +++ b/lotuswordpro/source/filter/lwppara.cxx @@ -199,7 +199,7 @@ void LwpPara::Read() if (Notify) { LwpForked3NotifyList* pNotifyList = new LwpForked3NotifyList(); - pNotifyList->GetExtraList()->Read(m_pObjStrm); + pNotifyList->GetExtraList().Read(m_pObjStrm); pNotifyList->Read(m_pObjStrm); delete pNotifyList; } @@ -477,17 +477,17 @@ void LwpPara::RegisterStyle() LwpBackgroundOverride* pBGOver = static_cast<LwpParaBackGroundProperty*>(pProps)->GetBackground(); if (pBGOver) { - LwpBackgroundStuff* pBGStuff = pBGOver->GetBGStuff(); - if (pBGStuff && !pBGStuff->IsTransparent() ) + LwpBackgroundStuff& rBGStuff = pBGOver->GetBGStuff(); + if (!rBGStuff.IsTransparent() ) { - if (pBGStuff->IsPatternFill()) + if (rBGStuff.IsPatternFill()) { - XFBGImage* pXFBGImage = pBGStuff->GetFillPattern(); + XFBGImage* pXFBGImage = rBGStuff.GetFillPattern(); pOverStyle->SetBackImage(pXFBGImage); } else { - LwpColor* pColor = pBGStuff->GetFillColor(); + LwpColor* pColor = rBGStuff.GetFillColor(); if (pColor && pColor->IsValidColor()) { XFColor aXFColor( pColor->To24Color()); @@ -605,7 +605,7 @@ void LwpPara::RegisterStyle() pParaSilverBullet = pPara->GetSilverBullet(); pNumbering = pPara->GetParaNumbering(); - if (*(pPara->GetObjectID()) != *(this->GetObjectID())) + if (pPara->GetObjectID() != this->GetObjectID()) { if (!pParaSilverBullet) { @@ -625,7 +625,7 @@ void LwpPara::RegisterStyle() break; } if ((pNumbering->GetLevel() == nFoundLevel) - && (*(pParaSilverBullet->GetObjectID()) != *(m_pSilverBullet->GetObjectID()) + && (pParaSilverBullet->GetObjectID() != m_pSilverBullet->GetObjectID() || pNumbering->GetPosition() != nPosition)) { break; @@ -634,7 +634,7 @@ void LwpPara::RegisterStyle() else { if (pNumbering && pNumbering->GetLevel() < nFoundBound && pParaSilverBullet - && (*(pParaSilverBullet->GetObjectID()) != *(m_pSilverBullet->GetObjectID()) + && (pParaSilverBullet->GetObjectID() != m_pSilverBullet->GetObjectID() || pNumbering->GetPosition() != nPosition)) { nFoundBound = pNumbering->GetLevel(); @@ -659,7 +659,7 @@ void LwpPara::RegisterStyle() if (m_pBullOver->IsSkip()) ; else if ( pParaSilverBullet - && *(pParaSilverBullet->GetObjectID()) == *(m_pSilverBullet->GetObjectID()) + && pParaSilverBullet->GetObjectID() == m_pSilverBullet->GetObjectID() && pNumbering && nPosition == pNumbering->GetPosition()) { if (bLesser) @@ -690,10 +690,7 @@ void LwpPara::RegisterStyle() } } - if (pPara->GetPrevious()) - pPrePara = dynamic_cast<LwpPara*>(pPara->GetPrevious()->obj(VO_PARA).get()); - else - pPrePara=NULL; + pPrePara = dynamic_cast<LwpPara*>(pPara->GetPrevious().obj(VO_PARA).get()); if (!pPrePara) { @@ -748,9 +745,9 @@ void LwpPara::RegisterStyle() } //end add - if (noSpacing && GetPrevious()) + if (noSpacing) { - LwpPara* pPrePara = dynamic_cast<LwpPara*>(GetPrevious()->obj().get()); + LwpPara* pPrePara = dynamic_cast<LwpPara*>(GetPrevious().obj().get()); if (pPrePara && pPrePara->GetBelowSpacing()!=0) { pOverStyle = new XFParaStyle; diff --git a/lotuswordpro/source/filter/lwppara.hxx b/lotuswordpro/source/filter/lwppara.hxx index 7482fe188aee..eaf8c152c8f0 100644 --- a/lotuswordpro/source/filter/lwppara.hxx +++ b/lotuswordpro/source/filter/lwppara.hxx @@ -107,7 +107,7 @@ protected: LwpNotifyListPersistent m_ExtraList; LwpNotifyListPersistent m_PersistentList; public: - LwpNotifyListPersistent* GetExtraList(){return &m_ExtraList;} + LwpNotifyListPersistent& GetExtraList() { return m_ExtraList; } void Read(LwpObjectStream* pObjStrm); }; @@ -156,7 +156,7 @@ public: void Release(); LwpPara* GetParent(); - LwpObjectID* GetStoryID(); + LwpObjectID& GetStoryID(); LwpStory* GetStory(); LwpBreaksOverride* GetBreaks(); @@ -174,7 +174,7 @@ public: bool GetBulletFlag() const; void GetParaNumber(sal_uInt16 nPosition, ParaNumbering* pParaNumbering); - LwpFribPtr* GetFribs(); + LwpFribPtr& GetFribs(); double GetBelowSpacing(); LwpParaProperty* GetProperty(sal_uInt32 nPropType); void GatherDropcapInfo(); @@ -328,9 +328,9 @@ inline bool LwpPara::GetBulletFlag() const { return m_bHasBullet; } -inline LwpFribPtr* LwpPara::GetFribs() +inline LwpFribPtr& LwpPara::GetFribs() { - return &m_Fribs; + return m_Fribs; } inline LwpBreaksOverride* LwpPara::GetBreaks() { @@ -362,9 +362,9 @@ inline void LwpPara::SetIndent(LwpIndentOverride* pIndentOverride) delete m_pIndentOverride; m_pIndentOverride = pIndentOverride; } -inline LwpObjectID* LwpPara::GetStoryID() +inline LwpObjectID& LwpPara::GetStoryID() { - return &m_Story; + return m_Story; } inline LwpStory* LwpPara::GetStory() { diff --git a/lotuswordpro/source/filter/lwppara1.cxx b/lotuswordpro/source/filter/lwppara1.cxx index 15ddf4e02f08..b508c6cc01e9 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().get()); + 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().get()); + pPara = dynamic_cast<LwpPara*>(pPara->GetPrevious().obj().get()); } } return NULL; @@ -569,7 +569,7 @@ void LwpPara::FindLayouts() { m_Fribs.SetPara(this); m_Fribs.FindLayouts(); - LwpPara* pNextPara = dynamic_cast<LwpPara*>(GetNext()->obj().get()); + LwpPara* pNextPara = dynamic_cast<LwpPara*>(GetNext().obj().get()); if(pNextPara) { pNextPara->FindLayouts(); diff --git a/lotuswordpro/source/filter/lwpparastyle.cxx b/lotuswordpro/source/filter/lwpparastyle.cxx index 47aa89be8050..a44d0ae8c73f 100644 --- a/lotuswordpro/source/filter/lwpparastyle.cxx +++ b/lotuswordpro/source/filter/lwpparastyle.cxx @@ -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().get()); + LwpPara* pPrePara = dynamic_cast<LwpPara*>(pPara->GetPrevious().obj().get()); if (pPrePara && above_val != -1) { above_val += pPrePara->GetBelowSpacing(); @@ -608,14 +608,14 @@ void LwpParaStyle::ApplySpacing(LwpPara* pPara, XFParaStyle* pParaStyle, LwpSpac **************************************************************************/ void LwpParaStyle::ApplyTab(XFParaStyle *pParaStyle, LwpTabOverride *pTabOverRide) { - LwpObjectID* pTabRackID = pTabOverRide->GetTabRackID(); - if(pTabRackID->IsNull()) + LwpObjectID& rTabRackID = pTabOverRide->GetTabRackID(); + if(rTabRackID.IsNull()) { //assert(false); return; } - LwpTabRack* pTabRack = dynamic_cast<LwpTabRack*>(pTabRackID->obj().get()); + LwpTabRack* pTabRack = dynamic_cast<LwpTabRack*>(rTabRackID.obj().get()); if(!pTabRack) { //assert(false); @@ -688,12 +688,12 @@ void LwpParaStyle::RegisterStyle() XFParaStyle* pStyle = new XFParaStyle(); //Set name - OUString styleName = GetName()->str(); + OUString styleName = GetName().str(); pStyle->SetStyleName(styleName); //Create font - LwpFontManager* pFontMgr = m_pFoundry->GetFontManger(); - rtl::Reference<XFFont> pFont = pFontMgr->CreateFont(m_nFinalFontID); + LwpFontManager& rFontMgr = m_pFoundry->GetFontManger(); + rtl::Reference<XFFont> pFont = rFontMgr.CreateFont(m_nFinalFontID); pStyle->SetFont(pFont); //Set other paragraph properties... @@ -701,7 +701,7 @@ void LwpParaStyle::RegisterStyle() Apply(pStyle); //Add style LwpStyleManager* pStyleMgr = m_pFoundry->GetStyleManager(); - pStyleMgr->AddStyle(*GetObjectID(), pStyle); + pStyleMgr->AddStyle(GetObjectID(), pStyle); } LwpAlignmentOverride* LwpParaStyle::GetAlignment() diff --git a/lotuswordpro/source/filter/lwpproplist.cxx b/lotuswordpro/source/filter/lwpproplist.cxx index 6547f64ea607..f79022f4898e 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().get()); + 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().get()); + return static_cast<LwpPropListElement*>(LwpDLVListHead::GetFirst().obj().get()); } OUString LwpPropList::EnumNamedProperty(OUString& name,OUString& value) diff --git a/lotuswordpro/source/filter/lwprowlayout.cxx b/lotuswordpro/source/filter/lwprowlayout.cxx index f51d539012f4..b09f1ad7547e 100644 --- a/lotuswordpro/source/filter/lwprowlayout.cxx +++ b/lotuswordpro/source/filter/lwprowlayout.cxx @@ -95,15 +95,15 @@ LwpRowLayout::~LwpRowLayout() */ void LwpRowLayout::SetRowMap(void) { - LwpObjectID *pCellID= GetChildHead(); - LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj().get()); + LwpObjectID& rCellID= GetChildHead(); + LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(rCellID.obj().get()); while(pCellLayout) { pCellLayout->SetCellMap(); - pCellID = pCellLayout->GetNext(); - pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj().get()); + rCellID = pCellLayout->GetNext(); + pCellLayout = dynamic_cast<LwpCellLayout *>(rCellID.obj().get()); } } /** @@ -135,15 +135,15 @@ void LwpRowLayout::RegisterStyle() pTableLayout->GetTable(); } // register cells' style - LwpObjectID *pCellID= GetChildHead(); - LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj().get()); + LwpObjectID& rCellID= GetChildHead(); + LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(rCellID.obj().get()); while(pCellLayout) { pCellLayout->SetFoundry(m_pFoundry); pCellLayout->RegisterStyle(); - pCellID = pCellLayout->GetNext(); - pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj().get()); + rCellID = pCellLayout->GetNext(); + pCellLayout = dynamic_cast<LwpCellLayout *>(rCellID.obj().get()); } } @@ -225,7 +225,7 @@ void LwpRowLayout::ConvertRow(XFTable* pXFTable,sal_uInt8 nStartCol,sal_uInt8 nE sal_uInt8 nColID = m_ConnCellList[nMarkConnCell]->GetColID() +m_ConnCellList[nMarkConnCell]->GetNumcols()-1; pXFCell = m_ConnCellList[nMarkConnCell]->ConvertCell( - *pTable->GetObjectID(), + pTable->GetObjectID(), crowid+m_ConnCellList[nMarkConnCell]->GetNumrows()-1, m_ConnCellList[nMarkConnCell]->GetColID()); @@ -377,8 +377,8 @@ void LwpRowLayout::ConvertCommonRow(XFTable* pXFTable,sal_uInt8 nStartCol,sal_uI for (sal_uInt8 i = nStartCol; i < nEndCol ; i++) { // add row to table - LwpObjectID *pCellID= GetChildHead(); - LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj().get()); + LwpObjectID& rCellID= GetChildHead(); + LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(rCellID.obj().get()); nCellStartCol = i;//mark the begin position of cell nCellEndCol = i;//mark the end position of cell while(pCellLayout) @@ -391,11 +391,11 @@ void LwpRowLayout::ConvertCommonRow(XFTable* pXFTable,sal_uInt8 nStartCol,sal_uI nCellEndCol = i+pConnCell->GetNumcols()-1; i = nCellEndCol; } - pCell = pCellLayout->ConvertCell(*pTable->GetObjectID(),crowid,i); + pCell = pCellLayout->ConvertCell(pTable->GetObjectID(),crowid,i); break; } - pCellID = pCellLayout->GetNext(); - pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj().get()); + rCellID = pCellLayout->GetNext(); + pCellLayout = dynamic_cast<LwpCellLayout *>(rCellID.obj().get()); } if (!pCellLayout) { @@ -405,7 +405,7 @@ void LwpRowLayout::ConvertCommonRow(XFTable* pXFTable,sal_uInt8 nStartCol,sal_uI if (pDefaultCell) { pCell = pDefaultCell->ConvertCell( - *pTable->GetObjectID(),crowid, i); + pTable->GetObjectID(),crowid, i); } else { @@ -425,8 +425,8 @@ void LwpRowLayout::ConvertCommonRow(XFTable* pXFTable,sal_uInt8 nStartCol,sal_uI */ void LwpRowLayout::CollectMergeInfo() { - LwpObjectID *pCellID= GetChildHead(); - LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj().get()); + LwpObjectID& rCellID= GetChildHead(); + LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(rCellID.obj().get()); while(pCellLayout) { @@ -435,8 +435,8 @@ void LwpRowLayout::CollectMergeInfo() LwpConnectedCellLayout* pConnCell = static_cast<LwpConnectedCellLayout*>(pCellLayout); m_ConnCellList.push_back(pConnCell); } - pCellID = pCellLayout->GetNext(); - pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj().get()); + rCellID = pCellLayout->GetNext(); + pCellLayout = dynamic_cast<LwpCellLayout *>(rCellID.obj().get()); } } /** diff --git a/lotuswordpro/source/filter/lwprowlayout.hxx b/lotuswordpro/source/filter/lwprowlayout.hxx index 2ece96f35bc5..070683ed47b2 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().get());} + inline LwpTableLayout * GetParentTableLayout(){return dynamic_cast<LwpTableLayout *>(GetParent().obj().get());} void SetRowMap(void); protected: void Read() SAL_OVERRIDE; diff --git a/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx b/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx index 430de02ad88e..aabda032cc72 100644 --- a/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx +++ b/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx @@ -155,9 +155,9 @@ void LwpSdwGroupLoaderV0102::BeginDrawObjects(std::vector< rtl::Reference<XFFram double fFrameHeight = LwpTools::ConvertFromUnitsToMetric(pFrameGeo->GetHeight()); // get frame offset - LwpPoint* pOffset = pMyScale->GetOffset(); - double fOffsetX = LwpTools::ConvertFromUnitsToMetric(pOffset->GetX()); - double fOffsetY = LwpTools::ConvertFromUnitsToMetric(pOffset->GetY()); + LwpPoint& rOffset = pMyScale->GetOffset(); + double fOffsetX = LwpTools::ConvertFromUnitsToMetric(rOffset.GetX()); + double fOffsetY = LwpTools::ConvertFromUnitsToMetric(rOffset.GetY()); // get scale mode sal_uInt16 nScalemode = pMyScale->GetScaleMode(); diff --git a/lotuswordpro/source/filter/lwpsection.hxx b/lotuswordpro/source/filter/lwpsection.hxx index 3e2fa83777ab..6c714e44a5a8 100644 --- a/lotuswordpro/source/filter/lwpsection.hxx +++ b/lotuswordpro/source/filter/lwpsection.hxx @@ -77,8 +77,8 @@ public: LwpOrderedObject(LwpObjectHeader &objHdr, LwpSvStream* pStrm); virtual ~LwpOrderedObject(){} void Read() SAL_OVERRIDE; - LwpObjectID* GetPosition(){ return &m_Para;} - LwpObjectID* GetListList(){ return &m_ListList;} + LwpObjectID& GetPosition(){ return m_Para;} + LwpObjectID& GetListList(){ return m_ListList;} protected: LwpObjectID m_ListList;//lwplistlist object, LwpObjectID m_Para; @@ -97,8 +97,8 @@ public: virtual ~LwpSection(); inline sal_uInt16 GetFlags(); inline LwpPageLayout* GetPageLayout(); - inline LwpColor* GetColor(); - inline LwpAtomHolder* GetAtomHolder(); + inline LwpColor& GetColor(); + inline LwpAtomHolder& GetAtomHolder(); void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; OUString GetSectionName(){return m_AtomHolder.str();} @@ -134,18 +134,18 @@ inline LwpPageLayout* LwpSection::GetPageLayout() * @descr get section tab color * */ -inline LwpColor* LwpSection::GetColor() +inline LwpColor& LwpSection::GetColor() { - return &m_Color; + return m_Color; } /** * @descr get section atom holder pointer * */ -inline LwpAtomHolder* LwpSection::GetAtomHolder() +inline LwpAtomHolder& LwpSection::GetAtomHolder() { - return &m_AtomHolder; + return m_AtomHolder; } class LwpIndexSection : public LwpSection diff --git a/lotuswordpro/source/filter/lwpsilverbullet.cxx b/lotuswordpro/source/filter/lwpsilverbullet.cxx index aad380c460f0..43a3657e2aa9 100644 --- a/lotuswordpro/source/filter/lwpsilverbullet.cxx +++ b/lotuswordpro/source/filter/lwpsilverbullet.cxx @@ -200,11 +200,7 @@ OUString LwpSilverBullet::GetBulletFontName() return aEmpty; } - LwpFontManager* pFontMgr = m_pFoundry->GetFontManger(); - if (!pFontMgr) - { - return aEmpty; - } + LwpFontManager& rFontMgr = m_pFoundry->GetFontManger(); sal_uInt32 nBulletFontID = m_pBulletPara->GetBulletFontID(); sal_uInt16 nFinalFont = static_cast<sal_uInt16>((nBulletFontID >> 16) & 0xFFFF); @@ -216,7 +212,7 @@ OUString LwpSilverBullet::GetBulletFontName() } //get font name from font manager. - OUString aFontName = pFontMgr->GetNameByID(nBulletFontID); + OUString aFontName = rFontMgr.GetNameByID(nBulletFontID); return aFontName; } @@ -245,7 +241,7 @@ LwpPara* LwpSilverBullet::GetBulletPara() return NULL; } - m_pBulletPara = dynamic_cast<LwpPara*>(pStory->GetFirstPara()->obj(VO_PARA).get()); + m_pBulletPara = dynamic_cast<LwpPara*>(pStory->GetFirstPara().obj(VO_PARA).get()); } return m_pBulletPara; @@ -332,12 +328,9 @@ bool LwpSilverBullet::IsBulletOrdered() if (!m_pBulletPara) return false; - LwpFribPtr* pFribs = m_pBulletPara->GetFribs(); - - if (!pFribs) - return false; + LwpFribPtr& rFribs = m_pBulletPara->GetFribs(); - return (pFribs->HasFrib(FRIB_TAG_PARANUMBER) != NULL); + return (rFribs.HasFrib(FRIB_TAG_PARANUMBER) != NULL); } /** @@ -378,7 +371,7 @@ OUString LwpSilverBullet::GetAdditionalName(sal_uInt8 nPos) bool bDivisionName = false; bool bSectionName = false; - LwpFrib* pParaFrib = m_pBulletPara->GetFribs()->GetFribs(); + LwpFrib* pParaFrib = m_pBulletPara->GetFribs().GetFribs(); if (!pParaFrib) { return aEmpty; @@ -435,10 +428,10 @@ OUString LwpSilverBullet::GetDivisionName() LwpDocument* pDoc = m_pFoundry->GetDocument(); if (pDoc) { - LwpObjectID* pID = pDoc->GetDivInfoID(); - if (!pID->IsNull()) + LwpObjectID& rID = pDoc->GetDivInfoID(); + if (!rID.IsNull()) { - LwpDivInfo *pInfo = dynamic_cast<LwpDivInfo*>(pID->obj(VO_DIVISIONINFO).get()); + LwpDivInfo *pInfo = dynamic_cast<LwpDivInfo*>(rID.obj(VO_DIVISIONINFO).get()); if (pInfo) aRet = pInfo->GetDivName(); } @@ -461,14 +454,7 @@ OUString LwpSilverBullet::GetSectionName() bool LwpSilverBullet::HasName() { - LwpAtomHolder* pName = this->GetName(); - if (pName) - { - return (!pName->str().isEmpty()); - } - else - { - return false; - } + LwpAtomHolder& rName = this->GetName(); + return (!rName.str().isEmpty()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/source/filter/lwpsilverbullet.hxx b/lotuswordpro/source/filter/lwpsilverbullet.hxx index 511b1f80ef56..27412b084749 100644 --- a/lotuswordpro/source/filter/lwpsilverbullet.hxx +++ b/lotuswordpro/source/filter/lwpsilverbullet.hxx @@ -163,7 +163,7 @@ inline OUString LwpSilverBullet::GetBulletStyleName() const inline OUString LwpSilverBullet::GetNumberingName() { - return GetName()->str(); + return GetName().str(); } inline LwpPara* LwpSilverBullet::GetNumberingPara() { diff --git a/lotuswordpro/source/filter/lwpslvlist.hxx b/lotuswordpro/source/filter/lwpslvlist.hxx index 2033e2024117..fa8a4aeeb4c5 100644 --- a/lotuswordpro/source/filter/lwpslvlist.hxx +++ b/lotuswordpro/source/filter/lwpslvlist.hxx @@ -76,7 +76,7 @@ public: if( LwpFileHeader::m_nFileRevision < 0x0006 ) pStrm->SkipExtra(); } - LwpObjectID* GetNext(){return &m_NextID;} + LwpObjectID& GetNext(){return m_NextID;} public: private: LwpObjectID m_NextID; diff --git a/lotuswordpro/source/filter/lwpstory.cxx b/lotuswordpro/source/filter/lwpstory.cxx index e38197a5b8b0..911e9ae47e90 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().get() ); + 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().get() ); + pPara = dynamic_cast<LwpPara*> ( pPara->GetNext().obj().get() ); } //process frame which anchor is to cell after converter all the para @@ -121,27 +121,27 @@ void LwpStory::XFConvert(XFContentContainer* pCont) XFConvertFrameInHeaderFooter(pCont); //Release Lwp Objects - LwpPara* pCur = dynamic_cast<LwpPara*> (GetFirstPara()->obj().get()); + LwpPara* pCur = dynamic_cast<LwpPara*> (GetFirstPara().obj().get()); LwpPara* pNext; while(pCur) { pCur->Release(); - pNext = dynamic_cast<LwpPara*> ( pCur->GetNext()->obj().get() ); + pNext = dynamic_cast<LwpPara*> ( pCur->GetNext().obj().get() ); LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance(); LwpObjectFactory* pObjMgr = pGlobal->GetLwpObjFactory(); - pObjMgr->ReleaseObject(*pCur->GetObjectID()); + pObjMgr->ReleaseObject(pCur->GetObjectID()); pCur = pNext; } } void LwpStory::RegisterStyle() { - LwpPara* pPara = dynamic_cast<LwpPara*>( GetFirstPara()->obj().get() ); + LwpPara* pPara = dynamic_cast<LwpPara*>( GetFirstPara().obj().get() ); while(pPara) { pPara->SetFoundry(m_pFoundry); pPara->RegisterStyle(); - pPara = dynamic_cast<LwpPara*>(pPara->GetNext()->obj().get()); + 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().get()); + LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetChildHead().obj().get()); while(pFrameLayout) { @@ -354,7 +354,7 @@ void LwpStory::XFConvertFrameInCell(XFContentContainer* pCont) if(pXFFirtPara) pFrameLayout->XFConvert(pXFFirtPara); } - pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext()->obj().get()); + pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext().obj().get()); } pLayout = GetLayout(pLayout); } @@ -371,7 +371,7 @@ void LwpStory::XFConvertFrameInPage(XFContentContainer* pCont) LwpVirtualLayout* pLayout = GetLayout(NULL); while(pLayout) { - LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetChildHead()->obj().get()); + LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetChildHead().obj().get()); while(pFrameLayout) { if((pFrameLayout->IsAnchorPage() @@ -381,7 +381,7 @@ void LwpStory::XFConvertFrameInPage(XFContentContainer* pCont) { pFrameLayout->XFConvert(pCont); } - pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext()->obj().get()); + pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext().obj().get()); } pLayout = GetLayout(pLayout); } @@ -397,14 +397,14 @@ void LwpStory::XFConvertFrameInFrame(XFContentContainer* pCont) LwpVirtualLayout* pLayout = GetLayout(NULL); while(pLayout) { - LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetChildHead()->obj().get()); + LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetChildHead().obj().get()); while(pFrameLayout) { if(pFrameLayout->IsAnchorFrame()) { pFrameLayout->XFConvert(pCont); } - pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext()->obj().get()); + pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext().obj().get()); } pLayout = GetLayout(pLayout); } @@ -420,7 +420,7 @@ void LwpStory::XFConvertFrameInHeaderFooter(XFContentContainer* pCont) LwpVirtualLayout* pLayout = GetLayout(NULL); while(pLayout) { - LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetChildHead()->obj().get()); + LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetChildHead().obj().get()); while(pFrameLayout) { if(pFrameLayout->IsAnchorPage() && (pLayout->IsHeader() || pLayout->IsFooter())) @@ -432,7 +432,7 @@ void LwpStory::XFConvertFrameInHeaderFooter(XFContentContainer* pCont) if(pXFFirtPara) pFrameLayout->XFConvert(pXFFirtPara); } - pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext()->obj().get()); + pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext().obj().get()); } pLayout = GetLayout(pLayout); } @@ -474,22 +474,22 @@ OUString LwpStory::GetContentText(bool bAllText) { OUString sText(""); //process para list - LwpPara* pPara = dynamic_cast<LwpPara*>(GetFirstPara()->obj().get()); + 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().get()); + pPara = dynamic_cast<LwpPara*>(pPara->GetNext().obj().get()); } return sText; } else //only the first text frib { - rtl::Reference<LwpObject> pObj = GetFirstPara()->obj(); + rtl::Reference<LwpObject> pObj = GetFirstPara().obj(); if(pObj.is()) { LwpPara* pPara = dynamic_cast<LwpPara*>(pObj.get()); - if (!pPara || pPara->GetNext()->obj() != NULL) + if (!pPara || pPara->GetNext().obj() != NULL) return OUString(""); pPara->SetFoundry(m_pFoundry); return pPara->GetContentText(); @@ -500,27 +500,23 @@ OUString LwpStory::GetContentText(bool bAllText) } OUString LwpStory::RegisterFirstFribStyle() { - LwpPara* pPara = dynamic_cast<LwpPara*>(GetFirstPara()->obj().get()); + LwpPara* pPara = dynamic_cast<LwpPara*>(GetFirstPara().obj().get()); if (!pPara) return OUString(""); pPara->SetFoundry(m_pFoundry); - LwpFribPtr* pFribs = pPara->GetFribs(); - if (pFribs) - { - LwpFrib* pFirstFrib = pFribs->GetFribs(); - pFirstFrib->RegisterStyle(m_pFoundry); - XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager(); - XFTextStyle* pBaseStyle = pXFStyleManager->FindTextStyle(pFirstFrib->GetStyleName()); - if (pBaseStyle == NULL) - return OUString(""); - XFTextStyle* pStyle = new XFTextStyle; - *pStyle = *pBaseStyle; - OUString sName = "Ruby" + pFirstFrib->GetStyleName(); - pStyle->SetStyleName(sName); - pXFStyleManager->AddStyle(pStyle); - return sName; - } - return OUString(""); + LwpFribPtr& rFribs = pPara->GetFribs(); + LwpFrib* pFirstFrib = rFribs.GetFribs(); + pFirstFrib->RegisterStyle(m_pFoundry); + XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager(); + XFTextStyle* pBaseStyle = pXFStyleManager->FindTextStyle(pFirstFrib->GetStyleName()); + if (pBaseStyle == NULL) + return OUString(""); + XFTextStyle* pStyle = new XFTextStyle; + *pStyle = *pBaseStyle; + OUString sName = "Ruby" + pFirstFrib->GetStyleName(); + pStyle->SetStyleName(sName); + pXFStyleManager->AddStyle(pStyle); + return sName; } bool LwpStory::IsBullStyleUsedBefore(const OUString& rStyleName, const sal_uInt8& nPos) diff --git a/lotuswordpro/source/filter/lwpstory.hxx b/lotuswordpro/source/filter/lwpstory.hxx index a1777240f850..a546b9d88ca8 100644 --- a/lotuswordpro/source/filter/lwpstory.hxx +++ b/lotuswordpro/source/filter/lwpstory.hxx @@ -106,9 +106,9 @@ public: void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; virtual void XFConvert(XFContentContainer* pCont) SAL_OVERRIDE; void XFConvertFrameInPage(XFContentContainer* pCont); - inline LwpDLVListHeadTail* GetParaList(); - inline LwpObjectID* GetFirstPara(); - inline LwpObjectID* GetLastPara(); + inline LwpDLVListHeadTail& GetParaList(); + inline LwpObjectID& GetFirstPara(); + inline LwpObjectID& GetLastPara(); XFContentContainer* GetXFContent(); void AddXFContent(XFContent* pContent); @@ -139,15 +139,15 @@ public: OUString RegisterFirstFribStyle(); }; -LwpDLVListHeadTail* LwpStory::GetParaList() +LwpDLVListHeadTail& LwpStory::GetParaList() { - return &m_ParaList; + return m_ParaList; } -LwpObjectID* LwpStory::GetFirstPara() +LwpObjectID& LwpStory::GetFirstPara() { return m_ParaList.GetHead(); } -LwpObjectID* LwpStory::GetLastPara() +LwpObjectID& LwpStory::GetLastPara() { return m_ParaList.GetTail(); } diff --git a/lotuswordpro/source/filter/lwptable.cxx b/lotuswordpro/source/filter/lwptable.cxx index 4d5539ee0dff..300fb38d3945 100644 --- a/lotuswordpro/source/filter/lwptable.cxx +++ b/lotuswordpro/source/filter/lwptable.cxx @@ -144,7 +144,7 @@ void LwpTable::Parse(IXFStream* /*pOutputStream*/) { LwpTableLayout* pLayout = dynamic_cast<LwpTableLayout*>(m_Layout.obj().get()); if(pLayout) - return dynamic_cast<LwpSuperTableLayout*>(pLayout->GetParent()->obj().get()); + return dynamic_cast<LwpSuperTableLayout*>(pLayout->GetParent().obj().get()); return NULL; } diff --git a/lotuswordpro/source/filter/lwptable.hxx b/lotuswordpro/source/filter/lwptable.hxx index e421a92227ba..833716c4a34e 100644 --- a/lotuswordpro/source/filter/lwptable.hxx +++ b/lotuswordpro/source/filter/lwptable.hxx @@ -121,7 +121,7 @@ public: virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; double GetWidth() {return LwpTools::ConvertFromUnitsToMetric(m_nWidth);} double GetHeight() {return LwpTools::ConvertFromUnitsToMetric(m_nHeight);} - LwpObjectID * GetDefaultCellStyle() {return &m_DefaultCellStyle;} + LwpObjectID& GetDefaultCellStyle() {return m_DefaultCellStyle;} sal_uInt16 GetRow() {return m_nRow;} sal_uInt16 GetColumn() {return m_nColumn;} LwpTableLayout * GetTableLayout(){return static_cast<LwpTableLayout *>(GetLayout(NULL));} diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx index 89eaa0444fac..0605ab3096bf 100644 --- a/lotuswordpro/source/filter/lwptablelayout.cxx +++ b/lotuswordpro/source/filter/lwptablelayout.cxx @@ -114,11 +114,11 @@ void LwpSuperTableLayout::Read() */ LwpTableLayout* LwpSuperTableLayout::GetTableLayout() { - LwpObjectID *pID = GetChildTail(); + LwpObjectID& rID = GetChildTail(); - while(pID && !pID->IsNull()) + while(!rID.IsNull()) { - LwpLayout* pLayout = dynamic_cast<LwpLayout*>(pID->obj().get()); + LwpLayout* pLayout = dynamic_cast<LwpLayout*>(rID.obj().get()); if (!pLayout) { break; @@ -127,7 +127,7 @@ LwpTableLayout* LwpSuperTableLayout::GetTableLayout() { return dynamic_cast<LwpTableLayout *>(pLayout); } - pID = pLayout->GetPrevious(); + rID = pLayout->GetPrevious(); } return NULL; @@ -138,11 +138,11 @@ LwpTableLayout* LwpSuperTableLayout::GetTableLayout() */ LwpTableHeadingLayout* LwpSuperTableLayout::GetTableHeadingLayout() { - LwpObjectID *pID = GetChildTail(); + LwpObjectID& rID = GetChildTail(); - while(pID && !pID->IsNull()) + while(!rID.IsNull()) { - LwpLayout * pLayout = dynamic_cast<LwpLayout *>(pID->obj().get()); + LwpLayout * pLayout = dynamic_cast<LwpLayout *>(rID.obj().get()); if (!pLayout) { break; @@ -152,7 +152,7 @@ LwpTableHeadingLayout* LwpSuperTableLayout::GetTableHeadingLayout() { return dynamic_cast<LwpTableHeadingLayout *>(pLayout); } - pID = pLayout->GetPrevious(); + rID = pLayout->GetPrevious(); } return NULL; @@ -234,8 +234,8 @@ double LwpSuperTableLayout::GetTableWidth() for(sal_uInt16 i =0; i< nCol; i++) { - LwpObjectID *pColumnID = pTableLayout->GetColumnLayoutHead(); - LwpColumnLayout * pColumnLayout = dynamic_cast<LwpColumnLayout *>(pColumnID->obj().get()); + LwpObjectID& rColumnID = pTableLayout->GetColumnLayoutHead(); + LwpColumnLayout * pColumnLayout = dynamic_cast<LwpColumnLayout *>(rColumnID.obj().get()); double dColumnWidth = dDefaultWidth; while (pColumnLayout) { @@ -244,8 +244,8 @@ double LwpSuperTableLayout::GetTableWidth() dColumnWidth = pColumnLayout->GetWidth(); break; } - pColumnID = pColumnLayout->GetNext(); - pColumnLayout = dynamic_cast<LwpColumnLayout *>(pColumnID->obj().get()); + rColumnID = pColumnLayout->GetNext(); + pColumnLayout = dynamic_cast<LwpColumnLayout *>(rColumnID.obj().get()); } dWidth += dColumnWidth; } @@ -468,8 +468,8 @@ void LwpTableLayout::TraverseTable() } // set value - LwpObjectID *pRowID = GetChildHead(); - LwpRowLayout * pRowLayout = dynamic_cast<LwpRowLayout *>(pRowID->obj().get()); + LwpObjectID& rRowID = GetChildHead(); + LwpRowLayout * pRowLayout = dynamic_cast<LwpRowLayout *>(rRowID.obj().get()); while (pRowLayout) { pRowLayout->SetRowMap(); @@ -479,8 +479,8 @@ void LwpTableLayout::TraverseTable() pRowLayout->CollectMergeInfo(); // end for 's analysis - pRowID = pRowLayout->GetNext(); - pRowLayout = dynamic_cast<LwpRowLayout *>(pRowID->obj().get()); + rRowID = pRowLayout->GetNext(); + pRowLayout = dynamic_cast<LwpRowLayout *>(rRowID.obj().get()); } } @@ -506,7 +506,7 @@ LwpObjectID * LwpTableLayout::SearchCellStoryMap(sal_uInt16 nRow, sal_uInt16 nCo { return NULL; } - return pCell->GetContent(); + return &pCell->GetContent(); } return NULL; @@ -518,7 +518,7 @@ LwpObjectID * LwpTableLayout::SearchCellStoryMap(sal_uInt16 nRow, sal_uInt16 nCo */ LwpSuperTableLayout * LwpTableLayout::GetSuperTableLayout() { - return dynamic_cast<LwpSuperTableLayout *>(GetParent()->obj().get()); + return dynamic_cast<LwpSuperTableLayout *>(GetParent().obj().get()); } /** * @short Get table pointer @@ -577,8 +577,8 @@ 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().get()); + LwpObjectID& rColumnID = GetColumnLayoutHead(); + LwpColumnLayout * pColumnLayout = dynamic_cast<LwpColumnLayout *>(rColumnID.obj().get()); while (pColumnLayout) { m_pColumns[pColumnLayout->GetColumnID()] = pColumnLayout; @@ -589,8 +589,8 @@ void LwpTableLayout::RegisterColumns() nJustifiableColumn --; } - pColumnID = pColumnLayout->GetNext(); - pColumnLayout = dynamic_cast<LwpColumnLayout *>(pColumnID->obj().get()); + rColumnID = pColumnLayout->GetNext(); + pColumnLayout = dynamic_cast<LwpColumnLayout *>(rColumnID.obj().get()); } // if all columns are not justifiable, the rightmost column will be changed to justifiable @@ -668,15 +668,15 @@ void LwpTableLayout::RegisterRows() m_DefaultRowStyleName = pXFStyleManager->AddStyle(pRowStyle)->GetStyleName(); // register style of rows - LwpObjectID * pRowID = GetChildHead(); - LwpRowLayout * pRowLayout = dynamic_cast<LwpRowLayout *>(pRowID->obj().get()); + LwpObjectID& rRowID = GetChildHead(); + LwpRowLayout * pRowLayout = dynamic_cast<LwpRowLayout *>(rRowID.obj().get()); while (pRowLayout) { pRowLayout->SetFoundry(m_pFoundry); pRowLayout->RegisterStyle(); - pRowID = pRowLayout->GetNext(); - pRowLayout = dynamic_cast<LwpRowLayout *>(pRowID->obj().get()); + rRowID = pRowLayout->GetNext(); + pRowLayout = dynamic_cast<LwpRowLayout *>(rRowID.obj().get()); } } /** @@ -706,11 +706,8 @@ void LwpTableLayout::RegisterStyle() m_nCols = pTable->GetColumn(); // get default cell layout of current table - LwpObjectID * pID= pTable->GetDefaultCellStyle(); - if (pID) - { - m_pDefaultCellLayout = dynamic_cast<LwpCellLayout *>(pID->obj().get()); - } + LwpObjectID& rID= pTable->GetDefaultCellStyle(); + m_pDefaultCellLayout = dynamic_cast<LwpCellLayout *>(rID.obj().get()); // register columns styles RegisterColumns(); @@ -759,7 +756,7 @@ void LwpTableLayout::RegisterStyle() //New Code if( GetFoundry() && GetTable() ) - PutCellVals( GetFoundry(),*GetTable()->GetObjectID() ); + PutCellVals( GetFoundry(),GetTable()->GetObjectID() ); } /** * @short read table layout @@ -777,7 +774,7 @@ void LwpTableLayout::ParseTable() // set name of object m_pXFTable = new XFTable; - m_pXFTable->SetTableName(pSuper->GetName()->str()); + m_pXFTable->SetTableName(pSuper->GetName().str()); // set table style m_pXFTable->SetStyleName(m_StyleName); @@ -1111,9 +1108,9 @@ void LwpTableLayout::PutCellVals(LwpFoundry* pFoundry, LwpObjectID aTableID) try{ - LwpDLVListHeadHolder* pHolder = (LwpDLVListHeadHolder*)pFoundry->GetNumberManager()->GetTableRangeID().obj().get(); + LwpDLVListHeadHolder* pHolder = (LwpDLVListHeadHolder*)pFoundry->GetNumberManager().GetTableRangeID().obj().get(); - LwpTableRange* pTableRange = (LwpTableRange*)pHolder->GetHeadID()->obj().get(); + LwpTableRange* pTableRange = (LwpTableRange*)pHolder->GetHeadID().obj().get(); //Look up the table while (NULL!=pTableRange) @@ -1251,8 +1248,8 @@ void LwpTableLayout::ConvertColumn(XFTable *pXFTable,sal_uInt8 nStartCol,sal_uIn for (sal_uInt32 iLoop = 0; iLoop < static_cast<sal_uInt32>(nEndCol)-nStartCol; ++iLoop) { // add row to table - LwpObjectID *pColID = GetColumnLayoutHead(); - LwpColumnLayout * pColumnLayout = dynamic_cast<LwpColumnLayout *>(pColID->obj().get()); + LwpObjectID& rColID = GetColumnLayoutHead(); + LwpColumnLayout * pColumnLayout = dynamic_cast<LwpColumnLayout *>(rColID.obj().get()); while (pColumnLayout) { if (pColumnLayout->GetColumnID() == (iLoop+nStartCol)) @@ -1260,8 +1257,8 @@ void LwpTableLayout::ConvertColumn(XFTable *pXFTable,sal_uInt8 nStartCol,sal_uIn pXFTable->SetColumnStyle(iLoop+1, pColumnLayout->GetStyleName()); break; } - pColID = pColumnLayout->GetNext(); - pColumnLayout = dynamic_cast<LwpColumnLayout *>(pColID->obj().get()); + rColID = pColumnLayout->GetNext(); + pColumnLayout = dynamic_cast<LwpColumnLayout *>(rColID.obj().get()); } if (!pColumnLayout) { @@ -1342,7 +1339,7 @@ void LwpTableLayout::ConvertDefaultRow(XFTable* pXFTable,sal_uInt8 nStartCol, if (m_pDefaultCellLayout) { pCell = m_pDefaultCellLayout->ConvertCell( - *GetTable()->GetObjectID(),nRowID,j+nStartCol); + GetTable()->GetObjectID(),nRowID,j+nStartCol); } else { @@ -1393,15 +1390,15 @@ 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().get()); + LwpObjectID& rRowID = GetChildHead(); + LwpRowLayout * pRowLayout = dynamic_cast<LwpRowLayout *>(rRowID.obj().get()); while (pRowLayout) { if(pRowLayout->GetRowID() == nRow) return pRowLayout; - pRowID = pRowLayout->GetNext(); - pRowLayout = dynamic_cast<LwpRowLayout *>(pRowID->obj().get()); + rRowID = pRowLayout->GetNext(); + pRowLayout = dynamic_cast<LwpRowLayout *>(rRowID.obj().get()); } return NULL; } @@ -1479,10 +1476,10 @@ void LwpTableHeadingLayout::GetStartEndRow(sal_uInt16& nStartRow, sal_uInt16& nE */ LwpRowHeadingLayout * LwpTableHeadingLayout::GetFirstRowHeadingLayout() { - LwpObjectID *pID = GetChildHead(); - if(pID && !pID->IsNull()) + LwpObjectID& rID = GetChildHead(); + if(!rID.IsNull()) { - LwpRowHeadingLayout * pHeadingRow = dynamic_cast<LwpRowHeadingLayout *>(pID->obj().get()); + LwpRowHeadingLayout * pHeadingRow = dynamic_cast<LwpRowHeadingLayout *>(rID.obj().get()); return pHeadingRow; } return NULL; diff --git a/lotuswordpro/source/filter/lwptablelayout.hxx b/lotuswordpro/source/filter/lwptablelayout.hxx index 1e7fb3b35a65..71ddcfdfd5d4 100644 --- a/lotuswordpro/source/filter/lwptablelayout.hxx +++ b/lotuswordpro/source/filter/lwptablelayout.hxx @@ -90,7 +90,7 @@ public: LwpTableLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm); virtual ~LwpTableLayout(); virtual LWP_LAYOUT_TYPE GetLayoutType () SAL_OVERRIDE { return LWP_TABLE_LAYOUT;} - LwpObjectID * GetColumnLayoutHead(){return &m_ColumnLayout;} + LwpObjectID& GetColumnLayoutHead(){return m_ColumnLayout;} void RegisterStyle() SAL_OVERRIDE; LwpTable * GetTable(); LwpCellLayout * GetDefaultCellLayout(){return m_pDefaultCellLayout;} diff --git a/lotuswordpro/source/filter/lwptaboverride.hxx b/lotuswordpro/source/filter/lwptaboverride.hxx index b9c28e21e5c2..8abcb540b38a 100644 --- a/lotuswordpro/source/filter/lwptaboverride.hxx +++ b/lotuswordpro/source/filter/lwptaboverride.hxx @@ -87,7 +87,7 @@ public: pStrm->SkipExtra(); } - inline LwpObjectID* GetTabRackID(); + inline LwpObjectID& GetTabRackID(); inline bool IsTabRackOverridden(); inline void Override(LwpTabOverride* pOther); inline void OverrideTabRack(LwpObjectID* pTabRackID); @@ -106,9 +106,9 @@ private: }; }; -inline LwpObjectID* LwpTabOverride::GetTabRackID() +inline LwpObjectID& LwpTabOverride::GetTabRackID() { - return &m_aTabRackID; + return m_aTabRackID; } inline void LwpTabOverride::Override(LwpTabOverride* pOther) @@ -117,7 +117,7 @@ inline void LwpTabOverride::Override(LwpTabOverride* pOther) { if (IsTabRackOverridden()) //m_aTabRackID = *(pOther->GetTabRackID()); - pOther->OverrideTabRack(GetTabRackID()); + pOther->OverrideTabRack(&GetTabRackID()); } } diff --git a/lotuswordpro/source/filter/lwptblcell.hxx b/lotuswordpro/source/filter/lwptblcell.hxx index b304999e5144..1d610248d271 100644 --- a/lotuswordpro/source/filter/lwptblcell.hxx +++ b/lotuswordpro/source/filter/lwptblcell.hxx @@ -85,7 +85,7 @@ public: LwpCellList(LwpObjectHeader &objHdr, LwpSvStream* pStrm); virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; - LwpObjectID GetNextID(){return *GetNext();} + LwpObjectID GetNextID(){return GetNext();} sal_uInt8 GetColumnID(){return cColumn;} virtual bool IsFormula(){return false;} LwpObjectID GetValueID(){return cValue;} @@ -110,8 +110,8 @@ public: LwpRowList(LwpObjectHeader &objHdr, LwpSvStream* pStrm); void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; - LwpObjectID GetChildHeadID(){return *cChild.GetHead();} - LwpObjectID GetNextID(){return *GetNext();} + LwpObjectID GetChildHeadID(){return cChild.GetHead();} + LwpObjectID GetNextID(){return GetNext();} sal_uInt16 GetRowID(){return cRowID;} protected: LwpDLVListHeadTail cChild; @@ -152,7 +152,7 @@ public: void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; LwpObjectID GetCellRangeID(){return cpCellRange;} LwpObjectID GetTableID(){ return cqTable;} - LwpTableRange* GetNext() { return (LwpTableRange*)(LwpDLVList::GetNext()->obj().get());} + LwpTableRange* GetNext() { return (LwpTableRange*)(LwpDLVList::GetNext().obj().get());} protected: LwpObjectID cqTable; LwpObjectID cpCellRange; @@ -187,7 +187,7 @@ public: LwpFolder(LwpObjectHeader &objHdr, LwpSvStream* pStrm); void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; - LwpObjectID GetChildHeadID(){ return *cChild.GetHead();} + LwpObjectID GetChildHeadID(){ return cChild.GetHead();} protected: LwpDLVListHeadTail cChild; LwpObjectID cParent; diff --git a/lotuswordpro/source/filter/lwptoc.cxx b/lotuswordpro/source/filter/lwptoc.cxx index 0a8b848a09b6..d36a9659c3d7 100644 --- a/lotuswordpro/source/filter/lwptoc.cxx +++ b/lotuswordpro/source/filter/lwptoc.cxx @@ -384,8 +384,8 @@ 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().get()); + LwpObjectID& rID = m_SearchItems.GetHead(); + LwpTocLevelData * pObj = dynamic_cast<LwpTocLevelData *>(rID.obj().get()); while(pObj) { @@ -394,8 +394,8 @@ LwpTocLevelData * LwpTocSuperLayout::GetSearchLevelPtr(sal_uInt16 index) return pObj; } - pID = pObj->GetNext(); // not necessary to check pID NULL or not - pObj = dynamic_cast<LwpTocLevelData *>(pID->obj().get()); + rID = pObj->GetNext(); + pObj = dynamic_cast<LwpTocLevelData *>(rID.obj().get()); } return NULL; @@ -408,8 +408,8 @@ 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().get()); + LwpObjectID& rID = pCurData->GetNext(); + LwpTocLevelData * pObj = dynamic_cast<LwpTocLevelData *>(rID.obj().get()); while(pObj) { @@ -418,8 +418,8 @@ LwpTocLevelData * LwpTocSuperLayout::GetNextSearchLevelPtr(sal_uInt16 index, Lwp return pObj; } - pID = pObj->GetNext(); // not necessary to check pID NULL or not - pObj = dynamic_cast<LwpTocLevelData *>(pID->obj().get()); + rID = pObj->GetNext(); + pObj = dynamic_cast<LwpTocLevelData *>(rID.obj().get()); } return NULL; diff --git a/lotuswordpro/source/filter/lwpvpointer.hxx b/lotuswordpro/source/filter/lwpvpointer.hxx index c9bc1f58ce06..93837ee4c6fc 100644 --- a/lotuswordpro/source/filter/lwpvpointer.hxx +++ b/lotuswordpro/source/filter/lwpvpointer.hxx @@ -75,7 +75,7 @@ public: void Read() SAL_OVERRIDE; void RegisterStyle() SAL_OVERRIDE; void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; - LwpObjectID* GetPointer(){return &m_PointerID;} + LwpObjectID& GetPointer(){return m_PointerID;} protected: LwpObjectID m_PointerID; private: diff --git a/lotuswordpro/source/filter/tocread.cxx b/lotuswordpro/source/filter/tocread.cxx index bb143710338b..90544df0ad6a 100644 --- a/lotuswordpro/source/filter/tocread.cxx +++ b/lotuswordpro/source/filter/tocread.cxx @@ -278,7 +278,7 @@ CBenTOCReader::ReadTOC() } pCBenNamedObjectListElmt pPrevNamedObjectListElmt; - if (FindNamedObject(cpContainer->GetNamedObjects(), + if (FindNamedObject(&cpContainer->GetNamedObjects(), sBuffer, &pPrevNamedObjectListElmt) != NULL) { delete[] sAllocBuffer; @@ -286,7 +286,7 @@ CBenTOCReader::ReadTOC() } pCBenObject pPrevObject = (pCBenObject) cpContainer-> - GetObjects()->GetLast(); + GetObjects().GetLast(); if (PropertyID == BEN_PROPID_GLOBAL_PROPERTY_NAME) pObject = new CBenPropertyName(cpContainer, ObjectID, @@ -332,12 +332,12 @@ CBenTOCReader::ReadTOC() if (pObject == NULL) pObject = new CBenObject(cpContainer, ObjectID, - (pCBenObject) cpContainer->GetObjects()->GetLast()); + (pCBenObject) cpContainer->GetObjects().GetLast()); pProperty = new CBenProperty(pObject, PropertyID, TypeID, - (pCBenProperty) pObject->GetProperties()->GetLast()); + (pCBenProperty) pObject->GetProperties().GetLast()); - if ((Err = ReadSegments(pProperty->UseValue(), + if ((Err = ReadSegments(&pProperty->UseValue(), &LookAhead)) != BenErr_OK) return Err; } diff --git a/lotuswordpro/source/filter/utlist.cxx b/lotuswordpro/source/filter/utlist.cxx index 11d5bf04f107..9825cbf0baa9 100644 --- a/lotuswordpro/source/filter/utlist.cxx +++ b/lotuswordpro/source/filter/utlist.cxx @@ -77,15 +77,15 @@ CUtListElmt::~CUtListElmt() CUtList::~CUtList() { - pCUtListElmt pTerminating = GetTerminating(); - for (pCUtListElmt pCurr = GetFirst(); pCurr != pTerminating; ) + CUtListElmt& rTerminating = GetTerminating(); + for (pCUtListElmt pCurr = GetFirst(); pCurr != &rTerminating; ) { pCUtListElmt pNext = pCurr->GetNext(); pCurr->MakeNotOnList(); pCurr = pNext; } - pTerminating->SetPrev(pTerminating); - pTerminating->SetNext(pTerminating); + rTerminating.SetPrev(&rTerminating); + rTerminating.SetNext(&rTerminating); } // If pCurr is NULL, returns first item in list. Otherwise, returns item @@ -99,7 +99,7 @@ CUtList::GetNextOrNULL(pCUtListElmt pCurr) if (pCurr == NULL) pNext = GetFirst(); else pNext = pCurr->GetNext(); - if (pNext == GetTerminating()) + if (pNext == &GetTerminating()) pNext = NULL; return pNext; } @@ -107,8 +107,8 @@ CUtList::GetNextOrNULL(pCUtListElmt pCurr) void CUtList::Destroy() { - pCUtListElmt pTerminating = GetTerminating(); - for (pCUtListElmt pCurr = GetFirst(); pCurr != pTerminating; ) + CUtListElmt& rTerminating = GetTerminating(); + for (pCUtListElmt pCurr = GetFirst(); pCurr != &rTerminating; ) { pCUtListElmt pNext = pCurr->GetNext(); delete pCurr; diff --git a/lotuswordpro/source/filter/utlist.hxx b/lotuswordpro/source/filter/utlist.hxx index bd7f50faefcb..deb9f72d1e4b 100644 --- a/lotuswordpro/source/filter/utlist.hxx +++ b/lotuswordpro/source/filter/utlist.hxx @@ -120,9 +120,9 @@ public: // Methods virtual ~CUtList(); pCUtListElmt GetFirst() { return cDummyElmt.GetNext(); } pCUtListElmt GetLast() { return cDummyElmt.GetPrev(); } - pCUtListElmt GetTerminating() { return &cDummyElmt; } + CUtListElmt& GetTerminating() { return cDummyElmt; } pCUtListElmt GetNextOrNULL(pCUtListElmt pCurr); - bool IsEmpty() { return GetFirst() == GetTerminating(); }; + bool IsEmpty() { return GetFirst() == &GetTerminating(); }; bool ContainsAtLeastTwoItems() { return GetFirst() != GetLast(); }; void Destroy(void); diff --git a/lotuswordpro/source/filter/xfilter/xfborders.hxx b/lotuswordpro/source/filter/xfilter/xfborders.hxx index dd718422cbee..4d5592c08fd9 100644 --- a/lotuswordpro/source/filter/xfilter/xfborders.hxx +++ b/lotuswordpro/source/filter/xfilter/xfborders.hxx @@ -167,13 +167,13 @@ public: */ void SetWidthOuter(enumXFBorder side, double outer); - XFBorder * GetLeft() {return &m_aBorderLeft;} + XFBorder& GetLeft() {return m_aBorderLeft;} - XFBorder * GetRight() {return &m_aBorderRight;} + XFBorder& GetRight() {return m_aBorderRight;} - XFBorder * GetTop() {return &m_aBorderTop;} + XFBorder& GetTop() {return m_aBorderTop;} - XFBorder * GetBottom() {return &m_aBorderBottom;} + XFBorder& GetBottom() {return m_aBorderBottom;} void ToXml(IXFStream *pStrm); |