22 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
23 #include <com/sun/star/beans/XPropertySet.hpp>
24 #include <com/sun/star/container/XNameAccess.hpp>
25 #include <com/sun/star/frame/XModel.hpp>
29 #include <osl/diagnose.h>
58 #include <drawdoc.hxx>
70 #include <uiitems.hxx>
80 #include <strings.hrc>
81 #include <AccessibilityCheck.hxx>
104 std::unique_ptr<SfxPoolItem> pItem;
120 case SID_STYLE_APPLY:
138 case SID_STYLE_FAMILY1:
145 aName =
SwResId(STR_POOLCHR_STANDARD);
150 case SID_STYLE_FAMILY2:
161 nMask = SfxStyleSearchBits::SwHtml;
166 nMask = SfxStyleSearchBits::SwIndex ;
173 nMask = SfxStyleSearchBits::SwExtra;
175 nMask = SfxStyleSearchBits::SwText;
184 case SID_STYLE_FAMILY3:
199 case SID_STYLE_FAMILY4:
207 if( n < pShell->GetPageDescCnt() )
214 case SID_STYLE_FAMILY5:
223 case SID_STYLE_FAMILY6:
233 case SID_STYLE_WATERCAN:
240 case SID_STYLE_UPDATE_BY_EXAMPLE:
242 ? SfxStyleFamily::Frame != nActualFamily
243 : ( SfxStyleFamily::Frame == nActualFamily ||
244 SfxStyleFamily::Page == nActualFamily ||
246 (SfxStyleFamily::Table == nActualFamily && !pShell->
GetTableAutoFormat(aTableAutoFormat))) )
252 case SID_STYLE_NEW_BY_EXAMPLE:
254 ? SfxStyleFamily::Frame != nActualFamily
255 : SfxStyleFamily::Frame == nActualFamily) ||
257 (SfxStyleFamily::Table == nActualFamily && !pShell->
GetTableAutoFormat(aTableAutoFormat)) )
263 case SID_CLASSIFICATION_APPLY:
267 case SID_CLASSIFICATION_DIALOG:
280 OSL_FAIL(
"Invalid SlotId");
289 sal_uInt16 nSlot = rReq.
GetSlot();
296 if( pArgs && SfxItemState::SET == pArgs->
GetItemState( SID_STYLE_FAMILY,
303 if( SfxItemState::SET == pArgs->
GetItemState( SID_STYLE_NEW,
305 sName = static_cast<const SfxStringItem*>(pItem)->GetValue();
306 if( SfxItemState::SET == pArgs->
GetItemState( SID_STYLE_MASK,
308 nMask = static_cast<SfxStyleSearchBits>(static_cast<const SfxUInt16Item*>(pItem)->GetValue());
310 if( SfxItemState::SET == pArgs->
GetItemState( SID_STYLE_REFERENCE,
312 sParent = static_cast<const SfxStringItem*>(pItem)->GetValue();
317 Edit(sName, sParent, nFamily, nMask,
true, OString(),
nullptr, &rReq, nSlot);
321 case SID_STYLE_APPLY:
332 if ( pFamilyItem && pNameItem )
334 uno::Reference< style::XStyleFamiliesSupplier >
xModel(
GetModel(), uno::UNO_QUERY);
337 uno::Reference< container::XNameAccess > xStyles;
338 uno::Reference< container::XNameAccess > xCont = xModel->getStyleFamilies();
339 xCont->getByName(pFamilyItem->GetValue()) >>= xStyles;
340 uno::Reference< beans::XPropertySet > xInfo;
341 xStyles->getByName( pNameItem->
GetValue() ) >>= xInfo;
343 xInfo->getPropertyValue(
"DisplayName") >>= aUIName;
344 if ( !aUIName.isEmpty() )
347 catch (
const uno::Exception&)
356 case SID_STYLE_DELETE:
359 case SID_STYLE_WATERCAN:
360 case SID_STYLE_FAMILY:
361 case SID_STYLE_UPDATE_BY_EXAMPLE:
362 case SID_STYLE_NEW_BY_EXAMPLE:
373 case SID_STYLE_NEW_BY_EXAMPLE:
385 case SID_STYLE_UPDATE_BY_EXAMPLE:
403 if( SfxItemState::SET == pArgs->
GetItemState(nSlot,
false, &pItem ))
404 aParam = static_cast<const SfxStringItem*>(pItem)->GetValue();
406 if( SfxItemState::SET == pArgs->
GetItemState(SID_STYLE_FAMILY,
408 nFamily = static_cast<SfxStyleFamily>(static_cast<const SfxUInt16Item*>(pItem)->GetValue());
410 if( SfxItemState::SET == pArgs->
GetItemState(SID_STYLE_FAMILYNAME,
false, &pItem ))
413 if(aFamily ==
"CharacterStyles")
414 nFamily = SfxStyleFamily::Char;
416 if(aFamily ==
"ParagraphStyles")
417 nFamily = SfxStyleFamily::Para;
419 if(aFamily ==
"PageStyles")
420 nFamily = SfxStyleFamily::Page;
422 if(aFamily ==
"FrameStyles")
423 nFamily = SfxStyleFamily::Frame;
425 if(aFamily ==
"NumberingStyles")
426 nFamily = SfxStyleFamily::Pseudo;
428 if(aFamily ==
"TableStyles")
429 nFamily = SfxStyleFamily::Table;
432 if( SfxItemState::SET == pArgs->
GetItemState(SID_STYLE_MASK,
434 nMask = static_cast<SfxStyleSearchBits>(static_cast<const SfxUInt16Item*>(pItem)->GetValue());
437 pActShell = pShell = static_cast<SwWrtShell*>(static_cast<const SwPtrItem*>(pItem)->GetValue());
439 if( nSlot == SID_STYLE_UPDATE_BY_EXAMPLE && aParam.isEmpty() )
443 case SfxStyleFamily::Para:
450 case SfxStyleFamily::Frame:
457 case SfxStyleFamily::Char:
464 case SfxStyleFamily::Pseudo:
465 if(SfxItemState::SET == pArgs->
GetItemState(SID_STYLE_UPD_BY_EX_NAME,
false, &pItem))
470 case SfxStyleFamily::Table:
471 if(SfxItemState::SET == pArgs->
GetItemState(SID_STYLE_UPD_BY_EX_NAME,
false, &pItem))
481 if (!aParam.isEmpty() || nSlot == SID_STYLE_WATERCAN )
483 sal_uInt16 nRet = 0xffff;
484 bool bReturns =
false;
489 Edit(aParam, OUString(), nFamily, nMask,
false, OString(), pActShell);
491 case SID_STYLE_DELETE:
496 Hide(aParam, nFamily, nSlot == SID_STYLE_HIDE);
498 case SID_STYLE_APPLY:
503 case SID_STYLE_WATERCAN:
504 nRet =
static_cast<sal_uInt16
>(
DoWaterCan(aParam, nFamily));
507 case SID_STYLE_UPDATE_BY_EXAMPLE:
510 case SID_STYLE_NEW_BY_EXAMPLE:
515 OSL_FAIL(
"Invalid SlotId");
549 , m_xBasePool(xBasePool)
550 , m_bModified(bModified)
561 bool DocIsModified()
const
578 SwWrtShell* pWrtShell = m_rDocSh.GetWrtShell();
579 SwDoc* pDoc = m_rDocSh.GetDoc();
580 SwView* pView = m_rDocSh.GetView();
584 if( SfxStyleFamily::Para == m_nFamily )
586 SfxItemSet aSet( *m_pDlg->GetOutputItemSet() );
591 m_xTmp->SetItemSet( aSet,
true );
595 if(SfxStyleFamily::Page == m_nFamily)
597 static const sal_uInt16 aInval[] = {
598 SID_IMAGE_ORIENTATION,
603 SfxItemSet aTmpSet( *m_pDlg->GetOutputItemSet() );
604 if( SfxStyleFamily::Char == m_nFamily )
609 m_xTmp->SetItemSet( aTmpSet );
614 if( aTmpSet.GetItemState( m_rDocSh.GetPool().GetTrueWhich( SID_ATTR_FRAMEDIRECTION,
false ) ,
true, &pItem ) == SfxItemState::SET )
618 if (m_nFamily == SfxStyleFamily::Page)
621 if (aTmpSet.HasItem(SID_ATTR_CHAR_GRABBAG, &pItem))
623 const auto& rGrabBagItem =
static_cast<const SfxGrabBagItem&
>(*pItem);
625 auto it = rGrabBagItem.
GetGrabBag().find(
"GutterAtTop");
626 if (it != rGrabBagItem.GetGrabBag().end())
628 it->second >>= bGutterAtTop;
632 if (bOldGutterAtTop != bGutterAtTop)
644 if(SfxStyleFamily::Frame == m_nFamily || SfxStyleFamily::Para == m_nFamily)
647 SfxItemSet aTmpSet(*m_pDlg->GetOutputItemSet());
650 m_xTmp->SetItemSet(aTmpSet);
654 if(SfxStyleFamily::Page == m_nFamily)
658 m_xBasePool->Broadcast(
SfxStyleSheetHint(SfxHintId::StyleSheetCreated, *m_xTmp));
660 m_xBasePool->Broadcast(
SfxStyleSheetHint(SfxHintId::StyleSheetModified, *m_xTmp));
676 void syncEndnoteOrientation(
const uno::Reference< style::XStyleFamiliesSupplier >& xStyleFamSupp)
678 if (!xStyleFamSupp.is())
680 SAL_WARN(
"sw.ui",
"Ref to XStyleFamiliesSupplier is null.");
683 uno::Reference<container::XNameAccess> xStyleFamilies = xStyleFamSupp->getStyleFamilies();
685 if (!xStyleFamilies.is())
688 uno::Reference<container::XNameAccess> xPageStyles(xStyleFamilies->getByName(
"PageStyles"),
691 if (!xPageStyles.is())
694 uno::Reference<css::style::XStyle> xEndnotePageStyle(xPageStyles->getByName(
"Endnote"),
697 if (!xEndnotePageStyle.is())
701 uno::Reference<css::style::XStyle> xDefaultPageStyle(xPageStyles->getByName(
"Standard"),
703 if (!xDefaultPageStyle.is())
706 if (xEndnotePageStyle->isUserDefined() || !xEndnotePageStyle->isInUse())
709 uno::Reference<beans::XPropertySet> xEndnotePagePropSet(xPageStyles->getByName(
"Endnote"), uno::UNO_QUERY);
710 uno::Reference<beans::XPropertySet> xDefaultPagePropSet(xPageStyles->getByName(
"Standard"), uno::UNO_QUERY);
712 if (!xEndnotePagePropSet.is() || !xDefaultPagePropSet.is())
714 SAL_WARN(
"sw.ui",
"xEndnotePagePropSet or xDefaultPagePropSet is null.");
718 auto const bIsDefLandScape = *o3tl::doAccess<bool>(
719 xDefaultPagePropSet->getPropertyValue(
"IsLandscape"));
720 auto const bIsEndLandScape = *o3tl::doAccess<bool>(
721 xEndnotePagePropSet->getPropertyValue(
"IsLandscape"));
723 if (bIsDefLandScape == bIsEndLandScape)
726 auto const nWidth = xEndnotePagePropSet->getPropertyValue(
"Width");
727 auto const nHeight = xEndnotePagePropSet->getPropertyValue(
"Height");
729 xEndnotePagePropSet->setPropertyValue(
"IsLandscape", css::uno::toAny(bIsDefLandScape));
730 xEndnotePagePropSet->setPropertyValue(
"Width", nHeight);
731 xEndnotePagePropSet->setPropertyValue(
"Height", nWidth);
736 const OUString &rName,
737 const OUString &rParent,
741 const OString& sPage,
747 const bool bBasic = pReq && pReq->
IsAPI();
750 bool bModified =
m_xDoc->getIDocumentState().IsModified();
763 if( SfxStyleSearchBits::All != nMask && SfxStyleSearchBits::AllVisible != nMask && SfxStyleSearchBits::Used != nMask )
764 nMask |= SfxStyleSearchBits::UserDefined;
766 nMask = SfxStyleSearchBits::UserDefined;
768 if ( nFamily == SfxStyleFamily::Para || nFamily == SfxStyleFamily::Char || nFamily == SfxStyleFamily::Frame )
773 pStyle = &
m_xBasePool->Make( rName, nFamily, nMask );
777 pStyle = &
m_xBasePool->Make( rName, nFamily, nMask );
784 case SfxStyleFamily::Para:
786 if(!rParent.isEmpty())
818 case SfxStyleFamily::Char:
820 if(!rParent.isEmpty())
842 case SfxStyleFamily::Frame :
844 if(!rParent.isEmpty())
871 SAL_WARN_IF( !pStyle,
"sw.ui",
"Style not found" );
879 if( SfxStyleFamily::Para == nFamily )
884 xTmp->MergeIndentAttrsOfListStyle( rSet );
888 else if( SfxStyleFamily::Char == nFamily )
893 if(SfxStyleFamily::Page == nFamily || SfxStyleFamily::Para == nFamily)
906 std::optional<SfxGrabBagItem> oGrabBag;
908 if (SfxItemState::SET == rSet.
GetItemState(SID_ATTR_CHAR_GRABBAG,
true, &pItem))
910 oGrabBag.emplace(*static_cast<SfxGrabBagItem const*>(pItem));
914 oGrabBag.emplace(SID_ATTR_CHAR_GRABBAG);
918 oGrabBag->GetGrabBag()[
"GutterAtTop"] <<= bGutterAtTop;
940 *xTmp, nFamily, sPage, pCurrShell, bNew));
941 auto pApplyStyleHelper = std::make_shared<ApplyStyle>(*
this, bNew, xTmp, nFamily, pDlg.get(),
m_xBasePool, bModified);
942 pDlg->SetApplyHdl(
LINK(pApplyStyleHelper.
get(), ApplyStyle, ApplyHdl));
944 std::shared_ptr<SfxRequest> pRequest;
947 pRequest = std::make_shared<SfxRequest>(*pReq);
951 bool bIsDefaultPage = nFamily == SfxStyleFamily::Page
952 && rName ==
SwResId(STR_POOLPAGE_STANDARD)
956 pDlg->StartExecuteAsync([bIsDefaultPage, bNew, nFamily, nSlot, nNewStyleUndoId, pApplyStyleHelper, pRequest, xTmp,
this](sal_Int32 nResult){
958 pApplyStyleHelper->apply();
964 case SfxStyleFamily::Para:
966 if(!xTmp->GetParent().isEmpty())
972 std::make_unique<SwUndoTextFormatCollCreate>(xTmp->GetCollection(), pColl, *
GetDoc()));
977 case SfxStyleFamily::Char:
979 if(!xTmp->GetParent().isEmpty())
985 std::make_unique<SwUndoCharFormatCreate>(xTmp->GetCharFormat(), pCFormat, *
GetDoc()));
990 case SfxStyleFamily::Frame:
992 if(!xTmp->GetParent().isEmpty())
998 std::make_unique<SwUndoFrameFormatCreate>(xTmp->GetFrameFormat(), pFFormat, *
GetDoc()));
1013 bool bDocModified = pApplyStyleHelper->DocIsModified();
1020 m_xDoc->GetIDocumentUndoRedo().ClearRedo();
1024 m_xDoc->getIDocumentState().ResetModified();
1028 if (nSlot == SID_STYLE_NEW && nFamily == SfxStyleFamily::Page)
1035 pApplyStyleHelper->m_pDlg.disposeAndClear();
1039 if (bIsDefaultPage && bDocModified)
1041 uno::Reference< style::XStyleFamiliesSupplier > xStyleFamSupp(
GetModel(), uno::UNO_QUERY);
1043 if (!xStyleFamSupp.is())
1045 SAL_WARN(
"sw.ui",
"Ref to XStyleFamiliesSupplier is null.");
1049 syncEndnoteOrientation(xStyleFamSupp);
1060 if( SfxStyleFamily::Para == nFamily )
1069 if(SfxStyleFamily::Page == nFamily)
1075 m_xDoc->getIDocumentState().SetModified();
1078 m_xDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
1108 xTmp->SetHidden( bHidden );
1119 SAL_WARN_IF( !pStyle,
"sw.ui",
"Style not found" );
1122 return SfxStyleFamily::None;
1132 case SfxStyleFamily::Char:
1139 case SfxStyleFamily::Para:
1147 case SfxStyleFamily::Frame:
1153 case SfxStyleFamily::Page:
1158 case SfxStyleFamily::Pseudo:
1163 if (pNumRule->
GetName() ==
"No List")
1169 pSh->
SetCurNumRule( *pNumRule,
false, sListIdForStyle,
true );
1172 case SfxStyleFamily::Table:
1178 OSL_FAIL(
"Unknown family");
1194 if( rName.isEmpty() )
1198 aTemplate.
eType = nFamily;
1205 SAL_WARN_IF( !pStyle,
"sw.ui",
"Where's the StyleSheet" );
1207 if(!pStyle)
return nFamily;
1211 case SfxStyleFamily::Char:
1214 case SfxStyleFamily::Para:
1217 case SfxStyleFamily::Frame:
1220 case SfxStyleFamily::Page:
1223 case SfxStyleFamily::Pseudo:
1228 OSL_FAIL(
"Unknown family");
1253 case SfxStyleFamily::Para:
1272 case SfxStyleFamily::Frame:
1293 case SfxStyleFamily::Char:
1306 case SfxStyleFamily::Pseudo:
1320 case SfxStyleFamily::Table:
1336 m_xDoc->BroadcastStyleOperation(rName, nFamily, SfxHintId::StyleSheetModified);
1350 if( SfxStyleSearchBits::All == nMask || SfxStyleSearchBits::Used == nMask )
1351 nMask = SfxStyleSearchBits::UserDefined;
1353 nMask |= SfxStyleSearchBits::UserDefined;
1355 if (nFamily == SfxStyleFamily::Para || nFamily == SfxStyleFamily::Char || nFamily == SfxStyleFamily::Frame)
1369 case SfxStyleFamily::Para:
1382 switch( nMask & static_cast<SfxStyleSearchBits>(0x0fff) )
1384 case SfxStyleSearchBits::SwText:
1387 case SfxStyleSearchBits::SwChapter:
1390 case SfxStyleSearchBits::SwList:
1393 case SfxStyleSearchBits::SwIndex:
1396 case SfxStyleSearchBits::SwExtra:
1399 case SfxStyleSearchBits::SwHtml:
1406 if (
GetDoc()->GetIDocumentUndoRedo().DoesUndo())
1409 std::make_unique<SwUndoTextFormatCollCreate>(pColl, pDerivedFrom, *
GetDoc()));
1416 case SfxStyleFamily::Frame:
1430 if (
GetDoc()->GetIDocumentUndoRedo().DoesUndo())
1433 std::make_unique<SwUndoFrameFormatCreate>(pFrame, pFFormat, *
GetDoc()));
1441 case SfxStyleFamily::Char:
1452 if (
GetDoc()->GetIDocumentUndoRedo().DoesUndo())
1457 std::make_unique<SwUndoCharFormatCreate>(
1458 pChar, pDerivedFrom ? pDerivedFrom :
GetDoc()->GetDfltCharFormat(),
1467 case SfxStyleFamily::Page:
1492 case SfxStyleFamily::Pseudo:
1501 OUString sOrigRule( aRule.
GetName() );
1514 case SfxStyleFamily::Table:
1531 m_xDoc->BroadcastStyleOperation(rName, nFamily, SfxHintId::StyleSheetCreated);
1538 return aCheck.getIssueCollection();
1543 return m_xDoc->GetDocColors();
1568 if( dynamic_cast<const SwDocShell*>( &rSource) !=
nullptr)
1573 if(!bPreserveCurrentDocument)
1574 static_cast<SwDocShell&
>(rSource).
m_xDoc->getIDocumentFieldsAccess().SetFixFields(
nullptr);
1583 m_xDoc->ReplaceStyles( *static_cast<SwDocShell&>(rSource).
m_xDoc );
1588 bool bModified =
m_xDoc->getIDocumentState().IsModified();
1589 m_xDoc->ReplaceStyles( *static_cast<SwDocShell&>(rSource).
m_xDoc );
1590 if (!bModified && m_xDoc->getIDocumentState().IsModified() && !
m_pView)
1594 m_xDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
1603 const OUString& rPage,
1604 const OString& rPageId,
1608 Edit(rPage, OUString(), SfxStyleFamily::Page, SfxStyleSearchBits::Auto,
false, rPageId, &rActShell, pRequest);
SfxViewFrame * GetViewFrame() const
#define LINK(Instance, Class, Member)
bool IsPrintLayoutExtension() const
virtual bool IsUsed() const
SwTextFormatColl * GetCurTextFormatColl() const
Get the named paragraph format of the current selection.
SwTextFormatColl * FindTextFormatCollByName(std::u16string_view rName) const
const sal_uInt16 COLL_LISTS_BITS
const sal_uInt16 COLL_DOC_BITS
IMPL_LINK_NOARG(ApplyStyle, ApplyHdl, LinkParamNone *, void)
Represents the style of a paragraph.
SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId)
SfxWatermarkItem GetWatermark() const
SwTableAutoFormat * GetTableFormat()
void SetPoolHelpId(sal_uInt16 const nId)
const SwNumRule * GetNumRuleAtCurrCursorPos() const
#define DECL_LINK(Member, ArgType, RetType)
SwCharFormat * GetCharFormatFromPool(sal_uInt16 nId)
SfxDispatcher * GetDispatcher()
virtual void SetModified()=0
Must be called manually at changes of format.
bool GetLastUndoInfo(OUString *const o_pStr, SwUndoId *const o_pId, const SwView *pView=nullptr) const
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
const OUString & GetDefaultListId() const
const sal_uInt16 COLL_HTML_BITS
SAL_DLLPRIVATE void UpdateStyle(const OUString &rName, SfxStyleFamily nFamily, SwWrtShell *pShell)
sal_uInt16 GetValue() const
void InvalidateItem(sal_uInt16 nWhich)
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
const OUString & GetName() const
void Done(bool bRemove=false)
void SetPageStyle(const OUString &rCollName)
IDocumentUndoRedo & GetIDocumentUndoRedo()
css::uno::Reference< css::frame::XModel > GetModel() const
const SfxItemSet * GetArgs() const
void Invalidate(sal_uInt16 nId)
virtual bool SetFormatAttr(const SfxPoolItem &rAttr) override
Override to recognize changes on the and register/unregister the paragragh style at t...
SwFrameFormat * GetFrameFormatFromPool(sal_uInt16 nId)
SwFrameFormat * FindFrameFormatByName(std::u16string_view rName) const
void PutItem(const SfxPoolItem &rItem)
void SetValue(SfxStyleSearchBits n)
void SetApplyTemplate(const SwApplyTemplate &)
Apply template.
XPatternListRef GetPatternList() const
const OUString & GetName() const
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
void SetCurNumRule(const SwNumRule &, const bool bCreateNewList, const OUString &sContinuedListId=OUString(), const bool bResetIndentAttrs=false)
Optional parameter (default value false).
Used by the UI to modify the document model.
void SetWatermark(const SfxWatermarkItem &rText)
virtual void set(DocumentSettingId id, bool value)=0
Set the specified document setting.
void FillByEx(SwCharFormat *)
bool IsAssignedToListLevelOfOutlineStyle() const
const SwView & GetView() const
const OUString & GetName() const
#define FN_NUM_BULLET_OFF
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
sal_uInt16 GetPoolFormatId() const
Query and set PoolFormat-Id.
void ExecStyleSheet(SfxRequest &)
SAL_DLLPRIVATE void Edit(const OUString &rName, const OUString &rParent, const SfxStyleFamily nFamily, SfxStyleSearchBits nMask, const bool bNew, const OString &sPageId, SwWrtShell *pActShell, SfxRequest *pRequest=nullptr, sal_uInt16 nSlot=0)
Methods for StyleSheets.
bool SetTableStyle(const OUString &rStyleName)
Set table style of the current table.
void InvalidateLayout(bool bSizeChanged)
virtual void DelAllUndoObj()=0
Delete all Undo actions.
void InitPrt(OutputDevice *pOutDev)
SwFrameFormat * GetFrameFormat()
static SW_DLLPUBLIC sal_uInt16 GetPoolIdFromUIName(const OUString &rName, SwGetPoolIdFromName)
const SwTable & GetTable() const
void SetPoolHlpFileId(sal_uInt8 const nId)
const SwPageDesc * GetPageDesc()
const OUString & GetTableStyleName() const
Return the table style name of this table.
const SwTOXBase * GetCurTOX() const
Get current listing before or at the Cursor.
virtual void LoadStyles(SfxObjectShell &rSource) override
const sal_uInt16 COLL_REGISTER_BITS
SwCharFormat * GetCharFormat()
virtual bool DoesUndo() const =0
Is Undo enabled?
void PresetParent(const OUString &rName)
SfxItemPool & GetPool() const
static SvxHtmlOptions & Get()
void ChgNumRuleFormats(const SwNumRule &rRule)
bool GetFlyFrameAttr(SfxItemSet &rSet) const
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
SwDoc * GetDoc()
returns Doc. But be careful!
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
virtual void AppendUndo(std::unique_ptr< SwUndo > pUndo)=0
Add new Undo action.
const SwTableNode * IsCursorInTable() const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
void SetTextFormatColl(SwTextFormatColl *, const bool bResetListAttrs=false)
Add 2nd optional parameter - see also
SwApplyTemplate * GetApplyTemplate() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
SwTextFormatColl * pTextColl
sfx::AccessibilityIssueCollection runAccessibilityCheck() override
virtual void SetUndoNoResetModified()=0
Disable (re)setting the document modified flag on Undo/Redo.
sal_uInt16 GetModifier() const
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
void LoadStyles_(SfxObjectShell &rSource, bool bPreserveCurrentDocument)
virtual std::set< Color > GetDocColors() override
SfxBindings & GetBindings()
#define FN_PARAM_WRTSHELL
void SetAttrItem(const SfxPoolItem &, SetAttrMode nFlags=SetAttrMode::DEFAULT, const bool bParagraphSetting=false)
const OUString & GetValue() const
const SwPageDesc & GetPageDesc(size_t i) const
FrameTypeFlags
values can be combined via logical or
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
const T * GetArg(sal_uInt16 nSlotId) const
void ChgTableStyle(const OUString &rName, const SwTableAutoFormat &rNewFormat)
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
virtual SfxStyleSheetBasePool * GetStyleSheetPool() override
For Style PI.
XGradientListRef GetGradientList() const
void AddRule(SwUndoArg eWhat, const OUString &rWith)
const std::map< OUString, css::uno::Any > & GetGrabBag() const
IDocumentState const & getIDocumentState() const
SwWrtShell * GetWrtShell()
Access to the SwWrtShell belonging to SwView.
SwFrameFormat * pFrameFormat
const SwNumRule * GetNumRule()
static SwAbstractDialogFactory * Create()
SfxItemState QueryState(sal_uInt16 nSID, std::unique_ptr< SfxPoolItem > &rpState)
rtl::Reference< SwDoc > m_xDoc
Document.
OUString SwResId(const char *pId)
void SetPoolFormatId(sal_uInt16 const nId)
virtual SfxPrinter * getPrinter(bool bCreate) const =0
Return the printer set at the document.
virtual void LoadStyles(SfxObjectShell &rSource)
SwFrameFormat * GetSelectedFrameFormat() const
If frame then frame style, else 0.
rtl::Reference< SfxStyleSheetBasePool > m_xBasePool
Passing through for formats.
sal_uInt16 const aFrameFormatSetRange[]
void SetReturnValue(const SfxPoolItem &)
SwCharFormat * pCharFormat
SAL_DLLPRIVATE void MakeByExample(const OUString &rName, SfxStyleFamily nFamily, SfxStyleSearchBits nMask, SwWrtShell *pShell)
SAL_DLLPRIVATE void Hide(const OUString &rName, SfxStyleFamily nFamily, bool bHidden)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
sal_uInt16 GetSlot() const
void CopyPageDesc(const SwPageDesc &rSrcDesc, SwPageDesc &rDstDesc, bool bCopyPoolIds=true)
Copy the complete PageDesc - beyond document and "deep"! Optionally copying of PoolFormatId, -HlpId can be prevented.
static SfxViewFrame * Current()
XHatchListRef GetHatchList() const
SwTextFormatColl * GetCollection()
void DisableItem(sal_uInt16 nWhich)
SwView * m_pView
For "historical reasons" nothing can be done without the WrtShell.
void ReplaceNumRule(const OUString &rOldRule, const OUString &rNewRule)
#define SAL_WARN_IF(condition, area, stream)
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
IDocumentSettingAccess const & getIDocumentSettingAccess() const
sal_uInt16 GetPoolHelpId() const
SwCharFormat * FindCharFormatByName(std::u16string_view rName) const
void SetAttrOutlineLevel(int)
void InvalidateRulerPos()
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
void SetFrameFormat(SwFrameFormat *pFormat, bool bKeepOrient=false, Point const *pDocPos=nullptr)
If frame then set frame style.
XBitmapListRef GetBitmapList() const
sal_uInt8 GetPoolHlpFileId() const
bool IsUserDefined() const
reference_type * get() const
SAL_DLLPRIVATE SfxStyleFamily ApplyStyles(const OUString &rName, const SfxStyleFamily nFamily, SwWrtShell *pShell, sal_uInt16 nMode)
SwCharFormat * GetCurCharFormat() const
void AppendItem(const SfxPoolItem &)
#define SAL_WARN(area, stream)
Reference< XModel > xModel
SAL_DLLPRIVATE SfxStyleFamily DoWaterCan(const OUString &rName, SfxStyleFamily nFamily)
const SwView * GetView() const
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
#define FN_INSERT_OBJ_CTRL
const sal_uInt16 COLL_TEXT_BITS
XColorListRef GetColorList() const
static OUString GenerateUnusedName(SfxStyleSheetBasePool &rPool, SfxStyleFamily eFam)
void FormatPage(const OUString &rPage, const OString &rPageId, SwWrtShell &rActShell, SfxRequest *pRequest=nullptr)
Show page style format dialog.
void SetName(const OUString &rNm, IDocumentListsAccess &rDocListAccess)
constexpr sal_uInt16 KEY_SHIFT
union SwApplyTemplate::@32 aColl
void StartAllAction()
For all views of this document.
SAL_DLLPRIVATE void Delete(const OUString &rName, SfxStyleFamily nFamily)
IDocumentListsAccess const & getIDocumentListsAccess() const
size_t GetCurPageDesc(const bool bCalcFrame=true) const
void StateStyleSheet(SfxItemSet &, SwWrtShell *pSh=nullptr)
void Undo(sal_uInt16 const nCount=1)
FrameTypeFlags GetFrameType(const Point *pPt, bool bStopAtFly) const
For return values see above FrameType.
bool IsFrameSelected() const
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(104)
const sal_uInt16 COLL_EXTRA_BITS
static void DoUpdateAllCharts(SwDoc *pDoc)
bool GetTableAutoFormat(SwTableAutoFormat &rGet)
virtual VclPtr< SfxAbstractApplyTabDialog > CreateTemplateDialog(weld::Window *pParent, SfxStyleSheetBase &rBase, SfxStyleFamily nRegion, const OString &sPage, SwWrtShell *pActShell, bool bNew)=0