summaryrefslogtreecommitdiff
path: root/extensions/source/bibliography
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-11-07 11:37:01 +0000
committerCaolán McNamara <caolanm@redhat.com>2011-11-07 12:27:32 +0000
commit0a590fc4f0ae79faeea402ec4868cfd89b5f0371 (patch)
treeb95f882ac48c947da986226f0cee09760f49d941 /extensions/source/bibliography
parent994a737a317165db736f2a2f6a25b3439207da5d (diff)
make extensions ByteString free
Diffstat (limited to 'extensions/source/bibliography')
-rw-r--r--extensions/source/bibliography/datman.cxx189
1 files changed, 81 insertions, 108 deletions
diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx
index f825c6f42f75..8668ed1ff174 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -118,7 +118,7 @@ Reference< XConnection > getConnection(const ::rtl::OUString& _rURL)
{
xDataSource = Reference< XDataSource > (Reference< XNamingService > (xNamingContext, UNO_QUERY)->getRegisteredObject(_rURL), UNO_QUERY);
}
- catch(Exception &)
+ catch (const Exception&)
{
OSL_FAIL("Exception caught in ODatabaseContext::getRegisteredObject()");
}
@@ -138,15 +138,13 @@ Reference< XConnection > getConnection(const ::rtl::OUString& _rURL)
Reference<task::XInteractionHandler> xIHdl(xHdl, UNO_QUERY);
xConn = xComplConn->connectWithCompletion(xIHdl);
}
- catch(SQLException&)
+ catch (const SQLException&)
{
// TODO : a real error handling
}
- catch(Exception& e )
+ catch (const Exception&)
{
- (void) e; // make compiler happy
}
-
}
return xConn;
}
@@ -166,9 +164,8 @@ Reference< XConnection > getConnection(const Reference< XInterface > & xRowSe
DBG_WARNING("no active connection");
}
}
- catch(Exception& e )
+ catch (const Exception&)
{
- (void) e; // make compiler happy
OSL_FAIL("exception in getConnection");
}
@@ -204,17 +201,15 @@ Reference< XNameAccess > getColumns(const Reference< XForm > & _rxForm)
if (xSupplyCols.is())
xReturn = xSupplyCols->getColumns();
}
-#ifdef DBG_UTIL
- catch(Exception& e )
-#else
- catch(Exception&)
-#endif
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
String sMsg(String::CreateFromAscii("::getColumns : catched an exception ("));
sMsg += String(e.Message);
sMsg.AppendAscii(") ...");
- OSL_FAIL( ByteString(sMsg, RTL_TEXTENCODING_ASCII_US ).GetBuffer());
+ OSL_FAIL(rtl::OUStringToOString(sMsg, RTL_TEXTENCODING_ASCII_US ).getStr());
+#else
+ (void)e;
#endif
}
@@ -625,13 +620,10 @@ DBChangeDialog_Impl::DBChangeDialog_Impl(Window* pParent, BibDataManager* pMan )
}
aSelectionLB.GetModel()->Resort();
}
- catch(Exception& e )
+ catch (const Exception&)
{
- (void) e; // make compiler happy
OSL_FAIL("Exception in BibDataManager::DBChangeDialog_Impl::DBChangeDialog_Impl");
}
-
-
}
IMPL_LINK(DBChangeDialog_Impl, DoubleClickHdl, SvTabListBox*, /*pLB*/)
@@ -855,9 +847,8 @@ void BibDataManager::InsertFields(const Reference< XFormComponent > & _rxGrid)
xColContainer->insertByName( *pFields, makeAny( xCurrentCol ) );
}
}
- catch(Exception& e )
+ catch (const Exception&)
{
- (void) e; // make compiler happy
OSL_FAIL("Exception in BibDataManager::InsertFields");
}
}
@@ -887,13 +878,11 @@ Reference< awt::XControlModel > BibDataManager::updateGridModel(const Reference<
Reference< XFormComponent > xFormComp( m_xGridModel, UNO_QUERY );
InsertFields( xFormComp );
}
- catch(Exception& e )
+ catch (const Exception&)
{
- (void) e; // make compiler happy
OSL_FAIL("::updateGridModel: something went wrong !");
}
-
return m_xGridModel;
}
@@ -971,13 +960,11 @@ Reference< XForm > BibDataManager::createDatabaseForm(BibDBDescriptor& rDesc)
}
}
}
- catch(Exception& e )
+ catch (const Exception&)
{
- (void) e; // make compiler happy
OSL_FAIL("::createDatabaseForm: something went wrong !");
}
-
return xResult;
}
//------------------------------------------------------------------------
@@ -994,13 +981,11 @@ Sequence< ::rtl::OUString > BibDataManager::getDataSources()
if (xTables.is())
aTableNameSeq = xTables->getElementNames();
}
- catch(Exception& e )
+ catch (const Exception&)
{
- (void) e; // make compiler happy
OSL_FAIL("::getDataSources: something went wrong !");
}
-
return aTableNameSeq;
}
//------------------------------------------------------------------------
@@ -1022,7 +1007,7 @@ void BibDataManager::setFilter(const ::rtl::OUString& rQuery)
xFormProps->setPropertyValue( C2U( "ApplyFilter" ), makeAny( sal_True ) );
reload();
}
- catch(Exception&)
+ catch (const Exception&)
{
DBG_UNHANDLED_EXCEPTION();
}
@@ -1039,7 +1024,7 @@ void BibDataManager::setFilter(const ::rtl::OUString& rQuery)
Reference< XPropertySet > xFormProps( m_xForm, UNO_QUERY_THROW );
OSL_VERIFY( xFormProps->getPropertyValue( C2U( "Filter" ) ) >>= aQueryString );
}
- catch( const Exception& )
+ catch (const Exception&)
{
DBG_UNHANDLED_EXCEPTION();
}
@@ -1234,12 +1219,10 @@ void BibDataManager::setActiveDataTable(const ::rtl::OUString& rTable)
}
}
}
- catch(Exception& e )
+ catch (const Exception&)
{
- (void) e; // make compiler happy
OSL_FAIL("::setActiveDataTable: something went wrong !");
}
-
}
//------------------------------------------------------------------------
@@ -1367,13 +1350,11 @@ Reference< awt::XControlModel > BibDataManager::createGridModel(const ::rtl::OUS
xPropSet->setPropertyValue( uProp, makeAny( sId ) );
}
}
- catch(Exception& e )
+ catch (const Exception&)
{
- (void) e; // make compiler happy
OSL_FAIL("::createGridModel: something went wrong !");
}
-
return xModel;
}
//------------------------------------------------------------------------
@@ -1489,9 +1470,8 @@ Reference< awt::XControlModel > BibDataManager::loadControlModel(
}
}
}
- catch(Exception& e )
+ catch (const Exception&)
{
- (void) e; // make compiler happy
OSL_FAIL("::loadControlModel: something went wrong !");
}
return xModel;
@@ -1529,104 +1509,97 @@ void BibDataManager::propertyChange(const beans::PropertyChangeEvent& evt) throw
xLocate->moveToBookmark(aUID);
}
}
- catch(Exception& e )
+ catch (const Exception&)
{
- (void) e; // make compiler happy
OSL_FAIL("::propertyChange: something went wrong !");
}
-
-
}
+
//------------------------------------------------------------------------
void BibDataManager::SetMeAsUidListener()
{
-try
-{
- Reference< XNameAccess > xFields = getColumns( m_xForm );
- if (!xFields.is())
- return;
-
- Sequence< ::rtl::OUString > aFields(xFields->getElementNames());
- const ::rtl::OUString* pFields = aFields.getConstArray();
- sal_Int32 nCount=aFields.getLength();
- String StrUID(C2S(STR_UID));
- ::rtl::OUString theFieldName;
- for( sal_Int32 i=0; i<nCount; i++ )
+ try
{
- String aName= pFields[i];
+ Reference< XNameAccess > xFields = getColumns( m_xForm );
+ if (!xFields.is())
+ return;
- if(aName.EqualsIgnoreCaseAscii(StrUID))
+ Sequence< ::rtl::OUString > aFields(xFields->getElementNames());
+ const ::rtl::OUString* pFields = aFields.getConstArray();
+ sal_Int32 nCount=aFields.getLength();
+ String StrUID(C2S(STR_UID));
+ ::rtl::OUString theFieldName;
+ for( sal_Int32 i=0; i<nCount; i++ )
{
- theFieldName=pFields[i];
- break;
+ String aName= pFields[i];
+
+ if(aName.EqualsIgnoreCaseAscii(StrUID))
+ {
+ theFieldName=pFields[i];
+ break;
+ }
}
- }
- if(theFieldName.getLength()>0)
- {
- Reference< XPropertySet > xPropSet;
- Any aElement;
+ if(theFieldName.getLength()>0)
+ {
+ Reference< XPropertySet > xPropSet;
+ Any aElement;
- aElement = xFields->getByName(theFieldName);
- xPropSet = *(Reference< XPropertySet > *)aElement.getValue();
+ aElement = xFields->getByName(theFieldName);
+ xPropSet = *(Reference< XPropertySet > *)aElement.getValue();
- xPropSet->addPropertyChangeListener(FM_PROP_VALUE, this);
- }
+ xPropSet->addPropertyChangeListener(FM_PROP_VALUE, this);
+ }
+ }
+ catch (const Exception&)
+ {
+ OSL_FAIL("Exception in BibDataManager::SetMeAsUidListener");
+ }
}
-catch(Exception& e )
-{
- (void) e; // make compiler happy
- OSL_FAIL("Exception in BibDataManager::SetMeAsUidListener");
-}
-
-}
//------------------------------------------------------------------------
void BibDataManager::RemoveMeAsUidListener()
{
-try
-{
- Reference< XNameAccess > xFields = getColumns( m_xForm );
- if (!xFields.is())
- return;
-
-
- Sequence< ::rtl::OUString > aFields(xFields->getElementNames());
- const ::rtl::OUString* pFields = aFields.getConstArray();
- sal_Int32 nCount=aFields.getLength();
- String StrUID(C2S(STR_UID));
- ::rtl::OUString theFieldName;
- for( sal_Int32 i=0; i<nCount; i++ )
+ try
{
- String aName= pFields[i];
+ Reference< XNameAccess > xFields = getColumns( m_xForm );
+ if (!xFields.is())
+ return;
- if(aName.EqualsIgnoreCaseAscii(StrUID))
- {
- theFieldName=pFields[i];
- break;
- }
- }
- if(theFieldName.getLength()>0)
- {
- Reference< XPropertySet > xPropSet;
- Any aElement;
+ Sequence< ::rtl::OUString > aFields(xFields->getElementNames());
+ const ::rtl::OUString* pFields = aFields.getConstArray();
+ sal_Int32 nCount=aFields.getLength();
+ String StrUID(C2S(STR_UID));
+ ::rtl::OUString theFieldName;
+ for( sal_Int32 i=0; i<nCount; i++ )
+ {
+ String aName= pFields[i];
- aElement = xFields->getByName(theFieldName);
- xPropSet = *(Reference< XPropertySet > *)aElement.getValue();
+ if(aName.EqualsIgnoreCaseAscii(StrUID))
+ {
+ theFieldName=pFields[i];
+ break;
+ }
+ }
- xPropSet->removePropertyChangeListener(FM_PROP_VALUE, this);
- }
+ if(theFieldName.getLength()>0)
+ {
+ Reference< XPropertySet > xPropSet;
+ Any aElement;
-}
-catch(Exception& e )
-{
- (void) e; // make compiler happy
- OSL_FAIL("Exception in BibDataManager::RemoveMeAsUidListener");
-}
+ aElement = xFields->getByName(theFieldName);
+ xPropSet = *(Reference< XPropertySet > *)aElement.getValue();
+ xPropSet->removePropertyChangeListener(FM_PROP_VALUE, this);
+ }
+ }
+ catch (const Exception&)
+ {
+ OSL_FAIL("Exception in BibDataManager::RemoveMeAsUidListener");
+ }
}
void BibDataManager::CreateMappingDialog(Window* pParent)