[Libreoffice-commits] .: 3 commits - binfilter/bf_sd binfilter/bf_sw filter/source
Caolán McNamara
caolan at kemper.freedesktop.org
Wed Dec 1 13:01:28 PST 2010
binfilter/bf_sd/source/ui/docshell/sd_docshell.cxx | 1
binfilter/bf_sw/source/core/doc/sw_swtable.cxx | 1
filter/source/graphicfilter/expm/expm.cxx | 69 ++++++++++-----------
3 files changed, 34 insertions(+), 37 deletions(-)
New commits:
commit 6432618997ae3ec5bb3d0c47646df6459f134328
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Dec 1 20:58:21 2010 +0000
tidy this up
diff --git a/filter/source/graphicfilter/expm/expm.cxx b/filter/source/graphicfilter/expm/expm.cxx
index 1f44d53..2a2c97b 100644
--- a/filter/source/graphicfilter/expm/expm.cxx
+++ b/filter/source/graphicfilter/expm/expm.cxx
@@ -39,7 +39,7 @@ class XPMWriter {
private:
- SvStream* mpOStm; // Die auszugebende XPM-Datei
+ SvStream& m_rOStm; // Die auszugebende XPM-Datei
USHORT mpOStmOldModus;
BOOL mbStatus;
@@ -59,18 +59,19 @@ private:
void ImplWritePixel( ULONG );
public:
- XPMWriter();
- ~XPMWriter();
+ XPMWriter(SvStream& rOStm);
+ ~XPMWriter();
- BOOL WriteXPM( const Graphic& rGraphic, SvStream& rXPM, FilterConfigItem* pFilterConfigItem );
+ BOOL WriteXPM( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem );
};
//=================== Methoden von XPMWriter ==============================
-XPMWriter::XPMWriter() :
- mbStatus ( TRUE ),
- mbTrans ( FALSE ),
- mpAcc ( NULL )
+XPMWriter::XPMWriter(SvStream& rOStm)
+ : m_rOStm(rOStm)
+ , mbStatus(TRUE)
+ , mbTrans(FALSE)
+ , mpAcc(NULL)
{
}
@@ -93,12 +94,10 @@ void XPMWriter::ImplCallback( USHORT nPercent )
// ------------------------------------------------------------------------
-BOOL XPMWriter::WriteXPM( const Graphic& rGraphic, SvStream& rXPM, FilterConfigItem* pFilterConfigItem)
+BOOL XPMWriter::WriteXPM( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem)
{
Bitmap aBmp;
- mpOStm = &rXPM;
-
if ( pFilterConfigItem )
{
xStatusIndicator = pFilterConfigItem->GetStatusIndicator();
@@ -130,21 +129,21 @@ BOOL XPMWriter::WriteXPM( const Graphic& rGraphic, SvStream& rXPM, FilterConfigI
if ( mpAcc )
{
mnColors = mpAcc->GetPaletteEntryCount();
- mpOStmOldModus = mpOStm->GetNumberFormatInt();
- mpOStm->SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
+ mpOStmOldModus = m_rOStm.GetNumberFormatInt();
+ m_rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
if ( ImplWriteHeader() )
{
ImplWritePalette();
ImplWriteBody();
- *mpOStm << "\x22XPMENDEXT\x22\x0a};";
+ m_rOStm << "\x22XPMENDEXT\x22\x0a};";
}
aBmp.ReleaseAccess( mpAcc );
}
else
mbStatus = FALSE;
- mpOStm->SetNumberFormatInt( mpOStmOldModus );
+ m_rOStm.SetNumberFormatInt( mpOStmOldModus );
if ( xStatusIndicator.is() )
xStatusIndicator->end();
@@ -160,15 +159,15 @@ BOOL XPMWriter::ImplWriteHeader()
mnHeight = mpAcc->Height();
if ( mnWidth && mnHeight && mnColors )
{
- *mpOStm << "/* XPM */\x0astatic char * image[] = \x0a{\x0a\x22";
+ m_rOStm << "/* XPM */\x0astatic char * image[] = \x0a{\x0a\x22";
ImplWriteNumber( mnWidth );
- *mpOStm << (BYTE)32;
+ m_rOStm << (BYTE)32;
ImplWriteNumber( mnHeight );
- *mpOStm << (BYTE)32;
+ m_rOStm << (BYTE)32;
ImplWriteNumber( mnColors );
- *mpOStm << (BYTE)32;
+ m_rOStm << (BYTE)32;
ImplWriteNumber( ( mnColors > 26 ) ? 2 : 1 );
- *mpOStm << "\x22,\x0a";
+ m_rOStm << "\x22,\x0a";
}
else mbStatus = FALSE;
return mbStatus;
@@ -184,16 +183,16 @@ void XPMWriter::ImplWritePalette()
nTransIndex = mpAcc->GetBestMatchingColor( BMP_COL_TRANS );
for ( USHORT i = 0; i < mnColors; i++ )
{
- *mpOStm << "\x22";
+ m_rOStm << "\x22";
ImplWritePixel( i );
- *mpOStm << (BYTE)32;
+ m_rOStm << (BYTE)32;
if ( nTransIndex != i )
{
ImplWriteColor( i );
- *mpOStm << "\x22,\x0a";
+ m_rOStm << "\x22,\x0a";
}
else
- *mpOStm << "c none\x22,\x0a";
+ m_rOStm << "c none\x22,\x0a";
}
}
@@ -204,12 +203,12 @@ void XPMWriter::ImplWriteBody()
for ( ULONG y = 0; y < mnHeight; y++ )
{
ImplCallback( (USHORT)( ( 100 * y ) / mnHeight ) ); // processing output in percent
- *mpOStm << (BYTE)0x22;
+ m_rOStm << (BYTE)0x22;
for ( ULONG x = 0; x < mnWidth; x++ )
{
ImplWritePixel( (BYTE)(mpAcc->GetPixel( y, x ) ) );
}
- *mpOStm << "\x22,\x0a";
+ m_rOStm << "\x22,\x0a";
}
}
@@ -220,8 +219,8 @@ void XPMWriter::ImplWriteNumber( sal_Int32 nNumber )
{
const ByteString aNum( ByteString::CreateFromInt32( nNumber ) );
- for( sal_Int16 n = 0UL, nLen = aNum.Len(); n < nLen; n++ )
- *mpOStm << aNum.GetChar( n );
+ for( sal_Int16 n = 0UL, nLen = aNum.Len(); n < nLen; ++n )
+ m_rOStm << aNum.GetChar( n );
}
@@ -232,11 +231,11 @@ void XPMWriter::ImplWritePixel( ULONG nCol )
if ( mnColors > 26 )
{
BYTE nDiff = (BYTE) ( nCol / 26 );
- *mpOStm << (BYTE)( nDiff + 'A' );
- *mpOStm << (BYTE)( nCol - ( nDiff*26 ) + 'A' );
+ m_rOStm << (BYTE)( nDiff + 'A' );
+ m_rOStm << (BYTE)( nCol - ( nDiff*26 ) + 'A' );
}
else
- *mpOStm << (BYTE)( nCol + 'A' );
+ m_rOStm << (BYTE)( nCol + 'A' );
}
// ------------------------------------------------------------------------
@@ -246,7 +245,7 @@ void XPMWriter::ImplWriteColor( USHORT nNumber )
ULONG nTmp;
BYTE j;
- *mpOStm << "c #"; // # zeigt einen folgenden Hexwert an
+ m_rOStm << "c #"; // # zeigt einen folgenden Hexwert an
const BitmapColor& rColor = mpAcc->GetPaletteColor( nNumber );
nTmp = ( rColor.GetRed() << 16 ) | ( rColor.GetGreen() << 8 ) | rColor.GetBlue();
for ( signed char i = 20; i >= 0 ; i-=4 )
@@ -255,7 +254,7 @@ void XPMWriter::ImplWriteColor( USHORT nNumber )
j += 'A' - 10;
else
j += '0';
- *mpOStm << j;
+ m_rOStm << j;
}
}
@@ -267,9 +266,9 @@ void XPMWriter::ImplWriteColor( USHORT nNumber )
extern "C" BOOL __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pFilterConfigItem, BOOL )
{
- XPMWriter aXPMWriter;
+ XPMWriter aXPMWriter(rStream);
- return aXPMWriter.WriteXPM( rGraphic, rStream, pFilterConfigItem );
+ return aXPMWriter.WriteXPM( rGraphic, pFilterConfigItem );
}
// ---------------
commit c1739540378ba0ad50c754b8d7c5fdeffab61e53
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Dec 1 20:50:32 2010 +0000
cppcheck: unused variable
diff --git a/binfilter/bf_sw/source/core/doc/sw_swtable.cxx b/binfilter/bf_sw/source/core/doc/sw_swtable.cxx
index 1acfd28..85c6de5 100644
--- a/binfilter/bf_sw/source/core/doc/sw_swtable.cxx
+++ b/binfilter/bf_sw/source/core/doc/sw_swtable.cxx
@@ -867,7 +867,6 @@ namespace binfilter {
/*N*/ const SwTblBoxNumFormat *pNewFmt = 0;
/*N*/ const SwTblBoxFormula *pNewFml = 0;
/*N*/ const SwTblBoxValue *pNewVal = 0;
-/*N*/ double aOldValue = 0;
/*N*/ ULONG nOldFmt = NUMBERFORMAT_TEXT;
/*N*/
/*N*/ switch( pNew ? pNew->Which() : 0 )
commit 9c2d472fed0c2a2baa3b7c3778dc240d8dcbfcfb
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Dec 1 15:35:15 2010 +0000
cppcheck: unused variable
diff --git a/binfilter/bf_sd/source/ui/docshell/sd_docshell.cxx b/binfilter/bf_sd/source/ui/docshell/sd_docshell.cxx
index 8a6a819..a77c4b3 100644
--- a/binfilter/bf_sd/source/ui/docshell/sd_docshell.cxx
+++ b/binfilter/bf_sd/source/ui/docshell/sd_docshell.cxx
@@ -297,7 +297,6 @@ BOOL SdDrawDocShell::Load( SvStorage* pStore )
BOOL bRet = FALSE;
BOOL bXML = ( nStoreVer >= SOFFICE_FILEFORMAT_60 );
BOOL bBinary = ( nStoreVer < SOFFICE_FILEFORMAT_60 );
- bool bStartPresentation = false;
if( bBinary || bXML )
{
More information about the Libreoffice-commits
mailing list