LibreOffice Module cui (master)  1
swpossizetabpage.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 <memory>
21 #include <cstddef>
22 #include <swpossizetabpage.hxx>
23 #include <svx/dlgutil.hxx>
24 #include <svx/anchorid.hxx>
25 #include <svl/aeitem.hxx>
26 #include <svl/intitem.hxx>
28 #include <sfx2/htmlmode.hxx>
29 #include <svx/svdview.hxx>
30 #include <svx/svdpagv.hxx>
32 #include <svx/rectenum.hxx>
33 #include <sal/macros.h>
34 #include <com/sun/star/text/HoriOrientation.hpp>
35 #include <com/sun/star/text/VertOrientation.hpp>
36 #include <com/sun/star/text/RelOrientation.hpp>
37 #include <svx/svxids.hrc>
38 #include <svtools/unitconv.hxx>
39 
40 using namespace ::com::sun::star::text;
41 
42 #define SwFPos SvxSwFramePosString
43 
44 namespace {
45 
46 enum class LB;
47 
48 }
49 
50 struct FrmMap
51 {
54  short nAlign;
56 };
57 
58 namespace {
59 
60 struct RelationMap
61 {
63  SvxSwFramePosString::StringId eMirrorStrId;
64  LB nLBRelation;
65  short nRelation;
66 };
67 struct StringIdPair_Impl
68 {
71 };
72 
73 enum class LB {
74  NONE = 0x000000,
75  Frame = 0x000001, // paragraph text area
76  PrintArea = 0x000002, // paragraph text area + indents
77  VertFrame = 0x000004, // vertical paragraph text area
78  VertPrintArea = 0x000008, // vertical paragraph text area + indents
79  RelFrameLeft = 0x000010, // left paragraph margin
80  RelFrameRight = 0x000020, // right paragraph margin
81 
82  RelPageLeft = 0x000040, // left page margin
83  RelPageRight = 0x000080, // right page margin
84  RelPageFrame = 0x000100, // complete page
85  RelPagePrintArea = 0x000200, // text area of page
86 
87  FlyRelPageLeft = 0x000400, // left frame margin
88  FlyRelPageRight = 0x000800, // right frame margin
89  FlyRelPageFrame = 0x001000, // complete frame
90  FlyRelPagePrintArea = 0x002000, // frame interior
91 
92  RelBase = 0x004000, // as char, relative to baseline
93  RelChar = 0x008000, // as char, relative to character
94  RelRow = 0x010000, // as char, relative to line
95 
96 // #i22305#
97  FlyVertFrame = 0x020000, // vertical entire frame
98  FlyVertPrintArea = 0x040000, // vertical frame text area
99 
100 // #i22341#
101  VertLine = 0x080000, // vertical text line
102 
103  LAST = VertLine
104 };
105 
106 }
107 
108 namespace o3tl {
109  template<> struct typed_flags<LB> : is_typed_flags<LB, 0x0fffff> {};
110 }
111 
112 static RelationMap const aRelationMap[] =
113 {
114  {SwFPos::FRAME, SwFPos::FRAME, LB::Frame, RelOrientation::FRAME},
115  {SwFPos::PRTAREA, SwFPos::PRTAREA, LB::PrintArea, RelOrientation::PRINT_AREA},
116  {SwFPos::REL_PG_LEFT, SwFPos::MIR_REL_PG_LEFT, LB::RelPageLeft, RelOrientation::PAGE_LEFT},
117  {SwFPos::REL_PG_RIGHT, SwFPos::MIR_REL_PG_RIGHT, LB::RelPageRight, RelOrientation::PAGE_RIGHT},
118  {SwFPos::REL_FRM_LEFT, SwFPos::MIR_REL_FRM_LEFT, LB::RelFrameLeft, RelOrientation::FRAME_LEFT},
119  {SwFPos::REL_FRM_RIGHT, SwFPos::MIR_REL_FRM_RIGHT, LB::RelFrameRight, RelOrientation::FRAME_RIGHT},
120  {SwFPos::REL_PG_FRAME, SwFPos::REL_PG_FRAME, LB::RelPageFrame, RelOrientation::PAGE_FRAME},
121  {SwFPos::REL_PG_PRTAREA,SwFPos::REL_PG_PRTAREA, LB::RelPagePrintArea, RelOrientation::PAGE_PRINT_AREA},
122  {SwFPos::REL_CHAR, SwFPos::REL_CHAR, LB::RelChar, RelOrientation::CHAR},
123 
124  {SwFPos::FLY_REL_PG_LEFT, SwFPos::FLY_MIR_REL_PG_LEFT, LB::FlyRelPageLeft, RelOrientation::PAGE_LEFT},
125  {SwFPos::FLY_REL_PG_RIGHT, SwFPos::FLY_MIR_REL_PG_RIGHT, LB::FlyRelPageRight, RelOrientation::PAGE_RIGHT},
126  {SwFPos::FLY_REL_PG_FRAME, SwFPos::FLY_REL_PG_FRAME, LB::FlyRelPageFrame, RelOrientation::PAGE_FRAME},
127  {SwFPos::FLY_REL_PG_PRTAREA, SwFPos::FLY_REL_PG_PRTAREA, LB::FlyRelPagePrintArea, RelOrientation::PAGE_PRINT_AREA},
128 
129  {SwFPos::REL_BORDER, SwFPos::REL_BORDER, LB::VertFrame, RelOrientation::FRAME},
130  {SwFPos::REL_PRTAREA, SwFPos::REL_PRTAREA, LB::VertPrintArea, RelOrientation::PRINT_AREA},
131 
132  // #i22305#
133  {SwFPos::FLY_REL_PG_FRAME, SwFPos::FLY_REL_PG_FRAME, LB::FlyVertFrame, RelOrientation::FRAME},
134  {SwFPos::FLY_REL_PG_PRTAREA, SwFPos::FLY_REL_PG_PRTAREA, LB::FlyVertPrintArea, RelOrientation::PRINT_AREA},
135 
136  // #i22341#
137  {SwFPos::REL_LINE, SwFPos::REL_LINE, LB::VertLine, RelOrientation::TEXT_LINE}
138 };
139 
140 static RelationMap const aAsCharRelationMap[] =
141 {
142  {SwFPos::REL_BASE, SwFPos::REL_BASE, LB::RelBase, RelOrientation::FRAME},
143  {SwFPos::REL_CHAR, SwFPos::REL_CHAR, LB::RelChar, RelOrientation::FRAME},
144  {SwFPos::REL_ROW, SwFPos::REL_ROW, LB::RelRow, RelOrientation::FRAME}
145 };
146 
147 /*--------------------------------------------------------------------
148  Anchored at page
149  --------------------------------------------------------------------*/
150 
151 static constexpr auto HORI_PAGE_REL = LB::RelPageFrame|LB::RelPagePrintArea|LB::RelPageLeft|
152  LB::RelPageRight;
153 
154 static FrmMap const aHPageMap[] =
155 {
156  {SwFPos::LEFT, SwFPos::MIR_LEFT, HoriOrientation::LEFT, HORI_PAGE_REL},
157  {SwFPos::RIGHT, SwFPos::MIR_RIGHT, HoriOrientation::RIGHT, HORI_PAGE_REL},
158  {SwFPos::CENTER_HORI,SwFPos::CENTER_HORI, HoriOrientation::CENTER, HORI_PAGE_REL},
159  {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, HoriOrientation::NONE, HORI_PAGE_REL}
160 };
161 
162 static FrmMap const aHPageHtmlMap[] =
163 {
164  {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, HoriOrientation::NONE, LB::RelPageFrame}
165 };
166 
167 #define VERT_PAGE_REL (LB::RelPageFrame|LB::RelPagePrintArea)
168 
169 static FrmMap const aVPageMap[] =
170 {
171  {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, VERT_PAGE_REL},
172  {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::BOTTOM, VERT_PAGE_REL},
173  {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::CENTER, VERT_PAGE_REL},
174  {SwFPos::FROMTOP, SwFPos::FROMTOP, VertOrientation::NONE, VERT_PAGE_REL}
175 };
176 
177 static FrmMap const aVPageHtmlMap[] =
178 {
179  {SwFPos::FROMTOP, SwFPos::FROMTOP, VertOrientation::NONE, LB::RelPageFrame}
180 };
181 
182 /*--------------------------------------------------------------------
183  Anchored at frame
184  --------------------------------------------------------------------*/
185 
186 static constexpr auto HORI_FRAME_REL = LB::FlyRelPageFrame|LB::FlyRelPagePrintArea|
187  LB::FlyRelPageLeft|LB::FlyRelPageRight;
188 
189 static FrmMap const aHFrameMap[] =
190 {
191  {SwFPos::LEFT, SwFPos::MIR_LEFT, HoriOrientation::LEFT, HORI_FRAME_REL},
192  {SwFPos::RIGHT, SwFPos::MIR_RIGHT, HoriOrientation::RIGHT, HORI_FRAME_REL},
193  {SwFPos::CENTER_HORI, SwFPos::CENTER_HORI, HoriOrientation::CENTER, HORI_FRAME_REL},
194  {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, HoriOrientation::NONE, HORI_FRAME_REL}
195 };
196 
197 static FrmMap const aHFlyHtmlMap[] =
198 {
199  {SwFPos::LEFT, SwFPos::MIR_LEFT, HoriOrientation::LEFT, LB::FlyRelPageFrame},
200  {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, HoriOrientation::NONE, LB::FlyRelPageFrame}
201 };
202 
203 // #i18732# - own vertical alignment map for to frame anchored objects
204 // #i22305#
205 #define VERT_FRAME_REL (LB::VertFrame|LB::FlyVertPrintArea)
206 
207 static FrmMap const aVFrameMap[] =
208 {
209  {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, VERT_FRAME_REL},
210  {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::BOTTOM, VERT_FRAME_REL},
211  {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::CENTER, VERT_FRAME_REL},
212  {SwFPos::FROMTOP, SwFPos::FROMTOP, VertOrientation::NONE, VERT_FRAME_REL}
213 };
214 
215 static FrmMap const aVFlyHtmlMap[] =
216 {
217  {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, LB::FlyVertFrame},
218  {SwFPos::FROMTOP, SwFPos::FROMTOP, VertOrientation::NONE, LB::FlyVertFrame}
219 };
220 
221 static FrmMap const aVMultiSelectionMap[] =
222 {
223  {SwFPos::FROMTOP, SwFPos::FROMTOP, VertOrientation::NONE, LB::NONE}
224 };
225 static FrmMap const aHMultiSelectionMap[] =
226 {
227  {SwFPos::FROMLEFT, SwFPos::FROMLEFT, HoriOrientation::NONE, LB::NONE}
228 };
229 
230 /*--------------------------------------------------------------------
231  Anchored at paragraph
232  --------------------------------------------------------------------*/
233 
234 static constexpr auto HORI_PARA_REL = LB::Frame|LB::PrintArea|LB::RelPageLeft|LB::RelPageRight|
235  LB::RelPageFrame|LB::RelPagePrintArea|LB::RelFrameLeft|
236  LB::RelFrameRight;
237 
238 static FrmMap const aHParaMap[] =
239 {
240  {SwFPos::LEFT, SwFPos::MIR_LEFT, HoriOrientation::LEFT, HORI_PARA_REL},
241  {SwFPos::RIGHT, SwFPos::MIR_RIGHT, HoriOrientation::RIGHT, HORI_PARA_REL},
242  {SwFPos::CENTER_HORI, SwFPos::CENTER_HORI, HoriOrientation::CENTER, HORI_PARA_REL},
243  {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, HoriOrientation::NONE, HORI_PARA_REL}
244 };
245 
246 #define HTML_HORI_PARA_REL (LB::Frame|LB::PrintArea)
247 
248 static FrmMap const aHParaHtmlMap[] =
249 {
250  {SwFPos::LEFT, SwFPos::LEFT, HoriOrientation::LEFT, HTML_HORI_PARA_REL},
251  {SwFPos::RIGHT, SwFPos::RIGHT, HoriOrientation::RIGHT, HTML_HORI_PARA_REL}
252 };
253 
254 static FrmMap const aHParaHtmlAbsMap[] =
255 {
256  {SwFPos::LEFT, SwFPos::MIR_LEFT, HoriOrientation::LEFT, HTML_HORI_PARA_REL},
257  {SwFPos::RIGHT, SwFPos::MIR_RIGHT, HoriOrientation::RIGHT, HTML_HORI_PARA_REL}
258 };
259 
260 
261 static constexpr auto VERT_PARA_REL = LB::VertFrame|LB::VertPrintArea|
262  LB::RelPageFrame|LB::RelPagePrintArea;
263 
264 static FrmMap const aVParaMap[] =
265 {
266  {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, VERT_PARA_REL},
267  {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::BOTTOM, VERT_PARA_REL},
268  {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::CENTER, VERT_PARA_REL},
269  {SwFPos::FROMTOP, SwFPos::FROMTOP, VertOrientation::NONE, VERT_PARA_REL}
270 };
271 
272 static FrmMap const aVParaHtmlMap[] =
273 {
274  {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, LB::VertPrintArea}
275 };
276 
277 /*--------------------------------------------------------------------
278  Anchored at character
279  --------------------------------------------------------------------*/
280 
281 static constexpr auto HORI_CHAR_REL = LB::Frame|LB::PrintArea|LB::RelPageLeft|LB::RelPageRight|
282  LB::RelPageFrame|LB::RelPagePrintArea|LB::RelFrameLeft|
283  LB::RelFrameRight|LB::RelChar;
284 
285 static FrmMap aHCharMap[] =
286 {
287  {SwFPos::LEFT, SwFPos::MIR_LEFT, HoriOrientation::LEFT, HORI_CHAR_REL},
288  {SwFPos::RIGHT, SwFPos::MIR_RIGHT, HoriOrientation::RIGHT, HORI_CHAR_REL},
289  {SwFPos::CENTER_HORI, SwFPos::CENTER_HORI, HoriOrientation::CENTER, HORI_CHAR_REL},
290  {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, HoriOrientation::NONE, HORI_CHAR_REL}
291 };
292 
293 #define HTML_HORI_CHAR_REL (LB::Frame|LB::PrintArea|LB::RelChar)
294 
296 {
297  {SwFPos::LEFT, SwFPos::LEFT, HoriOrientation::LEFT, HTML_HORI_CHAR_REL},
298  {SwFPos::RIGHT, SwFPos::RIGHT, HoriOrientation::RIGHT, HTML_HORI_CHAR_REL}
299 };
300 
302 {
303  {SwFPos::LEFT, SwFPos::MIR_LEFT, HoriOrientation::LEFT, LB::PrintArea|LB::RelChar},
304  {SwFPos::RIGHT, SwFPos::MIR_RIGHT, HoriOrientation::RIGHT, LB::PrintArea},
305  {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, HoriOrientation::NONE, LB::RelPageFrame}
306 };
307 
308 // #i18732# - allow vertical alignment at page areas
309 // #i22341# - handle <LB::RelChar> on its own
310 static constexpr auto VERT_CHAR_REL = LB::VertFrame|LB::VertPrintArea|
311  LB::RelPageFrame|LB::RelPagePrintArea;
312 
313 static FrmMap aVCharMap[] =
314 {
315  // #i22341#
316  // introduce mappings for new vertical alignment at top of line <LB::VertLine>
317  // and correct mapping for vertical alignment at character for position <FROM_BOTTOM>
318  // Note: because of these adjustments the map becomes ambiguous in its values
319  // <eStrId>/<eMirrorStrId> and <nAlign>. These ambiguities are considered
320  // in the methods <SwFrmPage::FillRelLB(..)>, <SwFrmPage::GetAlignment(..)>
321  // and <SwFrmPage::FillPosLB(..)>
322  {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, VERT_CHAR_REL|LB::RelChar},
323  {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::BOTTOM, VERT_CHAR_REL|LB::RelChar},
324  {SwFPos::BELOW, SwFPos::BELOW, VertOrientation::CHAR_BOTTOM, LB::RelChar},
325  {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::CENTER, VERT_CHAR_REL|LB::RelChar},
326  {SwFPos::FROMTOP, SwFPos::FROMTOP, VertOrientation::NONE, VERT_CHAR_REL},
327  {SwFPos::FROMBOTTOM, SwFPos::FROMBOTTOM, VertOrientation::NONE, LB::RelChar|LB::VertLine},
328  {SwFPos::TOP, SwFPos::TOP, VertOrientation::LINE_TOP, LB::VertLine},
329  {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::LINE_BOTTOM, LB::VertLine},
330  {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::LINE_CENTER, LB::VertLine}
331 };
332 
333 
334 static FrmMap const aVCharHtmlMap[] =
335 {
336  {SwFPos::BELOW, SwFPos::BELOW, VertOrientation::CHAR_BOTTOM, LB::RelChar}
337 };
338 
339 static FrmMap const aVCharHtmlAbsMap[] =
340 {
341  {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, LB::RelChar},
342  {SwFPos::BELOW, SwFPos::BELOW, VertOrientation::CHAR_BOTTOM, LB::RelChar}
343 };
344 /*--------------------------------------------------------------------
345  anchored as character
346  --------------------------------------------------------------------*/
347 
348 static FrmMap const aVAsCharMap[] =
349 {
350  {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, LB::RelBase},
351  {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::BOTTOM, LB::RelBase},
352  {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::CENTER, LB::RelBase},
353 
354  {SwFPos::TOP, SwFPos::TOP, VertOrientation::CHAR_TOP, LB::RelChar},
355  {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::CHAR_BOTTOM, LB::RelChar},
356  {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::CHAR_CENTER, LB::RelChar},
357 
358  {SwFPos::TOP, SwFPos::TOP, VertOrientation::LINE_TOP, LB::RelRow},
359  {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::LINE_BOTTOM, LB::RelRow},
360  {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::LINE_CENTER, LB::RelRow},
361 
362  {SwFPos::FROMBOTTOM, SwFPos::FROMBOTTOM, VertOrientation::NONE, LB::RelBase}
363 };
364 
365 static FrmMap const aVAsCharHtmlMap[] =
366 {
367  {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, LB::RelBase},
368  {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::CENTER, LB::RelBase},
369 
370  {SwFPos::TOP, SwFPos::TOP, VertOrientation::CHAR_TOP, LB::RelChar},
371 
372  {SwFPos::TOP, SwFPos::TOP, VertOrientation::LINE_TOP, LB::RelRow},
373  {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::LINE_BOTTOM, LB::RelRow},
374  {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::LINE_CENTER, LB::RelRow}
375 };
376 
377 static std::size_t lcl_GetFrmMapCount(const FrmMap* pMap)
378 {
379  if( pMap )
380  {
381  if( pMap == aVParaHtmlMap )
382  return SAL_N_ELEMENTS(aVParaHtmlMap);
383  if( pMap == aVAsCharHtmlMap )
384  return SAL_N_ELEMENTS( aVAsCharHtmlMap );
385  if( pMap == aHParaHtmlMap )
386  return SAL_N_ELEMENTS( aHParaHtmlMap );
387  if( pMap == aHParaHtmlAbsMap )
388  return SAL_N_ELEMENTS( aHParaHtmlAbsMap );
389  if( pMap == aVPageMap )
390  return SAL_N_ELEMENTS( aVPageMap );
391  if( pMap == aVPageHtmlMap )
392  return SAL_N_ELEMENTS( aVPageHtmlMap );
393  if( pMap == aVAsCharMap )
394  return SAL_N_ELEMENTS( aVAsCharMap );
395  if( pMap == aVParaMap )
396  return SAL_N_ELEMENTS( aVParaMap );
397  if( pMap == aHParaMap )
398  return SAL_N_ELEMENTS( aHParaMap );
399  if( pMap == aHFrameMap )
400  return SAL_N_ELEMENTS( aHFrameMap );
401  if( pMap == aVFrameMap )
402  return SAL_N_ELEMENTS( aVFrameMap );
403  if( pMap == aHCharMap )
404  return SAL_N_ELEMENTS( aHCharMap );
405  if( pMap == aHCharHtmlMap )
406  return SAL_N_ELEMENTS( aHCharHtmlMap );
407  if( pMap == aHCharHtmlAbsMap )
408  return SAL_N_ELEMENTS( aHCharHtmlAbsMap );
409  if( pMap == aVCharMap )
410  return SAL_N_ELEMENTS( aVCharMap );
411  if( pMap == aVCharHtmlMap )
412  return SAL_N_ELEMENTS( aVCharHtmlMap );
413  if( pMap == aVCharHtmlAbsMap )
414  return SAL_N_ELEMENTS( aVCharHtmlAbsMap );
415  if( pMap == aHPageHtmlMap )
416  return SAL_N_ELEMENTS( aHPageHtmlMap );
417  if( pMap == aHFlyHtmlMap )
418  return SAL_N_ELEMENTS( aHFlyHtmlMap );
419  if( pMap == aVFlyHtmlMap )
420  return SAL_N_ELEMENTS( aVFlyHtmlMap );
421  if( pMap == aVMultiSelectionMap )
422  return SAL_N_ELEMENTS( aVMultiSelectionMap );
423  if( pMap == aHMultiSelectionMap )
424  return SAL_N_ELEMENTS( aHMultiSelectionMap );
425  return SAL_N_ELEMENTS(aHPageMap);
426  }
427  return 0;
428 }
429 
431  SvxSwFramePosString::StringId eStringId, bool bVertical, bool bRTL)
432 {
433  //special handling of STR_FROMLEFT
434  if(SwFPos::FROMLEFT == eStringId)
435  {
436  eStringId = bVertical ?
437  bRTL ? SwFPos::FROMBOTTOM : SwFPos::FROMTOP :
438  bRTL ? SwFPos::FROMRIGHT : SwFPos::FROMLEFT;
439  return eStringId;
440  }
441  if(bVertical)
442  {
443  //exchange horizontal strings with vertical strings and vice versa
444  static const StringIdPair_Impl aHoriIds[] =
445  {
446  {SwFPos::LEFT, SwFPos::TOP},
447  {SwFPos::RIGHT, SwFPos::BOTTOM},
448  {SwFPos::CENTER_HORI, SwFPos::CENTER_VERT},
449  {SwFPos::FROMTOP, SwFPos::FROMRIGHT},
450  {SwFPos::REL_PG_LEFT, SwFPos::REL_PG_TOP},
451  {SwFPos::REL_PG_RIGHT, SwFPos::REL_PG_BOTTOM} ,
452  {SwFPos::REL_FRM_LEFT, SwFPos::REL_FRM_TOP},
453  {SwFPos::REL_FRM_RIGHT, SwFPos::REL_FRM_BOTTOM}
454  };
455  static const StringIdPair_Impl aVertIds[] =
456  {
457  {SwFPos::TOP, SwFPos::RIGHT},
458  {SwFPos::BOTTOM, SwFPos::LEFT },
459  {SwFPos::CENTER_VERT, SwFPos::CENTER_HORI},
460  {SwFPos::FROMTOP, SwFPos::FROMRIGHT },
461  {SwFPos::REL_PG_TOP, SwFPos::REL_PG_LEFT },
462  {SwFPos::REL_PG_BOTTOM, SwFPos::REL_PG_RIGHT } ,
463  {SwFPos::REL_FRM_TOP, SwFPos::REL_FRM_LEFT },
464  {SwFPos::REL_FRM_BOTTOM, SwFPos::REL_FRM_RIGHT }
465  };
466  for(size_t nIndex = 0; nIndex < SAL_N_ELEMENTS(aHoriIds); ++nIndex)
467  {
468  if(aHoriIds[nIndex].eHori == eStringId)
469  {
470  eStringId = aHoriIds[nIndex].eVert;
471  return eStringId;
472  }
473  }
474  for(size_t nIndex = 0; nIndex < SAL_N_ELEMENTS(aVertIds); ++nIndex)
475  {
476  if(aVertIds[nIndex].eHori == eStringId)
477  {
478  eStringId = aVertIds[nIndex].eVert;
479  break;
480  }
481  }
482  }
483  return eStringId;
484 }
485 // #i22341# - helper method in order to determine all possible
486 // listbox relations in a relation map for a given relation
487 static LB lcl_GetLBRelationsForRelations( const sal_uInt16 _nRel )
488 {
489  LB nLBRelations = LB::NONE;
490 
491  for (RelationMap const & nRelMapPos : aRelationMap)
492  {
493  if ( nRelMapPos.nRelation == _nRel )
494  {
495  nLBRelations |= nRelMapPos.nLBRelation;
496  }
497  }
498 
499  return nLBRelations;
500 }
501 
502 // #i22341# - helper method on order to determine all possible
503 // listbox relations in a relation map for a given string ID
505  const SvxSwFramePosString::StringId _eStrId,
506  const bool _bUseMirrorStr )
507 {
508  LB nLBRelations = LB::NONE;
509 
510  std::size_t nRelMapSize = lcl_GetFrmMapCount( _pMap );
511  for ( std::size_t nRelMapPos = 0; nRelMapPos < nRelMapSize; ++nRelMapPos )
512  {
513  if ( ( !_bUseMirrorStr && _pMap[nRelMapPos].eStrId == _eStrId ) ||
514  ( _bUseMirrorStr && _pMap[nRelMapPos].eMirrorStrId == _eStrId ) )
515  {
516  nLBRelations |= _pMap[nRelMapPos].nLBRelations;
517  }
518  }
519 
520  return nLBRelations;
521 }
522 
524  : SfxTabPage(pPage, pController, "cui/ui/swpossizepage.ui", "SwPosSizePage", &rInAttrs)
525  , m_pVMap(nullptr)
526  , m_pHMap(nullptr)
527  , m_pSdrView(nullptr)
528  , m_nOldH(HoriOrientation::CENTER)
529  , m_nOldHRel(RelOrientation::FRAME)
530  , m_nOldV(VertOrientation::TOP)
531  , m_nOldVRel(RelOrientation::PRINT_AREA)
532  , m_fWidthHeightRatio(1.0)
533  , m_bHtmlMode(false)
534  , m_bIsVerticalFrame(false)
535  , m_bPositioningDisabled(false)
536  , m_bIsMultiSelection(false)
537  , m_bIsInRightToLeft(false)
538  , m_nProtectSizeState(TRISTATE_FALSE)
539  , m_xWidthMF(m_xBuilder->weld_metric_spin_button("width", FieldUnit::CM))
540  , m_xHeightMF(m_xBuilder->weld_metric_spin_button("height", FieldUnit::CM))
541  , m_xKeepRatioCB(m_xBuilder->weld_check_button("ratio"))
542  , m_xToPageRB(m_xBuilder->weld_radio_button("topage"))
543  , m_xToParaRB(m_xBuilder->weld_radio_button("topara"))
544  , m_xToCharRB(m_xBuilder->weld_radio_button("tochar"))
545  , m_xAsCharRB(m_xBuilder->weld_radio_button("aschar"))
546  , m_xToFrameRB(m_xBuilder->weld_radio_button("toframe"))
547  , m_xPositionCB(m_xBuilder->weld_check_button("pos"))
548  , m_xSizeCB(m_xBuilder->weld_check_button("size"))
549  , m_xPosFrame(m_xBuilder->weld_widget("posframe"))
550  , m_xHoriFT(m_xBuilder->weld_label("horiposft"))
551  , m_xHoriLB(m_xBuilder->weld_combo_box("horipos"))
552  , m_xHoriByFT(m_xBuilder->weld_label("horibyft"))
553  , m_xHoriByMF(m_xBuilder->weld_metric_spin_button("byhori", FieldUnit::CM))
554  , m_xHoriToFT(m_xBuilder->weld_label("horitoft"))
555  , m_xHoriToLB(m_xBuilder->weld_combo_box("horianchor"))
556  , m_xHoriMirrorCB(m_xBuilder->weld_check_button("mirror"))
557  , m_xVertFT(m_xBuilder->weld_label("vertposft"))
558  , m_xVertLB(m_xBuilder->weld_combo_box("vertpos"))
559  , m_xVertByFT(m_xBuilder->weld_label("vertbyft"))
560  , m_xVertByMF(m_xBuilder->weld_metric_spin_button("byvert", FieldUnit::CM))
561  , m_xVertToFT(m_xBuilder->weld_label("verttoft"))
562  , m_xVertToLB(m_xBuilder->weld_combo_box("vertanchor"))
563  , m_xFollowCB(m_xBuilder->weld_check_button("followtextflow"))
564  , m_xExampleWN(new weld::CustomWeld(*m_xBuilder, "preview", m_aExampleWN))
565 {
568 
569  FieldUnit eDlgUnit = GetModuleFieldUnit( rInAttrs );
570  SetFieldUnit(*m_xHoriByMF, eDlgUnit, true);
571  SetFieldUnit(*m_xVertByMF, eDlgUnit, true);
572  SetFieldUnit(*m_xWidthMF , eDlgUnit, true);
573  SetFieldUnit(*m_xHeightMF, eDlgUnit, true);
574 
576 
577  Link<weld::Widget&,void> aLk3 = LINK(this, SvxSwPosSizeTabPage, RangeModifyHdl);
578  m_xWidthMF->connect_focus_out(aLk3);
579  m_xHeightMF->connect_focus_out(aLk3);
580  m_xHoriByMF->connect_focus_out(aLk3);
581  m_xVertByMF->connect_focus_out(aLk3);
582  m_xFollowCB->connect_toggled(LINK(this, SvxSwPosSizeTabPage, RangeModifyClickHdl));
583 
585  m_xWidthMF->connect_value_changed( aLk );
586  m_xHeightMF->connect_value_changed( aLk );
587  m_xHoriByMF->connect_value_changed( aLk );
588  m_xVertByMF->connect_value_changed( aLk );
589 
590  Link<weld::ToggleButton&,void> aLk2 = LINK(this, SvxSwPosSizeTabPage, AnchorTypeHdl);
591  m_xToPageRB->connect_toggled( aLk2 );
592  m_xToParaRB->connect_toggled( aLk2 );
593  m_xToCharRB->connect_toggled( aLk2 );
594  m_xAsCharRB->connect_toggled( aLk2 );
595  m_xToFrameRB->connect_toggled( aLk2 );
596 
597  m_xHoriLB->connect_changed(LINK(this, SvxSwPosSizeTabPage, PosHdl));
598  m_xVertLB->connect_changed(LINK(this, SvxSwPosSizeTabPage, PosHdl));
599 
600  m_xHoriToLB->connect_changed(LINK(this, SvxSwPosSizeTabPage, RelHdl));
601  m_xVertToLB->connect_changed(LINK(this, SvxSwPosSizeTabPage, RelHdl));
602 
603  m_xHoriMirrorCB->connect_toggled(LINK(this, SvxSwPosSizeTabPage, MirrorHdl));
604  m_xPositionCB->connect_toggled(LINK(this, SvxSwPosSizeTabPage, ProtectHdl));
605 }
606 
608 {
609  m_xWidthMF.reset();
610  m_xHeightMF.reset();
611  m_xHoriByMF.reset();
612  m_xVertByMF.reset();
613 }
614 
615 namespace
616 {
617  struct FrmMaps
618  {
619  FrmMap const *pMap;
620  size_t nCount;
621  };
622 }
623 
625 {
626  static const FrmMaps aMaps[] = {
627  { aHPageMap, SAL_N_ELEMENTS(aHPageMap) },
628  { aHPageHtmlMap, SAL_N_ELEMENTS(aHPageHtmlMap) },
629  { aVPageMap, SAL_N_ELEMENTS(aVPageMap) },
630  { aVPageHtmlMap, SAL_N_ELEMENTS(aVPageHtmlMap) },
631  { aHFrameMap, SAL_N_ELEMENTS(aHFrameMap) },
632  { aHFlyHtmlMap, SAL_N_ELEMENTS(aHFlyHtmlMap) },
633  { aVFrameMap, SAL_N_ELEMENTS(aVFrameMap) },
634  { aVFlyHtmlMap, SAL_N_ELEMENTS(aVFlyHtmlMap) },
635  { aHParaMap, SAL_N_ELEMENTS(aHParaMap) },
636  { aHParaHtmlMap, SAL_N_ELEMENTS(aHParaHtmlMap) },
637  { aHParaHtmlAbsMap, SAL_N_ELEMENTS(aHParaHtmlAbsMap) },
638  { aVParaMap, SAL_N_ELEMENTS(aVParaMap) },
639  { aVParaHtmlMap, SAL_N_ELEMENTS(aVParaHtmlMap) },
640  { aHCharMap, SAL_N_ELEMENTS(aHCharMap) },
641  { aHCharHtmlMap, SAL_N_ELEMENTS(aHCharHtmlMap) },
642  { aHCharHtmlAbsMap, SAL_N_ELEMENTS(aHCharHtmlAbsMap) },
643  { aVCharMap, SAL_N_ELEMENTS(aVCharMap) },
644  { aVCharHtmlMap, SAL_N_ELEMENTS(aVCharHtmlMap) },
645  { aVCharHtmlAbsMap, SAL_N_ELEMENTS(aVCharHtmlAbsMap) },
646  { aVAsCharMap, SAL_N_ELEMENTS(aVAsCharMap) },
647  { aVAsCharHtmlMap, SAL_N_ELEMENTS(aVAsCharHtmlMap) }
648  };
649 
650  std::vector<SvxSwFramePosString::StringId> aFrames;
651  for (const FrmMaps& aMap : aMaps)
652  {
653  for (size_t j = 0; j < aMap.nCount; ++j)
654  {
655  aFrames.push_back(aMap.pMap[j].eStrId);
656  aFrames.push_back(aMap.pMap[j].eMirrorStrId);
657  }
658  }
659 
660  std::sort(aFrames.begin(), aFrames.end());
661  aFrames.erase(std::unique(aFrames.begin(), aFrames.end()), aFrames.end());
662 
663  for (auto const& frame : aFrames)
664  {
666  }
667 
668  Size aBiggest(m_xHoriLB->get_preferred_size());
669  m_xHoriLB->set_size_request(aBiggest.Width(), -1);
670  m_xVertLB->set_size_request(aBiggest.Width(), -1);
671  m_xHoriLB->clear();
672 }
673 
674 namespace
675 {
676  struct RelationMaps
677  {
678  RelationMap const *pMap;
679  size_t nCount;
680  };
681 }
682 
684 {
685  static const RelationMaps aMaps[] = {
686  { aRelationMap, SAL_N_ELEMENTS(aRelationMap) },
687  { aAsCharRelationMap, SAL_N_ELEMENTS(aAsCharRelationMap) }
688  };
689 
690  std::vector<SvxSwFramePosString::StringId> aRels;
691  for (const RelationMaps& aMap : aMaps)
692  {
693  for (size_t j = 0; j < aMap.nCount; ++j)
694  {
695  aRels.push_back(aMap.pMap[j].eStrId);
696  aRels.push_back(aMap.pMap[j].eMirrorStrId);
697  }
698  }
699 
700  std::sort(aRels.begin(), aRels.end());
701  aRels.erase(std::unique(aRels.begin(), aRels.end()), aRels.end());
702 
703  for (auto const& elem : aRels)
704  {
705  m_xHoriLB->append_text(SvxSwFramePosString::GetString(elem));
706  }
707 
708  Size aBiggest(m_xHoriLB->get_preferred_size());
709  m_xHoriLB->set_size_request(aBiggest.Width(), -1);
710  m_xVertLB->set_size_request(aBiggest.Width(), -1);
711  m_xHoriLB->clear();
712 }
713 
714 std::unique_ptr<SfxTabPage> SvxSwPosSizeTabPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet)
715 {
716  return std::make_unique<SvxSwPosSizeTabPage>(pPage, pController, *rSet);
717 }
718 
720 {
721  static const sal_uInt16 pSwPosRanges[] =
722  {
723  SID_ATTR_TRANSFORM_POS_X,
724  SID_ATTR_TRANSFORM_POS_Y,
725  SID_ATTR_TRANSFORM_PROTECT_POS,
726  SID_ATTR_TRANSFORM_PROTECT_POS,
727  SID_ATTR_TRANSFORM_INTERN,
728  SID_ATTR_TRANSFORM_INTERN,
729  SID_ATTR_TRANSFORM_ANCHOR,
730  SID_ATTR_TRANSFORM_VERT_ORIENT,
731  SID_ATTR_TRANSFORM_WIDTH,
732  SID_ATTR_TRANSFORM_SIZE_POINT,
733  SID_ATTR_TRANSFORM_PROTECT_POS,
734  SID_ATTR_TRANSFORM_INTERN,
735  SID_ATTR_TRANSFORM_AUTOWIDTH,
736  SID_ATTR_TRANSFORM_VERT_ORIENT,
737  SID_HTML_MODE,
738  SID_HTML_MODE,
739  SID_SW_FOLLOW_TEXT_FLOW,
740  SID_SW_FOLLOW_TEXT_FLOW,
741  SID_ATTR_TRANSFORM_HORI_POSITION,
742  SID_ATTR_TRANSFORM_VERT_POSITION,
743  0
744  };
745  return pSwPosRanges;
746 }
747 
749 {
750  bool bAnchorChanged = false;
751  RndStdIds nAnchor = GetAnchorType(&bAnchorChanged);
752  bool bModified = false;
753  if(bAnchorChanged)
754  {
755  rSet->Put(SfxInt16Item(SID_ATTR_TRANSFORM_ANCHOR, static_cast<sal_Int16>(nAnchor)));
756  bModified = true;
757  }
758  if (m_xPositionCB->get_state_changed_from_saved())
759  {
760  if (m_xPositionCB->get_inconsistent())
761  rSet->InvalidateItem( SID_ATTR_TRANSFORM_PROTECT_POS );
762  else
763  rSet->Put(
764  SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_POS ),
765  m_xPositionCB->get_state() == TRISTATE_TRUE ) );
766  bModified = true;
767  }
768 
769  if (m_xSizeCB->get_state_changed_from_saved())
770  {
771  if (m_xSizeCB->get_inconsistent())
772  rSet->InvalidateItem( SID_ATTR_TRANSFORM_PROTECT_SIZE );
773  else
774  rSet->Put(
775  SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_SIZE ),
776  m_xSizeCB->get_state() == TRISTATE_TRUE ) );
777  bModified = true;
778  }
779 
780  const SfxItemSet& rOldSet = GetItemSet();
781 
783  {
784  //on multiple selections the positioning is set via SdrView
786  {
787  if (m_xHoriByMF->get_value_changed_from_saved() || m_xVertByMF->get_value_changed_from_saved())
788  {
789  auto nHoriByPos = m_xHoriByMF->denormalize(m_xHoriByMF->get_value(FieldUnit::TWIP));
790  auto nVertByPos = m_xVertByMF->denormalize(m_xVertByMF->get_value(FieldUnit::TWIP));
791 
792  // old rectangle with CoreUnit
795 
796  nHoriByPos += m_aAnchorPos.X();
797  nVertByPos += m_aAnchorPos.Y();
798 
799  rSet->Put( SfxInt32Item( GetWhich( SID_ATTR_TRANSFORM_POS_X ), nHoriByPos ) );
800  rSet->Put( SfxInt32Item( GetWhich( SID_ATTR_TRANSFORM_POS_Y ), nVertByPos ) );
801 
802  bModified = true;
803  }
804  }
805  else
806  {
807  if ( m_pHMap )
808  {
809  const SfxInt16Item& rHoriOrient =
810  static_cast<const SfxInt16Item&>(rOldSet.Get( SID_ATTR_TRANSFORM_HORI_ORIENT));
811  const SfxInt16Item& rHoriRelation =
812  static_cast<const SfxInt16Item&>(rOldSet.Get( SID_ATTR_TRANSFORM_HORI_RELATION));
813  const SfxInt32Item& rHoriPosition =
814  static_cast<const SfxInt32Item&>(rOldSet.Get( SID_ATTR_TRANSFORM_HORI_POSITION)) ;
815 
816  sal_uInt16 nMapPos = GetMapPos(m_pHMap, *m_xHoriLB);
817  short nAlign = GetAlignment(m_pHMap, nMapPos, *m_xHoriToLB);
818  short nRel = GetRelation(*m_xHoriToLB);
819  const auto nHoriByPos = m_xHoriByMF->denormalize(m_xHoriByMF->get_value(FieldUnit::TWIP));
820  if (
821  nAlign != rHoriOrient.GetValue() ||
822  nRel != rHoriRelation.GetValue() ||
823  (m_xHoriByMF->get_sensitive() && nHoriByPos != rHoriPosition.GetValue())
824  )
825  {
826  rSet->Put(SfxInt16Item(SID_ATTR_TRANSFORM_HORI_ORIENT, nAlign));
827  rSet->Put(SfxInt16Item(SID_ATTR_TRANSFORM_HORI_RELATION, nRel));
828  if(m_xHoriByMF->get_sensitive())
829  rSet->Put(SfxInt32Item(SID_ATTR_TRANSFORM_HORI_POSITION, nHoriByPos));
830  bModified = true;
831  }
832  }
833  if (m_xHoriMirrorCB->get_sensitive() && m_xHoriMirrorCB->get_state_changed_from_saved())
834  bModified |= nullptr != rSet->Put(SfxBoolItem(SID_ATTR_TRANSFORM_HORI_MIRROR, m_xHoriMirrorCB->get_active()));
835 
836  if ( m_pVMap )
837  {
838  const SfxInt16Item& rVertOrient =
839  static_cast<const SfxInt16Item&>(rOldSet.Get( SID_ATTR_TRANSFORM_VERT_ORIENT));
840  const SfxInt16Item& rVertRelation =
841  static_cast<const SfxInt16Item&>(rOldSet.Get( SID_ATTR_TRANSFORM_VERT_RELATION));
842  const SfxInt32Item& rVertPosition =
843  static_cast<const SfxInt32Item&>(rOldSet.Get( SID_ATTR_TRANSFORM_VERT_POSITION));
844 
845  sal_uInt16 nMapPos = GetMapPos(m_pVMap, *m_xVertLB);
846  short nAlign = GetAlignment(m_pVMap, nMapPos, *m_xVertToLB);
847  short nRel = GetRelation(*m_xVertToLB);
848  // #i34055# - convert vertical position for
849  // as-character anchored objects
850  auto nVertByPos = m_xVertByMF->denormalize(m_xVertByMF->get_value(FieldUnit::TWIP));
851  if (GetAnchorType() == RndStdIds::FLY_AS_CHAR)
852  {
853  nVertByPos *= -1;
854  }
855  if ( nAlign != rVertOrient.GetValue() ||
856  nRel != rVertRelation.GetValue() ||
857  ( m_xVertByMF->get_sensitive() &&
858  nVertByPos != rVertPosition.GetValue() ) )
859  {
860  rSet->Put(SfxInt16Item(SID_ATTR_TRANSFORM_VERT_ORIENT, nAlign));
861  rSet->Put(SfxInt16Item(SID_ATTR_TRANSFORM_VERT_RELATION, nRel));
862  if(m_xVertByMF->get_sensitive())
863  rSet->Put(SfxInt32Item(SID_ATTR_TRANSFORM_VERT_POSITION, nVertByPos));
864  bModified = true;
865  }
866  }
867 
868  // #i18732#
869  if (m_xFollowCB->get_state_changed_from_saved())
870  {
871  //Writer internal type - based on SfxBoolItem
872  const SfxPoolItem* pItem = GetItem( rOldSet, SID_SW_FOLLOW_TEXT_FLOW);
873  if(pItem)
874  {
875  std::unique_ptr<SfxBoolItem> pFollow(static_cast<SfxBoolItem*>(pItem->Clone()));
876  pFollow->SetValue(m_xFollowCB->get_active());
877  bModified |= nullptr != rSet->Put(*pFollow);
878  }
879  }
880  }
881  }
882  if (m_xWidthMF->get_value_changed_from_saved() || m_xHeightMF->get_value_changed_from_saved())
883  {
884  sal_uInt32 nWidth = static_cast<sal_uInt32>(m_xWidthMF->denormalize(m_xWidthMF->get_value(FieldUnit::TWIP)));
885  sal_uInt32 nHeight = static_cast<sal_uInt32>(m_xHeightMF->denormalize(m_xHeightMF->get_value(FieldUnit::TWIP)));
886  rSet->Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_WIDTH ), nWidth ) );
887  rSet->Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_HEIGHT ), nHeight ) );
888  //this item is required by SdrEditView::SetGeoAttrToMarked()
889  rSet->Put( SfxUInt16Item( GetWhich( SID_ATTR_TRANSFORM_SIZE_POINT ), sal_uInt16(RectPoint::LT) ) );
890 
891  bModified = true;
892  }
893 
894  return bModified;
895 }
896 
898 {
899  const SfxPoolItem* pItem = GetItem( *rSet, SID_ATTR_TRANSFORM_ANCHOR );
900  bool bInvalidateAnchor = false;
901  RndStdIds nAnchorType = RndStdIds::FLY_AT_PARA;
902  if(pItem)
903  {
904  nAnchorType = static_cast<RndStdIds>(static_cast<const SfxInt16Item*>(pItem)->GetValue());
905  switch(nAnchorType)
906  {
907  case RndStdIds::FLY_AT_PAGE: m_xToPageRB->set_active(true); break;
908  case RndStdIds::FLY_AT_PARA: m_xToParaRB->set_active(true); break;
909  case RndStdIds::FLY_AT_CHAR: m_xToCharRB->set_active(true); break;
910  case RndStdIds::FLY_AS_CHAR: m_xAsCharRB->set_active(true); break;
911  case RndStdIds::FLY_AT_FLY: m_xToFrameRB->set_active(true); break;
912  default : bInvalidateAnchor = true;
913  }
914  m_xToPageRB->save_state();
915  m_xToParaRB->save_state();
916  m_xToCharRB->save_state();
917  m_xAsCharRB->save_state();
918  m_xToFrameRB->save_state();
919  }
920  if (bInvalidateAnchor)
921  {
922  m_xToPageRB->set_sensitive( false );
923  m_xToParaRB->set_sensitive( false );
924  m_xToCharRB->set_sensitive( false );
925  m_xAsCharRB->set_sensitive( false );
926  m_xToFrameRB->set_sensitive( false );
927  }
928 
929  pItem = GetItem( *rSet, SID_ATTR_TRANSFORM_PROTECT_POS );
930  if (pItem)
931  {
932  bool bProtected = static_cast<const SfxBoolItem*>(pItem)->GetValue();
933  m_xPositionCB->set_active(bProtected);
934  m_xSizeCB->set_sensitive(!bProtected);
935  }
936  else
937  {
938  m_xPositionCB->set_inconsistent(true);
939  }
940 
941  m_xPositionCB->save_state();
942 
943  pItem = GetItem( *rSet, SID_ATTR_TRANSFORM_PROTECT_SIZE );
944 
945  if (pItem)
946  {
947  m_xSizeCB->set_active(static_cast<const SfxBoolItem*>(pItem)->GetValue());
948  }
949  else
950  m_xSizeCB->set_inconsistent(true);
951  m_xSizeCB->save_state();
952 
953  pItem = GetItem( *rSet, SID_HTML_MODE );
954  if(pItem)
955  {
956  m_bHtmlMode =
957  (static_cast<const SfxUInt16Item*>(pItem)->GetValue() & HTMLMODE_ON)
958  != 0;
959  }
960 
961  pItem = GetItem( *rSet, SID_ATTR_TRANSFORM_IN_VERTICAL_TEXT );
962  if(pItem && static_cast<const SfxBoolItem*>(pItem)->GetValue())
963  {
964  OUString sHLabel = m_xHoriFT->get_label();
965  m_xHoriFT->set_label(m_xVertFT->get_label());
966  m_xVertFT->set_label(sHLabel);
967  m_bIsVerticalFrame = true;
968  }
969  pItem = GetItem( *rSet, SID_ATTR_TRANSFORM_IN_RTL_TEXT);
970  if(pItem)
971  m_bIsInRightToLeft = static_cast<const SfxBoolItem*>(pItem)->GetValue();
972 
973  pItem = GetItem( *rSet, SID_SW_FOLLOW_TEXT_FLOW);
974  if(pItem)
975  {
976  const bool bFollowTextFlow =
977  static_cast<const SfxBoolItem*>(pItem)->GetValue();
978  m_xFollowCB->set_active(bFollowTextFlow);
979  }
980  m_xFollowCB->save_state();
981 
982  if(m_bHtmlMode)
983  {
984  m_xHoriMirrorCB->hide();
985  m_xKeepRatioCB->set_sensitive(false);
986  // #i18732# - hide checkbox in HTML mode
987  m_xFollowCB->hide();
988  }
989  else
990  {
991  // #i18732# correct enable/disable of check box 'Mirror on..'
992  m_xHoriMirrorCB->set_sensitive(!m_xAsCharRB->get_active() && !m_bIsMultiSelection);
993 
994  // #i18732# - enable/disable check box 'Follow text flow'.
995  m_xFollowCB->set_sensitive(m_xToParaRB->get_active() ||
996  m_xToCharRB->get_active());
997  }
998 
999  pItem = GetItem( *rSet, SID_ATTR_TRANSFORM_WIDTH );
1000  sal_Int32 nWidth = std::max( pItem ? ( static_cast<const SfxUInt32Item*>(pItem)->GetValue()) : 0, sal_uInt32(1) );
1001 
1002  m_xWidthMF->set_value(m_xWidthMF->normalize(nWidth), FieldUnit::TWIP);
1003  m_xWidthMF->save_value();
1004 
1005  pItem = GetItem( *rSet, SID_ATTR_TRANSFORM_HEIGHT );
1006  sal_Int32 nHeight = std::max( pItem ? ( static_cast<const SfxUInt32Item*>(pItem)->GetValue()) : 0, sal_uInt32(1) );
1007  m_xHeightMF->set_value(m_xHeightMF->normalize(nHeight), FieldUnit::TWIP);
1008  m_xHeightMF->save_value();
1009  m_fWidthHeightRatio = double(nWidth) / double(nHeight);
1010 
1012  {
1013  pItem = GetItem( *rSet, SID_ATTR_TRANSFORM_HORI_ORIENT);
1014  if(pItem)
1015  {
1016  short nHoriOrientation = static_cast< const SfxInt16Item*>(pItem)->GetValue();
1017  m_nOldH = nHoriOrientation;
1018  }
1019  pItem = GetItem( *rSet, SID_ATTR_TRANSFORM_VERT_ORIENT);
1020  if(pItem)
1021  {
1022  short nVertOrientation = static_cast< const SfxInt16Item*>(pItem)->GetValue();
1023  m_nOldV = nVertOrientation;
1024  }
1025  pItem = GetItem( *rSet, SID_ATTR_TRANSFORM_HORI_RELATION);
1026  if(pItem)
1027  {
1028  m_nOldHRel = static_cast< const SfxInt16Item*>(pItem)->GetValue();
1029  }
1030 
1031  pItem = GetItem( *rSet, SID_ATTR_TRANSFORM_VERT_RELATION);
1032  if(pItem)
1033  {
1034  m_nOldVRel = static_cast< const SfxInt16Item*>(pItem)->GetValue();
1035  }
1036  pItem = GetItem( *rSet, SID_ATTR_TRANSFORM_HORI_MIRROR);
1037  if(pItem)
1038  m_xHoriMirrorCB->set_active(static_cast<const SfxBoolItem*>(pItem)->GetValue());
1039  m_xHoriMirrorCB->save_state();
1040 
1041  sal_Int32 nHoriPos = 0;
1042  sal_Int32 nVertPos = 0;
1043  pItem = GetItem( *rSet, SID_ATTR_TRANSFORM_HORI_POSITION);
1044  if(pItem)
1045  nHoriPos = static_cast<const SfxInt32Item*>(pItem)->GetValue();
1046  pItem = GetItem( *rSet, SID_ATTR_TRANSFORM_VERT_POSITION);
1047  if(pItem)
1048  nVertPos = static_cast<const SfxInt32Item*>(pItem)->GetValue();
1049 
1050  InitPos(nAnchorType, m_nOldH, m_nOldHRel, m_nOldV, m_nOldVRel, nHoriPos, nVertPos);
1051 
1052  m_xVertByMF->save_value();
1053  m_xHoriByMF->save_value();
1054  // #i18732#
1055  m_xFollowCB->save_state();
1056 
1057  RangeModifyHdl(m_xWidthMF->get_widget()); // initially set maximum values
1058  }
1059 }
1060 
1062 {
1063  if( _pSet )
1064  {
1065  _pSet->Put(SfxBoolItem(GetWhich( SID_ATTR_TRANSFORM_PROTECT_POS ),
1066  m_xPositionCB->get_active()));
1067  _pSet->Put(SfxBoolItem(GetWhich( SID_ATTR_TRANSFORM_PROTECT_SIZE ),
1068  m_xSizeCB->get_active()));
1069  FillItemSet( _pSet );
1070  }
1071  return DeactivateRC::LeavePage;
1072 }
1073 
1075 {
1076  if (nAnchorEnable & SvxAnchorIds::Fly)
1077  m_xToFrameRB->show();
1078  if (!(nAnchorEnable & SvxAnchorIds::Page))
1079  m_xToPageRB->set_sensitive(false);
1080 }
1081 
1083 {
1084  RndStdIds nRet = RndStdIds::UNKNOWN;
1085  weld::RadioButton* pCheckedButton = nullptr;
1086  if(m_xToParaRB->get_sensitive())
1087  {
1088  if(m_xToPageRB->get_active())
1089  {
1090  nRet = RndStdIds::FLY_AT_PAGE;
1091  pCheckedButton = m_xToPageRB.get();
1092  }
1093  else if(m_xToParaRB->get_active())
1094  {
1095  nRet = RndStdIds::FLY_AT_PARA;
1096  pCheckedButton = m_xToParaRB.get();
1097  }
1098  else if(m_xToCharRB->get_active())
1099  {
1100  nRet = RndStdIds::FLY_AT_CHAR;
1101  pCheckedButton = m_xToCharRB.get();
1102  }
1103  else if(m_xAsCharRB->get_active())
1104  {
1105  nRet = RndStdIds::FLY_AS_CHAR;
1106  pCheckedButton = m_xAsCharRB.get();
1107  }
1108  else if(m_xToFrameRB->get_active())
1109  {
1110  nRet = RndStdIds::FLY_AT_FLY;
1111  pCheckedButton = m_xToFrameRB.get();
1112  }
1113  }
1114  if(pbHasChanged)
1115  {
1116  if(pCheckedButton)
1117  *pbHasChanged = pCheckedButton->get_state_changed_from_saved();
1118  else
1119  *pbHasChanged = false;
1120  }
1121  return nRet;
1122 }
1123 
1125 {
1126  RangeModifyHdl(m_xWidthMF->get_widget());
1127 }
1128 
1130 {
1131  if (m_bPositioningDisabled)
1132  return;
1133  SvxSwFrameValidation aVal;
1134 
1135  aVal.nAnchorType = GetAnchorType();
1136  aVal.bAutoHeight = false;
1137  aVal.bMirror = m_xHoriMirrorCB->get_active();
1138  // #i18732#
1139  aVal.bFollowTextFlow = m_xFollowCB->get_active();
1140 
1141  if ( m_pHMap )
1142  {
1143  // horizontal alignment
1144  sal_uInt16 nMapPos = GetMapPos(m_pHMap, *m_xHoriToLB);
1145  sal_uInt16 nAlign = GetAlignment(m_pHMap, nMapPos, *m_xHoriToLB);
1146  sal_uInt16 nRel = GetRelation(*m_xHoriToLB);
1147 
1148  aVal.nHoriOrient = static_cast<short>(nAlign);
1149  aVal.nHRelOrient = static_cast<short>(nRel);
1150  }
1151  else
1152  aVal.nHoriOrient = HoriOrientation::NONE;
1153 
1154  if ( m_pVMap )
1155  {
1156  // vertical alignment
1157  sal_uInt16 nMapPos = GetMapPos(m_pVMap, *m_xVertLB);
1158  sal_uInt16 nAlign = GetAlignment(m_pVMap, nMapPos, *m_xVertToLB);
1159  sal_uInt16 nRel = GetRelation(*m_xVertToLB);
1160 
1161  aVal.nVertOrient = static_cast<short>(nAlign);
1162  aVal.nVRelOrient = static_cast<short>(nRel);
1163  }
1164  else
1165  aVal.nVertOrient = VertOrientation::NONE;
1166 
1167  const auto nAtHorzPosVal = m_xHoriByMF->denormalize(m_xHoriByMF->get_value(FieldUnit::TWIP));
1168  const auto nAtVertPosVal = m_xVertByMF->denormalize(m_xVertByMF->get_value(FieldUnit::TWIP));
1169 
1170  aVal.nHPos = nAtHorzPosVal;
1171  aVal.nVPos = nAtVertPosVal;
1172 
1173  sal_Int32 nWidth = static_cast<sal_uInt32>(m_xWidthMF->denormalize(m_xWidthMF->get_value(FieldUnit::TWIP)));
1174  sal_Int32 nHeight = static_cast<sal_uInt32>(m_xHeightMF->denormalize(m_xHeightMF->get_value(FieldUnit::TWIP)));
1175  aVal.nWidth = nWidth;
1176  aVal.nHeight = nHeight;
1177 
1178  m_aValidateLink.Call(aVal);
1179 
1180  // minimum width also for style
1181  m_xHeightMF->set_min(m_xHeightMF->normalize(aVal.nMinHeight), FieldUnit::TWIP);
1182  m_xWidthMF->set_min(m_xWidthMF->normalize(aVal.nMinWidth), FieldUnit::TWIP);
1183 
1184  sal_Int32 nMaxWidth(aVal.nMaxWidth);
1185  sal_Int32 nMaxHeight(aVal.nMaxHeight);
1186 
1187  sal_Int64 nTmp = m_xHeightMF->normalize(nMaxHeight);
1188  m_xHeightMF->set_max(nTmp, FieldUnit::TWIP);
1189 
1190  nTmp = m_xWidthMF->normalize(nMaxWidth);
1191  m_xWidthMF->set_max(nTmp, FieldUnit::TWIP);
1192 
1193  m_xHoriByMF->set_range(m_xHoriByMF->normalize(aVal.nMinHPos),
1194  m_xHoriByMF->normalize(aVal.nMaxHPos), FieldUnit::TWIP);
1195  if ( aVal.nHPos != nAtHorzPosVal )
1196  m_xHoriByMF->set_value(m_xHoriByMF->normalize(aVal.nHPos), FieldUnit::TWIP);
1197 
1198  m_xVertByMF->set_range(m_xVertByMF->normalize(aVal.nMinVPos),
1199  m_xVertByMF->normalize(aVal.nMaxVPos), FieldUnit::TWIP);
1200  if ( aVal.nVPos != nAtVertPosVal )
1201  m_xVertByMF->set_value(m_xVertByMF->normalize(aVal.nVPos), FieldUnit::TWIP);
1202 }
1203 
1205 {
1206  m_xHoriMirrorCB->set_sensitive(!m_xAsCharRB->get_active() && !m_bIsMultiSelection);
1207 
1208  // #i18732# - enable check box 'Follow text flow' for anchor
1209  // type to-paragraph' and to-character
1210  m_xFollowCB->set_sensitive(m_xToParaRB->get_active() || m_xToCharRB->get_active());
1211 
1212  RndStdIds nId = GetAnchorType();
1213 
1214  InitPos( nId, USHRT_MAX, 0, USHRT_MAX, 0, LONG_MAX, LONG_MAX);
1215  RangeModifyHdl(m_xWidthMF->get_widget());
1216 
1217  if(m_bHtmlMode)
1218  {
1219  PosHdl(*m_xHoriLB);
1220  PosHdl(*m_xVertLB);
1221  }
1222 }
1223 
1225 {
1226  RndStdIds nId = GetAnchorType();
1227  InitPos( nId, USHRT_MAX, 0, USHRT_MAX, 0, LONG_MAX, LONG_MAX);
1228 }
1229 
1231 {
1232  bool bHori = &rLB == m_xHoriToLB.get();
1233 
1234  UpdateExample();
1235 
1236  if (m_bHtmlMode && RndStdIds::FLY_AT_CHAR == GetAnchorType()) // again special treatment
1237  {
1238  if(bHori)
1239  {
1240  sal_uInt16 nRel = GetRelation(*m_xHoriToLB);
1241  if(RelOrientation::PRINT_AREA == nRel && 0 == m_xVertLB->get_active())
1242  {
1243  m_xVertLB->set_active(1);
1244  }
1245  else if(RelOrientation::CHAR == nRel && 1 == m_xVertLB->get_active())
1246  {
1247  m_xVertLB->set_active(0);
1248  }
1249  }
1250  }
1251  RangeModifyHdl(m_xWidthMF->get_widget());
1252 }
1253 
1255 {
1256  bool bHori = &rLB == m_xHoriLB.get();
1257  weld::ComboBox* pRelLB = bHori ? m_xHoriToLB.get() : m_xVertToLB.get();
1258  weld::Label* pRelFT = bHori ? m_xHoriToFT.get() : m_xVertToFT.get();
1259  FrmMap const *pMap = bHori ? m_pHMap : m_pVMap;
1260 
1261 
1262  sal_uInt16 nMapPos = GetMapPos(pMap, rLB);
1263  sal_uInt16 nAlign = GetAlignment(pMap, nMapPos, *pRelLB);
1264 
1265  if (bHori)
1266  {
1267  bool bEnable = HoriOrientation::NONE == nAlign;
1268  m_xHoriByMF->set_sensitive( bEnable );
1269  m_xHoriByFT->set_sensitive( bEnable );
1270  }
1271  else
1272  {
1273  bool bEnable = VertOrientation::NONE == nAlign;
1274  m_xVertByMF->set_sensitive( bEnable );
1275  m_xVertByFT->set_sensitive( bEnable );
1276  }
1277 
1278  RangeModifyHdl(m_xWidthMF->get_widget());
1279 
1280  short nRel = 0;
1281  if (rLB.get_active() != -1)
1282  {
1283  if (pRelLB->get_active() != -1)
1284  nRel = reinterpret_cast<RelationMap*>(pRelLB->get_active_id().toUInt64())->nRelation;
1285 
1286  FillRelLB(pMap, nMapPos, nAlign, nRel, *pRelLB, *pRelFT);
1287  }
1288  else
1289  pRelLB->clear();
1290 
1291  UpdateExample();
1292 
1293  // special treatment for HTML-Mode with horz-vert-dependencies
1294  if (m_bHtmlMode && RndStdIds::FLY_AT_CHAR == GetAnchorType())
1295  {
1296  bool bSet = false;
1297  if(bHori)
1298  {
1299  // on the right only below is allowed - from the left only at the top
1300  // from the left at the character -> below
1301  if((HoriOrientation::LEFT == nAlign || HoriOrientation::RIGHT == nAlign) &&
1302  0 == m_xVertLB->get_active())
1303  {
1304  if(RelOrientation::FRAME == nRel)
1305  m_xVertLB->set_active(1);
1306  else
1307  m_xVertLB->set_active(0);
1308  bSet = true;
1309  }
1310  else if(HoriOrientation::LEFT == nAlign && 1 == m_xVertLB->get_active())
1311  {
1312  m_xVertLB->set_active(0);
1313  bSet = true;
1314  }
1315  else if(HoriOrientation::NONE == nAlign && 1 == m_xVertLB->get_active())
1316  {
1317  m_xVertLB->set_active(0);
1318  bSet = true;
1319  }
1320  if(bSet)
1321  PosHdl(*m_xVertLB);
1322  }
1323  else
1324  {
1325  if(VertOrientation::TOP == nAlign)
1326  {
1327  if(1 == m_xHoriLB->get_active())
1328  {
1329  m_xHoriLB->set_active(0);
1330  bSet = true;
1331  }
1332  m_xHoriToLB->set_active(1);
1333  }
1334  else if(VertOrientation::CHAR_BOTTOM == nAlign)
1335  {
1336  if(2 == m_xHoriLB->get_active())
1337  {
1338  m_xHoriLB->set_active(0);
1339  bSet = true;
1340  }
1341  m_xHoriToLB->set_active(0) ;
1342  }
1343  if(bSet)
1344  PosHdl(*m_xHoriLB);
1345  }
1346 
1347  }
1348 }
1349 
1351 {
1352  auto nWidth = m_xWidthMF->denormalize(m_xWidthMF->get_value(FieldUnit::TWIP));
1353  auto nHeight = m_xHeightMF->denormalize(m_xHeightMF->get_value(FieldUnit::TWIP));
1354  if (m_xKeepRatioCB->get_active())
1355  {
1356  if ( &rEdit == m_xWidthMF.get() )
1357  {
1358  nHeight = int(static_cast<double>(nWidth) / m_fWidthHeightRatio);
1359  m_xHeightMF->set_value(m_xHeightMF->normalize(nHeight), FieldUnit::TWIP);
1360  }
1361  else if(&rEdit == m_xHeightMF.get())
1362  {
1363  nWidth = int(static_cast<double>(nHeight) * m_fWidthHeightRatio);
1364  m_xWidthMF->set_value(m_xWidthMF->normalize(nWidth), FieldUnit::TWIP);
1365  }
1366  }
1367  m_fWidthHeightRatio = nHeight ? double(nWidth) / double(nHeight) : 1.0;
1368  UpdateExample();
1369 }
1370 
1372 {
1373  if (m_xSizeCB->get_sensitive())
1374  {
1375  m_nProtectSizeState = m_xSizeCB->get_state();
1376  }
1377 
1378  m_xSizeCB->set_state(m_xPositionCB->get_state() == TRISTATE_TRUE ? TRISTATE_TRUE : m_nProtectSizeState);
1379  m_xSizeCB->set_sensitive(m_xPositionCB->get_sensitive() && !m_xPositionCB->get_active());
1380 }
1381 
1383 {
1384  short nRel = 0;
1385  int nPos = rRelationLB.get_active();
1386  if (nPos != -1)
1387  {
1388  RelationMap *pEntry = reinterpret_cast<RelationMap*>(rRelationLB.get_id(nPos).toUInt64());
1389  nRel = pEntry->nRelation;
1390  }
1391 
1392  return nRel;
1393 }
1394 
1395 short SvxSwPosSizeTabPage::GetAlignment(FrmMap const *pMap, sal_uInt16 nMapPos, const weld::ComboBox& rRelationLB)
1396 {
1397  short nAlign = 0;
1398 
1399  // #i22341# - special handling also for map <aVCharMap>,
1400  // because it contains ambiguous items for alignment
1401  if (pMap == aVAsCharHtmlMap || pMap == aVAsCharMap ||
1402  pMap == aVCharMap )
1403  {
1404  if (rRelationLB.get_active() != -1)
1405  {
1406  LB nRel = reinterpret_cast<RelationMap*>(rRelationLB.get_active_id().toUInt64())->nLBRelation;
1407  std::size_t nMapCount = ::lcl_GetFrmMapCount(pMap);
1408  SvxSwFramePosString::StringId eStrId = pMap[nMapPos].eStrId;
1409 
1410  for (std::size_t i = 0; i < nMapCount; i++)
1411  {
1412  if (pMap[i].eStrId == eStrId)
1413  {
1414  LB nLBRelations = pMap[i].nLBRelations;
1415  if (nLBRelations & nRel)
1416  {
1417  nAlign = pMap[i].nAlign;
1418  break;
1419  }
1420  }
1421  }
1422  }
1423  }
1424  else if (pMap)
1425  nAlign = pMap[nMapPos].nAlign;
1426 
1427  return nAlign;
1428 }
1429 
1430 sal_uInt16 SvxSwPosSizeTabPage::GetMapPos(FrmMap const *pMap, const weld::ComboBox& rAlignLB)
1431 {
1432  sal_uInt16 nMapPos = 0;
1433  int nLBSelPos = rAlignLB.get_active();
1434 
1435  if (nLBSelPos != -1)
1436  {
1437  if (pMap == aVAsCharHtmlMap || pMap == aVAsCharMap)
1438  {
1439  std::size_t nMapCount = ::lcl_GetFrmMapCount(pMap);
1440  OUString sSelEntry(rAlignLB.get_active_text());
1441 
1442  for (std::size_t i = 0; i < nMapCount; i++)
1443  {
1444  SvxSwFramePosString::StringId eResId = pMap[i].eStrId;
1445 
1446  OUString sEntry = SvxSwFramePosString::GetString(eResId);
1447 
1448  if (sEntry == sSelEntry)
1449  {
1450  nMapPos = sal::static_int_cast< sal_uInt16 >(i);
1451  break;
1452  }
1453  }
1454  }
1455  else
1456  nMapPos = nLBSelPos;
1457  }
1458 
1459  return nMapPos;
1460 }
1461 
1463  sal_uInt16 nH,
1464  sal_uInt16 nHRel,
1465  sal_uInt16 nV,
1466  sal_uInt16 nVRel,
1467  long nX,
1468  long nY)
1469 {
1470  int nPos = m_xVertLB->get_active();
1471  if (nPos != -1 && m_pVMap)
1472  {
1473  m_nOldV = m_pVMap[nPos].nAlign;
1474  nPos = m_xVertToLB->get_active();
1475  if (nPos != -1)
1476  m_nOldVRel = reinterpret_cast<RelationMap*>(m_xVertToLB->get_id(nPos).toUInt64())->nRelation;
1477  }
1478 
1479  nPos = m_xHoriLB->get_active();
1480  if (nPos != -1 && m_pHMap)
1481  {
1482  m_nOldH = m_pHMap[nPos].nAlign;
1483 
1484  nPos = m_xHoriToLB->get_active();
1485  if (nPos != -1)
1486  m_nOldHRel = reinterpret_cast<RelationMap*>(m_xHoriToLB->get_id(nPos).toUInt64())->nRelation;
1487  }
1488 
1489  bool bEnable = true;
1490  if( m_bIsMultiSelection )
1491  {
1494  }
1495  else if (nAnchor == RndStdIds::FLY_AT_PAGE)
1496  {
1497  m_pVMap = m_bHtmlMode ? aVPageHtmlMap : aVPageMap;
1498  m_pHMap = m_bHtmlMode ? aHPageHtmlMap : aHPageMap;
1499  }
1500  else if (nAnchor == RndStdIds::FLY_AT_FLY)
1501  {
1502  // #i18732# - own vertical alignment map for to frame
1503  // anchored objects.
1504  m_pVMap = m_bHtmlMode ? aVFlyHtmlMap : aVFrameMap;
1505  m_pHMap = m_bHtmlMode ? aHFlyHtmlMap : aHFrameMap;
1506  }
1507  else if (nAnchor == RndStdIds::FLY_AT_PARA)
1508  {
1509  if(m_bHtmlMode)
1510  {
1513  }
1514  else
1515  {
1516  m_pVMap = aVParaMap;
1517  m_pHMap = aHParaMap;
1518  }
1519  }
1520  else if (nAnchor == RndStdIds::FLY_AT_CHAR)
1521  {
1522  if(m_bHtmlMode)
1523  {
1526  }
1527  else
1528  {
1529  m_pVMap = aVCharMap;
1530  m_pHMap = aHCharMap;
1531  }
1532  }
1533  else if (nAnchor == RndStdIds::FLY_AS_CHAR)
1534  {
1535  m_pVMap = m_bHtmlMode ? aVAsCharHtmlMap : aVAsCharMap;
1536  m_pHMap = nullptr;
1537  bEnable = false;
1538  }
1539  m_xHoriLB->set_sensitive(bEnable);
1540  m_xHoriFT->set_sensitive(bEnable);
1541 
1542  // select current Pos
1543  // horizontal
1544  if ( nH == USHRT_MAX )
1545  {
1546  nH = m_nOldH;
1547  nHRel = m_nOldHRel;
1548  }
1549  // #i22341# - pass <nHRel> as 3rd parameter to method <FillPosLB>
1550  sal_uInt16 nMapPos = FillPosLB(m_pHMap, nH, nHRel, *m_xHoriLB);
1551  FillRelLB(m_pHMap, nMapPos, nH, nHRel, *m_xHoriToLB, *m_xHoriToFT);
1552 
1553  // vertical
1554  if ( nV == USHRT_MAX )
1555  {
1556  nV = m_nOldV;
1557  nVRel = m_nOldVRel;
1558  }
1559  // #i22341# - pass <nVRel> as 3rd parameter to method <FillPosLB>
1560  nMapPos = FillPosLB(m_pVMap, nV, nVRel, *m_xVertLB);
1561  FillRelLB(m_pVMap, nMapPos, nV, nVRel, *m_xVertToLB, *m_xVertToFT);
1562 
1563  // Edits init
1564  bEnable = nH == HoriOrientation::NONE && nAnchor != RndStdIds::FLY_AS_CHAR; //#61359# why not in formats&& !bFormat;
1565  if (!bEnable)
1566  {
1567  m_xHoriByMF->set_value(0, FieldUnit::TWIP);
1568  }
1569  else if(m_bIsMultiSelection)
1570  {
1571  m_xHoriByMF->set_value(m_xHoriByMF->normalize(m_aRect.Left()), FieldUnit::TWIP);
1572  }
1573  else
1574  {
1575  if (nX != LONG_MAX)
1576  m_xHoriByMF->set_value(m_xHoriByMF->normalize(nX), FieldUnit::TWIP);
1577  }
1578  m_xHoriByFT->set_sensitive(bEnable);
1579  m_xHoriByMF->set_sensitive(bEnable);
1580 
1581  bEnable = nV == VertOrientation::NONE;
1582  if ( !bEnable )
1583  {
1584  m_xVertByMF->set_value( 0, FieldUnit::TWIP );
1585  }
1586  else if(m_bIsMultiSelection)
1587  {
1588  m_xVertByMF->set_value(m_xVertByMF->normalize(m_aRect.Top()), FieldUnit::TWIP);
1589  }
1590  else
1591  {
1592  if (nAnchor == RndStdIds::FLY_AS_CHAR)
1593  {
1594  if ( nY == LONG_MAX )
1595  nY = 0;
1596  else
1597  nY *= -1;
1598  }
1599  if ( nY != LONG_MAX )
1600  m_xVertByMF->set_value( m_xVertByMF->normalize(nY), FieldUnit::TWIP );
1601  }
1602  m_xVertByFT->set_sensitive( bEnable );
1603  m_xVertByMF->set_sensitive( bEnable );
1604  UpdateExample();
1605 }
1606 
1608 {
1609  int nPos = m_xHoriLB->get_active();
1610  if (m_pHMap && nPos != -1)
1611  {
1612  sal_uInt16 nMapPos = GetMapPos(m_pHMap, *m_xHoriLB);
1613  short nAlign = GetAlignment(m_pHMap, nMapPos, *m_xHoriToLB);
1614  short nRel = GetRelation(*m_xHoriToLB);
1615 
1616  m_aExampleWN.SetHAlign(nAlign);
1617  m_aExampleWN.SetHoriRel(nRel);
1618  }
1619 
1620  nPos = m_xVertLB->get_active();
1621  if (m_pVMap && nPos != -1)
1622  {
1623  sal_uInt16 nMapPos = GetMapPos(m_pVMap, *m_xVertLB);
1624  sal_uInt16 nAlign = GetAlignment(m_pVMap, nMapPos, *m_xVertToLB);
1625  sal_uInt16 nRel = GetRelation(*m_xVertToLB);
1626 
1627  m_aExampleWN.SetVAlign(nAlign);
1628  m_aExampleWN.SetVertRel(nRel);
1629  }
1630 
1631  // Size
1632  auto nXPos = m_xHoriByMF->denormalize(m_xHoriByMF->get_value(FieldUnit::TWIP));
1633  auto nYPos = m_xVertByMF->denormalize(m_xVertByMF->get_value(FieldUnit::TWIP));
1634  m_aExampleWN.SetRelPos(Point(nXPos, nYPos));
1635 
1637  m_aExampleWN.Invalidate();
1638 }
1639 
1640 void SvxSwPosSizeTabPage::FillRelLB(FrmMap const *pMap, sal_uInt16 nMapPos, sal_uInt16 nAlign,
1641  sal_uInt16 nRel, weld::ComboBox& rLB, weld::Label& rFT)
1642 {
1643  OUString sSelEntry;
1644  LB nLBRelations = LB::NONE;
1645  std::size_t nMapCount = ::lcl_GetFrmMapCount(pMap);
1646 
1647  rLB.clear();
1648 
1649  if (nMapPos < nMapCount)
1650  {
1651  if (pMap == aVAsCharHtmlMap || pMap == aVAsCharMap)
1652  {
1653  OUString sOldEntry(rLB.get_active_text());
1654  SvxSwFramePosString::StringId eStrId = pMap[nMapPos].eStrId;
1655 
1656  for (std::size_t _nMapPos = 0; _nMapPos < nMapCount; _nMapPos++)
1657  {
1658  if (pMap[_nMapPos].eStrId == eStrId)
1659  {
1660  nLBRelations = pMap[_nMapPos].nLBRelations;
1661  for (size_t nRelPos = 0; nRelPos < SAL_N_ELEMENTS(aAsCharRelationMap); nRelPos++)
1662  {
1663  if (nLBRelations & aAsCharRelationMap[nRelPos].nLBRelation)
1664  {
1665  SvxSwFramePosString::StringId sStrId1 = aAsCharRelationMap[nRelPos].eStrId;
1666 
1668  OUString sEntry = SvxSwFramePosString::GetString(sStrId1);
1669  rLB.append(OUString::number(reinterpret_cast<sal_uInt64>(&aAsCharRelationMap[nRelPos])), sEntry);
1670  if (pMap[_nMapPos].nAlign == nAlign)
1671  sSelEntry = sEntry;
1672  break;
1673  }
1674  }
1675  }
1676  }
1677  if (!sSelEntry.isEmpty())
1678  rLB.set_active_text(sSelEntry);
1679  else
1680  {
1681  rLB.set_active_text(sOldEntry);
1682  if (rLB.get_active() == -1)
1683  {
1684  for (int i = 0; i < rLB.get_count(); i++)
1685  {
1686  RelationMap *pEntry = reinterpret_cast<RelationMap*>(rLB.get_id(i).toUInt64());
1687  if (pEntry->nLBRelation == LB::RelChar) // Default
1688  {
1689  rLB.set_active(i);
1690  break;
1691  }
1692  }
1693  }
1694  }
1695  }
1696  else
1697  {
1698  // #i22341# - special handling for map <aVCharMap>,
1699  // because its ambiguous in its <eStrId>/<eMirrorStrId>.
1700  if ( pMap == aVCharMap )
1701  {
1702  nLBRelations = ::lcl_GetLBRelationsForStrID( pMap,
1703  ( m_xHoriMirrorCB->get_active()
1704  ? pMap[nMapPos].eMirrorStrId
1705  : pMap[nMapPos].eStrId ),
1706  m_xHoriMirrorCB->get_active() );
1707  }
1708  else
1709  {
1710  nLBRelations = pMap[nMapPos].nLBRelations;
1711  }
1712 
1713  for (sal_uLong nBit = 1; nBit < sal_uLong(LB::LAST); nBit <<= 1)
1714  {
1715  if (nLBRelations & static_cast<LB>(nBit))
1716  {
1717  for (size_t nRelPos = 0; nRelPos < SAL_N_ELEMENTS(aRelationMap); nRelPos++)
1718  {
1719  if (aRelationMap[nRelPos].nLBRelation == static_cast<LB>(nBit))
1720  {
1721  SvxSwFramePosString::StringId sStrId1 = m_xHoriMirrorCB->get_active() ? aRelationMap[nRelPos].eMirrorStrId : aRelationMap[nRelPos].eStrId;
1723  OUString sEntry = SvxSwFramePosString::GetString(sStrId1);
1724  rLB.append(OUString::number(reinterpret_cast<sal_uInt64>(&aRelationMap[nRelPos])), sEntry);
1725  if (sSelEntry.isEmpty() && aRelationMap[nRelPos].nRelation == nRel)
1726  sSelEntry = sEntry;
1727  }
1728  }
1729  }
1730  }
1731  if (!sSelEntry.isEmpty())
1732  rLB.set_active_text(sSelEntry);
1733  else
1734  {
1735  // Probably anchor change. So look for a similar relation.
1736  switch (nRel)
1737  {
1738  case RelOrientation::FRAME: nRel = RelOrientation::PAGE_FRAME; break;
1739  case RelOrientation::PRINT_AREA: nRel = RelOrientation::PAGE_PRINT_AREA; break;
1740  case RelOrientation::PAGE_LEFT: nRel = RelOrientation::FRAME_LEFT; break;
1741  case RelOrientation::PAGE_RIGHT: nRel = RelOrientation::FRAME_RIGHT; break;
1742  case RelOrientation::FRAME_LEFT: nRel = RelOrientation::PAGE_LEFT; break;
1743  case RelOrientation::FRAME_RIGHT: nRel = RelOrientation::PAGE_RIGHT; break;
1744  case RelOrientation::PAGE_FRAME: nRel = RelOrientation::FRAME; break;
1745  case RelOrientation::PAGE_PRINT_AREA: nRel = RelOrientation::PRINT_AREA; break;
1746 
1747  default:
1748  if (rLB.get_count())
1749  {
1750  RelationMap *pEntry = reinterpret_cast<RelationMap*>(rLB.get_id(rLB.get_count() - 1).toUInt64());
1751  nRel = pEntry->nRelation;
1752  }
1753  break;
1754  }
1755 
1756  for (int i = 0; i < rLB.get_count(); ++i)
1757  {
1758  RelationMap *pEntry = reinterpret_cast<RelationMap*>(rLB.get_id(i).toUInt64());
1759  if (pEntry->nRelation == nRel)
1760  {
1761  rLB.set_active(i);
1762  break;
1763  }
1764  }
1765 
1766  if (rLB.get_active() == -1)
1767  rLB.set_active(0);
1768  }
1769  }
1770  }
1771 
1772  rLB.set_sensitive(rLB.get_count() != 0);
1773  rFT.set_sensitive(rLB.get_count() != 0);
1774 
1775  RelHdl(rLB);
1776 }
1777 
1778 sal_uInt16 SvxSwPosSizeTabPage::FillPosLB(FrmMap const *_pMap,
1779  sal_uInt16 _nAlign,
1780  const sal_uInt16 _nRel,
1781  weld::ComboBox& _rLB)
1782 {
1783  OUString sSelEntry, sOldEntry;
1784  sOldEntry = _rLB.get_active_text();
1785 
1786  _rLB.clear();
1787 
1788  // #i22341# - determine all possible listbox relations for
1789  // given relation for map <aVCharMap>
1790  const LB nLBRelations = (_pMap != aVCharMap)
1791  ? LB::NONE
1792  : ::lcl_GetLBRelationsForRelations( _nRel );
1793 
1794  // fill listbox
1795  std::size_t nCount = ::lcl_GetFrmMapCount(_pMap);
1796  for (std::size_t i = 0; _pMap && i < nCount; ++i)
1797  {
1798  SvxSwFramePosString::StringId eStrId = m_xHoriMirrorCB->get_active() ? _pMap[i].eMirrorStrId : _pMap[i].eStrId;
1800  OUString sEntry(SvxSwFramePosString::GetString(eStrId));
1801  if (_rLB.find_text(sEntry) == -1)
1802  {
1803  // don't insert duplicate entries at character wrapped borders
1804  _rLB.append_text(sEntry);
1805  }
1806  // #i22341# - add condition to handle map <aVCharMap>
1807  // that is ambiguous in the alignment.
1808  if ( _pMap[i].nAlign == _nAlign &&
1809  ( _pMap != aVCharMap || _pMap[i].nLBRelations & nLBRelations ) )
1810  {
1811  sSelEntry = sEntry;
1812  }
1813  }
1814 
1815  _rLB.set_active_text(sSelEntry);
1816  if (_rLB.get_active() == -1)
1817  _rLB.set_active_text(sOldEntry);
1818 
1819  if (_rLB.get_active() == -1)
1820  _rLB.set_active(0);
1821 
1822  PosHdl(_rLB);
1823 
1824  return GetMapPos(_pMap, _rLB);
1825 }
1826 
1827 void SvxSwPosSizeTabPage::SetView( const SdrView* pSdrView )
1828 {
1829  m_pSdrView = pSdrView;
1830  if(!m_pSdrView)
1831  {
1832  OSL_FAIL("No SdrView* set");
1833  return;
1834  }
1835 
1836  // setting of the rectangle and the working area
1839 
1840  // get WorkArea
1842 
1843  // consider anchor position (for Writer)
1844  const SdrMarkList& rMarkList = m_pSdrView->GetMarkedObjectList();
1845  if( rMarkList.GetMarkCount() > 0 )
1846  {
1847  const SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
1848  m_aAnchorPos = pObj->GetAnchorPos();
1849 
1850  if( m_aAnchorPos != Point(0,0) ) // -> Writer
1851  {
1852  for( size_t i = 1; i < rMarkList.GetMarkCount(); ++i )
1853  {
1854  pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
1855  if( m_aAnchorPos != pObj->GetAnchorPos() )
1856  {
1857  // different anchor positions -> disable positioning
1858  m_xPosFrame->set_sensitive(false);
1859  m_bPositioningDisabled = true;
1860  return;
1861  }
1862  }
1863  }
1864  Point aPt = m_aAnchorPos * -1;
1865  Point aPt2 = aPt;
1866 
1867  aPt += m_aWorkArea.TopLeft();
1868  m_aWorkArea.SetPos( aPt );
1869 
1870  aPt2 += m_aRect.TopLeft();
1871  m_aRect.SetPos( aPt2 );
1872  }
1873 
1874  // this should happen via SID_ATTR_TRANSFORM_AUTOSIZE
1875  if( rMarkList.GetMarkCount() != 1 )
1876  m_bIsMultiSelection = true;
1877 #if OSL_DEBUG_LEVEL > 1
1878  else
1879  {
1880  const SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
1881  SdrObjKind eKind = (SdrObjKind) pObj->GetObjIdentifier();
1882  if( ( pObj->GetObjInventor() == SdrInventor::Default ) &&
1883  ( eKind==OBJ_TEXT || eKind==OBJ_TITLETEXT || eKind==OBJ_OUTLINETEXT) &&
1884  pObj->HasText() )
1885  {
1886  OSL_FAIL("AutoWidth/AutoHeight should be enabled");
1887  }
1888  }
1889 #endif
1890 }
1891 
1892 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual bool FillItemSet(SfxItemSet *) override
SvxSwFramePosString::StringId eMirrorStrId
Point TopLeft() const
void SetPos(const Point &rPoint)
void SetFieldUnit(weld::MetricSpinButton &rField, FieldUnit eUnit, bool bAll)
sal_Int32 GetValue() const
FieldUnit
sal_Int32 nIndex
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
std::unique_ptr< weld::Label > m_xVertByFT
size_t GetMarkCount() const
::tools::Rectangle m_aWorkArea
static sal_uInt16 GetMapPos(FrmMap const *pMap, const weld::ComboBox &rAlignLB)
static FrmMap aHCharHtmlAbsMap[]
std::string GetValue
static FrmMap const aHMultiSelectionMap[]
static FrmMap const aHFlyHtmlMap[]
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
#define FRAME
static RelationMap const aRelationMap[]
OBJ_TEXT
void InitPos(RndStdIds nAnchorType, sal_uInt16 nH, sal_uInt16 nHRel, sal_uInt16 nV, sal_uInt16 nVRel, long nX, long nY)
sal_uIntPtr sal_uLong
static FrmMap const aHPageHtmlMap[]
bool get_state_changed_from_saved() const
const wchar_t *typedef int(__stdcall *DllNativeUnregProc)(int
virtual bool HasText() const
virtual int find_text(const OUString &rStr) const =0
void InvalidateItem(sal_uInt16 nWhich)
sal_Int16 nId
static LB lcl_GetLBRelationsForStrID(const FrmMap *_pMap, const SvxSwFramePosString::StringId _eStrId, const bool _bUseMirrorStr)
std::unique_ptr< weld::CheckButton > m_xPositionCB
SdrMark * GetMark(size_t nNum) const
std::unique_ptr< weld::RadioButton > m_xToFrameRB
void append(const OUString &rId, const OUString &rStr)
sal_uInt16 FillPosLB(FrmMap const *pMap, sal_uInt16 nAlign, const sal_uInt16 _nRel, weld::ComboBox &rLB)
virtual OUString get_active_id() const =0
static FrmMap const aVCharHtmlAbsMap[]
std::unique_ptr< weld::CheckButton > m_xKeepRatioCB
virtual int get_active() const =0
static FrmMap const aVParaMap[]
TRISTATE_TRUE
static const SfxPoolItem * GetItem(const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true)
virtual int get_count() const =0
static FrmMap const aHParaHtmlMap[]
std::unique_ptr< weld::Widget > m_xPosFrame
FieldUnit GetModuleFieldUnit(const SfxItemSet &rSet)
NONE
std::unique_ptr< weld::Label > m_xVertFT
static const sal_uInt16 * GetRanges()
std::unique_ptr< weld::Label > m_xHoriByFT
HashMap_OWString_Interface aMap
void LogicToPagePos(Point &rPnt) const
void SetVertRel(short nR)
LB
std::unique_ptr< weld::MetricSpinButton > m_xVertByMF
#define VERT_FRAME_REL
std::unique_ptr< weld::CheckButton > m_xHoriMirrorCB
std::unique_ptr< weld::RadioButton > m_xToPageRB
void SetExchangeSupport()
int nCount
long Top() const
std::unique_ptr< weld::ComboBox > m_xHoriToLB
static OUString GetString(StringId eId)
static constexpr auto HORI_PAGE_REL
void SetVAlign(short nV)
std::unique_ptr< weld::ComboBox > m_xVertToLB
const SfxItemSet & GetItemSet() const
#define SAL_N_ELEMENTS(arr)
SvxSwFramePosString::StringId eStrId
SdrObject * GetMarkedSdrObj() const
static std::size_t lcl_GetFrmMapCount(const FrmMap *pMap)
SwFrameExample m_aExampleWN
static FrmMap const aVMultiSelectionMap[]
static constexpr auto VERT_PARA_REL
void set_active_text(const OUString &rStr)
FrmMap const * m_pVMap
static FrmMap const aVPageHtmlMap[]
sal_Int16 GetValue() const
std::unique_ptr< weld::CheckButton > m_xSizeCB
static FrmMap aVCharMap[]
static LB lcl_GetLBRelationsForRelations(const sal_uInt16 _nRel)
virtual sal_uInt16 GetObjIdentifier() const
std::unique_ptr< weld::CheckButton > m_xFollowCB
static constexpr auto HORI_CHAR_REL
static FrmMap aHCharMap[]
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
int i
TRISTATE_FALSE
const SdrMarkList & GetMarkedObjectList() const
static FrmMap const aHParaHtmlAbsMap[]
HTMLMODE_ON
CENTER
virtual void Reset(const SfxItemSet *) override
static RelationMap const aAsCharRelationMap[]
std::unique_ptr< weld::Label > m_xHoriToFT
void SetHAlign(short nH)
std::unique_ptr< weld::ComboBox > m_xVertLB
static FrmMap const aHParaMap[]
virtual void set_active(int pos)=0
std::unique_ptr< weld::RadioButton > m_xAsCharRB
virtual void clear()=0
std::unique_ptr< weld::MetricSpinButton > m_xWidthMF
static constexpr auto HORI_PARA_REL
std::unique_ptr< weld::MetricSpinButton > m_xHoriByMF
void SetAnchor(RndStdIds nA)
long X() const
const tools::Rectangle & GetAllMarkedRect() const
const long LONG_MAX
virtual SdrInventor GetObjInventor() const
std::unique_ptr< weld::Label > m_xVertToFT
::tools::Rectangle m_aRect
static FrmMap const aHFrameMap[]
std::unique_ptr< weld::ComboBox > m_xHoriLB
static short GetAlignment(FrmMap const *pMap, sal_uInt16 nMapPos, const weld::ComboBox &rRelationLB)
RndStdIds GetAnchorType(bool *pbHasChanged=nullptr)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
OBJ_OUTLINETEXT
static FrmMap const aVCharHtmlMap[]
IMPL_LINK(SvxSwPosSizeTabPage, RelHdl, weld::ComboBox &, rLB, void)
weld::Entry & rEdit
SdrObjKind
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
static FrmMap const aVPageMap[]
static SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(SvxSwFramePosString::StringId eStringId, bool bVertical, bool bRTL)
const SdrView * m_pSdrView
IMPL_LINK_NOARG(SvxSwPosSizeTabPage, RangeModifyClickHdl, weld::ToggleButton &, void)
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
SvxAnchorIds
static FrmMap const aVAsCharMap[]
#define HTML_HORI_PARA_REL
void SetHoriRel(short nR)
static FrmMap const aVParaHtmlMap[]
#define HTML_HORI_CHAR_REL
virtual OUString get_id(int pos) const =0
long Left() const
static short GetRelation(const weld::ComboBox &rRelationLB)
const Point & GetAnchorPos() const
SvxSwPosSizeTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rInAttrs)
void SetRelPos(const Point &rP)
SdrPageView * GetSdrPageView() const
std::unique_ptr< weld::MetricSpinButton > m_xHeightMF
DeactivateRC
static constexpr auto VERT_CHAR_REL
std::unique_ptr< weld::RadioButton > m_xToCharRB
FrmMap const * m_pHMap
void append_text(const OUString &rStr)
RndStdIds
static FrmMap const aVAsCharHtmlMap[]
static FrmMap aHCharHtmlMap[]
std::unique_ptr< weld::RadioButton > m_xToParaRB
static constexpr auto HORI_FRAME_REL
void EnableAnchorTypes(SvxAnchorIds nAnchorEnable)
static FrmMap const aVFlyHtmlMap[]
const tools::Rectangle & GetWorkArea() const
void FillRelLB(FrmMap const *pMap, sal_uInt16 nLBSelPos, sal_uInt16 nAlign, sal_uInt16 nRel, weld::ComboBox &rLB, weld::Label &rFT)
OBJ_TITLETEXT
#define VERT_PAGE_REL
virtual ~SvxSwPosSizeTabPage() override
static FrmMap const aVFrameMap[]
std::unique_ptr< weld::Label > m_xHoriFT
long Y() const
sal_uInt16 nPos
virtual void set_sensitive(bool sensitive)=0
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
virtual OUString get_active_text() const =0
void SetView(const SdrView *pSdrView)
static FrmMap const aHPageMap[]