[Libreoffice-commits] .: 4 commits - desktop/source editeng/source idl/inc sfx2/inc sfx2/source
Caolán McNamara
caolan at kemper.freedesktop.org
Tue Jun 21 01:14:03 PDT 2011
desktop/source/migration/migration.cxx | 36 +++++---
editeng/source/accessibility/AccessibleEditableTextPara.cxx | 54 +++++++-----
idl/inc/database.hxx | 2
sfx2/inc/sfx2/bindings.hxx | 11 +-
sfx2/inc/sfx2/childwin.hxx | 2
sfx2/inc/srchdlg.hxx | 2
sfx2/source/appl/childwin.cxx | 4
sfx2/source/dialog/srchdlg.cxx | 6 -
8 files changed, 70 insertions(+), 47 deletions(-)
New commits:
commit 27cc3c6306d8ddc7e2232f709feadd4098d2a213
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jun 21 08:53:19 2011 +0100
catch by const reference
diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx
index 85d66e3..3fd4e7c 100644
--- a/desktop/source/migration/migration.cxx
+++ b/desktop/source/migration/migration.cxx
@@ -125,8 +125,7 @@ static const char XDG_CONFIG_PART[] = "/.config";
sLabel = aStr;
}
-
- catch(container::NoSuchElementException&)
+ catch (const container::NoSuchElementException&)
{
sLabel = sCommand;
sal_Int32 nIndex = sLabel.indexOf(':');
@@ -228,9 +227,11 @@ void Migration::migrateSettingsIfNecessary()
return;
sal_Bool bResult = sal_False;
- try {
+ try
+ {
bResult = aImpl.doMigration();
- } catch (Exception& e)
+ }
+ catch (const Exception& e)
{
OString aMsg("doMigration() exception: ");
aMsg += OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US);
@@ -332,7 +333,8 @@ sal_Bool MigrationImpl::doMigration()
refresh();
result = sal_True;
- } catch (...)
+ }
+ catch (...)
{
OString aMsg("An unexpected exception was thrown during migration");
aMsg += "\nOldVersion: " + OUStringToOString(m_aInfo.productname, RTL_TEXTENCODING_ASCII_US);
@@ -358,11 +360,14 @@ void MigrationImpl::refresh()
void MigrationImpl::setMigrationCompleted()
{
- try {
+ try
+ {
uno::Reference< XPropertySet > aPropertySet(getConfigAccess("org.openoffice.Setup/Office", true), uno::UNO_QUERY_THROW);
aPropertySet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("MigrationCompleted")), uno::makeAny(sal_True));
uno::Reference< XChangesBatch >(aPropertySet, uno::UNO_QUERY_THROW)->commitChanges();
- } catch (...) {
+ }
+ catch (...)
+ {
// fail silently
}
}
@@ -382,7 +387,9 @@ bool MigrationImpl::checkMigrationCompleted()
setMigrationCompleted();
bMigrationCompleted = sal_True;
}
- } catch (Exception&) {
+ }
+ catch (const Exception&)
+ {
// just return false...
}
OSL_TRACE( "Migration %s", bMigrationCompleted ? "already completed" : "not done" );
@@ -587,7 +594,9 @@ install_info MigrationImpl::findInstallation(const strings_v& rVersions)
aInfo.userdata = aObj.GetMainURL( INetURLObject::NO_DECODE );
aInfo.productname = aVersion;
}
- catch( uno::Exception& ){}
+ catch (const uno::Exception&)
+ {
+ }
}
++i_ver;
}
@@ -870,7 +879,8 @@ uno::Reference< XNameAccess > MigrationImpl::getConfigAccess(const sal_Char* pPa
xNameAccess = uno::Reference< XNameAccess > (
theConfigProvider->createInstanceWithArguments(
sAccessSrvc, theArgs ), uno::UNO_QUERY_THROW );
- } catch (com::sun::star::uno::Exception& e)
+ }
+ catch (const com::sun::star::uno::Exception& e)
{
OString aMsg = OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US);
OSL_FAIL(aMsg.getStr());
@@ -954,13 +964,15 @@ void MigrationImpl::runServices()
xMigrationJob->execute(uno::Sequence< NamedValue >());
- } catch (Exception& e)
+ }
+ catch (const Exception& e)
{
OString aMsg("Execution of migration service failed (Exception caught).\nService: ");
aMsg += OUStringToOString(i_mig->service, RTL_TEXTENCODING_ASCII_US) + "\nMessage: ";
aMsg += OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US);
OSL_FAIL(aMsg.getStr());
- } catch (...)
+ }
+ catch (...)
{
OString aMsg("Execution of migration service failed (Exception caught).\nService: ");
aMsg += OUStringToOString(i_mig->service, RTL_TEXTENCODING_ASCII_US) +
commit 5a6e58441a2bc86898665bd783ff8bde14289efa
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Jun 20 22:01:49 2011 +0100
catch by const reference
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index b2c1478..131e1b8 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -153,7 +153,9 @@ namespace accessibility
pStateSet->AddState( AccessibleStateType::ENABLED );
pStateSet->AddState( AccessibleStateType::SENSITIVE );
}
- catch( const uno::Exception& ) {}
+ catch (const uno::Exception&)
+ {
+ }
}
AccessibleEditableTextPara::~AccessibleEditableTextPara()
@@ -170,7 +172,9 @@ namespace accessibility
OSL_TRACE( "AccessibleEditableTextPara revoked ID: %d\n", mnNotifierClientId );
#endif
}
- catch( const uno::Exception& ) {}
+ catch (const uno::Exception&)
+ {
+ }
}
}
@@ -315,13 +319,17 @@ namespace accessibility
aOldDesc <<= getAccessibleDescription();
aOldName <<= getAccessibleName();
}
- catch( const uno::Exception& ) {} // optional behaviour
+ catch (const uno::Exception&) // optional behaviour
+ {
+ }
// index and therefore description changed
FireEvent( AccessibleEventId::DESCRIPTION_CHANGED, uno::makeAny( getAccessibleDescription() ), aOldDesc );
FireEvent( AccessibleEventId::NAME_CHANGED, uno::makeAny( getAccessibleName() ), aOldName );
}
}
- catch( const uno::Exception& ) {} // optional behaviour
+ catch (const uno::Exception&) // optional behaviour
+ {
+ }
}
sal_Int32 AccessibleEditableTextPara::GetParagraphIndex() const SAL_THROW((uno::RuntimeException))
@@ -355,7 +363,9 @@ namespace accessibility
OSL_TRACE( "Disposed ID: %d\n", nClientId );
#endif
}
- catch( const uno::Exception& ) {}
+ catch (const uno::Exception&)
+ {
+ }
}
}
@@ -385,7 +395,9 @@ namespace accessibility
{
TextChanged();
}
- catch( const uno::RuntimeException& ) {}
+ catch (const uno::RuntimeException&)
+ {
+ }
}
ESelection AccessibleEditableTextPara::MakeSelection( sal_Int32 nStartEEIndex, sal_Int32 nEndEEIndex )
@@ -1363,7 +1375,7 @@ namespace accessibility
else
return -1;
}
- catch( const lang::IndexOutOfBoundsException& )
+ catch (const lang::IndexOutOfBoundsException&)
{
// #103927# Don't throw for invalid nIndex values
return -1;
@@ -1437,7 +1449,7 @@ namespace accessibility
SvxEditViewForwarder& rCacheVF = GetEditViewForwarder( sal_True );
return rCacheVF.SetSelection( MakeSelection(nStartIndex, nEndIndex) );
}
- catch( const uno::RuntimeException& )
+ catch (const uno::RuntimeException&)
{
return sal_False;
}
@@ -1650,7 +1662,7 @@ namespace accessibility
return aRetVal;
}
- catch( const uno::RuntimeException& )
+ catch (const uno::RuntimeException&)
{
return sal_False;
}
@@ -1681,7 +1693,7 @@ namespace accessibility
return rCacheVF.Cut();
}
- catch( const uno::RuntimeException& )
+ catch (const uno::RuntimeException&)
{
return sal_False;
}
@@ -1711,7 +1723,7 @@ namespace accessibility
return rCacheVF.Paste();
}
- catch( const uno::RuntimeException& )
+ catch (const uno::RuntimeException&)
{
return sal_False;
}
@@ -1744,7 +1756,7 @@ namespace accessibility
return bRet;
}
- catch( const uno::RuntimeException& )
+ catch (const uno::RuntimeException&)
{
return sal_False;
}
@@ -1779,7 +1791,7 @@ namespace accessibility
return bRet;
}
- catch( const uno::RuntimeException& )
+ catch (const uno::RuntimeException&)
{
return sal_False;
}
@@ -1814,7 +1826,7 @@ namespace accessibility
return bRet;
}
- catch( const uno::RuntimeException& )
+ catch (const uno::RuntimeException&)
{
return sal_False;
}
@@ -1861,7 +1873,7 @@ namespace accessibility
{
aPropSet.setPropertyValue(pPropArray->Name, pPropArray->Value);
}
- catch( const uno::Exception& )
+ catch (const uno::Exception&)
{
OSL_FAIL("AccessibleEditableTextPara::setAttributes exception in setPropertyValue");
}
@@ -1874,7 +1886,7 @@ namespace accessibility
return sal_True;
}
- catch( const uno::RuntimeException& )
+ catch (const uno::RuntimeException&)
{
return sal_False;
}
@@ -1937,7 +1949,7 @@ namespace accessibility
{
aProp = xPropSetInfo->getPropertyByName( pRequestedAttributes[i] );
}
- catch (beans::UnknownPropertyException &)
+ catch (const beans::UnknownPropertyException&)
{
continue;
}
@@ -2036,7 +2048,7 @@ namespace accessibility
{
aProp = xPropSetInfo->getPropertyByName( pRequestedAttributes[i] );
}
- catch (beans::UnknownPropertyException &)
+ catch (const beans::UnknownPropertyException&)
{
continue;
}
@@ -2199,7 +2211,7 @@ namespace accessibility
aResult.SegmentStart = nStart;
aResult.SegmentEnd = nEnd;
}
- catch (lang::IndexOutOfBoundsException)
+ catch (const lang::IndexOutOfBoundsException&)
{
// this is not the exception that should be raised in this function ...
DBG_ASSERT( 0, "unexpected exception" );
@@ -2222,7 +2234,7 @@ namespace accessibility
{
aResult = getTextAtLineNumber( getNumberOfLineWithCaret() );
}
- catch (lang::IndexOutOfBoundsException &)
+ catch (const lang::IndexOutOfBoundsException&)
{
// this one needs to be catched since this interface does not allow for it.
}
@@ -2239,7 +2251,7 @@ namespace accessibility
{
nRes = getLineNumberAtIndex( getCaretPosition() );
}
- catch (lang::IndexOutOfBoundsException &)
+ catch (const lang::IndexOutOfBoundsException&)
{
// this one needs to be catched since this interface does not allow for it.
}
commit 42600790f38a6b0411b45f3c3c81a79750a5f942
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Jun 20 20:57:43 2011 +0100
drop unused method and object
diff --git a/idl/inc/database.hxx b/idl/inc/database.hxx
index e3286ad..dd6dcf6 100644
--- a/idl/inc/database.hxx
+++ b/idl/inc/database.hxx
@@ -82,7 +82,6 @@ class SvIdlDataBase
protected:
#ifdef IDL_COMPILER
- ByteString aModulePrefix;
SvMetaObjectMemberStack aContextStack;
String aPath;
SvIdlError aError;
@@ -117,7 +116,6 @@ public:
void SetExportFile( const String& rName )
{ aExportFile = rName; }
void AppendAttr( SvMetaAttribute *pSlot );
- const ByteString& GetActModulePrefix() const { return aModulePrefix; }
const SvIdlError & GetError() const { return aError; }
void SetError( const SvIdlError & r )
{ aError = r; }
commit e666957e1ebd94067e739a06d60b48c1cb044723
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Jun 20 20:51:07 2011 +0100
ByteString->rtl::OString
diff --git a/sfx2/inc/sfx2/bindings.hxx b/sfx2/inc/sfx2/bindings.hxx
index 50e45cc..9a40285 100644
--- a/sfx2/inc/sfx2/bindings.hxx
+++ b/sfx2/inc/sfx2/bindings.hxx
@@ -31,6 +31,7 @@
#include "sal/config.h"
#include "sfx2/dllapi.h"
#include "sal/types.h"
+#include "rtl/strbuf.hxx"
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/uno/Reference.h>
@@ -216,15 +217,15 @@ public:
#ifdef DBG_UTIL
#define ENTERREGISTRATIONS() EnterRegistrations(__FILE__, __LINE__)
#define LEAVEREGISTRATIONS() LeaveRegistrations(USHRT_MAX, __FILE__, __LINE__)
-#define DENTERREGISTRATIONS( ) \
- EnterRegistrations( (ByteString(__FILE__).Append('(').Append(ByteString::CreateFromInt64((sal_uIntPtr)this).Append(')'))).GetBufferAccess(), __LINE__ )
+#define DENTERREGISTRATIONS() \
+ EnterRegistrations( rtl::OStringBuffer(__FILE__).append('(').append(reinterpret_cast<sal_Int64>(this)).append(')').getStr(), __LINE__ )
#define DLEAVEREGISTRATIONS( ) \
- LeaveRegistrations( USHRT_MAX, (ByteString(__FILE__).Append('(').Append(ByteString::CreateFromInt64((sal_uIntPtr)this).Append(')'))).GetBufferAccess(), __LINE__ )
+ LeaveRegistrations( USHRT_MAX, rtl::OStringBuffer(__FILE__).append('(').append(reinterpret_cast<sal_Int64>(this)).append(')').getStr(), __LINE__ )
#else
#define ENTERREGISTRATIONS() EnterRegistrations()
#define LEAVEREGISTRATIONS() LeaveRegistrations()
-#define DENTERREGISTRATIONS( ) EnterRegistrations()
-#define DLEAVEREGISTRATIONS( ) LeaveRegistrations()
+#define DENTERREGISTRATIONS() EnterRegistrations()
+#define DLEAVEREGISTRATIONS() LeaveRegistrations()
#endif
//--------------------------------------------------------------------
diff --git a/sfx2/inc/sfx2/childwin.hxx b/sfx2/inc/sfx2/childwin.hxx
index 509a7c2..f50a5c0 100644
--- a/sfx2/inc/sfx2/childwin.hxx
+++ b/sfx2/inc/sfx2/childwin.hxx
@@ -67,7 +67,7 @@ struct SfxChildWinInfo
Size aSize;
sal_uInt16 nFlags;
String aExtraString;
- ByteString aWinState;
+ rtl::OString aWinState;
SfxChildWinInfo()
{
diff --git a/sfx2/inc/srchdlg.hxx b/sfx2/inc/srchdlg.hxx
index aa8b7cd..2e0f6a1 100644
--- a/sfx2/inc/srchdlg.hxx
+++ b/sfx2/inc/srchdlg.hxx
@@ -59,7 +59,7 @@ private:
String m_sToggleText;
::rtl::OUString m_sConfigName;
- ByteString m_sWinState;
+ ::rtl::OString m_sWinState;
bool m_bIsConstructed;
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index 38dd30d..894505f 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -305,7 +305,7 @@ void SfxChildWindow::SaveStatus(const SfxChildWinInfo& rInfo)
}
SvtViewOptions aWinOpt( E_WINDOW, String::CreateFromInt32( nID ) );
- aWinOpt.SetWindowState( String( rInfo.aWinState, RTL_TEXTENCODING_UTF8 ) );
+ aWinOpt.SetWindowState(rtl::OStringToOUString(rInfo.aWinState, RTL_TEXTENCODING_UTF8));
::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq(1);
aSeq[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Data") );
@@ -386,7 +386,7 @@ void SfxChildWindow::InitializeChildWinFactory_Impl( sal_uInt16 nId, SfxChildWin
aSeq[0].Value >>= aTmp;
String aWinData( aTmp );
- rInfo.aWinState = ByteString( String(aWinOpt.GetWindowState()), RTL_TEXTENCODING_UTF8 );
+ rInfo.aWinState = rtl::OUStringToOString(aWinOpt.GetWindowState(), RTL_TEXTENCODING_UTF8);
if ( aWinData.Len() )
diff --git a/sfx2/source/dialog/srchdlg.cxx b/sfx2/source/dialog/srchdlg.cxx
index 6d915a7..8987094 100644
--- a/sfx2/source/dialog/srchdlg.cxx
+++ b/sfx2/source/dialog/srchdlg.cxx
@@ -93,7 +93,7 @@ void SearchDialog::LoadConfig()
SvtViewOptions aViewOpt( E_DIALOG, m_sConfigName );
if ( aViewOpt.Exists() )
{
- m_sWinState = ByteString( aViewOpt.GetWindowState().getStr(), RTL_TEXTENCODING_ASCII_US );
+ m_sWinState = rtl::OUStringToOString(aViewOpt.GetWindowState(), RTL_TEXTENCODING_ASCII_US);
Any aUserItem = aViewOpt.GetUserItem( USERITEM_NAME );
::rtl::OUString aTemp;
if ( aUserItem >>= aTemp )
@@ -120,7 +120,7 @@ void SearchDialog::LoadConfig()
void SearchDialog::SaveConfig()
{
SvtViewOptions aViewOpt( E_DIALOG, m_sConfigName );
- aViewOpt.SetWindowState( rtl::OUString::createFromAscii( m_sWinState.GetBuffer() ) );
+ aViewOpt.SetWindowState(rtl::OStringToOUString(m_sWinState, RTL_TEXTENCODING_ASCII_US));
String sUserData;
sal_uInt16 i = 0, nCount = Min( m_aSearchEdit.GetEntryCount(), MAX_SAVE_COUNT );
for ( ; i < nCount; ++i )
@@ -180,7 +180,7 @@ void SearchDialog::StateChanged( StateChangedType nStateChange )
{
if ( nStateChange == STATE_CHANGE_INITSHOW )
{
- if ( m_sWinState.Len() )
+ if (!m_sWinState.isEmpty())
SetWindowState( m_sWinState );
m_bIsConstructed = sal_True;
}
More information about the Libreoffice-commits
mailing list