Some more modules at least building with mingw64

Change-Id: I3ea039655aecb7885bb310b1f2c29d66f9f7bb4f
This commit is contained in:
Fridrich Štrba 2013-06-06 19:48:48 +02:00
parent 44c133ef99
commit 9eb4e4dc51
38 changed files with 248 additions and 202 deletions

View File

@ -29,6 +29,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,clucene,\
clucene/patches/clucene-nullptr.patch \
clucene/patches/clucene-warnings.patch \
clucene/patches/clucene-aix.patch \
clucene/patches/clucene-git1-win64.patch \
))
ifneq ($(OS),WNT)

View File

@ -0,0 +1,45 @@
--- src/shared/CLucene/config/threads.cpp 2013-06-06 16:25:23.014622397 +0200
+++ src/shared/CLucene/config/threads.cpp 2013-06-06 16:33:35.326048842 +0200
@@ -63,14 +63,14 @@
}
int32_t mutex_thread::atomic_increment(_LUCENE_ATOMIC_INT *theInteger){
-#ifdef _M_X64
+#ifdef _WIN64
return _InterlockedIncrement64(theInteger);
#else
return InterlockedIncrement(theInteger);
#endif
}
int32_t mutex_thread::atomic_decrement(_LUCENE_ATOMIC_INT *theInteger){
-#ifdef _M_X64
+#ifdef _WIN64
return _InterlockedDecrement64(theInteger);
#else
return InterlockedDecrement(theInteger);
--- src/shared/CLucene/config/_threads.h 2013-06-06 16:25:23.013622420 +0200
+++ src/shared/CLucene/config/_threads.h 2013-06-06 16:29:39.152601408 +0200
@@ -34,9 +34,9 @@
__declspec(dllimport) unsigned long __stdcall GetCurrentThreadId();
-#ifdef _M_X64
- __declspec(dllimport) long long __stdcall _InterlockedIncrement64(__inout long long volatile*);
- __declspec(dllimport) long long __stdcall _InterlockedDecrement64(__inout long long volatile*);
+#ifdef _WIN64
+ long long __stdcall _InterlockedIncrement64(long long volatile*);
+ long long __stdcall _InterlockedDecrement64(long long volatile*);
#else
__declspec(dllimport) long __stdcall InterlockedIncrement(long volatile*);
__declspec(dllimport) long __stdcall InterlockedDecrement(long volatile*);
--- src/shared/CLucene/LuceneThreads.h 2013-06-06 16:25:23.014622397 +0200
+++ src/shared/CLucene/LuceneThreads.h 2013-06-06 16:37:45.490166481 +0200
@@ -101,7 +101,7 @@
#define _LUCENE_ATOMIC_INC(theInteger) CL_NS(util)::mutex_thread::atomic_increment(theInteger)
#define _LUCENE_ATOMIC_DEC(theInteger) CL_NS(util)::mutex_thread::atomic_decrement(theInteger)
-#ifdef _M_X64
+#ifdef _WIN64
#define _LUCENE_ATOMIC_INT long long
#else
#define _LUCENE_ATOMIC_INT long

View File

@ -704,7 +704,7 @@ public:
sal_uInt16 nTabFlagMask=0xffff );
virtual Rectangle GetFocusRect( SvTreeListEntry*, long nLine );
// Respects indentation
virtual long GetTabPos( SvTreeListEntry*, SvLBoxTab* );
virtual sal_IntPtr GetTabPos( SvTreeListEntry*, SvLBoxTab* );
void InvalidateEntry( SvTreeListEntry* );
SvLBoxItem* GetItem( SvTreeListEntry*, long nX, SvLBoxTab** ppTab);
SvLBoxItem* GetItem( SvTreeListEntry*, long nX );

View File

@ -223,7 +223,7 @@ bool ScDocument::IsChart( const SdrObject* pObject )
IMPL_LINK_INLINE_START( ScDocument, GetUserDefinedColor, sal_uInt16 *, pColorIndex )
{
return (long) &((GetColorList()->GetColor(*pColorIndex))->GetColor());
return (sal_IntPtr) &((GetColorList()->GetColor(*pColorIndex))->GetColor());
}
IMPL_LINK_INLINE_END( ScDocument, GetUserDefinedColor, sal_uInt16 *, pColorIndex )

View File

