calc: on editing invalidation of view with different zoom is wrong
[LibreOffice.git] / drawinglayer / source / tools / emfpimageattributes.cxx
blobc13da361bf1a2d5f62b527a461e306e7f2d7542a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <sal/log.hxx>
22 #include "emfpimageattributes.hxx"
24 using namespace ::com::sun::star;
25 using namespace ::basegfx;
27 namespace emfplushelper
29 EMFPImageAttributes::EMFPImageAttributes()
30 : EMFPObject()
31 , wrapMode(0)
32 , objectClamp(0)
36 EMFPImageAttributes::~EMFPImageAttributes() {}
38 void EMFPImageAttributes::Read(SvStream& s)
40 sal_uInt32 graphicsVersion, reserved1, reserved2, tempClampColor;
41 sal_uInt8 clampColorBlue, clampColorGreen, clampColorRed, clampColorAlpha;
43 s.ReadUInt32(graphicsVersion)
44 .ReadUInt32(reserved1)
45 .ReadUInt32(wrapMode)
46 .ReadUInt32(tempClampColor)
47 .ReadUInt32(objectClamp)
48 .ReadUInt32(reserved2);
50 clampColorBlue = tempClampColor >> 24;
51 clampColorGreen = (tempClampColor & 0x00FFFFFF) >> 16;
52 clampColorRed = (tempClampColor & 0x0000FFFF) >> 8;
53 clampColorAlpha = tempClampColor & 0x000000FF;
55 clampColor.SetRed(clampColorRed);
56 clampColor.SetGreen(clampColorGreen);
57 clampColor.SetBlue(clampColorBlue);
58 clampColor.SetAlpha(255 - clampColorAlpha);
60 SAL_INFO("drawinglayer.emf", "EMF+\timage attributes");
61 SAL_WARN_IF((reserved1 != 0) || (reserved2 != 0), "drawinglayer.emf",
62 "Reserved field(s) not zero - reserved1: " << std::hex << reserved1
63 << " reserved2: " << reserved2);
64 SAL_WARN_IF((objectClamp != EmpPlusRectClamp) && (objectClamp != EmpPlusBitmapClamp),
65 "drawinglayer.emf", "Invalid object clamp - set to" << std::hex << objectClamp);
66 SAL_INFO("drawinglayer.emf", "EMF+\t image graphics version: 0x"
67 << std::hex << graphicsVersion << " wrap mode: " << wrapMode
68 << " clamp color: " << clampColor
69 << " object clamp: " << objectClamp);
73 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */