diff options
author | Eike Rathke <erack@redhat.com> | 2014-03-01 03:13:28 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2014-03-05 07:31:19 -0600 |
commit | 68ec95b3f80408ae50897b043eed69a07d084df9 (patch) | |
tree | 5d32076e843fae44f28e3c8d9dbbacf7648fecbc /sw/source | |
parent | c3403ac888c2e62edaf8befe7982f5f8cc95c16f (diff) |
made ListBox handle more than 64k elements, fdo#61520 related
ListBox and related now handle up to sal_Int32 elements correctly.
sal_Int32 instead of sal_Size or size_t because of UNO and a11y API.
Also disentangled some of the mess of SvTreeList and other containers
regarding sal_uInt16, sal_uLong, long, size_t, ... type mixtures.
Change-Id: Idb6e0ae689dc5bc2cf980721972b57b0261e688a
Reviewed-on: https://gerrit.libreoffice.org/8460
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sw/source')
36 files changed, 316 insertions, 304 deletions
diff --git a/sw/source/core/edit/edglbldc.cxx b/sw/source/core/edit/edglbldc.cxx index b7490b72f0ac..ee85aec3e7b4 100644 --- a/sw/source/core/edit/edglbldc.cxx +++ b/sw/source/core/edit/edglbldc.cxx @@ -238,7 +238,7 @@ sal_Bool SwEditShell::InsertGlobalDocContent( const SwGlblDocContent& rInsPos ) } sal_Bool SwEditShell::DeleteGlobalDocContent( const SwGlblDocContents& rArr , - sal_uInt16 nDelPos ) + size_t nDelPos ) { if( !getIDocumentSettingAccess()->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) ) return sal_False; @@ -303,8 +303,8 @@ sal_Bool SwEditShell::DeleteGlobalDocContent( const SwGlblDocContents& rArr , } sal_Bool SwEditShell::MoveGlobalDocContent( const SwGlblDocContents& rArr , - sal_uInt16 nFromPos, sal_uInt16 nToPos, - sal_uInt16 nInsPos ) + size_t nFromPos, size_t nToPos, + size_t nInsPos ) { if( !getIDocumentSettingAccess()->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) || nFromPos >= rArr.size() || nToPos > rArr.size() || diff --git a/sw/source/ui/cctrl/swlbox.cxx b/sw/source/ui/cctrl/swlbox.cxx index 66092eab9da5..384fca4f5fc0 100644 --- a/sw/source/ui/cctrl/swlbox.cxx +++ b/sw/source/ui/cctrl/swlbox.cxx @@ -26,11 +26,11 @@ SwBoxEntry::SwBoxEntry() : bModified(sal_False), bNew(sal_False), - nId(LISTBOX_APPEND) + nId(COMBOBOX_APPEND) { } -SwBoxEntry::SwBoxEntry(const OUString& aNam, sal_uInt16 nIdx) : +SwBoxEntry::SwBoxEntry(const OUString& aNam, sal_Int32 nIdx) : bModified(sal_False), bNew(sal_False), aName(aNam), @@ -55,8 +55,8 @@ SwComboBox::SwComboBox(Window* pParent, WinBits nStyle) void SwComboBox::Init() { // create administration for the resource's Stringlist - sal_uInt16 nSize = GetEntryCount(); - for( sal_uInt16 i=0; i < nSize; ++i ) + sal_Int32 nSize = GetEntryCount(); + for( sal_Int32 i=0; i < nSize; ++i ) { SwBoxEntry* pTmp = new SwBoxEntry(ComboBox::GetEntry(i), i); aEntryLst.push_back(pTmp); @@ -73,15 +73,15 @@ void SwComboBox::InsertSwEntry(const SwBoxEntry& rEntry) InsertSorted(new SwBoxEntry(rEntry)); } -sal_uInt16 SwComboBox::InsertEntry(const OUString& rStr, sal_uInt16) +sal_Int32 SwComboBox::InsertEntry(const OUString& rStr, sal_Int32) { InsertSwEntry(SwBoxEntry(rStr)); return 0; } -void SwComboBox::RemoveEntryAt(sal_uInt16 const nPos) +void SwComboBox::RemoveEntryAt(sal_Int32 const nPos) { - if(nPos >= aEntryLst.size()) + if(nPos < 0 || static_cast<size_t>(nPos) >= aEntryLst.size()) return; // Remove old element @@ -101,27 +101,27 @@ void SwComboBox::RemoveEntryAt(sal_uInt16 const nPos) } } -sal_uInt16 SwComboBox::GetSwEntryPos(const SwBoxEntry& rEntry) const +sal_Int32 SwComboBox::GetSwEntryPos(const SwBoxEntry& rEntry) const { return ComboBox::GetEntryPos(rEntry.aName); } -const SwBoxEntry& SwComboBox::GetSwEntry(sal_uInt16 const nPos) const +const SwBoxEntry& SwComboBox::GetSwEntry(sal_Int32 const nPos) const { - if(nPos < aEntryLst.size()) + if(0 <= nPos && static_cast<size_t>(nPos) < aEntryLst.size()) return aEntryLst[nPos]; return aDefault; } -sal_uInt16 SwComboBox::GetRemovedCount() const +sal_Int32 SwComboBox::GetRemovedCount() const { - return aDelEntryLst.size(); + return static_cast<sal_Int32>(aDelEntryLst.size()); } -const SwBoxEntry& SwComboBox::GetRemovedEntry(sal_uInt16 nPos) const +const SwBoxEntry& SwComboBox::GetRemovedEntry(sal_Int32 nPos) const { - if(nPos < aDelEntryLst.size()) + if(0 <= nPos && static_cast<size_t>(nPos) < aDelEntryLst.size()) return aDelEntryLst[nPos]; return aDefault; @@ -130,7 +130,7 @@ const SwBoxEntry& SwComboBox::GetRemovedEntry(sal_uInt16 nPos) const void SwComboBox::InsertSorted(SwBoxEntry* pEntry) { ComboBox::InsertEntry(pEntry->aName); - sal_uInt16 nPos = ComboBox::GetEntryPos(pEntry->aName); + sal_Int32 nPos = ComboBox::GetEntryPos(pEntry->aName); aEntryLst.insert( aEntryLst.begin() + nPos, pEntry ); } diff --git a/sw/source/ui/chrdlg/break.cxx b/sw/source/ui/chrdlg/break.cxx index 19a77d549dd0..7ba9dd1ca1c0 100644 --- a/sw/source/ui/chrdlg/break.cxx +++ b/sw/source/ui/chrdlg/break.cxx @@ -45,7 +45,7 @@ void SwBreakDlg::Apply() else if(m_pPageBtn->IsChecked()) { nKind = 3; - const sal_uInt16 nPos = m_pPageCollBox->GetSelectEntryPos(); + const sal_Int32 nPos = m_pPageCollBox->GetSelectEntryPos(); if(0 != nPos && LISTBOX_ENTRY_NOTFOUND != nPos) { aTemplate = m_pPageCollBox->GetSelectEntry(); @@ -99,7 +99,7 @@ IMPL_LINK_NOARG(SwBreakDlg, OkHdl) { if(m_pPageNumBox->IsChecked()) { // In case of differing page descriptions, test validity - const sal_uInt16 nPos = m_pPageCollBox->GetSelectEntryPos(); + const sal_Int32 nPos = m_pPageCollBox->GetSelectEntryPos(); // position 0 says 'Without'. const SwPageDesc *pPageDesc; if ( 0 != nPos && LISTBOX_ENTRY_NOTFOUND != nPos ) @@ -203,7 +203,7 @@ void SwBreakDlg::CheckEnable() if ( bEnable ) { // position 0 says 'Without' page template. - const sal_uInt16 nPos = m_pPageCollBox->GetSelectEntryPos(); + const sal_Int32 nPos = m_pPageCollBox->GetSelectEntryPos(); if ( 0 == nPos || LISTBOX_ENTRY_NOTFOUND == nPos ) bEnable = sal_False; } diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx index 838fe3c8825c..4abd35c76d8c 100644 --- a/sw/source/ui/config/optload.cxx +++ b/sw/source/ui/config/optload.cxx @@ -84,7 +84,7 @@ SwLoadOptPage::SwLoadOptPage(Window* pParent, const SfxItemSet& rSet) get(m_pWordCountED, "wordcount"); SvxStringArray aMetricArr( SW_RES( STR_ARR_METRIC ) ); - for ( sal_uInt16 i = 0; i < aMetricArr.Count(); ++i ) + for ( sal_uInt32 i = 0; i < aMetricArr.Count(); ++i ) { OUString sMetric = aMetricArr.GetStringByPos( i ); FieldUnit eFUnit = (FieldUnit)aMetricArr.GetValue( i ); @@ -98,7 +98,7 @@ SwLoadOptPage::SwLoadOptPage(Window* pParent, const SfxItemSet& rSet) case FUNIT_INCH: { // use only these metrics - sal_uInt16 nPos = m_pMetricLB->InsertEntry( sMetric ); + sal_Int32 nPos = m_pMetricLB->InsertEntry( sMetric ); m_pMetricLB->SetEntryData( nPos, (void*)(sal_IntPtr)eFUnit ); } default:; //prevent warning @@ -165,7 +165,7 @@ sal_Bool SwLoadOptPage::FillItemSet( SfxItemSet& rSet ) bRet = sal_True; } - const sal_uInt16 nMPos = m_pMetricLB->GetSelectEntryPos(); + const sal_Int32 nMPos = m_pMetricLB->GetSelectEntryPos(); if ( nMPos != m_pMetricLB->GetSavedValue() ) { // Double-Cast for VA3.0 @@ -253,7 +253,7 @@ void SwLoadOptPage::Reset( const SfxItemSet& rSet) const SfxUInt16Item& rItem = (SfxUInt16Item&)rSet.Get( SID_ATTR_METRIC ); FieldUnit eFieldUnit = (FieldUnit)rItem.GetValue(); - for ( sal_uInt16 i = 0; i < m_pMetricLB->GetEntryCount(); ++i ) + for ( sal_Int32 i = 0; i < m_pMetricLB->GetEntryCount(); ++i ) { if ( (int)(sal_IntPtr)m_pMetricLB->GetEntryData( i ) == (int)eFieldUnit ) { @@ -296,8 +296,8 @@ void SwLoadOptPage::Reset( const SfxItemSet& rSet) IMPL_LINK_NOARG(SwLoadOptPage, MetricHdl) { - const sal_uInt16 nMPos = m_pMetricLB->GetSelectEntryPos(); - if(nMPos != USHRT_MAX) + const sal_Int32 nMPos = m_pMetricLB->GetSelectEntryPos(); + if(nMPos != LISTBOX_ENTRY_NOTFOUND) { // Double-Cast for VA3.0 FieldUnit eFieldUnit = (FieldUnit)(sal_IntPtr)m_pMetricLB->GetEntryData( nMPos ); @@ -510,7 +510,7 @@ sal_Bool SwCaptionOptPage::FillItemSet( SfxItemSet& ) pEntry = m_pCheckLB->Next(pEntry); } - sal_uInt16 nCheckCount = m_pCheckLB->GetCheckedEntryCount(); + sal_uLong nCheckCount = m_pCheckLB->GetCheckedEntryCount(); pModOpt->SetInsWithCaption( bHTMLMode, nCheckCount > 0 ); sal_Int32 nPos = m_pLbCaptionOrder->GetSelectEntryPos(); @@ -531,7 +531,7 @@ void SwCaptionOptPage::Reset( const SfxItemSet& rSet) m_pCheckLB->GetModel()->Clear(); // remove all entries // Writer objects - sal_uInt16 nPos = 0; + sal_uLong nPos = 0; m_pCheckLB->InsertEntry(m_sSWTable); SetOptions(nPos++, TABLE_CAP); m_pCheckLB->InsertEntry(m_sSWFrame); @@ -567,7 +567,7 @@ void SwCaptionOptPage::Reset( const SfxItemSet& rSet) ModifyHdl(); } -void SwCaptionOptPage::SetOptions(const sal_uInt16 nPos, +void SwCaptionOptPage::SetOptions(const sal_uLong nPos, const SwCapObjType eObjType, const SvGlobalName *pOleId) { SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig(); @@ -600,7 +600,7 @@ IMPL_LINK_NOARG(SwCaptionOptPage, ShowEntryHdl) if (pSelEntry) { - sal_Bool bChecked = m_pCheckLB->IsChecked((sal_uInt16)m_pCheckLB->GetModel()->GetAbsPos(pSelEntry)); + sal_Bool bChecked = m_pCheckLB->IsChecked(m_pCheckLB->GetModel()->GetAbsPos(pSelEntry)); m_pSettingsGroup->Enable(bChecked); bool bNumSep = bChecked && m_pLbCaptionOrder->GetSelectEntryPos() == 1; @@ -646,7 +646,7 @@ IMPL_LINK_NOARG(SwCaptionOptPage, ShowEntryHdl) m_pCategoryBox->InsertEntry(pOpt->GetCategory()); if (m_pCategoryBox->GetText().isEmpty()) { - sal_uInt16 nPos = 0; + sal_Int32 nPos = 0; switch(pOpt->GetObjType()) { case OLE_CAP: @@ -657,7 +657,7 @@ IMPL_LINK_NOARG(SwCaptionOptPage, ShowEntryHdl) m_pCategoryBox->SetText(m_pCategoryBox->GetSwEntry(nPos).GetName()); } - for (sal_uInt16 i = 0; i < m_pFormatBox->GetEntryCount(); i++) + for (sal_Int32 i = 0; i < m_pFormatBox->GetEntryCount(); i++) { if (pOpt->GetNumType() == (sal_uInt16)(sal_uLong)m_pFormatBox->GetEntryData(i)) { @@ -687,7 +687,7 @@ IMPL_LINK_NOARG(SwCaptionOptPage, ShowEntryHdl) m_pPosBox->IsEnabled() ); m_pPosBox->SelectEntryPos(pOpt->GetPos()); - sal_uInt16 nLevelPos = ( pOpt->GetLevel() < MAXLEVEL ) ? pOpt->GetLevel() + 1 : 0; + sal_Int32 nLevelPos = ( pOpt->GetLevel() < MAXLEVEL ) ? pOpt->GetLevel() + 1 : 0; m_pLbLevel->SelectEntryPos( nLevelPos ); m_pEdDelim->SetText(pOpt->GetSeparator()); m_pNumberingSeparatorED->SetText( pOpt->GetNumSeparator() ); @@ -721,7 +721,7 @@ void SwCaptionOptPage::SaveEntry(SvTreeListEntry* pEntry) { InsCaptionOpt* pOpt = (InsCaptionOpt*)pEntry->GetUserData(); - pOpt->UseCaption() = m_pCheckLB->IsChecked((sal_uInt16)m_pCheckLB->GetModel()->GetAbsPos(pEntry)); + pOpt->UseCaption() = m_pCheckLB->IsChecked(m_pCheckLB->GetModel()->GetAbsPos(pEntry)); OUString aName( m_pCategoryBox->GetText() ); if (aName == m_sNone) pOpt->SetCategory(aEmptyOUStr); @@ -730,8 +730,8 @@ void SwCaptionOptPage::SaveEntry(SvTreeListEntry* pEntry) pOpt->SetNumType((sal_uInt16)(sal_uLong)m_pFormatBox->GetEntryData(m_pFormatBox->GetSelectEntryPos())); pOpt->SetCaption(m_pTextEdit->IsEnabled() ? m_pTextEdit->GetText() : OUString(aEmptyOUStr) ); pOpt->SetPos(m_pPosBox->GetSelectEntryPos()); - sal_uInt16 nPos = m_pLbLevel->GetSelectEntryPos(); - sal_uInt16 nLevel = ( nPos > 0 && nPos != LISTBOX_ENTRY_NOTFOUND ) ? nPos - 1 : MAXLEVEL; + sal_Int32 nPos = m_pLbLevel->GetSelectEntryPos(); + sal_Int32 nLevel = ( nPos > 0 && nPos != LISTBOX_ENTRY_NOTFOUND ) ? nPos - 1 : MAXLEVEL; pOpt->SetLevel(nLevel); pOpt->SetSeparator(m_pEdDelim->GetText()); pOpt->SetNumSeparator( m_pNumberingSeparatorED->GetText()); @@ -777,7 +777,7 @@ IMPL_LINK( SwCaptionOptPage, OrderHdl, ListBox*, pBox ) sal_Bool bChecked = sal_False; if (pSelEntry) { - bChecked = m_pCheckLB->IsChecked((sal_uInt16)m_pCheckLB->GetModel()->GetAbsPos(pSelEntry)); + bChecked = m_pCheckLB->IsChecked(m_pCheckLB->GetModel()->GetAbsPos(pSelEntry)); } sal_Int32 nPos = pBox->GetSelectEntryPos(); diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index cd88ff2ed640..5cf73bcf924f 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -118,7 +118,7 @@ SwContentOptPage::SwContentOptPage( Window* pParent, m_pAnyRulerCB->SetClickHdl(LINK(this, SwContentOptPage, AnyRulerHdl)); SvxStringArray aMetricArr( SW_RES( STR_ARR_METRIC ) ); - for ( sal_uInt16 i = 0; i < aMetricArr.Count(); ++i ) + for ( size_t i = 0; i < aMetricArr.Count(); ++i ) { OUString sMetric = aMetricArr.GetStringByPos( i ); FieldUnit eFUnit = (FieldUnit)aMetricArr.GetValue( i ); @@ -138,7 +138,7 @@ SwContentOptPage::SwContentOptPage( Window* pParent, // there isn't 'line' unit in HTML format if ( eFUnit != FUNIT_LINE ) { - sal_uInt16 nPos = m_pMetricLB->InsertEntry( sMetric ); + sal_Int32 nPos = m_pMetricLB->InsertEntry( sMetric ); m_pMetricLB->SetEntryData( nPos, (void*)(sal_IntPtr)eFUnit ); m_pHMetric->InsertEntry( sMetric ); m_pHMetric->SetEntryData( nPos, (void*)(sal_IntPtr)eFUnit ); @@ -146,7 +146,7 @@ SwContentOptPage::SwContentOptPage( Window* pParent, // a vertical ruler has not the 'character' unit if ( eFUnit != FUNIT_CHAR ) { - sal_uInt16 nPos = m_pVMetric->InsertEntry( sMetric ); + sal_Int32 nPos = m_pVMetric->InsertEntry( sMetric ); m_pVMetric->SetEntryData( nPos, (void*)(sal_IntPtr)eFUnit ); } } @@ -171,7 +171,7 @@ static void lcl_SelectMetricLB(ListBox* rMetric, sal_uInt16 nSID, const SfxItemS if( rSet.GetItemState( nSID, false, &pItem ) >= SFX_ITEM_AVAILABLE ) { FieldUnit eFieldUnit = (FieldUnit)((SfxUInt16Item*)pItem)->GetValue(); - for ( sal_uInt16 i = 0; i < rMetric->GetEntryCount(); ++i ) + for ( sal_Int32 i = 0; i < rMetric->GetEntryCount(); ++i ) { if ( (int)(sal_IntPtr)rMetric->GetEntryData( i ) == (int)eFieldUnit ) { @@ -238,8 +238,8 @@ sal_Bool SwContentOptPage::FillItemSet(SfxItemSet& rSet) if(bRet) bRet = 0 != rSet.Put(aElem); - sal_uInt16 nMPos = m_pMetricLB->GetSelectEntryPos(); - sal_uInt16 nGlobalMetricPos = nMPos; + sal_Int32 nMPos = m_pMetricLB->GetSelectEntryPos(); + sal_Int32 nGlobalMetricPos = nMPos; if ( nMPos != m_pMetricLB->GetSavedValue() ) { // Double-Cast for VA3.0 @@ -1695,7 +1695,7 @@ SwRedlineOptionsTabPage::SwRedlineOptionsTabPage( Window* pParent, sAuthor = get<Window>("byauthor")->GetText(); - for (sal_uInt16 i = 0; i < pInsertLB->GetEntryCount(); ++i) + for (sal_Int32 i = 0; i < pInsertLB->GetEntryCount(); ++i) { OUString sEntry(pInsertLB->GetEntry(i)); pDeletedLB->InsertEntry(sEntry); @@ -1755,7 +1755,7 @@ sal_Bool SwRedlineOptionsTabPage::FillItemSet( SfxItemSet& ) ColorData nOldMarkColor = pOpt->GetMarkAlignColor().GetColor(); sal_uInt16 nOldMarkMode = pOpt->GetMarkAlignMode(); - sal_uInt16 nPos = pInsertLB->GetSelectEntryPos(); + sal_Int32 nPos = pInsertLB->GetSelectEntryPos(); if (nPos != LISTBOX_ENTRY_NOTFOUND) { pAttr = (CharAttr *)pInsertLB->GetEntryData(nPos); @@ -1893,8 +1893,7 @@ void SwRedlineOptionsTabPage::Reset( const SfxItemSet& ) pChangedColorLB->InsertEntry(sAuthor); XColorListRef pColorLst = XColorList::GetStdColorList(); - sal_uInt16 i; - for( i = 0; i < pColorLst->Count(); ++i ) + for( sal_Int32 i = 0; i < pColorLst->Count(); ++i ) { XColorEntry* pEntry = pColorLst->GetColor( i ); Color aColor = pEntry->GetColor(); @@ -1965,7 +1964,7 @@ void SwRedlineOptionsTabPage::Reset( const SfxItemSet& ) lcl_FillRedlineAttrListBox(*pChangedLB, rChangedAttr, aChangedAttrMap, sizeof(aChangedAttrMap) / sizeof(sal_uInt16)); - sal_uInt16 nPos = 0; + sal_Int32 nPos = 0; switch (pOpt->GetMarkAlignMode()) { case text::HoriOrientation::NONE: nPos = 0; break; @@ -2022,7 +2021,7 @@ IMPL_LINK( SwRedlineOptionsTabPage, AttribHdl, ListBox *, pLB ) rFont.SetCaseMap(SVX_CASEMAP_NOT_MAPPED); rCJKFont.SetCaseMap(SVX_CASEMAP_NOT_MAPPED); - sal_uInt16 nPos = pColorLB->GetSelectEntryPos(); + sal_Int32 nPos = pColorLB->GetSelectEntryPos(); switch( nPos ) { @@ -2117,7 +2116,7 @@ IMPL_LINK( SwRedlineOptionsTabPage, ColorHdl, ColorListBox *, pColorLB ) SvxFont& rFont = pPrev->GetFont(); SvxFont& rCJKFont = pPrev->GetCJKFont(); - sal_uInt16 nPos = pLB->GetSelectEntryPos(); + sal_Int32 nPos = pLB->GetSelectEntryPos(); if( nPos == LISTBOX_ENTRY_NOTFOUND ) nPos = 0; diff --git a/sw/source/ui/dbui/customizeaddresslistdialog.cxx b/sw/source/ui/dbui/customizeaddresslistdialog.cxx index d2cd6285086b..5c3cb5211839 100644 --- a/sw/source/ui/dbui/customizeaddresslistdialog.cxx +++ b/sw/source/ui/dbui/customizeaddresslistdialog.cxx @@ -71,7 +71,7 @@ IMPL_LINK_NOARG(SwCustomizeAddressListDialog, ListBoxSelectHdl_Impl) IMPL_LINK(SwCustomizeAddressListDialog, AddRenameHdl_Impl, PushButton*, pButton) { bool bRename = pButton == m_pRenamePB; - sal_uInt16 nPos = m_pFieldsLB->GetSelectEntryPos(); + sal_Int32 nPos = m_pFieldsLB->GetSelectEntryPos(); if(nPos == LISTBOX_ENTRY_NOTFOUND) nPos = 0; @@ -117,7 +117,7 @@ IMPL_LINK(SwCustomizeAddressListDialog, AddRenameHdl_Impl, PushButton*, pButton) IMPL_LINK_NOARG(SwCustomizeAddressListDialog, DeleteHdl_Impl) { - sal_uInt16 nPos = m_pFieldsLB->GetSelectEntryPos(); + sal_Int32 nPos = m_pFieldsLB->GetSelectEntryPos(); m_pFieldsLB->RemoveEntry(m_pFieldsLB->GetSelectEntryPos()); m_pFieldsLB->SelectEntryPos(nPos > m_pFieldsLB->GetEntryCount() - 1 ? nPos - 1 : nPos); @@ -134,8 +134,8 @@ IMPL_LINK_NOARG(SwCustomizeAddressListDialog, DeleteHdl_Impl) IMPL_LINK(SwCustomizeAddressListDialog, UpDownHdl_Impl, PushButton*, pButton) { - sal_uInt16 nPos; - sal_uInt16 nOldPos = nPos = m_pFieldsLB->GetSelectEntryPos(); + sal_Int32 nPos; + sal_Int32 nOldPos = nPos = m_pFieldsLB->GetSelectEntryPos(); OUString aTemp = m_pFieldsLB->GetEntry(nPos); m_pFieldsLB->RemoveEntry( nPos ); if(pButton == m_pUpPB) @@ -162,8 +162,8 @@ IMPL_LINK(SwCustomizeAddressListDialog, UpDownHdl_Impl, PushButton*, pButton) void SwCustomizeAddressListDialog::UpdateButtons() { - sal_uInt16 nPos = m_pFieldsLB->GetSelectEntryPos(); - sal_uInt16 nEntries = m_pFieldsLB->GetEntryCount(); + sal_Int32 nPos = m_pFieldsLB->GetSelectEntryPos(); + sal_Int32 nEntries = m_pFieldsLB->GetEntryCount(); m_pUpPB->Enable(nPos > 0 && nEntries > 0); m_pDownPB->Enable(nPos < nEntries -1); m_pDeletePB->Enable(nEntries > 0); diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index 199e67ed6eb7..c7277626f8f2 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -481,7 +481,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblToFromHdl, Button*, pButton ) { bEnableTo = sal_False; - sal_uInt16 n, nInsPos = m_pLbTableCol->GetSelectEntryPos(), + sal_Int32 n, nInsPos = m_pLbTableCol->GetSelectEntryPos(), nCnt = m_pLbTblDbColumn->GetEntryCount(); if( LISTBOX_APPEND == nInsPos ) for( n = 0; n < nCnt; ++n ) @@ -497,7 +497,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblToFromHdl, Button*, pButton ) else if( pButton == m_pIbDbcolOneTo && LISTBOX_ENTRY_NOTFOUND != m_pLbTblDbColumn->GetSelectEntryPos() ) { - sal_uInt16 nInsPos = m_pLbTableCol->GetSelectEntryPos(), + sal_Int32 nInsPos = m_pLbTableCol->GetSelectEntryPos(), nDelPos = m_pLbTblDbColumn->GetSelectEntryPos(), nTopPos = m_pLbTblDbColumn->GetTopEntry(); m_pLbTableCol->InsertEntry( m_pLbTblDbColumn->GetEntry( nDelPos ), nInsPos ); @@ -515,7 +515,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblToFromHdl, Button*, pButton ) { if( LISTBOX_ENTRY_NOTFOUND != m_pLbTableCol->GetSelectEntryPos() ) { - sal_uInt16 nInsPos, + sal_Int32 nInsPos, nDelPos = m_pLbTableCol->GetSelectEntryPos(), nTopPos = m_pLbTableCol->GetTopEntry(); @@ -715,7 +715,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblFmtHdl, PushButton*, pButton ) { // Number of columns has changed: then the TabCols have to be adjusted long nWidth = pRep->GetWidth(); - sal_uInt16 nCols = m_pLbTableCol->GetEntryCount() - 1; + sal_Int32 nCols = m_pLbTableCol->GetEntryCount() - 1; SwTabCols aTabCols( nCols ); aTabCols.SetRight( nWidth ); aTabCols.SetRightMax( nWidth ); @@ -975,7 +975,8 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, { rSh.DoUndo( sal_False ); - sal_uInt16 n, nRows = 0, nCols = m_pLbTableCol->GetEntryCount(); + sal_Int32 nCols = m_pLbTableCol->GetEntryCount(); + sal_uInt16 nRows = 0; if( m_pCbTableHeadon->IsChecked() ) nRows++; @@ -986,7 +987,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, // prepare the array for the selected columns std::vector<SwInsDBColumn*> aColFlds; - for( n = 0; n < nCols; ++n ) + for( sal_Int32 n = 0; n < nCols; ++n ) { SwInsDBColumn aSrch( m_pLbTableCol->GetEntry( n ), 0 ); SwInsDBColumns::const_iterator it = aDBColumns.find( &aSrch ); @@ -997,10 +998,10 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, } } - if( nCols != aColFlds.size() ) + if( static_cast<size_t>(nCols) != aColFlds.size() ) { OSL_ENSURE( !this, "not all database columns found" ); - nCols = aColFlds.size(); + nCols = static_cast<sal_Int32>(aColFlds.size()); } if(!nRows || !nCols) @@ -1027,7 +1028,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, if( m_pCbTableHeadon->IsChecked() ) { - for( n = 0; n < nCols; ++n ) + for( sal_Int32 n = 0; n < nCols; ++n ) { if( m_pRbHeadlColnms->IsChecked() ) { @@ -1060,7 +1061,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, if(bBreak) break; - for( n = 0; n < nCols; ++n ) + for( sal_Int32 n = 0; n < nCols; ++n ) { // at the very first time, NO GoNextCell, because we're // already in it. Also no GoNextCell after the Insert, diff --git a/sw/source/ui/dbui/mmgreetingspage.cxx b/sw/source/ui/dbui/mmgreetingspage.cxx index 037da8c6e999..da9d8fa90e02 100644 --- a/sw/source/ui/dbui/mmgreetingspage.cxx +++ b/sw/source/ui/dbui/mmgreetingspage.cxx @@ -62,7 +62,7 @@ static void lcl_StoreGreetingsBox(ListBox& rBox, { Sequence< OUString> aEntries(rBox.GetEntryCount()); OUString* pEntries = aEntries.getArray(); - for(sal_uInt16 nEntry = 0; nEntry < rBox.GetEntryCount(); ++nEntry) + for(sal_Int32 nEntry = 0; nEntry < rBox.GetEntryCount(); ++nEntry) pEntries[nEntry] = rBox.GetEntry(nEntry); rConfig.SetGreetings(eType, aEntries); rConfig.SetCurrentGreeting(eType, rBox.GetSelectEntryPos()); @@ -74,7 +74,7 @@ static void lcl_StoreGreetingsBox(ComboBox& rBox, { Sequence< OUString> aEntries(rBox.GetEntryCount()); OUString* pEntries = aEntries.getArray(); - for(sal_uInt16 nEntry = 0; nEntry < rBox.GetEntryCount(); ++nEntry) + for(sal_Int32 nEntry = 0; nEntry < rBox.GetEntryCount(); ++nEntry) pEntries[nEntry] = rBox.GetEntry(nEntry); rConfig.SetGreetings(eType, aEntries); rConfig.SetCurrentGreeting(eType, rBox.GetSelectEntryPos()); @@ -364,10 +364,10 @@ sal_Bool SwMailMergeGreetingsPage::commitPage( ::svt::WizardTypes::CommitPage lcl_StoreGreetingsBox(m_aFemaleLB, rConfig, SwMailMergeConfigItem::FEMALE); lcl_StoreGreetingsBox(m_aMaleLB, rConfig, SwMailMergeConfigItem::MALE); - sal_uInt16 nCurrentTextPos = m_aNeutralCB.GetEntryPos( m_aNeutralCB.GetText() ); - if(LISTBOX_ENTRY_NOTFOUND == nCurrentTextPos) + sal_Int32 nCurrentTextPos = m_aNeutralCB.GetEntryPos( m_aNeutralCB.GetText() ); + if(COMBOBOX_ENTRY_NOTFOUND == nCurrentTextPos) { - sal_uInt16 nCount = m_aNeutralCB.GetEntryCount(); + sal_Int32 nCount = m_aNeutralCB.GetEntryCount(); m_aNeutralCB.InsertEntry( m_aNeutralCB.GetText(), nCount ); m_aNeutralCB.SelectEntryPos(nCount); } diff --git a/sw/source/ui/dochdl/gloshdl.cxx b/sw/source/ui/dochdl/gloshdl.cxx index 9190766c50ea..6aa1d5800964 100644 --- a/sw/source/ui/dochdl/gloshdl.cxx +++ b/sw/source/ui/dochdl/gloshdl.cxx @@ -458,7 +458,7 @@ sal_Bool SwGlossaryHdl::Expand( const OUString& rShortName, pDlg->InsertGlos(pData->sTitle, pData->sLongName); } pDlg->SelectEntryPos(0); - const sal_uInt16 nRet = RET_OK == pDlg->Execute()? + const sal_Int32 nRet = RET_OK == pDlg->Execute()? pDlg->GetSelectedIdx(): LISTBOX_ENTRY_NOTFOUND; delete pDlg; diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx index 82372d200867..f239e8ecac4d 100644 --- a/sw/source/ui/fldui/flddb.cxx +++ b/sw/source/ui/fldui/flddb.cxx @@ -82,12 +82,13 @@ void SwFldDBPage::Reset(const SfxItemSet&) Init(); // Allgemeine initialisierung m_pTypeLB->SetUpdateMode(false); - sal_uInt16 nOldPos = m_pTypeLB->GetSelectEntryPos(); + sal_Int32 nOldPos = m_pTypeLB->GetSelectEntryPos(); m_sOldDBName = m_pDatabaseTLB->GetDBName(m_sOldTableName, m_sOldColumnName); m_pTypeLB->Clear(); - sal_uInt16 nPos, nTypeId, i; + sal_Int32 nPos; + sal_uInt16 nTypeId, i; if (!IsFldEdit()) { @@ -117,7 +118,7 @@ void SwFldDBPage::Reset(const SfxItemSet&) sal_uInt16 nSize = GetFldMgr().GetFormatCount(TYP_DBSETNUMBERFLD, false, IsFldDlgHtmlMode()); for( i = 0; i < nSize; ++i ) { - sal_uInt16 nEntryPos = m_pFormatLB->InsertEntry(GetFldMgr().GetFormatStr(TYP_DBSETNUMBERFLD, i)); + sal_Int32 nEntryPos = m_pFormatLB->InsertEntry(GetFldMgr().GetFormatStr(TYP_DBSETNUMBERFLD, i)); sal_uInt16 nFmtId = GetFldMgr().GetFormatId( TYP_DBSETNUMBERFLD, i ); m_pFormatLB->SetEntryData( nEntryPos, reinterpret_cast<void*>(nFmtId) ); if( SVX_NUM_ARABIC == nFmtId ) @@ -262,7 +263,7 @@ sal_uInt16 SwFldDBPage::GetGroup() IMPL_LINK( SwFldDBPage, TypeHdl, ListBox *, pBox ) { // save old ListBoxPos - const sal_uInt16 nOld = GetTypeSel(); + const sal_Int32 nOld = GetTypeSel(); // current ListBoxPos SetTypeSel(m_pTypeLB->GetSelectEntryPos()); @@ -344,7 +345,7 @@ IMPL_LINK( SwFldDBPage, TypeHdl, ListBox *, pBox ) m_pFormatLB->Show(); if( IsFldEdit() ) { - for( sal_uInt16 nI = m_pFormatLB->GetEntryCount(); nI; ) + for( sal_Int32 nI = m_pFormatLB->GetEntryCount(); nI; ) if( GetCurField()->GetFormat() == (sal_uInt16)(sal_uLong) m_pFormatLB->GetEntryData( --nI )) { @@ -483,7 +484,7 @@ void SwFldDBPage::FillUserData() { OUString sData(USER_DATA_VERSION); sData += ";"; - sal_uInt16 nTypeSel = m_pTypeLB->GetSelectEntryPos(); + sal_Int32 nTypeSel = m_pTypeLB->GetSelectEntryPos(); if( LISTBOX_ENTRY_NOTFOUND == nTypeSel ) nTypeSel = USHRT_MAX; diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx index 78ccac188032..299f3b2fb2a0 100644 --- a/sw/source/ui/fldui/flddinf.cxx +++ b/sw/source/ui/fldui/flddinf.cxx @@ -123,12 +123,12 @@ void SwFldDokInfPage::Reset(const SfxItemSet& ) } } - sal_uInt16 nSelEntryData = USHRT_MAX; + sal_Int32 nSelEntryData = LISTBOX_ENTRY_NOTFOUND; OUString sUserData = GetUserData(); if (sUserData.getToken(0, ';').equalsIgnoreAsciiCase(USER_DATA_VERSION_1)) { OUString sVal = sUserData.getToken(1, ';'); - nSelEntryData = static_cast< sal_uInt16 >(sVal.toInt32()); + nSelEntryData = sVal.toInt32(); } std::vector<OUString> aLst; @@ -171,7 +171,7 @@ void SwFldDokInfPage::Reset(const SfxItemSet& ) pEntry->SetUserData(reinterpret_cast<void*>(i)); } } - if(nSelEntryData == i) + if(static_cast<size_t>(nSelEntryData) == i) pSelEntry = pEntry; } } @@ -231,7 +231,7 @@ IMPL_LINK_NOARG(SwFldDokInfPage, TypeHdl) IMPL_LINK_NOARG(SwFldDokInfPage, SubTypeHdl) { sal_uInt16 nSubType = (sal_uInt16)(sal_uLong)pSelEntry->GetUserData(); - sal_uInt16 nPos = m_pSelectionLB->GetSelectEntryPos(); + sal_Int32 nPos = m_pSelectionLB->GetSelectEntryPos(); sal_uInt16 nExtSubType; sal_uInt16 nNewType = 0; @@ -361,7 +361,7 @@ IMPL_LINK_NOARG(SwFldDokInfPage, SubTypeHdl) return 0; } -sal_uInt16 SwFldDokInfPage::FillSelectionLB(sal_uInt16 nSubType) +sal_Int32 SwFldDokInfPage::FillSelectionLB(sal_uInt16 nSubType) { // fill Format-Listbox sal_uInt16 nTypeId = TYP_DOCINFOFLD; @@ -374,7 +374,7 @@ sal_uInt16 SwFldDokInfPage::FillSelectionLB(sal_uInt16 nSubType) m_pSelectionLB->Clear(); sal_uInt16 nSize = 0; - sal_uInt16 nSelPos = USHRT_MAX; + sal_Int32 nSelPos = LISTBOX_ENTRY_NOTFOUND; sal_uInt16 nExtSubType = IsFldEdit() ? (((SwDocInfoField*)GetCurField())->GetSubType() & 0xff00) : 0; if (IsFldEdit()) @@ -392,7 +392,7 @@ sal_uInt16 SwFldDokInfPage::FillSelectionLB(sal_uInt16 nSubType) nSize = GetFldMgr().GetFormatCount(nTypeId, false, IsFldDlgHtmlMode()); for (sal_uInt16 i = 0; i < nSize; i++) { - sal_uInt16 nPos = m_pSelectionLB->InsertEntry(GetFldMgr().GetFormatStr(nTypeId, i)); + sal_Int32 nPos = m_pSelectionLB->InsertEntry(GetFldMgr().GetFormatStr(nTypeId, i)); m_pSelectionLB->SetEntryData(nPos, reinterpret_cast<void*>(GetFldMgr().GetFormatId(nTypeId, i))); if (IsFldEdit() && i == nExtSubType) nSelPos = nPos; @@ -424,7 +424,7 @@ sal_Bool SwFldDokInfPage::FillItemSet(SfxItemSet& ) sal_uLong nFormat = 0; - sal_uInt16 nPos = m_pSelectionLB->GetSelectEntryPos(); + sal_Int32 nPos = m_pSelectionLB->GetSelectEntryPos(); OUString aName; if (DI_CUSTOM == nSubType) diff --git a/sw/source/ui/fldui/flddinf.hxx b/sw/source/ui/fldui/flddinf.hxx index 8e5727cd4033..e58361967468 100644 --- a/sw/source/ui/fldui/flddinf.hxx +++ b/sw/source/ui/fldui/flddinf.hxx @@ -46,14 +46,14 @@ class SwFldDokInfPage : public SwFldPage SvTreeListEntry* pSelEntry; com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > xCustomPropertySet; - sal_uInt16 nOldSel; + sal_Int32 nOldSel; sal_uLong nOldFormat; OUString m_sOldCustomFieldName; DECL_LINK(TypeHdl, void * = 0); DECL_LINK(SubTypeHdl, void * = 0); - sal_uInt16 FillSelectionLB(sal_uInt16 nSubTypeId); + sal_Int32 FillSelectionLB(sal_uInt16 nSubTypeId); protected: virtual sal_uInt16 GetGroup(); diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx index bc76e4109df0..ec6bc4f119df 100644 --- a/sw/source/ui/fldui/flddok.cxx +++ b/sw/source/ui/fldui/flddok.cxx @@ -91,7 +91,8 @@ void SwFldDokPage::Reset(const SfxItemSet& ) m_pTypeLB->SetUpdateMode(false); m_pTypeLB->Clear(); - sal_uInt16 nPos, nTypeId; + sal_Int32 nPos; + sal_uInt16 nTypeId; if (!IsFldEdit()) { @@ -160,7 +161,7 @@ void SwFldDokPage::Reset(const SfxItemSet& ) sal_uInt16 nVal = static_cast< sal_uInt16 >(sVal.toInt32()); if(nVal != USHRT_MAX) { - for(sal_uInt16 i = 0; i < m_pTypeLB->GetEntryCount(); i++) + for(sal_Int32 i = 0; i < m_pTypeLB->GetEntryCount(); i++) if(nVal == (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(i)) { m_pTypeLB->SelectEntryPos(i); @@ -185,7 +186,7 @@ void SwFldDokPage::Reset(const SfxItemSet& ) IMPL_LINK_NOARG(SwFldDokPage, TypeHdl) { // save old ListBoxPos - const sal_uInt16 nOld = GetTypeSel(); + const sal_Int32 nOld = GetTypeSel(); // current ListBoxPos SetTypeSel(m_pTypeLB->GetSelectEntryPos()); @@ -196,7 +197,7 @@ IMPL_LINK_NOARG(SwFldDokPage, TypeHdl) m_pTypeLB->SelectEntryPos(0); } - sal_uInt16 nCount; + size_t nCount; if (nOld != GetTypeSel()) { @@ -297,7 +298,7 @@ IMPL_LINK_NOARG(SwFldDokPage, TypeHdl) m_pSelection->Enable( bEnable ); // fill Format-Listbox - sal_uInt16 nSize = FillFormatLB(nTypeId); + sal_Int32 nSize = FillFormatLB(nTypeId); sal_Bool bValue = sal_False, bLevel = sal_False, bNumFmt = sal_False, bOffset = sal_False; sal_Bool bFormat = nSize != 0; @@ -433,13 +434,13 @@ IMPL_LINK_NOARG(SwFldDokPage, TypeHdl) void SwFldDokPage::AddSubType(sal_uInt16 nTypeId) { - sal_uInt16 nPos = m_pSelectionLB->InsertEntry(SwFieldType::GetTypeStr(nTypeId)); + sal_Int32 nPos = m_pSelectionLB->InsertEntry(SwFieldType::GetTypeStr(nTypeId)); m_pSelectionLB->SetEntryData(nPos, reinterpret_cast<void*>(nTypeId)); } IMPL_LINK_NOARG(SwFldDokPage, SubTypeHdl) { - sal_uInt16 nPos = m_pSelectionLB->GetSelectEntryPos(); + sal_Int32 nPos = m_pSelectionLB->GetSelectEntryPos(); if(nPos == LISTBOX_ENTRY_NOTFOUND) nPos = 0; @@ -471,7 +472,7 @@ IMPL_LINK_NOARG(SwFldDokPage, SubTypeHdl) return 0; } -sal_uInt16 SwFldDokPage::FillFormatLB(sal_uInt16 nTypeId) +sal_Int32 SwFldDokPage::FillFormatLB(sal_uInt16 nTypeId) { // fill Format-Listbox m_pFormatLB->Clear(); @@ -483,7 +484,7 @@ sal_uInt16 SwFldDokPage::FillFormatLB(sal_uInt16 nTypeId) for( sal_uInt16 i = 0; i < nSize; ++i ) { - sal_uInt16 nPos = m_pFormatLB->InsertEntry(GetFldMgr().GetFormatStr(nTypeId, i)); + sal_Int32 nPos = m_pFormatLB->InsertEntry(GetFldMgr().GetFormatStr(nTypeId, i)); sal_uInt16 nFmtId = GetFldMgr().GetFormatId( nTypeId, i ); m_pFormatLB->SetEntryData( nPos, reinterpret_cast<void*>( nFmtId )); if (IsFldEdit() && nFmtId == (GetCurField()->GetFormat() & ~AF_FIXED)) @@ -512,7 +513,7 @@ IMPL_LINK_NOARG(SwFldDokPage, FormatHdl) if (nTypeId == USHRT_MAX) { - sal_uInt16 nPos = m_pSelectionLB->GetSelectEntryPos(); + sal_Int32 nPos = m_pSelectionLB->GetSelectEntryPos(); if(nPos == LISTBOX_ENTRY_NOTFOUND) nPos = 0; @@ -544,7 +545,7 @@ sal_Bool SwFldDokPage::FillItemSet(SfxItemSet& ) if (nTypeId == USHRT_MAX) { - sal_uInt16 nPos = m_pSelectionLB->GetSelectEntryPos(); + sal_Int32 nPos = m_pSelectionLB->GetSelectEntryPos(); if(nPos == LISTBOX_ENTRY_NOTFOUND) nPos = 0; nTypeId = (sal_uInt16)(sal_uLong)m_pSelectionLB->GetEntryData(nPos); @@ -556,14 +557,14 @@ sal_Bool SwFldDokPage::FillItemSet(SfxItemSet& ) if (m_pFormatLB->IsEnabled()) { - sal_uInt16 nPos = m_pFormatLB->GetSelectEntryPos(); + sal_Int32 nPos = m_pFormatLB->GetSelectEntryPos(); if(nPos != LISTBOX_ENTRY_NOTFOUND) nFormat = (sal_uInt16)(sal_uLong)m_pFormatLB->GetEntryData(nPos); } if (m_pSelectionLB->IsEnabled()) { - sal_uInt16 nPos = m_pSelectionLB->GetSelectEntryPos(); + sal_Int32 nPos = m_pSelectionLB->GetSelectEntryPos(); if(nPos != LISTBOX_ENTRY_NOTFOUND) nSubType = (sal_uInt16)(sal_uLong)m_pSelectionLB->GetEntryData(nPos); } @@ -645,7 +646,7 @@ void SwFldDokPage::FillUserData() { OUString sData(USER_DATA_VERSION); sData += ";"; - sal_uInt16 nTypeSel = m_pTypeLB->GetSelectEntryPos(); + sal_Int32 nTypeSel = m_pTypeLB->GetSelectEntryPos(); if( LISTBOX_ENTRY_NOTFOUND == nTypeSel ) nTypeSel = USHRT_MAX; else diff --git a/sw/source/ui/fldui/flddok.hxx b/sw/source/ui/fldui/flddok.hxx index 522599524996..25149e51b401 100644 --- a/sw/source/ui/fldui/flddok.hxx +++ b/sw/source/ui/fldui/flddok.hxx @@ -47,7 +47,7 @@ class SwFldDokPage : public SwFldPage NumFormatListBox* m_pNumFormatLB; CheckBox* m_pFixedCB; - sal_uInt16 nOldSel; + sal_Int32 nOldSel; sal_uLong nOldFormat; DECL_LINK(TypeHdl, void *); @@ -55,7 +55,7 @@ class SwFldDokPage : public SwFldPage DECL_LINK(SubTypeHdl, void *); void AddSubType(sal_uInt16 nTypeId); - sal_uInt16 FillFormatLB(sal_uInt16 nTypeId); + sal_Int32 FillFormatLB(sal_uInt16 nTypeId); protected: virtual sal_uInt16 GetGroup(); diff --git a/sw/source/ui/fldui/fldfunc.cxx b/sw/source/ui/fldui/fldfunc.cxx index 6c172a2cf846..b16075f4beb6 100644 --- a/sw/source/ui/fldui/fldfunc.cxx +++ b/sw/source/ui/fldui/fldfunc.cxx @@ -101,7 +101,8 @@ void SwFldFuncPage::Reset(const SfxItemSet& ) m_pTypeLB->SetUpdateMode(false); m_pTypeLB->Clear(); - sal_uInt16 nPos, nTypeId; + sal_Int32 nPos; + sal_uInt16 nTypeId; if (!IsFldEdit()) { @@ -157,7 +158,7 @@ void SwFldFuncPage::Reset(const SfxItemSet& ) sal_uInt16 nVal = static_cast< sal_uInt16 >(sVal.toInt32()); if(nVal != USHRT_MAX) { - for(sal_uInt16 i = 0; i < m_pTypeLB->GetEntryCount(); i++) + for(sal_Int32 i = 0; i < m_pTypeLB->GetEntryCount(); i++) if(nVal == (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(i)) { m_pTypeLB->SelectEntryPos(i); @@ -183,7 +184,7 @@ void SwFldFuncPage::Reset(const SfxItemSet& ) IMPL_LINK_NOARG(SwFldFuncPage, TypeHdl) { // save old ListBoxPos - const sal_uInt16 nOld = GetTypeSel(); + const sal_Int32 nOld = GetTypeSel(); // current ListBoxPos SetTypeSel(m_pTypeLB->GetSelectEntryPos()); @@ -208,7 +209,7 @@ IMPL_LINK_NOARG(SwFldFuncPage, TypeHdl) for (sal_uInt16 i = 0; i < nSize; i++) { - sal_uInt16 nPos = m_pFormatLB->InsertEntry(GetFldMgr().GetFormatStr(nTypeId, i)); + sal_Int32 nPos = m_pFormatLB->InsertEntry(GetFldMgr().GetFormatStr(nTypeId, i)); m_pFormatLB->SetEntryData( nPos, reinterpret_cast<void*>(GetFldMgr().GetFormatId( nTypeId, i )) ); } @@ -405,7 +406,7 @@ IMPL_LINK( SwFldFuncPage, ListModifyHdl, Control*, pControl) } else if(m_pListItemsLB->GetSelectEntryCount()) { - sal_uInt16 nSelPos = m_pListItemsLB->GetSelectEntryPos(); + sal_Int32 nSelPos = m_pListItemsLB->GetSelectEntryPos(); if(pControl == m_pListRemovePB) { m_pListItemsLB->RemoveEntry(nSelPos); @@ -529,7 +530,7 @@ sal_Bool SwFldFuncPage::FillItemSet(SfxItemSet& ) if(nFormat == LISTBOX_ENTRY_NOTFOUND) nFormat = 0; else - nFormat = (sal_uLong)m_pFormatLB->GetEntryData((sal_uInt16)nFormat); + nFormat = (sal_uLong)m_pFormatLB->GetEntryData(nFormat); OUString aVal(m_pValueED->GetText()); OUString aName(m_pNameED->GetText()); @@ -555,7 +556,7 @@ sal_Bool SwFldFuncPage::FillItemSet(SfxItemSet& ) case TYP_DROPDOWN : { aName = m_pListNameED->GetText(); - for(sal_uInt16 i = 0; i < m_pListItemsLB->GetEntryCount(); i++) + for(sal_Int32 i = 0; i < m_pListItemsLB->GetEntryCount(); i++) { if(i) aVal += OUString(DB_DELIM); @@ -625,7 +626,7 @@ void SwFldFuncPage::FillUserData() { OUString sData(USER_DATA_VERSION); sData += ";"; - sal_uInt16 nTypeSel = m_pTypeLB->GetSelectEntryPos(); + sal_Int32 nTypeSel = m_pTypeLB->GetSelectEntryPos(); if( LISTBOX_ENTRY_NOTFOUND == nTypeSel ) nTypeSel = USHRT_MAX; else diff --git a/sw/source/ui/fldui/fldpage.cxx b/sw/source/ui/fldui/fldpage.cxx index 559255bb3bc5..be9a092f93bf 100644 --- a/sw/source/ui/fldui/fldpage.cxx +++ b/sw/source/ui/fldui/fldpage.cxx @@ -308,7 +308,7 @@ void SwFldPage::SavePos( const ListBox* pLst1, const ListBox* pLst2, void SwFldPage::RestorePos(ListBox* pLst1, ListBox* pLst2, ListBox* pLst3) { - sal_uInt16 nPos = 0; + sal_Int32 nPos = 0; ListBox* aLBArr [ coLBCount ] = { pLst1, pLst2, pLst3 }; ListBox** ppLB = aLBArr; for( int i = 0; i < coLBCount; ++i, ++ppLB ) diff --git a/sw/source/ui/fldui/fldpage.hxx b/sw/source/ui/fldui/fldpage.hxx index 364dad36c7ad..791d4e81e173 100644 --- a/sw/source/ui/fldui/fldpage.hxx +++ b/sw/source/ui/fldui/fldpage.hxx @@ -34,8 +34,8 @@ class SwFldPage : public SfxTabPage SwFldMgr m_aMgr; SwField *m_pCurFld; SwWrtShell* m_pWrtShell; - sal_uInt16 m_nTypeSel; - sal_uInt16 m_nSelectionSel; + sal_Int32 m_nTypeSel; + sal_Int32 m_nSelectionSel; bool m_bFldEdit; sal_Bool m_bInsert; sal_Bool m_bFldDlgHtmlMode; @@ -44,10 +44,10 @@ class SwFldPage : public SfxTabPage protected: - sal_uInt16 GetTypeSel() const { return m_nTypeSel;} - void SetTypeSel(sal_uInt16 nSet) { m_nTypeSel = nSet;} - sal_uInt16 GetSelectionSel() const { return m_nSelectionSel;} - void SetSelectionSel(sal_uInt16 nSet){ m_nSelectionSel = nSet;} + sal_Int32 GetTypeSel() const { return m_nTypeSel;} + void SetTypeSel(sal_Int32 nSet) { m_nTypeSel = nSet;} + sal_Int32 GetSelectionSel() const { return m_nSelectionSel;} + void SetSelectionSel(sal_Int32 nSet){ m_nSelectionSel = nSet;} sal_Bool IsFldDlgHtmlMode() const { return m_bFldDlgHtmlMode;} sal_Bool IsRefresh() const { return m_bRefresh;} SwField* GetCurField() { return m_pCurFld;} diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx index dbfd35cfc660..9236ef145cb0 100644 --- a/sw/source/ui/fldui/fldref.cxx +++ b/sw/source/ui/fldui/fldref.cxx @@ -125,7 +125,7 @@ void SwFldRefPage::SaveSelectedTxtNode() if ( nTypeId == REFFLDFLAG_HEADING ) { mnSavedSelectedPos = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(pEntry->GetUserData())); - if ( mnSavedSelectedPos < maOutlineNodes.size() ) + if ( static_cast<size_t>(mnSavedSelectedPos) < maOutlineNodes.size() ) { mpSavedSelectedTxtNode = maOutlineNodes[mnSavedSelectedPos]; } @@ -133,7 +133,7 @@ void SwFldRefPage::SaveSelectedTxtNode() else if ( nTypeId == REFFLDFLAG_NUMITEM ) { mnSavedSelectedPos = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(pEntry->GetUserData())); - if ( mnSavedSelectedPos < maNumItems.size() ) + if ( static_cast<size_t>(mnSavedSelectedPos) < maNumItems.size() ) { mpSavedSelectedTxtNode = maNumItems[mnSavedSelectedPos]->GetTxtNode(); } @@ -147,7 +147,7 @@ const SwTxtNode* SwFldRefPage::GetSavedSelectedTxtNode() const return mpSavedSelectedTxtNode; } -sal_uInt16 SwFldRefPage::GetSavedSelectedPos() const +sal_Int32 SwFldRefPage::GetSavedSelectedPos() const { return mnSavedSelectedPos; } @@ -170,7 +170,7 @@ void SwFldRefPage::Reset(const SfxItemSet& ) // fill Type-Listbox - sal_uInt16 nPos; + sal_Int32 nPos; // set/insert reference const SwFldGroupRgn& rRg = GetFldMgr().GetGroupRange(IsFldDlgHtmlMode(), GetGroup()); @@ -246,7 +246,7 @@ void SwFldRefPage::Reset(const SfxItemSet& ) sal_uInt16 nVal = static_cast< sal_uInt16 >(sVal.toInt32()); if(nVal != USHRT_MAX) { - for(sal_uInt16 i = 0; i < m_pTypeLB->GetEntryCount(); i++) + for(sal_Int32 i = 0; i < m_pTypeLB->GetEntryCount(); i++) if(nVal == (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(i)) { m_pTypeLB->SelectEntryPos(i); @@ -270,7 +270,7 @@ void SwFldRefPage::Reset(const SfxItemSet& ) IMPL_LINK_NOARG(SwFldRefPage, TypeHdl) { // save old ListBoxPos - const sal_uInt16 nOld = GetTypeSel(); + const sal_Int32 nOld = GetTypeSel(); // current ListBoxPos SetTypeSel(m_pTypeLB->GetSelectEntryPos()); @@ -332,7 +332,7 @@ IMPL_LINK_NOARG(SwFldRefPage, TypeHdl) if (m_pTypeLB->GetEntryPos(sName) == LISTBOX_ENTRY_NOTFOUND) // reference to deleted mark { - sal_uInt16 nPos = m_pTypeLB->InsertEntry(sName); + sal_Int32 nPos = m_pTypeLB->InsertEntry(sName); m_pTypeLB->SetEntryData(nPos, reinterpret_cast<void*>(nFlag)); } @@ -393,7 +393,7 @@ IMPL_LINK_NOARG(SwFldRefPage, TypeHdl) m_pNameFT->Enable(bName); // fill Format-Listbox - sal_uInt16 nSize = FillFormatLB(nTypeId); + sal_Int32 nSize = FillFormatLB(nTypeId); bool bFormat = nSize != 0; m_pFormat->Enable(bFormat); @@ -467,7 +467,7 @@ void SwFldRefPage::UpdateSubType() // #i83479# if ( m_pSelectionLB->IsVisible() ) { - const sal_uInt16 nSelectionSel = m_pSelectionLB->GetSelectEntryPos(); + const sal_Int32 nSelectionSel = m_pSelectionLB->GetSelectEntryPos(); if (nSelectionSel != LISTBOX_ENTRY_NOTFOUND) { sOldSel = m_pSelectionLB->GetEntry(nSelectionSel); @@ -667,11 +667,11 @@ void SwFldRefPage::UpdateSubType() } } -sal_uInt16 SwFldRefPage::FillFormatLB(sal_uInt16 nTypeId) +sal_Int32 SwFldRefPage::FillFormatLB(sal_uInt16 nTypeId) { OUString sOldSel; - sal_uInt16 nFormatSel = m_pFormatLB->GetSelectEntryPos(); + sal_Int32 nFormatSel = m_pFormatLB->GetSelectEntryPos(); if (nFormatSel != LISTBOX_ENTRY_NOTFOUND) sOldSel = m_pFormatLB->GetEntry(nFormatSel); @@ -715,14 +715,14 @@ sal_uInt16 SwFldRefPage::FillFormatLB(sal_uInt16 nTypeId) for (sal_uInt16 i = 0; i < nSize; i++) { - sal_uInt16 nPos = m_pFormatLB->InsertEntry(GetFldMgr().GetFormatStr( nTypeId, i )); + sal_Int32 nPos = m_pFormatLB->InsertEntry(GetFldMgr().GetFormatStr( nTypeId, i )); m_pFormatLB->SetEntryData( nPos, reinterpret_cast<void*>(GetFldMgr().GetFormatId( nTypeId, i ))); } // #i83479# if ( bAddCrossRefFormats ) { sal_uInt16 nFormat = FMT_REF_NUMBER - FMT_REF_BEGIN; - sal_uInt16 nPos = m_pFormatLB->InsertEntry(GetFldMgr().GetFormatStr( nTypeId, nFormat )); + sal_Int32 nPos = m_pFormatLB->InsertEntry(GetFldMgr().GetFormatStr( nTypeId, nFormat )); m_pFormatLB->SetEntryData( nPos, reinterpret_cast<void*>(GetFldMgr().GetFormatId( nTypeId, nFormat ))); nFormat = FMT_REF_NUMBER_NO_CONTEXT - FMT_REF_BEGIN; nPos = m_pFormatLB->InsertEntry(GetFldMgr().GetFormatStr( nTypeId, nFormat )); @@ -975,7 +975,7 @@ void SwFldRefPage::FillUserData() { OUString sData(USER_DATA_VERSION); sData += ";"; - sal_uInt16 nTypeSel = m_pTypeLB->GetSelectEntryPos(); + sal_Int32 nTypeSel = m_pTypeLB->GetSelectEntryPos(); if( LISTBOX_ENTRY_NOTFOUND == nTypeSel ) nTypeSel = USHRT_MAX; else diff --git a/sw/source/ui/fldui/fldref.hxx b/sw/source/ui/fldui/fldref.hxx index 453ca8ada11b..47dde6c62542 100644 --- a/sw/source/ui/fldui/fldref.hxx +++ b/sw/source/ui/fldui/fldref.hxx @@ -59,19 +59,19 @@ class SwFldRefPage : public SwFldPage // in order to restore selection after update of selection listbox const SwTxtNode* mpSavedSelectedTxtNode; // fallback, if previously selected text node doesn't exist anymore - sal_uInt16 mnSavedSelectedPos; + sal_Int32 mnSavedSelectedPos; DECL_LINK(TypeHdl, void *); DECL_LINK(SubTypeHdl, void * = 0); DECL_LINK(ModifyHdl, void * = 0); void UpdateSubType(); - sal_uInt16 FillFormatLB(sal_uInt16 nTypeId); + sal_Int32 FillFormatLB(sal_uInt16 nTypeId); // #i83479# void SaveSelectedTxtNode(); const SwTxtNode* GetSavedSelectedTxtNode() const; - sal_uInt16 GetSavedSelectedPos() const; + sal_Int32 GetSavedSelectedPos() const; protected: virtual sal_uInt16 GetGroup(); diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx index a400560258c2..2f844a358650 100644 --- a/sw/source/ui/fldui/fldvar.cxx +++ b/sw/source/ui/fldui/fldvar.cxx @@ -96,7 +96,8 @@ void SwFldVarPage::Reset(const SfxItemSet& ) m_pTypeLB->SetUpdateMode(false); m_pTypeLB->Clear(); - sal_uInt16 nPos, nTypeId; + sal_Int32 nPos; + sal_uInt16 nTypeId; if (!IsFldEdit()) { @@ -154,7 +155,7 @@ void SwFldVarPage::Reset(const SfxItemSet& ) sal_uInt16 nVal = (sal_uInt16)sVal.toInt32(); if( USHRT_MAX != nVal ) { - for(sal_uInt16 i = 0; i < m_pTypeLB->GetEntryCount(); i++) + for(sal_Int32 i = 0; i < m_pTypeLB->GetEntryCount(); i++) if(nVal == (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(i)) { m_pTypeLB->SelectEntryPos(i); @@ -183,7 +184,7 @@ void SwFldVarPage::Reset(const SfxItemSet& ) IMPL_LINK_NOARG(SwFldVarPage, TypeHdl) { // save old ListBoxPos - const sal_uInt16 nOld = GetTypeSel(); + const sal_Int32 nOld = GetTypeSel(); // current ListBoxPos SetTypeSel(m_pTypeLB->GetSelectEntryPos()); @@ -215,10 +216,11 @@ IMPL_LINK_NOARG(SwFldVarPage, TypeHdl) IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox ) { sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); - sal_uInt16 nSelPos = m_pSelectionLB->GetSelectEntryPos(); + sal_Int32 nSelPos = m_pSelectionLB->GetSelectEntryPos(); + sal_uInt16 nSelData = USHRT_MAX; if (nSelPos != LISTBOX_ENTRY_NOTFOUND) - nSelPos = (sal_uInt16)(sal_uLong)m_pSelectionLB->GetEntryData(nSelPos); + nSelData = (sal_uInt16)(sal_uLong)m_pSelectionLB->GetEntryData(nSelPos); if (IsFldEdit() && (!pBox || bInit)) { @@ -237,7 +239,7 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox ) m_pFormatLB->SetUpdateMode(false); FillFormatLB(nTypeId); - sal_uInt16 nSize = m_pFormatLB->GetEntryCount(); + sal_Int32 nSize = m_pFormatLB->GetEntryCount(); sal_Bool bValue = sal_False, bName = sal_False, bNumFmt = sal_False, bInvisible = sal_False, bShowChapterFrame = sal_False; @@ -249,7 +251,7 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox ) { // change or create user type SwUserFieldType* pType = (SwUserFieldType*) - GetFldMgr().GetFldType(RES_USERFLD, nSelPos); + GetFldMgr().GetFldType(RES_USERFLD, nSelData); if (pType) { @@ -295,7 +297,7 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox ) else { m_pNumFormatLB->Clear(); - sal_uInt16 nPos = m_pNumFormatLB->InsertEntry(SW_RESSTR(FMT_SETVAR_TEXT), 0); + sal_Int32 nPos = m_pNumFormatLB->InsertEntry(SW_RESSTR(FMT_SETVAR_TEXT), 0); m_pNumFormatLB->SetEntryData(nPos, (void *)ULONG_MAX); m_pNumFormatLB->SelectEntryPos(0); } @@ -411,7 +413,7 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox ) { m_pNumFormatLB->Clear(); - sal_uInt16 nPos = m_pNumFormatLB->InsertEntry(SW_RESSTR(FMT_USERVAR_TEXT), 0); + sal_Int32 nPos = m_pNumFormatLB->InsertEntry(SW_RESSTR(FMT_USERVAR_TEXT), 0); m_pNumFormatLB->SetEntryData(nPos, (void *)ULONG_MAX); m_pNumFormatLB->SelectEntryPos(0); } @@ -432,7 +434,7 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox ) if (nSelPos != LISTBOX_ENTRY_NOTFOUND) { SwDDEFieldType* pType = - (SwDDEFieldType*) GetFldMgr().GetFldType(RES_DDEFLD, nSelPos); + (SwDDEFieldType*) GetFldMgr().GetFldType(RES_DDEFLD, nSelData); if(pType) { @@ -546,9 +548,11 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox ) nSelPos = m_pSelectionLB->GetSelectEntryPos(); if (nSelPos != LISTBOX_ENTRY_NOTFOUND) - nSelPos = (sal_uInt16)(sal_uLong)m_pSelectionLB->GetEntryData(nSelPos); + nSelData = (sal_uInt16)(sal_uLong)m_pSelectionLB->GetEntryData(nSelPos); + else + nSelData = USHRT_MAX; - if (nSelPos != LISTBOX_ENTRY_NOTFOUND && pBox && !bInit) + if (nSelData != USHRT_MAX && pBox && !bInit) { m_pValueED->ReplaceSelected(m_pSelectionLB->GetSelectEntry()); ModifyHdl(); @@ -666,16 +670,16 @@ void SwFldVarPage::UpdateSubType() m_pSelectionLB->SetUpdateMode(true); } -sal_uInt16 SwFldVarPage::FillFormatLB(sal_uInt16 nTypeId) +sal_Int32 SwFldVarPage::FillFormatLB(sal_uInt16 nTypeId) { OUString sOldSel, sOldNumSel; sal_uLong nOldNumFormat = 0; - sal_uInt16 nFormatSel = m_pFormatLB->GetSelectEntryPos(); + sal_Int32 nFormatSel = m_pFormatLB->GetSelectEntryPos(); if (nFormatSel != LISTBOX_ENTRY_NOTFOUND) sOldSel = m_pFormatLB->GetEntry(nFormatSel); - sal_uInt16 nNumFormatSel = m_pNumFormatLB->GetSelectEntryPos(); + sal_Int32 nNumFormatSel = m_pNumFormatLB->GetSelectEntryPos(); if (nNumFormatSel != LISTBOX_ENTRY_NOTFOUND) { sOldNumSel = m_pNumFormatLB->GetEntry(nNumFormatSel); @@ -717,7 +721,7 @@ sal_uInt16 SwFldVarPage::FillFormatLB(sal_uInt16 nTypeId) { if (!IsFldEdit() || bSpecialFmt) { - sal_uInt16 nPos = m_pNumFormatLB->InsertEntry(SW_RESSTR(FMT_MARK_TEXT), 0); + sal_Int32 nPos = m_pNumFormatLB->InsertEntry(SW_RESSTR(FMT_MARK_TEXT), 0); m_pNumFormatLB->SetEntryData(nPos, (void *)ULONG_MAX); nPos = m_pNumFormatLB->InsertEntry(SW_RESSTR(FMT_USERVAR_CMD), 1); m_pNumFormatLB->SetEntryData(nPos, (void *)ULONG_MAX); @@ -729,7 +733,7 @@ sal_uInt16 SwFldVarPage::FillFormatLB(sal_uInt16 nTypeId) { if (!IsFldEdit() || bSpecialFmt) { - sal_uInt16 nPos = m_pNumFormatLB->InsertEntry(SW_RESSTR(FMT_SETVAR_TEXT), 0); + sal_Int32 nPos = m_pNumFormatLB->InsertEntry(SW_RESSTR(FMT_SETVAR_TEXT), 0); m_pNumFormatLB->SetEntryData(nPos, (void *)ULONG_MAX); } } @@ -737,14 +741,14 @@ sal_uInt16 SwFldVarPage::FillFormatLB(sal_uInt16 nTypeId) case TYP_FORMELFLD: { - sal_uInt16 nPos = m_pNumFormatLB->InsertEntry(SW_RESSTR(FMT_GETVAR_NAME), 0); + sal_Int32 nPos = m_pNumFormatLB->InsertEntry(SW_RESSTR(FMT_GETVAR_NAME), 0); m_pNumFormatLB->SetEntryData(nPos, (void *)ULONG_MAX); } break; case TYP_GETFLD: { - sal_uInt16 nPos = m_pNumFormatLB->InsertEntry(SW_RESSTR(FMT_GETVAR_NAME), 0); + sal_Int32 nPos = m_pNumFormatLB->InsertEntry(SW_RESSTR(FMT_GETVAR_NAME), 0); m_pNumFormatLB->SetEntryData(nPos, (void *)ULONG_MAX); } break; @@ -769,7 +773,7 @@ sal_uInt16 SwFldVarPage::FillFormatLB(sal_uInt16 nTypeId) for (sal_uInt16 i = 0; i < nSize; i++) { - sal_uInt16 nPos = m_pFormatLB->InsertEntry(GetFldMgr().GetFormatStr(nTypeId, i)); + sal_Int32 nPos = m_pFormatLB->InsertEntry(GetFldMgr().GetFormatStr(nTypeId, i)); sal_uInt16 nFldId = GetFldMgr().GetFormatId( nTypeId, i ); m_pFormatLB->SetEntryData( nPos, reinterpret_cast<void*>(nFldId) ); if (IsFldEdit() && nFldId == GetCurField()->GetFormat()) @@ -965,7 +969,7 @@ IMPL_LINK( SwFldVarPage, TBClickHdl, ToolBox *, pBox ) OUString sName(m_pNameED->GetText()), sValue(m_pValueED->GetText()); SwFieldType* pType = 0; sal_uInt16 nId = 0; - sal_uInt16 nNumFormatPos = m_pNumFormatLB->GetSelectEntryPos(); + sal_Int32 nNumFormatPos = m_pNumFormatLB->GetSelectEntryPos(); switch (nTypeId) { @@ -977,7 +981,7 @@ IMPL_LINK( SwFldVarPage, TBClickHdl, ToolBox *, pBox ) sal_uLong nFormat = m_pFormatLB->GetSelectEntryPos(); if (nFormat != LISTBOX_ENTRY_NOTFOUND) - nFormat = (sal_uLong)m_pFormatLB->GetEntryData((sal_uInt16)nFormat); + nFormat = (sal_uLong)m_pFormatLB->GetEntryData((sal_Int32)nFormat); if (pType) // change { @@ -1096,22 +1100,20 @@ sal_Bool SwFldVarPage::FillItemSet(SfxItemSet& ) OUString aVal(m_pValueED->GetText()); OUString aName(m_pNameED->GetText()); - sal_uInt16 nSubType = m_pSelectionLB->GetSelectEntryPos(); - if(nSubType == LISTBOX_ENTRY_NOTFOUND) - nSubType = 0; - else - nSubType = (sal_uInt16)(sal_uLong)m_pSelectionLB->GetEntryData(nSubType); + sal_Int32 nSubPos = m_pSelectionLB->GetSelectEntryPos(); + sal_uInt16 nSubType = (nSubPos == LISTBOX_ENTRY_NOTFOUND) ? 0 : + (sal_uInt16)(sal_uLong)m_pSelectionLB->GetEntryData(nSubPos); sal_uLong nFormat; if (!m_pNumFormatLB->IsVisible()) { - nFormat = m_pFormatLB->GetSelectEntryPos(); + sal_Int32 nFormatPos = m_pFormatLB->GetSelectEntryPos(); - if(nFormat == LISTBOX_ENTRY_NOTFOUND) + if(nFormatPos == LISTBOX_ENTRY_NOTFOUND) nFormat = 0; else - nFormat = (sal_uLong)m_pFormatLB->GetEntryData((sal_uInt16)nFormat); + nFormat = (sal_uLong)m_pFormatLB->GetEntryData(nFormatPos); } else { @@ -1280,7 +1282,7 @@ void SwFldVarPage::FillUserData() { OUString sData(USER_DATA_VERSION); sData += ";"; - sal_uInt16 nTypeSel = m_pTypeLB->GetSelectEntryPos(); + sal_Int32 nTypeSel = m_pTypeLB->GetSelectEntryPos(); if( LISTBOX_ENTRY_NOTFOUND == nTypeSel ) nTypeSel = USHRT_MAX; else diff --git a/sw/source/ui/fldui/fldvar.hxx b/sw/source/ui/fldui/fldvar.hxx index 295a6d42f896..7165117a6e8b 100644 --- a/sw/source/ui/fldui/fldvar.hxx +++ b/sw/source/ui/fldui/fldvar.hxx @@ -84,7 +84,7 @@ class SwFldVarPage : public SwFldPage DECL_LINK(SeparatorHdl, void * = 0); void UpdateSubType(); - sal_uInt16 FillFormatLB(sal_uInt16 nTypeId); + sal_Int32 FillFormatLB(sal_uInt16 nTypeId); protected: virtual sal_uInt16 GetGroup(); diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index c09a075027d9..c11df6737bbd 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -846,7 +846,7 @@ void SwColumnPage::Init() bool SwColumnPage::isLineNotNone() const { // nothing is turned off - const sal_uInt16 nPos = m_pLineTypeDLB->GetSelectEntryPos(); + const sal_Int32 nPos = m_pLineTypeDLB->GetSelectEntryPos(); return nPos != LISTBOX_ENTRY_NOTFOUND && nPos != 0; } diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index 040cbc87afba..b67ab00fecde 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -447,7 +447,7 @@ static void lcl_InsertVectors(ListBox& rBox, nEntry = rBox.InsertEntry(*aIt); rBox.SetSeparatorPos(nEntry); //now insert all strings sorted - sal_uInt16 nStartPos = rBox.GetEntryCount(); + sal_uInt16 nStartPos = static_cast<sal_uInt16>(rBox.GetEntryCount()); for(aIt = rPrev.begin(); aIt != rPrev.end(); ++aIt) ::InsertStringSorted(*aIt, rBox, nStartPos ); @@ -1063,7 +1063,7 @@ sal_Bool SwFrmPage::FillItemSet(SfxItemSet &rSet) SwFmtHoriOrient aHoriOrient( (const SwFmtHoriOrient&) rOldSet.Get(RES_HORI_ORIENT) ); - sal_uInt16 nMapPos = GetMapPos(pHMap, *m_pHorizontalDLB); + sal_uInt16 nMapPos = static_cast<sal_uInt16>(GetMapPos(pHMap, *m_pHorizontalDLB)); short nAlign = GetAlignment(pHMap, nMapPos, *m_pHorizontalDLB, *m_pHoriRelationLB); short nRel = GetRelation(pHMap, *m_pHoriRelationLB); @@ -1102,7 +1102,7 @@ sal_Bool SwFrmPage::FillItemSet(SfxItemSet &rSet) SwFmtVertOrient aVertOrient( (const SwFmtVertOrient&) rOldSet.Get(RES_VERT_ORIENT) ); - sal_uInt16 nMapPos = GetMapPos(pVMap, *m_pVerticalDLB); + sal_uInt16 nMapPos = static_cast<sal_uInt16>(GetMapPos(pVMap, *m_pVerticalDLB)); short nAlign = GetAlignment(pVMap, nMapPos, *m_pVerticalDLB, *m_pVertRelationLB); short nRel = GetRelation(pVMap, *m_pVertRelationLB); @@ -1151,7 +1151,7 @@ sal_Bool SwFrmPage::FillItemSet(SfxItemSet &rSet) const SwFmtFrmSize& rOldSize = (const SwFmtFrmSize& )rOldSet.Get(RES_FRM_SIZE); SwFmtFrmSize aSz( rOldSize ); - sal_uInt16 nRelWidthRelation = m_pRelWidthRelationLB->GetSelectEntryPos(); + sal_Int32 nRelWidthRelation = m_pRelWidthRelationLB->GetSelectEntryPos(); if (nRelWidthRelation != LISTBOX_ENTRY_NOTFOUND) { if (nRelWidthRelation == 0) @@ -1159,7 +1159,7 @@ sal_Bool SwFrmPage::FillItemSet(SfxItemSet &rSet) else if (nRelWidthRelation == 1) aSz.SetWidthPercentRelation(text::RelOrientation::PAGE_FRAME); } - sal_uInt16 nRelHeightRelation = m_pRelHeightRelationLB->GetSelectEntryPos(); + sal_Int32 nRelHeightRelation = m_pRelHeightRelationLB->GetSelectEntryPos(); if (nRelHeightRelation != LISTBOX_ENTRY_NOTFOUND) { if (nRelHeightRelation == 0) @@ -1250,7 +1250,7 @@ void SwFrmPage::InitPos(RndStdIds eId, long nX, long nY) { - sal_uInt16 nPos = m_pVerticalDLB->GetSelectEntryPos(); + sal_Int32 nPos = m_pVerticalDLB->GetSelectEntryPos(); if ( nPos != LISTBOX_ENTRY_NOTFOUND && pVMap ) { nOldV = pVMap[nPos].nAlign; @@ -1325,7 +1325,7 @@ void SwFrmPage::InitPos(RndStdIds eId, nH = nOldH; nHRel = nOldHRel; } - sal_uInt16 nMapPos = FillPosLB(pHMap, nH, nHRel, *m_pHorizontalDLB); + sal_Int32 nMapPos = FillPosLB(pHMap, nH, nHRel, *m_pHorizontalDLB); FillRelLB(pHMap, nMapPos, nH, nHRel, *m_pHoriRelationLB, *m_pHoriRelationFT); // vertical @@ -1376,7 +1376,7 @@ void SwFrmPage::InitPos(RndStdIds eId, UpdateExample(); } -sal_uInt16 SwFrmPage::FillPosLB(const FrmMap* _pMap, +sal_Int32 SwFrmPage::FillPosLB(const FrmMap* _pMap, const sal_uInt16 _nAlign, const sal_uInt16 _nRel, ListBox& _rLB ) @@ -1471,7 +1471,7 @@ sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap, bIsVerticalL2R, bIsInRightToLeft); OUString sEntry = aFramePosString.GetString(sStrId1); - sal_uInt16 nPos = _rLB.InsertEntry(sEntry); + sal_Int32 nPos = _rLB.InsertEntry(sEntry); _rLB.SetEntryData(nPos, &aAsCharRelationMap[nRelPos]); if (_pMap[nMapPos].nAlign == _nAlign) sSelEntry = sEntry; @@ -1488,7 +1488,7 @@ sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap, if (!_rLB.GetSelectEntryCount()) { - for (sal_uInt16 i = 0; i < _rLB.GetEntryCount(); i++) + for (sal_Int32 i = 0; i < _rLB.GetEntryCount(); i++) { RelationMap *pEntry = (RelationMap *)_rLB.GetEntryData(i); if (pEntry->nLBRelation == LB_REL_CHAR) // default @@ -1536,7 +1536,7 @@ sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap, bIsVerticalL2R, bIsInRightToLeft); OUString sEntry = aFramePosString.GetString(eStrId1); - sal_uInt16 nPos = _rLB.InsertEntry(sEntry); + sal_Int32 nPos = _rLB.InsertEntry(sEntry); _rLB.SetEntryData(nPos, &aRelationMap[nRelPos]); if (sSelEntry.isEmpty() && aRelationMap[nRelPos].nRelation == _nRel) sSelEntry = sEntry; @@ -1569,7 +1569,7 @@ sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap, break; } - for (sal_uInt16 i = 0; i < _rLB.GetEntryCount(); i++) + for (sal_Int32 i = 0; i < _rLB.GetEntryCount(); i++) { RelationMap *pEntry = (RelationMap *)_rLB.GetEntryData(i); if (pEntry->nRelation == _nRel) @@ -1598,7 +1598,7 @@ sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap, short SwFrmPage::GetRelation(FrmMap * /*pMap*/, ListBox &rRelationLB) { short nRel = 0; - sal_uInt16 nPos = rRelationLB.GetSelectEntryPos(); + sal_Int32 nPos = rRelationLB.GetSelectEntryPos(); if (nPos != LISTBOX_ENTRY_NOTFOUND) { @@ -1609,11 +1609,19 @@ short SwFrmPage::GetRelation(FrmMap * /*pMap*/, ListBox &rRelationLB) return nRel; } -short SwFrmPage::GetAlignment(FrmMap *pMap, sal_uInt16 nMapPos, +short SwFrmPage::GetAlignment(FrmMap *pMap, sal_Int32 nMapPos, ListBox &/*rAlignLB*/, ListBox &rRelationLB) { short nAlign = 0; + if (!pMap || nMapPos < 0) + return nAlign; + + size_t nMapCount = ::lcl_GetFrmMapCount(pMap); + + if (static_cast<size_t>(nMapPos) >= nMapCount) + return nAlign; + // i#22341 special handling also for map <aVCharMap>, // because it contains ambigous items for alignment if ( pMap == aVAsCharHtmlMap || pMap == aVAsCharMap || @@ -1622,7 +1630,6 @@ short SwFrmPage::GetAlignment(FrmMap *pMap, sal_uInt16 nMapPos, if (rRelationLB.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND) { sal_uLong nRel = ((RelationMap *)rRelationLB.GetEntryData(rRelationLB.GetSelectEntryPos()))->nLBRelation; - size_t nMapCount = ::lcl_GetFrmMapCount(pMap); SvxSwFramePosString::StringId eStrId = pMap[nMapPos].eStrId; for (size_t i = 0; i < nMapCount; i++) @@ -1645,10 +1652,10 @@ short SwFrmPage::GetAlignment(FrmMap *pMap, sal_uInt16 nMapPos, return nAlign; } -sal_uInt16 SwFrmPage::GetMapPos( const FrmMap *pMap, ListBox &rAlignLB ) +sal_Int32 SwFrmPage::GetMapPos( const FrmMap *pMap, ListBox &rAlignLB ) { - sal_uInt16 nMapPos = 0; - sal_uInt16 nLBSelPos = rAlignLB.GetSelectEntryPos(); + sal_Int32 nMapPos = 0; + sal_Int32 nLBSelPos = rAlignLB.GetSelectEntryPos(); if (nLBSelPos != LISTBOX_ENTRY_NOTFOUND) { @@ -1666,7 +1673,7 @@ sal_uInt16 SwFrmPage::GetMapPos( const FrmMap *pMap, ListBox &rAlignLB ) if (sEntry == sSelEntry) { - nMapPos = static_cast< sal_uInt16 >(i); + nMapPos = static_cast< sal_Int32 >(i); break; } } @@ -1797,7 +1804,7 @@ IMPL_LINK_NOARG(SwFrmPage, RangeModifyHdl) if ( pHMap ) { // alignment horizonal - sal_uInt16 nMapPos = GetMapPos(pHMap, *m_pHorizontalDLB); + sal_uInt16 nMapPos = static_cast<sal_uInt16>(GetMapPos(pHMap, *m_pHorizontalDLB)); short nAlign = GetAlignment(pHMap, nMapPos, *m_pHorizontalDLB, *m_pHoriRelationLB); short nRel = GetRelation(pHMap, *m_pHoriRelationLB); @@ -1810,7 +1817,7 @@ IMPL_LINK_NOARG(SwFrmPage, RangeModifyHdl) if ( pVMap ) { // alignment vertical - sal_uInt16 nMapPos = GetMapPos(pVMap, *m_pVerticalDLB); + sal_uInt16 nMapPos = static_cast<sal_uInt16>(GetMapPos(pVMap, *m_pVerticalDLB)); short nAlign = GetAlignment(pVMap, nMapPos, *m_pVerticalDLB, *m_pVertRelationLB); short nRel = GetRelation(pVMap, *m_pVertRelationLB); @@ -1940,7 +1947,7 @@ IMPL_LINK( SwFrmPage, PosHdl, ListBox *, pLB ) FixedText *pRelFT = bHori ? m_pHoriRelationFT : m_pVertRelationFT; FrmMap *pMap = bHori ? pHMap : pVMap; - sal_uInt16 nMapPos = GetMapPos(pMap, *pLB); + sal_uInt16 nMapPos = static_cast<sal_uInt16>(GetMapPos(pMap, *pLB)); short nAlign = GetAlignment(pMap, nMapPos, *pLB, *pRelLB); if (bHori) @@ -2118,10 +2125,10 @@ IMPL_LINK( SwFrmPage, ModifyHdl, Edit *, pEdit ) void SwFrmPage::UpdateExample() { - sal_uInt16 nPos = m_pHorizontalDLB->GetSelectEntryPos(); + sal_Int32 nPos = m_pHorizontalDLB->GetSelectEntryPos(); if ( pHMap && nPos != LISTBOX_ENTRY_NOTFOUND ) { - sal_uInt16 nMapPos = GetMapPos(pHMap, *m_pHorizontalDLB); + sal_uInt16 nMapPos = static_cast<sal_uInt16>(GetMapPos(pHMap, *m_pHorizontalDLB)); short nAlign = GetAlignment(pHMap, nMapPos, *m_pHorizontalDLB, *m_pHoriRelationLB); short nRel = GetRelation(pHMap, *m_pHoriRelationLB); @@ -2132,7 +2139,7 @@ void SwFrmPage::UpdateExample() nPos = m_pVerticalDLB->GetSelectEntryPos(); if ( pVMap && nPos != LISTBOX_ENTRY_NOTFOUND ) { - sal_uInt16 nMapPos = GetMapPos(pVMap, *m_pVerticalDLB); + sal_uInt16 nMapPos = static_cast<sal_uInt16>(GetMapPos(pVMap, *m_pVerticalDLB)); short nAlign = GetAlignment(pVMap, nMapPos, *m_pVerticalDLB, *m_pVertRelationLB); short nRel = GetRelation(pVMap, *m_pVertRelationLB); @@ -3044,7 +3051,8 @@ void SwFrmAddPage::Reset(const SfxItemSet &rSet ) sal_uLong nData = FRMDIR_VERT_TOP_RIGHT; pTextFlowLB->RemoveEntry(pTextFlowLB->GetEntryPos((void*)nData)); } - sal_uInt16 nPos, nVal = ((SvxFrameDirectionItem&)rSet.Get(RES_FRAMEDIR)).GetValue(); + sal_uInt16 nVal = ((SvxFrameDirectionItem&)rSet.Get(RES_FRAMEDIR)).GetValue(); + sal_Int32 nPos; for( nPos = pTextFlowLB->GetEntryCount(); nPos; ) if( (sal_uInt16)(sal_IntPtr)pTextFlowLB->GetEntryData( --nPos ) == nVal ) break; @@ -3085,12 +3093,12 @@ sal_Bool SwFrmAddPage::FillItemSet(SfxItemSet &rSet) // textflow if( pTextFlowLB->IsVisible() ) { - sal_uInt16 nPos = pTextFlowLB->GetSelectEntryPos(); + sal_Int32 nPos = pTextFlowLB->GetSelectEntryPos(); if( nPos != pTextFlowLB->GetSavedValue() ) { - nPos = (sal_uInt16)(sal_IntPtr)pTextFlowLB->GetEntryData( nPos ); + sal_uInt16 nData = (sal_uInt16)(sal_IntPtr)pTextFlowLB->GetEntryData( nPos ); bRet |= 0 != rSet.Put( SvxFrameDirectionItem( - (SvxFrameDirection)nPos, RES_FRAMEDIR )); + (SvxFrameDirection)nData, RES_FRAMEDIR )); } } if(pWrtSh) @@ -3155,7 +3163,7 @@ IMPL_LINK(SwFrmAddPage, ChainModifyHdl, ListBox*, pBox) { bool bNextBox = pNextLB == pBox; ListBox& rChangeLB = bNextBox ? *pPrevLB : *pNextLB; - for(sal_uInt16 nEntry = rChangeLB.GetEntryCount(); nEntry > 1; nEntry--) + for(sal_Int32 nEntry = rChangeLB.GetEntryCount(); nEntry > 1; nEntry--) rChangeLB.RemoveEntry(nEntry - 1); //determine chainable frames ::std::vector< OUString > aPrevPageFrames; diff --git a/sw/source/ui/inc/bookmark.hxx b/sw/source/ui/inc/bookmark.hxx index c93d1fe50edb..2c896c17d3eb 100644 --- a/sw/source/ui/inc/bookmark.hxx +++ b/sw/source/ui/inc/bookmark.hxx @@ -31,16 +31,16 @@ class SfxRequest; class BookmarkCombo : public SwComboBox { - sal_uInt16 GetFirstSelEntryPos() const; - sal_uInt16 GetNextSelEntryPos(sal_uInt16 nPos) const; - sal_uInt16 GetSelEntryPos(sal_uInt16 nPos) const; + sal_Int32 GetFirstSelEntryPos() const; + sal_Int32 GetNextSelEntryPos(sal_Int32 nPos) const; + sal_Int32 GetSelEntryPos(sal_Int32 nPos) const; virtual bool PreNotify(NotifyEvent& rNEvt); public: BookmarkCombo(Window* pWin, WinBits nStyle); - sal_uInt16 GetSelectEntryCount() const; - sal_uInt16 GetSelectEntryPos( sal_uInt16 nSelIndex = 0 ) const; + sal_Int32 GetSelectEntryCount() const; + sal_Int32 GetSelectEntryPos( sal_Int32 nSelIndex = 0 ) const; static const OUString aForbiddenChars; }; diff --git a/sw/source/ui/inc/frmpage.hxx b/sw/source/ui/inc/frmpage.hxx index b9dfbb5b87bc..5949195c81c8 100644 --- a/sw/source/ui/inc/frmpage.hxx +++ b/sw/source/ui/inc/frmpage.hxx @@ -155,20 +155,20 @@ class SwFrmPage: public SfxTabPage void Init(const SfxItemSet& rSet, sal_Bool bReset = sal_False); // OD 12.11.2003 #i22341# - adjustment to handle maps, that are ambigous // in the alignment. - sal_uInt16 FillPosLB( const FrmMap* _pMap, + sal_Int32 FillPosLB( const FrmMap* _pMap, const sal_uInt16 _nAlign, const sal_uInt16 _nRel, ListBox& _rLB ); // OD 14.11.2003 #i22341# - adjustment to handle maps, that are ambigous // in their string entries. - sal_uLong FillRelLB( const FrmMap* _pMap, + sal_uLong FillRelLB( const FrmMap* _pMap, const sal_uInt16 _nLBSelPos, const sal_uInt16 _nAlign, sal_uInt16 _nRel, ListBox& _rLB, FixedText& _rFT ); - sal_uInt16 GetMapPos( const FrmMap *pMap, ListBox &rAlignLB ); - short GetAlignment(FrmMap *pMap, sal_uInt16 nMapPos, ListBox &rAlignLB, ListBox &rRelationLB); + sal_Int32 GetMapPos( const FrmMap *pMap, ListBox &rAlignLB ); + short GetAlignment(FrmMap *pMap, sal_Int32 nMapPos, ListBox &rAlignLB, ListBox &rRelationLB); short GetRelation(FrmMap *pMap, ListBox &rRelationLB); RndStdIds GetAnchor(); diff --git a/sw/source/ui/inc/optload.hxx b/sw/source/ui/inc/optload.hxx index 0ee5023e89a6..6013d8b8dfc3 100644 --- a/sw/source/ui/inc/optload.hxx +++ b/sw/source/ui/inc/optload.hxx @@ -152,7 +152,7 @@ private: DECL_LINK(SaveEntryHdl, void *); void DelUserData(); - void SetOptions( const sal_uInt16 nPos, + void SetOptions( const sal_uLong nPos, const SwCapObjType eType, const SvGlobalName *pOleId = 0); void SaveEntry( SvTreeListEntry* pEntry ); diff --git a/sw/source/ui/inc/swlbox.hxx b/sw/source/ui/inc/swlbox.hxx index 502e48370fce..49ac2b096892 100644 --- a/sw/source/ui/inc/swlbox.hxx +++ b/sw/source/ui/inc/swlbox.hxx @@ -40,10 +40,10 @@ class SW_DLLPUBLIC SwBoxEntry sal_Bool bNew : 1; OUString aName; - sal_uInt16 nId; + sal_Int32 nId; public: - SwBoxEntry(const OUString& aName, sal_uInt16 nId=0); + SwBoxEntry(const OUString& aName, sal_Int32 nId=0); SwBoxEntry(const SwBoxEntry& rOrg); SwBoxEntry(); @@ -70,15 +70,15 @@ public: ~SwComboBox(); void InsertSwEntry(const SwBoxEntry&); - virtual sal_uInt16 InsertEntry(const OUString& rStr, sal_uInt16 = 0) SAL_OVERRIDE; + virtual sal_Int32 InsertEntry(const OUString& rStr, sal_Int32 = 0) SAL_OVERRIDE; - virtual void RemoveEntryAt(sal_uInt16 nPos) SAL_OVERRIDE; + virtual void RemoveEntryAt(sal_Int32 nPos) SAL_OVERRIDE; - sal_uInt16 GetSwEntryPos(const SwBoxEntry& rEntry) const; - const SwBoxEntry& GetSwEntry(sal_uInt16) const; + sal_Int32 GetSwEntryPos(const SwBoxEntry& rEntry) const; + const SwBoxEntry& GetSwEntry(sal_Int32) const; - sal_uInt16 GetRemovedCount() const; - const SwBoxEntry& GetRemovedEntry(sal_uInt16 nPos) const; + sal_Int32 GetRemovedCount() const; + const SwBoxEntry& GetRemovedEntry(sal_Int32 nPos) const; }; #endif // INCLUDED_SW_SOURCE_UI_INC_SWLBOX_HXX diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index a0a1823e9b54..3dda87016be2 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -923,7 +923,7 @@ void SwTOXSelectTabPage::SetWrtShell(SwWrtShell& rSh) if(nUserTypeCount > 1) { //insert all new user indexes names after the standard user index - sal_uInt16 nPos = m_pTypeLB->GetEntryPos((void*)(sal_uInt32)TO_USER); + sal_Int32 nPos = m_pTypeLB->GetEntryPos((void*)(sal_uInt32)TO_USER); nPos++; for(sal_uInt16 nUser = 1; nUser < nUserTypeCount; nUser++) { @@ -1070,14 +1070,14 @@ void SwTOXSelectTabPage::ApplyTOXDescription() m_pFromObjectNamesRB->Check(rDesc.IsCreateFromObjectNames()); m_pFromCaptionsRB->Check(!rDesc.IsCreateFromObjectNames()); m_pCaptionSequenceLB->SelectEntry(rDesc.GetSequenceName()); - m_pDisplayTypeLB->SelectEntryPos( static_cast< sal_uInt16 >(rDesc.GetCaptionDisplay()) ); + m_pDisplayTypeLB->SelectEntryPos( static_cast< sal_Int32 >(rDesc.GetCaptionDisplay()) ); RadioButtonHdl(m_pFromCaptionsRB); } else if(TOX_OBJECTS == aCurType.eType) { long nOLEData = rDesc.GetOLEOptions(); - for(sal_uInt16 nFromObj = 0; nFromObj < m_pFromObjCLB->GetEntryCount(); nFromObj++) + for(sal_uLong nFromObj = 0; nFromObj < m_pFromObjCLB->GetEntryCount(); nFromObj++) { sal_IntPtr nData = (sal_IntPtr)m_pFromObjCLB->GetEntryData(nFromObj); m_pFromObjCLB->CheckEntryPos(nFromObj, 0 != (nData & nOLEData)); @@ -1099,13 +1099,13 @@ void SwTOXSelectTabPage::ApplyTOXDescription() m_pLanguageLB->SelectLanguage(rDesc.GetLanguage()); LanguageHdl(0); - for( long nCnt = 0; nCnt < m_pSortAlgorithmLB->GetEntryCount(); ++nCnt ) + for( sal_Int32 nCnt = 0; nCnt < m_pSortAlgorithmLB->GetEntryCount(); ++nCnt ) { - const OUString* pEntryData = (const OUString*)m_pSortAlgorithmLB->GetEntryData( (sal_uInt16)nCnt ); + const OUString* pEntryData = (const OUString*)m_pSortAlgorithmLB->GetEntryData( nCnt ); OSL_ENSURE(pEntryData, "no entry data available"); if( pEntryData && *pEntryData == rDesc.GetSortAlgorithm()) { - m_pSortAlgorithmLB->SelectEntryPos( (sal_uInt16)nCnt ); + m_pSortAlgorithmLB->SelectEntryPos( nCnt ); break; } } @@ -1174,7 +1174,7 @@ void SwTOXSelectTabPage::FillTOXDescription() case TOX_OBJECTS: { long nOLEData = 0; - for(sal_uInt16 i = 0; i < m_pFromObjCLB->GetEntryCount(); i++) + for(sal_uLong i = 0; i < m_pFromObjCLB->GetEntryCount(); i++) { if(m_pFromObjCLB->IsChecked(i)) { @@ -1414,19 +1414,18 @@ IMPL_LINK(SwTOXSelectTabPage, LanguageHdl, ListBox*, pBox) if( 0 != (pUserData = m_pSortAlgorithmLB->GetEntryData( m_pSortAlgorithmLB->GetSelectEntryPos())) ) sOldString = *(OUString*)pUserData; void* pDel; - sal_uInt16 nEnd = m_pSortAlgorithmLB->GetEntryCount(); - for( sal_uInt16 n = 0; n < nEnd; ++n ) + sal_Int32 nEnd = m_pSortAlgorithmLB->GetEntryCount(); + for( sal_Int32 n = 0; n < nEnd; ++n ) if( 0 != ( pDel = m_pSortAlgorithmLB->GetEntryData( n )) ) delete (OUString*)pDel; m_pSortAlgorithmLB->Clear(); - sal_uInt16 nInsPos; OUString sAlg, sUINm; - nEnd = static_cast< sal_uInt16 >(aSeq.getLength()); - for( sal_uInt16 nCnt = 0; nCnt < nEnd; ++nCnt ) + nEnd = aSeq.getLength(); + for( sal_Int32 nCnt = 0; nCnt < nEnd; ++nCnt ) { sUINm = pIndexRes->GetTranslation( sAlg = aSeq[ nCnt ] ); - nInsPos = m_pSortAlgorithmLB->InsertEntry( sUINm ); + sal_Int32 nInsPos = m_pSortAlgorithmLB->InsertEntry( sUINm ); m_pSortAlgorithmLB->SetEntryData( nInsPos, new OUString( sAlg )); if( sAlg == sOldString ) m_pSortAlgorithmLB->SelectEntryPos( nInsPos ); @@ -1884,10 +1883,10 @@ SwTOXEntryTabPage::SwTOXEntryTabPage(Window* pParent, const SfxItemSet& rAttrSet for (sal_uInt16 i = 0; i < AUTH_FIELD_END; ++i) { OUString sTmp(SW_RES(STR_AUTH_FIELD_START + i)); - sal_uInt16 nPos = m_pAuthFieldsLB->InsertEntry(sTmp); + sal_Int32 nPos = m_pAuthFieldsLB->InsertEntry(sTmp); m_pAuthFieldsLB->SetEntryData(nPos, reinterpret_cast< void * >(sal::static_int_cast< sal_uIntPtr >(i))); } - sal_uInt16 nPos = m_pFirstKeyLB->InsertEntry(sNoCharSortKey); + sal_Int32 nPos = m_pFirstKeyLB->InsertEntry(sNoCharSortKey); m_pFirstKeyLB->SetEntryData(nPos, reinterpret_cast< void * >(sal::static_int_cast< sal_uIntPtr >(USHRT_MAX))); nPos = m_pSecondKeyLB->InsertEntry(sNoCharSortKey); m_pSecondKeyLB->SetEntryData(nPos, reinterpret_cast< void * >(sal::static_int_cast< sal_uIntPtr >(USHRT_MAX))); @@ -2140,7 +2139,7 @@ IMPL_LINK(SwTOXEntryTabPage, RemoveInsertAuthHdl, PushButton*, pButton) bool bInsert = pButton == m_pAuthInsertPB; if(bInsert) { - sal_uInt16 nSelPos = m_pAuthFieldsLB->GetSelectEntryPos(); + sal_Int32 nSelPos = m_pAuthFieldsLB->GetSelectEntryPos(); OUString sToInsert(m_pAuthFieldsLB->GetSelectEntry()); SwFormToken aInsert(TOKEN_AUTHORITY); aInsert.nAuthorityField = (sal_uInt16)(sal_uIntPtr)m_pAuthFieldsLB->GetEntryData(nSelPos); @@ -2169,7 +2168,7 @@ void SwTOXEntryTabPage::PreTokenButtonRemoved(const SwFormToken& rToken) //fill it into the ListBox sal_uInt32 nData = rToken.nAuthorityField; OUString sTemp(SW_RES(STR_AUTH_FIELD_START + nData)); - sal_uInt16 nPos = m_pAuthFieldsLB->InsertEntry(sTemp); + sal_Int32 nPos = m_pAuthFieldsLB->InsertEntry(sTemp); m_pAuthFieldsLB->SetEntryData(nPos, (void*)(sal_uIntPtr)(nData)); } @@ -2296,7 +2295,7 @@ IMPL_LINK(SwTOXEntryTabPage, LevelHdl, SvTreeListBox*, pBox) for( sal_uInt32 i = 0; i < AUTH_FIELD_END; i++) { OUString sTmp(SW_RES(STR_AUTH_FIELD_START + i)); - sal_uInt16 nPos = m_pAuthFieldsLB->InsertEntry(sTmp); + sal_Int32 nPos = m_pAuthFieldsLB->InsertEntry(sTmp); m_pAuthFieldsLB->SetEntryData(nPos, (void*)(sal_uIntPtr)(i)); } @@ -2310,7 +2309,7 @@ IMPL_LINK(SwTOXEntryTabPage, LevelHdl, SvTreeListBox*, pBox) if(TOKEN_AUTHORITY == aToken.eTokenType) { sal_uInt32 nSearch = aToken.nAuthorityField; - sal_uInt16 nLstBoxPos = m_pAuthFieldsLB->GetEntryPos( (void*)(sal_uIntPtr)nSearch ); + sal_Int32 nLstBoxPos = m_pAuthFieldsLB->GetEntryPos( (void*)(sal_uIntPtr)nSearch ); OSL_ENSURE(LISTBOX_ENTRY_NOTFOUND != nLstBoxPos, "Entry not found?"); m_pAuthFieldsLB->RemoveEntry(nLstBoxPos); } @@ -2470,7 +2469,7 @@ IMPL_LINK(SwTOXEntryTabPage, StyleSelectHdl, ListBox*, pBox) IMPL_LINK(SwTOXEntryTabPage, ChapterInfoHdl, ListBox*, pBox) { - sal_uInt16 nPos = pBox->GetSelectEntryPos(); + sal_Int32 nPos = pBox->GetSelectEntryPos(); if(LISTBOX_ENTRY_NOTFOUND != nPos) { Control* pCtrl = m_pTokenWIN->GetActiveControl(); @@ -2498,7 +2497,7 @@ IMPL_LINK(SwTOXEntryTabPage, ChapterInfoOutlineHdl, NumericField*, pField) IMPL_LINK(SwTOXEntryTabPage, NumberFormatHdl, ListBox*, pBox) { - const sal_uInt16 nPos = pBox->GetSelectEntryPos(); + const sal_Int32 nPos = pBox->GetSelectEntryPos(); if(LISTBOX_ENTRY_NOTFOUND != nPos) { @@ -2571,7 +2570,7 @@ void SwTOXEntryTabPage::SetWrtShell(SwWrtShell& rSh) SwDocShell* pDocSh = rSh.GetView().GetDocShell(); ::FillCharStyleListBox(*m_pCharStyleLB, pDocSh, true, true); const OUString sDefault(SW_RES(STR_POOLCOLL_STANDARD)); - for(sal_uInt16 i = 0; i < m_pCharStyleLB->GetEntryCount(); i++) + for(sal_Int32 i = 0; i < m_pCharStyleLB->GetEntryCount(); i++) { OUString sEntry = m_pCharStyleLB->GetEntry(i); if(sDefault != sEntry) @@ -3700,8 +3699,8 @@ IMPL_LINK( SwTOXStylesTabPage, EditStyleHdl, Button *, pBtn ) // allocate templates IMPL_LINK_NOARG(SwTOXStylesTabPage, AssignHdl) { - sal_uInt16 nLevPos = m_pLevelLB->GetSelectEntryPos(); - sal_uInt16 nTemplPos = m_pParaLayLB->GetSelectEntryPos(); + sal_Int32 nLevPos = m_pLevelLB->GetSelectEntryPos(); + sal_Int32 nTemplPos = m_pParaLayLB->GetSelectEntryPos(); if(nLevPos != LISTBOX_ENTRY_NOTFOUND && nTemplPos != LISTBOX_ENTRY_NOTFOUND) { @@ -3727,7 +3726,7 @@ IMPL_LINK_NOARG(SwTOXStylesTabPage, AssignHdl) IMPL_LINK_NOARG(SwTOXStylesTabPage, StdHdl) { - sal_uInt16 nPos = m_pLevelLB->GetSelectEntryPos(); + sal_Int32 nPos = m_pLevelLB->GetSelectEntryPos(); if(nPos != LISTBOX_ENTRY_NOTFOUND) { OUString aStr(m_pLevelLB->GetEntry(nPos)); diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index 58d415077614..64c6c6f3a780 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -65,7 +65,7 @@ #define POS_CONTENT 0 #define POS_INDEX 1 -static sal_uInt16 nTypePos = 1; // TOX_INDEX as standard +static sal_Int32 nTypePos = 1; // TOX_INDEX as standard static sal_uInt16 nKey1Pos = USHRT_MAX; static sal_uInt16 nKey2Pos = USHRT_MAX; @@ -455,7 +455,7 @@ static void lcl_SelectSameStrings(SwWrtShell& rSh, sal_Bool bWordOnly, sal_Bool void SwIndexMarkPane::InsertMark() { - sal_uInt16 nPos = m_pTypeDCB->GetEntryPos(m_pTypeDCB->GetSelectEntry()); + sal_Int32 nPos = m_pTypeDCB->GetEntryPos(m_pTypeDCB->GetSelectEntry()); TOXTypes eType = nPos == POS_CONTENT ? TOX_CONTENT : nPos == POS_INDEX ? TOX_INDEX : TOX_USER; @@ -519,7 +519,7 @@ void SwIndexMarkPane::UpdateMark() UpdateKeyBoxes(); - sal_uInt16 nPos = m_pTypeDCB->GetEntryPos(m_pTypeDCB->GetSelectEntry()); + sal_Int32 nPos = m_pTypeDCB->GetEntryPos(m_pTypeDCB->GetSelectEntry()); TOXTypes eType = TOX_USER; if(POS_CONTENT == nPos) eType = TOX_CONTENT; @@ -554,9 +554,9 @@ void SwIndexMarkPane::UpdateMark() void SwIndexMarkPane::UpdateKeyBoxes() { OUString aKey(m_pKey1DCB->GetText()); - sal_uInt16 nPos = m_pKey1DCB->GetEntryPos(aKey); + sal_Int32 nPos = m_pKey1DCB->GetEntryPos(aKey); - if(nPos == LISTBOX_ENTRY_NOTFOUND && !aKey.isEmpty()) + if(nPos == COMBOBOX_ENTRY_NOTFOUND && !aKey.isEmpty()) { // create new key m_pKey1DCB->InsertEntry(aKey); } @@ -564,7 +564,7 @@ void SwIndexMarkPane::UpdateKeyBoxes() aKey = m_pKey2DCB->GetText(); nPos = m_pKey2DCB->GetEntryPos(aKey); - if(nPos == LISTBOX_ENTRY_NOTFOUND && !aKey.isEmpty()) + if(nPos == COMBOBOX_ENTRY_NOTFOUND && !aKey.isEmpty()) { // create new key m_pKey2DCB->InsertEntry(aKey); } @@ -658,7 +658,7 @@ IMPL_LINK( SwIndexMarkPane, ModifyHdl, ListBox *, pBox ) if (m_pTypeDCB == pBox) { // set index type - sal_uInt16 nPos = m_pTypeDCB->GetEntryPos(m_pTypeDCB->GetSelectEntry()); + sal_Int32 nPos = m_pTypeDCB->GetEntryPos(m_pTypeDCB->GetSelectEntry()); sal_Bool bLevelEnable = sal_False, bKeyEnable = sal_False, bSetKey2 = sal_False, diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx index 0367f40b75a5..f8b383cce5fe 100644 --- a/sw/source/ui/misc/bookmark.cxx +++ b/sw/source/ui/misc/bookmark.cxx @@ -72,7 +72,7 @@ IMPL_LINK_NOARG(SwInsertBookmarkDlg, DeleteHdl) { // remove text marks from the ComboBox - for (sal_uInt16 i = m_pBookmarkBox->GetSelectEntryCount(); i; i-- ) + for (sal_Int32 i = m_pBookmarkBox->GetSelectEntryCount(); i; i-- ) m_pBookmarkBox->RemoveEntryAt(m_pBookmarkBox->GetSelectEntryPos(i - 1)); m_pBookmarkBox->SetText(OUString()); @@ -90,7 +90,7 @@ void SwInsertBookmarkDlg::Apply() { //at first remove deleted bookmarks to prevent multiple bookmarks with the same //name - for (sal_uInt16 nCount = m_pBookmarkBox->GetRemovedCount(); nCount > 0; nCount--) + for (sal_Int32 nCount = m_pBookmarkBox->GetRemovedCount(); nCount > 0; nCount--) { OUString sRemoved = m_pBookmarkBox->GetRemovedEntry( nCount -1 ).GetName(); IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess(); @@ -160,21 +160,21 @@ BookmarkCombo::BookmarkCombo(Window* pWin, WinBits nStyle) { } -sal_uInt16 BookmarkCombo::GetFirstSelEntryPos() const +sal_Int32 BookmarkCombo::GetFirstSelEntryPos() const { return GetSelEntryPos(0); } -sal_uInt16 BookmarkCombo::GetNextSelEntryPos(sal_uInt16 nPos) const +sal_Int32 BookmarkCombo::GetNextSelEntryPos(sal_Int32 nPos) const { return GetSelEntryPos(nPos + 1); } -sal_uInt16 BookmarkCombo::GetSelEntryPos(sal_uInt16 nPos) const +sal_Int32 BookmarkCombo::GetSelEntryPos(sal_Int32 nPos) const { sal_Unicode cSep = GetMultiSelectionSeparator(); - sal_uInt16 nCnt = comphelper::string::getTokenCount(GetText(), cSep); + sal_Int32 nCnt = comphelper::string::getTokenCount(GetText(), cSep); for (; nPos < nCnt; nPos++) { @@ -186,11 +186,11 @@ sal_uInt16 BookmarkCombo::GetSelEntryPos(sal_uInt16 nPos) const return COMBOBOX_ENTRY_NOTFOUND; } -sal_uInt16 BookmarkCombo::GetSelectEntryCount() const +sal_Int32 BookmarkCombo::GetSelectEntryCount() const { - sal_uInt16 nCnt = 0; + sal_Int32 nCnt = 0; - sal_uInt16 nPos = GetFirstSelEntryPos(); + sal_Int32 nPos = GetFirstSelEntryPos(); while (nPos != COMBOBOX_ENTRY_NOTFOUND) { nPos = GetNextSelEntryPos(nPos); @@ -203,10 +203,10 @@ sal_uInt16 BookmarkCombo::GetSelectEntryCount() const /*------------------------------------------------------------------------ Description: position inside of the listbox (the ComboBox) -----------------------------------------------------------------------*/ -sal_uInt16 BookmarkCombo::GetSelectEntryPos( sal_uInt16 nSelIndex ) const +sal_Int32 BookmarkCombo::GetSelectEntryPos( sal_Int32 nSelIndex ) const { - sal_uInt16 nCnt = 0; - sal_uInt16 nPos = GetFirstSelEntryPos(); + sal_Int32 nCnt = 0; + sal_Int32 nPos = GetFirstSelEntryPos(); while (nPos != COMBOBOX_ENTRY_NOTFOUND) { diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx index 7c8ee93a2e22..88f32450f97a 100644 --- a/sw/source/ui/misc/docfnote.cxx +++ b/sw/source/ui/misc/docfnote.cxx @@ -188,7 +188,7 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet& ) else { OSL_ENSURE(!pColl->IsDefault(), "default style for footnotes is wrong"); - const sal_uInt16 nPos = m_pParaTemplBox->GetEntryPos(pColl->GetName()); + const sal_Int32 nPos = m_pParaTemplBox->GetEntryPos(pColl->GetName()); if( LISTBOX_ENTRY_NOTFOUND != nPos ) m_pParaTemplBox->SelectEntryPos( nPos ); else @@ -253,7 +253,7 @@ void SwEndNoteOptionPage::SelectNumbering(int eNum) int SwEndNoteOptionPage::GetNumbering() const { - const sal_uInt16 nPos = m_pNumCountBox->GetSelectEntryPos(); + const sal_Int32 nPos = m_pNumCountBox->GetSelectEntryPos(); return (int) bPosDoc? nPos + 1: nPos; } @@ -364,7 +364,7 @@ sal_Bool SwEndNoteOptionPage::FillItemSet( SfxItemSet & ) m_pFtnCharAnchorTemplBox->GetSelectEntry() ) ); // paragraph template - sal_uInt16 nPos = m_pParaTemplBox->GetSelectEntryPos(); + sal_Int32 nPos = m_pParaTemplBox->GetSelectEntryPos(); if(LISTBOX_ENTRY_NOTFOUND != nPos) { const OUString aFmtName( m_pParaTemplBox->GetSelectEntry() ); diff --git a/sw/source/ui/misc/linenum.cxx b/sw/source/ui/misc/linenum.cxx index da2d76abbdf6..d37c1d66ebbd 100644 --- a/sw/source/ui/misc/linenum.cxx +++ b/sw/source/ui/misc/linenum.cxx @@ -75,7 +75,7 @@ SwLineNumberingDlg::SwLineNumberingDlg(SwView *pVw) IDocumentStylePoolAccess* pIDSPA = pSh->getIDocumentStylePoolAccess(); OUString sStyleName(rInf.GetCharFmt( *pIDSPA )->GetName()); - const sal_uInt16 nPos = m_pCharStyleLB->GetEntryPos(sStyleName); + const sal_Int32 nPos = m_pCharStyleLB->GetEntryPos(sStyleName); if (nPos != LISTBOX_ENTRY_NOTFOUND) m_pCharStyleLB->SelectEntryPos(nPos); @@ -94,7 +94,7 @@ SwLineNumberingDlg::SwLineNumberingDlg(SwView *pVw) m_pFormatLB->SelectNumberingType(nSelFmt); // position - m_pPosLB->SelectEntryPos((sal_uInt16)rInf.GetPos()); + m_pPosLB->SelectEntryPos((sal_Int32)rInf.GetPos()); // offset sal_uInt16 nOffset = rInf.GetPosFromLeft(); diff --git a/sw/source/ui/misc/numberingtypelistbox.cxx b/sw/source/ui/misc/numberingtypelistbox.cxx index abf041025090..d319a131e3df 100644 --- a/sw/source/ui/misc/numberingtypelistbox.cxx +++ b/sw/source/ui/misc/numberingtypelistbox.cxx @@ -85,7 +85,7 @@ void SwNumberingTypeListBox::Reload(sal_uInt16 nTypeFlags) { sal_IntPtr nValue = rNames.GetValue(i); bool bInsert = true; - sal_uInt16 nPos = LISTBOX_APPEND; + sal_Int32 nPos = LISTBOX_APPEND; switch(nValue) { case style::NumberingType::NUMBER_NONE: @@ -115,7 +115,7 @@ void SwNumberingTypeListBox::Reload(sal_uInt16 nTypeFlags) } if(bInsert) { - sal_uInt16 nEntry = InsertEntry(rNames.GetString(i), nPos); + sal_Int32 nEntry = InsertEntry(rNames.GetString(i), nPos); SetEntryData( nEntry, (void*)nValue ); } } @@ -131,7 +131,7 @@ void SwNumberingTypeListBox::Reload(sal_uInt16 nTypeFlags) if(LISTBOX_ENTRY_NOTFOUND == GetEntryPos((void*)(sal_uLong)nCurrent)) { OUString aIdent = pImpl->xInfo->getNumberingIdentifier( nCurrent ); - sal_uInt16 nPos = InsertEntry(aIdent); + sal_Int32 nPos = InsertEntry(aIdent); SetEntryData(nPos,(void*)(sal_uLong)nCurrent); } } @@ -144,7 +144,7 @@ void SwNumberingTypeListBox::Reload(sal_uInt16 nTypeFlags) sal_Int16 SwNumberingTypeListBox::GetSelectedNumberingType() { sal_Int16 nRet = 0; - sal_uInt16 nSelPos = GetSelectEntryPos(); + sal_Int32 nSelPos = GetSelectEntryPos(); if(LISTBOX_ENTRY_NOTFOUND != nSelPos) nRet = (sal_Int16)(sal_uLong)GetEntryData(nSelPos); #if OSL_DEBUG_LEVEL > 0 @@ -156,7 +156,7 @@ sal_Int16 SwNumberingTypeListBox::GetSelectedNumberingType() sal_Bool SwNumberingTypeListBox::SelectNumberingType(sal_Int16 nType) { - sal_uInt16 nPos = GetEntryPos((void*)(sal_uLong)nType); + sal_Int32 nPos = GetEntryPos((void*)(sal_uLong)nType); SelectEntryPos( nPos ); return LISTBOX_ENTRY_NOTFOUND != nPos; } diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx index 372b6526b2da..3e356866548f 100644 --- a/sw/source/ui/misc/pgfnote.cxx +++ b/sw/source/ui/misc/pgfnote.cxx @@ -231,7 +231,7 @@ void SwFootNotePage::Reset(const SfxItemSet &rSet) } // select color in the list or add it as a user color - sal_uInt16 nSelPos = m_pLineColorBox->GetEntryPos( pFtnInfo->GetLineColor() ); + sal_Int32 nSelPos = m_pLineColorBox->GetEntryPos( pFtnInfo->GetLineColor() ); if( nSelPos == LISTBOX_ENTRY_NOTFOUND ) nSelPos = m_pLineColorBox->InsertEntry( pFtnInfo->GetLineColor(), OUString( SW_RES( RID_SVXSTR_COLOR_USER ) ) ); @@ -241,7 +241,7 @@ void SwFootNotePage::Reset(const SfxItemSet &rSet) m_pLineTypeBox->SetColor( pFtnInfo->GetLineColor() ); // position - m_pLinePosBox->SelectEntryPos( static_cast< sal_uInt16 >(pFtnInfo->GetAdj()) ); + m_pLinePosBox->SelectEntryPos( static_cast< sal_Int32 >(pFtnInfo->GetAdj()) ); // width Fraction aTmp( 100, 1 ); diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx index c31c650911eb..60ac680ffd66 100644 --- a/sw/source/ui/utlui/content.cxx +++ b/sw/source/ui/utlui/content.cxx @@ -1334,13 +1334,13 @@ void SwContentTree::RequestingChildren( SvTreeListEntry* pParent ) sEntry = sSpace; if(!pChild || (nLevel == 0)) pChild = InsertEntry(sEntry, pParent, - sal_False, LIST_APPEND,(void*)pCnt); + sal_False, TREELIST_APPEND,(void*)pCnt); else { //back search parent. if(((SwOutlineContent*)pCntType->GetMember(i-1))->GetOutlineLevel() < nLevel) pChild = InsertEntry(sEntry, pChild, - sal_False, LIST_APPEND, (void*)pCnt); + sal_False, TREELIST_APPEND, (void*)pCnt); else { pChild = Prev(pChild); @@ -1353,7 +1353,7 @@ void SwContentTree::RequestingChildren( SvTreeListEntry* pParent ) } if(pChild) pChild = InsertEntry(sEntry, pChild, - sal_False, LIST_APPEND, (void*)pCnt); + sal_False, TREELIST_APPEND, (void*)pCnt); } } } @@ -1370,7 +1370,7 @@ void SwContentTree::RequestingChildren( SvTreeListEntry* pParent ) if (sEntry.isEmpty()) sEntry = sSpace; SvTreeListEntry* pChild = InsertEntry(sEntry, pParent, - sal_False, LIST_APPEND, (void*)pCnt); + sal_False, TREELIST_APPEND, (void*)pCnt); //If object is marked , the corresponding entry is set true, //else the corresponding entry is set false . @@ -1639,7 +1639,7 @@ void SwContentTree::Display( bool bActive ) const Image& rImage = aEntryImages.GetImage(SID_SW_START + nCntType); sal_Bool bChOnDemand = 0 != (*ppContentT)->GetMemberCount(); pEntry = InsertEntry(sEntry, rImage, rImage, - 0, bChOnDemand, LIST_APPEND, (*ppContentT)); + 0, bChOnDemand, TREELIST_APPEND, (*ppContentT)); if(nCntType == nLastSelType) pSelEntry = pEntry; sal_Int32 nExpandOptions = bIsActive || bIsConstant ? @@ -1690,7 +1690,7 @@ void SwContentTree::Display( bool bActive ) const Image& rImage = aEntryImages.GetImage(20000 + nRootType); SvTreeListEntry* pParent = InsertEntry( (*ppRootContentT)->GetName(), rImage, rImage, - 0, sal_False, LIST_APPEND, *ppRootContentT); + 0, sal_False, TREELIST_APPEND, *ppRootContentT); if(nRootType != CONTENT_TYPE_OUTLINE) { @@ -1703,7 +1703,7 @@ void SwContentTree::Display( bool bActive ) if(sEntry.isEmpty()) sEntry = sSpace; InsertEntry( sEntry, pParent, - sal_False, LIST_APPEND, (void*)pCnt); + sal_False, TREELIST_APPEND, (void*)pCnt); } } } diff --git a/sw/source/ui/utlui/glbltree.cxx b/sw/source/ui/utlui/glbltree.cxx index 2065d9370230..9cdcf71b7e4b 100644 --- a/sw/source/ui/utlui/glbltree.cxx +++ b/sw/source/ui/utlui/glbltree.cxx @@ -201,7 +201,7 @@ sal_Int8 SwGlobalTree::ExecuteDrop( const ExecuteDropEvent& rEvt ) if( bIsInternalDrag ) { SvTreeListEntry* pDummy = 0; - sal_uLong nInsertionPos = LIST_APPEND; + sal_uLong nInsertionPos = TREELIST_APPEND; NotifyMoving( pDropEntry, pDDSource, pDummy, nInsertionPos ); } else @@ -219,7 +219,7 @@ sal_Int8 SwGlobalTree::ExecuteDrop( const ExecuteDropEvent& rEvt ) int nAbsContPos = pDropEntry ? (int) GetModel()->GetAbsPos(pDropEntry): - 1; - sal_uInt16 nEntryCount = (sal_uInt16)GetEntryCount(); + sal_uLong nEntryCount = GetEntryCount(); // Get data FileList aFileList; @@ -421,8 +421,8 @@ void SwGlobalTree::TbxMenuHdl(sal_uInt16 nTbxId, ToolBox* pBox) sal_uInt16 SwGlobalTree::GetEnableFlags() const { SvTreeListEntry* pEntry = FirstSelected(); - sal_uInt16 nSelCount = (sal_uInt16)GetSelectionCount(); - sal_uInt16 nEntryCount = (sal_uInt16)GetEntryCount(); + sal_uLong nSelCount = GetSelectionCount(); + sal_uLong nEntryCount = GetEntryCount(); SvTreeListEntry* pPrevEntry = pEntry ? Prev(pEntry) : 0; sal_uInt16 nRet = 0; @@ -499,9 +499,9 @@ void SwGlobalTree::RequestHelp( const HelpEvent& rHEvt ) void SwGlobalTree::SelectHdl() { - sal_uInt16 nSelCount = (sal_uInt16)GetSelectionCount(); + sal_uLong nSelCount = GetSelectionCount(); SvTreeListEntry* pSel = FirstSelected(); - sal_uInt16 nAbsPos = pSel ? (sal_uInt16)GetModel()->GetAbsPos(pSel) : 0; + sal_uLong nAbsPos = pSel ? GetModel()->GetAbsPos(pSel) : 0; SwNavigationPI* pNavi = GetParentWindow(); bool bReadonly = !pActiveShell || pActiveShell->GetView().GetDocShell()->IsReadOnly(); @@ -511,7 +511,7 @@ void SwGlobalTree::SelectHdl() pNavi->aGlobalToolBox.EnableItem(FN_ITEM_UP, nSelCount == 1 && nAbsPos && !bReadonly); pNavi->aGlobalToolBox.EnableItem(FN_ITEM_DOWN, - nSelCount == 1 && nAbsPos < ((sal_uInt16)GetEntryCount()) - 1 && !bReadonly); + nSelCount == 1 && nAbsPos < GetEntryCount() - 1 && !bReadonly); } @@ -540,8 +540,8 @@ sal_Bool SwGlobalTree::NotifyMoving( SvTreeListEntry* pTarget, ) { SvTreeList* _pModel = GetModel(); - sal_uInt16 nSource = (sal_uInt16) _pModel->GetAbsPos(pSource); - sal_uInt16 nDest = pTarget ? (sal_uInt16) _pModel->GetAbsPos(pTarget) : pSwGlblDocContents->size(); + sal_uLong nSource = _pModel->GetAbsPos(pSource); + sal_uLong nDest = pTarget ? _pModel->GetAbsPos(pTarget) : pSwGlblDocContents->size(); if( pActiveShell->MoveGlobalDocContent( *pSwGlblDocContents, nSource, nSource + 1, nDest ) && @@ -626,11 +626,11 @@ void SwGlobalTree::Display(bool bOnlyUpdateUserData) aEntryImages = ImageList(SW_RES(IMG_NAVI_ENTRYBMP)); bIsImageListInitialized = true; } - sal_uInt16 nCount = pSwGlblDocContents->size(); + size_t nCount = pSwGlblDocContents->size(); if(bOnlyUpdateUserData && GetEntryCount() == pSwGlblDocContents->size()) { SvTreeListEntry* pEntry = First(); - for( sal_uInt16 i = 0; i < nCount; i++) + for( size_t i = 0; i < nCount; i++) { SwGlblDocContent* pCont = (*pSwGlblDocContents)[i]; pEntry->SetUserData(pCont); @@ -642,18 +642,18 @@ void SwGlobalTree::Display(bool bOnlyUpdateUserData) SetUpdateMode( sal_False ); SvTreeListEntry* pOldSelEntry = FirstSelected(); OUString sEntryName; // Name of the entry - sal_uInt16 nSelPos = USHRT_MAX; + sal_uLong nSelPos = TREELIST_ENTRY_NOTFOUND; if(pOldSelEntry) { sEntryName = GetEntryText(pOldSelEntry); - nSelPos = (sal_uInt16)GetModel()->GetAbsPos(pOldSelEntry); + nSelPos = GetModel()->GetAbsPos(pOldSelEntry); } Clear(); if(!pSwGlblDocContents) Update( sal_False ); SvTreeListEntry* pSelEntry = 0; - for( sal_uInt16 i = 0; i < nCount; i++) + for( size_t i = 0; i < nCount; i++) { SwGlblDocContent* pCont = (*pSwGlblDocContents)[i]; OUString sEntry; @@ -682,7 +682,7 @@ void SwGlobalTree::Display(bool bOnlyUpdateUserData) break; } SvTreeListEntry* pEntry = InsertEntry(sEntry, aImage, aImage, - 0, sal_False, LIST_APPEND, pCont); + 0, sal_False, TREELIST_APPEND, pCont); if(sEntry == sEntryName) { pSelEntry = pEntry; @@ -692,7 +692,7 @@ void SwGlobalTree::Display(bool bOnlyUpdateUserData) { Select(pSelEntry); } - else if(nSelPos != USHRT_MAX && nSelPos < nCount) + else if(nSelPos != TREELIST_ENTRY_NOTFOUND && nSelPos < nCount) { Select(GetEntry(nSelPos)); } @@ -847,7 +847,7 @@ void SwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry { pActiveShell->DeleteGlobalDocContent( pTempContents ? *pTempContents : *pSwGlblDocContents, - (sal_uInt16)GetModel()->GetAbsPos(pSelEntry)); + GetModel()->GetAbsPos(pSelEntry)); pSelEntry = PrevSelected(pSelEntry); if(pSelEntry) { @@ -1052,13 +1052,13 @@ void SwGlobalTree::ExecCommand(sal_uInt16 nCmd) if(GetSelectionCount() == 1) { bool bMove = false; - sal_uInt16 nSource = (sal_uInt16)GetModel()->GetAbsPos(pEntry); - sal_uInt16 nDest = nSource; + sal_uLong nSource = GetModel()->GetAbsPos(pEntry); + sal_uLong nDest = nSource; switch(nCmd) { case FN_ITEM_DOWN: { - sal_uInt16 nEntryCount = (sal_uInt16)GetEntryCount(); + sal_uLong nEntryCount = GetEntryCount(); bMove = nEntryCount > nSource + 1; nDest+= 2; } @@ -1111,7 +1111,7 @@ sal_Bool SwGlobalTree::Update(sal_Bool bHard) } else { - for(sal_uInt16 i = 0; i < pTempContents->size() && !bCopy; i++) + for(size_t i = 0; i < pTempContents->size() && !bCopy; i++) { SwGlblDocContent* pLeft = (*pTempContents)[i]; SwGlblDocContent* pRight = (*pSwGlblDocContents)[i]; @@ -1264,7 +1264,7 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* _pContent, const Sequen bMove = true; } OUString sFilePassword; - sal_uInt16 nEntryCount = (sal_uInt16)GetEntryCount(); + sal_uLong nEntryCount = GetEntryCount(); const OUString* pFileNames = _rFiles.getConstArray(); SwWrtShell& rSh = GetParentWindow()->GetCreateView()->GetWrtShell(); rSh.StartAction(); @@ -1335,7 +1335,7 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* _pContent, const Sequen { Update( sal_False ); rSh.MoveGlobalDocContent( - *pSwGlblDocContents, nEntryCount, nEntryCount + (sal_uInt16)nFiles, nEntryCount - (sal_uInt16)nFiles ); + *pSwGlblDocContents, nEntryCount, nEntryCount + nFiles, nEntryCount - nFiles ); } rSh.EndAction(); Update( sal_False ); |