22#include <osl/diagnose.h>
23#include <tools/datetime.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>
73#define MAXHEIGHT 28350
84 std::shared_ptr<SvxBoxInfoItem> aBoxInfo(std::make_shared<SvxBoxInfoItem>(SID_ATTR_BORDER_INNER));
88 aBoxInfo.reset(pBoxInfo->Clone());
95 aBoxInfo->SetDist (
true);
101 aBoxInfo->SetValid(SvxBoxInfoItemValidFlags::DISABLE, !rSh.
IsTableMode());
130 aGrabBag.
GetGrabBag()[
"DialogUseCharAttr"] <<=
true;
136 aOrigRanges.getArray()[
i++] = rPair.first;
137 aOrigRanges.getArray()[
i++] = rPair.second;
139 aOrigRanges.getArray()[
i++] = 0;
140 aGrabBag.
GetGrabBag()[
"OrigItemSetRanges"] <<= aOrigRanges;
158 std::map<OUString, css::uno::Any>& rMap = aGrabBag.
GetGrabBag();
159 auto aIterator = rMap.find(
"CharShadingMarker");
160 if( aIterator != rMap.end() )
162 aIterator->second <<=
false;
176 std::map<OUString, css::uno::Any>& rMap = aGrabBag.
GetGrabBag();
177 auto aIterator = rMap.find(
"OrigItemSetRanges");
178 if (aIterator != rMap.end())
180 uno::Sequence<sal_uInt16> aOrigRanges;
181 if ( aIterator->second >>= aOrigRanges )
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)
188 xPairs[
i/2] = { aOrigRanges[
i], aOrigRanges[
i+1] };
216 std::map<OUString, css::uno::Any>& rMap = aGrabBag.
GetGrabBag();
217 auto aIterator = rMap.find(
"CharShadingMarker");
218 if (aIterator != rMap.end())
220 aIterator->second <<=
false;
242 aSet.
Put(aFrameSize);
251 nRet = SvxPageUsage::Left;
253 nRet = SvxPageUsage::Right;
255 nRet = SvxPageUsage::All;
257 nRet = SvxPageUsage::Mirror;
265 if (nUse == SvxPageUsage::Left)
267 else if (nUse == SvxPageUsage::Right)
269 else if (nUse == SvxPageUsage::All)
271 else if (nUse == SvxPageUsage::Mirror)
281 bool bFirstShare =
false;
288 if (pGrabBag->GetGrabBag().find(
"BackgroundFullSize")->second >>= bValue)
292 auto it = pGrabBag->GetGrabBag().find(
"RtlGutter");
293 if (it != pGrabBag->GetGrabBag().end() && (it->second >>= bValue))
308 if(nUse != SvxPageUsage::NONE)
327 const SfxItemSet& rHeaderSet = pHeaderSetItem->GetItemSet();
339 OSL_ENSURE(pHeaderFormat !=
nullptr,
"no header format");
345 rHeaderSet.
Get(SID_ATTR_PAGE_SHARED_FIRST)).
GetValue());
363 const SfxItemSet& rFooterSet = pFooterSetItem->GetItemSet();
375 OSL_ENSURE(pFooterFormat !=
nullptr,
"no footer format");
383 rFooterSet.
Get(SID_ATTR_PAGE_SHARED_FIRST)).
GetValue());
408 SID_SWREGISTER_MODE,
false);
409 if(!pRegisterModeItem)
412 bool bSet = pRegisterModeItem->
GetValue();
416 SID_SWREGISTER_COLLECTION,
false))
418 const OUString& rColl = pCollectionItem->GetValue();
425 if( USHRT_MAX !=
nId )
439bool IsOwnFormat(
const SwDoc& rDoc)
448 std::shared_ptr<const SfxFilter> pFilter = pMedium->
GetFilter();
454 return pFilter->IsOwnFormat();
481 std::shared_ptr<SvxBoxInfoItem> aBoxInfo(std::make_shared<SvxBoxInfoItem>(SID_ATTR_BORDER_INNER));
485 aBoxInfo.reset(pBoxInfo->Clone());
488 aBoxInfo->SetTable(
false );
490 aBoxInfo->SetDist(
true);
492 aBoxInfo->SetMinDist(
false );
496 aBoxInfo->SetValid( SvxBoxInfoItemValidFlags::DISABLE );
509 OSL_ENSURE(pHeaderFormat !=
nullptr,
"no header format");
517 SID_ATTR_BORDER_INNER,SID_ATTR_BORDER_INNER,
518 SID_ATTR_PAGE_SIZE,SID_ATTR_PAGE_SIZE,
519 SID_ATTR_PAGE_ON,SID_ATTR_PAGE_SHARED,
520 SID_ATTR_PAGE_SHARED_FIRST,SID_ATTR_PAGE_SHARED_FIRST> aHeaderSet(*
rSet.
GetPool());
532 aHeaderSet.Put(aDynamic);
536 aHeaderSet.Put(aShared);
538 aHeaderSet.Put(aFirstShared);
542 aHeaderSet.Put(aSize);
546 aHeaderSet.Put( *aBoxInfo );
549 SvxSetItem aSetItem(SID_ATTR_PAGE_HEADERSET, aHeaderSet);
558 OSL_ENSURE(pFooterFormat !=
nullptr,
"no footer format");
566 SID_ATTR_BORDER_INNER,SID_ATTR_BORDER_INNER,
567 SID_ATTR_PAGE_SIZE,SID_ATTR_PAGE_SIZE,
568 SID_ATTR_PAGE_ON,SID_ATTR_PAGE_SHARED,
569 SID_ATTR_PAGE_SHARED_FIRST,SID_ATTR_PAGE_SHARED_FIRST> aFooterSet(*
rSet.
GetPool());
581 aFooterSet.Put(aDynamic);
585 aFooterSet.Put(aShared);
587 aFooterSet.Put(aFirstShared);
591 aFooterSet.Put(aSize);
595 aFooterSet.Put( *aBoxInfo );
598 SvxSetItem aSetItem(SID_ATTR_PAGE_FOOTERSET, aFooterSet);
615 std::optional<SfxGrabBagItem> oGrabBag;
618 oGrabBag.emplace(*pItem);
622 oGrabBag.emplace(SID_ATTR_CHAR_GRABBAG);
624 oGrabBag->GetGrabBag()[
"BackgroundFullSize"] <<=
627 if (IsOwnFormat(*rMaster.
GetDoc()))
629 oGrabBag->GetGrabBag()[
"RtlGutter"]
643 SvxTabStop aSwTabStop( nDefDist, SvxTabAdjust::Default );
644 rTabs.
Insert( aSwTabStop );
652 return rTabs.
Count() ? rTabs[0].GetTabPos() : 1134;
661 bool bChanged =
false;
665 case SfxItemState::SET:
671 case SfxItemState::DISABLED:
676 case SfxItemState::UNKNOWN:
677 case SfxItemState::DEFAULT:
685 const OUString& rDescName = pModelItem->GetValue();
686 if( !rDescName.isEmpty() )
704 const SwPageDesc* pPageDesc = pPageDescItem->GetPageDesc();
721 ::std::optional<sal_uInt16> oNumOffset;
725 case SfxItemState::SET:
737 case SfxItemState::DEFAULT:
746 SfxUInt16Item aPageNum( SID_ATTR_PARA_PAGENUM, *oNumOffset );
747 rCoreSet.
Put( aPageNum );
758 return SW_MOD()->GetUsrPref(bWeb)->GetMetric();
765 SW_MOD()->ApplyUserMetric(eMetric, bWeb);
778 rToFill.
insert(nOffset, rEntry, &rId,
nullptr,
nullptr);
783 const int nOffset = rToFill.
get_count() > 0 ? 1 : 0;
788 const OUString sStandard(
SwResId(STR_POOLCHR_STANDARD));
791 if(bWithDefault || pBase->
GetName() != sStandard)
794 OUString
sId(OUString::number(nPoolId));
800 pBase = pPool->
Next();
804 for(
size_t i = 0;
i < pFormats->
size(); ++
i)
809 const OUString& rName = pFormat->
GetName();
812 OUString
sId(OUString::number(USHRT_MAX));
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:
852 OSL_FAIL(
"where to get the actual width from?");
867 OUString sRet = rAppLclData.
getDate( rDT ) +
" " + rAppLclData.
getTime( rDT );
875 return SW_MOD()->GetUsrPref(bWeb)->IsApplyCharUnit();
880 SW_MOD()->ApplyUserCharUnit(bApplyChar, bWeb);
886 const sal_uInt16 nItemCount = rMenu->getItemCount();
888 for (sal_uInt16 nItem = 0; nItem < nItemCount; ++nItem)
890 sal_Int16 nItemId = rMenu->getItemId(nItem);
891 css::uno::Reference<css::awt::XPopupMenu> xPopup = rMenu->getPopupMenu(nItemId);
894 sCommand = xPopup->getCommand(
nId);
895 if(!sCommand.isEmpty())
899 if(!sCommand.isEmpty())
902 uno::Reference < frame::XDispatchProvider > xProv(
xFrame, uno::UNO_QUERY );
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 );
910 uno::Sequence< beans::PropertyValue >
aSeq;
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
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
void SetDescName(const OUString &rStr)
tools::Long GetWidth() const
const Size & GetSize() const
void SetSize(const Size &rSize)
bool Insert(const SvxTabStop &rTab)
sal_uInt16 GetCursorCnt(bool bAll=true) const
Get the number of elements in the ring of cursors.
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
virtual SfxStyleSheetBasePool * GetStyleSheetPool() override
For Style PI.
SwDoc * GetDoc()
returns Doc. But be careful!
const SwCharFormats * GetCharFormats() const
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
const SwTextFormatColl * GetDfltTextFormatColl() const
SwTextFormatColl * FindTextFormatCollByName(const OUString &rName) const
SwTextFormatColl * MakeTextFormatColl(const OUString &rFormatName, SwTextFormatColl *pDerivedFrom, bool bBroadcast=false)
Create the FormatCollections.
const SwFrameFormat * GetDfltFrameFormat() const
SwDocShell * GetDocShell()
bool GetCurAttr(SfxItemSet &, const bool bMergeIndentValuesOfNumRule=false) const
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
void SetAttrItem(const SfxPoolItem &, SetAttrMode nFlags=SetAttrMode::DEFAULT, const bool bParagraphSetting=false)
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
const SwRect & GetAnyCurRect(CurRectType eType, const Point *pPt=nullptr, const css::uno::Reference< css::embed::XEmbeddedObject > &=css::uno::Reference< css::embed::XEmbeddedObject >()) const
const SwFrameFormat * GetFlyFrameFormat() const
Get FlyFrameFormat; for UI macro linkage at Flys.
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
void SetNumOffset(const ::std::optional< sal_uInt16 > &oNum)
void RegisterToPageDesc(SwPageDesc &)
SwPageDesc * GetPageDesc()
const ::std::optional< sal_uInt16 > & GetNumOffset() const
void ChgFooterShare(bool bNew)
const OUString & GetName() const
SwFrameFormat & GetMaster()
bool IsHeaderShared() const
const SvxNumberType & GetNumType() const
void ChgHeaderShare(bool bNew)
bool IsFirstShared() const
bool IsFooterShared() const
bool GetLandscape() const
UseOnPage GetUseOn() const
void SetNumType(const SvxNumberType &rNew)
void SetFootnoteInfo(const SwPageFootnoteInfo &rNew)
void ChgFirstShare(bool bNew)
const SwPageDesc * GetFollow() const
const SwPageFootnoteInfo & GetFootnoteInfo() const
void SetRegisterFormatColl(const SwTextFormatColl *rFormat)
set the style for the grid alignment
void SetUseOn(UseOnPage eNew)
Same as WriteUseOn(), but the >= HeaderShare part of the bitfield is not modified.
void SetLandscape(bool bNew)
const SwTextFormatColl * GetRegisterFormatColl() const
retrieve the style for the grid alignment
void Width(tools::Long nNew)
static SW_DLLPUBLIC sal_uInt16 GetPoolIdFromUIName(const OUString &rName, SwGetPoolIdFromName)
tools::Long GetRight() const
Represents the style of a paragraph.
virtual bool SetFormatAttr(const SfxPoolItem &rAttr) override
Override to recognize changes on the <SwNumRuleItem> and register/unregister the paragragh style at t...
Used by the UI to modify the document model.
SelectionType GetSelectionType() const
const SwView & GetView() const
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
#define FN_PARAM_FTN_INFO
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
@ FlyEmbeddedPrt
Rect of PrtArea of FlyFrame.
@ PagePrt
Rect of current PrtArea of page.
@ 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()
Sequence< sal_Int8 > aSeq
@ NONE
For internal use only.
sal_Int32 size() const noexcept
Reference< XFrame > xFrame
OUString SwResId(TranslateId aId)
constexpr SwTwips MIN_BORDER_DIST
std::pair< sal_uInt16, sal_uInt16 > WhichPair
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLUSESLIDEBACKGROUND)