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