sw/source/filter/ww8/docxexport.cxx | 5 +++++ sw/source/filter/ww8/docxexport.hxx | 2 +- sw/source/filter/ww8/rtfexport.cxx | 2 +- sw/source/filter/ww8/writerhelper.cxx | 6 ------ sw/source/filter/ww8/writerhelper.hxx | 22 +++++++++++----------- sw/source/filter/ww8/wrtw8nds.cxx | 12 ++++++------ sw/source/filter/ww8/wrtw8num.cxx | 22 +++++++++++----------- sw/source/filter/ww8/wrtww8.cxx | 6 +++--- sw/source/filter/ww8/wrtww8.hxx | 3 +-- sw/source/filter/ww8/wrtww8gr.cxx | 10 +++++----- sw/source/filter/ww8/ww8par.cxx | 16 +++++++--------- sw/source/filter/ww8/ww8par3.cxx | 28 +++++++++++++++------------- sw/source/ui/wrtsh/wrtsh1.cxx | 2 -- 13 files changed, 66 insertions(+), 70 deletions(-)
New commits: commit 16384a53f7fb5b3eeaaa6e624c7416f7e13b17d2 Author: Cédric Bosdonnat <cedric.bosdon...@free.fr> Date: Thu Mar 14 11:24:04 2013 +0100 Code cleanup for i#120928 patch Change-Id: Ic46acc5207bab70f080c4eba5a8113de8376ad36 diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 1b3c8f8..74854fa 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -152,6 +152,11 @@ void DocxExport::AppendBookmark( const OUString& rName, bool /*bSkip*/ ) m_pAttrOutput->WriteBookmarks_Impl( aStarts, aEnds ); } +void DocxExport::ExportGrfBullet(const SwTxtNode&) +{ + SAL_INFO("sw.docx", "TODO: " << OSL_THIS_FUNC); +} + ::rtl::OString DocxExport::AddRelation( const OUString& rType, const OUString& rTarget ) { OUString sId = m_pFilter->addRelation( m_pDocumentFS->getOutputStream(), diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx index 79ec117..203dbea 100644 --- a/sw/source/filter/ww8/docxexport.hxx +++ b/sw/source/filter/ww8/docxexport.hxx @@ -108,7 +108,7 @@ public: virtual void AppendBookmark( const rtl::OUString& rName, bool bSkip = false ); - virtual void ExportGrfBullet(const SwTxtNode&) {} + virtual void ExportGrfBullet(const SwTxtNode&); /// Returns the relationd id rtl::OString AddRelation( const rtl::OUString& rType, const rtl::OUString& rTarget ); diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 0079fbe..3f413a5 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -171,7 +171,7 @@ void RtfExport::AppendBookmark( const OUString& rName, bool /*bSkip*/ ) //For i120928,to export graphic of bullet for RTF filter void RtfExport::ExportGrfBullet(const SwTxtNode&) { - //This is for RTF filter on the graphic bullets + SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC); } void RtfExport::WriteChar( sal_Unicode ) diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx index 32167e0..5c9e6ec 100644 --- a/sw/source/filter/ww8/writerhelper.cxx +++ b/sw/source/filter/ww8/writerhelper.cxx @@ -50,12 +50,6 @@ #include <unotools/streamwrap.hxx> #include <numrule.hxx> #include <vcl/svapp.hxx>//For i120928 -#ifdef DEBUGDUMP -# include <vcl/svapp.hxx> -# include <tools/urlobj.hxx> -# include <unotools/ucbstreamhelper.hxx> -# include <unotools/localfilehelper.hxx> -#endif using namespace com::sun::star; using namespace nsSwGetPoolIdFromName; diff --git a/sw/source/filter/ww8/writerhelper.hxx b/sw/source/filter/ww8/writerhelper.hxx index 266af14..3d45b43 100644 --- a/sw/source/filter/ww8/writerhelper.hxx +++ b/sw/source/filter/ww8/writerhelper.hxx @@ -95,7 +95,7 @@ namespace sw class Frame { public: - enum WriterSource {eTxtBox, eGraphic, eOle, eDrawing, eFormControl,eBulletGrf};//For i120928,add Grf Bul Type + enum WriterSource {eTxtBox, eGraphic, eOle, eDrawing, eFormControl,eBulletGrf}; private: const SwFrmFmt* mpFlyFrm; SwPosition maPos; @@ -112,8 +112,8 @@ namespace sw Graphic maGrf; public: Frame(const SwFrmFmt &rFlyFrm, const SwPosition &rPos); - Frame(const Graphic&, const SwPosition &); - //End + Frame(const Graphic&, const SwPosition &); + /** Get the writer SwFrmFmt that this object describes @return @@ -167,8 +167,8 @@ namespace sw the first node of content in the frame, might not be any at all. */ const SwNode *GetContent() const { return mpStartFrameContent; } - const Graphic &GetGraphic() const { return maGrf; } - bool HasGraphic() const { return mbForBullet; } + const Graphic &GetGraphic() const { return maGrf; } + bool HasGraphic() const { return mbForBullet; } /** Does this sw::Frame refer to the same writer content as another @@ -178,12 +178,12 @@ namespace sw */ bool RefersToSameFrameAs(const Frame &rOther) const { - if (mbForBullet && rOther.mbForBullet) - return (maGrf == rOther.maGrf); - else if ((!mbForBullet) && (!rOther.mbForBullet)) - return (mpFlyFrm == rOther.mpFlyFrm); - else - return false; + if (mbForBullet && rOther.mbForBullet) + return (maGrf == rOther.maGrf); + else if ((!mbForBullet) && (!rOther.mbForBullet)) + return (mpFlyFrm == rOther.mpFlyFrm); + else + return false; } /** The Size of the contained element diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index f7742d3..d04de43 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -1977,12 +1977,12 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) m_aCurrentCharPropStarts.pop(); AttrOutput().EndTOX( *pTOXSect ); } - //For i120928,the position of the bullet's graphic is at end of doc - if (bLastCR && (!bExported)) - { - ExportGrfBullet(rNode); - bExported = true; - } + //For i120928,the position of the bullet's graphic is at end of doc + if (bLastCR && (!bExported)) + { + ExportGrfBullet(rNode); + bExported = true; + } WriteCR( pTextNodeInfoInner ); } diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx index 4d086b8..25d1ece 100644 --- a/sw/source/filter/ww8/wrtw8num.cxx +++ b/sw/source/filter/ww8/wrtw8num.cxx @@ -255,18 +255,18 @@ void WW8AttributeOutput::NumberingLevel( sal_uInt8 /*nLevel*/, } m_rWW8Export.OutputItemSet( *pOutSet, false, true, i18n::ScriptType::LATIN, m_rWW8Export.mbExportModeRTF ); - //For i120928,achieve graphic's index of bullet from the bullet bookmark - if (SVX_NUM_BITMAP == nNumberingType && pBrush) - { - int nIndex = m_rWW8Export.GetGrfIndex(*pBrush); - if ( nIndex != -1 ) + //For i120928,achieve graphic's index of bullet from the bullet bookmark + if (SVX_NUM_BITMAP == nNumberingType && pBrush) { - m_rWW8Export.InsUInt16(0x6887); - m_rWW8Export.InsUInt32(nIndex); - m_rWW8Export.InsUInt16(0x4888); - m_rWW8Export.InsUInt16(1); + int nIndex = m_rWW8Export.GetGrfIndex(*pBrush); + if ( nIndex != -1 ) + { + m_rWW8Export.InsUInt16(0x6887); + m_rWW8Export.InsUInt32(nIndex); + m_rWW8Export.InsUInt16(0x4888); + m_rWW8Export.InsUInt16(1); + } } - } m_rWW8Export.pO = pOldpO; } @@ -493,7 +493,7 @@ void MSWordExportBase::AbstractNumberingDefinitions() pPseudoFont, pOutSet, nIndentAt, nFirstLineIndex, nListTabPos, sNumStr, - rFmt.GetNumberingType()==SVX_NUM_BITMAP ? rFmt.GetBrush():0);//Start for i120928,export graphic bullet,2012.9.25 + rFmt.GetNumberingType()==SVX_NUM_BITMAP ? rFmt.GetBrush():0); delete pPseudoFont; } diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 9bce330..2aeaf80 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -1415,12 +1415,12 @@ int WW8Export::CollectGrfsOfBullets() const { int nCountRule = pDoc->GetNumRuleTbl().size(); for (int n = 0; n < nCountRule; ++n) - { + { const SwNumRule &rRule = *( pDoc->GetNumRuleTbl().at(n) ); sal_uInt16 nLevels = rRule.IsContinusNum() ? 1 : 9; for (sal_uInt16 nLvl = 0; nLvl < nLevels; ++nLvl) - { - const SwNumFmt &rFmt = rRule.Get(nLvl); + { + const SwNumFmt &rFmt = rRule.Get(nLvl); if (SVX_NUM_BITMAP != rFmt.GetNumberingType()) { continue; diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 66d402d..aae74df 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -912,8 +912,7 @@ public: sal_uInt8 bWrtWW8 : 1; ///< Write WW95 (false) or WW97 (true) file format - //For i120928,this vector is to record all the graphics of bullets - mutable std::vector<const Graphic*> m_vecBulletPic; + mutable std::vector<const Graphic*> m_vecBulletPic; ///< Vector to record all the graphics of bullets protected: SwWW8Writer *m_pWriter; ///< Pointer to the writer diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx index d072727..d5ae614 100644 --- a/sw/source/filter/ww8/wrtww8gr.cxx +++ b/sw/source/filter/ww8/wrtww8gr.cxx @@ -866,11 +866,11 @@ void SwWW8WrGrf::WriteGraphicNode(SvStream& rStrm, const GraphicDetails &rItem) //For i120928,add branch to export graphic of bullet case sw::Frame::eBulletGrf: { - if (rItem.maFly.HasGraphic()) - { - const Graphic& rGrf = rItem.maFly.GetGraphic(); - WriteGrfForBullet(rStrm, rGrf, nWidth, nHeight); - } + if (rItem.maFly.HasGraphic()) + { + const Graphic& rGrf = rItem.maFly.GetGraphic(); + WriteGrfForBullet(rStrm, rGrf, nWidth, nHeight); + } } break; diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 22c0c03..39144e9 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -4754,8 +4754,6 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos) GrafikDtor(); DELETEZ( pMSDffManager ); DELETEZ( pHdFt ); - //For i120928,delay the destruct action - //DELETEZ( pLstManager ); DELETEZ( pSBase ); delete pWDop; DELETEZ( pFonts ); @@ -4780,12 +4778,12 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos) rDoc.getIDocumentMarkAccess(); if ( pMarkAccess ) { - IDocumentMarkAccess::const_iterator_t ppBkmk = - pMarkAccess->findBookmark( "_PictureBullets" ); - if ( ppBkmk != pMarkAccess->getBookmarksEnd() && - IDocumentMarkAccess::GetType( *(ppBkmk->get()) ) - == IDocumentMarkAccess::BOOKMARK ) - { + IDocumentMarkAccess::const_iterator_t ppBkmk = + pMarkAccess->findBookmark( "_PictureBullets" ); + if ( ppBkmk != pMarkAccess->getBookmarksEnd() && + IDocumentMarkAccess::GetType( *(ppBkmk->get()) ) + == IDocumentMarkAccess::BOOKMARK ) + { SwTxtNode* pTxtNode = ppBkmk->get()->GetMarkStart().nNode.GetNode().GetTxtNode(); if ( pTxtNode ) { @@ -4846,8 +4844,8 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos) } } } - DELETEZ( pLstManager ); } + DELETEZ( pLstManager ); } //remove extra paragraphs after attribute ctrl diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index ed39660..b3312ba 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -655,17 +655,17 @@ bool WW8ListManager::ReadLVL(SwNumFmt& rNumFmt, SfxItemSet*& rpItemSet, if(aLVL.nLenGrpprlChpx != rSt.Read(&aGrpprlChpx, aLVL.nLenGrpprlChpx)) return false; - //For i120928,parse the graphic info of bullets - sal_uInt8 *pSprmWhichPis = GrpprlHasSprm(0x6887,aGrpprlChpx[0],aLVL.nLenGrpprlChpx); - sal_uInt8 *pSprmIsPicBullet = GrpprlHasSprm(0x4888,aGrpprlChpx[0],aLVL.nLenGrpprlChpx); - if (pSprmWhichPis) - { - nWitchPicIsBullet = *pSprmWhichPis; - } - if (pSprmIsPicBullet) - { - bIsPicBullet = (*pSprmIsPicBullet) & 0x0001; - } + //For i120928,parse the graphic info of bullets + sal_uInt8 *pSprmWhichPis = GrpprlHasSprm(0x6887,aGrpprlChpx[0],aLVL.nLenGrpprlChpx); + sal_uInt8 *pSprmIsPicBullet = GrpprlHasSprm(0x4888,aGrpprlChpx[0],aLVL.nLenGrpprlChpx); + if (pSprmWhichPis) + { + nWitchPicIsBullet = *pSprmWhichPis; + } + if (pSprmIsPicBullet) + { + bIsPicBullet = (*pSprmIsPicBullet) & 0x0001; + } // neues ItemSet fuer die Zeichenattribute anlegen rpItemSet = new SfxItemSet( rDoc.GetAttrPool(), RES_CHRATR_BEGIN, @@ -814,10 +814,12 @@ bool WW8ListManager::ReadLVL(SwNumFmt& rNumFmt, SfxItemSet*& rpItemSet, if (!cBullet) // unsave control code? cBullet = 0x2190; - } else if (SVX_NUM_BITMAP == eType) //For i120928,position index info of graphic + } + else if (SVX_NUM_BITMAP == eType) //For i120928,position index info of graphic { cGrfBulletCP = nWitchPicIsBullet; // This is a bullet picture ID - } else + } + else { /* #i173# diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx index f1fcdef..2336a6d 100644 --- a/sw/source/ui/wrtsh/wrtsh1.cxx +++ b/sw/source/ui/wrtsh/wrtsh1.cxx @@ -269,8 +269,6 @@ void SwWrtShell::Insert( const String &rPath, const String &rFilter, // eingefuegte Grafik in eigenen Absatz, falls am Ende // eines nichtleeren Absatzes //For i120928,avoid to split node - //if ( IsEndPara() && !IsSttPara() ) - // SwFEShell::SplitNode(); EnterSelFrmMode();
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits