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