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/awt/XPopupMenu.hpp>
40 #include <com/sun/star/frame/XDispatch.hpp>
41 #include <com/sun/star/frame/XDispatchProvider.hpp>
42 #include <com/sun/star/frame/XFrame.hpp>
43 #include <com/sun/star/util/URLTransformer.hpp>
44 #include <com/sun/star/util/XURLTransformer.hpp>
46 #include <sfx2/viewfrm.hxx>
47 #include <sfx2/docfile.hxx>
48 #include <sfx2/docfilt.hxx>
49 #include <fmtornt.hxx>
50 #include <tabcol.hxx>
51 #include <fmtfsize.hxx>
52 #include <fmthdft.hxx>
53 #include <fmtpdsc.hxx>
54 #include <uiitems.hxx>
55 #include <docsh.hxx>
56 #include <wrtsh.hxx>
57 #include <swmodule.hxx>
58 #include <view.hxx>
59 #include <uitool.hxx>
60 #include <frmatr.hxx>
61 #include <paratr.hxx>
62 #include <fmtcol.hxx>
63 #include <usrpref.hxx>
64 
65 #include <cmdid.h>
66 #include <doc.hxx>
67 #include <docary.hxx>
68 #include <charfmt.hxx>
69 #include <SwStyleNameMapper.hxx>
70 #include <strings.hrc>
71 // 50 cm 28350
72 
73 #define MAXHEIGHT 28350
74 #define MAXWIDTH 28350
75 
76 using namespace ::com::sun::star;
77 
78 // General list of string pointer
79 
80 // Set boxinfo attribute
81 
82 void PrepareBoxInfo(SfxItemSet& rSet, const SwWrtShell& rSh)
83 {
84  std::shared_ptr<SvxBoxInfoItem> aBoxInfo(std::make_shared<SvxBoxInfoItem>(SID_ATTR_BORDER_INNER));
85  const SfxPoolItem *pBoxInfo;
86 
87  if ( SfxItemState::SET == rSet.GetItemState( SID_ATTR_BORDER_INNER, true, &pBoxInfo))
88  {
89  aBoxInfo.reset(static_cast<SvxBoxInfoItem*>(pBoxInfo->Clone()));
90  }
91 
92  // Table variant: If more than one table cells are selected
93  rSh.GetCursor(); //So that GetCursorCnt() returns the right thing
94  aBoxInfo->SetTable (rSh.IsTableMode() && rSh.GetCursorCnt() > 1);
95  // Always show the distance field
96  aBoxInfo->SetDist (true);
97  // Set minimal size in tables and paragraphs
98  aBoxInfo->SetMinDist (rSh.IsTableMode() || rSh.GetSelectionType() & (SelectionType::Text | SelectionType::Table));
99  // Set always the default distance
100  aBoxInfo->SetDefDist (MIN_BORDER_DIST);
101  // Single lines can have only in tables DontCare-Status
102  aBoxInfo->SetValid(SvxBoxInfoItemValidFlags::DISABLE, !rSh.IsTableMode());
103 
104  rSet.Put(*aBoxInfo);
105 }
106 
107 void ConvertAttrCharToGen(SfxItemSet& rSet, bool bIsPara)
108 {
109  // Background / highlight
110  {
111  // Always use the visible background
112  const SfxPoolItem *pTmpBrush;
113  if( SfxItemState::SET == rSet.GetItemState( RES_CHRATR_HIGHLIGHT, true, &pTmpBrush ) )
114  {
115  SvxBrushItem aTmpBrush( pTmpBrush->StaticWhichCast(RES_CHRATR_HIGHLIGHT) );
116  if( aTmpBrush.GetColor() != COL_TRANSPARENT )
117  {
118  aTmpBrush.SetWhich( RES_CHRATR_BACKGROUND );
119  rSet.Put( aTmpBrush );
120  }
121  }
122  }
123 
124  if ( bIsPara )
125  return;
126 
127  // Tell dialogs to use character-specific slots/whichIds
128  // tdf#126684: We use RES_PARATR_GRABBAG, because RES_CHRATR_GRABBAG may be overwritten later in
129  // SwDocStyleSheet::GetItemSet when applying attributes from char format
130  assert(SfxItemState::SET != rSet.GetItemState(RES_PARATR_GRABBAG, false));
132  aGrabBag.GetGrabBag()["DialogUseCharAttr"] <<= true;
133  // Store initial ranges to allow restoring later
134  uno::Sequence<sal_uInt16> aOrigRanges(rSet.GetRanges().size() * 2 + 1);
135  int i = 0;
136  for (const auto& rPair : rSet.GetRanges())
137  {
138  aOrigRanges.getArray()[i++] = rPair.first;
139  aOrigRanges.getArray()[i++] = rPair.second;
140  }
141  aOrigRanges.getArray()[i++] = 0;
142  aGrabBag.GetGrabBag()["OrigItemSetRanges"] <<= aOrigRanges;
144  rSet.Put(aGrabBag);
145 }
146 
147 void ConvertAttrGenToChar(SfxItemSet& rSet, const SfxItemSet& rOrigSet, bool bIsPara)
148 {
149  // Background / highlighting
150  const SfxPoolItem *pTmpItem;
151  if( SfxItemState::SET == rSet.GetItemState( RES_CHRATR_BACKGROUND, false, &pTmpItem ) )
152  {
153  // Highlight is an MS specific thing, so remove it at the first time when LO modifies
154  // this part of the imported document.
156 
157  // Remove shading marker
158  if (SfxItemState::SET == rOrigSet.GetItemState(RES_CHRATR_GRABBAG, false, &pTmpItem))
159  {
161  std::map<OUString, css::uno::Any>& rMap = aGrabBag.GetGrabBag();
162  auto aIterator = rMap.find("CharShadingMarker");
163  if( aIterator != rMap.end() )
164  {
165  aIterator->second <<= false;
166  }
167  rSet.Put( aGrabBag );
168  }
169  }
170 
171  if ( bIsPara )
172  return;
173 
174  rSet.ClearItem( RES_BACKGROUND );
175 
176  if (SfxItemState::SET == rOrigSet.GetItemState(RES_PARATR_GRABBAG, false, &pTmpItem))
177  {
179  std::map<OUString, css::uno::Any>& rMap = aGrabBag.GetGrabBag();
180  auto aIterator = rMap.find("OrigItemSetRanges");
181  if (aIterator != rMap.end())
182  {
183  uno::Sequence<sal_uInt16> aOrigRanges;
184  if ( aIterator->second >>= aOrigRanges )
185  {
186  assert(aOrigRanges.getLength() % 2 == 1);
187  int numPairs = (aOrigRanges.getLength()-1)/2;
188  std::unique_ptr<WhichPair[]> xPairs(new WhichPair[numPairs]);
189  for(int i=0; i<aOrigRanges.getLength()-1; i += 2)
190  {
191  xPairs[i/2] = { aOrigRanges[i], aOrigRanges[i+1] };
192  }
193  rSet.SetRanges(WhichRangesContainer(std::move(xPairs), numPairs));
194  }
195  }
196  }
197  assert(SfxItemState::SET != rSet.GetItemState(RES_PARATR_GRABBAG, false));
198 }
199 
200 void ApplyCharBackground(const Color& rBackgroundColor, SwWrtShell& rShell)
201 {
203 
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  {
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
519 
520  // FillAttribute support
522 
523  SID_ATTR_BORDER_INNER,SID_ATTR_BORDER_INNER, // [10023
524  SID_ATTR_PAGE_SIZE,SID_ATTR_PAGE_SIZE, // [10051
525  SID_ATTR_PAGE_ON,SID_ATTR_PAGE_SHARED, // [10060
526  SID_ATTR_PAGE_SHARED_FIRST,SID_ATTR_PAGE_SHARED_FIRST> aHeaderSet(*rSet.GetPool());
527 
528  // set correct parent to get the XFILL_NONE FillStyle as needed
529  aHeaderSet.SetParent(&rMaster.GetDoc()->GetDfltFrameFormat()->GetAttrSet());
530 
531  // Dynamic or fixed height
532  SfxBoolItem aOn(SID_ATTR_PAGE_ON, true);
533  aHeaderSet.Put(aOn);
534 
535  const SwFormatFrameSize &rFrameSize = pHeaderFormat->GetFrameSize();
536  const SwFrameSize eSizeType = rFrameSize.GetHeightSizeType();
537  SfxBoolItem aDynamic(SID_ATTR_PAGE_DYNAMIC, eSizeType != SwFrameSize::Fixed);
538  aHeaderSet.Put(aDynamic);
539 
540  // Left equal right
541  SfxBoolItem aShared(SID_ATTR_PAGE_SHARED, rPageDesc.IsHeaderShared());
542  aHeaderSet.Put(aShared);
543  SfxBoolItem aFirstShared(SID_ATTR_PAGE_SHARED_FIRST, rPageDesc.IsFirstShared());
544  aHeaderSet.Put(aFirstShared);
545 
546  // Size
547  SvxSizeItem aSize(SID_ATTR_PAGE_SIZE, rFrameSize.GetSize());
548  aHeaderSet.Put(aSize);
549 
550  // Shifting frame attributes
551  aHeaderSet.Put(pHeaderFormat->GetAttrSet());
552  aHeaderSet.Put( *aBoxInfo );
553 
554  // Create SetItem
555  SvxSetItem aSetItem(SID_ATTR_PAGE_HEADERSET, aHeaderSet);
556  rSet.Put(aSetItem);
557  }
558 
559  // Footer
560  if(rMaster.GetFooter().IsActive())
561  {
562  const SwFormatFooter &rFooterFormat = rMaster.GetFooter();
563  const SwFrameFormat *pFooterFormat = rFooterFormat.GetFooterFormat();
564  OSL_ENSURE(pFooterFormat != nullptr, "no footer format");
565 
566  // FooterInfo, margins, background, border
568 
569  // FillAttribute support
571 
572  SID_ATTR_BORDER_INNER,SID_ATTR_BORDER_INNER, // [10023
573  SID_ATTR_PAGE_SIZE,SID_ATTR_PAGE_SIZE, // [10051
574  SID_ATTR_PAGE_ON,SID_ATTR_PAGE_SHARED, // [10060
575  SID_ATTR_PAGE_SHARED_FIRST,SID_ATTR_PAGE_SHARED_FIRST> aFooterSet(*rSet.GetPool());
576 
577  // set correct parent to get the XFILL_NONE FillStyle as needed
578  aFooterSet.SetParent(&rMaster.GetDoc()->GetDfltFrameFormat()->GetAttrSet());
579 
580  // Dynamic or fixed height
581  SfxBoolItem aOn(SID_ATTR_PAGE_ON, true);
582  aFooterSet.Put(aOn);
583 
584  const SwFormatFrameSize &rFrameSize = pFooterFormat->GetFrameSize();
585  const SwFrameSize eSizeType = rFrameSize.GetHeightSizeType();
586  SfxBoolItem aDynamic(SID_ATTR_PAGE_DYNAMIC, eSizeType != SwFrameSize::Fixed);
587  aFooterSet.Put(aDynamic);
588 
589  // Left equal right
590  SfxBoolItem aShared(SID_ATTR_PAGE_SHARED, rPageDesc.IsFooterShared());
591  aFooterSet.Put(aShared);
592  SfxBoolItem aFirstShared(SID_ATTR_PAGE_SHARED_FIRST, rPageDesc.IsFirstShared());
593  aFooterSet.Put(aFirstShared);
594 
595  // Size
596  SvxSizeItem aSize(SID_ATTR_PAGE_SIZE, rFrameSize.GetSize());
597  aFooterSet.Put(aSize);
598 
599  // Shifting Frame attributes
600  aFooterSet.Put(pFooterFormat->GetAttrSet());
601  aFooterSet.Put( *aBoxInfo );
602 
603  // Create SetItem
604  SvxSetItem aSetItem(SID_ATTR_PAGE_FOOTERSET, aFooterSet);
605  rSet.Put(aSetItem);
606  }
607 
608  // Integrate footnotes
609  SwPageFootnoteInfo& rInfo = const_cast<SwPageFootnoteInfo&>(rPageDesc.GetFootnoteInfo());
610  SwPageFootnoteInfoItem aFootnoteItem(rInfo);
611  rSet.Put(aFootnoteItem);
612 
613  // Register compliant
614  const SwTextFormatColl* pCol = rPageDesc.GetRegisterFormatColl();
615  SwRegisterItem aReg(pCol != nullptr);
616  aReg.SetWhich(SID_SWREGISTER_MODE);
617  rSet.Put(aReg);
618  if(pCol)
619  rSet.Put(SfxStringItem(SID_SWREGISTER_COLLECTION, pCol->GetName()));
620 
621  std::optional<SfxGrabBagItem> oGrabBag;
622  SfxPoolItem const* pItem(nullptr);
623  if (SfxItemState::SET == rSet.GetItemState(SID_ATTR_CHAR_GRABBAG, true, &pItem))
624  {
625  oGrabBag.emplace(*static_cast<SfxGrabBagItem const*>(pItem));
626  }
627  else
628  {
629  oGrabBag.emplace(SID_ATTR_CHAR_GRABBAG);
630  }
631  oGrabBag->GetGrabBag()["BackgroundFullSize"] <<=
633 
634  if (IsOwnFormat(*rMaster.GetDoc()))
635  {
636  oGrabBag->GetGrabBag()["RtlGutter"]
638  }
639 
640  rSet.Put(*oGrabBag);
641 }
642 
643 // Set DefaultTabs
644 
645 void MakeDefTabs(SwTwips nDefDist, SvxTabStopItem& rTabs)
646 {
647  if( rTabs.Count() )
648  return;
649  {
650  SvxTabStop aSwTabStop( nDefDist, SvxTabAdjust::Default );
651  rTabs.Insert( aSwTabStop );
652  }
653 }
654 
655 // Distance between two tabs
656 
658 {
659  return rTabs.Count() ? rTabs[0].GetTabPos() : 1134; // 1134 = 2 cm
660 }
661 
662 // Inquire if in the set is a Sfx-PageDesc combination present and return it.
663 void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet )
664 {
665  const SfxPoolItem* pItem;
666  SwFormatPageDesc aPgDesc;
667 
668  bool bChanged = false;
669  // Page number
670  switch (rSet.GetItemState(SID_ATTR_PARA_PAGENUM, false, &pItem))
671  {
672  case SfxItemState::SET:
673  {
674  aPgDesc.SetNumOffset(static_cast<const SfxUInt16Item*>(pItem)->GetValue());
675  bChanged = true;
676  break;
677  }
678  case SfxItemState::DISABLED:
679  {
680  bChanged = true; // default initialised aPgDesc clears the number
681  break;
682  }
683  case SfxItemState::UNKNOWN:
684  case SfxItemState::DEFAULT:
685  break;
686  default:
687  assert(false); // unexpected
688  break;
689  }
690  if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_PARA_MODEL, false, &pItem ))
691  {
692  const OUString& rDescName = static_cast<const SvxPageModelItem*>(pItem)->GetValue();
693  if( !rDescName.isEmpty() ) // No name -> disable PageDesc!
694  {
695  // Delete only, if PageDesc will be enabled!
696  rSet.ClearItem( RES_BREAK );
697  SwPageDesc* pDesc = const_cast<SwWrtShell&>(rShell).FindPageDescByName(
698  rDescName, true );
699  if( pDesc )
700  aPgDesc.RegisterToPageDesc( *pDesc );
701  }
702  rSet.ClearItem( SID_ATTR_PARA_MODEL );
703  bChanged = true;
704  }
705  else
706  {
708  rShell.GetCurAttr( aCoreSet );
709  if(SfxItemState::SET == aCoreSet.GetItemState( RES_PAGEDESC, true, &pItem ) )
710  {
711  auto pPageDesc = pItem->StaticWhichCast(RES_PAGEDESC).GetPageDesc();
712  if( pPageDesc )
713  {
714  aPgDesc.RegisterToPageDesc( *const_cast<SwPageDesc*>(pPageDesc) );
715  }
716  }
717  }
718 
719  if(bChanged)
720  rSet.Put( aPgDesc );
721 }
722 
723 // Inquire if in the set is a Sfx-PageDesc combination present and return it.
725 {
726  const SfxPoolItem* pItem = nullptr;
727  OUString aName;
728  ::std::optional<sal_uInt16> oNumOffset;
729  bool bPut = true;
730  switch( rCoreSet.GetItemState( RES_PAGEDESC, true, &pItem ) )
731  {
732  case SfxItemState::SET:
733  {
734  auto rPageDescItem = pItem->StaticWhichCast(RES_PAGEDESC);
735  if( rPageDescItem.GetPageDesc() )
736  {
737  aName = rPageDescItem.GetPageDesc()->GetName();
738  oNumOffset = rPageDescItem.GetNumOffset();
739  }
740  rCoreSet.ClearItem( RES_PAGEDESC );
741  // Page number
742  }
743  break;
744 
745  case SfxItemState::DEFAULT:
746  break;
747 
748  default:
749  bPut = false;
750  }
751 
752  if (oNumOffset)
753  {
754  SfxUInt16Item aPageNum( SID_ATTR_PARA_PAGENUM, *oNumOffset );
755  rCoreSet.Put( aPageNum );
756  }
757 
758  if(bPut)
759  rCoreSet.Put( SvxPageModelItem( aName, true, SID_ATTR_PARA_MODEL ) );
760 }
761 
762 // Determine metric
763 
765 {
766  return SW_MOD()->GetUsrPref(bWeb)->GetMetric();
767 }
768 
769 // Determine metric
770 
771 void SetDfltMetric( FieldUnit eMetric, bool bWeb )
772 {
773  SW_MOD()->ApplyUserMetric(eMetric, bWeb);
774 }
775 
776 void InsertStringSorted(const OUString& rId, const OUString& rEntry, weld::ComboBox& rToFill, int nOffset)
777 {
778  CollatorWrapper& rCaseColl = ::GetAppCaseCollator();
779  const int nCount = rToFill.get_count();
780  while (nOffset < nCount)
781  {
782  if (0 < rCaseColl.compareString(rToFill.get_text(nOffset), rEntry))
783  break;
784  ++nOffset;
785  }
786  rToFill.insert(nOffset, rEntry, &rId, nullptr, nullptr);
787 }
788 
789 void FillCharStyleListBox(weld::ComboBox& rToFill, SwDocShell* pDocSh, bool bSorted, bool bWithDefault)
790 {
791  const int nOffset = rToFill.get_count() > 0 ? 1 : 0;
792  rToFill.freeze();
793  SfxStyleSheetBasePool* pPool = pDocSh->GetStyleSheetPool();
794  SwDoc* pDoc = pDocSh->GetDoc();
795  const SfxStyleSheetBase* pBase = pPool->First(SfxStyleFamily::Char);
796  const OUString sStandard(SwResId(STR_POOLCHR_STANDARD));
797  while(pBase)
798  {
799  if(bWithDefault || pBase->GetName() != sStandard)
800  {
802  OUString sId(OUString::number(nPoolId));
803  if (bSorted)
804  InsertStringSorted(sId, pBase->GetName(), rToFill, nOffset);
805  else
806  rToFill.append(sId, pBase->GetName());
807  }
808  pBase = pPool->Next();
809  }
810  // non-pool styles
811  const SwCharFormats* pFormats = pDoc->GetCharFormats();
812  for(size_t i = 0; i < pFormats->size(); ++i)
813  {
814  const SwCharFormat* pFormat = (*pFormats)[i];
815  if(pFormat->IsDefault())
816  continue;
817  const OUString& rName = pFormat->GetName();
818  if (rToFill.find_text(rName) == -1)
819  {
820  OUString sId(OUString::number(USHRT_MAX));
821  if (bSorted)
822  InsertStringSorted(sId, rName, rToFill, nOffset);
823  else
824  rToFill.append(sId, rName);
825  }
826  }
827  rToFill.thaw();
828 };
829 
830 SwTwips GetTableWidth( SwFrameFormat const * pFormat, SwTabCols const & rCols, sal_uInt16 *pPercent,
831  SwWrtShell* pSh )
832 {
833  // To get the width is slightly more complicated.
834  SwTwips nWidth = 0;
835  const sal_Int16 eOri = pFormat->GetHoriOrient().GetHoriOrient();
836  switch(eOri)
837  {
838  case text::HoriOrientation::FULL: nWidth = rCols.GetRight(); break;
839  case text::HoriOrientation::LEFT_AND_WIDTH:
840  case text::HoriOrientation::LEFT:
841  case text::HoriOrientation::RIGHT:
842  case text::HoriOrientation::CENTER:
843  nWidth = pFormat->GetFrameSize().GetWidth();
844  break;
845  default:
846  {
847  if(pSh)
848  {
849  if ( nullptr == pSh->GetFlyFrameFormat() )
850  {
851  nWidth = pSh->GetAnyCurRect(CurRectType::PagePrt).Width();
852  }
853  else
854  {
856  }
857  }
858  else
859  {
860  OSL_FAIL("where to get the actual width from?");
861  }
862  const SvxLRSpaceItem& rLRSpace = pFormat->GetLRSpace();
863  nWidth -= (rLRSpace.GetRight() + rLRSpace.GetLeft());
864  }
865  }
866  if (pPercent)
867  *pPercent = pFormat->GetFrameSize().GetWidthPercent();
868  return nWidth;
869 }
870 
871 OUString GetAppLangDateTimeString( const DateTime& rDT )
872 {
873  const SvtSysLocale aSysLocale;
874  const LocaleDataWrapper& rAppLclData = aSysLocale.GetLocaleData();
875  OUString sRet = rAppLclData.getDate( rDT ) + " " + rAppLclData.getTime( rDT );
876  return sRet;
877 }
878 
879 // Add a new function which can get and set the current "SID_ATTR_APPLYCHARUNIT" value
880 
881 bool HasCharUnit( bool bWeb)
882 {
883  return SW_MOD()->GetUsrPref(bWeb)->IsApplyCharUnit();
884 }
885 
886 void SetApplyCharUnit(bool bApplyChar, bool bWeb)
887 {
888  SW_MOD()->ApplyUserCharUnit(bApplyChar, bWeb);
889 }
890 
891 bool ExecuteMenuCommand(const css::uno::Reference<css::awt::XPopupMenu>& rMenu, const SfxViewFrame& rViewFrame, sal_uInt16 nId)
892 {
893  bool bRet = false;
894  const sal_uInt16 nItemCount = rMenu->getItemCount();
895  OUString sCommand;
896  for (sal_uInt16 nItem = 0; nItem < nItemCount; ++nItem)
897  {
898  sal_Int16 nItemId = rMenu->getItemId(nItem);
899  css::uno::Reference<css::awt::XPopupMenu> xPopup = rMenu->getPopupMenu(nItemId);
900  if (xPopup.is())
901  {
902  sCommand = xPopup->getCommand(nId);
903  if(!sCommand.isEmpty())
904  break;
905  }
906  }
907  if(!sCommand.isEmpty())
908  {
909  uno::Reference< frame::XFrame > xFrame = rViewFrame.GetFrame().GetFrameInterface();
910  uno::Reference < frame::XDispatchProvider > xProv( xFrame, uno::UNO_QUERY );
911  util::URL aURL;
912  aURL.Complete = sCommand;
913  uno::Reference < util::XURLTransformer > xTrans( util::URLTransformer::create(::comphelper::getProcessComponentContext() ) );
914  xTrans->parseStrict( aURL );
915  uno::Reference< frame::XDispatch > xDisp = xProv->queryDispatch( aURL, OUString(), 0 );
916  if( xDisp.is() )
917  {
918  uno::Sequence< beans::PropertyValue > aSeq;
919  xDisp->dispatch( aURL, aSeq );
920  bRet = true;
921  }
922  }
923  return bRet;
924 }
925 
926 /* 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
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:73
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
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:644
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:663
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:82
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
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:881
void ConvertAttrGenToChar(SfxItemSet &rSet, const SfxItemSet &rOrigSet, bool bIsPara)
Convert general attributes to the corresponding character attributes.
Definition: uitool.cxx:147
void FillCharStyleListBox(weld::ComboBox &rToFill, SwDocShell *pDocSh, bool bSorted, bool bWithDefault)
Definition: uitool.cxx:789
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)
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:204
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:657
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:764
bool GetLandscape() const
Definition: pagedesc.hxx:199
#define MAXWIDTH
Definition: uitool.cxx:74
void SwToSfxPageDescAttr(SfxItemSet &rCoreSet)
Definition: uitool.cxx:724
void InsertStringSorted(const OUString &rId, const OUString &rEntry, weld::ComboBox &rToFill, int nOffset)
Definition: uitool.cxx:776
void SetApplyCharUnit(bool bApplyChar, bool bWeb)
Definition: uitool.cxx:886
void ChgFirstShare(bool bNew)
Definition: pagedesc.cxx:402
virtual void freeze()=0
void ChgFooterShare(bool bNew)
Definition: pagedesc.hxx:334
bool ExecuteMenuCommand(const css::uno::Reference< css::awt::XPopupMenu > &rMenu, const SfxViewFrame &rViewFrame, sal_uInt16 nId)
Definition: uitool.cxx:891
void SetAttrItem(const SfxPoolItem &, SetAttrMode nFlags=SetAttrMode::DEFAULT, const bool bParagraphSetting=false)
Definition: edatmisc.cxx:112
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:1158
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:645
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:2734
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:830
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:107
Footnote information.
Definition: pagedesc.hxx:48
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
Definition: crsrsh.cxx:194
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:200
OUString aName
void SetWhich(sal_uInt16 nId)
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
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:171
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:771
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:1550
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:871
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
OUString sId
SfxMedium * GetMedium() const
const SvxNumberType & GetNumType() const
Definition: pagedesc.hxx:202