[Libreoffice-commits] .: 6 commits - svtools/source tools/inc tools/source
Caolán McNamara
caolan at kemper.freedesktop.org
Tue Jun 14 01:58:42 PDT 2011
svtools/source/contnr/fileview.cxx | 20 +++++-----
svtools/source/control/valueacc.cxx | 10 ++---
svtools/source/dialogs/insdlg.cxx | 4 +-
svtools/source/filter/filter.cxx | 10 ++---
svtools/source/misc/embedhlp.cxx | 12 +++---
tools/inc/tools/stream.hxx | 24 ------------
tools/source/generic/svlibrary.cxx | 2 -
tools/source/stream/stream.cxx | 67 +-----------------------------------
8 files changed, 33 insertions(+), 116 deletions(-)
New commits:
commit 075033e5782403e05dc1881e5001a1ccc4aea8c6
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jun 14 09:51:53 2011 +0100
remove unused filler and width
diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx
index 1b4dafa..4c60756 100644
--- a/tools/inc/tools/stream.hxx
+++ b/tools/inc/tools/stream.hxx
@@ -269,17 +269,6 @@ private:
rtl::OString m_aCryptMaskKey; // aCryptMaskKey.getLength != 0 -> Verschluesselung
unsigned char nCryptMask;
- // Formatierung von Strings
- char cFiller;
- sal_uInt8 nWidth;
-
- enum PrintfParams
- {
- SPECIAL_PARAM_NONE = 0, // Format-Str, Number
- SPECIAL_PARAM_WIDTH = 1 // Format-Str, Width, Number
- };
-
- PrintfParams ePrintfParams;
ByteString aFormatString;
// Userdata
@@ -396,13 +385,6 @@ public:
SvStream& WriteByteString( const UniString& rStr ) { return WriteByteString( rStr, GetStreamCharSet() ); }
SvStream& WriteByteString( const ByteString& rStr );
- void SetWidth( sal_uInt8 nWid)
- { nWidth = nWid; CreateFormatString(); }
- sal_uInt8 GetWidth() const { return nWidth; }
- void SetFiller( char cFil )
- { cFiller = cFil; CreateFormatString(); }
- char GetFiller() const { return cFiller; }
-
SvStream& WriteNumber( sal_uInt32 nUInt32 );
SvStream& WriteNumber( sal_Int32 nInt32 );
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 49a3325..8af9660 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -458,8 +458,6 @@ void SvStream::ImpInit()
eIOMode = STREAM_IO_DONTKNOW;
nBufFree = 0;
- nWidth = 0; // default width
- cFiller = ' ';
eStreamMode = 0;
CreateFormatString();
@@ -1951,15 +1949,6 @@ void SvStream::RefreshBuffer()
void SvStream::CreateFormatString()
{
aFormatString = '%';
- ePrintfParams = SPECIAL_PARAM_NONE;
-
- if( nWidth )
- {
- if( cFiller != ' ' )
- aFormatString += '0';
- aFormatString += '*';
- ePrintfParams = SPECIAL_PARAM_WIDTH;
- }
}
/*************************************************************************
@@ -1973,16 +1962,7 @@ SvStream& SvStream::WriteNumber( sal_Int32 nInt32 )
char buffer[256+12];
ByteString aFStr( aFormatString);
aFStr += SAL_PRIdINT32;
- sal_Size nLen = 0;
- switch ( ePrintfParams )
- {
- case SPECIAL_PARAM_NONE :
- nLen = sprintf(buffer, aFStr.GetBuffer(), nInt32);
- break;
- case SPECIAL_PARAM_WIDTH :
- nLen = sprintf(buffer, aFStr.GetBuffer(), nWidth, nInt32);
- break;
- }
+ sal_Size nLen = sprintf(buffer, aFStr.GetBuffer(), nInt32);
Write( buffer, nLen );
return *this;
}
@@ -1992,16 +1972,7 @@ SvStream& SvStream::WriteNumber( sal_uInt32 nUInt32 )
char buffer[256+12];
ByteString aFStr( aFormatString);
aFStr += SAL_PRIuUINT32;
- sal_Size nLen = 0;
- switch ( ePrintfParams )
- {
- case SPECIAL_PARAM_NONE :
- nLen = sprintf(buffer, aFStr.GetBuffer(), nUInt32);
- break;
- case SPECIAL_PARAM_WIDTH :
- nLen = sprintf(buffer, aFStr.GetBuffer(), nWidth, nUInt32);
- break;
- }
+ sal_Size nLen = sprintf(buffer, aFStr.GetBuffer(), nUInt32);
Write( buffer, nLen );
return *this;
}
commit 3d3d895b5064dce28992ca95776f7b62455a30c6
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Jun 13 23:40:41 2011 +0100
catch by const reference
diff --git a/svtools/source/control/valueacc.cxx b/svtools/source/control/valueacc.cxx
index 3be7dc6..1ee86c7 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -125,7 +125,7 @@ void ValueSetAcc::FireAccessibleEvent( short nEventId, const uno::Any& rOldValue
{
(*aIter)->notifyEvent( aEvtObject );
}
- catch( uno::Exception& )
+ catch(const uno::Exception&)
{
}
@@ -154,7 +154,7 @@ ValueSetAcc* ValueSetAcc::getImplementation( const uno::Reference< uno::XInterfa
uno::Reference< lang::XUnoTunnel > xUnoTunnel( rxData, uno::UNO_QUERY );
return( xUnoTunnel.is() ? reinterpret_cast<ValueSetAcc*>(sal::static_int_cast<sal_IntPtr>(xUnoTunnel->getSomething( ValueSetAcc::getUnoTunnelId() ))) : NULL );
}
- catch( const ::com::sun::star::uno::Exception& )
+ catch(const ::com::sun::star::uno::Exception&)
{
return NULL;
}
@@ -719,7 +719,7 @@ void SAL_CALL ValueSetAcc::disposing (void)
{
(*aListenerIterator)->disposing (aEvent);
}
- catch( uno::Exception& )
+ catch(const uno::Exception&)
{
// Ignore exceptions.
}
@@ -864,7 +864,7 @@ ValueItemAcc* ValueItemAcc::getImplementation( const uno::Reference< uno::XInter
uno::Reference< lang::XUnoTunnel > xUnoTunnel( rxData, uno::UNO_QUERY );
return( xUnoTunnel.is() ? reinterpret_cast<ValueItemAcc*>(sal::static_int_cast<sal_IntPtr>(xUnoTunnel->getSomething( ValueItemAcc::getUnoTunnelId() ))) : NULL );
}
- catch( const ::com::sun::star::uno::Exception& )
+ catch(const ::com::sun::star::uno::Exception&)
{
return NULL;
}
@@ -932,7 +932,7 @@ sal_Int32 SAL_CALL ValueItemAcc::getAccessibleIndexInParent()
{
pItem = mpParent->mrParent.ImplGetVisibleItem (i);
}
- catch (lang::IndexOutOfBoundsException aException)
+ catch (const lang::IndexOutOfBoundsException&)
{
pItem = NULL;
}
diff --git a/svtools/source/dialogs/insdlg.cxx b/svtools/source/dialogs/insdlg.cxx
index dd97562..9987622 100644
--- a/svtools/source/dialogs/insdlg.cxx
+++ b/svtools/source/dialogs/insdlg.cxx
@@ -223,9 +223,9 @@ void SvObjectServerList::FillInsertObjects()
aObjectServerList.push_back( SvObjectServer( aOleFact, aOleObj ) );
#endif
- }catch( container::NoSuchElementException)
+ }catch(const container::NoSuchElementException&)
{
- }catch( uno::Exception)
+ }catch(const uno::Exception&)
{
}
catch(...)
diff --git a/svtools/source/filter/filter.cxx b/svtools/source/filter/filter.cxx
index 2872976..4566c92 100644
--- a/svtools/source/filter/filter.cxx
+++ b/svtools/source/filter/filter.cxx
@@ -131,11 +131,11 @@ sal_Bool ImplDirEntryHelper::Exists( const INetURLObject& rObj )
bExists = aCnt.isDocument();
}
- catch( ::com::sun::star::ucb::CommandAbortedException& )
+ catch(const ::com::sun::star::ucb::CommandAbortedException&)
{
DBG_ERRORFILE( "CommandAbortedException" );
}
- catch( ::com::sun::star::ucb::ContentCreationException& )
+ catch(const ::com::sun::star::ucb::ContentCreationException&)
{
DBG_ERRORFILE( "ContentCreationException" );
}
@@ -158,7 +158,7 @@ void ImplDirEntryHelper::Kill( const String& rMainUrl )
aCnt.executeCommand( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "delete" )),
::com::sun::star::uno::makeAny( sal_Bool( sal_True ) ) );
}
- catch( ::com::sun::star::ucb::CommandAbortedException& )
+ catch(const ::com::sun::star::ucb::CommandAbortedException&)
{
DBG_ERRORFILE( "CommandAbortedException" );
}
@@ -1665,7 +1665,7 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath,
{
pBuf = new sal_uInt8[ nBufSize ];
}
- catch (std::bad_alloc)
+ catch (const std::bad_alloc&)
{
nStatus = GRFILTER_TOOBIG;
}
@@ -2020,7 +2020,7 @@ sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String&
}
}
}
- catch( ::com::sun::star::uno::Exception& )
+ catch(const ::com::sun::star::uno::Exception&)
{
nStatus = GRFILTER_IOERROR;
}
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index f3e370f..7f5fc4d 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -339,11 +339,11 @@ void EmbeddedObjectRef::Clear()
mxObj->changeState( embed::EmbedStates::LOADED );
xClose->close( sal_True );
}
- catch ( util::CloseVetoException& )
+ catch (const util::CloseVetoException&)
{
// there's still someone who needs the object!
}
- catch ( uno::Exception& )
+ catch (const uno::Exception&)
{
OSL_FAIL( "Error on switching of the object to loaded state and closing!\n" );
}
@@ -484,10 +484,10 @@ Size EmbeddedObjectRef::GetSize( MapMode* pTargetMapMode ) const
{
aSize = mxObj->getVisualAreaSize( mpImp->nViewAspect );
}
- catch( embed::NoVisualAreaSizeException& )
+ catch(const embed::NoVisualAreaSizeException&)
{
}
- catch( uno::Exception& )
+ catch(const uno::Exception&)
{
OSL_FAIL( "Something went wrong on getting of the size of the object!" );
}
@@ -496,7 +496,7 @@ Size EmbeddedObjectRef::GetSize( MapMode* pTargetMapMode ) const
{
aSourceMapMode = VCLUnoHelper::UnoEmbed2VCLMapUnit( mxObj->getMapUnit( mpImp->nViewAspect ) );
}
- catch( uno::Exception )
+ catch(const uno::Exception&)
{
OSL_FAIL( "Can not get the map mode!" );
}
@@ -733,7 +733,7 @@ sal_Bool EmbeddedObjectRef::TryRunningState( const uno::Reference < embed::XEmbe
if ( xEmbObj->getCurrentState() == embed::EmbedStates::LOADED )
xEmbObj->changeState( embed::EmbedStates::RUNNING );
}
- catch ( uno::Exception& )
+ catch (const uno::Exception&)
{
return sal_False;
}
commit 34f90ef155ce2a1fd1a589bb92fd03b53902cf5c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Jun 13 21:57:36 2011 +0100
Precision unused
diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx
index 81f818b..1b4dafa 100644
--- a/tools/inc/tools/stream.hxx
+++ b/tools/inc/tools/stream.hxx
@@ -271,10 +271,16 @@ private:
// Formatierung von Strings
char cFiller;
- sal_uInt8 nPrecision;
sal_uInt8 nWidth;
- sal_uInt8 nPrintfParams;
- ByteString aFormatString;
+
+ enum PrintfParams
+ {
+ SPECIAL_PARAM_NONE = 0, // Format-Str, Number
+ SPECIAL_PARAM_WIDTH = 1 // Format-Str, Width, Number
+ };
+
+ PrintfParams ePrintfParams;
+ ByteString aFormatString;
// Userdata
long nVersion; // for external use
@@ -390,9 +396,6 @@ public:
SvStream& WriteByteString( const UniString& rStr ) { return WriteByteString( rStr, GetStreamCharSet() ); }
SvStream& WriteByteString( const ByteString& rStr );
- void SetPrecision( sal_uInt8 nPrec )
- { nPrecision = nPrec; CreateFormatString(); }
- sal_uInt8 GetPrecision() const { return nPrecision; }
void SetWidth( sal_uInt8 nWid)
{ nWidth = nWid; CreateFormatString(); }
sal_uInt8 GetWidth() const { return nWidth; }
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 9a749a6..49a3325 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -61,14 +61,6 @@ DBG_NAME( Stream )
// -----------------------------------------------------------------------
-// sprintf Param-Mode
-#define SPECIAL_PARAM_NONE 0 // Format-Str, Number
-#define SPECIAL_PARAM_WIDTH 1 // Format-Str, Width, Number
-#define SPECIAL_PARAM_PRECISION 2 // Format-Str, Precision, Number
-#define SPECIAL_PARAM_BOTH 3 // Format-Str, Width, Precision, Number
-
-// -----------------------------------------------------------------------
-
// !!! Nicht inline, wenn Operatoren <<,>> inline sind
inline static void SwapUShort( sal_uInt16& r )
{ r = SWAPSHORT(r); }
@@ -466,7 +458,6 @@ void SvStream::ImpInit()
eIOMode = STREAM_IO_DONTKNOW;
nBufFree = 0;
- nPrecision = 0; // all significant digits
nWidth = 0; // default width
cFiller = ' ';
eStreamMode = 0;
@@ -1960,23 +1951,14 @@ void SvStream::RefreshBuffer()
void SvStream::CreateFormatString()
{
aFormatString = '%';
- nPrintfParams = SPECIAL_PARAM_NONE;
+ ePrintfParams = SPECIAL_PARAM_NONE;
if( nWidth )
{
if( cFiller != ' ' )
aFormatString += '0';
aFormatString += '*';
- nPrintfParams = SPECIAL_PARAM_WIDTH;
- }
-
- if( nPrecision )
- {
- aFormatString += ".*";
- if( nWidth )
- nPrintfParams = SPECIAL_PARAM_BOTH;
- else
- nPrintfParams = SPECIAL_PARAM_PRECISION;
+ ePrintfParams = SPECIAL_PARAM_WIDTH;
}
}
@@ -1991,8 +1973,8 @@ SvStream& SvStream::WriteNumber( sal_Int32 nInt32 )
char buffer[256+12];
ByteString aFStr( aFormatString);
aFStr += SAL_PRIdINT32;
- sal_Size nLen;
- switch ( nPrintfParams )
+ sal_Size nLen = 0;
+ switch ( ePrintfParams )
{
case SPECIAL_PARAM_NONE :
nLen = sprintf(buffer, aFStr.GetBuffer(), nInt32);
@@ -2000,11 +1982,6 @@ SvStream& SvStream::WriteNumber( sal_Int32 nInt32 )
case SPECIAL_PARAM_WIDTH :
nLen = sprintf(buffer, aFStr.GetBuffer(), nWidth, nInt32);
break;
- case SPECIAL_PARAM_PRECISION :
- nLen = sprintf(buffer, aFStr.GetBuffer(), nPrecision, nInt32);
- break;
- default:
- nLen = sprintf(buffer, aFStr.GetBuffer(), nWidth, nPrecision, nInt32);
}
Write( buffer, nLen );
return *this;
@@ -2015,8 +1992,8 @@ SvStream& SvStream::WriteNumber( sal_uInt32 nUInt32 )
char buffer[256+12];
ByteString aFStr( aFormatString);
aFStr += SAL_PRIuUINT32;
- sal_Size nLen;
- switch ( nPrintfParams )
+ sal_Size nLen = 0;
+ switch ( ePrintfParams )
{
case SPECIAL_PARAM_NONE :
nLen = sprintf(buffer, aFStr.GetBuffer(), nUInt32);
@@ -2024,11 +2001,6 @@ SvStream& SvStream::WriteNumber( sal_uInt32 nUInt32 )
case SPECIAL_PARAM_WIDTH :
nLen = sprintf(buffer, aFStr.GetBuffer(), nWidth, nUInt32);
break;
- case SPECIAL_PARAM_PRECISION :
- nLen = sprintf(buffer, aFStr.GetBuffer(), nPrecision, nUInt32);
- break;
- default:
- nLen = sprintf(buffer,aFStr.GetBuffer(), nWidth, nPrecision, nUInt32);
}
Write( buffer, nLen );
return *this;
commit 5902c3e6bfff3c0162f7dd214fc83c46b4ebb1f1
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Jun 13 21:50:18 2011 +0100
fix assert, title column added twice
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index 09401d9..6a511bd 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -732,17 +732,19 @@ ViewTabListBox_Impl::ViewTabListBox_Impl( Window* pParentWin,
mpHeaderBar->SetPosSizePixel( Point( 0, 0 ), mpHeaderBar->CalcWindowSizePixel() );
HeaderBarItemBits nBits = ( HIB_LEFT | HIB_VCENTER | HIB_CLICKABLE );
- if ( ( nFlags & FILEVIEW_SHOW_ALL ) == FILEVIEW_SHOW_ALL )
- {
- mpHeaderBar->InsertItem( COLUMN_TITLE, String( SvtResId( STR_SVT_FILEVIEW_COLUMN_TITLE ) ), 180, nBits | HIB_UPARROW );
- mpHeaderBar->InsertItem( COLUMN_TYPE, String( SvtResId( STR_SVT_FILEVIEW_COLUMN_TYPE ) ), 140, nBits );
- mpHeaderBar->InsertItem( COLUMN_SIZE, String( SvtResId( STR_SVT_FILEVIEW_COLUMN_SIZE ) ), 80, nBits );
- mpHeaderBar->InsertItem( COLUMN_DATE, String( SvtResId( STR_SVT_FILEVIEW_COLUMN_DATE ) ), 500, nBits );
- }
- if( ( nFlags & FILEVIEW_SHOW_NONE ) == FILEVIEW_SHOW_NONE )
+ if ((nFlags & FILEVIEW_SHOW_NONE) == FILEVIEW_SHOW_NONE)
bViewHeader = false;
else
- mpHeaderBar->InsertItem( COLUMN_TITLE, String( SvtResId( STR_SVT_FILEVIEW_COLUMN_TITLE ) ), 600, nBits );
+ {
+ if (nFlags & FILEVIEW_SHOW_TITLE)
+ mpHeaderBar->InsertItem(COLUMN_TITLE, String(SvtResId(STR_SVT_FILEVIEW_COLUMN_TITLE)), 600, nBits | HIB_UPARROW);
+ if (nFlags & FILEVIEW_SHOW_ALL)
+ mpHeaderBar->InsertItem(COLUMN_TYPE, String(SvtResId(STR_SVT_FILEVIEW_COLUMN_TYPE)), 140, nBits);
+ if (nFlags & FILEVIEW_SHOW_SIZE)
+ mpHeaderBar->InsertItem(COLUMN_SIZE, String(SvtResId(STR_SVT_FILEVIEW_COLUMN_SIZE)), 80, nBits);
+ if (nFlags & FILEVIEW_SHOW_DATE)
+ mpHeaderBar->InsertItem(COLUMN_DATE, String(SvtResId(STR_SVT_FILEVIEW_COLUMN_DATE)), 500, nBits);
+ }
Size aHeadSize = mpHeaderBar->GetSizePixel();
SetPosSizePixel( Point( 0, aHeadSize.Height() ),
commit ba5e22b669a0233fb9c6bf490df6b4881a16e1f3
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Jun 13 21:10:34 2011 +0100
remove unused justification
diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx
index 13586fd..81f818b 100644
--- a/tools/inc/tools/stream.hxx
+++ b/tools/inc/tools/stream.hxx
@@ -94,9 +94,6 @@ typedef sal_uInt16 StreamMode;
#define COMPRESSMODE_ZBITMAP (sal_uInt16)0x0001
#define COMPRESSMODE_NATIVE (sal_uInt16)0x0010
-#define JUSTIFY_RIGHT 0x00
-#define JUSTIFY_LEFT 0x01
-
#define STREAM_IO_DONTKNOW 0
#define STREAM_IO_READ 1
#define STREAM_IO_WRITE 2
@@ -277,7 +274,6 @@ private:
sal_uInt8 nPrecision;
sal_uInt8 nWidth;
sal_uInt8 nPrintfParams;
- sal_uInt8 nJustification;
ByteString aFormatString;
// Userdata
@@ -403,9 +399,6 @@ public:
void SetFiller( char cFil )
{ cFiller = cFil; CreateFormatString(); }
char GetFiller() const { return cFiller; }
- void SetJustification( sal_uInt8 nJus )
- { nJustification = nJus; CreateFormatString(); }
- sal_uInt8 GetJustification() const { return nJustification; }
SvStream& WriteNumber( sal_uInt32 nUInt32 );
SvStream& WriteNumber( sal_Int32 nInt32 );
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index efbdae7..9a749a6 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -469,7 +469,6 @@ void SvStream::ImpInit()
nPrecision = 0; // all significant digits
nWidth = 0; // default width
cFiller = ' ';
- nJustification = JUSTIFY_RIGHT;
eStreamMode = 0;
CreateFormatString();
@@ -1963,11 +1962,6 @@ void SvStream::CreateFormatString()
aFormatString = '%';
nPrintfParams = SPECIAL_PARAM_NONE;
- if( nJustification )
- {
- aFormatString += '-';
- }
-
if( nWidth )
{
if( cFiller != ' ' )
commit 40d808d4b89d5df15c09abeee988cd1350c248c0
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Jun 13 15:18:23 2011 +0100
catch by const reference
diff --git a/tools/source/generic/svlibrary.cxx b/tools/source/generic/svlibrary.cxx
index 5864bdf..fdf7149 100644
--- a/tools/source/generic/svlibrary.cxx
+++ b/tools/source/generic/svlibrary.cxx
@@ -66,7 +66,7 @@ static uno::Sequence< rtl::OUString > GetMultiPaths_Impl()
xPathSettings->getPropertyValue( aInternal ) >>= aInternalPaths;
xPathSettings->getPropertyValue( aUser ) >>= aUserPaths;
}
- catch (uno::Exception &)
+ catch (const uno::Exception &)
{
bSuccess = false;
}
More information about the Libreoffice-commits
mailing list