summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2019-09-23 17:51:38 +0200
committerLuboš Luňák <l.lunak@collabora.com>2019-09-23 18:30:20 +0200
commit8def224fc68ba533a811ef07af1916470e807651 (patch)
tree4027aaacf312d8ef1ac46a6c3fa87a65cd950045
parentcdf86c3dfbc94c8147c5c681c642398427340e9a (diff)
add .cxx file for SalBitmap
And move the non-trivial virtual UpdateChecksum() there. Change-Id: I6776a51373e375e12f1ec9588a9c49410ae5124a
-rw-r--r--solenv/clang-format/blacklist1
-rw-r--r--vcl/Library_vcl.mk1
-rw-r--r--vcl/inc/salbmp.hxx24
-rw-r--r--vcl/source/bitmap/salbmp.cxx44
4 files changed, 47 insertions, 23 deletions
diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist
index 2e6c918d56cc..8dae6b74e154 100644
--- a/solenv/clang-format/blacklist
+++ b/solenv/clang-format/blacklist
@@ -17772,6 +17772,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 f87bbf14483d..cb2b00d5bb23 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -350,6 +350,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: */