11#include <ThemeColorChanger.hxx>
30#include <com/sun/star/text/XTextRange.hpp>
31#include <com/sun/star/container/XEnumerationAccess.hpp>
32#include <com/sun/star/container/XEnumeration.hpp>
33#include <com/sun/star/beans/XPropertySet.hpp>
53 : mrDocument(rDocument)
54 , mrColorSet(rColorSet)
65 for (
size_t i = 0;
i < rHints.
Count(); ++
i)
71 std::shared_ptr<SfxItemSet> pStyleHandle(rAutoFormatPool.GetStyleHandle());
75 auto eThemeType = rThemeColor.
getType();
79 auto pNew = pItem->Clone();
80 pNew->SetValue(aNewColor);
92 void handleNode(
SwNode* pNode)
override
100 void handleSdrObject(
SdrObject* pObject)
override
110 while (aIter.IsMore())
121 std::unique_ptr<SfxItemSet> pNewSet = rAttrSet.
Clone();
125 auto eThemeType = rThemeColor.
getType();
130 aColorItem.SetValue(aColor);
131 pNewSet->Put(aColorItem);
132 pDocument->
ChgFormat(*pFormat, *pNewSet);
157 pTheme->
SetColorSet(std::make_unique<model::ColorSet>(rColorSet));
163 pTheme->
SetColorSet(std::make_unique<model::ColorSet>(rColorSet));
174 if (pTextFormatCollection)
175 changeColor(pTextFormatCollection, rColorSet, pDocument);
185 changeColor(pCharFormat, rColorSet, pDocument);
190 auto pHandler = std::make_shared<ThemeColorHandler>(*pDocument, rColorSet);
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
const SdrPage * GetPage(sal_uInt16 nPgNum) const
void SetTheme(std::unique_ptr< model::Theme > pTheme)
std::unique_ptr< model::Theme > const & GetTheme() const
SdrPageProperties & getSdrPageProperties()
SfxStyleSheetBase * First(SfxStyleFamily eFamily, SfxStyleSearchBits eMask=SfxStyleSearchBits::All)
SfxStyleSheetBase * Next()
const SvxColorItem & GetColor(bool=true) const
virtual std::unique_ptr< SfxItemSet > Clone(bool bItems=true, SfxItemPool *pToPool=nullptr) const override
virtual SfxStyleSheetBasePool * GetStyleSheetPool() override
For Style PI.
SwDoc * GetDoc()
returns Doc. But be careful!
SwCharFormat * GetCharFormat()
SwTextFormatColl * GetCollection()
void ChgFormat(SwFormat &rFormat, const SfxItemSet &rSet)
IDocumentUndoRedo & GetIDocumentUndoRedo()
::sw::DocumentContentOperationsManager const & GetDocumentContentOperationsManager() const
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Base class of the Writer document model elements.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
PaM is Point and Mark: a selection of the document model.
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
sal_Int32 GetAnyEnd() const
end (if available), else start
sal_Int32 GetStart() const
const SwFormatAutoFormat & GetAutoFormat() const
Represents the style of a paragraph.
SwTextNode is a paragraph in the document model.
SwpHints & GetSwpHints()
getters for SwpHints
An SwTextAttr container, stores all directly formatted text portions for a text node.
SwTextAttr * Get(size_t nPos) const
Color getColor(model::ThemeColorType eType) const
Color resolveColor(model::ThemeColor const &rThemeColor) const
Color applyTransformations(Color const &rColor) const
ThemeColorType getType() const
void SetColorSet(std::unique_ptr< ColorSet > pColorSet)
bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, SwTextAttr **ppNewTextAttr=nullptr) override
Insert an attribute.
void addNodeHandler(std::shared_ptr< ModelTraverseHandler > pHandler)
void apply(model::ColorSet const &rColorSet) override
ThemeColorChanger(SwDocShell *pDocSh)
virtual ~ThemeColorChanger() override
EmbeddedObjectRef * pObject
constexpr TypedWhichId< SwFormatAutoFormat > RES_TXTATR_AUTOFMT(50)
constexpr TypedWhichId< SvxColorItem > RES_CHRATR_COLOR(3)
void updateSdrObject(model::ColorSet const &rColorSet, SdrObject *pObject)
Dialog to specify the properties of date form field.
@ NO_CURSOR_CHANGE
don't change the cursor position