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)
410 return std::size(aVParaHtmlMap);
411 if( pMap == aVAsCharHtmlMap)
412 return std::size(aVAsCharHtmlMap);
413 if( pMap == aHParaHtmlMap)
414 return std::size(aHParaHtmlMap);
415 if( pMap == aHParaHtmlAbsMap)
416 return std::size(aHParaHtmlAbsMap);
417 if ( pMap == aVPageMap )
418 return std::size(aVPageMap);
419 if ( pMap == aVPageHtmlMap )
420 return std::size(aVPageHtmlMap);
421 if ( pMap == aVAsCharMap )
422 return std::size(aVAsCharMap);
423 if ( pMap == aVParaMap )
424 return std::size(aVParaMap);
425 if ( pMap == aHParaMap )
426 return std::size(aHParaMap);
427 if ( pMap == aHFrameMap )
428 return std::size(aHFrameMap);
429 if ( pMap == aVFrameMap )
430 return std::size(aVFrameMap);
431 if ( pMap == aHCharMap )
432 return std::size(aHCharMap);
433 if ( pMap == aHCharHtmlMap )
434 return std::size(aHCharHtmlMap);
435 if ( pMap == aHCharHtmlAbsMap )
436 return std::size(aHCharHtmlAbsMap);
437 if ( pMap == aVCharMap )
438 return std::size(aVCharMap);
439 if ( pMap == aVCharHtmlMap )
440 return std::size(aVCharHtmlMap);
441 if ( pMap == aVCharHtmlAbsMap )
442 return std::size(aVCharHtmlAbsMap);
443 if ( pMap == aHPageHtmlMap )
444 return std::size(aHPageHtmlMap);
445 if ( pMap == aHFlyHtmlMap )
446 return std::size(aHFlyHtmlMap);
447 if ( pMap == aVFlyHtmlMap )
448 return std::size(aVFlyHtmlMap);
449 return std::size(aHPageMap);
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[] = {
745 { aHPageMap, std::size(aHPageMap) },
746 { aHPageHtmlMap, std::size(aHPageHtmlMap) },
747 { aVPageMap, std::size(aVPageMap) },
748 { aVPageHtmlMap, std::size(aVPageHtmlMap) },
749 { aHFrameMap, std::size(aHFrameMap) },
750 { aHFlyHtmlMap, std::size(aHFlyHtmlMap) },
751 { aVFrameMap, std::size(aVFrameMap) },
752 { aVFlyHtmlMap, std::size(aVFlyHtmlMap) },
753 { aHParaMap, std::size(aHParaMap) },
754 { aHParaHtmlMap, std::size(aHParaHtmlMap) },
755 { aHParaHtmlAbsMap, std::size(aHParaHtmlAbsMap) },
756 { aVParaMap, std::size(aVParaMap) },
757 { aVParaHtmlMap, std::size(aVParaHtmlMap) },
758 { aHCharMap, std::size(aHCharMap) },
759 { aHCharHtmlMap, std::size(aHCharHtmlMap) },
760 { aHCharHtmlAbsMap, std::size(aHCharHtmlAbsMap) },
761 { aVCharMap, std::size(aVCharMap) },
762 { aVCharHtmlMap, std::size(aVCharHtmlMap) },
763 { aVCharHtmlAbsMap, std::size(aVCharHtmlAbsMap) },
764 { aVAsCharMap, std::size(aVAsCharMap) },
765 { aVAsCharHtmlMap, std::size(aVAsCharHtmlMap) }
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(const SwFrameFormat& rFlyFormat)
802{
803 const SwNodeIndex* pStartNode = rFlyFormat.GetContent().GetContentIdx();
804 if (!pStartNode)
805 {
806 return false;
807 }
808
809 // Check if the frame content starts with a table.
810 SwNodeIndex aNodeIndex(*pStartNode);
811 ++aNodeIndex;
812 if (!aNodeIndex.GetNode().IsTableNode())
813 {
814 return false;
815 }
816
817 // Check if the frame content ends with the same table.
818 SwNodeIndex aEndIndex(*aNodeIndex.GetNode().EndOfSectionNode());
819 ++aEndIndex;
820 if (&aEndIndex.GetNode() != pStartNode->GetNode().EndOfSectionNode())
821 {
822 return false;
823 }
824
825 return true;
826}
827
828bool ContainsChain(const SwFrameFormat& rFlyFormat)
829{
830 const SwFormatChain& rChain = rFlyFormat.GetChain();
831 return rChain.GetPrev() || rChain.GetNext();
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 const SwFrameFormat* pFlyFormat = pSh->GetFlyFrameFormat();
1051 if (!pFlyFormat || !ContainsSingleTable(*pFlyFormat) || ContainsChain(*pFlyFormat))
1052 {
1053 // Only allow fly split if the frame contains a single table, otherwise it would be hard to
1054 // save the resulting model to Word formats.
1055 m_xFlySplitCB->hide();
1056 }
1057
1058 Init(*rSet);
1059 m_xAtVertPosED->save_value();
1060 m_xAtHorzPosED->save_value();
1061 m_xFollowTextFlowCB->save_state();
1062 m_xFlySplitCB->save_state();
1063
1064 m_xWidthED->save_value();
1065 m_xHeightED->save_value();
1066
1067 m_bNoModifyHdl = false;
1068 //lock PercentFields
1069 m_xWidthED->LockAutoCalculation(true);
1070 m_xHeightED->LockAutoCalculation(true);
1071 RangeModifyHdl(); // set all maximum values initially
1072 m_xHeightED->LockAutoCalculation(false);
1073 m_xWidthED->LockAutoCalculation(false);
1074
1075 m_xAutoHeightCB->save_state();
1076 m_xAutoWidthCB->save_state();
1077
1078 SwTwips nWidth = static_cast< SwTwips >(m_xWidthED->DenormalizePercent(m_xWidthED->get_value(FieldUnit::TWIP)));
1079 SwTwips nHeight = static_cast< SwTwips >(m_xHeightED->DenormalizePercent(m_xHeightED->get_value(FieldUnit::TWIP)));
1080 m_fWidthHeightRatio = nHeight ? double(nWidth) / double(nHeight) : 1.0;
1081}
1082
1083// stuff attributes into the set when OK
1085{
1086 bool bRet = false;
1087
1088 const SfxItemSet& rOldSet = GetItemSet();
1089 const SfxPoolItem* pOldItem = nullptr;
1090
1091 RndStdIds eAnchorId = GetAnchor();
1092
1093 if ( !m_bFormat || eAnchorId != RndStdIds::FLY_AT_FLY )
1094 {
1095 pOldItem = GetOldItem(*rSet, RES_ANCHOR);
1096 if (m_bNew || !pOldItem || eAnchorId != static_cast<const SwFormatAnchor*>(pOldItem)->GetAnchorId())
1097 {
1100 OSL_ENSURE( pSh , "shell not found");
1101 if (pSh)
1102 {
1103 SwFormatAnchor aAnc( eAnchorId, eAnchorId == RndStdIds::FLY_AT_PAGE ? pSh->GetPhyPageNum() : 0 );
1104 bRet = nullptr != rSet->Put( aAnc );
1105 }
1106 }
1107 }
1108
1109 if ( m_pHMap )
1110 {
1111 SwFormatHoriOrient aHoriOrient( rOldSet.Get(RES_HORI_ORIENT) );
1112
1113 const sal_Int32 nMapPos = GetMapPos(m_pHMap, *m_xHorizontalDLB);
1114 const sal_Int16 eHOri = GetAlignment(m_pHMap, nMapPos, *m_xHoriRelationLB);
1115 const sal_Int16 eRel = GetRelation(*m_xHoriRelationLB);
1116
1117 aHoriOrient.SetHoriOrient( eHOri );
1118 aHoriOrient.SetRelationOrient( eRel );
1119 aHoriOrient.SetPosToggle(m_xMirrorPagesCB->get_active());
1120
1121 bool bMod = m_xAtHorzPosED->get_value_changed_from_saved();
1122 bMod |= m_xMirrorPagesCB->get_state_changed_from_saved();
1123
1124 if ( eHOri == text::HoriOrientation::NONE &&
1125 (m_bNew || (m_bAtHorzPosModified || bMod) || m_nOldH != eHOri ) )
1126 {
1127 SwTwips nX = static_cast< SwTwips >(m_xAtHorzPosED->denormalize(m_xAtHorzPosED->get_value(FieldUnit::TWIP)));
1128 aHoriOrient.SetPos( nX );
1129 }
1130
1131 pOldItem = GetOldItem(*rSet, FN_HORI_ORIENT);
1132 bool bSame = false;
1133 if ((m_bNew == m_bFormat) && pOldItem)
1134 {
1135 bSame = aHoriOrient == static_cast<const SwFormatHoriOrient&>(*pOldItem);
1136 }
1137 if ((m_bNew && !m_bFormat) || ((m_bAtHorzPosModified || bMod) && !bSame))
1138 {
1139 bRet |= nullptr != rSet->Put( aHoriOrient );
1140 }
1141 }
1142
1143 if ( m_pVMap )
1144 {
1145 // alignment vertical
1146 SwFormatVertOrient aVertOrient( rOldSet.Get(RES_VERT_ORIENT) );
1147
1148 const sal_Int32 nMapPos = GetMapPos(m_pVMap, *m_xVerticalDLB);
1149 const sal_Int16 eVOri = GetAlignment(m_pVMap, nMapPos, *m_xVertRelationLB);
1150 const sal_Int16 eRel = GetRelation(*m_xVertRelationLB);
1151
1152 aVertOrient.SetVertOrient ( eVOri);
1153 aVertOrient.SetRelationOrient( eRel );
1154
1155 bool bMod = m_xAtVertPosED->get_value_changed_from_saved();
1156
1157 if ( eVOri == text::VertOrientation::NONE &&
1158 ( m_bNew || (m_bAtVertPosModified || bMod) || m_nOldV != eVOri) )
1159 {
1160 // vertical position
1161 // recalculate offset for character bound frames
1162 SwTwips nY = static_cast< SwTwips >(m_xAtVertPosED->denormalize(m_xAtVertPosED->get_value(FieldUnit::TWIP)));
1163 if (eAnchorId == RndStdIds::FLY_AS_CHAR)
1164 {
1165 nY *= -1;
1166 }
1167 aVertOrient.SetPos( nY );
1168 }
1169 pOldItem = GetOldItem(*rSet, FN_VERT_ORIENT);
1170 bool bSame = false;
1171 if((m_bNew == m_bFormat) && pOldItem)
1172 {
1173 bSame = m_bFormat ?
1174 aVertOrient.GetVertOrient() == static_cast<const SwFormatVertOrient*>(pOldItem)->GetVertOrient() &&
1175 aVertOrient.GetRelationOrient() == static_cast<const SwFormatVertOrient*>(pOldItem)->GetRelationOrient() &&
1176 aVertOrient.GetPos() == static_cast<const SwFormatVertOrient*>(pOldItem)->GetPos()
1177 : aVertOrient == static_cast<const SwFormatVertOrient&>(*pOldItem);
1178 }
1179 if( ( m_bNew && !m_bFormat ) || ((m_bAtVertPosModified || bMod) && !bSame ))
1180 {
1181 bRet |= nullptr != rSet->Put( aVertOrient );
1182 }
1183 }
1184
1185 // set size
1186 // new exception: when the size of pMgr(, 0), then the properties
1187 // for a graphic that isn't even loaded, are set. Then no SetSize
1188 // is done here when the size settings were not changed by the
1189 // user.
1190 const SwFormatFrameSize& rOldSize = rOldSet.Get(RES_FRM_SIZE);
1191 SwFormatFrameSize aSz( rOldSize );
1192
1193 auto nRelWidthRelation = m_xRelWidthRelationLB->get_active();
1194 if (nRelWidthRelation != -1)
1195 {
1196 if (nRelWidthRelation == 0)
1197 aSz.SetWidthPercentRelation(text::RelOrientation::FRAME);
1198 else if (nRelWidthRelation == 1)
1199 aSz.SetWidthPercentRelation(text::RelOrientation::PAGE_FRAME);
1200 }
1201 auto nRelHeightRelation = m_xRelHeightRelationLB->get_active();
1202 if (nRelHeightRelation != -1)
1203 {
1204 if (nRelHeightRelation == 0)
1205 aSz.SetHeightPercentRelation(text::RelOrientation::FRAME);
1206 else if (nRelHeightRelation == 1)
1207 aSz.SetHeightPercentRelation(text::RelOrientation::PAGE_FRAME);
1208 }
1209
1210 bool bValueModified = m_xWidthED->get_value_changed_from_saved() ||
1211 m_xHeightED->get_value_changed_from_saved();
1212 bool bCheckChanged = m_xRelWidthCB->get_state_changed_from_saved() ||
1213 m_xRelHeightCB->get_state_changed_from_saved() ||
1214 m_xFixedRatioCB->get_state_changed_from_saved();
1215
1216 bool bLegalValue = !(!rOldSize.GetWidth () && !rOldSize.GetHeight() &&
1217 m_xWidthED->get_value() == m_xWidthED->get_min() &&
1218 m_xHeightED->get_value() == m_xHeightED->get_min());
1219
1220 if ((m_bNew && !m_bFormat) || ((bValueModified || bCheckChanged) && bLegalValue))
1221 {
1222 sal_Int64 nNewWidth = m_xWidthED->DenormalizePercent(m_xWidthED->GetRealValue(FieldUnit::TWIP));
1223 sal_Int64 nNewHeight = m_xHeightED->DenormalizePercent(m_xHeightED->GetRealValue(FieldUnit::TWIP));
1224 aSz.SetWidth (static_cast< SwTwips >(nNewWidth));
1225 aSz.SetHeight(static_cast< SwTwips >(nNewHeight));
1226
1227 if (m_xRelWidthCB->get_active())
1228 {
1229 aSz.SetWidthPercent(static_cast<sal_uInt8>(std::min(MAX_PERCENT_WIDTH, m_xWidthED->Convert(m_xWidthED->NormalizePercent(nNewWidth), FieldUnit::TWIP, FieldUnit::PERCENT))));
1230 }
1231 else
1232 aSz.SetWidthPercent(0);
1233 if (m_xRelHeightCB->get_active())
1234 aSz.SetHeightPercent(static_cast<sal_uInt8>(std::min(MAX_PERCENT_HEIGHT, m_xHeightED->Convert(m_xHeightED->NormalizePercent(nNewHeight), FieldUnit::TWIP, FieldUnit::PERCENT))));
1235 else
1236 aSz.SetHeightPercent(0);
1237
1238 if (m_xFixedRatioCB->get_active() && (m_xRelWidthCB->get_active() != m_xRelHeightCB->get_active()))
1239 {
1240 if (m_xRelWidthCB->get_active())
1242 else
1244 }
1245 }
1246
1247 if( !IsInGraficMode() )
1248 {
1249 if (m_xAutoHeightCB->get_state_changed_from_saved())
1250 {
1252 if( eFrameSize != aSz.GetHeightSizeType() )
1253 aSz.SetHeightSizeType(eFrameSize);
1254 }
1255 if (m_xAutoWidthCB->get_state_changed_from_saved())
1256 {
1258 if( eFrameSize != aSz.GetWidthSizeType() )
1259 aSz.SetWidthSizeType( eFrameSize );
1260 }
1261 }
1262 if (m_xFixedRatioCB->get_state_changed_from_saved())
1263 bRet |= nullptr != rSet->Put(SfxBoolItem(FN_KEEP_ASPECT_RATIO, m_xFixedRatioCB->get_active()));
1264
1265 pOldItem = GetOldItem(*rSet, RES_FRM_SIZE);
1266
1267 if ((pOldItem && aSz != *pOldItem) || (!pOldItem && !m_bFormat) ||
1268 (m_bFormat &&
1269 (aSz.GetWidth() > 0 || aSz.GetWidthPercent() > 0) &&
1270 (aSz.GetHeight() > 0 || aSz.GetHeightPercent() > 0)))
1271 {
1272 if (aSz.GetHeightSizeType() == SwFrameSize::Variable) // there is no VAR_SIZE in frames
1274
1275 bRet |= nullptr != rSet->Put( aSz );
1276 }
1277 if (m_xFollowTextFlowCB->get_state_changed_from_saved())
1278 {
1279 bRet |= nullptr != rSet->Put(SwFormatFollowTextFlow(m_xFollowTextFlowCB->get_active()));
1280 }
1281 if (m_xFlySplitCB->get_state_changed_from_saved())
1282 {
1283 bRet |= rSet->Put(SwFormatFlySplit(m_xFlySplitCB->get_active())) != nullptr;
1284 }
1285 return bRet;
1286}
1287
1288// initialise horizontal and vertical Pos
1290 sal_Int16 nH,
1291 sal_Int16 nHRel,
1292 sal_Int16 nV,
1293 sal_Int16 nVRel,
1294 tools::Long nX,
1295 tools::Long nY)
1296{
1297 auto nPos = m_xVerticalDLB->get_active();
1298 if (nPos != -1 && m_pVMap)
1299 {
1301
1302 nPos = m_xVertRelationLB->get_active();
1303 if (nPos != -1)
1304 m_nOldVRel = weld::fromId<RelationMap*>(m_xVertRelationLB->get_id(nPos))->nRelation;
1305 }
1306
1307 nPos = m_xHorizontalDLB->get_active();
1308 if (nPos != -1 && m_pHMap)
1309 {
1311
1312 nPos = m_xHoriRelationLB->get_active();
1313 if (nPos != -1)
1314 m_nOldHRel = weld::fromId<RelationMap*>(m_xHoriRelationLB->get_id(nPos))->nRelation;
1315 }
1316
1317 bool bEnable = true;
1318 if ( eId == RndStdIds::FLY_AT_PAGE )
1319 {
1322 }
1323 else if ( eId == RndStdIds::FLY_AT_FLY )
1324 {
1325 // own vertical alignment map for to frame
1326 // anchored objects.
1329 }
1330 else if ( eId == RndStdIds::FLY_AT_PARA )
1331 {
1332 if(m_bHtmlMode)
1333 {
1336 }
1337 else
1338 {
1341 }
1342 }
1343 else if ( eId == RndStdIds::FLY_AT_CHAR )
1344 {
1345 if(m_bHtmlMode)
1346 {
1349 }
1350 else
1351 {
1354 }
1355 }
1356 else if ( eId == RndStdIds::FLY_AS_CHAR )
1357 {
1359 m_pHMap = nullptr;
1360 bEnable = false;
1361 }
1362 m_xHorizontalDLB->set_sensitive( bEnable );
1363 m_xHorizontalFT->set_sensitive( bEnable );
1364
1365 // select current Pos
1366 // horizontal
1367 if ( nH < 0 )
1368 {
1369 nH = m_nOldH;
1370 nHRel = m_nOldHRel;
1371 }
1372 sal_Int32 nMapPos = FillPosLB(m_pHMap, nH, nHRel, *m_xHorizontalDLB);
1373 FillRelLB(m_pHMap, nMapPos, nH, nHRel, *m_xHoriRelationLB, *m_xHoriRelationFT);
1374
1375 // vertical
1376 if ( nV < 0 )
1377 {
1378 nV = m_nOldV;
1379 nVRel = m_nOldVRel;
1380 }
1381 nMapPos = FillPosLB(m_pVMap, nV, nVRel, *m_xVerticalDLB);
1382 FillRelLB(m_pVMap, nMapPos, nV, nVRel, *m_xVertRelationLB, *m_xVertRelationFT);
1383
1384 bEnable = nH == text::HoriOrientation::NONE && eId != RndStdIds::FLY_AS_CHAR;
1385 if (!bEnable)
1386 m_xAtHorzPosED->set_value(0, FieldUnit::TWIP);
1387 else
1388 {
1389 if (nX != LONG_MAX)
1390 m_xAtHorzPosED->set_value(m_xAtHorzPosED->normalize(nX), FieldUnit::TWIP);
1391 }
1392 m_xAtHorzPosFT->set_sensitive( bEnable );
1393 m_xAtHorzPosED->set_sensitive( bEnable );
1394
1395 bEnable = nV == text::VertOrientation::NONE;
1396 if ( !bEnable )
1397 m_xAtVertPosED->set_value(0, FieldUnit::TWIP);
1398 else
1399 {
1400 if (eId == RndStdIds::FLY_AS_CHAR)
1401 {
1402 if ( nY == LONG_MAX )
1403 nY = 0;
1404 else
1405 nY *= -1;
1406 }
1407 if ( nY != LONG_MAX )
1408 m_xAtVertPosED->set_value(m_xAtVertPosED->normalize(nY), FieldUnit::TWIP);
1409 }
1410 m_xAtVertPosFT->set_sensitive( bEnable && m_bAllowVertPositioning );
1411 m_xAtVertPosED->set_sensitive( bEnable && m_bAllowVertPositioning );
1412 UpdateExample();
1413}
1414
1415sal_Int32 SwFramePage::FillPosLB(const FrameMap* _pMap,
1416 const sal_Int16 _nAlign,
1417 const sal_Int16 _nRel,
1418 weld::ComboBox& _rLB )
1419{
1420 OUString sSelEntry;
1421 const OUString sOldEntry = _rLB.get_active_text();
1422
1423 _rLB.clear();
1424
1425 // i#22341 determine all possible listbox relations for
1426 // given relation for map <aVCharMap>
1427 const LB nLBRelations = (_pMap != aVCharMap)
1428 ? LB::NONE
1430
1431 // fill Listbox
1432 size_t nCount = ::lcl_GetFrameMapCount(_pMap);
1433 for (size_t i = 0; _pMap && i < nCount; ++i)
1434 {
1435// Why not from the left/from inside or from above?
1436 SvxSwFramePosString::StringId eStrId = m_xMirrorPagesCB->get_active() ? _pMap[i].eMirrorStrId : _pMap[i].eStrId;
1437 // --> OD 2009-08-31 #mongolianlayout#
1438 eStrId = lcl_ChangeResIdToVerticalOrRTL( eStrId,
1442 OUString sEntry(SvxSwFramePosString::GetString(eStrId));
1443 if (_rLB.find_text(sEntry) == -1)
1444 {
1445 // don't insert entries when frames are character bound
1446 _rLB.append_text(sEntry);
1447 }
1448 // i#22341 - add condition to handle map <aVCharMap>
1449 // that is ambiguous in the alignment.
1450 if ( _pMap[i].nAlign == _nAlign &&
1451 ( (_pMap != aVCharMap) || _pMap[i].nLBRelations & nLBRelations ) )
1452 {
1453 sSelEntry = sEntry;
1454 }
1455 }
1456
1457 _rLB.set_active_text(sSelEntry);
1458 if (_rLB.get_active() == -1)
1459 _rLB.set_active_text(sOldEntry);
1460
1461 if (_rLB.get_active() == -1 && _rLB.get_count())
1462 _rLB.set_active(0);
1463
1464 PosHdl(_rLB);
1465
1466 return GetMapPos(_pMap, _rLB);
1467}
1468
1470 const sal_uInt16 _nLBSelPos,
1471 const sal_Int16 _nAlign,
1472 const sal_Int16 _nRel,
1473 weld::ComboBox& _rLB,
1474 weld::Label& _rFT)
1475{
1476 OUString sSelEntry;
1477 LB nLBRelations = LB::NONE;
1478 size_t nMapCount = ::lcl_GetFrameMapCount(_pMap);
1479
1480 _rLB.clear();
1481
1482 if (_nLBSelPos < nMapCount)
1483 {
1484 if (_pMap == aVAsCharHtmlMap || _pMap == aVAsCharMap)
1485 {
1486 const OUString sOldEntry(_rLB.get_active_text());
1487 SvxSwFramePosString::StringId eStrId = _pMap[_nLBSelPos].eStrId;
1488
1489 for (size_t nMapPos = 0; nMapPos < nMapCount; nMapPos++)
1490 {
1491 if (_pMap[nMapPos].eStrId == eStrId)
1492 {
1493 nLBRelations = _pMap[nMapPos].nLBRelations;
1494 for (RelationMap const & rCharMap : aAsCharRelationMap)
1495 {
1496 if (nLBRelations & rCharMap.nLBRelation)
1497 {
1498 // --> OD 2009-08-31 #mongolianlayout#
1500 lcl_ChangeResIdToVerticalOrRTL( rCharMap.eStrId,
1504 const OUString sEntry = SvxSwFramePosString::GetString(sStrId1);
1505 _rLB.append(weld::toId(&rCharMap), sEntry);
1506 if (_pMap[nMapPos].nAlign == _nAlign)
1507 sSelEntry = sEntry;
1508 break;
1509 }
1510 }
1511 }
1512 }
1513 if (!sSelEntry.isEmpty())
1514 _rLB.set_active_text(sSelEntry);
1515 else
1516 {
1517 _rLB.set_active_text(sOldEntry);
1518
1519 if (_rLB.get_active() == -1)
1520 {
1521 for (int i = 0; i < _rLB.get_count(); i++)
1522 {
1523 RelationMap *pEntry = weld::fromId<RelationMap*>(_rLB.get_id(i));
1524 if (pEntry->nLBRelation == LB::RelChar) // default
1525 {
1526 _rLB.set_active(i);
1527 break;
1528 }
1529 }
1530 }
1531 }
1532 }
1533 else
1534 {
1535 // special handling for map <aVCharMap>,
1536 // because its ambiguous in its <eStrId>/<eMirrorStrId>.
1537 if ( _pMap == aVCharMap )
1538 {
1539 nLBRelations = ::lcl_GetLBRelationsForStrID( _pMap,
1540 ( m_xMirrorPagesCB->get_active()
1541 ? _pMap[_nLBSelPos].eMirrorStrId
1542 : _pMap[_nLBSelPos].eStrId),
1543 m_xMirrorPagesCB->get_active() );
1544 }
1545 else
1546 {
1547 nLBRelations = _pMap[_nLBSelPos].nLBRelations;
1548 }
1549
1550 for (sal_uLong nBit = 1; nBit < 0x80000000; nBit <<= 1)
1551 {
1552 if (nLBRelations & static_cast<LB>(nBit))
1553 {
1554 for (RelationMap const & rMap : aRelationMap)
1555 {
1556 if (rMap.nLBRelation == static_cast<LB>(nBit))
1557 {
1558 SvxSwFramePosString::StringId eStrId1 = m_xMirrorPagesCB->get_active() ?
1559 rMap.eMirrorStrId : rMap.eStrId;
1560 // --> OD 2009-08-31 #mongolianlayout#
1561 eStrId1 =
1566 const OUString sEntry = SvxSwFramePosString::GetString(eStrId1);
1567 _rLB.append(weld::toId(&rMap), sEntry);
1568 if (sSelEntry.isEmpty() && rMap.nRelation == _nRel)
1569 sSelEntry = sEntry;
1570 }
1571 }
1572 }
1573 }
1574 if (!sSelEntry.isEmpty())
1575 _rLB.set_active_text(sSelEntry);
1576 else
1577 {
1578 // Probably anchor switch. So look for similar relation
1579 sal_Int16 nSimRel = -1;
1580 switch (_nRel)
1581 {
1582 case text::RelOrientation::FRAME:
1583 nSimRel = text::RelOrientation::PAGE_FRAME;
1584 break;
1585 case text::RelOrientation::PRINT_AREA:
1586 nSimRel = text::RelOrientation::PAGE_PRINT_AREA;
1587 break;
1588 case text::RelOrientation::PAGE_LEFT:
1589 nSimRel = text::RelOrientation::FRAME_LEFT;
1590 break;
1591 case text::RelOrientation::PAGE_RIGHT:
1592 nSimRel = text::RelOrientation::FRAME_RIGHT;
1593 break;
1594 case text::RelOrientation::FRAME_LEFT:
1595 nSimRel = text::RelOrientation::PAGE_LEFT;
1596 break;
1597 case text::RelOrientation::FRAME_RIGHT:
1598 nSimRel = text::RelOrientation::PAGE_RIGHT;
1599 break;
1600 case text::RelOrientation::PAGE_FRAME:
1601 nSimRel = text::RelOrientation::FRAME;
1602 break;
1603 case text::RelOrientation::PAGE_PRINT_AREA:
1604 nSimRel = text::RelOrientation::PRINT_AREA;
1605 break;
1606
1607 default:
1608 if (_rLB.get_active() != -1)
1609 {
1610 RelationMap *pEntry = weld::fromId<RelationMap*>(_rLB.get_id(_rLB.get_count() - 1));
1611 nSimRel = pEntry->nRelation;
1612 }
1613 break;
1614 }
1615
1616 for (int i = 0; i < _rLB.get_count(); i++)
1617 {
1618 RelationMap *pEntry = weld::fromId<RelationMap*>(_rLB.get_id(i));
1619 if (pEntry->nRelation == nSimRel)
1620 {
1621 _rLB.set_active(i);
1622 break;
1623 }
1624 }
1625
1626 if (_rLB.get_active() == -1)
1627 _rLB.set_active(0);
1628 }
1629 }
1630 }
1631
1632 const bool bEnable = _rLB.get_count() != 0
1633 && (&_rLB != m_xVertRelationLB.get() || m_bAllowVertPositioning);
1634 _rLB.set_sensitive( bEnable );
1635 _rFT.set_sensitive( bEnable );
1636
1637 RelHdl(_rLB);
1638}
1639
1640sal_Int16 SwFramePage::GetRelation(const weld::ComboBox& rRelationLB)
1641{
1642 const auto nPos = rRelationLB.get_active();
1643 if (nPos != -1)
1644 {
1645 RelationMap *pEntry = weld::fromId<RelationMap *>(rRelationLB.get_id(nPos));
1646 return pEntry->nRelation;
1647 }
1648
1649 return 0;
1650}
1651
1652sal_Int16 SwFramePage::GetAlignment(FrameMap const *pMap, sal_Int32 nMapPos,
1653 const weld::ComboBox& rRelationLB)
1654{
1655 if (!pMap || nMapPos < 0)
1656 return 0;
1657
1658 const size_t nMapCount = ::lcl_GetFrameMapCount(pMap);
1659
1660 if (o3tl::make_unsigned(nMapPos) >= nMapCount)
1661 return 0;
1662
1663 // i#22341 special handling also for map <aVCharMap>,
1664 // because it contains ambiguous items for alignment
1665 if ( pMap != aVAsCharHtmlMap && pMap != aVAsCharMap && pMap != aVCharMap )
1666 return pMap[nMapPos].nAlign;
1667
1668 if (rRelationLB.get_active() == -1)
1669 return 0;
1670
1671 const RelationMap *const pRelationMap = weld::fromId<const RelationMap*>(
1672 rRelationLB.get_active_id());
1673 const LB nRel = pRelationMap->nLBRelation;
1674 const SvxSwFramePosString::StringId eStrId = pMap[nMapPos].eStrId;
1675
1676 for (size_t i = 0; i < nMapCount; ++i)
1677 {
1678 if (pMap[i].eStrId == eStrId && (pMap[i].nLBRelations & nRel))
1679 return pMap[i].nAlign;
1680 }
1681
1682 return 0;
1683}
1684
1685sal_Int32 SwFramePage::GetMapPos(const FrameMap *pMap, const weld::ComboBox& rAlignLB)
1686{
1687 sal_Int32 nMapPos = 0;
1688 auto nLBSelPos = rAlignLB.get_active();
1689
1690 if (nLBSelPos != -1)
1691 {
1692 if (pMap == aVAsCharHtmlMap || pMap == aVAsCharMap)
1693 {
1694 const size_t nMapCount = ::lcl_GetFrameMapCount(pMap);
1695 const OUString sSelEntry(rAlignLB.get_active_text());
1696
1697 for (size_t i = 0; i < nMapCount; i++)
1698 {
1699 SvxSwFramePosString::StringId eResId = pMap[i].eStrId;
1700
1701 OUString sEntry = SvxSwFramePosString::GetString(eResId);
1703
1704 if (sEntry == sSelEntry)
1705 {
1706 nMapPos = static_cast< sal_Int32 >(i);
1707 break;
1708 }
1709 }
1710 }
1711 else
1712 nMapPos = nLBSelPos;
1713 }
1714
1715 return nMapPos;
1716}
1717
1719{
1720 RndStdIds nRet = RndStdIds::FLY_AT_PAGE;
1721 if (m_xAnchorAtParaRB->get_active())
1722 {
1723 nRet = RndStdIds::FLY_AT_PARA;
1724 }
1725 else if (m_xAnchorAtCharRB->get_active())
1726 {
1727 nRet = RndStdIds::FLY_AT_CHAR;
1728 }
1729 else if (m_xAnchorAsCharRB->get_active())
1730 {
1731 nRet = RndStdIds::FLY_AS_CHAR;
1732 }
1733 else if (m_xAnchorAtFrameRB->get_active())
1734 {
1735 nRet = RndStdIds::FLY_AT_FLY;
1736 }
1737 return nRet;
1738}
1739
1740// Bsp - Update
1742{
1743 m_bNoModifyHdl = true;
1744 Init(rSet);
1745 m_bNoModifyHdl = false;
1746 //lock PercentFields
1747 m_xWidthED->LockAutoCalculation(true);
1748 m_xHeightED->LockAutoCalculation(true);
1749 RangeModifyHdl(); // set all maximum values initially
1750 m_xHeightED->LockAutoCalculation(false);
1751 m_xWidthED->LockAutoCalculation(false);
1752 m_xFollowTextFlowCB->save_state();
1753 m_xFlySplitCB->save_state();
1754}
1755
1757{
1758 if ( _pSet )
1759 {
1760 FillItemSet( _pSet );
1761
1762 if (!m_bFormat) // tdf#112574 no anchor in styles
1763 {
1764 //FillItemSet doesn't set the anchor into the set when it matches
1765 //the original. But for the other pages we need the current anchor.
1768 if (pSh)
1769 {
1770 RndStdIds eAnchorId = GetAnchor();
1771 SwFormatAnchor aAnc( eAnchorId, eAnchorId == RndStdIds::FLY_AT_PAGE ? pSh->GetPhyPageNum() : 0 );
1772 _pSet->Put( aAnc );
1773 }
1774 }
1775 }
1776
1777 return DeactivateRC::LeavePage;
1778}
1779
1780// swap left/right with inside/outside
1782{
1783 RndStdIds eId = GetAnchor();
1784 InitPos(eId, -1, 0, -1, 0, LONG_MAX, LONG_MAX);
1785}
1786
1787IMPL_LINK( SwFramePage, RelSizeClickHdl, weld::Toggleable&, rBtn, void )
1788{
1789 if (&rBtn == m_xRelWidthCB.get())
1790 {
1791 m_xWidthED->ShowPercent(rBtn.get_active());
1792 m_xRelWidthRelationLB->set_sensitive(rBtn.get_active());
1793 if (rBtn.get_active())
1794 m_xWidthED->get()->set_max(MAX_PERCENT_WIDTH, FieldUnit::NONE);
1795 }
1796 else // rBtn == m_xRelHeightCB.get()
1797 {
1798 m_xHeightED->ShowPercent(rBtn.get_active());
1799 m_xRelHeightRelationLB->set_sensitive(rBtn.get_active());
1800 if (rBtn.get_active())
1801 m_xHeightED->get()->set_max(MAX_PERCENT_HEIGHT, FieldUnit::NONE);
1802 }
1803
1804 RangeModifyHdl(); // correct the values again
1805
1806 if (&rBtn == m_xRelWidthCB.get())
1807 ModifyHdl(*m_xWidthED->get());
1808 else // rBtn == m_xRelHeightCB.get()
1809 ModifyHdl(*m_xHeightED->get());
1810}
1811
1812// range check
1813IMPL_LINK_NOARG(SwFramePage, RangeModifyClickHdl, weld::Toggleable&, void)
1814{
1815 RangeModifyHdl();
1816}
1817
1819{
1820 if (m_bNoModifyHdl)
1821 return;
1822
1825 OSL_ENSURE(pSh , "shell not found");
1826 if (!pSh)
1827 return;
1828
1829 SwFlyFrameAttrMgr aMgr( m_bNew, pSh, GetItemSet() );
1831
1832 aVal.nAnchorType = GetAnchor();
1833 aVal.bAutoHeight = m_xAutoHeightCB->get_active();
1834 aVal.bMirror = m_xMirrorPagesCB->get_active();
1835 aVal.bFollowTextFlow = m_xFollowTextFlowCB->get_active();
1836
1837 if ( m_pHMap )
1838 {
1839 // alignment horizontal
1840 const sal_Int32 nMapPos = GetMapPos(m_pHMap, *m_xHorizontalDLB);
1843 }
1844 else
1846
1847 if ( m_pVMap )
1848 {
1849 // alignment vertical
1850 const sal_Int32 nMapPos = GetMapPos(m_pVMap, *m_xVerticalDLB);
1853 }
1854 else
1856
1857 const tools::Long nAtHorzPosVal = static_cast< tools::Long >(
1858 m_xAtHorzPosED->denormalize(m_xAtHorzPosED->get_value(FieldUnit::TWIP)) );
1859 const tools::Long nAtVertPosVal = static_cast< tools::Long >(
1860 m_xAtVertPosED->denormalize(m_xAtVertPosED->get_value(FieldUnit::TWIP)) );
1861
1862 aVal.nHPos = nAtHorzPosVal;
1863 aVal.nVPos = nAtVertPosVal;
1864
1865 aMgr.ValidateMetrics(aVal, mpToCharContentPos, true); // one time, to get reference values for percental values
1866
1867 // set reference values for percental values (100%) ...
1868 m_xWidthED->SetRefValue(aVal.aPercentSize.Width());
1869 m_xHeightED->SetRefValue(aVal.aPercentSize.Height());
1870
1871 // ... and correctly convert width and height with it
1872 SwTwips nWidth = static_cast< SwTwips >(m_xWidthED->DenormalizePercent(m_xWidthED->get_value(FieldUnit::TWIP)));
1873 SwTwips nHeight = static_cast< SwTwips >(m_xHeightED->DenormalizePercent(m_xHeightED->get_value(FieldUnit::TWIP)));
1874 aVal.nWidth = nWidth;
1875 aVal.nHeight = nHeight;
1876
1877 aMgr.ValidateMetrics(aVal, mpToCharContentPos); // one more time, to determine all remaining values with correct width and height.
1878
1879 // all columns have to be correct
1880 const SfxItemSet* pExampleSet = GetDialogExampleSet();
1881 if (pExampleSet && SfxItemState::DEFAULT <= pExampleSet->GetItemState(RES_COL))
1882 {
1883 const SwFormatCol& rCol = pExampleSet->Get(RES_COL);
1884 if ( rCol.GetColumns().size() > 1 )
1885 {
1886 for (const SwColumn & i : rCol.GetColumns())
1887 {
1888 aVal.nMinWidth += i.GetLeft() +
1889 i.GetRight() +
1890 MINFLY;
1891 }
1892 aVal.nMinWidth -= MINFLY;//one was already in there!
1893 }
1894 }
1895
1896 nWidth = aVal.nWidth;
1897 nHeight = aVal.nHeight;
1898
1899 // minimum range also for template
1900 m_xHeightED->set_min(m_xHeightED->NormalizePercent(aVal.nMinHeight), FieldUnit::TWIP);
1901 m_xWidthED->set_min(m_xWidthED->NormalizePercent(aVal.nMinWidth), FieldUnit::TWIP);
1902
1903 SwTwips nMaxWidth(aVal.nMaxWidth);
1904 SwTwips nMaxHeight(aVal.nMaxHeight);
1905
1906 if (aVal.bAutoHeight && (m_sDlgType == "PictureDialog" || m_sDlgType == "ObjectDialog"))
1907 {
1908 SwTwips nTmp = std::min(nWidth * nMaxHeight / std::max(nHeight, SwTwips(1)), nMaxHeight);
1909 m_xWidthED->set_max(m_xWidthED->NormalizePercent(nTmp), FieldUnit::TWIP);
1910
1911 nTmp = std::min(nHeight * nMaxWidth / std::max(nWidth, SwTwips(1)), nMaxWidth);
1912 m_xHeightED->set_max(m_xWidthED->NormalizePercent(nTmp), FieldUnit::TWIP);
1913 }
1914 else
1915 {
1916 SwTwips nTmp = static_cast< SwTwips >(m_xHeightED->NormalizePercent(nMaxHeight));
1917 m_xHeightED->set_max(nTmp, FieldUnit::TWIP);
1918
1919 nTmp = static_cast< SwTwips >(m_xWidthED->NormalizePercent(nMaxWidth));
1920 m_xWidthED->set_max(nTmp, FieldUnit::TWIP);
1921 }
1922
1923 m_xAtHorzPosED->set_range(m_xAtHorzPosED->normalize(aVal.nMinHPos),
1924 m_xAtHorzPosED->normalize(aVal.nMaxHPos),
1925 FieldUnit::TWIP);
1926 if (aVal.nHPos != nAtHorzPosVal)
1927 m_xAtHorzPosED->set_value(m_xAtHorzPosED->normalize(aVal.nHPos), FieldUnit::TWIP);
1928
1929 const SwTwips nUpperOffset = (aVal.nAnchorType == RndStdIds::FLY_AS_CHAR)
1930 ? m_nUpperBorder : 0;
1931 const SwTwips nLowerOffset = (aVal.nAnchorType == RndStdIds::FLY_AS_CHAR)
1932 ? m_nLowerBorder : 0;
1933
1934 m_xAtVertPosED->set_range(m_xAtVertPosED->normalize(aVal.nMinVPos + nLowerOffset + nUpperOffset),
1935 m_xAtVertPosED->normalize(aVal.nMaxVPos),
1936 FieldUnit::TWIP);
1937 if (aVal.nVPos != nAtVertPosVal)
1938 m_xAtVertPosED->set_value(m_xAtVertPosED->normalize(aVal.nVPos), FieldUnit::TWIP);
1939}
1940
1942{
1943 m_xMirrorPagesCB->set_sensitive(!m_xAnchorAsCharRB->get_active());
1944
1945 // i#18732 - enable check box 'Follow text flow' for anchor
1946 // type to-paragraph' and to-character
1947 // i#22305 - enable check box 'Follow text
1948 // flow' also for anchor type to-frame.
1949 m_xFollowTextFlowCB->set_sensitive(m_xAnchorAtParaRB->get_active() ||
1950 m_xAnchorAtCharRB->get_active() ||
1951 m_xAnchorAtFrameRB->get_active());
1952 m_xFlySplitCB->set_sensitive(m_xAnchorAtParaRB->get_active());
1953
1954 RndStdIds eId = GetAnchor();
1955
1956 InitPos( eId, -1, 0, -1, 0, LONG_MAX, LONG_MAX);
1957 RangeModifyHdl();
1958
1959 if(m_bHtmlMode)
1960 {
1961 PosHdl(*m_xHorizontalDLB);
1962 PosHdl(*m_xVerticalDLB);
1963 }
1964
1965 EnableVerticalPositioning( !(m_bIsMathOLE && m_bIsMathBaselineAlignment
1966 && RndStdIds::FLY_AS_CHAR == eId) );
1967}
1968
1969IMPL_LINK( SwFramePage, PosHdl, weld::ComboBox&, rLB, void )
1970{
1971 bool bHori = &rLB == m_xHorizontalDLB.get();
1972 weld::ComboBox *pRelLB = bHori ? m_xHoriRelationLB.get() : m_xVertRelationLB.get();
1973 weld::Label *pRelFT = bHori ? m_xHoriRelationFT.get() : m_xVertRelationFT.get();
1974 FrameMap const *pMap = bHori ? m_pHMap : m_pVMap;
1975
1976 const sal_Int32 nMapPos = GetMapPos(pMap, rLB);
1977 const sal_Int16 nAlign = GetAlignment(pMap, nMapPos, *pRelLB);
1978
1979 if (bHori)
1980 {
1981 bool bEnable = text::HoriOrientation::NONE == nAlign;
1982 m_xAtHorzPosED->set_sensitive( bEnable );
1983 m_xAtHorzPosFT->set_sensitive( bEnable );
1984 }
1985 else
1986 {
1987 bool bEnable = text::VertOrientation::NONE == nAlign && m_bAllowVertPositioning;
1988 m_xAtVertPosED->set_sensitive( bEnable );
1989 m_xAtVertPosFT->set_sensitive( bEnable );
1990 }
1991
1992 RangeModifyHdl();
1993
1994 sal_Int16 nRel = 0;
1995 if (rLB.get_active() != -1)
1996 {
1997 if (pRelLB->get_active() != -1)
1998 nRel = weld::fromId<RelationMap*>(pRelLB->get_active_id())->nRelation;
1999 FillRelLB(pMap, nMapPos, nAlign, nRel, *pRelLB, *pRelFT);
2000 }
2001 else
2002 pRelLB->clear();
2003
2004 UpdateExample();
2005
2006 if (bHori)
2007 m_bAtHorzPosModified = true;
2008 else
2009 m_bAtVertPosModified = true;
2010
2011 // special treatment for HTML-Mode with horizontal-vertical-dependencies
2012 if(!(m_bHtmlMode && (RndStdIds::FLY_AT_CHAR == GetAnchor())))
2013 return;
2014
2015 bool bSet = false;
2016 if(bHori)
2017 {
2018 // right is allowed only above - from the left only above
2019 // from the left at character -> below
2020 if((text::HoriOrientation::LEFT == nAlign || text::HoriOrientation::RIGHT == nAlign) &&
2021 0 == m_xVerticalDLB->get_active())
2022 {
2023 if(text::RelOrientation::FRAME == nRel)
2024 m_xVerticalDLB->set_active(1);
2025 else
2026 m_xVerticalDLB->set_active(0);
2027 bSet = true;
2028 }
2029 else if(text::HoriOrientation::LEFT == nAlign && 1 == m_xVerticalDLB->get_active())
2030 {
2031 m_xVerticalDLB->set_active(0);
2032 bSet = true;
2033 }
2034 else if(text::HoriOrientation::NONE == nAlign && 1 == m_xVerticalDLB->get_active())
2035 {
2036 m_xVerticalDLB->set_active(0);
2037 bSet = true;
2038 }
2039 if(bSet)
2040 PosHdl(*m_xVerticalDLB);
2041 }
2042 else
2043 {
2044 if(text::VertOrientation::TOP == nAlign)
2045 {
2046 if (1 == m_xHorizontalDLB->get_active())
2047 {
2048 m_xHorizontalDLB->set_active(0);
2049 bSet = true;
2050 }
2051 m_xHoriRelationLB->set_active(1);
2052 }
2053 else if(text::VertOrientation::CHAR_BOTTOM == nAlign)
2054 {
2055 if (2 == m_xHorizontalDLB->get_active())
2056 {
2057 m_xHorizontalDLB->set_active(0);
2058 bSet = true;
2059 }
2060 m_xHoriRelationLB->set_active(0) ;
2061 }
2062 if(bSet)
2063 PosHdl(*m_xHorizontalDLB);
2064 }
2065}
2066
2067// horizontal Pos
2068IMPL_LINK( SwFramePage, RelHdl, weld::ComboBox&, rLB, void )
2069{
2070 bool bHori = &rLB == m_xHoriRelationLB.get();
2071
2072 UpdateExample();
2073
2074 if (bHori)
2075 m_bAtHorzPosModified = true;
2076 else
2077 m_bAtVertPosModified = true;
2078
2079 if (m_bHtmlMode && (RndStdIds::FLY_AT_CHAR == GetAnchor()))
2080 {
2081 if(bHori)
2082 {
2083 const sal_Int16 nRel = GetRelation(*m_xHoriRelationLB);
2084 if(text::RelOrientation::PRINT_AREA == nRel && 0 == m_xVerticalDLB->get_active())
2085 {
2086 m_xVerticalDLB->set_active(1);
2087 }
2088 else if(text::RelOrientation::CHAR == nRel && 1 == m_xVerticalDLB->get_active())
2089 {
2090 m_xVerticalDLB->set_active(0);
2091 }
2092 }
2093 }
2094 RangeModifyHdl();
2095}
2096
2098{
2099 m_xWidthED->set_value(m_xWidthED->NormalizePercent(m_aGrfSize.Width()), FieldUnit::TWIP);
2100 m_xHeightED->set_value(m_xHeightED->NormalizePercent(m_aGrfSize.Height()), FieldUnit::TWIP);
2101 m_fWidthHeightRatio = m_aGrfSize.Height() ? double(m_aGrfSize.Width()) / double(m_aGrfSize.Height()) : 1.0;
2102 UpdateExample();
2103}
2104
2106{
2107 if( !IsInGraficMode() )
2108 HandleAutoCB( m_xAutoWidthCB->get_active(), *m_xWidthFT, *m_xWidthAutoFT, *m_xWidthED->get() );
2109}
2110
2112{
2113 if (!IsInGraficMode())
2114 HandleAutoCB(m_xAutoHeightCB->get_active(), *m_xHeightFT, *m_xHeightAutoFT, *m_xWidthED->get());
2115}
2116
2118{
2119 SwTwips nWidth = static_cast< SwTwips >(m_xWidthED->DenormalizePercent(m_xWidthED->get_value(FieldUnit::TWIP)));
2120 SwTwips nHeight = static_cast< SwTwips >(m_xHeightED->DenormalizePercent(m_xHeightED->get_value(FieldUnit::TWIP)));
2121 if (m_xFixedRatioCB->get_active())
2122 {
2123 if (&rEdit == m_xWidthED->get())
2124 {
2125 nHeight = SwTwips(static_cast<double>(nWidth) / m_fWidthHeightRatio);
2126 m_xHeightED->set_value(m_xHeightED->NormalizePercent(nHeight), FieldUnit::TWIP);
2127 }
2128 else if (&rEdit == m_xHeightED->get())
2129 {
2130 nWidth = SwTwips(static_cast<double>(nHeight) * m_fWidthHeightRatio);
2131 m_xWidthED->set_value(m_xWidthED->NormalizePercent(nWidth), FieldUnit::TWIP);
2132 }
2133 }
2134 m_fWidthHeightRatio = nHeight ? double(nWidth) / double(nHeight) : 1.0;
2135 UpdateExample();
2136}
2137
2139{
2140 auto nPos = m_xHorizontalDLB->get_active();
2141 if (m_pHMap && nPos != -1)
2142 {
2143 const sal_Int32 nMapPos = GetMapPos(m_pHMap, *m_xHorizontalDLB);
2146 }
2147
2148 nPos = m_xVerticalDLB->get_active();
2149 if (m_pVMap && nPos != -1)
2150 {
2151 const sal_Int32 nMapPos = GetMapPos(m_pVMap, *m_xVerticalDLB);
2154 }
2155
2156 // size
2157 auto nXPos = m_xAtHorzPosED->denormalize(m_xAtHorzPosED->get_value(FieldUnit::TWIP));
2158 auto nYPos = m_xAtVertPosED->denormalize(m_xAtVertPosED->get_value(FieldUnit::TWIP));
2159 m_aExampleWN.SetRelPos(Point(nXPos, nYPos));
2160
2162 m_aExampleWN.Invalidate();
2163}
2164
2166{
2167 if(!m_bFormat)
2168 {
2170
2171 // size
2172 const bool bSizeFixed = pSh->IsSelObjProtected( FlyProtectFlags::Fixed ) != FlyProtectFlags::NONE;
2173
2174 m_xWidthED->set_sensitive( !bSizeFixed );
2175 m_xHeightED->set_sensitive( !bSizeFixed );
2176
2177 // size controls for math OLE objects
2178 if ( m_sDlgType == "ObjectDialog" && ! m_bNew )
2179 {
2180 // disable width and height for math objects
2181 const SvGlobalName& rFactNm( pSh->GetOLEObject()->getClassID() );
2182
2183 static struct GlobalNameId {
2184 sal_uInt32 n1;
2185 sal_uInt16 n2, n3;
2186 sal_uInt8 b8, b9, b10, b11, b12, b13, b14, b15;
2187 } const aGlbNmIds[] = { { SO3_SM_CLASSID_60 }, { SO3_SM_CLASSID_50 },
2189
2190 for (const GlobalNameId & rId : aGlbNmIds) {
2191 SvGlobalName aGlbNm( rId.n1, rId.n2, rId.n3,
2192 rId.b8, rId.b9, rId.b10, rId.b11,
2193 rId.b12, rId.b13, rId.b14, rId.b15 );
2194
2195 if( rFactNm == aGlbNm )
2196 {
2197 // disable size controls for math OLE objects
2198 m_xWidthFT->set_sensitive(false);
2199 m_xWidthED->set_sensitive(false);
2200 m_xRelWidthCB->set_sensitive(false);
2201 m_xHeightFT->set_sensitive(false);
2202 m_xHeightED->set_sensitive(false);
2203 m_xRelHeightCB->set_sensitive(false);
2204 m_xFixedRatioCB->set_sensitive(false);
2205 m_xRealSizeBT->set_sensitive(false);
2206 break;
2207 }
2208 }
2209
2210 // TODO/LATER: get correct aspect
2211 if(0 != (pSh->GetOLEObject()->getStatus( embed::Aspects::MSOLE_CONTENT ) & embed::EmbedMisc::MS_EMBED_RECOMPOSEONRESIZE ) )
2212 m_xRealSizeBT->set_sensitive(false);
2213 }
2214 }
2215
2216 const SwFormatFrameSize& rSize = rSet.Get(RES_FRM_SIZE);
2217 sal_Int64 nWidth = m_xWidthED->NormalizePercent(rSize.GetWidth());
2218 sal_Int64 nHeight = m_xHeightED->NormalizePercent(rSize.GetHeight());
2219
2220 if (nWidth != m_xWidthED->get_value(FieldUnit::TWIP))
2221 m_xWidthED->set_value(nWidth, FieldUnit::TWIP);
2222
2223 if (nHeight != m_xHeightED->get_value(FieldUnit::TWIP))
2224 m_xHeightED->set_value(nHeight, FieldUnit::TWIP);
2225
2226 if (!IsInGraficMode())
2227 {
2228 SwFrameSize eSize = rSize.GetHeightSizeType();
2229 bool bCheck = eSize != SwFrameSize::Fixed;
2230 m_xAutoHeightCB->set_active(bCheck);
2231 HandleAutoCB( bCheck, *m_xHeightFT, *m_xHeightAutoFT, *m_xWidthED->get() );
2232 if( eSize == SwFrameSize::Variable )
2233 m_xHeightED->set_value(m_xHeightED->get_min());
2234
2235 eSize = rSize.GetWidthSizeType();
2236 bCheck = eSize != SwFrameSize::Fixed;
2237 m_xAutoWidthCB->set_active(bCheck);
2238 HandleAutoCB( bCheck, *m_xWidthFT, *m_xWidthAutoFT, *m_xWidthED->get() );
2239 if( eSize == SwFrameSize::Variable )
2240 m_xWidthED->set_value(m_xWidthED->get_min());
2241
2242 if ( !m_bFormat )
2243 {
2245 const SwFrameFormat* pFormat = pSh->GetFlyFrameFormat();
2246 if( pFormat && pFormat->GetChain().GetNext() )
2247 m_xAutoHeightCB->set_sensitive( false );
2248 }
2249 }
2250 else
2251 m_xAutoHeightCB->hide();
2252
2253 // organise circulation-gap for character bound frames
2254 const SvxULSpaceItem &rUL = rSet.Get(RES_UL_SPACE);
2255 m_nUpperBorder = rUL.GetUpper();
2256 m_nLowerBorder = rUL.GetLower();
2257
2258 if (SfxItemState::SET == rSet.GetItemState(FN_KEEP_ASPECT_RATIO))
2259 m_xFixedRatioCB->set_active(rSet.Get(FN_KEEP_ASPECT_RATIO).GetValue());
2260
2261 // columns
2262 SwFormatCol aCol( rSet.Get(RES_COL) );
2263 ::FitToActualSize( aCol, o3tl::narrowing<sal_uInt16>(rSize.GetWidth()) );
2264
2265 RndStdIds eAnchorId = GetAnchor();
2266
2267 if ( m_bNew && !m_bFormat )
2268 InitPos(eAnchorId, -1, 0, -1, 0, LONG_MAX, LONG_MAX);
2269 else
2270 {
2273 m_nOldH = rHori.GetHoriOrient();
2274 m_nOldHRel = rHori.GetRelationOrient();
2275 m_nOldV = rVert.GetVertOrient();
2276 m_nOldVRel = rVert.GetRelationOrient();
2277
2278 if (eAnchorId == RndStdIds::FLY_AT_PAGE)
2279 {
2280 if (m_nOldHRel == text::RelOrientation::FRAME)
2281 m_nOldHRel = text::RelOrientation::PAGE_FRAME;
2282 else if (m_nOldHRel == text::RelOrientation::PRINT_AREA)
2283 m_nOldHRel = text::RelOrientation::PAGE_PRINT_AREA;
2284 if (m_nOldVRel == text::RelOrientation::FRAME)
2285 m_nOldVRel = text::RelOrientation::PAGE_FRAME;
2286 else if (m_nOldVRel == text::RelOrientation::PRINT_AREA)
2287 m_nOldVRel = text::RelOrientation::PAGE_PRINT_AREA;
2288 }
2289
2290 m_xMirrorPagesCB->set_active(rHori.IsPosToggle());
2291 m_xMirrorPagesCB->save_state();
2292
2293 InitPos(eAnchorId,
2294 m_nOldH,
2295 m_nOldHRel,
2296 m_nOldV,
2297 m_nOldVRel,
2298 rHori.GetPos(),
2299 rVert.GetPos());
2300 }
2301
2302 // transparent for example
2303 // circulation for example
2304 const SwFormatSurround& rSurround = rSet.Get(RES_SURROUND);
2305 m_aExampleWN.SetWrap( rSurround.GetSurround() );
2306
2307 if ( rSurround.GetSurround() == css::text::WrapTextMode_THROUGH )
2308 {
2309 const SvxOpaqueItem& rOpaque = rSet.Get(RES_OPAQUE);
2310 m_aExampleWN.SetTransparent(!rOpaque.GetValue());
2311 }
2312
2313 // switch to percent if applicable
2314 RangeModifyHdl(); // set reference values (for 100%)
2315
2317 m_xFixedRatioCB->set_active(true);
2318 m_xFixedRatioCB->save_state();
2319 if (rSize.GetWidthPercent() && rSize.GetWidthPercent() != SwFormatFrameSize::SYNCED &&
2320 !m_xRelWidthCB->get_active())
2321 {
2322 m_xRelWidthCB->set_active(true);
2323 RelSizeClickHdl(*m_xRelWidthCB);
2324 m_xWidthED->set_value(rSize.GetWidthPercent(), FieldUnit::PERCENT);
2325 }
2327 !m_xRelHeightCB->get_active())
2328 {
2329 m_xRelHeightCB->set_active(true);
2330 RelSizeClickHdl(*m_xRelHeightCB);
2331 m_xHeightED->set_value(rSize.GetHeightPercent(), FieldUnit::PERCENT);
2332 }
2333 m_xRelWidthCB->save_state();
2334 m_xRelHeightCB->save_state();
2335
2336 if (rSize.GetWidthPercentRelation() == text::RelOrientation::PAGE_FRAME)
2337 m_xRelWidthRelationLB->set_active(1);
2338 else
2339 m_xRelWidthRelationLB->set_active(0);
2340
2341 if (rSize.GetHeightPercentRelation() == text::RelOrientation::PAGE_FRAME)
2342 m_xRelHeightRelationLB->set_active(1);
2343 else
2344 m_xRelHeightRelationLB->set_active(0);
2345}
2346
2347void SwFramePage::SetFormatUsed(bool bFormatUsed)
2348{
2349 m_bFormat = bFormatUsed;
2350 if (m_bFormat)
2351 m_xAnchorAtFrameRB->hide();
2352}
2353
2355{
2356 m_bAllowVertPositioning = bEnable;
2357 m_xVerticalFT->set_sensitive( bEnable );
2358 m_xVerticalDLB->set_sensitive( bEnable );
2359 m_xAtVertPosFT->set_sensitive( bEnable );
2360 m_xAtVertPosED->set_sensitive( bEnable );
2361 m_xVertRelationFT->set_sensitive( bEnable );
2362 m_xVertRelationLB->set_sensitive( bEnable );
2363}
2364
2366 : SfxTabPage(pPage, pController, "modules/swriter/ui/picturepage.ui", "PicturePage", &rSet)
2367 , m_bHtmlMode(false)
2368 , m_xMirror(m_xBuilder->weld_widget("flipframe"))
2369 , m_xMirrorVertBox(m_xBuilder->weld_check_button("vert"))
2370 , m_xMirrorHorzBox(m_xBuilder->weld_check_button("hori"))
2371 , m_xAllPagesRB(m_xBuilder->weld_radio_button("allpages"))
2372 , m_xLeftPagesRB(m_xBuilder->weld_radio_button("leftpages"))
2373 , m_xRightPagesRB(m_xBuilder->weld_radio_button("rightpages"))
2374 , m_xConnectED(m_xBuilder->weld_entry("entry"))
2375 , m_xBrowseBT(m_xBuilder->weld_button("browse"))
2376 , m_xLinkFrame(m_xBuilder->weld_frame("linkframe"))
2377 // RotGrfFlyFrame: Need Angle and RotateControls now
2378 , m_xFlAngle(m_xBuilder->weld_frame("FL_ANGLE"))
2379 , m_xNfAngle(m_xBuilder->weld_metric_spin_button("NF_ANGLE", FieldUnit::DEGREE))
2380 , m_xCtlAngle(new svx::DialControl)
2381 , m_xCtlAngleWin(new weld::CustomWeld(*m_xBuilder, "CTL_ANGLE", *m_xCtlAngle))
2382 , m_xBmpWin(new weld::CustomWeld(*m_xBuilder, "preview", m_aBmpWin))
2383 // tdf#138843 place holder for the graphic type
2384 , m_xLabelGraphicType(m_xBuilder->weld_label("label-graphic-type"))
2385{
2386 m_aBmpWin.SetBitmapEx(BitmapEx(RID_BMP_PREVIEW_FALLBACK));
2387
2388 m_xCtlAngle->SetLinkedField(m_xNfAngle.get(), 2);
2389
2391 m_xMirrorHorzBox->connect_toggled(LINK(this, SwGrfExtPage, MirrorHdl));
2392 m_xMirrorVertBox->connect_toggled(LINK(this, SwGrfExtPage, MirrorHdl));
2393 m_xBrowseBT->connect_clicked(LINK(this, SwGrfExtPage, BrowseHdl));
2394}
2395
2397{
2398 m_xBmpWin.reset();
2399 m_xCtlAngleWin.reset();
2400 m_xCtlAngle.reset();
2401 m_xGrfDlg.reset();
2402}
2403
2404std::unique_ptr<SfxTabPage> SwGrfExtPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet *rSet)
2405{
2406 return std::make_unique<SwGrfExtPage>(pPage, pController, *rSet);
2407}
2408
2410{
2411 const sal_uInt16 nHtmlMode = ::GetHtmlMode(static_cast<const SwDocShell*>(SfxObjectShell::Current()));
2412 m_bHtmlMode = (nHtmlMode & HTMLMODE_ON) != 0;
2413
2414 const SfxBoolItem* pConnectItem = rSet->GetItemIfSet( FN_PARAM_GRF_CONNECT );
2415 if( pConnectItem && pConnectItem->GetValue() )
2416 {
2417 m_xBrowseBT->set_sensitive(true);
2418 m_xConnectED->set_editable(true);
2419 }
2420
2421 // RotGrfFlyFrame: Get RotationAngle and set at control
2422 if(const SdrAngleItem* pAngleItem = rSet->GetItemIfSet( SID_ATTR_TRANSFORM_ANGLE, false))
2423 {
2424 m_xCtlAngle->SetRotation(pAngleItem->GetValue());
2425 }
2426 else
2427 {
2428 m_xCtlAngle->SetRotation(0_deg100);
2429 }
2430 m_xCtlAngle->SaveValue();
2431
2433}
2434
2436{
2437 const SvxProtectItem& rProt = rSet.Get(RES_PROTECT);
2438 bool bProtContent = rProt.IsContentProtected();
2439
2440 const SfxPoolItem* pItem = nullptr;
2441 bool bEnable = false;
2442 bool bEnableMirrorRB = false;
2443
2444 SfxItemState eState = rSet.GetItemState(RES_GRFATR_MIRRORGRF, true, &pItem);
2445 if (SfxItemState::UNKNOWN != eState && !bProtContent && !m_bHtmlMode)
2446 {
2447 if( SfxItemState::SET != eState )
2448 pItem = &rSet.Get( RES_GRFATR_MIRRORGRF );
2449
2450 bEnable = true;
2451
2452 MirrorGraph eMirror = static_cast<const SwMirrorGrf* >(pItem)->GetValue();
2453 switch( eMirror )
2454 {
2455 case MirrorGraph::Dont: break;
2456 case MirrorGraph::Vertical: m_xMirrorHorzBox->set_active(true); break;
2457 case MirrorGraph::Horizontal: m_xMirrorVertBox->set_active(true); break;
2458 case MirrorGraph::Both: m_xMirrorHorzBox->set_active(true);
2459 m_xMirrorVertBox->set_active(true);
2460 break;
2461 default:
2462 ;
2463 }
2464
2465 const int nPos = (static_cast<const SwMirrorGrf* >(pItem)->IsGrfToggle() ? 1 : 0)
2466 + ((eMirror == MirrorGraph::Vertical || eMirror == MirrorGraph::Both) ? 2 : 0);
2467
2468 bEnableMirrorRB = nPos != 0;
2469
2470 switch (nPos)
2471 {
2472 case 1: // mirror at left / even pages
2473 m_xLeftPagesRB->set_active(true);
2474 m_xMirrorHorzBox->set_active(true);
2475 break;
2476 case 2: // mirror on all pages
2477 m_xAllPagesRB->set_active(true);
2478 break;
2479 case 3: // mirror on right / odd pages
2480 m_xRightPagesRB->set_active(true);
2481 break;
2482 default:
2483 m_xAllPagesRB->set_active(true);
2484 break;
2485 }
2486 }
2487
2488 if( const SvxBrushItem* pGraphicBrushItem = rSet.GetItemIfSet( SID_ATTR_GRAF_GRAPHIC, false ) )
2489 {
2490 if( !pGraphicBrushItem->GetGraphicLink().isEmpty() )
2491 {
2492 m_aGrfName = m_aNewGrfName = pGraphicBrushItem->GetGraphicLink();
2493 m_xConnectED->set_text(m_aNewGrfName);
2494 }
2495 OUString referer;
2496 SfxStringItem const * it = 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_xDescriptionFT(m_xBuilder->weld_label("description_label"))
2864 , m_xDescriptionED(m_xBuilder->weld_text_view("description"))
2865 , m_xDecorativeCB(m_xBuilder->weld_check_button("decorative"))
2866 , m_xSequenceFrame(m_xBuilder->weld_widget("frmSequence"))
2867 , m_xPrevLB(m_xBuilder->weld_combo_box("prev"))
2868 , m_xNextLB(m_xBuilder->weld_combo_box("next"))
2869 , m_xProtectFrame(m_xBuilder->weld_widget("protect"))
2870 , m_xProtectContentCB(m_xBuilder->weld_check_button("protectcontent"))
2871 , m_xProtectFrameCB(m_xBuilder->weld_check_button("protectframe"))
2872 , m_xProtectSizeCB(m_xBuilder->weld_check_button("protectsize"))
2873 , m_xContentAlignFrame(m_xBuilder->weld_widget("contentalign"))
2874 , m_xVertAlignLB(m_xBuilder->weld_combo_box("vertalign"))
2875 , m_xPropertiesFrame(m_xBuilder->weld_widget("properties"))
2876 , m_xEditInReadonlyCB(m_xBuilder->weld_check_button("editinreadonly"))
2877 , m_xPrintFrameCB(m_xBuilder->weld_check_button("printframe"))
2878 , m_xTextFlowFT(m_xBuilder->weld_label("textflow_label"))
2879 , m_xTextFlowLB(new svx::FrameDirectionListBox(m_xBuilder->weld_combo_box("textflow")))
2880{
2881 m_xTextFlowLB->append(SvxFrameDirection::Horizontal_LR_TB, SvxResId(RID_SVXSTR_FRAMEDIR_LTR));
2882 m_xTextFlowLB->append(SvxFrameDirection::Horizontal_RL_TB, SvxResId(RID_SVXSTR_FRAMEDIR_RTL));
2883 m_xTextFlowLB->append(SvxFrameDirection::Vertical_RL_TB, SvxResId(RID_SVXSTR_PAGEDIR_RTL_VERT));
2884 m_xTextFlowLB->append(SvxFrameDirection::Vertical_LR_TB, SvxResId(RID_SVXSTR_PAGEDIR_LTR_VERT));
2885 m_xTextFlowLB->append(SvxFrameDirection::Vertical_LR_BT, SvxResId(RID_SVXSTR_PAGEDIR_LTR_BTT_VERT));
2886 m_xTextFlowLB->append(SvxFrameDirection::Environment, SvxResId(RID_SVXSTR_FRAMEDIR_SUPER));
2887 m_xDescriptionED->set_size_request(-1, m_xDescriptionED->get_preferred_size().Height());
2888
2889 m_xDecorativeCB->connect_toggled(LINK(this, SwFrameAddPage, DecorativeHdl));
2890}
2891
2893{
2894 m_xTextFlowLB.reset();
2895}
2896
2897std::unique_ptr<SfxTabPage> SwFrameAddPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet *rSet)
2898{
2899 return std::make_unique<SwFrameAddPage>(pPage, pController, *rSet);
2900}
2901
2903{
2904 sal_uInt16 nHtmlMode = ::GetHtmlMode(static_cast<const SwDocShell*>(SfxObjectShell::Current()));
2905 m_bHtmlMode = (nHtmlMode & HTMLMODE_ON) != 0;
2906 if (m_bHtmlMode)
2907 {
2908 m_xProtectFrame->hide();
2909 m_xEditInReadonlyCB->hide();
2910 m_xPrintFrameCB->hide();
2911 }
2912 if (m_sDlgType == "PictureDialog" || m_sDlgType == "ObjectDialog")
2913 {
2914 m_xSequenceFrame->hide();
2915 m_xEditInReadonlyCB->hide();
2916 if (m_bHtmlMode)
2917 {
2918 m_xPropertiesFrame->hide();
2919 }
2920 m_xContentAlignFrame->hide();
2921 }
2922
2923 if(const SfxStringItem* pNameItem = rSet->GetItemIfSet(FN_SET_FRM_ALT_NAME, false))
2924 {
2925 m_xAltNameED->set_text(pNameItem->GetValue());
2926 m_xAltNameED->save_value();
2927 }
2928
2929 if(const SfxStringItem* pDescriptionItem = rSet->GetItemIfSet(FN_UNO_DESCRIPTION, false))
2930 {
2931 m_xDescriptionED->set_text(pDescriptionItem->GetValue());
2932 m_xDescriptionED->save_value();
2933 }
2934
2935 if(!m_bFormat)
2936 {
2937 // insert graphic - properties
2938 // bNew is not set, so recognise by selection
2939 OUString aTmpName1;
2940 if(const SfxStringItem* pNameItem = rSet->GetItemIfSet(FN_SET_FRM_NAME, false))
2941 {
2942 aTmpName1 = pNameItem->GetValue();
2943 }
2944
2945 OSL_ENSURE(m_pWrtSh, "no Shell?");
2946 if( m_bNew || aTmpName1.isEmpty() )
2947 {
2948 if (m_sDlgType == "PictureDialog")
2949 aTmpName1 = m_pWrtSh->GetUniqueGrfName();
2950 else if (m_sDlgType == "ObjectDialog")
2951 aTmpName1 = m_pWrtSh->GetUniqueOLEName();
2952 else
2953 aTmpName1 = m_pWrtSh->GetUniqueFrameName();
2954
2955 m_pWrtSh->SetFlyName(aTmpName1);
2956 }
2957
2958 m_xNameED->set_text( aTmpName1 );
2959 m_xNameED->save_value();
2960 }
2961 else
2962 {
2963 m_xNameED->set_sensitive( false );
2964 m_xAltNameED->set_sensitive(false);
2965 m_xNameFT->set_sensitive( false );
2966 m_xAltNameFT->set_sensitive(false);
2967 }
2968 if (m_sDlgType == "FrameDialog" && m_xAltNameFT->get_visible())
2969 {
2970 m_xAltNameFT->hide();
2971 m_xAltNameED->hide();
2972 }
2973 else
2974 {
2975 m_xNameED->connect_changed(LINK(this, SwFrameAddPage, EditModifyHdl));
2976 }
2977
2978 if (!m_bNew)
2979 {
2981
2982 if (pFormat)
2983 {
2984 const SwFormatChain &rChain = pFormat->GetChain();
2985 const SwFlyFrameFormat* pFlyFormat;
2986 OUString sNextChain, sPrevChain;
2987 pFlyFormat = rChain.GetPrev();
2988 if (pFlyFormat != nullptr)
2989 {
2990 sPrevChain = pFlyFormat->GetName();
2991 }
2992
2993 pFlyFormat = rChain.GetNext();
2994 if (pFlyFormat != nullptr)
2995 {
2996 sNextChain = pFlyFormat->GetName();
2997 }
2998 //determine chainable frames
2999 std::vector< OUString > aPrevPageFrames;
3000 std::vector< OUString > aThisPageFrames;
3001 std::vector< OUString > aNextPageFrames;
3002 std::vector< OUString > aRemainFrames;
3003 m_pWrtSh->GetConnectableFrameFormats(*pFormat, sNextChain, false,
3004 aPrevPageFrames, aThisPageFrames, aNextPageFrames, aRemainFrames );
3005 for (sal_Int32 nEntry = m_xPrevLB->get_count(); nEntry > 1; nEntry--)
3006 m_xPrevLB->remove(nEntry - 1);
3007 lcl_InsertVectors(*m_xPrevLB, aPrevPageFrames, aThisPageFrames, aNextPageFrames, aRemainFrames);
3008 if(!sPrevChain.isEmpty())
3009 {
3010 if (m_xPrevLB->find_text(sPrevChain) == -1)
3011 m_xPrevLB->insert_text(1, sPrevChain);
3012 m_xPrevLB->set_active_text(sPrevChain);
3013 }
3014 else
3015 m_xPrevLB->set_active(0);
3016 aPrevPageFrames.clear();
3017 aNextPageFrames.clear();
3018 aThisPageFrames.clear();
3019 aRemainFrames.clear();
3020
3021 m_pWrtSh->GetConnectableFrameFormats(*pFormat, sPrevChain, true,
3022 aPrevPageFrames, aThisPageFrames, aNextPageFrames, aRemainFrames );
3023 for (sal_Int32 nEntry = m_xNextLB->get_count(); nEntry > 1; nEntry--)
3024 m_xNextLB->remove(nEntry - 1);
3025 lcl_InsertVectors(*m_xNextLB, aPrevPageFrames, aThisPageFrames, aNextPageFrames, aRemainFrames);
3026 if(!sNextChain.isEmpty())
3027 {
3028 if (m_xNextLB->find_text(sNextChain) == -1)
3029 m_xNextLB->insert_text(1, sNextChain);
3030 m_xNextLB->set_active_text(sNextChain);
3031 }
3032 else
3033 m_xNextLB->set_active(0);
3034 Link<weld::ComboBox&,void> aLink(LINK(this, SwFrameAddPage, ChainModifyHdl));
3035 m_xPrevLB->connect_changed(aLink);
3036 m_xNextLB->connect_changed(aLink);
3037 }
3038 }
3039 // Pos Protected
3040 const SvxProtectItem& rProt = rSet->Get(RES_PROTECT);
3041 m_xProtectFrameCB->set_active(rProt.IsPosProtected());
3042 m_xProtectContentCB->set_active(rProt.IsContentProtected());
3043 m_xProtectSizeCB->set_active(rProt.IsSizeProtected());
3044
3046 m_xEditInReadonlyCB->set_active(rEdit.GetValue());
3047 m_xEditInReadonlyCB->save_state();
3048
3049 // print
3050 const SvxPrintItem& rPrt = rSet->Get(RES_PRINT);
3051 m_xPrintFrameCB->set_active(rPrt.GetValue());
3052 m_xPrintFrameCB->save_state();
3053
3054 SfxBoolItem const& rDecorative = rSet->Get(RES_DECORATIVE);
3055 m_xDecorativeCB->set_active(rDecorative.GetValue());
3056 m_xDecorativeCB->save_state();
3057
3058 // textflow
3059 if( (!m_bHtmlMode || (0 != (nHtmlMode&HTMLMODE_SOME_STYLES)))
3060 && m_sDlgType != "PictureDialog" && m_sDlgType != "ObjectDialog"
3061 && SfxItemState::UNKNOWN != rSet->GetItemState( RES_FRAMEDIR ) )
3062 {
3063 m_xTextFlowFT->show();
3064 m_xTextFlowLB->show();
3065
3066 //vertical text flow is not possible in HTML
3067 if(m_bHtmlMode)
3068 {
3069 m_xTextFlowLB->remove_id(SvxFrameDirection::Vertical_RL_TB);
3070 }
3071 SvxFrameDirection nVal = rSet->Get(RES_FRAMEDIR).GetValue();
3072 m_xTextFlowLB->set_active_id(nVal);
3073 m_xTextFlowLB->save_value();
3074 }
3075 else
3076 {
3077 m_xTextFlowFT->hide();
3078 m_xTextFlowLB->hide();
3079 }
3080
3081 // Content alignment
3082 if ( rSet->GetItemState(RES_TEXT_VERT_ADJUST) > SfxItemState::DEFAULT )
3083 {
3085 sal_Int32 nPos = 0;
3086 switch(nAdjust)
3087 {
3088 case SDRTEXTVERTADJUST_TOP: nPos = 0; break;
3090 case SDRTEXTVERTADJUST_BLOCK: nPos = 1; break;
3091 case SDRTEXTVERTADJUST_BOTTOM: nPos = 2; break;
3092 }
3093 m_xVertAlignLB->set_active(nPos);
3094 }
3095 m_xVertAlignLB->save_value();
3096
3097 DecorativeHdl(*m_xDecorativeCB);
3098}
3099
3101{
3102 bool bRet = false;
3103 if (m_xNameED->get_value_changed_from_saved())
3104 bRet |= nullptr != rSet->Put(SfxStringItem(FN_SET_FRM_NAME, m_xNameED->get_text()));
3105 if (m_xAltNameED->get_value_changed_from_saved())
3106 bRet |= nullptr != rSet->Put(SfxStringItem(FN_SET_FRM_ALT_NAME, m_xAltNameED->get_text()));
3107 if (m_xDescriptionED->get_value_changed_from_saved())
3108 bRet |= nullptr != rSet->Put(SfxStringItem(FN_UNO_DESCRIPTION, m_xDescriptionED->get_text()));
3109
3110 const SfxPoolItem* pOldItem;
3112 aProt.SetContentProtect( m_xProtectContentCB->get_active() );
3113 aProt.SetSizeProtect ( m_xProtectSizeCB->get_active() );
3114 aProt.SetPosProtect ( m_xProtectFrameCB->get_active() );
3115 if ( nullptr == (pOldItem = GetOldItem(*rSet, FN_SET_PROTECT)) ||
3116 aProt != *pOldItem )
3117 bRet |= nullptr != rSet->Put( aProt);
3118
3119 if ( m_xEditInReadonlyCB->get_state_changed_from_saved() )
3120 bRet |= nullptr != rSet->Put( SwFormatEditInReadonly( RES_EDIT_IN_READONLY, m_xEditInReadonlyCB->get_active()));
3121
3122 if ( m_xPrintFrameCB->get_state_changed_from_saved() )
3123 bRet |= nullptr != rSet->Put( SvxPrintItem( RES_PRINT, m_xPrintFrameCB->get_active()));
3124
3125 if (m_xDecorativeCB->get_state_changed_from_saved())
3126 {
3127 bRet |= nullptr != rSet->Put(SfxBoolItem(RES_DECORATIVE, m_xDecorativeCB->get_active()));
3128 }
3129
3130 // textflow
3131 if (m_xTextFlowLB->get_visible() && m_xTextFlowLB->get_value_changed_from_saved())
3132 {
3133 SvxFrameDirection eDirection = m_xTextFlowLB->get_active_id();
3134 bRet |= nullptr != rSet->Put( SvxFrameDirectionItem(eDirection, RES_FRAMEDIR ));
3135 }
3136 if(m_pWrtSh)
3137 {
3138 const SwFrameFormat* pFormat = m_pWrtSh->GetFlyFrameFormat();
3139 if (pFormat)
3140 {
3141 OUString sCurrentPrevChain, sCurrentNextChain;
3142 if (m_xPrevLB->get_active())
3143 sCurrentPrevChain = m_xPrevLB->get_active_text();
3144 if (m_xNextLB->get_active())
3145 sCurrentNextChain = m_xNextLB->get_active_text();
3146 const SwFormatChain &rChain = pFormat->GetChain();
3147 const SwFlyFrameFormat* pFlyFormat;
3148 OUString sNextChain, sPrevChain;
3149 pFlyFormat = rChain.GetPrev();
3150 if (pFlyFormat != nullptr)
3151 sPrevChain = pFlyFormat->GetName();
3152
3153 pFlyFormat = rChain.GetNext();
3154 if (pFlyFormat != nullptr)
3155 sNextChain = pFlyFormat->GetName();
3156 if(sPrevChain != sCurrentPrevChain)
3157 bRet |= nullptr != rSet->Put(SfxStringItem(FN_PARAM_CHAIN_PREVIOUS, sCurrentPrevChain));
3158 if(sNextChain != sCurrentNextChain)
3159 bRet |= nullptr != rSet->Put(SfxStringItem(FN_PARAM_CHAIN_NEXT, sCurrentNextChain));
3160 }
3161 }
3162
3163 if (m_xVertAlignLB->get_value_changed_from_saved())
3164 {
3166 switch (m_xVertAlignLB->get_active())
3167 {
3168 default:
3169 case 0 : nAdjust = SDRTEXTVERTADJUST_TOP; break;
3170 case 1 : nAdjust = SDRTEXTVERTADJUST_CENTER; break;
3171 case 2 : nAdjust = SDRTEXTVERTADJUST_BOTTOM; break;
3172 }
3174 }
3175
3176 return bRet;
3177}
3178
3180{
3181 bool bEnable = !m_xNameED->get_text().isEmpty();
3182 m_xAltNameED->set_sensitive(bEnable);
3183 m_xAltNameFT->set_sensitive(bEnable);
3184}
3185
3187{
3188 bool const bEnable(!m_xDecorativeCB->get_active());
3189 m_xAltNameED->set_sensitive(bEnable);
3190 m_xAltNameFT->set_sensitive(bEnable);
3191 m_xDescriptionED->set_sensitive(bEnable);
3192 m_xDescriptionFT->set_sensitive(bEnable);
3193}
3194
3195void SwFrameAddPage::SetFormatUsed(bool bFormatUsed)
3196{
3197 m_bFormat = bFormatUsed;
3198 if (m_bFormat)
3199 {
3200 m_xNameFrame->hide();
3201 }
3202}
3203
3204IMPL_LINK(SwFrameAddPage, ChainModifyHdl, weld::ComboBox&, rBox, void)
3205{
3206 OUString sCurrentPrevChain, sCurrentNextChain;
3207 if (m_xPrevLB->get_active())
3208 sCurrentPrevChain = m_xPrevLB->get_active_text();
3209 if (m_xNextLB->get_active())
3210 sCurrentNextChain = m_xNextLB->get_active_text();
3211 SwFrameFormat* pFormat = m_pWrtSh->GetFlyFrameFormat();
3212 if (!pFormat)
3213 return;
3214
3215 bool bNextBox = m_xNextLB.get() == &rBox;
3216 weld::ComboBox& rChangeLB = bNextBox ? *m_xPrevLB : *m_xNextLB;
3217 for (sal_Int32 nEntry = rChangeLB.get_count(); nEntry > 1; nEntry--)
3218 rChangeLB.remove(nEntry - 1);
3219 //determine chainable frames
3220 std::vector< OUString > aPrevPageFrames;
3221 std::vector< OUString > aThisPageFrames;
3222 std::vector< OUString > aNextPageFrames;
3223 std::vector< OUString > aRemainFrames;
3224 m_pWrtSh->GetConnectableFrameFormats(*pFormat, bNextBox ? sCurrentNextChain : sCurrentPrevChain, !bNextBox,
3225 aPrevPageFrames, aThisPageFrames, aNextPageFrames, aRemainFrames );
3226 lcl_InsertVectors(rChangeLB,
3227 aPrevPageFrames, aThisPageFrames, aNextPageFrames, aRemainFrames);
3228 const OUString sToSelect = bNextBox ? sCurrentPrevChain : sCurrentNextChain;
3229 if (rChangeLB.find_text(sToSelect) != -1)
3230 rChangeLB.set_active_text(sToSelect);
3231 else
3232 rChangeLB.set_active(0);
3233
3234}
3235
3236/* 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()
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
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:2581
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:1614
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
SfxPoolItem subclass that wraps a URL.
Definition: fmturl.hxx:33
virtual SwFormatURL * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:1869
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:294
std::unique_ptr< svx::FrameDirectionListBox > m_xTextFlowLB
Definition: frmpage.hxx:303
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: frmpage.cxx:2897
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: frmpage.cxx:3100
std::unique_ptr< weld::ComboBox > m_xNextLB
Definition: frmpage.hxx:289
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:296
std::unique_ptr< weld::CheckButton > m_xProtectFrameCB
Definition: frmpage.hxx:293
SwWrtShell * m_pWrtSh
Definition: frmpage.hxx:272
virtual void Reset(const SfxItemSet *rSet) override
Definition: frmpage.cxx:2902
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:300
std::unique_ptr< weld::ComboBox > m_xPrevLB
Definition: frmpage.hxx:288
static const WhichRangesContainer s_aAddPgRg
Definition: frmpage.hxx:309
std::unique_ptr< weld::Label > m_xTextFlowFT
Definition: frmpage.hxx:302
std::unique_ptr< weld::ComboBox > m_xVertAlignLB
Definition: frmpage.hxx:297
std::unique_ptr< weld::TextView > m_xDescriptionED
Definition: frmpage.hxx:285
virtual ~SwFrameAddPage() override
Definition: frmpage.cxx:2892
std::unique_ptr< weld::CheckButton > m_xProtectContentCB
Definition: frmpage.hxx:292
std::unique_ptr< weld::Widget > m_xPropertiesFrame
Definition: frmpage.hxx:299
std::unique_ptr< weld::Widget > m_xProtectFrame
Definition: frmpage.hxx:291
std::unique_ptr< weld::CheckButton > m_xPrintFrameCB
Definition: frmpage.hxx:301
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:3195
std::unique_ptr< weld::CheckButton > m_xDecorativeCB
Definition: frmpage.hxx:286
std::unique_ptr< weld::Widget > m_xSequenceFrame
Definition: frmpage.hxx:287
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:72
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:1718
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:1652
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:1741
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:1415
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:1640
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:2354
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:1685
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:1469
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:2347
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:1084
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:1756
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:2138
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:1289
void RangeModifyHdl()
Definition: frmpage.cxx:1818
void Init(const SfxItemSet &rSet)
Definition: frmpage.cxx:2165
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:2396
OUString m_aFilterName
Definition: frmpage.hxx:200
SwGrfExtPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: frmpage.cxx:2365
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:2409
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:2404
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:2435
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:695
SwDocShell * GetDocShell()
Definition: view.cxx:1193
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
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
void append(const weld::ComboBoxEntry &rItem)
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:891
#define FN_HORI_ORIENT
Definition: cmdid.h:887
#define FN_SET_FRM_NAME
Definition: cmdid.h:888
#define FN_PARAM_CHAIN_PREVIOUS
Definition: cmdid.h:851
#define FN_PARAM_GRF_CONNECT
Definition: cmdid.h:821
#define FN_OLE_IS_MATH
Definition: cmdid.h:653
#define FN_KEEP_ASPECT_RATIO
Definition: cmdid.h:889
#define FN_MATH_BASELINE_ALIGNMENT
Definition: cmdid.h:654
#define FN_SET_PROTECT
Definition: cmdid.h:884
#define FN_VERT_ORIENT
Definition: cmdid.h:886
#define FN_PARAM_CHAIN_NEXT
Definition: cmdid.h:852
#define FN_UNO_DESCRIPTION
Definition: cmdid.h:893
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:1781
#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:1787
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:768
SW_DLLPUBLIC FieldUnit GetDfltMetric(bool bWeb)
Definition: uitool.cxx:756
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
Definition: viewopt.cxx:415