LibreOffice Module starmath (master) 1
rect.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 <osl/diagnose.h>
22#include <vcl/metric.hxx>
23#include <vcl/svapp.hxx>
24#include <vcl/virdev.hxx>
25#include <sal/log.hxx>
26
27#include <format.hxx>
28#include <rect.hxx>
29#include <types.hxx>
30#include <smmod.hxx>
31
32namespace {
33
34bool SmGetGlyphBoundRect(const vcl::RenderContext &rDev,
35 const OUString &rText, tools::Rectangle &rRect)
36 // basically the same as 'GetTextBoundRect' (in class 'OutputDevice')
37 // but with a string as argument.
38{
39 // handle special case first
40 if (rText.isEmpty())
41 {
42 rRect.SetEmpty();
43 return true;
44 }
45
46 // get a device where 'OutputDevice::GetTextBoundRect' will be successful
47 OutputDevice *pGlyphDev;
48 if (rDev.GetOutDevType() != OUTDEV_PRINTER)
49 pGlyphDev = const_cast<OutputDevice *>(&rDev);
50 else
51 {
52 // since we format for the printer (where GetTextBoundRect will fail)
53 // we need a virtual device here.
54 pGlyphDev = &SM_MOD()->GetDefaultVirtualDev();
55 }
56
57 const FontMetric aDevFM (rDev.GetFontMetric());
58
60 vcl::Font aFnt(rDev.GetFont());
61 aFnt.SetAlignment(ALIGN_TOP);
62
63 // use scale factor when calling GetTextBoundRect to counter
64 // negative effects from antialiasing which may otherwise result
65 // in significant incorrect bounding rectangles for some characters.
66 Size aFntSize = aFnt.GetFontSize();
67
68 // Workaround to avoid HUGE font sizes and resulting problems
69 tools::Long nScaleFactor = 1;
70 while( aFntSize.Height() > 2000 * nScaleFactor )
71 nScaleFactor *= 2;
72
73 aFnt.SetFontSize( Size( aFntSize.Width() / nScaleFactor, aFntSize.Height() / nScaleFactor ) );
74 pGlyphDev->SetFont(aFnt);
75
76 tools::Long nTextWidth = rDev.GetTextWidth(rText);
77 tools::Rectangle aResult (Point(), Size(nTextWidth, rDev.GetTextHeight())),
78 aTmp;
79
80 bool bSuccess = pGlyphDev->GetTextBoundRect(aTmp, rText);
81 OSL_ENSURE( bSuccess, "GetTextBoundRect failed" );
82
83
84 if (!aTmp.IsEmpty())
85 {
86 aResult = tools::Rectangle(aTmp.Left() * nScaleFactor, aTmp.Top() * nScaleFactor,
87 aTmp.Right() * nScaleFactor, aTmp.Bottom() * nScaleFactor);
88 if (&rDev != pGlyphDev) /* only when rDev is a printer... */
89 {
90 tools::Long nGDTextWidth = pGlyphDev->GetTextWidth(rText);
91 if (nGDTextWidth != 0 &&
92 nTextWidth != nGDTextWidth)
93 {
94 aResult.SetRight( aResult.Right() * nTextWidth );
95 aResult.SetRight( aResult.Right() / ( nGDTextWidth * nScaleFactor) );
96 }
97 }
98 }
99
100 // move rectangle to match possibly different baselines
101 // (because of different devices)
102 tools::Long nDelta = aDevFM.GetAscent() - pGlyphDev->GetFontMetric().GetAscent() * nScaleFactor;
103 aResult.Move(0, nDelta);
104
105 pGlyphDev->Pop();
106
107 rRect = aResult;
108 return bSuccess;
109}
110
111bool SmIsMathAlpha(std::u16string_view aText)
112 // true iff symbol (from StarMath Font) should be treated as letter
113{
114 // Set of symbols, which should be treated as letters in StarMath Font
115 // (to get a normal (non-clipped) SmRect in contrast to the other operators
116 // and symbols).
117 static o3tl::sorted_vector<sal_Unicode> const aMathAlpha({
119 MS_WP, u'\xE070', MS_EMPTYSET,
120 u'\x2113', u'\xE0D6', u'\x2107',
121 u'\x2127', u'\x210A', MS_HBAR,
124 u'\x2373', u'\xE0A5', u'\x2112',
125 u'\x2130', u'\x2131'
126 });
127
128 if (aText.empty())
129 return false;
130
131 OSL_ENSURE(aText.size() == 1, "Sm : string must be exactly one character long");
132 sal_Unicode cChar = aText[0];
133
134 // is it a greek symbol?
135 if (u'\xE0AC' <= cChar && cChar <= u'\xE0D4')
136 return true;
137 // or, does it appear in 'aMathAlpha'?
138 return aMathAlpha.find(cChar) != aMathAlpha.end();
139}
140
141}
142
143
145 // constructs empty rectangle at (0, 0) with width and height 0.
146 : aTopLeft(0, 0)
147 , aSize(0, 0)
148 , nBaseline(0)
149 , nAlignT(0)
150 , nAlignM(0)
151 , nAlignB(0)
152 , nGlyphTop(0)
153 , nGlyphBottom(0)
154 , nItalicLeftSpace(0)
155 , nItalicRightSpace(0)
156 , nLoAttrFence(0)
157 , nHiAttrFence(0)
158 , nBorderWidth(0)
159 , bHasBaseline(false)
160 , bHasAlignInfo(false)
161{
162}
163
164
166{
167 nBaseline = rRect.nBaseline;
169 nAlignT = rRect.nAlignT;
170 nAlignM = rRect.nAlignM;
171 nAlignB = rRect.nAlignB;
175}
176
177
178SmRect::SmRect(const OutputDevice &rDev, const SmFormat *pFormat,
179 const OUString &rText, sal_uInt16 nBorder)
180 // get rectangle fitting for drawing 'rText' on OutputDevice 'rDev'
181 : aTopLeft(0, 0)
182 , aSize(rDev.GetTextWidth(rText), rDev.GetTextHeight())
183{
184 const FontMetric aFM (rDev.GetFontMetric());
185 bool bIsMath = aFM.GetFamilyName().equalsIgnoreAsciiCase( FONTNAME_MATH );
186 bool bAllowSmaller = bIsMath && !SmIsMathAlpha(rText);
187 const tools::Long nFontHeight = rDev.GetFont().GetFontSize().Height();
188
190 bHasAlignInfo = true;
191 bHasBaseline = true;
192 nBaseline = aFM.GetAscent();
193 nAlignT = nBaseline - nFontHeight * 750 / 1000;
194 nAlignM = nBaseline - nFontHeight * 121 / 422;
195 // that's where the horizontal bars of '+', '-', ... are
196 // (1/3 of ascent over baseline)
197 // (121 = 1/3 of 12pt ascent, 422 = 12pt fontheight)
199
200 // workaround for printer fonts with very small (possible 0 or even
201 // negative(!)) leading
202 if (aFM.GetInternalLeading() < 5 && rDev.GetOutDevType() == OUTDEV_PRINTER)
203 {
205
207
208 pWindow->SetMapMode(rDev.GetMapMode());
209 pWindow->SetFont(rDev.GetFontMetric());
210
211 tools::Long nDelta = pWindow->GetFontMetric().GetInternalLeading();
212 if (nDelta == 0)
213 { // this value approx. fits a Leading of 80 at a
214 // Fontheight of 422 (12pt)
215 nDelta = nFontHeight * 8 / 43;
216 }
217 SetTop(GetTop() - nDelta);
218
219 pWindow->Pop();
220 }
221
222 // get GlyphBoundRect
223 tools::Rectangle aGlyphRect;
224 bool bSuccess = SmGetGlyphBoundRect(rDev, rText, aGlyphRect);
225 if (!bSuccess)
226 SAL_WARN("starmath", "Ooops... (Font missing?)");
227
228 nItalicLeftSpace = GetLeft() - aGlyphRect.Left() + nBorderWidth;
229 nItalicRightSpace = aGlyphRect.Right() - GetRight() + nBorderWidth;
230 if (nItalicLeftSpace < 0 && !bAllowSmaller)
232 if (nItalicRightSpace < 0 && !bAllowSmaller)
234
235 tools::Long nDist = 0;
236 if (pFormat)
237 nDist = (rDev.GetFont().GetFontSize().Height()
238 * pFormat->GetDistance(DIS_ORNAMENTSIZE)) / 100;
239
240 nHiAttrFence = aGlyphRect.Top() - 1 - nBorderWidth - nDist;
242
243 nGlyphTop = aGlyphRect.Top() - nBorderWidth;
244 nGlyphBottom = aGlyphRect.Bottom() + nBorderWidth;
245
246 if (bAllowSmaller)
247 {
248 // for symbols and operators from the StarMath Font
249 // we adjust upper and lower margin of the symbol
252 }
253
254 if (nHiAttrFence < GetTop())
256
257 if (nLoAttrFence > GetBottom())
259
260 OSL_ENSURE(rText.isEmpty() || !IsEmpty(),
261 "Sm: empty rectangle created");
262}
263
264
266 // this constructor should never be used for anything textlike because
267 // it will not provide useful values for baseline, AlignT and AlignB!
268 // It's purpose is to get a 'SmRect' for the horizontal line in fractions
269 // as used in 'SmBinVerNode'.
270 : aTopLeft(0, 0)
271 , aSize(nWidth, nHeight)
272 , nBaseline(0)
273 , nItalicLeftSpace(0)
274 , nItalicRightSpace(0)
275 , nBorderWidth(0)
276 , bHasBaseline(false)
277 , bHasAlignInfo(true)
278{
281 nAlignM = (nAlignT + nAlignB) / 2; // this is the default
282}
283
284
286{
287 if (nLeft <= GetRight())
288 { aSize.setWidth( GetRight() - nLeft + 1 );
289 aTopLeft.setX( nLeft );
290 }
291}
292
293
295{
296 if (nRight >= GetLeft())
297 aSize.setWidth( nRight - GetLeft() + 1 );
298}
299
300
302{
303 if (nBottom >= GetTop())
304 aSize.setHeight( nBottom - GetTop() + 1 );
305}
306
307
309{
310 if (nTop <= GetBottom())
311 { aSize.setHeight( GetBottom() - nTop + 1 );
312 aTopLeft.setY( nTop );
313 }
314}
315
316
317void SmRect::Move(const Point &rPosition)
318 // move rectangle by position 'rPosition'.
319{
320 aTopLeft += rPosition;
321
322 tools::Long nDelta = rPosition.Y();
323 nBaseline += nDelta;
324 nAlignT += nDelta;
325 nAlignM += nDelta;
326 nAlignB += nDelta;
327 nGlyphTop += nDelta;
328 nGlyphBottom += nDelta;
329 nHiAttrFence += nDelta;
330 nLoAttrFence += nDelta;
331}
332
333
335 RectHorAlign eHor, RectVerAlign eVer) const
336{ Point aPos (GetTopLeft());
337 // will become the topleft point of the new rectangle position
338
339 // set horizontal or vertical new rectangle position depending on ePos
340 switch (ePos)
341 { case RectPos::Left:
342 aPos.setX( rRect.GetItalicLeft() - GetItalicRightSpace()
343 - GetWidth() );
344 break;
345 case RectPos::Right:
346 aPos.setX( rRect.GetItalicRight() + 1 + GetItalicLeftSpace() );
347 break;
348 case RectPos::Top:
349 aPos.setY( rRect.GetTop() - GetHeight() );
350 break;
351 case RectPos::Bottom:
352 aPos.setY( rRect.GetBottom() + 1 );
353 break;
355 aPos.setX( rRect.GetItalicCenterX() - GetItalicWidth() / 2
356 + GetItalicLeftSpace() );
357 break;
358 default:
359 assert(false);
360 }
361
362 // check if horizontal position is already set
364 // correct error in current vertical position
365 switch (eVer)
366 { case RectVerAlign::Top :
367 aPos.AdjustY(rRect.GetAlignT() - GetAlignT() );
368 break;
369 case RectVerAlign::Mid :
370 aPos.AdjustY(rRect.GetAlignM() - GetAlignM() );
371 break;
373 // align baselines if possible else align mid's
374 if (HasBaseline() && rRect.HasBaseline())
375 aPos.AdjustY(rRect.GetBaseline() - GetBaseline() );
376 else
377 aPos.AdjustY(rRect.GetAlignM() - GetAlignM() );
378 break;
380 aPos.AdjustY(rRect.GetAlignB() - GetAlignB() );
381 break;
383 aPos.AdjustY(rRect.GetCenterY() - GetCenterY() );
384 break;
386 aPos.AdjustY(rRect.GetHiAttrFence() - GetBottom() );
387 break;
389 aPos.AdjustY(SmFromTo(rRect.GetAlignB(), rRect.GetAlignT(), 0.4)
390 - GetCenterY() );
391 break;
393 aPos.AdjustY(rRect.GetLoAttrFence() - GetTop() );
394 break;
395 default :
396 assert(false);
397 }
398
399 // check if vertical position is already set
401 // correct error in current horizontal position
402 switch (eHor)
403 { case RectHorAlign::Left:
404 aPos.AdjustX(rRect.GetItalicLeft() - GetItalicLeft() );
405 break;
407 aPos.AdjustX(rRect.GetItalicCenterX() - GetItalicCenterX() );
408 break;
410 aPos.AdjustX(rRect.GetItalicRight() - GetItalicRight() );
411 break;
412 default:
413 assert(false);
414 }
415
416 return aPos;
417}
418
419
420void SmRect::Union(const SmRect &rRect)
421 // rectangle union of current one with 'rRect'. The result is to be the
422 // smallest rectangles that covers the space of both rectangles.
423 // (empty rectangles cover no space)
425{
426 if (rRect.IsEmpty())
427 return;
428
429 tools::Long nL = rRect.GetLeft(),
430 nR = rRect.GetRight(),
431 nT = rRect.GetTop(),
432 nB = rRect.GetBottom(),
433 nGT = rRect.nGlyphTop,
434 nGB = rRect.nGlyphBottom;
435 if (!IsEmpty())
436 { tools::Long nTmp;
437
438 if ((nTmp = GetLeft()) < nL)
439 nL = nTmp;
440 if ((nTmp = GetRight()) > nR)
441 nR = nTmp;
442 if ((nTmp = GetTop()) < nT)
443 nT = nTmp;
444 if ((nTmp = GetBottom()) > nB)
445 nB = nTmp;
446 if ((nTmp = nGlyphTop) < nGT)
447 nGT = nTmp;
448 if ((nTmp = nGlyphBottom) > nGB)
449 nGB = nTmp;
450 }
451
452 SetLeft(nL);
453 SetRight(nR);
454 SetTop(nT);
455 SetBottom(nB);
456 nGlyphTop = nGT;
457 nGlyphBottom = nGB;
458}
459
460
461SmRect & SmRect::ExtendBy(const SmRect &rRect, RectCopyMBL eCopyMode)
462 // let current rectangle be the union of itself and 'rRect'
463 // (the smallest rectangle surrounding both). Also adapt values for
464 // 'AlignT', 'AlignM', 'AlignB', baseline and italic-spaces.
465 // The baseline is set according to 'eCopyMode'.
466 // If one of the rectangles has no relevant info the other one is copied.
467{
468 // get some values used for (italic) spaces adaptation
469 // ! (need to be done before changing current SmRect) !
470 tools::Long nL = std::min(GetItalicLeft(), rRect.GetItalicLeft()),
471 nR = std::max(GetItalicRight(), rRect.GetItalicRight());
472
473 Union(rRect);
474
475 SetItalicSpaces(GetLeft() - nL, nR - GetRight());
476
477 if (!HasAlignInfo())
478 CopyAlignInfo(rRect);
479 else if (rRect.HasAlignInfo())
480 {
481 assert(HasAlignInfo());
482 nAlignT = std::min(GetAlignT(), rRect.GetAlignT());
483 nAlignB = std::max(GetAlignB(), rRect.GetAlignB());
484 nHiAttrFence = std::min(GetHiAttrFence(), rRect.GetHiAttrFence());
485 nLoAttrFence = std::max(GetLoAttrFence(), rRect.GetLoAttrFence());
486
487 switch (eCopyMode)
488 { case RectCopyMBL::This:
489 // already done
490 break;
491 case RectCopyMBL::Arg:
492 CopyMBL(rRect);
493 break;
495 bHasBaseline = false;
496 nAlignM = (nAlignT + nAlignB) / 2;
497 break;
498 case RectCopyMBL::Xor:
499 if (!HasBaseline())
500 CopyMBL(rRect);
501 break;
502 default :
503 assert(false);
504 }
505 }
506
507 return *this;
508}
509
510
511void SmRect::ExtendBy(const SmRect &rRect, RectCopyMBL eCopyMode,
512 tools::Long nNewAlignM)
513 // as 'ExtendBy' but sets AlignM value to 'nNewAlignM'.
514 // (this version will be used in 'SmBinVerNode' to provide means to
515 // align eg "{a over b} over c" correctly where AlignM should not
516 // be (AlignT + AlignB) / 2)
517{
518 OSL_ENSURE(HasAlignInfo(), "Sm: no align info");
519
520 ExtendBy(rRect, eCopyMode);
521 nAlignM = nNewAlignM;
522}
523
524
525SmRect & SmRect::ExtendBy(const SmRect &rRect, RectCopyMBL eCopyMode,
526 bool bKeepVerAlignParams)
527 // as 'ExtendBy' but keeps original values for AlignT, -M and -B and
528 // baseline.
529 // (this is used in 'SmSupSubNode' where the sub-/supscripts shouldn't
530 // be allowed to modify these values.)
531{
532 tools::Long nOldAlignT = GetAlignT(),
533 nOldAlignM = GetAlignM(),
534 nOldAlignB = GetAlignB(),
535 nOldBaseline = nBaseline;
536 bool bOldHasAlignInfo = HasAlignInfo();
537
538 ExtendBy(rRect, eCopyMode);
539
540 if (bKeepVerAlignParams)
541 { nAlignT = nOldAlignT;
542 nAlignM = nOldAlignM;
543 nAlignB = nOldAlignB;
544 nBaseline = nOldBaseline;
545 bHasAlignInfo = bOldHasAlignInfo;
546 }
547
548 return *this;
549}
550
551
553 // return oriented distance of rPoint to the current rectangle,
554 // especially the return value is <= 0 iff the point is inside the
555 // rectangle.
556 // For simplicity the maximum-norm is used.
557{
558 bool bIsInside = IsInsideItalicRect(rPoint);
559
560 // build reference point to define the distance
561 Point aRef;
562 if (bIsInside)
563 { Point aIC (GetItalicCenterX(), GetCenterY());
564
565 aRef.setX( rPoint.X() >= aIC.X() ? GetItalicRight() : GetItalicLeft() );
566 aRef.setY( rPoint.Y() >= aIC.Y() ? GetBottom() : GetTop() );
567 }
568 else
569 {
570 // x-coordinate
571 if (rPoint.X() > GetItalicRight())
572 aRef.setX( GetItalicRight() );
573 else if (rPoint.X() < GetItalicLeft())
574 aRef.setX( GetItalicLeft() );
575 else
576 aRef.setX( rPoint.X() );
577 // y-coordinate
578 if (rPoint.Y() > GetBottom())
579 aRef.setY( GetBottom() );
580 else if (rPoint.Y() < GetTop())
581 aRef.setY( GetTop() );
582 else
583 aRef.setY( rPoint.Y() );
584 }
585
586 // build distance vector
587 Point aDist (aRef - rPoint);
588
589 tools::Long nAbsX = std::abs(aDist.X()),
590 nAbsY = std::abs(aDist.Y());
591
592 return bIsInside ? - std::min(nAbsX, nAbsY) : std::max (nAbsX, nAbsY);
593}
594
595
596bool SmRect::IsInsideRect(const Point &rPoint) const
597{
598 return rPoint.Y() >= GetTop()
599 && rPoint.Y() <= GetBottom()
600 && rPoint.X() >= GetLeft()
601 && rPoint.X() <= GetRight();
602}
603
604
605bool SmRect::IsInsideItalicRect(const Point &rPoint) const
606{
607 return rPoint.Y() >= GetTop()
608 && rPoint.Y() <= GetBottom()
609 && rPoint.X() >= GetItalicLeft()
610 && rPoint.X() <= GetItalicRight();
611}
612
614{
615 SmRect aRect (*this);
616 aRect.SetTop(nGlyphTop);
617 aRect.SetBottom(nGlyphBottom);
618 return aRect;
619}
620
621/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::chart::ChartAxisLabelPosition ePos
constexpr int nBorderWidth
static OutputDevice * GetDefaultDevice()
tools::Long GetAscent() const
tools::Long GetInternalLeading() const
const vcl::Font & GetFont() const
void SetFont(const vcl::Font &rNewFont)
bool GetTextBoundRect(tools::Rectangle &rRect, const OUString &rStr, sal_Int32 nBase=0, sal_Int32 nIndex=0, sal_Int32 nLen=-1, sal_uLong nLayoutWidth=0, KernArraySpan aDXArray=KernArraySpan(), o3tl::span< const sal_Bool > pKashidaArray={}, const SalLayoutGlyphs *pGlyphs=nullptr) const
void SetMapMode()
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
FontMetric GetFontMetric() const
const MapMode & GetMapMode() const
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
tools::Long GetTextHeight() const
OutDevType GetOutDevType() const
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
sal_uInt16 GetDistance(sal_uInt16 nIdent) const
Definition: format.hxx:120
Definition: rect.hxx:84
bool IsEmpty() const
Definition: rect.hxx:161
tools::Long GetItalicLeft() const
Definition: rect.hxx:140
void SetTop(tools::Long nTop)
Definition: rect.cxx:308
tools::Long GetItalicLeftSpace() const
Definition: rect.hxx:134
const Point & GetTopLeft() const
Definition: rect.hxx:124
tools::Long GetItalicWidth() const
Definition: rect.hxx:143
bool IsInsideRect(const Point &rPoint) const
Definition: rect.cxx:596
Point aTopLeft
Definition: rect.hxx:85
tools::Long nBaseline
Definition: rect.hxx:87
void SetBottom(tools::Long nBottom)
Definition: rect.cxx:301
tools::Long nItalicLeftSpace
Definition: rect.hxx:93
tools::Long nGlyphTop
Definition: rect.hxx:91
tools::Long nLoAttrFence
Definition: rect.hxx:95
tools::Long nAlignT
Definition: rect.hxx:88
SmRect()
Definition: rect.cxx:144
tools::Long GetCenterY() const
Definition: rect.hxx:130
tools::Long GetItalicRight() const
Definition: rect.hxx:142
tools::Long nAlignM
Definition: rect.hxx:89
SmRect AsGlyphRect() const
Definition: rect.cxx:613
tools::Long GetAlignT() const
Definition: rect.hxx:149
tools::Long GetHeight() const
Definition: rect.hxx:132
tools::Long nGlyphBottom
Definition: rect.hxx:92
tools::Long OrientedDist(const Point &rPoint) const
Definition: rect.cxx:552
tools::Long GetHiAttrFence() const
Definition: rect.hxx:137
tools::Long GetItalicCenterX() const
Definition: rect.hxx:141
bool HasBaseline() const
Definition: rect.hxx:145
void SetLeft(tools::Long nLeft)
Definition: rect.cxx:285
void Move(const Point &rPosition)
Definition: rect.cxx:317
void CopyAlignInfo(const SmRect &rRect)
Definition: rect.cxx:165
tools::Long nAlignB
Definition: rect.hxx:90
sal_uInt16 nBorderWidth
Definition: rect.hxx:97
tools::Long GetTop() const
Definition: rect.hxx:126
bool IsInsideItalicRect(const Point &rPoint) const
Definition: rect.cxx:605
tools::Long GetBottom() const
Definition: rect.hxx:128
Size aSize
Definition: rect.hxx:86
SmRect & ExtendBy(const SmRect &rRect, RectCopyMBL eCopyMode)
Definition: rect.cxx:461
tools::Long nItalicRightSpace
Definition: rect.hxx:94
tools::Long GetBaseline() const
Definition: rect.hxx:204
void Union(const SmRect &rRect)
Italic correction is NOT taken into account here!
Definition: rect.cxx:420
Point AlignTo(const SmRect &rRect, RectPos ePos, RectHorAlign eHor, RectVerAlign eVer) const
Definition: rect.cxx:334
tools::Long GetLoAttrFence() const
Definition: rect.hxx:138
void SetRight(tools::Long nRight)
Definition: rect.cxx:294
tools::Long GetAlignB() const
Definition: rect.hxx:151
tools::Long GetWidth() const
Definition: rect.hxx:131
bool bHasBaseline
Definition: rect.hxx:98
tools::Long GetAlignM() const
Definition: rect.hxx:150
void SetItalicSpaces(tools::Long nLeftSpace, tools::Long nRightSpace)
Definition: rect.hxx:186
bool bHasAlignInfo
Definition: rect.hxx:99
bool HasAlignInfo() const
Definition: rect.hxx:166
tools::Long GetLeft() const
Definition: rect.hxx:127
tools::Long nHiAttrFence
Definition: rect.hxx:96
void CopyMBL(const SmRect &rRect)
Definition: rect.hxx:195
tools::Long GetRight() const
Definition: rect.hxx:129
tools::Long GetItalicRightSpace() const
Definition: rect.hxx:135
constexpr tools::Long Top() const
constexpr tools::Long Right() const
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
constexpr bool IsEmpty() const
const OUString & GetFamilyName() const
const Size & GetFontSize() const
float u
#define DIS_ORNAMENTSIZE
Definition: format.hxx:73
#define SAL_WARN(area, stream)
tools::Long const nBorder
long Long
OUTDEV_PRINTER
RectCopyMBL
Definition: rect.hxx:74
RectHorAlign
Definition: rect.hxx:54
RectVerAlign
Definition: rect.hxx:61
RectPos
Definition: rect.hxx:45
tools::Long SmFromTo(tools::Long nFrom, tools::Long nTo, double fRelDist)
Definition: rect.hxx:30
#define SM_MOD()
Definition: smmod.hxx:98
sal_uInt16 sal_Unicode
sal_Unicode const MS_WP
Definition: types.hxx:106
sal_Unicode const MS_SETN
Definition: types.hxx:191
constexpr OUStringLiteral FONTNAME_MATH
Definition: types.hxx:25
sal_Unicode const MS_LAMBDABAR
Definition: types.hxx:184
sal_Unicode const MS_SETQ
Definition: types.hxx:193
sal_Unicode const MS_SETR
Definition: types.hxx:194
sal_Unicode const MS_ALEPH
Definition: types.hxx:103
sal_Unicode const MS_IM
Definition: types.hxx:104
sal_Unicode const MS_SETC
Definition: types.hxx:195
sal_Unicode const MS_SETZ
Definition: types.hxx:192
sal_Unicode const MS_HBAR
Definition: types.hxx:185
sal_Unicode const MS_EMPTYSET
Definition: types.hxx:163
sal_Unicode const MS_RE
Definition: types.hxx:105