BitmapScopedWriteAccess
Chris Sherlock
chris.sherlock79 at gmail.com
Tue Jan 14 20:21:33 UTC 2025
Sent from my iPhone
> On 15 Jan 2025, at 12:49 am, Thorsten Behrens <thb at libreoffice.org> wrote:
>
> Hi Chris,
>
> Chris Sherlock wrote:
>> Out of interest, what is “scoped” about BitmapScopedWriteAccess?
>>
> The original idea was providing RAII semantics to the bitmap access
> objects (c.f. commit a622d4e9d717e64c305399c833d7d15af2fc109e how that
> looked like during OOo times). See the 'mrBitmap.ReleaseAccess(
> mpAccess )' there, for what previously had to be done manually.
>
> Over the years, the plain Bitmap*Access objects grew proper value
> semantics, so I guess the scoped-access gold-plating is by now
> pointless. That most recent rework FWICT happend with
>
> https://gerrit.libreoffice.org/c/core/+/160293
>
Thanks, that is helpful but I still don’t understand why, when it is a scoped instance with RAII semantics, we need to run reset manually after we’ve finished using it.
Why not just use a BitmapWriteAccess? It does exactly the same thing.
Chris
> HTH,
>
> -- Thorsten
> <signature.asc>
More information about the LibreOffice
mailing list