LibreOffice Module sw (master) 1
swtypes.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#include <swtypes.hxx>
21
22#include <editeng/unolingu.hxx>
23#include <vcl/svapp.hxx>
24#include <vcl/graph.hxx>
25
26using namespace com::sun::star;
27
29{
30 const MapMode aMapTwip(MapUnit::MapTwip);
31 Size aSize(rGraphic.GetPrefSize());
32
33 if (!aSize.getWidth() && !aSize.getHeight())
34 {
35 const_cast<Graphic&>(rGraphic).makeAvailable();
36 aSize = rGraphic.GetPrefSize();
37 }
38
39 if (MapUnit::MapPixel == rGraphic.GetPrefMapMode().GetMapUnit())
40 {
41 if (!pOutDev)
43 aSize = pOutDev->PixelToLogic(aSize, aMapTwip);
44 }
45 else
46 {
47 aSize = OutputDevice::LogicToLogic(aSize, rGraphic.GetPrefMapMode(), aMapTwip);
48 }
49 return aSize;
50}
51
52uno::Reference<linguistic2::XSpellChecker1> GetSpellChecker()
53{
55}
56
57uno::Reference<linguistic2::XHyphenator> GetHyphenator() { return LinguMgr::GetHyphenator(); }
58
59uno::Reference<linguistic2::XThesaurus> GetThesaurus() { return LinguMgr::GetThesaurus(); }
60
61uno::Reference<linguistic2::XLinguProperties> GetLinguPropertySet()
62{
64}
65
66/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static OutputDevice * GetDefaultDevice()
Size GetPrefSize() const
MapMode GetPrefMapMode() const
static css::uno::Reference< css::linguistic2::XThesaurus > GetThesaurus()
static css::uno::Reference< css::linguistic2::XSpellChecker1 > GetSpellChecker()
static css::uno::Reference< css::linguistic2::XHyphenator > GetHyphenator()
static css::uno::Reference< css::linguistic2::XLinguProperties > GetLinguPropertySet()
MapUnit GetMapUnit() const
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
constexpr tools::Long getHeight() const
constexpr tools::Long getWidth() const
uno::Reference< linguistic2::XLinguProperties > GetLinguPropertySet()
Definition: swtypes.cxx:61
uno::Reference< linguistic2::XSpellChecker1 > GetSpellChecker()
Definition: swtypes.cxx:52
uno::Reference< linguistic2::XThesaurus > GetThesaurus()
Definition: swtypes.cxx:59
uno::Reference< linguistic2::XHyphenator > GetHyphenator()
Definition: swtypes.cxx:57
Size GetGraphicSizeTwip(const Graphic &rGraphic, vcl::RenderContext *pOutDev)
Definition: swtypes.cxx:28