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