diff options
-rw-r--r-- | solenv/clang-format/blacklist | 1 | ||||
-rw-r--r-- | vcl/Library_vcl.mk | 1 | ||||
-rw-r--r-- | vcl/inc/salbmp.hxx | 24 | ||||
-rw-r--r-- | vcl/source/bitmap/salbmp.cxx | 44 |
4 files changed, 47 insertions, 23 deletions
diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist index 97d55459cc2f..4b4124a74ae5 100644 --- a/solenv/clang-format/blacklist +++ b/solenv/clang-format/blacklist @@ -17695,6 +17695,7 @@ vcl/source/bitmap/BitmapTools.cxx vcl/source/bitmap/bitmap.cxx vcl/source/bitmap/bitmapfilter.cxx vcl/source/bitmap/checksum.cxx +vcl/source/bitmap/salbmp.cxx vcl/source/components/dtranscomp.cxx vcl/source/components/factory.cxx vcl/source/components/fontident.cxx diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index d08bc424020a..325db8b088bf 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -356,6 +356,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/bitmap/BitmapTools \ vcl/source/bitmap/checksum \ vcl/source/bitmap/Octree \ + vcl/source/bitmap/salbmp \ vcl/source/image/Image \ vcl/source/image/ImageTree \ vcl/source/image/ImageRepository \ diff --git a/vcl/inc/salbmp.hxx b/vcl/inc/salbmp.hxx index bd2f061cb310..103856dfae26 100644 --- a/vcl/inc/salbmp.hxx +++ b/vcl/inc/salbmp.hxx @@ -101,29 +101,7 @@ protected: bool mbChecksumValid; protected: - virtual void updateChecksum() const - { - if (mbChecksumValid) - return; - - BitmapChecksum nCrc = 0; - SalBitmap* pThis = const_cast<SalBitmap*>(this); - BitmapBuffer* pBuf = pThis->AcquireBuffer(BitmapAccessMode::Read); - if (pBuf) - { - nCrc = pBuf->maPalette.GetChecksum(); - nCrc = vcl_get_checksum(nCrc, pBuf->mpBits, pBuf->mnScanlineSize * pBuf->mnHeight); - pThis->ReleaseBuffer(pBuf, BitmapAccessMode::Read); - pThis->mnChecksum = nCrc; - pThis->mbChecksumValid = true; - } - else - { - pThis->mbChecksumValid = false; - } - } - - + virtual void updateChecksum() const; }; #endif diff --git a/vcl/source/bitmap/salbmp.cxx b/vcl/source/bitmap/salbmp.cxx new file mode 100644 index 000000000000..d1c4809007cc --- /dev/null +++ b/vcl/source/bitmap/salbmp.cxx @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include <salbmp.hxx> + +void SalBitmap::updateChecksum() const +{ + if (mbChecksumValid) + return; + + BitmapChecksum nCrc = 0; + SalBitmap* pThis = const_cast<SalBitmap*>(this); + BitmapBuffer* pBuf = pThis->AcquireBuffer(BitmapAccessMode::Read); + if (pBuf) + { + nCrc = pBuf->maPalette.GetChecksum(); + nCrc = vcl_get_checksum(nCrc, pBuf->mpBits, pBuf->mnScanlineSize * pBuf->mnHeight); + pThis->ReleaseBuffer(pBuf, BitmapAccessMode::Read); + pThis->mnChecksum = nCrc; + pThis->mbChecksumValid = true; + } + else + { + pThis->mbChecksumValid = false; + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |