21#include <libxml/xmlwriter.h>
28#include <com/sun/star/text/XTextCopy.hpp>
31#include <rtl/math.hxx>
76 bool bReplaceStyleSheets,
92 SdPage* pFoundMaster =
nullptr;
93 sal_uInt16 nMaster = 0;
98 for ( nMaster = 0; nMaster < nMasterCount; nMaster++ )
103 pFoundMaster = pMaster;
110 for ( nMaster = nMasterCount; nMaster > 0; nMaster-- )
115 pFoundMaster = pMaster;
121 DBG_ASSERT(pFoundMaster,
"Masterpage for presentation layout not found!");
124 if( pFoundMaster ==
nullptr )
137 std::vector<SfxStyleSheetBase*> aOutlineStyles;
138 std::vector<SfxStyleSheetBase*> aOldOutlineStyles;
139 std::vector<StyleReplaceData> aReplList;
140 bool bListsFilled =
false;
144 for (
size_t nObj = 0; nObj < nObjCount; ++nObj)
148 if (pObj->GetObjInventor() == SdrInventor::Default &&
149 pObj->GetObjIdentifier() == SdrObjKind::OutlineText)
151 if (!bListsFilled || !bReplaceStyleSheets)
154 OUString aOldFullName;
158 for (sal_Int16
i = -1;
i < 9;
i++)
160 aOldFullName = aOldLayoutName +
" " +
161 OUString::number( (
i <= 0 ) ? 1 :
i + 1 );
163 OUString::number( (
i <= 0 ) ? 1 :
i + 1);
164 pSheet = pStShPool->
Find(aOldFullName, SfxStyleFamily::Page);
165 DBG_ASSERT(pSheet,
"Old outline style sheet not found");
166 aOldOutlineStyles.push_back(pSheet);
168 pSheet = pStShPool->
Find(aFullName, SfxStyleFamily::Page);
169 DBG_ASSERT(pSheet,
"New outline style sheet not found");
170 aOutlineStyles.push_back(pSheet);
172 if (bReplaceStyleSheets && pSheet)
179 aReplData.
aName = aOldFullName;
180 aReplList.push_back(aReplData);
195 std::vector<SfxStyleSheetBase*>::iterator iterOldOut = aOldOutlineStyles.begin();
197 for (
const auto& rpOut : aOutlineStyles)
202 if (pSheet != pOldSheet)
208 pObj->StartListening(*pSheet);
215 if ( bReplaceStyleSheets && pOPO )
217 for (
const auto& rRepl : aReplList)
219 pOPO->
ChangeStyleSheets( rRepl.aName, rRepl.nFamily, rRepl.aNewName, rRepl.nNewFamily );
223 else if (pObj->GetObjInventor() == SdrInventor::Default &&
224 pObj->GetObjIdentifier() == SdrObjKind::TitleText)
232 pObj->SetStyleSheet(pSheet,
true);
239 pObj->SetStyleSheet(pSheet,
true);
254 if (!pOutlineTextObj)
262 aTrueLayoutName = aTrueLayoutName.copy(0,
nIndex);
264 std::vector<SfxStyleSheetBase*> aOutlineStyles;
267 for (
const auto& rpStyle : aOutlineStyles)
270 pOutlineTextObj->EndListening(*pSheet);
310 OUString aFilterName(
SdResId(STR_IMPRESS));
374 size_t nOrdNum = pObj->GetOrdNum();
385 for(
const Reference< XAnnotation >& srcAnnotation : rSrcPage.
maAnnotations)
387 Reference< XAnnotation > ref;
389 ref->setPosition(srcAnnotation->getPosition());
390 ref->setSize(srcAnnotation->getSize());
391 ref->setAuthor(srcAnnotation->getAuthor());
392 ref->setInitials(srcAnnotation->getInitials());
393 ref->setDateTime(srcAnnotation->getDateTime());
394 Reference< ::css::text::XTextCopy > srcRange ( srcAnnotation->getTextRange(), uno::UNO_QUERY);
395 Reference< ::css::text::XTextCopy > range ( ref->getTextRange(), uno::UNO_QUERY);
396 if(srcRange.is() && range.is())
397 range->copyText( srcRange );
401 SdrObjListIter aSourceIter( &rSrcPage, SdrIterMode::DeepWithGroups );
427 pClonedSdPage->lateInit(*
this);
428 return pClonedSdPage;
461 if( aAlienAttributes.
PutValue( rAttributes, 0 ) )
463 pSet->
Put( aAlienAttributes );
491 if (pShape->IsEmptyPresObj())
587 "OnAnnotationInserted",
588 Reference<XInterface>(xAnnotation, UNO_QUERY));
607 "OnAnnotationRemoved",
608 Reference<XInterface>( xAnnotation, UNO_QUERY ) );
617 if(!grafObj->GetGraphic().isAvailable())
618 graphics.push_back(
const_cast<Graphic*
>(&grafObj->GetGraphic()));
620 if(!fillGraphic->isAvailable())
621 graphics.push_back(
const_cast<Graphic*
>(fillGraphic));
627 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SdPage"));
629 const char* pPageKind =
nullptr;
633 pPageKind =
"PageKind::Standard";
636 pPageKind =
"PageKind::Notes";
639 pPageKind =
"PageKind::Handout";
643 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"mePageKind"), BAD_CAST(pPageKind));
647 (void)xmlTextWriterEndElement(pWriter);
void lateInit(const FmFormPage &rPage)
bool ChangeStyleSheets(std::u16string_view rOldName, SfxStyleFamily eOldFamily, const OUString &rNewName, SfxStyleFamily eNewFamily)
void SetStyleSheets(sal_uInt16 nLevel, const OUString &rNewName, const SfxStyleFamily &rNewFamily)
SdrObject * GetPresObj(PresObjKind eObjKind, int nIndex=1, bool bFuzzySearch=false)
returns the nIndex'th object from the given PresObjKind, index starts with 1
double mfTime
Display time in seconds.
void setTransitionFadeColor(sal_Int32 nTransitionFadeColor)
void cloneAnimations(SdPage &rTargetPage) const
clone the animations from this and set them to rTargetPage TTTT: Order is strange,...
AutoLayout meAutoLayout
AutoLayout.
rtl_TextEncoding meCharSet
Text encoding.
virtual rtl::Reference< SdrObject > RemoveObject(size_t nObjNum) override
bool mbScaleObjects
Objects should be scaled.
PageKind GetPageKind() const
OUString maLayoutName
Name of the layout.
void removeAnnotation(const css::uno::Reference< css::office::XAnnotation > &xAnnotation)
virtual SfxStyleSheet * GetTextStyleSheetForObject(SdrObject *pObj) const override
OUString maSoundFile
Path to sound file (MS-DOS notation).
sd::AnnotationVector maAnnotations
SdPageLink * mpPageLink
Page link (at left sides only)
void lateInit(const SdPage &rSrcPage)
const sd::HeaderFooterSettings & getHeaderFooterSettings() const
SfxStyleSheet * GetStyleSheetForPresObj(PresObjKind eObjKind) const
std::unique_ptr< SfxItemSet > mpItems
PageKind mePageKind
page type
sal_uInt16 mnPaperBin
PaperBin.
void createAnnotation(css::uno::Reference< css::office::XAnnotation > &xAnnotation)
void setTransitionDirection(bool bTransitionbDirection)
OUString maCreatedPageName
generated page name by GetPageName.
bool mbSelected
selection identifier
double mfTransitionDuration
void RemoveEmptyPresentationObjects()
removes all empty presentation objects from this slide
PresObjKind GetPresObjKind(SdrObject *pObj) const
SfxItemSet * getOrCreateItems()
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
void setTransitionSubtype(sal_Int16 nTransitionSubtype)
bool Equals(const SdPage &) const
bool setAlienAttributes(const css::uno::Any &rAttributes)
void EndListenOutlineText()
bool mbTransitionDirection
bool mbExcluded
will (not) be displayed during show.
void addAnnotation(const css::uno::Reference< css::office::XAnnotation > &xAnnotation, int nIndex)
SdPage(const SdPage &)=delete
void InsertPresObj(SdrObject *pObj, PresObjKind eKind)
inserts the given SdrObject into the presentation object list
OUString maBookmarkName
Bookmark name.
sal_Int32 mnTransitionFadeColor
virtual bool IsReadOnly() const override
virtual OUString GetLayoutName() const override
sal_Int16 mnTransitionSubtype
void setHeaderFooterSettings(const sd::HeaderFooterSettings &rNewSettings)
void setTransitionType(sal_Int16 nTransitionType)
PresChange mePresChange
manual / automatic / semi automatic
void SetPresentationLayout(std::u16string_view rLayoutName, bool bReplaceStyleSheets=true, bool bSetMasterPage=true, bool bReverseOrder=false)
sal_Int16 mnTransitionType
void getAlienAttributes(css::uno::Any &rAttributes)
OUString maFileName
file name.
void getGraphicsForPrefetch(std::vector< Graphic * > &graphics) const
Returns graphics objects from the page that can be prefetched before it's painted.
void setTransitionDuration(double fTransitionDuration)
virtual rtl::Reference< SdrPage > CloneSdrPage(SdrModel &rTargetModel) const override
sd::ShapeList maPresentationShapeList
presentation objects
bool mbSoundOn
with / without sound.
void CreateOutlineSheetList(std::u16string_view rLayoutName, std::vector< SfxStyleSheetBase * > &rOutlineStyles)
virtual void SetChanged(bool bFlg=true)
const SdrPage * GetMasterPage(sal_uInt16 nPgNum) const
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
sal_uInt16 GetMasterPageCount() const
const SfxItemPool & GetItemPool() const
SfxStyleSheetBasePool * GetStyleSheetPool() const
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
SdrObjUserCall * GetUserCall() const
void SetUserCall(SdrObjUserCall *pUser)
const Graphic * getFillGraphic() const
bool Equals(const SdrObject &) const
void TRG_SetMasterPage(SdrPage &rNew)
void dumpAsXml(xmlTextWriterPtr pWriter) const override
bool IsMasterPage() const
bool IsBackgroundFullSize() const
SdrModel & getSdrModelFromSdrPage() const
virtual SfxStyleSheet * GetTextStyleSheetForObject(SdrObject *pObj) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
bool IsListening(SfxBroadcaster &rBroadcaster) const
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
const OUString & GetOrigURL() const
SfxMedium * GetMedium() const
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
SfxStyleFamily GetFamily() const
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
const std::list< SdrObject * > & getList() const
void InsertFileLink(sfx2::SvBaseLink &, SvBaseLinkObjectType nFileType, std::u16string_view rFileNm, const OUString *pFilterNm=nullptr, const OUString *pRange=nullptr)
void Remove(SvBaseLink const *pLink)
#define DBG_ASSERT(sCon, aError)
struct _xmlTextWriter * xmlTextWriterPtr
constexpr OUStringLiteral SD_LT_SEPARATOR
void createAnnotation(uno::Reference< office::XAnnotation > &xAnnotation, SdPage *pPage)
std::unique_ptr< SdrUndoAction > CreateUndoInsertOrRemoveAnnotation(const uno::Reference< office::XAnnotation > &xAnnotation, bool bInsert)
OUString SdResId(TranslateId aId)
constexpr OUStringLiteral STR_LAYOUT_OUTLINE
SfxStyleFamily nNewFamily
constexpr TypedWhichId< SvXMLAttrContainerItem > SDRATTR_XMLATTRIBUTES(SDRATTR_MISC_FIRST+22)
void NotifyDocumentEvent(SdDrawDocument const &rDocument, const OUString &rEventName)