Some cleanup for sal_uIntPtr usage
Change-Id: Ia9779e6477d8848588f3543d09ea6b4477f594a2 Reviewed-on: https://gerrit.libreoffice.org/21022 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
parent
59ae2d11d5
commit
bccd83ea54
@ -599,7 +599,7 @@ namespace basic
|
|||||||
|
|
||||||
void BasicManagerRepository::resetApplicationBasicManager()
|
void BasicManagerRepository::resetApplicationBasicManager()
|
||||||
{
|
{
|
||||||
return ImplRepository::Instance().setApplicationBasicManager( nullptr );
|
ImplRepository::Instance().setApplicationBasicManager( nullptr );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -83,17 +83,17 @@ bool SbiGood( SvStream& r )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Open Record
|
// Open Record
|
||||||
sal_uIntPtr SbiOpenRecord( SvStream& r, sal_uInt16 nSignature, sal_uInt16 nElem )
|
sal_uInt64 SbiOpenRecord( SvStream& r, sal_uInt16 nSignature, sal_uInt16 nElem )
|
||||||
{
|
{
|
||||||
sal_Size nPos = r.Tell();
|
sal_uInt64 nPos = r.Tell();
|
||||||
r.WriteUInt16( nSignature ).WriteInt32( 0 ).WriteUInt16( nElem );
|
r.WriteUInt16( nSignature ).WriteInt32( 0 ).WriteUInt16( nElem );
|
||||||
return nPos;
|
return nPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close Record
|
// Close Record
|
||||||
void SbiCloseRecord( SvStream& r, sal_Size nOff )
|
void SbiCloseRecord( SvStream& r, sal_uInt64 nOff )
|
||||||
{
|
{
|
||||||
sal_Size nPos = r.Tell();
|
sal_uInt64 nPos = r.Tell();
|
||||||
r.Seek( nOff + 2 );
|
r.Seek( nOff + 2 );
|
||||||
r.WriteInt32(nPos - nOff - 8 );
|
r.WriteInt32(nPos - nOff - 8 );
|
||||||
r.Seek( nPos );
|
r.Seek( nPos );
|
||||||
@ -114,7 +114,7 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
|
|||||||
Clear();
|
Clear();
|
||||||
// Read Master-Record
|
// Read Master-Record
|
||||||
r.ReadUInt16( nSign ).ReadUInt32( nLen ).ReadUInt16( nCount );
|
r.ReadUInt16( nSign ).ReadUInt32( nLen ).ReadUInt16( nCount );
|
||||||
sal_Size nLast = r.Tell() + nLen;
|
sal_uInt64 nLast = r.Tell() + nLen;
|
||||||
sal_uInt32 nCharSet; // System charset
|
sal_uInt32 nCharSet; // System charset
|
||||||
sal_uInt32 lDimBase;
|
sal_uInt32 lDimBase;
|
||||||
sal_uInt16 nReserved1;
|
sal_uInt16 nReserved1;
|
||||||
@ -135,7 +135,7 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
|
|||||||
|
|
||||||
bool bLegacy = ( nVersion < B_EXT_IMG_VERSION );
|
bool bLegacy = ( nVersion < B_EXT_IMG_VERSION );
|
||||||
|
|
||||||
sal_Size nNext;
|
sal_uInt64 nNext;
|
||||||
while( ( nNext = r.Tell() ) < nLast )
|
while( ( nNext = r.Tell() ) < nLast )
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -160,7 +160,7 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
|
|||||||
{
|
{
|
||||||
//assuming an empty string with just the lead 32bit/16bit len indicator
|
//assuming an empty string with just the lead 32bit/16bit len indicator
|
||||||
const size_t nMinStringSize = (eCharSet == RTL_TEXTENCODING_UNICODE) ? 4 : 2;
|
const size_t nMinStringSize = (eCharSet == RTL_TEXTENCODING_UNICODE) ? 4 : 2;
|
||||||
const size_t nMaxStrings = r.remainingSize() / nMinStringSize;
|
const sal_uInt64 nMaxStrings = r.remainingSize() / nMinStringSize;
|
||||||
if (nCount > nMaxStrings)
|
if (nCount > nMaxStrings)
|
||||||
{
|
{
|
||||||
SAL_WARN("basic", "Parsing error: " << nMaxStrings <<
|
SAL_WARN("basic", "Parsing error: " << nMaxStrings <<
|
||||||
@ -207,8 +207,8 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
|
|||||||
{
|
{
|
||||||
if( bBadVer ) break;
|
if( bBadVer ) break;
|
||||||
//assuming an empty string with just the lead 32bit len indicator
|
//assuming an empty string with just the lead 32bit len indicator
|
||||||
const size_t nMinStringSize = 4;
|
const sal_uInt64 nMinStringSize = 4;
|
||||||
const size_t nMaxStrings = r.remainingSize() / nMinStringSize;
|
const sal_uInt64 nMaxStrings = r.remainingSize() / nMinStringSize;
|
||||||
if (nCount > nMaxStrings)
|
if (nCount > nMaxStrings)
|
||||||
{
|
{
|
||||||
SAL_WARN("basic", "Parsing error: " << nMaxStrings <<
|
SAL_WARN("basic", "Parsing error: " << nMaxStrings <<
|
||||||
@ -244,8 +244,8 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
|
|||||||
{
|
{
|
||||||
//assuming an empty string with just the lead 32bit/16bit len indicator
|
//assuming an empty string with just the lead 32bit/16bit len indicator
|
||||||
const size_t nMinStringSize = (eCharSet == RTL_TEXTENCODING_UNICODE) ? 4 : 2;
|
const size_t nMinStringSize = (eCharSet == RTL_TEXTENCODING_UNICODE) ? 4 : 2;
|
||||||
const size_t nMinRecordSize = nMinStringSize + sizeof(sal_Int16);
|
const sal_uInt64 nMinRecordSize = nMinStringSize + sizeof(sal_Int16);
|
||||||
const size_t nMaxRecords = r.remainingSize() / nMinRecordSize;
|
const sal_uInt64 nMaxRecords = r.remainingSize() / nMinRecordSize;
|
||||||
if (nCount > nMaxRecords)
|
if (nCount > nMaxRecords)
|
||||||
{
|
{
|
||||||
SAL_WARN("basic", "Parsing error: " << nMaxRecords <<
|
SAL_WARN("basic", "Parsing error: " << nMaxRecords <<
|
||||||
@ -261,7 +261,7 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
|
|||||||
sal_uInt16 nTypeMembers;
|
sal_uInt16 nTypeMembers;
|
||||||
r.ReadUInt16(nTypeMembers);
|
r.ReadUInt16(nTypeMembers);
|
||||||
|
|
||||||
const size_t nMaxTypeMembers = r.remainingSize() / 8;
|
const sal_uInt64 nMaxTypeMembers = r.remainingSize() / 8;
|
||||||
if (nTypeMembers > nMaxTypeMembers)
|
if (nTypeMembers > nMaxTypeMembers)
|
||||||
{
|
{
|
||||||
SAL_WARN("basic", "Parsing error: " << nMaxTypeMembers <<
|
SAL_WARN("basic", "Parsing error: " << nMaxTypeMembers <<
|
||||||
@ -375,8 +375,8 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// First of all the header
|
// First of all the header
|
||||||
sal_uIntPtr nStart = SbiOpenRecord( r, B_MODULE, 1 );
|
sal_uInt64 nStart = SbiOpenRecord( r, B_MODULE, 1 );
|
||||||
sal_uIntPtr nPos;
|
sal_uInt64 nPos;
|
||||||
|
|
||||||
eCharSet = GetSOStoreTextEncoding( eCharSet );
|
eCharSet = GetSOStoreTextEncoding( eCharSet );
|
||||||
if ( bLegacy )
|
if ( bLegacy )
|
||||||
|
@ -1679,7 +1679,7 @@ bool StarBASIC::CError( SbError code, const OUString& rMsg,
|
|||||||
// Implementation of the code for the string transport to SFX-Error
|
// Implementation of the code for the string transport to SFX-Error
|
||||||
if( !rMsg.isEmpty() )
|
if( !rMsg.isEmpty() )
|
||||||
{
|
{
|
||||||
code = (sal_uIntPtr)*new StringErrorInfo( code, rMsg );
|
code = (SbError)*new StringErrorInfo( code, rMsg );
|
||||||
}
|
}
|
||||||
SetErrorData( code, l, c1, c2 );
|
SetErrorData( code, l, c1, c2 );
|
||||||
GetSbData()->bCompiler = true;
|
GetSbData()->bCompiler = true;
|
||||||
@ -1723,11 +1723,11 @@ bool StarBASIC::RTError( SbError code, const OUString& rMsg, sal_Int32 l, sal_In
|
|||||||
{
|
{
|
||||||
OUString aTmp = "\'" + OUString::number(SbxErrObject::getUnoErrObject()->getNumber()) +
|
OUString aTmp = "\'" + OUString::number(SbxErrObject::getUnoErrObject()->getNumber()) +
|
||||||
"\'\n" + OUString(!GetSbData()->aErrMsg.isEmpty() ? GetSbData()->aErrMsg : rMsg);
|
"\'\n" + OUString(!GetSbData()->aErrMsg.isEmpty() ? GetSbData()->aErrMsg : rMsg);
|
||||||
code = (sal_uIntPtr)*new StringErrorInfo( code, aTmp );
|
code = (SbError)*new StringErrorInfo( code, aTmp );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
code = (sal_uIntPtr)*new StringErrorInfo( code, rMsg );
|
code = (SbError)*new StringErrorInfo( code, rMsg );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,9 +48,9 @@ namespace o3tl
|
|||||||
class SbiStream
|
class SbiStream
|
||||||
{
|
{
|
||||||
SvStream* pStrm;
|
SvStream* pStrm;
|
||||||
sal_uIntPtr nExpandOnWriteTo; // during writing access expand the stream to this size
|
sal_uInt64 nExpandOnWriteTo; // during writing access expand the stream to this size
|
||||||
OString aLine;
|
OString aLine;
|
||||||
sal_uIntPtr nLine;
|
sal_uInt64 nLine;
|
||||||
short nLen; // buffer length
|
short nLen; // buffer length
|
||||||
SbiStreamFlags nMode;
|
SbiStreamFlags nMode;
|
||||||
short nChan;
|
short nChan;
|
||||||
@ -73,8 +73,8 @@ public:
|
|||||||
bool IsAppend() const { return bool(nMode & SbiStreamFlags::Append); }
|
bool IsAppend() const { return bool(nMode & SbiStreamFlags::Append); }
|
||||||
short GetBlockLen() const { return nLen; }
|
short GetBlockLen() const { return nLen; }
|
||||||
SbiStreamFlags GetMode() const { return nMode; }
|
SbiStreamFlags GetMode() const { return nMode; }
|
||||||
sal_uIntPtr GetLine() const { return nLine; }
|
sal_uInt64 GetLine() const { return nLine; }
|
||||||
void SetExpandOnWriteTo( sal_uIntPtr n ) { nExpandOnWriteTo = n; }
|
void SetExpandOnWriteTo( sal_uInt64 n ) { nExpandOnWriteTo = n; }
|
||||||
void ExpandFile();
|
void ExpandFile();
|
||||||
SvStream* GetStrm() { return pStrm; }
|
SvStream* GetStrm() { return pStrm; }
|
||||||
};
|
};
|
||||||
|
@ -301,8 +301,8 @@ void ODbaseIndex::Release(bool bSave)
|
|||||||
m_aRoot.Clear();
|
m_aRoot.Clear();
|
||||||
}
|
}
|
||||||
// Release all references, before the FileStream will be closed
|
// Release all references, before the FileStream will be closed
|
||||||
for (sal_uIntPtr i = 0; i < m_aCollector.size(); i++)
|
for (auto& i : m_aCollector)
|
||||||
m_aCollector[i]->QueryDelete();
|
i->QueryDelete();
|
||||||
|
|
||||||
m_aCollector.clear();
|
m_aCollector.clear();
|
||||||
|
|
||||||
|
@ -452,7 +452,7 @@ namespace cppcanvas
|
|||||||
|
|
||||||
// at least _one_ call to GDIMetaFile::NextAction() is
|
// at least _one_ call to GDIMetaFile::NextAction() is
|
||||||
// executed
|
// executed
|
||||||
sal_uIntPtr nPos( 1 );
|
size_t nPos( 1 );
|
||||||
|
|
||||||
MetaAction* pCurrAct;
|
MetaAction* pCurrAct;
|
||||||
while( (pCurrAct=rMtf.NextAction()) != nullptr )
|
while( (pCurrAct=rMtf.NextAction()) != nullptr )
|
||||||
|
@ -83,7 +83,7 @@ void NewMenuController::setMenuImages( PopupMenu* pPopupMenu, bool bSetImages )
|
|||||||
bool bImageSet( false );
|
bool bImageSet( false );
|
||||||
OUString aImageId;
|
OUString aImageId;
|
||||||
|
|
||||||
sal_uIntPtr nAttributePtr = pPopupMenu->GetUserValue(sal::static_int_cast<sal_uInt16>(i));
|
sal_uLong nAttributePtr = pPopupMenu->GetUserValue(sal::static_int_cast<sal_uInt16>(i));
|
||||||
MenuAttributes* pAttributes = reinterpret_cast<MenuAttributes *>(nAttributePtr);
|
MenuAttributes* pAttributes = reinterpret_cast<MenuAttributes *>(nAttributePtr);
|
||||||
if (pAttributes)
|
if (pAttributes)
|
||||||
aImageId = pAttributes->aImageId;
|
aImageId = pAttributes->aImageId;
|
||||||
@ -346,7 +346,7 @@ void NewMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPopup
|
|||||||
if (( nItemId != 0 ) &&
|
if (( nItemId != 0 ) &&
|
||||||
( pSubMenu->GetItemType( nItemId ) != MenuItemType::SEPARATOR ))
|
( pSubMenu->GetItemType( nItemId ) != MenuItemType::SEPARATOR ))
|
||||||
{
|
{
|
||||||
sal_uIntPtr nAttributePtr = pSubMenu->GetUserValue(nItemId);
|
sal_uLong nAttributePtr = pSubMenu->GetUserValue(nItemId);
|
||||||
if (nAttributePtr)
|
if (nAttributePtr)
|
||||||
{
|
{
|
||||||
MenuAttributes* pAttributes = reinterpret_cast<MenuAttributes *>(nAttributePtr);
|
MenuAttributes* pAttributes = reinterpret_cast<MenuAttributes *>(nAttributePtr);
|
||||||
@ -411,7 +411,7 @@ void SAL_CALL NewMenuController::itemSelected( const css::awt::MenuEvent& rEvent
|
|||||||
SolarMutexGuard aSolarMutexGuard;
|
SolarMutexGuard aSolarMutexGuard;
|
||||||
PopupMenu* pVCLPopupMenu = static_cast<PopupMenu *>(pPopupMenu->GetMenu());
|
PopupMenu* pVCLPopupMenu = static_cast<PopupMenu *>(pPopupMenu->GetMenu());
|
||||||
aTargetURL.Complete = pVCLPopupMenu->GetItemCommand(rEvent.MenuId);
|
aTargetURL.Complete = pVCLPopupMenu->GetItemCommand(rEvent.MenuId);
|
||||||
sal_uIntPtr nAttributePtr = pVCLPopupMenu->GetUserValue(rEvent.MenuId);
|
sal_uLong nAttributePtr = pVCLPopupMenu->GetUserValue(rEvent.MenuId);
|
||||||
MenuAttributes* pAttributes = reinterpret_cast<MenuAttributes *>(nAttributePtr);
|
MenuAttributes* pAttributes = reinterpret_cast<MenuAttributes *>(nAttributePtr);
|
||||||
if (pAttributes)
|
if (pAttributes)
|
||||||
aTargetFrame = pAttributes->aTargetFrame;
|
aTargetFrame = pAttributes->aTargetFrame;
|
||||||
|
@ -446,7 +446,7 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r
|
|||||||
PopupMenu* pVCLPopupMenu = pXPopupMenu ? static_cast<PopupMenu *>(pXPopupMenu->GetMenu()) : nullptr;
|
PopupMenu* pVCLPopupMenu = pXPopupMenu ? static_cast<PopupMenu *>(pXPopupMenu->GetMenu()) : nullptr;
|
||||||
assert(pVCLPopupMenu);
|
assert(pVCLPopupMenu);
|
||||||
if (pVCLPopupMenu)
|
if (pVCLPopupMenu)
|
||||||
pVCLPopupMenu->SetUserValue( nIndex, sal_uIntPtr( aSortedTbs[i].bContextSensitive ? 1L : 0L ));
|
pVCLPopupMenu->SetUserValue( nIndex, sal_uLong( aSortedTbs[i].bContextSensitive ? 1L : 0L ));
|
||||||
}
|
}
|
||||||
|
|
||||||
// use VCL popup menu pointer to set vital information that are not part of the awt implementation
|
// use VCL popup menu pointer to set vital information that are not part of the awt implementation
|
||||||
|
Loading…
x
Reference in New Issue
Block a user