1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 // MARKER(update_precomp.py): autogen include statement, do not remove 29 #include "precompiled_xmloff.hxx" 30 #include "unointerfacetouniqueidentifiermapper.hxx" 31 #include <xmloff/nmspmap.hxx> 32 #include "xmloff/xmlnmspe.hxx" 33 #include <xmloff/xmluconv.hxx> 34 #include <xmloff/xmltoken.hxx> 35 #include <xmloff/xmlmetae.hxx> 36 #include <com/sun/star/lang/ServiceNotRegisteredException.hpp> 37 #include <com/sun/star/presentation/XPresentationSupplier.hpp> 38 #include <com/sun/star/presentation/XCustomPresentationSupplier.hpp> 39 #include <com/sun/star/geometry/RealPoint2D.hpp> 40 #include <com/sun/star/task/XStatusIndicatorSupplier.hpp> 41 #include <com/sun/star/office/XAnnotationAccess.hpp> 42 #include <com/sun/star/lang/Locale.hpp> 43 #include <com/sun/star/uno/Any.hxx> 44 #include "sdxmlexp_impl.hxx" 45 #include <com/sun/star/drawing/XDrawPagesSupplier.hpp> 46 #include <com/sun/star/drawing/XMasterPagesSupplier.hpp> 47 #include <com/sun/star/presentation/XHandoutMasterSupplier.hpp> 48 #include <com/sun/star/container/XIndexContainer.hpp> 49 #include <com/sun/star/view/PaperOrientation.hpp> 50 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> 51 #include <com/sun/star/style/XStyle.hpp> 52 53 #include <com/sun/star/form/XFormsSupplier2.hpp> 54 #include <com/sun/star/presentation/XPresentationPage.hpp> 55 #include <com/sun/star/drawing/XMasterPageTarget.hpp> 56 #include <com/sun/star/text/XText.hpp> 57 #include <com/sun/star/chart/XChartDocument.hpp> 58 #include <com/sun/star/animations/XAnimationNodeSupplier.hpp> 59 #include <com/sun/star/container/XNamed.hpp> 60 #include <rtl/ustrbuf.hxx> 61 #include <tools/gen.hxx> 62 #include <tools/debug.hxx> 63 #include <xmloff/xmlaustp.hxx> 64 #include <xmloff/families.hxx> 65 #include <xmloff/styleexp.hxx> 66 #include "sdpropls.hxx" 67 #include <xmloff/xmlexppr.hxx> 68 #include <com/sun/star/beans/XPropertyState.hpp> 69 #include "xexptran.hxx" 70 71 #ifndef _CPPUHELPER_IMPLBASE1_HXX 72 #include <cppuhelper/implbase1.hxx> 73 #endif 74 #include <comphelper/extract.hxx> 75 #include <com/sun/star/lang/XServiceInfo.hpp> 76 #include "PropertySetMerger.hxx" 77 #include "layerexp.hxx" 78 79 80 #include "xmloff/VisAreaExport.hxx" 81 #include "XMLNumberStylesExport.hxx" 82 #include <tools/list.hxx> 83 #include <tools/string.hxx> 84 85 #include "animationexport.hxx" 86 87 #include <com/sun/star/document/XDocumentProperties.hpp> 88 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> 89 90 using ::rtl::OUString; 91 using ::rtl::OUStringBuffer; 92 93 using namespace ::com::sun::star; 94 using namespace ::com::sun::star::uno; 95 using namespace ::com::sun::star::beans; 96 using namespace ::com::sun::star::util; 97 using namespace ::com::sun::star::container; 98 using namespace ::com::sun::star::drawing; 99 using namespace ::com::sun::star::office; 100 using namespace ::com::sun::star::presentation; 101 using namespace ::com::sun::star::geometry; 102 using namespace ::com::sun::star::text; 103 using namespace ::xmloff::token; 104 105 106 ////////////////////////////////////////////////////////////////////////////// 107 108 class ImpXMLEXPPageMasterInfo 109 { 110 sal_Int32 mnBorderBottom; 111 sal_Int32 mnBorderLeft; 112 sal_Int32 mnBorderRight; 113 sal_Int32 mnBorderTop; 114 sal_Int32 mnWidth; 115 sal_Int32 mnHeight; 116 view::PaperOrientation meOrientation; 117 OUString msName; 118 OUString msMasterPageName; 119 120 public: 121 ImpXMLEXPPageMasterInfo(const SdXMLExport& rExp, const Reference<XDrawPage>& xPage); 122 sal_Bool operator==(const ImpXMLEXPPageMasterInfo& rInfo) const; 123 void SetName(const OUString& rStr); 124 125 const OUString& GetName() const { return msName; } 126 const OUString& GetMasterPageName() const { return msMasterPageName; } 127 128 sal_Int32 GetBorderBottom() const { return mnBorderBottom; } 129 sal_Int32 GetBorderLeft() const { return mnBorderLeft; } 130 sal_Int32 GetBorderRight() const { return mnBorderRight; } 131 sal_Int32 GetBorderTop() const { return mnBorderTop; } 132 sal_Int32 GetWidth() const { return mnWidth; } 133 sal_Int32 GetHeight() const { return mnHeight; } 134 view::PaperOrientation GetOrientation() const { return meOrientation; } 135 }; 136 137 ImpXMLEXPPageMasterInfo::ImpXMLEXPPageMasterInfo( 138 const SdXMLExport& rExp, 139 const Reference<XDrawPage>& xPage) 140 : mnBorderBottom(0), 141 mnBorderLeft(0), 142 mnBorderRight(0), 143 mnBorderTop(0), 144 mnWidth(0), 145 mnHeight(0), 146 meOrientation(rExp.IsDraw() ? view::PaperOrientation_PORTRAIT : view::PaperOrientation_LANDSCAPE) 147 { 148 Reference <beans::XPropertySet> xPropSet(xPage, UNO_QUERY); 149 if(xPropSet.is()) 150 { 151 Any aAny; 152 153 Reference< beans::XPropertySetInfo > xPropsInfo( xPropSet->getPropertySetInfo() ); 154 if( xPropsInfo.is() && xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderBottom") ))) 155 { 156 aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderBottom"))); 157 aAny >>= mnBorderBottom; 158 159 aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderLeft"))); 160 aAny >>= mnBorderLeft; 161 162 aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderRight"))); 163 aAny >>= mnBorderRight; 164 165 aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderTop"))); 166 aAny >>= mnBorderTop; 167 } 168 169 if( xPropsInfo.is() && xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("Width") ))) 170 { 171 aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Width"))); 172 aAny >>= mnWidth; 173 174 aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Height"))); 175 aAny >>= mnHeight; 176 } 177 178 if( xPropsInfo.is() && xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("Orientation") ))) 179 { 180 aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Orientation"))); 181 aAny >>= meOrientation; 182 } 183 } 184 185 Reference <container::XNamed> xMasterNamed(xPage, UNO_QUERY); 186 if(xMasterNamed.is()) 187 { 188 msMasterPageName = xMasterNamed->getName(); 189 } 190 } 191 192 sal_Bool ImpXMLEXPPageMasterInfo::operator==(const ImpXMLEXPPageMasterInfo& rInfo) const 193 { 194 return ((mnBorderBottom == rInfo.mnBorderBottom) 195 && (mnBorderLeft == rInfo.mnBorderLeft) 196 && (mnBorderRight == rInfo.mnBorderRight) 197 && (mnBorderTop == rInfo.mnBorderTop) 198 && (mnWidth == rInfo.mnWidth) 199 && (mnHeight == rInfo.mnHeight) 200 && (meOrientation == rInfo.meOrientation)); 201 } 202 203 void ImpXMLEXPPageMasterInfo::SetName(const OUString& rStr) 204 { 205 msName = rStr; 206 } 207 208 DECLARE_LIST(ImpXMLEXPPageMasterList, ImpXMLEXPPageMasterInfo*) 209 210 ////////////////////////////////////////////////////////////////////////////// 211 212 #define IMP_AUTOLAYOUT_INFO_MAX (35L) 213 214 class ImpXMLAutoLayoutInfo 215 { 216 sal_uInt16 mnType; 217 ImpXMLEXPPageMasterInfo* mpPageMasterInfo; 218 OUString msLayoutName; 219 Rectangle maTitleRect; 220 Rectangle maPresRect; 221 sal_Int32 mnGapX; 222 sal_Int32 mnGapY; 223 224 public: 225 ImpXMLAutoLayoutInfo(sal_uInt16 nTyp, ImpXMLEXPPageMasterInfo* pInf); 226 227 sal_Bool operator==(const ImpXMLAutoLayoutInfo& rInfo) const; 228 229 sal_uInt16 GetLayoutType() const { return mnType; } 230 sal_Int32 GetGapX() const { return mnGapX; } 231 sal_Int32 GetGapY() const { return mnGapY; } 232 233 const OUString& GetLayoutName() const { return msLayoutName; } 234 void SetLayoutName(const OUString& rNew) { msLayoutName = rNew; } 235 236 const Rectangle& GetTitleRectangle() const { return maTitleRect; } 237 const Rectangle& GetPresRectangle() const { return maPresRect; } 238 239 static sal_Bool IsCreateNecessary(sal_uInt16 nTyp); 240 }; 241 242 sal_Bool ImpXMLAutoLayoutInfo::IsCreateNecessary(sal_uInt16 nTyp) 243 { 244 if(nTyp == 5 /* AUTOLAYOUT_ORG */ 245 || nTyp == 20 /* AUTOLAYOUT_NONE */ 246 || nTyp >= IMP_AUTOLAYOUT_INFO_MAX) 247 return sal_False; 248 return sal_True; 249 } 250 251 sal_Bool ImpXMLAutoLayoutInfo::operator==(const ImpXMLAutoLayoutInfo& rInfo) const 252 { 253 return ((mnType == rInfo.mnType 254 && mpPageMasterInfo == rInfo.mpPageMasterInfo)); 255 } 256 257 ImpXMLAutoLayoutInfo::ImpXMLAutoLayoutInfo(sal_uInt16 nTyp, ImpXMLEXPPageMasterInfo* pInf) 258 : mnType(nTyp), 259 mpPageMasterInfo(pInf) 260 { 261 // create full info (initialze with typical values) 262 Point aPagePos(0,0); 263 Size aPageSize(28000, 21000); 264 Size aPageInnerSize(28000, 21000); 265 266 if(mpPageMasterInfo) 267 { 268 aPagePos = Point(mpPageMasterInfo->GetBorderLeft(), mpPageMasterInfo->GetBorderTop()); 269 aPageSize = Size(mpPageMasterInfo->GetWidth(), mpPageMasterInfo->GetHeight()); 270 aPageInnerSize = aPageSize; 271 aPageInnerSize.Width() -= mpPageMasterInfo->GetBorderLeft() + mpPageMasterInfo->GetBorderRight(); 272 aPageInnerSize.Height() -= mpPageMasterInfo->GetBorderTop() + mpPageMasterInfo->GetBorderBottom(); 273 } 274 275 // title rectangle aligning 276 Point aTitlePos(aPagePos); 277 Size aTitleSize(aPageInnerSize); 278 279 if(mnType == 21 /* AUTOLAYOUT_NOTES */) 280 { 281 aTitleSize.Height() = (long) (aTitleSize.Height() / 2.5); 282 Point aPos = aTitlePos; 283 aPos.Y() += long( aTitleSize.Height() * 0.083 ); 284 Size aPartArea = aTitleSize; 285 Size aSize; 286 287 // tatsaechliche Seitengroesse in das Handout-Rechteck skalieren 288 double fH = (double) aPartArea.Width() / aPageSize.Width(); 289 double fV = (double) aPartArea.Height() / aPageSize.Height(); 290 291 if ( fH > fV ) 292 fH = fV; 293 aSize.Width() = (long) (fH * aPageSize.Width()); 294 aSize.Height() = (long) (fH * aPageSize.Height()); 295 296 aPos.X() += (aPartArea.Width() - aSize.Width()) / 2; 297 aPos.Y() += (aPartArea.Height()- aSize.Height())/ 2; 298 299 aTitlePos = aPos; 300 aTitleSize = aSize; 301 } 302 else if(mnType == 27 || mnType == 28) 303 { 304 // AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART or 305 // AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE 306 Point aClassicTPos( 307 aTitlePos.X() + long( aTitleSize.Width() * 0.0735 ), 308 aTitlePos.Y() + long( aTitleSize.Height() * 0.083 )); 309 Size aClassicTSize( 310 long( aTitleSize.Width() * 0.854 ), 311 long( aTitleSize.Height() * 0.167 )); 312 Point aLPos(aPagePos); 313 Size aLSize(aPageInnerSize); 314 Point aClassicLPos( 315 aLPos.X() + long( aLSize.Width() * 0.0735 ), 316 aLPos.Y() + long( aLSize.Height() * 0.472 )); 317 Size aClassicLSize( 318 long( aLSize.Width() * 0.854 ), 319 long( aLSize.Height() * 0.444 )); 320 321 aTitlePos.X() = (aClassicTPos.X() + aClassicTSize.Width()) - aClassicTSize.Height(); 322 aTitlePos.Y() = aClassicTPos.Y(); 323 aTitleSize.Width() = aClassicTSize.Height(); 324 aTitleSize.Height() = (aClassicLPos.Y() + aClassicLSize.Height()) - aClassicTPos.Y(); 325 } 326 else 327 { 328 aTitlePos.X() += long( aTitleSize.Width() * 0.0735 ); 329 aTitlePos.Y() += long( aTitleSize.Height() * 0.083 ); 330 aTitleSize.Width() = long( aTitleSize.Width() * 0.854 ); 331 aTitleSize.Height() = long( aTitleSize.Height() * 0.167 ); 332 } 333 334 maTitleRect.SetPos(aTitlePos); 335 maTitleRect.SetSize(aTitleSize); 336 337 // layout rectangle aligning 338 Point aLayoutPos(aPagePos); 339 Size aLayoutSize(aPageInnerSize); 340 341 if(mnType == 21 /* AUTOLAYOUT_NOTES */) 342 { 343 aLayoutPos.X() += long( aLayoutSize.Width() * 0.0735 ); 344 aLayoutPos.Y() += long( aLayoutSize.Height() * 0.472 ); 345 aLayoutSize.Width() = long( aLayoutSize.Width() * 0.854 ); 346 aLayoutSize.Height() = long( aLayoutSize.Height() * 0.444 ); 347 } 348 else if((mnType >= 22 && mnType <= 26) || (mnType == 31)) // AUTOLAYOUT_HANDOUT 349 { 350 // keep info for inner area in maPresRect, put info for gap size 351 // to maTitleRect position 352 mnGapX = (aPageSize.Width() - aPageInnerSize.Width()) / 2; 353 mnGapY = (aPageSize.Height() - aPageInnerSize.Height()) / 2; 354 355 if(!mnGapX) 356 mnGapX = aPageSize.Width() / 10; 357 358 if(!mnGapY) 359 mnGapY = aPageSize.Height() / 10; 360 361 if(mnGapX < aPageInnerSize.Width() / 10) 362 mnGapX = aPageInnerSize.Width() / 10; 363 364 if(mnGapY < aPageInnerSize.Height() / 10) 365 mnGapY = aPageInnerSize.Height() / 10; 366 } 367 else if(mnType == 27 || mnType == 28) 368 { 369 // AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART or 370 // AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE 371 Point aClassicTPos( 372 aTitlePos.X() + long( aTitleSize.Width() * 0.0735 ), 373 aTitlePos.Y() + long( aTitleSize.Height() * 0.083 )); 374 Size aClassicTSize( 375 long( aTitleSize.Width() * 0.854 ), 376 long( aTitleSize.Height() * 0.167 )); 377 Point aClassicLPos( 378 aLayoutPos.X() + long( aLayoutSize.Width() * 0.0735 ), 379 aLayoutPos.Y() + long( aLayoutSize.Height() * 0.472 )); 380 Size aClassicLSize( 381 long( aLayoutSize.Width() * 0.854 ), 382 long( aLayoutSize.Height() * 0.444 )); 383 384 aLayoutPos.X() = aClassicLPos.X(); 385 aLayoutPos.Y() = aClassicTPos.Y(); 386 aLayoutSize.Width() = (aClassicLPos.X() + aClassicLSize.Width()) 387 - (aClassicTSize.Height() + (aClassicLPos.Y() - (aClassicTPos.Y() + aClassicTSize.Height()))); 388 aLayoutSize.Height() = (aClassicLPos.Y() + aClassicLSize.Height()) - aClassicTPos.Y(); 389 } 390 else if( mnType == 32 ) 391 { 392 // AUTOLAYOUT_ONLY_TEXT 393 aLayoutPos = aTitlePos; 394 aLayoutSize.Width() = aTitleSize.Width(); 395 aLayoutSize.Height() = long( aLayoutSize.Height() * 0.825 ); 396 } 397 else 398 { 399 aLayoutPos.X() += long( aLayoutSize.Width() * 0.0735 ); 400 aLayoutPos.Y() += long( aLayoutSize.Height() * 0.278 ); 401 aLayoutSize.Width() = long( aLayoutSize.Width() * 0.854 ); 402 aLayoutSize.Height() = long( aLayoutSize.Height() * 0.630 ); 403 } 404 405 maPresRect.SetPos(aLayoutPos); 406 maPresRect.SetSize(aLayoutSize); 407 } 408 409 DECLARE_LIST(ImpXMLAutoLayoutInfoList, ImpXMLAutoLayoutInfo*) 410 411 ////////////////////////////////////////////////////////////////////////////// 412 413 // #110680# 414 SdXMLExport::SdXMLExport( 415 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, 416 sal_Bool bIsDraw, sal_uInt16 nExportFlags ) 417 : SvXMLExport( xServiceFactory, MAP_CM, bIsDraw ? XML_DRAWING : XML_PRESENTATION, nExportFlags ), 418 mnDocMasterPageCount(0L), 419 mnDocDrawPageCount(0L), 420 mnShapeStyleInfoIndex(0L), 421 mnObjectCount(0L), 422 mpPageMasterInfoList(new ImpXMLEXPPageMasterList(1, 4, 4)), 423 mpPageMasterUsageList(new ImpXMLEXPPageMasterList(1, 4, 4)), 424 mpNotesPageMasterUsageList(new ImpXMLEXPPageMasterList(1, 4, 4)), 425 mpHandoutPageMaster(NULL), 426 mpAutoLayoutInfoList(new ImpXMLAutoLayoutInfoList(1, 4, 4)), 427 mpSdPropHdlFactory(0L), 428 mpPropertySetMapper(0L), 429 mpPresPagePropsMapper(0L), 430 mbIsDraw(bIsDraw), 431 mbFamilyGraphicUsed(sal_False), 432 mbFamilyPresentationUsed(sal_False), 433 msZIndex( GetXMLToken(XML_ZINDEX) ), 434 msEmptyPres( RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") ), 435 msModel( RTL_CONSTASCII_USTRINGPARAM("Model") ), 436 msStartShape( RTL_CONSTASCII_USTRINGPARAM("StartShape") ), 437 msEndShape( RTL_CONSTASCII_USTRINGPARAM("EndShape") ), 438 msPageLayoutNames( RTL_CONSTASCII_USTRINGPARAM("PageLayoutNames") ) 439 { 440 441 442 } 443 444 // XExporter 445 void SAL_CALL SdXMLExport::setSourceDocument( const Reference< lang::XComponent >& xDoc ) 446 throw(lang::IllegalArgumentException, uno::RuntimeException) 447 { 448 SvXMLExport::setSourceDocument( xDoc ); 449 450 const OUString aEmpty; 451 452 // prepare factory parts 453 mpSdPropHdlFactory = new XMLSdPropHdlFactory( GetModel(), *this ); 454 if(mpSdPropHdlFactory) 455 { 456 // set lock to avoid deletion 457 mpSdPropHdlFactory->acquire(); 458 459 // build one ref 460 const UniReference< XMLPropertyHandlerFactory > aFactoryRef = mpSdPropHdlFactory; 461 462 // construct PropertySetMapper 463 UniReference < XMLPropertySetMapper > xMapper = new XMLShapePropertySetMapper( aFactoryRef); 464 465 mpPropertySetMapper = new XMLShapeExportPropertyMapper( xMapper, (XMLTextListAutoStylePool*)&GetTextParagraphExport()->GetListAutoStylePool(), *this ); 466 // set lock to avoid deletion 467 mpPropertySetMapper->acquire(); 468 469 // chain text attributes 470 mpPropertySetMapper->ChainExportMapper(XMLTextParagraphExport::CreateParaExtPropMapper(*this)); 471 472 // construct PresPagePropsMapper 473 xMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLSDPresPageProps, aFactoryRef); 474 475 mpPresPagePropsMapper = new XMLPageExportPropertyMapper( xMapper, *this ); 476 if(mpPresPagePropsMapper) 477 { 478 // set lock to avoid deletion 479 mpPresPagePropsMapper->acquire(); 480 } 481 } 482 483 // add family name 484 GetAutoStylePool()->AddFamily( 485 XML_STYLE_FAMILY_SD_GRAPHICS_ID, 486 OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)), 487 GetPropertySetMapper(), 488 OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_PREFIX))); 489 GetAutoStylePool()->AddFamily( 490 XML_STYLE_FAMILY_SD_PRESENTATION_ID, 491 OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_PRESENTATION_NAME)), 492 GetPropertySetMapper(), 493 OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_PRESENTATION_PREFIX))); 494 GetAutoStylePool()->AddFamily( 495 XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID, 496 OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME)), 497 GetPresPagePropsMapper(), 498 OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_DRAWINGPAGE_PREFIX))); 499 // prepare access to styles 500 Reference< style::XStyleFamiliesSupplier > xFamSup( GetModel(), UNO_QUERY ); 501 if(xFamSup.is()) 502 { 503 mxDocStyleFamilies = xFamSup->getStyleFamilies(); 504 } 505 506 // prepare access to master pages 507 Reference < drawing::XMasterPagesSupplier > xMasterPagesSupplier(GetModel(), UNO_QUERY); 508 if(xMasterPagesSupplier.is()) 509 { 510 mxDocMasterPages = mxDocMasterPages.query( xMasterPagesSupplier->getMasterPages() ); 511 if(mxDocMasterPages.is()) 512 { 513 mnDocMasterPageCount = mxDocMasterPages->getCount(); 514 maMasterPagesStyleNames.insert( maMasterPagesStyleNames.begin(), mnDocMasterPageCount, aEmpty ); 515 } 516 } 517 518 // prepare access to draw pages 519 Reference <XDrawPagesSupplier> xDrawPagesSupplier(GetModel(), UNO_QUERY); 520 if(xDrawPagesSupplier.is()) 521 { 522 mxDocDrawPages = mxDocDrawPages.query( xDrawPagesSupplier->getDrawPages() ); 523 if(mxDocDrawPages.is()) 524 { 525 mnDocDrawPageCount = mxDocDrawPages->getCount(); 526 maDrawPagesStyleNames.insert( maDrawPagesStyleNames.begin(), mnDocDrawPageCount, aEmpty ); 527 maDrawNotesPagesStyleNames.insert( maDrawNotesPagesStyleNames.begin(), mnDocDrawPageCount, aEmpty ); 528 if( !mbIsDraw ) 529 maDrawPagesAutoLayoutNames.realloc( mnDocDrawPageCount + 1 ); 530 531 HeaderFooterPageSettingsImpl aEmptySettings; 532 maDrawPagesHeaderFooterSettings.insert( maDrawPagesHeaderFooterSettings.begin(), mnDocDrawPageCount, aEmptySettings ); 533 maDrawNotesPagesHeaderFooterSettings.insert( maDrawNotesPagesHeaderFooterSettings.begin(), mnDocDrawPageCount, aEmptySettings ); 534 } 535 } 536 537 // #82003# count all draw objects for use with progress bar. 538 // #88245# init mnObjectCount once, use counter itself as flag. It 539 // is initialized to 0. 540 if(!mnObjectCount) 541 { 542 if( IsImpress() ) 543 { 544 // #91587# add handout master count 545 Reference<presentation::XHandoutMasterSupplier> xHandoutSupp(GetModel(), UNO_QUERY); 546 if(xHandoutSupp.is()) 547 { 548 Reference<XDrawPage> xHandoutPage(xHandoutSupp->getHandoutMasterPage()); 549 if(xHandoutPage.is()) 550 { 551 Reference<drawing::XShapes> xShapes(xHandoutPage, UNO_QUERY); 552 if(xShapes.is() && xShapes->getCount()) 553 { 554 mnObjectCount += ImpRecursiveObjectCount(xShapes); 555 } 556 } 557 } 558 } 559 560 if(mxDocMasterPages.is()) 561 { 562 for(sal_Int32 a(0); a < mnDocMasterPageCount; a++) 563 { 564 Any aAny(mxDocMasterPages->getByIndex(a)); 565 Reference< drawing::XShapes > xMasterPage; 566 567 if((aAny >>= xMasterPage) && xMasterPage.is()) 568 { 569 mnObjectCount += ImpRecursiveObjectCount(xMasterPage); 570 } 571 572 if( IsImpress() ) 573 { 574 // #91587# take notes pages from master pages into account 575 Reference<presentation::XPresentationPage> xPresPage; 576 if((aAny >>= xPresPage) && xPresPage.is()) 577 { 578 Reference<XDrawPage> xNotesPage(xPresPage->getNotesPage()); 579 if(xNotesPage.is()) 580 { 581 Reference<drawing::XShapes> xShapes(xNotesPage, UNO_QUERY); 582 if(xShapes.is() && xShapes->getCount()) 583 { 584 mnObjectCount += ImpRecursiveObjectCount(xShapes); 585 } 586 } 587 } 588 } 589 } 590 } 591 592 if(mxDocDrawPages.is()) 593 { 594 for(sal_Int32 a(0); a < mnDocDrawPageCount; a++) 595 { 596 Any aAny(mxDocDrawPages->getByIndex(a)); 597 Reference< drawing::XShapes > xPage; 598 599 if((aAny >>= xPage) && xPage.is()) 600 { 601 mnObjectCount += ImpRecursiveObjectCount(xPage); 602 } 603 604 if( IsImpress() ) 605 { 606 // #91587# take notes pages from draw pages into account 607 Reference<presentation::XPresentationPage> xPresPage; 608 if((aAny >>= xPresPage) && xPresPage.is()) 609 { 610 Reference<XDrawPage> xNotesPage(xPresPage->getNotesPage()); 611 if(xNotesPage.is()) 612 { 613 Reference<drawing::XShapes> xShapes(xNotesPage, UNO_QUERY); 614 if(xShapes.is() && xShapes->getCount()) 615 { 616 mnObjectCount += ImpRecursiveObjectCount(xShapes); 617 } 618 } 619 } 620 } 621 } 622 } 623 624 // #82003# init progress bar 625 GetProgressBarHelper()->SetReference(mnObjectCount); 626 } 627 628 // add namespaces 629 _GetNamespaceMap().Add( 630 GetXMLToken(XML_NP_PRESENTATION), 631 GetXMLToken(XML_N_PRESENTATION), 632 XML_NAMESPACE_PRESENTATION); 633 634 _GetNamespaceMap().Add( 635 GetXMLToken(XML_NP_SMIL), 636 GetXMLToken(XML_N_SMIL_COMPAT), 637 XML_NAMESPACE_SMIL); 638 639 _GetNamespaceMap().Add( 640 GetXMLToken(XML_NP_ANIMATION), 641 GetXMLToken(XML_N_ANIMATION), 642 XML_NAMESPACE_ANIMATION); 643 644 if( getDefaultVersion() > SvtSaveOptions::ODFVER_012 ) 645 { 646 _GetNamespaceMap().Add( 647 GetXMLToken(XML_NP_OFFICE_EXT), 648 GetXMLToken(XML_N_OFFICE_EXT), 649 XML_NAMESPACE_OFFICE_EXT); 650 651 _GetNamespaceMap().Add( 652 GetXMLToken(XML_NP_DRAW_EXT), 653 GetXMLToken(XML_N_DRAW_EXT), 654 XML_NAMESPACE_DRAW_EXT); 655 } 656 657 GetShapeExport()->enableLayerExport(); 658 659 // #88546# enable progress bar increments 660 GetShapeExport()->enableHandleProgressBar(); 661 } 662 663 ////////////////////////////////////////////////////////////////////////////// 664 // #82003# helper function for recursive object count 665 sal_uInt32 SdXMLExport::ImpRecursiveObjectCount(Reference< drawing::XShapes > xShapes) 666 { 667 sal_uInt32 nRetval(0L); 668 669 if(xShapes.is()) 670 { 671 sal_Int32 nCount = xShapes->getCount(); 672 673 for(sal_Int32 a(0L); a < nCount; a++) 674 { 675 Any aAny(xShapes->getByIndex(a)); 676 Reference< drawing::XShapes > xGroup; 677 678 if((aAny >>= xGroup) && xGroup.is()) 679 { 680 // #93180# count group objects, too. 681 nRetval += 1 + ImpRecursiveObjectCount(xGroup); 682 } 683 else 684 { 685 nRetval++; 686 } 687 } 688 } 689 690 return nRetval; 691 } 692 693 ////////////////////////////////////////////////////////////////////////////// 694 695 __EXPORT SdXMLExport::~SdXMLExport() 696 { 697 // cleanup factory, decrease refcount. Should lead to destruction. 698 if(mpSdPropHdlFactory) 699 { 700 mpSdPropHdlFactory->release(); 701 mpSdPropHdlFactory = 0L; 702 } 703 704 // cleanup mapper, decrease refcount. Should lead to destruction. 705 if(mpPropertySetMapper) 706 { 707 mpPropertySetMapper->release(); 708 mpPropertySetMapper = 0L; 709 } 710 711 // cleanup presPage mapper, decrease refcount. Should lead to destruction. 712 if(mpPresPagePropsMapper) 713 { 714 mpPresPagePropsMapper->release(); 715 mpPresPagePropsMapper = 0L; 716 } 717 718 // clear evtl. temporary page master infos 719 if(mpPageMasterInfoList) 720 { 721 while(mpPageMasterInfoList->Count()) 722 delete mpPageMasterInfoList->Remove(mpPageMasterInfoList->Count() - 1L); 723 delete mpPageMasterInfoList; 724 mpPageMasterInfoList = 0L; 725 } 726 if(mpPageMasterUsageList) 727 { 728 delete mpPageMasterUsageList; 729 mpPageMasterUsageList = 0L; 730 } 731 if(mpNotesPageMasterUsageList) 732 { 733 delete mpNotesPageMasterUsageList; 734 mpNotesPageMasterUsageList = 0L; 735 } 736 737 // clear auto-layout infos 738 if(mpAutoLayoutInfoList) 739 { 740 while(mpAutoLayoutInfoList->Count()) 741 delete mpAutoLayoutInfoList->Remove(mpAutoLayoutInfoList->Count() - 1L); 742 delete mpAutoLayoutInfoList; 743 mpAutoLayoutInfoList = 0L; 744 } 745 746 // #82003# status indicator stop is called exclusively 747 // from SdXMLFilter::Export() now. 748 // 749 // stop progress view 750 // if(GetStatusIndicator().is()) 751 // { 752 // GetStatusIndicator()->end(); 753 // GetStatusIndicator()->reset(); 754 // } 755 } 756 757 ////////////////////////////////////////////////////////////////////////////// 758 // to get default values in XPropertySet use this wrapper class 759 760 class ImpDefaultMapper : public ::cppu::WeakAggImplHelper1< beans::XPropertySet > 761 { 762 Reference< beans::XPropertyState > mxState; 763 Reference< beans::XPropertySet > mxSet; 764 765 public: 766 ImpDefaultMapper( Reference< beans::XPropertyState >& rxState ); 767 768 // Methods 769 virtual Reference< beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw(uno::RuntimeException); 770 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const Any& aValue ) throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException); 771 virtual Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException); 772 773 // empty implementations 774 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const Reference< beans::XPropertyChangeListener >& xListener ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException); 775 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const Reference< beans::XPropertyChangeListener >& aListener ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException); 776 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const Reference< beans::XVetoableChangeListener >& aListener ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException); 777 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const Reference< beans::XVetoableChangeListener >& aListener ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException); 778 }; 779 780 ImpDefaultMapper::ImpDefaultMapper( Reference< beans::XPropertyState >& rxState ) 781 : mxState( rxState ), 782 mxSet( rxState, UNO_QUERY ) 783 { 784 } 785 786 Reference< beans::XPropertySetInfo > SAL_CALL ImpDefaultMapper::getPropertySetInfo() throw(uno::RuntimeException) 787 { 788 return mxSet->getPropertySetInfo(); 789 } 790 791 void SAL_CALL ImpDefaultMapper::setPropertyValue( const OUString& aPropertyName, const Any& /*aValue*/ ) throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException) 792 { 793 mxState->setPropertyToDefault( aPropertyName /*, aValue */ ); 794 } 795 796 Any SAL_CALL ImpDefaultMapper::getPropertyValue( const OUString& PropertyName ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) 797 { 798 return mxState->getPropertyDefault( PropertyName ); 799 } 800 801 // empty implementations 802 void SAL_CALL ImpDefaultMapper::addPropertyChangeListener( const OUString&, const Reference< beans::XPropertyChangeListener >& ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) {} 803 void SAL_CALL ImpDefaultMapper::removePropertyChangeListener( const OUString&, const Reference< beans::XPropertyChangeListener >& ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) {} 804 void SAL_CALL ImpDefaultMapper::addVetoableChangeListener( const OUString&, const Reference< beans::XVetoableChangeListener >& ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) {} 805 void SAL_CALL ImpDefaultMapper::removeVetoableChangeListener( const OUString&, const Reference< beans::XVetoableChangeListener >& ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) {} 806 807 ////////////////////////////////////////////////////////////////////////////// 808 809 /* moved to shapeexport.cxx 810 void SdXMLExport::ImpWriteObjGraphicStyleInfos() 811 { 812 XMLStyleExport aStEx(*this, OUString(), GetAutoStylePool().get()); 813 const UniReference< SvXMLExportPropertyMapper > aMapperRef( GetPropertySetMapper() ); 814 815 // write graphic family default style 816 Reference< lang::XMultiServiceFactory > xFact( GetModel(), UNO_QUERY ); 817 if( xFact.is() ) 818 { 819 try 820 { 821 Reference< beans::XPropertySet > xDefaults( xFact->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Defaults") ) ), UNO_QUERY ); 822 if( xDefaults.is() ) 823 { 824 aStEx.exportDefaultStyle( xDefaults, OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)), aMapperRef ); 825 826 // write graphic family styles 827 aStEx.exportStyleFamily(XML_STYLE_FAMILY_SD_GRAPHICS_NAME, OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)), aMapperRef, sal_False, XML_STYLE_FAMILY_SD_GRAPHICS_ID); 828 } 829 } 830 catch( lang::ServiceNotRegisteredException& ) 831 { 832 } 833 } 834 } 835 */ 836 ////////////////////////////////////////////////////////////////////////////// 837 838 void SdXMLExport::ImpPrepAutoLayoutInfos() 839 { 840 if(IsImpress()) 841 { 842 OUString aStr; 843 844 Reference< presentation::XHandoutMasterSupplier > xHandoutSupp( GetModel(), UNO_QUERY ); 845 if( xHandoutSupp.is() ) 846 { 847 Reference< XDrawPage > xHandoutPage( xHandoutSupp->getHandoutMasterPage() ); 848 if( xHandoutPage.is() ) 849 { 850 if(ImpPrepAutoLayoutInfo(xHandoutPage, aStr)) 851 maDrawPagesAutoLayoutNames[0] = aStr; 852 } 853 } 854 855 // prepare name creation 856 for (sal_Int32 nCnt = 0; nCnt < mnDocDrawPageCount; nCnt++) 857 { 858 Any aAny(mxDocDrawPages->getByIndex(nCnt)); 859 Reference<XDrawPage> xDrawPage; 860 861 if((aAny >>= xDrawPage) && xDrawPage.is()) 862 { 863 if(ImpPrepAutoLayoutInfo(xDrawPage, aStr)) 864 maDrawPagesAutoLayoutNames[nCnt+1] = aStr; 865 } 866 } 867 } 868 } 869 870 sal_Bool SdXMLExport::ImpPrepAutoLayoutInfo(const Reference<XDrawPage>& xPage, OUString& rName) 871 { 872 rName = OUString(); 873 sal_Bool bRetval(sal_False); 874 875 Reference <beans::XPropertySet> xPropSet(xPage, UNO_QUERY); 876 if(xPropSet.is()) 877 { 878 sal_uInt16 nType = sal_uInt16(); 879 Any aAny; 880 881 aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Layout"))); 882 if(aAny >>= nType) 883 { 884 if(ImpXMLAutoLayoutInfo::IsCreateNecessary(nType)) 885 { 886 ImpXMLEXPPageMasterInfo* pInfo = 0L; 887 888 // get master-page info 889 Reference < drawing::XMasterPageTarget > xMasterPageInt(xPage, UNO_QUERY); 890 if(xMasterPageInt.is()) 891 { 892 Reference<XDrawPage> xUsedMasterPage(xMasterPageInt->getMasterPage()); 893 if(xUsedMasterPage.is()) 894 { 895 Reference < container::XNamed > xMasterNamed(xUsedMasterPage, UNO_QUERY); 896 if(xMasterNamed.is()) 897 { 898 OUString sMasterPageName = xMasterNamed->getName(); 899 pInfo = ImpGetPageMasterInfoByName(sMasterPageName); 900 } 901 } 902 } 903 904 // create entry and look for existance 905 ImpXMLAutoLayoutInfo* pNew = new ImpXMLAutoLayoutInfo(nType, pInfo); 906 sal_Bool bDidExist(sal_False); 907 908 for(sal_uInt32 nCnt = 0L; !bDidExist && nCnt < mpAutoLayoutInfoList->Count(); nCnt++) 909 { 910 if(*mpAutoLayoutInfoList->GetObject(nCnt) == *pNew) 911 { 912 delete pNew; 913 pNew = mpAutoLayoutInfoList->GetObject(nCnt); 914 bDidExist = sal_True; 915 } 916 } 917 918 if(!bDidExist) 919 { 920 mpAutoLayoutInfoList->Insert(pNew, LIST_APPEND); 921 OUString sNewName = OUString(RTL_CONSTASCII_USTRINGPARAM("AL")); 922 sNewName += OUString::valueOf(sal_Int32(mpAutoLayoutInfoList->Count() - 1)); 923 sNewName += OUString(RTL_CONSTASCII_USTRINGPARAM("T")); 924 sNewName += OUString::valueOf(sal_Int32(nType)); 925 pNew->SetLayoutName(sNewName); 926 } 927 928 rName = pNew->GetLayoutName(); 929 bRetval = sal_True; 930 } 931 } 932 } 933 934 return bRetval; 935 } 936 937 ////////////////////////////////////////////////////////////////////////////// 938 939 void SdXMLExport::ImpWriteAutoLayoutInfos() 940 { 941 if(mpAutoLayoutInfoList->Count()) 942 { 943 for(sal_uInt32 nCnt = 0L; nCnt < mpAutoLayoutInfoList->Count(); nCnt++) 944 { 945 ImpXMLAutoLayoutInfo* pInfo = mpAutoLayoutInfoList->GetObject(nCnt); 946 if(pInfo) 947 { 948 // prepare presentation-page layout attributes, style-name 949 AddAttribute(XML_NAMESPACE_STYLE, XML_NAME, pInfo->GetLayoutName()); 950 951 // write draw-style attributes 952 SvXMLElementExport aDSE(*this, XML_NAMESPACE_STYLE, XML_PRESENTATION_PAGE_LAYOUT, sal_True, sal_True); 953 954 // write presentation placeholders 955 switch(pInfo->GetLayoutType()) 956 { 957 case 0 : // AUTOLAYOUT_TITLE 958 { 959 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle()); 960 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderSubtitle, pInfo->GetPresRectangle()); 961 break; 962 } 963 case 1 : // AUTOLAYOUT_ENUM 964 { 965 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle()); 966 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, pInfo->GetPresRectangle()); 967 break; 968 } 969 case 2 : // AUTOLAYOUT_CHART 970 { 971 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle()); 972 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart, pInfo->GetPresRectangle()); 973 break; 974 } 975 case 3 : // AUTOLAYOUT_2TEXT 976 { 977 Rectangle aLeft(pInfo->GetPresRectangle()); 978 aLeft.setWidth(long(aLeft.GetWidth() * 0.488)); 979 Rectangle aRight(aLeft); 980 aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05); 981 982 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle()); 983 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aLeft); 984 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aRight); 985 break; 986 } 987 case 4 : // AUTOLAYOUT_TEXTCHART 988 { 989 Rectangle aLeft(pInfo->GetPresRectangle()); 990 aLeft.setWidth(long(aLeft.GetWidth() * 0.488)); 991 Rectangle aRight(aLeft); 992 aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05); 993 994 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle()); 995 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aLeft); 996 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart, aRight); 997 break; 998 } 999 case 6 : // AUTOLAYOUT_TEXTCLIP 1000 { 1001 Rectangle aLeft(pInfo->GetPresRectangle()); 1002 aLeft.setWidth(long(aLeft.GetWidth() * 0.488)); 1003 Rectangle aRight(aLeft); 1004 aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05); 1005 1006 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle()); 1007 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aLeft); 1008 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aRight); 1009 break; 1010 } 1011 case 7 : // AUTOLAYOUT_CHARTTEXT 1012 { 1013 Rectangle aLeft(pInfo->GetPresRectangle()); 1014 aLeft.setWidth(long(aLeft.GetWidth() * 0.488)); 1015 Rectangle aRight(aLeft); 1016 aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05); 1017 1018 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle()); 1019 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart, aLeft); 1020 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aRight); 1021 break; 1022 } 1023 case 8 : // AUTOLAYOUT_TAB 1024 { 1025 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle()); 1026 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTable, pInfo->GetPresRectangle()); 1027 break; 1028 } 1029 case 9 : // AUTOLAYOUT_CLIPTEXT 1030 { 1031 Rectangle aLeft(pInfo->GetPresRectangle()); 1032 aLeft.setWidth(long(aLeft.GetWidth() * 0.488)); 1033 Rectangle aRight(aLeft); 1034 aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05); 1035 1036 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle()); 1037 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aLeft); 1038 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aRight); 1039 break; 1040 } 1041 case 10 : // AUTOLAYOUT_TEXTOBJ 1042 { 1043 Rectangle aLeft(pInfo->GetPresRectangle()); 1044 aLeft.setWidth(long(aLeft.GetWidth() * 0.488)); 1045 Rectangle aRight(aLeft); 1046 aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05); 1047 1048 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle()); 1049 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aLeft); 1050 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aRight); 1051 break; 1052 } 1053 case 11 : // AUTOLAYOUT_OBJ 1054 { 1055 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle()); 1056 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, pInfo->GetPresRectangle()); 1057 break; 1058 } 1059 case 12 : // AUTOLAYOUT_TEXT2OBJ 1060 { 1061 Rectangle aLeft(pInfo->GetPresRectangle()); 1062 aLeft.setWidth(long(aLeft.GetWidth() * 0.488)); 1063 Rectangle aRightTop(aLeft); 1064 aRightTop.Left() = long(aRightTop.Left() + aRightTop.GetWidth() * 1.05); 1065 aRightTop.setHeight(long(aRightTop.GetHeight() * 0.477)); 1066 Rectangle aRightBottom(aRightTop); 1067 aRightBottom.Top() = long(aRightBottom.Top() + aRightBottom.GetHeight() * 1.095); 1068 1069 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle()); 1070 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aLeft); 1071 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aRightTop); 1072 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aRightBottom); 1073 break; 1074 } 1075 case 13 : // AUTOLAYOUT_OBJTEXT 1076 { 1077 Rectangle aLeft(pInfo->GetPresRectangle()); 1078 aLeft.setWidth(long(aLeft.GetWidth() * 0.488)); 1079 Rectangle aRight(aLeft); 1080 aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05); 1081 1082 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle()); 1083 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aLeft); 1084 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aRight); 1085 break; 1086 } 1087 case 14 : // AUTOLAYOUT_OBJOVERTEXT 1088 { 1089 Rectangle aTop(pInfo->GetPresRectangle()); 1090 aTop.setHeight(long(aTop.GetHeight() * 0.477)); 1091 Rectangle aBottom(aTop); 1092 aBottom.Top() = long(aBottom.Top() + aBottom.GetHeight() * 1.095); 1093 1094 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle()); 1095 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aTop); 1096 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aBottom); 1097 break; 1098 } 1099 case 15 : // AUTOLAYOUT_2OBJTEXT 1100 { 1101 Rectangle aLeftTop(pInfo->GetPresRectangle()); 1102 aLeftTop.setWidth(long(aLeftTop.GetWidth() * 0.488)); 1103 Rectangle aRight(aLeftTop); 1104 aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05); 1105 aLeftTop.setHeight(long(aLeftTop.GetHeight() * 0.477)); 1106 Rectangle aLeftBottom(aLeftTop); 1107 aLeftBottom.Top() = long(aLeftBottom.Top() + aLeftBottom.GetHeight() * 1.095); 1108 1109 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle()); 1110 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aLeftTop); 1111 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aLeftBottom); 1112 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aRight); 1113 break; 1114 } 1115 case 16 : // AUTOLAYOUT_2OBJOVERTEXT 1116 { 1117 Rectangle aTopLeft(pInfo->GetPresRectangle()); 1118 aTopLeft.setHeight(long(aTopLeft.GetHeight() * 0.477)); 1119 Rectangle aBottom(aTopLeft); 1120 aBottom.Top() = long(aBottom.Top() + aBottom.GetHeight() * 1.095); 1121 aTopLeft.setWidth(long(aTopLeft.GetWidth() * 0.488)); 1122 Rectangle aTopRight(aTopLeft); 1123 aTopRight.Left() = long(aTopRight.Left() + aTopRight.GetWidth() * 1.05); 1124 1125 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle()); 1126 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aTopLeft); 1127 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aTopRight); 1128 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aBottom); 1129 break; 1130 } 1131 case 17 : // AUTOLAYOUT_TEXTOVEROBJ 1132 { 1133 Rectangle aTop(pInfo->GetPresRectangle()); 1134 aTop.setHeight(long(aTop.GetHeight() * 0.477)); 1135 Rectangle aBottom(aTop); 1136 aBottom.Top() = long(aBottom.Top() + aBottom.GetHeight() * 1.095); 1137 1138 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle()); 1139 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aTop); 1140 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aBottom); 1141 break; 1142 } 1143 case 18 : // AUTOLAYOUT_4OBJ 1144 { 1145 Rectangle aTopLeft(pInfo->GetPresRectangle()); 1146 aTopLeft.setHeight(long(aTopLeft.GetHeight() * 0.477)); 1147 aTopLeft.setWidth(long(aTopLeft.GetWidth() * 0.488)); 1148 Rectangle aBottomLeft(aTopLeft); 1149 aBottomLeft.Top() = long(aBottomLeft.Top() + aBottomLeft.GetHeight() * 1.095); 1150 Rectangle aTopRight(aTopLeft); 1151 aTopRight.Left() = long(aTopRight.Left() + aTopRight.GetWidth() * 1.05); 1152 Rectangle aBottomRight(aTopRight); 1153 aBottomRight.Top() = long(aBottomRight.Top() + aBottomRight.GetHeight() * 1.095); 1154 1155 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle()); 1156 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aTopLeft); 1157 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aTopRight); 1158 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aBottomLeft); 1159 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aBottomRight); 1160 break; 1161 } 1162 case 19 : // AUTOLAYOUT_ONLY_TITLE 1163 { 1164 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle()); 1165 break; 1166 } 1167 case 21 : // AUTOLAYOUT_NOTES 1168 { 1169 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderPage, pInfo->GetTitleRectangle()); 1170 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderNotes, pInfo->GetPresRectangle()); 1171 break; 1172 } 1173 case 22 : // AUTOLAYOUT_HANDOUT1 1174 case 23 : // AUTOLAYOUT_HANDOUT2 1175 case 24 : // AUTOLAYOUT_HANDOUT3 1176 case 25 : // AUTOLAYOUT_HANDOUT4 1177 case 26 : // AUTOLAYOUT_HANDOUT6 1178 case 31 : // AUTOLAYOUT_HANDOUT9 1179 { 1180 sal_Int32 nColCnt, nRowCnt; 1181 sal_Int32 nGapX = pInfo->GetGapX(); 1182 sal_Int32 nGapY = pInfo->GetGapY(); 1183 1184 switch(pInfo->GetLayoutType()) 1185 { 1186 case 22 : nColCnt = 1; nRowCnt = 1; break; 1187 case 23 : nColCnt = 1; nRowCnt = 2; break; 1188 case 24 : nColCnt = 1; nRowCnt = 3; break; 1189 case 25 : nColCnt = 2; nRowCnt = 2; break; 1190 case 26 : nColCnt = 3; nRowCnt = 2; break; 1191 case 31 : nColCnt = 3; nRowCnt = 3; break; 1192 default: nColCnt = 0; nRowCnt = 0; break; // FIXME - What is correct values? 1193 } 1194 1195 Size aPartSize(pInfo->GetTitleRectangle().GetSize()); 1196 Point aPartPos(pInfo->GetTitleRectangle().TopLeft()); 1197 1198 if(aPartSize.Width() > aPartSize.Height()) 1199 { 1200 sal_Int32 nZwi(nColCnt); 1201 nColCnt = nRowCnt; 1202 nRowCnt = nZwi; 1203 } 1204 1205 aPartSize.Width() = (aPartSize.Width() - ((nColCnt - 1) * nGapX)) / nColCnt; 1206 aPartSize.Height() = (aPartSize.Height() - ((nRowCnt - 1) * nGapY)) / nRowCnt; 1207 1208 Point aTmpPos(aPartPos); 1209 1210 for (sal_Int32 a = 0; a < nRowCnt; a++) 1211 { 1212 aTmpPos.X() = aPartPos.X(); 1213 1214 for (sal_Int32 b = 0; b < nColCnt; b++) 1215 { 1216 Rectangle aTmpRect(aTmpPos, aPartSize); 1217 1218 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderHandout, aTmpRect); 1219 aTmpPos.X() += aPartSize.Width() + nGapX; 1220 } 1221 1222 aTmpPos.Y() += aPartSize.Height() + nGapY; 1223 } 1224 break; 1225 } 1226 case 27 : // AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART 1227 { 1228 Rectangle aTop(pInfo->GetPresRectangle()); 1229 aTop.setHeight(long(aTop.GetHeight() * 0.488)); 1230 Rectangle aBottom(aTop); 1231 aBottom.Top() = long(aBottom.Top() + aBottom.GetHeight() * 1.05); 1232 1233 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalTitle, pInfo->GetTitleRectangle()); 1234 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline, aTop); 1235 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart, aBottom); 1236 break; 1237 } 1238 case 28 : // AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE 1239 { 1240 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalTitle, pInfo->GetTitleRectangle()); 1241 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline, pInfo->GetPresRectangle()); 1242 break; 1243 } 1244 case 29 : // AUTOLAYOUT_TITLE_VERTICAL_OUTLINE 1245 { 1246 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle()); 1247 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline, pInfo->GetPresRectangle()); 1248 break; 1249 } 1250 case 30 : // AUTOLAYOUT_TITLE_VERTICAL_OUTLINE_CLIPART 1251 { 1252 Rectangle aLeft(pInfo->GetPresRectangle()); 1253 aLeft.setWidth(long(aLeft.GetWidth() * 0.488)); 1254 Rectangle aRight(aLeft); 1255 aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05); 1256 1257 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle()); 1258 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aLeft); 1259 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline, aRight); 1260 break; 1261 } 1262 case 32 : // AUTOLAYOUT_TITLE 1263 { 1264 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderSubtitle, pInfo->GetPresRectangle()); 1265 break; 1266 } 1267 1268 case 33 : // AUTOLAYOUT_4CLIPART 1269 { 1270 Rectangle aTopLeft(pInfo->GetPresRectangle()); 1271 aTopLeft.setHeight(long(aTopLeft.GetHeight() * 0.477)); 1272 aTopLeft.setWidth(long(aTopLeft.GetWidth() * 0.488)); 1273 Rectangle aBottomLeft(aTopLeft); 1274 aBottomLeft.Top() = long(aBottomLeft.Top() + aBottomLeft.GetHeight() * 1.095); 1275 Rectangle aTopRight(aTopLeft); 1276 aTopRight.Left() = long(aTopRight.Left() + aTopRight.GetWidth() * 1.05); 1277 Rectangle aBottomRight(aTopRight); 1278 aBottomRight.Top() = long(aBottomRight.Top() + aBottomRight.GetHeight() * 1.095); 1279 1280 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle()); 1281 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aTopLeft); 1282 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aTopRight); 1283 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aBottomLeft); 1284 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aBottomRight); 1285 break; 1286 } 1287 1288 case 34 : // AUTOLAYOUT_6CLIPART 1289 { 1290 Rectangle aTopLeft(pInfo->GetPresRectangle()); 1291 aTopLeft.setHeight(long(aTopLeft.GetHeight() * 0.477)); 1292 aTopLeft.setWidth(long(aTopLeft.GetWidth() * 0.322)); 1293 Rectangle aTopCenter(aTopLeft); 1294 aTopCenter.Left() = long(aTopCenter.Left() + aTopCenter.GetWidth() * 1.05); 1295 Rectangle aTopRight(aTopLeft); 1296 aTopRight.Left() = long(aTopRight.Left() + aTopRight.GetWidth() * 2 * 1.05); 1297 1298 Rectangle aBottomLeft(aTopLeft); 1299 aBottomLeft.Top() = long(aBottomLeft.Top() + aBottomLeft.GetHeight() * 1.095); 1300 Rectangle aBottomCenter(aTopCenter); 1301 aBottomCenter.Top() = long(aBottomCenter.Top() + aBottomCenter.GetHeight() * 1.095); 1302 Rectangle aBottomRight(aTopRight); 1303 aBottomRight.Top() = long(aBottomRight.Top() + aBottomRight.GetHeight() * 1.095); 1304 1305 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle()); 1306 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aTopLeft); 1307 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aTopCenter); 1308 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aTopRight); 1309 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aBottomLeft); 1310 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aBottomCenter); 1311 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aBottomRight); 1312 break; 1313 } 1314 default: 1315 { 1316 DBG_ERROR("XMLEXP: unknown autolayout export"); 1317 break; 1318 } 1319 } 1320 } 1321 } 1322 } 1323 } 1324 1325 ////////////////////////////////////////////////////////////////////////////// 1326 1327 void SdXMLExport::ImpWriteAutoLayoutPlaceholder(XmlPlaceholder ePl, const Rectangle& rRect) 1328 { 1329 OUString aStr; 1330 OUStringBuffer sStringBuffer; 1331 1332 // prepare presentation-placeholder attributes, presentation:object 1333 switch(ePl) 1334 { 1335 case XmlPlaceholderTitle: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("title")); break; 1336 case XmlPlaceholderOutline: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("outline")); break; 1337 case XmlPlaceholderSubtitle: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("subtitle")); break; 1338 case XmlPlaceholderText: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("text")); break; 1339 case XmlPlaceholderGraphic: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("graphic")); break; 1340 case XmlPlaceholderObject: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("object")); break; 1341 case XmlPlaceholderChart: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("chart")); break; 1342 case XmlPlaceholderOrgchart: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("orgchart")); break; 1343 case XmlPlaceholderTable: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("table")); break; 1344 case XmlPlaceholderPage: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("page")); break; 1345 case XmlPlaceholderNotes: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("notes")); break; 1346 case XmlPlaceholderHandout: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("handout")); break; 1347 case XmlPlaceholderVerticalTitle: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("vertical_title")); break; 1348 case XmlPlaceholderVerticalOutline: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("vertical_outline")); break; 1349 } 1350 1351 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_OBJECT, aStr); 1352 1353 // svg:x,y,width,height 1354 GetMM100UnitConverter().convertMeasure(sStringBuffer, rRect.Left()); 1355 aStr = sStringBuffer.makeStringAndClear(); 1356 AddAttribute(XML_NAMESPACE_SVG, XML_X, aStr); 1357 1358 GetMM100UnitConverter().convertMeasure(sStringBuffer, rRect.Top()); 1359 aStr = sStringBuffer.makeStringAndClear(); 1360 AddAttribute(XML_NAMESPACE_SVG, XML_Y, aStr); 1361 1362 GetMM100UnitConverter().convertMeasure(sStringBuffer, rRect.GetWidth()); 1363 aStr = sStringBuffer.makeStringAndClear(); 1364 AddAttribute(XML_NAMESPACE_SVG, XML_WIDTH, aStr); 1365 1366 GetMM100UnitConverter().convertMeasure(sStringBuffer, rRect.GetHeight()); 1367 aStr = sStringBuffer.makeStringAndClear(); 1368 AddAttribute(XML_NAMESPACE_SVG, XML_HEIGHT, aStr); 1369 1370 // write presentation-placeholder 1371 SvXMLElementExport aPPL(*this, XML_NAMESPACE_PRESENTATION, XML_PLACEHOLDER, sal_True, sal_True); 1372 } 1373 1374 ////////////////////////////////////////////////////////////////////////////// 1375 1376 ImpXMLEXPPageMasterInfo* SdXMLExport::ImpGetOrCreatePageMasterInfo( Reference< XDrawPage > xMasterPage ) 1377 { 1378 bool bDoesExist = false; 1379 1380 ImpXMLEXPPageMasterInfo* pNewInfo = new ImpXMLEXPPageMasterInfo(*this, xMasterPage); 1381 1382 // compare with prev page-master infos 1383 for(sal_uInt32 a = 0; !bDoesExist && a < mpPageMasterInfoList->Count(); a++) 1384 { 1385 if(mpPageMasterInfoList->GetObject(a) 1386 && *mpPageMasterInfoList->GetObject(a) == *pNewInfo) 1387 { 1388 delete pNewInfo; 1389 pNewInfo = mpPageMasterInfoList->GetObject(a); 1390 bDoesExist = true; 1391 } 1392 } 1393 // add entry when not found same page-master infos 1394 if(!bDoesExist) 1395 mpPageMasterInfoList->Insert(pNewInfo, LIST_APPEND); 1396 1397 return pNewInfo; 1398 } 1399 1400 void SdXMLExport::ImpPrepPageMasterInfos() 1401 { 1402 if( IsImpress() ) 1403 { 1404 // create page master info for handout master page 1405 1406 Reference< XHandoutMasterSupplier > xHMS( GetModel(), UNO_QUERY ); 1407 if( xHMS.is() ) 1408 { 1409 Reference< XDrawPage > xMasterPage( xHMS->getHandoutMasterPage() ); 1410 if( xMasterPage.is() ) 1411 mpHandoutPageMaster = ImpGetOrCreatePageMasterInfo(xMasterPage); 1412 } 1413 } 1414 1415 // create page master infos for master pages 1416 if(mnDocMasterPageCount) 1417 { 1418 // look for needed page-masters, create these 1419 for (sal_Int32 nMPageId = 0; nMPageId < mnDocMasterPageCount; nMPageId++) 1420 { 1421 Reference< XDrawPage > xMasterPage( mxDocMasterPages->getByIndex(nMPageId), UNO_QUERY ); 1422 ImpXMLEXPPageMasterInfo* pNewInfo = 0L; 1423 1424 if(xMasterPage.is()) 1425 pNewInfo = ImpGetOrCreatePageMasterInfo(xMasterPage); 1426 1427 mpPageMasterUsageList->Insert(pNewInfo, LIST_APPEND); 1428 1429 // look for page master of handout page 1430 if(IsImpress()) 1431 { 1432 pNewInfo = NULL; 1433 Reference< presentation::XPresentationPage > xPresPage(xMasterPage, UNO_QUERY); 1434 if(xPresPage.is()) 1435 { 1436 Reference< XDrawPage > xNotesPage(xPresPage->getNotesPage()); 1437 if(xNotesPage.is()) 1438 { 1439 pNewInfo = ImpGetOrCreatePageMasterInfo(xNotesPage); 1440 } 1441 } 1442 mpNotesPageMasterUsageList->Insert( pNewInfo, LIST_APPEND ); 1443 } 1444 } 1445 } 1446 } 1447 1448 ////////////////////////////////////////////////////////////////////////////// 1449 1450 void SdXMLExport::ImpWritePageMasterInfos() 1451 { 1452 // write created page-masters, create names for these 1453 for(sal_uInt32 nCnt = 0L; nCnt < mpPageMasterInfoList->Count(); nCnt++) 1454 { 1455 ImpXMLEXPPageMasterInfo* pInfo = mpPageMasterInfoList->GetObject(nCnt); 1456 if(pInfo) 1457 { 1458 // create name 1459 OUString sNewName = OUString(RTL_CONSTASCII_USTRINGPARAM("PM")); 1460 1461 sNewName += OUString::valueOf((sal_Int32)nCnt); 1462 pInfo->SetName(sNewName); 1463 1464 // prepare page-master attributes 1465 OUString sString; 1466 OUStringBuffer sStringBuffer; 1467 1468 sString = sNewName; 1469 AddAttribute(XML_NAMESPACE_STYLE, XML_NAME, sString); 1470 1471 // write page-layout 1472 SvXMLElementExport aPME(*this, XML_NAMESPACE_STYLE, XML_PAGE_LAYOUT, sal_True, sal_True); 1473 1474 // prepare style:properties inside page-master 1475 GetMM100UnitConverter().convertMeasure(sStringBuffer, pInfo->GetBorderTop()); 1476 sString = sStringBuffer.makeStringAndClear(); 1477 AddAttribute(XML_NAMESPACE_FO, XML_MARGIN_TOP, sString); 1478 1479 GetMM100UnitConverter().convertMeasure(sStringBuffer, pInfo->GetBorderBottom()); 1480 sString = sStringBuffer.makeStringAndClear(); 1481 AddAttribute(XML_NAMESPACE_FO, XML_MARGIN_BOTTOM, sString); 1482 1483 GetMM100UnitConverter().convertMeasure(sStringBuffer, pInfo->GetBorderLeft()); 1484 sString = sStringBuffer.makeStringAndClear(); 1485 AddAttribute(XML_NAMESPACE_FO, XML_MARGIN_LEFT, sString); 1486 1487 GetMM100UnitConverter().convertMeasure(sStringBuffer, pInfo->GetBorderRight()); 1488 sString = sStringBuffer.makeStringAndClear(); 1489 AddAttribute(XML_NAMESPACE_FO, XML_MARGIN_RIGHT, sString); 1490 1491 GetMM100UnitConverter().convertMeasure(sStringBuffer, pInfo->GetWidth()); 1492 sString = sStringBuffer.makeStringAndClear(); 1493 AddAttribute(XML_NAMESPACE_FO, XML_PAGE_WIDTH, sString); 1494 1495 GetMM100UnitConverter().convertMeasure(sStringBuffer, pInfo->GetHeight()); 1496 sString = sStringBuffer.makeStringAndClear(); 1497 AddAttribute(XML_NAMESPACE_FO, XML_PAGE_HEIGHT, sString); 1498 1499 if(pInfo->GetOrientation() == view::PaperOrientation_PORTRAIT) 1500 AddAttribute(XML_NAMESPACE_STYLE, XML_PRINT_ORIENTATION, XML_PORTRAIT); 1501 else 1502 AddAttribute(XML_NAMESPACE_STYLE, XML_PRINT_ORIENTATION, XML_LANDSCAPE); 1503 1504 // write style:properties 1505 SvXMLElementExport aPMF(*this, XML_NAMESPACE_STYLE, XML_PAGE_LAYOUT_PROPERTIES, sal_True, sal_True); 1506 } 1507 } 1508 } 1509 1510 ////////////////////////////////////////////////////////////////////////////// 1511 1512 ImpXMLEXPPageMasterInfo* SdXMLExport::ImpGetPageMasterInfoByName(const OUString& rName) 1513 { 1514 if(rName.getLength() && mpPageMasterInfoList->Count()) 1515 { 1516 for(sal_uInt32 nCnt = 0L; nCnt < mpPageMasterInfoList->Count(); nCnt++) 1517 { 1518 ImpXMLEXPPageMasterInfo* pInfo = mpPageMasterInfoList->GetObject(nCnt); 1519 if(pInfo) 1520 { 1521 if(pInfo->GetMasterPageName().getLength() && rName.equals(pInfo->GetMasterPageName())) 1522 { 1523 return pInfo; 1524 } 1525 } 1526 } 1527 } 1528 return 0L; 1529 } 1530 1531 ////////////////////////////////////////////////////////////////////////////// 1532 1533 void SdXMLExport::ImpPrepDrawPageInfos() 1534 { 1535 // create draw:style-name entries for page export 1536 // containing presentation page attributes AND background attributes 1537 // fixed family for page-styles is "drawing-page" (XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME) 1538 1539 sal_Int32 nCnt; 1540 for(nCnt = 0; nCnt < mnDocDrawPageCount; nCnt++) 1541 { 1542 Reference<XDrawPage> xDrawPage; 1543 mxDocDrawPages->getByIndex(nCnt) >>= xDrawPage; 1544 maDrawPagesStyleNames[nCnt] = ImpCreatePresPageStyleName( xDrawPage ); 1545 1546 Reference< presentation::XPresentationPage > xPresPage(xDrawPage, UNO_QUERY); 1547 if(xPresPage.is()) 1548 { 1549 maDrawNotesPagesStyleNames[nCnt] = ImpCreatePresPageStyleName( xPresPage->getNotesPage(), false ); 1550 1551 maDrawPagesHeaderFooterSettings[nCnt] = ImpPrepDrawPageHeaderFooterDecls( xDrawPage ); 1552 maDrawNotesPagesHeaderFooterSettings[nCnt] = ImpPrepDrawPageHeaderFooterDecls( xPresPage->getNotesPage() ); 1553 } 1554 } 1555 } 1556 1557 ////////////////////////////////////////////////////////////////////////////// 1558 1559 static OUString findOrAppendImpl( std::vector< OUString >& rVector, const OUString& rText, const sal_Char* pPrefix ) 1560 { 1561 // search rVector if there is already a string that equals rText 1562 std::vector< OUString >::iterator aIter; 1563 sal_Int32 nIndex; 1564 for( nIndex = 1, aIter = rVector.begin(); aIter != rVector.end(); aIter++, nIndex++ ) 1565 { 1566 if( (*aIter) == rText ) 1567 break; 1568 } 1569 1570 // if nothing is found, append the string at the end of rVector 1571 if( aIter == rVector.end() ) 1572 rVector.push_back( rText ); 1573 1574 // create a reference string with pPrefix and the index of the 1575 // found or created rText 1576 OUString aStr( OUString::createFromAscii( pPrefix ) ); 1577 aStr += OUString::valueOf( nIndex ); 1578 return aStr; 1579 } 1580 1581 static OUString findOrAppendImpl( std::vector< DateTimeDeclImpl >& rVector, const OUString& rText, sal_Bool bFixed, sal_Int32 nFormat, const sal_Char* pPrefix ) 1582 { 1583 // search rVector if there is already a DateTimeDeclImpl with rText,bFixed and nFormat 1584 std::vector< DateTimeDeclImpl >::iterator aIter; 1585 sal_Int32 nIndex; 1586 for( nIndex = 1, aIter = rVector.begin(); aIter != rVector.end(); aIter++, nIndex++ ) 1587 { 1588 const DateTimeDeclImpl& rDecl = (*aIter); 1589 if( (rDecl.mbFixed == bFixed ) && 1590 (!bFixed || rDecl.maStrText == rText) && 1591 (bFixed || (rDecl.mnFormat == nFormat) ) ) 1592 break; 1593 } 1594 1595 // if nothing is found, append a new DateTimeDeclImpl 1596 if( aIter == rVector.end() ) 1597 { 1598 DateTimeDeclImpl aDecl; 1599 aDecl.maStrText = rText; 1600 aDecl.mbFixed = bFixed; 1601 aDecl.mnFormat = nFormat; 1602 rVector.push_back( aDecl ); 1603 } 1604 1605 // create a reference string with pPrefix and the index of the 1606 // found or created DateTimeDeclImpl 1607 OUString aStr( OUString::createFromAscii( pPrefix ) ); 1608 aStr += OUString::valueOf( nIndex ); 1609 return aStr; 1610 1611 } 1612 1613 static const sal_Char* gpStrHeaderTextPrefix = "hdr"; 1614 static const sal_Char* gpStrFooterTextPrefix = "ftr"; 1615 static const sal_Char* gpStrDateTimeTextPrefix = "dtd"; 1616 1617 HeaderFooterPageSettingsImpl SdXMLExport::ImpPrepDrawPageHeaderFooterDecls( const Reference<XDrawPage>& xDrawPage ) 1618 { 1619 HeaderFooterPageSettingsImpl aSettings; 1620 1621 if( xDrawPage.is() ) try 1622 { 1623 Reference< XPropertySet > xSet( xDrawPage, UNO_QUERY_THROW ); 1624 Reference< XPropertySetInfo > xInfo( xSet->getPropertySetInfo() ); 1625 1626 OUString aStrText; 1627 1628 const OUString aStrHeaderTextProp( RTL_CONSTASCII_USTRINGPARAM( "HeaderText" ) ); 1629 if( xInfo->hasPropertyByName( aStrHeaderTextProp ) ) 1630 { 1631 xSet->getPropertyValue( aStrHeaderTextProp ) >>= aStrText; 1632 if( aStrText.getLength() ) 1633 aSettings.maStrHeaderDeclName = findOrAppendImpl( maHeaderDeclsVector, aStrText, gpStrHeaderTextPrefix ); 1634 } 1635 1636 const OUString aStrFooterTextProp( RTL_CONSTASCII_USTRINGPARAM( "FooterText" ) ); 1637 if( xInfo->hasPropertyByName( aStrFooterTextProp ) ) 1638 { 1639 xSet->getPropertyValue( aStrFooterTextProp ) >>= aStrText; 1640 if( aStrText.getLength() ) 1641 aSettings.maStrFooterDeclName = findOrAppendImpl( maFooterDeclsVector, aStrText, gpStrFooterTextPrefix ); 1642 } 1643 1644 const OUString aStrDateTimeTextProp( RTL_CONSTASCII_USTRINGPARAM( "DateTimeText" ) ); 1645 if( xInfo->hasPropertyByName( aStrDateTimeTextProp ) ) 1646 { 1647 sal_Bool bFixed = false; 1648 sal_Int32 nFormat = 0; 1649 xSet->getPropertyValue( aStrDateTimeTextProp ) >>= aStrText; 1650 xSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsDateTimeFixed" ) ) ) >>= bFixed; 1651 xSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DateTimeFormat" ) ) ) >>= nFormat; 1652 1653 if( !bFixed || aStrText.getLength() ) 1654 { 1655 aSettings.maStrDateTimeDeclName = findOrAppendImpl( maDateTimeDeclsVector, aStrText, bFixed, nFormat, gpStrDateTimeTextPrefix ); 1656 if( !bFixed ) 1657 addDataStyle( nFormat ); 1658 } 1659 } 1660 } 1661 catch( Exception& e ) 1662 { 1663 (void)e; 1664 DBG_ERROR( "SdXMLExport::ImpPrepDrawPageHeaderFooterDecls(), unexpected exception cought!" ); 1665 } 1666 1667 return aSettings; 1668 } 1669 1670 ////////////////////////////////////////////////////////////////////////////// 1671 1672 void SdXMLExport::ImpWriteHeaderFooterDecls() 1673 { 1674 OUStringBuffer sBuffer; 1675 1676 if( !maHeaderDeclsVector.empty() ) 1677 { 1678 // export header decls 1679 const OUString aPrefix( OUString::createFromAscii( gpStrHeaderTextPrefix ) ); 1680 std::vector< OUString >::iterator aIter; 1681 sal_Int32 nIndex; 1682 for( nIndex = 1, aIter = maHeaderDeclsVector.begin(); aIter != maHeaderDeclsVector.end(); aIter++, nIndex++ ) 1683 { 1684 sBuffer.append( aPrefix ); 1685 sBuffer.append( nIndex ); 1686 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_NAME, sBuffer.makeStringAndClear()); 1687 1688 SvXMLElementExport aElem(*this, XML_NAMESPACE_PRESENTATION, XML_HEADER_DECL, sal_True, sal_True); 1689 Characters((*aIter)); 1690 } 1691 } 1692 1693 if( !maFooterDeclsVector.empty() ) 1694 { 1695 // export footer decls 1696 const OUString aPrefix( OUString::createFromAscii( gpStrFooterTextPrefix ) ); 1697 std::vector< OUString >::iterator aIter; 1698 sal_Int32 nIndex; 1699 for( nIndex = 1, aIter = maFooterDeclsVector.begin(); aIter != maFooterDeclsVector.end(); aIter++, nIndex++ ) 1700 { 1701 sBuffer.append( aPrefix ); 1702 sBuffer.append( nIndex ); 1703 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_NAME, sBuffer.makeStringAndClear()); 1704 1705 SvXMLElementExport aElem(*this, XML_NAMESPACE_PRESENTATION, XML_FOOTER_DECL, sal_False, sal_False); 1706 Characters((*aIter)); 1707 } 1708 } 1709 1710 if( !maDateTimeDeclsVector.empty() ) 1711 { 1712 // export footer decls 1713 const OUString aPrefix( OUString::createFromAscii( gpStrDateTimeTextPrefix ) ); 1714 std::vector< DateTimeDeclImpl >::iterator aIter; 1715 sal_Int32 nIndex; 1716 for( nIndex = 1, aIter = maDateTimeDeclsVector.begin(); aIter != maDateTimeDeclsVector.end(); aIter++, nIndex++ ) 1717 { 1718 const DateTimeDeclImpl& rDecl = (*aIter); 1719 1720 sBuffer.append( aPrefix ); 1721 sBuffer.append( nIndex ); 1722 AddAttribute( XML_NAMESPACE_PRESENTATION, XML_NAME, sBuffer.makeStringAndClear()); 1723 1724 AddAttribute( XML_NAMESPACE_PRESENTATION, XML_SOURCE, rDecl.mbFixed ? XML_FIXED : XML_CURRENT_DATE ); 1725 1726 if( !rDecl.mbFixed ) 1727 AddAttribute( XML_NAMESPACE_STYLE, XML_DATA_STYLE_NAME, getDataStyleName( rDecl.mnFormat ) ); 1728 1729 SvXMLElementExport aElem(*this, XML_NAMESPACE_PRESENTATION, XML_DATE_TIME_DECL, sal_False, sal_False); 1730 if( rDecl.mbFixed ) 1731 Characters(rDecl.maStrText); 1732 } 1733 } 1734 } 1735 1736 void SdXMLExport::ImplExportHeaderFooterDeclAttributes( const HeaderFooterPageSettingsImpl& aSettings ) 1737 { 1738 if( aSettings.maStrHeaderDeclName.getLength() ) 1739 AddAttribute( XML_NAMESPACE_PRESENTATION, XML_USE_HEADER_NAME, aSettings.maStrHeaderDeclName ); 1740 1741 if( aSettings.maStrFooterDeclName.getLength() ) 1742 AddAttribute( XML_NAMESPACE_PRESENTATION, XML_USE_FOOTER_NAME, aSettings.maStrFooterDeclName ); 1743 1744 if( aSettings.maStrDateTimeDeclName.getLength() ) 1745 AddAttribute( XML_NAMESPACE_PRESENTATION, XML_USE_DATE_TIME_NAME, aSettings.maStrDateTimeDeclName ); 1746 } 1747 1748 ////////////////////////////////////////////////////////////////////////////// 1749 1750 OUString SdXMLExport::ImpCreatePresPageStyleName( Reference<XDrawPage> xDrawPage, bool bExportBackground /* = true */ ) 1751 { 1752 // create name 1753 OUString sStyleName; 1754 1755 // create style for this page and add to auto style pool 1756 1757 Reference< beans::XPropertySet > xPropSet1(xDrawPage, UNO_QUERY); 1758 if(xPropSet1.is()) 1759 { 1760 Reference< beans::XPropertySet > xPropSet; 1761 1762 if( bExportBackground ) 1763 { 1764 // since the background items are in a different propertyset 1765 // which itself is a property of the pages property set 1766 // we now merge these two propertysets if possible to simulate 1767 // a single propertyset with all draw page properties 1768 const OUString aBackground(RTL_CONSTASCII_USTRINGPARAM("Background")); 1769 Reference< beans::XPropertySet > xPropSet2; 1770 Reference< beans::XPropertySetInfo > xInfo( xPropSet1->getPropertySetInfo() ); 1771 if( xInfo.is() && xInfo->hasPropertyByName( aBackground ) ) 1772 { 1773 Any aAny( xPropSet1->getPropertyValue( aBackground ) ); 1774 aAny >>= xPropSet2; 1775 } 1776 1777 if( xPropSet2.is() ) 1778 xPropSet = PropertySetMerger_CreateInstance( xPropSet1, xPropSet2 ); 1779 else 1780 xPropSet = xPropSet1; 1781 } 1782 else 1783 { 1784 xPropSet = xPropSet1; 1785 } 1786 1787 const UniReference< SvXMLExportPropertyMapper > aMapperRef( GetPresPagePropsMapper() ); 1788 1789 std::vector< XMLPropertyState > xPropStates( aMapperRef->Filter( xPropSet ) ); 1790 1791 if( !xPropStates.empty() ) 1792 { 1793 // there are filtered properties -> hard attributes 1794 // try to find this style in AutoStylePool 1795 sStyleName = GetAutoStylePool()->Find(XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID, sStyleName, xPropStates); 1796 1797 if(!sStyleName.getLength()) 1798 { 1799 // Style did not exist, add it to AutoStalePool 1800 sStyleName = GetAutoStylePool()->Add(XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID, sStyleName, xPropStates); 1801 } 1802 } 1803 } 1804 1805 return sStyleName; 1806 } 1807 1808 ////////////////////////////////////////////////////////////////////////////// 1809 1810 void SdXMLExport::ImpPrepMasterPageInfos() 1811 { 1812 // create draw:style-name entries for master page export 1813 // containing only background attributes 1814 // fixed family for page-styles is "drawing-page" (XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME) 1815 1816 sal_Int32 nCnt; 1817 for( nCnt = 0; nCnt < mnDocMasterPageCount; nCnt++) 1818 { 1819 Reference<XDrawPage> xDrawPage; 1820 mxDocMasterPages->getByIndex(nCnt) >>= xDrawPage; 1821 maMasterPagesStyleNames[nCnt] = ImpCreatePresPageStyleName( xDrawPage ); 1822 } 1823 1824 if( IsImpress() ) 1825 { 1826 Reference< presentation::XHandoutMasterSupplier > xHandoutSupp( GetModel(), UNO_QUERY ); 1827 if( xHandoutSupp.is() ) 1828 { 1829 Reference< XDrawPage > xHandoutPage( xHandoutSupp->getHandoutMasterPage() ); 1830 if( xHandoutPage.is() ) 1831 { 1832 maHandoutPageHeaderFooterSettings = ImpPrepDrawPageHeaderFooterDecls( xHandoutPage ); 1833 maHandoutMasterStyleName = ImpCreatePresPageStyleName( xHandoutPage, false ); 1834 } 1835 } 1836 } 1837 } 1838 1839 ////////////////////////////////////////////////////////////////////////////// 1840 void SdXMLExport::ImpWritePresentationStyles() 1841 { 1842 if(IsImpress()) 1843 { 1844 for (sal_Int32 nCnt = 0; nCnt < mnDocMasterPageCount; nCnt++) 1845 { 1846 Any aAny(mxDocMasterPages->getByIndex(nCnt)); 1847 Reference<container::XNamed> xNamed; 1848 1849 if(aAny >>= xNamed) 1850 { 1851 // write presentation styles (ONLY if presentation) 1852 if(IsImpress() && mxDocStyleFamilies.is() && xNamed.is()) 1853 { 1854 XMLStyleExport aStEx(*this, OUString(), GetAutoStylePool().get()); 1855 const UniReference< SvXMLExportPropertyMapper > aMapperRef( GetPropertySetMapper() ); 1856 1857 OUString aPrefix( xNamed->getName() ); 1858 1859 aPrefix += OUString(RTL_CONSTASCII_USTRINGPARAM("-")); 1860 aStEx.exportStyleFamily(xNamed->getName(), 1861 OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_PRESENTATION_NAME)), 1862 aMapperRef, sal_False, 1863 XML_STYLE_FAMILY_SD_PRESENTATION_ID, &aPrefix); 1864 } 1865 } 1866 } 1867 } 1868 } 1869 1870 ////////////////////////////////////////////////////////////////////////////// 1871 1872 void SdXMLExport::SetProgress(sal_Int32 nProg) 1873 { 1874 // set progress view 1875 if(GetStatusIndicator().is()) 1876 GetStatusIndicator()->setValue(nProg); 1877 } 1878 1879 ////////////////////////////////////////////////////////////////////////////// 1880 // #82003# 1881 1882 void SdXMLExport::_ExportMeta() 1883 { 1884 uno::Sequence<beans::NamedValue> stats(1); 1885 stats[0] = beans::NamedValue(::rtl::OUString::createFromAscii("ObjectCount"), 1886 uno::makeAny(mnObjectCount)); 1887 1888 // update document statistics at the model 1889 uno::Reference<document::XDocumentPropertiesSupplier> xPropSup(GetModel(), 1890 uno::UNO_QUERY_THROW); 1891 uno::Reference<document::XDocumentProperties> xDocProps( 1892 xPropSup->getDocumentProperties()); 1893 if (xDocProps.is()) { 1894 xDocProps->setDocumentStatistics(stats); 1895 } 1896 1897 // call parent 1898 SvXMLExport::_ExportMeta(); 1899 } 1900 1901 ////////////////////////////////////////////////////////////////////////////// 1902 1903 void SdXMLExport::_ExportContent() 1904 { 1905 // export <pres:header-decl>, <pres:footer-decl> and <pres:date-time-decl> elements 1906 ImpWriteHeaderFooterDecls(); 1907 1908 // page export 1909 for(sal_Int32 nPageInd(0); nPageInd < mnDocDrawPageCount; nPageInd++) 1910 { 1911 uno::Reference<drawing::XDrawPage> xDrawPage( mxDocDrawPages->getByIndex(nPageInd), uno::UNO_QUERY ); 1912 1913 SetProgress(((nPageInd + 1) * 100) / mnDocDrawPageCount); 1914 1915 if(xDrawPage.is()) 1916 { 1917 // prepare page attributes, name of page 1918 Reference < container::XNamed > xNamed(xDrawPage, UNO_QUERY); 1919 if(xNamed.is()) 1920 AddAttribute(XML_NAMESPACE_DRAW, XML_NAME, xNamed->getName()); 1921 1922 // draw:style-name (presentation page attributes AND background attributes) 1923 if( maDrawPagesStyleNames[nPageInd].getLength() ) 1924 AddAttribute(XML_NAMESPACE_DRAW, XML_STYLE_NAME, 1925 maDrawPagesStyleNames[nPageInd]); 1926 1927 // draw:master-page-name 1928 Reference < drawing::XMasterPageTarget > xMasterPageInt(xDrawPage, UNO_QUERY); 1929 if(xMasterPageInt.is()) 1930 { 1931 Reference<XDrawPage> xUsedMasterPage(xMasterPageInt->getMasterPage()); 1932 if(xUsedMasterPage.is()) 1933 { 1934 Reference < container::XNamed > xMasterNamed(xUsedMasterPage, UNO_QUERY); 1935 if(xMasterNamed.is()) 1936 { 1937 AddAttribute(XML_NAMESPACE_DRAW, XML_MASTER_PAGE_NAME, 1938 EncodeStyleName( xMasterNamed->getName()) ); 1939 } 1940 } 1941 } 1942 1943 // presentation:page-layout-name 1944 if( IsImpress() && maDrawPagesAutoLayoutNames[nPageInd+1].getLength()) 1945 { 1946 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_PRESENTATION_PAGE_LAYOUT_NAME, maDrawPagesAutoLayoutNames[nPageInd+1] ); 1947 } 1948 1949 Reference< beans::XPropertySet > xProps( xDrawPage, UNO_QUERY ); 1950 if( xProps.is() ) 1951 { 1952 try 1953 { 1954 OUString aBookmarkURL; 1955 xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "BookmarkURL" ) ) ) >>= aBookmarkURL; 1956 1957 if( aBookmarkURL.getLength() ) 1958 { 1959 sal_Int32 nIndex = aBookmarkURL.lastIndexOf( (sal_Unicode)'#' ); 1960 if( nIndex != -1 ) 1961 { 1962 OUString aFileName( aBookmarkURL.copy( 0, nIndex ) ); 1963 OUString aBookmarkName( aBookmarkURL.copy( nIndex+1 ) ); 1964 1965 aBookmarkURL = GetRelativeReference( aFileName ); 1966 aBookmarkURL += String( '#' ); 1967 aBookmarkURL += aBookmarkName; 1968 } 1969 1970 AddAttribute ( XML_NAMESPACE_XLINK, XML_HREF, aBookmarkURL); 1971 AddAttribute ( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); 1972 AddAttribute ( XML_NAMESPACE_XLINK, XML_SHOW, XML_REPLACE ); 1973 AddAttribute ( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONREQUEST ); 1974 } 1975 } 1976 catch( Exception& ) 1977 { 1978 DBG_ERROR(" no \"BookmarkURL\" property at page?" ); 1979 } 1980 } 1981 1982 if( IsImpress() ) 1983 ImplExportHeaderFooterDeclAttributes( maDrawPagesHeaderFooterSettings[nPageInd] ); 1984 1985 1986 OUString sNavigationOrder( getNavigationOrder( xDrawPage ) ); 1987 if( sNavigationOrder.getLength() != 0 ) 1988 AddAttribute ( XML_NAMESPACE_DRAW, XML_NAV_ORDER, sNavigationOrder ); 1989 1990 UniReference< xmloff::AnimationsExporter > xAnimationsExporter; 1991 uno::Reference< ::com::sun::star::animations::XAnimationNodeSupplier > xAnimNodeSupplier; 1992 1993 // prepare animation export 1994 if(IsImpress()) 1995 { 1996 if( getExportFlags() & EXPORT_OASIS ) 1997 { 1998 // export new animations for oasis format 1999 xAnimNodeSupplier.set( xDrawPage, UNO_QUERY ); 2000 2001 // prepare animations exporter if impress 2002 if(xAnimNodeSupplier.is()) 2003 { 2004 xAnimationsExporter = new xmloff::AnimationsExporter( *this, xProps ); 2005 xAnimationsExporter->prepare( xAnimNodeSupplier->getAnimationNode() ); 2006 } 2007 } 2008 else 2009 { 2010 // export old animations for ooo format 2011 UniReference< XMLAnimationsExporter > xAnimExport = new XMLAnimationsExporter( GetShapeExport().get() ); 2012 GetShapeExport()->setAnimationsExporter( xAnimExport ); 2013 } 2014 } 2015 2016 // write draw:id 2017 const OUString aPageId = getInterfaceToIdentifierMapper().getIdentifier( xDrawPage ); 2018 if( aPageId.getLength() != 0 ) 2019 { 2020 AddAttributeIdLegacy(XML_NAMESPACE_DRAW, aPageId); 2021 } 2022 2023 // write page 2024 SvXMLElementExport aDPG(*this, XML_NAMESPACE_DRAW, XML_PAGE, sal_True, sal_True); 2025 2026 // write optional office:forms 2027 exportFormsElement( xDrawPage ); 2028 2029 // write graphic objects on this page (if any) 2030 Reference< drawing::XShapes > xExportShapes(xDrawPage, UNO_QUERY); 2031 if(xExportShapes.is() && xExportShapes->getCount()) 2032 GetShapeExport()->exportShapes( xExportShapes ); 2033 2034 // write animations and presentation notes (ONLY if presentation) 2035 if(IsImpress()) 2036 { 2037 if(xAnimNodeSupplier.is()) 2038 { 2039 xAnimationsExporter->exportAnimations( xAnimNodeSupplier->getAnimationNode() ); 2040 } 2041 else 2042 { 2043 // animations 2044 UniReference< XMLAnimationsExporter > xAnimExport( GetShapeExport()->getAnimationsExporter() ); 2045 if( xAnimExport.is() ) 2046 xAnimExport->exportAnimations( *this ); 2047 2048 xAnimExport = NULL; 2049 GetShapeExport()->setAnimationsExporter( xAnimExport ); 2050 } 2051 2052 // presentations 2053 Reference< presentation::XPresentationPage > xPresPage(xDrawPage, UNO_QUERY); 2054 if(xPresPage.is()) 2055 { 2056 Reference< XDrawPage > xNotesPage(xPresPage->getNotesPage()); 2057 if(xNotesPage.is()) 2058 { 2059 Reference< drawing::XShapes > xShapes(xNotesPage, UNO_QUERY); 2060 if(xShapes.is()) 2061 { 2062 if( maDrawNotesPagesStyleNames[nPageInd].getLength() ) 2063 AddAttribute(XML_NAMESPACE_DRAW, XML_STYLE_NAME, maDrawNotesPagesStyleNames[nPageInd]); 2064 2065 ImplExportHeaderFooterDeclAttributes( maDrawNotesPagesHeaderFooterSettings[nPageInd] ); 2066 2067 // write presentation notes 2068 SvXMLElementExport aPSY(*this, XML_NAMESPACE_PRESENTATION, XML_NOTES, sal_True, sal_True); 2069 2070 // write optional office:forms 2071 exportFormsElement( xNotesPage ); 2072 2073 // write shapes per se 2074 GetShapeExport()->exportShapes( xShapes ); 2075 } 2076 } 2077 } 2078 } 2079 2080 exportAnnotations( xDrawPage ); 2081 } 2082 } 2083 2084 if( IsImpress() ) 2085 exportPresentationSettings(); 2086 } 2087 2088 ////////////////////////////////////////////////////////////////////////////// 2089 2090 void SdXMLExport::exportPresentationSettings() 2091 { 2092 try 2093 { 2094 Reference< XPresentationSupplier > xPresSupplier( GetModel(), UNO_QUERY ); 2095 if( !xPresSupplier.is() ) 2096 return; 2097 2098 Reference< XPropertySet > xPresProps( xPresSupplier->getPresentation(), UNO_QUERY ); 2099 if( !xPresProps.is() ) 2100 return; 2101 2102 sal_Bool bHasAttr = sal_False; 2103 2104 sal_Bool bTemp = false; 2105 2106 // export range 2107 xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsShowAll" ) ) ) >>= bTemp; 2108 if( !bTemp ) 2109 { 2110 OUString aFirstPage; 2111 xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "FirstPage" ) ) ) >>= aFirstPage; 2112 if( aFirstPage.getLength() ) 2113 { 2114 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_START_PAGE, aFirstPage ); 2115 bHasAttr = sal_True; 2116 } 2117 else 2118 { 2119 OUString aCustomShow; 2120 xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "CustomShow" ) ) ) >>= aCustomShow; 2121 if( aCustomShow.getLength() ) 2122 { 2123 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_SHOW, aCustomShow ); 2124 bHasAttr = sal_True; 2125 } 2126 } 2127 } 2128 2129 xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsEndless" ) ) ) >>= bTemp; 2130 if( bTemp ) 2131 { 2132 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_ENDLESS, XML_TRUE ); 2133 bHasAttr = sal_True; 2134 2135 sal_Int32 nPause = 0; 2136 xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Pause" ) ) ) >>= nPause; 2137 2138 util::DateTime aTime( 0, (sal_uInt16)nPause, 0, 0, 0, 0, 0 ); 2139 2140 OUStringBuffer aOut; 2141 SvXMLUnitConverter::convertTime( aOut, aTime ); 2142 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_PAUSE, aOut.makeStringAndClear() ); 2143 } 2144 2145 xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AllowAnimations" ) ) ) >>= bTemp; 2146 if( !bTemp ) 2147 { 2148 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_ANIMATIONS, XML_DISABLED ); 2149 bHasAttr = sal_True; 2150 } 2151 2152 xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsAlwaysOnTop" ) ) ) >>= bTemp; 2153 if( bTemp ) 2154 { 2155 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_STAY_ON_TOP, XML_TRUE ); 2156 bHasAttr = sal_True; 2157 } 2158 2159 xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsAutomatic" ) ) ) >>= bTemp; 2160 if( bTemp ) 2161 { 2162 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_FORCE_MANUAL, XML_TRUE ); 2163 bHasAttr = sal_True; 2164 } 2165 2166 xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFullScreen" ) ) ) >>= bTemp; 2167 if( !bTemp ) 2168 { 2169 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_FULL_SCREEN, XML_FALSE ); 2170 bHasAttr = sal_True; 2171 } 2172 2173 xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsMouseVisible" ) ) ) >>= bTemp; 2174 if( !bTemp ) 2175 { 2176 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_MOUSE_VISIBLE, XML_FALSE ); 2177 bHasAttr = sal_True; 2178 } 2179 2180 xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "StartWithNavigator" ) ) ) >>= bTemp; 2181 if( bTemp ) 2182 { 2183 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_START_WITH_NAVIGATOR, XML_TRUE ); 2184 bHasAttr = sal_True; 2185 } 2186 2187 xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "UsePen" ) ) ) >>= bTemp; 2188 if( bTemp ) 2189 { 2190 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_MOUSE_AS_PEN, XML_TRUE ); 2191 bHasAttr = sal_True; 2192 } 2193 2194 xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsTransitionOnClick" ) ) ) >>= bTemp; 2195 if( !bTemp ) 2196 { 2197 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_TRANSITION_ON_CLICK, XML_DISABLED ); 2198 bHasAttr = sal_True; 2199 } 2200 2201 xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsShowLogo" ) ) ) >>= bTemp; 2202 if( bTemp ) 2203 { 2204 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_SHOW_LOGO, XML_TRUE ); 2205 bHasAttr = sal_True; 2206 } 2207 2208 Reference< container::XNameContainer > xShows; 2209 Sequence< OUString > aShowNames; 2210 const OUString* pShowNames = NULL; 2211 sal_Int32 nShowCount = 0; 2212 2213 Reference< XCustomPresentationSupplier > xSup( GetModel(), UNO_QUERY ); 2214 if( xSup.is() ) 2215 { 2216 xShows = xSup->getCustomPresentations(); 2217 if( xShows.is() ) 2218 { 2219 aShowNames = xShows->getElementNames(); 2220 pShowNames = aShowNames.getArray(); 2221 nShowCount = aShowNames.getLength(); 2222 } 2223 } 2224 2225 if( bHasAttr || nShowCount != 0 ) 2226 { 2227 SvXMLElementExport aSettings(*this, XML_NAMESPACE_PRESENTATION, XML_SETTINGS, sal_True, sal_True); 2228 2229 if( nShowCount == 0 ) 2230 return; 2231 2232 Reference< XIndexContainer > xShow; 2233 Reference< XNamed > xPageName; 2234 2235 OUStringBuffer sTmp; 2236 2237 for( sal_Int32 nIndex = 0; nIndex < nShowCount; nIndex++, pShowNames++ ) 2238 { 2239 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_NAME, *pShowNames ); 2240 2241 xShows->getByName( *pShowNames ) >>= xShow; 2242 DBG_ASSERT( xShow.is(), "invalid custom show!" ); 2243 if( !xShow.is() ) 2244 continue; 2245 2246 const sal_Int32 nPageCount = xShow->getCount(); 2247 for( sal_Int32 nPage = 0; nPage < nPageCount; nPage++ ) 2248 { 2249 xShow->getByIndex( nPage ) >>= xPageName; 2250 2251 if( !xPageName.is() ) 2252 continue; 2253 2254 if( sTmp.getLength() != 0 ) 2255 sTmp.append( sal_Unicode( ',' ) ); 2256 sTmp.append( xPageName->getName() ); 2257 2258 } 2259 2260 if( sTmp.getLength() ) 2261 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_PAGES, sTmp.makeStringAndClear() ); 2262 2263 SvXMLElementExport aShows(*this, XML_NAMESPACE_PRESENTATION, XML_SHOW, sal_True, sal_True); 2264 } 2265 } 2266 } 2267 catch( uno::Exception ) 2268 { 2269 DBG_ERROR( "uno::Exception while exporting <presentation:settings>" ); 2270 } 2271 } 2272 2273 ////////////////////////////////////////////////////////////////////////////// 2274 2275 void SdXMLExport::_ExportStyles(sal_Bool bUsed) 2276 { 2277 GetPropertySetMapper()->SetAutoStyles( sal_False ); 2278 2279 // export fill styles 2280 SvXMLExport::_ExportStyles( bUsed ); 2281 2282 // write draw:style-name for object graphic-styles 2283 GetShapeExport()->ExportGraphicDefaults(); 2284 2285 // do not export in ODF 1.1 or older 2286 if( getDefaultVersion() >= SvtSaveOptions::ODFVER_012 ) 2287 GetShapeExport()->GetShapeTableExport()->exportTableStyles(); 2288 2289 // write presentation styles 2290 ImpWritePresentationStyles(); 2291 2292 // prepare draw:auto-layout-name for page export 2293 ImpPrepAutoLayoutInfos(); 2294 2295 // write draw:auto-layout-name for page export 2296 ImpWriteAutoLayoutInfos(); 2297 2298 Reference< beans::XPropertySet > xInfoSet( getExportInfo() ); 2299 if( xInfoSet.is() ) 2300 { 2301 Reference< beans::XPropertySetInfo > xInfoSetInfo( xInfoSet->getPropertySetInfo() ); 2302 2303 Any aAny; 2304 2305 if( xInfoSetInfo->hasPropertyByName( msPageLayoutNames ) ) 2306 { 2307 aAny <<= maDrawPagesAutoLayoutNames; 2308 xInfoSet->setPropertyValue( msPageLayoutNames, aAny ); 2309 } 2310 } 2311 } 2312 2313 ////////////////////////////////////////////////////////////////////////////// 2314 2315 void SdXMLExport::_ExportAutoStyles() 2316 { 2317 Reference< beans::XPropertySet > xInfoSet( getExportInfo() ); 2318 if( xInfoSet.is() ) 2319 { 2320 Reference< beans::XPropertySetInfo > xInfoSetInfo( xInfoSet->getPropertySetInfo() ); 2321 2322 if( xInfoSetInfo->hasPropertyByName( msPageLayoutNames ) ) 2323 { 2324 xInfoSet->getPropertyValue( msPageLayoutNames ) >>= maDrawPagesAutoLayoutNames; 2325 } 2326 } 2327 2328 GetPropertySetMapper()->SetAutoStyles( sal_True ); 2329 2330 if( getExportFlags() & EXPORT_STYLES ) 2331 { 2332 // #80012# PageMaster export moved from _ExportStyles 2333 // prepare page-master infos 2334 ImpPrepPageMasterInfos(); 2335 2336 // write page-master infos 2337 ImpWritePageMasterInfos(); 2338 2339 // prepare draw:style-name for master page export 2340 ImpPrepMasterPageInfos(); 2341 } 2342 2343 if( getExportFlags() & EXPORT_CONTENT ) 2344 { 2345 // prepare draw:style-name for page export 2346 ImpPrepDrawPageInfos(); 2347 } 2348 2349 // export draw-page styles 2350 GetAutoStylePool()->exportXML( 2351 XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID 2352 , GetDocHandler(), 2353 GetMM100UnitConverter(), 2354 GetNamespaceMap() 2355 ); 2356 2357 if( getExportFlags() & EXPORT_STYLES ) 2358 { 2359 // create auto style infos for shapes on master handout page 2360 if( IsImpress() ) 2361 { 2362 Reference< presentation::XHandoutMasterSupplier > xHandoutSupp( GetModel(), UNO_QUERY ); 2363 if( xHandoutSupp.is() ) 2364 { 2365 Reference< XDrawPage > xHandoutPage( xHandoutSupp->getHandoutMasterPage() ); 2366 if( xHandoutPage.is() ) 2367 { 2368 Reference< drawing::XShapes > xShapes(xHandoutPage, UNO_QUERY); 2369 if(xShapes.is() && xShapes->getCount()) 2370 GetShapeExport()->collectShapesAutoStyles( xShapes ); 2371 } 2372 } 2373 } 2374 2375 // create auto style infos for objects on master pages 2376 for(sal_Int32 nMPageId(0L); nMPageId < mnDocMasterPageCount; nMPageId++) 2377 { 2378 Reference< XDrawPage > xMasterPage(mxDocMasterPages->getByIndex(nMPageId), UNO_QUERY ); 2379 2380 if( xMasterPage.is() ) 2381 { 2382 // collect layer information 2383 GetFormExport()->examineForms( xMasterPage ); 2384 2385 // get MasterPage Name 2386 OUString aMasterPageNamePrefix; 2387 Reference < container::XNamed > xNamed(xMasterPage, UNO_QUERY); 2388 if(xNamed.is()) 2389 { 2390 aMasterPageNamePrefix = xNamed->getName(); 2391 } 2392 if(aMasterPageNamePrefix.getLength()) 2393 { 2394 aMasterPageNamePrefix += OUString(RTL_CONSTASCII_USTRINGPARAM("-")); 2395 } 2396 GetShapeExport()->setPresentationStylePrefix( aMasterPageNamePrefix ); 2397 2398 Reference< drawing::XShapes > xMasterShapes(xMasterPage, UNO_QUERY); 2399 if(xMasterShapes.is() && xMasterShapes->getCount()) 2400 GetShapeExport()->collectShapesAutoStyles( xMasterShapes ); 2401 2402 if(IsImpress()) 2403 { 2404 Reference< presentation::XPresentationPage > xPresPage(xMasterPage, UNO_QUERY); 2405 if(xPresPage.is()) 2406 { 2407 Reference< XDrawPage > xNotesPage(xPresPage->getNotesPage()); 2408 if(xNotesPage.is()) 2409 { 2410 // collect layer information 2411 GetFormExport()->examineForms( xNotesPage ); 2412 2413 Reference< drawing::XShapes > xShapes(xNotesPage, UNO_QUERY); 2414 if(xShapes.is() && xShapes->getCount()) 2415 GetShapeExport()->collectShapesAutoStyles( xShapes ); 2416 } 2417 } 2418 } 2419 collectAnnotationAutoStyles(xMasterPage); 2420 } 2421 } 2422 } 2423 2424 if( getExportFlags() & EXPORT_CONTENT ) 2425 { 2426 // prepare animations exporter if impress 2427 if(IsImpress() && ((getExportFlags() & EXPORT_OASIS) == 0) ) 2428 { 2429 UniReference< XMLAnimationsExporter > xAnimExport = new XMLAnimationsExporter( GetShapeExport().get() ); 2430 GetShapeExport()->setAnimationsExporter( xAnimExport ); 2431 } 2432 2433 // create auto style infos for objects on pages 2434 for(sal_Int32 nPageInd(0); nPageInd < mnDocDrawPageCount; nPageInd++) 2435 { 2436 Reference<XDrawPage> xDrawPage( mxDocDrawPages->getByIndex(nPageInd), UNO_QUERY ); 2437 if( xDrawPage.is() ) 2438 { 2439 // collect layer information 2440 GetFormExport()->examineForms( xDrawPage ); 2441 2442 // get MasterPage Name 2443 OUString aMasterPageNamePrefix; 2444 Reference < drawing::XMasterPageTarget > xMasterPageInt(xDrawPage, UNO_QUERY); 2445 if(xMasterPageInt.is()) 2446 { 2447 Reference<XDrawPage> xUsedMasterPage(xMasterPageInt->getMasterPage()); 2448 if(xUsedMasterPage.is()) 2449 { 2450 Reference < container::XNamed > xMasterNamed(xUsedMasterPage, UNO_QUERY); 2451 if(xMasterNamed.is()) 2452 { 2453 aMasterPageNamePrefix = xMasterNamed->getName(); 2454 } 2455 } 2456 } 2457 if(aMasterPageNamePrefix.getLength()) 2458 { 2459 aMasterPageNamePrefix += OUString(RTL_CONSTASCII_USTRINGPARAM("-")); 2460 } 2461 2462 GetShapeExport()->setPresentationStylePrefix( aMasterPageNamePrefix ); 2463 2464 // prepare object infos 2465 Reference< drawing::XShapes > xDrawShapes(xDrawPage, UNO_QUERY); 2466 if(xDrawShapes.is() && xDrawShapes->getCount()) 2467 GetShapeExport()->collectShapesAutoStyles( xDrawShapes ); 2468 2469 // prepare presentation notes page object infos (ONLY if presentation) 2470 if(IsImpress()) 2471 { 2472 Reference< presentation::XPresentationPage > xPresPage(xDrawPage, UNO_QUERY); 2473 if(xPresPage.is()) 2474 { 2475 Reference< XDrawPage > xNotesPage(xPresPage->getNotesPage()); 2476 if(xNotesPage.is()) 2477 { 2478 // collect layer information 2479 GetFormExport()->examineForms( xNotesPage ); 2480 2481 Reference< drawing::XShapes > xShapes(xNotesPage, UNO_QUERY); 2482 if(xShapes.is() && xShapes->getCount()) 2483 GetShapeExport()->collectShapesAutoStyles( xShapes ); 2484 } 2485 } 2486 } 2487 2488 collectAnnotationAutoStyles( xDrawPage ); 2489 } 2490 } 2491 if(IsImpress()) 2492 { 2493 UniReference< XMLAnimationsExporter > xAnimExport; 2494 GetShapeExport()->setAnimationsExporter( xAnimExport ); 2495 } 2496 } 2497 2498 exportAutoDataStyles(); 2499 2500 GetShapeExport()->exportAutoStyles(); 2501 2502 sal_uInt16 nContentAutostyles = EXPORT_CONTENT | EXPORT_AUTOSTYLES; 2503 if ( ( getExportFlags() & nContentAutostyles ) == nContentAutostyles ) 2504 GetFormExport()->exportAutoStyles( ); 2505 2506 // ...for text 2507 GetTextParagraphExport()->exportTextAutoStyles(); 2508 } 2509 2510 ////////////////////////////////////////////////////////////////////////////// 2511 2512 void SdXMLExport::_ExportMasterStyles() 2513 { 2514 // export layer 2515 SdXMLayerExporter::exportLayer( *this ); 2516 2517 // export handout master page if impress 2518 if( IsImpress() ) 2519 { 2520 Reference< presentation::XHandoutMasterSupplier > xHandoutSupp( GetModel(), UNO_QUERY ); 2521 if( xHandoutSupp.is() ) 2522 { 2523 Reference< XDrawPage > xHandoutPage( xHandoutSupp->getHandoutMasterPage() ); 2524 if( xHandoutPage.is() ) 2525 { 2526 // presentation:page-layout-name 2527 if( IsImpress() && maDrawPagesAutoLayoutNames[0].getLength()) 2528 { 2529 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_PRESENTATION_PAGE_LAYOUT_NAME, EncodeStyleName( maDrawPagesAutoLayoutNames[0] )); 2530 } 2531 2532 ImpXMLEXPPageMasterInfo* pInfo = mpHandoutPageMaster; 2533 if(pInfo) 2534 { 2535 OUString sString = pInfo->GetName(); 2536 AddAttribute(XML_NAMESPACE_STYLE, XML_PAGE_LAYOUT_NAME, sString ); 2537 } 2538 2539 // draw:style-name 2540 if( maHandoutMasterStyleName.getLength() ) 2541 AddAttribute(XML_NAMESPACE_DRAW, XML_STYLE_NAME, maHandoutMasterStyleName); 2542 2543 ImplExportHeaderFooterDeclAttributes( maHandoutPageHeaderFooterSettings ); 2544 2545 // write masterpage 2546 SvXMLElementExport aMPG(*this, XML_NAMESPACE_STYLE, XML_HANDOUT_MASTER, sal_True, sal_True); 2547 2548 // write graphic objects on this master page (if any) 2549 Reference< drawing::XShapes > xShapes(xHandoutPage, UNO_QUERY); 2550 if(xShapes.is() && xShapes->getCount()) 2551 GetShapeExport()->exportShapes( xShapes ); 2552 } 2553 } 2554 } 2555 2556 // export MasterPages in master-styles section 2557 for (sal_Int32 nMPageId = 0; nMPageId < mnDocMasterPageCount; nMPageId++) 2558 { 2559 Reference< XDrawPage > xMasterPage( mxDocMasterPages->getByIndex(nMPageId), UNO_QUERY ); 2560 if(xMasterPage.is()) 2561 { 2562 // prepare masterpage attributes 2563 OUString sMasterPageName; 2564 Reference < container::XNamed > xNamed(xMasterPage, UNO_QUERY); 2565 if(xNamed.is()) 2566 { 2567 sal_Bool bEncoded = sal_False; 2568 sMasterPageName = xNamed->getName(); 2569 AddAttribute(XML_NAMESPACE_STYLE, XML_NAME, 2570 EncodeStyleName( sMasterPageName, &bEncoded )); 2571 if( bEncoded ) 2572 AddAttribute( 2573 XML_NAMESPACE_STYLE, XML_DISPLAY_NAME, 2574 sMasterPageName ); 2575 } 2576 2577 ImpXMLEXPPageMasterInfo* pInfo = mpPageMasterUsageList->GetObject(nMPageId); 2578 if(pInfo) 2579 { 2580 OUString sString = pInfo->GetName(); 2581 AddAttribute(XML_NAMESPACE_STYLE, XML_PAGE_LAYOUT_NAME, sString ); 2582 } 2583 2584 // draw:style-name (background attributes) 2585 if( maMasterPagesStyleNames[nMPageId].getLength() ) 2586 AddAttribute(XML_NAMESPACE_DRAW, XML_STYLE_NAME, 2587 maMasterPagesStyleNames[nMPageId]); 2588 2589 // write masterpage 2590 SvXMLElementExport aMPG(*this, XML_NAMESPACE_STYLE, XML_MASTER_PAGE, sal_True, sal_True); 2591 2592 // write optional office:forms 2593 exportFormsElement( xMasterPage ); 2594 2595 // write graphic objects on this master page (if any) 2596 Reference< drawing::XShapes > xMasterShapes(xMasterPage, UNO_QUERY); 2597 if(xMasterShapes.is() && xMasterShapes->getCount()) 2598 GetShapeExport()->exportShapes( xMasterShapes ); 2599 2600 // write presentation notes (ONLY if presentation) 2601 if(IsImpress()) 2602 { 2603 Reference< presentation::XPresentationPage > xPresPage(xMasterPage, UNO_QUERY); 2604 if(xPresPage.is()) 2605 { 2606 Reference< XDrawPage > xNotesPage(xPresPage->getNotesPage()); 2607 if(xNotesPage.is()) 2608 { 2609 Reference< drawing::XShapes > xShapes(xNotesPage, UNO_QUERY); 2610 if(xShapes.is()) 2611 { 2612 ImpXMLEXPPageMasterInfo* pMasterInfo = mpNotesPageMasterUsageList->GetObject(nMPageId); 2613 if(pMasterInfo) 2614 { 2615 OUString sString = pMasterInfo->GetName(); 2616 AddAttribute(XML_NAMESPACE_STYLE, XML_PAGE_LAYOUT_NAME, sString); 2617 } 2618 2619 // write presentation notes 2620 SvXMLElementExport aPSY(*this, XML_NAMESPACE_PRESENTATION, XML_NOTES, sal_True, sal_True); 2621 2622 // write optional office:forms 2623 exportFormsElement( xNotesPage ); 2624 2625 // write shapes per se 2626 GetShapeExport()->exportShapes( xShapes ); 2627 } 2628 } 2629 } 2630 } 2631 exportAnnotations( xMasterPage ); 2632 } 2633 } 2634 } 2635 2636 void SdXMLExport::exportFormsElement( Reference< XDrawPage > xDrawPage ) 2637 { 2638 if( xDrawPage.is() ) 2639 { 2640 Reference< form::XFormsSupplier2 > xFormsSupplier( xDrawPage, UNO_QUERY ); 2641 if ( xFormsSupplier.is() && xFormsSupplier->hasForms() ) 2642 { 2643 // write masterpage 2644 ::xmloff::OOfficeFormsExport aForms(*this); 2645 GetFormExport()->exportForms( xDrawPage ); 2646 } 2647 2648 if(! GetFormExport()->seekPage( xDrawPage ) ) 2649 { 2650 DBG_ERROR( "OFormLayerXMLExport::seekPage failed!" ); 2651 } 2652 } 2653 } 2654 2655 void SdXMLExport::GetViewSettings(uno::Sequence<beans::PropertyValue>& rProps) 2656 { 2657 rProps.realloc(4); 2658 beans::PropertyValue* pProps = rProps.getArray(); 2659 if(pProps) 2660 { 2661 // SvXMLElementExport aViewSettingsElem(*this, XML_NAMESPACE_DRAW, XML_VIEW_SETTINGS, sal_True, sal_True); 2662 2663 Reference< beans::XPropertySet > xPropSet( GetModel(), UNO_QUERY ); 2664 if( !xPropSet.is() ) 2665 return; 2666 2667 awt::Rectangle aVisArea; 2668 xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "VisibleArea" ) ) ) >>= aVisArea; 2669 /* 2670 sal_Int16 nMapUnit; 2671 xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "MapUnit" ) ) ) >>= nMapUnit; 2672 */ 2673 2674 sal_uInt16 i = 0; 2675 pProps[i].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaTop")); 2676 pProps[i++].Value <<= aVisArea.Y; 2677 pProps[i].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaLeft")); 2678 pProps[i++].Value <<= aVisArea.X; 2679 pProps[i].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaWidth")); 2680 pProps[i++].Value <<= aVisArea.Width; 2681 pProps[i].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaHeight")); 2682 pProps[i++].Value <<= aVisArea.Height; 2683 } 2684 } 2685 2686 void SdXMLExport::GetConfigurationSettings(uno::Sequence<beans::PropertyValue>& rProps) 2687 { 2688 Reference< lang::XMultiServiceFactory > xFac( GetModel(), UNO_QUERY ); 2689 if( xFac.is() ) 2690 { 2691 Reference< beans::XPropertySet > xProps( xFac->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.Settings" ) ) ), UNO_QUERY ); 2692 if( xProps.is() ) 2693 SvXMLUnitConverter::convertPropertySet( rProps, xProps ); 2694 } 2695 } 2696 2697 ////////////////////////////////////////////////////////////////////////////// 2698 2699 void SdXMLExport::addDataStyle(const sal_Int32 nNumberFormat, sal_Bool bTimeFormat ) 2700 { 2701 sal_Int32 nFormat = nNumberFormat; 2702 if( (nNumberFormat > 1) && (nNumberFormat <= 0x0f) ) 2703 nFormat -= 2; 2704 2705 if( bTimeFormat ) 2706 { 2707 if( maUsedTimeStyles.count( nFormat ) == 0 ) 2708 maUsedTimeStyles.insert( nFormat ); 2709 } 2710 else 2711 { 2712 if( maUsedDateStyles.count( nFormat ) == 0 ) 2713 maUsedDateStyles.insert( nFormat ); 2714 } 2715 } 2716 2717 ////////////////////////////////////////////////////////////////////////////// 2718 2719 void SdXMLExport::exportDataStyles() 2720 { 2721 // there are no data styles to export in draw/impress yet 2722 } 2723 2724 ////////////////////////////////////////////////////////////////////////////// 2725 2726 void SdXMLExport::exportAutoDataStyles() 2727 { 2728 SdXMLFormatMap::iterator aIter( maUsedDateStyles.begin() ); 2729 SdXMLFormatMap::iterator aEnd( maUsedDateStyles.end() ); 2730 2731 while( aIter != aEnd ) 2732 SdXMLNumberStylesExporter::exportDateStyle( *this, (*aIter++) ); 2733 2734 aIter = maUsedTimeStyles.begin(); 2735 aEnd = maUsedTimeStyles.end(); 2736 while( aIter != aEnd ) 2737 SdXMLNumberStylesExporter::exportTimeStyle( *this, (*aIter++) ); 2738 2739 if(HasFormExport()) 2740 GetFormExport()->exportAutoControlNumberStyles(); 2741 } 2742 2743 ////////////////////////////////////////////////////////////////////////////// 2744 2745 OUString SdXMLExport::getDataStyleName(const sal_Int32 nNumberFormat, sal_Bool bTimeFormat ) const 2746 { 2747 if( bTimeFormat ) 2748 { 2749 return SdXMLNumberStylesExporter::getTimeStyleName( nNumberFormat ); 2750 } 2751 else 2752 { 2753 return SdXMLNumberStylesExporter::getDateStyleName( nNumberFormat ); 2754 } 2755 } 2756 2757 OUString SdXMLExport::getNavigationOrder( const Reference< XDrawPage >& xDrawPage ) 2758 { 2759 OUStringBuffer sNavOrder; 2760 try 2761 { 2762 Reference< XPropertySet > xSet( xDrawPage, UNO_QUERY_THROW ); 2763 Reference< XIndexAccess > xNavOrder( xSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "NavigationOrder" ) ) ), UNO_QUERY_THROW ); 2764 2765 Reference< XIndexAccess > xZOrderAccess( xDrawPage, UNO_QUERY ); 2766 2767 // only export navigation order if it is different from the z-order 2768 if( (xNavOrder.get() != xZOrderAccess.get()) && (xNavOrder->getCount() == xDrawPage->getCount()) ) 2769 { 2770 sal_Int32 nIndex; 2771 const sal_Int32 nCount = xNavOrder->getCount(); 2772 for( nIndex = 0; nIndex < nCount; ++nIndex ) 2773 { 2774 OUString sId( getInterfaceToIdentifierMapper().registerReference( Reference< XInterface >( xNavOrder->getByIndex( nIndex ), UNO_QUERY ) ) ); 2775 if( sId.getLength() != 0 ) 2776 { 2777 if( sNavOrder.getLength() != 0 ) 2778 sNavOrder.append( (sal_Unicode)' ' ); 2779 sNavOrder.append( sId ); 2780 } 2781 } 2782 } 2783 } 2784 catch( Exception& ) 2785 { 2786 } 2787 return sNavOrder.makeStringAndClear(); 2788 } 2789 2790 ////////////////////////////////////////////////////////////////////////////// 2791 2792 void SdXMLExport::collectAnnotationAutoStyles( const Reference<XDrawPage>& xDrawPage ) 2793 { 2794 Reference< XAnnotationAccess > xAnnotationAccess( xDrawPage, UNO_QUERY ); 2795 if( xAnnotationAccess.is() ) try 2796 { 2797 Reference< XAnnotationEnumeration > xAnnotationEnumeration( xAnnotationAccess->createAnnotationEnumeration() ); 2798 if( xAnnotationEnumeration.is() ) 2799 { 2800 while( xAnnotationEnumeration->hasMoreElements() ) 2801 { 2802 Reference< XAnnotation > xAnnotation( xAnnotationEnumeration->nextElement(), UNO_QUERY_THROW ); 2803 Reference< XText > xText( xAnnotation->getTextRange() ); 2804 if(xText.is() && xText->getString().getLength()) 2805 GetTextParagraphExport()->collectTextAutoStyles( xText ); 2806 } 2807 } 2808 } 2809 catch( Exception& ) 2810 { 2811 DBG_ERROR("SdXMLExport::collectAnnotationAutoStyles(), exception caught during export of annotation auto styles"); 2812 } 2813 } 2814 2815 void SdXMLExport::exportAnnotations( const Reference<XDrawPage>& xDrawPage ) 2816 { 2817 // do not export in ODF 1.2 or older 2818 if( getDefaultVersion() <= SvtSaveOptions::ODFVER_012 ) 2819 return; 2820 2821 Reference< XAnnotationAccess > xAnnotationAccess( xDrawPage, UNO_QUERY ); 2822 if( xAnnotationAccess.is() ) try 2823 { 2824 Reference< XAnnotationEnumeration > xAnnotationEnumeration( xAnnotationAccess->createAnnotationEnumeration() ); 2825 if( xAnnotationEnumeration.is() && xAnnotationEnumeration->hasMoreElements() ) 2826 { 2827 OUStringBuffer sStringBuffer; 2828 do 2829 { 2830 Reference< XAnnotation > xAnnotation( xAnnotationEnumeration->nextElement(), UNO_QUERY_THROW ); 2831 2832 RealPoint2D aPosition( xAnnotation->getPosition() ); 2833 2834 GetMM100UnitConverter().convertMeasure(sStringBuffer, static_cast<sal_Int32>( aPosition.X * 100 ) ); 2835 AddAttribute(XML_NAMESPACE_SVG, XML_X, sStringBuffer.makeStringAndClear()); 2836 2837 GetMM100UnitConverter().convertMeasure(sStringBuffer, static_cast<sal_Int32>( aPosition.Y * 100 ) ); 2838 AddAttribute(XML_NAMESPACE_SVG, XML_Y, sStringBuffer.makeStringAndClear()); 2839 2840 RealSize2D aSize( xAnnotation->getSize() ); 2841 2842 if( aSize.Width || aSize.Height ) 2843 { 2844 GetMM100UnitConverter().convertMeasure(sStringBuffer, static_cast<sal_Int32>( aSize.Width * 100 ) ); 2845 AddAttribute(XML_NAMESPACE_SVG, XML_WIDTH, sStringBuffer.makeStringAndClear()); 2846 GetMM100UnitConverter().convertMeasure(sStringBuffer, static_cast<sal_Int32>( aSize.Height * 100 ) ); 2847 AddAttribute(XML_NAMESPACE_SVG, XML_HEIGHT, sStringBuffer.makeStringAndClear()); 2848 } 2849 2850 // annotation element + content 2851 SvXMLElementExport aElem(*this, XML_NAMESPACE_OFFICE_EXT, XML_ANNOTATION, sal_False, sal_True); 2852 2853 // author 2854 OUString aAuthor( xAnnotation->getAuthor() ); 2855 if( aAuthor.getLength() ) 2856 { 2857 SvXMLElementExport aCreatorElem( *this, XML_NAMESPACE_DC, XML_CREATOR, sal_True, sal_False ); 2858 this->Characters(aAuthor); 2859 } 2860 2861 { 2862 // date time 2863 DateTime aDate( xAnnotation->getDateTime() ); 2864 GetMM100UnitConverter().convertDateTime(sStringBuffer, aDate, sal_True); 2865 SvXMLElementExport aDateElem( *this, XML_NAMESPACE_DC, XML_DATE, sal_True, sal_False ); 2866 Characters(sStringBuffer.makeStringAndClear()); 2867 } 2868 2869 com::sun::star::uno::Reference < com::sun::star::text::XText > xText( xAnnotation->getTextRange() ); 2870 if( xText.is() ) 2871 this->GetTextParagraphExport()->exportText( xText ); 2872 } 2873 while( xAnnotationEnumeration->hasMoreElements() ); 2874 } 2875 } 2876 catch( Exception& ) 2877 { 2878 DBG_ERROR("SdXMLExport::exportAnnotations(), exception caught during export of annotations"); 2879 } 2880 } 2881 2882 ////////////////////////////////////////////////////////////////////////////// 2883 2884 #define SERVICE( classname, servicename, implementationname, draw, flags )\ 2885 uno::Sequence< OUString > SAL_CALL classname##_getSupportedServiceNames() throw()\ 2886 {\ 2887 const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( servicename ) );\ 2888 const uno::Sequence< OUString > aSeq( &aServiceName, 1 );\ 2889 return aSeq;\ 2890 }\ 2891 OUString SAL_CALL classname##_getImplementationName() throw()\ 2892 {\ 2893 return OUString( RTL_CONSTASCII_USTRINGPARAM( implementationname ) );\ 2894 }\ 2895 uno::Reference< uno::XInterface > SAL_CALL classname##_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )\ 2896 {\ 2897 return (cppu::OWeakObject*)new SdXMLExport( rSMgr, draw, flags );\ 2898 } 2899 2900 SERVICE( XMLImpressExportOasis, "com.sun.star.comp.Impress.XMLOasisExporter", "XMLImpressExportOasis", sal_False, EXPORT_OASIS|EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED ); 2901 SERVICE( XMLImpressStylesExportOasis, "com.sun.star.comp.Impress.XMLOasisStylesExporter", "XMLImpressStylesExportOasis", sal_False, EXPORT_OASIS|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES ); 2902 SERVICE( XMLImpressContentExportOasis, "com.sun.star.comp.Impress.XMLOasisContentExporter", "XMLImpressContentExportOasis", sal_False, EXPORT_OASIS|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS ); 2903 SERVICE( XMLImpressMetaExportOasis, "com.sun.star.comp.Impress.XMLOasisMetaExporter", "XMLImpressMetaExportOasis", sal_False, EXPORT_OASIS|EXPORT_META ); 2904 SERVICE( XMLImpressSettingsExportOasis, "com.sun.star.comp.Impress.XMLOasisSettingsExporter", "XMLImpressSettingsExportOasis", sal_False, EXPORT_OASIS|EXPORT_SETTINGS ); 2905 2906 SERVICE( XMLImpressExportOOO, "com.sun.star.comp.Impress.XMLExporter", "XMLImpressExportOOO", sal_False, EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED ); 2907 SERVICE( XMLImpressStylesExportOOO, "com.sun.star.comp.Impress.XMLStylesExporter", "XMLImpressStylesExportOOO", sal_False, EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES ); 2908 SERVICE( XMLImpressContentExportOOO, "com.sun.star.comp.Impress.XMLContentExporter", "XMLImpressContentExportOOO", sal_False, EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS ); 2909 SERVICE( XMLImpressMetaExportOOO, "com.sun.star.comp.Impress.XMLMetaExporter", "XMLImpressMetaExportOOO", sal_False, EXPORT_META ); 2910 SERVICE( XMLImpressSettingsExportOOO, "com.sun.star.comp.Impress.XMLSettingsExporter", "XMLImpressSettingsExportOOO", sal_False, EXPORT_SETTINGS ); 2911 2912 SERVICE( XMLDrawExportOasis, "com.sun.star.comp.Draw.XMLOasisExporter", "XMLDrawExportOasis", sal_True, EXPORT_OASIS|EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED ); 2913 SERVICE( XMLDrawStylesExportOasis, "com.sun.star.comp.Draw.XMLOasisStylesExporter", "XMLDrawStylesExportOasis", sal_True, EXPORT_OASIS|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES ); 2914 SERVICE( XMLDrawContentExportOasis, "com.sun.star.comp.Draw.XMLOasisContentExporter", "XMLDrawContentExportOasis", sal_True, EXPORT_OASIS|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS ); 2915 SERVICE( XMLDrawMetaExportOasis, "com.sun.star.comp.Draw.XMLOasisMetaExporter", "XMLDrawMetaExportOasis", sal_True, EXPORT_OASIS|EXPORT_META ); 2916 SERVICE( XMLDrawSettingsExportOasis, "com.sun.star.comp.Draw.XMLOasisSettingsExporter", "XMLDrawSettingsExportOasis", sal_True, EXPORT_OASIS|EXPORT_SETTINGS ); 2917 2918 SERVICE( XMLDrawExportOOO, "com.sun.star.comp.Draw.XMLExporter", "XMLDrawExportOOO", sal_True, EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED ); 2919 SERVICE( XMLDrawStylesExportOOO, "com.sun.star.comp.Draw.XMLStylesExporter", "XMLDrawStylesExportOOO", sal_True, EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES ); 2920 SERVICE( XMLDrawContentExportOOO, "com.sun.star.comp.Draw.XMLContentExporter", "XMLDrawContentExportOOO", sal_True, EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS ); 2921 SERVICE( XMLDrawMetaExportOOO, "com.sun.star.comp.Draw.XMLMetaExporter", "XMLDrawMetaExportOOO", sal_True, EXPORT_META ); 2922 SERVICE( XMLDrawSettingsExportOOO, "com.sun.star.comp.Draw.XMLSettingsExporter", "XMLDrawSettingsExportOOO", sal_True, EXPORT_SETTINGS ); 2923 2924 SERVICE( XMLDrawingLayerExport, "com.sun.star.comp.DrawingLayer.XMLExporter", "XMLDrawingLayerExport", sal_True, EXPORT_OASIS|EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_FONTDECLS|EXPORT_EMBEDDED ); 2925 SERVICE( XMLImpressClipboardExport, "com.sun.star.comp.Impress.XMLClipboardExporter", "XMLImpressClipboardExport", sal_False, EXPORT_OASIS|EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_FONTDECLS|EXPORT_EMBEDDED ); 2926 2927 // XServiceInfo 2928 OUString SAL_CALL SdXMLExport::getImplementationName() throw( uno::RuntimeException ) 2929 { 2930 if( IsDraw()) 2931 { 2932 // Draw 2933 2934 switch( getExportFlags()) 2935 { 2936 case EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED: 2937 return XMLDrawExportOOO_getImplementationName(); 2938 case EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES: 2939 return XMLDrawStylesExportOOO_getImplementationName(); 2940 case EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS: 2941 return XMLDrawContentExportOOO_getImplementationName(); 2942 case EXPORT_META: 2943 return XMLDrawMetaExportOOO_getImplementationName(); 2944 case EXPORT_SETTINGS: 2945 return XMLDrawSettingsExportOOO_getImplementationName(); 2946 2947 case EXPORT_OASIS|EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED: 2948 return XMLDrawExportOasis_getImplementationName(); 2949 case EXPORT_OASIS|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES: 2950 return XMLDrawStylesExportOasis_getImplementationName(); 2951 case EXPORT_OASIS|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS: 2952 return XMLDrawContentExportOasis_getImplementationName(); 2953 case EXPORT_OASIS|EXPORT_META: 2954 return XMLDrawMetaExportOasis_getImplementationName(); 2955 case EXPORT_OASIS|EXPORT_SETTINGS: 2956 return XMLDrawSettingsExportOasis_getImplementationName(); 2957 2958 default: 2959 return XMLDrawExportOOO_getImplementationName(); 2960 } 2961 } 2962 else 2963 { 2964 // Impress 2965 2966 switch( getExportFlags()) 2967 { 2968 case EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED: 2969 return XMLImpressExportOOO_getImplementationName(); 2970 case EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES: 2971 return XMLImpressStylesExportOOO_getImplementationName(); 2972 case EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS: 2973 return XMLImpressContentExportOOO_getImplementationName(); 2974 case EXPORT_META: 2975 return XMLImpressMetaExportOOO_getImplementationName(); 2976 case EXPORT_SETTINGS: 2977 return XMLImpressSettingsExportOOO_getImplementationName(); 2978 case EXPORT_OASIS|EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED: 2979 return XMLImpressExportOasis_getImplementationName(); 2980 case EXPORT_OASIS|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES: 2981 return XMLImpressStylesExportOasis_getImplementationName(); 2982 case EXPORT_OASIS|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS: 2983 return XMLImpressContentExportOasis_getImplementationName(); 2984 case EXPORT_OASIS|EXPORT_META: 2985 return XMLImpressMetaExportOasis_getImplementationName(); 2986 case EXPORT_OASIS|EXPORT_SETTINGS: 2987 return XMLImpressSettingsExportOasis_getImplementationName(); 2988 2989 default: 2990 return XMLImpressExportOOO_getImplementationName(); 2991 } 2992 } 2993 } 2994