[Libreoffice-commits] .: 5 commits - l10ntools/inc l10ntools/source tools/source vcl/unx
David Tardon
dtardon at kemper.freedesktop.org
Mon May 16 06:44:49 PDT 2011
l10ntools/inc/export.hxx | 1 -
l10ntools/inc/xmlparse.hxx | 22 ----------------------
l10ntools/source/xmlparse.cxx | 40 +++-------------------------------------
tools/source/fsys/dirent.cxx | 4 ++++
vcl/unx/gtk/a11y/atkwrapper.cxx | 2 +-
vcl/unx/gtk/app/gtkdata.cxx | 2 +-
6 files changed, 9 insertions(+), 62 deletions(-)
New commits:
commit 4d969ef8bf0f565e9b2ab860e8f6bea182abf188
Author: David Tardon <dtardon at redhat.com>
Date: Mon May 16 11:56:50 2011 +0200
close opened files on error
diff --git a/tools/source/fsys/dirent.cxx b/tools/source/fsys/dirent.cxx
index 1ca7295..a188569 100644
--- a/tools/source/fsys/dirent.cxx
+++ b/tools/source/fsys/dirent.cxx
@@ -2273,6 +2273,10 @@ FSysError DirEntry::MoveTo( const DirEntry& rNewName ) const
}
else
{
+ if ( fpIN )
+ fclose( fpIN );
+ if ( fpOUT )
+ fclose( fpOUT );
return Sys2SolarError_Impl( EXDEV );
}
}
commit 3f9760a2d2d733e214d8364045b64c093e127c43
Author: David Tardon <dtardon at redhat.com>
Date: Mon May 16 10:15:19 2011 +0200
avoid array overrun
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index 50fa4c9..2694025 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -358,7 +358,7 @@ GdkCursor* GtkSalDisplay::getFromXPM( const unsigned char *pBitmap,
GdkCursor *GtkSalDisplay::getCursor( PointerStyle ePointerStyle )
{
- if( ePointerStyle > POINTER_COUNT )
+ if( ePointerStyle >= POINTER_COUNT )
return NULL;
if ( !m_aCursors[ ePointerStyle ] )
commit 85c7d05e6332d444933156a030d5103546794509
Author: David Tardon <dtardon at redhat.com>
Date: Mon May 16 10:13:07 2011 +0200
fix brain fart
diff --git a/vcl/unx/gtk/a11y/atkwrapper.cxx b/vcl/unx/gtk/a11y/atkwrapper.cxx
index f4e0bad..7ccf07b 100644
--- a/vcl/unx/gtk/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk/a11y/atkwrapper.cxx
@@ -313,7 +313,7 @@ static AtkRole mapToAtkRole( sal_Int16 nRole )
initialized = true;
}
- static const sal_Int32 nMapSize = sizeof(roleMap)/sizeof(sal_Int16);
+ static const sal_Int32 nMapSize = SAL_N_ELEMENTS(roleMap);
if( 0 <= nRole && nMapSize > nRole )
role = roleMap[nRole];
commit d08c2bf264e68b52e98e101ac00d1a37c560d7cd
Author: David Tardon <dtardon at redhat.com>
Date: Mon May 16 10:00:15 2011 +0200
remove unused code
diff --git a/l10ntools/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx
index a31b2c8..aa5c79d 100644
--- a/l10ntools/inc/xmlparse.hxx
+++ b/l10ntools/inc/xmlparse.hxx
@@ -270,31 +270,9 @@ public:
/// UnQuot the XML characters and restore \n \t
static void UnQuotHTML ( String &rString );
-
- /// Return the numeric iso language code
- //sal_uInt16 GetLangByIsoLang( const ByteString &rIsoLang );
-
- /// Return the alpha strings representation
- ByteString GetIsoLangByIndex( sal_uInt16 nIndex );
-
- static XMLUtil& Instance();
- ~XMLUtil();
-
- void dump();
-
private:
- /// Mapping iso alpha string code <-> iso numeric code
- HashMap lMap;
-
- /// Mapping iso numeric code <-> iso alpha string code
- ByteString isoArray[MAX_LANGUAGES];
-
static void UnQuotData( String &rString );
static void UnQuotTags( String &rString );
-
- XMLUtil();
- XMLUtil(const XMLUtil&);
-
};
diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx
index 173595e..be1deca 100644
--- a/l10ntools/source/xmlparse.cxx
+++ b/l10ntools/source/xmlparse.cxx
@@ -330,9 +330,6 @@ void XMLFile::WriteString( ofstream &rStream, const String &sString )
sal_Bool XMLFile::Write( ofstream &rStream , XMLNode *pCur )
{
- XMLUtil& xmlutil = XMLUtil::Instance();
- (void) xmlutil;
-
if ( !pCur )
Write( rStream, this );
else {
@@ -351,11 +348,11 @@ sal_Bool XMLFile::Write( ofstream &rStream , XMLNode *pCur )
for ( size_t j = 0; j < pElement->GetAttributeList()->size(); j++ ) {
rStream << " ";
String sData(* (*pElement->GetAttributeList())[ j ] );
- xmlutil.QuotHTML( sData );
+ XMLUtil::QuotHTML( sData );
WriteString( rStream , sData );
rStream << "=\"";
sData = (*pElement->GetAttributeList())[ j ]->GetValue();
- xmlutil.QuotHTML( sData );
+ XMLUtil::QuotHTML( sData );
WriteString( rStream , sData );
rStream << "\"";
}
@@ -374,7 +371,7 @@ sal_Bool XMLFile::Write( ofstream &rStream , XMLNode *pCur )
case XML_NODE_TYPE_DATA: {
XMLData *pData = ( XMLData * ) pCur;
String sData( pData->GetData());
- xmlutil.QuotHTML( sData );
+ XMLUtil::QuotHTML( sData );
WriteString( rStream, sData );
}
break;
@@ -1417,35 +1414,4 @@ void XMLUtil::UnQuotData( String &rString_in ){
}
-XMLUtil::XMLUtil(){
-}
-
-
-/*****************************************************************************/
-void XMLUtil::dump(){
-/*****************************************************************************/
- int cnt=1;
- printf("size=%lu\n",static_cast<unsigned long>(lMap.size()));
- for(HashMap::iterator pos = lMap.begin(); pos != lMap.end() ; ++pos){
- fprintf(stdout,"key=%s , value=%d , no=%d\n",pos->first.GetBuffer(),pos->second,cnt++);
- }
-}
-/*****************************************************************************/
-XMLUtil& XMLUtil::Instance(){
-/*****************************************************************************/
- static XMLUtil instance;
- return instance;
-}
-/*****************************************************************************/
-XMLUtil::~XMLUtil(){}
-/*****************************************************************************/
-/*****************************************************************************/
-ByteString XMLUtil::GetIsoLangByIndex( sal_uInt16 nIndex )
-/*****************************************************************************/
-{
- if(nIndex > 0 && MAX_LANGUAGES >= nIndex )
- return isoArray[nIndex];
- return "";
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 5826caca22719f12a35f48a03bb9bf39da91a4d0
Author: David Tardon <dtardon at redhat.com>
Date: Mon May 16 09:54:05 2011 +0200
remove unused function
diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index 4cb0b64..9724138 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -342,7 +342,6 @@ public:
static bool hasUTF8ByteOrderMarker( const ByteString &rString );
static void RemoveUTF8ByteOrderMarkerFromFile( const ByteString &rFilename );
static bool fileHasUTF8ByteOrderMarker( const ByteString &rString );
- static ByteString GetIsoLangByIndex( sal_uInt16 nIndex );
static void QuotHTML( ByteString &rString );
static bool CopyFile( const ByteString& source , const ByteString& dest );
More information about the Libreoffice-commits
mailing list