diff options
Diffstat (limited to 'lotuswordpro/source/filter/lwptoc.cxx')
-rw-r--r-- | lotuswordpro/source/filter/lwptoc.cxx | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/lotuswordpro/source/filter/lwptoc.cxx b/lotuswordpro/source/filter/lwptoc.cxx index e81bf7039be4..8888e6af9619 100644 --- a/lotuswordpro/source/filter/lwptoc.cxx +++ b/lotuswordpro/source/filter/lwptoc.cxx @@ -261,44 +261,44 @@ void LwpTocSuperLayout::XFConvert(XFContentContainer* pCont) */ void LwpTocSuperLayout::XFConvertFrame(XFContentContainer* pCont, sal_Int32 nStart, sal_Int32 nEnd, bool bAll) { - if (m_pFrame) + if (!m_pFrame) + return; + + rtl::Reference<XFFrame> xXFFrame; + if(nEnd < nStart) { - rtl::Reference<XFFrame> xXFFrame; - if(nEnd < nStart) - { - xXFFrame.set(new XFFrame); - } - else - { - xXFFrame.set(new XFFloatFrame(nStart, nEnd, bAll)); - } + xXFFrame.set(new XFFrame); + } + else + { + xXFFrame.set(new XFFloatFrame(nStart, nEnd, bAll)); + } - m_pFrame->Parse(xXFFrame.get(), static_cast<sal_uInt16>(nStart)); + m_pFrame->Parse(xXFFrame.get(), static_cast<sal_uInt16>(nStart)); - //parse table, and add table to frame or TOC - LwpTableLayout * pTableLayout = GetTableLayout(); - if (pTableLayout) - { - XFContentContainer* pTableContainer = xXFFrame.get(); - // if *this is a TOCSuperTableLayout and it's located in a cell - // add the frame to upper level and add TOCSuperTableLayout into the frame - rtl::Reference<LwpVirtualLayout> xContainer(GetContainerLayout()); - if (!xContainer.is()) - return; - if (xContainer->IsCell()) - { - pTableContainer = pCont; // TOC contain table directly - xXFFrame->Add(pCont); - m_pCont->Add(xXFFrame.get()); - } - else - { - //add frame to the container - pCont->Add(xXFFrame.get()); - } - pTableLayout->XFConvert(pTableContainer); - } + //parse table, and add table to frame or TOC + LwpTableLayout * pTableLayout = GetTableLayout(); + if (!pTableLayout) + return; + + XFContentContainer* pTableContainer = xXFFrame.get(); + // if *this is a TOCSuperTableLayout and it's located in a cell + // add the frame to upper level and add TOCSuperTableLayout into the frame + rtl::Reference<LwpVirtualLayout> xContainer(GetContainerLayout()); + if (!xContainer.is()) + return; + if (xContainer->IsCell()) + { + pTableContainer = pCont; // TOC contain table directly + xXFFrame->Add(pCont); + m_pCont->Add(xXFFrame.get()); } + else + { + //add frame to the container + pCont->Add(xXFFrame.get()); + } + pTableLayout->XFConvert(pTableContainer); } @@ -318,22 +318,22 @@ void LwpTocSuperLayout::AddSourceStyle(XFIndex* pToc, LwpTocLevelData * pLevel, OUString sLwpStyleName = pLevel->GetSearchStyle(); - if (pFoundry) + if (!pFoundry) + return; + + LwpDocument * pDoc = pFoundry->GetDocument(); + if (pDoc && pDoc->IsChildDoc()) { - LwpDocument * pDoc = pFoundry->GetDocument(); - if (pDoc && pDoc->IsChildDoc()) - { - OUString sSodcStyleName = pFoundry->FindActuralStyleName(sLwpStyleName); - pToc->AddTocSource(pLevel->GetLevel(), sSodcStyleName); - } - else + OUString sSodcStyleName = pFoundry->FindActuralStyleName(sLwpStyleName); + pToc->AddTocSource(pLevel->GetLevel(), sSodcStyleName); + } + else + { + pDoc = pDoc->GetFirstDivision(); + while (pDoc) { - pDoc = pDoc->GetFirstDivision(); - while (pDoc) - { - AddSourceStyle(pToc, pLevel, pDoc->GetFoundry() ); - pDoc = pDoc->GetNextDivision(); - } + AddSourceStyle(pToc, pLevel, pDoc->GetFoundry() ); + pDoc = pDoc->GetNextDivision(); } } } |