Tag: cws_src680_oj14 User: oj Date: 2006/07/04 01:00:31 Modified: dba/dbaccess/source/ui/dlg/paramdialog.cxx
Log: RESYNC: (1.11-1.14); FILE MERGED File Changes: Directory: /dba/dbaccess/source/ui/dlg/ ======================================= File [changed]: paramdialog.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/dlg/paramdialog.cxx?r1=1.11.4.3&r2=1.11.4.4 Delta lines: +27 -34 --------------------- --- paramdialog.cxx 25 Apr 2006 13:03:01 -0000 1.11.4.3 +++ paramdialog.cxx 4 Jul 2006 08:00:28 -0000 1.11.4.4 @@ -45,6 +45,9 @@ #ifndef _DBAUI_COMMON_TYPES_HXX_ #include "commontypes.hxx" #endif +#ifndef _DBAUI_MODULE_DBU_HXX_ +#include "moduledbu.hxx" +#endif #ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATTER_HPP_ #include <com/sun/star/util/XNumberFormatter.hpp> #endif @@ -66,9 +69,6 @@ #ifndef _TOOLS_DEBUG_HXX #include <tools/debug.hxx> #endif -#ifndef _ISOLANG_HXX -#include <tools/isolang.hxx> -#endif #ifndef _DBAUI_LOCALRESACCESS_HXX_ #include "localresaccess.hxx" #endif @@ -107,9 +107,9 @@ ,m_aOKBtn (this, ResId(BT_OK)) \ ,m_aCancelBtn (this, ResId(BT_CANCEL)) \ ,m_nCurrentlySelected(LISTBOX_ENTRY_NOTFOUND) \ - ,m_bNeedErrorOnCurrent(sal_True) \ ,m_xConnection(_rxConnection) \ ,m_aPredicateInput( _rxORB, _rxConnection, getParseContext() ) \ + ,m_bNeedErrorOnCurrent(sal_True) \ //------------------------------------------------------------------------------ @@ -128,8 +128,6 @@ else DBG_ERROR("OParameterDialog::OParameterDialog: need a service factory!"); - m_pVisitedParams = (void*)new ByteVector; - Reference< XNumberFormatsSupplier > xNumberFormats = ::dbtools::getNumberFormats(m_xConnection, sal_True); if (!xNumberFormats.is()) ::comphelper::disposeComponent(m_xFormatter); @@ -158,7 +156,7 @@ pValues->Value = makeAny(::rtl::OUString()); // default the values to an empty string - ((ByteVector*)m_pVisitedParams)->push_back(0); + m_aVisitedParams.push_back(0); // not visited, not dirty } @@ -183,8 +181,6 @@ if (m_aResetVisitFlag.IsActive()) m_aResetVisitFlag.Stop(); - delete (ByteVector*)m_pVisitedParams; - DBG_DTOR(OParameterDialog,NULL); } @@ -219,17 +215,15 @@ } //------------------------------------------------------------------------------ - IMPL_LINK(OParameterDialog, OnValueLoseFocus, Control*, pSource) + IMPL_LINK(OParameterDialog, OnValueLoseFocus, Control*, /*pSource*/) { if (m_nCurrentlySelected != LISTBOX_ENTRY_NOTFOUND) { - if (((*(ByteVector*)m_pVisitedParams)[m_nCurrentlySelected] & EF_DIRTY) == 0) + if ( ( m_aVisitedParams[ m_nCurrentlySelected ] & EF_DIRTY ) == 0 ) // nothing to do, the value isn't dirty return 0L; } - DBG_ASSERT(pSource == &m_aParam, "OParameterDialog::OnValueLoseFocus : invalid source !"); - // transform the current string according to the param field type ::rtl::OUString sTransformedText(m_aParam.GetText()); Reference< XPropertySet > xParamAsSet; @@ -245,7 +239,7 @@ { // with this the value isn't dirty anymore if (m_nCurrentlySelected != LISTBOX_ENTRY_NOTFOUND) - (*(ByteVector*)m_pVisitedParams)[m_nCurrentlySelected] &= ~EF_DIRTY; + m_aVisitedParams[m_nCurrentlySelected] &= ~EF_DIRTY; } else { @@ -265,7 +259,7 @@ String sMessage; { - OLocalResourceAccess aDummy(DLG_PARAMETERS, RSC_MODALDIALOG); + LocalResourceAccess aDummy(DLG_PARAMETERS, RSC_MODALDIALOG); sMessage = String(ResId(STR_COULD_NOT_CONVERT_PARAM)); } sMessage.SearchAndReplaceAll(String::CreateFromAscii("$name$"), sName.getStr()); @@ -307,7 +301,6 @@ // write the parameters try { - String sValue; ::rtl::OUString sError; PropertyValue* pValues = m_aFinalValues.getArray(); for (sal_Int32 i = 0, nCount = m_xParams->getCount(); i<nCount; ++i, ++pValues) @@ -333,14 +326,14 @@ { sal_uInt16 nCurrent = m_aAllParams.GetSelectEntryPos(); sal_uInt16 nCount = m_aAllParams.GetEntryCount(); - DBG_ASSERT(nCount == ((ByteVector*)m_pVisitedParams)->size(), "OParameterDialog::OnButtonClicked : inconsistent lists !"); + DBG_ASSERT(nCount == m_aVisitedParams.size(), "OParameterDialog::OnButtonClicked : inconsistent lists !"); // search the next entry in list we haven't visited yet sal_uInt16 nNext = (nCurrent + 1) % nCount; - while ((nNext != nCurrent) && ( (*((ByteVector*)m_pVisitedParams))[nNext] & EF_VISITED )) + while ((nNext != nCurrent) && ( m_aVisitedParams[nNext] & EF_VISITED )) nNext = (nNext + 1) % nCount; - if ( (*((ByteVector*)m_pVisitedParams))[nNext] & EF_VISITED ) + if ( m_aVisitedParams[nNext] & EF_VISITED ) // there is no such "not visited yet" entry -> simpy take the next one nNext = (nCurrent + 1) % nCount; @@ -356,7 +349,7 @@ } //------------------------------------------------------------------------------ - IMPL_LINK(OParameterDialog, OnEntrySelected, ListBox*, pList) + IMPL_LINK(OParameterDialog, OnEntrySelected, ListBox*, /*pList*/) { if (m_aResetVisitFlag.IsActive()) { @@ -384,8 +377,8 @@ m_nCurrentlySelected = nSelected; // with this the value isn't dirty - DBG_ASSERT(m_nCurrentlySelected < ((ByteVector*)m_pVisitedParams)->size(), "OParameterDialog::OnEntrySelected : invalid current entry !"); - (*(ByteVector*)m_pVisitedParams)[m_nCurrentlySelected] &= ~EF_DIRTY; + DBG_ASSERT(m_nCurrentlySelected < m_aVisitedParams.size(), "OParameterDialog::OnEntrySelected : invalid current entry !"); + m_aVisitedParams[m_nCurrentlySelected] &= ~EF_DIRTY; m_aResetVisitFlag.SetTimeout(1000); m_aResetVisitFlag.Start(); @@ -394,25 +387,25 @@ } //------------------------------------------------------------------------------ - IMPL_LINK(OParameterDialog, OnVisitedTimeout, Timer*, pTimer) + IMPL_LINK(OParameterDialog, OnVisitedTimeout, Timer*, /*pTimer*/) { DBG_ASSERT(m_nCurrentlySelected != LISTBOX_ENTRY_NOTFOUND, "OParameterDialog::OnVisitedTimeout : invalid call !"); // mark the currently selected entry as visited - DBG_ASSERT(m_nCurrentlySelected < ((ByteVector*)m_pVisitedParams)->size(), "OParameterDialog::OnVisitedTimeout : invalid entry !"); - (*(ByteVector*)m_pVisitedParams)[m_nCurrentlySelected] |= EF_VISITED; + DBG_ASSERT(m_nCurrentlySelected < m_aVisitedParams.size(), "OParameterDialog::OnVisitedTimeout : invalid entry !"); + m_aVisitedParams[m_nCurrentlySelected] |= EF_VISITED; // was it the last "not visited yet" entry ? ConstByteVectorIterator aIter; - for ( aIter = ((ByteVector*)m_pVisitedParams)->begin(); - aIter < ((ByteVector*)m_pVisitedParams)->end(); + for ( aIter = m_aVisitedParams.begin(); + aIter < m_aVisitedParams.end(); ++aIter ) { if (((*aIter) & EF_VISITED) == 0) break; } - if (aIter == ((ByteVector*)m_pVisitedParams)->end()) + if (aIter == m_aVisitedParams.end()) { // yes, there isn't another one -> change the "default button" m_aTravelNext.SetStyle(m_aTravelNext.GetStyle() & ~WB_DEFBUTTON); m_aOKBtn.SetStyle(m_aOKBtn.GetStyle() | WB_DEFBUTTON); @@ -443,11 +436,11 @@ } //------------------------------------------------------------------------------ - IMPL_LINK(OParameterDialog, OnValueModified, Control*, pBox) + IMPL_LINK(OParameterDialog, OnValueModified, Control*, /*pBox*/) { // mark the currently selected entry as dirty - DBG_ASSERT(m_nCurrentlySelected < ((ByteVector*)m_pVisitedParams)->size(), "OParameterDialog::OnValueModified : invalid entry !"); - (*(ByteVector*)m_pVisitedParams)[m_nCurrentlySelected] |= EF_DIRTY; + DBG_ASSERT(m_nCurrentlySelected < m_aVisitedParams.size(), "OParameterDialog::OnValueModified : invalid entry !"); + m_aVisitedParams[m_nCurrentlySelected] |= EF_DIRTY; m_bNeedErrorOnCurrent = sal_True; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
