sal_uIntPtr->VclPtr<OutputDevice> in XParaPortionList

who knows we had to hide a pointer behind an integer type, but it's been
this way since forever

Change-Id: I9738e1137752cc8226877e2cf0291967b45dbf0e
Reviewed-on: https://gerrit.libreoffice.org/46480
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2017-12-14 11:06:52 +02:00
parent 0f0f585e78
commit bd79b7154d
3 changed files with 4 additions and 4 deletions

View File

@ -98,7 +98,7 @@ XParaPortionList::XParaPortionList(
OutputDevice* pRefDev, sal_uLong nPW, sal_uInt16 _nStretchX, sal_uInt16 _nStretchY) :
aRefMapMode(pRefDev->GetMapMode()), nStretchX(_nStretchX), nStretchY(_nStretchY)
{
nRefDevPtr = reinterpret_cast<sal_uIntPtr>(pRefDev);
nRefDevPtr = pRefDev;
nPaperWidth = nPW;
eRefDevType = pRefDev->GetOutDevType();
}

View File

@ -96,7 +96,7 @@ class XParaPortionList
typedef std::vector<std::unique_ptr<XParaPortion> > ListType;
ListType maList;
sal_uIntPtr nRefDevPtr;
VclPtr<OutputDevice> nRefDevPtr;
OutDevType eRefDevType;
MapMode aRefMapMode;
sal_uInt16 nStretchX;
@ -109,7 +109,7 @@ public:
void push_back(XParaPortion* p);
const XParaPortion& operator[](size_t i) const;
sal_uIntPtr GetRefDevPtr() const { return nRefDevPtr; }
OutputDevice* GetRefDevPtr() const { return nRefDevPtr; }
sal_uLong GetPaperWidth() const { return nPaperWidth; }
OutDevType GetRefDevType() const { return eRefDevType; }
const MapMode& GetRefMapMode() const { return aRefMapMode; }

View File

@ -1186,7 +1186,7 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject
&& ( pPortionInfo->GetStretchX() == nStretchX )
&& ( pPortionInfo->GetStretchY() == nStretchY ) )
{
if ( ( pPortionInfo->GetRefDevPtr() == reinterpret_cast<sal_uIntPtr>(GetRefDevice()) ) ||
if ( ( pPortionInfo->GetRefDevPtr() == GetRefDevice() ) ||
( ( pPortionInfo->GetRefDevType() == OUTDEV_VIRDEV ) &&
( GetRefDevice()->GetOutDevType() == OUTDEV_VIRDEV ) ) )
bUsePortionInfo = true;