[Libreoffice-commits] .: dbaccess/source

Caolán McNamara caolan at kemper.freedesktop.org
Wed Jul 20 02:04:04 PDT 2011


 dbaccess/source/filter/xml/xmlfilter.cxx |   46 ++++++++++++++-----------------
 dbaccess/source/ui/dlg/dbfindex.cxx      |   13 +++++---
 2 files changed, 29 insertions(+), 30 deletions(-)

New commits:
commit aea73ba0af0bcf626306ffd0e7b00042c13c2dac
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jul 19 21:50:47 2011 +0100

    ByteString::CreateFromAscii->rtl::OStringBuffer::valueOf

diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx
index 8857c55..383fc29 100644
--- a/dbaccess/source/filter/xml/xmlfilter.cxx
+++ b/dbaccess/source/filter/xml/xmlfilter.cxx
@@ -120,9 +120,8 @@ namespace dbaxml
                     {
                         ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM(m_xFactory);
                     }
-                    catch(uno::Exception& ex)
+                    catch (const uno::Exception&)
                     {
-                        (void)ex;
                         OSL_ASSERT(0);
                     }
                 }
@@ -167,9 +166,8 @@ namespace dbaxml
                             ::comphelper::disposeComponent(xModel);
                         }
                     }
-                    catch(uno::Exception& ex)
+                    catch (const uno::Exception&)
                     {
-                        (void)ex;
                         OSL_ASSERT(0);
                     }
                 }
@@ -268,33 +266,31 @@ sal_Int32 ReadThroughComponent(
     {
         xParser->parseStream( aParserInput );
     }
-#if OSL_DEBUG_LEVEL > 1
-    catch( SAXParseException& r )
+    catch (const SAXParseException& r)
     {
-        ByteString aError( "SAX parse exception catched while importing:\n" );
-        aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US );
-        aError += ByteString::CreateFromInt32( r.LineNumber );
-        aError += ',';
-        aError += ByteString::CreateFromInt32( r.ColumnNumber );
-
-        OSL_FAIL( aError.GetBuffer() );
-        return 1;
-    }
+#if OSL_DEBUG_LEVEL > 1
+        rtl::OStringBuffer aError(RTL_CONSTASCII_STRINGPARAM(
+            "SAX parse exception catched while importing:\n"));
+        aError.append(rtl::OUStringToOString(r.Message,
+            RTL_TEXTENCODING_ASCII_US));
+        aError.append(r.LineNumber);
+        aError.append(',');
+        aError.append(r.ColumnNumber);
+        OSL_FAIL(aError.getStr());
 #else
-    catch( SAXParseException& )
-    {
+        (void)r;
+#endif
         return 1;
     }
-#endif
-    catch( SAXException& )
+    catch (const SAXException&)
     {
         return 1;
     }
-    catch( packages::zip::ZipIOException& )
+    catch (const packages::zip::ZipIOException&)
     {
         return ERRCODE_IO_BROKENPACKAGE;
     }
-    catch( Exception& )
+    catch (const Exception&)
     {
         DBG_UNHANDLED_EXCEPTION();
     }
@@ -346,11 +342,11 @@ sal_Int32 ReadThroughComponent(
             uno::Any aAny = xProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Encrypted") ) );
             aAny >>= bEncrypted;
         }
-        catch( packages::WrongPasswordException& )
+        catch (const packages::WrongPasswordException&)
         {
             return ERRCODE_SFX_WRONGPASSWORD;
         }
-        catch ( uno::Exception& )
+        catch (const uno::Exception&)
         {
             return 1; // TODO/LATER: error handling
         }
@@ -457,7 +453,7 @@ sal_Bool ODBFilter::implImport( const Sequence< PropertyValue >& rDescriptor )
         {
             xStorage.set( pMedium->GetStorage( sal_False ), UNO_QUERY_THROW );
         }
-        catch( const Exception& )
+        catch (const Exception&)
         {
             Any aError = ::cppu::getCaughtException();
             if  ( aError.isExtractableTo( ::cppu::UnoType< RuntimeException >::get() ) )
@@ -908,7 +904,7 @@ void ODBFilter::setPropertyInfo()
         {
             xDataSource->setPropertyValue(PROPERTY_INFO,makeAny(aInfo));
         }
-        catch(const Exception&)
+        catch (const Exception&)
         {
             DBG_UNHANDLED_EXCEPTION();
         }
diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx
index 9a593cd..6403be2 100644
--- a/dbaccess/source/ui/dlg/dbfindex.cxx
+++ b/dbaccess/source/ui/dlg/dbfindex.cxx
@@ -42,6 +42,7 @@
 #include <unotools/pathoptions.hxx>
 #include <ucbhelper/content.hxx>
 #include <svl/filenotation.hxx>
+#include <rtl/strbuf.hxx>
 
 
 //.........................................................................
@@ -493,14 +494,13 @@ void OTableInfo::WriteInfFile( const String& rDSN ) const
     // Erst einmal alle Tabellenindizes loeschen
     ByteString aNDX;
     sal_uInt16 nKeyCnt = aInfFile.GetKeyCount();
-    ByteString aKeyName;
     ByteString aEntry;
     sal_uInt16 nKey = 0;
 
     while( nKey < nKeyCnt )
     {
         // Verweist der Key auf ein Indexfile?...
-        aKeyName = aInfFile.GetKeyName( nKey );
+        ByteString aKeyName = aInfFile.GetKeyName( nKey );
         aNDX = aKeyName.Copy(0,3);
 
         //...wenn ja, Indexfile loeschen, nKey steht dann auf nachfolgendem Key
@@ -521,10 +521,13 @@ void OTableInfo::WriteInfFile( const String& rDSN ) const
             ++aIndex, ++nPos
         )
     {
-        aKeyName = "NDX";
+        rtl::OStringBuffer aKeyName(RTL_CONSTASCII_STRINGPARAM("NDX"));
         if( nPos > 0 )	// Erster Index erhaelt keine Ziffer
-            aKeyName += ByteString::CreateFromInt32( nPos );
-        aInfFile.WriteKey( aKeyName, ByteString(aIndex->GetIndexFileName(), gsl_getSystemTextEncoding()) );
+            aKeyName.append(static_cast<sal_Int32>(nPos));
+        aInfFile.WriteKey(
+            aKeyName.makeStringAndClear(),
+            rtl::OUStringToOString(aIndex->GetIndexFileName(),
+                gsl_getSystemTextEncoding()));
     }
 
     aInfFile.Flush();


More information about the Libreoffice-commits mailing list