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