@ -424,7 +424,7 @@ ScTpLayoutOptions::ScTpLayoutOptions( Window* pParent,
{
// nur diese Metriken benutzen
sal_uInt16 nPos = aUnitLB.InsertEntry( sMetric );
aUnitLB.SetEntryData( nPos, (void*)(long)eFUnit );
aUnitLB.SetEntryData( nPos, (void*)(sal_IntPtr)eFUnit );
}
break;
default:
@ -457,7 +457,7 @@ sal_Bool ScTpLayoutOptions::FillItemSet( SfxItemSet& rCoreSet )
const sal_uInt16 nMPos = aUnitLB.GetSelectEntryPos();
if ( nMPos != aUnitLB.GetSavedValue() )
{
sal_uInt16 nFieldUnit = (sal_uInt16)(long)aUnitLB.GetEntryData( nMPos );
sal_uInt16 nFieldUnit = (sal_uInt16)(sal_IntPtr)aUnitLB.GetEntryData( nMPos );
rCoreSet.Put( SfxUInt16Item( SID_ATTR_METRIC,
(sal_uInt16)nFieldUnit ) );
bRet = sal_True;
@ -553,7 +553,7 @@ void ScTpLayoutOptions::Reset( const SfxItemSet& rCoreSet )
for ( sal_uInt16 i = 0; i < aUnitLB.GetEntryCount(); ++i )
{
if ( (FieldUnit)(long)aUnitLB.GetEntryData( i ) == eFieldUnit )
if ( (FieldUnit)(sal_IntPtr)aUnitLB.GetEntryData( i ) == eFieldUnit )
{
aUnitLB.SelectEntryPos( i );
break;
@ -651,7 +651,7 @@ IMPL_LINK_NOARG(ScTpLayoutOptions, MetricHdl)
const sal_uInt16 nMPos = aUnitLB.GetSelectEntryPos();
if(nMPos != USHRT_MAX)
{
FieldUnit eFieldUnit = (FieldUnit)(long)aUnitLB.GetEntryData( nMPos );
FieldUnit eFieldUnit = (FieldUnit)(sal_IntPtr)aUnitLB.GetEntryData( nMPos );
sal_Int64 nVal =
aTabMF.Denormalize( aTabMF.GetValue( FUNIT_TWIP ) );
::SetFieldUnit( aTabMF, eFieldUnit );

View File

@ -268,7 +268,7 @@ SdTpOptionsMisc::SdTpOptionsMisc( Window* pParent, const SfxItemSet& rInAttrs )
for ( i = 0; i < aMetricArr.Count(); ++i )
{
String sMetric = aMetricArr.GetStringByPos( i );
long nFieldUnit = aMetricArr.GetValue( i );
sal_IntPtr nFieldUnit = aMetricArr.GetValue( i );
sal_uInt16 nPos = m_pLbMetric->InsertEntry( sMetric );
m_pLbMetric->SetEntryData( nPos, (void*)nFieldUnit );
}
@ -421,7 +421,7 @@ sal_Bool SdTpOptionsMisc::FillItemSet( SfxItemSet& rAttrs )
const sal_uInt16 nMPos = m_pLbMetric->GetSelectEntryPos();
if ( nMPos != m_pLbMetric->GetSavedValue() )
{
sal_uInt16 nFieldUnit = (sal_uInt16)(long)m_pLbMetric->GetEntryData( nMPos );
sal_uInt16 nFieldUnit = (sal_uInt16)(sal_IntPtr)m_pLbMetric->GetEntryData( nMPos );
rAttrs.Put( SfxUInt16Item( GetWhich( SID_ATTR_METRIC ),
(sal_uInt16)nFieldUnit ) );
bModified |= sal_True;
@ -490,7 +490,7 @@ void SdTpOptionsMisc::Reset( const SfxItemSet& rAttrs )
for ( sal_uInt16 i = 0; i < m_pLbMetric->GetEntryCount(); ++i )
{
if ( (long)m_pLbMetric->GetEntryData( i ) == nFieldUnit )
if ( (sal_IntPtr)m_pLbMetric->GetEntryData( i ) == nFieldUnit )
{
m_pLbMetric->SelectEntryPos( i );
break;
@ -545,7 +545,7 @@ IMPL_LINK_NOARG(SdTpOptionsMisc, SelectMetricHdl_Impl)
if( nPos != LISTBOX_ENTRY_NOTFOUND )
{
FieldUnit eUnit = (FieldUnit)(long)m_pLbMetric->GetEntryData( nPos );
FieldUnit eUnit = (FieldUnit)(sal_IntPtr)m_pLbMetric->GetEntryData( nPos );
sal_Int64 nVal =
m_pMtrFldTabstop->Denormalize( m_pMtrFldTabstop->GetValue( FUNIT_TWIP ) );
SetFieldUnit( *m_pMtrFldTabstop, eUnit );

View File

@ -530,7 +530,7 @@ void ShowWindow::DrawPauseScene( bool bTimeoutOnly )
std::max( aOutOrg.Y() + aOutSize.Height() - aGrfSize.Height() - aOffset.Height(), aOutOrg.Y() ) );
if( maLogo.IsAnimated() )
maLogo.StartAnimation( this, aGrfPos, aGrfSize, (long) this );
maLogo.StartAnimation( this, aGrfPos, aGrfSize, (sal_IntPtr) this );
else
maLogo.Draw( this, aGrfPos, aGrfSize );
}

View File

@ -80,7 +80,7 @@ private:
struct DrawDocHash {
size_t operator()(SdDrawDocument* argument) const
{ return reinterpret_cast<unsigned long>(argument); }
{ return reinterpret_cast<sal_uIntPtr>(argument); }
};
typedef ::boost::unordered_map<SdDrawDocument*,
MasterPageObserver::MasterPageNameSet,

View File

@ -44,8 +44,7 @@ gb_RCDEFS := \
-DWIN32 \
-DWIN64
gb_RCFLAGS := \
-V
gb_RCFLAGS :=
gb_CFLAGS += \
$(gb_CFLAGS_COMMON) \

View File

@ -3328,16 +3328,16 @@ Rectangle SvTreeListBox::GetFocusRect( SvTreeListEntry* pEntry, long nLine )
}
long SvTreeListBox::GetTabPos( SvTreeListEntry* pEntry, SvLBoxTab* pTab)
sal_IntPtr SvTreeListBox::GetTabPos( SvTreeListEntry* pEntry, SvLBoxTab* pTab)
{
DBG_CHKTHIS(SvTreeListBox,0);
DBG_ASSERT(pTab,"No Tab");
long nPos = pTab->GetPos();
sal_IntPtr nPos = pTab->GetPos();
if( pTab->IsDynamic() )
{
sal_uInt16 nDepth = pModel->GetDepth( pEntry );
nDepth = nDepth * (sal_uInt16)nIndent;
nPos += (long)nDepth;
nPos += (sal_IntPtr)nDepth;
}
return nPos;
}

View File

@ -58,16 +58,16 @@ typedef boost::ptr_vector<SwAuthEntry> SwAuthDataArr;
class SW_DLLPUBLIC SwAuthorityFieldType : public SwFieldType
{
SwDoc* m_pDoc;
SwAuthDataArr m_DataArr;
std::vector<long> m_SequArr;
SortKeyArr m_SortKeyArr;
sal_Unicode m_cPrefix;
sal_Unicode m_cSuffix;
sal_Bool m_bIsSequence :1;
sal_Bool m_bSortByDocument :1;
LanguageType m_eLanguage;
String m_sSortAlgorithm;
SwDoc* m_pDoc;
SwAuthDataArr m_DataArr;
std::vector<sal_IntPtr> m_SequArr;
SortKeyArr m_SortKeyArr;
sal_Unicode m_cPrefix;
sal_Unicode m_cSuffix;
sal_Bool m_bIsSequence :1;
sal_Bool m_bSortByDocument :1;
LanguageType m_eLanguage;
String m_sSortAlgorithm;
protected:
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
@ -81,29 +81,29 @@ public:
virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhichId ) const;
virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhichId );
inline void SetDoc(SwDoc* pNewDoc) { m_pDoc = pNewDoc; }
SwDoc* GetDoc(){ return m_pDoc; }
void RemoveField(long nHandle);
long AddField(const String& rFieldContents);
sal_Bool AddField(long nHandle);
inline void SetDoc(SwDoc* pNewDoc) { m_pDoc = pNewDoc; }
SwDoc* GetDoc(){ return m_pDoc; }
void RemoveField(sal_IntPtr nHandle);
sal_IntPtr AddField(const String& rFieldContents);
sal_Bool AddField(sal_IntPtr nHandle);
void DelSequenceArray()
{
m_SequArr.clear();
}
const SwAuthEntry* GetEntryByHandle(long nHandle) const;
const SwAuthEntry* GetEntryByHandle(sal_IntPtr nHandle) const;
void GetAllEntryIdentifiers( std::vector<String>& rToFill )const;
const SwAuthEntry* GetEntryByIdentifier(const String& rIdentifier)const;
bool ChangeEntryContent(const SwAuthEntry* pNewEntry);
// import interface
sal_uInt16 AppendField(const SwAuthEntry& rInsert);
long GetHandle(sal_uInt16 nPos);
sal_uInt16 AppendField(const SwAuthEntry& rInsert);
sal_IntPtr GetHandle(sal_uInt16 nPos);
sal_uInt16 GetSequencePos(long nHandle);
sal_uInt16 GetSequencePos(sal_IntPtr nHandle);
sal_Bool IsSequence() const {return m_bIsSequence;}
sal_Bool IsSequence() const {return m_bIsSequence;}
void SetSequence(sal_Bool bSet)
{
DelSequenceArray();
@ -118,14 +118,14 @@ public:
sal_Unicode GetPrefix() const { return m_cPrefix;}
sal_Unicode GetSuffix() const { return m_cSuffix;}
sal_Bool IsSortByDocument() const {return m_bSortByDocument;}
sal_Bool IsSortByDocument() const {return m_bSortByDocument;}
void SetSortByDocument(sal_Bool bSet)
{
DelSequenceArray();
m_bSortByDocument = bSet;
}
sal_uInt16 GetSortKeyCount() const ;
sal_uInt16 GetSortKeyCount() const ;
const SwTOXSortKey* GetSortKey(sal_uInt16 nIdx) const ;
void SetSortKeys(sal_uInt16 nKeyCount, SwTOXSortKey nKeys[]);
@ -143,15 +143,15 @@ public:
class SwAuthorityField : public SwField
{
long m_nHandle;
mutable long m_nTempSequencePos;
sal_IntPtr m_nHandle;
mutable sal_IntPtr m_nTempSequencePos;
virtual String Expand() const;
virtual SwField* Copy() const;
public:
SwAuthorityField(SwAuthorityFieldType* pType, const String& rFieldContents);
SwAuthorityField(SwAuthorityFieldType* pType, long nHandle);
SwAuthorityField(SwAuthorityFieldType* pType, sal_IntPtr nHandle);
~SwAuthorityField();
const String& GetFieldText(ToxAuthorityField eField) const;
@ -162,7 +162,7 @@ public:
virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhichId ) const;
virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhichId );
long GetHandle() const { return m_nHandle; }
sal_IntPtr GetHandle() const { return m_nHandle; }
virtual String GetDescription() const;
};

View File

@ -1934,7 +1934,7 @@ void SwDoc::SetModified()
// give the old and new modified state to the link
// Bit 0: -> old state
// Bit 1: -> new state
long nCall = mbModified ? 3 : 2;
sal_IntPtr nCall = mbModified ? 3 : 2;
mbModified = sal_True;
mpDocStat->bModified = sal_True;
if( maOle2Link.IsSet() )
@ -1953,7 +1953,7 @@ void SwDoc::ResetModified()
// give the old and new modified state to the link
// Bit 0: -> old state
// Bit 1: -> new state
long nCall = mbModified ? 1 : 0;
sal_IntPtr nCall = mbModified ? 1 : 0;
mbModified = sal_False;
GetIDocumentUndoRedo().SetUndoNoModifiedPosition();
if( nCall && maOle2Link.IsSet() )

View File

@ -902,7 +902,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
"pOut should not be a virtual device" );
pGrfNd->StartGraphicAnimation(pOut, aAlignedGrfArea.Pos(),
aAlignedGrfArea.SSize(), long(this),
aAlignedGrfArea.SSize(), sal_IntPtr(this),
0, GRFMGR_DRAW_STANDARD, pVout );
}
else
@ -1095,7 +1095,7 @@ void SwNoTxtFrm::StopAnimation( OutputDevice* pOut ) const
if( pGrfNd && pGrfNd->IsAnimated() )
{
const_cast< SwGrfNode* >(pGrfNd)->StopGraphicAnimation( pOut, long(this) );
const_cast< SwGrfNode* >(pGrfNd)->StopGraphicAnimation( pOut, sal_IntPtr(this) );
}
}

View File

@ -82,7 +82,7 @@ SwFieldType* SwAuthorityFieldType::Copy() const
return new SwAuthorityFieldType(m_pDoc);
}
void SwAuthorityFieldType::RemoveField(long nHandle)
void SwAuthorityFieldType::RemoveField(sal_IntPtr nHandle)
{
#if OSL_DEBUG_LEVEL > 0
bool bRemoved = false;
@ -90,7 +90,7 @@ void SwAuthorityFieldType::RemoveField(long nHandle)
for(sal_uInt16 j = 0; j < m_DataArr.size(); j++)
{
SwAuthEntry* pTemp = &m_DataArr[j];
long nRet = (long)(void*)pTemp;
sal_IntPtr nRet = (sal_IntPtr)(void*)pTemp;
if(nRet == nHandle)
{
#if OSL_DEBUG_LEVEL > 0
@ -111,9 +111,9 @@ void SwAuthorityFieldType::RemoveField(long nHandle)
#endif
}
long SwAuthorityFieldType::AddField(const String& rFieldContents)
sal_IntPtr SwAuthorityFieldType::AddField(const String& rFieldContents)
{
long nRet = 0;
sal_IntPtr nRet = 0;
SwAuthEntry* pEntry = new SwAuthEntry;
for( sal_uInt16 i = 0; i < AUTH_FIELD_END; ++i )
pEntry->SetAuthorField( (ToxAuthorityField)i,
@ -125,14 +125,14 @@ long SwAuthorityFieldType::AddField(const String& rFieldContents)
if(*pTemp == *pEntry)
{
DELETEZ(pEntry);
nRet = (long)(void*)pTemp;
nRet = (sal_IntPtr)(void*)pTemp;
pTemp->AddRef();
}
}
//if it is a new Entry - insert
if(pEntry)
{
nRet = (long)(void*)pEntry;
nRet = (sal_IntPtr)(void*)pEntry;
pEntry->AddRef();
m_DataArr.push_back(pEntry);
//re-generate positions of the fields
@ -141,13 +141,13 @@ long SwAuthorityFieldType::AddField(const String& rFieldContents)
return nRet;
}
sal_Bool SwAuthorityFieldType::AddField(long nHandle)
sal_Bool SwAuthorityFieldType::AddField(sal_IntPtr nHandle)
{
sal_Bool bRet = sal_False;
for( sal_uInt16 j = 0; j < m_DataArr.size(); j++ )
{
SwAuthEntry* pTemp = &m_DataArr[j];
long nTmp = (long)(void*)pTemp;
sal_IntPtr nTmp = (sal_IntPtr)(void*)pTemp;
if( nTmp == nHandle )
{
bRet = sal_True;
@ -157,17 +157,17 @@ sal_Bool SwAuthorityFieldType::AddField(long nHandle)
break;
}
}
OSL_ENSURE(bRet, "::AddField(long) failed");
OSL_ENSURE(bRet, "::AddField(sal_IntPtr) failed");
return bRet;
}
const SwAuthEntry* SwAuthorityFieldType::GetEntryByHandle(long nHandle) const
const SwAuthEntry* SwAuthorityFieldType::GetEntryByHandle(sal_IntPtr nHandle) const
{
const SwAuthEntry* pRet = 0;
for(sal_uInt16 j = 0; j < m_DataArr.size(); j++)
{
const SwAuthEntry* pTemp = &m_DataArr[j];
long nTmp = (long)(void*)pTemp;
sal_IntPtr nTmp = (sal_IntPtr)(void*)pTemp;
if( nTmp == nHandle )
{
pRet = pTemp;
@ -246,18 +246,18 @@ sal_uInt16 SwAuthorityFieldType::AppendField( const SwAuthEntry& rInsert )
return nRet;
}
long SwAuthorityFieldType::GetHandle(sal_uInt16 nPos)
sal_IntPtr SwAuthorityFieldType::GetHandle(sal_uInt16 nPos)
{
long nRet = 0;
sal_IntPtr nRet = 0;
if( nPos < m_DataArr.size() )
{
SwAuthEntry* pTemp = &m_DataArr[nPos];
nRet = (long)(void*)pTemp;
nRet = (sal_IntPtr)(void*)pTemp;
}
return nRet;
}
sal_uInt16 SwAuthorityFieldType::GetSequencePos(long nHandle)
sal_uInt16 SwAuthorityFieldType::GetSequencePos(sal_IntPtr nHandle)
{
//find the field in a sorted array of handles,
#if OSL_DEBUG_LEVEL > 0
@ -527,7 +527,7 @@ SwAuthorityField::SwAuthorityField( SwAuthorityFieldType* pInitType,
}
SwAuthorityField::SwAuthorityField( SwAuthorityFieldType* pInitType,
long nSetHandle )
sal_IntPtr nSetHandle )
: SwField( pInitType ),
m_nHandle( nSetHandle ),
m_nTempSequencePos( -1 )

View File

@ -1025,7 +1025,7 @@ IMPL_LINK( SwGrfNode, SwapGraphic, GraphicObject*, pGrfObj )
}
}
return (long)pRet;
return (sal_IntPtr)pRet;
}
/// delete all QuickDraw-Bitmaps in the specified document

View File

@ -47,9 +47,9 @@ public:
const SwLinePortion *GetPortion() const{ return pPor; }
sal_uInt16 GetDirection() const { return nDir; }
sal_Bool operator<( const SwBlinkPortion& rBlinkPortion ) const
{ return (long)pPor < (long)rBlinkPortion.pPor; }
{ return (sal_IntPtr)pPor < (sal_IntPtr)rBlinkPortion.pPor; }
sal_Bool operator==( const SwBlinkPortion& rBlinkPortion ) const
{ return (long)pPor == (long)rBlinkPortion.pPor; }
{ return (sal_IntPtr)pPor == (sal_IntPtr)rBlinkPortion.pPor; }
};
class SwBlinkList : public boost::ptr_set<SwBlinkPortion> {};

View File

@ -532,7 +532,7 @@ void SwFmtCntnt::SetNewCntntIdx( const SwNodeIndex *pIdx )
int SwFmtCntnt::operator==( const SfxPoolItem& rAttr ) const
{
OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
if( (long)pStartNode ^ (long)((SwFmtCntnt&)rAttr).pStartNode )
if( (sal_IntPtr)pStartNode ^ (sal_IntPtr)((SwFmtCntnt&)rAttr).pStartNode )
return 0;
if( pStartNode )
return ( *pStartNode == *((SwFmtCntnt&)rAttr).GetCntntIdx() );

View File

@ -3794,8 +3794,8 @@ sal_Bool SwFlyFrm::IsPaint( SdrObject *pObj, const ViewShell *pSh )
else if ( bTableHack &&
pFly->Frm().Top() >= pFly->GetAnchorFrm()->Frm().Top() &&
pFly->Frm().Top() < pFly->GetAnchorFrm()->Frm().Bottom() &&
long(pSh->GetOut()) ==
long(pSh->getIDocumentDeviceAccess()->getPrinter( false ) ) )
sal_IntPtr(pSh->GetOut()) ==
sal_IntPtr(pSh->getIDocumentDeviceAccess()->getPrinter( false ) ) )
{
pAnch = pFly->AnchorFrm();
}
@ -3812,7 +3812,7 @@ sal_Bool SwFlyFrm::IsPaint( SdrObject *pObj, const ViewShell *pSh )
{
if ( !pAnch->GetValidPosFlag() )
pAnch = 0;
else if ( long(pSh->GetOut()) == long(pSh->getIDocumentDeviceAccess()->getPrinter( false )))
else if ( sal_IntPtr(pSh->GetOut()) == sal_IntPtr(pSh->getIDocumentDeviceAccess()->getPrinter( false )))
{
//HACK: we have to omit some of the objects for printing,
//otherwise they would be printed twice.

View File

@ -968,7 +968,7 @@ void SwGrfNumPortion::Paint( const SwTxtPaintInfo &rInf ) const
bDraw = !rInf.GetOpt().IsGraphic();
if( !nId )
{
SetId( long( rInf.GetTxtFrm() ) );
SetId( sal_IntPtr( rInf.GetTxtFrm() ) );
rInf.GetTxtFrm()->SetAnimation();
}
if( aTmp.IsOver( rInf.GetPaintRect() ) && !bDraw )

View File

@ -751,7 +751,7 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTxtFormatInfo &rInf )
nTmpIdx = 0;
while( nTmpIdx < DROP_CACHE_SIZE &&
( aTxt[ nTmpIdx ] != aStr || aMagicNo[ nTmpIdx ] != long(pFntNo) ||
( aTxt[ nTmpIdx ] != aStr || aMagicNo[ nTmpIdx ] != sal_IntPtr(pFntNo) ||
aWishedHeight[ nTmpIdx ] != pDrop->GetDropHeight() ) )
++nTmpIdx;
}
@ -785,7 +785,7 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTxtFormatInfo &rInf )
if ( bUseCache )
{
// save keys for cache
aMagicNo[ nTmpIdx ] = long(pFntNo);
aMagicNo[ nTmpIdx ] = sal_IntPtr(pFntNo);
aTxt[ nTmpIdx ] = aStr;
aWishedHeight[ nTmpIdx ] = KSHORT(nWishedHeight);
// save initial scaling factor

View File

@ -56,7 +56,7 @@ static bool lcl_IsLessStart( const SwTxtAttr &rHt1, const SwTxtAttr &rHt2 )
return nS1 < nS2;
}
return (long)&rHt1 < (long)&rHt2;
return (sal_IntPtr)&rHt1 < (sal_IntPtr)&rHt2;
}
// order is important! for requirements see hintids.hxx
return ( nWhich1 > nWhich2 );
@ -91,7 +91,7 @@ static bool lcl_IsLessEnd( const SwTxtAttr &rHt1, const SwTxtAttr &rHt2 )
return nS1 > nS2;
}
return (long)&rHt1 > (long)&rHt2;
return (sal_IntPtr)&rHt1 > (sal_IntPtr)&rHt2;
}
// order is important! for requirements see hintids.hxx
return ( nWhich1 < nWhich2 );

View File

@ -2460,13 +2460,13 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
for( ; p->pName; ++p, ++i )
{
// set the name
const SwPropNameLen& rPropNm = GetPropName( (sal_uInt16)(long)p->pName );
const SwPropNameLen& rPropNm = GetPropName( (sal_uInt16)(sal_IntPtr)p->pName );
p->pName = rPropNm.pName;
p->nNameLen = rPropNm.nNameLen;
// get the cppu type from the comphelper
CppuTypes nTyp = (CppuTypes) (long) p->pType;
CppuTypes nTyp = (CppuTypes) (sal_IntPtr) p->pType;
GenerateCppuType( nTyp, p->pType );
OSL_ENSURE( nTyp != (CppuTypes) (long) p->pType, "unknown type" );
OSL_ENSURE( nTyp != (CppuTypes) (sal_IntPtr) p->pType, "unknown type" );
}
}
return aMapEntriesArr[nPropertyId];

View File

@ -248,13 +248,13 @@ struct SwHTMLFmtInfo
friend bool operator==( const SwHTMLFmtInfo& rInfo1,
const SwHTMLFmtInfo& rInfo2 )
{
return (long)rInfo1.pFmt == (long)rInfo2.pFmt;
return (sal_IntPtr)rInfo1.pFmt == (sal_IntPtr)rInfo2.pFmt;
}
friend bool operator<( const SwHTMLFmtInfo& rInfo1,
const SwHTMLFmtInfo& rInfo2 )
{
return (long)rInfo1.pFmt < (long)rInfo2.pFmt;
return (sal_IntPtr)rInfo1.pFmt < (sal_IntPtr)rInfo2.pFmt;
}
};

