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