calc: on editing invalidation of view with different zoom is wrong
[LibreOffice.git] / vcl / qa / cppunit / fontmocks.hxx
blob7e33ce8e7e13eff9441a3f90ce0f3abe131c6fd3
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/.
8 */
10 #pragma once
12 #include <sal/config.h>
14 #include <font/FontSelectPattern.hxx>
15 #include <font/PhysicalFontFace.hxx>
16 #include <font/PhysicalFontFaceCollection.hxx>
17 #include <fontattributes.hxx>
18 #include <font/LogicalFontInstance.hxx>
20 class TestFontInstance : public LogicalFontInstance
22 public:
23 TestFontInstance(vcl::font::PhysicalFontFace const& rFontFace,
24 vcl::font::FontSelectPattern const& rFontSelectPattern)
25 : LogicalFontInstance(rFontFace, rFontSelectPattern)
29 bool GetGlyphOutline(sal_GlyphId, basegfx::B2DPolyPolygon&, bool) const override
31 return true;
34 protected:
35 bool ImplGetGlyphBoundRect(sal_GlyphId, tools::Rectangle&, bool) const override { return true; }
38 class TestFontFace : public vcl::font::PhysicalFontFace
40 public:
41 TestFontFace(sal_uIntPtr nId)
42 : vcl::font::PhysicalFontFace(FontAttributes())
43 , mnFontId(nId)
47 TestFontFace(FontAttributes const& rFontAttributes, sal_uIntPtr nId)
48 : vcl::font::PhysicalFontFace(rFontAttributes)
49 , mnFontId(nId)
53 rtl::Reference<LogicalFontInstance>
54 CreateFontInstance(vcl::font::FontSelectPattern const& rFontSelectPattern) const override
56 return new TestFontInstance(*this, rFontSelectPattern);
59 sal_IntPtr GetFontId() const override { return mnFontId; }
60 FontCharMapRef GetFontCharMap() const override { return FontCharMap::GetDefaultMap(false); }
61 bool GetFontCapabilities(vcl::FontCapabilities&) const override { return true; }
63 private:
64 sal_IntPtr mnFontId;
67 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */