diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-12-08 18:09:45 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-12-10 09:28:16 +0000 |
commit | d0b590fe19b45e2248adff22c6fe61a4049a7db8 (patch) | |
tree | 36ff9d9f0a7799595062d70c262395abea2400c5 /sw | |
parent | 993dae8a904b07b6db2b8854feae353f42836c5a (diff) |
callcatcher: remove unused rtf filter and associated methods
update and remove newly unused code, mostly original rtf filter
Change-Id: I2dd302851ee6fad62d79fbc81cb8a61a861396db
Diffstat (limited to 'sw')
-rw-r--r-- | sw/Library_msword.mk | 3 | ||||
-rw-r--r-- | sw/inc/crsrsh.hxx | 4 | ||||
-rw-r--r-- | sw/inc/numrule.hxx | 1 | ||||
-rw-r--r-- | sw/inc/swtable.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/crsr/crsrsh.cxx | 9 | ||||
-rw-r--r-- | sw/source/core/crsr/trvltbl.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/doc/number.cxx | 7 | ||||
-rw-r--r-- | sw/source/core/doc/tblrwcl.cxx | 93 | ||||
-rw-r--r-- | sw/source/core/table/swtable.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/basflt/fltini.cxx | 146 | ||||
-rw-r--r-- | sw/source/filter/inc/fltini.hxx | 6 | ||||
-rw-r--r-- | sw/source/filter/inc/wwstyles.hxx | 25 | ||||
-rw-r--r-- | sw/source/filter/rtf/rtffld.cxx | 264 | ||||
-rw-r--r-- | sw/source/filter/rtf/rtffly.cxx | 142 | ||||
-rw-r--r-- | sw/source/filter/rtf/rtfnum.cxx | 68 | ||||
-rw-r--r-- | sw/source/filter/rtf/swparrtf.cxx | 262 | ||||
-rw-r--r-- | sw/source/filter/rtf/swparrtf.hxx | 225 | ||||
-rw-r--r-- | sw/source/filter/ww8/styles.cxx | 14 | ||||
-rw-r--r-- | sw/source/filter/ww8/writerhelper.cxx | 56 | ||||
-rw-r--r-- | sw/source/ui/inc/bookmark.hxx | 1 | ||||
-rw-r--r-- | sw/source/ui/misc/bookmark.cxx | 9 | ||||
-rw-r--r-- | sw/source/ui/vba/vbafield.cxx | 39 |
22 files changed, 62 insertions, 1330 deletions
diff --git a/sw/Library_msword.mk b/sw/Library_msword.mk index c808dcfc80bf..cae89b5cb9f2 100644 --- a/sw/Library_msword.mk +++ b/sw/Library_msword.mk @@ -67,9 +67,6 @@ $(eval $(call gb_Library_use_externals,msword,\ )) $(eval $(call gb_Library_add_exception_objects,msword,\ - sw/source/filter/rtf/rtffld \ - sw/source/filter/rtf/rtffly \ - sw/source/filter/rtf/rtfnum \ sw/source/filter/rtf/swparrtf \ sw/source/filter/ww8/docxattributeoutput \ sw/source/filter/ww8/docxexport \ diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index 6d479273e214..ababf914494f 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -483,9 +483,6 @@ public: void SetReadOnlyAvailable( sal_Bool bFlag ); sal_Bool IsOverReadOnlyPos( const Point& rPt ) const; - /// Is the rPt point in the header or footer area? - sal_Bool IsOverHeaderFooterPos( const Point& rPt ) const; - // Methods for aFlyMacroLnk. void SetFlyMacroLnk( const Link& rLnk ) { aFlyMacroLnk = rLnk; } const Link& GetFlyMacroLnk() const { return aFlyMacroLnk; } @@ -585,7 +582,6 @@ public: inline const SwPaM* GetTblCrs() const; inline SwPaM* GetTblCrs(); - bool IsTblComplex() const; bool IsTblComplexForChart(); // get current table selection as text String GetBoxNms() const; diff --git a/sw/inc/numrule.hxx b/sw/inc/numrule.hxx index 1fe43ba6eece..3b468ef61d88 100644 --- a/sw/inc/numrule.hxx +++ b/sw/inc/numrule.hxx @@ -72,7 +72,6 @@ public: SwCharFmt* GetCharFmt() const { return (SwCharFmt*)GetRegisteredIn(); } void SetCharFmt( SwCharFmt* ); - void ForgetCharFmt(); virtual void SetCharFmtName(const String& rSet); virtual const String& GetCharFmtName()const; diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx index 741e096382e9..81f2696ea6dd 100644 --- a/sw/inc/swtable.hxx +++ b/sw/inc/swtable.hxx @@ -242,7 +242,6 @@ public: sal_uInt16 nCnt = 1, bool bBehind = true ); bool InsertRow( SwDoc*, const SwSelBoxes& rBoxes, sal_uInt16 nCnt = 1, bool bBehind = true ); - bool AppendRow( SwDoc* pDoc, sal_uInt16 nCnt = 1 ); void PrepareDelBoxes( const SwSelBoxes& rBoxes ); bool DeleteSel( SwDoc*, const SwSelBoxes& rBoxes, const SwSelBoxes* pMerged, SwUndo* pUndo, const bool bDelMakeFrms, const bool bCorrBorder ); @@ -478,7 +477,6 @@ public: sal_uInt16 nMaxStep = USHRT_MAX ) const { return const_cast<SwTableBox*>(this)->FindEndOfRowSpan( rTable, nMaxStep ); } void RegisterToFormat( SwFmt& rFmt ) ; - void ForgetFrmFmt(); }; class SwCellFrm; diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 3486a74209cb..a87677fc806c 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -2289,15 +2289,6 @@ sal_Bool SwCrsrShell::IsOverReadOnlyPos( const Point& rPt ) const return aPam.HasReadonlySel( GetViewOptions()->IsFormView() ); } -sal_Bool SwCrsrShell::IsOverHeaderFooterPos( const Point& rPt ) const -{ - Point aPt( rPt ); - SwPaM aPam( *pCurCrsr->GetPoint() ); - GetLayout()->GetCrsrOfst( aPam.GetPoint(), aPt ); - - return GetDoc()->IsInHeaderFooter( aPam.GetPoint()->nNode ); -} - /** Get the number of elements in the ring of cursors @param bAll If <false> get only spanned ones (= with selections) (Basic). diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx index 816a48bcd3b8..5c424f544f77 100644 --- a/sw/source/core/crsr/trvltbl.cxx +++ b/sw/source/core/crsr/trvltbl.cxx @@ -696,16 +696,6 @@ sal_Bool SwCrsrShell::MoveTable( SwWhichTable fnWhichTbl, SwPosTable fnPosTbl ) return bRet; } - -bool SwCrsrShell::IsTblComplex() const -{ - SwFrm *pFrm = GetCurrFrm( sal_False ); - if ( pFrm && pFrm->IsInTab() ) - return pFrm->FindTabFrm()->GetTable()->IsTblComplex(); - return false; -} - - bool SwCrsrShell::IsTblComplexForChart() { bool bRet = false; diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index 91b822b3de15..36426c778dc8 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -316,13 +316,6 @@ const String& SwNumFmt::GetCharFmtName() const return aEmptyStr; } -void SwNumFmt::ForgetCharFmt() -{ - if ( GetRegisteredIn() ) - GetRegisteredInNonConst()->Remove( this ); -} - - void SwNumFmt::SetGraphicBrush( const SvxBrushItem* pBrushItem, const Size* pSize, const sal_Int16* pOrient) { diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index 65af1e53018b..9818bde06925 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -665,99 +665,6 @@ bool SwTable::_InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, return true; } -void _FndBoxAppendRowLine( SwTableLine* pLine, _FndPara* pFndPara ); - -static void _FndBoxAppendRowBox( SwTableBox* pBox, _FndPara* pFndPara ) -{ - _FndBox* pFndBox = new _FndBox( pBox, pFndPara->pFndLine ); - if( pBox->GetTabLines().size() ) - { - _FndPara aPara( *pFndPara, pFndBox ); - BOOST_FOREACH( SwTableLine* pLine, pFndBox->GetBox()->GetTabLines() ) - _FndBoxAppendRowLine( pLine, &aPara ); - if( pFndBox->GetLines().empty() ) - delete pFndBox; - } - else - pFndPara->pFndLine->GetBoxes().push_back( pFndBox ); -} - -void _FndBoxAppendRowLine( SwTableLine* pLine, _FndPara* pFndPara ) -{ - _FndLine* pFndLine = new _FndLine( pLine, pFndPara->pFndBox ); - _FndPara aPara( *pFndPara, pFndLine ); - for( SwTableBoxes::iterator it = pFndLine->GetLine()->GetTabBoxes().begin(); - it != pFndLine->GetLine()->GetTabBoxes().end(); ++it) - _FndBoxAppendRowBox(*it, &aPara ); - if( pFndLine->GetBoxes().size() ) - { - pFndPara->pFndBox->GetLines().push_back( pFndLine ); - } - else - delete pFndLine; -} - -bool SwTable::AppendRow( SwDoc* pDoc, sal_uInt16 nCnt ) -{ - SwTableNode *const pTblNd = const_cast<SwTableNode*>( - m_TabSortContentBoxes[0]->GetSttNd()->FindTableNode()); - if( !pTblNd ) - return false; - - // Find all Boxes/Lines - _FndBox aFndBox( 0, 0 ); - { - SwTableLine* pLLine = GetTabLines().back(); - - const SwSelBoxes* pBxs = 0; // Dummy!!! - _FndPara aPara( *pBxs, &aFndBox ); - - _FndBoxAppendRowLine(pLLine, &aPara); - } - if( aFndBox.GetLines().empty() ) - return false; - - SetHTMLTableLayout( 0 ); // Delete HTML Layout - - // Find Lines for the Layout update - bool bLayout = 0 != SwIterator<SwTabFrm,SwFmt>::FirstElement( *GetFrmFmt() ); - if( bLayout ) - { - aFndBox.SetTableLines( *this ); - // TL_CHART2: nothing to be done since chart2 currently does not want to - // get notified about new rows/cols. - } - - _CpyTabFrms aTabFrmArr; - _CpyPara aCpyPara( pTblNd, 0, aTabFrmArr ); - aCpyPara.nInsPos = GetTabLines().size(); - aCpyPara.nDelBorderFlag = 1; - - for( sal_uInt16 nCpyCnt = 0; nCpyCnt < nCnt; ++nCpyCnt ) - { - aCpyPara.nDelBorderFlag = 1; - BOOST_FOREACH( _FndLine& rFndLine, aFndBox.GetLines() ) - lcl_CopyRow( rFndLine, &aCpyPara ); - } - - // Clean up this Line's structure once again, generally all of them - if( !pDoc->IsInReading() ) - GCLines(); - - // Update Layout - if ( bLayout ) - { - aFndBox.MakeNewFrms( *this, nCnt, sal_True ); - } - // TL_CHART2: need to inform chart of probably changed cell names - pDoc->UpdateCharts( GetFrmFmt()->GetName() ); - - CHECKBOXWIDTH; - CHECKTABLELAYOUT; - - return true; -} - static void lcl_LastBoxSetWidth( SwTableBoxes &rBoxes, const long nOffset, bool bFirst, SwShareBoxFmts& rShareFmts ); diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index c37ff85635c3..466ed909ae24 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -2796,12 +2796,6 @@ void SwTableBox::RegisterToFormat( SwFmt& rFmt ) rFmt.Add( this ); } -void SwTableBox::ForgetFrmFmt() -{ - if ( GetRegisteredIn() ) - GetRegisteredInNonConst()->Remove(this); -} - // free's any remaining child objects SwTableLines::~SwTableLines() { diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx index 6df6cd73e08b..8664fa4239bb 100644 --- a/sw/source/filter/basflt/fltini.cxx +++ b/sw/source/filter/basflt/fltini.cxx @@ -330,152 +330,6 @@ SwRelNumRuleSpaces::~SwRelNumRuleSpaces() } } -void SwRelNumRuleSpaces::SetNumRelSpaces( SwDoc& rDoc ) -{ - const SwNumRuleTbl* pRuleTbl = NULL; - - if( !bNewDoc ) - { - // jetzt alle schon vorhanden NumRules aus dem Array entfernen, - // damit nur die neuen angepasst werden - SwNumRuleTbl aNumRuleTbl; - aNumRuleTbl.insert( aNumRuleTbl.begin(), pNumRuleTbl->begin(), pNumRuleTbl->end() ); - pNumRuleTbl->clear(); - const SwNumRuleTbl& rRuleTbl = rDoc.GetNumRuleTbl(); - SwNumRule* pRule; - - for( sal_uInt16 n = 0; n < rRuleTbl.size(); ++n ) - if( USHRT_MAX == aNumRuleTbl.GetPos( pRule = rRuleTbl[ n ] )) - // war noch nicht vorhanden, also neu - pNumRuleTbl->push_back( pRule ); - - aNumRuleTbl.clear(); - - pRuleTbl = pNumRuleTbl; - } - else - { - pRuleTbl = &rDoc.GetNumRuleTbl(); - } - - if( pRuleTbl ) - { - for( sal_uInt16 n = pRuleTbl->size(); n; ) - { - SwNumRule* pRule = (*pRuleTbl)[ --n ]; - // Rule noch gueltig und am Doc vorhanden? - if( USHRT_MAX != rDoc.GetNumRuleTbl().GetPos( pRule )) - { - SwNumRule::tTxtNodeList aTxtNodeList; - pRule->GetTxtNodeList( aTxtNodeList ); - for ( SwNumRule::tTxtNodeList::iterator aIter = aTxtNodeList.begin(); - aIter != aTxtNodeList.end(); ++aIter ) - { - SwTxtNode* pNd = *aIter; - SetNumLSpace( *pNd, *pRule ); - } - } - } - } - - if( pNumRuleTbl ) - { - pNumRuleTbl->clear(); - delete pNumRuleTbl, pNumRuleTbl = 0; - } - - if( bNewDoc ) - { - SetOultineRelSpaces( SwNodeIndex( rDoc.GetNodes() ), - SwNodeIndex( rDoc.GetNodes().GetEndOfContent())); - } -} - -void SwRelNumRuleSpaces::SetOultineRelSpaces( const SwNodeIndex& rStt, - const SwNodeIndex& rEnd ) -{ - SwDoc* pDoc = rStt.GetNode().GetDoc(); - const SwOutlineNodes& rOutlNds = pDoc->GetNodes().GetOutLineNds(); - if( !rOutlNds.empty() ) - { - sal_uInt16 nPos; - rOutlNds.Seek_Entry( &rStt.GetNode(), &nPos ); - for( ; nPos < rOutlNds.size() && - rOutlNds[ nPos ]->GetIndex() < rEnd.GetIndex(); ++nPos ) - { - SwTxtNode* pNd = rOutlNds[ nPos ]->GetTxtNode(); - if( pNd->IsOutline() && !pNd->GetNumRule() ) - SetNumLSpace( *pNd, *pDoc->GetOutlineNumRule() ); - } - } -} - -void SwRelNumRuleSpaces::SetNumLSpace( SwTxtNode& rNd, const SwNumRule& rRule ) -{ - sal_Bool bOutlineRule = OUTLINE_RULE == rRule.GetRuleType(); - // correction of refactoring done by cws swnumtree: - // - assure a correct level for retrieving numbering format. - sal_uInt8 nLvl = 0; - if ( rNd.GetActualListLevel() >= 0 && rNd.GetActualListLevel() < MAXLEVEL ) - { - nLvl = static_cast< sal_uInt8 >(rNd.GetActualListLevel()); - } - - const SwNumFmt& rFmt = rRule.Get( nLvl ); - const SvxLRSpaceItem& rLR = rNd.GetSwAttrSet().GetLRSpace(); - - SvxLRSpaceItem aLR( rLR ); - aLR.SetTxtFirstLineOfst( 0 ); - - // sagt der Node, das die Numerierung den Wert vorgibt? - if( !bOutlineRule && rNd.IsSetNumLSpace() ) - aLR.SetTxtLeft( 0 ); - else - { - long nLeft = rFmt.GetAbsLSpace(), nParaLeft = rLR.GetTxtLeft(); - if( 0 < rLR.GetTxtFirstLineOfst() ) - nParaLeft += rLR.GetTxtFirstLineOfst(); - else if( nParaLeft >= nLeft ) - // set correct paragraph indent - nParaLeft -= nLeft; - else - nParaLeft = rLR.GetTxtLeft()+rLR.GetTxtFirstLineOfst(); - aLR.SetTxtLeft( nParaLeft ); - } - - if( aLR.GetTxtLeft() != rLR.GetTxtLeft() ) - { - //bevor rLR geloescht wird! - long nOffset = rLR.GetTxtLeft() - aLR.GetTxtLeft(); - rNd.SetAttr( aLR ); - - // Tabs anpassen !! - const SfxPoolItem* pItem; - if( SFX_ITEM_SET == rNd.GetSwAttrSet().GetItemState( - RES_PARATR_TABSTOP, sal_True, &pItem )) - { - SvxTabStopItem aTStop( *(SvxTabStopItem*)pItem ); - for( sal_uInt16 n = 0; n < aTStop.Count(); ++n ) - { - SvxTabStop& rTab = (SvxTabStop&)aTStop[ n ]; - if( SVX_TAB_ADJUST_DEFAULT != rTab.GetAdjustment() ) - { - if( !rTab.GetTabPos() ) - { - aTStop.Remove( n ); - --n; - } - else - rTab.GetTabPos() += nOffset; - } - } - rNd.SetAttr( aTStop ); - } - } -} - - - void CalculateFlySize(SfxItemSet& rFlySet, const SwNodeIndex& rAnchor, SwTwips nPageWidth) { diff --git a/sw/source/filter/inc/fltini.hxx b/sw/source/filter/inc/fltini.hxx index b3758cdcb5c5..55c9f88e1944 100644 --- a/sw/source/filter/inc/fltini.hxx +++ b/sw/source/filter/inc/fltini.hxx @@ -73,15 +73,9 @@ class SW_DLLPUBLIC SwRelNumRuleSpaces SwNumRuleTbl* pNumRuleTbl; // Liste aller benannten NumRules sal_Bool bNewDoc; - void SetNumLSpace( SwTxtNode& rNd, const SwNumRule& rRule ); - public: SwRelNumRuleSpaces( SwDoc& rDoc, sal_Bool bNewDoc ); ~SwRelNumRuleSpaces(); - - void SetNumRelSpaces( SwDoc& rDoc ); - void SetOultineRelSpaces( const SwNodeIndex& rStt, - const SwNodeIndex& rEnd ); }; #define SW_SV_BRUSH_25 0 diff --git a/sw/source/filter/inc/wwstyles.hxx b/sw/source/filter/inc/wwstyles.hxx index 2cbc6189cc68..1e2539a45d48 100644 --- a/sw/source/filter/inc/wwstyles.hxx +++ b/sw/source/filter/inc/wwstyles.hxx @@ -135,31 +135,6 @@ namespace ww stiNil = 0x0fff // max for 12 bits }; - /** Find the WinWord sti index of an english style name. - - When importing a RTF document we would like to treat styles as similiar - to how word does as possible, to this end word will treat some styles - with special names as inbuilt styles, and some as user defined styles. - - See OpenOffice.org issue 21881 - (http://www.openoffice.org/issues/show_bug.cgi?id=21881) - and OpenOffice.org issue 17503 - (http://www.openoffice.org/issues/show_bug.cgi?id=17503) - - @param - rSting the Style name to test to see what winword sti word would give - such a name if it has no other information to work with (e.g. importing - a RTF document) - - @return the sti that word would give it. stiUser if word would treat - it as a user defined style. - - @author - <a href="mailto:cmc@openoffice.org">Caolán McNamara</a> - <a href="mailto:tono@openoffice.org">Takashi Ono</a> - */ - sti GetCanonicalStiFromEnglishName(const String &rString) throw(); - /** Find the WinWord sti index of an old <= Word2 stc (style code) When importing a Word 2 document we would like to treat styles as diff --git a/sw/source/filter/rtf/rtffld.cxx b/sw/source/filter/rtf/rtffld.cxx deleted file mode 100644 index 6afe16666f08..000000000000 --- a/sw/source/filter/rtf/rtffld.cxx +++ /dev/null @@ -1,264 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - -#include <ctype.h> -#include <hintids.hxx> - -#include <sal/macros.h> -#include <com/sun/star/i18n/ScriptType.hpp> -#include <comphelper/string.hxx> -#include <vcl/graph.hxx> -#include <svl/urihelper.hxx> -#include <svtools/rtftoken.h> -#include <svl/zforlist.hxx> -#include <editeng/fontitem.hxx> -#include <editeng/fhgtitem.hxx> -#include <editeng/langitem.hxx> -#include <editeng/brkitem.hxx> -#include <fmtfld.hxx> -#include <fmtinfmt.hxx> -#include <swtypes.hxx> -#include <doc.hxx> -#include <pam.hxx> -#include <ndtxt.hxx> -#include <shellio.hxx> -#include <fldbas.hxx> -#include <swparrtf.hxx> -#include <txatbase.hxx> -#include <dbfld.hxx> -#include <usrfld.hxx> -#include <docufld.hxx> -#include <flddat.hxx> -#include <charfmt.hxx> -#include <fmtruby.hxx> -#include <breakit.hxx> -#include <reffld.hxx> -#include <SwStyleNameMapper.hxx> -#include <editeng/charhiddenitem.hxx> - - -// bestimme, ob es sich um ein IMPORT/TOC - Feld handelt. -// return: 0 - weder noch, -// 1 - TOC -// 2 - IMPORT -// 3 - INDEX -enum RTF_FLD_TYPES { - RTFFLD_UNKNOWN = 0, - RTFFLD_TOC, - RTFFLD_IMPORT, - RTFFLD_INDEX, - RTFFLD_SYMBOL, - RTFFLD_PAGE, - RTFFLD_NUMPAGES, - RTFFLD_DATE, - RTFFLD_TIME, - RTFFLD_DATA, - RTFFLD_MERGEFLD, - RTFFLD_HYPERLINK, - RTFFLD_REF, - RTFFLD_PAGEREF, - RTFFLD_EQ, - RTFFLD_INCLUDETEXT -}; - -class RtfFieldSwitch -{ - String sParam; - xub_StrLen nCurPos; -public: - RtfFieldSwitch( const String& rParam ); - sal_Unicode GetSwitch( String& rParam ); - - sal_Bool IsAtEnd() const { return nCurPos >= sParam.Len(); } - xub_StrLen GetCurPos() const { return nCurPos; } - void Erase( xub_StrLen nEndPos ) { sParam.Erase( 0, nEndPos ); } - void Insert( const String& rIns ) { sParam.Insert( rIns, 0 ); } - const String& GetStr() const { return sParam; } -}; - -RtfFieldSwitch::RtfFieldSwitch( const String& rParam ) - : nCurPos( 0 ) -{ - sParam = comphelper::string::strip(rParam, ' '); -} - -sal_Unicode RtfFieldSwitch::GetSwitch( String& rParam ) -{ - // beginnt ein Schalter? - sal_Unicode c, cKey = 0; - if( '\\' == (c = sParam.GetChar( nCurPos )) ) - { - if( '\\' == ( c = sParam.GetChar( ++nCurPos )) ) - c = sParam.GetChar( ++nCurPos ); - - cKey = c; - - while( ++nCurPos < sParam.Len() && - ' ' == ( c = sParam.GetChar( nCurPos )) ) - ; - } - - // dann alles in Hochkommatas oder bis zum naechsten // als - // Param returnen - sal_uInt16 nOffset; - if( '"' != c && '\'' != c ) - c = '\\', nOffset = 0; - else - nOffset = 1; - - sParam.Erase( 0, nCurPos + nOffset ); - rParam = sParam.GetToken( 0, c ); - sParam = comphelper::string::stripStart(sParam.Erase(0, rParam.Len() + nOffset), ' '); - if( '\\' == c ) - rParam = comphelper::string::stripEnd(rParam, ' '); - nCurPos = 0; - - return cKey; -} - -struct RTF_EquationData -{ - String sFontName, sUp, sDown, sText; - sal_Int32 nJustificationCode, nFontSize, nUp, nDown, nStyleNo; - - inline RTF_EquationData() - : nJustificationCode(0), nFontSize(0), nUp(0), nDown(0), - nStyleNo( -1 ) - {} -}; - -xub_StrLen lcl_FindEndBracket( const String& rStr ) -{ - xub_StrLen nEnd = rStr.Len(), nRet = STRING_NOTFOUND, nPos = 0; - int nOpenCnt = 1; - sal_Unicode cCh; - for( ; nPos < nEnd; ++nPos ) - if( ')' == (cCh = rStr.GetChar( nPos )) && !--nOpenCnt ) - { - nRet = nPos; - break; - } - else if( '(' == cCh ) - ++nOpenCnt; - - return nRet; -} - -static void lcl_ScanEquationField( const String& rStr, RTF_EquationData& rData, - sal_Unicode nSttKey ) -{ - int nSubSupFlag(0); - RtfFieldSwitch aRFS( rStr ); - while( !aRFS.IsAtEnd() ) - { - String sParam; - sal_Unicode cKey = aRFS.GetSwitch( sParam ); - if( 1 == nSubSupFlag ) - ++nSubSupFlag; - else if( 1 < nSubSupFlag ) - nSubSupFlag = 0; - - sal_Bool bCheckBracket = sal_False; - switch( cKey ) - { - case 0: - switch( nSttKey ) - { - case 'u': rData.sUp += sParam; break; - case 'd': rData.sDown += sParam; break; - default: rData.sText += sParam; break; - } - break; - - case '*': - if( sParam.Len() ) - { - if( sParam.EqualsIgnoreCaseAscii( "jc", 0, 2 ) ) - rData.nJustificationCode = sParam.Copy( 2 ).ToInt32(); - else if( sParam.EqualsIgnoreCaseAscii( "hps", 0, 3 ) ) - rData.nFontSize= sParam.Copy( 3 ).ToInt32(); - else if( sParam.EqualsIgnoreCaseAscii( "Font:", 0, 5 ) ) - rData.sFontName = sParam.Copy( 5 ); - else if( sParam.EqualsIgnoreCaseAscii( "cs", 0, 2 ) ) - rData.nStyleNo = sParam.Copy( 2 ).ToInt32(); - } - break; - case 's' : - ++nSubSupFlag; - break; - - case 'u': - if( sParam.Len() && 'p' == sParam.GetChar( 0 ) && - 2 == nSubSupFlag ) - { - rData.nUp = sParam.Copy( 1 ).ToInt32(); - bCheckBracket = sal_True; - } - break; - - case 'd': - if( sParam.Len() && 'o' == sParam.GetChar( 0 ) && - 2 == nSubSupFlag ) - { - rData.nDown = sParam.Copy( 1 ).ToInt32(); - bCheckBracket = sal_True; - } - break; - - default: - bCheckBracket = sal_True; - cKey = 0; - break; - } - - if( bCheckBracket && sParam.Len() ) - { - xub_StrLen nEnd, nStt = sParam.Search( '(' ), - nLen = sParam.Len(); - if( STRING_NOTFOUND != nStt ) - { - sParam.Erase( 0, nStt + 1 ) += aRFS.GetStr(); - if( STRING_NOTFOUND != - (nEnd = ::lcl_FindEndBracket( sParam )) ) - { - // end in the added string? - if( (nLen - nStt - 1 ) < nEnd ) - aRFS.Erase( nEnd + 1 - (nLen - nStt - 1)); - else - { - // not all handled here, so set new into the RFS - aRFS.Insert( sParam.Copy( nEnd + 1, - nLen - nStt - nEnd - 2 )); - sal_Unicode cCh; - if( aRFS.GetStr().Len() && - ( ',' == (cCh = aRFS.GetStr().GetChar(0)) || - ';' == cCh )) - aRFS.Erase( 1 ); - } - - ::lcl_ScanEquationField( sParam.Copy( 0, nEnd ), - rData, cKey ); - } - } - } - } -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/rtf/rtffly.cxx b/sw/source/filter/rtf/rtffly.cxx deleted file mode 100644 index 5e19830514bc..000000000000 --- a/sw/source/filter/rtf/rtffly.cxx +++ /dev/null @@ -1,142 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include <hintids.hxx> -#include <tools/cachestr.hxx> -#include <svtools/rtftoken.h> -#include <svl/itemiter.hxx> -#include <editeng/prntitem.hxx> -#include <editeng/opaqitem.hxx> -#include <editeng/protitem.hxx> -#include <editeng/ulspitem.hxx> -#include <editeng/lrspitem.hxx> -#include <editeng/boxitem.hxx> -#include <editeng/frmdiritem.hxx> -#include <fmtfsize.hxx> -#include <fmtanchr.hxx> -#include <fmtpdsc.hxx> -#include <fmtsrnd.hxx> -#include <fmtclds.hxx> -#include <fmtcntnt.hxx> -#include <frmatr.hxx> -#include <doc.hxx> -#include <pam.hxx> -#include <ndtxt.hxx> -#include <shellio.hxx> -#include <swparrtf.hxx> -#include <grfatr.hxx> -#include <paratr.hxx> -#include <rtf.hxx> -#include <ndgrf.hxx> -#include <pagedesc.hxx> -#include <swtable.hxx> -#include <txtflcnt.hxx> -#include <fmtflcnt.hxx> -#include <fltini.hxx> -#include <unoframe.hxx> -#include <deque> -#include <map> -#include <utility> -// #i27767# -#include <fmtwrapinfluenceonobjpos.hxx> -#include <editeng/brshitem.hxx> -#include <fmtfollowtextflow.hxx> -#include "dcontact.hxx" - -using namespace ::com::sun::star; - -#define ANCHOR(p) ((SwFmtAnchor*)p) - -// steht in shellio.hxx -extern SwCntntNode* GoNextNds( SwNodeIndex * pIdx, sal_Bool bChk ); - -inline const SwFmtFrmSize GetFrmSize(const SfxItemSet& rSet, sal_Bool bInP=sal_True) -{ - return (const SwFmtFrmSize&)rSet.Get(RES_FRM_SIZE,bInP); -} - -SwFlySave::SwFlySave(const SwPaM& rPam, SfxItemSet& rSet) - : aFlySet(rSet), nSttNd(rPam.GetPoint()->nNode), nEndNd(nSttNd), nEndCnt(0), - nPageWidth(ATT_MIN_SIZE), nDropLines(0), nDropAnchor(0) -{ -} - -int SwFlySave::IsEqualFly( const SwPaM& rPos, SfxItemSet& rSet ) -{ - if( rSet.Count() != aFlySet.Count() || nDropAnchor ) - return sal_False; - - // nur TextNodes zusammenfassen - if( nSttNd == nEndNd && nEndNd.GetNode().IsNoTxtNode() ) - return sal_False; - - // teste auf gleiche / naechste Position - if( rPos.GetPoint()->nNode.GetIndex() == nEndNd.GetIndex() ) - { - if( 1 < (rPos.GetPoint()->nContent.GetIndex() - nEndCnt) ) - return sal_False; - } - else if( rPos.GetPoint()->nContent.GetIndex() ) - return sal_False; - else - { - SwNodeIndex aIdx( nEndNd ); - SwCntntNode *const pCNd = aIdx.GetNode().GetCntntNode(); - if( !GoNextNds( &aIdx, sal_True ) || - aIdx.GetIndex() != rPos.GetPoint()->nNode.GetIndex() || - ( pCNd && pCNd->Len() != nEndCnt )) - { - return sal_False; - } - } - - if( rSet.Count() ) - { - SfxItemIter aIter( rSet ); - const SfxPoolItem *pItem, *pCurr = aIter.GetCurItem(); - while( sal_True ) - { - if( SFX_ITEM_SET != aFlySet.GetItemState( pCurr->Which(), - sal_False, &pItem ) || - // Ankerattribute gesondert behandeln - ( RES_ANCHOR == pCurr->Which() - ? (ANCHOR(pCurr)->GetAnchorId() != ANCHOR(pItem)->GetAnchorId() || - ANCHOR(pCurr)->GetPageNum() != ANCHOR(pItem)->GetPageNum()) - : *pItem != *pCurr )) - return sal_False; - - if( aIter.IsAtEnd() ) - break; - pCurr = aIter.NextItem(); - } - } - return sal_True; -} - -void SwFlySave::SetFlySize( const SwTableNode& rTblNd ) -{ - // sollte der Fly kleiner als diese Tabelle sein, dann - // korrigiere diesen (nur bei abs. Angaben!) - SwTwips nWidth = rTblNd.GetTable().GetFrmFmt()->GetFrmSize().GetWidth(); - const SwFmtFrmSize& rSz = GetFrmSize( aFlySet ); - if( nWidth > rSz.GetWidth() ) - aFlySet.Put( SwFmtFrmSize( rSz.GetHeightSizeType(), nWidth, rSz.GetHeight() )); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/rtf/rtfnum.cxx b/sw/source/filter/rtf/rtfnum.cxx deleted file mode 100644 index 54f47b95ac86..000000000000 --- a/sw/source/filter/rtf/rtfnum.cxx +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include <hintids.hxx> -#include <tools/stream.hxx> -#include <svtools/rtftoken.h> -#include <svtools/rtfkeywd.hxx> -#include <svl/intitem.hxx> -#include <svtools/rtfout.hxx> -#include <editeng/lrspitem.hxx> -#include <editeng/fontitem.hxx> -#include <editeng/fhgtitem.hxx> -#include <editeng/wghtitem.hxx> -#include <editeng/postitem.hxx> -#include <editeng/cmapitem.hxx> -#include <editeng/crsditem.hxx> -#include <editeng/colritem.hxx> -#include <editeng/udlnitem.hxx> -#include <editeng/wrlmitem.hxx> -#include <editeng/numitem.hxx> -#include <shellio.hxx> -#include <fltini.hxx> -#include <swtypes.hxx> -#include <swparrtf.hxx> -#include <ndtxt.hxx> -#include <doc.hxx> -#include <docary.hxx> -#include <pam.hxx> -#include <charfmt.hxx> -#include <charatr.hxx> -#include <paratr.hxx> -#include <cmdid.h> -#include <numrule.hxx> - -#define RTF_NUMRULE_NAME "RTF_Num" - -SfxItemSet& GetNumChrFmt( SwDoc& rDoc, SwNumRule& rRule, sal_uInt8 nNumLvl ) -{ - SwCharFmt* pChrFmt = rRule.Get( nNumLvl ).GetCharFmt(); - if( !pChrFmt ) - { - String sNm( rRule.GetName() ); - ( sNm += ' ' ) += String::CreateFromInt32( nNumLvl + 1 ); - pChrFmt = rDoc.MakeCharFmt( sNm, rDoc.GetDfltCharFmt() ); - if( !rRule.GetNumFmt( nNumLvl )) - rRule.Set( nNumLvl, rRule.Get( nNumLvl ) ); - ((SwNumFmt*)rRule.GetNumFmt( nNumLvl ))->SetCharFmt( pChrFmt ); - } - return (SfxItemSet&)pChrFmt->GetAttrSet(); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx index 02c7bdf8ff13..b64fba0dc7e4 100644 --- a/sw/source/filter/rtf/swparrtf.cxx +++ b/sw/source/filter/rtf/swparrtf.cxx @@ -17,92 +17,19 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <hintids.hxx> - -#include <stack> - -#include <tools/errinf.hxx> #include <tools/stream.hxx> -#include <tools/helpers.hxx> -#include <svl/itemiter.hxx> -#include <svtools/rtftoken.h> -#include <svl/intitem.hxx> -#include <editeng/fhgtitem.hxx> -#include <editeng/ulspitem.hxx> -#include <editeng/tstpitem.hxx> -#include <editeng/lspcitem.hxx> -#include <editeng/lrspitem.hxx> -#include <editeng/escpitem.hxx> -#include <editeng/fontitem.hxx> -#include <editeng/frmdiritem.hxx> -#include <editeng/hyznitem.hxx> -#include <fmtpdsc.hxx> -#include <fmtfld.hxx> -#include <fmthdft.hxx> -#include <fmtcntnt.hxx> -#include <txtftn.hxx> -#include <fmtclds.hxx> -#include <fmtftn.hxx> -#include <fmtfsize.hxx> -#include <fmtflcnt.hxx> -#include <fmtanchr.hxx> -#include <frmatr.hxx> -#include <docstat.hxx> -#include <swtable.hxx> +#include <poolfmt.hxx> #include <shellio.hxx> -#include <swtypes.hxx> #include <ndtxt.hxx> #include <doc.hxx> -#include <docary.hxx> +#include <docsh.hxx> #include <pam.hxx> -#include <mdiexp.hxx> // ...Percent() -#include <swparrtf.hxx> -#include <charfmt.hxx> -#include <pagedesc.hxx> -#include <ftninfo.hxx> -#include <docufld.hxx> -#include <flddat.hxx> -#include <fltini.hxx> -#include <fchrfmt.hxx> -#include <paratr.hxx> -#include <section.hxx> -#include <fmtclbl.hxx> -#include <viewsh.hxx> -#include <shellres.hxx> -#include <hfspacingitem.hxx> -#include <tox.hxx> #include <swerror.h> -#include <cmdid.h> -#include <statstr.hrc> // ResId fuer Statusleiste -#include <SwStyleNameMapper.hxx> -#include <tblsel.hxx> // SwSelBoxes -#include <docsh.hxx> -#include <fmtlsplt.hxx> // SwLayoutSplit #include <unotextrange.hxx> -#include <editeng/keepitem.hxx> -#include <svx/svdopath.hxx> -#include <svx/svdorect.hxx> - -#include <fmtsrnd.hxx> -#include <fmtfollowtextflow.hxx> -#include <svx/svdmodel.hxx> -#include <svx/svdpage.hxx> -#include <editeng/opaqitem.hxx> -#include "svx/svdograf.hxx" -#include <svx/xflclit.hxx> -#include <svx/xlnwtit.hxx> -#include <svx/svdoutl.hxx> #include <unotools/streamwrap.hxx> #include <comphelper/processfactory.hxx> -#include <comphelper/string.hxx> -#include <editeng/outlobj.hxx> -#include <editeng/paperinf.hxx> - -#include <basegfx/polygon/b2dpolygon.hxx> -#include <basegfx/polygon/b2dpolypolygon.hxx> -#include <basegfx/range/b2drange.hxx> #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> #include <com/sun/star/document/XFilter.hpp> @@ -110,18 +37,8 @@ #include <com/sun/star/document/XExporter.hpp> #include <com/sun/star/text/XTextRange.hpp> - using namespace ::com::sun::star; - -// einige Hilfs-Funktionen -// char -inline const SvxFontHeightItem& GetSize(const SfxItemSet& rSet,sal_Bool bInP=sal_True) - { return (const SvxFontHeightItem&)rSet.Get( RES_CHRATR_FONTSIZE,bInP); } -inline const SvxLRSpaceItem& GetLRSpace(const SfxItemSet& rSet,sal_Bool bInP=sal_True) - { return (const SvxLRSpaceItem&)rSet.Get( RES_LR_SPACE,bInP); } - - /// Glue class to call RtfImport as an internal filter, needed by copy&paste support. class SwRTFReader : public Reader { @@ -156,7 +73,7 @@ sal_uLong SwRTFReader::Read( SwDoc &rDoc, const String& /*rBaseURL*/, SwPaM& rPa SwDocShell *pDocShell(rDoc.GetDocShell()); uno::Reference<lang::XMultiServiceFactory> xMultiServiceFactory(comphelper::getProcessServiceFactory()); uno::Reference<uno::XInterface> xInterface(xMultiServiceFactory->createInstance( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Writer.RtfFilter"))), uno::UNO_QUERY_THROW); + "com.sun.star.comp.Writer.RtfFilter"), uno::UNO_QUERY_THROW); uno::Reference<document::XImporter> xImporter(xInterface, uno::UNO_QUERY_THROW); uno::Reference<lang::XComponent> xDstDoc(pDocShell->GetModel(), uno::UNO_QUERY_THROW); @@ -167,7 +84,7 @@ sal_uLong SwRTFReader::Read( SwDoc &rDoc, const String& /*rBaseURL*/, SwPaM& rPa uno::Reference<document::XFilter> xFilter(xInterface, uno::UNO_QUERY_THROW); uno::Sequence<beans::PropertyValue> aDescriptor(3); - aDescriptor[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("InputStream")); + aDescriptor[0].Name = "InputStream"; uno::Reference<io::XStream> xStream(new utl::OStreamWrapper(*pStrm)); aDescriptor[0].Value <<= xStream; aDescriptor[1].Name = "IsNewDoc"; @@ -225,175 +142,4 @@ extern "C" SAL_DLLPUBLIC_EXPORT Reader* SAL_CALL ImportRTF() return new SwRTFReader(); } -bool HasHeader(const SwFrmFmt &rFmt) -{ - const SfxPoolItem *pHd; - if (SFX_ITEM_SET == rFmt.GetItemState(RES_HEADER, false, &pHd)) - return ((const SwFmtHeader *)(pHd))->IsActive(); - return false; -} - -bool HasFooter(const SwFrmFmt &rFmt) -{ - const SfxPoolItem *pFt; - if (SFX_ITEM_SET == rFmt.GetItemState(RES_FOOTER, false, &pFt)) - return ((const SwFmtFooter *)(pFt))->IsActive(); - return false; -} - -namespace sw{ - namespace util{ - -InsertedTableClient::InsertedTableClient(SwTableNode & rNode) -{ - rNode.Add(this); -} - -SwTableNode * InsertedTableClient::GetTableNode() -{ - return dynamic_cast<SwTableNode *> (GetRegisteredInNonConst()); -} - -InsertedTablesManager::InsertedTablesManager(const SwDoc &rDoc) - : mbHasRoot(rDoc.GetCurrentLayout()) //swmod 080218 -{ -} - -void InsertedTablesManager::DelAndMakeTblFrms() -{ - if (!mbHasRoot) - return; - TblMapIter aEnd = maTables.end(); - for (TblMapIter aIter = maTables.begin(); aIter != aEnd; ++aIter) - { - // exitiert schon ein Layout, dann muss an dieser Tabelle die BoxFrames - // neu erzeugt - SwTableNode *pTable = aIter->first->GetTableNode(); - OSL_ENSURE(pTable, "Why no expected table"); - if (pTable) - { - SwFrmFmt * pFrmFmt = pTable->GetTable().GetFrmFmt(); - - if (pFrmFmt != NULL) - { - SwNodeIndex *pIndex = aIter->second; - pTable->DelFrms(); - pTable->MakeFrms(pIndex); - } - } - } -} - -void InsertedTablesManager::InsertTable(SwTableNode &rTableNode, SwPaM &rPaM) -{ - if (!mbHasRoot) - return; - //Associate this tablenode with this after position, replace an //old - //node association if necessary - - InsertedTableClient * pClient = new InsertedTableClient(rTableNode); - - maTables.insert(TblMap::value_type(pClient, &(rPaM.GetPoint()->nNode))); -} -} -} - -::basegfx::B2DPoint rotate(const ::basegfx::B2DPoint& rStart, const ::basegfx::B2DPoint& rEnd) -{ - const ::basegfx::B2DVector aVector(rStart - rEnd); - return ::basegfx::B2DPoint(aVector.getY() + rEnd.getX(), -aVector.getX() + rEnd.getY()); -} - - -DocPageInformation::DocPageInformation() - : maBox( RES_BOX ), - mnPaperw(12240), mnPaperh(15840), mnMargl(1800), mnMargr(1800), - mnMargt(1440), mnMargb(1440), mnGutter(0), mnPgnStart(1), mbFacingp(false), - mbLandscape(false), mbRTLdoc(false) -{ -} - -SectPageInformation::SectPageInformation(const DocPageInformation &rDoc) - : maBox(rDoc.maBox), mpTitlePageHdFt(0), mpPageHdFt(0), - mnPgwsxn(rDoc.mnPaperw), mnPghsxn(rDoc.mnPaperh), mnMarglsxn(rDoc.mnMargl), - mnMargrsxn(rDoc.mnMargr), mnMargtsxn(rDoc.mnMargt), - mnMargbsxn(rDoc.mnMargb), mnGutterxsn(rDoc.mnGutter), mnHeadery(720), - mnFootery(720), mnPgnStarts(rDoc.mnPgnStart), mnCols(1), mnColsx(720), - mnStextflow(rDoc.mbRTLdoc ? 3 : 0), mnBkc(2), mbLndscpsxn(rDoc.mbLandscape), - mbTitlepg(false), mbFacpgsxn(rDoc.mbFacingp), mbRTLsection(rDoc.mbRTLdoc), - mbPgnrestart(false), mbTitlePageHdFtUsed(false), mbPageHdFtUsed(false) -{ -}; - -SectPageInformation::SectPageInformation(const SectPageInformation &rSect) - : maColumns(rSect.maColumns), maBox(rSect.maBox), - maNumType(rSect.maNumType), mpTitlePageHdFt(rSect.mpTitlePageHdFt), - mpPageHdFt(rSect.mpPageHdFt), mnPgwsxn(rSect.mnPgwsxn), - mnPghsxn(rSect.mnPghsxn), mnMarglsxn(rSect.mnMarglsxn), - mnMargrsxn(rSect.mnMargrsxn), mnMargtsxn(rSect.mnMargtsxn), - mnMargbsxn(rSect.mnMargbsxn), mnGutterxsn(rSect.mnGutterxsn), - mnHeadery(rSect.mnHeadery), mnFootery(rSect.mnFootery), - mnPgnStarts(rSect.mnPgnStarts), mnCols(rSect.mnCols), - mnColsx(rSect.mnColsx), mnStextflow(rSect.mnStextflow), mnBkc(rSect.mnBkc), - mbLndscpsxn(rSect.mbLndscpsxn), mbTitlepg(rSect.mbTitlepg), - mbFacpgsxn(rSect.mbFacpgsxn), mbRTLsection(rSect.mbRTLsection), - mbPgnrestart(rSect.mbPgnrestart), - mbTitlePageHdFtUsed(rSect.mbTitlePageHdFtUsed), - mbPageHdFtUsed(rSect.mbPageHdFtUsed) -{ -}; - -rtfSection::rtfSection(const SwPosition &rPos, - const SectPageInformation &rPageInfo) - : maStart(rPos.nNode), maPageInfo(rPageInfo), mpSection(0), mpTitlePage(0), - mpPage(0) -{ -} - -BookmarkPosition::BookmarkPosition(const SwPaM &rPaM) - : maMkNode(rPaM.GetMark()->nNode), - mnMkCntnt(rPaM.GetMark()->nContent.GetIndex()) -{ -} - -BookmarkPosition::BookmarkPosition(const BookmarkPosition &rEntry) - : maMkNode(rEntry.maMkNode), mnMkCntnt(rEntry.mnMkCntnt) -{ -} - -bool BookmarkPosition::operator==(const BookmarkPosition rhs) -{ - return(maMkNode.GetIndex() == rhs.maMkNode.GetIndex() && mnMkCntnt == rhs.mnMkCntnt); -} - -sal_uLong SwNodeIdx::GetIdx() const -{ - return aIdx.GetIndex(); -} - -SvxNodeIdx* SwNodeIdx::Clone() const -{ - return new SwNodeIdx( aIdx ); -} - -SvxPosition* SwxPosition::Clone() const -{ - return new SwxPosition( pPam ); -} - -SvxNodeIdx* SwxPosition::MakeNodeIdx() const -{ - return new SwNodeIdx( pPam->GetPoint()->nNode ); -} - -sal_uLong SwxPosition::GetNodeIdx() const -{ - return pPam->GetPoint()->nNode.GetIndex(); -} - -xub_StrLen SwxPosition::GetCntIdx() const -{ - return pPam->GetPoint()->nContent.GetIndex(); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/rtf/swparrtf.hxx b/sw/source/filter/rtf/swparrtf.hxx deleted file mode 100644 index 86a0815f980c..000000000000 --- a/sw/source/filter/rtf/swparrtf.hxx +++ /dev/null @@ -1,225 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef _SWPARRTF_HXX -#define _SWPARRTF_HXX - -#include <deque> -#include <vector> -#include <map> - -#include <editeng/svxrtf.hxx> -#include <editeng/numitem.hxx> -#include <editeng/boxitem.hxx> -#include <redline.hxx> - -#include <fltshell.hxx> // fuer den Attribut Stack -#include <ndindex.hxx> -#include "../inc/msfilter.hxx" -#include <svx/svdobj.hxx> - - -extern void GetLineIndex(SvxBoxItem &rBox, short nLineThickness, short nSpace, sal_uInt8 nCol, short nIdx, - sal_uInt16 nOOIndex, sal_uInt16 nWWIndex, short *pSize); - -class Font; -class Graphic; - -class SwNoTxtNode; -class Size; -class SwPaM; -class SwDoc; -class SwPageDesc; -class SwTxtFmtColl; -class SwTableNode; -class SwCharFmt; -class SwNumRule; -class SvxFontItem; -class SwRelNumRuleSpaces; -class SwNodeNum; -class SwTxtNode; -struct SvxRTFPictureType; - -class SwNodeIdx : public SvxNodeIdx -{ - SwNodeIndex aIdx; -public: - SwNodeIdx( const SwNodeIndex& rIdx ) : aIdx( rIdx ) {} - virtual sal_uLong GetIdx() const; - virtual SvxNodeIdx* Clone() const; -}; - -class BookmarkPosition -{ -public: - SwNodeIndex maMkNode; - xub_StrLen mnMkCntnt; - BookmarkPosition(const SwPaM &rPaM); - BookmarkPosition(const BookmarkPosition &rEntry); - - bool operator==(const BookmarkPosition); -private: - //No assignment - BookmarkPosition& operator=(const BookmarkPosition&); - -}; - -class SwxPosition : public SvxPosition -{ - SwPaM* pPam; -public: - SwxPosition( SwPaM* pCrsr ) : pPam( pCrsr ) {} - - virtual sal_uLong GetNodeIdx() const; - virtual xub_StrLen GetCntIdx() const; - - // erzeuge von sich selbst eine Kopie - virtual SvxPosition* Clone() const; - // erzeuge vom NodeIndex eine Kopie - virtual SvxNodeIdx* MakeNodeIdx() const; -}; - - -// zum zwischenspeichern der Flys: -struct SwFlySave -{ - SfxItemSet aFlySet; - SwNodeIndex nSttNd, nEndNd; - xub_StrLen nEndCnt; - SwTwips nPageWidth; - sal_uInt16 nDropLines, nDropAnchor; - - SwFlySave( const SwPaM& rPam, SfxItemSet& rSet ); - int IsEqualFly( const SwPaM& rPos, SfxItemSet& rSet ); - void SetFlySize( const SwTableNode& rTblNd ); -}; - -struct SwListEntry -{ - long nListId, nListTemplateId, nListNo; - sal_uInt16 nListDocPos; - sal_Bool bRuleUsed; - - SwListEntry() - : nListId( 0 ), nListTemplateId( 0 ), nListNo( 0 ), nListDocPos( 0 ), - bRuleUsed( sal_False ) - {} - SwListEntry( long nLstId, long nLstTmplId, sal_uInt16 nLstDocPos ) - : nListId( nLstId ), nListTemplateId( nLstTmplId ), nListNo( 0 ), - nListDocPos( nLstDocPos ), bRuleUsed( sal_False ) - {} - - void Clear() { nListId = nListTemplateId = nListNo = 0, nListDocPos = 0; - bRuleUsed = sal_False; } -}; - -class SwFlySaveArr : public std::vector<SwFlySave*> -{ -public: - SwFlySaveArr() : ::std::vector<SwFlySave*>() {} - SwFlySaveArr(const SwFlySaveArr& rOther) - : ::std::vector<SwFlySave*>(rOther) - {} - - ~SwFlySaveArr() - { - for(const_iterator it = begin(); it != end(); ++it) - delete *it; - } -}; - -typedef std::deque< SwListEntry > SwListArr; - -struct DocPageInformation -{ - SvxBoxItem maBox; - long mnPaperw; - long mnPaperh; - long mnMargl; - long mnMargr; - long mnMargt; - long mnMargb; - long mnGutter; - long mnPgnStart; - bool mbFacingp; - bool mbLandscape; - bool mbRTLdoc; - DocPageInformation(); -}; - -struct SectPageInformation -{ - std::vector<long> maColumns; - SvxBoxItem maBox; - SvxNumberType maNumType; - SwPageDesc *mpTitlePageHdFt; - SwPageDesc *mpPageHdFt; - long mnPgwsxn; - long mnPghsxn; - long mnMarglsxn; - long mnMargrsxn; - long mnMargtsxn; - long mnMargbsxn; - long mnGutterxsn; - long mnHeadery; - long mnFootery; - long mnPgnStarts; - long mnCols; - long mnColsx; - long mnStextflow; - int mnBkc; - bool mbLndscpsxn; - bool mbTitlepg; - bool mbFacpgsxn; - bool mbRTLsection; - bool mbPgnrestart; - bool mbTitlePageHdFtUsed; - bool mbPageHdFtUsed; - SectPageInformation(const DocPageInformation &rDoc); - SectPageInformation(const SectPageInformation &rSect); -}; - -class rtfSection -{ -public: - rtfSection(const SwPosition &rPos, - const SectPageInformation &rPageInfo); - SwNodeIndex maStart; - SectPageInformation maPageInfo; - SwSection *mpSection; - SwPageDesc *mpTitlePage; - SwPageDesc *mpPage; - - bool IsContinous() const { return maPageInfo.mnBkc == 0; } - long NoCols() const { return maPageInfo.mnCols; } - long StandardColSeperation() const { return maPageInfo.mnColsx; } - bool HasTitlePage() const { return maPageInfo.mbTitlepg; } - long PageStartAt() const { return maPageInfo.mnPgnStarts; } - bool PageRestartNo() const { return maPageInfo.mbPgnrestart; } - bool IsBiDi() const { return maPageInfo.mbRTLsection; } - long GetPageWidth() const { return maPageInfo.mnPgwsxn; } - long GetPageHeight() const { return maPageInfo.mnPghsxn; } - long GetPageLeft() const { return maPageInfo.mnMarglsxn; } - long GetPageRight() const { return maPageInfo.mnMargrsxn; } - bool IsLandScape() const { return maPageInfo.mbLndscpsxn; } -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/styles.cxx b/sw/source/filter/ww8/styles.cxx index e191a32fe171..5d1f1b1fae74 100644 --- a/sw/source/filter/ww8/styles.cxx +++ b/sw/source/filter/ww8/styles.cxx @@ -143,20 +143,6 @@ namespace namespace ww { - //Original code/idea by Takashi Ono for CJK - sti GetCanonicalStiFromEnglishName(const String &rName) throw() - { - typedef const sal_Char** myIter; - sti eRet = stiUser; - myIter aBegin = GetStiNames(); - myIter aEnd(aBegin); - std::advance(aEnd, stiMax); - myIter aIter = std::find_if(aBegin, aEnd, SameName(rName)); - if (aIter != aEnd) - eRet = static_cast<sti>(std::distance(aBegin, aIter)); - return eRet; - } - const sal_Char* GetEnglishNameFromSti(sti eSti) throw() { if (eSti >= stiMax) diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx index 481b9a866cd7..2d4ab8d10687 100644 --- a/sw/source/filter/ww8/writerhelper.cxx +++ b/sw/source/filter/ww8/writerhelper.cxx @@ -757,6 +757,62 @@ namespace sw return nRet; } } + + namespace util + { + InsertedTableClient::InsertedTableClient(SwTableNode & rNode) + { + rNode.Add(this); + } + + SwTableNode * InsertedTableClient::GetTableNode() + { + return dynamic_cast<SwTableNode *> (GetRegisteredInNonConst()); + } + + InsertedTablesManager::InsertedTablesManager(const SwDoc &rDoc) + : mbHasRoot(rDoc.GetCurrentLayout()) //swmod 080218 + { + } + + void InsertedTablesManager::DelAndMakeTblFrms() + { + if (!mbHasRoot) + return; + TblMapIter aEnd = maTables.end(); + for (TblMapIter aIter = maTables.begin(); aIter != aEnd; ++aIter) + { + // exitiert schon ein Layout, dann muss an dieser Tabelle die BoxFrames + // neu erzeugt + SwTableNode *pTable = aIter->first->GetTableNode(); + OSL_ENSURE(pTable, "Why no expected table"); + if (pTable) + { + SwFrmFmt * pFrmFmt = pTable->GetTable().GetFrmFmt(); + + if (pFrmFmt != NULL) + { + SwNodeIndex *pIndex = aIter->second; + pTable->DelFrms(); + pTable->MakeFrms(pIndex); + } + } + } + } + + void InsertedTablesManager::InsertTable(SwTableNode &rTableNode, SwPaM &rPaM) + { + if (!mbHasRoot) + return; + //Associate this tablenode with this after position, replace an //old + //node association if necessary + + InsertedTableClient * pClient = new InsertedTableClient(rTableNode); + + maTables.insert(TblMap::value_type(pClient, &(rPaM.GetPoint()->nNode))); + } + } + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/bookmark.hxx b/sw/source/ui/inc/bookmark.hxx index 80cf41bd2a10..c90bc1c1bb58 100644 --- a/sw/source/ui/inc/bookmark.hxx +++ b/sw/source/ui/inc/bookmark.hxx @@ -38,7 +38,6 @@ class BookmarkCombo : public SwComboBox virtual long PreNotify(NotifyEvent& rNEvt); public: BookmarkCombo( Window* pWin ); - BookmarkCombo( Window* pWin, const ResId& rResId ); sal_uInt16 GetSelectEntryCount() const; sal_uInt16 GetSelectEntryPos( sal_uInt16 nSelIndex = 0 ) const; diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx index 06411f97c469..8ab55b4503d4 100644 --- a/sw/source/ui/misc/bookmark.cxx +++ b/sw/source/ui/misc/bookmark.cxx @@ -154,13 +154,8 @@ SwInsertBookmarkDlg::~SwInsertBookmarkDlg() { } -BookmarkCombo::BookmarkCombo(Window* pWin) : - SwComboBox(pWin) -{ -} - -BookmarkCombo::BookmarkCombo( Window* pWin, const ResId& rResId ) : - SwComboBox(pWin, rResId) +BookmarkCombo::BookmarkCombo(Window* pWin) + : SwComboBox(pWin) { } diff --git a/sw/source/ui/vba/vbafield.cxx b/sw/source/ui/vba/vbafield.cxx index 63fa5d4e5071..7173fc8ab7fd 100644 --- a/sw/source/ui/vba/vbafield.cxx +++ b/sw/source/ui/vba/vbafield.cxx @@ -81,13 +81,10 @@ public: SwVbaReadFieldParams( const String& rData ); ~SwVbaReadFieldParams(); - xub_StrLen GoToTokenParam(); long SkipToNextToken(); xub_StrLen GetTokenSttPtr() const { return nFnd; } xub_StrLen FindNextStringPiece( xub_StrLen _nStart = STRING_NOTFOUND ); - bool GetTokenSttFromTo(xub_StrLen* _pFrom, xub_StrLen* _pTo, - xub_StrLen _nMax); String GetResult() const; String GetFieldName()const { return aFieldName; } @@ -133,15 +130,6 @@ String SwVbaReadFieldParams::GetResult() const } -xub_StrLen SwVbaReadFieldParams::GoToTokenParam() -{ - xub_StrLen nOld = nNext; - if( -2 == SkipToNextToken() ) - return GetTokenSttPtr(); - nNext = nOld; - return STRING_NOTFOUND; -} - // ret: -2: NOT a '\' parameter but normal Text long SwVbaReadFieldParams::SkipToNextToken() { @@ -238,33 +226,6 @@ xub_StrLen SwVbaReadFieldParams::FindNextStringPiece(const xub_StrLen nStart) return n; } - - -// read parameters "1-3" or 1-3 with both values between 1 and nMax -bool SwVbaReadFieldParams::GetTokenSttFromTo(sal_uInt16* pFrom, sal_uInt16* pTo, sal_uInt16 nMax) -{ - sal_uInt16 nStart = 0; - sal_uInt16 nEnd = 0; - xub_StrLen n = GoToTokenParam(); - if( STRING_NOTFOUND != n ) - { - - String sParams( GetResult() ); - - xub_StrLen nIndex = 0; - String sStart( sParams.GetToken(0, '-', nIndex) ); - if( STRING_NOTFOUND != nIndex ) - { - nStart = static_cast<sal_uInt16>(sStart.ToInt32()); - nEnd = static_cast<sal_uInt16>(sParams.Copy(nIndex).ToInt32()); - } - } - if( pFrom ) *pFrom = nStart; - if( pTo ) *pTo = nEnd; - - return nStart && nEnd && (nMax >= nStart) && (nMax >= nEnd); -} - // *** SwVbaFields *********************************************** static uno::Any lcl_createField( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< frame::XModel >& xModel, const uno::Any& aSource ) |