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