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()
|
||||
{
|
||||
return ImplRepository::Instance().setApplicationBasicManager( nullptr );
|
||||
ImplRepository::Instance().setApplicationBasicManager( nullptr );
|
||||
}
|
||||
|
||||
|
||||
|
@ -83,17 +83,17 @@ bool SbiGood( SvStream& r )
|
||||
}
|
||||
|
||||
// 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 );
|
||||
return nPos;
|
||||
}
|
||||
|
||||
// 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.WriteInt32(nPos - nOff - 8 );
|
||||
r.Seek( nPos );
|
||||
@ -114,7 +114,7 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
|
||||
Clear();
|
||||
// Read Master-Record
|
||||
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 lDimBase;
|
||||
sal_uInt16 nReserved1;
|
||||
@ -135,7 +135,7 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
|
||||
|
||||
bool bLegacy = ( nVersion < B_EXT_IMG_VERSION );
|
||||
|
||||
sal_Size nNext;
|
||||
sal_uInt64 nNext;
|
||||
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
|
||||
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)
|
||||
{
|
||||
SAL_WARN("basic", "Parsing error: " << nMaxStrings <<
|
||||
@ -207,8 +207,8 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
|
||||
{
|
||||
if( bBadVer ) break;
|
||||
//assuming an empty string with just the lead 32bit len indicator
|
||||
const size_t nMinStringSize = 4;
|
||||
const size_t nMaxStrings = r.remainingSize() / nMinStringSize;
|
||||
const sal_uInt64 nMinStringSize = 4;
|
||||
const sal_uInt64 nMaxStrings = r.remainingSize() / nMinStringSize;
|
||||
if (nCount > 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
|
||||
const size_t nMinStringSize = (eCharSet == RTL_TEXTENCODING_UNICODE) ? 4 : 2;
|
||||
const size_t nMinRecordSize = nMinStringSize + sizeof(sal_Int16);
|
||||
const size_t nMaxRecords = r.remainingSize() / nMinRecordSize;
|
||||
const sal_uInt64 nMinRecordSize = nMinStringSize + sizeof(sal_Int16);
|
||||
const sal_uInt64 nMaxRecords = r.remainingSize() / nMinRecordSize;
|
||||
if (nCount > nMaxRecords)
|
||||
{
|
||||
SAL_WARN("basic", "Parsing error: " << nMaxRecords <<
|
||||
@ -261,7 +261,7 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
|
||||
sal_uInt16 nTypeMembers;
|
||||
r.ReadUInt16(nTypeMembers);
|
||||
|
||||
const size_t nMaxTypeMembers = r.remainingSize() / 8;
|
||||
const sal_uInt64 nMaxTypeMembers = r.remainingSize() / 8;
|
||||
if (nTypeMembers > nMaxTypeMembers)
|
||||
{
|
||||
SAL_WARN("basic", "Parsing error: " << nMaxTypeMembers <<
|
||||
@ -375,8 +375,8 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
|
||||
return true;
|
||||
}
|
||||
// First of all the header
|
||||
sal_uIntPtr nStart = SbiOpenRecord( r, B_MODULE, 1 );
|
||||
sal_uIntPtr nPos;
|
||||
sal_uInt64 nStart = SbiOpenRecord( r, B_MODULE, 1 );
|
||||
sal_uInt64 nPos;
|
||||
|
||||
eCharSet = GetSOStoreTextEncoding( eCharSet );
|
||||
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
|
||||
if( !rMsg.isEmpty() )
|
||||
{
|
||||
code = (sal_uIntPtr)*new StringErrorInfo( code, rMsg );
|
||||
code = (SbError)*new StringErrorInfo( code, rMsg );
|
||||
}
|
||||
SetErrorData( code, l, c1, c2 );
|
||||
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()) +
|
||||
"\'\n" + OUString(!GetSbData()->aErrMsg.isEmpty() ? GetSbData()->aErrMsg : rMsg);
|
||||
code = (sal_uIntPtr)*new StringErrorInfo( code, aTmp );
|
||||
code = (SbError)*new StringErrorInfo( code, aTmp );
|
||||
}
|
||||
else
|
||||
{
|
||||
code = (sal_uIntPtr)*new StringErrorInfo( code, rMsg );
|
||||
code = (SbError)*new StringErrorInfo( code, rMsg );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,9 +48,9 @@ namespace o3tl
|
||||
class SbiStream
|
||||
{
|
||||
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;
|
||||
sal_uIntPtr nLine;
|
||||
sal_uInt64 nLine;
|
||||
short nLen; // buffer length
|
||||
SbiStreamFlags nMode;
|
||||
short nChan;
|
||||
@ -73,8 +73,8 @@ public:
|
||||
bool IsAppend() const { return bool(nMode & SbiStreamFlags::Append); }
|
||||
short GetBlockLen() const { return nLen; }
|
||||
SbiStreamFlags GetMode() const { return nMode; }
|
||||
sal_uIntPtr GetLine() const { return nLine; }
|
||||
void SetExpandOnWriteTo( sal_uIntPtr n ) { nExpandOnWriteTo = n; }
|
||||
sal_uInt64 GetLine() const { return nLine; }
|
||||
void SetExpandOnWriteTo( sal_uInt64 n ) { nExpandOnWriteTo = n; }
|
||||
void ExpandFile();
|
||||
SvStream* GetStrm() { return pStrm; }
|
||||
};
|
||||
|
@ -301,8 +301,8 @@ void ODbaseIndex::Release(bool bSave)
|
||||
m_aRoot.Clear();
|
||||
}
|
||||
// Release all references, before the FileStream will be closed
|
||||
for (sal_uIntPtr i = 0; i < m_aCollector.size(); i++)
|
||||
m_aCollector[i]->QueryDelete();
|
||||
for (auto& i : m_aCollector)
|
||||
i->QueryDelete();
|
||||
|
||||
m_aCollector.clear();
|
||||
|
||||
|
@ -452,7 +452,7 @@ namespace cppcanvas
|
||||
|
||||
// at least _one_ call to GDIMetaFile::NextAction() is
|
||||
// executed
|
||||
sal_uIntPtr nPos( 1 );
|
||||
size_t nPos( 1 );
|
||||
|
||||
MetaAction* pCurrAct;
|
||||
while( (pCurrAct=rMtf.NextAction()) != nullptr )
|
||||
|
@ -83,7 +83,7 @@ void NewMenuController::setMenuImages( PopupMenu* pPopupMenu, bool bSetImages )
|
||||
bool bImageSet( false );
|
||||
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);
|
||||
if (pAttributes)
|
||||
aImageId = pAttributes->aImageId;
|
||||
@ -346,7 +346,7 @@ void NewMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPopup
|
||||
if (( nItemId != 0 ) &&
|
||||
( pSubMenu->GetItemType( nItemId ) != MenuItemType::SEPARATOR ))
|
||||
{
|
||||
sal_uIntPtr nAttributePtr = pSubMenu->GetUserValue(nItemId);
|
||||
sal_uLong nAttributePtr = pSubMenu->GetUserValue(nItemId);
|
||||
if (nAttributePtr)
|
||||
{
|
||||
MenuAttributes* pAttributes = reinterpret_cast<MenuAttributes *>(nAttributePtr);
|
||||
@ -411,7 +411,7 @@ void SAL_CALL NewMenuController::itemSelected( const css::awt::MenuEvent& rEvent
|
||||
SolarMutexGuard aSolarMutexGuard;
|
||||
PopupMenu* pVCLPopupMenu = static_cast<PopupMenu *>(pPopupMenu->GetMenu());
|
||||
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);
|
||||
if (pAttributes)
|
||||
aTargetFrame = pAttributes->aTargetFrame;
|
||||
|
@ -446,7 +446,7 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r
|
||||
PopupMenu* pVCLPopupMenu = pXPopupMenu ? static_cast<PopupMenu *>(pXPopupMenu->GetMenu()) : nullptr;
|
||||
assert(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
|
||||
|
Loading…
x
Reference in New Issue
Block a user