LibreOffice Module sw (master)  1
uitool.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 <hintids.hxx>
21 
22 #include <osl/diagnose.h>
23 #include <tools/datetime.hxx>
24 #include <vcl/weld.hxx>
26 #include <svl/stritem.hxx>
27 #include <svl/grabbagitem.hxx>
28 #include <unotools/syslocale.hxx>
30 #include <editeng/pmdlitem.hxx>
31 #include <editeng/tstpitem.hxx>
32 #include <editeng/boxitem.hxx>
33 #include <editeng/sizeitem.hxx>
34 #include <editeng/brushitem.hxx>
35 #include <svx/pageitem.hxx>
36 #include <editeng/lrspitem.hxx>
37 #include <svl/style.hxx>
39 #include <com/sun/star/frame/XDispatch.hpp>
40 #include <com/sun/star/frame/XDispatchProvider.hpp>
41 #include <com/sun/star/frame/XFrame.hpp>
42 #include <com/sun/star/util/URLTransformer.hpp>
43 #include <com/sun/star/util/XURLTransformer.hpp>
45 #include <sfx2/viewfrm.hxx>
46 #include <fmtornt.hxx>
47 #include <tabcol.hxx>
48 #include <fmtfsize.hxx>
49 #include <fmthdft.hxx>
50 #include <fmtpdsc.hxx>
51 #include <uiitems.hxx>
52 #include <docsh.hxx>
53 #include <wrtsh.hxx>
54 #include <swmodule.hxx>
55 #include <view.hxx>
56 #include <uitool.hxx>
57 #include <frmatr.hxx>
58 #include <paratr.hxx>
59 #include <fmtcol.hxx>
60 #include <usrpref.hxx>
61 
62 #include <cmdid.h>
63 #include <doc.hxx>
64 #include <docary.hxx>
65 #include <charfmt.hxx>
66 #include <SwStyleNameMapper.hxx>
67 #include <strings.hrc>
68 // 50 cm 28350
69 
70 #define MAXHEIGHT 28350
71 #define MAXWIDTH 28350
72 
73 using namespace ::com::sun::star;
74 
75 // General list of string pointer
76 
77 // Set boxinfo attribute
78 
79 void PrepareBoxInfo(SfxItemSet& rSet, const SwWrtShell& rSh)
80 {
81  std::shared_ptr<SvxBoxInfoItem> aBoxInfo(std::make_shared<SvxBoxInfoItem>(SID_ATTR_BORDER_INNER));
82  const SfxPoolItem *pBoxInfo;
83 
84  if ( SfxItemState::SET == rSet.GetItemState( SID_ATTR_BORDER_INNER, true, &pBoxInfo))
85  {
86  aBoxInfo.reset(static_cast<SvxBoxInfoItem*>(pBoxInfo->Clone()));
87  }
88 
89  // Table variant: If more than one table cells are selected
90  rSh.GetCursor(); //So that GetCursorCnt() returns the right thing
91  aBoxInfo->SetTable (rSh.IsTableMode() && rSh.GetCursorCnt() > 1);
92  // Always show the distance field
93  aBoxInfo->SetDist (true);
94  // Set minimal size in tables and paragraphs
95  aBoxInfo->SetMinDist (rSh.IsTableMode() || rSh.GetSelectionType() & (SelectionType::Text | SelectionType::Table));
96  // Set always the default distance
97  aBoxInfo->SetDefDist (MIN_BORDER_DIST);
98  // Single lines can have only in tables DontCare-Status
99  aBoxInfo->SetValid(SvxBoxInfoItemValidFlags::DISABLE, !rSh.IsTableMode());
100 
101  rSet.Put(*aBoxInfo);
102 }
103 
104 void ConvertAttrCharToGen(SfxItemSet& rSet, bool bIsPara)
105 {
106  // Background / highlight
107  {
108  // Always use the visible background
109  const SfxPoolItem *pTmpBrush;
110  if( SfxItemState::SET == rSet.GetItemState( RES_CHRATR_HIGHLIGHT, true, &pTmpBrush ) )
111  {
112  SvxBrushItem aTmpBrush( pTmpBrush->StaticWhichCast(RES_CHRATR_HIGHLIGHT) );
113  if( aTmpBrush.GetColor() != COL_TRANSPARENT )
114  {
115  aTmpBrush.SetWhich( RES_CHRATR_BACKGROUND );
116  rSet.Put( aTmpBrush );
117  }
118  }
119  }
120 
121  if ( bIsPara )
122  return;
123 
124  // Tell dialogs to use character-specific slots/whichIds
125  // tdf#126684: We use RES_PARATR_GRABBAG, because RES_CHRATR_GRABBAG may be overwritten later in
126  // SwDocStyleSheet::GetItemSet when applying attributes from char format
127  assert(SfxItemState::SET != rSet.GetItemState(RES_PARATR_GRABBAG, false));
129  aGrabBag.GetGrabBag()["DialogUseCharAttr"] <<= true;
130  // Store initial ranges to allow restoring later
131  const sal_uInt16* pRanges = rSet.GetRanges();
132  const sal_uInt16* pEnd = pRanges;
133  while (*pEnd)
134  ++pEnd;
135  const uno::Sequence<sal_uInt16> aOrigRanges(pRanges, pEnd - pRanges + 1);
136  aGrabBag.GetGrabBag()["OrigItemSetRanges"] <<= aOrigRanges;
138  rSet.Put(aGrabBag);
139 }
140 
141 void ConvertAttrGenToChar(SfxItemSet& rSet, const SfxItemSet& rOrigSet, bool bIsPara)
142 {
143  // Background / highlighting
144  const SfxPoolItem *pTmpItem;
145  if( SfxItemState::SET == rSet.GetItemState( RES_CHRATR_BACKGROUND, false, &pTmpItem ) )
146  {
147  // Highlight is an MS specific thing, so remove it at the first time when LO modifies
148  // this part of the imported document.
150 
151  // Remove shading marker
152  if (SfxItemState::SET == rOrigSet.GetItemState(RES_CHRATR_GRABBAG, false, &pTmpItem))
153  {
155  std::map<OUString, css::uno::Any>& rMap = aGrabBag.GetGrabBag();
156  auto aIterator = rMap.find("CharShadingMarker");
157  if( aIterator != rMap.end() )
158  {
159  aIterator->second <<= false;
160  }
161  rSet.Put( aGrabBag );
162  }
163  }
164 
165  if ( bIsPara )
166  return;
167 
168  rSet.ClearItem( RES_BACKGROUND );
169 
170  if (SfxItemState::SET == rOrigSet.GetItemState(RES_PARATR_GRABBAG, false, &pTmpItem))
171  {
173  std::map<OUString, css::uno::Any>& rMap = aGrabBag.GetGrabBag();
174  auto aIterator = rMap.find("OrigItemSetRanges");
175  if (aIterator != rMap.end())
176  {
177  if (uno::Sequence<sal_uInt16> aOrigRanges; (aIterator->second >>= aOrigRanges)
178  && aOrigRanges.getLength() % 2 == 1
179  && *(std::cend(aOrigRanges) - 1) == 0)
180  rSet.SetRanges(aOrigRanges.getConstArray());
181  }
182  }
183  assert(SfxItemState::SET != rSet.GetItemState(RES_PARATR_GRABBAG, false));
184 }
185 
186 void ApplyCharBackground(const Color& rBackgroundColor, SwWrtShell& rShell)
187 {
189 
190  SfxItemSet aCoreSet(rShell.GetView().GetPool(), svl::Items<
191  RES_CHRATR_GRABBAG, RES_CHRATR_GRABBAG>{});
192 
193  rShell.GetCurAttr(aCoreSet);
194 
195  // Set char background
196  rShell.SetAttrItem(SvxBrushItem(rBackgroundColor, RES_CHRATR_BACKGROUND));
197 
198  // Highlight is an MS specific thing, so remove it at the first time when LO modifies
199  // this part of the imported document.
201 
202  // Remove shading marker
203  const SfxPoolItem *pTmpItem;
204  if (SfxItemState::SET == aCoreSet.GetItemState(RES_CHRATR_GRABBAG, false, &pTmpItem))
205  {
206  SfxGrabBagItem aGrabBag(pTmpItem->StaticWhichCast(RES_CHRATR_GRABBAG));
207  std::map<OUString, css::uno::Any>& rMap = aGrabBag.GetGrabBag();
208  auto aIterator = rMap.find("CharShadingMarker");
209  if (aIterator != rMap.end())
210  {
211  aIterator->second <<= false;
212  }
213  rShell.SetAttrItem(aGrabBag);
214  }
215 
216  rShell.EndUndo(SwUndoId::INSATTR);
217 }
218 
219 // Fill header footer
220 
221 static void FillHdFt(SwFrameFormat* pFormat, const SfxItemSet& rSet)
222 {
223  SwAttrSet aSet(pFormat->GetAttrSet());
224  aSet.Put(rSet);
225 
226  const SvxSizeItem& rSize = rSet.Get(SID_ATTR_PAGE_SIZE);
227  const SfxBoolItem& rDynamic = rSet.Get(SID_ATTR_PAGE_DYNAMIC);
228 
229  // Convert size
231  rSize.GetSize().Width(),
232  rSize.GetSize().Height());
233  aSet.Put(aFrameSize);
234  pFormat->SetFormatAttr(aSet);
235 }
236 
239 {
240  SvxPageUsage nRet = SvxPageUsage::NONE;
241  if (nUse & UseOnPage::Left)
242  nRet = SvxPageUsage::Left;
243  if (nUse & UseOnPage::Right)
244  nRet = SvxPageUsage::Right;
245  if ((nUse & UseOnPage::All) == UseOnPage::All)
246  nRet = SvxPageUsage::All;
247  if ((nUse & UseOnPage::Mirror) == UseOnPage::Mirror)
248  nRet = SvxPageUsage::Mirror;
249  return nRet;
250 }
251 
254 {
255  UseOnPage nRet = UseOnPage::NONE;
256  if (nUse == SvxPageUsage::Left)
257  nRet = UseOnPage::Left;
258  else if (nUse == SvxPageUsage::Right)
259  nRet = UseOnPage::Right;
260  else if (nUse == SvxPageUsage::All)
261  nRet = UseOnPage::All;
262  else if (nUse == SvxPageUsage::Mirror)
263  nRet = UseOnPage::Mirror;
264  return nRet;
265 }
266 
267 // PageDesc <-> convert into sets and back
268 
269 void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc )
270 {
271  SwFrameFormat& rMaster = rPageDesc.GetMaster();
272  bool bFirstShare = false;
273 
274  // before SetFormatAttr() in case it contains RES_BACKGROUND_FULL_SIZE
275  // itself, as it does when called from SwXPageStyle
276  SfxPoolItem const* pItem(nullptr);
277  if (SfxItemState::SET == rSet.GetItemState(SID_ATTR_CHAR_GRABBAG, true, &pItem))
278  {
279  SfxGrabBagItem const*const pGrabBag(static_cast<SfxGrabBagItem const*>(pItem));
280  bool bValue;
281  if (pGrabBag->GetGrabBag().find("BackgroundFullSize")->second >>= bValue)
282  {
284  }
285  if (pGrabBag->GetGrabBag().find("RtlGutter")->second >>= bValue)
286  {
287  rMaster.SetFormatAttr(SfxBoolItem(RES_RTL_GUTTER, bValue));
288  }
289  }
290 
291  // Transfer all general frame attributes
292  rMaster.SetFormatAttr(rSet);
293 
294  // PageData
295  if(rSet.GetItemState(SID_ATTR_PAGE) == SfxItemState::SET)
296  {
297  const SvxPageItem& rPageItem = rSet.Get(SID_ATTR_PAGE);
298 
299  const SvxPageUsage nUse = rPageItem.GetPageUsage();
300  if(nUse != SvxPageUsage::NONE)
301  rPageDesc.SetUseOn( lcl_convertUseFromSvx(nUse) );
302  rPageDesc.SetLandscape(rPageItem.IsLandscape());
303  SvxNumberType aNumType;
304  aNumType.SetNumberingType( rPageItem.GetNumType() );
305  rPageDesc.SetNumType(aNumType);
306  }
307  // Size
308  if(rSet.GetItemState(SID_ATTR_PAGE_SIZE) == SfxItemState::SET)
309  {
310  const SvxSizeItem& rSizeItem = rSet.Get(SID_ATTR_PAGE_SIZE);
312  aSize.SetSize(rSizeItem.GetSize());
313  rMaster.SetFormatAttr(aSize);
314  }
315  // Evaluate header attributes
316  if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_PAGE_HEADERSET,
317  false, &pItem ) )
318  {
319  const SfxItemSet& rHeaderSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet();
320  const SfxBoolItem& rHeaderOn = rHeaderSet.Get(SID_ATTR_PAGE_ON);
321 
322  if(rHeaderOn.GetValue())
323  {
324  // Take over values
325  if(!rMaster.GetHeader().IsActive())
326  rMaster.SetFormatAttr(SwFormatHeader(true));
327 
328  // Pick out everything and adapt the header format
329  SwFormatHeader aHeaderFormat(rMaster.GetHeader());
330  SwFrameFormat *pHeaderFormat = aHeaderFormat.GetHeaderFormat();
331  OSL_ENSURE(pHeaderFormat != nullptr, "no header format");
332 
333  ::FillHdFt(pHeaderFormat, rHeaderSet);
334 
335  rPageDesc.ChgHeaderShare(rHeaderSet.Get(SID_ATTR_PAGE_SHARED).GetValue());
336  rPageDesc.ChgFirstShare(static_cast<const SfxBoolItem&>(
337  rHeaderSet.Get(SID_ATTR_PAGE_SHARED_FIRST)).GetValue());
338  bFirstShare = true;
339  }
340  else
341  {
342  // Disable header
343  if(rMaster.GetHeader().IsActive())
344  {
345  rMaster.SetFormatAttr(SwFormatHeader(false));
346  rPageDesc.ChgHeaderShare(false);
347  }
348  }
349  }
350 
351  // Evaluate footer attributes
352  if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_PAGE_FOOTERSET,
353  false, &pItem ) )
354  {
355  const SfxItemSet& rFooterSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet();
356  const SfxBoolItem& rFooterOn = rFooterSet.Get(SID_ATTR_PAGE_ON);
357 
358  if(rFooterOn.GetValue())
359  {
360  // Take over values
361  if(!rMaster.GetFooter().IsActive())
362  rMaster.SetFormatAttr(SwFormatFooter(true));
363 
364  // Pick out everything and adapt the footer format
365  SwFormatFooter aFooterFormat(rMaster.GetFooter());
366  SwFrameFormat *pFooterFormat = aFooterFormat.GetFooterFormat();
367  OSL_ENSURE(pFooterFormat != nullptr, "no footer format");
368 
369  ::FillHdFt(pFooterFormat, rFooterSet);
370 
371  rPageDesc.ChgFooterShare(rFooterSet.Get(SID_ATTR_PAGE_SHARED).GetValue());
372  if (!bFirstShare)
373  {
374  rPageDesc.ChgFirstShare(static_cast<const SfxBoolItem&>(
375  rFooterSet.Get(SID_ATTR_PAGE_SHARED_FIRST)).GetValue());
376  }
377  }
378  else
379  {
380  // Disable footer
381  if(rMaster.GetFooter().IsActive())
382  {
383  rMaster.SetFormatAttr(SwFormatFooter(false));
384  rPageDesc.ChgFooterShare(false);
385  }
386  }
387  }
388 
389  // Footnotes
390 
391  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_FTN_INFO,
392  false, &pItem ) )
393  rPageDesc.SetFootnoteInfo( static_cast<const SwPageFootnoteInfoItem*>(pItem)->GetPageFootnoteInfo() );
394 
395  // Columns
396 
397  // Register compliant
398 
399  if(SfxItemState::SET != rSet.GetItemState(
400  SID_SWREGISTER_MODE, false, &pItem))
401  return;
402 
403  bool bSet = static_cast<const SfxBoolItem*>(pItem)->GetValue();
404  if(!bSet)
405  rPageDesc.SetRegisterFormatColl(nullptr);
406  else if(SfxItemState::SET == rSet.GetItemState(
407  SID_SWREGISTER_COLLECTION, false, &pItem))
408  {
409  const OUString& rColl = static_cast<const SfxStringItem*>(pItem)->GetValue();
410  SwDoc& rDoc = *rMaster.GetDoc();
411  SwTextFormatColl* pColl = rDoc.FindTextFormatCollByName( rColl );
412  if( !pColl )
413  {
414  const sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(
416  if( USHRT_MAX != nId )
417  pColl = rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool( nId );
418  else
419  pColl = rDoc.MakeTextFormatColl( rColl,
420  rDoc.GetDfltTextFormatColl() );
421  }
422  if( pColl )
423  pColl->SetFormatAttr( SwRegisterItem ( true ));
424  rPageDesc.SetRegisterFormatColl( pColl );
425  }
426 }
427 
428 void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet)
429 {
430  const SwFrameFormat& rMaster = rPageDesc.GetMaster();
431 
432  // Page data
433  SvxPageItem aPageItem(SID_ATTR_PAGE);
434  aPageItem.SetDescName(rPageDesc.GetName());
435  aPageItem.SetPageUsage(lcl_convertUseToSvx(rPageDesc.GetUseOn()));
436  aPageItem.SetLandscape(rPageDesc.GetLandscape());
437  aPageItem.SetNumType(rPageDesc.GetNumType().GetNumberingType());
438  rSet.Put(aPageItem);
439 
440  // Size
441  SvxSizeItem aSizeItem(SID_ATTR_PAGE_SIZE, rMaster.GetFrameSize().GetSize());
442  rSet.Put(aSizeItem);
443 
444  // Maximum size
445  SvxSizeItem aMaxSizeItem(SID_ATTR_PAGE_MAXSIZE, Size(MAXWIDTH, MAXHEIGHT));
446  rSet.Put(aMaxSizeItem);
447 
448  // Margins, border and the other stuff.
449  rSet.Put(rMaster.GetAttrSet());
450 
451  std::shared_ptr<SvxBoxInfoItem> aBoxInfo(std::make_shared<SvxBoxInfoItem>(SID_ATTR_BORDER_INNER));
452  const SfxPoolItem *pBoxInfo;
453 
454  if ( SfxItemState::SET == rSet.GetItemState( SID_ATTR_BORDER_INNER, true, &pBoxInfo) )
455  {
456  aBoxInfo.reset(static_cast<SvxBoxInfoItem*>(pBoxInfo->Clone()));
457  }
458 
459  aBoxInfo->SetTable( false );
460  // Show always the distance field
461  aBoxInfo->SetDist( true);
462  // Set minimal size in tables and paragraphs
463  aBoxInfo->SetMinDist( false );
464  // Set always the default distance
465  aBoxInfo->SetDefDist( MIN_BORDER_DIST );
466  // Single lines can have only in tables DontCare-Status
467  aBoxInfo->SetValid( SvxBoxInfoItemValidFlags::DISABLE );
468  rSet.Put( *aBoxInfo );
469 
470  SfxStringItem aFollow(SID_ATTR_PAGE_EXT1, OUString());
471  if(rPageDesc.GetFollow())
472  aFollow.SetValue(rPageDesc.GetFollow()->GetName());
473  rSet.Put(aFollow);
474 
475  // Header
476  if(rMaster.GetHeader().IsActive())
477  {
478  const SwFormatHeader &rHeaderFormat = rMaster.GetHeader();
479  const SwFrameFormat *pHeaderFormat = rHeaderFormat.GetHeaderFormat();
480  OSL_ENSURE(pHeaderFormat != nullptr, "no header format");
481 
482  // HeaderInfo, margins, background, border
483  SfxItemSet aHeaderSet(*rSet.GetPool(),
485 
486  // FillAttribute support
488 
489  SID_ATTR_BORDER_INNER,SID_ATTR_BORDER_INNER, // [10023
490  SID_ATTR_PAGE_SIZE,SID_ATTR_PAGE_SIZE, // [10051
491  SID_ATTR_PAGE_ON,SID_ATTR_PAGE_SHARED, // [10060
492  SID_ATTR_PAGE_SHARED_FIRST,SID_ATTR_PAGE_SHARED_FIRST>{});
493 
494  // set correct parent to get the XFILL_NONE FillStyle as needed
495  aHeaderSet.SetParent(&rMaster.GetDoc()->GetDfltFrameFormat()->GetAttrSet());
496 
497  // Dynamic or fixed height
498  SfxBoolItem aOn(SID_ATTR_PAGE_ON, true);
499  aHeaderSet.Put(aOn);
500 
501  const SwFormatFrameSize &rFrameSize = pHeaderFormat->GetFrameSize();
502  const SwFrameSize eSizeType = rFrameSize.GetHeightSizeType();
503  SfxBoolItem aDynamic(SID_ATTR_PAGE_DYNAMIC, eSizeType != SwFrameSize::Fixed);
504  aHeaderSet.Put(aDynamic);
505 
506  // Left equal right
507  SfxBoolItem aShared(SID_ATTR_PAGE_SHARED, rPageDesc.IsHeaderShared());
508  aHeaderSet.Put(aShared);
509  SfxBoolItem aFirstShared(SID_ATTR_PAGE_SHARED_FIRST, rPageDesc.IsFirstShared());
510  aHeaderSet.Put(aFirstShared);
511 
512  // Size
513  SvxSizeItem aSize(SID_ATTR_PAGE_SIZE, rFrameSize.GetSize());
514  aHeaderSet.Put(aSize);
515 
516  // Shifting frame attributes
517  aHeaderSet.Put(pHeaderFormat->GetAttrSet());
518  aHeaderSet.Put( *aBoxInfo );
519 
520  // Create SetItem
521  SvxSetItem aSetItem(SID_ATTR_PAGE_HEADERSET, aHeaderSet);
522  rSet.Put(aSetItem);
523  }
524 
525  // Footer
526  if(rMaster.GetFooter().IsActive())
527  {
528  const SwFormatFooter &rFooterFormat = rMaster.GetFooter();
529  const SwFrameFormat *pFooterFormat = rFooterFormat.GetFooterFormat();
530  OSL_ENSURE(pFooterFormat != nullptr, "no footer format");
531 
532  // FooterInfo, margins, background, border
533  SfxItemSet aFooterSet(*rSet.GetPool(),
535 
536  // FillAttribute support
538 
539  SID_ATTR_BORDER_INNER,SID_ATTR_BORDER_INNER, // [10023
540  SID_ATTR_PAGE_SIZE,SID_ATTR_PAGE_SIZE, // [10051
541  SID_ATTR_PAGE_ON,SID_ATTR_PAGE_SHARED, // [10060
542  SID_ATTR_PAGE_SHARED_FIRST,SID_ATTR_PAGE_SHARED_FIRST>{});
543 
544  // set correct parent to get the XFILL_NONE FillStyle as needed
545  aFooterSet.SetParent(&rMaster.GetDoc()->GetDfltFrameFormat()->GetAttrSet());
546 
547  // Dynamic or fixed height
548  SfxBoolItem aOn(SID_ATTR_PAGE_ON, true);
549  aFooterSet.Put(aOn);
550 
551  const SwFormatFrameSize &rFrameSize = pFooterFormat->GetFrameSize();
552  const SwFrameSize eSizeType = rFrameSize.GetHeightSizeType();
553  SfxBoolItem aDynamic(SID_ATTR_PAGE_DYNAMIC, eSizeType != SwFrameSize::Fixed);
554  aFooterSet.Put(aDynamic);
555 
556  // Left equal right
557  SfxBoolItem aShared(SID_ATTR_PAGE_SHARED, rPageDesc.IsFooterShared());
558  aFooterSet.Put(aShared);
559  SfxBoolItem aFirstShared(SID_ATTR_PAGE_SHARED_FIRST, rPageDesc.IsFirstShared());
560  aFooterSet.Put(aFirstShared);
561 
562  // Size
563  SvxSizeItem aSize(SID_ATTR_PAGE_SIZE, rFrameSize.GetSize());
564  aFooterSet.Put(aSize);
565 
566  // Shifting Frame attributes
567  aFooterSet.Put(pFooterFormat->GetAttrSet());
568  aFooterSet.Put( *aBoxInfo );
569 
570  // Create SetItem
571  SvxSetItem aSetItem(SID_ATTR_PAGE_FOOTERSET, aFooterSet);
572  rSet.Put(aSetItem);
573  }
574 
575  // Integrate footnotes
576  SwPageFootnoteInfo& rInfo = const_cast<SwPageFootnoteInfo&>(rPageDesc.GetFootnoteInfo());
577  SwPageFootnoteInfoItem aFootnoteItem(rInfo);
578  rSet.Put(aFootnoteItem);
579 
580  // Register compliant
581  const SwTextFormatColl* pCol = rPageDesc.GetRegisterFormatColl();
582  SwRegisterItem aReg(pCol != nullptr);
583  aReg.SetWhich(SID_SWREGISTER_MODE);
584  rSet.Put(aReg);
585  if(pCol)
586  rSet.Put(SfxStringItem(SID_SWREGISTER_COLLECTION, pCol->GetName()));
587 
588  std::optional<SfxGrabBagItem> oGrabBag;
589  SfxPoolItem const* pItem(nullptr);
590  if (SfxItemState::SET == rSet.GetItemState(SID_ATTR_CHAR_GRABBAG, true, &pItem))
591  {
592  oGrabBag.emplace(*static_cast<SfxGrabBagItem const*>(pItem));
593  }
594  else
595  {
596  oGrabBag.emplace(SID_ATTR_CHAR_GRABBAG);
597  }
598  oGrabBag->GetGrabBag()["BackgroundFullSize"] <<=
600  oGrabBag->GetGrabBag()["RtlGutter"] <<=
602  rSet.Put(*oGrabBag);
603 }
604 
605 // Set DefaultTabs
606 
607 void MakeDefTabs(SwTwips nDefDist, SvxTabStopItem& rTabs)
608 {
609  if( rTabs.Count() )
610  return;
611  {
612  SvxTabStop aSwTabStop( nDefDist, SvxTabAdjust::Default );
613  rTabs.Insert( aSwTabStop );
614  }
615 }
616 
617 // Distance between two tabs
618 
620 {
621  return rTabs.Count() ? rTabs[0].GetTabPos() : 1134; // 1134 = 2 cm
622 }
623 
624 // Inquire if in the set is a Sfx-PageDesc combination present and return it.
625 void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet )
626 {
627  const SfxPoolItem* pItem;
628  SwFormatPageDesc aPgDesc;
629 
630  bool bChanged = false;
631  // Page number
632  switch (rSet.GetItemState(SID_ATTR_PARA_PAGENUM, false, &pItem))
633  {
634  case SfxItemState::SET:
635  {
636  aPgDesc.SetNumOffset(static_cast<const SfxUInt16Item*>(pItem)->GetValue());
637  bChanged = true;
638  break;
639  }
640  case SfxItemState::DISABLED:
641  {
642  bChanged = true; // default initialised aPgDesc clears the number
643  break;
644  }
645  case SfxItemState::UNKNOWN:
646  case SfxItemState::DEFAULT:
647  break;
648  default:
649  assert(false); // unexpected
650  break;
651  }
652  if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_PARA_MODEL, false, &pItem ))
653  {
654  const OUString& rDescName = static_cast<const SvxPageModelItem*>(pItem)->GetValue();
655  if( !rDescName.isEmpty() ) // No name -> disable PageDesc!
656  {
657  // Delete only, if PageDesc will be enabled!
658  rSet.ClearItem( RES_BREAK );
659  SwPageDesc* pDesc = const_cast<SwWrtShell&>(rShell).FindPageDescByName(
660  rDescName, true );
661  if( pDesc )
662  aPgDesc.RegisterToPageDesc( *pDesc );
663  }
664  rSet.ClearItem( SID_ATTR_PARA_MODEL );
665  bChanged = true;
666  }
667  else
668  {
670  rShell.GetCurAttr( aCoreSet );
671  if(SfxItemState::SET == aCoreSet.GetItemState( RES_PAGEDESC, true, &pItem ) )
672  {
673  auto pPageDesc = pItem->StaticWhichCast(RES_PAGEDESC).GetPageDesc();
674  if( pPageDesc )
675  {
676  aPgDesc.RegisterToPageDesc( *const_cast<SwPageDesc*>(pPageDesc) );
677  }
678  }
679  }
680 
681  if(bChanged)
682  rSet.Put( aPgDesc );
683 }
684 
685 // Inquire if in the set is a Sfx-PageDesc combination present and return it.
687 {
688  const SfxPoolItem* pItem = nullptr;
689  OUString aName;
690  ::std::optional<sal_uInt16> oNumOffset;
691  bool bPut = true;
692  switch( rCoreSet.GetItemState( RES_PAGEDESC, true, &pItem ) )
693  {
694  case SfxItemState::SET:
695  {
696  auto rPageDescItem = pItem->StaticWhichCast(RES_PAGEDESC);
697  if( rPageDescItem.GetPageDesc() )
698  {
699  aName = rPageDescItem.GetPageDesc()->GetName();
700  oNumOffset = rPageDescItem.GetNumOffset();
701  }
702  rCoreSet.ClearItem( RES_PAGEDESC );
703  // Page number
704  }
705  break;
706 
707  case SfxItemState::DEFAULT:
708  break;
709 
710  default:
711  bPut = false;
712  }
713 
714  if (oNumOffset)
715  {
716  SfxUInt16Item aPageNum( SID_ATTR_PARA_PAGENUM, *oNumOffset );
717  rCoreSet.Put( aPageNum );
718  }
719 
720  if(bPut)
721  rCoreSet.Put( SvxPageModelItem( aName, true, SID_ATTR_PARA_MODEL ) );
722 }
723 
724 // Determine metric
725 
727 {
728  return SW_MOD()->GetUsrPref(bWeb)->GetMetric();
729 }
730 
731 // Determine metric
732 
733 void SetDfltMetric( FieldUnit eMetric, bool bWeb )
734 {
735  SW_MOD()->ApplyUserMetric(eMetric, bWeb);
736 }
737 
738 void InsertStringSorted(const OUString& rId, const OUString& rEntry, weld::ComboBox& rToFill, int nOffset)
739 {
740  CollatorWrapper& rCaseColl = ::GetAppCaseCollator();
741  const int nCount = rToFill.get_count();
742  while (nOffset < nCount)
743  {
744  if (0 < rCaseColl.compareString(rToFill.get_text(nOffset), rEntry))
745  break;
746  ++nOffset;
747  }
748  rToFill.insert(nOffset, rEntry, &rId, nullptr, nullptr);
749 }
750 
751 void FillCharStyleListBox(weld::ComboBox& rToFill, SwDocShell* pDocSh, bool bSorted, bool bWithDefault)
752 {
753  const int nOffset = rToFill.get_count() > 0 ? 1 : 0;
754  rToFill.freeze();
755  SfxStyleSheetBasePool* pPool = pDocSh->GetStyleSheetPool();
756  SwDoc* pDoc = pDocSh->GetDoc();
757  const SfxStyleSheetBase* pBase = pPool->First(SfxStyleFamily::Char);
758  const OUString sStandard(SwResId(STR_POOLCHR_STANDARD));
759  while(pBase)
760  {
761  if(bWithDefault || pBase->GetName() != sStandard)
762  {
764  OUString sId(OUString::number(nPoolId));
765  if (bSorted)
766  InsertStringSorted(sId, pBase->GetName(), rToFill, nOffset);
767  else
768  rToFill.append(sId, pBase->GetName());
769  }
770  pBase = pPool->Next();
771  }
772  // non-pool styles
773  const SwCharFormats* pFormats = pDoc->GetCharFormats();
774  for(size_t i = 0; i < pFormats->size(); ++i)
775  {
776  const SwCharFormat* pFormat = (*pFormats)[i];
777  if(pFormat->IsDefault())
778  continue;
779  const OUString& rName = pFormat->GetName();
780  if (rToFill.find_text(rName) == -1)
781  {
782  OUString sId(OUString::number(USHRT_MAX));
783  if (bSorted)
784  InsertStringSorted(sId, rName, rToFill, nOffset);
785  else
786  rToFill.append(sId, rName);
787  }
788  }
789  rToFill.thaw();
790 };
791 
792 SwTwips GetTableWidth( SwFrameFormat const * pFormat, SwTabCols const & rCols, sal_uInt16 *pPercent,
793  SwWrtShell* pSh )
794 {
795  // To get the width is slightly more complicated.
796  SwTwips nWidth = 0;
797  const sal_Int16 eOri = pFormat->GetHoriOrient().GetHoriOrient();
798  switch(eOri)
799  {
800  case text::HoriOrientation::FULL: nWidth = rCols.GetRight(); break;
801  case text::HoriOrientation::LEFT_AND_WIDTH:
802  case text::HoriOrientation::LEFT:
803  case text::HoriOrientation::RIGHT:
804  case text::HoriOrientation::CENTER:
805  nWidth = pFormat->GetFrameSize().GetWidth();
806  break;
807  default:
808  {
809  if(pSh)
810  {
811  if ( nullptr == pSh->GetFlyFrameFormat() )
812  {
813  nWidth = pSh->GetAnyCurRect(CurRectType::PagePrt).Width();
814  }
815  else
816  {
818  }
819  }
820  else
821  {
822  OSL_FAIL("where to get the actual width from?");
823  }
824  const SvxLRSpaceItem& rLRSpace = pFormat->GetLRSpace();
825  nWidth -= (rLRSpace.GetRight() + rLRSpace.GetLeft());
826  }
827  }
828  if (pPercent)
829  *pPercent = pFormat->GetFrameSize().GetWidthPercent();
830  return nWidth;
831 }
832 
833 OUString GetAppLangDateTimeString( const DateTime& rDT )
834 {
835  const SvtSysLocale aSysLocale;
836  const LocaleDataWrapper& rAppLclData = aSysLocale.GetLocaleData();
837  OUString sRet = rAppLclData.getDate( rDT ) + " " + rAppLclData.getTime( rDT );
838  return sRet;
839 }
840 
841 // Add a new function which can get and set the current "SID_ATTR_APPLYCHARUNIT" value
842 
843 bool HasCharUnit( bool bWeb)
844 {
845  return SW_MOD()->GetUsrPref(bWeb)->IsApplyCharUnit();
846 }
847 
848 void SetApplyCharUnit(bool bApplyChar, bool bWeb)
849 {
850  SW_MOD()->ApplyUserCharUnit(bApplyChar, bWeb);
851 }
852 
853 bool ExecuteMenuCommand( PopupMenu const & rMenu, SfxViewFrame const & rViewFrame, sal_uInt16 nId )
854 {
855  bool bRet = false;
856  const sal_uInt16 nItemCount = rMenu.GetItemCount();
857  OUString sCommand;
858  for( sal_uInt16 nItem = 0; nItem < nItemCount; ++nItem)
859  {
860  PopupMenu* pPopup = rMenu.GetPopupMenu( rMenu.GetItemId( nItem ) );
861  if(pPopup)
862  {
863  sCommand = pPopup->GetItemCommand(nId);
864  if(!sCommand.isEmpty())
865  break;
866  }
867  }
868  if(!sCommand.isEmpty())
869  {
870  uno::Reference< frame::XFrame > xFrame = rViewFrame.GetFrame().GetFrameInterface();
871  uno::Reference < frame::XDispatchProvider > xProv( xFrame, uno::UNO_QUERY );
872  util::URL aURL;
873  aURL.Complete = sCommand;
874  uno::Reference < util::XURLTransformer > xTrans( util::URLTransformer::create(::comphelper::getProcessComponentContext() ) );
875  xTrans->parseStrict( aURL );
876  uno::Reference< frame::XDispatch > xDisp = xProv->queryDispatch( aURL, OUString(), 0 );
877  if( xDisp.is() )
878  {
879  uno::Sequence< beans::PropertyValue > aSeq;
880  xDisp->dispatch( aURL, aSeq );
881  bRet = true;
882  }
883  }
884  return bRet;
885 }
886 
887 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool IsLandscape() const
SwTextFormatColl * MakeTextFormatColl(const OUString &rFormatName, SwTextFormatColl *pDerivedFrom, bool bBroadcast=false)
Create the FormatCollections.
Definition: docfmt.cxx:877
bool GetValue() const
SvxNumType GetNumberingType() const
SfxStyleSheetBase * First(SfxStyleFamily eFamily, SfxStyleSearchBits eMask=SfxStyleSearchBits::All)
tools::Long GetWidth() const
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(93)
URL aURL
PopupMenu * GetPopupMenu(sal_uInt16 nItemId) const
FieldUnit
bool Insert(const SvxTabStop &rTab)
void SetUseOn(UseOnPage eNew)
Same as WriteUseOn(), but the >= HeaderShare part of the bitfield is not modified.
Definition: pagedesc.hxx:342
Represents the style of a paragraph.
Definition: fmtcol.hxx:56
sal_uInt16 Count() const
#define MAXHEIGHT
Definition: uitool.cxx:70
static void FillHdFt(SwFrameFormat *pFormat, const SfxItemSet &rSet)
Definition: uitool.cxx:221
sal_Int32 compareString(const OUString &s1, const OUString &s2) const
virtual void insert(int pos, const OUString &rStr, const OUString *pId, const OUString *pIconName, VirtualDevice *pImageSurface)=0
void SetPageUsage(SvxPageUsage eU)
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
Definition: fmtpdsc.hxx:35
SwPaM * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
Definition: crsrsh.cxx:194
bool IsDefault() const
Definition: format.hxx:113
const SwFormatHeader & GetHeader(bool=true) const
Definition: fmthdft.hxx:97
void ChgHeaderShare(bool bNew)
Definition: pagedesc.hxx:328
std::string GetValue
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
bool IsTableMode() const
Definition: crsrsh.hxx:643
sal_uInt16 char char * pDesc
const SwRect & GetAnyCurRect(CurRectType eType, const Point *pPt=nullptr, const css::uno::Reference< css::embed::XEmbeddedObject > &=css::uno::Reference< css::embed::XEmbeddedObject >()) const
Definition: fews.cxx:90
virtual OUString get_text(int pos) const =0
tools::Long GetRight() const
constexpr::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
Reference< XFrame > xFrame
void SfxToSwPageDescAttr(const SwWrtShell &rShell, SfxItemSet &rSet)
Definition: uitool.cxx:625
void SetLandscape(bool bL)
Definition: doc.hxx:187
constexpr sal_uInt16 RES_FRMATR_END(133)
virtual int find_text(const OUString &rStr) const =0
sal_Int16 nId
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
Definition: edws.cxx:234
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(94)
void append(const OUString &rId, const OUString &rStr)
virtual bool SetFormatAttr(const SfxPoolItem &rAttr) override
Override to recognize changes on the and register/unregister the paragragh style at t...
Definition: fmtcol.cxx:339
constexpr TypedWhichId< SfxGrabBagItem > RES_CHRATR_GRABBAG(43)
#define MIN_BORDER_DIST
Definition: swtypes.hxx:74
void PrepareBoxInfo(SfxItemSet &rSet, const SwWrtShell &rSh)
Definition: uitool.cxx:79
UseOnPage GetUseOn() const
Definition: pagedesc.hxx:354
Value in Var-direction gives minimum (can be exceeded but not be less).
virtual int get_count() const =0
const OUString & GetName() const
Definition: pagedesc.hxx:197
bool IsActive() const
Definition: fmthdft.hxx:89
virtual void thaw()=0
UseOnPage
Definition: pagedesc.hxx:120
Used by the UI to modify the document model.
Definition: wrtsh.hxx:91
constexpr tools::Long Width() const
const SwPageFootnoteInfo & GetFootnoteInfo() const
Definition: pagedesc.hxx:206
const LocaleDataWrapper & GetLocaleData() const
void MergeRange(sal_uInt16 nFrom, sal_uInt16 nTo)
const SwView & GetView() const
Definition: wrtsh.hxx:429
bool ExecuteMenuCommand(PopupMenu const &rMenu, SfxViewFrame const &rViewFrame, sal_uInt16 nId)
Definition: uitool.cxx:853
SvxNumType GetNumType() const
const OUString & GetName() const
void SetValue(const OUString &rTheValue)
void SetFootnoteInfo(const SwPageFootnoteInfo &rNew)
Definition: pagedesc.hxx:208
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
bool HasCharUnit(bool bWeb)
Definition: uitool.cxx:843
void ConvertAttrGenToChar(SfxItemSet &rSet, const SfxItemSet &rOrigSet, bool bIsPara)
Convert general attributes to the corresponding character attributes.
Definition: uitool.cxx:141
void FillCharStyleListBox(weld::ComboBox &rToFill, SwDocShell *pDocSh, bool bSorted, bool bWithDefault)
Definition: uitool.cxx:751
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:426
const SwTextFormatColl * GetDfltTextFormatColl() const
Definition: doc.hxx:777
void SetLandscape(bool bNew)
Definition: pagedesc.hxx:201
const OUString & GetName() const
Definition: format.hxx:115
Footer, for pageformats Client of FrameFormat describing the footer.
Definition: fmthdft.hxx:64
SfxFrame & GetFrame() const
int nCount
constexpr TypedWhichId< SfxBoolItem > RES_RTL_GUTTER(132)
#define FN_PARAM_FTN_INFO
Definition: cmdid.h:769
For internal use only.
static SW_DLLPUBLIC sal_uInt16 GetPoolIdFromUIName(const OUString &rName, SwGetPoolIdFromName)
OUString GetItemCommand(sal_uInt16 nItemId) const
void Width(tools::Long nNew)
Definition: swrect.hxx:187
void SetNumType(SvxNumType eNum)
constexpr TypedWhichId< SfxGrabBagItem > RES_PARATR_GRABBAG(81)
SfxItemPool & GetPool() const
SwDoc * GetDoc()
returns Doc. But be careful!
Definition: docsh.hxx:203
bool IsHeaderShared() const
Definition: pagedesc.hxx:320
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
Style of a layout element.
Definition: frmfmt.hxx:58
Rect of current PrtArea of page.
void SetRanges(const sal_uInt16 *pRanges)
#define SW_MOD()
Definition: swmodule.hxx:256
SwTwips GetTabDist(const SvxTabStopItem &rTabs)
Definition: uitool.cxx:619
constexpr TypedWhichId< SfxBoolItem > RES_BACKGROUND_FULL_SIZE(131)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
int i
T & StaticWhichCast(TypedWhichId< T > nId)
void SetNumType(const SvxNumberType &rNew)
Definition: pagedesc.hxx:204
const SwFrameFormat * GetFooterFormat() const
Definition: fmthdft.hxx:85
const SwFormatHoriOrient & GetHoriOrient(bool=true) const
Definition: fmtornt.hxx:108
FieldUnit GetDfltMetric(bool bWeb)
Definition: uitool.cxx:726
bool GetLandscape() const
Definition: pagedesc.hxx:200
#define MAXWIDTH
Definition: uitool.cxx:71
void SwToSfxPageDescAttr(SfxItemSet &rCoreSet)
Definition: uitool.cxx:686
void InsertStringSorted(const OUString &rId, const OUString &rEntry, weld::ComboBox &rToFill, int nOffset)
Definition: uitool.cxx:738
void SetApplyCharUnit(bool bApplyChar, bool bWeb)
Definition: uitool.cxx:848
void ChgFirstShare(bool bNew)
Definition: pagedesc.cxx:401
virtual void freeze()=0
void ChgFooterShare(bool bNew)
Definition: pagedesc.hxx:335
void SetAttrItem(const SfxPoolItem &, SetAttrMode nFlags=SetAttrMode::DEFAULT, const bool bParagraphSetting=false)
Definition: edatmisc.cxx:112
sal_uInt16 GetItemId(sal_uInt16 nPos) const
tools::Long GetLeft() const
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
Definition: edws.cxx:223
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
virtual SfxStyleSheetBasePool * GetStyleSheetPool() override
For Style PI.
Definition: docsh.cxx:1140
const SfxItemSet * GetItemSet(const SfxPoolItem &rAttr)
Returns the item set associated with a character/inet/auto style.
Definition: atrstck.cxx:132
size_t size() const
Definition: docary.hxx:84
const SwFormatFooter & GetFooter(bool=true) const
Definition: fmthdft.hxx:99
const SwTextFormatColl * GetRegisterFormatColl() const
retrieve the style for the grid alignment
Definition: pagedesc.cxx:224
sal_Int16 GetHoriOrient() const
Definition: fmtornt.hxx:87
const std::map< OUString, css::uno::Any > & GetGrabBag() const
void MakeDefTabs(SwTwips nDefDist, SvxTabStopItem &rTabs)
Definition: uitool.cxx:607
static SvxPageUsage lcl_convertUseToSvx(UseOnPage nUse)
Convert from UseOnPage to SvxPageUsage.
Definition: uitool.cxx:238
sal_uInt16 GetCursorCnt(bool bAll=true) const
Get the number of elements in the ring of cursors.
Definition: crsrsh.cxx:2732
SwFrameSize
Definition: fmtfsize.hxx:35
bool IsFooterShared() const
Definition: pagedesc.hxx:324
OUString SwResId(const char *pId)
Definition: swmodule.cxx:165
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:123
SwTwips GetTableWidth(SwFrameFormat const *pFormat, SwTabCols const &rCols, sal_uInt16 *pPercent, SwWrtShell *pSh)
Definition: uitool.cxx:792
sal_uInt8 GetWidthPercent() const
Definition: fmtfsize.hxx:91
SfxItemPool * GetPool() const
Frame cannot be moved in Var-direction.
tools::Long SwTwips
Definition: swtypes.hxx:49
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
SvxPageUsage
const SwPageDesc * GetFollow() const
Definition: pagedesc.hxx:268
const SwFrameFormat * GetDfltFrameFormat() const
Definition: doc.hxx:746
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:450
OUString getDate(const Date &rDate) const
SvxPageUsage GetPageUsage() const
SwTextFormatColl * FindTextFormatCollByName(std::u16string_view rName) const
Definition: doc.hxx:800
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:239
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_BACKGROUND(21)
void ConvertAttrCharToGen(SfxItemSet &rSet, bool bIsPara)
Convert character specific attributes to general ones used by tab pages.
Definition: uitool.cxx:104
Footnote information.
Definition: pagedesc.hxx:48
const SwCharFormats * GetCharFormats() const
Definition: doc.hxx:739
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
constexpr tools::Long Height() const
SfxStyleSheetBase * Next()
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:254
void ApplyCharBackground(const Color &rBackgroundColor, SwWrtShell &rShell)
Apply character background on the shell.
Definition: uitool.cxx:186
OUString aName
void SetWhich(sal_uInt16 nId)
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
sal_uInt16 GetItemCount() const
static UseOnPage lcl_convertUseFromSvx(SvxPageUsage nUse)
Convert from SvxPageUsage to UseOnPage.
Definition: uitool.cxx:253
void SetSize(const Size &rSize)
Reference< XComponentContext > getProcessComponentContext()
void PageDescToItemSet(const SwPageDesc &rPageDesc, SfxItemSet &rSet)
Definition: uitool.cxx:428
Sequence< sal_Int8 > aSeq
Header, for PageFormats Client of FrameFormat describing the header.
Definition: fmthdft.hxx:33
bool GetCurAttr(SfxItemSet &, const bool bMergeIndentValuesOfNumRule=false) const
Definition: edattr.cxx:177
const SwFormatFrameSize & GetFrameSize(bool=true) const
Definition: fmtfsize.hxx:104
OUString sId
const sal_uInt16 * GetRanges() const
const SwFrameFormat * GetFlyFrameFormat() const
Get FlyFrameFormat; for UI macro linkage at Flys.
Definition: fefly1.cxx:1248
void SetDfltMetric(FieldUnit eMetric, bool bWeb)
Definition: uitool.cxx:733
void SetNumOffset(const ::std::optional< sal_uInt16 > &oNum)
Definition: fmtpdsc.hxx:65
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLBACKGROUND)
bool IsFirstShared() const
Definition: pagedesc.cxx:396
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:120
OUString getTime(const tools::Time &rTime, bool bSec=true, bool b100Sec=false) const
void SetNumberingType(SvxNumType nSet)
bool IsActive() const
Definition: fmthdft.hxx:58
SelectionType GetSelectionType() const
Definition: wrtsh1.cxx:1395
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
void RegisterToPageDesc(SwPageDesc &)
Definition: atrfrm.cxx:707
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_HIGHLIGHT(42)
tools::Long GetRight() const
Definition: tabcol.hxx:79
CollatorWrapper & GetAppCaseCollator()
Definition: init.cxx:756
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
Rect of PrtArea of FlyFrame.
OUString GetAppLangDateTimeString(const DateTime &rDT)
Definition: uitool.cxx:833
const Size & GetSize() const
const SwFrameFormat * GetHeaderFormat() const
Definition: fmthdft.hxx:54
SwFrameSize GetHeightSizeType() const
Definition: fmtfsize.hxx:80
void SetDescName(const OUString &rStr)
void SetRegisterFormatColl(const SwTextFormatColl *rFormat)
set the style for the grid alignment
Definition: pagedesc.cxx:212
const SvxLRSpaceItem & GetLRSpace(bool=true) const
Definition: frmatr.hxx:74
void ItemSetToPageDesc(const SfxItemSet &rSet, SwPageDesc &rPageDesc)
Definition: uitool.cxx:269
const SvxNumberType & GetNumType() const
Definition: pagedesc.hxx:203