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