20#include <config_wasm_strip.h>
24#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
25#include <com/sun/star/beans/XPropertySet.hpp>
26#include <com/sun/star/container/XNameAccess.hpp>
27#include <com/sun/star/frame/XModel.hpp>
31#include <osl/diagnose.h>
85#include <AccessibilityCheck.hxx>
110 std::unique_ptr<SfxUInt16Item> pFamilyItem;
114 nActualFamily =
static_cast<SfxStyleFamily>(pFamilyItem->GetValue());
125 case SID_STYLE_APPLY:
138 aName = pStyle->GetName();
149 case SID_STYLE_FAMILY1:
161 case SID_STYLE_FAMILY2:
169 aName = pStyle->GetName();
175 aName = pColl->GetName();
176 sal_uInt16
nId = pColl->GetPoolFormatId();
184 nMask = SfxStyleSearchBits::SwHtml;
189 nMask = SfxStyleSearchBits::SwIndex ;
196 nMask = SfxStyleSearchBits::SwExtra;
198 nMask = SfxStyleSearchBits::SwText;
207 case SID_STYLE_FAMILY3:
222 case SID_STYLE_FAMILY4:
229 if( n < pShell->GetPageDescCnt() )
236 case SID_STYLE_FAMILY5:
245 case SID_STYLE_FAMILY6:
255 case SID_STYLE_WATERCAN:
262 case SID_STYLE_UPDATE_BY_EXAMPLE:
264 ? SfxStyleFamily::Frame != nActualFamily
265 : ( SfxStyleFamily::Frame == nActualFamily ||
266 SfxStyleFamily::Page == nActualFamily ||
268 (SfxStyleFamily::Table == nActualFamily && !pShell->
GetTableAutoFormat(aTableAutoFormat))) )
274 case SID_STYLE_NEW_BY_EXAMPLE:
276 ? SfxStyleFamily::Frame != nActualFamily
277 : SfxStyleFamily::Frame == nActualFamily) ||
279 (SfxStyleFamily::Table == nActualFamily && !pShell->
GetTableAutoFormat(aTableAutoFormat)) )
285 case SID_CLASSIFICATION_APPLY:
289 case SID_CLASSIFICATION_DIALOG:
302 OSL_FAIL(
"Invalid SlotId");
311 sal_uInt16 nSlot = rReq.
GetSlot();
318 if( pArgs && SfxItemState::SET == pArgs->
GetItemState( SID_STYLE_FAMILY,
325 if( SfxItemState::SET == pArgs->
GetItemState( SID_STYLE_NEW,
328 if( SfxItemState::SET == pArgs->
GetItemState( SID_STYLE_MASK,
332 if( SfxItemState::SET == pArgs->
GetItemState( SID_STYLE_REFERENCE,
343 case SID_STYLE_APPLY:
354 if ( pFamilyItem && pNameItem )
356 uno::Reference< style::XStyleFamiliesSupplier >
xModel(
GetModel(), uno::UNO_QUERY);
359 uno::Reference< container::XNameAccess > xStyles;
360 uno::Reference< container::XNameAccess > xCont =
xModel->getStyleFamilies();
361 xCont->getByName(pFamilyItem->GetValue()) >>= xStyles;
362 uno::Reference< beans::XPropertySet > xInfo;
363 xStyles->getByName( pNameItem->
GetValue() ) >>= xInfo;
365 xInfo->getPropertyValue(
"DisplayName") >>=
aUIName;
369 catch (
const uno::Exception&)
378 case SID_STYLE_DELETE:
381 case SID_STYLE_WATERCAN:
382 case SID_STYLE_FAMILY:
383 case SID_STYLE_UPDATE_BY_EXAMPLE:
384 case SID_STYLE_NEW_BY_EXAMPLE:
395 case SID_STYLE_NEW_BY_EXAMPLE:
407 case SID_STYLE_UPDATE_BY_EXAMPLE:
413 if (
auto pStyle = pOLV->GetStyleSheet())
414 aParam = pStyle->GetName();
417 aParam = pColl->GetName();
419 if (!aParam.isEmpty())
430 if( SfxItemState::SET == pArgs->
GetItemState(nSlot,
false, &pItem ))
433 if( SfxItemState::SET == pArgs->
GetItemState(SID_STYLE_FAMILY,
437 if( SfxItemState::SET == pArgs->
GetItemState(SID_STYLE_FAMILYNAME,
false, &pItem ))
440 if(aFamily ==
"CharacterStyles")
441 nFamily = SfxStyleFamily::Char;
443 if(aFamily ==
"ParagraphStyles")
444 nFamily = SfxStyleFamily::Para;
446 if(aFamily ==
"PageStyles")
447 nFamily = SfxStyleFamily::Page;
449 if(aFamily ==
"FrameStyles")
450 nFamily = SfxStyleFamily::Frame;
452 if(aFamily ==
"NumberingStyles")
453 nFamily = SfxStyleFamily::Pseudo;
455 if(aFamily ==
"TableStyles")
456 nFamily = SfxStyleFamily::Table;
459 if( SfxItemState::SET == pArgs->
GetItemState(SID_STYLE_MASK,
463 pActShell = pShell =
static_cast<SwWrtShell*
>(pShellItem->GetValue());
465 if( nSlot == SID_STYLE_UPDATE_BY_EXAMPLE && aParam.isEmpty() )
469 case SfxStyleFamily::Para:
476 case SfxStyleFamily::Frame:
483 case SfxStyleFamily::Char:
487 aParam =
pChar->GetName();
490 case SfxStyleFamily::Pseudo:
493 aParam = pExName->GetValue();
496 case SfxStyleFamily::Table:
499 aParam = pExName->GetValue();
507 if (!aParam.isEmpty() || nSlot == SID_STYLE_WATERCAN )
509 sal_uInt16 nRet = 0xffff;
510 bool bReturns =
false;
515 Edit(rReq.
GetFrameWeld(), aParam, {}, nFamily, nMask,
false, {}, pActShell);
517 case SID_STYLE_DELETE:
522 Hide(aParam, nFamily, nSlot == SID_STYLE_HIDE);
524 case SID_STYLE_APPLY:
529 case SID_STYLE_WATERCAN:
530 nRet =
static_cast<sal_uInt16
>(
DoWaterCan(aParam, nFamily));
533 case SID_STYLE_UPDATE_BY_EXAMPLE:
536 case SID_STYLE_NEW_BY_EXAMPLE:
541 OSL_FAIL(
"Invalid SlotId");
577 , m_xTmp(
std::move(xTmp))
579 , m_xBasePool(
std::move(xBasePool))
580 , m_bModified(bModified)
591 bool DocIsModified()
const
608 SwWrtShell* pWrtShell = m_rDocSh.GetWrtShell();
609 SwDoc* pDoc = m_rDocSh.GetDoc();
610 SwView* pView = m_rDocSh.GetView();
614 if( SfxStyleFamily::Para == m_nFamily )
616 SfxItemSet aSet( *m_pDlg->GetOutputItemSet() );
621 m_xTmp->SetItemSet( aSet,
false,
true );
625 if(SfxStyleFamily::Page == m_nFamily || SfxStyleFamily::Frame == m_nFamily)
627 static const sal_uInt16 aInval[] = {
628 SID_IMAGE_ORIENTATION,
635 SfxItemSet aTmpSet( *m_pDlg->GetOutputItemSet() );
636 if( SfxStyleFamily::Char == m_nFamily )
641 m_xTmp->SetItemSet( aTmpSet,
false );
646 if( aTmpSet.
GetItemState( m_rDocSh.GetPool().GetTrueWhich( SID_ATTR_FRAMEDIRECTION,
false ) ,
true, &pItem ) == SfxItemState::SET )
650 if (m_nFamily == SfxStyleFamily::Page)
655 auto it = pGrabBagItem->GetGrabBag().find(
"GutterAtTop");
656 if (it != pGrabBagItem->GetGrabBag().end())
658 it->second >>= bGutterAtTop;
662 if (bOldGutterAtTop != bGutterAtTop)
671 if (m_nFamily == SfxStyleFamily::Frame)
688 if(SfxStyleFamily::Frame == m_nFamily || SfxStyleFamily::Para == m_nFamily)
691 SfxItemSet aTmpSet(*m_pDlg->GetOutputItemSet());
694 m_xTmp->SetItemSet(aTmpSet,
false);
698 if(SfxStyleFamily::Page == m_nFamily)
702 m_xBasePool->Broadcast(
SfxStyleSheetHint(SfxHintId::StyleSheetCreated, *m_xTmp));
704 m_xBasePool->Broadcast(
SfxStyleSheetHint(SfxHintId::StyleSheetModified, *m_xTmp));
720void syncEndnoteOrientation(
const uno::Reference< style::XStyleFamiliesSupplier >& xStyleFamSupp)
722 if (!xStyleFamSupp.is())
724 SAL_WARN(
"sw.ui",
"Ref to XStyleFamiliesSupplier is null.");
727 uno::Reference<container::XNameAccess> xStyleFamilies = xStyleFamSupp->getStyleFamilies();
729 if (!xStyleFamilies.is())
732 uno::Reference<container::XNameAccess> xPageStyles(xStyleFamilies->getByName(
"PageStyles"),
735 if (!xPageStyles.is())
738 uno::Reference<css::style::XStyle> xEndnotePageStyle(xPageStyles->getByName(
"Endnote"),
741 if (!xEndnotePageStyle.is())
745 uno::Reference<css::style::XStyle> xDefaultPageStyle(xPageStyles->getByName(
"Standard"),
747 if (!xDefaultPageStyle.is())
750 if (xEndnotePageStyle->isUserDefined() || !xEndnotePageStyle->isInUse())
753 uno::Reference<beans::XPropertySet> xEndnotePagePropSet(xPageStyles->getByName(
"Endnote"), uno::UNO_QUERY);
754 uno::Reference<beans::XPropertySet> xDefaultPagePropSet(xPageStyles->getByName(
"Standard"), uno::UNO_QUERY);
756 if (!xEndnotePagePropSet.is() || !xDefaultPagePropSet.is())
758 SAL_WARN(
"sw.ui",
"xEndnotePagePropSet or xDefaultPagePropSet is null.");
762 auto const bIsDefLandScape = *o3tl::doAccess<bool>(
763 xDefaultPagePropSet->getPropertyValue(
"IsLandscape"));
764 auto const bIsEndLandScape = *o3tl::doAccess<bool>(
765 xEndnotePagePropSet->getPropertyValue(
"IsLandscape"));
767 if (bIsDefLandScape == bIsEndLandScape)
770 auto const nWidth = xEndnotePagePropSet->getPropertyValue(
"Width");
771 auto const nHeight = xEndnotePagePropSet->getPropertyValue(
"Height");
773 xEndnotePagePropSet->setPropertyValue(
"IsLandscape", css::uno::toAny(bIsDefLandScape));
774 xEndnotePagePropSet->setPropertyValue(
"Width", nHeight);
775 xEndnotePagePropSet->setPropertyValue(
"Height", nWidth);
781 const OUString &rName,
782 const OUString &rParent,
786 const OUString& sPage,
792 const bool bBasic = pReq && pReq->
IsAPI();
795 bool bModified =
m_xDoc->getIDocumentState().IsModified();
808 if( SfxStyleSearchBits::All != nMask && SfxStyleSearchBits::AllVisible != nMask && SfxStyleSearchBits::Used != nMask )
809 nMask |= SfxStyleSearchBits::UserDefined;
811 nMask = SfxStyleSearchBits::UserDefined;
813 if ( nFamily == SfxStyleFamily::Para || nFamily == SfxStyleFamily::Char || nFamily == SfxStyleFamily::Frame )
818 pStyle = &
m_xBasePool->Make( rName, nFamily, nMask );
822 pStyle = &
m_xBasePool->Make( rName, nFamily, nMask );
829 case SfxStyleFamily::Para:
831 if(!rParent.isEmpty())
852 case SfxStyleFamily::Char:
854 if(!rParent.isEmpty())
876 case SfxStyleFamily::Frame :
878 if(!rParent.isEmpty())
905 SAL_WARN_IF( !pStyle,
"sw.ui",
"Style not found" );
913 if( SfxStyleFamily::Para == nFamily )
918 xTmp->MergeIndentAttrsOfListStyle(
rSet );
922 else if( SfxStyleFamily::Char == nFamily )
927 if(SfxStyleFamily::Page == nFamily || SfxStyleFamily::Para == nFamily)
940 std::optional<SfxGrabBagItem> oGrabBag;
943 oGrabBag.emplace(*pItem);
947 oGrabBag.emplace(SID_ATTR_CHAR_GRABBAG);
951 oGrabBag->GetGrabBag()[
"GutterAtTop"] <<= bGutterAtTop;
956 if (nFamily == SfxStyleFamily::Frame)
981 SAL_WARN(
"sw.ui",
"no parent for dialog supplied, assuming document frame is good enough");
985 *xTmp, nFamily, sPage, pCurrShell, bNew));
986 auto pApplyStyleHelper = std::make_shared<ApplyStyle>(*
this, bNew, xTmp, nFamily, pDlg.
get(),
m_xBasePool, bModified);
987 pDlg->SetApplyHdl(
LINK(pApplyStyleHelper.get(), ApplyStyle, ApplyHdl));
989 std::shared_ptr<SfxRequest> pRequest;
992 pRequest = std::make_shared<SfxRequest>(*pReq);
996 bool bIsDefaultPage = nFamily == SfxStyleFamily::Page
997 && rName ==
SwResId(STR_POOLPAGE_STANDARD)
1001 pDlg->StartExecuteAsync([bIsDefaultPage, bNew, nFamily, nSlot, nNewStyleUndoId, pApplyStyleHelper, pRequest, xTmp,
this](sal_Int32 nResult){
1003 pApplyStyleHelper->apply();
1009 case SfxStyleFamily::Para:
1011 if(!xTmp->GetParent().isEmpty())
1013 SwTextFormatColl* pColl = m_pWrtShell->FindTextFormatCollByName(xTmp->GetParent());
1014 if (GetDoc()->GetIDocumentUndoRedo().DoesUndo())
1016 GetDoc()->GetIDocumentUndoRedo().AppendUndo(
1017 std::make_unique<SwUndoTextFormatCollCreate>(xTmp->GetCollection(), pColl, *GetDoc()));
1022 case SfxStyleFamily::Char:
1024 if(!xTmp->GetParent().isEmpty())
1026 SwCharFormat* pCFormat = m_pWrtShell->FindCharFormatByName(xTmp->GetParent());
1027 if (GetDoc()->GetIDocumentUndoRedo().DoesUndo())
1029 GetDoc()->GetIDocumentUndoRedo().AppendUndo(
1030 std::make_unique<SwUndoCharFormatCreate>(xTmp->GetCharFormat(), pCFormat, *GetDoc()));
1035 case SfxStyleFamily::Frame:
1037 if(!xTmp->GetParent().isEmpty())
1039 SwFrameFormat* pFFormat = m_pWrtShell->GetDoc()->FindFrameFormatByName(xTmp->GetParent());
1040 if (GetDoc()->GetIDocumentUndoRedo().DoesUndo())
1042 GetDoc()->GetIDocumentUndoRedo().AppendUndo(
1043 std::make_unique<SwUndoFrameFormatCreate>(xTmp->GetFrameFormat(), pFFormat, *GetDoc()));
1058 bool bDocModified = pApplyStyleHelper->DocIsModified();
1060 if (RET_OK != nResult)
1064 GetWrtShell()->Undo();
1065 m_xDoc->GetIDocumentUndoRedo().ClearRedo();
1069 m_xDoc->getIDocumentState().ResetModified();
1073 if (nSlot == SID_STYLE_NEW && nFamily == SfxStyleFamily::Page)
1080 pApplyStyleHelper->m_pDlg.disposeAndClear();
1084 if (bIsDefaultPage && bDocModified)
1086 uno::Reference< style::XStyleFamiliesSupplier > xStyleFamSupp(GetModel(), uno::UNO_QUERY);
1088 if (!xStyleFamSupp.is())
1090 SAL_WARN(
"sw.ui",
"Ref to XStyleFamiliesSupplier is null.");
1094 syncEndnoteOrientation(xStyleFamSupp);
1103 GetWrtShell()->StartAllAction();
1105 if( SfxStyleFamily::Para == nFamily )
1114 if(SfxStyleFamily::Page == nFamily)
1115 m_pView->InvalidateRulerPos();
1120 m_xDoc->getIDocumentState().SetModified();
1123 m_xDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
1125 GetWrtShell()->EndAllAction();
1153 xTmp->SetHidden( bHidden );
1164 SAL_WARN_IF( !pStyle,
"sw.ui",
"Style not found" );
1167 return SfxStyleFamily::None;
1177 case SfxStyleFamily::Char:
1184 case SfxStyleFamily::Para:
1204 case SfxStyleFamily::Frame:
1210 case SfxStyleFamily::Page:
1215 case SfxStyleFamily::Pseudo:
1227 pSh->
SetCurNumRule( *pNumRule,
false, sListIdForStyle,
true );
1230 case SfxStyleFamily::Table:
1236 OSL_FAIL(
"Unknown family");
1252 if( rName.isEmpty() )
1256 aTemplate.
eType = nFamily;
1263 SAL_WARN_IF( !pStyle,
"sw.ui",
"Where's the StyleSheet" );
1265 if(!pStyle)
return nFamily;
1269 case SfxStyleFamily::Char:
1272 case SfxStyleFamily::Para:
1275 case SfxStyleFamily::Frame:
1278 case SfxStyleFamily::Page:
1281 case SfxStyleFamily::Pseudo:
1286 OSL_FAIL(
"Unknown family");
1301 assert( pCurrWrtShell );
1311 case SfxStyleFamily::Para:
1330 case SfxStyleFamily::Frame:
1351 case SfxStyleFamily::Char:
1364 case SfxStyleFamily::Pseudo:
1378 case SfxStyleFamily::Table:
1382 if(pFEShell->IsTableMode())
1384 pFEShell->TableCursorToCursor();
1400 m_xDoc->BroadcastStyleOperation(rName, nFamily, SfxHintId::StyleSheetModified);
1414 if( SfxStyleSearchBits::All == nMask || SfxStyleSearchBits::Used == nMask )
1415 nMask = SfxStyleSearchBits::UserDefined;
1417 nMask |= SfxStyleSearchBits::UserDefined;
1419 if (nFamily == SfxStyleFamily::Para || nFamily == SfxStyleFamily::Char || nFamily == SfxStyleFamily::Frame)
1433 case SfxStyleFamily::Para:
1448 case SfxStyleSearchBits::SwText:
1451 case SfxStyleSearchBits::SwChapter:
1454 case SfxStyleSearchBits::SwList:
1457 case SfxStyleSearchBits::SwIndex:
1460 case SfxStyleSearchBits::SwExtra:
1463 case SfxStyleSearchBits::SwHtml:
1473 std::make_unique<SwUndoTextFormatCollCreate>(pColl, pDerivedFrom, *
GetDoc()));
1480 case SfxStyleFamily::Frame:
1494 if (
GetDoc()->GetIDocumentUndoRedo().DoesUndo())
1497 std::make_unique<SwUndoFrameFormatCreate>(pFrame, pFFormat, *
GetDoc()));
1505 case SfxStyleFamily::Char:
1513 pChar->SetDerivedFrom( pDerivedFrom );
1516 if (
GetDoc()->GetIDocumentUndoRedo().DoesUndo())
1521 std::make_unique<SwUndoCharFormatCreate>(
1522 pChar, pDerivedFrom ? pDerivedFrom :
GetDoc()->GetDfltCharFormat(),
1531 case SfxStyleFamily::Page:
1556 case SfxStyleFamily::Pseudo:
1565 OUString sOrigRule( aRule.
GetName() );
1578 case SfxStyleFamily::Table:
1595 m_xDoc->BroadcastStyleOperation(rName, nFamily, SfxHintId::StyleSheetCreated);
1600#if !ENABLE_WASM_STRIP_ACCESSIBILITY
1611 return m_xDoc->GetDocColors();
1616 SdrPage* pPage =
m_xDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
1622 return pTheme->getColorSet();
1647 if(
dynamic_cast<const SwDocShell*
>( &rSource) !=
nullptr)
1652 if(!bPreserveCurrentDocument)
1653 static_cast<SwDocShell&
>(rSource).
m_xDoc->getIDocumentFieldsAccess().SetFixFields(
nullptr);
1667 bool bModified =
m_xDoc->getIDocumentState().IsModified();
1669 if (!bModified &&
m_xDoc->getIDocumentState().IsModified() && !
m_pView)
1673 m_xDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
1683 const OUString& rPage,
1684 const OUString& rPageId,
1688 Edit(pDialogParent, rPage, OUString(), SfxStyleFamily::Page, SfxStyleSearchBits::Auto,
false, rPageId, &rActShell, pRequest);
sal_uInt16 GetValue() const
const OUString & GetValue() const
virtual SfxPrinter * getPrinter(bool bCreate) const =0
Return the printer set at the document.
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
virtual void set(DocumentSettingId id, bool value)=0
Set the specified document setting.
virtual void SetModified()=0
Must be called manually at changes of format.
void SetStyleSheet(const OUString &rStyleName)
const SfxStyleSheet * GetStyleSheet() const
XBitmapListRef GetBitmapList() const
XGradientListRef GetGradientList() const
XPatternListRef GetPatternList() const
XColorListRef GetColorList() const
XHatchListRef GetHatchList() const
std::shared_ptr< model::Theme > const & GetTheme() const
SdrPageProperties & getSdrPageProperties()
SfxItemState QueryState(sal_uInt16 nSID, std::unique_ptr< SfxPoolItem > &rpState)
void Invalidate(sal_uInt16 nId)
void InvalidateAll(bool bWithMsg)
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
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 * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void DisableItem(sal_uInt16 nWhich)
void InvalidateItem(sal_uInt16 nWhich)
css::uno::Reference< css::frame::XModel3 > GetModel() const
virtual void LoadStyles(SfxObjectShell &rSource)
sal_uInt16 GetSlot() const
const SfxItemSet * GetArgs() const
const T * GetArg(sal_uInt16 nSlotId) const
void AppendItem(const SfxPoolItem &)
void SetReturnValue(const SfxPoolItem &)
sal_uInt16 GetModifier() const
weld::Window * GetFrameWeld() const
void Done(bool bRemove=false)
void PutItem(const SfxPoolItem &rItem)
SfxItemPool & GetPool() const
static OUString GenerateUnusedName(SfxStyleSheetBasePool &rPool, SfxStyleFamily eFam)
const OUString & GetName() const
bool IsUserDefined() const
virtual bool IsUsed() const
void SetValue(SfxStyleSearchBits n)
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
SfxBindings & GetBindings()
SfxDispatcher * GetDispatcher()
weld::Window * GetFrameWeld() const
SfxViewFrame & GetViewFrame() const
static bool IsCTLFontEnabled()
virtual VclPtr< SfxAbstractApplyTabDialog > CreateTemplateDialog(weld::Window *pParent, SfxStyleSheetBase &rBase, SfxStyleFamily nRegion, const OUString &sPage, SwWrtShell *pActShell, bool bNew)=0
static SwAbstractDialogFactory * Create()
static void DoUpdateAllCharts(SwDoc *pDoc)
const SwTableNode * IsCursorInTable() const
Check if Point of current cursor is placed within a table.
rtl::Reference< SwDoc > m_xDoc
Document.
rtl::Reference< SfxStyleSheetBasePool > m_xBasePool
Passing through for formats.
virtual std::set< Color > GetDocColors() override
SAL_DLLPRIVATE void Edit(weld::Window *pDialogParent, const OUString &rName, const OUString &rParent, const SfxStyleFamily nFamily, SfxStyleSearchBits nMask, const bool bNew, const OUString &sPageId, SwWrtShell *pActShell, SfxRequest *pRequest=nullptr, sal_uInt16 nSlot=0)
Methods for StyleSheets.
SwFEShell * GetFEShell()
For Core - it knows the DocShell but not the WrtShell!
void LoadStyles_(SfxObjectShell &rSource, bool bPreserveCurrentDocument)
void StateStyleSheet(SfxItemSet &, SwWrtShell *pSh=nullptr)
SAL_DLLPRIVATE void MakeByExample(const OUString &rName, SfxStyleFamily nFamily, SfxStyleSearchBits nMask, SwWrtShell *pShell)
void FormatPage(weld::Window *pDialogParent, const OUString &rPage, const OUString &rPageId, SwWrtShell &rActShell, SfxRequest *pRequest=nullptr)
Show page style format dialog.
SAL_DLLPRIVATE void Delete(const OUString &rName, SfxStyleFamily nFamily)
virtual std::shared_ptr< model::ColorSet > GetThemeColors() override
const SwView * GetView() const
SAL_DLLPRIVATE void UpdateStyle(const OUString &rName, SfxStyleFamily nFamily, SwWrtShell *pShell)
SwWrtShell * GetWrtShell()
Access to the SwWrtShell belonging to SwView.
SAL_DLLPRIVATE void Hide(const OUString &rName, SfxStyleFamily nFamily, bool bHidden)
SwView * m_pView
For "historical reasons" nothing can be done without the WrtShell.
virtual SfxStyleSheetBasePool * GetStyleSheetPool() override
For Style PI.
virtual void LoadStyles(SfxObjectShell &rSource) override
void ExecStyleSheet(SfxRequest &)
SAL_DLLPRIVATE SfxStyleFamily DoWaterCan(const OUString &rName, SfxStyleFamily nFamily)
sfx::AccessibilityIssueCollection runAccessibilityCheck() override
SwDoc * GetDoc()
returns Doc. But be careful!
SAL_DLLPRIVATE SfxStyleFamily ApplyStyles(const OUString &rName, const SfxStyleFamily nFamily, SwWrtShell *pShell, sal_uInt16 nMode)
const SwNumRule * GetNumRule()
SwFrameFormat * GetFrameFormat()
void PresetParent(const OUString &rName)
SwCharFormat * GetCharFormat()
SwTextFormatColl * GetCollection()
SwTableAutoFormat * GetTableFormat()
const SwPageDesc * GetPageDesc()
void CopyPageDesc(const SwPageDesc &rSrcDesc, SwPageDesc &rDstDesc, bool bCopyPoolIds=true)
Copy the complete PageDesc - beyond document and "deep"! Optionally copying of PoolFormatId,...
void ChgTableStyle(const OUString &rName, const SwTableAutoFormat &rNewFormat)
IDocumentState const & getIDocumentState() const
IDocumentUndoRedo & GetIDocumentUndoRedo()
IDocumentSettingAccess const & getIDocumentSettingAccess() const
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
IDocumentListsAccess const & getIDocumentListsAccess() const
SwFrameFormat * FindFrameFormatByName(const OUString &rName) const
const SwTOXBase * GetCurTOX() const
Get current listing before or at the Cursor.
void StartAllAction()
For all views of this document.
void SetWatermark(const SfxWatermarkItem &rText)
SwCharFormat * GetCurCharFormat() const
SwCharFormat * GetCharFormatFromPool(sal_uInt16 nId)
void ReplaceNumRule(const OUString &rOldRule, const OUString &rNewRule)
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)
SwCharFormat * FindCharFormatByName(const OUString &rName) const
bool GetLastUndoInfo(OUString *const o_pStr, SwUndoId *const o_pId, const SwView *pView=nullptr) const
void SetTextFormatColl(SwTextFormatColl *, const bool bResetListAttrs=false)
Add 2nd optional parameter <bResetListAttrs> - see also <SwDoc::SetTextFormatColl(....
void SetCurNumRule(const SwNumRule &, const bool bCreateNewList, const OUString &sContinuedListId=OUString(), const bool bResetIndentAttrs=false)
Optional parameter <bResetIndentAttrs> (default value false).
SwTextFormatColl * FindTextFormatCollByName(const OUString &rName) const
SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId)
const SwNumRule * GetNumRuleAtCurrCursorPos() const
SwFrameFormat * GetFrameFormatFromPool(sal_uInt16 nId)
void ChgNumRuleFormats(const SwNumRule &rRule)
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
SfxWatermarkItem GetWatermark() const
SwTextFormatColl * GetCurTextFormatColl() const
Get the named paragraph format of the current selection.
void FillByEx(SwCharFormat *)
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
void SetApplyTemplate(const SwApplyTemplate &)
Apply template.
SwApplyTemplate * GetApplyTemplate() const
FrameTypeFlags GetFrameType(const Point *pPt, bool bStopAtFly) const
For return values see above FrameType.
void SetFrameFormat(SwFrameFormat *pFormat, bool bKeepOrient=false, Point const *pDocPos=nullptr)
If frame then set frame style.
bool IsFrameSelected() const
void SetTableStyle(const OUString &rStyleName)
Set table style of the current table.
SwFrameFormat * GetSelectedFrameFormat() const
If frame then frame style, else 0.
size_t GetCurPageDesc(const bool bCalcFrame=true) const
bool GetTableAutoFormat(SwTableAutoFormat &rGet)
bool GetFlyFrameAttr(SfxItemSet &rSet) const
const SwPageDesc & GetPageDesc(size_t i) const
void SetName(const OUString &rNm, IDocumentListsAccess &rDocListAccess)
const OUString & GetDefaultListId() const
const OUString & GetName() const
sal_uInt16 GetPoolFormatId() const
Query and set PoolFormat-Id.
sal_uInt16 GetPoolHelpId() const
const OUString & GetName() const
void SetPoolHlpFileId(sal_uInt8 const nId)
sal_uInt8 GetPoolHlpFileId() const
void SetPoolFormatId(sal_uInt16 const nId)
void SetPoolHelpId(sal_uInt16 const nId)
sw::annotation::SwAnnotationWin * GetActiveSidebarWin()
SW_DLLPUBLIC bool HasActiveSidebarWin() const
void AddRule(SwUndoArg eWhat, const OUString &rWith)
static SW_DLLPUBLIC sal_uInt16 GetPoolIdFromUIName(const OUString &rName, SwGetPoolIdFromName)
static const OUString & GetProgName(const OUString &rName, SwGetPoolIdFromName)
static void FillProgName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
const SwTable & GetTable() const
const OUString & GetTableStyleName() const
Return the table style name of this table.
Represents the style of a paragraph.
void SetKeepRatio(bool b)
const SwViewOption * GetViewOptions() const
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
void InvalidateLayout(bool bSizeChanged)
const SwPostItMgr * GetPostItMgr() const
void InitPrt(OutputDevice *pOutDev)
void InvalidateRulerPos()
Used by the UI to modify the document model.
SelectionType GetSelectionType() const
void SetPageStyle(const OUString &rCollName)
const SwView & GetView() const
reference_type * get() const
AccessibilityIssueCollection & getIssueCollection()
OutlinerView * GetOutlinerView()
#define FN_NUM_BULLET_OFF
#define FN_INSERT_OBJ_CTRL
#define FN_TABLE_INSERT_COL_BEFORE
#define FN_KEEP_ASPECT_RATIO
#define FN_PARAM_WRTSHELL
#define FN_TABLE_INSERT_COL_AFTER
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
DECL_LINK(CheckNameHdl, SvxNameDialog &, bool)
IMPL_LINK_NOARG(ApplyStyle, ApplyHdl, LinkParamNone *, void)
FrameTypeFlags
values can be combined via logical or
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(110)
WhichRangesContainer const aFrameFormatSetRange(svl::Items< RES_FRMATR_BEGIN, RES_FRMATR_END-1, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, XATTR_FILL_FIRST, XATTR_FILL_LAST >)
constexpr sal_uInt16 KEY_SHIFT
#define LINK(Instance, Class, Member)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
if(aStr !=aBuf) UpdateName_Impl(m_xFollowLb.get()
bool IsPrintLayoutExtension()
SwFormatColl * GetCurTextFormatColl(SwPaM &rPam, const bool bConditional)
const sal_uInt16 COLL_DOC_BITS
const sal_uInt16 COLL_REGISTER_BITS
const sal_uInt16 COLL_TEXT_BITS
const sal_uInt16 COLL_HTML_BITS
const sal_uInt16 COLL_LISTS_BITS
const sal_uInt16 COLL_EXTRA_BITS
SwCharFormat * pCharFormat
SwTextFormatColl * pTextColl
union SwApplyTemplate::@29 aColl
SwFrameFormat * pFrameFormat
Reference< XModel > xModel
OUString SwResId(TranslateId aId)
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)