1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 <vcl/metric.hxx>
21 #include <vcl/outdev.hxx>
22 #include <vcl/svapp.hxx>
23 #include <vcl/settings.hxx>
24 #include <svtools/colorcfg.hxx>
25 #include <svx/swframeexample.hxx>
26 #include <i18nlangtag/languagetag.hxx>
27 #include <com/sun/star/text/HoriOrientation.hpp>
28 #include <com/sun/star/text/VertOrientation.hpp>
29 #include <com/sun/star/text/RelOrientation.hpp>
31 using namespace ::com::sun::star::text
;
33 #define FLYINFLY_BORDER 3
38 void DrawRect_Impl(vcl::RenderContext
& rRenderContext
, const tools::Rectangle
&rRect
,
39 const Color
&rFillColor
, const Color
&rLineColor
)
41 rRenderContext
.SetFillColor(rFillColor
);
42 rRenderContext
.SetLineColor(rLineColor
);
43 rRenderContext
.DrawRect(rRect
);
48 SwFrameExample::SwFrameExample()
49 : nHAlign(HoriOrientation::CENTER
)
50 , nHRel(RelOrientation::FRAME
)
51 , nVAlign(VertOrientation::TOP
)
52 , nVRel(RelOrientation::PRINT_AREA
)
53 , nWrap(WrapTextMode_NONE
)
54 , nAnchor(RndStdIds::FLY_AT_PAGE
)
61 void SwFrameExample::SetDrawingArea(weld::DrawingArea
* pDrawingArea
)
63 CustomWidgetController::SetDrawingArea(pDrawingArea
);
64 pDrawingArea
->set_size_request(pDrawingArea
->get_approximate_digit_width() * 16,
65 pDrawingArea
->get_text_height() * 12);
68 void SwFrameExample::InitColors_Impl()
70 const StyleSettings
& rSettings
= Application::GetSettings().GetStyleSettings();
71 m_aBgCol
= rSettings
.GetWindowColor();
73 bool bHC
= rSettings
.GetHighContrastMode();
75 m_aFrameColor
= COL_LIGHTGREEN
;
76 m_aAlignColor
= COL_LIGHTRED
;
77 m_aTransColor
= COL_TRANSPARENT
;
80 svtools::ColorConfig().GetColorValue(svtools::FONTCOLOR
).nColor
:
82 m_aPrintAreaCol
= bHC
? m_aTxtCol
: COL_GRAY
;
83 m_aBorderCol
= m_aTxtCol
;
84 m_aBlankCol
= bHC
? m_aTxtCol
: COL_LIGHTGRAY
;
85 m_aBlankFrameCol
= bHC
? m_aTxtCol
: COL_GRAY
;
88 void SwFrameExample::StyleUpdated()
91 CustomWidgetController::StyleUpdated();
94 void SwFrameExample::InitAllRects_Impl(vcl::RenderContext
& rRenderContext
)
96 aPage
.SetSize(GetOutputSizePixel());
98 sal_uInt32 nOutWPix
= aPage
.GetWidth();
99 sal_uInt32 nOutHPix
= aPage
.GetHeight();
107 sal_uInt32 nLTxtBorder
;
108 sal_uInt32 nRTxtBorder
;
109 sal_uInt32 nTTxtBorder
;
110 sal_uInt32 nBTxtBorder
;
112 if (nAnchor
!= RndStdIds::FLY_AS_CHAR
)
136 aPagePrtArea
= tools::Rectangle(Point(nLBorder
, nTBorder
), Point((nOutWPix
- 1) - nRBorder
, (nOutHPix
- 1) - nBBorder
));
138 // Example text: Preparing for the text output
140 aTextLine
= aPagePrtArea
;
141 aTextLine
.SetSize(Size(aTextLine
.GetWidth(), 2));
142 aTextLine
.AdjustLeft(nLTxtBorder
);
143 aTextLine
.AdjustRight( -sal_Int32(nRTxtBorder
) );
144 aTextLine
.Move(0, nTTxtBorder
);
146 // Rectangle to edges including paragraph
147 sal_uInt16 nLines
= static_cast<sal_uInt16
>((aPagePrtArea
.GetHeight() / 2 - nTTxtBorder
- nBTxtBorder
)
148 / (aTextLine
.GetHeight() + 2));
149 aPara
= aPagePrtArea
;
150 aPara
.SetSize(Size(aPara
.GetWidth(),
151 (aTextLine
.GetHeight() + 2) * nLines
+ nTTxtBorder
+ nBTxtBorder
));
153 // Rectangle around paragraph without borders
154 aParaPrtArea
= aPara
;
155 aParaPrtArea
.AdjustLeft(nLTxtBorder
);
156 aParaPrtArea
.AdjustRight( -sal_Int32(nRTxtBorder
) );
157 aParaPrtArea
.AdjustTop(nTTxtBorder
);
158 aParaPrtArea
.AdjustBottom( -sal_Int32(nBTxtBorder
) );
160 if (nAnchor
== RndStdIds::FLY_AS_CHAR
|| nAnchor
== RndStdIds::FLY_AT_CHAR
)
162 vcl::Font aFont
= OutputDevice::GetDefaultFont(
163 DefaultFontType::LATIN_TEXT
, Application::GetSettings().GetLanguageTag().getLanguageType(),
164 GetDefaultFontFlags::OnlyOne
, &rRenderContext
);
165 aFont
.SetColor( m_aTxtCol
);
166 aFont
.SetFillColor( m_aBgCol
);
167 aFont
.SetWeight(WEIGHT_NORMAL
);
169 if (nAnchor
== RndStdIds::FLY_AS_CHAR
)
171 aFont
.SetFontSize(Size(0, aParaPrtArea
.GetHeight() - 2));
172 rRenderContext
.SetFont(aFont
);
173 aParaPrtArea
.SetSize(Size(rRenderContext
.GetTextWidth(DEMOTEXT
), rRenderContext
.GetTextHeight()));
177 aFont
.SetFontSize(Size(0, aParaPrtArea
.GetHeight() / 2));
178 rRenderContext
.SetFont(aFont
);
179 aAutoCharFrame
.SetSize(Size(rRenderContext
.GetTextWidth(OUString('A')), GetTextHeight()));
180 aAutoCharFrame
.SetPos(Point(aParaPrtArea
.Left() + (aParaPrtArea
.GetWidth() - aAutoCharFrame
.GetWidth()) / 2,
181 aParaPrtArea
.Top() + (aParaPrtArea
.GetHeight() - aAutoCharFrame
.GetHeight()) / 2));
185 // Inner Frame anchored at the Frame
186 aFrameAtFrame
= aPara
;
187 aFrameAtFrame
.AdjustLeft(9 );
188 aFrameAtFrame
.AdjustRight( -5 );
189 aFrameAtFrame
.AdjustBottom(5 );
190 aFrameAtFrame
.SetPos(Point(aFrameAtFrame
.Left() + 2, (aPagePrtArea
.Bottom() - aFrameAtFrame
.GetHeight()) / 2 + 5));
192 // Size of the frame to be positioned
193 if (nAnchor
!= RndStdIds::FLY_AS_CHAR
)
195 sal_uInt32 nLFBorder
= nAnchor
== RndStdIds::FLY_AT_PAGE
? nLBorder
: nLTxtBorder
;
196 sal_uInt32 nRFBorder
= nAnchor
== RndStdIds::FLY_AT_PAGE
? nRBorder
: nRTxtBorder
;
200 case RelOrientation::PAGE_LEFT
:
201 case RelOrientation::FRAME_LEFT
:
202 aFrmSize
= Size(nLFBorder
- 4, (aTextLine
.GetHeight() + 2) * 3);
205 case RelOrientation::PAGE_RIGHT
:
206 case RelOrientation::FRAME_RIGHT
:
207 aFrmSize
= Size(nRFBorder
- 4, (aTextLine
.GetHeight() + 2) * 3);
211 aFrmSize
= Size(nLBorder
- 3, (aTextLine
.GetHeight() + 2) * 3);
214 aFrmSize
.setWidth( std::max(tools::Long(5), aFrmSize
.Width()) );
215 aFrmSize
.setHeight( std::max(tools::Long(5), aFrmSize
.Height()) );
219 sal_uInt32 nFreeWidth
= aPagePrtArea
.GetWidth() - rRenderContext
.GetTextWidth(DEMOTEXT
);
221 aFrmSize
= Size(nFreeWidth
/ 2, (aTextLine
.GetHeight() + 2) * 3);
222 aDrawObj
.SetSize(Size(std::max(tools::Long(5), tools::Long(nFreeWidth
/ 3)), std::max(tools::Long(5), aFrmSize
.Height() * 3)));
223 aDrawObj
.SetPos(Point(aParaPrtArea
.Right() + 1, aParaPrtArea
.Bottom() / 2));
224 aParaPrtArea
.SetRight( aDrawObj
.Right() );
228 void SwFrameExample::CalcBoundRect_Impl(const vcl::RenderContext
& rRenderContext
, tools::Rectangle
&rRect
)
232 case RndStdIds::FLY_AT_PAGE
:
236 case RelOrientation::FRAME
:
237 case RelOrientation::PAGE_FRAME
:
238 rRect
.SetLeft( aPage
.Left() );
239 rRect
.SetRight( aPage
.Right() );
242 case RelOrientation::PRINT_AREA
:
243 case RelOrientation::PAGE_PRINT_AREA
:
244 rRect
.SetLeft( aPagePrtArea
.Left() );
245 rRect
.SetRight( aPagePrtArea
.Right() );
248 case RelOrientation::PAGE_LEFT
:
249 rRect
.SetLeft( aPage
.Left() );
250 rRect
.SetRight( aPagePrtArea
.Left() );
253 case RelOrientation::PAGE_RIGHT
:
254 rRect
.SetLeft( aPagePrtArea
.Right() );
255 rRect
.SetRight( aPage
.Right() );
261 case RelOrientation::PRINT_AREA
:
262 case RelOrientation::PAGE_PRINT_AREA
:
263 rRect
.SetTop( aPagePrtArea
.Top() );
264 rRect
.SetBottom( aPagePrtArea
.Bottom() );
267 case RelOrientation::FRAME
:
268 case RelOrientation::PAGE_FRAME
:
269 rRect
.SetTop( aPage
.Top() );
270 rRect
.SetBottom( aPage
.Bottom() );
276 case RndStdIds::FLY_AT_FLY
:
280 case RelOrientation::FRAME
:
281 case RelOrientation::PAGE_FRAME
:
282 rRect
.SetLeft( aFrameAtFrame
.Left() );
283 rRect
.SetRight( aFrameAtFrame
.Right() );
286 case RelOrientation::PRINT_AREA
:
287 case RelOrientation::PAGE_PRINT_AREA
:
288 rRect
.SetLeft( aFrameAtFrame
.Left() + FLYINFLY_BORDER
);
289 rRect
.SetRight( aFrameAtFrame
.Right() - FLYINFLY_BORDER
);
292 case RelOrientation::PAGE_RIGHT
:
293 rRect
.SetLeft( aFrameAtFrame
.Left() );
294 rRect
.SetRight( aFrameAtFrame
.Left() + FLYINFLY_BORDER
);
297 case RelOrientation::PAGE_LEFT
:
298 rRect
.SetLeft( aFrameAtFrame
.Right() );
299 rRect
.SetRight( aFrameAtFrame
.Right() - FLYINFLY_BORDER
);
305 case RelOrientation::FRAME
:
306 case RelOrientation::PAGE_FRAME
:
307 rRect
.SetTop( aFrameAtFrame
.Top() );
308 rRect
.SetBottom( aFrameAtFrame
.Bottom() );
311 case RelOrientation::PRINT_AREA
:
312 case RelOrientation::PAGE_PRINT_AREA
:
313 rRect
.SetTop( aFrameAtFrame
.Top() + FLYINFLY_BORDER
);
314 rRect
.SetBottom( aFrameAtFrame
.Bottom() - FLYINFLY_BORDER
);
319 case RndStdIds::FLY_AT_PARA
:
320 case RndStdIds::FLY_AT_CHAR
:
324 case RelOrientation::FRAME
:
325 rRect
.SetLeft( aPara
.Left() );
326 rRect
.SetRight( aPara
.Right() );
329 case RelOrientation::PRINT_AREA
:
330 rRect
.SetLeft( aParaPrtArea
.Left() );
331 rRect
.SetRight( aParaPrtArea
.Right() );
334 case RelOrientation::PAGE_LEFT
:
335 rRect
.SetLeft( aPage
.Left() );
336 rRect
.SetRight( aPagePrtArea
.Left() );
339 case RelOrientation::PAGE_RIGHT
:
340 rRect
.SetLeft( aPagePrtArea
.Right() );
341 rRect
.SetRight( aPage
.Right() );
344 case RelOrientation::PAGE_FRAME
:
345 rRect
.SetLeft( aPage
.Left() );
346 rRect
.SetRight( aPage
.Right() );
349 case RelOrientation::PAGE_PRINT_AREA
:
350 rRect
.SetLeft( aPagePrtArea
.Left() );
351 rRect
.SetRight( aPagePrtArea
.Right() );
354 case RelOrientation::FRAME_LEFT
:
355 rRect
.SetLeft( aPara
.Left() );
356 rRect
.SetRight( aParaPrtArea
.Left() );
359 case RelOrientation::FRAME_RIGHT
:
360 rRect
.SetLeft( aParaPrtArea
.Right() );
361 rRect
.SetRight( aPara
.Right() );
364 case RelOrientation::CHAR
:
365 rRect
.SetLeft( aAutoCharFrame
.Left() );
366 rRect
.SetRight( aAutoCharFrame
.Left() );
372 case RelOrientation::FRAME
:
373 rRect
.SetTop( aPara
.Top() );
374 rRect
.SetBottom( aPara
.Bottom() );
377 case RelOrientation::PRINT_AREA
:
378 rRect
.SetTop( aParaPrtArea
.Top() );
379 rRect
.SetBottom( aParaPrtArea
.Bottom() );
382 case RelOrientation::CHAR
:
383 if (nVAlign
!= VertOrientation::NONE
&&
384 nVAlign
!= VertOrientation::CHAR_BOTTOM
)
385 rRect
.SetTop( aAutoCharFrame
.Top() );
387 rRect
.SetTop( aAutoCharFrame
.Bottom() );
388 rRect
.SetBottom( aAutoCharFrame
.Bottom() );
390 // OD 12.11.2003 #i22341#
391 case RelOrientation::TEXT_LINE
:
392 rRect
.SetTop( aAutoCharFrame
.Top() );
393 rRect
.SetBottom( aAutoCharFrame
.Top() );
399 case RndStdIds::FLY_AS_CHAR
:
400 rRect
.SetLeft( aParaPrtArea
.Left() );
401 rRect
.SetRight( aParaPrtArea
.Right() );
405 case VertOrientation::NONE
:
406 case VertOrientation::TOP
:
407 case VertOrientation::CENTER
:
408 case VertOrientation::BOTTOM
:
410 FontMetric
aMetric(rRenderContext
.GetFontMetric());
412 rRect
.SetTop( aParaPrtArea
.Bottom() - aMetric
.GetDescent() );
413 rRect
.SetBottom( rRect
.Top() );
419 case VertOrientation::LINE_TOP
:
420 case VertOrientation::LINE_CENTER
:
421 case VertOrientation::LINE_BOTTOM
:
422 rRect
.SetTop( aParaPrtArea
.Top() );
423 rRect
.SetBottom( aDrawObj
.Bottom() );
426 case VertOrientation::CHAR_TOP
:
427 case VertOrientation::CHAR_CENTER
:
428 case VertOrientation::CHAR_BOTTOM
:
429 rRect
.SetTop( aParaPrtArea
.Top() );
430 rRect
.SetBottom( aParaPrtArea
.Bottom() );
440 tools::Rectangle
SwFrameExample::DrawInnerFrame_Impl(vcl::RenderContext
& rRenderContext
, const tools::Rectangle
&rRect
,
441 const Color
&rFillColor
, const Color
&rBorderColor
)
443 DrawRect_Impl(rRenderContext
, rRect
, rFillColor
, rBorderColor
);
445 // determine the area relative to which the positioning happens
446 tools::Rectangle
aRect(rRect
); // aPagePrtArea = Default
447 CalcBoundRect_Impl(rRenderContext
, aRect
);
449 if (nAnchor
== RndStdIds::FLY_AT_FLY
&& &rRect
== &aPagePrtArea
)
451 // draw text paragraph
452 tools::Rectangle
aTxt(aTextLine
);
453 sal_Int32 nStep
= aTxt
.GetHeight() + 2;
454 sal_uInt16 nLines
= static_cast<sal_uInt16
>(aParaPrtArea
.GetHeight() / (aTextLine
.GetHeight() + 2));
456 for (sal_uInt16 i
= 0; i
< nLines
; i
++)
459 aTxt
.SetSize(Size(aTxt
.GetWidth() / 2, aTxt
.GetHeight()));
460 DrawRect_Impl(rRenderContext
, aTxt
, m_aTxtCol
, m_aTransColor
);
468 void SwFrameExample::Paint(vcl::RenderContext
& rRenderContext
, const tools::Rectangle
&)
470 rRenderContext
.SetMapMode(MapMode(MapUnit::MapPixel
));
472 InitAllRects_Impl(rRenderContext
);
475 DrawRect_Impl(rRenderContext
, aPage
, m_aBgCol
, m_aBorderCol
);
478 tools::Rectangle aRect
= DrawInnerFrame_Impl(rRenderContext
, aPagePrtArea
, m_aTransColor
, m_aPrintAreaCol
);
480 if (nAnchor
== RndStdIds::FLY_AT_FLY
)
481 aRect
= DrawInnerFrame_Impl(rRenderContext
, aFrameAtFrame
, m_aBgCol
, m_aBorderCol
);
483 tools::Long lXPos
= 0;
484 tools::Long lYPos
= 0;
486 // Horizontal alignment
487 if (nAnchor
!= RndStdIds::FLY_AS_CHAR
)
491 case HoriOrientation::RIGHT
:
493 lXPos
= aRect
.Right() - aFrmSize
.Width() + 1;
496 case HoriOrientation::CENTER
:
498 lXPos
= aRect
.Left() + (aRect
.GetWidth() - aFrmSize
.Width()) / 2;
501 case HoriOrientation::NONE
:
503 lXPos
= aRect
.Left() + aRelPos
.X();
507 default: // HoriOrientation::LEFT
508 lXPos
= aRect
.Left();
514 lXPos
= aRect
.Right() + 2;
517 // Vertical Alignment
518 if (nAnchor
!= RndStdIds::FLY_AS_CHAR
)
522 case VertOrientation::BOTTOM
:
523 case VertOrientation::LINE_BOTTOM
:
526 if ( nVRel
!= RelOrientation::TEXT_LINE
)
528 lYPos
= aRect
.Bottom() - aFrmSize
.Height() + 1;
536 case VertOrientation::CENTER
:
537 case VertOrientation::LINE_CENTER
:
539 lYPos
= aRect
.Top() + (aRect
.GetHeight() - aFrmSize
.Height()) / 2;
542 case VertOrientation::NONE
:
545 if ( nVRel
!= RelOrientation::CHAR
&& nVRel
!= RelOrientation::TEXT_LINE
)
546 lYPos
= aRect
.Top() + aRelPos
.Y();
548 lYPos
= aRect
.Top() - aRelPos
.Y();
553 if ( nVRel
!= RelOrientation::TEXT_LINE
)
559 lYPos
= aRect
.Bottom() - aFrmSize
.Height() + 1;
568 case VertOrientation::CENTER
:
569 case VertOrientation::CHAR_CENTER
:
570 case VertOrientation::LINE_CENTER
:
571 lYPos
= aRect
.Top() + (aRect
.GetHeight() - aFrmSize
.Height()) / 2;
574 case VertOrientation::TOP
:
575 case VertOrientation::CHAR_BOTTOM
:
576 case VertOrientation::LINE_BOTTOM
:
577 lYPos
= aRect
.Bottom() - aFrmSize
.Height() + 1;
581 lYPos
= aRect
.Top() - aRelPos
.Y();
586 tools::Rectangle
aFrmRect(Point(lXPos
, lYPos
), aFrmSize
);
588 tools::Rectangle
* pOuterFrame
= &aPage
;
590 if (nAnchor
== RndStdIds::FLY_AT_FLY
)
591 pOuterFrame
= &aFrameAtFrame
;
593 if (aFrmRect
.Left() < pOuterFrame
->Left())
594 aFrmRect
.Move(pOuterFrame
->Left() - aFrmRect
.Left(), 0);
595 if (aFrmRect
.Right() > pOuterFrame
->Right())
596 aFrmRect
.Move(pOuterFrame
->Right() - aFrmRect
.Right(), 0);
598 if (aFrmRect
.Top() < pOuterFrame
->Top())
599 aFrmRect
.Move(0, pOuterFrame
->Top() - aFrmRect
.Top());
600 if (aFrmRect
.Bottom() > pOuterFrame
->Bottom())
601 aFrmRect
.Move(0, pOuterFrame
->Bottom() - aFrmRect
.Bottom());
603 // Draw Test paragraph
604 const tools::Long nTxtLineHeight
= aTextLine
.GetHeight();
605 tools::Rectangle
aTxt(aTextLine
);
609 if (nAnchor
== RndStdIds::FLY_AT_FLY
)
611 aTxt
.SetLeft( aFrameAtFrame
.Left() + FLYINFLY_BORDER
);
612 aTxt
.SetRight( aFrameAtFrame
.Right() - FLYINFLY_BORDER
);
613 aTxt
.SetTop( aFrameAtFrame
.Top() + FLYINFLY_BORDER
);
614 aTxt
.SetBottom( aTxt
.Top() + aTextLine
.GetHeight() - 1 );
616 nStep
= aTxt
.GetHeight() + 2;
617 nLines
= static_cast<sal_uInt16
>(((aFrameAtFrame
.GetHeight() - 2 * FLYINFLY_BORDER
) * 2 / 3)
618 / (aTxt
.GetHeight() + 2));
622 nStep
= aTxt
.GetHeight() + 2;
623 nLines
= static_cast<sal_uInt16
>(aParaPrtArea
.GetHeight() / (aTextLine
.GetHeight() + 2));
626 if (nAnchor
!= RndStdIds::FLY_AS_CHAR
)
629 const tools::Long nOldR
= aTxt
.Right();
630 const tools::Long nOldL
= aTxt
.Left();
633 const bool bIgnoreWrap
= nAnchor
== RndStdIds::FLY_AT_CHAR
&&
634 ( nHRel
== RelOrientation::CHAR
|| nVRel
== RelOrientation::CHAR
||
635 nVRel
== RelOrientation::TEXT_LINE
);
637 for (sal_uInt16 i
= 0; i
< nLines
; ++i
)
639 if (i
== (nLines
- 1))
640 aTxt
.SetSize(Size(aTxt
.GetWidth() / 2, aTxt
.GetHeight()));
642 if (aTxt
.IsOver(aFrmRect
) && nAnchor
!= RndStdIds::FLY_AS_CHAR
&& !bIgnoreWrap
)
646 case WrapTextMode_NONE
:
647 aTxt
.SetTop( aFrmRect
.Bottom() + nTxtLineHeight
);
648 aTxt
.SetBottom( aTxt
.Top() + nTxtLineHeight
- 1 );
651 case WrapTextMode_LEFT
:
652 aTxt
.SetRight( aFrmRect
.Left() );
655 case WrapTextMode_RIGHT
:
656 aTxt
.SetLeft( aFrmRect
.Right() );
661 if (pOuterFrame
->IsInside(aTxt
))
662 DrawRect_Impl(rRenderContext
, aTxt
, m_aTxtCol
, m_aTransColor
);
665 aTxt
.SetRight( nOldR
);
666 aTxt
.SetLeft( nOldL
);
668 aTxt
.Move(0, -nStep
);
670 if (nAnchor
!= RndStdIds::FLY_AT_FLY
&& aTxt
.Bottom() > aParaPrtArea
.Bottom())
672 // Text has been replaced by frame, so adjust parameters height
673 sal_Int32 nDiff
= aTxt
.Bottom() - aParaPrtArea
.Bottom();
674 aParaPrtArea
.AdjustBottom(nDiff
);
675 aPara
.AdjustBottom(nDiff
);
677 CalcBoundRect_Impl(rRenderContext
, aRect
);
679 aParaPrtArea
.AdjustBottom( -nDiff
);
680 aPara
.AdjustBottom( -nDiff
);
682 if (nAnchor
== RndStdIds::FLY_AT_CHAR
&& bIgnoreWrap
)
683 rRenderContext
.DrawText(aAutoCharFrame
, OUString('A'));
687 rRenderContext
.DrawText(aParaPrtArea
, OUString(DEMOTEXT
));
688 DrawRect_Impl(rRenderContext
, aDrawObj
, m_aBlankCol
, m_aBlankFrameCol
);
691 // Draw rectangle on which the frame is aligned:
692 DrawRect_Impl(rRenderContext
, aRect
, m_aTransColor
, m_aAlignColor
);
695 bool bDontFill
= (nAnchor
== RndStdIds::FLY_AT_CHAR
&& aFrmRect
.IsOver(aAutoCharFrame
)) || bTrans
;
696 DrawRect_Impl(rRenderContext
, aFrmRect
, bDontFill
? m_aTransColor
: m_aBgCol
, m_aFrameColor
);
699 void SwFrameExample::SetRelPos(const Point
& rP
)
714 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */