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