View File

@ -1044,7 +1044,7 @@ IMPL_LINK( SwDocShell, Ole2ModifiedHdl, void *, p )
// the Status is handed over from Doc (see doc.cxx)
// Bit 0: -> old state
// Bit 1: -> new state
long nStatus = (long)p;
sal_IntPtr nStatus = (sal_IntPtr)p;
if( IsEnableSetModified() )
SetModified( (nStatus & 2) ? sal_True : sal_False );
return 0;

View File

@ -110,7 +110,7 @@ SwLoadOptPage::SwLoadOptPage( Window* pParent, const SfxItemSet& rSet ) :
{
// use only these metrics
sal_uInt16 nPos = aMetricLB.InsertEntry( sMetric );
aMetricLB.SetEntryData( nPos, (void*)(long)eFUnit );
aMetricLB.SetEntryData( nPos, (void*)(sal_IntPtr)eFUnit );
}
default:; //prevent warning
}
@ -184,7 +184,7 @@ sal_Bool SwLoadOptPage::FillItemSet( SfxItemSet& rSet )
if ( nMPos != aMetricLB.GetSavedValue() )
{
// Double-Cast for VA3.0
sal_uInt16 nFieldUnit = (sal_uInt16)(long)aMetricLB.GetEntryData( nMPos );
sal_uInt16 nFieldUnit = (sal_uInt16)(sal_IntPtr)aMetricLB.GetEntryData( nMPos );
rSet.Put( SfxUInt16Item( SID_ATTR_METRIC, (sal_uInt16)nFieldUnit ) );
bRet = sal_True;
}
@ -320,7 +320,7 @@ IMPL_LINK_NOARG(SwLoadOptPage, MetricHdl)
if(nMPos != USHRT_MAX)
{
// Double-Cast for VA3.0
FieldUnit eFieldUnit = (FieldUnit)(long)aMetricLB.GetEntryData( nMPos );
FieldUnit eFieldUnit = (FieldUnit)(sal_IntPtr)aMetricLB.GetEntryData( nMPos );
sal_Bool bModified = aTabMF.IsModified();
long nVal = bModified ?
sal::static_int_cast<sal_Int32, sal_Int64 >( aTabMF.Denormalize( aTabMF.GetValue( FUNIT_TWIP ) )) :

View File

@ -138,15 +138,15 @@ SwContentOptPage::SwContentOptPage( Window* pParent,
if ( eFUnit != FUNIT_LINE )
{
sal_uInt16 nPos = m_pMetricLB->InsertEntry( sMetric );
m_pMetricLB->SetEntryData( nPos, (void*)(long)eFUnit );
m_pMetricLB->SetEntryData( nPos, (void*)(sal_IntPtr)eFUnit );
m_pHMetric->InsertEntry( sMetric );
m_pHMetric->SetEntryData( nPos, (void*)(long)eFUnit );
m_pHMetric->SetEntryData( nPos, (void*)(sal_IntPtr)eFUnit );
}
// a vertical ruler has not the 'character' unit
if ( eFUnit != FUNIT_CHAR )
{
sal_uInt16 nPos = m_pVMetric->InsertEntry( sMetric );
m_pVMetric->SetEntryData( nPos, (void*)(long)eFUnit );
m_pVMetric->SetEntryData( nPos, (void*)(sal_IntPtr)eFUnit );
}
}
default:;//prevent warning
@ -243,7 +243,7 @@ sal_Bool SwContentOptPage::FillItemSet(SfxItemSet& rSet)
if ( nMPos != m_pMetricLB->GetSavedValue() )
{
// Double-Cast for VA3.0
sal_uInt16 nFieldUnit = (sal_uInt16)(long)m_pMetricLB->GetEntryData( nMPos );
sal_uInt16 nFieldUnit = (sal_uInt16)(sal_IntPtr)m_pMetricLB->GetEntryData( nMPos );
rSet.Put( SfxUInt16Item( SID_ATTR_METRIC, (sal_uInt16)nFieldUnit ) );
bRet = sal_True;
}
@ -252,7 +252,7 @@ sal_Bool SwContentOptPage::FillItemSet(SfxItemSet& rSet)
if ( nMPos != m_pHMetric->GetSavedValue() || nMPos != nGlobalMetricPos )
{
// Double-Cast for VA3.0
sal_uInt16 nFieldUnit = (sal_uInt16)(long)m_pHMetric->GetEntryData( nMPos );
sal_uInt16 nFieldUnit = (sal_uInt16)(sal_IntPtr)m_pHMetric->GetEntryData( nMPos );
rSet.Put( SfxUInt16Item( FN_HSCROLL_METRIC, (sal_uInt16)nFieldUnit ) );
bRet = sal_True;
}
@ -260,7 +260,7 @@ sal_Bool SwContentOptPage::FillItemSet(SfxItemSet& rSet)
if ( nMPos != m_pVMetric->GetSavedValue() || nMPos != nGlobalMetricPos )
{
// Double-Cast for VA3.0
sal_uInt16 nFieldUnit = (sal_uInt16)(long)m_pVMetric->GetEntryData( nMPos );
sal_uInt16 nFieldUnit = (sal_uInt16)(sal_IntPtr)m_pVMetric->GetEntryData( nMPos );
rSet.Put( SfxUInt16Item( FN_VSCROLL_METRIC, (sal_uInt16)nFieldUnit ) );
bRet = sal_True;
}

View File

@ -252,7 +252,7 @@ IMPL_LINK(SwColumnDlg, ObjectHdl, ListBox*, pBox)
{
pTabPage->FillItemSet(*pSet);
}
nOldSelection = (long)m_pApplyToLB->GetEntryData(m_pApplyToLB->GetSelectEntryPos());
nOldSelection = (sal_IntPtr)m_pApplyToLB->GetEntryData(m_pApplyToLB->GetSelectEntryPos());
long nWidth = nSelectionWidth;
switch(nOldSelection)
{

View File

@ -2969,7 +2969,7 @@ void SwFrmAddPage::Reset(const SfxItemSet &rSet )
}
sal_uInt16 nPos, nVal = ((SvxFrameDirectionItem&)rSet.Get(RES_FRAMEDIR)).GetValue();
for( nPos = aTextFlowLB.GetEntryCount(); nPos; )
if( (sal_uInt16)(long)aTextFlowLB.GetEntryData( --nPos ) == nVal )
if( (sal_uInt16)(sal_IntPtr)aTextFlowLB.GetEntryData( --nPos ) == nVal )
break;
aTextFlowLB.SelectEntryPos( nPos );
aTextFlowLB.SaveValue();
@ -3011,7 +3011,7 @@ sal_Bool SwFrmAddPage::FillItemSet(SfxItemSet &rSet)
sal_uInt16 nPos = aTextFlowLB.GetSelectEntryPos();
if( nPos != aTextFlowLB.GetSavedValue() )
{
nPos = (sal_uInt16)(long)aTextFlowLB.GetEntryData( nPos );
nPos = (sal_uInt16)(sal_IntPtr)aTextFlowLB.GetEntryData( nPos );
bRet |= 0 != rSet.Put( SvxFrameDirectionItem(
(SvxFrameDirection)nPos, RES_FRAMEDIR ));
}

View File

@ -189,7 +189,7 @@ public:
DECL_LINK( ContentDoubleClickHdl, void * );
DECL_LINK( TimerUpdate, void * );
virtual long GetTabPos( SvTreeListEntry*, SvLBoxTab* );
virtual sal_IntPtr GetTabPos( SvTreeListEntry*, SvLBoxTab* );
virtual void RequestingChildren( SvTreeListEntry* pParent );
virtual void GetFocus();
virtual void KeyInput(const KeyEvent& rKEvt);
@ -261,7 +261,7 @@ protected:
virtual void RequestHelp( const HelpEvent& rHEvt );
virtual long GetTabPos( SvTreeListEntry*, SvLBoxTab* );
virtual sal_IntPtr GetTabPos( SvTreeListEntry*, SvLBoxTab* );
virtual sal_Bool NotifyMoving( SvTreeListEntry* pTarget,
SvTreeListEntry* pEntry,
SvTreeListEntry*& rpNewParent,

View File

@ -578,16 +578,16 @@ public:
SvTreeListBox(pWin, rResId), pHeaderBar(0){}
virtual void KeyInput( const KeyEvent& rKEvt );
virtual long GetTabPos( SvTreeListEntry*, SvLBoxTab* );
virtual sal_IntPtr GetTabPos( SvTreeListEntry*, SvLBoxTab* );
void SetHeaderBar(const HeaderBar* pHB) {pHeaderBar = pHB;}
};
long SwIndexTreeLB::GetTabPos( SvTreeListEntry* pEntry, SvLBoxTab* pTab)
sal_IntPtr SwIndexTreeLB::GetTabPos( SvTreeListEntry* pEntry, SvLBoxTab* pTab)
{
long nData = (long)pEntry->GetUserData();
sal_IntPtr nData = (sal_IntPtr)pEntry->GetUserData();
if(nData != USHRT_MAX)
{
long nPos = pHeaderBar->GetItemRect( static_cast< sal_uInt16 >(101 + nData) ).TopLeft().X();
sal_IntPtr nPos = pHeaderBar->GetItemRect( static_cast< sal_uInt16 >(101 + nData) ).TopLeft().X();
nData = nPos;
}
else
@ -603,7 +603,7 @@ void SwIndexTreeLB::KeyInput( const KeyEvent& rKEvt )
sal_Bool bChanged = sal_False;
if(pEntry)
{
long nLevel = (long)pEntry->GetUserData();
sal_IntPtr nLevel = (sal_IntPtr)pEntry->GetUserData();
if(aCode.GetCode() == KEY_ADD )
{
if(nLevel < MAXLEVEL - 1)
@ -786,7 +786,7 @@ IMPL_LINK_NOARG(SwAddStylesDlg_Impl, OkHdl)
SvTreeListEntry* pEntry = rTLB.First();
while(pEntry)
{
long nLevel = (long)pEntry->GetUserData();
sal_IntPtr nLevel = (sal_IntPtr)pEntry->GetUserData();
if(nLevel != USHRT_MAX)
{
String sName(rTLB.GetEntryText(pEntry));
@ -814,7 +814,7 @@ IMPL_LINK(SwAddStylesDlg_Impl, LeftRightHdl, PushButton*, pBtn)
SvTreeListEntry* pEntry = aHeaderTree.GetTreeListBox().FirstSelected();
if(pEntry)
{
long nLevel = (long)pEntry->GetUserData();
sal_IntPtr nLevel = (sal_IntPtr)pEntry->GetUserData();
if(bLeft)
{
if(!nLevel)
@ -1019,7 +1019,7 @@ void SwTOXSelectTabPage::SelectType(TOXTypes eSet)
{
CurTOXType eCurType (eSet, 0);
long nData = lcl_TOXTypesToUserData(eCurType);
sal_IntPtr nData = lcl_TOXTypesToUserData(eCurType);
aTypeLB.SelectEntryPos(aTypeLB.GetEntryPos((void*)nData));
aTypeFT.Enable(sal_False);
aTypeLB.Enable(sal_False);
@ -1131,7 +1131,7 @@ void SwTOXSelectTabPage::ApplyTOXDescription()
long nOLEData = rDesc.GetOLEOptions();
for(sal_uInt16 nFromObj = 0; nFromObj < aFromObjCLB.GetEntryCount(); nFromObj++)
{
long nData = (long)aFromObjCLB.GetEntryData(nFromObj);
sal_IntPtr nData = (sal_IntPtr)aFromObjCLB.GetEntryData(nFromObj);
aFromObjCLB.CheckEntryPos(nFromObj, 0 != (nData & nOLEData));
}
}
@ -1230,7 +1230,7 @@ void SwTOXSelectTabPage::FillTOXDescription()
{
if(aFromObjCLB.IsChecked(i))
{
long nData = (long)aFromObjCLB.GetEntryData(i);
sal_IntPtr nData = (sal_IntPtr)aFromObjCLB.GetEntryData(i);
nOLEData |= nData;
}
}
@ -1279,7 +1279,7 @@ void SwTOXSelectTabPage::Reset( const SfxItemSet& )
SwMultiTOXTabDialog* pTOXDlg = (SwMultiTOXTabDialog*)GetTabDialog();
SwWrtShell& rSh = pTOXDlg->GetWrtShell();
const CurTOXType aCurType = pTOXDlg->GetCurrentTOXType();
long nData = lcl_TOXTypesToUserData(aCurType);
sal_IntPtr nData = lcl_TOXTypesToUserData(aCurType);
aTypeLB.SelectEntryPos(aTypeLB.GetEntryPos((void*)nData));
sAutoMarkURL = INetURLObject::decode( rSh.GetTOIAutoMarkURL(),
@ -1316,7 +1316,7 @@ int SwTOXSelectTabPage::DeactivatePage( SfxItemSet* _pSet )
{
if(_pSet)
_pSet->Put(SfxUInt16Item(FN_PARAM_TOX_TYPE,
(sal_uInt16)(long)aTypeLB.GetEntryData( aTypeLB.GetSelectEntryPos() )));
(sal_uInt16)(sal_IntPtr)aTypeLB.GetEntryData( aTypeLB.GetSelectEntryPos() )));
FillTOXDescription();
return LEAVE_PAGE;
}
@ -2641,7 +2641,7 @@ IMPL_LINK(SwTOXEntryTabPage, TokenSelectedHdl, SwFormToken*, pToken)
IMPL_LINK(SwTOXEntryTabPage, StyleSelectHdl, ListBox*, pBox)
{
String sEntry = pBox->GetSelectEntry();
sal_uInt16 nId = (sal_uInt16)(long)pBox->GetEntryData(pBox->GetSelectEntryPos());
sal_uInt16 nId = (sal_uInt16)(sal_IntPtr)pBox->GetEntryData(pBox->GetSelectEntryPos());
aEditStylePB.Enable(sEntry != sNoCharStyle);
if(sEntry == sNoCharStyle)
sEntry.Erase();

View File

@ -96,7 +96,7 @@ void SwNumberingTypeListBox::Reload(sal_uInt16 nTypeFlags)
ResStringArray& rNames = aNames.GetNames();
for(sal_uInt16 i = 0; i < rNames.Count(); i++)
{
long nValue = rNames.GetValue(i);
sal_IntPtr nValue = rNames.GetValue(i);
bool bInsert = true;
sal_uInt16 nPos = LISTBOX_APPEND;
switch(nValue)

View File

@ -1111,7 +1111,7 @@ PopupMenu* SwContentTree::CreateContextMenu( void )
// Indentation for outlines (and sections)
long SwContentTree::GetTabPos( SvTreeListEntry* pEntry, SvLBoxTab* pTab)
sal_IntPtr SwContentTree::GetTabPos( SvTreeListEntry* pEntry, SvLBoxTab* pTab)
{
sal_uInt16 nLevel = 0;
if(lcl_IsContent(pEntry))
@ -3030,7 +3030,7 @@ NaviContentBookmark::NaviContentBookmark( const String &rUrl,
const SwDocShell* pDocSh ) :
aUrl( rUrl ),
aDescr(rDesc),
nDocSh((long)pDocSh),
nDocSh((sal_IntPtr)pDocSh),
nDefDrag( nDragType )
{
}

View File

@ -528,7 +528,7 @@ DragDropMode SwGlobalTree::NotifyStartDrag( TransferDataContainer& ,
return SV_DRAGDROP_CTRL_MOVE;
}
long SwGlobalTree::GetTabPos( SvTreeListEntry*, SvLBoxTab* pTab)
sal_IntPtr SwGlobalTree::GetTabPos( SvTreeListEntry*, SvLBoxTab* pTab)
{
return pTab->GetPos() - GLBL_TABPOS_SUB;
}

View File

@ -612,7 +612,7 @@ void FillCharStyleListBox(ListBox& rToFill, SwDocShell* pDocSh, bool bSorted, bo
nPos = InsertStringSorted(pBase->GetName(), rToFill, bHasOffset );
else
nPos = rToFill.InsertEntry(pBase->GetName());
long nPoolId = SwStyleNameMapper::GetPoolIdFromUIName( pBase->GetName(), nsSwGetPoolIdFromName::GET_POOLID_CHRFMT );
sal_IntPtr nPoolId = SwStyleNameMapper::GetPoolIdFromUIName( pBase->GetName(), nsSwGetPoolIdFromName::GET_POOLID_CHRFMT );
rToFill.SetEntryData( nPos, (void*) (nPoolId));
}
pBase = pPool->Next();
@ -632,7 +632,7 @@ void FillCharStyleListBox(ListBox& rToFill, SwDocShell* pDocSh, bool bSorted, bo
nPos = InsertStringSorted(rName, rToFill, bHasOffset );
else
nPos = rToFill.InsertEntry(rName);
long nPoolId = USHRT_MAX;
sal_IntPtr nPoolId = USHRT_MAX;
rToFill.SetEntryData( nPos, (void*) (nPoolId));
}
}

View File

@ -537,7 +537,7 @@ void EventList::Clear()
}
//--------------------------------------------------------------------------
void EventList::AddEvent( long nType, long nPos, long nCount )
void EventList::AddEvent( sal_IntPtr nType, sal_IntPtr nPos, sal_IntPtr nCount )
{
ListAction *pAction = new ListAction;
pAction->Position = nPos;

View File

@ -78,10 +78,10 @@ struct SortInfo
struct SortListData
{
sal_Bool mbModified;
long mnCurPos;
long mnOldPos;
sal_IntPtr mnCurPos;
sal_IntPtr mnOldPos;
SortListData( long nPos, sal_Bool bModified = sal_False );
SortListData( sal_IntPtr nPos, sal_Bool bModified = sal_False );
};
//============================================================================
@ -1015,9 +1015,9 @@ void SAL_CALL SortedResultSet::removeVetoableChangeListener(
//--------------------------------------------------------------------------
// private methods
//--------------------------------------------------------------------------
long SortedResultSet::CompareImpl( Reference < XResultSet > xResultOne,
sal_IntPtr SortedResultSet::CompareImpl( Reference < XResultSet > xResultOne,
Reference < XResultSet > xResultTwo,
long nIndexOne, long nIndexTwo,
sal_IntPtr nIndexOne, sal_IntPtr nIndexTwo,
SortInfo* pSortInfo )
throw( SQLException, RuntimeException )
@ -1025,8 +1025,8 @@ long SortedResultSet::CompareImpl( Reference < XResultSet > xResultOne,
Reference < XRow > xRowOne = Reference< XRow >::query( xResultOne );
Reference < XRow > xRowTwo = Reference< XRow >::query( xResultTwo );
long nCompare = 0;
long nColumn = pSortInfo->mnColumn;
sal_IntPtr nCompare = 0;
sal_IntPtr nColumn = pSortInfo->mnColumn;
switch ( pSortInfo->mnType )
{
@ -1230,12 +1230,12 @@ long SortedResultSet::CompareImpl( Reference < XResultSet > xResultOne,
}
//--------------------------------------------------------------------------
long SortedResultSet::CompareImpl( Reference < XResultSet > xResultOne,
sal_IntPtr SortedResultSet::CompareImpl( Reference < XResultSet > xResultOne,
Reference < XResultSet > xResultTwo,
long nIndexOne, long nIndexTwo )
sal_IntPtr nIndexOne, sal_IntPtr nIndexTwo )
throw( SQLException, RuntimeException )
{
long nCompare = 0;
sal_IntPtr nCompare = 0;
SortInfo* pInfo = mpSortInfo;
while ( !nCompare && pInfo )
@ -1272,12 +1272,12 @@ long SortedResultSet::CompareImpl( Reference < XResultSet > xResultOne,
}
//--------------------------------------------------------------------------
long SortedResultSet::Compare( SortListData *pOne,
sal_IntPtr SortedResultSet::Compare( SortListData *pOne,
SortListData *pTwo )
throw( SQLException, RuntimeException )
{
long nIndexOne;
long nIndexTwo;
sal_IntPtr nIndexOne;
sal_IntPtr nIndexTwo;
Reference < XResultSet > xResultOne;
Reference < XResultSet > xResultTwo;
@ -1304,23 +1304,23 @@ long SortedResultSet::Compare( SortListData *pOne,
nIndexTwo = pTwo->mnCurPos;
}
long nCompare;
sal_IntPtr nCompare;
nCompare = CompareImpl( xResultOne, xResultTwo,
nIndexOne, nIndexTwo );
return nCompare;
}
//--------------------------------------------------------------------------
long SortedResultSet::FindPos( SortListData *pEntry,
long _nStart, long _nEnd )
sal_IntPtr SortedResultSet::FindPos( SortListData *pEntry,
sal_IntPtr _nStart, sal_IntPtr _nEnd )
throw( SQLException, RuntimeException )
{
if ( _nStart > _nEnd )
return _nStart + 1;
long nStart = _nStart;
long nEnd = _nEnd;
long nMid = 0, nCompare = 0;
sal_IntPtr nStart = _nStart;
sal_IntPtr nEnd = _nEnd;
sal_IntPtr nMid = 0, nCompare = 0;
SortListData *pMid;
@ -1331,7 +1331,7 @@ long SortedResultSet::FindPos( SortListData *pEntry,
nCompare = Compare( pEntry, pMid );
if ( !nCompare )
nCompare = ((long) pEntry ) - ( (long) pMid );
nCompare = ((sal_IntPtr) pEntry ) - ( (sal_IntPtr) pMid );
if ( nCompare < 0 ) // pEntry < pMid
nEnd = nMid - 1;
@ -1394,7 +1394,7 @@ void SortedResultSet::CopyData( SortedResultSet *pSource )
const SortedEntryList *pSrcS2O = pSource->GetS2OList();
const SimpleList *pSrcO2S = pSource->GetO2SList();
long i, nCount;
sal_IntPtr i, nCount;
maS2O.Clear();
maO2S.Clear();
@ -1431,7 +1431,7 @@ void SortedResultSet::Initialize(
SortListData *pData = new SortListData( 0 );
maS2O.Insert( pData, 0 );
long nIndex = 1;
sal_IntPtr nIndex = 1;
// now fetch all the elements from the original result set,
// get there new position in the sorted result set and insert
@ -1440,7 +1440,7 @@ void SortedResultSet::Initialize(
while ( mxOriginal->absolute( nIndex ) )
{
pData = new SortListData( nIndex );
long nPos = FindPos( pData, 1, nIndex-1 );
sal_IntPtr nPos = FindPos( pData, 1, nIndex-1 );
maS2O.Insert( pData, nPos );
@ -1470,7 +1470,7 @@ void SortedResultSet::Initialize(
}
//--------------------------------------------------------------------------
void SortedResultSet::CheckProperties( long nOldCount, sal_Bool bWasFinal )
void SortedResultSet::CheckProperties( sal_IntPtr nOldCount, sal_Bool bWasFinal )
{
osl::Guard< osl::Mutex > aGuard( maMutex );
@ -1510,11 +1510,11 @@ void SortedResultSet::CheckProperties( long nOldCount, sal_Bool bWasFinal )
}
//-------------------------------------------------------------------------
void SortedResultSet::InsertNew( long nPos, long nCount )
void SortedResultSet::InsertNew( sal_IntPtr nPos, sal_IntPtr nCount )
{
// for all entries in the msS20-list, which are >= nPos, increase by nCount
SortListData *pData;
long i, nEnd;
sal_IntPtr i, nEnd;
nEnd = maS2O.Count();
for ( i=1; i<=nEnd; i++ )
@ -1541,10 +1541,10 @@ void SortedResultSet::InsertNew( long nPos, long nCount )
}
//-------------------------------------------------------------------------
void SortedResultSet::Remove( long nPos, long nCount, EventList *pEvents )
void SortedResultSet::Remove( sal_IntPtr nPos, sal_IntPtr nCount, EventList *pEvents )
{
sal_uInt32 i, j;
long nOldLastSort;
sal_IntPtr nOldLastSort;
// correct mnLastSort first
nOldLastSort = mnLastSort;
@ -1560,12 +1560,12 @@ void SortedResultSet::Remove( long nPos, long nCount, EventList *pEvents )
// in the original2sorted list
for ( i=0; i < (sal_uInt32) nCount; i++ )
{
long nSortPos = (long) maO2S.GetObject( nPos );
sal_IntPtr nSortPos = (sal_IntPtr) maO2S.GetObject( nPos );
maO2S.Remove( (sal_uInt32) nPos );
for ( j=1; j<=maO2S.Count(); j++ )
{
long nVal = (long) maO2S.GetObject( j );
sal_IntPtr nVal = (sal_IntPtr) maO2S.GetObject( j );
if ( nVal > nSortPos )
{
--nVal;
@ -1595,17 +1595,17 @@ void SortedResultSet::Remove( long nPos, long nCount, EventList *pEvents )
}
//-------------------------------------------------------------------------
void SortedResultSet::Move( long nPos, long nCount, long nOffset )
void SortedResultSet::Move( sal_IntPtr nPos, sal_IntPtr nCount, sal_IntPtr nOffset )
{
if ( !nOffset )
return;
long i, nSortPos, nTo;
sal_IntPtr i, nSortPos, nTo;
SortListData *pData;
for ( i=0; i<nCount; i++ )
{
nSortPos = (long) maO2S.GetObject( nPos+i );
nSortPos = (sal_IntPtr) maO2S.GetObject( nPos+i );
pData = maS2O.GetData( nSortPos );
pData->mnCurPos += nOffset;
}
@ -1614,50 +1614,50 @@ void SortedResultSet::Move( long nPos, long nCount, long nOffset )
{
for ( i=nPos+nOffset; i<nPos; i++ )
{
nSortPos = (long) maO2S.GetObject( i );
nSortPos = (sal_IntPtr) maO2S.GetObject( i );
pData = maS2O.GetData( nSortPos );
pData->mnCurPos += nCount;
}
}
else
{
long nStart = nPos + nCount;
long nEnd = nStart + nOffset;
sal_IntPtr nStart = nPos + nCount;
sal_IntPtr nEnd = nStart + nOffset;
for ( i=nStart; i<nEnd; i++ )
{
nSortPos = (long) maO2S.GetObject( i );
nSortPos = (sal_IntPtr) maO2S.GetObject( i );
pData = maS2O.GetData( nSortPos );
pData->mnCurPos -= nCount;
}
}
// remember the to be moved entries
long *pTmpArr = new long[ nCount ];
sal_IntPtr *pTmpArr = new sal_IntPtr[ nCount ];
for ( i=0; i<nCount; i++ )
pTmpArr[i] = (long)maO2S.GetObject( (sal_uInt32)( nPos+i ) );
pTmpArr[i] = (sal_IntPtr)maO2S.GetObject( (sal_uInt32)( nPos+i ) );
// now move the entries, which are in the way
if ( nOffset < 0 )
{
// be carefully here, because nOffset is negative here, so an
// addition is a subtraction
long nFrom = nPos - 1;
sal_IntPtr nFrom = nPos - 1;
nTo = nPos + nCount - 1;
// same for i here
for ( i=0; i>nOffset; i-- )
{
long nVal = (long) maO2S.GetObject( (sal_uInt32)( nFrom+i ) );
sal_IntPtr nVal = (sal_IntPtr) maO2S.GetObject( (sal_uInt32)( nFrom+i ) );
maO2S.Replace( (void*) nVal, (sal_uInt32)( nTo+i ) );
}
}
else
{
long nStart = nPos + nCount;
sal_IntPtr nStart = nPos + nCount;
for ( i=0; i<nOffset; i++ )
{
long nVal = (long) maO2S.GetObject( (sal_uInt32)( nStart+i ) );
sal_IntPtr nVal = (sal_IntPtr) maO2S.GetObject( (sal_uInt32)( nStart+i ) );
maO2S.Replace( (void*) nVal, (sal_uInt32)( nPos+i ) );
}
}
@ -1693,7 +1693,7 @@ void SortedResultSet::BuildSortInfo(
OUString aPropName;
SortInfo *pInfo;
for ( long i=xSortInfo.getLength(); i > 0; )
for ( sal_IntPtr i=xSortInfo.getLength(); i > 0; )
{
--i;
nColumn = pSortInfo[ i ].ColumnIndex;
@ -1724,11 +1724,11 @@ void SortedResultSet::BuildSortInfo(
}
//-------------------------------------------------------------------------
void SortedResultSet::SetChanged( long nPos, long nCount )
void SortedResultSet::SetChanged( sal_IntPtr nPos, sal_IntPtr nCount )
{
for ( long i=0; i<nCount; i++ )
for ( sal_IntPtr i=0; i<nCount; i++ )
{
long nSortPos = (long) maO2S.GetObject( nPos );
sal_IntPtr nSortPos = (sal_IntPtr) maO2S.GetObject( nPos );
if ( nSortPos < mnLastSort )
{
SortListData *pData = maS2O.GetData( nSortPos );
@ -1746,8 +1746,8 @@ void SortedResultSet::SetChanged( long nPos, long nCount )
void SortedResultSet::ResortModified( EventList* pList )
{
sal_uInt32 i, j;
long nCompare, nCurPos, nNewPos;
long nStart, nEnd, nOffset, nVal;
sal_IntPtr nCompare, nCurPos, nNewPos;
sal_IntPtr nStart, nEnd, nOffset, nVal;
SortListData *pData;
ListAction *pAction;
@ -1760,7 +1760,7 @@ void SortedResultSet::ResortModified( EventList* pList )
pData->mbModified = sal_False;
if ( nCompare != 0 )
{
nCurPos = (long) maO2S.GetObject( (sal_uInt32) pData->mnCurPos );
nCurPos = (sal_IntPtr) maO2S.GetObject( (sal_uInt32) pData->mnCurPos );
if ( nCompare < 0 )
{
nNewPos = FindPos( pData, 1, nCurPos-1 );
@ -1783,7 +1783,7 @@ void SortedResultSet::ResortModified( EventList* pList )
maS2O.Insert( pData, nNewPos );
for ( j=1; j<maO2S.Count(); j++ )
{
nVal = (long) maO2S.GetObject( (sal_uInt32)( j ) );
nVal = (sal_IntPtr) maO2S.GetObject( (sal_uInt32)( j ) );
if ( ( nStart <= nVal ) && ( nVal <= nEnd ) )
{
nVal += nOffset;
@ -1816,11 +1816,11 @@ void SortedResultSet::ResortModified( EventList* pList )
//-------------------------------------------------------------------------
void SortedResultSet::ResortNew( EventList* pList )
{
long i, j, nNewPos, nVal;
sal_IntPtr i, j, nNewPos, nVal;
SortListData *pData;
try {
for ( i = mnLastSort; i<(long)maS2O.Count(); i++ )
for ( i = mnLastSort; i<(sal_IntPtr)maS2O.Count(); i++ )
{
pData = (SortListData*) maModList.GetObject( i );
nNewPos = FindPos( pData, 1, mnLastSort );
@ -1829,9 +1829,9 @@ void SortedResultSet::ResortNew( EventList* pList )
maS2O.Remove( (sal_uInt32) i );
maS2O.Insert( pData, nNewPos );
// maO2S liste korigieren
for ( j=1; j<(long)maO2S.Count(); j++ )
for ( j=1; j<(sal_IntPtr)maO2S.Count(); j++ )
{
nVal = (long) maO2S.GetObject( (sal_uInt32)( j ) );
nVal = (sal_IntPtr) maO2S.GetObject( (sal_uInt32)( j ) );
if ( nVal >= nNewPos )
maO2S.Replace( (void*) (nVal+1), (sal_uInt32)( j ) );
}
@ -1852,7 +1852,7 @@ void SortedResultSet::ResortNew( EventList* pList )
// SortListData
//
//-------------------------------------------------------------------------
SortListData::SortListData( long nPos, sal_Bool bModified )
SortListData::SortListData( sal_IntPtr nPos, sal_Bool bModified )
{
mbModified = bModified;
mnCurPos = nPos;
@ -1873,20 +1873,20 @@ void SortedEntryList::Clear()
}
//-------------------------------------------------------------------------
void SortedEntryList::Insert( SortListData *pEntry, long nPos )
void SortedEntryList::Insert( SortListData *pEntry, sal_IntPtr nPos )
{
if ( nPos < (long) maData.size() )
if ( nPos < (sal_IntPtr) maData.size() )
maData.insert( maData.begin() + nPos, pEntry );
else
maData.push_back( pEntry );
}
//-------------------------------------------------------------------------
SortListData* SortedEntryList::Remove( long nPos )
SortListData* SortedEntryList::Remove( sal_IntPtr nPos )
{
SortListData *pData;
if ( nPos < (long) maData.size() )
if ( nPos < (sal_IntPtr) maData.size() )
{
pData = maData[ nPos ];
maData.erase( maData.begin() + nPos );
@ -1898,11 +1898,11 @@ SortListData* SortedEntryList::Remove( long nPos )
}
//-------------------------------------------------------------------------
SortListData* SortedEntryList::GetData( long nPos )
SortListData* SortedEntryList::GetData( sal_IntPtr nPos )
{
SortListData *pData;
if ( nPos < (long) maData.size() )
if ( nPos < (sal_IntPtr) maData.size() )
pData = maData[ nPos ];
else
pData = NULL;
@ -1911,11 +1911,11 @@ SortListData* SortedEntryList::GetData( long nPos )
}
//-------------------------------------------------------------------------
long SortedEntryList::operator [] ( long nPos ) const
sal_IntPtr SortedEntryList::operator [] ( sal_IntPtr nPos ) const
{
SortListData *pData;
if ( nPos < (long) maData.size() )
if ( nPos < (sal_IntPtr) maData.size() )
pData = maData[ nPos ];
else
pData = NULL;

View File

@ -62,11 +62,11 @@ public:
sal_uInt32 Count() const { return (sal_uInt32) maData.size(); }
void Clear();
void Insert( SortListData *pEntry, long nPos );
SortListData* Remove( long nPos );
SortListData* GetData( long nPos );
void Insert( SortListData *pEntry, sal_IntPtr nPos );
SortListData* Remove( sal_IntPtr nPos );
SortListData* GetData( sal_IntPtr nPos );
long operator [] ( long nPos ) const;
sal_IntPtr operator [] ( sal_IntPtr nPos ) const;
};
//-----------------------------------------------------------------------------
@ -81,10 +81,10 @@ public:
sal_uInt32 Count() { return (sal_uInt32) maData.size(); }
void AddEvent( long nType, long nPos, long nCount );
void AddEvent( sal_IntPtr nType, sal_IntPtr nPos, sal_IntPtr nCount );
void Insert( css::ucb::ListAction *pAction ) { maData.push_back( pAction ); }
void Clear();
css::ucb::ListAction* GetAction( long nIndex ) { return maData[ nIndex ]; }
css::ucb::ListAction* GetAction( sal_IntPtr nIndex ) { return maData[ nIndex ]; }
};
//-----------------------------------------------------------------------------
@ -141,30 +141,30 @@ class SortedResultSet:
SortedEntryList maS2O; // maps the sorted entries to the original ones
SimpleList maO2S; // maps the original Entries to the sorted ones
SimpleList maModList; // keeps track of modified entries
long mnLastSort; // index of the last sorted entry;
long mnCurEntry; // index of the current entry
long mnCount; // total count of the elements
sal_IntPtr mnLastSort; // index of the last sorted entry;
sal_IntPtr mnCurEntry; // index of the current entry
sal_IntPtr mnCount; // total count of the elements
sal_Bool mbIsCopy;
private:
long FindPos( SortListData *pEntry, long nStart, long nEnd )
sal_IntPtr FindPos( SortListData *pEntry, sal_IntPtr nStart, sal_IntPtr nEnd )
throw( css::sdbc::SQLException, css::uno::RuntimeException );
long Compare( SortListData *pOne,
sal_IntPtr Compare( SortListData *pOne,
SortListData *pTwo )
throw( css::sdbc::SQLException, css::uno::RuntimeException );
void BuildSortInfo( css::uno::Reference< css::sdbc::XResultSet > aResult,
const css::uno::Sequence < css::ucb::NumberedSortingInfo > &xSortInfo,
const css::uno::Reference< css::ucb::XAnyCompareFactory > &xCompFac );
long CompareImpl( css::uno::Reference < css::sdbc::XResultSet > xResultOne,
sal_IntPtr CompareImpl( css::uno::Reference < css::sdbc::XResultSet > xResultOne,
css::uno::Reference < css::sdbc::XResultSet > xResultTwo,
long nIndexOne, long nIndexTwo,
sal_IntPtr nIndexOne, sal_IntPtr nIndexTwo,
SortInfo* pSortInfo )
throw( css::sdbc::SQLException, css::uno::RuntimeException );
long CompareImpl( css::uno::Reference < css::sdbc::XResultSet > xResultOne,
sal_IntPtr CompareImpl( css::uno::Reference < css::sdbc::XResultSet > xResultOne,
css::uno::Reference < css::sdbc::XResultSet > xResultTwo,
long nIndexOne, long nIndexTwo )
sal_IntPtr nIndexOne, sal_IntPtr nIndexTwo )
throw( css::sdbc::SQLException, css::uno::RuntimeException );
void PropertyChanged( const css::beans::PropertyChangeEvent& rEvt );
@ -176,17 +176,17 @@ public:
const SimpleList* GetO2SList() const { return &maO2S; }
css::uno::Reference < css::sdbc::XResultSet > GetResultSet() const { return mxOriginal; }
SortInfo* GetSortInfo() const { return mpSortInfo; }
long GetCount() const { return mnCount; }
sal_IntPtr GetCount() const { return mnCount; }
void CopyData( SortedResultSet* pSource );
void Initialize( const css::uno::Sequence < css::ucb::NumberedSortingInfo > &xSortInfo,
const css::uno::Reference< css::ucb::XAnyCompareFactory > &xCompFac );
void CheckProperties( long nOldCount, sal_Bool bWasFinal );
void CheckProperties( sal_IntPtr nOldCount, sal_Bool bWasFinal );
void InsertNew( long nPos, long nCount );
void SetChanged( long nPos, long nCount );
void Remove( long nPos, long nCount, EventList *pList );
void Move( long nPos, long nCount, long nOffset );
void InsertNew( sal_IntPtr nPos, sal_IntPtr nCount );
void SetChanged( sal_IntPtr nPos, sal_IntPtr nCount );
void Remove( sal_IntPtr nPos, sal_IntPtr nCount, EventList *pList );
void Move( sal_IntPtr nPos, sal_IntPtr nCount, sal_IntPtr nOffset );
void ResortModified( EventList* pList );
void ResortNew( EventList* pList );

View File

@ -24,6 +24,7 @@
#include "nss.h"
#include "certt.h"
#include <sal/macros.h>
#include <sal/types.h>
#include "../diagnose.hxx"
@ -89,7 +90,7 @@ printChainFailure(CERTVerifyLog *log)
switch (node->error)
{
case SEC_ERROR_INADEQUATE_KEY_USAGE:
errorFlags = (unsigned long)node->arg;
errorFlags = (sal_uIntPtr)node->arg;
switch (errorFlags)
{
case KU_DIGITAL_SIGNATURE:
@ -107,7 +108,7 @@ printChainFailure(CERTVerifyLog *log)
}
break;
case SEC_ERROR_INADEQUATE_CERT_TYPE:
errorFlags = (unsigned long)node->arg;
errorFlags = (sal_uIntPtr)node->arg;
switch (errorFlags)
{
case NS_CERT_TYPE_SSL_CLIENT: