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