LibreOffice Module sw (master) 1
frmpage.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 <com/sun/star/embed/Aspects.hpp>
21#include <com/sun/star/embed/EmbedMisc.hpp>
22#include <com/sun/star/embed/XEmbeddedObject.hpp>
23
24#include <cmdid.h>
25#include <hintids.hxx>
26#include <bitmaps.hlst>
27#include <o3tl/safeint.hxx>
28#include <vcl/mnemonic.hxx>
29#include <svl/stritem.hxx>
30#include <sfx2/htmlmode.hxx>
31#include <editeng/opaqitem.hxx>
32#include <editeng/protitem.hxx>
33#include <editeng/prntitem.hxx>
34#include <editeng/brushitem.hxx>
35#include <editeng/ulspitem.hxx>
39#include <svx/sdangitm.hxx>
41#include <tools/globname.hxx>
42#include <tools/urlobj.hxx>
43#include <fmturl.hxx>
44#include <fmteiro.hxx>
45#include <fmtcnct.hxx>
46#include <fmtsrnd.hxx>
47#include <view.hxx>
48#include <wrtsh.hxx>
49#include <swmodule.hxx>
50#include <uitool.hxx>
51#include <docsh.hxx>
52#include <viewopt.hxx>
53#include <frmdlg.hxx>
54#include <frmmgr.hxx>
55#include <frmpage.hxx>
56#include <colmgr.hxx>
57#include <grfatr.hxx>
58#include <fmtfollowtextflow.hxx>
59#include <svx/sdtaitm.hxx>
60#include <sal/macros.h>
61#include <osl/diagnose.h>
62
63#include <strings.hrc>
64#include <svx/strings.hrc>
65#include <svx/dialmgr.hxx>
66#include <svx/graphichelper.hxx>
68#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
69#include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
70#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
71#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
72#include <vcl/graphicfilter.hxx>
73#include <svtools/embedhlp.hxx>
74#include <comphelper/lok.hxx>
75#include <memory>
76
77using namespace ::com::sun::star;
78using namespace ::sfx2;
79
80#define SwFPos SvxSwFramePosString
81
82namespace {
83
84struct StringIdPair_Impl
85{
88};
89
90}
91
92#define MAX_PERCENT_WIDTH SAL_CONST_INT64(254)
93#define MAX_PERCENT_HEIGHT SAL_CONST_INT64(254)
94
95namespace {
96
97enum class LB {
98 NONE = 0x00000000L,
99 Frame = 0x00000001L, // text region of the paragraph
100 PrintArea = 0x00000002L, // text region of the paragraph + indentions
101 VertFrame = 0x00000004L, // vertical text region of the paragraph
102 VertPrintArea = 0x00000008L, // vertical text region of the paragraph + indentions
103 RelFrameLeft = 0x00000010L, // left paragraph edge
104 RelFrameRight = 0x00000020L, // right paragraph edge
105
106 RelPageLeft = 0x00000040L, // left page edge
107 RelPageRight = 0x00000080L, // right page edge
108 RelPageFrame = 0x00000100L, // whole page
109 RelPagePrintArea = 0x00000200L, // text region of the page
110
111 FlyRelPageLeft = 0x00000400L, // left frame edge
112 FlyRelPageRight = 0x00000800L, // right frame edge
113 FlyRelPageFrame = 0x00001000L, // whole frame
114 FlyRelPagePrintArea = 0x00002000L, // inside of the frame
115
116 RelBase = 0x00010000L, // character alignment Base
117 RelChar = 0x00020000L, // character alignment Character
118 RelRow = 0x00040000L, // character alignment Row
119
120 FlyVertFrame = 0x00100000L, // vertical entire frame
121 FlyVertPrintArea = 0x00200000L, // vertical frame text area
122
123 VertLine = 0x00400000L, // vertical text line
124};
125
126}
127
128namespace o3tl {
129 template<> struct typed_flags<LB> : is_typed_flags<LB, 0x00773fffL> {};
130}
131
132namespace {
133
134struct RelationMap
135{
138 LB nLBRelation;
139 sal_Int16 nRelation;
140};
141
142}
143
145{
148 sal_Int16 nAlign;
150};
151
152
153RelationMap const aRelationMap[] =
154{
155 {SwFPos::FRAME, SwFPos::FRAME, LB::Frame, text::RelOrientation::FRAME},
156 {SwFPos::PRTAREA, SwFPos::PRTAREA, LB::PrintArea, text::RelOrientation::PRINT_AREA},
157 {SwFPos::REL_PG_LEFT, SwFPos::MIR_REL_PG_LEFT, LB::RelPageLeft, text::RelOrientation::PAGE_LEFT},
158 {SwFPos::REL_PG_RIGHT, SwFPos::MIR_REL_PG_RIGHT, LB::RelPageRight, text::RelOrientation::PAGE_RIGHT},
159 {SwFPos::REL_FRM_LEFT, SwFPos::MIR_REL_FRM_LEFT, LB::RelFrameLeft, text::RelOrientation::FRAME_LEFT},
160 {SwFPos::REL_FRM_RIGHT, SwFPos::MIR_REL_FRM_RIGHT, LB::RelFrameRight, text::RelOrientation::FRAME_RIGHT},
161 {SwFPos::REL_PG_FRAME, SwFPos::REL_PG_FRAME, LB::RelPageFrame, text::RelOrientation::PAGE_FRAME},
162 {SwFPos::REL_PG_PRTAREA, SwFPos::REL_PG_PRTAREA, LB::RelPagePrintArea, text::RelOrientation::PAGE_PRINT_AREA},
163 {SwFPos::REL_CHAR, SwFPos::REL_CHAR, LB::RelChar, text::RelOrientation::CHAR},
164
165 {SwFPos::FLY_REL_PG_LEFT, SwFPos::FLY_MIR_REL_PG_LEFT, LB::FlyRelPageLeft, text::RelOrientation::PAGE_LEFT},
166 {SwFPos::FLY_REL_PG_RIGHT, SwFPos::FLY_MIR_REL_PG_RIGHT, LB::FlyRelPageRight, text::RelOrientation::PAGE_RIGHT},
167 {SwFPos::FLY_REL_PG_FRAME, SwFPos::FLY_REL_PG_FRAME, LB::FlyRelPageFrame, text::RelOrientation::PAGE_FRAME},
168 {SwFPos::FLY_REL_PG_PRTAREA, SwFPos::FLY_REL_PG_PRTAREA, LB::FlyRelPagePrintArea, text::RelOrientation::PAGE_PRINT_AREA},
169
170 {SwFPos::REL_BORDER, SwFPos::REL_BORDER, LB::VertFrame, text::RelOrientation::FRAME},
171 {SwFPos::REL_PRTAREA, SwFPos::REL_PRTAREA, LB::VertPrintArea, text::RelOrientation::PRINT_AREA},
172
173 {SwFPos::FLY_REL_PG_FRAME, SwFPos::FLY_REL_PG_FRAME, LB::FlyVertFrame, text::RelOrientation::FRAME},
174 {SwFPos::FLY_REL_PG_PRTAREA, SwFPos::FLY_REL_PG_PRTAREA, LB::FlyVertPrintArea, text::RelOrientation::PRINT_AREA},
175
176 {SwFPos::REL_LINE, SwFPos::REL_LINE, LB::VertLine, text::RelOrientation::TEXT_LINE}
177};
178
179RelationMap const aAsCharRelationMap[] =
180{
181 {SwFPos::REL_BASE, SwFPos::REL_BASE, LB::RelBase, text::RelOrientation::FRAME},
182 {SwFPos::REL_CHAR, SwFPos::REL_CHAR, LB::RelChar, text::RelOrientation::FRAME},
183 {SwFPos::REL_ROW, SwFPos::REL_ROW, LB::RelRow, text::RelOrientation::FRAME}
184};
185
186// site anchored
187constexpr auto HORI_PAGE_REL = LB::RelPageFrame | LB::RelPagePrintArea | LB::RelPageLeft |
188 LB::RelPageRight;
189
191{
192 {SwFPos::LEFT, SwFPos::MIR_LEFT, text::HoriOrientation::LEFT, HORI_PAGE_REL},
193 {SwFPos::RIGHT, SwFPos::MIR_RIGHT, text::HoriOrientation::RIGHT, HORI_PAGE_REL},
194 {SwFPos::CENTER_HORI, SwFPos::CENTER_HORI, text::HoriOrientation::CENTER, HORI_PAGE_REL},
195 {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, text::HoriOrientation::NONE, HORI_PAGE_REL}
196};
197
199{
200 {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, text::HoriOrientation::NONE, LB::RelPageFrame}
201};
202
203#define VERT_PAGE_REL (LB::RelPageFrame|LB::RelPagePrintArea)
204
206{
207 {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, VERT_PAGE_REL},
208 {SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::BOTTOM, VERT_PAGE_REL},
209 {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::CENTER, VERT_PAGE_REL},
210 {SwFPos::FROMTOP, SwFPos::FROMTOP, text::VertOrientation::NONE, VERT_PAGE_REL}
211};
212
214{
215 {SwFPos::FROMTOP, SwFPos::FROMTOP, text::VertOrientation::NONE, LB::RelPageFrame}
216};
217
218// frame anchored
219constexpr auto HORI_FRAME_REL = LB::FlyRelPageFrame | LB::FlyRelPagePrintArea |
220 LB::FlyRelPageLeft | LB::FlyRelPageRight;
221
223{
224 {SwFPos::LEFT, SwFPos::MIR_LEFT, text::HoriOrientation::LEFT, HORI_FRAME_REL},
225 {SwFPos::RIGHT, SwFPos::MIR_RIGHT, text::HoriOrientation::RIGHT, HORI_FRAME_REL},
226 {SwFPos::CENTER_HORI, SwFPos::CENTER_HORI, text::HoriOrientation::CENTER, HORI_FRAME_REL},
227 {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, text::HoriOrientation::NONE, HORI_FRAME_REL}
228};
229
231{
232 {SwFPos::LEFT, SwFPos::MIR_LEFT, text::HoriOrientation::LEFT, LB::FlyRelPageFrame},
233 {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, text::HoriOrientation::NONE, LB::FlyRelPageFrame}
234};
235
236// own vertical alignment map for objects anchored to frame
237#define VERT_FRAME_REL (LB::FlyVertFrame|LB::FlyVertPrintArea)
238
240{
241 {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, VERT_FRAME_REL},
242 {SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::BOTTOM, VERT_FRAME_REL},
243 {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::CENTER, VERT_FRAME_REL},
244 {SwFPos::FROMTOP, SwFPos::FROMTOP, text::VertOrientation::NONE, VERT_FRAME_REL}
245};
246
248{
249 {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, LB::FlyVertFrame},
250 {SwFPos::FROMTOP, SwFPos::FROMTOP, text::VertOrientation::NONE, LB::FlyVertFrame}
251};
252
253// paragraph anchored
254constexpr auto HORI_PARA_REL = LB::Frame | LB::PrintArea | LB::RelPageLeft | LB::RelPageRight |
255 LB::RelPageFrame | LB::RelPagePrintArea | LB::RelFrameLeft |
256 LB::RelFrameRight;
257
259{
260 {SwFPos::LEFT, SwFPos::MIR_LEFT, text::HoriOrientation::LEFT, HORI_PARA_REL},
261 {SwFPos::RIGHT, SwFPos::MIR_RIGHT, text::HoriOrientation::RIGHT, HORI_PARA_REL},
262 {SwFPos::CENTER_HORI, SwFPos::CENTER_HORI, text::HoriOrientation::CENTER, HORI_PARA_REL},
263 {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, text::HoriOrientation::NONE, HORI_PARA_REL}
264};
265
266#define HTML_HORI_PARA_REL (LB::Frame|LB::PrintArea)
267
269{
270 {SwFPos::LEFT, SwFPos::LEFT, text::HoriOrientation::LEFT, HTML_HORI_PARA_REL},
271 {SwFPos::RIGHT, SwFPos::RIGHT, text::HoriOrientation::RIGHT, HTML_HORI_PARA_REL}
272};
273
275{
276 {SwFPos::LEFT, SwFPos::MIR_LEFT, text::HoriOrientation::LEFT, HTML_HORI_PARA_REL},
277 {SwFPos::RIGHT, SwFPos::MIR_RIGHT, text::HoriOrientation::RIGHT, HTML_HORI_PARA_REL}
278};
279
280// allow vertical alignment at page areas
281constexpr auto VERT_PARA_REL = LB::VertFrame | LB::VertPrintArea |
282 LB::RelPageFrame | LB::RelPagePrintArea;
283
285{
286 {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, VERT_PARA_REL},
287 {SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::BOTTOM, VERT_PARA_REL},
288 {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::CENTER, VERT_PARA_REL},
289 {SwFPos::FROMTOP, SwFPos::FROMTOP, text::VertOrientation::NONE, VERT_PARA_REL}
290};
291
293{
294 {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, LB::VertPrintArea}
295};
296
297// anchored relative to the character
298constexpr auto HORI_CHAR_REL = LB::Frame|LB::PrintArea | LB::RelPageLeft | LB::RelPageRight |
299 LB::RelPageFrame | LB::RelPagePrintArea | LB::RelFrameLeft |
300 LB::RelFrameRight | LB::RelChar;
301
303{
304 {SwFPos::LEFT, SwFPos::MIR_LEFT, text::HoriOrientation::LEFT, HORI_CHAR_REL},
305 {SwFPos::RIGHT, SwFPos::MIR_RIGHT, text::HoriOrientation::RIGHT, HORI_CHAR_REL},
306 {SwFPos::CENTER_HORI, SwFPos::CENTER_HORI, text::HoriOrientation::CENTER, HORI_CHAR_REL},
307 {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, text::HoriOrientation::NONE, HORI_CHAR_REL}
308};
309
310#define HTML_HORI_CHAR_REL (LB::Frame|LB::PrintArea|LB::RelChar)
311
313{
314 {SwFPos::LEFT, SwFPos::LEFT, text::HoriOrientation::LEFT, HTML_HORI_CHAR_REL},
315 {SwFPos::RIGHT, SwFPos::RIGHT, text::HoriOrientation::RIGHT, HTML_HORI_CHAR_REL}
316};
317
319{
320 {SwFPos::LEFT, SwFPos::MIR_LEFT, text::HoriOrientation::LEFT, LB::PrintArea|LB::RelChar},
321 {SwFPos::RIGHT, SwFPos::MIR_RIGHT, text::HoriOrientation::RIGHT, LB::PrintArea},
322 {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, text::HoriOrientation::NONE, LB::RelPageFrame}
323};
324
325// allow vertical alignment at page areas
326constexpr auto VERT_CHAR_REL = LB::VertFrame | LB::VertPrintArea |
327 LB::RelPageFrame | LB::RelPagePrintArea;
328
330{
331 // introduce mappings for new vertical alignment at top of line <LB::VertLine>
332 // and correct mapping for vertical alignment at character for position <FROM_BOTTOM>
333 // Note: Because of these adjustments the map becomes ambiguous in its values
334 // <eStrId>/<eMirrorStrId> and <nAlign>. These ambiguities are considered
335 // in the methods <SwFramePage::FillRelLB(..)>, <SwFramePage::GetAlignment(..)>
336 // and <SwFramePage::FillPosLB(..)>
337 {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, VERT_CHAR_REL|LB::RelChar},
338 {SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::BOTTOM, VERT_CHAR_REL|LB::RelChar},
339 {SwFPos::BELOW, SwFPos::BELOW, text::VertOrientation::CHAR_BOTTOM, LB::RelChar},
340 {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::CENTER, VERT_CHAR_REL|LB::RelChar},
341 {SwFPos::FROMTOP, SwFPos::FROMTOP, text::VertOrientation::NONE, VERT_CHAR_REL},
342 {SwFPos::FROMBOTTOM, SwFPos::FROMBOTTOM, text::VertOrientation::NONE, LB::RelChar|LB::VertLine},
343 {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::LINE_TOP, LB::VertLine},
344 {SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::LINE_BOTTOM, LB::VertLine},
345 {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::LINE_CENTER, LB::VertLine}
346};
347
349{
350 {SwFPos::BELOW, SwFPos::BELOW, text::VertOrientation::CHAR_BOTTOM, LB::RelChar}
351};
352
354{
355 {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, LB::RelChar},
356 {SwFPos::BELOW, SwFPos::BELOW, text::VertOrientation::CHAR_BOTTOM, LB::RelChar}
357};
358
359// anchored as character
361{
362 {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, LB::RelBase},
363 {SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::BOTTOM, LB::RelBase},
364 {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::CENTER, LB::RelBase},
365
366 {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::CHAR_TOP, LB::RelChar},
367 {SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::CHAR_BOTTOM, LB::RelChar},
368 {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::CHAR_CENTER, LB::RelChar},
369
370 {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::LINE_TOP, LB::RelRow},
371 {SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::LINE_BOTTOM, LB::RelRow},
372 {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::LINE_CENTER, LB::RelRow},
373
374 {SwFPos::FROMBOTTOM, SwFPos::FROMBOTTOM, text::VertOrientation::NONE, LB::RelBase}
375};
376
378{
379 {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, LB::RelBase},
380 {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::CENTER, LB::RelBase},
381
382 {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::CHAR_TOP, LB::RelChar},
383
384 {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::LINE_TOP, LB::RelRow},
385 {SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::LINE_BOTTOM, LB::RelRow},
386 {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::LINE_CENTER, LB::RelRow}
387};
388
394>);
401>);
402
403static size_t lcl_GetFrameMapCount( const FrameMap* pMap)
404{
405 if ( pMap )
406 {
407 if( pMap == aVParaHtmlMap)
409 if( pMap == aVAsCharHtmlMap)
411 if( pMap == aHParaHtmlMap)
413 if( pMap == aHParaHtmlAbsMap)
415 if ( pMap == aVPageMap )
417 if ( pMap == aVPageHtmlMap )
419 if ( pMap == aVAsCharMap )
421 if ( pMap == aVParaMap )
423 if ( pMap == aHParaMap )
425 if ( pMap == aHFrameMap )
427 if ( pMap == aVFrameMap )
429 if ( pMap == aHCharMap )
431 if ( pMap == aHCharHtmlMap )
433 if ( pMap == aHCharHtmlAbsMap )
435 if ( pMap == aVCharMap )
437 if ( pMap == aVCharHtmlMap )
439 if ( pMap == aVCharHtmlAbsMap )
441 if ( pMap == aHPageHtmlMap )
443 if ( pMap == aHFlyHtmlMap )
445 if ( pMap == aVFlyHtmlMap )
448 }
449 return 0;
450}
451
453 const std::vector< OUString >& rPrev, const std::vector< OUString >& rThis,
454 const std::vector< OUString >& rNext, const std::vector< OUString >& rRemain)
455{
456 for(const auto& rItem : rPrev)
457 rBox.append_text(rItem);
458 for(const auto& rItem : rThis)
459 rBox.append_text(rItem);
460 for(const auto& rItem : rNext)
461 rBox.append_text(rItem);
462 rBox.append_separator("");
463 //now insert all strings sorted
464 const auto nStartPos = rBox.get_count();
465
466 for(const auto& rItem : rPrev)
467 ::InsertStringSorted("", rItem, rBox, nStartPos );
468 for(const auto& rItem : rThis)
469 ::InsertStringSorted("", rItem, rBox, nStartPos );
470 for(const auto& rItem : rNext)
471 ::InsertStringSorted("", rItem, rBox, nStartPos );
472 for(const auto& rItem : rRemain)
473 ::InsertStringSorted("", rItem, rBox, nStartPos );
474}
475
476// --> OD 2009-08-31 #mongolianlayout#
477// add input parameter
478static SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(SvxSwFramePosString::StringId eStringId, bool bVertical, bool bVerticalL2R, bool bRTL)
479{
480 //special handling of STR_FROMLEFT
481 if ( SwFPos::FROMLEFT == eStringId )
482 {
483 eStringId = bVertical
484 ? ( bRTL
485 ? SwFPos::FROMBOTTOM
486 : SwFPos::FROMTOP )
487 : ( bRTL
488 ? SwFPos::FROMRIGHT
489 : SwFPos::FROMLEFT );
490 return eStringId;
491 }
492 // --> OD 2009-08-31 #mongolianlayout#
493 // special handling of STR_FROMTOP in case of mongolianlayout (vertical left-to-right)
494 if ( SwFPos::FROMTOP == eStringId &&
495 bVertical && bVerticalL2R )
496 {
497 eStringId = SwFPos::FROMLEFT;
498 return eStringId;
499 }
500 if ( bVertical )
501 {
502 //exchange horizontal strings with vertical strings and vice versa
503 static const StringIdPair_Impl aHoriIds[] =
504 {
505 {SwFPos::LEFT, SwFPos::TOP},
506 {SwFPos::RIGHT, SwFPos::BOTTOM},
507 {SwFPos::CENTER_HORI, SwFPos::CENTER_VERT},
508 {SwFPos::FROMTOP, SwFPos::FROMRIGHT},
509 {SwFPos::REL_PG_LEFT, SwFPos::REL_PG_TOP},
510 {SwFPos::REL_PG_RIGHT, SwFPos::REL_PG_BOTTOM} ,
511 {SwFPos::REL_FRM_LEFT, SwFPos::REL_FRM_TOP},
512 {SwFPos::REL_FRM_RIGHT, SwFPos::REL_FRM_BOTTOM}
513 };
514 static const StringIdPair_Impl aVertIds[] =
515 {
516 {SwFPos::TOP, SwFPos::RIGHT},
517 {SwFPos::BOTTOM, SwFPos::LEFT },
518 {SwFPos::CENTER_VERT, SwFPos::CENTER_HORI},
519 {SwFPos::FROMTOP, SwFPos::FROMRIGHT },
520 {SwFPos::REL_PG_TOP, SwFPos::REL_PG_LEFT },
521 {SwFPos::REL_PG_BOTTOM, SwFPos::REL_PG_RIGHT } ,
522 {SwFPos::REL_FRM_TOP, SwFPos::REL_FRM_LEFT },
523 {SwFPos::REL_FRM_BOTTOM, SwFPos::REL_FRM_RIGHT }
524 };
525 // --> OD 2009-08-31 #monglianlayout#
526 static const StringIdPair_Impl aVertL2RIds[] =
527 {
528 {SwFPos::TOP, SwFPos::LEFT },
529 {SwFPos::BOTTOM, SwFPos::RIGHT },
530 {SwFPos::CENTER_VERT, SwFPos::CENTER_HORI },
531 {SwFPos::FROMTOP, SwFPos::FROMLEFT },
532 {SwFPos::REL_PG_TOP, SwFPos::REL_PG_LEFT },
533 {SwFPos::REL_PG_BOTTOM, SwFPos::REL_PG_RIGHT } ,
534 {SwFPos::REL_FRM_TOP, SwFPos::REL_FRM_LEFT },
535 {SwFPos::REL_FRM_BOTTOM, SwFPos::REL_FRM_RIGHT }
536 };
537 for(const StringIdPair_Impl & rHoriId : aHoriIds)
538 {
539 if(rHoriId.eHori == eStringId)
540 {
541 eStringId = rHoriId.eVert;
542 return eStringId;
543 }
544 }
545 for(size_t nIndex = 0; nIndex < SAL_N_ELEMENTS(aVertIds); ++nIndex)
546 {
547 // --> OD 2009-08-31 #mongolianlayout#
548 if ( !bVerticalL2R )
549 {
550 if(aVertIds[nIndex].eHori == eStringId)
551 {
552 eStringId = aVertIds[nIndex].eVert;
553 break;
554 }
555 }
556 else
557 {
558 if(aVertL2RIds[nIndex].eHori == eStringId)
559 {
560 eStringId = aVertL2RIds[nIndex].eVert;
561 break;
562 }
563 }
564 }
565 }
566 return eStringId;
567}
568
569// helper method in order to determine all possible
570// listbox relations in a relation map for a given relation
571static LB lcl_GetLBRelationsForRelations( const sal_Int16 _nRel )
572{
573 LB nLBRelations = LB::NONE;
574
575 for (RelationMap const & i : aRelationMap)
576 {
577 if ( i.nRelation == _nRel )
578 {
579 nLBRelations |= i.nLBRelation;
580 }
581 }
582
583 return nLBRelations;
584}
585
586// helper method on order to determine all possible
587// listbox relations in a relation map for a given string ID
588static LB lcl_GetLBRelationsForStrID( const FrameMap* _pMap,
589 const SvxSwFramePosString::StringId _eStrId,
590 const bool _bUseMirrorStr )
591{
592 LB nLBRelations = LB::NONE;
593
594 size_t nRelMapSize = lcl_GetFrameMapCount( _pMap );
595 for ( size_t nRelMapPos = 0; nRelMapPos < nRelMapSize; ++nRelMapPos )
596 {
597 if ( ( !_bUseMirrorStr && _pMap[nRelMapPos].eStrId == _eStrId ) ||
598 ( _bUseMirrorStr && _pMap[nRelMapPos].eMirrorStrId == _eStrId ) )
599 {
600 nLBRelations |= _pMap[nRelMapPos].nLBRelations;
601 }
602 }
603
604 return nLBRelations;
605}
606
607// standard frame TabPage
608namespace
609{
610 void HandleAutoCB(bool _bChecked, weld::Label& _rFT_man, weld::Label& _rFT_auto, weld::MetricSpinButton& _rPF_Edit)
611 {
612 _rFT_man.set_visible( !_bChecked );
613 _rFT_auto.set_visible( _bChecked );
614 OUString accName = _bChecked ? _rFT_auto.get_label() : _rFT_man.get_label();
615 _rPF_Edit.set_accessible_name(accName);
616 }
617}
618
620 : SfxTabPage(pPage, pController, "modules/swriter/ui/frmtypepage.ui", "FrameTypePage", &rSet)
621 , m_bAtHorzPosModified(false)
622 , m_bAtVertPosModified(false)
623 , m_bFormat(false)
624 , m_bNew(true)
625 , m_bNoModifyHdl(true)
626 , m_bIsVerticalFrame(false)
627 , m_bIsVerticalL2R(false)
628 , m_bIsInRightToLeft(false)
629 , m_bHtmlMode(false)
630 , m_nHtmlMode(0)
631 , m_nUpperBorder(0)
632 , m_nLowerBorder(0)
633 , m_fWidthHeightRatio(1.0)
634 , mpToCharContentPos(nullptr)
635 , m_nOldH(text::HoriOrientation::CENTER)
636 , m_nOldHRel(text::RelOrientation::FRAME)
637 , m_nOldV(text::VertOrientation::TOP)
638 , m_nOldVRel(text::RelOrientation::PRINT_AREA)
639 , m_pVMap(nullptr)
640 , m_pHMap(nullptr)
641 , m_bAllowVertPositioning( true )
642 , m_bIsMathOLE(false)
643 , m_bIsMathBaselineAlignment(true)
644 , m_xWidthFT(m_xBuilder->weld_label("widthft"))
645 , m_xWidthAutoFT(m_xBuilder->weld_label("autowidthft"))
646 , m_xRelWidthCB(m_xBuilder->weld_check_button("relwidth"))
647 , m_xRelWidthRelationLB(m_xBuilder->weld_combo_box("relwidthrelation"))
648 , m_xAutoWidthCB(m_xBuilder->weld_check_button("autowidth"))
649 , m_xHeightFT(m_xBuilder->weld_label("heightft"))
650 , m_xHeightAutoFT(m_xBuilder->weld_label("autoheightft"))
651 , m_xRelHeightCB(m_xBuilder->weld_check_button("relheight"))
652 , m_xRelHeightRelationLB(m_xBuilder->weld_combo_box("relheightrelation"))
653 , m_xAutoHeightCB(m_xBuilder->weld_check_button("autoheight"))
654 , m_xFixedRatioCB(m_xBuilder->weld_check_button("ratio"))
655 , m_xRealSizeBT(m_xBuilder->weld_button("origsize"))
656 , m_xAnchorFrame(m_xBuilder->weld_widget("anchorframe"))
657 , m_xAnchorAtPageRB(m_xBuilder->weld_radio_button("topage"))
658 , m_xAnchorAtParaRB(m_xBuilder->weld_radio_button("topara"))
659 , m_xAnchorAtCharRB(m_xBuilder->weld_radio_button("tochar"))
660 , m_xAnchorAsCharRB(m_xBuilder->weld_radio_button("aschar"))
661 , m_xAnchorAtFrameRB(m_xBuilder->weld_radio_button("toframe"))
662 , m_xHorizontalFT(m_xBuilder->weld_label("horiposft"))
663 , m_xHorizontalDLB(m_xBuilder->weld_combo_box("horipos"))
664 , m_xAtHorzPosFT(m_xBuilder->weld_label("horibyft"))
665 , m_xAtHorzPosED(m_xBuilder->weld_metric_spin_button("byhori", FieldUnit::CM))
666 , m_xHoriRelationFT(m_xBuilder->weld_label("horitoft"))
667 , m_xHoriRelationLB(m_xBuilder->weld_combo_box("horianchor"))
668 , m_xMirrorPagesCB(m_xBuilder->weld_check_button("mirror"))
669 , m_xVerticalFT(m_xBuilder->weld_label("vertposft"))
670 , m_xVerticalDLB(m_xBuilder->weld_combo_box("vertpos"))
671 , m_xAtVertPosFT(m_xBuilder->weld_label("vertbyft"))
672 , m_xAtVertPosED(m_xBuilder->weld_metric_spin_button("byvert", FieldUnit::CM))
673 , m_xVertRelationFT(m_xBuilder->weld_label("verttoft"))
674 , m_xVertRelationLB(m_xBuilder->weld_combo_box("vertanchor"))
675 , m_xFollowTextFlowCB(m_xBuilder->weld_check_button("followtextflow"))
676 , m_xExampleWN(new weld::CustomWeld(*m_xBuilder, "preview", m_aExampleWN))
677 , m_xWidthED(new SwPercentField(m_xBuilder->weld_metric_spin_button("width", FieldUnit::CM)))
678 , m_xHeightED(new SwPercentField(m_xBuilder->weld_metric_spin_button("height", FieldUnit::CM)))
679{
680 const auto nWidthRequest = m_xAtHorzPosED->get_preferred_size().Width();
681 m_xAtHorzPosED->set_size_request(nWidthRequest, -1);
682 m_xAtVertPosED->set_size_request(nWidthRequest, -1);
683
686
688
689 Link<weld::MetricSpinButton&,void> aLk3 = LINK(this, SwFramePage, ModifyHdl);
690 m_xWidthED->connect_value_changed( aLk3 );
691 m_xHeightED->connect_value_changed( aLk3 );
692 m_xAtHorzPosED->connect_value_changed( aLk3 );
693 m_xAtVertPosED->connect_value_changed( aLk3 );
694 m_xFollowTextFlowCB->connect_toggled(LINK(this, SwFramePage, RangeModifyClickHdl));
695
696 Link<weld::Toggleable&,void> aLk2 = LINK(this, SwFramePage, AnchorTypeHdl);
697 m_xAnchorAtPageRB->connect_toggled( aLk2 );
698 m_xAnchorAtParaRB->connect_toggled( aLk2 );
699 m_xAnchorAtCharRB->connect_toggled( aLk2 );
700 m_xAnchorAsCharRB->connect_toggled( aLk2 );
701 m_xAnchorAtFrameRB->connect_toggled( aLk2 );
702
703 m_xHorizontalDLB->connect_changed(LINK(this, SwFramePage, PosHdl));
704 m_xVerticalDLB->connect_changed(LINK(this, SwFramePage, PosHdl));
705
706 m_xHoriRelationLB->connect_changed(LINK(this, SwFramePage, RelHdl));
707 m_xVertRelationLB->connect_changed(LINK(this, SwFramePage, RelHdl));
708
709 m_xMirrorPagesCB->connect_toggled(LINK(this, SwFramePage, MirrorHdl));
710
711 aLk2 = LINK(this, SwFramePage, RelSizeClickHdl);
712 m_xRelWidthCB->connect_toggled(aLk2);
713 m_xRelHeightCB->connect_toggled(aLk2);
714
715 m_xAutoWidthCB->connect_toggled(LINK(this, SwFramePage, AutoWidthClickHdl));
716 m_xAutoHeightCB->connect_toggled(LINK(this, SwFramePage, AutoHeightClickHdl));
717
719 {
720 m_xAnchorAtPageRB->hide();
721 m_xAnchorAtParaRB->hide();
722 m_xAnchorAtFrameRB->hide();
723 }
724}
725
727{
728}
729
730namespace
731{
732 struct FrameMaps
733 {
734 FrameMap const * pMap;
735 size_t nCount;
736 };
737}
738
740{
741 static FrameMaps const aMaps[] = {
763 };
764
765 std::vector<SvxSwFramePosString::StringId> aFrames;
766 for (const FrameMaps & rMap : aMaps)
767 {
768 for (size_t j = 0; j < rMap.nCount; ++j)
769 {
770 aFrames.push_back(rMap.pMap[j].eStrId);
771 aFrames.push_back(rMap.pMap[j].eMirrorStrId);
772 }
773 }
774
775 std::sort(aFrames.begin(), aFrames.end());
776 aFrames.erase(std::unique(aFrames.begin(), aFrames.end()), aFrames.end());
777
778 for (const auto& rFrame : aFrames)
779 {
781 }
782
783 Size aBiggest(m_xHorizontalDLB->get_preferred_size());
784 m_xHorizontalDLB->set_size_request(aBiggest.Width(), -1);
785 m_xVerticalDLB->set_size_request(aBiggest.Width(), -1);
786 m_xHorizontalDLB->clear();
787}
788
789namespace
790{
791 struct RelationMaps
792 {
793 RelationMap const * pMap;
794 size_t nCount;
795 };
796}
797
799{
800 static const RelationMaps aMaps[] = {
803 };
804
805 std::vector<SvxSwFramePosString::StringId> aRels;
806 for (const RelationMaps & rMap : aMaps)
807 {
808 for (size_t j = 0; j < rMap.nCount; ++j)
809 {
810 aRels.push_back(rMap.pMap[j].eStrId);
811 aRels.push_back(rMap.pMap[j].eMirrorStrId);
812 }
813 }
814
815 std::sort(aRels.begin(), aRels.end());
816 aRels.erase(std::unique(aRels.begin(), aRels.end()), aRels.end());
817
818 for (const auto& rRel : aRels)
819 {
821 }
822
823 Size aBiggest(m_xHoriRelationLB->get_preferred_size());
824 m_xHoriRelationLB->set_size_request(aBiggest.Width(), -1);
825 m_xVertRelationLB->set_size_request(aBiggest.Width(), -1);
826 m_xRelWidthRelationLB->set_size_request(aBiggest.Width(), -1);
827 m_xRelHeightRelationLB->set_size_request(aBiggest.Width(), -1);
828 m_xHoriRelationLB->clear();
829}
830
831std::unique_ptr<SfxTabPage> SwFramePage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet *rSet)
832{
833 return std::make_unique<SwFramePage>(pPage, pController, *rSet);
834}
835
837{
838 // i#39692 - mustn't be called more than once
839 if (!m_xRealSizeBT->get_visible())
840 {
841 m_xWidthFT->show();
842 m_xWidthAutoFT->hide();
843 m_xAutoHeightCB->hide();
844
845 m_xHeightFT->show();
846 m_xHeightAutoFT->hide();
847 m_xAutoWidthCB->hide();
848
849 m_xRealSizeBT->show();
850 }
851}
852
854{
855 return static_cast<SwFrameDlg*>(GetDialogController())->GetWrtShell();
856}
857
859{
862
865
867 m_xWidthED->SetMetric(aMetric);
868 m_xHeightED->SetMetric(aMetric);
869 ::SetFieldUnit(*m_xAtHorzPosED, aMetric);
870 ::SetFieldUnit(*m_xAtVertPosED, aMetric);
871
872 const SwFormatAnchor& rAnchor = rSet->Get(RES_ANCHOR);
873
874 if (const SfxBoolItem* pMathItem = rSet->GetItemIfSet(FN_OLE_IS_MATH, false))
875 m_bIsMathOLE = pMathItem->GetValue();
876 if (const SfxBoolItem* pAlignItem = rSet->GetItemIfSet(FN_MATH_BASELINE_ALIGNMENT, false))
877 m_bIsMathBaselineAlignment = pAlignItem->GetValue();
879 && RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId()) );
880
881 if (m_bFormat)
882 {
883 // at formats no to-fly anchor
884 m_xAnchorAtFrameRB->set_sensitive(false);
885 if (rSet->GetItemState(FN_KEEP_ASPECT_RATIO) != SfxItemState::SET)
886 {
887 m_xFixedRatioCB->set_sensitive(false);
888 }
889 }
890 else
891 {
892 if (rAnchor.GetAnchorId() != RndStdIds::FLY_AT_FLY && !pSh->IsFlyInFly())
893 m_xAnchorAtFrameRB->hide();
895 {
896 OUString sHLabel = m_xHorizontalFT->get_label();
897 m_xHorizontalFT->set_label(m_xVerticalFT->get_label());
898 m_xVerticalFT->set_label(sHLabel);
899 m_bIsVerticalFrame = true;
900 }
901 }
902
903 if ( m_sDlgType == "PictureDialog" || m_sDlgType == "ObjectDialog" )
904 {
905 OSL_ENSURE(pSh , "shell not found");
906 pSh->GetGrfSize( m_aGrfSize );
907
908 if ( !m_bNew )
909 {
910 m_xRealSizeBT->connect_clicked(LINK(this, SwFramePage, RealSizeHdl));
912 }
913
914 if (m_sDlgType == "PictureDialog")
915 m_xFixedRatioCB->set_active(false);
916 else
917 {
918 if ( m_bNew )
919 SetPageTitle(SwResId(STR_FRMUI_OLE_INSERT));
920 else
921 SetPageTitle(SwResId(STR_FRMUI_OLE_EDIT));
922 }
923 }
924 else
925 {
926 m_aGrfSize = rSet->Get(RES_FRM_SIZE).GetSize();
927 }
928
929 // entering percent value made possible
930
931 // the available space is not yet known so the RefValue has to be calculated from size and relative size values
932 // this is needed only if relative values are already set
933 const SwFormatFrameSize& rFrameSize = rSet->Get(RES_FRM_SIZE);
934
935 m_xRelWidthRelationLB->append_text(SvxSwFramePosString::GetString(SwFPos::FRAME));
936 m_xRelWidthRelationLB->append_text(SvxSwFramePosString::GetString(SwFPos::REL_PG_FRAME));
937 if (rFrameSize.GetWidthPercent() != SwFormatFrameSize::SYNCED && rFrameSize.GetWidthPercent() != 0)
938 {
939 //calculate the reference value from the width and relative width values
940 sal_Int32 nSpace = rFrameSize.GetWidth() * 100 / rFrameSize.GetWidthPercent();
941 m_xWidthED->SetRefValue( nSpace );
942
943 m_xRelWidthRelationLB->set_sensitive(true);
944 }
945 else
946 m_xRelWidthRelationLB->set_sensitive(false);
947
948 m_xRelHeightRelationLB->append_text(SvxSwFramePosString::GetString(SwFPos::FRAME));
949 m_xRelHeightRelationLB->append_text(SvxSwFramePosString::GetString(SwFPos::REL_PG_FRAME));
950 if (rFrameSize.GetHeightPercent() != SwFormatFrameSize::SYNCED && rFrameSize.GetHeightPercent() != 0)
951 {
952 //calculate the reference value from the with and relative width values
953 sal_Int32 nSpace = rFrameSize.GetHeight() * 100 / rFrameSize.GetHeightPercent();
954 m_xHeightED->SetRefValue( nSpace );
955
956 m_xRelHeightRelationLB->set_sensitive(true);
957 }
958 else
959 m_xRelHeightRelationLB->set_sensitive(false);
960
961 // general initialisation part
962 switch(rAnchor.GetAnchorId())
963 {
964 case RndStdIds::FLY_AT_PAGE: m_xAnchorAtPageRB->set_active(true); break;
965 case RndStdIds::FLY_AT_PARA: m_xAnchorAtParaRB->set_active(true); break;
966 case RndStdIds::FLY_AT_CHAR: m_xAnchorAtCharRB->set_active(true); break;
967 case RndStdIds::FLY_AS_CHAR: m_xAnchorAsCharRB->set_active(true); break;
968 case RndStdIds::FLY_AT_FLY: m_xAnchorAtFrameRB->set_active(true);break;
969 default:; //prevent warning
970 }
971
972 // i#22341 - determine content position of character
973 // Note: content position can be NULL
975
976 // i#18732 - init checkbox value
977 {
978 const bool bFollowTextFlow =
979 rSet->Get(RES_FOLLOW_TEXT_FLOW).GetValue();
980 m_xFollowTextFlowCB->set_active(bFollowTextFlow);
981 }
982
983 if(m_bHtmlMode)
984 {
985 m_xAutoHeightCB->set_sensitive(false);
986 m_xAutoWidthCB->set_sensitive(false);
987 m_xMirrorPagesCB->hide();
988 if (m_sDlgType == "FrameDialog")
989 m_xFixedRatioCB->set_sensitive(false);
990 // i#18732 hide checkbox in HTML mode
991 m_xFollowTextFlowCB->hide();
992 }
993 else
994 {
995 // enable/disable of check box 'Mirror on..'
996 m_xMirrorPagesCB->set_sensitive(!m_xAnchorAsCharRB->get_active());
997
998 // enable/disable check box 'Follow text flow'.
999 // enable check box 'Follow text
1000 // flow' also for anchor type to-frame.
1001 m_xFollowTextFlowCB->set_sensitive(m_xAnchorAtParaRB->get_active() ||
1002 m_xAnchorAtCharRB->get_active() ||
1003 m_xAnchorAtFrameRB->get_active());
1004 }
1005
1006 Init(*rSet);
1007 m_xAtVertPosED->save_value();
1008 m_xAtHorzPosED->save_value();
1009 m_xFollowTextFlowCB->save_state();
1010
1011 m_xWidthED->save_value();
1012 m_xHeightED->save_value();
1013
1014 m_bNoModifyHdl = false;
1015 //lock PercentFields
1016 m_xWidthED->LockAutoCalculation(true);
1017 m_xHeightED->LockAutoCalculation(true);
1018 RangeModifyHdl(); // set all maximum values initially
1019 m_xHeightED->LockAutoCalculation(false);
1020 m_xWidthED->LockAutoCalculation(false);
1021
1022 m_xAutoHeightCB->save_state();
1023 m_xAutoWidthCB->save_state();
1024
1025 SwTwips nWidth = static_cast< SwTwips >(m_xWidthED->DenormalizePercent(m_xWidthED->get_value(FieldUnit::TWIP)));
1026 SwTwips nHeight = static_cast< SwTwips >(m_xHeightED->DenormalizePercent(m_xHeightED->get_value(FieldUnit::TWIP)));
1027 m_fWidthHeightRatio = nHeight ? double(nWidth) / double(nHeight) : 1.0;
1028}
1029
1030// stuff attributes into the set when OK
1032{
1033 bool bRet = false;
1036 OSL_ENSURE( pSh , "shell not found");
1037 const SfxItemSet& rOldSet = GetItemSet();
1038 const SfxPoolItem* pOldItem = nullptr;
1039
1040 RndStdIds eAnchorId = GetAnchor();
1041
1042 if ( !m_bFormat || eAnchorId != RndStdIds::FLY_AT_FLY )
1043 {
1044 pOldItem = GetOldItem(*rSet, RES_ANCHOR);
1045 if (m_bNew || !pOldItem || eAnchorId != static_cast<const SwFormatAnchor*>(pOldItem)->GetAnchorId())
1046 {
1047 SwFormatAnchor aAnc( eAnchorId, pSh->GetPhyPageNum() );
1048 bRet = nullptr != rSet->Put( aAnc );
1049 }
1050 }
1051
1052 if ( m_pHMap )
1053 {
1054 SwFormatHoriOrient aHoriOrient( rOldSet.Get(RES_HORI_ORIENT) );
1055
1056 const sal_Int32 nMapPos = GetMapPos(m_pHMap, *m_xHorizontalDLB);
1057 const sal_Int16 eHOri = GetAlignment(m_pHMap, nMapPos, *m_xHoriRelationLB);
1058 const sal_Int16 eRel = GetRelation(*m_xHoriRelationLB);
1059
1060 aHoriOrient.SetHoriOrient( eHOri );
1061 aHoriOrient.SetRelationOrient( eRel );
1062 aHoriOrient.SetPosToggle(m_xMirrorPagesCB->get_active());
1063
1064 bool bMod = m_xAtHorzPosED->get_value_changed_from_saved();
1065 bMod |= m_xMirrorPagesCB->get_state_changed_from_saved();
1066
1067 if ( eHOri == text::HoriOrientation::NONE &&
1068 (m_bNew || (m_bAtHorzPosModified || bMod) || m_nOldH != eHOri ) )
1069 {
1070 SwTwips nX = static_cast< SwTwips >(m_xAtHorzPosED->denormalize(m_xAtHorzPosED->get_value(FieldUnit::TWIP)));
1071 aHoriOrient.SetPos( nX );
1072 }
1073
1074 pOldItem = GetOldItem(*rSet, FN_HORI_ORIENT);
1075 bool bSame = false;
1076 if ((m_bNew == m_bFormat) && pOldItem)
1077 {
1078 bSame = aHoriOrient == static_cast<const SwFormatHoriOrient&>(*pOldItem);
1079 }
1080 if ((m_bNew && !m_bFormat) || ((m_bAtHorzPosModified || bMod) && !bSame))
1081 {
1082 bRet |= nullptr != rSet->Put( aHoriOrient );
1083 }
1084 }
1085
1086 if ( m_pVMap )
1087 {
1088 // alignment vertical
1089 SwFormatVertOrient aVertOrient( rOldSet.Get(RES_VERT_ORIENT) );
1090
1091 const sal_Int32 nMapPos = GetMapPos(m_pVMap, *m_xVerticalDLB);
1092 const sal_Int16 eVOri = GetAlignment(m_pVMap, nMapPos, *m_xVertRelationLB);
1093 const sal_Int16 eRel = GetRelation(*m_xVertRelationLB);
1094
1095 aVertOrient.SetVertOrient ( eVOri);
1096 aVertOrient.SetRelationOrient( eRel );
1097
1098 bool bMod = m_xAtVertPosED->get_value_changed_from_saved();
1099
1100 if ( eVOri == text::VertOrientation::NONE &&
1101 ( m_bNew || (m_bAtVertPosModified || bMod) || m_nOldV != eVOri) )
1102 {
1103 // vertical position
1104 // recalculate offset for character bound frames
1105 SwTwips nY = static_cast< SwTwips >(m_xAtVertPosED->denormalize(m_xAtVertPosED->get_value(FieldUnit::TWIP)));
1106 if (eAnchorId == RndStdIds::FLY_AS_CHAR)
1107 {
1108 nY *= -1;
1109 }
1110 aVertOrient.SetPos( nY );
1111 }
1112 pOldItem = GetOldItem(*rSet, FN_VERT_ORIENT);
1113 bool bSame = false;
1114 if((m_bNew == m_bFormat) && pOldItem)
1115 {
1116 bSame = m_bFormat ?
1117 aVertOrient.GetVertOrient() == static_cast<const SwFormatVertOrient*>(pOldItem)->GetVertOrient() &&
1118 aVertOrient.GetRelationOrient() == static_cast<const SwFormatVertOrient*>(pOldItem)->GetRelationOrient() &&
1119 aVertOrient.GetPos() == static_cast<const SwFormatVertOrient*>(pOldItem)->GetPos()
1120 : aVertOrient == static_cast<const SwFormatVertOrient&>(*pOldItem);
1121 }
1122 if( ( m_bNew && !m_bFormat ) || ((m_bAtVertPosModified || bMod) && !bSame ))
1123 {
1124 bRet |= nullptr != rSet->Put( aVertOrient );
1125 }
1126 }
1127
1128 // set size
1129 // new exception: when the size of pMgr(, 0), then the properties
1130 // for a graphic that isn't even loaded, are set. Then no SetSize
1131 // is done here when the size settings were not changed by the
1132 // user.
1133 const SwFormatFrameSize& rOldSize = rOldSet.Get(RES_FRM_SIZE);
1134 SwFormatFrameSize aSz( rOldSize );
1135
1136 auto nRelWidthRelation = m_xRelWidthRelationLB->get_active();
1137 if (nRelWidthRelation != -1)
1138 {
1139 if (nRelWidthRelation == 0)
1140 aSz.SetWidthPercentRelation(text::RelOrientation::FRAME);
1141 else if (nRelWidthRelation == 1)
1142 aSz.SetWidthPercentRelation(text::RelOrientation::PAGE_FRAME);
1143 }
1144 auto nRelHeightRelation = m_xRelHeightRelationLB->get_active();
1145 if (nRelHeightRelation != -1)
1146 {
1147 if (nRelHeightRelation == 0)
1148 aSz.SetHeightPercentRelation(text::RelOrientation::FRAME);
1149 else if (nRelHeightRelation == 1)
1150 aSz.SetHeightPercentRelation(text::RelOrientation::PAGE_FRAME);
1151 }
1152
1153 bool bValueModified = m_xWidthED->get_value_changed_from_saved() ||
1154 m_xHeightED->get_value_changed_from_saved();
1155 bool bCheckChanged = m_xRelWidthCB->get_state_changed_from_saved() ||
1156 m_xRelHeightCB->get_state_changed_from_saved() ||
1157 m_xFixedRatioCB->get_state_changed_from_saved();
1158
1159 bool bLegalValue = !(!rOldSize.GetWidth () && !rOldSize.GetHeight() &&
1160 m_xWidthED->get_value() == m_xWidthED->get_min() &&
1161 m_xHeightED->get_value() == m_xHeightED->get_min());
1162
1163 if ((m_bNew && !m_bFormat) || ((bValueModified || bCheckChanged) && bLegalValue))
1164 {
1165 sal_Int64 nNewWidth = m_xWidthED->DenormalizePercent(m_xWidthED->GetRealValue(FieldUnit::TWIP));
1166 sal_Int64 nNewHeight = m_xHeightED->DenormalizePercent(m_xHeightED->GetRealValue(FieldUnit::TWIP));
1167 aSz.SetWidth (static_cast< SwTwips >(nNewWidth));
1168 aSz.SetHeight(static_cast< SwTwips >(nNewHeight));
1169
1170 if (m_xRelWidthCB->get_active())
1171 {
1172 aSz.SetWidthPercent(static_cast<sal_uInt8>(std::min(MAX_PERCENT_WIDTH, m_xWidthED->Convert(m_xWidthED->NormalizePercent(nNewWidth), FieldUnit::TWIP, FieldUnit::PERCENT))));
1173 }
1174 else
1175 aSz.SetWidthPercent(0);
1176 if (m_xRelHeightCB->get_active())
1177 aSz.SetHeightPercent(static_cast<sal_uInt8>(std::min(MAX_PERCENT_HEIGHT, m_xHeightED->Convert(m_xHeightED->NormalizePercent(nNewHeight), FieldUnit::TWIP, FieldUnit::PERCENT))));
1178 else
1179 aSz.SetHeightPercent(0);
1180
1181 if (m_xFixedRatioCB->get_active() && (m_xRelWidthCB->get_active() != m_xRelHeightCB->get_active()))
1182 {
1183 if (m_xRelWidthCB->get_active())
1185 else
1187 }
1188 }
1189
1190 if( !IsInGraficMode() )
1191 {
1192 if (m_xAutoHeightCB->get_state_changed_from_saved())
1193 {
1195 if( eFrameSize != aSz.GetHeightSizeType() )
1196 aSz.SetHeightSizeType(eFrameSize);
1197 }
1198 if (m_xAutoWidthCB->get_state_changed_from_saved())
1199 {
1201 if( eFrameSize != aSz.GetWidthSizeType() )
1202 aSz.SetWidthSizeType( eFrameSize );
1203 }
1204 }
1205 if (m_xFixedRatioCB->get_state_changed_from_saved())
1206 bRet |= nullptr != rSet->Put(SfxBoolItem(FN_KEEP_ASPECT_RATIO, m_xFixedRatioCB->get_active()));
1207
1208 pOldItem = GetOldItem(*rSet, RES_FRM_SIZE);
1209
1210 if ((pOldItem && aSz != *pOldItem) || (!pOldItem && !m_bFormat) ||
1211 (m_bFormat &&
1212 (aSz.GetWidth() > 0 || aSz.GetWidthPercent() > 0) &&
1213 (aSz.GetHeight() > 0 || aSz.GetHeightPercent() > 0)))
1214 {
1215 if (aSz.GetHeightSizeType() == SwFrameSize::Variable) // there is no VAR_SIZE in frames
1217
1218 bRet |= nullptr != rSet->Put( aSz );
1219 }
1220 if (m_xFollowTextFlowCB->get_state_changed_from_saved())
1221 {
1222 bRet |= nullptr != rSet->Put(SwFormatFollowTextFlow(m_xFollowTextFlowCB->get_active()));
1223 }
1224 return bRet;
1225}
1226
1227// initialise horizontal and vertical Pos
1229 sal_Int16 nH,
1230 sal_Int16 nHRel,
1231 sal_Int16 nV,
1232 sal_Int16 nVRel,
1233 tools::Long nX,
1234 tools::Long nY)
1235{
1236 auto nPos = m_xVerticalDLB->get_active();
1237 if (nPos != -1 && m_pVMap)
1238 {
1240
1241 nPos = m_xVertRelationLB->get_active();
1242 if (nPos != -1)
1243 m_nOldVRel = weld::fromId<RelationMap*>(m_xVertRelationLB->get_id(nPos))->nRelation;
1244 }
1245
1246 nPos = m_xHorizontalDLB->get_active();
1247 if (nPos != -1 && m_pHMap)
1248 {
1250
1251 nPos = m_xHoriRelationLB->get_active();
1252 if (nPos != -1)
1253 m_nOldHRel = weld::fromId<RelationMap*>(m_xHoriRelationLB->get_id(nPos))->nRelation;
1254 }
1255
1256 bool bEnable = true;
1257 if ( eId == RndStdIds::FLY_AT_PAGE )
1258 {
1261 }
1262 else if ( eId == RndStdIds::FLY_AT_FLY )
1263 {
1264 // own vertical alignment map for to frame
1265 // anchored objects.
1268 }
1269 else if ( eId == RndStdIds::FLY_AT_PARA )
1270 {
1271 if(m_bHtmlMode)
1272 {
1275 }
1276 else
1277 {
1280 }
1281 }
1282 else if ( eId == RndStdIds::FLY_AT_CHAR )
1283 {
1284 if(m_bHtmlMode)
1285 {
1288 }
1289 else
1290 {
1293 }
1294 }
1295 else if ( eId == RndStdIds::FLY_AS_CHAR )
1296 {
1298 m_pHMap = nullptr;
1299 bEnable = false;
1300 }
1301 m_xHorizontalDLB->set_sensitive( bEnable );
1302 m_xHorizontalFT->set_sensitive( bEnable );
1303
1304 // select current Pos
1305 // horizontal
1306 if ( nH < 0 )
1307 {
1308 nH = m_nOldH;
1309 nHRel = m_nOldHRel;
1310 }
1311 sal_Int32 nMapPos = FillPosLB(m_pHMap, nH, nHRel, *m_xHorizontalDLB);
1312 FillRelLB(m_pHMap, nMapPos, nH, nHRel, *m_xHoriRelationLB, *m_xHoriRelationFT);
1313
1314 // vertical
1315 if ( nV < 0 )
1316 {
1317 nV = m_nOldV;
1318 nVRel = m_nOldVRel;
1319 }
1320 nMapPos = FillPosLB(m_pVMap, nV, nVRel, *m_xVerticalDLB);
1321 FillRelLB(m_pVMap, nMapPos, nV, nVRel, *m_xVertRelationLB, *m_xVertRelationFT);
1322
1323 bEnable = nH == text::HoriOrientation::NONE && eId != RndStdIds::FLY_AS_CHAR;
1324 if (!bEnable)
1325 m_xAtHorzPosED->set_value(0, FieldUnit::TWIP);
1326 else
1327 {
1328 if (nX != LONG_MAX)
1329 m_xAtHorzPosED->set_value(m_xAtHorzPosED->normalize(nX), FieldUnit::TWIP);
1330 }
1331 m_xAtHorzPosFT->set_sensitive( bEnable );
1332 m_xAtHorzPosED->set_sensitive( bEnable );
1333
1334 bEnable = nV == text::VertOrientation::NONE;
1335 if ( !bEnable )
1336 m_xAtVertPosED->set_value(0, FieldUnit::TWIP);
1337 else
1338 {
1339 if (eId == RndStdIds::FLY_AS_CHAR)
1340 {
1341 if ( nY == LONG_MAX )
1342 nY = 0;
1343 else
1344 nY *= -1;
1345 }
1346 if ( nY != LONG_MAX )
1347 m_xAtVertPosED->set_value(m_xAtVertPosED->normalize(nY), FieldUnit::TWIP);
1348 }
1349 m_xAtVertPosFT->set_sensitive( bEnable && m_bAllowVertPositioning );
1350 m_xAtVertPosED->set_sensitive( bEnable && m_bAllowVertPositioning );
1351 UpdateExample();
1352}
1353
1354sal_Int32 SwFramePage::FillPosLB(const FrameMap* _pMap,
1355 const sal_Int16 _nAlign,
1356 const sal_Int16 _nRel,
1357 weld::ComboBox& _rLB )
1358{
1359 OUString sSelEntry;
1360 const OUString sOldEntry = _rLB.get_active_text();
1361
1362 _rLB.clear();
1363
1364 // i#22341 determine all possible listbox relations for
1365 // given relation for map <aVCharMap>
1366 const LB nLBRelations = (_pMap != aVCharMap)
1367 ? LB::NONE
1369
1370 // fill Listbox
1371 size_t nCount = ::lcl_GetFrameMapCount(_pMap);
1372 for (size_t i = 0; _pMap && i < nCount; ++i)
1373 {
1374// Why not from the left/from inside or from above?
1375 SvxSwFramePosString::StringId eStrId = m_xMirrorPagesCB->get_active() ? _pMap[i].eMirrorStrId : _pMap[i].eStrId;
1376 // --> OD 2009-08-31 #mongolianlayout#
1377 eStrId = lcl_ChangeResIdToVerticalOrRTL( eStrId,
1381 OUString sEntry(SvxSwFramePosString::GetString(eStrId));
1382 if (_rLB.find_text(sEntry) == -1)
1383 {
1384 // don't insert entries when frames are character bound
1385 _rLB.append_text(sEntry);
1386 }
1387 // i#22341 - add condition to handle map <aVCharMap>
1388 // that is ambiguous in the alignment.
1389 if ( _pMap[i].nAlign == _nAlign &&
1390 ( (_pMap != aVCharMap) || _pMap[i].nLBRelations & nLBRelations ) )
1391 {
1392 sSelEntry = sEntry;
1393 }
1394 }
1395
1396 _rLB.set_active_text(sSelEntry);
1397 if (_rLB.get_active() == -1)
1398 _rLB.set_active_text(sOldEntry);
1399
1400 if (_rLB.get_active() == -1 && _rLB.get_count())
1401 _rLB.set_active(0);
1402
1403 PosHdl(_rLB);
1404
1405 return GetMapPos(_pMap, _rLB);
1406}
1407
1409 const sal_uInt16 _nLBSelPos,
1410 const sal_Int16 _nAlign,
1411 const sal_Int16 _nRel,
1412 weld::ComboBox& _rLB,
1413 weld::Label& _rFT)
1414{
1415 OUString sSelEntry;
1416 LB nLBRelations = LB::NONE;
1417 size_t nMapCount = ::lcl_GetFrameMapCount(_pMap);
1418
1419 _rLB.clear();
1420
1421 if (_nLBSelPos < nMapCount)
1422 {
1423 if (_pMap == aVAsCharHtmlMap || _pMap == aVAsCharMap)
1424 {
1425 const OUString sOldEntry(_rLB.get_active_text());
1426 SvxSwFramePosString::StringId eStrId = _pMap[_nLBSelPos].eStrId;
1427
1428 for (size_t nMapPos = 0; nMapPos < nMapCount; nMapPos++)
1429 {
1430 if (_pMap[nMapPos].eStrId == eStrId)
1431 {
1432 nLBRelations = _pMap[nMapPos].nLBRelations;
1433 for (RelationMap const & rCharMap : aAsCharRelationMap)
1434 {
1435 if (nLBRelations & rCharMap.nLBRelation)
1436 {
1437 // --> OD 2009-08-31 #mongolianlayout#
1439 lcl_ChangeResIdToVerticalOrRTL( rCharMap.eStrId,
1443 const OUString sEntry = SvxSwFramePosString::GetString(sStrId1);
1444 _rLB.append(weld::toId(&rCharMap), sEntry);
1445 if (_pMap[nMapPos].nAlign == _nAlign)
1446 sSelEntry = sEntry;
1447 break;
1448 }
1449 }
1450 }
1451 }
1452 if (!sSelEntry.isEmpty())
1453 _rLB.set_active_text(sSelEntry);
1454 else
1455 {
1456 _rLB.set_active_text(sOldEntry);
1457
1458 if (_rLB.get_active() == -1)
1459 {
1460 for (int i = 0; i < _rLB.get_count(); i++)
1461 {
1462 RelationMap *pEntry = weld::fromId<RelationMap*>(_rLB.get_id(i));
1463 if (pEntry->nLBRelation == LB::RelChar) // default
1464 {
1465 _rLB.set_active(i);
1466 break;
1467 }
1468 }
1469 }
1470 }
1471 }
1472 else
1473 {
1474 // special handling for map <aVCharMap>,
1475 // because its ambiguous in its <eStrId>/<eMirrorStrId>.
1476 if ( _pMap == aVCharMap )
1477 {
1478 nLBRelations = ::lcl_GetLBRelationsForStrID( _pMap,
1479 ( m_xMirrorPagesCB->get_active()
1480 ? _pMap[_nLBSelPos].eMirrorStrId
1481 : _pMap[_nLBSelPos].eStrId),
1482 m_xMirrorPagesCB->get_active() );
1483 }
1484 else
1485 {
1486 nLBRelations = _pMap[_nLBSelPos].nLBRelations;
1487 }
1488
1489 for (sal_uLong nBit = 1; nBit < 0x80000000; nBit <<= 1)
1490 {
1491 if (nLBRelations & static_cast<LB>(nBit))
1492 {
1493 for (RelationMap const & rMap : aRelationMap)
1494 {
1495 if (rMap.nLBRelation == static_cast<LB>(nBit))
1496 {
1497 SvxSwFramePosString::StringId eStrId1 = m_xMirrorPagesCB->get_active() ?
1498 rMap.eMirrorStrId : rMap.eStrId;
1499 // --> OD 2009-08-31 #mongolianlayout#
1500 eStrId1 =
1505 const OUString sEntry = SvxSwFramePosString::GetString(eStrId1);
1506 _rLB.append(weld::toId(&rMap), sEntry);
1507 if (sSelEntry.isEmpty() && rMap.nRelation == _nRel)
1508 sSelEntry = sEntry;
1509 }
1510 }
1511 }
1512 }
1513 if (!sSelEntry.isEmpty())
1514 _rLB.set_active_text(sSelEntry);
1515 else
1516 {
1517 // Probably anchor switch. So look for similar relation
1518 sal_Int16 nSimRel = -1;
1519 switch (_nRel)
1520 {
1521 case text::RelOrientation::FRAME:
1522 nSimRel = text::RelOrientation::PAGE_FRAME;
1523 break;
1524 case text::RelOrientation::PRINT_AREA:
1525 nSimRel = text::RelOrientation::PAGE_PRINT_AREA;
1526 break;
1527 case text::RelOrientation::PAGE_LEFT:
1528 nSimRel = text::RelOrientation::FRAME_LEFT;
1529 break;
1530 case text::RelOrientation::PAGE_RIGHT:
1531 nSimRel = text::RelOrientation::FRAME_RIGHT;
1532 break;
1533 case text::RelOrientation::FRAME_LEFT:
1534 nSimRel = text::RelOrientation::PAGE_LEFT;
1535 break;
1536 case text::RelOrientation::FRAME_RIGHT:
1537 nSimRel = text::RelOrientation::PAGE_RIGHT;
1538 break;
1539 case text::RelOrientation::PAGE_FRAME:
1540 nSimRel = text::RelOrientation::FRAME;
1541 break;
1542 case text::RelOrientation::PAGE_PRINT_AREA:
1543 nSimRel = text::RelOrientation::PRINT_AREA;
1544 break;
1545
1546 default:
1547 if (_rLB.get_active() != -1)
1548 {
1549 RelationMap *pEntry = weld::fromId<RelationMap*>(_rLB.get_id(_rLB.get_count() - 1));
1550 nSimRel = pEntry->nRelation;
1551 }
1552 break;
1553 }
1554
1555 for (int i = 0; i < _rLB.get_count(); i++)
1556 {
1557 RelationMap *pEntry = weld::fromId<RelationMap*>(_rLB.get_id(i));
1558 if (pEntry->nRelation == nSimRel)
1559 {
1560 _rLB.set_active(i);
1561 break;
1562 }
1563 }
1564
1565 if (_rLB.get_active() == -1)
1566 _rLB.set_active(0);
1567 }
1568 }
1569 }
1570
1571 const bool bEnable = _rLB.get_count() != 0
1572 && (&_rLB != m_xVertRelationLB.get() || m_bAllowVertPositioning);
1573 _rLB.set_sensitive( bEnable );
1574 _rFT.set_sensitive( bEnable );
1575
1576 RelHdl(_rLB);
1577}
1578
1579sal_Int16 SwFramePage::GetRelation(const weld::ComboBox& rRelationLB)
1580{
1581 const auto nPos = rRelationLB.get_active();
1582 if (nPos != -1)
1583 {
1584 RelationMap *pEntry = weld::fromId<RelationMap *>(rRelationLB.get_id(nPos));
1585 return pEntry->nRelation;
1586 }
1587
1588 return 0;
1589}
1590
1591sal_Int16 SwFramePage::GetAlignment(FrameMap const *pMap, sal_Int32 nMapPos,
1592 const weld::ComboBox& rRelationLB)
1593{
1594 if (!pMap || nMapPos < 0)
1595 return 0;
1596
1597 const size_t nMapCount = ::lcl_GetFrameMapCount(pMap);
1598
1599 if (o3tl::make_unsigned(nMapPos) >= nMapCount)
1600 return 0;
1601
1602 // i#22341 special handling also for map <aVCharMap>,
1603 // because it contains ambiguous items for alignment
1604 if ( pMap != aVAsCharHtmlMap && pMap != aVAsCharMap && pMap != aVCharMap )
1605 return pMap[nMapPos].nAlign;
1606
1607 if (rRelationLB.get_active() == -1)
1608 return 0;
1609
1610 const RelationMap *const pRelationMap = weld::fromId<const RelationMap*>(
1611 rRelationLB.get_active_id());
1612 const LB nRel = pRelationMap->nLBRelation;
1613 const SvxSwFramePosString::StringId eStrId = pMap[nMapPos].eStrId;
1614
1615 for (size_t i = 0; i < nMapCount; ++i)
1616 {
1617 if (pMap[i].eStrId == eStrId && (pMap[i].nLBRelations & nRel))
1618 return pMap[i].nAlign;
1619 }
1620
1621 return 0;
1622}
1623
1624sal_Int32 SwFramePage::GetMapPos(const FrameMap *pMap, const weld::ComboBox& rAlignLB)
1625{
1626 sal_Int32 nMapPos = 0;
1627 auto nLBSelPos = rAlignLB.get_active();
1628
1629 if (nLBSelPos != -1)
1630 {
1631 if (pMap == aVAsCharHtmlMap || pMap == aVAsCharMap)
1632 {
1633 const size_t nMapCount = ::lcl_GetFrameMapCount(pMap);
1634 const OUString sSelEntry(rAlignLB.get_active_text());
1635
1636 for (size_t i = 0; i < nMapCount; i++)
1637 {
1638 SvxSwFramePosString::StringId eResId = pMap[i].eStrId;
1639
1640 OUString sEntry = SvxSwFramePosString::GetString(eResId);
1642
1643 if (sEntry == sSelEntry)
1644 {
1645 nMapPos = static_cast< sal_Int32 >(i);
1646 break;
1647 }
1648 }
1649 }
1650 else
1651 nMapPos = nLBSelPos;
1652 }
1653
1654 return nMapPos;
1655}
1656
1658{
1659 RndStdIds nRet = RndStdIds::FLY_AT_PAGE;
1660 if (m_xAnchorAtParaRB->get_active())
1661 {
1662 nRet = RndStdIds::FLY_AT_PARA;
1663 }
1664 else if (m_xAnchorAtCharRB->get_active())
1665 {
1666 nRet = RndStdIds::FLY_AT_CHAR;
1667 }
1668 else if (m_xAnchorAsCharRB->get_active())
1669 {
1670 nRet = RndStdIds::FLY_AS_CHAR;
1671 }
1672 else if (m_xAnchorAtFrameRB->get_active())
1673 {
1674 nRet = RndStdIds::FLY_AT_FLY;
1675 }
1676 return nRet;
1677}
1678
1679// Bsp - Update
1681{
1682 m_bNoModifyHdl = true;
1683 Init(rSet);
1684 m_bNoModifyHdl = false;
1685 //lock PercentFields
1686 m_xWidthED->LockAutoCalculation(true);
1687 m_xHeightED->LockAutoCalculation(true);
1688 RangeModifyHdl(); // set all maximum values initially
1689 m_xHeightED->LockAutoCalculation(false);
1690 m_xWidthED->LockAutoCalculation(false);
1691 m_xFollowTextFlowCB->save_state();
1692}
1693
1695{
1696 if ( _pSet )
1697 {
1698 FillItemSet( _pSet );
1699
1700 if (!m_bFormat) // tdf#112574 no anchor in styles
1701 {
1702 //FillItemSet doesn't set the anchor into the set when it matches
1703 //the original. But for the other pages we need the current anchor.
1706 RndStdIds eAnchorId = GetAnchor();
1707 SwFormatAnchor aAnc( eAnchorId, pSh->GetPhyPageNum() );
1708 _pSet->Put( aAnc );
1709 }
1710 }
1711
1712 return DeactivateRC::LeavePage;
1713}
1714
1715// swap left/right with inside/outside
1717{
1718 RndStdIds eId = GetAnchor();
1719 InitPos(eId, -1, 0, -1, 0, LONG_MAX, LONG_MAX);
1720}
1721
1722IMPL_LINK( SwFramePage, RelSizeClickHdl, weld::Toggleable&, rBtn, void )
1723{
1724 if (&rBtn == m_xRelWidthCB.get())
1725 {
1726 m_xWidthED->ShowPercent(rBtn.get_active());
1727 m_xRelWidthRelationLB->set_sensitive(rBtn.get_active());
1728 if (rBtn.get_active())
1729 m_xWidthED->get()->set_max(MAX_PERCENT_WIDTH, FieldUnit::NONE);
1730 }
1731 else // rBtn == m_xRelHeightCB.get()
1732 {
1733 m_xHeightED->ShowPercent(rBtn.get_active());
1734 m_xRelHeightRelationLB->set_sensitive(rBtn.get_active());
1735 if (rBtn.get_active())
1736 m_xHeightED->get()->set_max(MAX_PERCENT_HEIGHT, FieldUnit::NONE);
1737 }
1738
1739 RangeModifyHdl(); // correct the values again
1740
1741 if (&rBtn == m_xRelWidthCB.get())
1742 ModifyHdl(*m_xWidthED->get());
1743 else // rBtn == m_xRelHeightCB.get()
1744 ModifyHdl(*m_xHeightED->get());
1745}
1746
1747// range check
1748IMPL_LINK_NOARG(SwFramePage, RangeModifyClickHdl, weld::Toggleable&, void)
1749{
1750 RangeModifyHdl();
1751}
1752
1754{
1755 if (m_bNoModifyHdl)
1756 return;
1757
1760 OSL_ENSURE(pSh , "shell not found");
1761 SwFlyFrameAttrMgr aMgr( m_bNew, pSh, GetItemSet() );
1763
1764 aVal.nAnchorType = GetAnchor();
1765 aVal.bAutoHeight = m_xAutoHeightCB->get_active();
1766 aVal.bMirror = m_xMirrorPagesCB->get_active();
1767 aVal.bFollowTextFlow = m_xFollowTextFlowCB->get_active();
1768
1769 if ( m_pHMap )
1770 {
1771 // alignment horizontal
1772 const sal_Int32 nMapPos = GetMapPos(m_pHMap, *m_xHorizontalDLB);
1775 }
1776 else
1778
1779 if ( m_pVMap )
1780 {
1781 // alignment vertical
1782 const sal_Int32 nMapPos = GetMapPos(m_pVMap, *m_xVerticalDLB);
1785 }
1786 else
1788
1789 const tools::Long nAtHorzPosVal = static_cast< tools::Long >(
1790 m_xAtHorzPosED->denormalize(m_xAtHorzPosED->get_value(FieldUnit::TWIP)) );
1791 const tools::Long nAtVertPosVal = static_cast< tools::Long >(
1792 m_xAtVertPosED->denormalize(m_xAtVertPosED->get_value(FieldUnit::TWIP)) );
1793
1794 aVal.nHPos = nAtHorzPosVal;
1795 aVal.nVPos = nAtVertPosVal;
1796
1797 aMgr.ValidateMetrics(aVal, mpToCharContentPos, true); // one time, to get reference values for percental values
1798
1799 // set reference values for percental values (100%) ...
1800 m_xWidthED->SetRefValue(aVal.aPercentSize.Width());
1801 m_xHeightED->SetRefValue(aVal.aPercentSize.Height());
1802
1803 // ... and correctly convert width and height with it
1804 SwTwips nWidth = static_cast< SwTwips >(m_xWidthED->DenormalizePercent(m_xWidthED->get_value(FieldUnit::TWIP)));
1805 SwTwips nHeight = static_cast< SwTwips >(m_xHeightED->DenormalizePercent(m_xHeightED->get_value(FieldUnit::TWIP)));
1806 aVal.nWidth = nWidth;
1807 aVal.nHeight = nHeight;
1808
1809 aMgr.ValidateMetrics(aVal, mpToCharContentPos); // one more time, to determine all remaining values with correct width and height.
1810
1811 // all columns have to be correct
1812 const SfxItemSet* pExampleSet = GetDialogExampleSet();
1813 if (pExampleSet && SfxItemState::DEFAULT <= pExampleSet->GetItemState(RES_COL))
1814 {
1815 const SwFormatCol& rCol = pExampleSet->Get(RES_COL);
1816 if ( rCol.GetColumns().size() > 1 )
1817 {
1818 for (const SwColumn & i : rCol.GetColumns())
1819 {
1820 aVal.nMinWidth += i.GetLeft() +
1821 i.GetRight() +
1822 MINFLY;
1823 }
1824 aVal.nMinWidth -= MINFLY;//one was already in there!
1825 }
1826 }
1827
1828 nWidth = aVal.nWidth;
1829 nHeight = aVal.nHeight;
1830
1831 // minimum range also for template
1832 m_xHeightED->set_min(m_xHeightED->NormalizePercent(aVal.nMinHeight), FieldUnit::TWIP);
1833 m_xWidthED->set_min(m_xWidthED->NormalizePercent(aVal.nMinWidth), FieldUnit::TWIP);
1834
1835 SwTwips nMaxWidth(aVal.nMaxWidth);
1836 SwTwips nMaxHeight(aVal.nMaxHeight);
1837
1838 if (aVal.bAutoHeight && (m_sDlgType == "PictureDialog" || m_sDlgType == "ObjectDialog"))
1839 {
1840 SwTwips nTmp = std::min(nWidth * nMaxHeight / std::max(nHeight, SwTwips(1)), nMaxHeight);
1841 m_xWidthED->set_max(m_xWidthED->NormalizePercent(nTmp), FieldUnit::TWIP);
1842
1843 nTmp = std::min(nHeight * nMaxWidth / std::max(nWidth, SwTwips(1)), nMaxWidth);
1844 m_xHeightED->set_max(m_xWidthED->NormalizePercent(nTmp), FieldUnit::TWIP);
1845 }
1846 else
1847 {
1848 SwTwips nTmp = static_cast< SwTwips >(m_xHeightED->NormalizePercent(nMaxHeight));
1849 m_xHeightED->set_max(nTmp, FieldUnit::TWIP);
1850
1851 nTmp = static_cast< SwTwips >(m_xWidthED->NormalizePercent(nMaxWidth));
1852 m_xWidthED->set_max(nTmp, FieldUnit::TWIP);
1853 }
1854
1855 m_xAtHorzPosED->set_range(m_xAtHorzPosED->normalize(aVal.nMinHPos),
1856 m_xAtHorzPosED->normalize(aVal.nMaxHPos),
1857 FieldUnit::TWIP);
1858 if (aVal.nHPos != nAtHorzPosVal)
1859 m_xAtHorzPosED->set_value(m_xAtHorzPosED->normalize(aVal.nHPos), FieldUnit::TWIP);
1860
1861 const SwTwips nUpperOffset = (aVal.nAnchorType == RndStdIds::FLY_AS_CHAR)
1862 ? m_nUpperBorder : 0;
1863 const SwTwips nLowerOffset = (aVal.nAnchorType == RndStdIds::FLY_AS_CHAR)
1864 ? m_nLowerBorder : 0;
1865
1866 m_xAtVertPosED->set_range(m_xAtVertPosED->normalize(aVal.nMinVPos + nLowerOffset + nUpperOffset),
1867 m_xAtVertPosED->normalize(aVal.nMaxVPos),
1868 FieldUnit::TWIP);
1869 if (aVal.nVPos != nAtVertPosVal)
1870 m_xAtVertPosED->set_value(m_xAtVertPosED->normalize(aVal.nVPos), FieldUnit::TWIP);
1871}
1872
1874{
1875 m_xMirrorPagesCB->set_sensitive(!m_xAnchorAsCharRB->get_active());
1876
1877 // i#18732 - enable check box 'Follow text flow' for anchor
1878 // type to-paragraph' and to-character
1879 // i#22305 - enable check box 'Follow text
1880 // flow' also for anchor type to-frame.
1881 m_xFollowTextFlowCB->set_sensitive(m_xAnchorAtParaRB->get_active() ||
1882 m_xAnchorAtCharRB->get_active() ||
1883 m_xAnchorAtFrameRB->get_active());
1884
1885 RndStdIds eId = GetAnchor();
1886
1887 InitPos( eId, -1, 0, -1, 0, LONG_MAX, LONG_MAX);
1888 RangeModifyHdl();
1889
1890 if(m_bHtmlMode)
1891 {
1892 PosHdl(*m_xHorizontalDLB);
1893 PosHdl(*m_xVerticalDLB);
1894 }
1895
1896 EnableVerticalPositioning( !(m_bIsMathOLE && m_bIsMathBaselineAlignment
1897 && RndStdIds::FLY_AS_CHAR == eId) );
1898}
1899
1900IMPL_LINK( SwFramePage, PosHdl, weld::ComboBox&, rLB, void )
1901{
1902 bool bHori = &rLB == m_xHorizontalDLB.get();
1903 weld::ComboBox *pRelLB = bHori ? m_xHoriRelationLB.get() : m_xVertRelationLB.get();
1904 weld::Label *pRelFT = bHori ? m_xHoriRelationFT.get() : m_xVertRelationFT.get();
1905 FrameMap const *pMap = bHori ? m_pHMap : m_pVMap;
1906
1907 const sal_Int32 nMapPos = GetMapPos(pMap, rLB);
1908 const sal_Int16 nAlign = GetAlignment(pMap, nMapPos, *pRelLB);
1909
1910 if (bHori)
1911 {
1912 bool bEnable = text::HoriOrientation::NONE == nAlign;
1913 m_xAtHorzPosED->set_sensitive( bEnable );
1914 m_xAtHorzPosFT->set_sensitive( bEnable );
1915 }
1916 else
1917 {
1918 bool bEnable = text::VertOrientation::NONE == nAlign && m_bAllowVertPositioning;
1919 m_xAtVertPosED->set_sensitive( bEnable );
1920 m_xAtVertPosFT->set_sensitive( bEnable );
1921 }
1922
1923 RangeModifyHdl();
1924
1925 sal_Int16 nRel = 0;
1926 if (rLB.get_active() != -1)
1927 {
1928 if (pRelLB->get_active() != -1)
1929 nRel = weld::fromId<RelationMap*>(pRelLB->get_active_id())->nRelation;
1930 FillRelLB(pMap, nMapPos, nAlign, nRel, *pRelLB, *pRelFT);
1931 }
1932 else
1933 pRelLB->clear();
1934
1935 UpdateExample();
1936
1937 if (bHori)
1938 m_bAtHorzPosModified = true;
1939 else
1940 m_bAtVertPosModified = true;
1941
1942 // special treatment for HTML-Mode with horizontal-vertical-dependencies
1943 if(!(m_bHtmlMode && (RndStdIds::FLY_AT_CHAR == GetAnchor())))
1944 return;
1945
1946 bool bSet = false;
1947 if(bHori)
1948 {
1949 // right is allowed only above - from the left only above
1950 // from the left at character -> below
1951 if((text::HoriOrientation::LEFT == nAlign || text::HoriOrientation::RIGHT == nAlign) &&
1952 0 == m_xVerticalDLB->get_active())
1953 {
1954 if(text::RelOrientation::FRAME == nRel)
1955 m_xVerticalDLB->set_active(1);
1956 else
1957 m_xVerticalDLB->set_active(0);
1958 bSet = true;
1959 }
1960 else if(text::HoriOrientation::LEFT == nAlign && 1 == m_xVerticalDLB->get_active())
1961 {
1962 m_xVerticalDLB->set_active(0);
1963 bSet = true;
1964 }
1965 else if(text::HoriOrientation::NONE == nAlign && 1 == m_xVerticalDLB->get_active())
1966 {
1967 m_xVerticalDLB->set_active(0);
1968 bSet = true;
1969 }
1970 if(bSet)
1971 PosHdl(*m_xVerticalDLB);
1972 }
1973 else
1974 {
1975 if(text::VertOrientation::TOP == nAlign)
1976 {
1977 if (1 == m_xHorizontalDLB->get_active())
1978 {
1979 m_xHorizontalDLB->set_active(0);
1980 bSet = true;
1981 }
1982 m_xHoriRelationLB->set_active(1);
1983 }
1984 else if(text::VertOrientation::CHAR_BOTTOM == nAlign)
1985 {
1986 if (2 == m_xHorizontalDLB->get_active())
1987 {
1988 m_xHorizontalDLB->set_active(0);
1989 bSet = true;
1990 }
1991 m_xHoriRelationLB->set_active(0) ;
1992 }
1993 if(bSet)
1994 PosHdl(*m_xHorizontalDLB);
1995 }
1996}
1997
1998// horizontal Pos
1999IMPL_LINK( SwFramePage, RelHdl, weld::ComboBox&, rLB, void )
2000{
2001 bool bHori = &rLB == m_xHoriRelationLB.get();
2002
2003 UpdateExample();
2004
2005 if (bHori)
2006 m_bAtHorzPosModified = true;
2007 else
2008 m_bAtVertPosModified = true;
2009
2010 if (m_bHtmlMode && (RndStdIds::FLY_AT_CHAR == GetAnchor()))
2011 {
2012 if(bHori)
2013 {
2014 const sal_Int16 nRel = GetRelation(*m_xHoriRelationLB);
2015 if(text::RelOrientation::PRINT_AREA == nRel && 0 == m_xVerticalDLB->get_active())
2016 {
2017 m_xVerticalDLB->set_active(1);
2018 }
2019 else if(text::RelOrientation::CHAR == nRel && 1 == m_xVerticalDLB->get_active())
2020 {
2021 m_xVerticalDLB->set_active(0);
2022 }
2023 }
2024 }
2025 RangeModifyHdl();
2026}
2027
2029{
2030 m_xWidthED->set_value(m_xWidthED->NormalizePercent(m_aGrfSize.Width()), FieldUnit::TWIP);
2031 m_xHeightED->set_value(m_xHeightED->NormalizePercent(m_aGrfSize.Height()), FieldUnit::TWIP);
2032 m_fWidthHeightRatio = m_aGrfSize.Height() ? double(m_aGrfSize.Width()) / double(m_aGrfSize.Height()) : 1.0;
2033 UpdateExample();
2034}
2035
2037{
2038 if( !IsInGraficMode() )
2039 HandleAutoCB( m_xAutoWidthCB->get_active(), *m_xWidthFT, *m_xWidthAutoFT, *m_xWidthED->get() );
2040}
2041
2043{
2044 if (!IsInGraficMode())
2045 HandleAutoCB(m_xAutoHeightCB->get_active(), *m_xHeightFT, *m_xHeightAutoFT, *m_xWidthED->get());
2046}
2047
2049{
2050 SwTwips nWidth = static_cast< SwTwips >(m_xWidthED->DenormalizePercent(m_xWidthED->get_value(FieldUnit::TWIP)));
2051 SwTwips nHeight = static_cast< SwTwips >(m_xHeightED->DenormalizePercent(m_xHeightED->get_value(FieldUnit::TWIP)));
2052 if (m_xFixedRatioCB->get_active())
2053 {
2054 if (&rEdit == m_xWidthED->get())
2055 {
2056 nHeight = SwTwips(static_cast<double>(nWidth) / m_fWidthHeightRatio);
2057 m_xHeightED->set_value(m_xHeightED->NormalizePercent(nHeight), FieldUnit::TWIP);
2058 }
2059 else if (&rEdit == m_xHeightED->get())
2060 {
2061 nWidth = SwTwips(static_cast<double>(nHeight) * m_fWidthHeightRatio);
2062 m_xWidthED->set_value(m_xWidthED->NormalizePercent(nWidth), FieldUnit::TWIP);
2063 }
2064 }
2065 m_fWidthHeightRatio = nHeight ? double(nWidth) / double(nHeight) : 1.0;
2066 UpdateExample();
2067}
2068
2070{
2071 auto nPos = m_xHorizontalDLB->get_active();
2072 if (m_pHMap && nPos != -1)
2073 {
2074 const sal_Int32 nMapPos = GetMapPos(m_pHMap, *m_xHorizontalDLB);
2077 }
2078
2079 nPos = m_xVerticalDLB->get_active();
2080 if (m_pVMap && nPos != -1)
2081 {
2082 const sal_Int32 nMapPos = GetMapPos(m_pVMap, *m_xVerticalDLB);
2085 }
2086
2087 // size
2088 auto nXPos = m_xAtHorzPosED->denormalize(m_xAtHorzPosED->get_value(FieldUnit::TWIP));
2089 auto nYPos = m_xAtVertPosED->denormalize(m_xAtVertPosED->get_value(FieldUnit::TWIP));
2090 m_aExampleWN.SetRelPos(Point(nXPos, nYPos));
2091
2093 m_aExampleWN.Invalidate();
2094}
2095
2097{
2098 if(!m_bFormat)
2099 {
2101
2102 // size
2103 const bool bSizeFixed = pSh->IsSelObjProtected( FlyProtectFlags::Fixed ) != FlyProtectFlags::NONE;
2104
2105 m_xWidthED->set_sensitive( !bSizeFixed );
2106 m_xHeightED->set_sensitive( !bSizeFixed );
2107
2108 // size controls for math OLE objects
2109 if ( m_sDlgType == "ObjectDialog" && ! m_bNew )
2110 {
2111 // disable width and height for math objects
2112 const SvGlobalName& rFactNm( pSh->GetOLEObject()->getClassID() );
2113
2114 static struct GlobalNameId {
2115 sal_uInt32 n1;
2116 sal_uInt16 n2, n3;
2117 sal_uInt8 b8, b9, b10, b11, b12, b13, b14, b15;
2118 } const aGlbNmIds[] = { { SO3_SM_CLASSID_60 }, { SO3_SM_CLASSID_50 },
2120
2121 for (const GlobalNameId & rId : aGlbNmIds) {
2122 SvGlobalName aGlbNm( rId.n1, rId.n2, rId.n3,
2123 rId.b8, rId.b9, rId.b10, rId.b11,
2124 rId.b12, rId.b13, rId.b14, rId.b15 );
2125
2126 if( rFactNm == aGlbNm )
2127 {
2128 // disable size controls for math OLE objects
2129 m_xWidthFT->set_sensitive(false);
2130 m_xWidthED->set_sensitive(false);
2131 m_xRelWidthCB->set_sensitive(false);
2132 m_xHeightFT->set_sensitive(false);
2133 m_xHeightED->set_sensitive(false);
2134 m_xRelHeightCB->set_sensitive(false);
2135 m_xFixedRatioCB->set_sensitive(false);
2136 m_xRealSizeBT->set_sensitive(false);
2137 break;
2138 }
2139 }
2140
2141 // TODO/LATER: get correct aspect
2142 if(0 != (pSh->GetOLEObject()->getStatus( embed::Aspects::MSOLE_CONTENT ) & embed::EmbedMisc::MS_EMBED_RECOMPOSEONRESIZE ) )
2143 m_xRealSizeBT->set_sensitive(false);
2144 }
2145 }
2146
2147 const SwFormatFrameSize& rSize = rSet.Get(RES_FRM_SIZE);
2148 sal_Int64 nWidth = m_xWidthED->NormalizePercent(rSize.GetWidth());
2149 sal_Int64 nHeight = m_xHeightED->NormalizePercent(rSize.GetHeight());
2150
2151 if (nWidth != m_xWidthED->get_value(FieldUnit::TWIP))
2152 m_xWidthED->set_value(nWidth, FieldUnit::TWIP);
2153
2154 if (nHeight != m_xHeightED->get_value(FieldUnit::TWIP))
2155 m_xHeightED->set_value(nHeight, FieldUnit::TWIP);
2156
2157 if (!IsInGraficMode())
2158 {
2159 SwFrameSize eSize = rSize.GetHeightSizeType();
2160 bool bCheck = eSize != SwFrameSize::Fixed;
2161 m_xAutoHeightCB->set_active(bCheck);
2162 HandleAutoCB( bCheck, *m_xHeightFT, *m_xHeightAutoFT, *m_xWidthED->get() );
2163 if( eSize == SwFrameSize::Variable )
2164 m_xHeightED->set_value(m_xHeightED->get_min());
2165
2166 eSize = rSize.GetWidthSizeType();
2167 bCheck = eSize != SwFrameSize::Fixed;
2168 m_xAutoWidthCB->set_active(bCheck);
2169 HandleAutoCB( bCheck, *m_xWidthFT, *m_xWidthAutoFT, *m_xWidthED->get() );
2170 if( eSize == SwFrameSize::Variable )
2171 m_xWidthED->set_value(m_xWidthED->get_min());
2172
2173 if ( !m_bFormat )
2174 {
2176 const SwFrameFormat* pFormat = pSh->GetFlyFrameFormat();
2177 if( pFormat && pFormat->GetChain().GetNext() )
2178 m_xAutoHeightCB->set_sensitive( false );
2179 }
2180 }
2181 else
2182 m_xAutoHeightCB->hide();
2183
2184 // organise circulation-gap for character bound frames
2185 const SvxULSpaceItem &rUL = rSet.Get(RES_UL_SPACE);
2186 m_nUpperBorder = rUL.GetUpper();
2187 m_nLowerBorder = rUL.GetLower();
2188
2189 if (SfxItemState::SET == rSet.GetItemState(FN_KEEP_ASPECT_RATIO))
2190 m_xFixedRatioCB->set_active(rSet.Get(FN_KEEP_ASPECT_RATIO).GetValue());
2191
2192 // columns
2193 SwFormatCol aCol( rSet.Get(RES_COL) );
2194 ::FitToActualSize( aCol, o3tl::narrowing<sal_uInt16>(rSize.GetWidth()) );
2195
2196 RndStdIds eAnchorId = GetAnchor();
2197
2198 if ( m_bNew && !m_bFormat )
2199 InitPos(eAnchorId, -1, 0, -1, 0, LONG_MAX, LONG_MAX);
2200 else
2201 {
2204 m_nOldH = rHori.GetHoriOrient();
2205 m_nOldHRel = rHori.GetRelationOrient();
2206 m_nOldV = rVert.GetVertOrient();
2207 m_nOldVRel = rVert.GetRelationOrient();
2208
2209 if (eAnchorId == RndStdIds::FLY_AT_PAGE)
2210 {
2211 if (m_nOldHRel == text::RelOrientation::FRAME)
2212 m_nOldHRel = text::RelOrientation::PAGE_FRAME;
2213 else if (m_nOldHRel == text::RelOrientation::PRINT_AREA)
2214 m_nOldHRel = text::RelOrientation::PAGE_PRINT_AREA;
2215 if (m_nOldVRel == text::RelOrientation::FRAME)
2216 m_nOldVRel = text::RelOrientation::PAGE_FRAME;
2217 else if (m_nOldVRel == text::RelOrientation::PRINT_AREA)
2218 m_nOldVRel = text::RelOrientation::PAGE_PRINT_AREA;
2219 }
2220
2221 m_xMirrorPagesCB->set_active(rHori.IsPosToggle());
2222 m_xMirrorPagesCB->save_state();
2223
2224 InitPos(eAnchorId,
2225 m_nOldH,
2226 m_nOldHRel,
2227 m_nOldV,
2228 m_nOldVRel,
2229 rHori.GetPos(),
2230 rVert.GetPos());
2231 }
2232
2233 // transparent for example
2234 // circulation for example
2235 const SwFormatSurround& rSurround = rSet.Get(RES_SURROUND);
2236 m_aExampleWN.SetWrap( rSurround.GetSurround() );
2237
2238 if ( rSurround.GetSurround() == css::text::WrapTextMode_THROUGH )
2239 {
2240 const SvxOpaqueItem& rOpaque = rSet.Get(RES_OPAQUE);
2241 m_aExampleWN.SetTransparent(!rOpaque.GetValue());
2242 }
2243
2244 // switch to percent if applicable
2245 RangeModifyHdl(); // set reference values (for 100%)
2246
2248 m_xFixedRatioCB->set_active(true);
2249 m_xFixedRatioCB->save_state();
2250 if (rSize.GetWidthPercent() && rSize.GetWidthPercent() != SwFormatFrameSize::SYNCED &&
2251 !m_xRelWidthCB->get_active())
2252 {
2253 m_xRelWidthCB->set_active(true);
2254 RelSizeClickHdl(*m_xRelWidthCB);
2255 m_xWidthED->set_value(rSize.GetWidthPercent(), FieldUnit::PERCENT);
2256 }
2258 !m_xRelHeightCB->get_active())
2259 {
2260 m_xRelHeightCB->set_active(true);
2261 RelSizeClickHdl(*m_xRelHeightCB);
2262 m_xHeightED->set_value(rSize.GetHeightPercent(), FieldUnit::PERCENT);
2263 }
2264 m_xRelWidthCB->save_state();
2265 m_xRelHeightCB->save_state();
2266
2267 if (rSize.GetWidthPercentRelation() == text::RelOrientation::PAGE_FRAME)
2268 m_xRelWidthRelationLB->set_active(1);
2269 else
2270 m_xRelWidthRelationLB->set_active(0);
2271
2272 if (rSize.GetHeightPercentRelation() == text::RelOrientation::PAGE_FRAME)
2273 m_xRelHeightRelationLB->set_active(1);
2274 else
2275 m_xRelHeightRelationLB->set_active(0);
2276}
2277
2278void SwFramePage::SetFormatUsed(bool bFormatUsed)
2279{
2280 m_bFormat = bFormatUsed;
2281 if (m_bFormat)
2282 m_xAnchorAtFrameRB->hide();
2283}
2284
2286{
2287 m_bAllowVertPositioning = bEnable;
2288 m_xVerticalFT->set_sensitive( bEnable );
2289 m_xVerticalDLB->set_sensitive( bEnable );
2290 m_xAtVertPosFT->set_sensitive( bEnable );
2291 m_xAtVertPosED->set_sensitive( bEnable );
2292 m_xVertRelationFT->set_sensitive( bEnable );
2293 m_xVertRelationLB->set_sensitive( bEnable );
2294}
2295
2297 : SfxTabPage(pPage, pController, "modules/swriter/ui/picturepage.ui", "PicturePage", &rSet)
2298 , m_bHtmlMode(false)
2299 , m_xMirror(m_xBuilder->weld_widget("flipframe"))
2300 , m_xMirrorVertBox(m_xBuilder->weld_check_button("vert"))
2301 , m_xMirrorHorzBox(m_xBuilder->weld_check_button("hori"))
2302 , m_xAllPagesRB(m_xBuilder->weld_radio_button("allpages"))
2303 , m_xLeftPagesRB(m_xBuilder->weld_radio_button("leftpages"))
2304 , m_xRightPagesRB(m_xBuilder->weld_radio_button("rightpages"))
2305 , m_xConnectED(m_xBuilder->weld_entry("entry"))
2306 , m_xBrowseBT(m_xBuilder->weld_button("browse"))
2307 , m_xLinkFrame(m_xBuilder->weld_frame("linkframe"))
2308 // RotGrfFlyFrame: Need Angle and RotateControls now
2309 , m_xFlAngle(m_xBuilder->weld_frame("FL_ANGLE"))
2310 , m_xNfAngle(m_xBuilder->weld_metric_spin_button("NF_ANGLE", FieldUnit::DEGREE))
2311 , m_xCtlAngle(new svx::DialControl)
2312 , m_xCtlAngleWin(new weld::CustomWeld(*m_xBuilder, "CTL_ANGLE", *m_xCtlAngle))
2313 , m_xBmpWin(new weld::CustomWeld(*m_xBuilder, "preview", m_aBmpWin))
2314 // tdf#138843 place holder for the graphic type
2315 , m_xLabelGraphicType(m_xBuilder->weld_label("label-graphic-type"))
2316{
2317 m_aBmpWin.SetBitmapEx(BitmapEx(RID_BMP_PREVIEW_FALLBACK));
2318
2319 m_xCtlAngle->SetLinkedField(m_xNfAngle.get(), 2);
2320
2322 m_xMirrorHorzBox->connect_toggled(LINK(this, SwGrfExtPage, MirrorHdl));
2323 m_xMirrorVertBox->connect_toggled(LINK(this, SwGrfExtPage, MirrorHdl));
2324 m_xBrowseBT->connect_clicked(LINK(this, SwGrfExtPage, BrowseHdl));
2325}
2326
2328{
2329 m_xBmpWin.reset();
2330 m_xCtlAngleWin.reset();
2331 m_xCtlAngle.reset();
2332 m_xGrfDlg.reset();
2333}
2334
2335std::unique_ptr<SfxTabPage> SwGrfExtPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet *rSet)
2336{
2337 return std::make_unique<SwGrfExtPage>(pPage, pController, *rSet);
2338}
2339
2341{
2342 const sal_uInt16 nHtmlMode = ::GetHtmlMode(static_cast<const SwDocShell*>(SfxObjectShell::Current()));
2343 m_bHtmlMode = (nHtmlMode & HTMLMODE_ON) != 0;
2344
2345 const SfxBoolItem* pConnectItem = rSet->GetItemIfSet( FN_PARAM_GRF_CONNECT );
2346 if( pConnectItem && pConnectItem->GetValue() )
2347 {
2348 m_xBrowseBT->set_sensitive(true);
2349 m_xConnectED->set_editable(true);
2350 }
2351
2352 // RotGrfFlyFrame: Get RotationAngle and set at control
2353 if(const SdrAngleItem* pAngleItem = rSet->GetItemIfSet( SID_ATTR_TRANSFORM_ANGLE, false))
2354 {
2355 m_xCtlAngle->SetRotation(pAngleItem->GetValue());
2356 }
2357 else
2358 {
2359 m_xCtlAngle->SetRotation(0_deg100);
2360 }
2361 m_xCtlAngle->SaveValue();
2362
2364}
2365
2367{
2368 const SvxProtectItem& rProt = rSet.Get(RES_PROTECT);
2369 bool bProtContent = rProt.IsContentProtected();
2370
2371 const SfxPoolItem* pItem = nullptr;
2372 bool bEnable = false;
2373 bool bEnableMirrorRB = false;
2374
2375 SfxItemState eState = rSet.GetItemState(RES_GRFATR_MIRRORGRF, true, &pItem);
2376 if (SfxItemState::UNKNOWN != eState && !bProtContent && !m_bHtmlMode)
2377 {
2378 if( SfxItemState::SET != eState )
2379 pItem = &rSet.Get( RES_GRFATR_MIRRORGRF );
2380
2381 bEnable = true;
2382
2383 MirrorGraph eMirror = static_cast<const SwMirrorGrf* >(pItem)->GetValue();
2384 switch( eMirror )
2385 {
2386 case MirrorGraph::Dont: break;
2387 case MirrorGraph::Vertical: m_xMirrorHorzBox->set_active(true); break;
2388 case MirrorGraph::Horizontal: m_xMirrorVertBox->set_active(true); break;
2389 case MirrorGraph::Both: m_xMirrorHorzBox->set_active(true);
2390 m_xMirrorVertBox->set_active(true);
2391 break;
2392 default:
2393 ;
2394 }
2395
2396 const int nPos = (static_cast<const SwMirrorGrf* >(pItem)->IsGrfToggle() ? 1 : 0)
2397 + ((eMirror == MirrorGraph::Vertical || eMirror == MirrorGraph::Both) ? 2 : 0);
2398
2399 bEnableMirrorRB = nPos != 0;
2400
2401 switch (nPos)
2402 {
2403 case 1: // mirror at left / even pages
2404 m_xLeftPagesRB->set_active(true);
2405 m_xMirrorHorzBox->set_active(true);
2406 break;
2407 case 2: // mirror on all pages
2408 m_xAllPagesRB->set_active(true);
2409 break;
2410 case 3: // mirror on right / odd pages
2411 m_xRightPagesRB->set_active(true);
2412 break;
2413 default:
2414 m_xAllPagesRB->set_active(true);
2415 break;
2416 }
2417 }
2418
2419 if( const SvxBrushItem* pGraphicBrushItem = rSet.GetItemIfSet( SID_ATTR_GRAF_GRAPHIC, false ) )
2420 {
2421 if( !pGraphicBrushItem->GetGraphicLink().isEmpty() )
2422 {
2423 m_aGrfName = m_aNewGrfName = pGraphicBrushItem->GetGraphicLink();
2424 m_xConnectED->set_text(m_aNewGrfName);
2425 }
2426 OUString referer;
2427 SfxStringItem const * it = static_cast<SfxStringItem const *>(
2428 rSet.GetItem(SID_REFERER));
2429 if (it != nullptr) {
2430 referer = it->GetValue();
2431 }
2432 const Graphic* pGrf = pGraphicBrushItem->GetGraphic(referer);
2433 if( pGrf )
2434 {
2435 m_aBmpWin.SetGraphic( *pGrf );
2437 }
2438 }
2439
2440 m_xConnectED->save_value();
2441
2442 m_xMirror->set_sensitive(bEnable);
2443 m_xAllPagesRB->set_sensitive(bEnableMirrorRB);
2444 m_xLeftPagesRB->set_sensitive(bEnableMirrorRB);
2445 m_xRightPagesRB->set_sensitive(bEnableMirrorRB);
2446
2447 m_xAllPagesRB->save_state();
2448 m_xLeftPagesRB->save_state();
2449 m_xRightPagesRB->save_state();
2450 m_xMirrorHorzBox->save_state();
2451 m_xMirrorVertBox->save_state();
2452
2453 m_aBmpWin.MirrorHorz( m_xMirrorVertBox->get_active() );
2454 m_aBmpWin.MirrorVert( m_xMirrorHorzBox->get_active() );
2456}
2457
2459{
2460 bool bModified = false;
2461 if ( m_xMirrorHorzBox->get_state_changed_from_saved() ||
2462 m_xMirrorVertBox->get_state_changed_from_saved() ||
2463 m_xAllPagesRB->get_state_changed_from_saved() ||
2464 m_xLeftPagesRB->get_state_changed_from_saved() ||
2465 m_xRightPagesRB->get_state_changed_from_saved() )
2466 {
2467 bModified = true;
2468
2469 bool bHori = false;
2470
2471 if (m_xMirrorHorzBox->get_active() &&
2472 !m_xLeftPagesRB->get_active())
2473 bHori = true;
2474
2475 MirrorGraph eMirror;
2476 eMirror = m_xMirrorVertBox->get_active() && bHori ?
2477 MirrorGraph::Both : bHori ?
2478 MirrorGraph::Vertical : m_xMirrorVertBox->get_active() ?
2480
2481 bool bMirror = !m_xAllPagesRB->get_active();
2482 SwMirrorGrf aMirror( eMirror );
2483 aMirror.SetGrfToggle(bMirror );
2484 rSet->Put( aMirror );
2485 }
2486
2487 if (m_aGrfName != m_aNewGrfName || m_xConnectED->get_value_changed_from_saved())
2488 {
2489 bModified = true;
2490 m_aGrfName = m_xConnectED->get_text();
2492 SID_ATTR_GRAF_GRAPHIC ));
2493 }
2494
2495 // RotGrfFlyFrame: Safe rotation if modified
2496 if(m_xCtlAngle->IsValueModified())
2497 {
2498 rSet->Put(SdrAngleItem(SID_ATTR_TRANSFORM_ANGLE, m_xCtlAngle->GetRotation()));
2499 bModified = true;
2500 }
2501
2502 return bModified;
2503}
2504
2506{
2507 if( _pSet )
2508 FillItemSet( _pSet );
2509 return DeactivateRC::LeavePage;
2510}
2511
2513{
2514 if(!m_xGrfDlg)
2515 {
2516 m_xGrfDlg.reset(new FileDialogHelper(
2517 ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW,
2518 FileDialogFlags::Graphic, GetFrameWeld()));
2519 m_xGrfDlg->SetTitle(m_xLinkFrame->get_label());
2520 }
2521 m_xGrfDlg->SetDisplayDirectory(m_xConnectED->get_text());
2522 uno::Reference < ui::dialogs::XFilePicker3 > xFP = m_xGrfDlg->GetFilePicker();
2523 uno::Reference < ui::dialogs::XFilePickerControlAccess > xCtrlAcc(xFP, uno::UNO_QUERY);
2524 xCtrlAcc->setValue( ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_LINK, 0, uno::Any(true) );
2525
2526 if ( m_xGrfDlg->Execute() != ERRCODE_NONE )
2527 return;
2528
2529// remember selected filter
2530 m_aFilterName = m_xGrfDlg->GetCurrentFilter();
2531 m_aNewGrfName = INetURLObject::decode( m_xGrfDlg->GetPath(),
2533 m_xConnectED->set_text(m_aNewGrfName);
2534 //reset mirrors because maybe a Bitmap was swapped with
2535 //another type of graphic that cannot be mirrored.
2536 m_xMirrorVertBox->set_active(false);
2537 m_xMirrorHorzBox->set_active(false);
2538 m_xAllPagesRB->set_sensitive(false);
2539 m_xLeftPagesRB->set_sensitive(false);
2540 m_xRightPagesRB->set_sensitive(false);
2541 m_aBmpWin.MirrorHorz(false);
2542 m_aBmpWin.MirrorVert(false);
2543
2544 Graphic aGraphic;
2545 (void)GraphicFilter::LoadGraphic(m_xGrfDlg->GetPath(), OUString(), aGraphic);
2546 m_aBmpWin.SetGraphic(aGraphic);
2547 m_xLabelGraphicType->set_label(GraphicHelper::GetImageType(aGraphic));
2548
2549 bool bEnable = GraphicType::Bitmap == aGraphic.GetType() ||
2550 GraphicType::GdiMetafile == aGraphic.GetType();
2551 m_xMirrorVertBox->set_sensitive(bEnable);
2552 m_xMirrorHorzBox->set_sensitive(bEnable);
2553 m_xAllPagesRB->set_sensitive(bEnable);
2554 m_xLeftPagesRB->set_sensitive(bEnable);
2555 m_xRightPagesRB->set_sensitive(bEnable);
2556
2557}
2558
2560{
2561 bool bEnable = m_xMirrorHorzBox->get_active();
2562
2563 m_aBmpWin.MirrorHorz( m_xMirrorVertBox->get_active() );
2564 m_aBmpWin.MirrorVert( bEnable );
2565
2566 m_xAllPagesRB->set_sensitive(bEnable);
2567 m_xLeftPagesRB->set_sensitive(bEnable);
2568 m_xRightPagesRB->set_sensitive(bEnable);
2569
2570 if (!m_xAllPagesRB->get_active() && !m_xLeftPagesRB->get_active() && !m_xRightPagesRB->get_active())
2571 m_xAllPagesRB->set_active(true);
2572}
2573
2574// example window
2576 : m_bHorz(false)
2577 , m_bVert(false)
2578 , m_bGraphic(false)
2579{
2580}
2581
2583{
2584 CustomWidgetController::SetDrawingArea(pDrawingArea);
2585 Size aSize = pDrawingArea->get_ref_device().LogicToPixel(Size(127 , 66), MapMode(MapUnit::MapAppFont));
2586 set_size_request(aSize.Width(), aSize.Height());
2587 SetOutputSizePixel(aSize);
2588}
2589
2591{
2592 // Setup
2593 rRenderContext.SetBackground();
2594 // #i119307# the graphic might have transparency, set up white as the color
2595 // to use when drawing a rectangle under the image
2596 rRenderContext.SetLineColor(COL_WHITE);
2597 rRenderContext.SetFillColor(COL_WHITE);
2598
2599 // Paint
2600 Point aPntPos;
2601 Size aPntSz(GetOutputSizePixel());
2602 Size aGrfSize;
2603 if (m_bGraphic)
2604 aGrfSize = ::GetGraphicSizeTwip(m_aGraphic, &rRenderContext);
2605 //it should show the default bitmap also if no graphic can be found
2606 if (!aGrfSize.Width() && !aGrfSize.Height())
2607 aGrfSize = rRenderContext.PixelToLogic(m_aBmp.GetSizePixel());
2608
2609 tools::Long nRelGrf = aGrfSize.Width() * 100 / aGrfSize.Height();
2610 tools::Long nRelWin = aPntSz.Width() * 100 / aPntSz.Height();
2611 if (nRelGrf < nRelWin)
2612 {
2613 const tools::Long nWidth = aPntSz.Width();
2614 // if we use a replacement preview, try to draw at original size
2615 if (!m_bGraphic && (aGrfSize.Width() <= aPntSz.Width())
2616 && (aGrfSize.Height() <= aPntSz.Height()))
2617 {
2618 const tools::Long nHeight = aPntSz.Height();
2619 aPntSz.setWidth( aGrfSize.Width() );
2620 aPntSz.setHeight( aGrfSize.Height() );
2621 aPntPos.AdjustY((nHeight - aPntSz.Height()) / 2 );
2622 }
2623 else
2624 aPntSz.setWidth( aPntSz.Height() * nRelGrf /100 );
2625
2626 aPntPos.AdjustX(nWidth - aPntSz.Width() ) ;
2627 }
2628
2629 // #i119307# clear window background, the graphic might have transparency
2630 rRenderContext.DrawRect(tools::Rectangle(aPntPos, aPntSz));
2631
2632 if (m_bHorz || m_bVert)
2633 {
2635 BmpMirrorFlags nMirrorFlags(BmpMirrorFlags::NONE);
2636 if (m_bHorz)
2637 nMirrorFlags |= BmpMirrorFlags::Vertical;
2638 if (m_bVert)
2639 nMirrorFlags |= BmpMirrorFlags::Horizontal;
2640 aTmpBmp.Mirror(nMirrorFlags);
2641 rRenderContext.DrawBitmapEx(aPntPos, aPntSz, aTmpBmp);
2642 }
2643 else if (m_bGraphic) //draw unmirrored preview graphic
2644 {
2645 m_aGraphic.Draw(rRenderContext, aPntPos, aPntSz);
2646 }
2647 else //draw unmirrored stock sample image
2648 {
2649 rRenderContext.DrawBitmapEx(aPntPos, aPntSz, m_aBmp);
2650 }
2651}
2652
2654{
2655}
2656
2657void BmpWindow::SetGraphic(const Graphic& rGraphic)
2658{
2659 m_aGraphic = rGraphic;
2660 Size aSize = m_aGraphic.GetPrefSize();
2661 m_bGraphic = aSize.Width() && aSize.Height();
2662 Invalidate();
2663}
2664
2666{
2667 m_aBmp = rBmp;
2668 Invalidate();
2669}
2670
2671// set URL and ImageMap at frames
2673 : SfxTabPage(pPage, pController, "modules/swriter/ui/frmurlpage.ui", "FrameURLPage", &rSet)
2674 , m_xURLED(m_xBuilder->weld_entry("url"))
2675 , m_xSearchPB(m_xBuilder->weld_button("search"))
2676 , m_xNameED(m_xBuilder->weld_entry("name"))
2677 , m_xFrameCB(m_xBuilder->weld_combo_box("frame"))
2678 , m_xServerCB(m_xBuilder->weld_check_button("server"))
2679 , m_xClientCB(m_xBuilder->weld_check_button("client"))
2680{
2681 m_xSearchPB->connect_clicked(LINK(this, SwFrameURLPage, InsertFileHdl));
2682}
2683
2685{
2686}
2687
2689{
2690 if ( SfxItemState::SET == rSet->GetItemState( SID_DOCFRAME ))
2691 {
2692 TargetList aList;
2694 size_t nCount = aList.size();
2695 for (size_t i = 0; i < nCount; ++i)
2696 {
2697 m_xFrameCB->append_text(aList.at(i));
2698 }
2699 }
2700
2701 if ( const SwFormatURL* pFormatURL = rSet->GetItemIfSet( RES_URL ) )
2702 {
2703 m_xURLED->set_text(INetURLObject::decode(pFormatURL->GetURL(),
2705 m_xNameED->set_text(pFormatURL->GetName());
2706
2707 m_xClientCB->set_sensitive(pFormatURL->GetMap() != nullptr);
2708 m_xClientCB->set_active(pFormatURL->GetMap() != nullptr);
2709 m_xServerCB->set_active(pFormatURL->IsServerMap());
2710
2711 m_xFrameCB->set_entry_text(pFormatURL->GetTargetFrameName());
2712 m_xFrameCB->save_value();
2713 }
2714 else
2715 m_xClientCB->set_sensitive(false);
2716
2717 m_xServerCB->save_state();
2718 m_xClientCB->save_state();
2719}
2720
2722{
2723 bool bModified = false;
2724 const SwFormatURL* pOldURL = GetOldItem(*rSet, RES_URL);
2725 std::unique_ptr<SwFormatURL> pFormatURL;
2726 if(pOldURL)
2727 pFormatURL.reset(pOldURL->Clone());
2728 else
2729 pFormatURL.reset(new SwFormatURL());
2730
2731 {
2732 const OUString sText = m_xURLED->get_text();
2733
2734 if( pFormatURL->GetURL() != sText ||
2735 pFormatURL->GetName() != m_xNameED->get_text() ||
2736 m_xServerCB->get_active() != pFormatURL->IsServerMap() )
2737 {
2738 pFormatURL->SetURL(sText, m_xServerCB->get_active());
2739 pFormatURL->SetName(m_xNameED->get_text());
2740 bModified = true;
2741 }
2742 }
2743
2744 if (!m_xClientCB->get_active() && pFormatURL->GetMap() != nullptr)
2745 {
2746 pFormatURL->SetMap(nullptr);
2747 bModified = true;
2748 }
2749
2750 if(pFormatURL->GetTargetFrameName() != m_xFrameCB->get_active_text())
2751 {
2752 pFormatURL->SetTargetFrameName(m_xFrameCB->get_active_text());
2753 bModified = true;
2754 }
2755 rSet->Put(std::move(pFormatURL));
2756 return bModified;
2757}
2758
2759std::unique_ptr<SfxTabPage> SwFrameURLPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet *rSet)
2760{
2761 return std::make_unique<SwFrameURLPage>(pPage, pController, *rSet);
2762}
2763
2765{
2766 FileDialogHelper aDlgHelper(ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE,
2767 FileDialogFlags::NONE, GetFrameWeld());
2768 uno::Reference < ui::dialogs::XFilePicker3 > xFP = aDlgHelper.GetFilePicker();
2769
2770 try
2771 {
2772 const OUString sTemp(m_xURLED->get_text());
2773 if(!sTemp.isEmpty())
2774 xFP->setDisplayDirectory(sTemp);
2775 }
2776 catch( const uno::Exception& ) {}
2777 if( aDlgHelper.Execute() == ERRCODE_NONE )
2778 {
2779 m_xURLED->set_text(xFP->getSelectedFiles().getConstArray()[0]);
2780 }
2781}
2782
2784 : SfxTabPage(pPage, pController, "modules/swriter/ui/frmaddpage.ui", "FrameAddPage", &rSet)
2785 , m_pWrtSh(nullptr)
2786 , m_bHtmlMode(false)
2787 , m_bFormat(false)
2788 , m_bNew(false)
2789 , m_xNameFrame(m_xBuilder->weld_widget("nameframe"))
2790 , m_xNameFT(m_xBuilder->weld_label("name_label"))
2791 , m_xNameED(m_xBuilder->weld_entry("name"))
2792 , m_xAltNameFT(m_xBuilder->weld_label("altname_label"))
2793 , m_xAltNameED(m_xBuilder->weld_entry("altname"))
2794 , m_xDescriptionED(m_xBuilder->weld_text_view("description"))
2795 , m_xSequenceFrame(m_xBuilder->weld_widget("frmSequence"))
2796 , m_xPrevLB(m_xBuilder->weld_combo_box("prev"))
2797 , m_xNextLB(m_xBuilder->weld_combo_box("next"))
2798 , m_xProtectFrame(m_xBuilder->weld_widget("protect"))
2799 , m_xProtectContentCB(m_xBuilder->weld_check_button("protectcontent"))
2800 , m_xProtectFrameCB(m_xBuilder->weld_check_button("protectframe"))
2801 , m_xProtectSizeCB(m_xBuilder->weld_check_button("protectsize"))
2802 , m_xContentAlignFrame(m_xBuilder->weld_widget("contentalign"))
2803 , m_xVertAlignLB(m_xBuilder->weld_combo_box("vertalign"))
2804 , m_xPropertiesFrame(m_xBuilder->weld_widget("properties"))
2805 , m_xEditInReadonlyCB(m_xBuilder->weld_check_button("editinreadonly"))
2806 , m_xPrintFrameCB(m_xBuilder->weld_check_button("printframe"))
2807 , m_xTextFlowFT(m_xBuilder->weld_label("textflow_label"))
2808 , m_xTextFlowLB(new svx::FrameDirectionListBox(m_xBuilder->weld_combo_box("textflow")))
2809{
2810 m_xTextFlowLB->append(SvxFrameDirection::Horizontal_LR_TB, SvxResId(RID_SVXSTR_FRAMEDIR_LTR));
2811 m_xTextFlowLB->append(SvxFrameDirection::Horizontal_RL_TB, SvxResId(RID_SVXSTR_FRAMEDIR_RTL));
2812 m_xTextFlowLB->append(SvxFrameDirection::Vertical_RL_TB, SvxResId(RID_SVXSTR_PAGEDIR_RTL_VERT));
2813 m_xTextFlowLB->append(SvxFrameDirection::Vertical_LR_TB, SvxResId(RID_SVXSTR_PAGEDIR_LTR_VERT));
2814 m_xTextFlowLB->append(SvxFrameDirection::Vertical_LR_BT, SvxResId(RID_SVXSTR_PAGEDIR_LTR_BTT_VERT));
2815 m_xTextFlowLB->append(SvxFrameDirection::Environment, SvxResId(RID_SVXSTR_FRAMEDIR_SUPER));
2816 m_xDescriptionED->set_size_request(-1, m_xDescriptionED->get_preferred_size().Height());
2817}
2818
2820{
2821 m_xTextFlowLB.reset();
2822}
2823
2824std::unique_ptr<SfxTabPage> SwFrameAddPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet *rSet)
2825{
2826 return std::make_unique<SwFrameAddPage>(pPage, pController, *rSet);
2827}
2828
2830{
2831 sal_uInt16 nHtmlMode = ::GetHtmlMode(static_cast<const SwDocShell*>(SfxObjectShell::Current()));
2832 m_bHtmlMode = (nHtmlMode & HTMLMODE_ON) != 0;
2833 if (m_bHtmlMode)
2834 {
2835 m_xProtectFrame->hide();
2836 m_xEditInReadonlyCB->hide();
2837 m_xPrintFrameCB->hide();
2838 }
2839 if (m_sDlgType == "PictureDialog" || m_sDlgType == "ObjectDialog")
2840 {
2841 m_xSequenceFrame->hide();
2842 m_xEditInReadonlyCB->hide();
2843 if (m_bHtmlMode)
2844 {
2845 m_xPropertiesFrame->hide();
2846 }
2847 m_xContentAlignFrame->hide();
2848 }
2849
2850 if(const SfxStringItem* pNameItem = rSet->GetItemIfSet(FN_SET_FRM_ALT_NAME, false))
2851 {
2852 m_xAltNameED->set_text(pNameItem->GetValue());
2853 m_xAltNameED->save_value();
2854 }
2855
2856 if(const SfxStringItem* pDescriptionItem = rSet->GetItemIfSet(FN_UNO_DESCRIPTION, false))
2857 {
2858 m_xDescriptionED->set_text(pDescriptionItem->GetValue());
2859 m_xDescriptionED->save_value();
2860 }
2861
2862 if(!m_bFormat)
2863 {
2864 // insert graphic - properties
2865 // bNew is not set, so recognise by selection
2866 OUString aTmpName1;
2867 if(const SfxStringItem* pNameItem = rSet->GetItemIfSet(FN_SET_FRM_NAME, false))
2868 {
2869 aTmpName1 = pNameItem->GetValue();
2870 }
2871
2872 OSL_ENSURE(m_pWrtSh, "no Shell?");
2873 if( m_bNew || aTmpName1.isEmpty() )
2874 {
2875 if (m_sDlgType == "PictureDialog")
2876 aTmpName1 = m_pWrtSh->GetUniqueGrfName();
2877 else if (m_sDlgType == "ObjectDialog")
2878 aTmpName1 = m_pWrtSh->GetUniqueOLEName();
2879 else
2880 aTmpName1 = m_pWrtSh->GetUniqueFrameName();
2881
2882 m_pWrtSh->SetFlyName(aTmpName1);
2883 }
2884
2885 m_xNameED->set_text( aTmpName1 );
2886 m_xNameED->save_value();
2887 }
2888 else
2889 {
2890 m_xNameED->set_sensitive( false );
2891 m_xAltNameED->set_sensitive(false);
2892 m_xNameFT->set_sensitive( false );
2893 m_xAltNameFT->set_sensitive(false);
2894 }
2895 if (m_sDlgType == "FrameDialog" && m_xAltNameFT->get_visible())
2896 {
2897 m_xAltNameFT->hide();
2898 m_xAltNameED->hide();
2899 }
2900 else
2901 {
2902 m_xNameED->connect_changed(LINK(this, SwFrameAddPage, EditModifyHdl));
2903 }
2904
2905 if (!m_bNew)
2906 {
2908
2909 if (pFormat)
2910 {
2911 const SwFormatChain &rChain = pFormat->GetChain();
2912 const SwFlyFrameFormat* pFlyFormat;
2913 OUString sNextChain, sPrevChain;
2914 pFlyFormat = rChain.GetPrev();
2915 if (pFlyFormat != nullptr)
2916 {
2917 sPrevChain = pFlyFormat->GetName();
2918 }
2919
2920 pFlyFormat = rChain.GetNext();
2921 if (pFlyFormat != nullptr)
2922 {
2923 sNextChain = pFlyFormat->GetName();
2924 }
2925 //determine chainable frames
2926 std::vector< OUString > aPrevPageFrames;
2927 std::vector< OUString > aThisPageFrames;
2928 std::vector< OUString > aNextPageFrames;
2929 std::vector< OUString > aRemainFrames;
2930 m_pWrtSh->GetConnectableFrameFormats(*pFormat, sNextChain, false,
2931 aPrevPageFrames, aThisPageFrames, aNextPageFrames, aRemainFrames );
2932 for (sal_Int32 nEntry = m_xPrevLB->get_count(); nEntry > 1; nEntry--)
2933 m_xPrevLB->remove(nEntry - 1);
2934 lcl_InsertVectors(*m_xPrevLB, aPrevPageFrames, aThisPageFrames, aNextPageFrames, aRemainFrames);
2935 if(!sPrevChain.isEmpty())
2936 {
2937 if (m_xPrevLB->find_text(sPrevChain) == -1)
2938 m_xPrevLB->insert_text(1, sPrevChain);
2939 m_xPrevLB->set_active_text(sPrevChain);
2940 }
2941 else
2942 m_xPrevLB->set_active(0);
2943 aPrevPageFrames.clear();
2944 aNextPageFrames.clear();
2945 aThisPageFrames.clear();
2946 aRemainFrames.clear();
2947
2948 m_pWrtSh->GetConnectableFrameFormats(*pFormat, sPrevChain, true,
2949 aPrevPageFrames, aThisPageFrames, aNextPageFrames, aRemainFrames );
2950 for (sal_Int32 nEntry = m_xNextLB->get_count(); nEntry > 1; nEntry--)
2951 m_xNextLB->remove(nEntry - 1);
2952 lcl_InsertVectors(*m_xNextLB, aPrevPageFrames, aThisPageFrames, aNextPageFrames, aRemainFrames);
2953 if(!sNextChain.isEmpty())
2954 {
2955 if (m_xNextLB->find_text(sNextChain) == -1)
2956 m_xNextLB->insert_text(1, sNextChain);
2957 m_xNextLB->set_active_text(sNextChain);
2958 }
2959 else
2960 m_xNextLB->set_active(0);
2961 Link<weld::ComboBox&,void> aLink(LINK(this, SwFrameAddPage, ChainModifyHdl));
2962 m_xPrevLB->connect_changed(aLink);
2963 m_xNextLB->connect_changed(aLink);
2964 }
2965 }
2966 // Pos Protected
2967 const SvxProtectItem& rProt = rSet->Get(RES_PROTECT);
2968 m_xProtectFrameCB->set_active(rProt.IsPosProtected());
2969 m_xProtectContentCB->set_active(rProt.IsContentProtected());
2970 m_xProtectSizeCB->set_active(rProt.IsSizeProtected());
2971
2973 m_xEditInReadonlyCB->set_active(rEdit.GetValue());
2974 m_xEditInReadonlyCB->save_state();
2975
2976 // print
2977 const SvxPrintItem& rPrt = rSet->Get(RES_PRINT);
2978 m_xPrintFrameCB->set_active(rPrt.GetValue());
2979 m_xPrintFrameCB->save_state();
2980
2981 // textflow
2982 if( (!m_bHtmlMode || (0 != (nHtmlMode&HTMLMODE_SOME_STYLES)))
2983 && m_sDlgType != "PictureDialog" && m_sDlgType != "ObjectDialog"
2984 && SfxItemState::UNKNOWN != rSet->GetItemState( RES_FRAMEDIR ) )
2985 {
2986 m_xTextFlowFT->show();
2987 m_xTextFlowLB->show();
2988
2989 //vertical text flow is not possible in HTML
2990 if(m_bHtmlMode)
2991 {
2992 m_xTextFlowLB->remove_id(SvxFrameDirection::Vertical_RL_TB);
2993 }
2994 SvxFrameDirection nVal = rSet->Get(RES_FRAMEDIR).GetValue();
2995 m_xTextFlowLB->set_active_id(nVal);
2996 m_xTextFlowLB->save_value();
2997 }
2998 else
2999 {
3000 m_xTextFlowFT->hide();
3001 m_xTextFlowLB->hide();
3002 }
3003
3004 // Content alignment
3005 if ( rSet->GetItemState(RES_TEXT_VERT_ADJUST) > SfxItemState::DEFAULT )
3006 {
3007 SdrTextVertAdjust nAdjust = rSet->Get(RES_TEXT_VERT_ADJUST).GetValue();
3008 sal_Int32 nPos = 0;
3009 switch(nAdjust)
3010 {
3011 case SDRTEXTVERTADJUST_TOP: nPos = 0; break;
3013 case SDRTEXTVERTADJUST_BLOCK: nPos = 1; break;
3014 case SDRTEXTVERTADJUST_BOTTOM: nPos = 2; break;
3015 }
3016 m_xVertAlignLB->set_active(nPos);
3017 }
3018 m_xVertAlignLB->save_value();
3019}
3020
3022{
3023 bool bRet = false;
3024 if (m_xNameED->get_value_changed_from_saved())
3025 bRet |= nullptr != rSet->Put(SfxStringItem(FN_SET_FRM_NAME, m_xNameED->get_text()));
3026 if (m_xAltNameED->get_value_changed_from_saved())
3027 bRet |= nullptr != rSet->Put(SfxStringItem(FN_SET_FRM_ALT_NAME, m_xAltNameED->get_text()));
3028 if (m_xDescriptionED->get_value_changed_from_saved())
3029 bRet |= nullptr != rSet->Put(SfxStringItem(FN_UNO_DESCRIPTION, m_xDescriptionED->get_text()));
3030
3031 const SfxPoolItem* pOldItem;
3033 aProt.SetContentProtect( m_xProtectContentCB->get_active() );
3034 aProt.SetSizeProtect ( m_xProtectSizeCB->get_active() );
3035 aProt.SetPosProtect ( m_xProtectFrameCB->get_active() );
3036 if ( nullptr == (pOldItem = GetOldItem(*rSet, FN_SET_PROTECT)) ||
3037 aProt != *pOldItem )
3038 bRet |= nullptr != rSet->Put( aProt);
3039
3040 if ( m_xEditInReadonlyCB->get_state_changed_from_saved() )
3041 bRet |= nullptr != rSet->Put( SwFormatEditInReadonly( RES_EDIT_IN_READONLY, m_xEditInReadonlyCB->get_active()));
3042
3043 if ( m_xPrintFrameCB->get_state_changed_from_saved() )
3044 bRet |= nullptr != rSet->Put( SvxPrintItem( RES_PRINT, m_xPrintFrameCB->get_active()));
3045
3046 // textflow
3047 if (m_xTextFlowLB->get_visible() && m_xTextFlowLB->get_value_changed_from_saved())
3048 {
3049 SvxFrameDirection eDirection = m_xTextFlowLB->get_active_id();
3050 bRet |= nullptr != rSet->Put( SvxFrameDirectionItem(eDirection, RES_FRAMEDIR ));
3051 }
3052 if(m_pWrtSh)
3053 {
3054 const SwFrameFormat* pFormat = m_pWrtSh->GetFlyFrameFormat();
3055 if (pFormat)
3056 {
3057 OUString sCurrentPrevChain, sCurrentNextChain;
3058 if (m_xPrevLB->get_active())
3059 sCurrentPrevChain = m_xPrevLB->get_active_text();
3060 if (m_xNextLB->get_active())
3061 sCurrentNextChain = m_xNextLB->get_active_text();
3062 const SwFormatChain &rChain = pFormat->GetChain();
3063 const SwFlyFrameFormat* pFlyFormat;
3064 OUString sNextChain, sPrevChain;
3065 pFlyFormat = rChain.GetPrev();
3066 if (pFlyFormat != nullptr)
3067 sPrevChain = pFlyFormat->GetName();
3068
3069 pFlyFormat = rChain.GetNext();
3070 if (pFlyFormat != nullptr)
3071 sNextChain = pFlyFormat->GetName();
3072 if(sPrevChain != sCurrentPrevChain)
3073 bRet |= nullptr != rSet->Put(SfxStringItem(FN_PARAM_CHAIN_PREVIOUS, sCurrentPrevChain));
3074 if(sNextChain != sCurrentNextChain)
3075 bRet |= nullptr != rSet->Put(SfxStringItem(FN_PARAM_CHAIN_NEXT, sCurrentNextChain));
3076 }
3077 }
3078
3079 if (m_xVertAlignLB->get_value_changed_from_saved())
3080 {
3081 SdrTextVertAdjust nAdjust;
3082 switch (m_xVertAlignLB->get_active())
3083 {
3084 default:
3085 case 0 : nAdjust = SDRTEXTVERTADJUST_TOP; break;
3086 case 1 : nAdjust = SDRTEXTVERTADJUST_CENTER; break;
3087 case 2 : nAdjust = SDRTEXTVERTADJUST_BOTTOM; break;
3088 }
3089 bRet |= nullptr != rSet->Put(SdrTextVertAdjustItem(nAdjust, RES_TEXT_VERT_ADJUST));
3090 }
3091
3092 return bRet;
3093}
3094
3096{
3097 bool bEnable = !m_xNameED->get_text().isEmpty();
3098 m_xAltNameED->set_sensitive(bEnable);
3099 m_xAltNameFT->set_sensitive(bEnable);
3100}
3101
3102void SwFrameAddPage::SetFormatUsed(bool bFormatUsed)
3103{
3104 m_bFormat = bFormatUsed;
3105 if (m_bFormat)
3106 {
3107 m_xNameFrame->hide();
3108 }
3109}
3110
3111IMPL_LINK(SwFrameAddPage, ChainModifyHdl, weld::ComboBox&, rBox, void)
3112{
3113 OUString sCurrentPrevChain, sCurrentNextChain;
3114 if (m_xPrevLB->get_active())
3115 sCurrentPrevChain = m_xPrevLB->get_active_text();
3116 if (m_xNextLB->get_active())
3117 sCurrentNextChain = m_xNextLB->get_active_text();
3118 SwFrameFormat* pFormat = m_pWrtSh->GetFlyFrameFormat();
3119 if (!pFormat)
3120 return;
3121
3122 bool bNextBox = m_xNextLB.get() == &rBox;
3123 weld::ComboBox& rChangeLB = bNextBox ? *m_xPrevLB : *m_xNextLB;
3124 for (sal_Int32 nEntry = rChangeLB.get_count(); nEntry > 1; nEntry--)
3125 rChangeLB.remove(nEntry - 1);
3126 //determine chainable frames
3127 std::vector< OUString > aPrevPageFrames;
3128 std::vector< OUString > aThisPageFrames;
3129 std::vector< OUString > aNextPageFrames;
3130 std::vector< OUString > aRemainFrames;
3131 m_pWrtSh->GetConnectableFrameFormats(*pFormat, bNextBox ? sCurrentNextChain : sCurrentPrevChain, !bNextBox,
3132 aPrevPageFrames, aThisPageFrames, aNextPageFrames, aRemainFrames );
3133 lcl_InsertVectors(rChangeLB,
3134 aPrevPageFrames, aThisPageFrames, aNextPageFrames, aRemainFrames);
3135 const OUString sToSelect = bNextBox ? sCurrentPrevChain : sCurrentNextChain;
3136 if (rChangeLB.find_text(sToSelect) != -1)
3137 rChangeLB.set_active_text(sToSelect);
3138 else
3139 rChangeLB.set_active(0);
3140
3141}
3142
3143/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
GPOS_LT
bool Mirror(BmpMirrorFlags nMirrorFlags)
const Size & GetSizePixel() const
bool m_bGraphic
Definition: bmpwin.hxx:36
void SetGraphic(const Graphic &rGrf)
Definition: frmpage.cxx:2657
BitmapEx m_aBmp
Definition: bmpwin.hxx:32
void MirrorHorz(bool bMirror)
Definition: bmpwin.hxx:46
void MirrorVert(bool bMirror)
Definition: bmpwin.hxx:45
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
Definition: frmpage.cxx:2582
void SetBitmapEx(const BitmapEx &rGrf)
Definition: frmpage.cxx:2665
virtual ~BmpWindow() override
Definition: frmpage.cxx:2653
bool m_bHorz
Definition: bmpwin.hxx:34
virtual void Paint(vcl::RenderContext &, const tools::Rectangle &rRect) override
Definition: frmpage.cxx:2590
bool m_bVert
Definition: bmpwin.hxx:35
Graphic m_aGraphic
Definition: bmpwin.hxx:31
const OUString & GetValue() const
static ErrCode LoadGraphic(const OUString &rPath, const OUString &rFilter, Graphic &rGraphic, GraphicFilter *pFilter=nullptr, sal_uInt16 *pDeterminedFormat=nullptr)
static OUString GetImageType(const Graphic &rGraphic)
Size GetPrefSize() const
GraphicType GetType() const
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
void Draw(OutputDevice &rOutDev, const Point &rDestPt) const
static OUString decode(std::u16string_view rText, DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
static OUString EraseAllMnemonicChars(const OUString &rStr)
void DrawBitmapEx(const Point &rDestPt, const BitmapEx &rBitmapEx)
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
void DrawRect(const tools::Rectangle &rRect)
void SetLineColor()
void SetFillColor()
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
void SetBackground()
bool GetValue() const
static void GetDefaultTargetList(TargetList &)
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
static SfxObjectShell * Current()
const SfxItemSet & GetItemSet() const
SfxOkDialogController * GetDialogController() const
void SetExchangeSupport()
const SfxItemSet * GetDialogExampleSet() const
const SfxPoolItem * GetOldItem(const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true)
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
void SetSizeProtect(bool bNew)
void SetContentProtect(bool bNew)
bool IsPosProtected() const
bool IsContentProtected() const
bool IsSizeProtected() const
void SetPosProtect(bool bNew)
tools::Long GetHeight() const
tools::Long GetWidth() const
void SetHeight(tools::Long n)
void SetWidth(tools::Long n)
static OUString GetString(StringId eId)
sal_uInt16 GetUpper() const
sal_uInt16 GetLower() const
ColumnDescriptor.
Definition: fmtclds.hxx:34
bool GetGrfSize(Size &) const
Definition: editsh.cxx:278
svt::EmbeddedObjectRef & GetOLEObject() const
Get OLE object at pointer.
Definition: editsh.cxx:358
FlyProtectFlags IsSelObjProtected(FlyProtectFlags eType) const
Which Protection is set at selected object?
Definition: feshview.cxx:2701
void GetConnectableFrameFormats(SwFrameFormat &rFormat, const OUString &rReference, bool bSuccessors, std::vector< OUString > &aPrevPageVec, std::vector< OUString > &aThisPageVec, std::vector< OUString > &aNextPageVec, std::vector< OUString > &aRestVec)
Definition: fefly1.cxx:1866
OUString GetUniqueGrfName() const
Created unique name for frame.
Definition: fefly1.cxx:1504
void SetFlyName(const OUString &rName)
Set name at selected FlyFrame.
Definition: fefly1.cxx:1471
bool IsFrameVertical(const bool bEnvironment, bool &bRightToLeft, bool &bVertL2R) const
Determines whether a frame or its environment is vertically formatted and right-to-left.
Definition: fews.cxx:1270
OUString GetUniqueFrameName() const
Definition: feflyole.cxx:83
OUString GetUniqueOLEName() const
Definition: feflyole.cxx:78
sal_uInt16 GetPhyPageNum() const
Phy: real page count.
Definition: fews.cxx:335
const SwFrameFormat * IsFlyInFly()
Is selected frame within another frame?
Definition: fefly1.cxx:312
const SwFrameFormat * GetFlyFrameFormat() const
Get FlyFrameFormat; for UI macro linkage at Flys.
Definition: fefly1.cxx:1270
void ValidateMetrics(SvxSwFrameValidation &rVal, const SwPosition *pToCharContentPos, bool bOnlyPercentRefValue=false)
Definition: frmmgr.cxx:263
FlyAnchors.
Definition: fmtanchr.hxx:37
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:67
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:69
Connection (text flow) between two FlyFrames.
Definition: fmtcnct.hxx:32
SwFlyFrameFormat * GetPrev() const
Definition: fmtcnct.hxx:53
SwFlyFrameFormat * GetNext() const
Definition: fmtcnct.hxx:54
const SwColumns & GetColumns() const
Definition: fmtclds.hxx:112
void SetHeightPercentRelation(sal_Int16 n)
Definition: fmtfsize.hxx:94
void SetWidthPercent(sal_uInt8 n)
Definition: fmtfsize.hxx:95
void SetHeightSizeType(SwFrameSize eSize)
Definition: fmtfsize.hxx:81
void SetHeightPercent(sal_uInt8 n)
Definition: fmtfsize.hxx:93
sal_Int16 GetWidthPercentRelation() const
Definition: fmtfsize.hxx:92
void SetWidthSizeType(SwFrameSize eSize)
Definition: fmtfsize.hxx:84
void SetWidthPercentRelation(sal_Int16 n)
Definition: fmtfsize.hxx:96
sal_Int16 GetHeightPercentRelation() const
Definition: fmtfsize.hxx:89
SwFrameSize GetWidthSizeType() const
Definition: fmtfsize.hxx:83
sal_uInt8 GetWidthPercent() const
Definition: fmtfsize.hxx:91
SwFrameSize GetHeightSizeType() const
Definition: fmtfsize.hxx:80
sal_uInt8 GetHeightPercent() const
Definition: fmtfsize.hxx:88
Defines the horizontal position of a fly frame.
Definition: fmtornt.hxx:73
void SetPos(SwTwips nNew)
Definition: fmtornt.hxx:100
void SetPosToggle(bool bNew)
Definition: fmtornt.hxx:103
void SetHoriOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:96
sal_Int16 GetHoriOrient() const
Definition: fmtornt.hxx:94
void SetRelationOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:97
SwTwips GetPos() const
Definition: fmtornt.hxx:99
bool IsPosToggle() const
Definition: fmtornt.hxx:102
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:95
css::text::WrapTextMode GetSurround() const
Definition: fmtsrnd.hxx:51
virtual SwFormatURL * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:1828
Defines the vertical position of a fly frame.
Definition: fmtornt.hxx:37
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:58
SwTwips GetPos() const
Definition: fmtornt.hxx:62
void SetVertOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:59
void SetPos(SwTwips nNew)
Definition: fmtornt.hxx:63
void SetRelationOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:60
sal_Int16 GetVertOrient() const
Definition: fmtornt.hxx:57
const SwFormatChain & GetChain(bool=true) const
Definition: fmtcnct.hxx:70
const OUString & GetName() const
Definition: format.hxx:131
std::unique_ptr< weld::CheckButton > m_xProtectSizeCB
Definition: frmpage.hxx:289
std::unique_ptr< svx::FrameDirectionListBox > m_xTextFlowLB
Definition: frmpage.hxx:298
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: frmpage.cxx:2824
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: frmpage.cxx:3021
std::unique_ptr< weld::ComboBox > m_xNextLB
Definition: frmpage.hxx:284
std::unique_ptr< weld::Entry > m_xNameED
Definition: frmpage.hxx:278
bool m_bHtmlMode
Definition: frmpage.hxx:272
std::unique_ptr< weld::Widget > m_xContentAlignFrame
Definition: frmpage.hxx:291
std::unique_ptr< weld::CheckButton > m_xProtectFrameCB
Definition: frmpage.hxx:288
SwWrtShell * m_pWrtSh
Definition: frmpage.hxx:269
virtual void Reset(const SfxItemSet *rSet) override
Definition: frmpage.cxx:2829
std::unique_ptr< weld::Label > m_xAltNameFT
Definition: frmpage.hxx:279
OUString m_sDlgType
Definition: frmpage.hxx:271
std::unique_ptr< weld::CheckButton > m_xEditInReadonlyCB
Definition: frmpage.hxx:295
std::unique_ptr< weld::ComboBox > m_xPrevLB
Definition: frmpage.hxx:283
static const WhichRangesContainer s_aAddPgRg
Definition: frmpage.hxx:303
std::unique_ptr< weld::Label > m_xTextFlowFT
Definition: frmpage.hxx:297
std::unique_ptr< weld::ComboBox > m_xVertAlignLB
Definition: frmpage.hxx:292
std::unique_ptr< weld::TextView > m_xDescriptionED
Definition: frmpage.hxx:281
virtual ~SwFrameAddPage() override
Definition: frmpage.cxx:2819
std::unique_ptr< weld::CheckButton > m_xProtectContentCB
Definition: frmpage.hxx:287
std::unique_ptr< weld::Widget > m_xPropertiesFrame
Definition: frmpage.hxx:294
std::unique_ptr< weld::Widget > m_xProtectFrame
Definition: frmpage.hxx:286
std::unique_ptr< weld::CheckButton > m_xPrintFrameCB
Definition: frmpage.hxx:296
std::unique_ptr< weld::Label > m_xNameFT
Definition: frmpage.hxx:277
std::unique_ptr< weld::Widget > m_xNameFrame
Definition: frmpage.hxx:276
SwFrameAddPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: frmpage.cxx:2783
void SetFormatUsed(bool bFormat)
Definition: frmpage.cxx:3102
std::unique_ptr< weld::Widget > m_xSequenceFrame
Definition: frmpage.hxx:282
std::unique_ptr< weld::Entry > m_xAltNameED
Definition: frmpage.hxx:280
void SetWrap(css::text::WrapTextMode nW)
void SetVertRel(short nR)
void SetHoriRel(short nR)
void SetRelPos(const Point &rP)
void SetHAlign(short nH)
void SetTransparent(bool bT)
void SetAnchor(RndStdIds nA)
void SetVAlign(short nV)
Style of a layout element.
Definition: frmfmt.hxx:62
std::unique_ptr< weld::Label > m_xHorizontalFT
Definition: frmpage.hxx:102
std::unique_ptr< weld::CheckButton > m_xMirrorPagesCB
Definition: frmpage.hxx:109
std::unique_ptr< weld::CheckButton > m_xRelHeightCB
Definition: frmpage.hxx:86
RndStdIds GetAnchor() const
Definition: frmpage.cxx:1657
std::unique_ptr< weld::CheckButton > m_xFixedRatioCB
Definition: frmpage.hxx:90
std::unique_ptr< weld::CheckButton > m_xFollowTextFlowCB
Definition: frmpage.hxx:118
bool m_bAtHorzPosModified
Definition: frmpage.hxx:40
std::unique_ptr< weld::Label > m_xHeightFT
Definition: frmpage.hxx:84
static sal_Int16 GetAlignment(FrameMap const *pMap, sal_Int32 nMapPos, const weld::ComboBox &rRelationLB)
Definition: frmpage.cxx:1591
std::unique_ptr< weld::ComboBox > m_xHoriRelationLB
Definition: frmpage.hxx:107
bool m_bAtVertPosModified
Definition: frmpage.hxx:41
bool m_bNew
Definition: frmpage.hxx:44
std::unique_ptr< weld::Label > m_xAtHorzPosFT
Definition: frmpage.hxx:104
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: frmpage.cxx:1680
bool m_bIsMathBaselineAlignment
Definition: frmpage.hxx:73
sal_uInt16 m_nHtmlMode
Definition: frmpage.hxx:51
virtual void Reset(const SfxItemSet *rSet) override
Definition: frmpage.cxx:858
sal_Int32 FillPosLB(const FrameMap *_pMap, const sal_Int16 _nAlign, const sal_Int16 _nRel, weld::ComboBox &_rLB)
Definition: frmpage.cxx:1354
bool m_bHtmlMode
Definition: frmpage.hxx:50
std::unique_ptr< weld::MetricSpinButton > m_xAtVertPosED
Definition: frmpage.hxx:114
std::unique_ptr< weld::ComboBox > m_xRelWidthRelationLB
Definition: frmpage.hxx:81
bool m_bIsVerticalFrame
Definition: frmpage.hxx:46
sal_Int16 m_nOldH
Definition: frmpage.hxx:63
SwTwips m_nUpperBorder
Definition: frmpage.hxx:54
std::unique_ptr< weld::Label > m_xVertRelationFT
Definition: frmpage.hxx:115
sal_Int16 m_nOldHRel
Definition: frmpage.hxx:64
bool m_bFormat
Definition: frmpage.hxx:43
OUString m_sDlgType
Definition: frmpage.hxx:52
static sal_Int16 GetRelation(const weld::ComboBox &rRelationLB)
Definition: frmpage.cxx:1579
std::unique_ptr< weld::Label > m_xWidthFT
Definition: frmpage.hxx:78
std::unique_ptr< weld::RadioButton > m_xAnchorAsCharRB
Definition: frmpage.hxx:98
void EnableVerticalPositioning(bool bEnable)
Definition: frmpage.cxx:2285
std::unique_ptr< SwPercentField > m_xWidthED
Definition: frmpage.hxx:123
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: frmpage.cxx:831
void EnableGraficMode()
Definition: frmpage.cxx:836
std::unique_ptr< weld::RadioButton > m_xAnchorAtPageRB
Definition: frmpage.hxx:95
std::unique_ptr< weld::Label > m_xVerticalFT
Definition: frmpage.hxx:111
std::unique_ptr< weld::Label > m_xWidthAutoFT
Definition: frmpage.hxx:79
bool m_bIsVerticalL2R
Definition: frmpage.hxx:48
const SwPosition * mpToCharContentPos
Definition: frmpage.hxx:60
std::unique_ptr< weld::ComboBox > m_xRelHeightRelationLB
Definition: frmpage.hxx:87
static sal_Int32 GetMapPos(const FrameMap *pMap, const weld::ComboBox &rAlignLB)
Definition: frmpage.cxx:1624
virtual ~SwFramePage() override
Definition: frmpage.cxx:726
void setOptimalFrameWidth()
Definition: frmpage.cxx:739
sal_Int16 m_nOldV
Definition: frmpage.hxx:65
std::unique_ptr< SwPercentField > m_xHeightED
Definition: frmpage.hxx:124
std::unique_ptr< weld::ComboBox > m_xHorizontalDLB
Definition: frmpage.hxx:103
std::unique_ptr< weld::Label > m_xHeightAutoFT
Definition: frmpage.hxx:85
FrameMap const * m_pHMap
Definition: frmpage.hxx:69
void FillRelLB(const FrameMap *_pMap, const sal_uInt16 _nLBSelPos, const sal_Int16 _nAlign, const sal_Int16 _nRel, weld::ComboBox &_rLB, weld::Label &_rFT)
Definition: frmpage.cxx:1408
std::unique_ptr< weld::CheckButton > m_xAutoHeightCB
Definition: frmpage.hxx:88
bool m_bIsInRightToLeft
Definition: frmpage.hxx:49
FrameMap const * m_pVMap
Definition: frmpage.hxx:68
std::unique_ptr< weld::Button > m_xRealSizeBT
Definition: frmpage.hxx:91
static const WhichRangesContainer s_aPageRg
Definition: frmpage.hxx:176
std::unique_ptr< weld::ComboBox > m_xVerticalDLB
Definition: frmpage.hxx:112
std::unique_ptr< weld::CheckButton > m_xRelWidthCB
Definition: frmpage.hxx:80
SwTwips m_nLowerBorder
Definition: frmpage.hxx:55
SwFramePage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: frmpage.cxx:619
bool m_bAllowVertPositioning
Definition: frmpage.hxx:71
sal_Int16 m_nOldVRel
Definition: frmpage.hxx:66
void SetFormatUsed(bool bFormat)
Definition: frmpage.cxx:2278
double m_fWidthHeightRatio
Definition: frmpage.hxx:56
std::unique_ptr< weld::MetricSpinButton > m_xAtHorzPosED
Definition: frmpage.hxx:105
std::unique_ptr< weld::Label > m_xHoriRelationFT
Definition: frmpage.hxx:106
std::unique_ptr< weld::RadioButton > m_xAnchorAtParaRB
Definition: frmpage.hxx:96
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: frmpage.cxx:1031
std::unique_ptr< weld::Label > m_xAtVertPosFT
Definition: frmpage.hxx:113
bool m_bNoModifyHdl
Definition: frmpage.hxx:45
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: frmpage.cxx:1694
std::unique_ptr< weld::RadioButton > m_xAnchorAtFrameRB
Definition: frmpage.hxx:99
std::unique_ptr< weld::CheckButton > m_xAutoWidthCB
Definition: frmpage.hxx:82
SwWrtShell * getFrameDlgParentShell()
Definition: frmpage.cxx:853
void UpdateExample()
Definition: frmpage.cxx:2069
bool m_bIsMathOLE
Definition: frmpage.hxx:72
void InitPos(RndStdIds eId, sal_Int16 nH, sal_Int16 nHRel, sal_Int16 nV, sal_Int16 nVRel, tools::Long nX, tools::Long nY)
Definition: frmpage.cxx:1228
void RangeModifyHdl()
Definition: frmpage.cxx:1753
void Init(const SfxItemSet &rSet)
Definition: frmpage.cxx:2096
SwFrameExample m_aExampleWN
Definition: frmpage.hxx:75
std::unique_ptr< weld::ComboBox > m_xVertRelationLB
Definition: frmpage.hxx:116
bool IsInGraficMode() const
Definition: frmpage.hxx:191
void setOptimalRelWidth()
Definition: frmpage.cxx:798
Size m_aGrfSize
Definition: frmpage.hxx:53
std::unique_ptr< weld::RadioButton > m_xAnchorAtCharRB
Definition: frmpage.hxx:97
std::unique_ptr< weld::Entry > m_xNameED
Definition: frmpage.hxx:248
virtual ~SwFrameURLPage() override
Definition: frmpage.cxx:2684
std::unique_ptr< weld::CheckButton > m_xServerCB
Definition: frmpage.hxx:252
std::unique_ptr< weld::Button > m_xSearchPB
Definition: frmpage.hxx:247
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: frmpage.cxx:2721
std::unique_ptr< weld::Entry > m_xURLED
Definition: frmpage.hxx:246
std::unique_ptr< weld::CheckButton > m_xClientCB
Definition: frmpage.hxx:253
SwFrameURLPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: frmpage.cxx:2672
std::unique_ptr< weld::ComboBox > m_xFrameCB
Definition: frmpage.hxx:249
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: frmpage.cxx:2759
virtual void Reset(const SfxItemSet *rSet) override
Definition: frmpage.cxx:2688
std::unique_ptr< weld::CustomWeld > m_xBmpWin
Definition: frmpage.hxx:222
std::unique_ptr< weld::RadioButton > m_xLeftPagesRB
Definition: frmpage.hxx:210
virtual ~SwGrfExtPage() override
Definition: frmpage.cxx:2327
OUString m_aFilterName
Definition: frmpage.hxx:197
SwGrfExtPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: frmpage.cxx:2296
std::unique_ptr< weld::RadioButton > m_xRightPagesRB
Definition: frmpage.hxx:211
std::unique_ptr< weld::MetricSpinButton > m_xNfAngle
Definition: frmpage.hxx:219
std::unique_ptr< weld::CustomWeld > m_xCtlAngleWin
Definition: frmpage.hxx:221
BmpWindow m_aBmpWin
Definition: frmpage.hxx:205
virtual void Reset(const SfxItemSet *rSet) override
Definition: frmpage.cxx:2340
bool m_bHtmlMode
Definition: frmpage.hxx:202
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: frmpage.cxx:2335
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: frmpage.cxx:2505
std::unique_ptr< weld::Entry > m_xConnectED
Definition: frmpage.hxx:213
std::unique_ptr< weld::Label > m_xLabelGraphicType
Definition: frmpage.hxx:225
std::unique_ptr< weld::Widget > m_xMirror
Definition: frmpage.hxx:206
std::unique_ptr< weld::RadioButton > m_xAllPagesRB
Definition: frmpage.hxx:209
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: frmpage.cxx:2366
std::unique_ptr< weld::Button > m_xBrowseBT
Definition: frmpage.hxx:214
std::unique_ptr<::sfx2::FileDialogHelper > m_xGrfDlg
Definition: frmpage.hxx:200
std::unique_ptr< svx::DialControl > m_xCtlAngle
Definition: frmpage.hxx:220
std::unique_ptr< weld::CheckButton > m_xMirrorHorzBox
Definition: frmpage.hxx:208
OUString m_aNewGrfName
Definition: frmpage.hxx:198
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: frmpage.cxx:2458
std::unique_ptr< weld::CheckButton > m_xMirrorVertBox
Definition: frmpage.hxx:207
OUString m_aGrfName
Definition: frmpage.hxx:198
void SetGrfToggle(bool bNew)
Definition: grfatr.hxx:66
SwDocShell * GetDocShell()
Definition: view.cxx:1160
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
const SwView & GetView() const
Definition: wrtsh.hxx:438
#define SO3_SM_CLASSID_50
#define SO3_SM_CLASSID_60
#define SO3_SM_CLASSID_30
#define SO3_SM_CLASSID_40
void append(const OUString &rId, const OUString &rStr)
virtual int find_text(const OUString &rStr) const=0
virtual OUString get_active_id() const=0
virtual OUString get_active_text() const=0
virtual OUString get_id(int pos) const=0
virtual void clear()=0
virtual void set_active(int pos)=0
void append_separator(const OUString &rId)
void append_text(const OUString &rStr)
virtual void remove(int pos)=0
virtual int get_active() const=0
virtual int get_count() const=0
void set_active_text(const OUString &rStr)
void set_size_request(int nWidth, int nHeight)
void SetOutputSizePixel(const Size &rSize)
Size const & GetOutputSizePixel() const
virtual OutputDevice & get_ref_device()=0
virtual OUString get_label() const=0
void set_accessible_name(const OUString &rName)
virtual void set_sensitive(bool sensitive)=0
virtual void set_visible(bool visible)
#define FN_SET_FRM_ALT_NAME
Definition: cmdid.h:872
#define FN_HORI_ORIENT
Definition: cmdid.h:868
#define FN_SET_FRM_NAME
Definition: cmdid.h:869
#define FN_PARAM_CHAIN_PREVIOUS
Definition: cmdid.h:832
#define FN_PARAM_GRF_CONNECT
Definition: cmdid.h:802
#define FN_OLE_IS_MATH
Definition: cmdid.h:634
#define FN_KEEP_ASPECT_RATIO
Definition: cmdid.h:870
#define FN_MATH_BASELINE_ALIGNMENT
Definition: cmdid.h:635
#define FN_SET_PROTECT
Definition: cmdid.h:865
#define FN_VERT_ORIENT
Definition: cmdid.h:867
#define FN_PARAM_CHAIN_NEXT
Definition: cmdid.h:833
#define FN_UNO_DESCRIPTION
Definition: cmdid.h:874
void FitToActualSize(SwFormatCol &rCol, sal_uInt16 nWidth)
Definition: colmgr.cxx:35
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
int nCount
@ PrintArea
SVXCORE_DLLPUBLIC OUString SvxResId(TranslateId aId)
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
Definition: dialoghelp.cxx:19
#define ERRCODE_NONE
@ Fixed
Only protection that cannot be withdrawn e.g.
FieldUnit
SwFrameSize
Definition: fmtfsize.hxx:36
@ Fixed
Frame cannot be moved in Var-direction.
@ Variable
Frame is variable in Var-direction.
@ Minimum
Value in Var-direction gives minimum (can be exceeded but not be less).
SvxFrameDirection
#define MAX_PERCENT_WIDTH
Definition: frmpage.cxx:92
static LB lcl_GetLBRelationsForRelations(const sal_Int16 _nRel)
Definition: frmpage.cxx:571
constexpr auto HORI_PARA_REL
Definition: frmpage.cxx:254
RelationMap const aAsCharRelationMap[]
Definition: frmpage.cxx:179
IMPL_LINK_NOARG(SwFramePage, MirrorHdl, weld::Toggleable &, void)
Definition: frmpage.cxx:1716
#define VERT_FRAME_REL
Definition: frmpage.cxx:237
FrameMap const aHParaHtmlMap[]
Definition: frmpage.cxx:268
constexpr auto VERT_CHAR_REL
Definition: frmpage.cxx:326
FrameMap const aVAsCharHtmlMap[]
Definition: frmpage.cxx:377
FrameMap const aVParaHtmlMap[]
Definition: frmpage.cxx:292
FrameMap const aVFrameMap[]
Definition: frmpage.cxx:239
FrameMap const aHFlyHtmlMap[]
Definition: frmpage.cxx:230
constexpr auto HORI_PAGE_REL
Definition: frmpage.cxx:187
FrameMap const aHPageMap[]
Definition: frmpage.cxx:190
#define HTML_HORI_PARA_REL
Definition: frmpage.cxx:266
FrameMap const aVParaMap[]
Definition: frmpage.cxx:284
FrameMap const aHFrameMap[]
Definition: frmpage.cxx:222
#define HTML_HORI_CHAR_REL
Definition: frmpage.cxx:310
static SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(SvxSwFramePosString::StringId eStringId, bool bVertical, bool bVerticalL2R, bool bRTL)
Definition: frmpage.cxx:478
IMPL_LINK(SwFramePage, RelSizeClickHdl, weld::Toggleable &, rBtn, void)
Definition: frmpage.cxx:1722
static LB lcl_GetLBRelationsForStrID(const FrameMap *_pMap, const SvxSwFramePosString::StringId _eStrId, const bool _bUseMirrorStr)
Definition: frmpage.cxx:588
RelationMap const aRelationMap[]
Definition: frmpage.cxx:153
FrameMap const aHParaHtmlAbsMap[]
Definition: frmpage.cxx:274
static void lcl_InsertVectors(weld::ComboBox &rBox, const std::vector< OUString > &rPrev, const std::vector< OUString > &rThis, const std::vector< OUString > &rNext, const std::vector< OUString > &rRemain)
Definition: frmpage.cxx:452
#define MAX_PERCENT_HEIGHT
Definition: frmpage.cxx:93
constexpr auto VERT_PARA_REL
Definition: frmpage.cxx:281
static size_t lcl_GetFrameMapCount(const FrameMap *pMap)
Definition: frmpage.cxx:403
FrameMap const aVCharHtmlAbsMap[]
Definition: frmpage.cxx:353
FrameMap const aVFlyHtmlMap[]
Definition: frmpage.cxx:247
FrameMap const aVAsCharMap[]
Definition: frmpage.cxx:360
#define VERT_PAGE_REL
Definition: frmpage.cxx:203
FrameMap const aHCharMap[]
Definition: frmpage.cxx:302
FrameMap const aVCharMap[]
Definition: frmpage.cxx:329
FrameMap const aVCharHtmlMap[]
Definition: frmpage.cxx:348
FrameMap const aVPageMap[]
Definition: frmpage.cxx:205
FrameMap const aHParaMap[]
Definition: frmpage.cxx:258
FrameMap const aVPageHtmlMap[]
Definition: frmpage.cxx:213
constexpr auto HORI_FRAME_REL
Definition: frmpage.cxx:219
FrameMap const aHCharHtmlAbsMap[]
Definition: frmpage.cxx:318
FrameMap const aHPageHtmlMap[]
Definition: frmpage.cxx:198
constexpr auto HORI_CHAR_REL
Definition: frmpage.cxx:298
FrameMap const aHCharHtmlMap[]
Definition: frmpage.cxx:312
MirrorGraph
Definition: grfatr.hxx:32
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(120)
constexpr TypedWhichId< SvxOpaqueItem > RES_OPAQUE(99)
constexpr TypedWhichId< SwFormatCol > RES_COL(109)
constexpr TypedWhichId< SwFormatFollowTextFlow > RES_FOLLOW_TEXT_FLOW(123)
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(101)
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
constexpr TypedWhichId< SwFormatHoriOrient > RES_HORI_ORIENT(103)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(104)
constexpr TypedWhichId< SwFormatURL > RES_URL(111)
constexpr TypedWhichId< SwMirrorGrf > RES_GRFATR_MIRRORGRF(RES_GRFATR_BEGIN)
constexpr TypedWhichId< SvxPrintItem > RES_PRINT(98)
constexpr TypedWhichId< SvxProtectItem > RES_PROTECT(100)
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(102)
constexpr TypedWhichId< SdrTextVertAdjustItem > RES_TEXT_VERT_ADJUST(130)
constexpr TypedWhichId< SwFormatEditInReadonly > RES_EDIT_IN_READONLY(112)
HTMLMODE_SOME_STYLES
HTMLMODE_ON
::std::vector< OUString > TargetList
BmpMirrorFlags
sal_Int32 nIndex
sal_uInt16 nPos
const long LONG_MAX
#define SAL_N_ELEMENTS(arr)
sal_Int16 nBit
int n2
int n1
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
def text(shape, orig_st)
const sal_uInt32 TOP
int i
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
static constexpr auto Items
long Long
OUString toId(const void *pValue)
FRAME
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
Definition: nodeoffset.hxx:35
const char GetValue[]
SfxItemState
SdrTextVertAdjust
SDRTEXTVERTADJUST_BOTTOM
SDRTEXTVERTADJUST_BLOCK
SDRTEXTVERTADJUST_CENTER
SDRTEXTVERTADJUST_TOP
static SfxItemSet & rSet
sal_uIntPtr sal_uLong
sal_Int16 nAlign
Definition: frmpage.cxx:148
LB nLBRelations
Definition: frmpage.cxx:149
SvxSwFramePosString::StringId eStrId
Definition: frmpage.cxx:146
SvxSwFramePosString::StringId eMirrorStrId
Definition: frmpage.cxx:147
RndStdIds
SwWrtShell * GetActiveWrtShell()
Definition: swmodul1.cxx:108
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:165
Size GetGraphicSizeTwip(const Graphic &rGraphic, vcl::RenderContext *pOutDev)
Definition: swtypes.cxx:28
tools::Long SwTwips
Definition: swtypes.hxx:51
#define MINFLY
Definition: swtypes.hxx:61
DeactivateRC
unsigned char sal_uInt8
SW_DLLPUBLIC void InsertStringSorted(const OUString &rId, const OUString &rEntry, weld::ComboBox &rToFill, int nOffset)
Definition: uitool.cxx:767
SW_DLLPUBLIC FieldUnit GetDfltMetric(bool bWeb)
Definition: uitool.cxx:755
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
Definition: viewopt.cxx:332