summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2014-03-01 03:13:28 +0100
committerEike Rathke <erack@redhat.com>2014-03-05 07:31:19 -0600
commit68ec95b3f80408ae50897b043eed69a07d084df9 (patch)
tree5d32076e843fae44f28e3c8d9dbbacf7648fecbc /extensions
parentc3403ac888c2e62edaf8befe7982f5f8cc95c16f (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 'extensions')
-rw-r--r--extensions/source/bibliography/toolbar.cxx2
-rw-r--r--extensions/source/bibliography/toolbar.hxx2
-rw-r--r--extensions/source/dbpilots/gridwizard.cxx6
-rw-r--r--extensions/source/propctrlr/browserlistbox.cxx2
-rw-r--r--extensions/source/propctrlr/pcrcommon.hxx5
-rw-r--r--extensions/source/propctrlr/propcontroller.cxx8
-rw-r--r--extensions/source/propctrlr/propertyeditor.cxx4
-rw-r--r--extensions/source/propctrlr/taborder.cxx2
8 files changed, 16 insertions, 15 deletions
diff --git a/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx
index ae74141b19f7..6117df51ab19 100644
--- a/extensions/source/bibliography/toolbar.cxx
+++ b/extensions/source/bibliography/toolbar.cxx
@@ -407,7 +407,7 @@ void BibToolBar::UpdateSourceList(sal_Bool bFlag)
aLBSource.SetUpdateMode(bFlag);
}
-void BibToolBar::InsertSourceEntry(const OUString& aEntry, sal_uInt16 nPos)
+void BibToolBar::InsertSourceEntry(const OUString& aEntry, sal_Int32 nPos)
{
aLBSource.InsertEntry(aEntry, nPos);
}
diff --git a/extensions/source/bibliography/toolbar.hxx b/extensions/source/bibliography/toolbar.hxx
index 407b87c79d00..7fbe16358f66 100644
--- a/extensions/source/bibliography/toolbar.hxx
+++ b/extensions/source/bibliography/toolbar.hxx
@@ -156,7 +156,7 @@ class BibToolBar: public ToolBox
void ClearSourceList();
void UpdateSourceList(sal_Bool bFlag=sal_True);
void EnableSourceList(sal_Bool bFlag=sal_True);
- void InsertSourceEntry(const OUString&,sal_uInt16 nPos=LISTBOX_APPEND );
+ void InsertSourceEntry(const OUString&,sal_Int32 nPos=LISTBOX_APPEND );
void SelectSourceEntry(const OUString& );
void EnableQuery(sal_Bool bFlag=sal_True);
diff --git a/extensions/source/dbpilots/gridwizard.cxx b/extensions/source/dbpilots/gridwizard.cxx
index af38f74f0de7..6ddfa06f5b20 100644
--- a/extensions/source/dbpilots/gridwizard.cxx
+++ b/extensions/source/dbpilots/gridwizard.cxx
@@ -414,7 +414,7 @@ namespace dbp
// the (original) relative position of the entry
sal_IntPtr nRelativeIndex = reinterpret_cast<sal_IntPtr>(bMoveRight ? m_aExistFields.GetEntryData(nSelected) : m_aSelFields.GetEntryData(nSelected));
- sal_uInt16 nInsertPos = LISTBOX_APPEND;
+ sal_uInt16 nInsertPos = SAL_MAX_UINT16;
if (!bMoveRight)
{ // need to determine an insert pos which reflects the original
nInsertPos = 0;
@@ -437,7 +437,7 @@ namespace dbp
// remove the entry from it's old list
if (bMoveRight)
{
- sal_uInt16 nSelectPos = m_aExistFields.GetSelectEntryPos();
+ sal_Int32 nSelectPos = m_aExistFields.GetSelectEntryPos();
m_aExistFields.RemoveEntry(nSelected);
if ((LISTBOX_ENTRY_NOTFOUND != nSelectPos) && (nSelectPos < m_aExistFields.GetEntryCount()))
m_aExistFields.SelectEntryPos(nSelectPos);
@@ -446,7 +446,7 @@ namespace dbp
}
else
{
- sal_uInt16 nSelectPos = m_aSelFields.GetSelectEntryPos();
+ sal_Int32 nSelectPos = m_aSelFields.GetSelectEntryPos();
m_aSelFields.RemoveEntry(nSelected);
if ((LISTBOX_ENTRY_NOTFOUND != nSelectPos) && (nSelectPos < m_aSelFields.GetEntryCount()))
m_aSelFields.SelectEntryPos(nSelectPos);
diff --git a/extensions/source/propctrlr/browserlistbox.cxx b/extensions/source/propctrlr/browserlistbox.cxx
index e93a5055bc16..e4fb9dd4851f 100644
--- a/extensions/source/propctrlr/browserlistbox.cxx
+++ b/extensions/source/propctrlr/browserlistbox.cxx
@@ -674,7 +674,7 @@ namespace pcr
sal_uInt16 OBrowserListBox::GetPropertyPos( const OUString& _rEntryName ) const
{
- sal_uInt16 nRet = LISTBOX_ENTRY_NOTFOUND;
+ sal_uInt16 nRet = EDITOR_LIST_ENTRY_NOTFOUND;
for ( ListBoxLines::const_iterator linePos = m_aLines.begin();
linePos != m_aLines.end();
++linePos
diff --git a/extensions/source/propctrlr/pcrcommon.hxx b/extensions/source/propctrlr/pcrcommon.hxx
index 1d3f6d78806f..a18b8a231476 100644
--- a/extensions/source/propctrlr/pcrcommon.hxx
+++ b/extensions/source/propctrlr/pcrcommon.hxx
@@ -20,8 +20,9 @@
#ifndef _EXTENSIONS_PROPCTRLR_PCRCOMMON_HXX_
#define _EXTENSIONS_PROPCTRLR_PCRCOMMON_HXX_
-#define EDITOR_LIST_APPEND (sal_uInt16)-1
-#define EDITOR_LIST_REPLACE_EXISTING (sal_uInt16)-1
+#define EDITOR_LIST_APPEND (SAL_MAX_UINT16)
+#define EDITOR_LIST_REPLACE_EXISTING (SAL_MAX_UINT16)
+#define EDITOR_LIST_ENTRY_NOTFOUND (SAL_MAX_UINT16)
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/beans/XPropertyChangeListener.hpp>
diff --git a/extensions/source/propctrlr/propcontroller.cxx b/extensions/source/propctrlr/propcontroller.cxx
index 39e8e34564b4..f530432cc5cd 100644
--- a/extensions/source/propctrlr/propcontroller.cxx
+++ b/extensions/source/propctrlr/propcontroller.cxx
@@ -1611,7 +1611,7 @@ namespace pcr
if ( !impl_findObjectProperty_nothrow( _rPropertyName, &propertyPos ) )
return;
- if ( getPropertyBox().GetPropertyPos( _rPropertyName ) != LISTBOX_ENTRY_NOTFOUND )
+ if ( getPropertyBox().GetPropertyPos( _rPropertyName ) != EDITOR_LIST_ENTRY_NOTFOUND )
{
rebuildPropertyUI( _rPropertyName );
return;
@@ -1629,16 +1629,16 @@ namespace pcr
// by definition, the properties in m_aProperties are in the order in which they appear in the UI
// So all we need is a predecessor of pProperty in m_aProperties
- sal_uInt16 nUIPos = LISTBOX_ENTRY_NOTFOUND;
+ sal_uInt16 nUIPos = EDITOR_LIST_ENTRY_NOTFOUND;
do
{
if ( propertyPos != m_aProperties.begin() )
--propertyPos;
nUIPos = getPropertyBox().GetPropertyPos( propertyPos->second.Name );
}
- while ( ( nUIPos == LISTBOX_ENTRY_NOTFOUND ) && ( propertyPos != m_aProperties.begin() ) );
+ while ( ( nUIPos == EDITOR_LIST_ENTRY_NOTFOUND ) && ( propertyPos != m_aProperties.begin() ) );
- if ( nUIPos == LISTBOX_ENTRY_NOTFOUND )
+ if ( nUIPos == EDITOR_LIST_ENTRY_NOTFOUND )
// insert at the very top
nUIPos = 0;
else
diff --git a/extensions/source/propctrlr/propertyeditor.cxx b/extensions/source/propctrlr/propertyeditor.cxx
index e5aa5f24d5d5..0cf8dffb8e0f 100644
--- a/extensions/source/propctrlr/propertyeditor.cxx
+++ b/extensions/source/propctrlr/propertyeditor.cxx
@@ -383,7 +383,7 @@ namespace pcr
OBrowserPage* pPage = getPage( _nPageId );
DBG_ASSERT( pPage, "OPropertyEditor::InsertEntry: don't have such a page!" );
if ( !pPage )
- return LISTBOX_ENTRY_NOTFOUND;
+ return EDITOR_LIST_ENTRY_NOTFOUND;
sal_uInt16 nEntry = pPage->getListBox().InsertEntry( rData, nPos );
@@ -427,7 +427,7 @@ namespace pcr
sal_uInt16 OPropertyEditor::GetPropertyPos( const OUString& rEntryName ) const
{
- sal_uInt16 nVal=LISTBOX_ENTRY_NOTFOUND;
+ sal_uInt16 nVal=EDITOR_LIST_ENTRY_NOTFOUND;
const OBrowserPage* pPage = getPage( rEntryName );
if ( pPage )
nVal = pPage->getListBox().GetPropertyPos( rEntryName );
diff --git a/extensions/source/propctrlr/taborder.cxx b/extensions/source/propctrlr/taborder.cxx
index 770610adab84..64ee7a75dc31 100644
--- a/extensions/source/propctrlr/taborder.cxx
+++ b/extensions/source/propctrlr/taborder.cxx
@@ -193,7 +193,7 @@ namespace pcr
aName = ::comphelper::getString( xControl->getPropertyValue( PROPERTY_NAME ) );
// TODO: do Basic controls have a name?
aImage = GetImage( xControl );
- m_pLB_Controls->InsertEntry( aName, aImage, aImage, 0, sal_False, LIST_APPEND, xControl.get() );
+ m_pLB_Controls->InsertEntry( aName, aImage, aImage, 0, sal_False, TREELIST_APPEND, xControl.get() );
}
}
else