[Libreoffice-commits] .: binfilter/bf_sw binfilter/inc
Caolán McNamara
caolan at kemper.freedesktop.org
Thu Mar 15 09:27:16 PDT 2012
binfilter/bf_sw/source/filter/inc/wrt_fn.hxx | 5
binfilter/bf_sw/source/filter/writer/sw_writer.cxx | 128 ---------------------
binfilter/bf_sw/source/filter/writer/sw_wrt_fn.cxx | 61 ----------
binfilter/inc/bf_sw/shellio.hxx | 28 ----
4 files changed, 222 deletions(-)
New commits:
commit 49d3d392b740bd90bacf73036b6dae454d8fa5c8
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Mar 15 16:25:46 2012 +0000
callcatcher: now safely remove the actually unused parts
diff --git a/binfilter/bf_sw/source/filter/inc/wrt_fn.hxx b/binfilter/bf_sw/source/filter/inc/wrt_fn.hxx
index f0fd707..58aef01 100644
--- a/binfilter/bf_sw/source/filter/inc/wrt_fn.hxx
+++ b/binfilter/bf_sw/source/filter/inc/wrt_fn.hxx
@@ -46,11 +46,6 @@ class Writer;
typedef Writer& (*FnAttrOut)( Writer&, const SfxPoolItem& );
typedef FnAttrOut SwAttrFnTab[ POOLATTR_END - POOLATTR_BEGIN ];
-Writer& Out( const SwAttrFnTab, const SfxPoolItem&, Writer& );
-Writer& Out_SfxItemSet( const SwAttrFnTab, Writer&, const SfxItemSet&,
- BOOL bDeep, BOOL bTstForDefault = TRUE );
-
-
/* Funktionspointer auf die Node-Write-Funktionen */
enum RES_NODE
diff --git a/binfilter/bf_sw/source/filter/writer/sw_writer.cxx b/binfilter/bf_sw/source/filter/writer/sw_writer.cxx
index 0dcc3be..53069ed 100644
--- a/binfilter/bf_sw/source/filter/writer/sw_writer.cxx
+++ b/binfilter/bf_sw/source/filter/writer/sw_writer.cxx
@@ -53,10 +53,6 @@
#include <swerror.h>
namespace binfilter {
-// Stringbuffer fuer die umgewandelten Zahlen
-static sal_Char aNToABuf[] = "0000000000000000000000000";
-#define NTOABUFLEN (sizeof(aNToABuf))
-
/*N*/ DECLARE_TABLE( SwBookmarkNodeTable, SvPtrarr* )
/*N*/ struct Writer_Impl
@@ -166,28 +162,6 @@ static sal_Char aNToABuf[] = "0000000000000000000000000";
/*?*/ return TRUE;
/*N*/ }
-// suche die naechste Bookmark-Position aus der Bookmark-Tabelle
-
- SwPaM* Writer::NewSwPaM( SwDoc & rDoc, ULONG nStartIdx, ULONG nEndIdx ) const
- {
- SwNodes* pNds = &rDoc.GetNodes();
-
- SwNodeIndex aStt( *pNds, nStartIdx );
- SwCntntNode* pCNode = aStt.GetNode().GetCntntNode();
- if( !pCNode && 0 == ( pCNode = pNds->GoNext( &aStt )) )
- OSL_ENSURE( !this, "An StartPos kein ContentNode mehr" );
-
- SwPaM* pNew = new SwPaM( aStt );
- pNew->SetMark();
- aStt = nEndIdx;
- if( 0 == (pCNode = aStt.GetNode().GetCntntNode()) &&
- 0 == (pCNode = pNds->GoPrevious( &aStt )) )
- OSL_ENSURE( !this, "An StartPos kein ContentNode mehr" );
- pCNode->MakeEndIndex( &pNew->GetPoint()->nContent );
- pNew->GetPoint()->nNode = aStt;
- return pNew;
- }
-
// Stream-spezifisches
/*N*/ #ifdef DBG_UTIL
/*N*/ SvStream& Writer::Strm()
@@ -198,53 +172,6 @@ static sal_Char aNToABuf[] = "0000000000000000000000000";
/*N*/ #endif
-SvStream& Writer::OutHex( SvStream& rStrm, ULONG nHex, BYTE nLen )
-{ // in einen Stream aus
- // Pointer an das Bufferende setzen
- sal_Char* pStr = aNToABuf + (NTOABUFLEN-1);
- for( BYTE n = 0; n < nLen; ++n )
- {
- *(--pStr) = (sal_Char)(nHex & 0xf ) + 48;
- if( *pStr > '9' )
- *pStr += 39;
- nHex >>= 4;
- }
- return rStrm << pStr;
-}
-
-SvStream& Writer::OutLong( SvStream& rStrm, long nVal )
-{
- // Pointer an das Bufferende setzen
- sal_Char* pStr = aNToABuf + (NTOABUFLEN-1);
-
- int bNeg = nVal < 0;
- if( bNeg )
- nVal = -nVal;
-
- do {
- *(--pStr) = (sal_Char)(nVal % 10 ) + 48;
- nVal /= 10;
- } while( nVal );
-
- // Ist Zahl negativ, dann noch -
- if( bNeg )
- *(--pStr) = '-';
-
- return rStrm << pStr;
-}
-
-SvStream& Writer::OutULong( SvStream& rStrm, ULONG nVal )
-{
- // Pointer an das Bufferende setzen
- sal_Char* pStr = aNToABuf + (NTOABUFLEN-1);
-
- do {
- *(--pStr) = (sal_Char)(nVal % 10 ) + 48;
- nVal /= 10;
- } while ( nVal );
- return rStrm << pStr;
-}
-
/*N*/ ULONG Writer::Write( SwPaM& rPaM, SvStream& rStrm )
/*N*/ {
/*N*/ pStrm = &rStrm;
@@ -263,61 +190,6 @@ SvStream& Writer::OutULong( SvStream& rStrm, ULONG nVal )
/*N*/ return nRet;
/*N*/ }
-/*N*/ void Writer::PutNumFmtFontsInAttrPool()
-/*N*/ {
-/*N*/ if( !pImpl )
-/*?*/ pImpl = new Writer_Impl;
-/*N*/
-/*N*/ // dann gibt es noch in den NumRules ein paar Fonts
-/*N*/ // Diese in den Pool putten. Haben sie danach einen RefCount > 1
-/*N*/ // kann es wieder entfernt werden - ist schon im Pool
-/*N*/ SfxItemPool& rPool = pDoc->GetAttrPool();
-/*N*/ const SwNumRuleTbl& rListTbl = pDoc->GetNumRuleTbl();
-/*N*/ const SwNumRule* pRule;
-/*N*/ const SwNumFmt* pFmt;
-/*N*/ const Font *pFont, *pDefFont = &SwNumRule::GetDefBulletFont();
-/*N*/ BOOL bCheck = FALSE;
-/*N*/
-/*N*/ for( USHORT nGet = rListTbl.Count(); nGet; )
-/*N*/ if( pDoc->IsUsed( *(pRule = rListTbl[ --nGet ] )))
-/*?*/ for( BYTE nLvl = 0; nLvl < MAXLEVEL; ++nLvl )
-/*?*/ if( SVX_NUM_CHAR_SPECIAL == (pFmt = &pRule->Get( nLvl ))->GetNumberingType() ||
-/*?*/ SVX_NUM_BITMAP == pFmt->GetNumberingType() )
-/*?*/ {
-/*?*/ if( 0 == ( pFont = pFmt->GetBulletFont() ) )
-/*?*/ pFont = pDefFont;
-/*?*/
-/*?*/ if( bCheck )
-/*?*/ {
-/*?*/ if( *pFont == *pDefFont )
-/*?*/ continue;
-/*?*/ }
-/*?*/ else if( *pFont == *pDefFont )
-/*?*/ bCheck = TRUE;
-/*?*/
-/*?*/ _AddFontItem( rPool, SvxFontItem( pFont->GetFamily(),
-/*?*/ pFont->GetName(), pFont->GetStyleName(),
-/*?*/ pFont->GetPitch(), pFont->GetCharSet() ));
-/*N*/ }
-/*N*/ }
-
-/*N*/ void Writer::PutEditEngFontsInAttrPool( BOOL bIncl_CJK_CTL )
-/*N*/ {
-/*N*/ if( !pImpl )
-/*?*/ pImpl = new Writer_Impl;
-/*N*/
-/*N*/ SfxItemPool& rPool = pDoc->GetAttrPool();
-/*N*/ if( rPool.GetSecondaryPool() )
-/*N*/ {
-/*N*/ _AddFontItems( rPool, EE_CHAR_FONTINFO );
-/*N*/ if( bIncl_CJK_CTL )
-/*N*/ {
-/*N*/ _AddFontItems( rPool, EE_CHAR_FONTINFO_CJK );
-/*N*/ _AddFontItems( rPool, EE_CHAR_FONTINFO_CTL );
-/*N*/ }
-/*N*/ }
-/*N*/ }
-
/*N*/ void Writer::_AddFontItems( SfxItemPool& rPool, USHORT nW )
/*N*/ {
/*N*/ const SvxFontItem* pFont = (const SvxFontItem*)&rPool.GetDefaultItem( nW );
diff --git a/binfilter/bf_sw/source/filter/writer/sw_wrt_fn.cxx b/binfilter/bf_sw/source/filter/writer/sw_wrt_fn.cxx
index 944e269..99586b1 100644
--- a/binfilter/bf_sw/source/filter/writer/sw_wrt_fn.cxx
+++ b/binfilter/bf_sw/source/filter/writer/sw_wrt_fn.cxx
@@ -41,66 +41,6 @@
#include "node.hxx"
namespace binfilter {
-
-
-Writer& Out( const SwAttrFnTab pTab, const SfxPoolItem& rHt, Writer & rWrt )
-{
- USHORT nId = rHt.Which();
- OSL_ENSURE( nId < POOLATTR_END && nId >= POOLATTR_BEGIN, "SwAttrFnTab::Out()" );
- FnAttrOut pOut;
- if( 0 != ( pOut = pTab[ nId - RES_CHRATR_BEGIN] ))
- (*pOut)( rWrt, rHt );
- return rWrt;
-
-}
-
-Writer& Out_SfxItemSet( const SwAttrFnTab pTab, Writer& rWrt,
- const SfxItemSet& rSet, BOOL bDeep,
- BOOL bTstForDefault )
-{
- // erst die eigenen Attribute ausgeben
- const SfxItemPool& rPool = *rSet.GetPool();
- const SfxItemSet* pSet = &rSet;
- if( !pSet->Count() ) // Optimierung - leere Sets
- {
- if( !bDeep )
- return rWrt;
- while( 0 != ( pSet = pSet->GetParent() ) && !pSet->Count() )
- ;
- if( !pSet )
- return rWrt;
- }
- const SfxPoolItem* pItem;
- FnAttrOut pOut;
- if( !bDeep || !pSet->GetParent() )
- {
- OSL_ENSURE( rSet.Count(), "Wurde doch schon behandelt oder?" );
- SfxItemIter aIter( *pSet );
- pItem = aIter.GetCurItem();
- do {
- if( 0 != ( pOut = pTab[ pItem->Which() - RES_CHRATR_BEGIN] ))
- (*pOut)( rWrt, *pItem );
- } while( !aIter.IsAtEnd() && 0 != ( pItem = aIter.NextItem() ) );
- }
- else
- {
- SfxWhichIter aIter( *pSet );
- register USHORT nWhich = aIter.FirstWhich();
- while( nWhich )
- {
- if( SFX_ITEM_SET == pSet->GetItemState( nWhich, bDeep, &pItem ) &&
- ( !bTstForDefault || (
- *pItem != rPool.GetDefaultItem( nWhich )
- || ( pSet->GetParent() &&
- *pItem != pSet->GetParent()->Get( nWhich ))
- )) && 0 != ( pOut = pTab[ nWhich - RES_CHRATR_BEGIN] ))
- (*pOut)( rWrt, *pItem );
- nWhich = aIter.NextWhich();
- }
- }
- return rWrt;
-}
-
/*N*/ Writer& Out( const SwNodeFnTab pTab, SwNode& rNode, Writer & rWrt )
/*N*/ {
/*N*/ // es muss ein CntntNode sein !!
@@ -123,7 +63,6 @@ Writer& Out_SfxItemSet( const SwAttrFnTab pTab, Writer& rWrt,
/*N*/ return rWrt;
/*N*/ }
-
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/inc/bf_sw/shellio.hxx b/binfilter/inc/bf_sw/shellio.hxx
index 0f030bd..83703c5 100644
--- a/binfilter/inc/bf_sw/shellio.hxx
+++ b/binfilter/inc/bf_sw/shellio.hxx
@@ -121,9 +121,6 @@ protected:
void ResetWriter();
BOOL CopyNextPam( SwPaM ** );
- void PutNumFmtFontsInAttrPool();
- void PutEditEngFontsInAttrPool( BOOL bIncl_CJK_CTL = TRUE );
-
virtual ULONG WriteStream() = 0;
public:
@@ -152,31 +149,6 @@ public:
const SwAsciiOptions& GetAsciiOptions() const { return aAscOpts; }
void SetAsciiOptions( const SwAsciiOptions& rOpt ) { aAscOpts = rOpt; }
- // suche die naechste Bookmark-Position aus der Bookmark-Tabelle
- // build a bookmark table, which is sort by the node position. The
- // OtherPos of the bookmarks also inserted.
- // search alle Bookmarks in the range and return it in the Array
- // lege einen neuen PaM an der Position an
- SwPaM* NewSwPaM( SwDoc & rDoc, ULONG nStartIdx, ULONG nEndIdx ) const;
-
- // kopiere ggfs. eine lokale Datei ins Internet
-
- // Stream-spezifische Routinen, im Storage-Writer NICHT VERWENDEN!
-
- // Optimierung der Ausgabe auf den Stream.
-SvStream& OutLong( SvStream& rStrm, long nVal );
-SvStream& OutULong( SvStream& rStrm, ULONG nVal );
-
- // Hex-Zahl ausgeben, default ist 2.stellige Zahl
-SvStream& OutHex( SvStream& rStrm, ULONG nHex, BYTE nLen = 2 );
- // 4-st. Hex-Zahl ausgeben
- // 8-st. Hex-Zahl ausgeben
-
-inline SvStream& OutHex( USHORT nHex, BYTE nLen = 2 ) { return OutHex( Strm(), nHex, nLen ); }
-inline SvStream& OutHex4( USHORT nHex ) { return OutHex( Strm(), nHex, 4 ); }
-inline SvStream& OutLong( long nVal ) { return OutLong( Strm(), nVal ); }
-inline SvStream& OutULong( ULONG nVal ) { return OutULong( Strm(), nVal ); }
-
void SetStrm( SvStream& rStrm ) { pStrm = &rStrm; }
#ifndef DBG_UTIL
SvStream& Strm() { return *pStrm; }
More information about the Libreoffice-commits
mailing list