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(pParent, "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  disposeOnce();
721 }
722 
723 namespace
724 {
725  struct FrameMaps
726  {
727  FrameMap const * pMap;
728  size_t nCount;
729  };
730 }
731 
733 {
734  static FrameMaps const aMaps[] = {
735  { aHPageMap, SAL_N_ELEMENTS(aHPageMap) },
736  { aHPageHtmlMap, SAL_N_ELEMENTS(aHPageHtmlMap) },
737  { aVPageMap, SAL_N_ELEMENTS(aVPageMap) },
738  { aVPageHtmlMap, SAL_N_ELEMENTS(aVPageHtmlMap) },
739  { aHFrameMap, SAL_N_ELEMENTS(aHFrameMap) },
740  { aHFlyHtmlMap, SAL_N_ELEMENTS(aHFlyHtmlMap) },
741  { aVFrameMap, SAL_N_ELEMENTS(aVFrameMap) },
742  { aVFlyHtmlMap, SAL_N_ELEMENTS(aVFlyHtmlMap) },
743  { aHParaMap, SAL_N_ELEMENTS(aHParaMap) },
744  { aHParaHtmlMap, SAL_N_ELEMENTS(aHParaHtmlMap) },
745  { aHParaHtmlAbsMap, SAL_N_ELEMENTS(aHParaHtmlAbsMap) },
746  { aVParaMap, SAL_N_ELEMENTS(aVParaMap) },
747  { aVParaHtmlMap, SAL_N_ELEMENTS(aVParaHtmlMap) },
748  { aHCharMap, SAL_N_ELEMENTS(aHCharMap) },
749  { aHCharHtmlMap, SAL_N_ELEMENTS(aHCharHtmlMap) },
750  { aHCharHtmlAbsMap, SAL_N_ELEMENTS(aHCharHtmlAbsMap) },
751  { aVCharMap, SAL_N_ELEMENTS(aVCharMap) },
752  { aVCharHtmlMap, SAL_N_ELEMENTS(aVCharHtmlMap) },
753  { aVCharHtmlAbsMap, SAL_N_ELEMENTS(aVCharHtmlAbsMap) },
754  { aVAsCharMap, SAL_N_ELEMENTS(aVAsCharMap) },
755  { aVAsCharHtmlMap, SAL_N_ELEMENTS(aVAsCharHtmlMap) }
756  };
757 
758  std::vector<SvxSwFramePosString::StringId> aFrames;
759  for (const FrameMaps & rMap : aMaps)
760  {
761  for (size_t j = 0; j < rMap.nCount; ++j)
762  {
763  aFrames.push_back(rMap.pMap[j].eStrId);
764  aFrames.push_back(rMap.pMap[j].eMirrorStrId);
765  }
766  }
767 
768  std::sort(aFrames.begin(), aFrames.end());
769  aFrames.erase(std::unique(aFrames.begin(), aFrames.end()), aFrames.end());
770 
771  for (const auto& rFrame : aFrames)
772  {
773  m_xHorizontalDLB->append_text(SvxSwFramePosString::GetString(rFrame));
774  }
775 
776  Size aBiggest(m_xHorizontalDLB->get_preferred_size());
777  m_xHorizontalDLB->set_size_request(aBiggest.Width(), -1);
778  m_xVerticalDLB->set_size_request(aBiggest.Width(), -1);
779  m_xHorizontalDLB->clear();
780 }
781 
782 namespace
783 {
784  struct RelationMaps
785  {
786  RelationMap const * pMap;
787  size_t nCount;
788  };
789 }
790 
792 {
793  static const RelationMaps aMaps[] = {
794  { aRelationMap, SAL_N_ELEMENTS(aRelationMap) },
795  { aAsCharRelationMap, SAL_N_ELEMENTS(aAsCharRelationMap) }
796  };
797 
798  std::vector<SvxSwFramePosString::StringId> aRels;
799  for (const RelationMaps & rMap : aMaps)
800  {
801  for (size_t j = 0; j < rMap.nCount; ++j)
802  {
803  aRels.push_back(rMap.pMap[j].eStrId);
804  aRels.push_back(rMap.pMap[j].eMirrorStrId);
805  }
806  }
807 
808  std::sort(aRels.begin(), aRels.end());
809  aRels.erase(std::unique(aRels.begin(), aRels.end()), aRels.end());
810 
811  for (const auto& rRel : aRels)
812  {
814  }
815 
816  Size aBiggest(m_xHoriRelationLB->get_preferred_size());
817  m_xHoriRelationLB->set_size_request(aBiggest.Width(), -1);
818  m_xVertRelationLB->set_size_request(aBiggest.Width(), -1);
819  m_xRelWidthRelationLB->set_size_request(aBiggest.Width(), -1);
820  m_xRelHeightRelationLB->set_size_request(aBiggest.Width(), -1);
821  m_xHoriRelationLB->clear();
822 }
823 
825 {
826  return VclPtr<SwFramePage>::Create(pParent, *rSet);
827 }
828 
830 {
831  // i#39692 - mustn't be called more than once
832  if (!m_xRealSizeBT->get_visible())
833  {
834  m_xWidthFT->show();
835  m_xWidthAutoFT->hide();
836  m_xAutoHeightCB->hide();
837 
838  m_xHeightFT->show();
839  m_xHeightAutoFT->hide();
840  m_xAutoWidthCB->hide();
841 
842  m_xRealSizeBT->show();
843  }
844 }
845 
847 {
848  return static_cast<SwFrameDlg*>(GetDialogController())->GetWrtShell();
849 }
850 
851 void SwFramePage::Reset( const SfxItemSet *rSet )
852 {
855 
858 
859  FieldUnit aMetric = ::GetDfltMetric(m_bHtmlMode);
860  m_xWidthED->SetMetric(aMetric);
861  m_xHeightED->SetMetric(aMetric);
862  ::SetFieldUnit(*m_xAtHorzPosED, aMetric);
863  ::SetFieldUnit(*m_xAtVertPosED, aMetric);
864 
865  const SfxPoolItem* pItem = nullptr;
866  const SwFormatAnchor& rAnchor = rSet->Get(RES_ANCHOR);
867 
868  if (SfxItemState::SET == rSet->GetItemState(FN_OLE_IS_MATH, false, &pItem))
869  m_bIsMathOLE = static_cast<const SfxBoolItem*>(pItem)->GetValue();
870  if (SfxItemState::SET == rSet->GetItemState(FN_MATH_BASELINE_ALIGNMENT, false, &pItem))
871  m_bIsMathBaselineAlignment = static_cast<const SfxBoolItem*>(pItem)->GetValue();
873  && RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId()) );
874 
875  if (m_bFormat)
876  {
877  // at formats no anchor editing
878  m_xAnchorFrame->set_sensitive(false);
879  m_xFixedRatioCB->set_sensitive(false);
880  }
881  else
882  {
883  if (rAnchor.GetAnchorId() != RndStdIds::FLY_AT_FLY && !pSh->IsFlyInFly())
884  m_xAnchorAtFrameRB->hide();
886  {
887  OUString sHLabel = m_xHorizontalFT->get_label();
888  m_xHorizontalFT->set_label(m_xVerticalFT->get_label());
889  m_xVerticalFT->set_label(sHLabel);
890  m_bIsVerticalFrame = true;
891  }
892  }
893 
894  if ( m_sDlgType == "PictureDialog" || m_sDlgType == "ObjectDialog" )
895  {
896  OSL_ENSURE(pSh , "shell not found");
897  //OS: only for the variant Insert/Graphic/Properties
898  if(SfxItemState::SET == rSet->GetItemState(FN_PARAM_GRF_REALSIZE, false, &pItem))
899  m_aGrfSize = static_cast<const SvxSizeItem*>(pItem)->GetSize();
900  else
901  pSh->GetGrfSize( m_aGrfSize );
902 
903  if ( !m_bNew )
904  {
905  m_xRealSizeBT->connect_clicked(LINK(this, SwFramePage, RealSizeHdl));
907  }
908 
909  if (m_sDlgType == "PictureDialog")
910  m_xFixedRatioCB->set_active(false);
911  else
912  {
913  if ( m_bNew )
914  SetText(SwResId(STR_FRMUI_OLE_INSERT));
915  else
916  SetText(SwResId(STR_FRMUI_OLE_EDIT));
917  }
918  }
919  else
920  {
921  m_aGrfSize = rSet->Get(RES_FRM_SIZE).GetSize();
922  }
923 
924  // entering percent value made possible
925 
926  // the available space is not yet known so the RefValue has to be calculated from size and relative size values
927  // this is needed only if relative values are already set
928  const SwFormatFrameSize& rFrameSize = rSet->Get(RES_FRM_SIZE);
929 
930  m_xRelWidthRelationLB->append_text(SvxSwFramePosString::GetString(SwFPos::FRAME));
931  m_xRelWidthRelationLB->append_text(SvxSwFramePosString::GetString(SwFPos::REL_PG_FRAME));
932  if (rFrameSize.GetWidthPercent() != SwFormatFrameSize::SYNCED && rFrameSize.GetWidthPercent() != 0)
933  {
934  //calculate the reference value from the width and relative width values
935  sal_Int32 nSpace = rFrameSize.GetWidth() * 100 / rFrameSize.GetWidthPercent();
936  m_xWidthED->SetRefValue( nSpace );
937 
938  m_xRelWidthRelationLB->set_sensitive(true);
939  }
940  else
941  m_xRelWidthRelationLB->set_sensitive(false);
942 
943  m_xRelHeightRelationLB->append_text(SvxSwFramePosString::GetString(SwFPos::FRAME));
944  m_xRelHeightRelationLB->append_text(SvxSwFramePosString::GetString(SwFPos::REL_PG_FRAME));
945  if (rFrameSize.GetHeightPercent() != SwFormatFrameSize::SYNCED && rFrameSize.GetHeightPercent() != 0)
946  {
947  //calculate the reference value from the with and relative width values
948  sal_Int32 nSpace = rFrameSize.GetHeight() * 100 / rFrameSize.GetHeightPercent();
949  m_xHeightED->SetRefValue( nSpace );
950 
951  m_xRelHeightRelationLB->set_sensitive(true);
952  }
953  else
954  m_xRelHeightRelationLB->set_sensitive(false);
955 
956  // general initialisation part
957  switch(rAnchor.GetAnchorId())
958  {
959  case RndStdIds::FLY_AT_PAGE: m_xAnchorAtPageRB->set_active(true); break;
960  case RndStdIds::FLY_AT_PARA: m_xAnchorAtParaRB->set_active(true); break;
961  case RndStdIds::FLY_AT_CHAR: m_xAnchorAtCharRB->set_active(true); break;
962  case RndStdIds::FLY_AS_CHAR: m_xAnchorAsCharRB->set_active(true); break;
963  case RndStdIds::FLY_AT_FLY: m_xAnchorAtFrameRB->set_active(true);break;
964  default:; //prevent warning
965  }
966 
967  // i#22341 - determine content position of character
968  // Note: content position can be NULL
970 
971  // i#18732 - init checkbox value
972  {
973  const bool bFollowTextFlow =
974  rSet->Get(RES_FOLLOW_TEXT_FLOW).GetValue();
975  m_xFollowTextFlowCB->set_active(bFollowTextFlow);
976  }
977 
978  if(m_bHtmlMode)
979  {
980  m_xAutoHeightCB->set_sensitive(false);
981  m_xAutoWidthCB->set_sensitive(false);
982  m_xMirrorPagesCB->hide();
983  if (m_sDlgType == "FrameDialog")
984  m_xFixedRatioCB->set_sensitive(false);
985  // i#18732 hide checkbox in HTML mode
986  m_xFollowTextFlowCB->hide();
987  }
988  else
989  {
990  // enable/disable of check box 'Mirror on..'
991  m_xMirrorPagesCB->set_sensitive(!m_xAnchorAsCharRB->get_active());
992 
993  // enable/disable check box 'Follow text flow'.
994  // enable check box 'Follow text
995  // flow' also for anchor type to-frame.
996  m_xFollowTextFlowCB->set_sensitive(m_xAnchorAtParaRB->get_active() ||
997  m_xAnchorAtCharRB->get_active() ||
998  m_xAnchorAtFrameRB->get_active());
999  }
1000 
1001  Init(*rSet);
1002  m_xAtVertPosED->save_value();
1003  m_xAtHorzPosED->save_value();
1004  m_xFollowTextFlowCB->save_state();
1005 
1006  m_xWidthED->save_value();
1007  m_xHeightED->save_value();
1008 
1009  m_bNoModifyHdl = false;
1010  //lock PercentFields
1011  m_xWidthED->LockAutoCalculation(true);
1012  m_xHeightED->LockAutoCalculation(true);
1013  RangeModifyHdl(); // set all maximum values initially
1014  m_xHeightED->LockAutoCalculation(false);
1015  m_xWidthED->LockAutoCalculation(false);
1016 
1017  m_xAutoHeightCB->save_state();
1018  m_xAutoWidthCB->save_state();
1019 
1020  SwTwips nWidth = static_cast< SwTwips >(m_xWidthED->DenormalizePercent(m_xWidthED->get_value(FieldUnit::TWIP)));
1021  SwTwips nHeight = static_cast< SwTwips >(m_xHeightED->DenormalizePercent(m_xHeightED->get_value(FieldUnit::TWIP)));
1022  m_fWidthHeightRatio = nHeight ? double(nWidth) / double(nHeight) : 1.0;
1023 }
1024 
1025 // stuff attributes into the set when OK
1027 {
1028  bool bRet = false;
1031  OSL_ENSURE( pSh , "shell not found");
1032  const SfxItemSet& rOldSet = GetItemSet();
1033  const SfxPoolItem* pOldItem = nullptr;
1034 
1035  RndStdIds eAnchorId = GetAnchor();
1036 
1037  if ( !m_bFormat )
1038  {
1039  pOldItem = GetOldItem(*rSet, RES_ANCHOR);
1040  if (m_bNew || !pOldItem || eAnchorId != static_cast<const SwFormatAnchor*>(pOldItem)->GetAnchorId())
1041  {
1042  SwFormatAnchor aAnc( eAnchorId, pSh->GetPhyPageNum() );
1043  bRet = nullptr != rSet->Put( aAnc );
1044  }
1045  }
1046 
1047  if ( m_pHMap )
1048  {
1049  SwFormatHoriOrient aHoriOrient( rOldSet.Get(RES_HORI_ORIENT) );
1050 
1051  const sal_Int32 nMapPos = GetMapPos(m_pHMap, *m_xHorizontalDLB);
1052  const sal_Int16 eHOri = GetAlignment(m_pHMap, nMapPos, *m_xHoriRelationLB);
1053  const sal_Int16 eRel = GetRelation(*m_xHoriRelationLB);
1054 
1055  aHoriOrient.SetHoriOrient( eHOri );
1056  aHoriOrient.SetRelationOrient( eRel );
1057  aHoriOrient.SetPosToggle(m_xMirrorPagesCB->get_active());
1058 
1059  bool bMod = m_xAtHorzPosED->get_value_changed_from_saved();
1060  bMod |= m_xMirrorPagesCB->get_state_changed_from_saved();
1061 
1062  if ( eHOri == text::HoriOrientation::NONE &&
1063  (m_bNew || (m_bAtHorzPosModified || bMod) || m_nOldH != eHOri ) )
1064  {
1065  SwTwips nX = static_cast< SwTwips >(m_xAtHorzPosED->denormalize(m_xAtHorzPosED->get_value(FieldUnit::TWIP)));
1066  aHoriOrient.SetPos( nX );
1067  }
1068 
1069  pOldItem = GetOldItem(*rSet, FN_HORI_ORIENT);
1070  bool bSame = false;
1071  if ((m_bNew == m_bFormat) && pOldItem)
1072  {
1073  bSame = aHoriOrient == static_cast<const SwFormatHoriOrient&>(*pOldItem);
1074  }
1075  if ((m_bNew && !m_bFormat) || ((m_bAtHorzPosModified || bMod) && !bSame))
1076  {
1077  bRet |= nullptr != rSet->Put( aHoriOrient );
1078  }
1079  }
1080 
1081  if ( m_pVMap )
1082  {
1083  // alignment vertical
1084  SwFormatVertOrient aVertOrient( rOldSet.Get(RES_VERT_ORIENT) );
1085 
1086  const sal_Int32 nMapPos = GetMapPos(m_pVMap, *m_xVerticalDLB);
1087  const sal_Int16 eVOri = GetAlignment(m_pVMap, nMapPos, *m_xVertRelationLB);
1088  const sal_Int16 eRel = GetRelation(*m_xVertRelationLB);
1089 
1090  aVertOrient.SetVertOrient ( eVOri);
1091  aVertOrient.SetRelationOrient( eRel );
1092 
1093  bool bMod = m_xAtVertPosED->get_value_changed_from_saved();
1094 
1095  if ( eVOri == text::VertOrientation::NONE &&
1096  ( m_bNew || (m_bAtVertPosModified || bMod) || m_nOldV != eVOri) )
1097  {
1098  // vertical position
1099  // recalculate offset for character bound frames
1100  SwTwips nY = static_cast< SwTwips >(m_xAtVertPosED->denormalize(m_xAtVertPosED->get_value(FieldUnit::TWIP)));
1101  if (eAnchorId == RndStdIds::FLY_AS_CHAR)
1102  {
1103  nY *= -1;
1104  }
1105  aVertOrient.SetPos( nY );
1106  }
1107  pOldItem = GetOldItem(*rSet, FN_VERT_ORIENT);
1108  bool bSame = false;
1109  if((m_bNew == m_bFormat) && pOldItem)
1110  {
1111  bSame = m_bFormat ?
1112  aVertOrient.GetVertOrient() == static_cast<const SwFormatVertOrient*>(pOldItem)->GetVertOrient() &&
1113  aVertOrient.GetRelationOrient() == static_cast<const SwFormatVertOrient*>(pOldItem)->GetRelationOrient() &&
1114  aVertOrient.GetPos() == static_cast<const SwFormatVertOrient*>(pOldItem)->GetPos()
1115  : aVertOrient == static_cast<const SwFormatVertOrient&>(*pOldItem);
1116  }
1117  if( ( m_bNew && !m_bFormat ) || ((m_bAtVertPosModified || bMod) && !bSame ))
1118  {
1119  bRet |= nullptr != rSet->Put( aVertOrient );
1120  }
1121  }
1122 
1123  // set size
1124  // new exception: when the size of pMgr(, 0), then the properties
1125  // for a graphic that isn't even loaded, are set. Then no SetSize
1126  // is done here when the size settings were not changed by the
1127  // user.
1128  const SwFormatFrameSize& rOldSize = rOldSet.Get(RES_FRM_SIZE);
1129  SwFormatFrameSize aSz( rOldSize );
1130 
1131  auto nRelWidthRelation = m_xRelWidthRelationLB->get_active();
1132  if (nRelWidthRelation != -1)
1133  {
1134  if (nRelWidthRelation == 0)
1135  aSz.SetWidthPercentRelation(text::RelOrientation::FRAME);
1136  else if (nRelWidthRelation == 1)
1137  aSz.SetWidthPercentRelation(text::RelOrientation::PAGE_FRAME);
1138  }
1139  auto nRelHeightRelation = m_xRelHeightRelationLB->get_active();
1140  if (nRelHeightRelation != -1)
1141  {
1142  if (nRelHeightRelation == 0)
1143  aSz.SetHeightPercentRelation(text::RelOrientation::FRAME);
1144  else if (nRelHeightRelation == 1)
1145  aSz.SetHeightPercentRelation(text::RelOrientation::PAGE_FRAME);
1146  }
1147 
1148  bool bValueModified = m_xWidthED->get_value_changed_from_saved() ||
1149  m_xHeightED->get_value_changed_from_saved();
1150  bool bCheckChanged = m_xRelWidthCB->get_state_changed_from_saved() ||
1151  m_xRelHeightCB->get_state_changed_from_saved();
1152 
1153  bool bLegalValue = !(!rOldSize.GetWidth () && !rOldSize.GetHeight() &&
1154  m_xWidthED->get_value() == m_xWidthED->get_min() &&
1155  m_xHeightED->get_value() == m_xHeightED->get_min());
1156 
1157  if ((m_bNew && !m_bFormat) || ((bValueModified || bCheckChanged) && bLegalValue))
1158  {
1159  sal_Int64 nNewWidth = m_xWidthED->DenormalizePercent(m_xWidthED->GetRealValue(FieldUnit::TWIP));
1160  sal_Int64 nNewHeight = m_xHeightED->DenormalizePercent(m_xHeightED->GetRealValue(FieldUnit::TWIP));
1161  aSz.SetWidth (static_cast< SwTwips >(nNewWidth));
1162  aSz.SetHeight(static_cast< SwTwips >(nNewHeight));
1163 
1164  if (m_xRelWidthCB->get_active())
1165  {
1166  aSz.SetWidthPercent(static_cast<sal_uInt8>(std::min(MAX_PERCENT_WIDTH, m_xWidthED->Convert(m_xWidthED->NormalizePercent(nNewWidth), FieldUnit::TWIP, FieldUnit::PERCENT))));
1167  }
1168  else
1169  aSz.SetWidthPercent(0);
1170  if (m_xRelHeightCB->get_active())
1171  aSz.SetHeightPercent(static_cast<sal_uInt8>(std::min(MAX_PERCENT_HEIGHT, m_xHeightED->Convert(m_xHeightED->NormalizePercent(nNewHeight), FieldUnit::TWIP, FieldUnit::PERCENT))));
1172  else
1173  aSz.SetHeightPercent(0);
1174 
1175  if (m_xFixedRatioCB->get_active() && (m_xRelWidthCB->get_active() != m_xRelHeightCB->get_active()))
1176  {
1177  if (m_xRelWidthCB->get_active())
1179  else
1181  }
1182  }
1183  if( !IsInGraficMode() )
1184  {
1185  if (m_xAutoHeightCB->get_state_changed_from_saved())
1186  {
1187  SwFrameSize eFrameSize = m_xAutoHeightCB->get_active()? ATT_MIN_SIZE : ATT_FIX_SIZE;
1188  if( eFrameSize != aSz.GetHeightSizeType() )
1189  aSz.SetHeightSizeType(eFrameSize);
1190  }
1191  if (m_xAutoWidthCB->get_state_changed_from_saved())
1192  {
1193  SwFrameSize eFrameSize = m_xAutoWidthCB->get_active()? ATT_MIN_SIZE : ATT_FIX_SIZE;
1194  if( eFrameSize != aSz.GetWidthSizeType() )
1195  aSz.SetWidthSizeType( eFrameSize );
1196  }
1197  }
1198  if (!m_bFormat && m_xFixedRatioCB->get_state_changed_from_saved())
1199  bRet |= nullptr != rSet->Put(SfxBoolItem(FN_KEEP_ASPECT_RATIO, m_xFixedRatioCB->get_active()));
1200 
1201  pOldItem = GetOldItem(*rSet, RES_FRM_SIZE);
1202 
1203  if ((pOldItem && aSz != *pOldItem) || (!pOldItem && !m_bFormat) ||
1204  (m_bFormat &&
1205  (aSz.GetWidth() > 0 || aSz.GetWidthPercent() > 0) &&
1206  (aSz.GetHeight() > 0 || aSz.GetHeightPercent() > 0)))
1207  {
1208  if (aSz.GetHeightSizeType() == ATT_VAR_SIZE) // there is no VAR_SIZE in frames
1210 
1211  bRet |= nullptr != rSet->Put( aSz );
1212  }
1213  if (m_xFollowTextFlowCB->get_state_changed_from_saved())
1214  {
1215  bRet |= nullptr != rSet->Put(SwFormatFollowTextFlow(m_xFollowTextFlowCB->get_active()));
1216  }
1217  return bRet;
1218 }
1219 
1220 // initialise horizontal and vertical Pos
1222  sal_Int16 nH,
1223  sal_Int16 nHRel,
1224  sal_Int16 nV,
1225  sal_Int16 nVRel,
1226  long nX,
1227  long nY)
1228 {
1229  auto nPos = m_xVerticalDLB->get_active();
1230  if (nPos != -1 && m_pVMap)
1231  {
1233 
1234  nPos = m_xVertRelationLB->get_active();
1235  if (nPos != -1)
1236  m_nOldVRel = reinterpret_cast<RelationMap*>(m_xVertRelationLB->get_id(nPos).toInt64())->nRelation;
1237  }
1238 
1239  nPos = m_xHorizontalDLB->get_active();
1240  if (nPos != -1 && m_pHMap)
1241  {
1243 
1244  nPos = m_xHoriRelationLB->get_active();
1245  if (nPos != -1)
1246  m_nOldHRel = reinterpret_cast<RelationMap*>(m_xHoriRelationLB->get_id(nPos).toInt64())->nRelation;
1247  }
1248 
1249  bool bEnable = true;
1250  if ( eId == RndStdIds::FLY_AT_PAGE )
1251  {
1252  m_pVMap = m_bHtmlMode ? aVPageHtmlMap : aVPageMap;
1253  m_pHMap = m_bHtmlMode ? aHPageHtmlMap : aHPageMap;
1254  }
1255  else if ( eId == RndStdIds::FLY_AT_FLY )
1256  {
1257  // own vertical alignment map for to frame
1258  // anchored objects.
1259  m_pVMap = m_bHtmlMode ? aVFlyHtmlMap : aVFrameMap;
1260  m_pHMap = m_bHtmlMode ? aHFlyHtmlMap : aHFrameMap;
1261  }
1262  else if ( eId == RndStdIds::FLY_AT_PARA )
1263  {
1264  if(m_bHtmlMode)
1265  {
1268  }
1269  else
1270  {
1271  m_pVMap = aVParaMap;
1272  m_pHMap = aHParaMap;
1273  }
1274  }
1275  else if ( eId == RndStdIds::FLY_AT_CHAR )
1276  {
1277  if(m_bHtmlMode)
1278  {
1281  }
1282  else
1283  {
1284  m_pVMap = aVCharMap;
1285  m_pHMap = aHCharMap;
1286  }
1287  }
1288  else if ( eId == RndStdIds::FLY_AS_CHAR )
1289  {
1290  m_pVMap = m_bHtmlMode ? aVAsCharHtmlMap : aVAsCharMap;
1291  m_pHMap = nullptr;
1292  bEnable = false;
1293  }
1294  m_xHorizontalDLB->set_sensitive( bEnable );
1295  m_xHorizontalFT->set_sensitive( bEnable );
1296 
1297  // select current Pos
1298  // horizontal
1299  if ( nH < 0 )
1300  {
1301  nH = m_nOldH;
1302  nHRel = m_nOldHRel;
1303  }
1304  sal_Int32 nMapPos = FillPosLB(m_pHMap, nH, nHRel, *m_xHorizontalDLB);
1305  FillRelLB(m_pHMap, nMapPos, nH, nHRel, *m_xHoriRelationLB, *m_xHoriRelationFT);
1306 
1307  // vertical
1308  if ( nV < 0 )
1309  {
1310  nV = m_nOldV;
1311  nVRel = m_nOldVRel;
1312  }
1313  nMapPos = FillPosLB(m_pVMap, nV, nVRel, *m_xVerticalDLB);
1314  FillRelLB(m_pVMap, nMapPos, nV, nVRel, *m_xVertRelationLB, *m_xVertRelationFT);
1315 
1316  bEnable = nH == text::HoriOrientation::NONE && eId != RndStdIds::FLY_AS_CHAR;
1317  if (!bEnable)
1318  m_xAtHorzPosED->set_value(0, FieldUnit::TWIP);
1319  else
1320  {
1321  if (nX != LONG_MAX)
1322  m_xAtHorzPosED->set_value(m_xAtHorzPosED->normalize(nX), FieldUnit::TWIP);
1323  }
1324  m_xAtHorzPosFT->set_sensitive( bEnable );
1325  m_xAtHorzPosED->set_sensitive( bEnable );
1326 
1327  bEnable = nV == text::VertOrientation::NONE;
1328  if ( !bEnable )
1329  m_xAtVertPosED->set_value(0, FieldUnit::TWIP);
1330  else
1331  {
1332  if (eId == RndStdIds::FLY_AS_CHAR)
1333  {
1334  if ( nY == LONG_MAX )
1335  nY = 0;
1336  else
1337  nY *= -1;
1338  }
1339  if ( nY != LONG_MAX )
1340  m_xAtVertPosED->set_value(m_xAtVertPosED->normalize(nY), FieldUnit::TWIP);
1341  }
1342  m_xAtVertPosFT->set_sensitive( bEnable && m_bAllowVertPositioning );
1343  m_xAtVertPosED->set_sensitive( bEnable && m_bAllowVertPositioning );
1344  UpdateExample();
1345 }
1346 
1347 sal_Int32 SwFramePage::FillPosLB(const FrameMap* _pMap,
1348  const sal_Int16 _nAlign,
1349  const sal_Int16 _nRel,
1350  weld::ComboBox& _rLB )
1351 {
1352  OUString sSelEntry;
1353  const OUString sOldEntry = _rLB.get_active_text();
1354 
1355  _rLB.clear();
1356 
1357  // i#22341 determine all possible listbox relations for
1358  // given relation for map <aVCharMap>
1359  const LB nLBRelations = (_pMap != aVCharMap)
1360  ? LB::NONE
1361  : ::lcl_GetLBRelationsForRelations( _nRel );
1362 
1363  // fill Listbox
1364  size_t nCount = ::lcl_GetFrameMapCount(_pMap);
1365  for (size_t i = 0; _pMap && i < nCount; ++i)
1366  {
1367 // Why not from the left/from inside or from above?
1368  SvxSwFramePosString::StringId eStrId = m_xMirrorPagesCB->get_active() ? _pMap[i].eMirrorStrId : _pMap[i].eStrId;
1369  // --> OD 2009-08-31 #mongolianlayout#
1370  eStrId = lcl_ChangeResIdToVerticalOrRTL( eStrId,
1374  OUString sEntry(SvxSwFramePosString::GetString(eStrId));
1375  if (_rLB.find_text(sEntry) == -1)
1376  {
1377  // don't insert entries when frames are character bound
1378  _rLB.append_text(sEntry);
1379  }
1380  // i#22341 - add condition to handle map <aVCharMap>
1381  // that is ambiguous in the alignment.
1382  if ( _pMap[i].nAlign == _nAlign &&
1383  ( (_pMap != aVCharMap) || _pMap[i].nLBRelations & nLBRelations ) )
1384  {
1385  sSelEntry = sEntry;
1386  }
1387  }
1388 
1389  _rLB.set_active_text(sSelEntry);
1390  if (_rLB.get_active() == -1)
1391  _rLB.set_active_text(sOldEntry);
1392 
1393  if (_rLB.get_active() == -1)
1394  _rLB.set_active(0);
1395 
1396  PosHdl(_rLB);
1397 
1398  return GetMapPos(_pMap, _rLB);
1399 }
1400 
1402  const sal_uInt16 _nLBSelPos,
1403  const sal_Int16 _nAlign,
1404  const sal_Int16 _nRel,
1405  weld::ComboBox& _rLB,
1406  weld::Label& _rFT)
1407 {
1408  OUString sSelEntry;
1409  LB nLBRelations = LB::NONE;
1410  size_t nMapCount = ::lcl_GetFrameMapCount(_pMap);
1411 
1412  _rLB.clear();
1413 
1414  if (_nLBSelPos < nMapCount)
1415  {
1416  if (_pMap == aVAsCharHtmlMap || _pMap == aVAsCharMap)
1417  {
1418  const OUString sOldEntry(_rLB.get_active_text());
1419  SvxSwFramePosString::StringId eStrId = _pMap[_nLBSelPos].eStrId;
1420 
1421  for (size_t nMapPos = 0; nMapPos < nMapCount; nMapPos++)
1422  {
1423  if (_pMap[nMapPos].eStrId == eStrId)
1424  {
1425  nLBRelations = _pMap[nMapPos].nLBRelations;
1426  for (RelationMap const & rCharMap : aAsCharRelationMap)
1427  {
1428  if (nLBRelations & rCharMap.nLBRelation)
1429  {
1430  // --> OD 2009-08-31 #mongolianlayout#
1432  lcl_ChangeResIdToVerticalOrRTL( rCharMap.eStrId,
1436  const OUString sEntry = SvxSwFramePosString::GetString(sStrId1);
1437  _rLB.append(OUString::number(reinterpret_cast<sal_Int64>(&rCharMap)), sEntry);
1438  if (_pMap[nMapPos].nAlign == _nAlign)
1439  sSelEntry = sEntry;
1440  break;
1441  }
1442  }
1443  }
1444  }
1445  if (!sSelEntry.isEmpty())
1446  _rLB.set_active_text(sSelEntry);
1447  else
1448  {
1449  _rLB.set_active_text(sOldEntry);
1450 
1451  if (_rLB.get_active() == -1)
1452  {
1453  for (int i = 0; i < _rLB.get_count(); i++)
1454  {
1455  RelationMap *pEntry = reinterpret_cast<RelationMap*>(_rLB.get_id(i).toInt64());
1456  if (pEntry->nLBRelation == LB::RelChar) // default
1457  {
1458  _rLB.set_active(i);
1459  break;
1460  }
1461  }
1462  }
1463  }
1464  }
1465  else
1466  {
1467  // special handling for map <aVCharMap>,
1468  // because its ambiguous in its <eStrId>/<eMirrorStrId>.
1469  if ( _pMap == aVCharMap )
1470  {
1471  nLBRelations = ::lcl_GetLBRelationsForStrID( _pMap,
1472  ( m_xMirrorPagesCB->get_active()
1473  ? _pMap[_nLBSelPos].eMirrorStrId
1474  : _pMap[_nLBSelPos].eStrId),
1475  m_xMirrorPagesCB->get_active() );
1476  }
1477  else
1478  {
1479  nLBRelations = _pMap[_nLBSelPos].nLBRelations;
1480  }
1481 
1482  for (sal_uLong nBit = 1; nBit < 0x80000000; nBit <<= 1)
1483  {
1484  if (nLBRelations & static_cast<LB>(nBit))
1485  {
1486  for (RelationMap const & rMap : aRelationMap)
1487  {
1488  if (rMap.nLBRelation == static_cast<LB>(nBit))
1489  {
1490  SvxSwFramePosString::StringId eStrId1 = m_xMirrorPagesCB->get_active() ?
1491  rMap.eMirrorStrId : rMap.eStrId;
1492  // --> OD 2009-08-31 #mongolianlayout#
1493  eStrId1 =
1498  const OUString sEntry = SvxSwFramePosString::GetString(eStrId1);
1499  _rLB.append(OUString::number(reinterpret_cast<sal_Int64>(&rMap)), sEntry);
1500  if (sSelEntry.isEmpty() && rMap.nRelation == _nRel)
1501  sSelEntry = sEntry;
1502  }
1503  }
1504  }
1505  }
1506  if (!sSelEntry.isEmpty())
1507  _rLB.set_active_text(sSelEntry);
1508  else
1509  {
1510  // Probably anchor switch. So look for similar relation
1511  sal_Int16 nSimRel = -1;
1512  switch (_nRel)
1513  {
1514  case text::RelOrientation::FRAME:
1515  nSimRel = text::RelOrientation::PAGE_FRAME;
1516  break;
1517  case text::RelOrientation::PRINT_AREA:
1518  nSimRel = text::RelOrientation::PAGE_PRINT_AREA;
1519  break;
1520  case text::RelOrientation::PAGE_LEFT:
1521  nSimRel = text::RelOrientation::FRAME_LEFT;
1522  break;
1523  case text::RelOrientation::PAGE_RIGHT:
1524  nSimRel = text::RelOrientation::FRAME_RIGHT;
1525  break;
1526  case text::RelOrientation::FRAME_LEFT:
1527  nSimRel = text::RelOrientation::PAGE_LEFT;
1528  break;
1529  case text::RelOrientation::FRAME_RIGHT:
1530  nSimRel = text::RelOrientation::PAGE_RIGHT;
1531  break;
1532  case text::RelOrientation::PAGE_FRAME:
1533  nSimRel = text::RelOrientation::FRAME;
1534  break;
1535  case text::RelOrientation::PAGE_PRINT_AREA:
1536  nSimRel = text::RelOrientation::PRINT_AREA;
1537  break;
1538 
1539  default:
1540  if (_rLB.get_active() != -1)
1541  {
1542  RelationMap *pEntry = reinterpret_cast<RelationMap*>(_rLB.get_id(_rLB.get_count() - 1).toInt64());
1543  nSimRel = pEntry->nRelation;
1544  }
1545  break;
1546  }
1547 
1548  for (int i = 0; i < _rLB.get_count(); i++)
1549  {
1550  RelationMap *pEntry = reinterpret_cast<RelationMap*>(_rLB.get_id(i).toInt64());
1551  if (pEntry->nRelation == nSimRel)
1552  {
1553  _rLB.set_active(i);
1554  break;
1555  }
1556  }
1557 
1558  if (_rLB.get_active() == -1)
1559  _rLB.set_active(0);
1560  }
1561  }
1562  }
1563 
1564  const bool bEnable = _rLB.get_count() != 0
1565  && (&_rLB != m_xVertRelationLB.get() || m_bAllowVertPositioning);
1566  _rLB.set_sensitive( bEnable );
1567  _rFT.set_sensitive( bEnable );
1568 
1569  RelHdl(_rLB);
1570 }
1571 
1572 sal_Int16 SwFramePage::GetRelation(const weld::ComboBox& rRelationLB)
1573 {
1574  const auto nPos = rRelationLB.get_active();
1575  if (nPos != -1)
1576  {
1577  RelationMap *pEntry = reinterpret_cast<RelationMap *>(rRelationLB.get_id(nPos).toInt64());
1578  return pEntry->nRelation;
1579  }
1580 
1581  return 0;
1582 }
1583 
1584 sal_Int16 SwFramePage::GetAlignment(FrameMap const *pMap, sal_Int32 nMapPos,
1585  const weld::ComboBox& rRelationLB)
1586 {
1587  if (!pMap || nMapPos < 0)
1588  return 0;
1589 
1590  const size_t nMapCount = ::lcl_GetFrameMapCount(pMap);
1591 
1592  if (static_cast<size_t>(nMapPos) >= nMapCount)
1593  return 0;
1594 
1595  // i#22341 special handling also for map <aVCharMap>,
1596  // because it contains ambiguous items for alignment
1597  if ( pMap != aVAsCharHtmlMap && pMap != aVAsCharMap && pMap != aVCharMap )
1598  return pMap[nMapPos].nAlign;
1599 
1600  if (rRelationLB.get_active() == -1)
1601  return 0;
1602 
1603  const RelationMap *const pRelationMap = reinterpret_cast<const RelationMap *>(
1604  rRelationLB.get_active_id().toInt64());
1605  const LB nRel = pRelationMap->nLBRelation;
1606  const SvxSwFramePosString::StringId eStrId = pMap[nMapPos].eStrId;
1607 
1608  for (size_t i = 0; i < nMapCount; ++i)
1609  {
1610  if (pMap[i].eStrId == eStrId && (pMap[i].nLBRelations & nRel))
1611  return pMap[i].nAlign;
1612  }
1613 
1614  return 0;
1615 }
1616 
1617 sal_Int32 SwFramePage::GetMapPos(const FrameMap *pMap, const weld::ComboBox& rAlignLB)
1618 {
1619  sal_Int32 nMapPos = 0;
1620  auto nLBSelPos = rAlignLB.get_active();
1621 
1622  if (nLBSelPos != -1)
1623  {
1624  if (pMap == aVAsCharHtmlMap || pMap == aVAsCharMap)
1625  {
1626  const size_t nMapCount = ::lcl_GetFrameMapCount(pMap);
1627  const OUString sSelEntry(rAlignLB.get_active_text());
1628 
1629  for (size_t i = 0; i < nMapCount; i++)
1630  {
1631  SvxSwFramePosString::StringId eResId = pMap[i].eStrId;
1632 
1633  OUString sEntry = SvxSwFramePosString::GetString(eResId);
1634  sEntry = MnemonicGenerator::EraseAllMnemonicChars( sEntry );
1635 
1636  if (sEntry == sSelEntry)
1637  {
1638  nMapPos = static_cast< sal_Int32 >(i);
1639  break;
1640  }
1641  }
1642  }
1643  else
1644  nMapPos = nLBSelPos;
1645  }
1646 
1647  return nMapPos;
1648 }
1649 
1651 {
1652  RndStdIds nRet = RndStdIds::FLY_AT_PAGE;
1653  if (m_xAnchorAtParaRB->get_active())
1654  {
1655  nRet = RndStdIds::FLY_AT_PARA;
1656  }
1657  else if (m_xAnchorAtCharRB->get_active())
1658  {
1659  nRet = RndStdIds::FLY_AT_CHAR;
1660  }
1661  else if (m_xAnchorAsCharRB->get_active())
1662  {
1663  nRet = RndStdIds::FLY_AS_CHAR;
1664  }
1665  else if (m_xAnchorAtFrameRB->get_active())
1666  {
1667  nRet = RndStdIds::FLY_AT_FLY;
1668  }
1669  return nRet;
1670 }
1671 
1672 // Bsp - Update
1674 {
1675  m_bNoModifyHdl = true;
1676  Init(rSet);
1677  m_bNoModifyHdl = false;
1678  //lock PercentFields
1679  m_xWidthED->LockAutoCalculation(true);
1680  m_xHeightED->LockAutoCalculation(true);
1681  RangeModifyHdl(); // set all maximum values initially
1682  m_xHeightED->LockAutoCalculation(false);
1683  m_xWidthED->LockAutoCalculation(false);
1684  m_xFollowTextFlowCB->save_state();
1685 }
1686 
1688 {
1689  if ( _pSet )
1690  {
1691  FillItemSet( _pSet );
1692 
1693  if (!m_bFormat) // tdf#112574 no anchor in styles
1694  {
1695  //FillItemSet doesn't set the anchor into the set when it matches
1696  //the original. But for the other pages we need the current anchor.
1699  RndStdIds eAnchorId = GetAnchor();
1700  SwFormatAnchor aAnc( eAnchorId, pSh->GetPhyPageNum() );
1701  _pSet->Put( aAnc );
1702  }
1703  }
1704 
1705  return DeactivateRC::LeavePage;
1706 }
1707 
1708 // swap left/right with inside/outside
1710 {
1711  RndStdIds eId = GetAnchor();
1712  InitPos(eId, -1, 0, -1, 0, LONG_MAX, LONG_MAX);
1713 }
1714 
1715 IMPL_LINK( SwFramePage, RelSizeClickHdl, weld::ToggleButton&, rBtn, void )
1716 {
1717  if (&rBtn == m_xRelWidthCB.get())
1718  {
1719  m_xWidthED->ShowPercent(rBtn.get_active());
1720  m_xRelWidthRelationLB->set_sensitive(rBtn.get_active());
1721  if (rBtn.get_active())
1722  m_xWidthED->get()->set_max(MAX_PERCENT_WIDTH, FieldUnit::NONE);
1723  }
1724  else // rBtn == m_xRelHeightCB.get()
1725  {
1726  m_xHeightED->ShowPercent(rBtn.get_active());
1727  m_xRelHeightRelationLB->set_sensitive(rBtn.get_active());
1728  if (rBtn.get_active())
1729  m_xHeightED->get()->set_max(MAX_PERCENT_HEIGHT, FieldUnit::NONE);
1730  }
1731 
1732  RangeModifyHdl(); // correct the values again
1733 
1734  if (&rBtn == m_xRelWidthCB.get())
1735  ModifyHdl(*m_xWidthED->get());
1736  else // rBtn == m_xRelHeightCB.get()
1737  ModifyHdl(*m_xHeightED->get());
1738 }
1739 
1740 // range check
1741 IMPL_LINK_NOARG(SwFramePage, RangeModifyClickHdl, weld::ToggleButton&, void)
1742 {
1743  RangeModifyHdl();
1744 }
1745 
1747 {
1748  if (m_bNoModifyHdl)
1749  return;
1750 
1753  OSL_ENSURE(pSh , "shell not found");
1754  SwFlyFrameAttrMgr aMgr( m_bNew, pSh, GetItemSet() );
1755  SvxSwFrameValidation aVal;
1756 
1757  aVal.nAnchorType = GetAnchor();
1758  aVal.bAutoHeight = m_xAutoHeightCB->get_active();
1759  aVal.bMirror = m_xMirrorPagesCB->get_active();
1760  aVal.bFollowTextFlow = m_xFollowTextFlowCB->get_active();
1761 
1762  if ( m_pHMap )
1763  {
1764  // alignment horizontal
1765  const sal_Int32 nMapPos = GetMapPos(m_pHMap, *m_xHorizontalDLB);
1768  }
1769  else
1770  aVal.nHoriOrient = text::HoriOrientation::NONE;
1771 
1772  if ( m_pVMap )
1773  {
1774  // alignment vertical
1775  const sal_Int32 nMapPos = GetMapPos(m_pVMap, *m_xVerticalDLB);
1778  }
1779  else
1780  aVal.nVertOrient = text::VertOrientation::NONE;
1781 
1782  const long nAtHorzPosVal = static_cast< long >(
1783  m_xAtHorzPosED->denormalize(m_xAtHorzPosED->get_value(FieldUnit::TWIP)) );
1784  const long nAtVertPosVal = static_cast< long >(
1785  m_xAtVertPosED->denormalize(m_xAtVertPosED->get_value(FieldUnit::TWIP)) );
1786 
1787  aVal.nHPos = nAtHorzPosVal;
1788  aVal.nVPos = nAtVertPosVal;
1789 
1790  aMgr.ValidateMetrics(aVal, mpToCharContentPos, true); // one time, to get reference values for percental values
1791 
1792  // set reference values for percental values (100%) ...
1793  m_xWidthED->SetRefValue(aVal.aPercentSize.Width());
1794  m_xHeightED->SetRefValue(aVal.aPercentSize.Height());
1795 
1796  // ... and correctly convert width and height with it
1797  SwTwips nWidth = static_cast< SwTwips >(m_xWidthED->DenormalizePercent(m_xWidthED->get_value(FieldUnit::TWIP)));
1798  SwTwips nHeight = static_cast< SwTwips >(m_xHeightED->DenormalizePercent(m_xHeightED->get_value(FieldUnit::TWIP)));
1799  aVal.nWidth = nWidth;
1800  aVal.nHeight = nHeight;
1801 
1802  aMgr.ValidateMetrics(aVal, mpToCharContentPos); // one more time, to determine all remaining values with correct width and height.
1803 
1804  // all columns have to be correct
1805  const SfxItemSet* pExampleSet = GetDialogExampleSet();
1806  if (pExampleSet && SfxItemState::DEFAULT <= pExampleSet->GetItemState(RES_COL))
1807  {
1808  const SwFormatCol& rCol = pExampleSet->Get(RES_COL);
1809  if ( rCol.GetColumns().size() > 1 )
1810  {
1811  for (const SwColumn & i : rCol.GetColumns())
1812  {
1813  aVal.nMinWidth += i.GetLeft() +
1814  i.GetRight() +
1815  MINFLY;
1816  }
1817  aVal.nMinWidth -= MINFLY;//one was already in there!
1818  }
1819  }
1820 
1821  nWidth = aVal.nWidth;
1822  nHeight = aVal.nHeight;
1823 
1824  // minimum range also for template
1825  m_xHeightED->set_min(m_xHeightED->NormalizePercent(aVal.nMinHeight), FieldUnit::TWIP);
1826  m_xWidthED->set_min(m_xWidthED->NormalizePercent(aVal.nMinWidth), FieldUnit::TWIP);
1827 
1828  SwTwips nMaxWidth(aVal.nMaxWidth);
1829  SwTwips nMaxHeight(aVal.nMaxHeight);
1830 
1831  if (aVal.bAutoHeight && (m_sDlgType == "PictureDialog" || m_sDlgType == "ObjectDialog"))
1832  {
1833  SwTwips nTmp = std::min(nWidth * nMaxHeight / std::max(nHeight, 1L), nMaxHeight);
1834  m_xWidthED->set_max(m_xWidthED->NormalizePercent(nTmp), FieldUnit::TWIP);
1835 
1836  nTmp = std::min(nHeight * nMaxWidth / std::max(nWidth, 1L), nMaxWidth);
1837  m_xHeightED->set_max(m_xWidthED->NormalizePercent(nTmp), FieldUnit::TWIP);
1838  }
1839  else
1840  {
1841  SwTwips nTmp = static_cast< SwTwips >(m_xHeightED->NormalizePercent(nMaxHeight));
1842  m_xHeightED->set_max(nTmp, FieldUnit::TWIP);
1843 
1844  nTmp = static_cast< SwTwips >(m_xWidthED->NormalizePercent(nMaxWidth));
1845  m_xWidthED->set_max(nTmp, FieldUnit::TWIP);
1846  }
1847 
1848  m_xAtHorzPosED->set_range(m_xAtHorzPosED->normalize(aVal.nMinHPos),
1849  m_xAtHorzPosED->normalize(aVal.nMaxHPos),
1850  FieldUnit::TWIP);
1851  if (aVal.nHPos != nAtHorzPosVal)
1852  m_xAtHorzPosED->set_value(m_xAtHorzPosED->normalize(aVal.nHPos), FieldUnit::TWIP);
1853 
1854  const SwTwips nUpperOffset = (aVal.nAnchorType == RndStdIds::FLY_AS_CHAR)
1855  ? m_nUpperBorder : 0;
1856  const SwTwips nLowerOffset = (aVal.nAnchorType == RndStdIds::FLY_AS_CHAR)
1857  ? m_nLowerBorder : 0;
1858 
1859  m_xAtVertPosED->set_range(m_xAtVertPosED->normalize(aVal.nMinVPos + nLowerOffset + nUpperOffset),
1860  m_xAtVertPosED->normalize(aVal.nMaxVPos),
1861  FieldUnit::TWIP);
1862  if (aVal.nVPos != nAtVertPosVal)
1863  m_xAtVertPosED->set_value(m_xAtVertPosED->normalize(aVal.nVPos), FieldUnit::TWIP);
1864 }
1865 
1867 {
1868  m_xMirrorPagesCB->set_sensitive(!m_xAnchorAsCharRB->get_active());
1869 
1870  // i#18732 - enable check box 'Follow text flow' for anchor
1871  // type to-paragraph' and to-character
1872  // i#22305 - enable check box 'Follow text
1873  // flow' also for anchor type to-frame.
1874  m_xFollowTextFlowCB->set_sensitive(m_xAnchorAtParaRB->get_active() ||
1875  m_xAnchorAtCharRB->get_active() ||
1876  m_xAnchorAtFrameRB->get_active());
1877 
1878  RndStdIds eId = GetAnchor();
1879 
1880  InitPos( eId, -1, 0, -1, 0, LONG_MAX, LONG_MAX);
1881  RangeModifyHdl();
1882 
1883  if(m_bHtmlMode)
1884  {
1885  PosHdl(*m_xHorizontalDLB);
1886  PosHdl(*m_xVerticalDLB);
1887  }
1888 
1889  EnableVerticalPositioning( !(m_bIsMathOLE && m_bIsMathBaselineAlignment
1890  && RndStdIds::FLY_AS_CHAR == eId) );
1891 }
1892 
1893 IMPL_LINK( SwFramePage, PosHdl, weld::ComboBox&, rLB, void )
1894 {
1895  bool bHori = &rLB == m_xHorizontalDLB.get();
1896  weld::ComboBox *pRelLB = bHori ? m_xHoriRelationLB.get() : m_xVertRelationLB.get();
1897  weld::Label *pRelFT = bHori ? m_xHoriRelationFT.get() : m_xVertRelationFT.get();
1898  FrameMap const *pMap = bHori ? m_pHMap : m_pVMap;
1899 
1900  const sal_Int32 nMapPos = GetMapPos(pMap, rLB);
1901  const sal_Int16 nAlign = GetAlignment(pMap, nMapPos, *pRelLB);
1902 
1903  if (bHori)
1904  {
1905  bool bEnable = text::HoriOrientation::NONE == nAlign;
1906  m_xAtHorzPosED->set_sensitive( bEnable );
1907  m_xAtHorzPosFT->set_sensitive( bEnable );
1908  }
1909  else
1910  {
1911  bool bEnable = text::VertOrientation::NONE == nAlign && m_bAllowVertPositioning;
1912  m_xAtVertPosED->set_sensitive( bEnable );
1913  m_xAtVertPosFT->set_sensitive( bEnable );
1914  }
1915 
1916  RangeModifyHdl();
1917 
1918  sal_Int16 nRel = 0;
1919  if (rLB.get_active() != -1)
1920  {
1921  if (pRelLB->get_active() != -1)
1922  nRel = reinterpret_cast<RelationMap*>(pRelLB->get_active_id().toInt64())->nRelation;
1923  FillRelLB(pMap, nMapPos, nAlign, nRel, *pRelLB, *pRelFT);
1924  }
1925  else
1926  pRelLB->clear();
1927 
1928  UpdateExample();
1929 
1930  if (bHori)
1931  m_bAtHorzPosModified = true;
1932  else
1933  m_bAtVertPosModified = true;
1934 
1935  // special treatment for HTML-Mode with horizontal-vertical-dependencies
1936  if(m_bHtmlMode && (RndStdIds::FLY_AT_CHAR == GetAnchor()))
1937  {
1938  bool bSet = false;
1939  if(bHori)
1940  {
1941  // right is allowed only above - from the left only above
1942  // from the left at character -> below
1943  if((text::HoriOrientation::LEFT == nAlign || text::HoriOrientation::RIGHT == nAlign) &&
1944  0 == m_xVerticalDLB->get_active())
1945  {
1946  if(text::RelOrientation::FRAME == nRel)
1947  m_xVerticalDLB->set_active(1);
1948  else
1949  m_xVerticalDLB->set_active(0);
1950  bSet = true;
1951  }
1952  else if(text::HoriOrientation::LEFT == nAlign && 1 == m_xVerticalDLB->get_active())
1953  {
1954  m_xVerticalDLB->set_active(0);
1955  bSet = true;
1956  }
1957  else if(text::HoriOrientation::NONE == nAlign && 1 == m_xVerticalDLB->get_active())
1958  {
1959  m_xVerticalDLB->set_active(0);
1960  bSet = true;
1961  }
1962  if(bSet)
1963  PosHdl(*m_xVerticalDLB);
1964  }
1965  else
1966  {
1967  if(text::VertOrientation::TOP == nAlign)
1968  {
1969  if (1 == m_xHorizontalDLB->get_active())
1970  {
1971  m_xHorizontalDLB->set_active(0);
1972  bSet = true;
1973  }
1974  m_xHoriRelationLB->set_active(1);
1975  }
1976  else if(text::VertOrientation::CHAR_BOTTOM == nAlign)
1977  {
1978  if (2 == m_xHorizontalDLB->get_active())
1979  {
1980  m_xHorizontalDLB->set_active(0);
1981  bSet = true;
1982  }
1983  m_xHoriRelationLB->set_active(0) ;
1984  }
1985  if(bSet)
1986  PosHdl(*m_xHorizontalDLB);
1987  }
1988 
1989  }
1990 }
1991 
1992 // horizontal Pos
1993 IMPL_LINK( SwFramePage, RelHdl, weld::ComboBox&, rLB, void )
1994 {
1995  bool bHori = &rLB == m_xHoriRelationLB.get();
1996 
1997  UpdateExample();
1998 
1999  if (bHori)
2000  m_bAtHorzPosModified = true;
2001  else
2002  m_bAtVertPosModified = true;
2003 
2004  if (m_bHtmlMode && (RndStdIds::FLY_AT_CHAR == GetAnchor()))
2005  {
2006  if(bHori)
2007  {
2008  const sal_Int16 nRel = GetRelation(*m_xHoriRelationLB);
2009  if(text::RelOrientation::PRINT_AREA == nRel && 0 == m_xVerticalDLB->get_active())
2010  {
2011  m_xVerticalDLB->set_active(1);
2012  }
2013  else if(text::RelOrientation::CHAR == nRel && 1 == m_xVerticalDLB->get_active())
2014  {
2015  m_xVerticalDLB->set_active(0);
2016  }
2017  }
2018  }
2019  RangeModifyHdl();
2020 }
2021 
2023 {
2024  m_xWidthED->set_value(m_xWidthED->NormalizePercent(m_aGrfSize.Width()), FieldUnit::TWIP);
2025  m_xHeightED->set_value(m_xHeightED->NormalizePercent(m_aGrfSize.Height()), FieldUnit::TWIP);
2026  m_fWidthHeightRatio = m_aGrfSize.Height() ? double(m_aGrfSize.Width()) / double(m_aGrfSize.Height()) : 1.0;
2027  UpdateExample();
2028 }
2029 
2031 {
2032  if( !IsInGraficMode() )
2033  HandleAutoCB( m_xAutoWidthCB->get_active(), *m_xWidthFT, *m_xWidthAutoFT, *m_xWidthED->get() );
2034 }
2035 
2036 IMPL_LINK_NOARG(SwFramePage, AutoHeightClickHdl, weld::ToggleButton&, void)
2037 {
2038  if (!IsInGraficMode())
2039  HandleAutoCB(m_xAutoHeightCB->get_active(), *m_xHeightFT, *m_xHeightAutoFT, *m_xWidthED->get());
2040 }
2041 
2042 IMPL_LINK( SwFramePage, ModifyHdl, weld::MetricSpinButton&, rEdit, void )
2043 {
2044  SwTwips nWidth = static_cast< SwTwips >(m_xWidthED->DenormalizePercent(m_xWidthED->get_value(FieldUnit::TWIP)));
2045  SwTwips nHeight = static_cast< SwTwips >(m_xHeightED->DenormalizePercent(m_xHeightED->get_value(FieldUnit::TWIP)));
2046  if (m_xFixedRatioCB->get_active())
2047  {
2048  if (&rEdit == m_xWidthED->get())
2049  {
2050  nHeight = SwTwips(static_cast<double>(nWidth) / m_fWidthHeightRatio);
2051  m_xHeightED->set_value(m_xHeightED->NormalizePercent(nHeight), FieldUnit::TWIP);
2052  }
2053  else if (&rEdit == m_xHeightED->get())
2054  {
2055  nWidth = SwTwips(static_cast<double>(nHeight) * m_fWidthHeightRatio);
2056  m_xWidthED->set_value(m_xWidthED->NormalizePercent(nWidth), FieldUnit::TWIP);
2057  }
2058  }
2059  m_fWidthHeightRatio = nHeight ? double(nWidth) / double(nHeight) : 1.0;
2060  UpdateExample();
2061 }
2062 
2064 {
2065  auto nPos = m_xHorizontalDLB->get_active();
2066  if (m_pHMap && nPos != -1)
2067  {
2068  const sal_Int32 nMapPos = GetMapPos(m_pHMap, *m_xHorizontalDLB);
2071  }
2072 
2073  nPos = m_xVerticalDLB->get_active();
2074  if (m_pVMap && nPos != -1)
2075  {
2076  const sal_Int32 nMapPos = GetMapPos(m_pVMap, *m_xVerticalDLB);
2079  }
2080 
2081  // size
2082  auto nXPos = m_xAtHorzPosED->denormalize(m_xAtHorzPosED->get_value(FieldUnit::TWIP));
2083  auto nYPos = m_xAtVertPosED->denormalize(m_xAtVertPosED->get_value(FieldUnit::TWIP));
2084  m_aExampleWN.SetRelPos(Point(nXPos, nYPos));
2085 
2087  m_aExampleWN.Invalidate();
2088 }
2089 
2091 {
2092  if(!m_bFormat)
2093  {
2095 
2096  // size
2097  const bool bSizeFixed = pSh->IsSelObjProtected( FlyProtectFlags::Fixed ) != FlyProtectFlags::NONE;
2098 
2099  m_xWidthED->set_sensitive( !bSizeFixed );
2100  m_xHeightED->set_sensitive( !bSizeFixed );
2101 
2102  // size controls for math OLE objects
2103  if ( m_sDlgType == "ObjectDialog" && ! m_bNew )
2104  {
2105  // disable width and height for math objects
2106  const SvGlobalName& rFactNm( pSh->GetOLEObject()->getClassID() );
2107 
2108  static struct GlobalNameId {
2109  sal_uInt32 const n1;
2110  sal_uInt16 n2, n3;
2111  sal_uInt8 b8, b9, b10, b11, b12, b13, b14, b15;
2112  } const aGlbNmIds[] = { { SO3_SM_CLASSID_60 }, { SO3_SM_CLASSID_50 },
2114 
2115  for (const GlobalNameId & rId : aGlbNmIds) {
2116  SvGlobalName aGlbNm( rId.n1, rId.n2, rId.n3,
2117  rId.b8, rId.b9, rId.b10, rId.b11,
2118  rId.b12, rId.b13, rId.b14, rId.b15 );
2119 
2120  if( rFactNm == aGlbNm )
2121  {
2122  // disable size controls for math OLE objects
2123  m_xWidthFT->set_sensitive(false);
2124  m_xWidthED->set_sensitive(false);
2125  m_xRelWidthCB->set_sensitive(false);
2126  m_xHeightFT->set_sensitive(false);
2127  m_xHeightED->set_sensitive(false);
2128  m_xRelHeightCB->set_sensitive(false);
2129  m_xFixedRatioCB->set_sensitive(false);
2130  m_xRealSizeBT->set_sensitive(false);
2131  break;
2132  }
2133  }
2134 
2135  // TODO/LATER: get correct aspect
2136  if(0 != (pSh->GetOLEObject()->getStatus( embed::Aspects::MSOLE_CONTENT ) & embed::EmbedMisc::MS_EMBED_RECOMPOSEONRESIZE ) )
2137  m_xRealSizeBT->set_sensitive(false);
2138  }
2139  }
2140 
2141  const SwFormatFrameSize& rSize = rSet.Get(RES_FRM_SIZE);
2142  sal_Int64 nWidth = m_xWidthED->NormalizePercent(rSize.GetWidth());
2143  sal_Int64 nHeight = m_xHeightED->NormalizePercent(rSize.GetHeight());
2144 
2145  if (nWidth != m_xWidthED->get_value(FieldUnit::TWIP))
2146  m_xWidthED->set_value(nWidth, FieldUnit::TWIP);
2147 
2148  if (nHeight != m_xHeightED->get_value(FieldUnit::TWIP))
2149  m_xHeightED->set_value(nHeight, FieldUnit::TWIP);
2150 
2151  if (!IsInGraficMode())
2152  {
2153  SwFrameSize eSize = rSize.GetHeightSizeType();
2154  bool bCheck = eSize != ATT_FIX_SIZE;
2155  m_xAutoHeightCB->set_active(bCheck);
2156  HandleAutoCB( bCheck, *m_xHeightFT, *m_xHeightAutoFT, *m_xWidthED->get() );
2157  if( eSize == ATT_VAR_SIZE )
2158  m_xHeightED->set_value(m_xHeightED->get_min());
2159 
2160  eSize = rSize.GetWidthSizeType();
2161  bCheck = eSize != ATT_FIX_SIZE;
2162  m_xAutoWidthCB->set_active(bCheck);
2163  HandleAutoCB( bCheck, *m_xWidthFT, *m_xWidthAutoFT, *m_xWidthED->get() );
2164  if( eSize == ATT_VAR_SIZE )
2165  m_xWidthED->set_value(m_xWidthED->get_min());
2166 
2167  if ( !m_bFormat )
2168  {
2170  const SwFrameFormat* pFormat = pSh->GetFlyFrameFormat();
2171  if( pFormat && pFormat->GetChain().GetNext() )
2172  m_xAutoHeightCB->set_sensitive( false );
2173  }
2174  }
2175  else
2176  m_xAutoHeightCB->hide();
2177 
2178  // organise circulation-gap for character bound frames
2179  const SvxULSpaceItem &rUL = rSet.Get(RES_UL_SPACE);
2180  m_nUpperBorder = rUL.GetUpper();
2181  m_nLowerBorder = rUL.GetLower();
2182 
2183  if(SfxItemState::SET == rSet.GetItemState(FN_KEEP_ASPECT_RATIO))
2184  {
2185  m_xFixedRatioCB->set_active(static_cast<const SfxBoolItem&>(rSet.Get(FN_KEEP_ASPECT_RATIO)).GetValue());
2186  m_xFixedRatioCB->save_state();
2187  }
2188 
2189  // columns
2190  SwFormatCol aCol( rSet.Get(RES_COL) );
2191  ::FitToActualSize( aCol, static_cast<sal_uInt16>(rSize.GetWidth()) );
2192 
2193  RndStdIds eAnchorId = GetAnchor();
2194 
2195  if ( m_bNew && !m_bFormat )
2196  InitPos(eAnchorId, -1, 0, -1, 0, LONG_MAX, LONG_MAX);
2197  else
2198  {
2199  const SwFormatHoriOrient& rHori = rSet.Get(RES_HORI_ORIENT);
2200  const SwFormatVertOrient& rVert = rSet.Get(RES_VERT_ORIENT);
2201  m_nOldH = rHori.GetHoriOrient();
2202  m_nOldHRel = rHori.GetRelationOrient();
2203  m_nOldV = rVert.GetVertOrient();
2204  m_nOldVRel = rVert.GetRelationOrient();
2205 
2206  if (eAnchorId == RndStdIds::FLY_AT_PAGE)
2207  {
2208  if (m_nOldHRel == text::RelOrientation::FRAME)
2209  m_nOldHRel = text::RelOrientation::PAGE_FRAME;
2210  else if (m_nOldHRel == text::RelOrientation::PRINT_AREA)
2211  m_nOldHRel = text::RelOrientation::PAGE_PRINT_AREA;
2212  if (m_nOldVRel == text::RelOrientation::FRAME)
2213  m_nOldVRel = text::RelOrientation::PAGE_FRAME;
2214  else if (m_nOldVRel == text::RelOrientation::PRINT_AREA)
2215  m_nOldVRel = text::RelOrientation::PAGE_PRINT_AREA;
2216  }
2217 
2218  m_xMirrorPagesCB->set_active(rHori.IsPosToggle());
2219  m_xMirrorPagesCB->save_state();
2220 
2221  InitPos(eAnchorId,
2222  m_nOldH,
2223  m_nOldHRel,
2224  m_nOldV,
2225  m_nOldVRel,
2226  rHori.GetPos(),
2227  rVert.GetPos());
2228  }
2229 
2230  // transparent for example
2231  // circulation for example
2232  const SwFormatSurround& rSurround = rSet.Get(RES_SURROUND);
2233  m_aExampleWN.SetWrap( rSurround.GetSurround() );
2234 
2235  if ( rSurround.GetSurround() == css::text::WrapTextMode_THROUGH )
2236  {
2237  const SvxOpaqueItem& rOpaque = rSet.Get(RES_OPAQUE);
2238  m_aExampleWN.SetTransparent(!rOpaque.GetValue());
2239  }
2240 
2241  // switch to percent if applicable
2242  RangeModifyHdl(); // set reference values (for 100%)
2243 
2245  m_xFixedRatioCB->set_active(true);
2246  if (rSize.GetWidthPercent() && rSize.GetWidthPercent() != SwFormatFrameSize::SYNCED &&
2247  !m_xRelWidthCB->get_active())
2248  {
2249  m_xRelWidthCB->set_active(true);
2250  RelSizeClickHdl(*m_xRelWidthCB);
2251  m_xWidthED->set_value(rSize.GetWidthPercent(), FieldUnit::PERCENT);
2252  }
2253  if (rSize.GetHeightPercent() && rSize.GetHeightPercent() != SwFormatFrameSize::SYNCED &&
2254  !m_xRelHeightCB->get_active())
2255  {
2256  m_xRelHeightCB->set_active(true);
2257  RelSizeClickHdl(*m_xRelHeightCB);
2258  m_xHeightED->set_value(rSize.GetHeightPercent(), FieldUnit::PERCENT);
2259  }
2260  m_xRelWidthCB->save_state();
2261  m_xRelHeightCB->save_state();
2262 
2263  if (rSize.GetWidthPercentRelation() == text::RelOrientation::PAGE_FRAME)
2264  m_xRelWidthRelationLB->set_active(1);
2265  else
2266  m_xRelWidthRelationLB->set_active(0);
2267 
2268  if (rSize.GetHeightPercentRelation() == text::RelOrientation::PAGE_FRAME)
2269  m_xRelHeightRelationLB->set_active(1);
2270  else
2271  m_xRelHeightRelationLB->set_active(0);
2272 }
2273 
2274 void SwFramePage::SetFormatUsed(bool bFormatUsed)
2275 {
2276  m_bFormat = bFormatUsed;
2277  if (m_bFormat)
2278  m_xAnchorFrame->hide();
2279 }
2280 
2282 {
2283  m_bAllowVertPositioning = bEnable;
2284  m_xVerticalFT->set_sensitive( bEnable );
2285  m_xVerticalDLB->set_sensitive( bEnable );
2286  m_xAtVertPosFT->set_sensitive( bEnable );
2287  m_xAtVertPosED->set_sensitive( bEnable );
2288  m_xVertRelationFT->set_sensitive( bEnable );
2289  m_xVertRelationLB->set_sensitive( bEnable );
2290 }
2291 
2293  : SfxTabPage(pParent, "modules/swriter/ui/picturepage.ui", "PicturePage", &rSet)
2294  , m_bHtmlMode(false)
2295  , m_xMirror(m_xBuilder->weld_widget("flipframe"))
2296  , m_xMirrorVertBox(m_xBuilder->weld_check_button("vert"))
2297  , m_xMirrorHorzBox(m_xBuilder->weld_check_button("hori"))
2298  , m_xAllPagesRB(m_xBuilder->weld_radio_button("allpages"))
2299  , m_xLeftPagesRB(m_xBuilder->weld_radio_button("leftpages"))
2300  , m_xRightPagesRB(m_xBuilder->weld_radio_button("rightpages"))
2301  , m_xConnectED(m_xBuilder->weld_entry("entry"))
2302  , m_xBrowseBT(m_xBuilder->weld_button("browse"))
2303  , m_xLinkFrame(m_xBuilder->weld_frame("linkframe"))
2304  // RotGrfFlyFrame: Need Angle and RotateControls now
2305  , m_xFlAngle(m_xBuilder->weld_frame("FL_ANGLE"))
2306  , m_xNfAngle(m_xBuilder->weld_spin_button("NF_ANGLE"))
2307  , m_xCtlAngle(new weld::CustomWeld(*m_xBuilder, "CTL_ANGLE", m_aCtlAngle))
2308  , m_xBmpWin(new weld::CustomWeld(*m_xBuilder, "preview", m_aBmpWin))
2309 {
2310  m_aBmpWin.SetBitmapEx(BitmapEx(RID_BMP_PREVIEW_FALLBACK));
2311 
2313 
2315  m_xMirrorHorzBox->connect_toggled(LINK(this, SwGrfExtPage, MirrorHdl));
2316  m_xMirrorVertBox->connect_toggled(LINK(this, SwGrfExtPage, MirrorHdl));
2317  m_xBrowseBT->connect_clicked(LINK(this, SwGrfExtPage, BrowseHdl));
2318 }
2319 
2321 {
2322  disposeOnce();
2323 }
2324 
2326 {
2327  m_xBmpWin.reset();
2328  m_xCtlAngle.reset();
2329  m_xGrfDlg.reset();
2331 }
2332 
2334 {
2335  return VclPtr<SwGrfExtPage>::Create(pParent, *rSet);
2336 }
2337 
2339 {
2340  const SfxPoolItem* pItem;
2341  const sal_uInt16 nHtmlMode = ::GetHtmlMode(static_cast<const SwDocShell*>(SfxObjectShell::Current()));
2342  m_bHtmlMode = (nHtmlMode & HTMLMODE_ON) != 0;
2343 
2344  if( SfxItemState::SET == rSet->GetItemState( FN_PARAM_GRF_CONNECT, true, &pItem)
2345  && static_cast<const SfxBoolItem *>(pItem)->GetValue() )
2346  {
2347  m_xBrowseBT->set_sensitive(true);
2348  m_xConnectED->set_editable(true);
2349  }
2350 
2351  // RotGrfFlyFrame: Get RotationAngle and set at control
2352  if(SfxItemState::SET == rSet->GetItemState( SID_ATTR_TRANSFORM_ANGLE, false, &pItem))
2353  {
2354  m_aCtlAngle.SetRotation(static_cast<const SfxInt32Item*>(pItem)->GetValue());
2355  }
2356  else
2357  {
2359  }
2361 
2362  ActivatePage(*rSet);
2363 }
2364 
2366 {
2367  const SvxProtectItem& rProt = rSet.Get(RES_PROTECT);
2368  bool bProtContent = rProt.IsContentProtected();
2369 
2370  const SfxPoolItem* pItem = nullptr;
2371  bool bEnable = false;
2372  bool bEnableMirrorRB = false;
2373 
2374  SfxItemState eState = rSet.GetItemState(RES_GRFATR_MIRRORGRF, true, &pItem);
2375  if (SfxItemState::UNKNOWN != eState && !bProtContent && !m_bHtmlMode)
2376  {
2377  if( SfxItemState::SET != eState )
2378  pItem = &rSet.Get( RES_GRFATR_MIRRORGRF );
2379 
2380  bEnable = true;
2381 
2382  MirrorGraph eMirror = static_cast<const SwMirrorGrf* >(pItem)->GetValue();
2383  switch( eMirror )
2384  {
2385  case MirrorGraph::Dont: break;
2386  case MirrorGraph::Vertical: m_xMirrorHorzBox->set_active(true); break;
2387  case MirrorGraph::Horizontal: m_xMirrorVertBox->set_active(true); break;
2388  case MirrorGraph::Both: m_xMirrorHorzBox->set_active(true);
2389  m_xMirrorVertBox->set_active(true);
2390  break;
2391  default:
2392  ;
2393  }
2394 
2395  const int nPos = (static_cast<const SwMirrorGrf* >(pItem)->IsGrfToggle() ? 1 : 0)
2396  + ((eMirror == MirrorGraph::Vertical || eMirror == MirrorGraph::Both) ? 2 : 0);
2397 
2398  bEnableMirrorRB = nPos != 0;
2399 
2400  switch (nPos)
2401  {
2402  case 1: // mirror at left / even pages
2403  m_xLeftPagesRB->set_active(true);
2404  m_xMirrorHorzBox->set_active(true);
2405  break;
2406  case 2: // mirror on all pages
2407  m_xAllPagesRB->set_active(true);
2408  break;
2409  case 3: // mirror on right / odd pages
2410  m_xRightPagesRB->set_active(true);
2411  break;
2412  default:
2413  m_xAllPagesRB->set_active(true);
2414  break;
2415  }
2416  }
2417 
2418  if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_GRAF_GRAPHIC, false, &pItem ) )
2419  {
2420  const SvxBrushItem& rBrush = *static_cast<const SvxBrushItem*>(pItem);
2421  if( !rBrush.GetGraphicLink().isEmpty() )
2422  {
2423  aGrfName = aNewGrfName = rBrush.GetGraphicLink();
2424  m_xConnectED->set_text(aNewGrfName);
2425  }
2426  OUString referer;
2427  SfxStringItem const * it = static_cast<SfxStringItem const *>(
2428  rSet.GetItem(SID_REFERER));
2429  if (it != nullptr) {
2430  referer = it->GetValue();
2431  }
2432  const Graphic* pGrf = rBrush.GetGraphic(referer);
2433  if( pGrf )
2434  m_aBmpWin.SetGraphic( *pGrf );
2435  }
2436 
2437  m_xConnectED->save_value();
2438 
2439  m_xMirror->set_sensitive(bEnable);
2440  m_xAllPagesRB->set_sensitive(bEnableMirrorRB);
2441  m_xLeftPagesRB->set_sensitive(bEnableMirrorRB);
2442  m_xRightPagesRB->set_sensitive(bEnableMirrorRB);
2443 
2444  m_xAllPagesRB->save_state();
2445  m_xLeftPagesRB->save_state();
2446  m_xRightPagesRB->save_state();
2447  m_xMirrorHorzBox->save_state();
2448  m_xMirrorVertBox->save_state();
2449 
2450  m_aBmpWin.MirrorHorz( m_xMirrorVertBox->get_active() );
2451  m_aBmpWin.MirrorVert( m_xMirrorHorzBox->get_active() );
2453 }
2454 
2456 {
2457  bool bModified = false;
2458  if ( m_xMirrorHorzBox->get_state_changed_from_saved() ||
2459  m_xMirrorVertBox->get_state_changed_from_saved() ||
2460  m_xAllPagesRB->get_state_changed_from_saved() ||
2461  m_xLeftPagesRB->get_state_changed_from_saved() ||
2462  m_xRightPagesRB->get_state_changed_from_saved() )
2463  {
2464  bModified = true;
2465 
2466  bool bHori = false;
2467 
2468  if (m_xMirrorHorzBox->get_active() &&
2469  !m_xLeftPagesRB->get_active())
2470  bHori = true;
2471 
2472  MirrorGraph eMirror;
2473  eMirror = m_xMirrorVertBox->get_active() && bHori ?
2474  MirrorGraph::Both : bHori ?
2475  MirrorGraph::Vertical : m_xMirrorVertBox->get_active() ?
2477 
2478  bool bMirror = !m_xAllPagesRB->get_active();
2479  SwMirrorGrf aMirror( eMirror );
2480  aMirror.SetGrfToggle(bMirror );
2481  rSet->Put( aMirror );
2482  }
2483 
2484  if (aGrfName != aNewGrfName || m_xConnectED->get_value_changed_from_saved())
2485  {
2486  bModified = true;
2487  aGrfName = m_xConnectED->get_text();
2489  SID_ATTR_GRAF_GRAPHIC ));
2490  }
2491 
2492  // RotGrfFlyFrame: Safe rotation if modified
2494  {
2495  rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ANGLE), m_aCtlAngle.GetRotation()));
2496  bModified = true;
2497  }
2498 
2499  return bModified;
2500 }
2501 
2503 {
2504  if( _pSet )
2505  FillItemSet( _pSet );
2506  return DeactivateRC::LeavePage;
2507 }
2508 
2510 {
2511  if(!m_xGrfDlg)
2512  {
2513  m_xGrfDlg.reset(new FileDialogHelper(
2514  ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW,
2515  FileDialogFlags::Graphic, GetFrameWeld()));
2516  m_xGrfDlg->SetTitle(m_xLinkFrame->get_label());
2517  }
2518  m_xGrfDlg->SetDisplayDirectory(m_xConnectED->get_text());
2519  uno::Reference < ui::dialogs::XFilePicker3 > xFP = m_xGrfDlg->GetFilePicker();
2520  uno::Reference < ui::dialogs::XFilePickerControlAccess > xCtrlAcc(xFP, uno::UNO_QUERY);
2521  xCtrlAcc->setValue( ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_LINK, 0, uno::makeAny(true) );
2522 
2523  if ( m_xGrfDlg->Execute() != ERRCODE_NONE )
2524  return;
2525 
2526 // remember selected filter
2527  aFilterName = m_xGrfDlg->GetCurrentFilter();
2528  aNewGrfName = INetURLObject::decode( m_xGrfDlg->GetPath(),
2530  m_xConnectED->set_text(aNewGrfName);
2531  //reset mirrors because maybe a Bitmap was swapped with
2532  //another type of graphic that cannot be mirrored.
2533  m_xMirrorVertBox->set_active(false);
2534  m_xMirrorHorzBox->set_active(false);
2535  m_xAllPagesRB->set_sensitive(false);
2536  m_xLeftPagesRB->set_sensitive(false);
2537  m_xRightPagesRB->set_sensitive(false);
2538  m_aBmpWin.MirrorHorz(false);
2539  m_aBmpWin.MirrorVert(false);
2540 
2541  Graphic aGraphic;
2542  (void)GraphicFilter::LoadGraphic(m_xGrfDlg->GetPath(), OUString(), aGraphic);
2543  m_aBmpWin.SetGraphic(aGraphic);
2544 
2545  bool bEnable = GraphicType::Bitmap == aGraphic.GetType() ||
2546  GraphicType::GdiMetafile == aGraphic.GetType();
2547  m_xMirrorVertBox->set_sensitive(bEnable);
2548  m_xMirrorHorzBox->set_sensitive(bEnable);
2549  m_xAllPagesRB->set_sensitive(bEnable);
2550  m_xLeftPagesRB->set_sensitive(bEnable);
2551  m_xRightPagesRB->set_sensitive(bEnable);
2552 
2553 }
2554 
2556 {
2557  bool bEnable = m_xMirrorHorzBox->get_active();
2558 
2559  m_aBmpWin.MirrorHorz( m_xMirrorVertBox->get_active() );
2560  m_aBmpWin.MirrorVert( bEnable );
2561 
2562  m_xAllPagesRB->set_sensitive(bEnable);
2563  m_xLeftPagesRB->set_sensitive(bEnable);
2564  m_xRightPagesRB->set_sensitive(bEnable);
2565 
2566  if (!m_xAllPagesRB->get_active() && !m_xLeftPagesRB->get_active() && !m_xRightPagesRB->get_active())
2567  m_xAllPagesRB->set_active(true);
2568 }
2569 
2570 // example window
2572  : bHorz(false)
2573  , bVert(false)
2574  , bGraphic(false)
2575 {
2576 }
2577 
2579 {
2580  CustomWidgetController::SetDrawingArea(pDrawingArea);
2581  Size aSize = pDrawingArea->get_ref_device().LogicToPixel(Size(127 , 66), MapMode(MapUnit::MapAppFont));
2582  set_size_request(aSize.Width(), aSize.Height());
2583  SetOutputSizePixel(aSize);
2584 }
2585 
2587 {
2588  // Setup
2589  rRenderContext.SetBackground();
2590  // #i119307# the graphic might have transparency, set up white as the color
2591  // to use when drawing a rectangle under the image
2592  rRenderContext.SetLineColor(COL_WHITE);
2593  rRenderContext.SetFillColor(COL_WHITE);
2594 
2595  // Paint
2596  Point aPntPos;
2597  Size aPntSz(GetOutputSizePixel());
2598  Size aGrfSize;
2599  if (bGraphic)
2600  aGrfSize = ::GetGraphicSizeTwip(aGraphic, &rRenderContext);
2601  //it should show the default bitmap also if no graphic can be found
2602  if (!aGrfSize.Width() && !aGrfSize.Height())
2603  aGrfSize = rRenderContext.PixelToLogic(aBmp.GetSizePixel());
2604 
2605  long nRelGrf = aGrfSize.Width() * 100 / aGrfSize.Height();
2606  long nRelWin = aPntSz.Width() * 100 / aPntSz.Height();
2607  if (nRelGrf < nRelWin)
2608  {
2609  const long nWidth = aPntSz.Width();
2610  // if we use a replacement preview, try to draw at original size
2611  if (!bGraphic && (aGrfSize.Width() <= aPntSz.Width())
2612  && (aGrfSize.Height() <= aPntSz.Height()))
2613  {
2614  const long nHeight = aPntSz.Height();
2615  aPntSz.setWidth( aGrfSize.Width() );
2616  aPntSz.setHeight( aGrfSize.Height() );
2617  aPntPos.AdjustY((nHeight - aPntSz.Height()) / 2 );
2618  }
2619  else
2620  aPntSz.setWidth( aPntSz.Height() * nRelGrf /100 );
2621 
2622  aPntPos.AdjustX(nWidth - aPntSz.Width() ) ;
2623  }
2624 
2625  // #i119307# clear window background, the graphic might have transparency
2626  rRenderContext.DrawRect(tools::Rectangle(aPntPos, aPntSz));
2627 
2628  if (bHorz || bVert)
2629  {
2630  BitmapEx aTmpBmp(bGraphic ? aGraphic.GetBitmapEx() : aBmp);
2631  BmpMirrorFlags nMirrorFlags(BmpMirrorFlags::NONE);
2632  if (bHorz)
2633  nMirrorFlags |= BmpMirrorFlags::Vertical;
2634  if (bVert)
2635  nMirrorFlags |= BmpMirrorFlags::Horizontal;
2636  aTmpBmp.Mirror(nMirrorFlags);
2637  rRenderContext.DrawBitmapEx(aPntPos, aPntSz, aTmpBmp);
2638  }
2639  else if (bGraphic) //draw unmirrored preview graphic
2640  {
2641  aGraphic.Draw(&rRenderContext, aPntPos, aPntSz);
2642  }
2643  else //draw unmirrored stock sample image
2644  {
2645  rRenderContext.DrawBitmapEx(aPntPos, aPntSz, aBmp);
2646  }
2647 }
2648 
2650 {
2651 }
2652 
2653 void BmpWindow::SetGraphic(const Graphic& rGraphic)
2654 {
2655  aGraphic = rGraphic;
2656  Size aSize = aGraphic.GetPrefSize();
2657  bGraphic = aSize.Width() && aSize.Height();
2658  Invalidate();
2659 }
2660 
2662 {
2663  aBmp = rBmp;
2664  Invalidate();
2665 }
2666 
2667 // set URL and ImageMap at frames
2669  : SfxTabPage(pParent, "modules/swriter/ui/frmurlpage.ui", "FrameURLPage", &rSet)
2670  , m_xURLED(m_xBuilder->weld_entry("url"))
2671  , m_xSearchPB(m_xBuilder->weld_button("search"))
2672  , m_xNameED(m_xBuilder->weld_entry("name"))
2673  , m_xFrameCB(m_xBuilder->weld_combo_box("frame"))
2674  , m_xServerCB(m_xBuilder->weld_check_button("server"))
2675  , m_xClientCB(m_xBuilder->weld_check_button("client"))
2676 {
2677  m_xSearchPB->connect_clicked(LINK(this, SwFrameURLPage, InsertFileHdl));
2678 }
2679 
2681 {
2682  disposeOnce();
2683 }
2684 
2686 {
2687  const SfxPoolItem* pItem;
2688  if ( SfxItemState::SET == rSet->GetItemState( SID_DOCFRAME, true, &pItem))
2689  {
2690  std::unique_ptr<TargetList> pList(new TargetList);
2692  size_t nCount = pList->size();
2693  for (size_t i = 0; i < nCount; ++i)
2694  {
2695  m_xFrameCB->append_text(pList->at(i));
2696  }
2697  }
2698 
2699  if ( SfxItemState::SET == rSet->GetItemState( RES_URL, true, &pItem ) )
2700  {
2701  const SwFormatURL* pFormatURL = static_cast<const SwFormatURL*>(pItem);
2702  m_xURLED->set_text(INetURLObject::decode(pFormatURL->GetURL(),
2704  m_xNameED->set_text(pFormatURL->GetName());
2705 
2706  m_xClientCB->set_sensitive(pFormatURL->GetMap() != nullptr);
2707  m_xClientCB->set_active(pFormatURL->GetMap() != nullptr);
2708  m_xServerCB->set_active(pFormatURL->IsServerMap());
2709 
2710  m_xFrameCB->set_entry_text(pFormatURL->GetTargetFrameName());
2711  m_xFrameCB->save_value();
2712  }
2713  else
2714  m_xClientCB->set_sensitive(false);
2715 
2716  m_xServerCB->save_state();
2717  m_xClientCB->save_state();
2718 }
2719 
2721 {
2722  bool bModified = false;
2723  const SwFormatURL* pOldURL = GetOldItem(*rSet, RES_URL);
2724  std::unique_ptr<SwFormatURL> pFormatURL;
2725  if(pOldURL)
2726  pFormatURL.reset(static_cast<SwFormatURL*>(pOldURL->Clone()));
2727  else
2728  pFormatURL.reset(new SwFormatURL());
2729 
2730  {
2731  const OUString sText = m_xURLED->get_text();
2732 
2733  if( pFormatURL->GetURL() != sText ||
2734  pFormatURL->GetName() != m_xNameED->get_text() ||
2735  m_xServerCB->get_active() != pFormatURL->IsServerMap() )
2736  {
2737  pFormatURL->SetURL(sText, m_xServerCB->get_active());
2738  pFormatURL->SetName(m_xNameED->get_text());
2739  bModified = true;
2740  }
2741  }
2742 
2743  if (!m_xClientCB->get_active() && pFormatURL->GetMap() != nullptr)
2744  {
2745  pFormatURL->SetMap(nullptr);
2746  bModified = true;
2747  }
2748 
2749  if(pFormatURL->GetTargetFrameName() != m_xFrameCB->get_active_text())
2750  {
2751  pFormatURL->SetTargetFrameName(m_xFrameCB->get_active_text());
2752  bModified = true;
2753  }
2754  rSet->Put(*pFormatURL);
2755  return bModified;
2756 }
2757 
2759 {
2760  return VclPtr<SwFrameURLPage>::Create(pParent, *rSet);
2761 }
2762 
2764 {
2765  FileDialogHelper aDlgHelper(ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE,
2766  FileDialogFlags::NONE, GetFrameWeld());
2767  uno::Reference < ui::dialogs::XFilePicker3 > xFP = aDlgHelper.GetFilePicker();
2768 
2769  try
2770  {
2771  const OUString sTemp(m_xURLED->get_text());
2772  if(!sTemp.isEmpty())
2773  xFP->setDisplayDirectory(sTemp);
2774  }
2775  catch( const uno::Exception& ) {}
2776  if( aDlgHelper.Execute() == ERRCODE_NONE )
2777  {
2778  m_xURLED->set_text(xFP->getSelectedFiles().getConstArray()[0]);
2779  }
2780 }
2781 
2783  : SfxTabPage(pParent, "modules/swriter/ui/frmaddpage.ui", "FrameAddPage", &rSet)
2784  , m_pWrtSh(nullptr)
2785  , m_bHtmlMode(false)
2786  , m_bFormat(false)
2787  , m_bNew(false)
2788  , m_xNameFrame(m_xBuilder->weld_widget("nameframe"))
2789  , m_xNameFT(m_xBuilder->weld_label("name_label"))
2790  , m_xNameED(m_xBuilder->weld_entry("name"))
2791  , m_xAltNameFT(m_xBuilder->weld_label("altname_label"))
2792  , m_xAltNameED(m_xBuilder->weld_entry("altname"))
2793  , m_xDescriptionFT(m_xBuilder->weld_label("description_label"))
2794  , m_xDescriptionED(m_xBuilder->weld_text_view("description"))
2795  , m_xPrevFT(m_xBuilder->weld_label("prev_label"))
2796  , m_xPrevLB(m_xBuilder->weld_combo_box("prev"))
2797  , m_xNextFT(m_xBuilder->weld_label("next_label"))
2798  , m_xNextLB(m_xBuilder->weld_combo_box("next"))
2799  , m_xProtectFrame(m_xBuilder->weld_widget("protect"))
2800  , m_xProtectContentCB(m_xBuilder->weld_check_button("protectcontent"))
2801  , m_xProtectFrameCB(m_xBuilder->weld_check_button("protectframe"))
2802  , m_xProtectSizeCB(m_xBuilder->weld_check_button("protectsize"))
2803  , m_xContentAlignFrame(m_xBuilder->weld_widget("contentalign"))
2804  , m_xVertAlignLB(m_xBuilder->weld_combo_box("vertalign"))
2805  , m_xPropertiesFrame(m_xBuilder->weld_widget("properties"))
2806  , m_xEditInReadonlyCB(m_xBuilder->weld_check_button("editinreadonly"))
2807  , m_xPrintFrameCB(m_xBuilder->weld_check_button("printframe"))
2808  , m_xTextFlowFT(m_xBuilder->weld_label("textflow_label"))
2809  , m_xTextFlowLB(new svx::FrameDirectionListBox(m_xBuilder->weld_combo_box("textflow")))
2810 {
2811  m_xTextFlowLB->append(SvxFrameDirection::Horizontal_LR_TB, SvxResId(RID_SVXSTR_FRAMEDIR_LTR));
2812  m_xTextFlowLB->append(SvxFrameDirection::Horizontal_RL_TB, SvxResId(RID_SVXSTR_FRAMEDIR_RTL));
2813  m_xTextFlowLB->append(SvxFrameDirection::Vertical_RL_TB, SvxResId(RID_SVXSTR_PAGEDIR_RTL_VERT));
2814  m_xTextFlowLB->append(SvxFrameDirection::Vertical_LR_TB, SvxResId(RID_SVXSTR_PAGEDIR_LTR_VERT));
2815  m_xTextFlowLB->append(SvxFrameDirection::Vertical_LR_BT, SvxResId(RID_SVXSTR_PAGEDIR_LTR_BTT_VERT));
2816  m_xTextFlowLB->append(SvxFrameDirection::Environment, SvxResId(RID_SVXSTR_FRAMEDIR_SUPER));
2817  m_xDescriptionED->set_size_request(-1, m_xDescriptionED->get_preferred_size().Height());
2818 }
2819 
2821 {
2822  disposeOnce();
2823 }
2824 
2826 {
2827  m_xTextFlowLB.reset();
2829 }
2830 
2832 {
2833  return VclPtr<SwFrameAddPage>::Create(pParent, *rSet);
2834 }
2835 
2837 {
2838  const SfxPoolItem* pItem;
2839  sal_uInt16 nHtmlMode = ::GetHtmlMode(static_cast<const SwDocShell*>(SfxObjectShell::Current()));
2840  m_bHtmlMode = (nHtmlMode & HTMLMODE_ON) != 0;
2841  if (m_bHtmlMode)
2842  {
2843  m_xProtectFrame->hide();
2844  m_xEditInReadonlyCB->hide();
2845  m_xPrintFrameCB->hide();
2846  }
2847  if (m_sDlgType == "PictureDialog" || m_sDlgType == "ObjectDialog")
2848  {
2849  m_xEditInReadonlyCB->hide();
2850  if (m_bHtmlMode)
2851  {
2852  m_xPropertiesFrame->hide();
2853  }
2854  m_xContentAlignFrame->hide();
2855  }
2856 
2857  if(SfxItemState::SET == rSet->GetItemState(FN_SET_FRM_ALT_NAME, false, &pItem))
2858  {
2859  m_xAltNameED->set_text(static_cast<const SfxStringItem*>(pItem)->GetValue());
2860  m_xAltNameED->save_value();
2861  }
2862 
2863  if(SfxItemState::SET == rSet->GetItemState(FN_UNO_DESCRIPTION, false, &pItem))
2864  {
2865  m_xDescriptionED->set_text(static_cast<const SfxStringItem*>(pItem)->GetValue());
2866  m_xDescriptionED->save_value();
2867  }
2868 
2869  if(!m_bFormat)
2870  {
2871  // insert graphic - properties
2872  // bNew is not set, so recognise by selection
2873  OUString aTmpName1;
2874  if(SfxItemState::SET == rSet->GetItemState(FN_SET_FRM_NAME, false, &pItem))
2875  {
2876  aTmpName1 = static_cast<const SfxStringItem*>(pItem)->GetValue();
2877  }
2878 
2879  OSL_ENSURE(m_pWrtSh, "no Shell?");
2880  if( m_bNew || aTmpName1.isEmpty() )
2881  {
2882  if (m_sDlgType == "PictureDialog")
2883  aTmpName1 = m_pWrtSh->GetUniqueGrfName();
2884  else if (m_sDlgType == "ObjectDialog")
2885  aTmpName1 = m_pWrtSh->GetUniqueOLEName();
2886  else
2887  aTmpName1 = m_pWrtSh->GetUniqueFrameName();
2888 
2889  m_pWrtSh->SetFlyName(aTmpName1);
2890  }
2891 
2892  m_xNameED->set_text( aTmpName1 );
2893  m_xNameED->save_value();
2894  }
2895  else
2896  {
2897  m_xNameED->set_sensitive( false );
2898  m_xAltNameED->set_sensitive(false);
2899  m_xNameFT->set_sensitive( false );
2900  m_xAltNameFT->set_sensitive(false);
2901  }
2902  if (m_sDlgType == "FrameDialog" && m_xAltNameFT->get_visible())
2903  {
2904  m_xAltNameFT->hide();
2905  m_xAltNameED->hide();
2906  }
2907  else
2908  {
2909  m_xNameED->connect_changed(LINK(this, SwFrameAddPage, EditModifyHdl));
2910  }
2911 
2912  if (!m_bNew)
2913  {
2915 
2916  if (pFormat)
2917  {
2918  const SwFormatChain &rChain = pFormat->GetChain();
2919  const SwFlyFrameFormat* pFlyFormat;
2920  OUString sNextChain, sPrevChain;
2921  if ((pFlyFormat = rChain.GetPrev()) != nullptr)
2922  {
2923  sPrevChain = pFlyFormat->GetName();
2924  }
2925 
2926  if ((pFlyFormat = rChain.GetNext()) != nullptr)
2927  {
2928  sNextChain = pFlyFormat->GetName();
2929  }
2930  //determine chainable frames
2931  std::vector< OUString > aPrevPageFrames;
2932  std::vector< OUString > aThisPageFrames;
2933  std::vector< OUString > aNextPageFrames;
2934  std::vector< OUString > aRemainFrames;
2935  m_pWrtSh->GetConnectableFrameFormats(*pFormat, sNextChain, false,
2936  aPrevPageFrames, aThisPageFrames, aNextPageFrames, aRemainFrames );
2937  for (sal_Int32 nEntry = m_xPrevLB->get_count(); nEntry > 1; nEntry--)
2938  m_xPrevLB->remove(nEntry - 1);
2939  lcl_InsertVectors(*m_xPrevLB, aPrevPageFrames, aThisPageFrames, aNextPageFrames, aRemainFrames);
2940  if(!sPrevChain.isEmpty())
2941  {
2942  if (m_xPrevLB->find_text(sPrevChain) == -1)
2943  m_xPrevLB->insert_text(1, sPrevChain);
2944  m_xPrevLB->set_active_text(sPrevChain);
2945  }
2946  else
2947  m_xPrevLB->set_active(0);
2948  aPrevPageFrames.clear();
2949  aNextPageFrames.clear();
2950  aThisPageFrames.clear();
2951  aRemainFrames.clear();
2952 
2953  m_pWrtSh->GetConnectableFrameFormats(*pFormat, sPrevChain, true,
2954  aPrevPageFrames, aThisPageFrames, aNextPageFrames, aRemainFrames );
2955  for (sal_Int32 nEntry = m_xNextLB->get_count(); nEntry > 1; nEntry--)
2956  m_xNextLB->remove(nEntry - 1);
2957  lcl_InsertVectors(*m_xNextLB, aPrevPageFrames, aThisPageFrames, aNextPageFrames, aRemainFrames);
2958  if(!sNextChain.isEmpty())
2959  {
2960  if (m_xNextLB->find_text(sNextChain) == -1)
2961  m_xNextLB->insert_text(1, sNextChain);
2962  m_xNextLB->set_active_text(sNextChain);
2963  }
2964  else
2965  m_xNextLB->set_active(0);
2966  Link<weld::ComboBox&,void> aLink(LINK(this, SwFrameAddPage, ChainModifyHdl));
2967  m_xPrevLB->connect_changed(aLink);
2968  m_xNextLB->connect_changed(aLink);
2969  }
2970  }
2971  // Pos Protected
2972  const SvxProtectItem& rProt = rSet->Get(RES_PROTECT);
2973  m_xProtectFrameCB->set_active(rProt.IsPosProtected());
2974  m_xProtectContentCB->set_active(rProt.IsContentProtected());
2975  m_xProtectSizeCB->set_active(rProt.IsSizeProtected());
2976 
2978  m_xEditInReadonlyCB->set_active(rEdit.GetValue());
2979  m_xEditInReadonlyCB->save_state();
2980 
2981  // print
2982  const SvxPrintItem& rPrt = rSet->Get(RES_PRINT);
2983  m_xPrintFrameCB->set_active(rPrt.GetValue());
2984  m_xPrintFrameCB->save_state();
2985 
2986  // textflow
2987  if( (!m_bHtmlMode || (0 != (nHtmlMode&HTMLMODE_SOME_STYLES)))
2988  && m_sDlgType != "PictureDialog" && m_sDlgType != "ObjectDialog"
2989  && SfxItemState::UNKNOWN != rSet->GetItemState( RES_FRAMEDIR ) )
2990  {
2991  m_xTextFlowFT->show();
2992  m_xTextFlowLB->show();
2993 
2994  //vertical text flow is not possible in HTML
2995  if(m_bHtmlMode)
2996  {
2997  m_xTextFlowLB->remove_id(SvxFrameDirection::Vertical_RL_TB);
2998  }
2999  SvxFrameDirection nVal = rSet->Get(RES_FRAMEDIR).GetValue();
3000  m_xTextFlowLB->set_active_id(nVal);
3001  m_xTextFlowLB->save_value();
3002  }
3003  else
3004  {
3005  m_xTextFlowFT->hide();
3006  m_xTextFlowLB->hide();
3007  }
3008 
3009  // Content alignment
3010  if ( rSet->GetItemState(RES_TEXT_VERT_ADJUST) > SfxItemState::DEFAULT )
3011  {
3012  SdrTextVertAdjust nAdjust = rSet->Get(RES_TEXT_VERT_ADJUST).GetValue();
3013  sal_Int32 nPos = 0;
3014  switch(nAdjust)
3015  {
3016  case SDRTEXTVERTADJUST_TOP: nPos = 0; break;
3018  case SDRTEXTVERTADJUST_BLOCK: nPos = 1; break;
3019  case SDRTEXTVERTADJUST_BOTTOM: nPos = 2; break;
3020  }
3021  m_xVertAlignLB->set_active(nPos);
3022  }
3023  m_xVertAlignLB->save_value();
3024 }
3025 
3027 {
3028  bool bRet = false;
3029  if (m_xNameED->get_value_changed_from_saved())
3030  bRet |= nullptr != rSet->Put(SfxStringItem(FN_SET_FRM_NAME, m_xNameED->get_text()));
3031  if (m_xAltNameED->get_value_changed_from_saved())
3032  bRet |= nullptr != rSet->Put(SfxStringItem(FN_SET_FRM_ALT_NAME, m_xAltNameED->get_text()));
3033  if (m_xDescriptionED->get_value_changed_from_saved())
3034  bRet |= nullptr != rSet->Put(SfxStringItem(FN_UNO_DESCRIPTION, m_xDescriptionED->get_text()));
3035 
3036  const SfxPoolItem* pOldItem;
3038  aProt.SetContentProtect( m_xProtectContentCB->get_active() );
3039  aProt.SetSizeProtect ( m_xProtectSizeCB->get_active() );
3040  aProt.SetPosProtect ( m_xProtectFrameCB->get_active() );
3041  if ( nullptr == (pOldItem = GetOldItem(*rSet, FN_SET_PROTECT)) ||
3042  aProt != *pOldItem )
3043  bRet |= nullptr != rSet->Put( aProt);
3044 
3045  if ( m_xEditInReadonlyCB->get_state_changed_from_saved() )
3046  bRet |= nullptr != rSet->Put( SwFormatEditInReadonly( RES_EDIT_IN_READONLY, m_xEditInReadonlyCB->get_active()));
3047 
3048  if ( m_xPrintFrameCB->get_state_changed_from_saved() )
3049  bRet |= nullptr != rSet->Put( SvxPrintItem( RES_PRINT, m_xPrintFrameCB->get_active()));
3050 
3051  // textflow
3052  if (m_xTextFlowLB->get_visible() && m_xTextFlowLB->get_value_changed_from_saved())
3053  {
3054  SvxFrameDirection eDirection = m_xTextFlowLB->get_active_id();
3055  bRet |= nullptr != rSet->Put( SvxFrameDirectionItem(eDirection, RES_FRAMEDIR ));
3056  }
3057  if(m_pWrtSh)
3058  {
3059  const SwFrameFormat* pFormat = m_pWrtSh->GetFlyFrameFormat();
3060  if (pFormat)
3061  {
3062  OUString sCurrentPrevChain, sCurrentNextChain;
3063  if (m_xPrevLB->get_active())
3064  sCurrentPrevChain = m_xPrevLB->get_active_text();
3065  if (m_xNextLB->get_active())
3066  sCurrentNextChain = m_xNextLB->get_active_text();
3067  const SwFormatChain &rChain = pFormat->GetChain();
3068  const SwFlyFrameFormat* pFlyFormat;
3069  OUString sNextChain, sPrevChain;
3070  if ((pFlyFormat = rChain.GetPrev()) != nullptr)
3071  sPrevChain = pFlyFormat->GetName();
3072 
3073  if ((pFlyFormat = rChain.GetNext()) != nullptr)
3074  sNextChain = pFlyFormat->GetName();
3075  if(sPrevChain != sCurrentPrevChain)
3076  bRet |= nullptr != rSet->Put(SfxStringItem(FN_PARAM_CHAIN_PREVIOUS, sCurrentPrevChain));
3077  if(sNextChain != sCurrentNextChain)
3078  bRet |= nullptr != rSet->Put(SfxStringItem(FN_PARAM_CHAIN_NEXT, sCurrentNextChain));
3079  }
3080  }
3081 
3082  if (m_xVertAlignLB->get_value_changed_from_saved())
3083  {
3084  SdrTextVertAdjust nAdjust;
3085  switch (m_xVertAlignLB->get_active())
3086  {
3087  default:
3088  case 0 : nAdjust = SDRTEXTVERTADJUST_TOP; break;
3089  case 1 : nAdjust = SDRTEXTVERTADJUST_CENTER; break;
3090  case 2 : nAdjust = SDRTEXTVERTADJUST_BOTTOM; break;
3091  }
3092  bRet |= nullptr != rSet->Put(SdrTextVertAdjustItem(nAdjust, RES_TEXT_VERT_ADJUST));
3093  }
3094 
3095  return bRet;
3096 }
3097 
3099 {
3100  bool bEnable = !m_xNameED->get_text().isEmpty();
3101  m_xAltNameED->set_sensitive(bEnable);
3102  m_xAltNameFT->set_sensitive(bEnable);
3103 }
3104 
3105 void SwFrameAddPage::SetFormatUsed(bool bFormatUsed)
3106 {
3107  m_bFormat = bFormatUsed;
3108  if (m_bFormat)
3109  {
3110  m_xNameFrame->hide();
3111  }
3112 }
3113 
3114 IMPL_LINK(SwFrameAddPage, ChainModifyHdl, weld::ComboBox&, rBox, void)
3115 {
3116  OUString sCurrentPrevChain, sCurrentNextChain;
3117  if (m_xPrevLB->get_active())
3118  sCurrentPrevChain = m_xPrevLB->get_active_text();
3119  if (m_xNextLB->get_active())
3120  sCurrentNextChain = m_xNextLB->get_active_text();
3121  SwFrameFormat* pFormat = m_pWrtSh->GetFlyFrameFormat();
3122  if (!pFormat)
3123  return;
3124 
3125  bool bNextBox = m_xNextLB.get() == &rBox;
3126  weld::ComboBox& rChangeLB = bNextBox ? *m_xPrevLB : *m_xNextLB;
3127  for (sal_Int32 nEntry = rChangeLB.get_count(); nEntry > 1; nEntry--)
3128  rChangeLB.remove(nEntry - 1);
3129  //determine chainable frames
3130  std::vector< OUString > aPrevPageFrames;
3131  std::vector< OUString > aThisPageFrames;
3132  std::vector< OUString > aNextPageFrames;
3133  std::vector< OUString > aRemainFrames;
3134  m_pWrtSh->GetConnectableFrameFormats(*pFormat, bNextBox ? sCurrentNextChain : sCurrentPrevChain, !bNextBox,
3135  aPrevPageFrames, aThisPageFrames, aNextPageFrames, aRemainFrames );
3136  lcl_InsertVectors(rChangeLB,
3137  aPrevPageFrames, aThisPageFrames, aNextPageFrames, aRemainFrames);
3138  const OUString sToSelect = bNextBox ? sCurrentPrevChain : sCurrentNextChain;
3139  if (rChangeLB.find_text(sToSelect) != -1)
3140  rChangeLB.set_active_text(sToSelect);
3141  else
3142  rChangeLB.set_active(0);
3143 
3144 }
3145 
3146 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: frmpage.cxx:1687
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:1436
std::unique_ptr< weld::CheckButton > m_xEditInReadonlyCB
Definition: frmpage.hxx:306
#define FN_HORI_ORIENT
Definition: cmdid.h:828
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:194
SDRTEXTVERTADJUST_TOP
#define RES_COL
Definition: hintids.hxx:214
static FrameMap const aHFrameMap[]
Definition: frmpage.cxx:212
static FrameMap const aVCharHtmlAbsMap[]
Definition: frmpage.cxx:343
sal_uInt16 GetPhyPageNum()
Phy: real page count.
Definition: fews.cxx:336
#define RES_URL
Definition: hintids.hxx:216
SwFrameAddPage(TabPageParent pParent, const SfxItemSet &rSet)
Definition: frmpage.cxx:2782
std::unique_ptr< weld::RadioButton > m_xAnchorAsCharRB
Definition: frmpage.hxx:98
std::unique_ptr< weld::Widget > m_xContentAlignFrame
Definition: frmpage.hxx:302
void SetWidthPercentRelation(sal_Int16 n)
Definition: fmtfsize.hxx:96
#define RES_EDIT_IN_READONLY
Definition: hintids.hxx:217
std::unique_ptr< weld::RadioButton > m_xLeftPagesRB
Definition: frmpage.hxx:214
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:2281
OUString aFilterName
Definition: frmpage.hxx:200
static constexpr auto HORI_PARA_REL
Definition: frmpage.cxx:244
OUString m_sDlgType
Definition: frmpage.hxx:280
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:793
static void GetDefaultTargetList(TargetList &)
void SetGrfToggle(bool bNew)
Definition: grfatr.hxx:66
std::unique_ptr< weld::CheckButton > m_xProtectSizeCB
Definition: frmpage.hxx:300
static const sal_uInt16 aAddPgRg[]
Definition: frmpage.hxx:314
#define RES_HORI_ORIENT
Definition: hintids.hxx:208
SwGrfExtPage(TabPageParent pParent, const SfxItemSet &rSet)
Definition: frmpage.cxx:2292
static VclPtr< SfxTabPage > Create(TabPageParent pParent, const SfxItemSet *rSet)
Definition: frmpage.cxx:2831
std::string GetValue
void FitToActualSize(SwFormatCol &rCol, sal_uInt16 nWidth)
Definition: colmgr.cxx:35
void SetFormatUsed(bool bFormat)
Definition: frmpage.cxx:2274
void EnableGraficMode()
Definition: frmpage.cxx:829
long Height() const
Frame
#define FN_PARAM_GRF_CONNECT
Definition: cmdid.h:759
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:307
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:295
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:1221
#define RES_FRAMEDIR
Definition: hintids.hxx:225
#define RES_SURROUND
Definition: hintids.hxx:206
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:2685
#define FN_OLE_IS_MATH
Definition: cmdid.h:599
#define FN_SET_FRM_ALT_NAME
Definition: cmdid.h:832
LB const nLBRelations
Definition: frmpage.cxx:139
bool IsInGraficMode()
Definition: frmpage.hxx:194
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:851
#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
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:1572
bool IsSizeProtected() const
virtual OUString get_active_id() const =0
std::unique_ptr< weld::CheckButton > m_xProtectContentCB
Definition: frmpage.hxx:298
sal_uInt16 m_nHtmlMode
Definition: frmpage.hxx:51
std::unique_ptr< weld::Button > m_xBrowseBT
Definition: frmpage.hxx:218
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:205
std::unique_ptr< weld::Entry > m_xNameED
Definition: frmpage.hxx:254
virtual void dispose() override
Definition: frmpage.cxx:2825
std::unique_ptr< weld::Widget > m_xPropertiesFrame
Definition: frmpage.hxx:305
virtual int get_count() const =0
Size const & GetOutputSizePixel() const
bool m_bHtmlMode
Definition: frmpage.hxx:50
#define RES_GRFATR_MIRRORGRF
Definition: hintids.hxx:239
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:1731
SvxSwFramePosString::StringId eStrId
std::unique_ptr< weld::Entry > m_xNameED
Definition: frmpage.hxx:287
Used by the UI to modify the document model.
Definition: wrtsh.hxx:88
#define FN_VERT_ORIENT
Definition: cmdid.h:827
std::unique_ptr< weld::ComboBox > m_xVertAlignLB
Definition: frmpage.hxx:303
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:281
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:426
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:1746
OUString SvxResId(const char *pId)
static RelationMap const aAsCharRelationMap[]
Definition: frmpage.cxx:169
SwWrtShell * m_pWrtSh
Definition: frmpage.hxx:278
bool m_bFormat
Definition: frmpage.hxx:43
virtual void Reset(const SfxItemSet *rSet) override
Definition: frmpage.cxx:2836
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:259
const OUString & GetName() const
Definition: format.hxx:111
void SetExchangeSupport()
bool IsValueModified() const
RndStdIds GetAnchor()
Definition: frmpage.cxx:1650
void set_accessible_name(const OUString &rName)
std::unique_ptr< weld::Widget > m_xAnchorFrame
Definition: frmpage.hxx:94
void UpdateExample()
Definition: frmpage.cxx:2063
#define RES_UL_SPACE
Definition: hintids.hxx:197
const Graphic * GetGraphic(OUString const &referer=OUString()) const
static OUString GetString(StringId eId)
virtual OutputDevice & get_ref_device()=0
std::unique_ptr< weld::CheckButton > m_xRelHeightCB
Definition: frmpage.hxx:86
#define RES_PRINT
Definition: hintids.hxx:203
virtual void dispose() override
#define HTML_HORI_CHAR_REL
Definition: frmpage.cxx:300
virtual ~SwGrfExtPage() override
Definition: frmpage.cxx:2320
void append_separator()
bool bHorz
Definition: bmpwin.hxx:34
void SetVAlign(short nV)
void DrawRect(const tools::Rectangle &rRect)
std::unique_ptr< weld::MetricSpinButton > m_xAtVertPosED
Definition: frmpage.hxx:114
const OUString & GetName() const
Definition: fmturl.hxx:71
#define RES_FOLLOW_TEXT_FLOW
Definition: hintids.hxx:228
#define FN_PARAM_GRF_REALSIZE
Definition: cmdid.h:764
const SfxItemSet & GetItemSet() const
std::unique_ptr< weld::Label > m_xNameFT
Definition: frmpage.hxx:286
void SetWidth(long n)
SwFrameURLPage(TabPageParent pParent, const SfxItemSet &rSet)
Definition: frmpage.cxx:2668
#define SAL_N_ELEMENTS(arr)
void Init(const SfxItemSet &rSet)
Definition: frmpage.cxx:2090
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
virtual void dispose() override
Definition: frmpage.cxx:2325
#define FN_UNO_DESCRIPTION
Definition: cmdid.h:834
const SfxPoolItem * GetOldItem(const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true)
SDRTEXTVERTADJUST_BOTTOM
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: frmpage.cxx:2720
#define SO3_SM_CLASSID_50
void SetLineColor()
void set_active_text(const OUString &rStr)
std::unique_ptr< weld::Button > m_xSearchPB
Definition: frmpage.hxx:253
void SetRotation(sal_Int32 nAngle)
Style of a layout element.
Definition: frmfmt.hxx:57
void SetFormatUsed(bool bFormat)
Definition: frmpage.cxx:3105
sal_Int16 const nAlign
Definition: frmpage.cxx:138
virtual ~SwFrameAddPage() override
Definition: frmpage.cxx:2820
IMPL_LINK_NOARG(SwFramePage, MirrorHdl, weld::ToggleButton &, void)
Definition: frmpage.cxx:1709
Size m_aGrfSize
Definition: frmpage.hxx:53
void Draw(OutputDevice *pOutDev, const Point &rDestPt) const
#define RES_ANCHOR
Definition: hintids.hxx:209
Only protection that cannot be withdrawn e.g.
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
SW_DLLPUBLIC FieldUnit GetDfltMetric(bool bWeb)
Definition: uitool.cxx:710
const SwColumns & GetColumns() const
Definition: fmtclds.hxx:112
#define FN_KEEP_ASPECT_RATIO
Definition: cmdid.h:830
long AdjustY(long nVertMove)
virtual ~BmpWindow() override
Definition: frmpage.cxx:2649
static FrameMap const aVParaMap[]
Definition: frmpage.cxx:274
GraphicType GetType() const
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: frmpage.cxx:2365
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
virtual void Reset(const SfxItemSet *rSet) override
Definition: frmpage.cxx:2338
bool m_bHtmlMode
Definition: frmpage.hxx:205
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:67
#define RES_VERT_ORIENT
Definition: hintids.hxx:207
SW_DLLPUBLIC void InsertStringSorted(const OUString &rId, const OUString &rEntry, weld::ComboBox &rToFill, int nOffset)
Definition: uitool.cxx:722
std::unique_ptr< weld::CheckButton > m_xProtectFrameCB
Definition: frmpage.hxx:299
void GetConnectableFrameFormats(SwFrameFormat &rFormat, const OUString &rReference, bool bSuccessors, std::vector< OUString > &aPrevPageVec, std::vector< OUString > &aThisPageVec, std::vector< OUString > &aNextPageVec, std::vector< OUString > &aRestVec)
Definition: fefly1.cxx:1831
std::unique_ptr< weld::Label > m_xHorizontalFT
Definition: frmpage.hxx:102
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: frmpage.cxx:3026
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:1584
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:825
std::unique_ptr< svx::FrameDirectionListBox > m_xTextFlowLB
Definition: frmpage.hxx:309
void MirrorHorz(bool bMirror)
Definition: bmpwin.hxx:46
bool bGraphic
Definition: bmpwin.hxx:36
std::unique_ptr< weld::Entry > m_xURLED
Definition: frmpage.hxx:252
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
weld::Window * GetFrameWeld(SfxFrame *pFrame)
Definition: dialoghelp.cxx:20
SwFrameSize GetWidthSizeType() const
Definition: fmtfsize.hxx:83
sal_Int16 GetHoriOrient() const
Definition: fmtornt.hxx:87
BmpMirrorFlags
std::unique_ptr< weld::Label > m_xAltNameFT
Definition: frmpage.hxx:288
std::unique_ptr< weld::CheckButton > m_xMirrorVertBox
Definition: frmpage.hxx:211
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:2502
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:732
void SetHAlign(short nH)
virtual void set_active(int pos)=0
std::unique_ptr< weld::Entry > m_xConnectED
Definition: frmpage.hxx:217
OUString SwResId(const char *pId)
Definition: swmodule.cxx:191
#define FN_MATH_BASELINE_ALIGNMENT
Definition: cmdid.h:600
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
static VclPtr< SfxTabPage > Create(TabPageParent pParent, const SfxItemSet *rSet)
Definition: frmpage.cxx:2333
#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:201
std::unique_ptr< weld::Entry > m_xAltNameED
Definition: frmpage.hxx:289
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:308
std::unique_ptr< weld::RadioButton > m_xAllPagesRB
Definition: frmpage.hxx:213
sal_Int32 FillPosLB(const FrameMap *_pMap, const sal_Int16 _nAlign, const sal_Int16 _nRel, weld::ComboBox &_rLB)
Definition: frmpage.cxx:1347
SwFramePage(TabPageParent pParent, const SfxItemSet &rSet)
Definition: frmpage.cxx:611
std::unique_ptr< weld::CheckButton > m_xAutoWidthCB
Definition: frmpage.hxx:82
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: frmpage.cxx:1673
static VclPtr< SfxTabPage > Create(TabPageParent pParent, const SfxItemSet *rSet)
Definition: frmpage.cxx:2758
sal_Int16 GetHeightPercentRelation() const
Definition: fmtfsize.hxx:89
std::unique_ptr< weld::Widget > m_xProtectFrame
Definition: frmpage.hxx:297
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:2578
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:794
const OUString & GetGraphicLink() const
std::unique_ptr< weld::CheckButton > m_xServerCB
Definition: frmpage.hxx:258
static sal_Int32 GetMapPos(const FrameMap *pMap, const weld::ComboBox &rAlignLB)
Definition: frmpage.cxx:1617
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:1296
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:1026
HTMLMODE_SOME_STYLES
std::unique_ptr< weld::RadioButton > m_xRightPagesRB
Definition: frmpage.hxx:215
std::unique_ptr<::sfx2::FileDialogHelper > m_xGrfDlg
Definition: frmpage.hxx:203
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:829
#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:1469
SwWrtShell * getFrameDlgParentShell()
Definition: frmpage.cxx:846
IMPL_LINK(SwFramePage, RelSizeClickHdl, weld::ToggleButton &, rBtn, void)
Definition: frmpage.cxx:1715
#define RES_OPAQUE
Definition: hintids.hxx:204
static constexpr auto VERT_CHAR_REL
Definition: frmpage.cxx:316
std::unique_ptr< weld::Widget > m_xMirror
Definition: frmpage.hxx:210
bool m_bIsVerticalFrame
Definition: frmpage.hxx:46
static VclPtr< reference_type > Create(Arg &&...arg)
double m_fWidthHeightRatio
Definition: frmpage.hxx:56
OUString aNewGrfName
Definition: frmpage.hxx:201
virtual void Paint(vcl::RenderContext &, const tools::Rectangle &rRect) override
Definition: frmpage.cxx:2586
static FrameMap const aVFrameMap[]
Definition: frmpage.cxx:229
static constexpr auto HORI_PAGE_REL
Definition: frmpage.cxx:177
void setOptimalRelWidth()
Definition: frmpage.cxx:791
svx::SvxDialControl m_aCtlAngle
Definition: frmpage.hxx:209
std::unique_ptr< weld::ComboBox > m_xFrameCB
Definition: frmpage.hxx:255
void SetHoriRel(short nR)
void SetHeight(long n)
static FrameMap const aVCharMap[]
Definition: frmpage.cxx:319
SfxOkDialogController * GetDialogController() const
std::unique_ptr< weld::CustomWeld > m_xCtlAngle
Definition: frmpage.hxx:224
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:285
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:293
void MirrorVert(bool bMirror)
Definition: bmpwin.hxx:45
const SwFrameFormat * GetFlyFrameFormat() const
Get FlyFrameFormat; for UI macro linkage at Flys.
Definition: fefly1.cxx:1235
virtual void remove(int pos)=0
SVX_DLLPUBLIC MSO_SPT Get(const OUString &)
void append_text(const OUString &rStr)
RndStdIds
OUString m_sDlgType
Definition: frmpage.hxx:52
virtual ~SwFrameURLPage() override
Definition: frmpage.cxx:2680
void SetContentProtect(bool bNew)
std::unique_ptr< weld::CustomWeld > m_xBmpWin
Definition: frmpage.hxx:225
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:2653
const Size & GetSizePixel() const
static VclPtr< SfxTabPage > Create(TabPageParent pParent, const SfxItemSet *rSet)
Definition: frmpage.cxx:824
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:2455
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:1401
BmpWindow m_aBmpWin
Definition: frmpage.hxx:208
std::unique_ptr< weld::CheckButton > m_xMirrorHorzBox
Definition: frmpage.hxx:212
Frame is variable in Var-direction.
Definition: fmtfsize.hxx:37
static const sal_uInt16 aPageRg[]
Definition: frmpage.hxx:179
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:223
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:235
void SetBitmapEx(const BitmapEx &rGrf)
Definition: frmpage.cxx:2661
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:291
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)