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