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>
83#include <AccessibilityCheck.hxx>
108 std::unique_ptr<SfxUInt16Item> pFamilyItem;
112 nActualFamily =
static_cast<SfxStyleFamily>(pFamilyItem->GetValue());
123 case SID_STYLE_APPLY:
141 case SID_STYLE_FAMILY1:
153 case SID_STYLE_FAMILY2:
169 nMask = SfxStyleSearchBits::SwHtml;
174 nMask = SfxStyleSearchBits::SwIndex ;
181 nMask = SfxStyleSearchBits::SwExtra;
183 nMask = SfxStyleSearchBits::SwText;
192 case SID_STYLE_FAMILY3:
207 case SID_STYLE_FAMILY4:
214 if( n < pShell->GetPageDescCnt() )
221 case SID_STYLE_FAMILY5:
230 case SID_STYLE_FAMILY6:
240 case SID_STYLE_WATERCAN:
247 case SID_STYLE_UPDATE_BY_EXAMPLE:
249 ? SfxStyleFamily::Frame != nActualFamily
250 : ( SfxStyleFamily::Frame == nActualFamily ||
251 SfxStyleFamily::Page == nActualFamily ||
253 (SfxStyleFamily::Table == nActualFamily && !pShell->
GetTableAutoFormat(aTableAutoFormat))) )
259 case SID_STYLE_NEW_BY_EXAMPLE:
261 ? SfxStyleFamily::Frame != nActualFamily
262 : SfxStyleFamily::Frame == nActualFamily) ||
264 (SfxStyleFamily::Table == nActualFamily && !pShell->
GetTableAutoFormat(aTableAutoFormat)) )
270 case SID_CLASSIFICATION_APPLY:
274 case SID_CLASSIFICATION_DIALOG:
287 OSL_FAIL(
"Invalid SlotId");
296 sal_uInt16 nSlot = rReq.
GetSlot();
303 if( pArgs && SfxItemState::SET == pArgs->
GetItemState( SID_STYLE_FAMILY,
310 if( SfxItemState::SET == pArgs->
GetItemState( SID_STYLE_NEW,
313 if( SfxItemState::SET == pArgs->
GetItemState( SID_STYLE_MASK,
317 if( SfxItemState::SET == pArgs->
GetItemState( SID_STYLE_REFERENCE,
328 case SID_STYLE_APPLY:
339 if ( pFamilyItem && pNameItem )
341 uno::Reference< style::XStyleFamiliesSupplier >
xModel(
GetModel(), uno::UNO_QUERY);
344 uno::Reference< container::XNameAccess > xStyles;
345 uno::Reference< container::XNameAccess > xCont =
xModel->getStyleFamilies();
346 xCont->getByName(pFamilyItem->GetValue()) >>= xStyles;
347 uno::Reference< beans::XPropertySet > xInfo;
348 xStyles->getByName( pNameItem->
GetValue() ) >>= xInfo;
350 xInfo->getPropertyValue(
"DisplayName") >>=
aUIName;
354 catch (
const uno::Exception&)
363 case SID_STYLE_DELETE:
366 case SID_STYLE_WATERCAN:
367 case SID_STYLE_FAMILY:
368 case SID_STYLE_UPDATE_BY_EXAMPLE:
369 case SID_STYLE_NEW_BY_EXAMPLE:
380 case SID_STYLE_NEW_BY_EXAMPLE:
392 case SID_STYLE_UPDATE_BY_EXAMPLE:
410 if( SfxItemState::SET == pArgs->
GetItemState(nSlot,
false, &pItem ))
413 if( SfxItemState::SET == pArgs->
GetItemState(SID_STYLE_FAMILY,
417 if( SfxItemState::SET == pArgs->
GetItemState(SID_STYLE_FAMILYNAME,
false, &pItem ))
420 if(aFamily ==
"CharacterStyles")
421 nFamily = SfxStyleFamily::Char;
423 if(aFamily ==
"ParagraphStyles")
424 nFamily = SfxStyleFamily::Para;
426 if(aFamily ==
"PageStyles")
427 nFamily = SfxStyleFamily::Page;
429 if(aFamily ==
"FrameStyles")
430 nFamily = SfxStyleFamily::Frame;
432 if(aFamily ==
"NumberingStyles")
433 nFamily = SfxStyleFamily::Pseudo;
435 if(aFamily ==
"TableStyles")
436 nFamily = SfxStyleFamily::Table;
439 if( SfxItemState::SET == pArgs->
GetItemState(SID_STYLE_MASK,
443 pActShell = pShell =
static_cast<SwWrtShell*
>(pShellItem->GetValue());
445 if( nSlot == SID_STYLE_UPDATE_BY_EXAMPLE && aParam.isEmpty() )
449 case SfxStyleFamily::Para:
456 case SfxStyleFamily::Frame:
463 case SfxStyleFamily::Char:
467 aParam =
pChar->GetName();
470 case SfxStyleFamily::Pseudo:
473 aParam = pExName->GetValue();
476 case SfxStyleFamily::Table:
479 aParam = pExName->GetValue();
487 if (!aParam.isEmpty() || nSlot == SID_STYLE_WATERCAN )
489 sal_uInt16 nRet = 0xffff;
490 bool bReturns =
false;
495 Edit(rReq.
GetFrameWeld(), aParam, {}, nFamily, nMask,
false, {}, pActShell);
497 case SID_STYLE_DELETE:
502 Hide(aParam, nFamily, nSlot == SID_STYLE_HIDE);
504 case SID_STYLE_APPLY:
509 case SID_STYLE_WATERCAN:
510 nRet =
static_cast<sal_uInt16
>(
DoWaterCan(aParam, nFamily));
513 case SID_STYLE_UPDATE_BY_EXAMPLE:
516 case SID_STYLE_NEW_BY_EXAMPLE:
521 OSL_FAIL(
"Invalid SlotId");
553 , m_xTmp(
std::move(xTmp))
555 , m_xBasePool(
std::move(xBasePool))
556 , m_bModified(bModified)
567 bool DocIsModified()
const
584 SwWrtShell* pWrtShell = m_rDocSh.GetWrtShell();
585 SwDoc* pDoc = m_rDocSh.GetDoc();
586 SwView* pView = m_rDocSh.GetView();
590 if( SfxStyleFamily::Para == m_nFamily )
592 SfxItemSet aSet( *m_pDlg->GetOutputItemSet() );
597 m_xTmp->SetItemSet( aSet,
true );
601 if(SfxStyleFamily::Page == m_nFamily || SfxStyleFamily::Frame == m_nFamily)
603 static const sal_uInt16 aInval[] = {
604 SID_IMAGE_ORIENTATION,
611 SfxItemSet aTmpSet( *m_pDlg->GetOutputItemSet() );
612 if( SfxStyleFamily::Char == m_nFamily )
617 m_xTmp->SetItemSet( aTmpSet );
619 if( SfxStyleFamily::Page == m_nFamily &&
SvtCTLOptions().IsCTLFontEnabled() )
622 if( aTmpSet.
GetItemState( m_rDocSh.GetPool().GetTrueWhich( SID_ATTR_FRAMEDIRECTION,
false ) ,
true, &pItem ) == SfxItemState::SET )
626 if (m_nFamily == SfxStyleFamily::Page)
631 auto it = pGrabBagItem->GetGrabBag().find(
"GutterAtTop");
632 if (it != pGrabBagItem->GetGrabBag().end())
634 it->second >>= bGutterAtTop;
638 if (bOldGutterAtTop != bGutterAtTop)
647 if (m_nFamily == SfxStyleFamily::Frame)
664 if(SfxStyleFamily::Frame == m_nFamily || SfxStyleFamily::Para == m_nFamily)
667 SfxItemSet aTmpSet(*m_pDlg->GetOutputItemSet());
670 m_xTmp->SetItemSet(aTmpSet);
674 if(SfxStyleFamily::Page == m_nFamily)
678 m_xBasePool->Broadcast(
SfxStyleSheetHint(SfxHintId::StyleSheetCreated, *m_xTmp));
680 m_xBasePool->Broadcast(
SfxStyleSheetHint(SfxHintId::StyleSheetModified, *m_xTmp));
696void syncEndnoteOrientation(
const uno::Reference< style::XStyleFamiliesSupplier >& xStyleFamSupp)
698 if (!xStyleFamSupp.is())
700 SAL_WARN(
"sw.ui",
"Ref to XStyleFamiliesSupplier is null.");
703 uno::Reference<container::XNameAccess> xStyleFamilies = xStyleFamSupp->getStyleFamilies();
705 if (!xStyleFamilies.is())
708 uno::Reference<container::XNameAccess> xPageStyles(xStyleFamilies->getByName(
"PageStyles"),
711 if (!xPageStyles.is())
714 uno::Reference<css::style::XStyle> xEndnotePageStyle(xPageStyles->getByName(
"Endnote"),
717 if (!xEndnotePageStyle.is())
721 uno::Reference<css::style::XStyle> xDefaultPageStyle(xPageStyles->getByName(
"Standard"),
723 if (!xDefaultPageStyle.is())
726 if (xEndnotePageStyle->isUserDefined() || !xEndnotePageStyle->isInUse())
729 uno::Reference<beans::XPropertySet> xEndnotePagePropSet(xPageStyles->getByName(
"Endnote"), uno::UNO_QUERY);
730 uno::Reference<beans::XPropertySet> xDefaultPagePropSet(xPageStyles->getByName(
"Standard"), uno::UNO_QUERY);
732 if (!xEndnotePagePropSet.is() || !xDefaultPagePropSet.is())
734 SAL_WARN(
"sw.ui",
"xEndnotePagePropSet or xDefaultPagePropSet is null.");
738 auto const bIsDefLandScape = *o3tl::doAccess<bool>(
739 xDefaultPagePropSet->getPropertyValue(
"IsLandscape"));
740 auto const bIsEndLandScape = *o3tl::doAccess<bool>(
741 xEndnotePagePropSet->getPropertyValue(
"IsLandscape"));
743 if (bIsDefLandScape == bIsEndLandScape)
746 auto const nWidth = xEndnotePagePropSet->getPropertyValue(
"Width");
747 auto const nHeight = xEndnotePagePropSet->getPropertyValue(
"Height");
749 xEndnotePagePropSet->setPropertyValue(
"IsLandscape", css::uno::toAny(bIsDefLandScape));
750 xEndnotePagePropSet->setPropertyValue(
"Width", nHeight);
751 xEndnotePagePropSet->setPropertyValue(
"Height", nWidth);
757 const OUString &rName,
758 const OUString &rParent,
762 const OUString& sPage,
768 const bool bBasic = pReq && pReq->
IsAPI();
771 bool bModified =
m_xDoc->getIDocumentState().IsModified();
784 if( SfxStyleSearchBits::All != nMask && SfxStyleSearchBits::AllVisible != nMask && SfxStyleSearchBits::Used != nMask )
785 nMask |= SfxStyleSearchBits::UserDefined;
787 nMask = SfxStyleSearchBits::UserDefined;
789 if ( nFamily == SfxStyleFamily::Para || nFamily == SfxStyleFamily::Char || nFamily == SfxStyleFamily::Frame )
794 pStyle = &
m_xBasePool->Make( rName, nFamily, nMask );
798 pStyle = &
m_xBasePool->Make( rName, nFamily, nMask );
805 case SfxStyleFamily::Para:
807 if(!rParent.isEmpty())
828 case SfxStyleFamily::Char:
830 if(!rParent.isEmpty())
852 case SfxStyleFamily::Frame :
854 if(!rParent.isEmpty())
881 SAL_WARN_IF( !pStyle,
"sw.ui",
"Style not found" );
889 if( SfxStyleFamily::Para == nFamily )
894 xTmp->MergeIndentAttrsOfListStyle(
rSet );
898 else if( SfxStyleFamily::Char == nFamily )
903 if(SfxStyleFamily::Page == nFamily || SfxStyleFamily::Para == nFamily)
916 std::optional<SfxGrabBagItem> oGrabBag;
919 oGrabBag.emplace(*pItem);
923 oGrabBag.emplace(SID_ATTR_CHAR_GRABBAG);
927 oGrabBag->GetGrabBag()[
"GutterAtTop"] <<= bGutterAtTop;
932 if (nFamily == SfxStyleFamily::Frame)
957 SAL_WARN(
"sw.ui",
"no parent for dialog supplied, assuming document frame is good enough");
961 *xTmp, nFamily, sPage, pCurrShell, bNew));
962 auto pApplyStyleHelper = std::make_shared<ApplyStyle>(*
this, bNew, xTmp, nFamily, pDlg.
get(),
m_xBasePool, bModified);
963 pDlg->SetApplyHdl(
LINK(pApplyStyleHelper.get(), ApplyStyle, ApplyHdl));
965 std::shared_ptr<SfxRequest> pRequest;
968 pRequest = std::make_shared<SfxRequest>(*pReq);
972 bool bIsDefaultPage = nFamily == SfxStyleFamily::Page
973 && rName ==
SwResId(STR_POOLPAGE_STANDARD)
977 pDlg->StartExecuteAsync([bIsDefaultPage, bNew, nFamily, nSlot, nNewStyleUndoId, pApplyStyleHelper, pRequest, xTmp,
this](sal_Int32 nResult){
979 pApplyStyleHelper->apply();
985 case SfxStyleFamily::Para:
987 if(!xTmp->GetParent().isEmpty())
989 SwTextFormatColl* pColl = m_pWrtShell->FindTextFormatCollByName(xTmp->GetParent());
990 if (GetDoc()->GetIDocumentUndoRedo().DoesUndo())
992 GetDoc()->GetIDocumentUndoRedo().AppendUndo(
993 std::make_unique<SwUndoTextFormatCollCreate>(xTmp->GetCollection(), pColl, *GetDoc()));
998 case SfxStyleFamily::Char:
1000 if(!xTmp->GetParent().isEmpty())
1002 SwCharFormat* pCFormat = m_pWrtShell->FindCharFormatByName(xTmp->GetParent());
1003 if (GetDoc()->GetIDocumentUndoRedo().DoesUndo())
1005 GetDoc()->GetIDocumentUndoRedo().AppendUndo(
1006 std::make_unique<SwUndoCharFormatCreate>(xTmp->GetCharFormat(), pCFormat, *GetDoc()));
1011 case SfxStyleFamily::Frame:
1013 if(!xTmp->GetParent().isEmpty())
1015 SwFrameFormat* pFFormat = m_pWrtShell->GetDoc()->FindFrameFormatByName(xTmp->GetParent());
1016 if (GetDoc()->GetIDocumentUndoRedo().DoesUndo())
1018 GetDoc()->GetIDocumentUndoRedo().AppendUndo(
1019 std::make_unique<SwUndoFrameFormatCreate>(xTmp->GetFrameFormat(), pFFormat, *GetDoc()));
1034 bool bDocModified = pApplyStyleHelper->DocIsModified();
1036 if (RET_OK != nResult)
1040 GetWrtShell()->Undo();
1041 m_xDoc->GetIDocumentUndoRedo().ClearRedo();
1045 m_xDoc->getIDocumentState().ResetModified();
1049 if (nSlot == SID_STYLE_NEW && nFamily == SfxStyleFamily::Page)
1056 pApplyStyleHelper->m_pDlg.disposeAndClear();
1060 if (bIsDefaultPage && bDocModified)
1062 uno::Reference< style::XStyleFamiliesSupplier > xStyleFamSupp(GetModel(), uno::UNO_QUERY);
1064 if (!xStyleFamSupp.is())
1066 SAL_WARN(
"sw.ui",
"Ref to XStyleFamiliesSupplier is null.");
1070 syncEndnoteOrientation(xStyleFamSupp);
1079 GetWrtShell()->StartAllAction();
1081 if( SfxStyleFamily::Para == nFamily )
1090 if(SfxStyleFamily::Page == nFamily)
1091 m_pView->InvalidateRulerPos();
1096 m_xDoc->getIDocumentState().SetModified();
1099 m_xDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
1101 GetWrtShell()->EndAllAction();
1129 xTmp->SetHidden( bHidden );
1140 SAL_WARN_IF( !pStyle,
"sw.ui",
"Style not found" );
1143 return SfxStyleFamily::None;
1153 case SfxStyleFamily::Char:
1160 case SfxStyleFamily::Para:
1173 case SfxStyleFamily::Frame:
1179 case SfxStyleFamily::Page:
1184 case SfxStyleFamily::Pseudo:
1196 pSh->
SetCurNumRule( *pNumRule,
false, sListIdForStyle,
true );
1199 case SfxStyleFamily::Table:
1205 OSL_FAIL(
"Unknown family");
1221 if( rName.isEmpty() )
1225 aTemplate.
eType = nFamily;
1232 SAL_WARN_IF( !pStyle,
"sw.ui",
"Where's the StyleSheet" );
1234 if(!pStyle)
return nFamily;
1238 case SfxStyleFamily::Char:
1241 case SfxStyleFamily::Para:
1244 case SfxStyleFamily::Frame:
1247 case SfxStyleFamily::Page:
1250 case SfxStyleFamily::Pseudo:
1255 OSL_FAIL(
"Unknown family");
1270 assert( pCurrWrtShell );
1280 case SfxStyleFamily::Para:
1299 case SfxStyleFamily::Frame:
1320 case SfxStyleFamily::Char:
1333 case SfxStyleFamily::Pseudo:
1347 case SfxStyleFamily::Table:
1351 if(pFEShell->IsTableMode())
1353 pFEShell->TableCursorToCursor();
1369 m_xDoc->BroadcastStyleOperation(rName, nFamily, SfxHintId::StyleSheetModified);
1383 if( SfxStyleSearchBits::All == nMask || SfxStyleSearchBits::Used == nMask )
1384 nMask = SfxStyleSearchBits::UserDefined;
1386 nMask |= SfxStyleSearchBits::UserDefined;
1388 if (nFamily == SfxStyleFamily::Para || nFamily == SfxStyleFamily::Char || nFamily == SfxStyleFamily::Frame)
1402 case SfxStyleFamily::Para:
1417 case SfxStyleSearchBits::SwText:
1420 case SfxStyleSearchBits::SwChapter:
1423 case SfxStyleSearchBits::SwList:
1426 case SfxStyleSearchBits::SwIndex:
1429 case SfxStyleSearchBits::SwExtra:
1432 case SfxStyleSearchBits::SwHtml:
1442 std::make_unique<SwUndoTextFormatCollCreate>(pColl, pDerivedFrom, *
GetDoc()));
1449 case SfxStyleFamily::Frame:
1463 if (
GetDoc()->GetIDocumentUndoRedo().DoesUndo())
1466 std::make_unique<SwUndoFrameFormatCreate>(pFrame, pFFormat, *
GetDoc()));
1474 case SfxStyleFamily::Char:
1482 pChar->SetDerivedFrom( pDerivedFrom );
1485 if (
GetDoc()->GetIDocumentUndoRedo().DoesUndo())
1490 std::make_unique<SwUndoCharFormatCreate>(
1491 pChar, pDerivedFrom ? pDerivedFrom :
GetDoc()->GetDfltCharFormat(),
1500 case SfxStyleFamily::Page:
1525 case SfxStyleFamily::Pseudo:
1534 OUString sOrigRule( aRule.
GetName() );
1547 case SfxStyleFamily::Table:
1564 m_xDoc->BroadcastStyleOperation(rName, nFamily, SfxHintId::StyleSheetCreated);
1569#if !ENABLE_WASM_STRIP_ACCESSIBILITY
1580 return m_xDoc->GetDocColors();
1585 SdrPage* pPage =
m_xDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
1591 return pTheme->GetColors();
1616 if(
dynamic_cast<const SwDocShell*
>( &rSource) !=
nullptr)
1621 if(!bPreserveCurrentDocument)
1622 static_cast<SwDocShell&
>(rSource).
m_xDoc->getIDocumentFieldsAccess().SetFixFields(
nullptr);
1636 bool bModified =
m_xDoc->getIDocumentState().IsModified();
1638 if (!bModified &&
m_xDoc->getIDocumentState().IsModified() && !
m_pView)
1642 m_xDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
1652 const OUString& rPage,
1653 const OUString& rPageId,
1657 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.
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)
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
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.
virtual std::vector< Color > GetThemeColors() override
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)
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)
void AddRule(SwUndoArg eWhat, const OUString &rWith)
static SW_DLLPUBLIC sal_uInt16 GetPoolIdFromUIName(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)
void InitPrt(OutputDevice *pOutDev)
void InvalidateRulerPos()
Used by the UI to modify the document model.
void SetPageStyle(const OUString &rCollName)
const SwView & GetView() const
reference_type * get() const
AccessibilityIssueCollection & getIssueCollection()
#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()
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)