summaryrefslogtreecommitdiff
path: root/filter/inc
diff options
context:
space:
mode:
Diffstat (limited to 'filter/inc')
-rw-r--r--filter/inc/filter.hrc65
-rw-r--r--filter/inc/filter/msfilter/countryid.hxx320
-rw-r--r--filter/inc/filter/msfilter/escherex.hxx1635
-rw-r--r--filter/inc/filter/msfilter/mscodec.hxx379
-rw-r--r--filter/inc/filter/msfilter/msdffimp.hxx860
-rw-r--r--filter/inc/filter/msfilter/msfilterdllapi.h44
-rw-r--r--filter/inc/filter/msfilter/msfiltertracer.hxx99
-rw-r--r--filter/inc/filter/msfilter/msocximex.hxx1241
-rw-r--r--filter/inc/filter/msfilter/msoleexp.hxx62
-rw-r--r--filter/inc/filter/msfilter/mstoolbar.hxx366
-rw-r--r--filter/inc/filter/msfilter/msvbahelper.hxx111
-rw-r--r--filter/inc/filter/msfilter/svdfppt.hxx1414
-rw-r--r--filter/inc/filter/msfilter/svxmsbas.hxx116
-rw-r--r--filter/inc/makefile.mk47
-rw-r--r--filter/inc/pch/precompiled_filter.cxx31
-rw-r--r--filter/inc/pch/precompiled_filter.hxx34
-rw-r--r--filter/inc/registration.hxx124
17 files changed, 6948 insertions, 0 deletions
diff --git a/filter/inc/filter.hrc b/filter/inc/filter.hrc
new file mode 100644
index 000000000000..2bbf94ed50c7
--- /dev/null
+++ b/filter/inc/filter.hrc
@@ -0,0 +1,65 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _FILTER_HRC
+#define _FILTER_HRC
+
+// include ---------------------------------------------------------------
+
+#include <svl/solar.hrc>
+
+// Help-Ids --------------------------------------------------------------
+
+#define RID_PDF_DIALOG_START (RID_FILTER_START + 0)
+#define RID_PDF_DIALOG_END (RID_FILTER_START + 19)
+#define RID_XSLT_DIALOG_START (RID_FILTER_START + 20)
+#define RID_XSLT_DIALOG_END (RID_FILTER_START + 69)
+#define RID_PDF_OLD_EXPORT_DLG (RID_FILTER_START + 70)
+
+#define DLG_EXPORT_EPCT (RID_GOODIES_START+ 0)
+#define DLG_EXPORT_GIF (RID_GOODIES_START+ 1)
+#define DLG_EXPORT_EMET (RID_GOODIES_START+ 2)
+#define DLG_EXPORT_JPG (RID_GOODIES_START+ 3)
+#define DLG_IMPORT_PCD (RID_GOODIES_START+ 4)
+#define DLG_EXPORT_EPNG (RID_GOODIES_START+ 5)
+#define DLG_EXPORT_EPS (RID_GOODIES_START+ 8)
+#define DLG_EXPORT_EPBM (RID_GOODIES_START+ 9)
+#define DLG_EXPORT_EPGM (RID_GOODIES_START+ 10)
+#define DLG_EXPORT_EPPM (RID_GOODIES_START+ 11)
+#define DLG_SSL_NEWCERT (RID_GOODIES_START+ 12)
+#define DLG_SSL_INFCERT (RID_GOODIES_START+ 13)
+
+// warning, next range is RID_FILTER_START + 100 !
+
+#define HID_FILTER_PDF_OPTIONS "HID_FILTER_PDF_OPTIONS"
+#define HID_FILTER_PDF_INITIAL_VIEW "HID_FILTER_PDF_INITIAL_VIEW"
+#define HID_FILTER_PDF_USER_INTERFACE "HID_FILTER_PDF_USER_INTERFACE"
+#define HID_FILTER_PDF_SECURITY "HID_FILTER_PDF_SECURITY"
+#define HID_FILTER_PDF_LINKS "HID_FILTER_PDF_LINKS"
+
+#endif
+
diff --git a/filter/inc/filter/msfilter/countryid.hxx b/filter/inc/filter/msfilter/countryid.hxx
new file mode 100644
index 000000000000..63d4bdc29ee8
--- /dev/null
+++ b/filter/inc/filter/msfilter/countryid.hxx
@@ -0,0 +1,320 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// ============================================================================
+
+#ifndef INCLUDED_SVX_COUNTRYID_HXX
+#define INCLUDED_SVX_COUNTRYID_HXX
+
+#include <sal/types.h>
+#include <i18npool/lang.h>
+#include "filter/msfilter/msfilterdllapi.h"
+
+// ----------------------------------------------------------------------------
+
+namespace msfilter {
+
+// Windows Country IDs ========================================================
+
+/** Represents a Windows country ID.
+
+ The country IDs used in Windows are equal to the international calling
+ code of each country, i.e. the code 353 represents Ireland (+353).
+
+ ATTENTION: These country codes are not supposed to be used anywhere in core
+ structures! They shall ONLY be used in the import/export filters for
+ Microsoft Office documents!
+ */
+typedef sal_uInt16 CountryId;
+
+const CountryId COUNTRY_DONTKNOW = 0;
+const CountryId COUNTRY_USA = 1;
+const CountryId COUNTRY_DOMINICAN_REPUBLIC = 1; // NANP
+const CountryId COUNTRY_GUAM = 1; // NANP
+const CountryId COUNTRY_JAMAICA = 1; // NANP
+const CountryId COUNTRY_PUERTO_RICO = 1; // NANP
+const CountryId COUNTRY_TRINIDAD_Y_TOBAGO = 1; // NANP
+const CountryId COUNTRY_CANADA = 2;
+const CountryId COUNTRY_RUSSIA = 7;
+const CountryId COUNTRY_KAZAKHSTAN = 7; // no own ID
+const CountryId COUNTRY_TATARSTAN = 7; // no own ID
+const CountryId COUNTRY_EGYPT = 20;
+const CountryId COUNTRY_SOUTH_AFRICA = 27;
+const CountryId COUNTRY_GREECE = 30;
+const CountryId COUNTRY_NETHERLANDS = 31;
+const CountryId COUNTRY_BELGIUM = 32;
+const CountryId COUNTRY_FRANCE = 33;
+const CountryId COUNTRY_SPAIN = 34;
+const CountryId COUNTRY_HUNGARY = 36;
+const CountryId COUNTRY_ITALY = 39;
+const CountryId COUNTRY_ROMANIA = 40;
+const CountryId COUNTRY_SWITZERLAND = 41;
+const CountryId COUNTRY_AUSTRIA = 43;
+const CountryId COUNTRY_UNITED_KINGDOM = 44;
+const CountryId COUNTRY_DENMARK = 45;
+const CountryId COUNTRY_SWEDEN = 46;
+const CountryId COUNTRY_NORWAY = 47;
+const CountryId COUNTRY_POLAND = 48;
+const CountryId COUNTRY_GERMANY = 49;
+const CountryId COUNTRY_PERU = 51;
+const CountryId COUNTRY_MEXICO = 52;
+const CountryId COUNTRY_CUBA = 53;
+const CountryId COUNTRY_ARGENTINIA = 54;
+const CountryId COUNTRY_BRAZIL = 55;
+const CountryId COUNTRY_CHILE = 56;
+const CountryId COUNTRY_COLOMBIA = 57;
+const CountryId COUNTRY_VENEZUELA = 58;
+const CountryId COUNTRY_MALAYSIA = 60;
+const CountryId COUNTRY_AUSTRALIA = 61;
+const CountryId COUNTRY_INDONESIA = 62;
+const CountryId COUNTRY_PHILIPPINES = 63;
+const CountryId COUNTRY_NEW_ZEALAND = 64;
+const CountryId COUNTRY_SINGAPORE = 65;
+const CountryId COUNTRY_THAILAND = 66;
+const CountryId COUNTRY_JAPAN = 81;
+const CountryId COUNTRY_SOUTH_KOREA = 82;
+const CountryId COUNTRY_VIET_NAM = 84;
+const CountryId COUNTRY_PR_CHINA = 86;
+const CountryId COUNTRY_TIBET = 86; // no own ID
+const CountryId COUNTRY_TURKEY = 90;
+const CountryId COUNTRY_INDIA = 91;
+const CountryId COUNTRY_PAKISTAN = 92;
+const CountryId COUNTRY_AFGHANISTAN = 93;
+const CountryId COUNTRY_SRI_LANKA = 94;
+const CountryId COUNTRY_MYANMAR = 95;
+const CountryId COUNTRY_MOROCCO = 212;
+const CountryId COUNTRY_ALGERIA = 213;
+const CountryId COUNTRY_TUNISIA = 216;
+const CountryId COUNTRY_LIBYA = 218;
+const CountryId COUNTRY_GAMBIA = 220;
+const CountryId COUNTRY_SENEGAL = 221;
+const CountryId COUNTRY_MAURITANIA = 222;
+const CountryId COUNTRY_MALI = 223;
+const CountryId COUNTRY_GUINEA = 224;
+const CountryId COUNTRY_COTE_D_IVOIRE = 225;
+const CountryId COUNTRY_BURKINA_FARSO = 226;
+const CountryId COUNTRY_NIGER = 227;
+const CountryId COUNTRY_TOGO = 228;
+const CountryId COUNTRY_BENIN = 229;
+const CountryId COUNTRY_MAURITIUS = 230;
+const CountryId COUNTRY_LIBERIA = 231;
+const CountryId COUNTRY_SIERRA_LEONE = 232;
+const CountryId COUNTRY_GHANA = 233;
+const CountryId COUNTRY_NIGERIA = 234;
+const CountryId COUNTRY_CHAD = 235;
+const CountryId COUNTRY_CENTRAL_AFR_REP = 236;
+const CountryId COUNTRY_CAMEROON = 237;
+const CountryId COUNTRY_CAPE_VERDE = 238;
+const CountryId COUNTRY_SAO_TOME = 239;
+const CountryId COUNTRY_EQUATORIAL_GUINEA = 240;
+const CountryId COUNTRY_GABON = 241;
+const CountryId COUNTRY_CONGO = 242;
+const CountryId COUNTRY_ZAIRE = 243;
+const CountryId COUNTRY_ANGOLA = 244;
+const CountryId COUNTRY_GUINEA_BISSAU = 245;
+const CountryId COUNTRY_DIEGO_GARCIA = 246;
+const CountryId COUNTRY_ASCENSION_ISLAND = 247;
+const CountryId COUNTRY_SEYCHELLES = 248;
+const CountryId COUNTRY_SUDAN = 249;
+const CountryId COUNTRY_RWANDA = 250;
+const CountryId COUNTRY_ETHIOPIA = 251;
+const CountryId COUNTRY_SOMALIA = 252;
+const CountryId COUNTRY_DJIBOUTI = 253;
+const CountryId COUNTRY_KENYA = 254;
+const CountryId COUNTRY_TANZANIA = 255;
+const CountryId COUNTRY_UGANDA = 256;
+const CountryId COUNTRY_BURUNDI = 257;
+const CountryId COUNTRY_MOZAMBIQUE = 258;
+const CountryId COUNTRY_ZANZIBAR = 259;
+const CountryId COUNTRY_ZAMBIA = 260;
+const CountryId COUNTRY_MADAGASKAR = 261;
+const CountryId COUNTRY_REUNION = 262;
+const CountryId COUNTRY_ZIMBABWE = 263;
+const CountryId COUNTRY_NAMIBIA = 264;
+const CountryId COUNTRY_MALAWI = 265;
+const CountryId COUNTRY_LESOTHO = 266;
+const CountryId COUNTRY_BOTSWANA = 267;
+const CountryId COUNTRY_SWAZILAND = 268;
+const CountryId COUNTRY_COMOROS_MAYOTTE = 269;
+const CountryId COUNTRY_ST_HELENA = 290;
+const CountryId COUNTRY_ERITREA = 291;
+const CountryId COUNTRY_ARUBA = 297;
+const CountryId COUNTRY_FAEROE_ISLANDS = 298;
+const CountryId COUNTRY_GREEN_ISLAND = 299;
+const CountryId COUNTRY_GIBRALTAR = 350;
+const CountryId COUNTRY_PORTUGAL = 351;
+const CountryId COUNTRY_LUXEMBOURG = 352;
+const CountryId COUNTRY_IRELAND = 353;
+const CountryId COUNTRY_ICELAND = 354;
+const CountryId COUNTRY_ALBANIA = 355;
+const CountryId COUNTRY_MALTA = 356;
+const CountryId COUNTRY_CYPRUS = 357;
+const CountryId COUNTRY_FINLAND = 358;
+const CountryId COUNTRY_BULGARIA = 359;
+const CountryId COUNTRY_LITHUANIA = 370;
+const CountryId COUNTRY_LATVIA = 371;
+const CountryId COUNTRY_ESTONIA = 372;
+const CountryId COUNTRY_MOLDOVA = 373;
+const CountryId COUNTRY_ARMENIA = 374;
+const CountryId COUNTRY_BELARUS = 375;
+const CountryId COUNTRY_ANDORRA = 376;
+const CountryId COUNTRY_MONACO = 377;
+const CountryId COUNTRY_SAN_MARINO = 378;
+const CountryId COUNTRY_VATICAN_CITY = 379;
+const CountryId COUNTRY_UKRAINE = 380;
+const CountryId COUNTRY_SERBIA = 381;
+const CountryId COUNTRY_CROATIA = 385;
+const CountryId COUNTRY_SLOVENIA = 386;
+const CountryId COUNTRY_BOSNIA = 387;
+const CountryId COUNTRY_MACEDONIA = 389;
+const CountryId COUNTRY_CZECH = 420;
+const CountryId COUNTRY_SLOVAK = 421;
+const CountryId COUNTRY_LIECHTENSTEIN = 423;
+const CountryId COUNTRY_FALKLAND_ISLANDS = 500;
+const CountryId COUNTRY_BELIZE = 501;
+const CountryId COUNTRY_GUATEMALA = 502;
+const CountryId COUNTRY_EL_SALVADOR = 503;
+const CountryId COUNTRY_HONDURAS = 504;
+const CountryId COUNTRY_NICARAGUA = 505;
+const CountryId COUNTRY_COSTA_RICA = 506;
+const CountryId COUNTRY_PANAMA = 507;
+const CountryId COUNTRY_ST_PIERRE = 508;
+const CountryId COUNTRY_HAITI = 509;
+const CountryId COUNTRY_GUADELOUPE = 590;
+const CountryId COUNTRY_BOLIVIA = 591;
+const CountryId COUNTRY_GUYANA = 592;
+const CountryId COUNTRY_ECUADOR = 593;
+const CountryId COUNTRY_FRENCH_GUIANA = 594;
+const CountryId COUNTRY_PARAGUAY = 595;
+const CountryId COUNTRY_MARTINIQUE = 596;
+const CountryId COUNTRY_SURINAME = 597;
+const CountryId COUNTRY_URUGUAY = 598;
+const CountryId COUNTRY_NETHERL_ANTILLES = 599;
+const CountryId COUNTRY_EAST_TIMOR = 670;
+const CountryId COUNTRY_ANTARCTICA = 672;
+const CountryId COUNTRY_BRUNEI_DARUSSALAM = 673;
+const CountryId COUNTRY_NARUPU = 674;
+const CountryId COUNTRY_PAPUA_NEW_GUINEA = 675;
+const CountryId COUNTRY_TONGA = 676;
+const CountryId COUNTRY_SOLOMON_ISLANDS = 677;
+const CountryId COUNTRY_VANUATU = 678;
+const CountryId COUNTRY_FIJI = 679;
+const CountryId COUNTRY_PALAU = 680;
+const CountryId COUNTRY_WALLIS_AND_FUTUNA = 681;
+const CountryId COUNTRY_COOK_ISLANDS = 682;
+const CountryId COUNTRY_NIUE_ISLAND = 683;
+const CountryId COUNTRY_AMERICAN_SAMOA = 684;
+const CountryId COUNTRY_WESTERN_SAMOA = 685;
+const CountryId COUNTRY_KIRIBATI = 686;
+const CountryId COUNTRY_NEW_CALEDONIA = 687;
+const CountryId COUNTRY_TUVALU = 688;
+const CountryId COUNTRY_FRENCH_POLYNESIA = 689;
+const CountryId COUNTRY_TOKELAU = 690;
+const CountryId COUNTRY_MICRONESIA = 691;
+const CountryId COUNTRY_MARSHALL_ISLANDS = 692;
+const CountryId COUNTRY_NORTH_KOREA = 850;
+const CountryId COUNTRY_HONG_KONG = 852;
+const CountryId COUNTRY_MACAU = 853;
+const CountryId COUNTRY_CAMBODIA = 855;
+const CountryId COUNTRY_LAOS = 856;
+const CountryId COUNTRY_BANGLADESH = 880;
+const CountryId COUNTRY_TAIWAN = 886;
+const CountryId COUNTRY_MALDIVES = 960;
+const CountryId COUNTRY_LEBANON = 961;
+const CountryId COUNTRY_JORDAN = 962;
+const CountryId COUNTRY_SYRIA = 963;
+const CountryId COUNTRY_IRAQ = 964;
+const CountryId COUNTRY_KUWAIT = 965;
+const CountryId COUNTRY_SAUDI_ARABIA = 966;
+const CountryId COUNTRY_YEMEN = 967;
+const CountryId COUNTRY_OMAN = 968;
+const CountryId COUNTRY_PALESTINE = 970;
+const CountryId COUNTRY_UAE = 971;
+const CountryId COUNTRY_ISRAEL = 972;
+const CountryId COUNTRY_BAHRAIN = 973;
+const CountryId COUNTRY_QATAR = 974;
+const CountryId COUNTRY_BHUTAN = 975;
+const CountryId COUNTRY_MONGOLIA = 976;
+const CountryId COUNTRY_NEPAL = 977;
+const CountryId COUNTRY_IRAN = 981;
+const CountryId COUNTRY_TAJIKISTAN = 992;
+const CountryId COUNTRY_TURKMENISTAN = 993;
+const CountryId COUNTRY_AZERBAIJAN = 994;
+const CountryId COUNTRY_GEORGIA = 995;
+const CountryId COUNTRY_KYRGYZSTAN = 996;
+const CountryId COUNTRY_UZBEKISTAN = 998;
+
+// Country ID <-> Language type conversion ====================================
+
+/** Converts a language type to a Windows country ID.
+
+ The function regards the sub type of the passed language, and tries to
+ return the appropriate country, i.e. COUNTRY_IRELAND for
+ LANGUAGE_ENGLISH_EIRE.
+
+ A few countries do not have an own associated country ID. Most of these
+ countries are mapped to another related country, i.e. Kazakhstan is
+ mapped to Russia.
+
+ If no country can be found, the value COUNTRY_DONTKNOW will be returned.
+
+ @param eLanguage
+ A language type, defined in tools/lang.hxx.
+
+ @return
+ The best Windows country ID for the passed language type, or
+ COUNTRY_DONTKNOW on error.
+ */
+MSFILTER_DLLPUBLIC CountryId ConvertLanguageToCountry( LanguageType eLanguage );
+
+/** Converts a Windows country ID to a language type.
+
+ The function returns the most used language for the passed country
+ (hopefully), i.e. LANGUAGE_ENGLISH_EIRE for COUNTRY_IRELAND.
+
+ If the passed country ID is not valid, the value LANGUAGE_DONTKNOW will be
+ returned.
+
+ @param eCountry
+ A Windows country ID, defined above.
+
+ @return
+ The most used language type in the passed country, or LANGUAGE_DONTKNOW
+ on error.
+ */
+MSFILTER_DLLPUBLIC LanguageType ConvertCountryToLanguage( CountryId eCountry );
+
+// ============================================================================
+
+} // namespace svx
+
+// ============================================================================
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/inc/filter/msfilter/escherex.hxx b/filter/inc/filter/msfilter/escherex.hxx
new file mode 100644
index 000000000000..b04a18e04041
--- /dev/null
+++ b/filter/inc/filter/msfilter/escherex.hxx
@@ -0,0 +1,1635 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SVX_ESCHEREX_HXX
+#define _SVX_ESCHEREX_HXX
+
+#include <memory>
+#include <vector>
+#include <boost/shared_ptr.hpp>
+#include <tools/solar.h>
+#include <tools/gen.hxx>
+#include <tools/list.hxx>
+#include <tools/stream.hxx>
+#include <com/sun/star/uno/Reference.h>
+#include <svtools/grfmgr.hxx>
+#include <com/sun/star/awt/Size.hpp>
+#include <com/sun/star/awt/Point.hpp>
+#include <com/sun/star/awt/Rectangle.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/PropertyState.hpp>
+#include <com/sun/star/drawing/BitmapMode.hpp>
+#include <com/sun/star/drawing/Hatch.hpp>
+#include <svx/msdffdef.hxx>
+#include <memory>
+#include "filter/msfilter/msfilterdllapi.h"
+
+ /*Record Name FBT-Value Instance Contents Wrd Exl PPt Ver*/
+// In der Mickysoft-Doku heissen die msofbt... statt ESCHER_...
+#define ESCHER_DggContainer 0xF000 /* per-document data X X X */
+#define ESCHER_Dgg 0xF006 /* an FDGG and several FIDCLs X X X 0 */
+#define ESCHER_CLSID 0xF016 /* the CLSID of the application that put the data on the clipboard C C C 0 */
+#define ESCHER_OPT 0xF00B /* count of properties the document-wide default shape properties X X X 3 */
+#define ESCHER_ColorMRU 0xF11A /* count of colors the colors in the MRU swatch X X X 0 */
+#define ESCHER_SplitMenuColors 0xF11E /* count of colors the colors in the top-level split menus X X X 0 */
+#define ESCHER_BstoreContainer 0xF001 /* count of BLIPs all images in the document (JPEGs, metafiles, etc.) X X X */
+#define ESCHER_BSE 0xF007 /* BLIP type an FBSE (one per BLIP) X X X 2 */
+#define ESCHER_BlipFirst 0xF018 /* range of fbts reserved for various kinds of BLIPs X X X */
+#define ESCHER_BlipLast 0xF117 /* range of fbts reserved for various kinds of BLIPs X X X */
+
+#define ESCHER_DgContainer 0xF002 /* per-sheet/page/slide data X X X */
+#define ESCHER_Dg 0xF008 /* drawing ID an FDG X X X 0 */
+#define ESCHER_RegroupItems 0xF118 /* count of regroup entries several FRITs X X X 0 */
+#define ESCHER_ColorScheme 0xF120 /* count of colors the colors of the source host's color scheme C C 0 */
+#define ESCHER_SpgrContainer 0xF003 /* several SpContainers, the first of which is the group shape itself X X X */
+#define ESCHER_SpContainer 0xF004 /* a shape X X X */
+#define ESCHER_Spgr 0xF009 /* an FSPGR; only present if the shape is a group shape X X X 1 */
+#define ESCHER_Sp 0xF00A /* shape type an FSP X X X 2 */
+//#define ESCHER_OPT 0xF00B /* count of properties a shape property table X X X 3 */
+#define ESCHER_Textbox 0xF00C /* RTF text C C C 0 */
+#define ESCHER_ClientTextbox 0xF00D /* host-defined the text in the textbox, in host-defined format X X X */
+#define ESCHER_Anchor 0xF00E /* a RECT, in 100000ths of an inch C C C 0 */
+#define ESCHER_ChildAnchor 0xF00F /* a RECT, in units relative to the parent group X X X 0 */
+#define ESCHER_ClientAnchor 0xF010 /* host-defined the location of the shape, in a host-defined format X X X */
+#define ESCHER_ClientData 0xF011 /* host-defined host-specific data X X X */
+#define ESCHER_OleObject 0xF11F /* a serialized IStorage for an OLE object C C C 0 */
+#define ESCHER_DeletedPspl 0xF11D /* an FPSPL; only present in top-level deleted shapes X 0 */
+#define ESCHER_SolverContainer 0xF005 /* count of rules the rules governing shapes X X X */
+#define ESCHER_ConnectorRule 0xF012 /* an FConnectorRule X X 1 */
+#define ESCHER_AlignRule 0xF013 /* an FAlignRule X X X 0 */
+#define ESCHER_ArcRule 0xF014 /* an FARCRU X X X 0 */
+#define ESCHER_ClientRule 0xF015 /* host-defined host-defined */
+#define ESCHER_CalloutRule 0xF017 /* an FCORU X X X 0 */
+#define ESCHER_Selection 0xF119 /* an FDGSL followed by the SPIDs of the shapes in the selection X 0 */
+#define ESCHER_UDefProp 0xF122
+
+#define SHAPEFLAG_GROUP 0x001 // This shape is a group shape
+#define SHAPEFLAG_CHILD 0x002 // Not a top-level shape
+#define SHAPEFLAG_PATRIARCH 0x004 // This is the topmost group shape. Exactly one of these per drawing.
+#define SHAPEFLAG_DELETED 0x008 // The shape has been deleted
+#define SHAPEFLAG_OLESHAPE 0x010 // The shape is an OLE object
+#define SHAPEFLAG_HAVEMASTER 0x020 // Shape has a hspMaster property
+#define SHAPEFLAG_FLIPH 0x040 // Shape is flipped horizontally
+#define SHAPEFLAG_FLIPV 0x080 // Shape is flipped vertically
+#define SHAPEFLAG_CONNECTOR 0x100 // Connector type of shape
+#define SHAPEFLAG_HAVEANCHOR 0x200 // Shape has an anchor of some kind
+#define SHAPEFLAG_BACKGROUND 0x400 // Background shape
+#define SHAPEFLAG_HAVESPT 0x800 // Shape has a shape type property
+
+#define ESCHER_ShpInst_Min 0
+#define ESCHER_ShpInst_NotPrimitive ESCHER_ShpInst_Min
+#define ESCHER_ShpInst_Rectangle 1
+#define ESCHER_ShpInst_RoundRectangle 2
+#define ESCHER_ShpInst_Ellipse 3
+#define ESCHER_ShpInst_Diamond 4
+#define ESCHER_ShpInst_IsocelesTriangle 5
+#define ESCHER_ShpInst_RightTriangle 6
+#define ESCHER_ShpInst_Parallelogram 7
+#define ESCHER_ShpInst_Trapezoid 8
+#define ESCHER_ShpInst_Hexagon 9
+#define ESCHER_ShpInst_Octagon 10
+#define ESCHER_ShpInst_Plus 11
+#define ESCHER_ShpInst_Star 12
+#define ESCHER_ShpInst_Arrow 13
+#define ESCHER_ShpInst_ThickArrow 14
+#define ESCHER_ShpInst_HomePlate 15
+#define ESCHER_ShpInst_Cube 16
+#define ESCHER_ShpInst_Balloon 17
+#define ESCHER_ShpInst_Seal 18
+#define ESCHER_ShpInst_Arc 19
+#define ESCHER_ShpInst_Line 20
+#define ESCHER_ShpInst_Plaque 21
+#define ESCHER_ShpInst_Can 22
+#define ESCHER_ShpInst_Donut 23
+#define ESCHER_ShpInst_TextSimple 24
+#define ESCHER_ShpInst_TextOctagon 25
+#define ESCHER_ShpInst_TextHexagon 26
+#define ESCHER_ShpInst_TextCurve 27
+#define ESCHER_ShpInst_TextWave 28
+#define ESCHER_ShpInst_TextRing 29
+#define ESCHER_ShpInst_TextOnCurve 30
+#define ESCHER_ShpInst_TextOnRing 31
+#define ESCHER_ShpInst_StraightConnector1 32
+#define ESCHER_ShpInst_BentConnector2 33
+#define ESCHER_ShpInst_BentConnector3 34
+#define ESCHER_ShpInst_BentConnector4 35
+#define ESCHER_ShpInst_BentConnector5 36
+#define ESCHER_ShpInst_CurvedConnector2 37
+#define ESCHER_ShpInst_CurvedConnector3 38
+#define ESCHER_ShpInst_CurvedConnector4 39
+#define ESCHER_ShpInst_CurvedConnector5 40
+#define ESCHER_ShpInst_Callout1 41
+#define ESCHER_ShpInst_Callout2 42
+#define ESCHER_ShpInst_Callout3 43
+#define ESCHER_ShpInst_AccentCallout1 44
+#define ESCHER_ShpInst_AccentCallout2 45
+#define ESCHER_ShpInst_AccentCallout3 46
+#define ESCHER_ShpInst_BorderCallout1 47
+#define ESCHER_ShpInst_BorderCallout2 48
+#define ESCHER_ShpInst_BorderCallout3 49
+#define ESCHER_ShpInst_AccentBorderCallout1 50
+#define ESCHER_ShpInst_AccentBorderCallout2 51
+#define ESCHER_ShpInst_AccentBorderCallout3 52
+#define ESCHER_ShpInst_Ribbon 53
+#define ESCHER_ShpInst_Ribbon2 54
+#define ESCHER_ShpInst_Chevron 55
+#define ESCHER_ShpInst_Pentagon 56
+#define ESCHER_ShpInst_NoSmoking 57
+#define ESCHER_ShpInst_Seal8 58
+#define ESCHER_ShpInst_Seal16 59
+#define ESCHER_ShpInst_Seal32 60
+#define ESCHER_ShpInst_WedgeRectCallout 61
+#define ESCHER_ShpInst_WedgeRRectCallout 62
+#define ESCHER_ShpInst_WedgeEllipseCallout 63
+#define ESCHER_ShpInst_Wave 64
+#define ESCHER_ShpInst_FoldedCorner 65
+#define ESCHER_ShpInst_LeftArrow 66
+#define ESCHER_ShpInst_DownArrow 67
+#define ESCHER_ShpInst_UpArrow 68
+#define ESCHER_ShpInst_LeftRightArrow 69
+#define ESCHER_ShpInst_UpDownArrow 70
+#define ESCHER_ShpInst_IrregularSeal1 71
+#define ESCHER_ShpInst_IrregularSeal2 72
+#define ESCHER_ShpInst_LightningBolt 73
+#define ESCHER_ShpInst_Heart 74
+#define ESCHER_ShpInst_PictureFrame 75
+#define ESCHER_ShpInst_QuadArrow 76
+#define ESCHER_ShpInst_LeftArrowCallout 77
+#define ESCHER_ShpInst_RightArrowCallout 78
+#define ESCHER_ShpInst_UpArrowCallout 79
+#define ESCHER_ShpInst_DownArrowCallout 80
+#define ESCHER_ShpInst_LeftRightArrowCallout 81
+#define ESCHER_ShpInst_UpDownArrowCallout 82
+#define ESCHER_ShpInst_QuadArrowCallout 83
+#define ESCHER_ShpInst_Bevel 84
+#define ESCHER_ShpInst_LeftBracket 85
+#define ESCHER_ShpInst_RightBracket 86
+#define ESCHER_ShpInst_LeftBrace 87
+#define ESCHER_ShpInst_RightBrace 88
+#define ESCHER_ShpInst_LeftUpArrow 89
+#define ESCHER_ShpInst_BentUpArrow 90
+#define ESCHER_ShpInst_BentArrow 91
+#define ESCHER_ShpInst_Seal24 92
+#define ESCHER_ShpInst_StripedRightArrow 93
+#define ESCHER_ShpInst_NotchedRightArrow 94
+#define ESCHER_ShpInst_BlockArc 95
+#define ESCHER_ShpInst_SmileyFace 96
+#define ESCHER_ShpInst_VerticalScroll 97
+#define ESCHER_ShpInst_HorizontalScroll 98
+#define ESCHER_ShpInst_CircularArrow 99
+#define ESCHER_ShpInst_NotchedCircularArrow 100
+#define ESCHER_ShpInst_UturnArrow 101
+#define ESCHER_ShpInst_CurvedRightArrow 102
+#define ESCHER_ShpInst_CurvedLeftArrow 103
+#define ESCHER_ShpInst_CurvedUpArrow 104
+#define ESCHER_ShpInst_CurvedDownArrow 105
+#define ESCHER_ShpInst_CloudCallout 106
+#define ESCHER_ShpInst_EllipseRibbon 107
+#define ESCHER_ShpInst_EllipseRibbon2 108
+#define ESCHER_ShpInst_FlowChartProcess 109
+#define ESCHER_ShpInst_FlowChartDecision 110
+#define ESCHER_ShpInst_FlowChartInputOutput 111
+#define ESCHER_ShpInst_FlowChartPredefinedProcess 112
+#define ESCHER_ShpInst_FlowChartInternalStorage 113
+#define ESCHER_ShpInst_FlowChartDocument 114
+#define ESCHER_ShpInst_FlowChartMultidocument 115
+#define ESCHER_ShpInst_FlowChartTerminator 116
+#define ESCHER_ShpInst_FlowChartPreparation 117
+#define ESCHER_ShpInst_FlowChartManualInput 118
+#define ESCHER_ShpInst_FlowChartManualOperation 119
+#define ESCHER_ShpInst_FlowChartConnector 120
+#define ESCHER_ShpInst_FlowChartPunchedCard 121
+#define ESCHER_ShpInst_FlowChartPunchedTape 122
+#define ESCHER_ShpInst_FlowChartSummingJunction 123
+#define ESCHER_ShpInst_FlowChartOr 124
+#define ESCHER_ShpInst_FlowChartCollate 125
+#define ESCHER_ShpInst_FlowChartSort 126
+#define ESCHER_ShpInst_FlowChartExtract 127
+#define ESCHER_ShpInst_FlowChartMerge 128
+#define ESCHER_ShpInst_FlowChartOfflineStorage 129
+#define ESCHER_ShpInst_FlowChartOnlineStorage 130
+#define ESCHER_ShpInst_FlowChartMagneticTape 131
+#define ESCHER_ShpInst_FlowChartMagneticDisk 132
+#define ESCHER_ShpInst_FlowChartMagneticDrum 133
+#define ESCHER_ShpInst_FlowChartDisplay 134
+#define ESCHER_ShpInst_FlowChartDelay 135
+#define ESCHER_ShpInst_TextPlainText 136
+#define ESCHER_ShpInst_TextStop 137
+#define ESCHER_ShpInst_TextTriangle 138
+#define ESCHER_ShpInst_TextTriangleInverted 139
+#define ESCHER_ShpInst_TextChevron 140
+#define ESCHER_ShpInst_TextChevronInverted 141
+#define ESCHER_ShpInst_TextRingInside 142
+#define ESCHER_ShpInst_TextRingOutside 143
+#define ESCHER_ShpInst_TextArchUpCurve 144
+#define ESCHER_ShpInst_TextArchDownCurve 145
+#define ESCHER_ShpInst_TextCircleCurve 146
+#define ESCHER_ShpInst_TextButtonCurve 147
+#define ESCHER_ShpInst_TextArchUpPour 148
+#define ESCHER_ShpInst_TextArchDownPour 149
+#define ESCHER_ShpInst_TextCirclePour 150
+#define ESCHER_ShpInst_TextButtonPour 151
+#define ESCHER_ShpInst_TextCurveUp 152
+#define ESCHER_ShpInst_TextCurveDown 153
+#define ESCHER_ShpInst_TextCascadeUp 154
+#define ESCHER_ShpInst_TextCascadeDown 155
+#define ESCHER_ShpInst_TextWave1 156
+#define ESCHER_ShpInst_TextWave2 157
+#define ESCHER_ShpInst_TextWave3 158
+#define ESCHER_ShpInst_TextWave4 159
+#define ESCHER_ShpInst_TextInflate 160
+#define ESCHER_ShpInst_TextDeflate 161
+#define ESCHER_ShpInst_TextInflateBottom 162
+#define ESCHER_ShpInst_TextDeflateBottom 163
+#define ESCHER_ShpInst_TextInflateTop 164
+#define ESCHER_ShpInst_TextDeflateTop 165
+#define ESCHER_ShpInst_TextDeflateInflate 166
+#define ESCHER_ShpInst_TextDeflateInflateDeflate 167
+#define ESCHER_ShpInst_TextFadeRight 168
+#define ESCHER_ShpInst_TextFadeLeft 169
+#define ESCHER_ShpInst_TextFadeUp 170
+#define ESCHER_ShpInst_TextFadeDown 171
+#define ESCHER_ShpInst_TextSlantUp 172
+#define ESCHER_ShpInst_TextSlantDown 173
+#define ESCHER_ShpInst_TextCanUp 174
+#define ESCHER_ShpInst_TextCanDown 175
+#define ESCHER_ShpInst_FlowChartAlternateProcess 176
+#define ESCHER_ShpInst_FlowChartOffpageConnector 177
+#define ESCHER_ShpInst_Callout90 178
+#define ESCHER_ShpInst_AccentCallout90 179
+#define ESCHER_ShpInst_BorderCallout90 180
+#define ESCHER_ShpInst_AccentBorderCallout90 181
+#define ESCHER_ShpInst_LeftRightUpArrow 182
+#define ESCHER_ShpInst_Sun 183
+#define ESCHER_ShpInst_Moon 184
+#define ESCHER_ShpInst_BracketPair 185
+#define ESCHER_ShpInst_BracePair 186
+#define ESCHER_ShpInst_Seal4 187
+#define ESCHER_ShpInst_DoubleWave 188
+#define ESCHER_ShpInst_ActionButtonBlank 189
+#define ESCHER_ShpInst_ActionButtonHome 190
+#define ESCHER_ShpInst_ActionButtonHelp 191
+#define ESCHER_ShpInst_ActionButtonInformation 192
+#define ESCHER_ShpInst_ActionButtonForwardNext 193
+#define ESCHER_ShpInst_ActionButtonBackPrevious 194
+#define ESCHER_ShpInst_ActionButtonEnd 195
+#define ESCHER_ShpInst_ActionButtonBeginning 196
+#define ESCHER_ShpInst_ActionButtonReturn 197
+#define ESCHER_ShpInst_ActionButtonDocument 198
+#define ESCHER_ShpInst_ActionButtonSound 199
+#define ESCHER_ShpInst_ActionButtonMovie 200
+#define ESCHER_ShpInst_HostControl 201
+#define ESCHER_ShpInst_TextBox 202
+
+#define ESCHER_ShpInst_COUNT 203
+#define ESCHER_ShpInst_Max 0x0FFF
+#define ESCHER_ShpInst_Nil ESCHER_ShpInst_Max
+
+enum ESCHER_BlibType
+{ // GEL provided types...
+ ERROR = 0, // An error occurred during loading
+ UNKNOWN, // An unknown blip type
+ EMF, // Windows Enhanced Metafile
+ WMF, // Windows Metafile
+ PICT, // Macintosh PICT
+ PEG, // JFIF
+ PNG, // PNG
+ DIB, // Windows DIB
+ FirstClient = 32, // First client defined blip type
+ LastClient = 255 // Last client defined blip type
+};
+
+enum ESCHER_FillStyle
+{
+ ESCHER_FillSolid, // Fill with a solid color
+ ESCHER_FillPattern, // Fill with a pattern (bitmap)
+ ESCHER_FillTexture, // A texture (pattern with its own color map)
+ ESCHER_FillPicture, // Center a picture in the shape
+ ESCHER_FillShade, // Shade from start to end points
+ ESCHER_FillShadeCenter, // Shade from bounding rectangle to end point
+ ESCHER_FillShadeShape, // Shade from shape outline to end point
+ ESCHER_FillShadeScale,
+ ESCHER_FillShadeTitle,
+ ESCHER_FillBackground
+};
+
+enum ESCHER_wMode
+{
+ ESCHER_wColor, // only used for predefined shades
+ ESCHER_wAutomatic, // depends on object type
+ ESCHER_wGrayScale, // shades of gray only
+ ESCHER_wLightGrayScale, // shades of light gray only
+ ESCHER_wInverseGray, // dark gray mapped to light gray, etc.
+ ESCHER_wGrayOutline, // pure gray and white
+ ESCHER_wBlackTextLine, // black text and lines, all else grayscale
+ ESCHER_wHighContrast, // pure black and white mode (no grays)
+ ESCHER_wBlack, // solid black msobwWhite, // solid white
+ ESCHER_wDontShow, // object not drawn
+ ESCHER_wNumModes // number of Black and white modes
+};
+
+
+//
+enum ESCHER_ShapePath
+{
+ ESCHER_ShapeLines, // A line of straight segments
+ ESCHER_ShapeLinesClosed, // A closed polygonal object
+ ESCHER_ShapeCurves, // A line of Bezier curve segments
+ ESCHER_ShapeCurvesClosed, // A closed shape with curved edges
+ ESCHER_ShapeComplex // pSegmentInfo must be non-empty
+};
+
+
+enum ESCHER_WrapMode
+{
+ ESCHER_WrapSquare,
+ ESCHER_WrapByPoints,
+ ESCHER_WrapNone,
+ ESCHER_WrapTopBottom,
+ ESCHER_WrapThrough
+};
+
+//
+enum ESCHER_bwMode
+{
+ ESCHER_bwColor, // only used for predefined shades
+ ESCHER_bwAutomatic, // depends on object type
+ ESCHER_bwGrayScale, // shades of gray only
+ ESCHER_bwLightGrayScale, // shades of light gray only
+ ESCHER_bwInverseGray, // dark gray mapped to light gray, etc.
+ ESCHER_bwGrayOutline, // pure gray and white
+ ESCHER_bwBlackTextLine, // black text and lines, all else grayscale
+ ESCHER_bwHighContrast, // pure black and white mode (no grays)
+ ESCHER_bwBlack, // solid black
+ ESCHER_bwWhite, // solid white
+ ESCHER_bwDontShow, // object not drawn
+ ESCHER_bwNumModes // number of Black and white modes
+};
+
+
+enum ESCHER_AnchorText
+{
+ ESCHER_AnchorTop,
+ ESCHER_AnchorMiddle,
+ ESCHER_AnchorBottom,
+ ESCHER_AnchorTopCentered,
+ ESCHER_AnchorMiddleCentered,
+ ESCHER_AnchorBottomCentered,
+ ESCHER_AnchorTopBaseline,
+ ESCHER_AnchorBottomBaseline,
+ ESCHER_AnchorTopCenteredBaseline,
+ ESCHER_AnchorBottomCenteredBaseline
+};
+
+enum ESCHER_cDir
+{
+ ESCHER_cDir0, // Right
+ ESCHER_cDir90, // Down
+ ESCHER_cDir180, // Left
+ ESCHER_cDir270 // Up
+};
+
+// connector style
+enum ESCHER_cxSTYLE
+{
+ ESCHER_cxstyleStraight = 0,
+ ESCHER_cxstyleBent,
+ ESCHER_cxstyleCurved,
+ ESCHER_cxstyleNone
+};
+
+// text flow
+enum ESCHER_txfl
+{
+ ESCHER_txflHorzN, // Horizontal non-@
+ ESCHER_txflTtoBA, // Top to Bottom @-font
+ ESCHER_txflBtoT, // Bottom to Top non-@
+ ESCHER_txflTtoBN, // Top to Bottom non-@
+ ESCHER_txflHorzA, // Horizontal @-font
+ ESCHER_txflVertN // Vertical, non-@
+};
+
+// text direction (needed for Bi-Di support)
+enum ESCHER_txDir
+{
+ ESCHER_txdirLTR, // left-to-right text direction
+ ESCHER_txdirRTL, // right-to-left text direction
+ ESCHER_txdirContext // context text direction
+};
+
+// Callout Type
+enum ESCHER_spcot
+{
+ ESCHER_spcotRightAngle = 1,
+ ESCHER_spcotOneSegment = 2,
+ ESCHER_spcotTwoSegment = 3,
+ ESCHER_spcotThreeSegment = 4
+};
+
+// Callout Angle
+enum ESCHER_spcoa
+{
+ ESCHER_spcoaAny,
+ ESCHER_spcoa30,
+ ESCHER_spcoa45,
+ ESCHER_spcoa60,
+ ESCHER_spcoa90,
+ ESCHER_spcoa0
+};
+
+// Callout Drop
+enum ESCHER_spcod
+{
+ ESCHER_spcodTop,
+ ESCHER_spcodCenter,
+ ESCHER_spcodBottom,
+ ESCHER_spcodSpecified
+};
+
+// FontWork alignment
+enum ESCHER_GeoTextAlign
+{
+ ESCHER_AlignTextStretch, /* Stretch each line of text to fit width. */
+ ESCHER_AlignTextCenter, /* Center text on width. */
+ ESCHER_AlignTextLeft, /* Left justify. */
+ ESCHER_AlignTextRight, /* Right justify. */
+ ESCHER_AlignTextLetterJust, /* Spread letters out to fit width. */
+ ESCHER_AlignTextWordJust, /* Spread words out to fit width. */
+ ESCHER_AlignTextInvalid /* Invalid */
+};
+
+// flags for pictures
+enum ESCHER_BlipFlags
+{
+ ESCHER_BlipFlagDefault = 0,
+ ESCHER_BlipFlagComment = 0, // Blip name is a comment
+ ESCHER_BlipFlagFile, // Blip name is a file name
+ ESCHER_BlipFlagURL, // Blip name is a full URL
+ ESCHER_BlipFlagType = 3, // Mask to extract type
+ /* Or the following flags with any of the above. */
+ ESCHER_BlipFlagDontSave = 4, // A "dont" is the depression in the metal
+ // body work of an automobile caused when a
+ // cyclist violently thrusts his or her nose
+ // at it, thus a DontSave is another name for
+ // a cycle lane.
+ ESCHER_BlipFlagDoNotSave = 4, // For those who prefer English
+ ESCHER_BlipFlagLinkToFile = 8
+};
+
+//
+enum ESCHER_3DRenderMode
+{
+ ESCHER_FullRender, // Generate a full rendering
+ ESCHER_Wireframe, // Generate a wireframe
+ ESCHER_BoundingCube // Generate a bounding cube
+};
+
+//
+enum ESCHER_xFormType
+{
+ ESCHER_xFormAbsolute, // Apply transform in absolute space centered on shape
+ ESCHER_xFormShape, // Apply transform to shape geometry
+ ESCHER_xFormDrawing // Apply transform in drawing space
+};
+
+//
+enum ESCHER_ShadowType
+{
+ ESCHER_ShadowOffset, // N pixel offset shadow
+ ESCHER_ShadowDouble, // Use second offset too
+ ESCHER_ShadowRich, // Rich perspective shadow (cast relative to shape)
+ ESCHER_ShadowShape, // Rich perspective shadow (cast in shape space)
+ ESCHER_ShadowDrawing, // Perspective shadow cast in drawing space
+ ESCHER_ShadowEmbossOrEngrave
+};
+
+// - the type of a (length) measurement
+enum ESCHER_dzType
+ {
+ ESCHER_dzTypeMin = 0,
+ ESCHER_dzTypeDefault = 0, // Default size, ignore the values
+ ESCHER_dzTypeA = 1, // Values are in EMUs
+ ESCHER_dzTypeV = 2, // Values are in pixels
+ ESCHER_dzTypeShape = 3, // Values are 16.16 fractions of shape size
+ ESCHER_dzTypeFixedAspect = 4, // Aspect ratio is fixed
+ ESCHER_dzTypeAFixed = 5, // EMUs, fixed aspect ratio
+ ESCHER_dzTypeVFixed = 6, // Pixels, fixed aspect ratio
+ ESCHER_dzTypeShapeFixed = 7, // Proportion of shape, fixed aspect ratio
+ ESCHER_dzTypeFixedAspectEnlarge= 8, // Aspect ratio is fixed, favor larger size
+ ESCHER_dzTypeAFixedBig = 9, // EMUs, fixed aspect ratio
+ ESCHER_dzTypeVFixedBig = 10, // Pixels, fixed aspect ratio
+ ESCHER_dzTypeShapeFixedBig= 11, // Proportion of shape, fixed aspect ratio
+ ESCHER_dzTypeMax = 11
+};
+
+// how to interpret the colors in a shaded fill.
+enum ESCHER_ShadeType
+{
+ ESCHER_ShadeNone = 0, // Interpolate without correction between RGBs
+ ESCHER_ShadeGamma = 1, // Apply gamma correction to colors
+ ESCHER_ShadeSigma = 2, // Apply a sigma transfer function to position
+ ESCHER_ShadeBand = 4, // Add a flat band at the start of the shade
+ ESCHER_ShadeOneColor = 8, // This is a one color shade
+
+ /* A parameter for the band or sigma function can be stored in the top
+ 16 bits of the value - this is a proportion of *each* band of the
+ shade to make flat (or the approximate equal value for a sigma
+ function). NOTE: the parameter is not used for the sigma function,
+ instead a built in value is used. This value should not be changed
+ from the default! */
+ ESCHER_ShadeParameterShift = 16,
+ ESCHER_ShadeParameterMask = 0xffff0000,
+
+ ESCHER_ShadeDefault = (ESCHER_ShadeGamma|ESCHER_ShadeSigma|
+ (16384<<ESCHER_ShadeParameterShift))
+};
+
+// compound line style
+enum ESCHER_LineStyle
+{
+ ESCHER_LineSimple, // Single line (of width lineWidth)
+ ESCHER_LineDouble, // Double lines of equal width
+ ESCHER_LineThickThin, // Double lines, one thick, one thin
+ ESCHER_LineThinThick, // Double lines, reverse order
+ ESCHER_LineTriple // Three lines, thin, thick, thin
+};
+
+// how to "fill" the line contour
+enum ESCHER_LineType
+{
+ ESCHER_lineSolidType, // Fill with a solid color
+ ESCHER_linePattern, // Fill with a pattern (bitmap)
+ ESCHER_lineTexture, // A texture (pattern with its own color map)
+ ESCHER_linePicture // Center a picture in the shape
+};
+
+// dashed line style
+enum ESCHER_LineDashing
+{
+ ESCHER_LineSolid, // Solid (continuous) pen
+ ESCHER_LineDashSys, // PS_DASH system dash style
+ ESCHER_LineDotSys, // PS_DOT system dash style
+ ESCHER_LineDashDotSys, // PS_DASHDOT system dash style
+ ESCHER_LineDashDotDotSys, // PS_DASHDOTDOT system dash style
+ ESCHER_LineDotGEL, // square dot style
+ ESCHER_LineDashGEL, // dash style
+ ESCHER_LineLongDashGEL, // long dash style
+ ESCHER_LineDashDotGEL, // dash short dash
+ ESCHER_LineLongDashDotGEL, // long dash short dash
+ ESCHER_LineLongDashDotDotGEL // long dash short dash short dash
+};
+
+// line end effect
+enum ESCHER_LineEnd
+{
+ ESCHER_LineNoEnd,
+ ESCHER_LineArrowEnd,
+ ESCHER_LineArrowStealthEnd,
+ ESCHER_LineArrowDiamondEnd,
+ ESCHER_LineArrowOvalEnd,
+ ESCHER_LineArrowOpenEnd
+};
+
+// size of arrowhead
+enum ESCHER_LineWidth
+{
+ ESCHER_LineNarrowArrow,
+ ESCHER_LineMediumWidthArrow,
+ ESCHER_LineWideArrow
+};
+
+// size of arrowhead
+enum ESCHER_LineEndLenght
+{
+ ESCHER_LineShortArrow,
+ ESCHER_LineMediumLenArrow,
+ ESCHER_LineLongArrow
+};
+
+// line join style.
+enum ESCHER_LineJoin
+{
+ ESCHER_LineJoinBevel, // Join edges by a straight line
+ ESCHER_LineJoinMiter, // Extend edges until they join
+ ESCHER_LineJoinRound // Draw an arc between the two edges
+};
+
+// line cap style (applies to ends of dash segments too).
+enum ESCHER_LineCap
+{
+ ESCHER_LineEndCapRound, // Rounded ends - the default
+ ESCHER_LineEndCapSquare, // Square protrudes by half line width
+ ESCHER_LineEndCapFlat // Line ends at end point
+};
+// Shape Properties
+// 1pt = 12700 EMU (English Metric Units)
+// 1pt = 20 Twip = 20/1440" = 1/72"
+// 1twip=635 EMU
+// 1" = 12700*72 = 914400 EMU
+// 1" = 25.4mm
+// 1mm = 36000 EMU
+// Transform
+#define ESCHER_Prop_Rotation 4 /* Fixed Point 16.16 degrees */
+// Protection
+#define ESCHER_Prop_LockRotation 119 /* sal_Bool No rotation */
+#define ESCHER_Prop_LockAspectRatio 120 /* sal_Bool Don't allow changes in aspect ratio */
+#define ESCHER_Prop_LockPosition 121 /* sal_Bool Don't allow the shape to be moved */
+#define ESCHER_Prop_LockAgainstSelect 122 /* sal_Bool Shape may not be selected */
+#define ESCHER_Prop_LockCropping 123 /* sal_Bool No cropping this shape */
+#define ESCHER_Prop_LockVertices 124 /* sal_Bool Edit Points not allowed */
+#define ESCHER_Prop_LockText 125 /* sal_Bool Do not edit text */
+#define ESCHER_Prop_LockAdjustHandles 126 /* sal_Bool Do not adjust */
+#define ESCHER_Prop_LockAgainstGrouping 127 /* sal_Bool Do not group this shape */
+// Text
+#define ESCHER_Prop_lTxid 128 /* LONG id for the text, value determined by the host */
+#define ESCHER_Prop_dxTextLeft 129 /* LONG margins relative to shape's inscribed */
+#define ESCHER_Prop_dyTextTop 130 /* LONG text rectangle (in EMUs) */
+#define ESCHER_Prop_dxTextRight 131 /* LONG */
+#define ESCHER_Prop_dyTextBottom 132 /* LONG */
+#define ESCHER_Prop_WrapText 133 /* MSOWRAPMODE Wrap text at shape margins */
+#define ESCHER_Prop_scaleText 134 /* LONG Text zoom/scale (used if fFitTextToShape) */
+#define ESCHER_Prop_AnchorText 135 /* ESCHER_AnchorText How to anchor the text */
+#define ESCHER_Prop_txflTextFlow 136 /* MSOTXFL Text flow */
+#define ESCHER_Prop_cdirFont 137 /* MSOCDIR Font rotation */
+#define ESCHER_Prop_hspNext 138 /* MSOHSP ID of the next shape (used by Word for linked textboxes) */
+#define ESCHER_Prop_txdir 139 /* MSOTXDIR Bi-Di Text direction */
+#define ESCHER_Prop_SelectText 187 /* sal_Bool sal_True if single click selects text, sal_False if two clicks */
+#define ESCHER_Prop_AutoTextMargin 188 /* sal_Bool use host's margin calculations */
+#define ESCHER_Prop_RotateText 189 /* sal_Bool Rotate text with shape */
+#define ESCHER_Prop_FitShapeToText 190 /* sal_Bool Size shape to fit text size */
+#define ESCHER_Prop_FitTextToShape 191 /* sal_Bool Size text to fit shape size */
+// GeoText
+#define ESCHER_Prop_gtextUNICODE 192 /* WCHAR* UNICODE text string */
+#define ESCHER_Prop_gtextRTF 193 /* char* RTF text string */
+#define ESCHER_Prop_gtextAlign 194 /* MSOGEOTEXTALIGN alignment on curve */
+#define ESCHER_Prop_gtextSize 195 /* LONG default point size */
+#define ESCHER_Prop_gtextSpacing 196 /* LONG fixed point 16.16 */
+#define ESCHER_Prop_gtextFont 197 /* WCHAR* font family name */
+#define ESCHER_Prop_gtextFReverseRows 240 /* sal_Bool Reverse row order */
+#define ESCHER_Prop_fGtext 241 /* sal_Bool Has text effect */
+#define ESCHER_Prop_gtextFVertical 242 /* sal_Bool Rotate characters */
+#define ESCHER_Prop_gtextFKern 243 /* sal_Bool Kern characters */
+#define ESCHER_Prop_gtextFTight 244 /* sal_Bool Tightening or tracking */
+#define ESCHER_Prop_gtextFStretch 245 /* sal_Bool Stretch to fit shape */
+#define ESCHER_Prop_gtextFShrinkFit 246 /* sal_Bool Char bounding box */
+#define ESCHER_Prop_gtextFBestFit 247 /* sal_Bool Scale text-on-path */
+#define ESCHER_Prop_gtextFNormalize 248 /* sal_Bool Stretch char height */
+#define ESCHER_Prop_gtextFDxMeasure 249 /* sal_Bool Do not measure along path */
+#define ESCHER_Prop_gtextFBold 250 /* sal_Bool Bold font */
+#define ESCHER_Prop_gtextFItalic 251 /* sal_Bool Italic font */
+#define ESCHER_Prop_gtextFUnderline 252 /* sal_Bool Underline font */
+#define ESCHER_Prop_gtextFShadow 253 /* sal_Bool Shadow font */
+#define ESCHER_Prop_gtextFSmallcaps 254 /* sal_Bool Small caps font */
+#define ESCHER_Prop_gtextFStrikethrough 255 /* sal_Bool Strike through font */
+// Blip
+#define ESCHER_Prop_cropFromTop 256 /* LONG 16.16 fraction times total */
+#define ESCHER_Prop_cropFromBottom 257 /* LONG image width or height, */
+#define ESCHER_Prop_cropFromLeft 258 /* LONG as appropriate. */
+#define ESCHER_Prop_cropFromRight 259 /* LONG */
+#define ESCHER_Prop_pib 260 /* IMsoBlip* Blip to display */
+#define ESCHER_Prop_pibName 261 /* WCHAR* Blip file name */
+#define ESCHER_Prop_pibFlags 262 /* MSOBLIPFLAGS Blip flags */
+#define ESCHER_Prop_pictureTransparent 263 /* LONG transparent color (none if ~0UL) */
+#define ESCHER_Prop_pictureContrast 264 /* LONG contrast setting */
+#define ESCHER_Prop_pictureBrightness 265 /* LONG brightness setting */
+#define ESCHER_Prop_pictureGamma 266 /* LONG 16.16 gamma */
+#define ESCHER_Prop_pictureId 267 /* LONG Host-defined ID for OLE objects (usually a pointer) */
+#define ESCHER_Prop_pictureDblCrMod 268 /* MSOCLR Modification used if shape has double shadow */
+#define ESCHER_Prop_pictureFillCrMod 269 /* MSOCLR */
+#define ESCHER_Prop_pictureLineCrMod 270 /* MSOCLR */
+#define ESCHER_Prop_pibPrint 271 /* IMsoBlip* Blip to display when printing */
+#define ESCHER_Prop_pibPrintName 272 /* WCHAR* Blip file name */
+#define ESCHER_Prop_pibPrintFlags 273 /* MSOBLIPFLAGS Blip flags */
+#define ESCHER_Prop_fNoHitTestPicture 316 /* sal_Bool Do not hit test the picture */
+#define ESCHER_Prop_pictureGray 317 /* sal_Bool grayscale display */
+#define ESCHER_Prop_pictureBiLevel 318 /* sal_Bool bi-level display */
+#define ESCHER_Prop_pictureActive 319 /* sal_Bool Server is active (OLE objects only) */
+// Geometry
+#define ESCHER_Prop_geoLeft 320 /* LONG Defines the G (geometry) coordinate space. */
+#define ESCHER_Prop_geoTop 321 /* LONG */
+#define ESCHER_Prop_geoRight 322 /* LONG */
+#define ESCHER_Prop_geoBottom 323 /* LONG */
+#define ESCHER_Prop_shapePath 324 /* MSOSHAPEPATH */
+#define ESCHER_Prop_pVertices 325 /* IMsoArray An array of points, in G units. */
+#define ESCHER_Prop_pSegmentInfo 326 /* IMsoArray */
+#define ESCHER_Prop_adjustValue 327 /* LONG Adjustment values corresponding to */
+#define ESCHER_Prop_adjust2Value 328 /* LONG the positions of the adjust handles */
+#define ESCHER_Prop_adjust3Value 329 /* LONG of the shape. The number of values */
+#define ESCHER_Prop_adjust4Value 330 /* LONG used and their allowable ranges vary */
+#define ESCHER_Prop_adjust5Value 331 /* LONG from shape type to shape type. */
+#define ESCHER_Prop_adjust6Value 332 /* LONG */
+#define ESCHER_Prop_adjust7Value 333 /* LONG */
+#define ESCHER_Prop_adjust8Value 334 /* LONG */
+#define ESCHER_Prop_adjust9Value 335 /* LONG */
+#define ESCHER_Prop_adjust10Value 336 /* LONG */
+#define ESCHER_Prop_fShadowOK 378 /* sal_Bool Shadow may be set */
+#define ESCHER_Prop_f3DOK 379 /* sal_Bool 3D may be set */
+#define ESCHER_Prop_fLineOK 380 /* sal_Bool Line style may be set */
+#define ESCHER_Prop_fGtextOK 381 /* sal_Bool Text effect (FontWork) supported */
+#define ESCHER_Prop_fFillShadeShapeOK 382 /* sal_Bool */
+#define ESCHER_Prop_fFillOK 383 /* sal_Bool OK to fill the shape through the UI or VBA? */
+// FillStyle
+#define ESCHER_Prop_fillType 384 /* ESCHER_FillStyle Type of fill */
+#define ESCHER_Prop_fillColor 385 /* MSOCLR Foreground color */
+#define ESCHER_Prop_fillOpacity 386 /* LONG Fixed 16.16 */
+#define ESCHER_Prop_fillBackColor 387 /* MSOCLR Background color */
+#define ESCHER_Prop_fillBackOpacity 388 /* LONG Shades only */
+#define ESCHER_Prop_fillCrMod 389 /* MSOCLR Modification for BW views */
+#define ESCHER_Prop_fillBlip 390 /* IMsoBlip* Pattern/texture */
+#define ESCHER_Prop_fillBlipName 391 /* WCHAR* Blip file name */
+#define ESCHER_Prop_fillBlipFlags 392 /* MSOBLIPFLAGS Blip flags */
+#define ESCHER_Prop_fillWidth 393 /* LONG How big (A units) to make a metafile texture. */
+#define ESCHER_Prop_fillHeight 394 /* LONG */
+#define ESCHER_Prop_fillAngle 395 /* LONG Fade angle - degrees in 16.16 */
+#define ESCHER_Prop_fillFocus 396 /* LONG Linear shaded fill focus percent */
+#define ESCHER_Prop_fillToLeft 397 /* LONG Fraction 16.16 */
+#define ESCHER_Prop_fillToTop 398 /* LONG Fraction 16.16 */
+#define ESCHER_Prop_fillToRight 399 /* LONG Fraction 16.16 */
+#define ESCHER_Prop_fillToBottom 400 /* LONG Fraction 16.16 */
+#define ESCHER_Prop_fillRectLeft 401 /* LONG For shaded fills, use the specified rectangle */
+#define ESCHER_Prop_fillRectTop 402 /* LONG instead of the shape's bounding rect to */
+#define ESCHER_Prop_fillRectRight 403 /* LONG define how large the fade is going to be. */
+#define ESCHER_Prop_fillRectBottom 404 /* LONG */
+#define ESCHER_Prop_fillDztype 405 /* MSODZTYPE */
+#define ESCHER_Prop_fillShadePreset 406 /* LONG Special shades */
+#define ESCHER_Prop_fillShadeColors 407 /* IMsoArray a preset array of colors */
+#define ESCHER_Prop_fillOriginX 408 /* LONG */
+#define ESCHER_Prop_fillOriginY 409 /* LONG */
+#define ESCHER_Prop_fillShapeOriginX 410 /* LONG */
+#define ESCHER_Prop_fillShapeOriginY 411 /* LONG */
+#define ESCHER_Prop_fillShadeType 412 /* MSOSHADETYPE Type of shading, if a shaded (gradient) fill. */
+#define ESCHER_Prop_fFilled 443 /* sal_Bool Is shape filled? */
+#define ESCHER_Prop_fHitTestFill 444 /* sal_Bool Should we hit test fill? */
+#define ESCHER_Prop_fillShape 445 /* sal_Bool Register pattern on shape */
+#define ESCHER_Prop_fillUseRect 446 /* sal_Bool Use the large rect? */
+#define ESCHER_Prop_fNoFillHitTest 447 /* sal_Bool Hit test a shape as though filled */
+// LineStyle
+#define ESCHER_Prop_lineColor 448 /* MSOCLR Color of line */
+#define ESCHER_Prop_lineOpacity 449 /* LONG Not implemented */
+#define ESCHER_Prop_lineBackColor 450 /* MSOCLR Background color */
+#define ESCHER_Prop_lineCrMod 451 /* MSOCLR Modification for BW views */
+#define ESCHER_Prop_lineType 452 /* MSOLINETYPE Type of line */
+#define ESCHER_Prop_lineFillBlip 453 /* IMsoBlip* Pattern/texture */
+#define ESCHER_Prop_lineFillBlipName 454 /* WCHAR* Blip file name */
+#define ESCHER_Prop_lineFillBlipFlags 455 /* MSOBLIPFLAGS Blip flags */
+#define ESCHER_Prop_lineFillWidth 456 /* LONG How big (A units) to make */
+#define ESCHER_Prop_lineFillHeight 457 /* LONG a metafile texture. */
+#define ESCHER_Prop_lineFillDztype 458 /* MSODZTYPE How to interpret fillWidth/Height numbers. */
+#define ESCHER_Prop_lineWidth 459 /* LONG A units; 1pt == 12700 EMUs */
+#define ESCHER_Prop_lineMiterLimit 460 /* LONG ratio (16.16) of width */
+#define ESCHER_Prop_lineStyle 461 /* MSOLINESTYLE Draw parallel lines? */
+#define ESCHER_Prop_lineDashing 462 /* MSOLINEDASHING Can be overridden by: */
+#define ESCHER_Prop_lineDashStyle 463 /* IMsoArray As Win32 ExtCreatePen */
+#define ESCHER_Prop_lineStartArrowhead 464 /* MSOLINEEND Arrow at start */
+#define ESCHER_Prop_lineEndArrowhead 465 /* MSOLINEEND Arrow at end */
+#define ESCHER_Prop_lineStartArrowWidth 466 /* MSOLINEENDWIDTH Arrow at start */
+#define ESCHER_Prop_lineStartArrowLength 467 /* MSOLINEENDLENGTH Arrow at end */
+#define ESCHER_Prop_lineEndArrowWidth 468 /* MSOLINEENDWIDTH Arrow at start */
+#define ESCHER_Prop_lineEndArrowLength 469 /* MSOLINEENDLENGTH Arrow at end */
+#define ESCHER_Prop_lineJoinStyle 470 /* MSOLINEJOIN How to join lines */
+#define ESCHER_Prop_lineEndCapStyle 471 /* MSOLINECAP How to end lines */
+#define ESCHER_Prop_fArrowheadsOK 507 /* sal_Bool Allow arrowheads if prop. is set */
+#define ESCHER_Prop_fLine 508 /* sal_Bool Any line? */
+#define ESCHER_Prop_fHitTestLine 509 /* sal_Bool Should we hit test lines? */
+#define ESCHER_Prop_lineFillShape 510 /* sal_Bool Register pattern on shape */
+#define ESCHER_Prop_fNoLineDrawDash 511 /* sal_Bool Draw a dashed line if no line */
+// ShadowStyle
+#define ESCHER_Prop_shadowType 512 /* MSOSHADOWTYPE Type of effect */
+#define ESCHER_Prop_shadowColor 513 /* MSOCLR Foreground color */
+#define ESCHER_Prop_shadowHighlight 514 /* MSOCLR Embossed color */
+#define ESCHER_Prop_shadowCrMod 515 /* MSOCLR Modification for BW views */
+#define ESCHER_Prop_shadowOpacity 516 /* LONG Fixed 16.16 */
+#define ESCHER_Prop_shadowOffsetX 517 /* LONG Offset shadow */
+#define ESCHER_Prop_shadowOffsetY 518 /* LONG Offset shadow */
+#define ESCHER_Prop_shadowSecondOffsetX 519 /* LONG Double offset shadow */
+#define ESCHER_Prop_shadowSecondOffsetY 520 /* LONG Double offset shadow */
+#define ESCHER_Prop_shadowScaleXToX 521 /* LONG 16.16 */
+#define ESCHER_Prop_shadowScaleYToX 522 /* LONG 16.16 */
+#define ESCHER_Prop_shadowScaleXToY 523 /* LONG 16.16 */
+#define ESCHER_Prop_shadowScaleYToY 524 /* LONG 16.16 */
+#define ESCHER_Prop_shadowPerspectiveX 525 /* LONG 16.16 / weight */
+#define ESCHER_Prop_shadowPerspectiveY 526 /* LONG 16.16 / weight */
+#define ESCHER_Prop_shadowWeight 527 /* LONG scaling factor */
+#define ESCHER_Prop_shadowOriginX 528 /* LONG */
+#define ESCHER_Prop_shadowOriginY 529 /* LONG */
+#define ESCHER_Prop_fShadow 574 /* sal_Bool Any shadow? */
+#define ESCHER_Prop_fshadowObscured 575 /* sal_Bool Excel5-style shadow */
+// PerspectiveStyle
+#define ESCHER_Prop_perspectiveType 576 /* MSOXFORMTYPE Where transform applies */
+#define ESCHER_Prop_perspectiveOffsetX 577 /* LONG The LONG values define a */
+#define ESCHER_Prop_perspectiveOffsetY 578 /* LONG transformation matrix, */
+#define ESCHER_Prop_perspectiveScaleXToX 579 /* LONG effectively, each value */
+#define ESCHER_Prop_perspectiveScaleYToX 580 /* LONG is scaled by the */
+#define ESCHER_Prop_perspectiveScaleXToY 581 /* LONG perspectiveWeight parameter. */
+#define ESCHER_Prop_perspectiveScaleYToY 582 /* LONG */
+#define ESCHER_Prop_perspectivePerspectiveX 583 /* LONG */
+#define ESCHER_Prop_perspectivePerspectiveY 584 /* LONG */
+#define ESCHER_Prop_perspectiveWeight 585 /* LONG Scaling factor */
+#define ESCHER_Prop_perspectiveOriginX 586 /* LONG */
+#define ESCHER_Prop_perspectiveOriginY 587 /* LONG */
+#define ESCHER_Prop_fPerspective 639 /* sal_Bool On/off */
+// 3D Object
+#define ESCHER_Prop_c3DSpecularAmt 640 /* LONG Fixed-point 16.16 */
+#define ESCHER_Prop_c3DDiffuseAmt 641 /* LONG Fixed-point 16.16 */
+#define ESCHER_Prop_c3DShininess 642 /* LONG Default gives OK results */
+#define ESCHER_Prop_c3DEdgeThickness 643 /* LONG Specular edge thickness */
+#define ESCHER_Prop_c3DExtrudeForward 644 /* LONG Distance of extrusion in EMUs */
+#define ESCHER_Prop_c3DExtrudeBackward 645 /* LONG */
+#define ESCHER_Prop_c3DExtrudePlane 646 /* LONG Extrusion direction */
+#define ESCHER_Prop_c3DExtrusionColor 647 /* MSOCLR Basic color of extruded part of shape; the lighting model used will determine the exact shades used when rendering. */
+#define ESCHER_Prop_c3DCrMod 648 /* MSOCLR Modification for BW views */
+#define ESCHER_Prop_f3D 700 /* sal_Bool Does this shape have a 3D effect? */
+#define ESCHER_Prop_fc3DMetallic 701 /* sal_Bool Use metallic specularity? */
+#define ESCHER_Prop_fc3DUseExtrusionColor 702 /* sal_Bool */
+#define ESCHER_Prop_fc3DLightFace 703 /* sal_Bool */
+// 3D Style
+#define ESCHER_Prop_c3DYRotationAngle 704 /* LONG degrees (16.16) about y axis */
+#define ESCHER_Prop_c3DXRotationAngle 705 /* LONG degrees (16.16) about x axis */
+#define ESCHER_Prop_c3DRotationAxisX 706 /* LONG These specify the rotation axis; */
+#define ESCHER_Prop_c3DRotationAxisY 707 /* LONG only their relative magnitudes */
+#define ESCHER_Prop_c3DRotationAxisZ 708 /* LONG matter. */
+#define ESCHER_Prop_c3DRotationAngle 709 /* LONG degrees (16.16) about axis */
+#define ESCHER_Prop_c3DRotationCenterX 710 /* LONG rotation center x (16.16 or g-units) */
+#define ESCHER_Prop_c3DRotationCenterY 711 /* LONG rotation center y (16.16 or g-units) */
+#define ESCHER_Prop_c3DRotationCenterZ 712 /* LONG rotation center z (absolute (emus)) */
+#define ESCHER_Prop_c3DRenderMode 713 /* MSO3DRENDERMODE Full,wireframe, or bcube */
+#define ESCHER_Prop_c3DTolerance 714 /* LONG pixels (16.16) */
+#define ESCHER_Prop_c3DXViewpoint 715 /* LONG X view point (emus) */
+#define ESCHER_Prop_c3DYViewpoint 716 /* LONG Y view point (emus) */
+#define ESCHER_Prop_c3DZViewpoint 717 /* LONG Z view distance (emus) */
+#define ESCHER_Prop_c3DOriginX 718 /* LONG */
+#define ESCHER_Prop_c3DOriginY 719 /* LONG */
+#define ESCHER_Prop_c3DSkewAngle 720 /* LONG degree (16.16) skew angle */
+#define ESCHER_Prop_c3DSkewAmount 721 /* LONG Percentage skew amount */
+#define ESCHER_Prop_c3DAmbientIntensity 722 /* LONG Fixed point intensity */
+#define ESCHER_Prop_c3DKeyX 723 /* LONG Key light source direc- */
+#define ESCHER_Prop_c3DKeyY 724 /* LONG tion; only their relative */
+#define ESCHER_Prop_c3DKeyZ 725 /* LONG magnitudes matter */
+#define ESCHER_Prop_c3DKeyIntensity 726 /* LONG Fixed point intensity */
+#define ESCHER_Prop_c3DFillX 727 /* LONG Fill light source direc- */
+#define ESCHER_Prop_c3DFillY 728 /* LONG tion; only their relative */
+#define ESCHER_Prop_c3DFillZ 729 /* LONG magnitudes matter */
+#define ESCHER_Prop_c3DFillIntensity 730 /* LONG Fixed point intensity */
+#define ESCHER_Prop_fc3DConstrainRotation 763 /* sal_Bool */
+#define ESCHER_Prop_fc3DRotationCenterAuto 764 /* sal_Bool */
+#define ESCHER_Prop_fc3DParallel 765 /* sal_Bool Parallel projection? */
+#define ESCHER_Prop_fc3DKeyHarsh 766 /* sal_Bool Is key lighting harsh? */
+#define ESCHER_Prop_fc3DFillHarsh 767 /* sal_Bool Is fill lighting harsh? */
+// Shape
+#define ESCHER_Prop_hspMaster 769 /* MSOHSP master shape */
+#define ESCHER_Prop_cxstyle 771 /* MSOCXSTYLE Type of connector */
+#define ESCHER_Prop_bWMode 772 /* ESCHERwMode Settings for modifications to */
+#define ESCHER_Prop_bWModePureBW 773 /* ESCHERwMode be made when in different */
+#define ESCHER_Prop_bWModeBW 774 /* ESCHERwMode forms of black-and-white mode. */
+#define ESCHER_Prop_fOleIcon 826 /* sal_Bool For OLE objects, whether the object is in icon form */
+#define ESCHER_Prop_fPreferRelativeResize 827 /* sal_Bool For UI only. Prefer relative resizing. */
+#define ESCHER_Prop_fLockShapeType 828 /* sal_Bool Lock the shape type (don't allow Change Shape) */
+#define ESCHER_Prop_fDeleteAttachedObject 830 /* sal_Bool */
+#define ESCHER_Prop_fBackground 831 /* sal_Bool If sal_True, this is the background shape. */
+// Callout
+#define ESCHER_Prop_spcot 832 /* MSOSPCOT Callout type */
+#define ESCHER_Prop_dxyCalloutGap 833 /* LONG Distance from box to first point.(EMUs) */
+#define ESCHER_Prop_spcoa 834 /* MSOSPCOA Callout angle */
+#define ESCHER_Prop_spcod 835 /* MSOSPCOD Callout drop type */
+#define ESCHER_Prop_dxyCalloutDropSpecified 836 /* LONG if msospcodSpecified, the actual drop distance */
+#define ESCHER_Prop_dxyCalloutLengthSpecified 837 /* LONG if fCalloutLengthSpecified, the actual distance */
+#define ESCHER_Prop_fCallout 889 /* sal_Bool Is the shape a callout? */
+#define ESCHER_Prop_fCalloutAccentBar 890 /* sal_Bool does callout have accent bar */
+#define ESCHER_Prop_fCalloutTextBorder 891 /* sal_Bool does callout have a text border */
+#define ESCHER_Prop_fCalloutMinusX 892 /* sal_Bool */
+#define ESCHER_Prop_fCalloutMinusY 893 /* sal_Bool */
+#define ESCHER_Prop_fCalloutDropAuto 894 /* sal_Bool If true, then we occasionally invert the drop distance */
+#define ESCHER_Prop_fCalloutLengthSpecified 895 /* sal_Bool if true, we look at dxyCalloutLengthSpecified */
+// GroupShape
+#define ESCHER_Prop_wzName 896 /* WCHAR* Shape Name (present only if explicitly set) */
+#define ESCHER_Prop_wzDescription 897 /* WCHAR* alternate text */
+#define ESCHER_Prop_pihlShape 898 /* IHlink* The hyperlink in the shape. */
+#define ESCHER_Prop_pWrapPolygonVertices 899 /* IMsoArray The polygon that text will be wrapped around (Word) */
+#define ESCHER_Prop_dxWrapDistLeft 900 /* LONG Left wrapping distance from text (Word) */
+#define ESCHER_Prop_dyWrapDistTop 901 /* LONG Top wrapping distance from text (Word) */
+#define ESCHER_Prop_dxWrapDistRight 902 /* LONG Right wrapping distance from text (Word) */
+#define ESCHER_Prop_dyWrapDistBottom 903 /* LONG Bottom wrapping distance from text (Word) */
+#define ESCHER_Prop_lidRegroup 904 /* LONG Regroup ID */
+#define ESCHER_Prop_tableProperties 927
+#define ESCHER_Prop_tableRowProperties 928
+#define ESCHER_Prop_fEditedWrap 953 /* sal_Bool Has the wrap polygon been edited? */
+#define ESCHER_Prop_fBehindDocument 954 /* sal_Bool Word-only (shape is behind text) */
+#define ESCHER_Prop_fOnDblClickNotify 955 /* sal_Bool Notify client on a double click */
+#define ESCHER_Prop_fIsButton 956 /* sal_Bool A button shape (i.e., clicking performs an action). Set for shapes with attached hyperlinks or macros. */
+#define ESCHER_Prop_fOneD 957 /* sal_Bool 1D adjustment */
+#define ESCHER_Prop_fHidden 958 /* sal_Bool Do not display */
+#define ESCHER_Prop_fPrint 959 /* sal_Bool Print this shape */
+
+#define ESCHER_PERSISTENTRY_PREALLOCATE 64
+
+#define ESCHER_Persist_PrivateEntry 0x80000000
+#define ESCHER_Persist_Dgg 0x00010000
+#define ESCHER_Persist_Dg 0x00020000
+#define ESCHER_Persist_CurrentPosition 0x00040000
+#define ESCHER_Persist_Grouping_Snap 0x00050000
+#define ESCHER_Persist_Grouping_Logic 0x00060000
+
+const sal_uInt32 DFF_DGG_CLUSTER_SIZE = 0x00000400; /// Shape IDs per cluster in DGG atom.
+
+// ---------------------------------------------------------------------------------------------
+
+namespace com { namespace sun { namespace star {
+ namespace awt {
+ struct Gradient;
+ }
+ namespace drawing {
+ struct EnhancedCustomShapeAdjustmentValue;
+ class XShape;
+ class XShapes;
+ }
+}}}
+
+struct MSFILTER_DLLPUBLIC EscherConnectorListEntry
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXConnector;
+ ::com::sun::star::awt::Point maPointA;
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXConnectToA;
+ ::com::sun::star::awt::Point maPointB;
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXConnectToB;
+
+ sal_uInt32 GetConnectorRule( sal_Bool bFirst );
+
+ EscherConnectorListEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rC,
+ const ::com::sun::star::awt::Point& rPA,
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rSA ,
+ const ::com::sun::star::awt::Point& rPB,
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rSB ) :
+ mXConnector ( rC ),
+ maPointA ( rPA ),
+ mXConnectToA( rSA ),
+ maPointB ( rPB ),
+ mXConnectToB( rSB ) {}
+
+ sal_uInt32 GetClosestPoint( const Polygon& rPoly, const ::com::sun::star::awt::Point& rP );
+};
+
+struct MSFILTER_DLLPUBLIC EscherExContainer
+{
+ sal_uInt32 nContPos;
+ SvStream& rStrm;
+
+ EscherExContainer( SvStream& rSt, const sal_uInt16 nRecType, const sal_uInt16 nInstance = 0 );
+ ~EscherExContainer();
+};
+struct MSFILTER_DLLPUBLIC EscherExAtom
+{
+ sal_uInt32 nContPos;
+ SvStream& rStrm;
+
+ EscherExAtom( SvStream& rSt, const sal_uInt16 nRecType, const sal_uInt16 nInstance = 0, const sal_uInt8 nVersion = 0 );
+ ~EscherExAtom();
+};
+
+struct EscherPropertyValueHelper
+{
+ static sal_Bool GetPropertyValue(
+ ::com::sun::star::uno::Any& rAny,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
+ const String& rPropertyName,
+ sal_Bool bTestPropertyAvailability = sal_False );
+
+ static ::com::sun::star::beans::PropertyState GetPropertyState(
+ const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > &,
+ const String& rPropertyName );
+};
+
+// ---------------------------------------------------------------------------------------------
+
+struct EscherPersistEntry
+{
+ sal_uInt32 mnID;
+ sal_uInt32 mnOffset;
+ EscherPersistEntry( sal_uInt32 nId, sal_uInt32 nOffset ) { mnID = nId; mnOffset = nOffset; };
+
+};
+
+// ---------------------------------------------------------------------------------------------
+
+class EscherBlibEntry
+{
+
+ friend class EscherGraphicProvider;
+ friend class EscherEx;
+
+ protected:
+
+ sal_uInt32 mnIdentifier[ 4 ];
+ sal_uInt32 mnPictureOffset; // offset auf die grafik im PictureStreams
+ sal_uInt32 mnSize; // size of real graphic
+
+ sal_uInt32 mnRefCount; // !! reference count
+ sal_uInt32 mnSizeExtra; // !! size of preceding header
+
+ ESCHER_BlibType meBlibType;
+
+ Size maPrefSize;
+ MapMode maPrefMapMode;
+
+ sal_Bool mbIsEmpty;
+ sal_Bool mbIsNativeGraphicPossible;
+
+ public:
+
+ EscherBlibEntry( sal_uInt32 nPictureOffset, const GraphicObject& rObj,
+ const ByteString& rId, const GraphicAttr* pAttr = NULL );
+
+ ~EscherBlibEntry();
+
+ void WriteBlibEntry( SvStream& rSt, sal_Bool bWritePictureOffset, sal_uInt32 nResize = 0 );
+ sal_Bool IsEmpty() const { return mbIsEmpty; };
+
+ sal_Bool operator==( const EscherBlibEntry& ) const;
+};
+
+// ---------------------------------------------------------------------------------------------
+
+#define _E_GRAPH_PROV_USE_INSTANCES 1
+#define _E_GRAPH_PROV_DO_NOT_ROTATE_METAFILES 2
+
+class MSFILTER_DLLPUBLIC EscherGraphicProvider
+{
+ sal_uInt32 mnFlags;
+
+ EscherBlibEntry** mpBlibEntrys;
+ sal_uInt32 mnBlibBufSize;
+ sal_uInt32 mnBlibEntrys;
+
+ protected :
+
+ sal_uInt32 ImplInsertBlib( EscherBlibEntry* p_EscherBlibEntry );
+
+ public :
+
+ sal_uInt32 GetBlibStoreContainerSize( SvStream* pMergePicStreamBSE = NULL ) const;
+ void WriteBlibStoreContainer( SvStream& rStrm, SvStream* pMergePicStreamBSE = NULL );
+ sal_Bool WriteBlibStoreEntry(SvStream& rStrm, sal_uInt32 nBlipId,
+ sal_Bool bWritePictureOffset, sal_uInt32 nResize = 0);
+ sal_uInt32 GetBlibID( SvStream& rPicOutStream, const ByteString& rGraphicId, const Rectangle& rBoundRect,
+ const com::sun::star::awt::Rectangle* pVisArea = NULL, const GraphicAttr* pGrafikAttr = NULL );
+ sal_Bool HasGraphics() const { return mnBlibEntrys != 0; };
+
+ void SetNewBlipStreamOffset( sal_Int32 nOffset );
+
+ sal_Bool GetPrefSize( const sal_uInt32 nBlibId, Size& rSize, MapMode& rMapMode );
+
+ EscherGraphicProvider( sal_uInt32 nFlags = _E_GRAPH_PROV_DO_NOT_ROTATE_METAFILES );
+ ~EscherGraphicProvider();
+
+};
+
+class MSFILTER_DLLPUBLIC EscherSolverContainer
+{
+ List maShapeList;
+ List maConnectorList;
+
+public:
+
+ sal_uInt32 GetShapeId( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rShape ) const;
+
+ void AddShape( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > &, sal_uInt32 nId );
+ void AddConnector( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > &,
+ const ::com::sun::star::awt::Point& rA,
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > &,
+ const ::com::sun::star::awt::Point& rB,
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rConB );
+
+ void WriteSolver( SvStream& );
+
+ EscherSolverContainer(){};
+ ~EscherSolverContainer();
+};
+
+// ---------------------------------------------------------------------------------------------
+
+#define ESCHER_CREATEPOLYGON_LINE 1
+#define ESCHER_CREATEPOLYGON_POLYLINE 2
+#define ESCHER_CREATEPOLYGON_POLYPOLYGON 4
+
+class GraphicAttr;
+class SdrObjCustomShape;
+
+struct EscherPropSortStruct
+{
+ sal_uInt8* pBuf;
+ sal_uInt32 nPropSize;
+ sal_uInt32 nPropValue;
+ sal_uInt16 nPropId;
+};
+
+typedef std::vector< EscherPropSortStruct > EscherProperties;
+
+class MSFILTER_DLLPUBLIC EscherPropertyContainer
+{
+ EscherGraphicProvider* pGraphicProvider;
+ SvStream* pPicOutStrm;
+ Rectangle* pShapeBoundRect;
+
+ EscherPropSortStruct* pSortStruct;
+
+ sal_uInt32 nSortCount;
+ sal_uInt32 nSortBufSize;
+ sal_uInt32 nCountCount;
+ sal_uInt32 nCountSize;
+
+ sal_Bool bHasComplexData;
+ sal_Bool bSuppressRotation;
+
+
+ sal_uInt32 ImplGetColor( const sal_uInt32 rColor, sal_Bool bSwap = sal_True );
+ void ImplCreateGraphicAttributes( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
+ sal_uInt32 nBlibId, sal_Bool bCreateCroppingAttributes );
+ sal_Bool ImplCreateEmbeddedBmp( const ByteString& rUniqueId );
+ void ImplInit();
+
+ public :
+
+ EscherPropertyContainer();
+ EscherPropertyContainer(
+ EscherGraphicProvider& rGraphicProvider, // the PropertyContainer needs to know
+ SvStream* pPicOutStrm, // the GraphicProvider to be able to write
+ Rectangle& rShapeBoundRect ); // FillBitmaps or GraphicObjects.
+ // under some cirumstances the ShapeBoundRect is adjusted
+ // this will happen when rotated GraphicObjects
+ // are saved to PowerPoint
+ ~EscherPropertyContainer();
+
+ void AddOpt( sal_uInt16 nPropertyID, const rtl::OUString& rString );
+
+ void AddOpt( sal_uInt16 nPropertyID, sal_uInt32 nPropValue,
+ sal_Bool bBlib = sal_False );
+
+ void AddOpt( sal_uInt16 nPropertyID, sal_Bool bBlib, sal_uInt32 nPropValue,
+ sal_uInt8* pProp, sal_uInt32 nPropSize );
+
+ sal_Bool GetOpt( sal_uInt16 nPropertyID, sal_uInt32& rPropValue ) const;
+
+ sal_Bool GetOpt( sal_uInt16 nPropertyID, EscherPropSortStruct& rPropValue ) const;
+
+ EscherProperties GetOpts() const;
+
+ void Commit( SvStream& rSt, sal_uInt16 nVersion = 3, sal_uInt16 nRecType = ESCHER_OPT );
+
+ sal_Bool CreateShapeProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape );
+ sal_Bool CreateOLEGraphicProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXOleObject );
+
+ /** Creates a complex ESCHER_Prop_fillBlip containing the BLIP directly (for Excel charts). */
+ sal_Bool CreateEmbeddedBitmapProperties( const ::rtl::OUString& rBitmapUrl,
+ ::com::sun::star::drawing::BitmapMode eBitmapMode );
+ /** Creates a complex ESCHER_Prop_fillBlip containing a hatch style (for Excel charts). */
+ sal_Bool CreateEmbeddedHatchProperties( const ::com::sun::star::drawing::Hatch& rHatch,
+ const Color& rBackColor, bool bFillBackground );
+
+ // the GraphicProperties will only be created if a GraphicProvider and PicOutStrm is known
+ // DR: #99897# if no GraphicProvider is present, a complex ESCHER_Prop_fillBlip
+ // will be created, containing the BLIP directly (e.g. for Excel charts).
+ sal_Bool CreateGraphicProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
+ const String& rSource, const sal_Bool bCreateFillBitmap, const sal_Bool bCreateCroppingAttributes = sal_False,
+ const sal_Bool bFillBitmapModeAllowed = sal_True );
+
+ sal_Bool CreatePolygonProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
+ sal_uInt32 nFlags, sal_Bool bBezier, ::com::sun::star::awt::Rectangle& rGeoRect, Polygon* pPolygon = NULL );
+
+ static sal_uInt32 GetGradientColor( const ::com::sun::star::awt::Gradient* pGradient, sal_uInt32 nStartColor );
+
+ void CreateGradientProperties( const ::com::sun::star::awt::Gradient & rGradient );
+ void CreateGradientProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & );
+ void CreateLineProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &, sal_Bool bEdge );
+ void CreateFillProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &, sal_Bool bEdge );
+ void CreateTextProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &, sal_uInt32 nText,
+ const sal_Bool bIsCustomShape = sal_False, const sal_Bool bIsTextFrame = sal_True );
+
+ sal_Bool CreateConnectorProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape,
+ EscherSolverContainer& rSolver, ::com::sun::star::awt::Rectangle& rGeoRect,
+ sal_uInt16& rShapeType, sal_uInt16& rShapeFlags );
+
+ // Because shadow properties depends to the line and fillstyle, the CreateShadowProperties method should be called at last.
+ // It activ only when at least a FillStyle or LineStyle is set.
+ sal_Bool CreateShadowProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & );
+
+ // creates all necessary CustomShape properties, this includes also Text-, Shadow-, Fill-, and LineProperties
+ void CreateCustomShapeProperties( const MSO_SPT eShapeType, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & );
+ sal_Bool IsFontWork() const;
+
+ // helper functions which are also used by the escher import
+ static PolyPolygon GetPolyPolygon( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape );
+ static PolyPolygon GetPolyPolygon( const ::com::sun::star::uno::Any& rSource );
+ static MSO_SPT GetCustomShapeType( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape, sal_uInt32& nMirrorFlags );
+ static MSO_SPT GetCustomShapeType( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape, sal_uInt32& nMirrorFlags, rtl::OUString& rShapeType );
+
+ // helper functions which are also used in ooxml export
+ static sal_Bool GetLineArrow( const sal_Bool bLineStart,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
+ ESCHER_LineEnd& reLineEnd, sal_Int32& rnArrowLength, sal_Int32& rnArrowWidth );
+ static sal_Bool IsDefaultObject( SdrObjCustomShape* pCustoShape );
+ static void LookForPolarHandles( const MSO_SPT eShapeType, sal_Int32& nAdjustmentsWhichNeedsToBeConverted );
+ static sal_Bool GetAdjustmentValue( const com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue & rkProp, sal_Int32 nIndex, sal_Int32 nAdjustmentsWhichNeedsToBeConverted, sal_Int32& nValue );
+};
+
+// ---------------------------------------------------------------------------------------------
+
+class MSFILTER_DLLPUBLIC EscherPersistTable
+{
+
+ public:
+ List maPersistTable;
+
+ sal_Bool PtIsID( sal_uInt32 nID );
+ void PtInsert( sal_uInt32 nID, sal_uInt32 nOfs );
+ sal_uInt32 PtDelete( sal_uInt32 nID );
+ sal_uInt32 PtGetOffsetByID( sal_uInt32 nID );
+ sal_uInt32 PtReplace( sal_uInt32 nID, sal_uInt32 nOfs );
+ sal_uInt32 PtReplaceOrInsert( sal_uInt32 nID, sal_uInt32 nOfs );
+ sal_uInt32 PtGetCount() const { return maPersistTable.Count(); };
+
+ EscherPersistTable();
+ virtual ~EscherPersistTable();
+};
+
+// ---------------------------------------------------------------------------------------------
+
+class EscherEx;
+
+/// abstract base class for ESCHER_ClientTextbox, ESCHER_ClientData
+class MSFILTER_DLLPUBLIC EscherExClientRecord_Base
+{
+public:
+ EscherExClientRecord_Base() {}
+ virtual ~EscherExClientRecord_Base();
+
+ /// Application writes the record header
+ /// using rEx.AddAtom(...) followed by
+ /// record data written to rEx.GetStream()
+ virtual void WriteData( EscherEx& rEx ) const = 0;
+};
+
+
+/// abstract base class for ESCHER_ClientAnchor
+class MSFILTER_DLLPUBLIC EscherExClientAnchor_Base
+{
+public:
+ EscherExClientAnchor_Base() {}
+ virtual ~EscherExClientAnchor_Base();
+
+ /// Application writes the record header
+ /// using rEx.AddAtom(...) followed by
+ /// record data written to rEx.GetStream()
+ virtual void WriteData( EscherEx& rEx,
+ const Rectangle& rRect ) = 0;
+};
+
+class InteractionInfo
+{
+ bool mbHasInteraction;
+ std::auto_ptr<SvMemoryStream> mpHyperlinkRecord;
+ InteractionInfo();
+public:
+ InteractionInfo( SvMemoryStream* pStream, bool bInteraction ) : mbHasInteraction( bInteraction )
+ {
+ mpHyperlinkRecord.reset( pStream );
+ }
+ bool hasInteraction() { return mbHasInteraction; }
+ const std::auto_ptr< SvMemoryStream >& getHyperlinkRecord() { return mpHyperlinkRecord; }
+};
+
+class EscherExHostAppData
+{
+private:
+ EscherExClientAnchor_Base* pClientAnchor;
+ EscherExClientRecord_Base* pClientData;
+ EscherExClientRecord_Base* pClientTextbox;
+ InteractionInfo* pInteractionInfo;
+ // ignore single shape if entire pages are written
+ sal_Bool bDontWriteShape;
+
+public:
+ EscherExHostAppData() : pClientAnchor(0), pClientData(0),
+ pClientTextbox(0), pInteractionInfo(0), bDontWriteShape(sal_False)
+ {}
+
+ void SetInteractionInfo( InteractionInfo* p )
+ { pInteractionInfo = p; }
+ void SetClientAnchor( EscherExClientAnchor_Base* p )
+ { pClientAnchor = p; }
+ void SetClientData( EscherExClientRecord_Base* p )
+ { pClientData = p; }
+ void SetClientTextbox( EscherExClientRecord_Base* p )
+ { pClientTextbox = p; }
+ void SetDontWriteShape( sal_Bool b )
+ { bDontWriteShape = b; }
+ InteractionInfo* GetInteractionInfo() const
+ { return pInteractionInfo; }
+ EscherExClientAnchor_Base* GetClientAnchor() const
+ { return pClientAnchor; }
+ EscherExClientRecord_Base* GetClientData() const
+ { return pClientData; }
+ EscherExClientRecord_Base* GetClientTextbox() const
+ { return pClientTextbox; }
+
+ void WriteClientAnchor( EscherEx& rEx, const Rectangle& rRect )
+ { if( pClientAnchor ) pClientAnchor->WriteData( rEx, rRect ); }
+ void WriteClientData( EscherEx& rEx )
+ { if( pClientData ) pClientData->WriteData( rEx ); }
+ void WriteClientTextbox( EscherEx& rEx )
+ { if( pClientTextbox ) pClientTextbox->WriteData( rEx ); }
+
+ sal_Bool DontWriteShape() const { return bDontWriteShape; }
+};
+
+
+// ============================================================================
+
+/** Instance for global DFF data, shared through various instances of EscherEx. */
+class MSFILTER_DLLPUBLIC EscherExGlobal : public EscherGraphicProvider
+{
+public:
+ explicit EscherExGlobal( sal_uInt32 nGraphicProvFlags = _E_GRAPH_PROV_DO_NOT_ROTATE_METAFILES );
+ virtual ~EscherExGlobal();
+
+ /** Returns a new drawing ID for a new drawing container (DGCONTAINER). */
+ sal_uInt32 GenerateDrawingId();
+ /** Creates and returns a new shape identifier, updates the internal shape
+ counters and registers the identifier in the DGG cluster table.
+ @param nDrawingId Drawing identifier has to be passed to be able to
+ generate shape identifiers for multiple drawings simultaniously. */
+ sal_uInt32 GenerateShapeId( sal_uInt32 nDrawingId, bool bIsInSpgr );
+ /** Returns the number of shapes in the current drawing, based on number of
+ calls to the GenerateShapeId() function. */
+ sal_uInt32 GetDrawingShapeCount( sal_uInt32 nDrawingId ) const;
+ /** Returns the last shape identifier generated by the GenerateShapeId()
+ function. */
+ sal_uInt32 GetLastShapeId( sal_uInt32 nDrawingId ) const;
+
+ /** Sets the flag indicating that the DGGCONTAINER exists. */
+ inline void SetDggContainer() { mbHasDggCont = true; }
+ /** Sets the flag indicating that the DGGCONTAINER exists. */
+ inline bool HasDggContainer() const { return mbHasDggCont; }
+ /** Returns the total size of the DGG atom (including header). */
+ sal_uInt32 GetDggAtomSize() const;
+ /** Writes the complete DGG atom to the passed stream (overwrites existing data!). */
+ void WriteDggAtom( SvStream& rStrm ) const;
+
+ /** Called if a picture shall be written and no picture stream is set at
+ class ImplEscherExSdr.
+
+ On first invokation, this function calls the virtual member function
+ ImplQueryPictureStream(). The return value will be cached internally
+ for subsequent calls and for the GetPictureStream() function.
+ */
+ SvStream* QueryPictureStream();
+
+ /** Returns the picture stream if existing (queried), otherwise null. */
+ inline SvStream* GetPictureStream() { return mpPicStrm; }
+
+private:
+ /** Derived classes may implement to create a new stream used to store the
+ picture data.
+
+ The implementation has to take care about lifetime of the returned
+ stream (it will not be destructed automatically). This function is
+ called exactly once. The return value will be cached internally for
+ repeated calls of the public QueryPictureStream() function.
+ */
+ virtual SvStream* ImplQueryPictureStream();
+
+private:
+ struct ClusterEntry
+ {
+ sal_uInt32 mnDrawingId; /// Identifier of drawing this cluster belongs to (one-based index into maDrawingInfos).
+ sal_uInt32 mnNextShapeId; /// Next free shape identifier in this cluster.
+ inline explicit ClusterEntry( sal_uInt32 nDrawingId ) : mnDrawingId( nDrawingId ), mnNextShapeId( 0 ) {}
+ };
+ typedef ::std::vector< ClusterEntry > ClusterTable;
+
+ struct DrawingInfo
+ {
+ sal_uInt32 mnClusterId; /// Currently used cluster (one-based index into maClusterTable).
+ sal_uInt32 mnShapeCount; /// Current number of shapes in this drawing.
+ sal_uInt32 mnLastShapeId; /// Last shape identifier generated for this drawing.
+ inline explicit DrawingInfo( sal_uInt32 nClusterId ) : mnClusterId( nClusterId ), mnShapeCount( 0 ), mnLastShapeId( 0 ) {}
+ };
+ typedef ::std::vector< DrawingInfo > DrawingInfoVector;
+
+ ClusterTable maClusterTable; /// List with cluster IDs (used object IDs in drawings).
+ DrawingInfoVector maDrawingInfos; /// Data about all used drawings.
+ SvStream* mpPicStrm; /// Cached result of ImplQueryPictureStream().
+ bool mbHasDggCont; /// True = the DGGCONTAINER has been initialized.
+ bool mbPicStrmQueried; /// True = ImplQueryPictureStream() has been called.
+};
+
+typedef ::boost::shared_ptr< EscherExGlobal > EscherExGlobalRef;
+
+// ---------------------------------------------------------------------------------------------
+
+class SdrObject;
+class SdrPage;
+class ImplEscherExSdr;
+
+class MSFILTER_DLLPUBLIC EscherEx : public EscherPersistTable
+{
+ protected:
+ typedef ::std::auto_ptr< ImplEscherExSdr > ImplEscherExSdrPtr;
+
+ EscherExGlobalRef mxGlobal;
+ ImplEscherExSdrPtr mpImplEscherExSdr;
+ SvStream* mpOutStrm;
+ sal_uInt32 mnStrmStartOfs;
+ std::vector< sal_uInt32 > mOffsets;
+ std::vector< sal_uInt16 > mRecTypes;
+
+ sal_uInt32 mnCurrentDg;
+ sal_uInt32 mnCountOfs;
+
+ sal_uInt32 mnGroupLevel;
+ sal_uInt16 mnHellLayerId;
+
+ sal_Bool mbEscherSpgr;
+ sal_Bool mbEscherDg;
+ sal_Bool mbOleEmf; // OLE is EMF instead of WMF
+
+
+ virtual sal_Bool DoSeek( sal_uInt32 nKey );
+
+public:
+ explicit EscherEx( const EscherExGlobalRef& rxGlobal, SvStream& rOutStrm );
+ virtual ~EscherEx();
+
+ /** Creates and returns a new shape identifier, updates the internal shape
+ counters and registers the identifier in the DGG cluster table. */
+ inline sal_uInt32 GenerateShapeId() { return mxGlobal->GenerateShapeId( mnCurrentDg, mbEscherSpgr ); }
+
+ /** Returns the graphic provider from the global object that has been
+ passed to the constructor.
+ */
+ inline EscherGraphicProvider&
+ GetGraphicProvider() { return *mxGlobal; }
+
+ /** Called if a picture shall be written and no picture stream is set at
+ class ImplEscherExSdr.
+ */
+ inline SvStream* QueryPictureStream() { return mxGlobal->QueryPictureStream(); }
+
+ /// Fuegt in den EscherStream interne Daten ein, dieser Vorgang
+ /// darf und muss nur einmal ausgefuehrt werden.
+ /// Wenn pPicStreamMergeBSE angegeben ist, werden die BLIPs
+ /// aus diesem Stream in die MsofbtBSE Records des EscherStream
+ /// gemerged, wie es fuer Excel (und Word?) benoetigt wird.
+ virtual void Flush( SvStream* pPicStreamMergeBSE = NULL );
+
+ /** Inserts the passed number of bytes at the current position of the
+ output stream.
+
+ Inserts dummy bytes and moves all following stream data, and updates
+ all internal stream offsets stored in the PersistTable and the affected
+ container sizes, which makes this operation very expensive. (!)
+
+ @param nBytes The number of bytes to be inserted into the stream.
+
+ @param bExpandEndOfAtom If set to true, an atom that currently ends
+ exactly at the current stream position will be expanded to include
+ the inserted data. If set to false, an atom that currently ends
+ exactly at the current stream position will not be expanded to
+ include the inserted data (used to insert e.g. a new atom after an
+ existing atom). Note that containers that end exactly at the
+ current stream position are always expanded to include the inserted
+ data.
+ */
+ void InsertAtCurrentPos( sal_uInt32 nBytes, bool bExpandEndOfAtom );
+
+ void InsertPersistOffset( sal_uInt32 nKey, sal_uInt32 nOffset ); // Es wird nicht geprueft, ob sich jener schluessel schon in der PersistantTable befindet
+ void ReplacePersistOffset( sal_uInt32 nKey, sal_uInt32 nOffset );
+ sal_uInt32 GetPersistOffset( sal_uInt32 nKey );
+ sal_Bool SeekToPersistOffset( sal_uInt32 nKey );
+ virtual sal_Bool InsertAtPersistOffset( sal_uInt32 nKey, sal_uInt32 nValue );// nValue wird im Stream an entrsprechender Stelle eingefuegt(overwrite modus), ohne dass sich die
+ // aktuelle StreamPosition aendert
+
+ SvStream& GetStream() const { return *mpOutStrm; }
+ sal_uLong GetStreamPos() const { return mpOutStrm->Tell(); }
+
+ virtual sal_Bool SeekBehindRecHeader( sal_uInt16 nRecType ); // der stream muss vor einem gueltigen Record Header oder Atom stehen
+
+ // features beim erzeugen folgender Container:
+ //
+ // ESCHER_DggContainer: ein EscherDgg Atom wird automatisch erzeugt und verwaltet
+ // ESCHER_DgContainer: ein EscherDg Atom wird automatisch erzeugt und verwaltet
+ // ESCHER_SpgrContainer:
+ // ESCHER_SpContainer:
+
+ virtual void OpenContainer( sal_uInt16 nEscherContainer, int nRecInstance = 0 );
+ virtual void CloseContainer();
+
+ virtual void BeginAtom();
+ virtual void EndAtom( sal_uInt16 nRecType, int nRecVersion = 0, int nRecInstance = 0 );
+ virtual void AddAtom( sal_uInt32 nAtomSitze, sal_uInt16 nRecType, int nRecVersion = 0, int nRecInstance = 0 );
+ virtual void AddChildAnchor( const Rectangle& rRectangle );
+ virtual void AddClientAnchor( const Rectangle& rRectangle );
+
+ virtual sal_uInt32 EnterGroup( const String& rShapeName, const Rectangle* pBoundRect = 0 );
+ sal_uInt32 EnterGroup( const Rectangle* pBoundRect = NULL );
+ sal_uInt32 GetGroupLevel() const { return mnGroupLevel; };
+ virtual sal_Bool SetGroupSnapRect( sal_uInt32 nGroupLevel, const Rectangle& rRect );
+ virtual sal_Bool SetGroupLogicRect( sal_uInt32 nGroupLevel, const Rectangle& rRect );
+ virtual void LeaveGroup();
+
+ // ein ESCHER_Sp wird geschrieben ( Ein ESCHER_DgContainer muss dazu geoeffnet sein !!)
+ virtual void AddShape( sal_uInt32 nShpInstance, sal_uInt32 nFlagIds, sal_uInt32 nShapeID = 0 );
+
+ virtual void Commit( EscherPropertyContainer& rProps, const Rectangle& rRect );
+
+ sal_uInt32 GetColor( const sal_uInt32 nColor, sal_Bool bSwap = sal_True );
+ sal_uInt32 GetColor( const Color& rColor, sal_Bool bSwap = sal_True );
+
+ // ...Sdr... implemented in eschesdo.cxx
+
+ void AddSdrPage( const SdrPage& rPage );
+ void AddUnoShapes( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes );
+
+ /// returns the ShapeID
+ sal_uInt32 AddSdrObject( const SdrObject& rObj );
+
+ /// If objects are written through AddSdrObject the
+ /// SolverContainer has to be written, and maybe some
+ /// maintenance to be done.
+ void EndSdrObjectPage();
+
+ /// Called before a shape is written, application supplies
+ /// ClientRecords. May set AppData::bDontWriteShape so the
+ /// shape is ignored.
+ virtual EscherExHostAppData* StartShape(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rShape,
+ const Rectangle* pChildAnchor );
+
+ /// Called after a shape is written to inform the application
+ /// of the resulted shape type and ID.
+ virtual void EndShape( sal_uInt16 nShapeType, sal_uInt32 nShapeID );
+
+ /// Called before an AdditionalText EnterGroup occurs.
+ /// The current shape will be written in three parts:
+ /// a group shape, the shape itself, and an extra textbox shape.
+ /// The complete flow is:
+ /// StartShape sets HostData1.
+ /// EnterAdditionalTextGroup sets HostData2, App may modify
+ /// HostData1 and keep track of the change.
+ /// The group shape is written with HostData2.
+ /// Another StartShape with the same (!) object sets HostData3.
+ /// The current shape is written with HostData3.
+ /// EndShape is called for the current shape.
+ /// Another StartShape with the same (!) object sets HostData4.
+ /// The textbox shape is written with HostData4.
+ /// EndShape is called for the textbox shape.
+ /// EndShape is called for the group shape, this provides
+ /// the same functionality as an ordinary recursive group.
+ virtual EscherExHostAppData* EnterAdditionalTextGroup();
+
+ /// Called if an ESCHER_Prop_lTxid shall be written
+ virtual sal_uInt32 QueryTextID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >&, sal_uInt32 nShapeId );
+ // add an dummy rectangle shape into the escher stream
+ sal_uInt32 AddDummyShape();
+
+ static const SdrObject* GetSdrObject( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rXShape );
+
+ void SetHellLayerId( sal_uInt16 nId ) { mnHellLayerId = nId; }
+ sal_uInt16 GetHellLayerId() const { return mnHellLayerId; }
+
+private:
+ EscherEx( const EscherEx& );
+ EscherEx& operator=( const EscherEx& );
+
+ // prevent C-style cast to former base class EscherGraphicProvider
+ operator EscherGraphicProvider&();
+ operator EscherGraphicProvider const&();
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/inc/filter/msfilter/mscodec.hxx b/filter/inc/filter/msfilter/mscodec.hxx
new file mode 100644
index 000000000000..63afd9456078
--- /dev/null
+++ b/filter/inc/filter/msfilter/mscodec.hxx
@@ -0,0 +1,379 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SVX_MSCODEC_HXX
+#define SVX_MSCODEC_HXX
+
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/beans/NamedValue.hpp>
+
+#include <rtl/cipher.h>
+#include <rtl/digest.h>
+#include "filter/msfilter/msfilterdllapi.h"
+
+namespace msfilter {
+
+// ============================================================================
+
+/** Encodes and decodes data from protected MSO 95- documents.
+ */
+class MSFILTER_DLLPUBLIC MSCodec_Xor95
+{
+public:
+ explicit MSCodec_Xor95(int nRotateDistance);
+ virtual ~MSCodec_Xor95();
+
+ /** Initializes the algorithm with the specified password.
+
+ @param pPassData
+ Character array containing the password. Must be zero terminated,
+ which results in a maximum length of 15 characters.
+ */
+ void InitKey( const sal_uInt8 pnPassData[ 16 ] );
+
+ /** Initializes the algorithm with the encryption data.
+
+ @param aData
+ The sequence contains the necessary data to initialize
+ the codec.
+ */
+ sal_Bool InitCodec( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aData );
+
+ /** Retrieves the encryption data
+
+ @return
+ The sequence contains the necessary data to initialize
+ the codec.
+ */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > GetEncryptionData();
+
+
+ /** Verifies the validity of the password using the passed key and hash.
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used.
+
+ @param nKey
+ Password key value read from the file.
+ @param nHash
+ Password hash value read from the file.
+
+ @return
+ true = Test was successful.
+ */
+ bool VerifyKey( sal_uInt16 nKey, sal_uInt16 nHash ) const;
+
+ /** Reinitializes the codec to start a new memory block.
+
+ Resets the internal key offset to 0.
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used.
+ */
+ void InitCipher();
+
+ /** Decodes a block of memory inplace.
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used.
+
+ @param pnData
+ Encrypted data block. Will contain the decrypted data afterwards.
+ @param nBytes
+ Size of the passed data block.
+ */
+ virtual void Decode( sal_uInt8* pnData, sal_Size nBytes )=0;
+
+ /** Lets the cipher skip a specific amount of bytes.
+
+ This function sets the cipher to the same state as if the specified
+ amount of data has been decoded with one or more calls of Decode().
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used.
+
+ @param nBytes
+ Number of bytes to be skipped (cipher "seeks" forward).
+ */
+ void Skip( sal_Size nBytes );
+
+protected:
+ sal_uInt8 mpnKey[ 16 ]; /// Encryption key.
+ sal_Size mnOffset; /// Key offset.
+
+private:
+ MSFILTER_DLLPRIVATE MSCodec_Xor95( const MSCodec_Xor95& );
+ MSFILTER_DLLPRIVATE MSCodec_Xor95& operator=( const MSCodec_Xor95& );
+
+ sal_uInt16 mnKey; /// Base key from password.
+ sal_uInt16 mnHash; /// Hash value from password.
+ int mnRotateDistance;
+};
+
+/** Encodes and decodes data from protected MSO XLS 95- documents.
+ */
+class MSFILTER_DLLPUBLIC MSCodec_XorXLS95 : public MSCodec_Xor95
+{
+public:
+ explicit MSCodec_XorXLS95() : MSCodec_Xor95(2) {}
+
+ /** Decodes a block of memory inplace.
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used.
+
+ @param pnData
+ Encrypted data block. Will contain the decrypted data afterwards.
+ @param nBytes
+ Size of the passed data block.
+ */
+ virtual void Decode( sal_uInt8* pnData, sal_Size nBytes );
+};
+
+/** Encodes and decodes data from protected MSO Word 95- documents.
+ */
+class MSFILTER_DLLPUBLIC MSCodec_XorWord95 : public MSCodec_Xor95
+{
+public:
+ explicit MSCodec_XorWord95() : MSCodec_Xor95(7) {}
+
+ /** Decodes a block of memory inplace.
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used.
+
+ @param pnData
+ Encrypted data block. Will contain the decrypted data afterwards.
+ @param nBytes
+ Size of the passed data block.
+ */
+ virtual void Decode( sal_uInt8* pnData, sal_Size nBytes );
+};
+
+
+// ============================================================================
+
+/** Encodes and decodes data from protected MSO 97+ documents.
+
+ This is a wrapper class around low level cryptographic functions from RTL.
+ Implementation is based on the wvDecrypt package by Caolan McNamara:
+ http://www.csn.ul.ie/~caolan/docs/wvDecrypt.html
+ */
+class MSFILTER_DLLPUBLIC MSCodec_Std97
+{
+public:
+ explicit MSCodec_Std97();
+ ~MSCodec_Std97();
+
+ /** Initializes the algorithm with the encryption data.
+
+ @param aData
+ The sequence contains the necessary data to initialize
+ the codec.
+ */
+ sal_Bool InitCodec( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aData );
+
+ /** Retrieves the encryption data
+
+ @return
+ The sequence contains the necessary data to initialize
+ the codec.
+ */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > GetEncryptionData();
+
+
+ /** Initializes the algorithm with the specified password and document ID.
+
+ @param pPassData
+ Wide character array containing the password. Must be zero
+ terminated, which results in a maximum length of 15 characters.
+ @param pDocId
+ Unique document identifier read from or written to the file.
+ */
+ void InitKey(
+ const sal_uInt16 pPassData[ 16 ],
+ const sal_uInt8 pDocId[ 16 ] );
+
+ /** Verifies the validity of the password using the passed salt data.
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used.
+
+ @param pSaltData
+ Salt data block read from the file.
+ @param pSaltDigest
+ Salt digest read from the file.
+
+ @return
+ true = Test was successful.
+ */
+ bool VerifyKey(
+ const sal_uInt8 pSaltData[ 16 ],
+ const sal_uInt8 pSaltDigest[ 16 ] );
+
+ /** Rekeys the codec using the specified counter.
+
+ After reading a specific amount of data the cipher algorithm needs to
+ be rekeyed using a counter that counts the data blocks.
+
+ The block size is for example 512 Bytes for Word files and 1024 Bytes
+ for Excel files.
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used.
+
+ @param nCounter
+ Block counter used to rekey the cipher.
+ */
+ bool InitCipher( sal_uInt32 nCounter );
+
+ /** Creates an MD5 digest of salt digest. */
+ bool CreateSaltDigest(
+ const sal_uInt8 nSaltData[16], sal_uInt8 nSaltDigest[16] );
+
+ /** Encodes a block of memory.
+
+ @see rtl_cipher_encode()
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used. The destination buffer must be able to take all
+ unencoded data from the source buffer (usually this means it must be
+ as long as or longer than the source buffer).
+
+ @param pData
+ Unencrypted source data block.
+ @param nDatLen
+ Size of the passed source data block.
+ @param pBuffer
+ Destination buffer for the encrypted data.
+ @param nBufLen
+ Size of the destination buffer.
+
+ @return
+ true = Encoding was successful (no error occurred).
+ */
+ bool Encode(
+ const void* pData, sal_Size nDatLen,
+ sal_uInt8* pBuffer, sal_Size nBufLen );
+
+ /** Decodes a block of memory.
+
+ @see rtl_cipher_decode()
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used. The destination buffer must be able to take all
+ encoded data from the source buffer (usually this means it must be
+ as long as or longer than the source buffer).
+
+ @param pData
+ Encrypted source data block.
+ @param nDatLen
+ Size of the passed source data block.
+ @param pBuffer
+ Destination buffer for the decrypted data.
+ @param nBufLen
+ Size of the destination buffer.
+
+ @return
+ true = Decoding was successful (no error occurred).
+ */
+ bool Decode(
+ const void* pData, sal_Size nDatLen,
+ sal_uInt8* pBuffer, sal_Size nBufLen );
+
+ /** Lets the cipher skip a specific amount of bytes.
+
+ This function sets the cipher to the same state as if the specified
+ amount of data has been decoded with one or more calls of Decode().
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used.
+
+ @param nDatLen
+ Number of bytes to be skipped (cipher "seeks" forward).
+ */
+ bool Skip( sal_Size nDatLen );
+
+ /** Gets salt data and salt digest.
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used.
+
+ @param pSalt
+ Salt, a random number.
+ @param pSaltData
+ Salt data block generated from the salt.
+ @param pSaltDigest
+ Salt digest generated from the salt.
+ */
+ void GetEncryptKey (
+ const sal_uInt8 pSalt[16],
+ sal_uInt8 pSaltData[16],
+ sal_uInt8 pSaltDigest[16]);
+
+ /* allows to get the unique document id from the codec
+ */
+ void GetDocId( sal_uInt8 pDocId[16] );
+
+ void GetDigestFromSalt( const sal_uInt8 pSaltData[16], sal_uInt8 pDigest[16] );
+
+private:
+ void InitKeyImpl(
+ const sal_uInt8 pKeyData[64],
+ const sal_uInt8 pDocId[16] );
+
+
+private:
+ MSFILTER_DLLPRIVATE MSCodec_Std97( const MSCodec_Std97& );
+ MSFILTER_DLLPRIVATE MSCodec_Std97& operator=( const MSCodec_Std97& );
+
+ rtlCipher m_hCipher;
+ rtlDigest m_hDigest;
+ sal_uInt8 m_pDigestValue[ RTL_DIGEST_LENGTH_MD5 ];
+ sal_uInt8 m_pDocId[16];
+};
+
+// ============================================================================
+
+} // namespace msfilter
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/inc/filter/msfilter/msdffimp.hxx b/filter/inc/filter/msfilter/msdffimp.hxx
new file mode 100644
index 000000000000..a3043b04934d
--- /dev/null
+++ b/filter/inc/filter/msfilter/msdffimp.hxx
@@ -0,0 +1,860 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _MSDFFIMP_HXX
+#define _MSDFFIMP_HXX
+
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include <tools/solar.h>
+#include <svl/svarray.hxx>
+#include <tools/color.hxx>
+#include <tools/gen.hxx>
+#include <tools/table.hxx>
+#include <svx/msdffdef.hxx>
+#include <filter/msfilter/msfiltertracer.hxx>
+#include <vcl/graph.hxx>
+#include <string.h>
+#include <map>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <filter/msfilter/msfilterdllapi.h>
+#include <sot/storage.hxx>
+
+class Graphic;
+class SvStream;
+class SdrObject;
+class SdrOle2Obj;
+class SotStorageRef;
+class Polygon;
+class PolyPolygon;
+class FmFormModel;
+class SdrModel;
+class DffRecordHeader;
+
+class SwFlyFrmFmt;
+
+struct SvxMSDffBLIPInfo;
+struct SvxMSDffShapeInfo;
+struct SvxMSDffShapeOrder;
+
+class MSFILTER_DLLPUBLIC DffRecordHeader
+{
+
+public:
+ sal_uInt8 nRecVer; // may be DFF_PSFLAG_CONTAINER
+ sal_uInt16 nRecInstance;
+ sal_uInt16 nImpVerInst;
+ sal_uInt16 nRecType;
+ sal_uInt32 nRecLen;
+ sal_uLong nFilePos;
+public:
+ DffRecordHeader() : nRecVer(0), nRecInstance(0), nImpVerInst(0), nRecType(0), nRecLen(0), nFilePos(0) {}
+ bool IsContainer() const { return nRecVer == DFF_PSFLAG_CONTAINER; }
+ sal_uLong GetRecBegFilePos() const { return nFilePos; }
+ sal_uLong GetRecEndFilePos() const { return nFilePos + DFF_COMMON_RECORD_HEADER_SIZE + nRecLen; }
+ void SeekToEndOfRecord(SvStream& rIn) const { rIn.Seek(nFilePos + DFF_COMMON_RECORD_HEADER_SIZE + nRecLen ); }
+ void SeekToContent( SvStream& rIn) const { rIn.Seek(nFilePos + DFF_COMMON_RECORD_HEADER_SIZE ); }
+ void SeekToBegOfRecord(SvStream& rIn) const { rIn.Seek( nFilePos ); }
+
+ MSFILTER_DLLPUBLIC friend SvStream& operator>>(SvStream& rIn, DffRecordHeader& rRec);
+
+};
+
+struct DffPropFlags
+{
+ sal_uInt8 bSet : 1;
+ sal_uInt8 bComplex : 1;
+ sal_uInt8 bBlip : 1;
+ sal_uInt8 bSoftAttr : 1;
+};
+
+class SvxMSDffManager;
+
+class MSFILTER_DLLPUBLIC DffPropSet : public Table
+{
+ protected :
+
+ sal_uInt32 mpContents[ 1024 ];
+ DffPropFlags mpFlags[ 1024 ];
+
+ public :
+
+ DffPropSet( sal_Bool bInitialize = sal_False ){ if ( bInitialize )
+ memset( mpFlags, 0, 0x400 * sizeof( DffPropFlags ) ); };
+
+ inline sal_Bool IsProperty( sal_uInt32 nRecType ) const { return ( mpFlags[ nRecType & 0x3ff ].bSet ); };
+ sal_Bool IsHardAttribute( sal_uInt32 nId ) const;
+ sal_uInt32 GetPropertyValue( sal_uInt32 nId, sal_uInt32 nDefault = 0 ) const;
+ /** Returns a boolean property by its real identifier. */
+ bool GetPropertyBool( sal_uInt32 nId, bool bDefault = false ) const;
+ /** Returns a string property. */
+ ::rtl::OUString GetPropertyString( sal_uInt32 nId, SvStream& rStrm ) const;
+ void SetPropertyValue( sal_uInt32 nId, sal_uInt32 nValue ) const;
+ sal_Bool SeekToContent( sal_uInt32 nRecType, SvStream& rSt ) const;
+ void Merge( DffPropSet& rMasterPropSet ) const;
+ void InitializePropSet() const;
+ friend SvStream& operator>>( SvStream& rIn, DffPropSet& rPropSet );
+};
+
+class SfxItemSet;
+class SdrObject;
+struct DffObjData;
+
+class MSFILTER_DLLPUBLIC DffPropertyReader : public DffPropSet
+{
+ const SvxMSDffManager& rManager;
+ DffPropSet* pDefaultPropSet;
+
+ void ApplyCustomShapeTextAttributes( SfxItemSet& rSet ) const;
+ void ApplyCustomShapeAdjustmentAttributes( SfxItemSet& rSet ) const;
+ void ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxItemSet& rSet, const DffObjData& rObjData ) const;
+ void ApplyLineAttributes( SfxItemSet& rSet, const MSO_SPT eShapeType ) const; // #i28269#
+ void ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, const DffObjData& rObjData ) const;
+
+public:
+
+ sal_Int32 mnFix16Angle;
+
+ DffPropertyReader( const SvxMSDffManager& rManager );
+ ~DffPropertyReader();
+ sal_Int32 Fix16ToAngle( sal_Int32 nAngle ) const;
+
+#ifdef DBG_CUSTOMSHAPE
+ void ReadPropSet( SvStream& rIn, void* pClientData, sal_uInt32 nShapeType = 0 ) const;
+#else
+ void ReadPropSet( SvStream& rIn, void* pClientData ) const;
+#endif
+
+ void SetDefaultPropSet( SvStream& rIn, sal_uInt32 nOffDgg ) const;
+ void ApplyAttributes( SvStream& rIn, SfxItemSet& rSet ) const;
+ void ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, const DffObjData& rObjData ) const;
+};
+
+
+#define COL_DEFAULT RGB_COLORDATA( 0xFA, 0xFB, 0xFC )
+
+typedef SvxMSDffBLIPInfo* SvxMSDffBLIPInfo_Ptr;
+
+typedef SvxMSDffShapeInfo* SvxMSDffShapeInfo_Ptr;
+
+typedef SvxMSDffShapeOrder* SvxMSDffShapeOrder_Ptr;
+
+typedef ::std::map< sal_Int32, SdrObject* > SvxMSDffShapeIdContainer;
+
+#define SVEXT_PERSIST_STREAM "\002OlePres000"
+
+// nach der Reihenfolge des Auftretens sortiert werden:
+//
+SV_DECL_PTRARR_DEL(SvxMSDffBLIPInfos, SvxMSDffBLIPInfo_Ptr, 16,16)
+
+SV_DECL_PTRARR_DEL(SvxMSDffShapeOrders, SvxMSDffShapeOrder_Ptr, 16,16)
+
+// explizit sortiert werden:
+//
+SV_DECL_PTRARR_SORT_DEL_VISIBILITY(SvxMSDffShapeInfos, SvxMSDffShapeInfo_Ptr, 16,16, MSFILTER_DLLPUBLIC)
+
+SV_DECL_PTRARR_SORT_VISIBILITY(SvxMSDffShapeTxBxSort, SvxMSDffShapeOrder_Ptr, 16,16, MSFILTER_DLLPUBLIC)
+
+#define SVXMSDFF_SETTINGS_CROP_BITMAPS 1
+#define SVXMSDFF_SETTINGS_IMPORT_PPT 2
+#define SVXMSDFF_SETTINGS_IMPORT_EXCEL 4
+
+#define SP_FGROUP 0x001 // This shape is a group shape
+#define SP_FCHILD 0x002 // Not a top-level shape
+#define SP_FPATRIARCH 0x004 // This is the topmost group shape.
+ // Exactly one of these per drawing.
+#define SP_FDELETED 0x008 // The shape has been deleted
+#define SP_FOLESHAPE 0x010 // The shape is an OLE object
+#define SP_FHAVEMASTER 0x020 // Shape has a hspMaster property
+#define SP_FFLIPH 0x040 // Shape is flipped horizontally
+#define SP_FFLIPV 0x080 // Shape is flipped vertically
+#define SP_FCONNECTOR 0x100 // Connector type of shape
+#define SP_FHAVEANCHOR 0x200 // Shape has an anchor of some kind
+#define SP_FBACKGROUND 0x400 // Background shape
+#define SP_FHAVESPT 0x800 // Shape has a shape type property
+
+// for the CreateSdrOLEFromStorage we need the information, how we handle
+// convert able OLE-Objects - this ist stored in
+#define OLE_MATHTYPE_2_STARMATH 0x0001
+#define OLE_WINWORD_2_STARWRITER 0x0002
+#define OLE_EXCEL_2_STARCALC 0x0004
+#define OLE_POWERPOINT_2_STARIMPRESS 0x0008
+
+struct SvxMSDffConnectorRule
+{
+ sal_uInt32 nRuleId;
+ sal_uInt32 nShapeA; // SPID of shape A
+
+ sal_uInt32 nShapeB; // SPID of shape B
+ sal_uInt32 nShapeC; // SPID of connector shape
+ sal_uInt32 ncptiA; // Connection site Index of shape A
+ sal_uInt32 ncptiB; // Connection site Index of shape B
+ sal_uInt32 nSpFlagsA; // SpFlags of shape A ( the original mirror flags must be known when solving the Solver Container )
+ sal_uInt32 nSpFlagsB; // SpFlags of shape A
+
+ SdrObject* pAObj; // pPtr of object ( corresponding to shape A )
+ SdrObject* pBObj; // "
+ SdrObject* pCObj; // " of connector object
+
+ SvxMSDffConnectorRule() : nSpFlagsA( 0 ), nSpFlagsB( 0 ), pAObj( NULL ), pBObj( NULL ), pCObj( NULL ) {};
+
+ friend SvStream& operator>>( SvStream& rIn, SvxMSDffConnectorRule& rAtom );
+};
+struct MSFILTER_DLLPUBLIC SvxMSDffSolverContainer
+{
+ List aCList;
+
+ SvxMSDffSolverContainer();
+ ~SvxMSDffSolverContainer();
+
+ MSFILTER_DLLPUBLIC friend SvStream& operator>>( SvStream& rIn, SvxMSDffSolverContainer& rAtom );
+};
+
+struct FIDCL
+{
+ sal_uInt32 dgid; // DG owning the SPIDs in this cluster
+ sal_uInt32 cspidCur; // number of SPIDs used so far
+};
+
+//---------------------------------------------------------------------------
+// von SvxMSDffManager fuer jedes in der Gruppe enthaltene Shape geliefert
+//---------------------------------------------------------------------------
+struct MSDffTxId
+{
+ sal_uInt16 nTxBxS;
+ sal_uInt16 nSequence;
+ MSDffTxId(sal_uInt16 nTxBxS_, sal_uInt16 nSequence_ )
+ : nTxBxS( nTxBxS_ ),
+ nSequence( nSequence_ ){}
+ MSDffTxId(const MSDffTxId& rCopy)
+ : nTxBxS( rCopy.nTxBxS ),
+ nSequence( rCopy.nSequence ){}
+};
+
+struct MSFILTER_DLLPUBLIC SvxMSDffImportRec
+{
+ static const int RELTO_DEFAULT = 2;
+
+ SdrObject* pObj;
+ Polygon* pWrapPolygon;
+ char* pClientAnchorBuffer;
+ sal_uInt32 nClientAnchorLen;
+ char* pClientDataBuffer;
+ sal_uInt32 nClientDataLen;
+ sal_uInt32 nXAlign;
+ sal_uInt32 *pXRelTo;
+ sal_uInt32 nYAlign;
+ sal_uInt32 *pYRelTo;
+ sal_uInt32 nLayoutInTableCell;
+ sal_uInt32 nFlags;
+ long nTextRotationAngle;
+ long nDxTextLeft; // Abstand der Textbox vom umgebenden Shape
+ long nDyTextTop;
+ long nDxTextRight;
+ long nDyTextBottom;
+ long nDxWrapDistLeft;
+ long nDyWrapDistTop;
+ long nDxWrapDistRight;
+ long nDyWrapDistBottom;
+ long nCropFromTop;
+ long nCropFromBottom;
+ long nCropFromLeft;
+ long nCropFromRight;
+ MSDffTxId aTextId; // Kennungen fuer Textboxen
+ sal_uLong nNextShapeId; // fuer verlinkte Textboxen
+ sal_uLong nShapeId;
+ MSO_SPT eShapeType;
+ MSO_LineStyle eLineStyle; // Umrandungs-Arten
+ MSO_LineDashing eLineDashing;
+ sal_Bool bDrawHell :1;
+ sal_Bool bHidden :1;
+ sal_Bool bReplaceByFly :1;
+ sal_Bool bLastBoxInChain :1;
+ sal_Bool bHasUDefProp :1;
+ sal_Bool bVFlip :1;
+ sal_Bool bHFlip :1;
+ sal_Bool bAutoWidth :1;
+
+ SvxMSDffImportRec();
+ SvxMSDffImportRec(const SvxMSDffImportRec& rCopy);
+ ~SvxMSDffImportRec();
+ sal_Bool operator==( const SvxMSDffImportRec& rEntry ) const
+ { return nShapeId == rEntry.nShapeId; }
+ sal_Bool operator<( const SvxMSDffImportRec& rEntry ) const
+ { return nShapeId < rEntry.nShapeId; }
+private:
+ SvxMSDffImportRec &operator=(const SvxMSDffImportRec&);
+};
+typedef SvxMSDffImportRec* MSDffImportRec_Ptr;
+
+// Liste aller SvxMSDffImportRec fuer eine Gruppe
+SV_DECL_PTRARR_SORT_DEL_VISIBILITY(MSDffImportRecords, MSDffImportRec_Ptr, 16,16, MSFILTER_DLLPUBLIC)
+
+//---------------------------------------------------------------------------
+// Import-/Export-Parameterblock fuer 1 x ImportObjAtCurrentStreamPos()
+//---------------------------------------------------------------------------
+struct SvxMSDffImportData
+{
+ MSDffImportRecords aRecords; // Shape-Pointer, -Ids und private Daten
+ Rectangle aParentRect;// Rectangle der umgebenden Gruppe
+ // bzw. von aussen reingegebenes Rect
+ Rectangle aNewRect; // mit diesem Shape definiertes Rectangle
+
+ SvxMSDffImportData()
+ {}
+ SvxMSDffImportData(const Rectangle& rParentRect)
+ :aParentRect( rParentRect )
+ {}
+ void SetNewRect(sal_Int32 l, sal_Int32 o,
+ sal_Int32 r, sal_Int32 u ){ aNewRect = Rectangle(l,o, r,u); }
+ sal_Bool HasParRect() const { return aParentRect.IsEmpty(); }
+ sal_Bool HasNewRect() const { return aNewRect.IsEmpty() ; }
+ sal_Bool HasRecords() const { return 0 != aRecords.Count(); }
+ sal_uInt16 GetRecCount() const { return aRecords.Count(); }
+ SvxMSDffImportRec* GetRecord(sal_uInt16 iRecord) const
+ { return aRecords.GetObject( iRecord ); }
+};
+
+struct DffObjData
+{
+ const DffRecordHeader& rSpHd;
+
+ Rectangle aBoundRect;
+ Rectangle aChildAnchor;
+
+ sal_uInt32 nShapeId;
+ sal_uInt32 nSpFlags;
+ MSO_SPT eShapeType;
+
+ sal_Bool bShapeType : 1;
+ sal_Bool bClientAnchor : 1;
+ sal_Bool bClientData : 1;
+ sal_Bool bChildAnchor : 1;
+ sal_Bool bOpt : 1;
+ sal_Bool bIsAutoText : 1;
+
+ int nCalledByGroup;
+
+ DffObjData( const DffRecordHeader& rObjHd,
+ const Rectangle& rBoundRect,
+ int nClByGroup ) :
+ rSpHd( rObjHd ),
+ aBoundRect( rBoundRect ),
+ nShapeId( 0 ),
+ nSpFlags( 0 ),
+ eShapeType( mso_sptNil ),
+ bShapeType( sal_False ),
+ bClientAnchor( sal_False ),
+ bClientData( sal_False ),
+ bChildAnchor( sal_False ),
+ bOpt( sal_False ),
+ bIsAutoText( sal_False ),
+ nCalledByGroup( nClByGroup ){}
+};
+
+#define DFF_RECORD_MANAGER_BUF_SIZE 64
+
+struct DffRecordList
+{
+ sal_uInt32 nCount;
+ sal_uInt32 nCurrent;
+ DffRecordList* pPrev;
+ DffRecordList* pNext;
+
+ DffRecordHeader mHd[ DFF_RECORD_MANAGER_BUF_SIZE ];
+
+ DffRecordList( DffRecordList* pList );
+ ~DffRecordList();
+};
+
+enum DffSeekToContentMode
+{
+ SEEK_FROM_BEGINNING,
+ SEEK_FROM_CURRENT,
+ SEEK_FROM_CURRENT_AND_RESTART
+};
+
+class MSFILTER_DLLPUBLIC DffRecordManager : public DffRecordList
+{
+ public :
+
+ DffRecordList* pCList;
+
+ void Clear();
+ void Consume( SvStream& rIn, sal_Bool bAppend = sal_False, sal_uInt32 nStOfs = 0 );
+
+ sal_Bool SeekToContent( SvStream& rIn, sal_uInt16 nRecType, DffSeekToContentMode eMode = SEEK_FROM_BEGINNING );
+ DffRecordHeader* GetRecordHeader( sal_uInt16 nRecType, DffSeekToContentMode eMode = SEEK_FROM_BEGINNING );
+
+ DffRecordManager();
+ DffRecordManager( SvStream& rIn );
+ ~DffRecordManager();
+
+ DffRecordHeader* Current();
+ DffRecordHeader* First();
+ DffRecordHeader* Next();
+ DffRecordHeader* Prev();
+ DffRecordHeader* Last();
+};
+
+/*
+ SvxMSDffManager - abstrakte Basis-Klasse fuer Escher-Import
+ ===============
+ Zweck: Zugriff auf Objekte im Drawing File Format
+ Stand: Zugriff nur auf BLIPs (wird spaeter erweitert)
+
+ Beachte: in der zwecks PowerPoint-, ODER Word- ODER Excel-Import
+ ======== abgeleiteten Klasse
+ MUSS jeweils die Methode ProcessUserDefinedRecord()
+ implementiert werden!
+*/
+class MSFILTER_DLLPUBLIC SvxMSDffManager : public DffPropertyReader
+{
+ FmFormModel* pFormModel;
+ SvxMSDffBLIPInfos* pBLIPInfos;
+ SvxMSDffShapeInfos* pShapeInfos;
+ SvxMSDffShapeOrders* pShapeOrders;
+ sal_uLong nDefaultFontHeight;
+ long nOffsDgg;
+ sal_uInt16 nBLIPCount;
+ sal_uInt16 nShapeCount;
+ sal_uInt32 nGroupShapeFlags;
+
+ void CheckTxBxStoryChain();
+ void GetFidclData( long nOffsDgg );
+
+protected :
+
+ String maBaseURL;
+ sal_uInt32 mnCurMaxShapeId; // we need this information to
+ sal_uInt32 mnDrawingsSaved; // access the right drawing
+ sal_uInt32 mnIdClusters; // while only knowing the shapeid
+ FIDCL* mpFidcls;
+ Table maDgOffsetTable; // array of fileoffsets
+
+ friend class DffPropertyReader;
+
+ SvStream& rStCtrl;
+ SvStream* pStData;
+ SvStream* pStData2;
+ SdrModel* pSdrModel;
+
+ long nMapMul;
+ long nMapDiv;
+ long nMapXOfs;
+ long nMapYOfs;
+ long nEmuMul;
+ long nEmuDiv;
+ long nPntMul;
+ long nPntDiv;
+ bool bNeedMap;
+ sal_uInt32 nSvxMSDffSettings;
+ sal_uInt32 nSvxMSDffOLEConvFlags;
+
+ /** stores a reference to an imported SdrObject with its shape id if
+ it has one
+ */
+ SvxMSDffShapeIdContainer maShapeIdContainer;
+
+ void GetCtrlData( long nOffsDgg );
+ void GetDrawingGroupContainerData( SvStream& rSt,
+ sal_uLong nLenDgg );
+ // #156763#
+ // Add internal drawing container id as parameter to the sub methods of
+ // reading the control information about the drawing objects.
+ // The drawing container id is used to distinguish the text ids of drawing
+ // objects in different drawing containers.
+ void GetDrawingContainerData( SvStream& rSt,
+ sal_uLong nLenDg,
+ const unsigned long nDrawingContainerId );
+ sal_Bool GetShapeGroupContainerData( SvStream& rSt,
+ sal_uLong nLenShapeGroupCont,
+ sal_Bool bPatriarch,
+ const unsigned long nDrawingContainerId );
+ sal_Bool GetShapeContainerData( SvStream& rSt,
+ sal_uLong nLenShapeCont,
+ sal_uLong nPosGroup,
+ const unsigned long nDrawingContainerId );
+
+ bool ReadGraphic( SvStream& rSt, sal_uLong nIndex, Graphic& rGraphic ) const;
+ SdrObject* ImportFontWork( SvStream&, SfxItemSet&, Rectangle& rBoundRect ) const;
+ SdrObject* ImportGraphic( SvStream&, SfxItemSet&, const DffObjData& ) const;
+ // #i32596# - pass <nCalledByGroup> to method
+ // Needed in the Writer Microsoft Word import to avoid import of OLE objects
+ // inside groups. Instead a graphic object is created.
+ virtual SdrObject* ImportOLE( long nOLEId,
+ const Graphic& rGraf,
+ const Rectangle& rBoundRect,
+ const Rectangle& rVisArea,
+ const int _nCalledByGroup,
+ sal_Int64 nAspect ) const;
+ SdrObject* GetAutoForm( MSO_SPT eTyp ) const;
+ static const GDIMetaFile* lcl_GetMetaFileFromGrf_Impl( const Graphic& rGrf, GDIMetaFile& rMtf );
+ static com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > CheckForConvertToSOObj(
+ sal_uInt32 nConvertFlags, SotStorage& rSrcStg,
+ const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xDestStg,
+ const Graphic& rGrf,
+ const Rectangle& rVisArea );
+
+/*
+ folgende Methoden sind zum Excel-Import zu ueberschreiben:
+*/
+ virtual sal_Bool ProcessClientAnchor(SvStream& rStData, sal_uLong nDatLen, char*& rpBuff, sal_uInt32& rBuffLen ) const;
+ virtual void ProcessClientAnchor2( SvStream& rStData, DffRecordHeader& rHd, void* pData, DffObjData& );
+ virtual sal_Bool ProcessClientData( SvStream& rStData, sal_uLong nDatLen, char*& rpBuff, sal_uInt32& rBuffLen ) const;
+ virtual SdrObject* ProcessObj( SvStream& rSt, DffObjData& rData, void* pData, Rectangle& rTextRect, SdrObject* pObj = NULL);
+ virtual sal_uLong Calc_nBLIPPos( sal_uLong nOrgVal, sal_uLong nStreamPos ) const;
+ virtual bool GetColorFromPalette(sal_uInt16 nNum, Color& rColor) const;
+
+ bool ReadDffString(SvStream& rSt, String& rTxt) const;
+ bool ReadObjText(SvStream& rSt, SdrObject* pObj) const;
+
+ // SJ: New implementation of ReadObjText is used by Fontwork objects, because
+ // the old one does not properly import multiple paragraphs
+ void ReadObjText( const String& rText, SdrObject* pObj ) const;
+
+ /*
+ folgende Methode ist von allen zu ueberschreiben, die OLE-Objecte
+ importieren moechten:
+ */
+ virtual sal_Bool GetOLEStorageName( long nOLEId, String& rStorageName,
+ SotStorageRef& rSrcStorage,
+ com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xDestStg
+ ) const;
+
+ /*
+ folgende Methode ist von allen zu ueberschreiben, die verhindern
+ moechten, dass (abgerundete) Rechtecke mit umgebrochenem Text
+ immer in SdrRectObj( OBJ_TEXT ) umgewandelt werden:
+ sal_True bedeutet umwandeln.
+ */
+ virtual sal_Bool ShapeHasText(sal_uLong nShapeId, sal_uLong nFilePos) const;
+
+public:
+
+ void* pSvxMSDffDummy1;
+ void* pSvxMSDffDummy2;
+ void* pSvxMSDffDummy3;
+ List* pEscherBlipCache;
+
+ DffRecordManager maShapeRecords;
+ ColorData mnDefaultColor;
+
+ MSFilterTracer* mpTracer;
+ sal_Bool mbTracing;
+
+ Color MSO_TEXT_CLR_ToColor( sal_uInt32 nColorCode ) const;
+ Color MSO_CLR_ToColor( sal_uInt32 nColorCode, sal_uInt16 nContextProperty = DFF_Prop_lineColor ) const;
+ virtual sal_Bool SeekToShape( SvStream& rSt, void* pClientData, sal_uInt32 nId ) const;
+ bool SeekToRec( SvStream& rSt, sal_uInt16 nRecId, sal_uLong nMaxFilePos, DffRecordHeader* pRecHd = NULL, sal_uLong nSkipCount = 0 ) const;
+ bool SeekToRec2( sal_uInt16 nRecId1, sal_uInt16 nRecId2, sal_uLong nMaxFilePos, DffRecordHeader* pRecHd = NULL, sal_uLong nSkipCount = 0 ) const;
+
+ static void MSDFFReadZString( SvStream& rIn, String& rStr, sal_uLong nMaxLen, bool bUniCode = sal_False );
+
+ static sal_Bool ReadCommonRecordHeader( DffRecordHeader& rRec, SvStream& rIn );
+ static sal_Bool ReadCommonRecordHeader( SvStream& rSt,
+ sal_uInt8& rVer,
+ sal_uInt16& rInst,
+ sal_uInt16& rFbt,
+ sal_uInt32& rLength );
+/*
+ Konstruktor
+ ===========
+ Input: rStCtrl - Verwaltungsstream mit Containern,
+ FBSE Objekten und Shapes
+ ( muss immer uebergeben werden;
+ Stream muss bereits offen sein )
+
+ nOffsDgg - Offset im rStCtrl: Beginn des Drawing Group Containers
+
+ pStData - Datenstream, in dem die BLIPs gespeichert sind
+ ( falls Null, wird angenommen, dass die
+ BLIPs ebenfalls im rStCtrl gespeichert sind;
+ dieser Stream muss ebenfalls bereits offen sein )
+ pSdrModel_ kann beim Ctor-Aufruf leer bleiben, muss dann aber
+ spaeter ueber SetModel() gesetzt werden!
+
+ setzt nBLIPCount
+*/
+ SvxMSDffManager( SvStream& rStCtrl,
+ const String& rBaseURL,
+ long nOffsDgg,
+ SvStream* pStData,
+ SdrModel* pSdrModel_ = 0,
+ long nApplicationScale = 0,
+ ColorData mnDefaultColor_ = COL_DEFAULT,
+ sal_uLong nDefaultFontHeight_ = 24,
+ SvStream* pStData2_ = 0,
+ MSFilterTracer* pTracer = NULL );
+
+ // in PPT werden die Parameter DGGContainerOffset und PicStream
+ // mit Hilfe einer Init Routine Uebergeben.
+ SvxMSDffManager( SvStream& rStCtrl, const String& rBaseURL, MSFilterTracer* pTracer );
+ void InitSvxMSDffManager( long nOffsDgg_, SvStream* pStData_, sal_uInt32 nSvxMSDffOLEConvFlags );
+ void SetDgContainer( SvStream& rSt );
+
+ virtual ~SvxMSDffManager();
+
+ sal_uInt32 GetSvxMSDffSettings() const { return nSvxMSDffSettings; };
+ void SetSvxMSDffSettings( sal_uInt32 nSettings ) { nSvxMSDffSettings = nSettings; };
+
+ static sal_Bool MakeContentStream( SotStorage * pStor, const GDIMetaFile & );
+ static sal_Bool ConvertToOle2( SvStream& rStm, sal_uInt32 nLen, const GDIMetaFile*,
+ const SotStorageRef & rDest );
+
+ void SetModel(SdrModel* pModel, long nApplicationScale);
+ SdrModel* GetModel() const { return pSdrModel; }
+ void Scale(sal_Int32& rVal) const;
+ void Scale(Point& rPos) const;
+ void Scale(Size& rSiz) const;
+ void Scale(Rectangle& rRect) const;
+ void Scale(Polygon& rPoly) const;
+ void Scale(PolyPolygon& rPoly) const;
+ void ScaleEmu(sal_Int32& rVal) const;
+ sal_uInt32 ScalePt( sal_uInt32 nPt ) const;
+ sal_Int32 ScalePoint( sal_Int32 nVal ) const;
+
+/*
+ GetBLIP() - Anforderung eines bestimmten BLIP
+ =========
+ Input: nIdx - Nummer des angeforderten BLIP
+ ( muss immer uebergeben werden )
+
+ Output: rData - bereits fertig konvertierte Daten
+ ( direkt als Grafik in unsere Dokumente einzusetzen )
+
+ Rueckgabewert: sal_True, im Erfolgsfalls, sal_False bei Fehler
+*/
+ sal_Bool GetBLIP( sal_uLong nIdx, Graphic& rData, Rectangle* pVisArea = NULL ) const;
+
+/*
+ GetBLIPDirect() -Einlesen eines BLIP aus schon positioniertem Stream
+ ===============
+ Input: rBLIPStream -bereits korrekt positionierter Stream
+ ( muss immer uebergeben werden )
+
+ Output: rData -bereits fertig konvertierte Daten
+ ( direkt als Grafik in unsere Dokumente einzusetzen )
+
+ Rueckgabewert: sal_True, im Erfolgsfalls, sal_False bei Fehler
+*/
+ sal_Bool GetBLIPDirect(SvStream& rBLIPStream, Graphic& rData, Rectangle* pVisArea = NULL ) const;
+
+ sal_Bool GetShape(sal_uLong nId,
+ SdrObject*& rpData, SvxMSDffImportData& rData);
+
+/*
+ GetBLIPCount() - Abfrage der verwalteten BLIP Anzahl
+ ==============
+ Input: ./.
+ Output: ./.
+ Rueckgabewert: nBLIPCount - Anzahl der im pStData (bzw. rStCtrl) enthaltenen BLIPs
+ ( sprich: Anzahl der FBSEs im Drawing Group Container )
+
+ Werte: 0 - Struktur Ok, jedoch keine BLIPs vorhanden
+ 1.. - Anzahl der BLIPs
+ USHRT_MAX - Fehler: kein korrektes Drawing File Format
+*/
+ sal_uInt16 GetBLIPCount() const{ return nBLIPCount; }
+
+/*
+ ZCodecDecompressed() - Dekomprimierung eines komp. WMF oder Enhanced WMF
+ ====================
+ Input: rIn -bereits korrekt positionierter Stream,
+ der das komprimierte Bild enthaelt
+ rOut -bereits korrekt positionierter Ausgabe-Stream,
+
+ bLookForEnd -Flag, ob das komp. Bild bis zum Stream-Ende reicht.
+ Falls sal_True, wird jeweils geprueft, ob das gelesene noch
+ zum Bild gehoert.
+ Falls sal_False, wird bis zum Stream-Ende gelesen.
+
+ Output: rIn -Der Stream steht hinter dem Ende des komp. Bildes.
+ (es kann aber noch eine Ende-Kennung und CRC-Sum folgen)
+ rOut -Der Stream enthaelt das dekomprimierte Bild.
+ Der Stream wird auf den Anfang des Bildes positioniert.
+ (also dorthin, wo der Stream vor der Verarbeitung stand)
+
+ Rueckgabewert: sal_True, im Erfolgsfall
+ sal_False bei Fehler oder Null Bytes geschrieben
+*/
+// static sal_Bool ZCodecDecompressed( SvStream& rIn,
+// SvStream& rOut,
+// sal_Bool bLookForEnd );
+//
+ SdrObject* ImportObj(SvStream& rSt, void* pData,
+ Rectangle& rClientRect, const Rectangle& rGlobalChildRect, int nCalledByGroup = 0, sal_Int32* pShapeId = NULL);
+
+ SdrObject* ImportGroup( const DffRecordHeader& rHd, SvStream& rSt, void* pData,
+ Rectangle& rClientRect, const Rectangle& rGlobalChildRect, int nCalledByGroup = 0, sal_Int32* pShapeId = NULL );
+
+ SdrObject* ImportShape( const DffRecordHeader& rHd, SvStream& rSt, void* pData,
+ Rectangle& rClientRect, const Rectangle& rGlobalChildRect, int nCalledByGroup = 0, sal_Int32* pShapeId = NULL);
+
+ Rectangle GetGlobalChildAnchor( const DffRecordHeader& rHd, SvStream& rSt, Rectangle& aClientRect );
+ void GetGroupAnchors( const DffRecordHeader& rHd, SvStream& rSt,
+ Rectangle& rGroupClientAnchor, Rectangle& rGroupChildAnchor,
+ const Rectangle& rClientRect, const Rectangle& rGlobalChildRect );
+
+ inline const SvxMSDffShapeInfos* GetShapeInfos( void ) const
+ {
+ return pShapeInfos;
+ }
+
+ inline const SvxMSDffShapeOrders* GetShapeOrders( void ) const
+ {
+ return pShapeOrders;
+ }
+
+ void StoreShapeOrder(sal_uLong nId,
+ sal_uLong nTxBx,
+ SdrObject* pObject,
+ SwFlyFrmFmt* pFly = 0,
+ short nHdFtSection = 0) const;
+
+ void ExchangeInShapeOrder(SdrObject* pOldObject,
+ sal_uLong nTxBx,
+ SwFlyFrmFmt* pFly,
+ SdrObject* pObject) const;
+
+ void RemoveFromShapeOrder( SdrObject* pObject ) const;
+
+ sal_uInt32 GetConvertFlags() const { return nSvxMSDffOLEConvFlags; }
+
+ static SdrOle2Obj* CreateSdrOLEFromStorage( const String& rStorageName,
+ SotStorageRef& rSrcStorage,
+ const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xDestStg,
+ const Graphic& rGraf,
+ const Rectangle& rBoundRect,
+ const Rectangle& rVisArea,
+ SvStream* pDataStrrm,
+ ErrCode& rError,
+ sal_uInt32 nConvertFlags,
+ sal_Int64 nAspect );
+
+ /* the method SolveSolver will create connections between shapes, it should be called after a page is imported.
+ The SvxMSDffSolverContainer is containing necessary data data that is collected during the import of each shape
+ */
+ void SolveSolver( const SvxMSDffSolverContainer& rSolver );
+
+ static sal_Bool SetPropValue(
+ const ::com::sun::star::uno::Any& rAny,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
+ const String& rPropertyName,
+ sal_Bool bTestPropertyAvailability = sal_False );
+
+ void insertShapeId( sal_Int32 nShapeId, SdrObject* pShape );
+ void removeShapeId( SdrObject* pShape );
+ SdrObject* getShapeForId( sal_Int32 nShapeId );
+};
+
+struct SvxMSDffBLIPInfo
+{
+ sal_uInt16 nBLIPType; // Art des BLIP: z.B. 6 fuer PNG
+ sal_uLong nFilePos; // Offset des BLIP im Daten-Stream
+ sal_uLong nBLIPSize; // Anzahl Bytes, die der BLIP im Stream einnimmt
+ SvxMSDffBLIPInfo(sal_uInt16 nBType, sal_uLong nFPos, sal_uLong nBSize):
+ nBLIPType( nBType ), nFilePos( nFPos ), nBLIPSize( nBSize ){}
+};
+
+struct SvxMSDffShapeInfo
+{
+ sal_uInt32 nShapeId; // Shape Id, verwendet im PLCF SPA und im mso_fbtSp (FSP)
+ sal_uLong nFilePos; // Offset des Shape im Kontroll-Stream fuer eventuelle
+ // erneute Zugriffe auf dieses Shape
+ sal_uInt32 nTxBxComp;
+
+ sal_Bool bReplaceByFly :1; // Shape darf im Writer durch Rahmen ersetzt werden.
+ sal_Bool bSortByShapeId :1;
+ sal_Bool bLastBoxInChain:1;
+
+ SvxMSDffShapeInfo(sal_uLong nFPos, sal_uInt32 nId=0, // sal_uLong nBIdx=0,
+ sal_uInt16 nSeqId=0, sal_uInt16 nBoxId=0):
+ nShapeId( nId ),
+ nFilePos( nFPos ),
+ nTxBxComp( (nSeqId << 16) + nBoxId )
+ {
+ bReplaceByFly = sal_False;
+ bSortByShapeId = sal_False;
+ bLastBoxInChain = sal_True;
+ }
+ SvxMSDffShapeInfo(SvxMSDffShapeInfo& rInfo):
+ nShapeId( rInfo.nShapeId ),
+ nFilePos( rInfo.nFilePos ),
+ nTxBxComp( rInfo.nTxBxComp )
+ {
+ bReplaceByFly = rInfo.bReplaceByFly;
+ bSortByShapeId = rInfo.bSortByShapeId;
+ bLastBoxInChain = rInfo.bLastBoxInChain;
+ }
+ sal_Bool operator==( const SvxMSDffShapeInfo& rEntry ) const
+ {
+ return bSortByShapeId ? (nShapeId == rEntry.nShapeId)
+ : (nTxBxComp == rEntry.nTxBxComp && this == &rEntry);
+ }
+ sal_Bool operator<( const SvxMSDffShapeInfo& rEntry ) const
+ {
+ return bSortByShapeId ? (nShapeId < rEntry.nShapeId)
+ : (nTxBxComp < rEntry.nTxBxComp);
+ }
+};
+
+struct SvxMSDffShapeOrder
+{
+ sal_uLong nShapeId; // Shape Id, verwendet im PLCF SPA und im mso_fbtSp (FSP)
+
+ sal_uLong nTxBxComp; // Ketten- und Boxnummer in der Text-Box-Story (bzw. Null)
+
+ SwFlyFrmFmt* pFly; // Frame-Format eines statt des Sdr-Text-Objektes im
+ // Writer eingefuegten Rahmens: zur Verkettung benoetigt!
+
+ short nHdFtSection; // used by Writer to find out if linked frames are in the
+ // same header or footer of the same section
+
+ SdrObject* pObj; // Zeiger auf das Draw-Objekt (bzw. Null, falls nicht verwendet)
+
+ // Vorgehensweise: im Ctor des SvxMSDffManager werden im der Shape-Order-Array
+ // nur die Shape-Ids vermerkt,
+ // Text-Box-Nummer und der Objekt-Pointer werden nur dann
+ // gespeichert, wenn das Shape tatsaechlich importiert wird!
+ SvxMSDffShapeOrder( sal_uLong nId ):
+ nShapeId( nId ), nTxBxComp( 0 ), pFly( 0 ), nHdFtSection( 0 ), pObj( 0 ){}
+
+ sal_Bool operator==( const SvxMSDffShapeOrder& rEntry ) const
+ {
+ return (nTxBxComp == rEntry.nTxBxComp);
+ }
+ sal_Bool operator<( const SvxMSDffShapeOrder& rEntry ) const
+ {
+ return (nTxBxComp < rEntry.nTxBxComp);
+ }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/inc/filter/msfilter/msfilterdllapi.h b/filter/inc/filter/msfilter/msfilterdllapi.h
new file mode 100644
index 000000000000..594b97870225
--- /dev/null
+++ b/filter/inc/filter/msfilter/msfilterdllapi.h
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_MSFILTER_DLLAPI_H
+#define INCLUDED_MSFILTER_DLLAPI_H
+
+#include "sal/types.h"
+
+#if defined MSFILTER_DLLIMPLEMENTATION
+#define MSFILTER_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define MSFILTER_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+
+#define MSFILTER_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/inc/filter/msfilter/msfiltertracer.hxx b/filter/inc/filter/msfilter/msfiltertracer.hxx
new file mode 100644
index 000000000000..66d20d6f5f55
--- /dev/null
+++ b/filter/inc/filter/msfilter/msfiltertracer.hxx
@@ -0,0 +1,99 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _MS_FILTERTRACER_HXX
+#define _MS_FILTERTRACER_HXX
+
+#include <rtl/ustring.hxx>
+#include <tools/stream.hxx>
+#include <xmloff/attrlist.hxx>
+#include <com/sun/star/uno/Any.h>
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/util/XTextSearch.hpp>
+#include <com/sun/star/util/SearchResult.hpp>
+#include <com/sun/star/util/logging/XLogger.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/xml/sax/XAttributeList.hpp>
+#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+#include "filter/msfilter/msfilterdllapi.h"
+
+class FilterConfigItem;
+class MSFILTER_DLLPUBLIC MSFilterTracer
+{
+ FilterConfigItem* mpCfgItem;
+ SvXMLAttributeList* mpAttributeList;
+ SvStream* mpStream;
+ sal_Bool mbEnabled;
+
+ ::com::sun::star::util::SearchOptions maSearchOptions;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxFilterTracer;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XTextSearch > mxTextSearch;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::logging::XLogger > mxLogger;
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > mxHandler;
+
+ public :
+
+ /* The first parameter is expecting the path of the configuration file.
+ The second parameter can be used to override properties of the configuration
+ file. A "DocumentURL" property can be set in the property
+ sequence to provide the current url of the document.
+ If the "Path" property is not set in the configuration file, then the path
+ of the "DocumentURL" property is used instead. If both are not set, the
+ application path is used instead.
+ If the "Name" property is not set in the configuration file, then the name
+ of the "DocumentURL" property is used instead. If both are not set, the
+ name "tracer* is used.
+ The file extension will always be "log" */
+
+ MSFilterTracer( const ::rtl::OUString& rConfigurationPath,
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pConfigData = NULL );
+ ~MSFilterTracer();
+
+ void StartTracing();
+ void EndTracing();
+
+ inline sal_Bool IsEnabled() const { return mbEnabled; }
+
+ void StartElement( const ::rtl::OUString& rName, ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > xAttribs );
+ void EndElement( const ::rtl::OUString& rName );
+
+ void Trace( const ::rtl::OUString& rElementID, const ::rtl::OUString& rMessage );
+ void AddAttribute( const ::rtl::OUString &sName , const ::rtl::OUString &sValue );
+ void RemoveAttribute( const ::rtl::OUString& sName );
+ void ClearAttributes();
+
+ /* initially all properties of the configuration file and the
+ properties which are given to the c'tor can be retrieved */
+ ::com::sun::star::uno::Any GetProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any* pDefault = NULL ) const;
+ void SetProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rProperty );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/inc/filter/msfilter/msocximex.hxx b/filter/inc/filter/msfilter/msocximex.hxx
new file mode 100644
index 000000000000..5e1915d0406f
--- /dev/null
+++ b/filter/inc/filter/msfilter/msocximex.hxx
@@ -0,0 +1,1241 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _MSOCXIMEX_HXX
+#define _MSOCXIMEX_HXX
+
+#include <sot/storage.hxx>
+#include <tools/debug.hxx>
+#include <com/sun/star/graphic/XGraphicObject.hpp>
+
+//!! no such defines in global namespaces - it will break other existing code that uses the same define!!
+//#ifndef C2U
+//#define C2U(cChar) rtl::OUString::createFromAscii(cChar)
+//#endif
+#include "filter/msfilter/msfilterdllapi.h"
+#include <vector>
+#include <boost/unordered_map.hpp>
+
+namespace com{namespace sun{namespace star{
+ namespace drawing{
+ class XDrawPage;
+ class XShape;
+ class XShapes;
+ }
+ namespace form{
+ class XFormComponent;
+ }
+ namespace lang{
+ class XMultiServiceFactory;
+ }
+ namespace container{
+ class XIndexContainer;
+ class XNameContainer;
+ }
+ namespace beans{
+ class XPropertySet;
+ }
+ namespace text{
+ class XText;
+ }
+ namespace awt{
+ struct Size;
+ class XControlModel;
+ }
+ namespace uno{
+ class XComponentContext;
+ }
+
+}}}
+
+class OCX_Control;
+class SfxObjectShell;
+class SwPaM;
+
+class TypeName
+{
+public:
+ String msName;
+ sal_uInt16 mnType;
+ sal_Int32 mnLeft;
+ sal_Int32 mnTop;
+ sal_Int32 mnStoreId;
+ TypeName(sal_Char *pName, sal_uInt32 nStoreId, sal_uInt32 nLen, sal_uInt16 nType,
+ sal_Int32 nLeft, sal_Int32 nTop);
+};
+
+
+class MSFILTER_DLLPUBLIC SvxMSConvertOCXControls
+{
+public:
+ SvxMSConvertOCXControls( SfxObjectShell *pDSh,SwPaM *pP );
+ virtual ~SvxMSConvertOCXControls();
+
+ //Reads a control from the given storage, constructed shape in pShapeRef
+ sal_Bool ReadOCXStream( SotStorageRef& rSrc1,
+ com::sun::star::uno::Reference<
+ com::sun::star::drawing::XShape > *pShapeRef=0,
+ sal_Bool bFloatingCtrl=sal_False );
+
+
+ //Excel has a nasty kludged mechanism for this, read
+ //the comments in the source to follow it
+ sal_Bool ReadOCXExcelKludgeStream(SotStorageStreamRef& rSrc1,
+ com::sun::star::uno::Reference <
+ com::sun::star::drawing::XShape > *pShapeRef,sal_Bool bFloatingCtrl);
+
+
+ //Writes the given Uno Control into the given storage
+
+ static sal_Bool WriteOCXStream(SotStorageRef &rSrc1,
+ const com::sun::star::uno::Reference<
+ com::sun::star::awt::XControlModel > &rControlModel,
+ const com::sun::star::awt::Size& rSize,String &rName);
+
+ //Excel has a nasty kludged mechanism for this, read
+ //the comments in the source to follow it
+ static sal_Bool WriteOCXExcelKludgeStream(SotStorageStreamRef& rContents,
+ const com::sun::star::uno::Reference<
+ com::sun::star::awt::XControlModel > &rControlModel,
+ const com::sun::star::awt::Size &rSize, String &rName);
+
+ //Generate an OCX converter based on the OLE2 name
+ static OCX_Control *OCX_Factory(const String &rId);
+
+ //Generate an OCX converter based on the StarOffice UNO id
+ static OCX_Control *OCX_Factory( const com::sun::star::uno::Reference<
+ com::sun::star::awt::XControlModel > &rControlModel,
+ String &rId,String &rName);
+
+ virtual sal_Bool InsertControl(
+ const com::sun::star::uno::Reference<
+ com::sun::star::form::XFormComponent >& /*rFComp*/,
+ const com::sun::star::awt::Size& /*rSize*/,
+ com::sun::star::uno::Reference<
+ com::sun::star::drawing::XShape >* /*pShape*/,
+ sal_Bool /*bFloatingCtrl*/ ) {return sal_False;}
+
+ /*begin: Backwards compatability with office 95 import, modify later*/
+ const com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory > & GetServiceFactory();
+
+ sal_uInt16 GetEditNum() { return ++nEdit; }
+ sal_uInt16 GetCheckboxNum() { return ++nCheckbox; }
+ /*end: Backwards compatability*/
+protected:
+ const com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > &
+ GetShapes();
+
+ const com::sun::star::uno::Reference<
+ com::sun::star::container::XIndexContainer > & GetFormComps();
+
+ SfxObjectShell *pDocSh;
+ SwPaM *pPaM;
+
+ // gecachte Interfaces
+ com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage >
+ xDrawPage;
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >
+ xShapes;
+ com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xServiceFactory;
+
+ // das einzige Formular
+ com::sun::star::uno::Reference< com::sun::star::container::XIndexContainer >
+ xFormComps;
+
+ sal_uInt16 nEdit;
+ sal_uInt16 nCheckbox;
+
+ virtual const com::sun::star::uno::Reference<
+ com::sun::star::drawing::XDrawPage > & GetDrawPage();
+};
+
+class OCX_FontData
+{
+public:
+ OCX_FontData() : nFontNameLen(0), fBold(0), fItalic(0), fUnderline(0),
+ fStrike(0), nFontSize(12), nJustification(1), pFontName(0),
+ bHasAlign(sal_False), bHasFont(sal_True) {}
+ ~OCX_FontData() {
+ if (pFontName)
+ delete [] pFontName;
+ }
+ sal_Bool Read(SotStorageStream *pS);
+ void Import(com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet > &rPropSet);
+
+ sal_Bool Export(SotStorageStreamRef &rContent,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet);
+
+ sal_uInt16 nIdentifier;
+ sal_uInt16 nFixedAreaLen;
+ sal_uInt8 pBlockFlags[4];
+
+ sal_uInt32 nFontNameLen;
+
+ sal_uInt8 fBold:1;
+ sal_uInt8 fItalic:1;
+ sal_uInt8 fUnderline:1;
+ sal_uInt8 fStrike:1;
+ sal_uInt8 fUnknown1:4;
+
+ sal_uInt8 nUnknown2;
+ sal_uInt8 nUnknown3;
+ sal_uInt8 nUnknown4;
+
+ sal_uInt32 nFontSize;
+ sal_uInt16 nLanguageID;
+ sal_uInt8 nJustification;
+ sal_uInt16 nFontWeight;
+
+ char *pFontName;
+ void SetHasAlign(sal_Bool bIn) {bHasAlign=bIn;}
+ void SetHasFont(sal_Bool bIn) {bHasFont=bIn;}
+protected:
+ static sal_uInt16 nStandardId;
+ sal_uInt8 ExportAlign(sal_Int16 nAlign) const;
+ sal_Int16 ImportAlign(sal_uInt8 nJustification) const;
+private:
+ sal_Bool bHasAlign;
+ sal_Bool bHasFont;
+};
+
+class MSFILTER_DLLPUBLIC OCX_Control
+{
+public:
+ OCX_Control(UniString sN, OCX_Control* parent = NULL ) : nWidth( 0 ), nHeight( 0 ), mnLeft(0), mnTop(0),
+ mnStep(0), mnBackColor(0x8000000FL), mnForeColor(0), mnTabPos(0), mbVisible(true), sName(sN), pDocSh(0),
+ bSetInDialog(sal_False), mpParent( parent ) {}
+ sal_Bool FullRead(SotStorageStream *pS)
+ {
+ return Read(pS) && ReadFontData(pS);
+ };
+ virtual sal_Bool Read(SotStorageStream *pS);
+ virtual sal_Bool ReadFontData(SotStorageStream *pS);
+ virtual sal_Bool Import(const com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory > &rServiceFactory,
+ com::sun::star::uno::Reference<
+ com::sun::star::form::XFormComponent > &rFComp,
+ com::sun::star::awt::Size &rSz);
+ virtual sal_Bool Import(com::sun::star::uno::Reference<
+ com::sun::star::container::XNameContainer>
+ &rDialog);
+ virtual sal_Bool Import(com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet>& /*rPropSet*/)
+ {return sal_False;}
+ //Export exports a control as an OLE style storage stream tree
+ virtual sal_Bool Export(SotStorageRef& /*rObj*/,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet>& /*rPropSet*/,
+ const com::sun::star::awt::Size& /*rSize*/) {return sal_False;}
+
+ //WriteContents writes the contents of a contents stream, for
+ //the Excel export you cannot use Export, only WriteContents instead
+ virtual sal_Bool WriteContents(SotStorageStreamRef& /*rObj*/,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet>& /*rPropSet*/,
+ const com::sun::star::awt::Size& /*rSize*/) {return sal_False;}
+ void SetInDialog(bool bState) { bSetInDialog = bState; }
+ bool GetInDialog() { return bSetInDialog; }
+
+ sal_Bool ReadAndImport(SotStorageStream *pS,
+ com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory > &rSF,
+ com::sun::star::uno::Reference<
+ com::sun::star::form::XFormComponent > &rFComp,
+ com::sun::star::awt::Size &rSz)
+ {
+ if (Read(pS))
+ return Import(rSF,rFComp,rSz);
+ return sal_False;
+ }
+ virtual ~OCX_Control() {}
+
+ static void FillSystemColors();
+
+ sal_uInt32 nWidth;
+ sal_uInt32 nHeight;
+ sal_Int32 mnLeft;
+ sal_Int32 mnTop;
+ sal_Int32 mnStep;
+ sal_Int32 mnBackColor;
+ sal_Int32 mnForeColor;
+ sal_uInt16 mnTabPos;
+ bool mbVisible;
+ UniString sName;
+ UniString msToolTip;
+ UniString msParentName;
+ OCX_FontData aFontData;
+ rtl::OUString msCtrlSource;
+ rtl::OUString msRowSource;
+ SfxObjectShell *pDocSh;
+ ::rtl::OUString sImageUrl;
+ com::sun::star::uno::Reference< com::sun::star::graphic::XGraphicObject> mxGrfObj;
+protected:
+
+ sal_uInt32 ImportColor(sal_uInt32 nColorCode) const;
+ sal_uInt32 ExportColor(sal_uInt32 nColorCode) const;
+ sal_uInt32 SwapColor(sal_uInt32 nColorCode) const;
+ sal_Int16 ImportBorder(sal_uInt16 nSpecialEffect,sal_uInt16 nBorderStyle)
+ const;
+ sal_uInt8 ExportBorder(sal_uInt16 nBorder,sal_uInt8 &rBorderStyle) const;
+ bool bSetInDialog;
+ sal_Int16 ImportSpecEffect( sal_uInt8 nSpecialEffect ) const;
+ sal_uInt8 ExportSpecEffect( sal_Int16 nApiEffect ) const;
+ static sal_uInt16 nStandardId;
+ static sal_uInt8 const aObjInfo[4];
+ rtl::OUString msFormType;
+ rtl::OUString msDialogType;
+ OCX_Control* mpParent;
+private:
+ static sal_uInt32 pColor[25];
+};
+
+class OCX_ModernControl : public OCX_Control
+{
+public:
+ OCX_ModernControl(UniString sN) : OCX_Control(sN),
+ fEnabled(1), fLocked(0), fBackStyle(1), fColumnHeads(0), fIntegralHeight(1),
+ fMatchRequired(0), fAlignment(1), fDragBehaviour(0), fEnterKeyBehaviour(0),
+ fEnterFieldBehaviour(0), fTabKeyBehaviour(0), fWordWrap(1),
+ fSelectionMargin(1), fAutoWordSelect(1), fAutoSize(0), fHideSelection(1),
+ fAutoTab(0), fMultiLine(1), nMaxLength(0), nBorderStyle(0), nScrollBars(0),
+ nStyle(0), nMousePointer(0), nPasswordChar(0), nListWidth(0),
+ nBoundColumn(1), nTextColumn(-1), nColumnCount(1), nListRows(8),
+ nMatchEntry(2), nListStyle(0), nShowDropButtonWhen(0), nDropButtonStyle(1),
+ nMultiState(0), nValueLen(0), nCaptionLen(0), nVertPos(1), nHorzPos(7),
+ nSpecialEffect(2), nIcon(0), nPicture(0), nAccelerator(0), nGroupNameLen(0),
+ pValue(0), pCaption(0), pGroupName(0), nIconLen(0), pIcon(0),
+ nPictureLen(0) {}
+
+ ~OCX_ModernControl() {
+ if (pValue) delete[] pValue;
+ if (pCaption) delete[] pCaption;
+ if (pGroupName) delete[] pGroupName;
+ if (pIcon) delete[] pIcon;
+ }
+ sal_Bool Read(SotStorageStream *pS);
+
+
+ /*sal_uInt8 for sal_uInt8 Word Struct*/
+ sal_uInt16 nIdentifier;
+ sal_uInt16 nFixedAreaLen;
+ sal_uInt8 pBlockFlags[8];
+
+ sal_uInt8 fUnknown1:1;
+ sal_uInt8 fEnabled:1;
+ sal_uInt8 fLocked:1;
+ sal_uInt8 fBackStyle:1;
+ sal_uInt8 fUnknown2:4;
+
+ sal_uInt8 fUnknown3:2;
+ sal_uInt8 fColumnHeads:1;
+ sal_uInt8 fIntegralHeight:1;
+ sal_uInt8 fMatchRequired:1;
+ sal_uInt8 fAlignment:1;
+ sal_uInt8 fUnknown4:2;
+
+ sal_uInt8 fUnknown5:3;
+ sal_uInt8 fDragBehaviour:1;
+ sal_uInt8 fEnterKeyBehaviour:1;
+ sal_uInt8 fEnterFieldBehaviour:1;
+ sal_uInt8 fTabKeyBehaviour:1;
+ sal_uInt8 fWordWrap:1;
+
+ sal_uInt8 fUnknown6:2;
+ sal_uInt8 fSelectionMargin:1;
+ sal_uInt8 fAutoWordSelect:1;
+ sal_uInt8 fAutoSize:1;
+ sal_uInt8 fHideSelection:1;
+ sal_uInt8 fAutoTab:1;
+ sal_uInt8 fMultiLine:1;
+
+ sal_uInt32 nMaxLength;
+ sal_uInt8 nBorderStyle;
+ sal_uInt8 nScrollBars;
+ sal_uInt8 nStyle;
+ sal_uInt8 nMousePointer;
+ sal_uInt8 nUnknown7;
+ sal_uInt8 nPasswordChar;
+ sal_uInt32 nListWidth;
+ sal_uInt16 nBoundColumn;
+ sal_Int16 nTextColumn;
+ sal_uInt16 nColumnCount;
+ sal_uInt16 nListRows;
+ sal_uInt16 nUnknown8;
+ sal_uInt8 nMatchEntry;
+ sal_uInt8 nListStyle;
+ sal_uInt8 nShowDropButtonWhen;
+ sal_uInt8 nDropButtonStyle;
+ sal_uInt8 nMultiState;
+ sal_uInt32 nValueLen;
+ sal_uInt32 nCaptionLen;
+
+ sal_uInt16 nVertPos;
+ sal_uInt16 nHorzPos;
+
+ sal_uInt32 nBorderColor;
+ sal_uInt8 nSpecialEffect;
+ sal_uInt16 nIcon;
+ sal_uInt16 nPicture;
+ sal_uInt8 nAccelerator;
+ sal_uInt8 nUnknown9;
+ sal_uInt32 nGroupNameLen;
+ sal_uInt32 nUnknown10;
+
+ char *pValue;
+ char *pCaption;
+ char *pGroupName;
+
+ sal_uInt8 pIconHeader[20];
+ sal_uInt32 nIconLen;
+ sal_uInt8 *pIcon;
+
+ sal_uInt8 pPictureHeader[20];
+ sal_uInt32 nPictureLen;
+
+};
+
+class OCX_TabStrip : public OCX_Control
+{
+public:
+ OCX_TabStrip() : OCX_Control( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TabStrip" ))), nIdentifier(0), nFixedAreaLen(0), nNumTabs(0), bHasTabs(true) {}
+
+ virtual sal_Bool ReadFontData(SotStorageStream *pS);
+ virtual sal_Bool Read(SotStorageStream *pS);
+
+ std::vector< rtl::OUString > msItems;
+ sal_uInt16 nIdentifier;
+ sal_uInt16 nFixedAreaLen;
+ sal_uInt8 pBlockFlags[4];
+ sal_Int32 nNumTabs;
+ bool bHasTabs;
+};
+
+class OCX_Image : public OCX_Control
+{
+public:
+ OCX_Image() : OCX_Control(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Image" ))), fEnabled(1), fBackStyle(0), bPictureTiling(false), bAutoSize(false) {
+ msFormType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.DatabaseImageControl" ));
+ msDialogType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlImageControlModel" ));
+ }
+
+ ~OCX_Image() { }
+ /*sal_uInt8 for sal_uInt8 Word Struct*/
+ sal_uInt16 nIdentifier;
+ sal_uInt16 nFixedAreaLen;
+ sal_uInt8 pBlockFlags[4];
+
+ sal_uInt32 nBorderColor;
+ sal_uInt8 nBorderStyle;
+ sal_uInt8 nMousePointer;
+ sal_uInt8 nPictureSizeMode;
+
+
+ sal_uInt8 fUnknown1:1;
+ sal_uInt8 fEnabled:1;
+ sal_uInt8 fUnknown2:2;
+ sal_uInt8 fBackStyle:1;
+ sal_uInt8 fUnknown3:3;
+
+ sal_uInt8 nPictureAlignment;
+ bool bPictureTiling;
+ sal_uInt8 nSpecialEffect;
+
+ bool bAutoSize;
+ sal_Bool Read(SotStorageStream *pS);
+
+ using OCX_Control::Import; // to not hide the other two import methods
+ virtual sal_Bool Import(com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet>& rPropSet);
+ sal_Bool Export(SotStorageRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize);
+ sal_Bool WriteContents(SotStorageStreamRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize);
+ // No Font record
+ virtual sal_Bool ReadFontData(SvStorageStream* /*pS*/) { return sal_True; }
+
+ static OCX_Control *Create() { return new OCX_Image;}
+};
+struct ContainerRecord
+{
+ ContainerRecord():nTop(0), nLeft(0), nSubStorageId(0), nSubStreamLen(0), nTabPos(0), nTypeIdent(0), bVisible( true ), bTabStop( true ) {}
+ ::rtl::OUString cName;
+ ::rtl::OUString controlTip;
+ ::rtl::OUString sCtrlSource;
+ ::rtl::OUString sRowSource;
+
+ sal_uInt32 nTop;
+ sal_uInt32 nLeft;
+ sal_uInt32 nSubStorageId;
+ sal_uInt32 nSubStreamLen;
+ sal_uInt16 nTabPos;
+ sal_uInt16 nTypeIdent;
+ bool bVisible;
+ bool bTabStop;
+};
+
+typedef std::vector<OCX_Control*>::iterator CtrlIterator;
+typedef std::vector<OCX_Control*>::const_iterator CtrlIteratorConst;
+typedef std::vector<OCX_Control*> CtrlList;
+
+class OCX_OptionButton;
+
+class OCX_ParentControl : public OCX_Control
+{
+public:
+ virtual sal_Bool Read(SvStorageStream *pS);
+ virtual sal_Bool ReadFontData(SvStorageStream* /*pS*/) { return sal_True; }
+
+ using OCX_Control::Import; // to not hide the other two import methods
+
+ virtual sal_Bool Import(com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet);
+
+ SotStorageStreamRef getContainerStream() { return mContainerStream; }
+
+ SotStorageStreamRef getOStream() { return mContainedControlsStream; }
+ virtual void ProcessControl( OCX_Control* pControl, SvStorageStream* pS, ContainerRecord& rec );
+ bool createFromContainerRecord( const ContainerRecord& record,
+ OCX_Control*& );
+ SotStorageStreamRef getContainedControlsStream(){ return mContainedControlsStream; }
+protected:
+ OCX_ParentControl( SotStorageRef& parent,
+ const ::rtl::OUString& storageName,
+ const ::rtl::OUString& sN,
+ const com::sun::star::uno::Reference<
+ com::sun::star::container::XNameContainer > &rDialog,
+ OCX_Control* pParent = NULL );
+ ~OCX_ParentControl();
+
+ com::sun::star::uno::Reference<
+ com::sun::star::container::XNameContainer > mxParent;
+ std::vector<OCX_Control*> mpControls;
+ boost::unordered_map<sal_uInt16, sal_uInt16> mActiveXIDMap;
+ SotStorageRef mContainerStorage;
+ SotStorageStreamRef mContainerStream;
+ SotStorageStreamRef mContainedControlsStream;
+ sal_uInt16 nIdentifier;
+ sal_uInt16 nFixedAreaLen;
+ sal_uInt8 pBlockFlags[4];
+
+ sal_uInt32 nChildrenA;
+ sal_uInt32 nNextAvailableID;
+ sal_uInt32 nBooleanProperties;
+ sal_uInt32 nGroupCnt;
+ sal_uInt32 nZoom;
+
+ sal_uInt8 fUnknown1:1;
+ sal_uInt8 fEnabled:1;
+ sal_uInt8 fLocked:1;
+ sal_uInt8 fBackStyle:1;
+ sal_uInt8 fUnknown2:4;
+
+ sal_uInt8 fUnknown3:8;
+
+ sal_uInt8 fUnknown4:7;
+ sal_uInt8 fWordWrap:1;
+
+ sal_uInt8 fUnknown5:4;
+ sal_uInt8 fAutoSize:1;
+ sal_uInt8 fUnknown6:3;
+
+ sal_uInt32 nCaptionLen;
+ sal_uInt16 nVertPos;
+ sal_uInt16 nHorzPos;
+ sal_uInt32 nBorderColor;
+ sal_uInt32 nDrawBuffer;
+ sal_uInt32 nShapeCookie;
+ sal_uInt8 nKeepScrollBarsVisible;
+ sal_uInt8 nCycle;
+ sal_uInt8 nBorderStyle;
+ sal_uInt8 nMousePointer;
+ sal_uInt8 nSpecialEffect;
+ sal_uInt16 nPicture;
+ sal_uInt8 nPictureAlignment;
+ sal_uInt8 nPictureSizeMode;
+ bool bPictureTiling;
+ sal_uInt16 nAccelerator;
+ sal_uInt16 nIcon;
+ sal_uInt16 fUnknown7;
+
+ char *pCaption;
+
+ sal_uInt32 nScrollWidth;
+ sal_uInt32 nScrollHeight;
+ sal_uInt32 nScrollLeft;
+ sal_uInt32 nScrollTop;
+
+ sal_uInt8 pIconHeader[20];
+ sal_uInt32 nIconLen;
+ sal_uInt8 *pIcon;
+
+ sal_uInt8 pPictureHeader[20];
+ sal_uInt32 nPictureLen;
+private:
+ OCX_ParentControl(); // not implemented
+ OCX_ParentControl(const OCX_ParentControl&); // not implemented
+
+};
+
+class OCX_Page;
+class OCX_MultiPage : public OCX_ParentControl
+{
+public:
+ OCX_MultiPage( SotStorageRef& parent,
+ const ::rtl::OUString& storageName,
+ const ::rtl::OUString& sN,
+ const com::sun::star::uno::Reference<
+ com::sun::star::container::XNameContainer > &rDialog, OCX_Control* pParent = NULL);
+
+ virtual sal_Bool Read(SvStorageStream *pS);
+
+ using OCX_ParentControl::Import; // to not hide the other two import methods
+ virtual sal_Bool Import(com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet);
+ virtual void ProcessControl( OCX_Control* pControl, SvStorageStream* pS, ContainerRecord& rec );
+private:
+ sal_Int32 nActiveTab;
+ SotStorageStreamRef mXStream;
+ bool bHasTabs;
+ std::vector< rtl::OUString > sCaptions;
+ // order of Ids corrosponds to the order of captions above
+ std::vector< sal_Int32 > mPageIds;
+ boost::unordered_map< sal_Int32, OCX_Page* > idToPage;
+};
+
+
+class OCX_Page : public OCX_ParentControl
+{
+public:
+ OCX_Page( SotStorageRef& parentStorage,
+ sal_Int32 nID,
+ const ::rtl::OUString& sN,
+ const com::sun::star::uno::Reference<
+ com::sun::star::container::XNameContainer > &rDialog, OCX_Control* parent = NULL);
+ virtual sal_Bool Read(SvStorageStream *pS);
+
+ using OCX_ParentControl::Import; // to not hide the other two import methods
+ virtual sal_Bool Import(com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet);
+ rtl::OUString msTitle; // #FIXME we should use the existing caption
+ sal_Int32 mnID;
+private:
+};
+
+
+class OCX_Frame : public OCX_ParentControl
+{
+public:
+ OCX_Frame( SotStorageRef& parent,
+ const ::rtl::OUString& storageName,
+ const ::rtl::OUString& sN,
+ const com::sun::star::uno::Reference<
+ com::sun::star::container::XNameContainer > &rDialog, OCX_Control* pParent = NULL);
+ virtual sal_Bool Read(SvStorageStream *pS);
+
+ using OCX_ParentControl::Import; // to not hide the other two import methods
+ virtual sal_Bool Import(com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet);
+};
+
+
+class OCX_UserForm : public OCX_ParentControl
+{
+public:
+ OCX_UserForm( SotStorageRef& parent,
+ const ::rtl::OUString& storageName,
+ const ::rtl::OUString& sN,
+ const com::sun::star::uno::Reference<
+ com::sun::star::container::XNameContainer > &rDialog,
+ const com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory >& rMsf);
+ using OCX_ParentControl::Import; // to not hide the other two import methods
+ virtual sal_Bool Import( com::sun::star::uno::Reference<
+ com::sun::star::container::XNameContainer>
+ &rDialog);
+private:
+ com::sun::star::uno::Reference<
+ com::sun::star::uno::XComponentContext> mxCtx;
+};
+
+
+
+class OCX_CheckBox : public OCX_ModernControl
+{
+public:
+ OCX_CheckBox() : OCX_ModernControl(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CheckBox" ))){
+ msFormType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.CheckBox" ));
+ msDialogType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlCheckBoxModel" ));
+ mnBackColor = 0x80000005L;
+ mnForeColor = 0x80000008L;
+ aFontData.SetHasAlign(sal_True);
+ }
+
+ using OCX_ModernControl::Import; // to not hide the other two import methods
+ virtual sal_Bool Import(com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet);
+ sal_Bool Export(SotStorageRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize);
+ sal_Bool WriteContents(SotStorageStreamRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize);
+ static OCX_Control *Create() { return new OCX_CheckBox;}
+};
+
+class OCX_OptionButton : public OCX_ModernControl
+{
+public:
+ OCX_OptionButton() : OCX_ModernControl(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OptionButton" )))
+ {
+ msFormType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.RadioButton" ));
+ //msDialogType = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlRadioButtonModel"));
+ msDialogType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.RadioButton" ));
+ mnBackColor = 0x80000005L;
+ mnForeColor = 0x80000008L;
+ aFontData.SetHasAlign(sal_True);
+ }
+
+ using OCX_ModernControl::Import; // to not hide the other two import methods
+ virtual sal_Bool Import(com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet);
+ sal_Bool Export(SotStorageRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize);
+ sal_Bool WriteContents(SotStorageStreamRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize);
+
+
+ static OCX_Control *Create() { return new OCX_OptionButton;}
+};
+
+class OCX_TextBox : public OCX_ModernControl
+{
+public:
+ OCX_TextBox() : OCX_ModernControl(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TextBox" ))) {
+ msFormType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.TextField" ));
+ msDialogType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlEditModel" ));
+ mnBackColor = 0x80000005L;
+ mnForeColor = 0x80000008L;
+ nBorderColor = 0x80000006L;
+ aFontData.SetHasAlign(sal_True);
+ }
+
+ using OCX_ModernControl::Import; // to not hide the other two import methods
+ virtual sal_Bool Import(com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet);
+
+ sal_Bool Export(SotStorageRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize);
+ sal_Bool WriteContents(SotStorageStreamRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize);
+ static OCX_Control *Create() { return new OCX_TextBox;}
+};
+
+class OCX_FieldControl: public OCX_ModernControl
+{
+public:
+ OCX_FieldControl() : OCX_ModernControl(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TextBox" ))) {
+ mnBackColor = 0x80000005L;
+ mnForeColor = 0x80000008L;
+ nBorderColor = 0x80000006L;
+ }
+ sal_Bool Export(SotStorageRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize);
+ sal_Bool WriteContents(SotStorageStreamRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize);
+ static OCX_Control *Create() { return new OCX_FieldControl;}
+};
+
+
+class OCX_ToggleButton : public OCX_ModernControl
+{
+public:
+ OCX_ToggleButton() : OCX_ModernControl(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ToggleButton" ))) {
+ msFormType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.CommandButton" ));
+ msDialogType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlButtonModel" ));
+
+ mnBackColor = 0x8000000F;
+ mnForeColor = 0x80000012;
+ aFontData.SetHasAlign(sal_True);
+ aFontData.nJustification = 3; // centered by default
+ }
+ static OCX_Control *Create() { return new OCX_ToggleButton;}
+
+ using OCX_ModernControl::Import; // to not hide the other two import methods
+ virtual sal_Bool Import(com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet);
+ sal_Bool Export(SvStorageRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize);
+ sal_Bool WriteContents(SvStorageStreamRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize);
+};
+
+class OCX_ComboBox : public OCX_ModernControl
+{
+public:
+ OCX_ComboBox() : OCX_ModernControl(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ComboBox" ))){
+ msFormType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.ComboBox" ));
+ msDialogType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.ComboBox" ));
+ mnBackColor = 0x80000005;
+ mnForeColor = 0x80000008;
+ nBorderColor = 0x80000006;
+ aFontData.SetHasAlign(sal_True);
+ }
+ static OCX_Control *Create() { return new OCX_ComboBox;}
+ using OCX_ModernControl::Import; // to not hide the other two import methods
+ virtual sal_Bool Import(com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet);
+ sal_Bool Export(SotStorageRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize);
+ sal_Bool WriteContents(SotStorageStreamRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize);
+};
+
+class OCX_ListBox : public OCX_ModernControl
+{
+public:
+ OCX_ListBox() : OCX_ModernControl(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ListBox" ))){
+ msFormType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.ListBox" ));
+ //msDialogType = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlListBoxModel"));
+ msDialogType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.ListBox" ));
+ mnBackColor = 0x80000005;
+ mnForeColor = 0x80000008;
+ nBorderColor = 0x80000006;
+ aFontData.SetHasAlign(sal_True);
+ }
+ static OCX_Control *Create() { return new OCX_ListBox;}
+ using OCX_ModernControl::Import; // to not hide the other two import methods
+ virtual sal_Bool Import(com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet);
+ sal_Bool Export(SotStorageRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize);
+ sal_Bool WriteContents(SotStorageStreamRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize);
+
+};
+
+class OCX_CommandButton : public OCX_Control
+{
+public:
+ OCX_CommandButton() : OCX_Control(String::CreateFromAscii("CommandButton")),
+ fEnabled(1), fLocked(0), fBackStyle(1), fWordWrap(0), fAutoSize(0),
+ nCaptionLen(0), nVertPos(1), nHorzPos(7), nMousePointer(0), nPicture(0),
+ nAccelerator(0), nIcon(0), pCaption(0), nIconLen(0), pIcon(0), nPictureLen(0),
+ mbTakeFocus( true )
+ {
+ msFormType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.CommandButton" ));
+ msDialogType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlButtonModel" ));
+ mnForeColor = 0x80000012L;
+ mnBackColor = 0x8000000FL;
+ }
+
+ ~OCX_CommandButton() {
+ if (pCaption) delete[] pCaption;
+ if (pIcon) delete[] pIcon;
+ }
+ sal_Bool Read(SotStorageStream *pS);
+
+ /*sal_uInt8 for sal_uInt8 Word Struct*/
+ sal_uInt16 nIdentifier;
+ sal_uInt16 nFixedAreaLen;
+ sal_uInt8 pBlockFlags[4];
+
+
+ sal_uInt8 fUnknown1:1;
+ sal_uInt8 fEnabled:1;
+ sal_uInt8 fLocked:1;
+ sal_uInt8 fBackStyle:1;
+ sal_uInt8 fUnknown2:4;
+
+ sal_uInt8 fUnknown3:8;
+
+ sal_uInt8 fUnknown4:7;
+ sal_uInt8 fWordWrap:1;
+
+ sal_uInt8 fUnknown5:4;
+ sal_uInt8 fAutoSize:1;
+ sal_uInt8 fUnknown6:3;
+
+ sal_uInt32 nCaptionLen;
+
+ sal_uInt16 nVertPos;
+ sal_uInt16 nHorzPos;
+
+ sal_uInt16 nMousePointer;
+ sal_uInt16 nPicture;
+ sal_uInt16 nAccelerator;
+ sal_uInt16 nIcon;
+
+ char *pCaption;
+
+ sal_uInt8 pIconHeader[20];
+ sal_uInt32 nIconLen;
+ sal_uInt8 *pIcon;
+
+ sal_uInt8 pPictureHeader[20];
+ sal_uInt32 nPictureLen;
+
+ bool mbTakeFocus;
+
+ static OCX_Control *Create() { return new OCX_CommandButton;}
+ using OCX_Control::Import; // to not hide the other two import methods
+ virtual sal_Bool Import(com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet);
+ sal_Bool Export(SotStorageRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize);
+ sal_Bool WriteContents(SotStorageStreamRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize);
+
+};
+
+class OCX_ImageButton: public OCX_CommandButton
+{
+public:
+ OCX_ImageButton() {
+ aFontData.SetHasAlign(sal_False);
+ aFontData.SetHasFont(sal_False);
+ }
+ static OCX_Control *Create() { return new OCX_ImageButton;}
+ sal_Bool Export(SotStorageRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize);
+ sal_Bool WriteContents(SotStorageStreamRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize);
+
+};
+
+class OCX_GroupBox: public OCX_Control
+{
+public:
+ OCX_GroupBox() : OCX_Control(String::CreateFromAscii("GroupBox")) {}
+ static OCX_Control *Create() { return new OCX_GroupBox;}
+ sal_Bool Export(SotStorageRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize);
+ sal_Bool WriteContents(SotStorageStreamRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize);
+
+};
+
+class OCX_Label : public OCX_Control
+{
+public:
+ OCX_Label(OCX_Control* pParent = NULL ) : OCX_Control(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Label" )), pParent ), fEnabled(1),
+ fLocked(0),fBackStyle(1),fWordWrap(1),
+ fAutoSize(0),nCaptionLen(0),nVertPos(1),nHorzPos(7),nMousePointer(0),
+ nBorderColor(0x80000006),nBorderStyle(0),nSpecialEffect(0),
+ nPicture(0),nAccelerator(0),nIcon(0),pCaption(0),nIconLen(0),pIcon(0),
+ nPictureLen(0)
+ {
+ msFormType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.FixedText" ));
+ msDialogType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlFixedTextModel" ));
+ mnForeColor = 0x80000008;
+ mnBackColor = 0x80000005;
+ aFontData.SetHasAlign(sal_True);
+ }
+
+ ~OCX_Label() {
+ if (pCaption) delete[] pCaption;
+ if (pIcon) delete[] pIcon;
+ }
+ sal_Bool Read(SotStorageStream *pS);
+
+ /*sal_uInt8 for sal_uInt8 Word Struct*/
+ sal_uInt16 nIdentifier;
+ sal_uInt16 nFixedAreaLen;
+ sal_uInt8 pBlockFlags[4];
+
+
+ sal_uInt8 fUnknown1:1;
+ sal_uInt8 fEnabled:1;
+ sal_uInt8 fLocked:1;
+ sal_uInt8 fBackStyle:1;
+ sal_uInt8 fUnknown2:4;
+
+ sal_uInt8 fUnknown3:8;
+
+ sal_uInt8 fUnknown4:7;
+ sal_uInt8 fWordWrap:1;
+
+ sal_uInt8 fUnknown5:4;
+ sal_uInt8 fAutoSize:1;
+ sal_uInt8 fUnknown6:3;
+
+ sal_uInt32 nCaptionLen;
+ sal_uInt16 nVertPos;
+ sal_uInt16 nHorzPos;
+ sal_uInt8 nMousePointer;
+ sal_uInt32 nBorderColor;
+ sal_uInt16 nBorderStyle;
+ sal_uInt16 nSpecialEffect;
+ sal_uInt16 nPicture;
+ sal_uInt16 nAccelerator;
+ sal_uInt16 nIcon;
+
+ char *pCaption;
+
+ sal_uInt8 pIconHeader[20];
+ sal_uInt32 nIconLen;
+ sal_uInt8 *pIcon;
+
+ sal_uInt8 pPictureHeader[20];
+ sal_uInt32 nPictureLen;
+
+ static OCX_Control *Create() { return new OCX_Label;}
+
+ using OCX_Control::Import; // to not hide the other two import methods
+ virtual sal_Bool Import(com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet);
+
+ sal_Bool Export(SotStorageRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize);
+ sal_Bool WriteContents(SotStorageStreamRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize);
+
+};
+
+
+class OCX_ProgressBar : public OCX_Control
+{
+public:
+ explicit OCX_ProgressBar();
+
+ static OCX_Control* Create();
+
+ virtual sal_Bool Read( SvStorageStream *pS );
+ using OCX_Control::Import; // to not hide the other two import methods
+ virtual sal_Bool Import(com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet);
+ // No Font record
+ virtual sal_Bool ReadFontData(SvStorageStream* /*pS*/) { return sal_True; }
+private:
+ sal_Int32 nMin;
+ sal_Int32 nMax;
+ bool bFixedSingle;
+ bool bEnabled;
+ bool b3d;
+};
+
+class OCX_SpinButton : public OCX_Control
+{
+public:
+ explicit OCX_SpinButton();
+
+ static OCX_Control* Create();
+
+ virtual sal_Bool Read( SvStorageStream *pS );
+
+ virtual sal_Bool ReadFontData( SvStorageStream *pS );
+
+ using OCX_Control::Import; // to not hide the other two import methods
+ virtual sal_Bool Import(com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet);
+ //Export exports a control as an OLE style storage stream tree
+ virtual sal_Bool Export( SvStorageRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize );
+
+ //WriteContents writes the contents of a contents stream, for
+ //the Excel export you cannot use Export, only WriteContents instead
+ virtual sal_Bool WriteContents( SvStorageStreamRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize );
+
+protected:
+ void UpdateInt32Property(
+ sal_Int32& rnCoreValue, sal_Int32 nNewValue,
+ sal_Int32 nBlockFlag );
+
+ void GetInt32Property(
+ sal_Int32& rnCoreValue,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet >& rxPropSet,
+ const rtl::OUString& rPropName,
+ sal_Int32 nBlockFlag );
+
+ void UpdateBoolProperty(
+ bool& rbCoreValue, bool bNewValue,
+ sal_Int32 nBlockFlag );
+
+ void GetBoolProperty(
+ bool& rbCoreValue,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet >& rxPropSet,
+ const rtl::OUString& rPropName,
+ sal_Int32 nBlockFlag );
+
+ /** Writes the data from own members to stream. */
+ sal_Bool WriteData( SvStream& rStrm ) const;
+
+ sal_Int32 mnBlockFlags;
+ sal_Int32 mnValue;
+ sal_Int32 mnMin;
+ sal_Int32 mnMax;
+ sal_Int32 mnSmallStep;
+ sal_Int32 mnPageStep;
+ sal_Int32 mnOrient;
+ sal_Int32 mnDelay;
+ bool mbEnabled;
+ bool mbLocked;
+ bool mbPropThumb;
+};
+
+class OCX_ScrollBar : public OCX_SpinButton
+{
+public:
+ explicit OCX_ScrollBar();
+
+ static OCX_Control* Create();
+
+ using OCX_Control::Import; // to not hide the other two import methods
+ virtual sal_Bool Import(com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet);
+
+ //Export exports a control as an OLE style storage stream tree
+ virtual sal_Bool Export( SvStorageRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize );
+
+ //WriteContents writes the contents of a contents stream, for
+ //the Excel export you cannot use Export, only WriteContents instead
+ virtual sal_Bool WriteContents( SvStorageStreamRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize );
+};
+
+class HTML_Select : public OCX_ModernControl
+{
+public:
+ HTML_Select() : OCX_ModernControl(rtl::OUString::createFromAscii("TextBox")) {
+ msFormType = rtl::OUString::createFromAscii("com.sun.star.form.component.ListBox");
+ msDialogType = rtl::OUString::createFromAscii("com.sun.star.form.component.ListBox");
+ mnBackColor = 0x80000005L;
+ mnForeColor = 0x80000008L;
+ nBorderColor = 0x80000006L;
+ aFontData.SetHasAlign(sal_True);
+ fEnabled = true;
+ nMultiState =false;
+ }
+
+ using OCX_ModernControl::Import; // to not hide the other two import methods
+ virtual sal_Bool Import(com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet);
+
+ static OCX_Control *Create() { return new HTML_Select;}
+
+ virtual sal_Bool Read(SotStorageStream *pS);
+ virtual sal_Bool ReadFontData(SotStorageStream *pS);
+ com::sun::star::uno::Sequence< rtl::OUString > msListData;
+ com::sun::star::uno::Sequence< sal_Int16 > msIndices;
+};
+
+class HTML_TextBox : public OCX_ModernControl
+{
+public:
+ HTML_TextBox() : OCX_ModernControl(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TextBox" ))) {
+ msFormType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.TextField" ));
+ msDialogType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlEditModel" ));
+ mnBackColor = 0x80000005L;
+ mnForeColor = 0x80000008L;
+ nBorderColor = 0x80000006L;
+ aFontData.SetHasAlign(sal_True);
+ }
+
+ using OCX_ModernControl::Import; // to not hide the other two import methods
+ virtual sal_Bool Import(com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet);
+ /*
+ sal_Bool Export(SotStorageRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize);
+ sal_Bool WriteContents(SotStorageStreamRef &rObj,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet> &rPropSet,
+ const com::sun::star::awt::Size& rSize);
+ */
+ static OCX_Control *Create() { return new HTML_TextBox;}
+
+ virtual sal_Bool Read(SotStorageStream *pS);
+ virtual sal_Bool ReadFontData(SotStorageStream *pS);
+};
+
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/inc/filter/msfilter/msoleexp.hxx b/filter/inc/filter/msfilter/msoleexp.hxx
new file mode 100644
index 000000000000..9693215833f3
--- /dev/null
+++ b/filter/inc/filter/msfilter/msoleexp.hxx
@@ -0,0 +1,62 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _MSOLEEXP_HXX
+#define _MSOLEEXP_HXX
+
+#include <com/sun/star/uno/Reference.h>
+#include "filter/msfilter/msfilterdllapi.h"
+
+// for the CreateSdrOLEFromStorage we need the information, how we handle
+// convert able OLE-Objects - this ist stored in
+#define OLE_STARMATH_2_MATHTYPE 0x0001
+#define OLE_STARWRITER_2_WINWORD 0x0002
+#define OLE_STARCALC_2_EXCEL 0x0004
+#define OLE_STARIMPRESS_2_POWERPOINT 0x0008
+
+class SotStorage;
+
+#include <svtools/embedhlp.hxx>
+
+class MSFILTER_DLLPUBLIC SvxMSExportOLEObjects
+{
+ sal_uInt32 nConvertFlags;
+public:
+ SvxMSExportOLEObjects( sal_uInt32 nCnvrtFlgs ) : nConvertFlags(nCnvrtFlgs) {}
+
+ void SetFlags( sal_uInt32 n ) { nConvertFlags = n; }
+ sal_uInt32 GetFlags() const { return nConvertFlags; }
+
+ void ExportOLEObject( svt::EmbeddedObjectRef& rObj, SotStorage& rDestStg );
+ void ExportOLEObject( const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject>& rObj, SotStorage& rDestStg );
+};
+
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/inc/filter/msfilter/mstoolbar.hxx b/filter/inc/filter/msfilter/mstoolbar.hxx
new file mode 100644
index 000000000000..2556c0997405
--- /dev/null
+++ b/filter/inc/filter/msfilter/mstoolbar.hxx
@@ -0,0 +1,366 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Noel Power <noel.power@novell.com>
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Noel Power <noel.power@novell.com>
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef _MSTOOLBAR_HXX
+#define _MSTOOLBAR_HXX
+#include "filter/msfilter/msfilterdllapi.h"
+#include <tools/string.hxx>
+#include <sot/storage.hxx>
+#include <ostream>
+#include <memory>
+#include <vector>
+#include <boost/shared_ptr.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/container/XIndexContainer.hpp>
+#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
+#include <com/sun/star/ui/ImageType.hpp>
+#include <com/sun/star/graphic/XGraphic.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <vcl/bitmap.hxx>
+#include <cppuhelper/implbase1.hxx>
+
+namespace css = ::com::sun::star;
+
+class TBCHeader;
+
+
+class MSOCommandConvertor
+{
+public:
+ virtual ~MSOCommandConvertor() {}
+ virtual rtl::OUString MSOCommandToOOCommand( sal_Int16 msoCmd ) = 0;
+ virtual rtl::OUString MSOTCIDToOOCommand( sal_Int16 msoTCID ) = 0;
+};
+
+class SfxObjectShell;
+
+class MSFILTER_DLLPUBLIC CustomToolBarImportHelper
+{
+ struct iconcontrolitem
+ {
+ rtl::OUString sCommand;
+ css::uno::Reference< css::graphic::XGraphic > image;
+ };
+ std::vector< iconcontrolitem > iconcommands;
+ std::auto_ptr< MSOCommandConvertor > pMSOCmdConvertor;
+ css::uno::Reference< css::ui::XUIConfigurationManagerSupplier > m_xCfgSupp;
+ css::uno::Reference< css::ui::XUIConfigurationManager > m_xAppCfgMgr;
+ SfxObjectShell& mrDocSh;
+ void ScaleImage( css::uno::Reference< css::graphic::XGraphic >& xGraphic, long nNewSize );
+public:
+ CustomToolBarImportHelper( SfxObjectShell& rDocSh, const css::uno::Reference< css::ui::XUIConfigurationManager >& rxAppCfgMgr );
+
+ void setMSOCommandMap( MSOCommandConvertor* pCnvtr ) { pMSOCmdConvertor.reset( pCnvtr ); }
+ css::uno::Reference< css::ui::XUIConfigurationManager > getCfgManager();
+ css::uno::Reference< css::ui::XUIConfigurationManager > getAppCfgManager();
+
+
+ css::uno::Any createCommandFromMacro( const rtl::OUString& sCmd );
+
+ void addIcon( const css::uno::Reference< css::graphic::XGraphic >& xImage, const rtl::OUString& sString );
+ void applyIcons();
+ rtl::OUString MSOCommandToOOCommand( sal_Int16 msoCmd );
+ rtl::OUString MSOTCIDToOOCommand( sal_Int16 msoTCID );
+ SfxObjectShell& GetDocShell() { return mrDocSh; }
+ void showToolbar( const rtl::OUString& rName );
+ bool createMenu( const rtl::OUString& rName, const css::uno::Reference< css::container::XIndexAccess >& xMenuDesc, bool bPersist );
+};
+
+class MSFILTER_DLLPUBLIC TBBase
+{
+friend class Indent;
+ static int nIndent; // num spaces to indent before printing
+protected:
+ void indent_printf(FILE* fp, const char* format, ... );
+ sal_uInt32 nOffSet; // usually for debug we can store the offset in the stream to this record
+public:
+ TBBase() : nOffSet( 0 ) {}
+ virtual ~TBBase(){}
+ rtl::OUString readUnicodeString( SvStream* pS, sal_Size nChars );
+
+ virtual bool Read(SvStream *pS) = 0;
+ virtual void Print( FILE* ) {} // #FIXME remove this an implement the debug routines in all the classes below to enable some sort of readable output
+ sal_uInt32 GetOffset() { return nOffSet; }
+};
+
+class Indent
+{
+public:
+ Indent( bool binit = false )
+ {
+ if ( binit )
+ init();
+ else
+ TBBase::nIndent = TBBase::nIndent + 2;
+ }
+ ~Indent() { TBBase::nIndent = TBBase::nIndent - 2; }
+ void init() { TBBase::nIndent = 0; }
+};
+
+
+class MSFILTER_DLLPUBLIC WString : public TBBase
+{
+ rtl::OUString sString;
+
+public:
+ WString(){};
+ ~WString(){};
+ bool Read(SvStream *pS);
+ rtl::OUString getString(){ return sString; }
+};
+
+class MSFILTER_DLLPUBLIC TBCExtraInfo : public TBBase
+{
+ WString wstrHelpFile;
+ sal_Int32 idHelpContext;
+ WString wstrTag;
+ WString wstrOnAction;
+ WString wstrParam;
+ sal_Int8 tbcu;
+ sal_Int8 tbmg;
+
+ TBCExtraInfo(const TBCExtraInfo&);
+ TBCExtraInfo& operator = ( const TBCExtraInfo&);
+public:
+ TBCExtraInfo();
+ ~TBCExtraInfo(){}
+ bool Read(SvStream *pS);
+ void Print( FILE* );
+ rtl::OUString getOnAction();
+};
+
+class MSFILTER_DLLPUBLIC TBCGeneralInfo : public TBBase
+{
+ sal_uInt8 bFlags;
+ WString customText;
+ WString descriptionText;
+ WString tooltip;
+ TBCExtraInfo extraInfo;
+
+public:
+ TBCGeneralInfo();
+ ~TBCGeneralInfo() {}
+ bool Read(SvStream *pS);
+ void Print( FILE* );
+ bool ImportToolBarControlData( CustomToolBarImportHelper&, std::vector< css::beans::PropertyValue >& );
+ rtl::OUString CustomText() { return customText.getString(); }
+ rtl::OUString DescriptionText() { return descriptionText.getString(); }
+ rtl::OUString Tooltip() { return tooltip.getString(); }
+};
+
+class MSFILTER_DLLPUBLIC TBCBitMap : public TBBase
+{
+friend class TBCBSpecific; // #FIXME hacky access, need to fix
+ sal_Int32 cbDIB;
+ Bitmap mBitMap;
+ int size;
+public:
+ TBCBitMap();
+ ~TBCBitMap();
+ bool Read(SvStream *pS);
+ void Print( FILE* );
+ Bitmap& getBitMap();
+};
+
+class MSFILTER_DLLPUBLIC TBCMenuSpecific : public TBBase
+{
+ sal_Int32 tbid;
+ boost::shared_ptr< WString > name; //exist only if tbid equals 0x00000001
+public:
+ TBCMenuSpecific();
+ ~TBCMenuSpecific(){}
+ bool Read(SvStream *pS);
+ void Print( FILE* );
+ rtl::OUString Name();
+};
+
+class MSFILTER_DLLPUBLIC TBCCDData : public TBBase
+{
+ sal_Int16 cwstrItems; //Signed integer that specifies the number of items in wstrList. MUST be positive.
+ std::vector< WString > wstrList; // Zero-based index array of WString structures. Number of elements MUST be equal to cwstrItems.
+ sal_Int16 cwstrMRU; // Signed integer that specifies the number of most recently used string
+ sal_Int16 iSel ; // Signed integer that specifies the zero-based index of the selected item in the wstrList field. MUST be equal to 0xFFFF (-1) or greater than or equal to 0x0000.
+ sal_Int16 cLines; // Signed integer that specifies the suggested number of lines that the toolbar control will display at any time when displaying the elements of wstrList of available items.
+ sal_Int16 dxWidth; // Signed integer that specifies the width in pixels that the interior of the dropdown has. This excludes the width of the toolbar control border and scroll bar.
+ WString wstrEdit; //Structure of type WString. Editable text for editable area of the ComboBox toolbar control.
+
+public:
+ TBCCDData();
+ ~TBCCDData();
+ bool Read(SvStream *pS);
+ void Print( FILE* );
+};
+
+class TBCComboDropdownSpecific : public TBBase
+{
+ boost::shared_ptr< TBCCDData > data;
+public:
+ TBCComboDropdownSpecific( const TBCHeader& header );
+ TBCComboDropdownSpecific(){}
+ bool Read(SvStream *pS);
+ void Print( FILE* );
+};
+
+class TBCBSpecific : public TBBase
+{
+ sal_uInt8 bFlags;
+ boost::shared_ptr< TBCBitMap > icon; // optional
+ boost::shared_ptr< TBCBitMap > iconMask; // optional
+ boost::shared_ptr< sal_uInt16 > iBtnFace; // optional
+ boost::shared_ptr< WString > wstrAcc; // optional
+
+public:
+ TBCBSpecific();
+ ~TBCBSpecific(){}
+ bool Read(SvStream *pS);
+ void Print( FILE* );
+ // #TODO just add a getGraphic member here
+ TBCBitMap* getIcon();
+ TBCBitMap* getIconMask();
+ sal_uInt16* getBtnFace() { return iBtnFace.get(); }
+};
+
+/* TBCHeader.tct controlSpecificInfo type
+
+0x01 (Button control) TBCBSpecific
+0x10 (ExpandingGrid control) TBCBSpecific
+0x0A (Popup control) TBCMenuSpecific
+0x0C (ButtonPopup control) TBCMenuSpecific
+0x0D (SplitButtonPopup control) TBCMenuSpecific
+0x0E (SplitButtonMRUPopup control) TBCMenuSpecific
+0x02 (Edit control) TBCComboDropdow nSpecific
+0x04 (ComboBox control) TBCComboDropdow nSpecific
+0x14 (GraphicCombo control) TBCComboDropdow nSpecific
+0x03 (DropDown control) TBCComboDropdow nSpecific
+0x06 (SplitDropDown control) TBCComboDropdow nSpecific
+0x09 (GraphicDropDown control) TBCComboDropdow nSpecific
+0x07 (OCXDropDown control) controlSpecificInfo MUST NOT exist
+0x0F (Label control) controlSpecificInfo MUST NOT exist
+0x12 (Grid control) controlSpecificInfo MUST NOT exist
+0x13 (Gauge control) controlSpecificInfo MUST NOT exist
+0x16 (ActiveX control) controlSpecificInfo MUST NOT exist
+
+*/
+class MSFILTER_DLLPUBLIC TBCHeader : public TBBase
+{
+ sal_Int8 bSignature;
+ sal_Int8 bVersion;
+ sal_uInt8 bFlagsTCR;
+ sal_uInt8 tct;
+ sal_uInt16 tcid;
+ sal_uInt32 tbct;
+ sal_uInt8 bPriority;
+ boost::shared_ptr< sal_uInt16 > width; //optional
+ boost::shared_ptr< sal_uInt16 > height; //optional
+
+public:
+ TBCHeader();
+ ~TBCHeader();
+ sal_uInt8 getTct() const { return tct; }
+ sal_uInt16 getTcID() const { return tcid; }
+ bool isVisible() { return !( bFlagsTCR & 0x1 ); }
+ bool isBeginGroup() { return ( bFlagsTCR & 0x2 ); }
+ bool Read(SvStream *pS);
+ void Print( FILE* );
+ sal_uInt32 getTbct() { return tbct; };
+};
+
+class MSFILTER_DLLPUBLIC TBCData : public TBBase
+{
+ TBCHeader rHeader;
+ TBCGeneralInfo controlGeneralInfo;
+ boost::shared_ptr< TBBase > controlSpecificInfo; // can be one of TBCBSpecific, TBCMenuSpecific or TBCComboDropdow nSpecific depending on the control type specified by TBCHeader.tct
+ TBCData(const TBCData&);
+ TBCData& operator = ( const TBCData&);
+public:
+ TBCData( const TBCHeader& Header );
+ ~TBCData(){}
+ bool Read(SvStream *pS);
+ void Print( FILE* );
+ bool ImportToolBarControl( CustomToolBarImportHelper&, std::vector< css::beans::PropertyValue >&, bool& bBeginGroup, bool bIsMenuBar );
+ TBCGeneralInfo& getGeneralInfo() { return controlGeneralInfo; }
+ TBCMenuSpecific* getMenuSpecific();
+};
+
+class MSFILTER_DLLPUBLIC TB : public TBBase
+{
+ sal_uInt8 bSignature;// Signed integer that specifies the toolbar signature number. MUST be 0x02.
+ sal_uInt8 bVersion; // Signed integer that specifies the toolbar version number. MUST be 0x01.
+ sal_Int16 cCL; // Signed integer that SHOULD specify the number of toolbar controls contained in this toolbar.
+ sal_Int32 ltbid;// Signed integer that specifies the toolbar ID. MUST be 0x0001 (custom toolbar ID).
+ sal_uInt32 ltbtr;// Unsigned integer of type TBTRFlags that specifies the toolbar type and toolbar restrictions.
+ sal_uInt16 cRowsDefault;// Unsigned integer that specifies the number of preferred rows for the toolbar when the toolbar is not docked. MUST be less than or equal to 255.
+ sal_uInt16 bFlags; //Unsigned integer of type TBFlags.
+ WString name; //Structure of type WString that specifies the toolbar name
+public:
+ TB();
+ ~TB(){}
+ bool Read(SvStream *pS);
+ void Print( FILE* );
+ sal_Int16 getcCL(){ return cCL; }
+ WString& getName(){ return name; }
+ bool IsEnabled();
+ bool IsMenuToolbar(){ return ( ( ltbtr & 0x2000000 ) == 0x2000000 ); }
+ bool NeedsPositioning();
+};
+
+class MSFILTER_DLLPUBLIC SRECT : public TBBase
+{
+public:
+ SRECT() : left(0), top(0), right(0), bottom(0) {}
+ sal_Int16 left;
+ sal_Int16 top;
+ sal_Int16 right;
+ sal_Int16 bottom;
+ bool Read( SvStream* pS ) { *pS >> left >> top >> right >> bottom; return true; }
+ void Print( FILE* fo );
+};
+
+typedef cppu::WeakImplHelper1< css::container::XIndexContainer > PropertyValueIndexContainer_BASE;
+
+class MSFILTER_DLLPUBLIC TBVisualData : public TBBase
+{
+ sal_Int8 tbds;
+ sal_Int8 tbv;
+ sal_Int8 tbdsDock;
+ sal_Int8 iRow;
+
+ SRECT rcDock;
+ SRECT rcFloat;
+
+public:
+ TBVisualData();
+ ~TBVisualData(){}
+ bool Read(SvStream *pS);
+ void Print( FILE* );
+};
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/inc/filter/msfilter/msvbahelper.hxx b/filter/inc/filter/msfilter/msvbahelper.hxx
new file mode 100644
index 000000000000..04fb21c57a14
--- /dev/null
+++ b/filter/inc/filter/msfilter/msvbahelper.hxx
@@ -0,0 +1,111 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _MSVBAHELPER_HXX
+#define _MSVBAHELPER_HXX
+
+#include <sfx2/objsh.hxx>
+#include <cppuhelper/implbase3.hxx>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/script/vba/XVBAMacroResolver.hpp>
+#include "filter/msfilter/msfilterdllapi.h"
+
+namespace ooo {
+namespace vba {
+
+// ============================================================================
+
+struct MSFILTER_DLLPUBLIC MacroResolvedInfo
+{
+ SfxObjectShell* mpDocContext;
+ String msResolvedMacro;
+ bool mbFound;
+
+ inline explicit MacroResolvedInfo( SfxObjectShell* pDocContext = 0 ) : mpDocContext( pDocContext ), mbFound( false ) {}
+};
+
+MSFILTER_DLLPUBLIC String makeMacroURL( const String& sMacroName );
+MSFILTER_DLLPUBLIC ::rtl::OUString extractMacroName( const ::rtl::OUString& rMacroUrl );
+MSFILTER_DLLPUBLIC MacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const ::rtl::OUString& rMacroName, bool bSearchGlobalTemplates = false );
+MSFILTER_DLLPUBLIC sal_Bool executeMacro( SfxObjectShell* pShell, const String& sMacroName, com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArgs, com::sun::star::uno::Any& aRet, const com::sun::star::uno::Any& aCaller );
+
+// ============================================================================
+
+typedef ::cppu::WeakImplHelper3<
+ ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::lang::XInitialization,
+ ::com::sun::star::script::vba::XVBAMacroResolver > VBAMacroResolverBase;
+
+class VBAMacroResolver : public VBAMacroResolverBase
+{
+public:
+ explicit VBAMacroResolver();
+ virtual ~VBAMacroResolver();
+
+ // com.sun.star.lang.XServiceInfo interface -------------------------------
+
+ virtual ::rtl::OUString SAL_CALL
+ getImplementationName() throw (::com::sun::star::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL
+ supportsService( const ::rtl::OUString& rService )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
+ getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException);
+
+ // com.sun.star.lang.XInitialization interface ----------------------------
+
+ virtual void SAL_CALL initialize(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rArgs )
+ throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // com.sun.star.script.vba.XVBAMacroResolver interface --------------------
+
+ virtual ::rtl::OUString SAL_CALL
+ resolveVBAMacroToScriptURL( const ::rtl::OUString& rVBAMacroName )
+ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+
+ virtual ::rtl::OUString SAL_CALL
+ resolveScriptURLtoVBAMacro( const ::rtl::OUString& rScriptURL )
+ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxModel;
+ SfxObjectShell* mpObjShell;
+ ::rtl::OUString maProjectName;
+};
+
+// ============================================================================
+
+} // namespace vba
+} // namespace ooo
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/inc/filter/msfilter/svdfppt.hxx b/filter/inc/filter/msfilter/svdfppt.hxx
new file mode 100644
index 000000000000..adc885cda3e1
--- /dev/null
+++ b/filter/inc/filter/msfilter/svdfppt.hxx
@@ -0,0 +1,1414 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SVDFPPT_HXX
+#define _SVDFPPT_HXX
+
+#include <tools/solar.h>
+#include <svl/svarray.hxx>
+#include <tools/string.hxx>
+#include <tools/gen.hxx>
+#include <tools/color.hxx>
+#include <svx/svdobj.hxx>
+#include <editeng/numitem.hxx>
+#include <editeng/editdata.hxx>
+#include <filter/msfilter/msdffimp.hxx>
+#include <filter/msfilter/msocximex.hxx>
+#include <filter/msfilter/msfiltertracer.hxx>
+#include <editeng/eeitem.hxx>
+#define ITEMID_FIELD EE_FEATURE_FIELD
+#include <editeng/flditem.hxx>
+#undef ITEMID_FIELD
+#include "filter/msfilter/msfilterdllapi.h"
+#include <vcl/font.hxx>
+#include <vector>
+#include <boost/optional.hpp>
+
+class SdrModel;
+class SdPage;
+class SdrPage;
+class SdrObject;
+class SvStream;
+class Polygon;
+class PolyPolygon;
+class SfxItemSet;
+class Outliner;
+class Graphic;
+class SvxMSDffManager;
+class PptTextMetaCharList;
+class PPTTextObj;
+class DffRecordHeader;
+struct PptCharAttrSet;
+class SvxBulletItem;
+
+#define PPT_IMPORTFLAGS_NO_TEXT_ASSERT 1
+
+struct MSFILTER_DLLPUBLIC PptCurrentUserAtom
+{
+ sal_uInt32 nMagic;
+ sal_uInt32 nCurrentUserEdit;
+ sal_uInt16 nDocFileVersion;
+ sal_uInt8 nMajorVersion;
+ sal_uInt8 nMinorVersion;
+ String aCurrentUser;
+
+public:
+
+ PptCurrentUserAtom() : nMagic ( 0 ),
+ nCurrentUserEdit ( 0 ),
+ nDocFileVersion ( 0 ),
+ nMajorVersion ( 0 ),
+ nMinorVersion ( 0 ) {}
+
+ MSFILTER_DLLPUBLIC friend SvStream& operator>>( SvStream& rIn, PptCurrentUserAtom& rAtom );
+};
+
+struct MSFILTER_DLLPUBLIC PowerPointImportParam
+{
+ SvStream& rDocStream;
+ sal_uInt32 nImportFlags;
+ MSFilterTracer* pTracer;
+ PptCurrentUserAtom aCurrentUserAtom;
+
+ PowerPointImportParam( SvStream& rDocStream, sal_uInt32 nImportFlags, MSFilterTracer* pTracer );
+};
+
+struct SdHyperlinkEntry
+{
+ sal_uInt32 nIndex;
+ sal_Int32 nPrivate1;
+ sal_Int32 nPrivate2;
+ sal_Int32 nPrivate3;
+ sal_Int32 nInfo;
+ String aTarget;
+ String aSubAdress;
+
+ sal_Int32 nStartPos;
+ sal_Int32 nEndPos;
+
+ String aConvSubString;
+ ESelection aESelection;
+ sal_Bool bSelection;
+};
+
+// Hilfsklasse zum Einlesen der PPT InteractiveInfoAtom
+struct MSFILTER_DLLPUBLIC PptInteractiveInfoAtom
+{
+ sal_uInt32 nSoundRef;
+ sal_uInt32 nExHyperlinkId;
+ sal_uInt8 nAction;
+ sal_uInt8 nOleVerb;
+ sal_uInt8 nJump;
+ sal_uInt8 nFlags;
+ sal_uInt8 nHyperlinkType;
+
+ // unknown, da Gesamtgroesse 16 ist
+ sal_uInt8 nUnknown1;
+ sal_uInt8 nUnknown2;
+ sal_uInt8 nUnknown3;
+
+public:
+
+ MSFILTER_DLLPUBLIC friend SvStream& operator>>( SvStream& rIn, PptInteractiveInfoAtom& rAtom );
+};
+
+enum PptPageKind { PPT_MASTERPAGE, PPT_SLIDEPAGE, PPT_NOTEPAGE };
+
+enum PptPageFormat
+{ PPTPF_SCREEN, //
+ PPTPF_USLETTER, // 8.5x11"
+ PPTPF_A4, // 210x297mm
+ PPTPF_35MMDIA, // DIA
+ PPTPF_OVERHEAD, //
+ PPTPF_CUSTOM
+};
+
+// Werte fuer den sal_uLong im PPT_PST_TextHeaderAtom
+enum PPT_TextHeader
+{
+ PPTTH_TITLE,
+ PPTTH_BODY,
+ PPTTH_NOTES,
+ PPTTH_NOTUSED,
+ PPTTH_OTHER, // Text in a Shape
+ PPTTH_CENTERBODY, // Subtitle in Title-Slide
+ PPTTH_CENTERTITLE, // Title in Title-Slide
+ PPTTH_HALFBODY, // Body in two-column slide
+ PPTTH_QUARTERBODY // Body in four-body slide
+};
+
+#define TSS_TYPE_PAGETITLE (0)
+#define TSS_TYPE_BODY (1)
+#define TSS_TYPE_NOTES (2)
+#define TSS_TYPE_UNUSED (3)
+#define TSS_TYPE_TEXT_IN_SHAPE (4)
+#define TSS_TYPE_SUBTITLE (5)
+#define TSS_TYPE_TITLE (6)
+#define TSS_TYPE_HALFBODY (7)
+#define TSS_TYPE_QUARTERBODY (8)
+
+// Inventor-Id fuer PPT UserData
+const sal_uInt32 PPTInventor =sal_uInt32('P')*0x00000001+
+ sal_uInt32('P')*0x00000100+
+ sal_uInt32('T')*0x00010000+
+ sal_uInt32('0')*0x01000000;
+
+// Object-Ids fuer StarDraw UserData
+#define PPT_OBJECTINFO_ID (1)
+
+struct MSFILTER_DLLPUBLIC PptDocumentAtom
+{
+ Size aSlidesPageSize; // Seitengroesse der Slides in 576DPI
+ Size aNotesPageSize; // Seitengroesse der Notes in 576DPI
+ // RatioAtom erstmal weggelassen
+ sal_uInt32 nNotesMasterPersist; // 0=nicht vorhanden
+ sal_uInt32 nHandoutMasterPersist; // 0=nicht vorhanden
+ sal_uInt16 n1stPageNumber; // Seitennummer des ersten Slides
+ PptPageFormat eSlidesPageFormat; // Seitenformat der Slides
+ sal_Bool bEmbeddedTrueType : 1; // TrueType direkt im File?
+ sal_Bool bTitlePlaceholdersOmitted : 1;
+ sal_Bool bRightToLeft : 1;
+ sal_Bool bShowComments : 1;
+
+public:
+
+ Size GetPageSize( const Size& rSiz ) const;
+ Size GetSlidesPageSize() const { return GetPageSize( aSlidesPageSize ); }
+ Size GetNotesPageSize() const { return GetPageSize( aNotesPageSize ); }
+
+ friend SvStream& operator>>( SvStream& rIn, PptDocumentAtom& rAtom );
+};
+
+struct PptSlideLayoutAtom
+{
+ sal_Int32 eLayout; // 0..18
+ sal_uInt8 aPlaceholderId[ 8 ];
+ sal_uLong aPlacementId[ 8 ];
+
+public:
+
+ PptSlideLayoutAtom() { Clear(); }
+ void Clear();
+
+ // Das SlideLayoutAtom wird ohne Header eingelesen!
+ friend SvStream& operator>>( SvStream& rIn, PptSlideLayoutAtom& rAtom );
+};
+
+struct PptSlideAtom
+{
+ PptSlideLayoutAtom aLayout;
+ sal_uInt32 nMasterId;
+ sal_uInt32 nNotesId;
+ sal_uInt16 nFlags;
+
+public:
+
+ PptSlideAtom() { Clear(); }
+ void Clear();
+
+ friend SvStream& operator>>(SvStream& rIn, PptSlideAtom& rAtom);
+};
+
+struct PptSlidePersistAtom
+{
+ sal_uInt32 nPsrReference;
+ sal_uInt32 nFlags;
+ sal_uInt32 nNumberTexts;
+ sal_uInt32 nSlideId;
+ sal_uInt32 nReserved; // we will use nReserved temporarly to set the offset to SSSlideInfoAtom ( if possible )
+
+public:
+
+ PptSlidePersistAtom() { Clear(); }
+ void Clear();
+
+ friend SvStream& operator>>(SvStream& rIn, PptSlidePersistAtom& rAtom);
+};
+
+struct PptNotesAtom
+{
+ sal_uInt32 nSlideId;
+ sal_uInt16 nFlags;
+
+public:
+
+ PptNotesAtom() { Clear(); }
+ void Clear();
+
+ friend SvStream& operator>>(SvStream& rIn, PptNotesAtom& rAtom);
+};
+
+struct PptColorSchemeAtom
+{
+ sal_uInt8 aData[32];
+
+public:
+ PptColorSchemeAtom () { Clear(); }
+ void Clear();
+ Color GetColor( sal_uInt16 nNum ) const;
+
+ friend SvStream& operator>>(SvStream& rIn, PptColorSchemeAtom& rAtom);
+};
+
+struct PptFontEntityAtom
+{
+ String aName;
+ double fScaling;
+ sal_uInt8 lfClipPrecision;
+ sal_uInt8 lfQuality;
+
+ sal_uInt32 nUniqueFontId; // not used anymore
+ CharSet eCharSet;
+ FontFamily eFamily;
+ FontPitch ePitch;
+ sal_Bool bAvailable;
+
+ friend SvStream& operator>>(SvStream& rIn, PptFontEntityAtom& rAtom);
+};
+
+class PptFontCollection;
+struct PptUserEditAtom
+{
+ DffRecordHeader aHd;
+ sal_Int32 nLastSlideID; // ID of last visible slide
+ sal_uInt32 nVersion; // This is major/minor/build which did the edit
+ sal_uInt32 nOffsetLastEdit; // File offset of prev PptUserEditAtom
+ sal_uInt32 nOffsetPersistDirectory; // Offset to PersistPtrs for this file version.
+ sal_uInt32 nDocumentRef;
+ sal_uInt32 nMaxPersistWritten; // Gesamtanzahl der Persisteintraege bis hierher.
+ sal_Int16 eLastViewType; // enum view type
+
+public:
+
+ PptUserEditAtom() : nOffsetPersistDirectory( 0 ) {}
+
+ friend SvStream& operator>>( SvStream& rIn, PptUserEditAtom& rAtom );
+};
+
+struct PptOEPlaceholderAtom
+{
+ sal_uInt32 nPlacementId;
+ sal_uInt8 nPlaceholderId;
+ sal_uInt8 nPlaceholderSize; // 0=Full size, 1=Half size, 2=Quarter of Slide
+
+public:
+
+ PptOEPlaceholderAtom() { Clear(); }
+ void Clear();
+
+ friend SvStream& operator>>( SvStream& rIn, PptOEPlaceholderAtom& rAtom );
+};
+
+struct ProcessData;
+struct PPTStyleSheet;
+struct HeaderFooterEntry;
+struct PptSlidePersistEntry
+{
+ PptSlidePersistAtom aPersistAtom;
+ PptSlideAtom aSlideAtom;
+ PptNotesAtom aNotesAtom;
+ PptColorSchemeAtom aColorScheme; // each slide includes this colorscheme atom
+ PPTStyleSheet* pStyleSheet; // stylesheet of this page ( only in masterpages ), since XP supports more than one masterpage
+
+ sal_uInt32 HeaderFooterOfs[ 4 ]; // containing the ofs to the placeholder (only masterpage)
+ HeaderFooterEntry* pHeaderFooterEntry;
+ SvxMSDffSolverContainer* pSolverContainer;
+ sal_uInt32 nSlidePersistStartOffset;// is an array to the end of the SlidePersistAtom of this page, TextHeaderAtom is following
+ sal_uInt32 nSlidePersistEndOffset;
+ sal_uInt32 nBackgroundOffset; // fileoffset
+ sal_uInt32 nDrawingDgId; // valid, if not -1
+ sal_uInt32* pPresentationObjects; // if valid, this is a pointer to an array that includes the offsets to the presentation objects
+ // on this masterpage for each instance ( 0 - 8 );
+ SdrObject* pBObj;
+ sal_Bool bBObjIsTemporary;
+
+ void* pDummy2;
+ PptPageKind ePageKind; //
+
+ sal_Bool bNotesMaster : 1; // fuer NotesMaster
+ sal_Bool bHandoutMaster : 1; // fuer HandoutMaster
+ sal_Bool bStarDrawFiller : 1; // speziell fuer StarDraw
+public:
+ PptSlidePersistEntry();
+ ~PptSlidePersistEntry();
+ sal_uInt32 GetSlideId() const { return aPersistAtom.nSlideId; }
+};
+
+SV_DECL_PTRARR_DEL(_PptSlidePersistList,PptSlidePersistEntry*,16,16)
+
+#define PPTSLIDEPERSIST_ENTRY_NOTFOUND 0xFFFF
+
+class MSFILTER_DLLPUBLIC PptSlidePersistList: public _PptSlidePersistList
+{
+
+ public:
+
+ sal_uInt16 FindPage( sal_uInt32 nId ) const;
+};
+
+class SfxObjectShell;
+struct PPTOleEntry
+{
+ sal_uInt32 nId; // OleId
+ sal_uInt32 nPersistPtr; // PersistPtr
+ sal_uInt32 nRecHdOfs; // points to the record header: ExObjListHd
+ SfxObjectShell* pShell;
+ sal_uInt16 nType; // maybe PPT_PST_ExEmbed or PPT_PST_ExControl
+ sal_uInt32 nAspect; // the aspect of the OLE object
+
+ PPTOleEntry( sal_uInt32 nid, sal_uInt32 nOfs, SfxObjectShell* pSh, sal_uInt16 nT, sal_uInt32 nAsp ) :
+ nId ( nid ),
+ nRecHdOfs ( nOfs ),
+ pShell ( pSh ),
+ nType ( nT ),
+ nAspect ( nAsp ) {}
+};
+
+struct PptExOleObjAtom
+{
+ sal_uInt32 nAspect;
+ sal_uInt32 nDummy1;
+ sal_uInt32 nId;
+ sal_uInt32 nDummy2;
+ sal_uInt32 nPersistPtr;
+ sal_uInt32 nDummy4;
+
+public:
+
+ friend SvStream& operator>>( SvStream& rIn, PptExOleObjAtom& rAtom );
+};
+
+class PPTExtParaProv;
+class MSFILTER_DLLPUBLIC SdrEscherImport : public SvxMSDffManager
+{
+
+protected:
+
+ friend class PPTTextObj;
+ friend class PPTPortionObj;
+ friend struct PPTStyleTextPropReader;
+ friend class ImplSdPPTImport;
+
+ PptDocumentAtom aDocAtom;
+ DffRecordManager aDocRecManager; // contains all first level container and atoms of the document container
+
+ List aHFMasterList;
+ List aOleObjectList; // contains PPTOleEntrys
+
+ PptFontCollection* pFonts;
+
+ sal_uInt32 nStreamLen;
+ sal_uInt16 nTextStylesIndex;
+
+ CharSet eCharSetSystem;
+
+ sal_Bool bWingdingsChecked : 1;
+ sal_Bool bWingdingsAvailable : 1;
+ sal_Bool bMonotypeSortsChecked : 1;
+ sal_Bool bMonotypeSortsAvailable : 1;
+ sal_Bool bTimesNewRomanChecked : 1;
+ sal_Bool bTimesNewRomanAvailable : 1;
+
+ sal_Bool ReadString( String& rStr ) const;
+ // nur fuer PowerPoint-Filter:
+ virtual const PptSlideLayoutAtom* GetSlideLayoutAtom() const;
+ void CheckWingdings() const;
+ void CheckMonotypeSorts() const;
+ void CheckTimesNewRoman() const;
+
+public:
+
+ PowerPointImportParam& rImportParam;
+
+ void* pSdrEscherDummy1;
+ void* pSdrEscherDummy2;
+ void* pSdrEscherDummy3;
+ void* pSdrEscherDummy4;
+
+ SdrEscherImport( PowerPointImportParam&, const String& rBaseURL );
+ virtual ~SdrEscherImport();
+ virtual bool GetColorFromPalette( sal_uInt16 nNum, Color& rColor ) const;
+ virtual sal_Bool SeekToShape( SvStream& rSt, void* pClientData, sal_uInt32 nId ) const;
+ PptFontEntityAtom* GetFontEnityAtom( sal_uInt32 nNum ) const;
+ CharSet GetCharSet( sal_uInt32 nNum ) const;
+ sal_Bool IsFontAvailable( sal_uInt32 nNum ) const;
+ void RecolorGraphic( SvStream& rSt, sal_uInt32 nRecLen, Graphic& rGraph );
+ using SvxMSDffManager::ReadObjText;
+ virtual SdrObject* ReadObjText( PPTTextObj* pTextObj, SdrObject* pObj, SdPage* pPage ) const;
+ virtual SdrObject* ProcessObj( SvStream& rSt, DffObjData& rData, void* pData, Rectangle& rTextRect, SdrObject* pObj );
+ virtual void ProcessClientAnchor2( SvStream& rSt, DffRecordHeader& rHd, void* pData, DffObjData& rObj );
+ void ImportHeaderFooterContainer( DffRecordHeader& rHeader, HeaderFooterEntry& rEntry );
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#define SD_HEADERFOOTER_DATE 1
+#define SD_HEADERFOOTER_TODAYDATE 2
+#define SD_HEADERFOOTER_USERDATE 4
+#define SD_HEADERFOOTER_SLIDENUMBER 8
+#define SD_HEADERFOOTER_HEADER 16
+#define SD_HEADERFOOTER_FOOTER 32
+
+class SvxFieldItem;
+struct MSFILTER_DLLPUBLIC PPTFieldEntry
+{
+ sal_uInt16 nPos;
+ sal_uInt16 nTextRangeEnd;
+ SvxFieldItem* pField1;
+ SvxFieldItem* pField2;
+ String* pString;
+
+ PPTFieldEntry() : nPos( 0 ), nTextRangeEnd( 0 ), pField1( NULL ), pField2( NULL ), pString( NULL ) {};
+ ~PPTFieldEntry();
+
+ void SetDateTime( sal_uInt32 nType );
+
+ // converting PPT date time format:
+ static void GetDateTime( const sal_uInt32 nVal, SvxDateFormat& eDateFormat, SvxTimeFormat& eTimeFormat );
+};
+
+struct MSFILTER_DLLPUBLIC HeaderFooterEntry
+{
+ const PptSlidePersistEntry* pMasterPersist;
+ String pPlaceholder[ 4 ];
+ sal_uInt32 nAtom;
+
+ sal_uInt32 GetMaskForInstance( sal_uInt32 nInstance );
+ sal_uInt32 IsToDisplay( sal_uInt32 nInstance );
+ sal_uInt32 NeedToImportInstance( const sal_uInt32 nInstance, const PptSlidePersistEntry& rSlidePersist );
+
+ HeaderFooterEntry( const PptSlidePersistEntry* pMaster = NULL );
+ ~HeaderFooterEntry();
+};
+
+struct ProcessData
+{
+ PptSlidePersistEntry& rPersistEntry;
+ SdPage* pPage;
+ List* pBackgroundColoredObjects;
+ sal_uInt32* pTableRowProperties;
+
+ ProcessData( PptSlidePersistEntry& rP, SdPage* pP ) :
+ rPersistEntry ( rP ),
+ pPage ( pP ),
+ pBackgroundColoredObjects ( NULL ),
+ pTableRowProperties ( NULL ) {};
+ ~ProcessData() { delete pBackgroundColoredObjects; delete[] pTableRowProperties; };
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SdrTextObj;
+class SfxObjectShell;
+class MSFILTER_DLLPUBLIC SdrPowerPointImport : public SdrEscherImport
+{
+
+protected:
+
+ friend class PPTTextObj;
+ friend class PPTExtParaProv;
+ friend struct PPTStyleSheet;
+ friend class PPTNumberFormatCreator;
+
+ sal_Bool bOk;
+ PptUserEditAtom aUserEditAtom;
+ PptColorSchemeAtom aPageColors;
+ List aHyperList;
+ sal_uInt32* pPersistPtr;
+ sal_uLong nPersistPtrAnz;
+
+ const PPTStyleSheet* pPPTStyleSheet; // this is the current stylesheet;
+ const PPTStyleSheet* pDefaultSheet; // this is a sheet we are using if no masterpage can be found, but that should
+ // never happen just preventing a crash
+ PptSlidePersistList* pMasterPages;
+ PptSlidePersistList* pSlidePages;
+ PptSlidePersistList* pNotePages;
+ sal_uInt16 nAktPageNum;
+ sal_uLong nDocStreamPos;
+ sal_uInt16 nPageColorsNum;
+ PptPageKind ePageColorsKind;
+ PptPageKind eAktPageKind;
+
+protected:
+
+ sal_Bool SeekToAktPage(DffRecordHeader* pRecHd=NULL) const;
+ sal_Bool SeekToDocument(DffRecordHeader* pRecHd=NULL) const;
+ sal_Bool SeekToContentOfProgTag( sal_Int32 nVersion, SvStream& rSt, const DffRecordHeader& rProgTagBinaryDataHd,
+ DffRecordHeader& rContentHd );
+ virtual SdrObject* ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pText, SdPage* pPage, SfxStyleSheet*, SfxStyleSheet** ) const;
+ using SdrEscherImport::ReadObjText;
+ virtual SdrObject* ReadObjText( PPTTextObj* pTextObj, SdrObject* pObj, SdPage* pPage ) const;
+ // #i32596# - new parameter <_nCalledByGroup>, which
+ // indicates, if the OLE object is imported inside a group object.
+ virtual SdrObject* ImportOLE( long nOLEId,
+ const Graphic& rGraf,
+ const Rectangle& rBoundRect,
+ const Rectangle& rVisArea,
+ const int _nCalledByGroup,
+ sal_Int64 nAspect ) const;
+ SvMemoryStream* ImportExOleObjStg( sal_uInt32 nPersistPtr, sal_uInt32& nOleId ) const;
+ SdrPage* MakeBlancPage(sal_Bool bMaster) const;
+ sal_Bool ReadFontCollection();
+ sal_Bool ForceFontCollection() const { return pFonts!=NULL?sal_True:((SdrPowerPointImport*)this)->ReadFontCollection(); }
+ PptSlidePersistList* GetPageList(PptPageKind ePageKind) const;
+ sal_uInt32 GetAktPageId();
+ sal_uInt32 GetMasterPageId(sal_uInt16 nPageNum, PptPageKind ePageKind) const;
+ sal_uInt32 GetNotesPageId(sal_uInt16 nPageNum ) const;
+ SdrOutliner* GetDrawOutliner( SdrTextObj* pSdrText ) const;
+ void SeekOle( SfxObjectShell* pShell, sal_uInt32 nFilterOptions );
+
+public:
+ SdrPowerPointImport( PowerPointImportParam&, const String& rBaseURL );
+ virtual ~SdrPowerPointImport();
+ sal_uInt16 GetPageCount( PptPageKind eKind = PPT_SLIDEPAGE ) const;
+ void SetPageNum( sal_uInt16 nPageNum, PptPageKind = PPT_SLIDEPAGE );
+ sal_uInt16 GetPageNum() const { return nAktPageNum; }
+ PptPageKind GetPageKind() const { return eAktPageKind; }
+ Size GetPageSize() const;
+ SdrObject* ImportPageBackgroundObject( const SdrPage& rPage, sal_uInt32& nBgFileOffset, sal_Bool bForce );
+ sal_Bool IsNoteOrHandout( sal_uInt16 nPageNum, PptPageKind ePageKind ) const;
+ sal_Bool HasMasterPage( sal_uInt16 nPageNum, PptPageKind ePageKind = PPT_SLIDEPAGE ) const;
+ sal_uInt16 GetMasterPageIndex( sal_uInt16 nPageNum, PptPageKind ePageKind = PPT_SLIDEPAGE ) const;
+
+ void ImportPage( SdrPage* pPage, const PptSlidePersistEntry* pMasterPersist = NULL );
+ virtual bool GetColorFromPalette(sal_uInt16 nNum, Color& rColor) const;
+ virtual sal_Bool SeekToShape( SvStream& rSt, void* pClientData, sal_uInt32 nId ) const;
+ sal_Unicode PPTSubstitute( sal_uInt16 nFont, sal_Unicode nChar,
+ sal_uInt32& nMappedFontId, Font& rFont, char nDefault ) const;
+ const PptDocumentAtom& GetDocumentAtom() const { return aDocAtom; }
+ virtual const PptSlideLayoutAtom* GetSlideLayoutAtom() const;
+ SdrObject* CreateTable( SdrObject* pGroupObject, sal_uInt32* pTableArry, SvxMSDffSolverContainer* );
+};
+
+struct PPTTextCharacterStyleAtomInterpreter
+{
+ sal_uInt16 nFlags1;
+ sal_uInt16 nFlags2;
+ sal_uInt16 nFlags3;
+ sal_Int32 n1;
+ sal_uInt16 nFontHeight;
+ sal_Int32 nFontColor;
+
+ PPTTextCharacterStyleAtomInterpreter();
+ ~PPTTextCharacterStyleAtomInterpreter();
+
+ sal_Bool Read( SvStream& rIn, const DffRecordHeader& rRecHd );
+
+ sal_uInt32 GetColor( sal_uInt32 nDefault );
+};
+
+struct PPTTextParagraphStyleAtomInterpreter
+{
+ sal_Bool bValid;
+ sal_Bool bForbiddenRules;
+ sal_Bool bHangingPunctuation;
+ sal_Bool bLatinTextWrap;
+
+ PPTTextParagraphStyleAtomInterpreter();
+ ~PPTTextParagraphStyleAtomInterpreter();
+
+ sal_Bool Read( SvStream& rIn, const DffRecordHeader& rRecHd );
+};
+
+struct PPTTextSpecInfo
+{
+ sal_uInt32 nCharIdx;
+ sal_uInt16 nLanguage[ 3 ];
+ sal_uInt16 nDontKnow;
+
+ PPTTextSpecInfo( sal_uInt32 nCharIdx );
+ ~PPTTextSpecInfo();
+};
+
+struct PPTTextSpecInfoAtomInterpreter
+{
+ sal_Bool bValid;
+ List aList;
+
+ PPTTextSpecInfoAtomInterpreter();
+ ~PPTTextSpecInfoAtomInterpreter();
+
+ sal_Bool Read( SvStream& rIn, const DffRecordHeader& rRecHd,
+ sal_uInt16 nRecordType, const PPTTextSpecInfo* pTextSpecDefault = NULL );
+
+};
+
+#define PPT_STYLESHEETENTRYS 9
+
+struct PPTExtParaLevel
+{
+ sal_uInt32 mnExtParagraphMask;
+ sal_uInt16 mnBuBlip;
+ sal_uInt16 mnHasAnm;
+ sal_uInt32 mnAnmScheme;
+ sal_uInt32 mpfPP10Ext;
+ sal_uInt32 mnExtCharacterMask;
+ sal_uInt32 mcfPP10Ext;
+ sal_Bool mbSet;
+
+ PPTExtParaLevel();
+ friend SvStream& operator>>( SvStream& rIn, PPTExtParaLevel& rL );
+};
+
+struct PPTExtParaSheet
+{
+ PPTExtParaLevel aExtParaLevel[ 5 ];
+};
+
+struct PPTBuGraEntry
+{
+ sal_uInt32 nInstance;
+ Graphic aBuGra;
+
+ PPTBuGraEntry( Graphic& rGraphic, sal_uInt32 nInstance );
+};
+
+class PPTExtParaProv
+{
+ List aBuGraList;
+
+ public :
+ sal_Bool bStyles;
+ sal_Bool bGraphics;
+ DffRecordManager aExtendedPresRules;
+
+ PPTExtParaSheet aExtParaSheet[ PPT_STYLESHEETENTRYS ];
+
+ sal_Bool GetGraphic( sal_uInt32 nInstance, Graphic& rGraphic ) const;
+
+ PPTExtParaProv( SdrPowerPointImport& rManager, SvStream& rSt,
+ const DffRecordHeader* pMainMasterHd );
+ ~PPTExtParaProv();
+};
+
+struct PPTCharLevel
+{
+ Color mnFontColorInStyleSheet;
+ sal_uInt32 mnFontColor;
+ sal_uInt16 mnFlags;
+ sal_uInt16 mnFont;
+ sal_uInt16 mnAsianOrComplexFont;
+ sal_uInt16 mnFontHeight;
+ sal_uInt16 mnEscapement;
+};
+
+struct PPTCharSheet
+{
+ PPTCharLevel maCharLevel[ 5 ];
+
+ PPTCharSheet( sal_uInt32 nInstance );
+ PPTCharSheet( const PPTCharSheet& rCharSheet );
+
+ void Read( SvStream& rIn, sal_Bool bMasterStyle, sal_uInt32 nLevel, sal_Bool bFirst );
+};
+
+struct PPTParaLevel
+{
+ sal_uInt16 mnBuFlags;
+ sal_uInt16 mnBulletChar;
+ sal_uInt16 mnBulletFont;
+ sal_uInt16 mnBulletHeight;
+ sal_uInt32 mnBulletColor;
+
+ sal_uInt16 mnAdjust;
+ sal_uInt16 mnLineFeed;
+ sal_uInt16 mnUpperDist;
+ sal_uInt16 mnLowerDist;
+ sal_uInt16 mnTextOfs;
+ sal_uInt16 mnBulletOfs;
+ sal_uInt16 mnDefaultTab;
+ sal_uInt16 mnAsianLineBreak; // bit0: use asian rules for first and last character
+ // 1: do not wrap latin text in the middle of the word
+ // 2: allow hanging punctuation
+ sal_uInt16 mnBiDi;
+};
+
+struct PPTParaSheet
+{
+ public:
+
+ PPTParaLevel maParaLevel[ 5 ];
+
+ PPTParaSheet( sal_uInt32 nInstance );
+ PPTParaSheet( const PPTParaSheet& rParaSheet );
+
+ void Read( SdrPowerPointImport& rMan, SvStream& rIn, sal_Bool bMasterStyle,
+ sal_uInt32 nLevel, sal_Bool bFirst );
+};
+
+class PPTParagraphObj;
+class PPTNumberFormatCreator
+{
+ sal_uInt32 nIsBullet;
+ sal_uInt32 nBulletChar;
+ sal_uInt32 nBulletFont;
+ sal_uInt32 nBulletHeight;
+ sal_uInt32 nBulletColor;
+ sal_uInt32 nTextOfs;
+ sal_uInt32 nBulletOfs;
+
+ void ImplGetNumberFormat( SdrPowerPointImport& rMan, SvxNumberFormat& rNumberFormat, sal_uInt32 nLevel );
+ sal_Bool ImplGetExtNumberFormat( SdrPowerPointImport& rMan, SvxNumberFormat& rNumberFormat, sal_uInt32 nLevel,
+ sal_uInt32 nInstance, sal_uInt32 nInstanceInSheet, boost::optional< sal_Int16 >& rStartNumbering,
+ sal_uInt32 nFontHeight, PPTParagraphObj* pPara );
+
+ protected :
+
+ PPTNumberFormatCreator( PPTExtParaProv* );
+ ~PPTNumberFormatCreator();
+
+ public :
+
+ PPTExtParaProv* pExtParaProv;
+
+ void GetNumberFormat( SdrPowerPointImport& rMan, SvxNumberFormat& rNumberFormat, sal_uInt32 nLevel,
+ const PPTParaLevel& rParaLevel, const PPTCharLevel& rCharLevel, sal_uInt32 nInstance );
+
+ sal_Bool GetNumberFormat( SdrPowerPointImport& rMan, SvxNumberFormat& rNumberFormat,
+ PPTParagraphObj* pPara, sal_uInt32 nInstanceInSheet, boost::optional< sal_Int16 >& rStartNumbering );
+};
+
+class SvxNumBulletItem;
+struct PPTStyleSheet : public PPTNumberFormatCreator
+{
+ PPTTextSpecInfo maTxSI;
+ PPTCharSheet* mpCharSheet[ PPT_STYLESHEETENTRYS ];
+ PPTParaSheet* mpParaSheet[ PPT_STYLESHEETENTRYS ];
+ SvxNumBulletItem* mpNumBulletItem[ PPT_STYLESHEETENTRYS ];
+ void* mpDummy;
+
+ PPTStyleSheet( const DffRecordHeader& rSlideHd, SvStream& rSt, SdrPowerPointImport&,
+ const PPTTextCharacterStyleAtomInterpreter&, const PPTTextParagraphStyleAtomInterpreter&, const PPTTextSpecInfo& );
+ ~PPTStyleSheet();
+};
+
+struct ImplPPTParaPropSet
+{
+ sal_uInt32 mnRefCount;
+
+ sal_uInt16 mnDepth;
+ sal_uInt32 mnAttrSet;
+ sal_uInt32 mnBulletColor;
+ sal_uInt16 mpArry[ 22 ];
+
+ sal_uInt32 mnExtParagraphMask;
+ sal_uInt32 mnAnmScheme;
+ sal_uInt16 mnHasAnm;
+ sal_uInt16 mnBuBlip;
+
+ sal_uInt32 nDontKnow1;
+ sal_uInt32 nDontKnow2;
+ sal_uInt16 nDontKnow2bit06;
+
+ ImplPPTParaPropSet(){ mnRefCount = 1; mnAttrSet = 0; mnExtParagraphMask = 0; mnDepth = 0; };
+};
+
+struct PPTParaPropSet
+{
+ sal_uInt32 mnOriginalTextPos;
+ ImplPPTParaPropSet* pParaSet;
+
+ PPTParaPropSet();
+ PPTParaPropSet( PPTParaPropSet& rParaPropSet );
+ ~PPTParaPropSet();
+
+ PPTParaPropSet& operator=( PPTParaPropSet& rParaPropSet );
+};
+
+struct ImplPPTCharPropSet
+{
+ sal_uInt32 mnRefCount;
+
+ sal_uInt32 mnAttrSet;
+ sal_uInt16 mnFlags;
+ sal_uInt32 mnColor;
+ sal_uInt16 mnFont;
+ sal_uInt16 mnAsianOrComplexFont;
+ sal_uInt16 mnANSITypeface;
+ sal_uInt16 mnFontHeight;
+ sal_uInt16 mnEscapement;
+ sal_uInt16 mnSymbolFont;
+
+ ImplPPTCharPropSet(){ mnRefCount = 1; mnAttrSet = 0; };
+};
+
+struct PPTCharPropSet
+{
+
+ sal_uInt32 mnOriginalTextPos;
+ sal_uInt32 mnParagraph;
+ String maString;
+ SvxFieldItem* mpFieldItem;
+ sal_uInt16 mnLanguage[ 3 ];
+
+ ImplPPTCharPropSet* pCharSet;
+
+ void SetFont( sal_uInt16 nFont );
+ void SetColor( sal_uInt32 nColor );
+
+ PPTCharPropSet( sal_uInt32 nParagraph );
+ PPTCharPropSet( PPTCharPropSet& rCharPropSet );
+ PPTCharPropSet( PPTCharPropSet& rCharPropSet, sal_uInt32 nParagraph );
+ ~PPTCharPropSet();
+
+ PPTCharPropSet& operator=( PPTCharPropSet& rCharPropSet );
+
+ private :
+
+ void ImplMakeUnique();
+};
+
+struct PPTTabEntry
+{
+ sal_uInt16 nOffset;
+ sal_uInt16 nStyle;
+};
+
+struct PPTRuler
+{
+ sal_uInt32 nRefCount;
+
+ sal_Int32 nFlags;
+ sal_uInt16 nDefaultTab;
+ sal_uInt16 nTextOfs[ 5 ];
+ sal_uInt16 nBulletOfs[ 5 ];
+ PPTTabEntry* pTab;
+ sal_uInt16 nTabCount;
+
+ PPTRuler();
+ ~PPTRuler();
+};
+
+struct PPTTextRulerInterpreter
+{
+ PPTRuler *mpImplRuler;
+
+ PPTTextRulerInterpreter();
+ PPTTextRulerInterpreter( PPTTextRulerInterpreter& rRuler );
+ PPTTextRulerInterpreter( sal_uInt32 nFileOfs, SdrPowerPointImport&, DffRecordHeader& rHd, SvStream& rIn );
+ ~PPTTextRulerInterpreter();
+
+ sal_uInt16 GetTabOffsetByIndex( sal_uInt16 nIndex ) const { return mpImplRuler->pTab[ nIndex ].nOffset; };
+ sal_uInt16 GetTabStyleByIndex( sal_uInt16 nIndex ) const { return mpImplRuler->pTab[ nIndex ].nStyle; };
+ sal_uInt16 GetTabCount() const { return mpImplRuler->nTabCount; };
+ sal_Bool GetDefaultTab( sal_uInt32 nLevel, sal_uInt16& nValue ) const;
+ sal_Bool GetTextOfs( sal_uInt32 nLevel, sal_uInt16& nValue ) const;
+ sal_Bool GetBulletOfs( sal_uInt32 nLevel, sal_uInt16& nValue ) const;
+
+ PPTTextRulerInterpreter& operator=( PPTTextRulerInterpreter& rRuler );
+};
+
+#define PPT_SPEC_NEWLINE 0x10000
+#define PPT_SPEC_SYMBOL 0x20000
+#define PPT_SPEC_USE_STARBATS 0x40000
+
+struct StyleTextProp9
+{
+ sal_uInt32 mnExtParagraphMask;
+ sal_uInt16 mnBuBlip;
+ sal_uInt16 mnHasAnm;
+ sal_uInt32 mnAnmScheme;
+ sal_uInt32 mpfPP10Ext;
+ sal_uInt32 mnExtCharacterMask;
+ sal_uInt32 mncfPP10Ext;
+ sal_uInt32 mnSpecialInfoMask;
+ sal_uInt32 mnPP10Ext;
+ sal_uInt16 mfBidi;
+
+ StyleTextProp9()
+ : mnExtParagraphMask( 0 )
+ , mnBuBlip( 0 )
+ , mnHasAnm( 0 )
+ , mnAnmScheme( 0 )
+ , mpfPP10Ext( 0 )
+ , mnExtCharacterMask( 0 )
+ , mncfPP10Ext( 0 )
+ , mnSpecialInfoMask( 0 )
+ , mnPP10Ext( 0 )
+ , mfBidi( 0 )
+ {
+ }
+ void Read( SvStream& rSt );
+};
+
+struct PPTStyleTextPropReader
+{
+ List aSpecMarkerList; // hiword -> Flags, loword -> Position
+ List aParaPropList;
+ List aCharPropList;
+
+ PPTStyleTextPropReader( SvStream& rIn, SdrPowerPointImport&, const DffRecordHeader& rClientTextBoxHd,
+ PPTTextRulerInterpreter& rInterpreter, const DffRecordHeader& rExtParaHd, sal_uInt32 nTextInstance );
+
+ void Init( SvStream& rIn, SdrPowerPointImport&, const DffRecordHeader& rClientTextBoxHd,
+ PPTTextRulerInterpreter& rInterpreter, const DffRecordHeader& rExtParaHd, sal_uInt32 nTextInstance );
+ void ReadParaProps( SvStream& rIn, SdrPowerPointImport& rMan, const DffRecordHeader& rTextHeader,
+ const String& aString, PPTTextRulerInterpreter& rRuler,
+ sal_uInt32& nCharCount, sal_Bool& bTextPropAtom );
+ void ReadCharProps( SvStream& rIn, PPTCharPropSet& aCharPropSet, const String& aString,
+ sal_uInt32& nCharCount, sal_uInt32 nCharAnzRead,
+ sal_Bool& bTextPropAtom, sal_uInt32 nExtParaPos,
+ const std::vector< StyleTextProp9 >& aStyleTextProp9,
+ sal_uInt32& nExtParaFlags, sal_uInt16& nBuBlip,
+ sal_uInt16& nHasAnm, sal_uInt32& nAnmScheme );
+
+ ~PPTStyleTextPropReader();
+};
+
+class SvxFieldItem;
+class MSFILTER_DLLPUBLIC PPTPortionObj : public PPTCharPropSet
+{
+
+ friend class PPTParagraphObj;
+
+ const PPTStyleSheet& mrStyleSheet;
+ sal_uInt32 mnInstance;
+ sal_uInt32 mnDepth;
+
+ public :
+
+ sal_Bool GetAttrib( sal_uInt32 nAttr, sal_uInt32& nVal, sal_uInt32 nInstanceInSheet );
+ SvxFieldItem* GetTextField();
+
+ PPTPortionObj( const PPTStyleSheet&, sal_uInt32 nInstance, sal_uInt32 nDepth );
+ PPTPortionObj( PPTCharPropSet&, const PPTStyleSheet&, sal_uInt32 nInstance, sal_uInt32 nDepth );
+ PPTPortionObj( PPTPortionObj& );
+ ~PPTPortionObj();
+
+ // the following function should be removed during next full update
+ void ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, sal_uInt32 nInstanceInSheet );
+ void ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, sal_uInt32 nInstanceInSheet, const PPTTextObj* pTextObj );
+ sal_uInt32 Count() const { return ( mpFieldItem ) ? 1 : maString.Len(); };
+ sal_Bool HasTabulator();
+};
+
+class MSFILTER_DLLPUBLIC PPTParagraphObj : public PPTParaPropSet, public PPTNumberFormatCreator, public PPTTextRulerInterpreter
+{
+ friend class PPTTextObj;
+ friend class PPTNumberFormatCreator;
+
+ const PPTStyleSheet& mrStyleSheet;
+ sal_uInt32 mnInstance;
+
+ protected :
+
+ void ImplClear();
+
+ public :
+
+ sal_Bool mbTab; // if true, this paragraph has tabulators in text
+
+ sal_uInt32 mnCurrentObject;
+ sal_uInt32 mnPortionCount;
+ PPTPortionObj** mpPortionList;
+
+ void UpdateBulletRelSize( sal_uInt32& nBulletRelSize ) const;
+ sal_Bool GetAttrib( sal_uInt32 nAttr, sal_uInt32& nVal, sal_uInt32 nInstanceInSheet );
+
+ PPTParagraphObj( const PPTStyleSheet&, sal_uInt32 nInstance, sal_uInt16 nDepth );
+ PPTParagraphObj( PPTStyleTextPropReader&, const PPTStyleSheet&, sal_uInt32 nInstance, PPTTextRulerInterpreter& rRuler );
+ ~PPTParagraphObj();
+
+ sal_uInt32 GetTextSize();
+ PPTPortionObj* First();
+ PPTPortionObj* Next();
+
+ void AppendPortion( PPTPortionObj& rPortion );
+ void ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >& rStartNumbering, SdrPowerPointImport& rManager, sal_uInt32 nInstanceInSheet, const PPTParagraphObj* pPrev );
+};
+
+#define PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT 1
+#define PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_CENTER 2
+#define PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT 4
+#define PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_BLOCK 8
+#define PPT_TEXTOBJ_FLAGS_VERTICAL 16
+
+struct ImplPPTTextObj
+{
+ sal_uInt32 mnRefCount;
+ sal_uInt32 mnShapeId;
+ sal_uInt32 mnShapeMaster;
+ PptOEPlaceholderAtom* mpPlaceHolderAtom;
+ sal_uInt16 mnInstance;
+ sal_uInt16 mnDestinationInstance;
+ MSO_SPT meShapeType;
+
+ sal_uInt32 mnCurrentObject;
+ sal_uInt32 mnParagraphCount;
+ PPTParagraphObj** mpParagraphList;
+ PptSlidePersistEntry& mrPersistEntry;
+
+ sal_uInt32 mnTextFlags;
+
+ ImplPPTTextObj( PptSlidePersistEntry& rPersistEntry ) : mrPersistEntry ( rPersistEntry ) {};
+};
+
+class PPTTextObj
+{
+ ImplPPTTextObj* mpImplTextObj;
+ void ImplClear();
+
+ PPTTextObj(){};
+ public :
+ PPTTextObj( SvStream& rSt, SdrPowerPointImport&, PptSlidePersistEntry&, DffObjData* );
+ PPTTextObj( PPTTextObj& rTextObj );
+ ~PPTTextObj();
+
+ sal_uInt32 GetCurrentIndex() const { return mpImplTextObj->mnCurrentObject; };
+ sal_uInt32 Count() const { return mpImplTextObj->mnParagraphCount; };
+ PPTParagraphObj* First();
+ PPTParagraphObj* Next();
+ MSO_SPT GetShapeType() const { return mpImplTextObj->meShapeType; };
+ sal_uInt32 GetInstance() const { return mpImplTextObj->mnInstance; };
+ void SetInstance( sal_uInt16 nInstance ) { mpImplTextObj->mnInstance = nInstance; };
+ sal_uInt32 GetDestinationInstance() const { return mpImplTextObj->mnDestinationInstance; };
+ void SetDestinationInstance( sal_uInt16 nInstance ) { mpImplTextObj->mnDestinationInstance = nInstance; };
+ PptOEPlaceholderAtom* GetOEPlaceHolderAtom() const { return mpImplTextObj->mpPlaceHolderAtom; };
+ sal_uInt32 GetTextFlags() const { return mpImplTextObj->mnTextFlags; };
+ void SetVertical( sal_Bool bVertical )
+ {
+ if ( bVertical )
+ mpImplTextObj->mnTextFlags |= PPT_TEXTOBJ_FLAGS_VERTICAL;
+ else
+ mpImplTextObj->mnTextFlags &= ~PPT_TEXTOBJ_FLAGS_VERTICAL;
+ }
+ sal_Bool GetVertical() const { return ( mpImplTextObj->mnTextFlags & PPT_TEXTOBJ_FLAGS_VERTICAL ) != 0; };
+ const SfxItemSet* GetBackground() const;
+
+ PPTTextObj& operator=( PPTTextObj& rTextObj );
+};
+
+class PPTConvertOCXControls : public SvxMSConvertOCXControls
+{
+ virtual const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > & GetDrawPage();
+ PptPageKind ePageKind;
+ public :
+
+ PPTConvertOCXControls( SfxObjectShell* pDSh, PptPageKind ePKind ) :
+ SvxMSConvertOCXControls ( pDSh, NULL ),
+ ePageKind ( ePKind ){};
+
+ virtual sal_Bool InsertControl(
+ const com::sun::star::uno::Reference<
+ com::sun::star::form::XFormComponent > &rFComp,
+ const com::sun::star::awt::Size& rSize,
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShape > *pShape,
+ sal_Bool bFloatingCtrl );
+};
+
+// Powerpoint Recordtypen
+#define PPT_PST_Unknown 0
+#define PPT_PST_SubContainerCompleted 1
+#define PPT_PST_IRRAtom 2
+#define PPT_PST_PSS 3
+#define PPT_PST_SubContainerException 4
+#define PPT_PST_ClientSignal1 6
+#define PPT_PST_ClientSignal2 7
+#define PPT_PST_PowerPointStateInfoAtom 10
+#define PPT_PST_Document 1000
+#define PPT_PST_DocumentAtom 1001
+#define PPT_PST_EndDocument 1002
+#define PPT_PST_SlidePersist 1003
+#define PPT_PST_SlideBase 1004
+#define PPT_PST_SlideBaseAtom 1005
+#define PPT_PST_Slide 1006
+#define PPT_PST_SlideAtom 1007
+#define PPT_PST_Notes 1008
+#define PPT_PST_NotesAtom 1009
+#define PPT_PST_Environment 1010
+#define PPT_PST_SlidePersistAtom 1011
+#define PPT_PST_Scheme 1012
+#define PPT_PST_SchemeAtom 1013
+#define PPT_PST_DocViewInfo 1014
+#define PPT_PST_SslideLayoutAtom 1015
+#define PPT_PST_MainMaster 1016
+#define PPT_PST_SSSlideInfoAtom 1017
+#define PPT_PST_SlideViewInfo 1018
+#define PPT_PST_GuideAtom 1019
+#define PPT_PST_ViewInfo 1020
+#define PPT_PST_ViewInfoAtom 1021
+#define PPT_PST_SlideViewInfoAtom 1022
+#define PPT_PST_VBAInfo 1023
+#define PPT_PST_VBAInfoAtom 1024
+#define PPT_PST_SSDocInfoAtom 1025
+#define PPT_PST_Summary 1026
+#define PPT_PST_Texture 1027
+#define PPT_PST_VBASlideInfo 1028
+#define PPT_PST_VBASlideInfoAtom 1029
+#define PPT_PST_DocRoutingSlip 1030
+#define PPT_PST_OutlineViewInfo 1031
+#define PPT_PST_SorterViewInfo 1032
+#define PPT_PST_ExObjList 1033
+#define PPT_PST_ExObjListAtom 1034
+#define PPT_PST_PPDrawingGroup 1035
+#define PPT_PST_PPDrawing 1036
+#define PPT_PST_NewlyAddedAtomByXP1037 1037
+#define PPT_PST_NamedShows 1040
+#define PPT_PST_NamedShow 1041
+#define PPT_PST_NamedShowSlides 1042
+#define PPT_PST_List 2000
+#define PPT_PST_FontCollection 2005
+#define PPT_PST_ListPlaceholder 2017
+#define PPT_PST_BookmarkCollection 2019
+#define PPT_PST_SoundCollection 2020
+#define PPT_PST_SoundCollAtom 2021
+#define PPT_PST_Sound 2022
+#define PPT_PST_SoundData 2023
+#define PPT_PST_BookmarkSeedAtom 2025
+#define PPT_PST_GuideList 2026
+#define PPT_PST_RunArray 2028
+#define PPT_PST_RunArrayAtom 2029
+#define PPT_PST_ArrayElementAtom 2030
+#define PPT_PST_Int4ArrayAtom 2031
+#define PPT_PST_ColorSchemeAtom 2032
+
+// these atoms first was seen in ppt2000 in a private Tag atom
+#define PPT_PST_ExtendedBuGraContainer 2040 // consist of 4041
+#define PPT_PST_ExtendedBuGraAtom 2041 // the instance of this atom indices the current graphic
+
+#define PPT_PST_OEShape 3008
+#define PPT_PST_ExObjRefAtom 3009
+#define PPT_PST_OEPlaceholderAtom 3011
+#define PPT_PST_GrColor 3020
+#define PPT_PST_GrectAtom 3025
+#define PPT_PST_GratioAtom 3031
+#define PPT_PST_Gscaling 3032
+#define PPT_PST_GpointAtom 3034
+#define PPT_PST_OEShapeAtom 3035
+#define PPT_PST_OutlineTextRefAtom 3998
+#define PPT_PST_TextHeaderAtom 3999
+#define PPT_PST_TextCharsAtom 4000
+#define PPT_PST_StyleTextPropAtom 4001
+#define PPT_PST_BaseTextPropAtom 4002
+#define PPT_PST_TxMasterStyleAtom 4003
+#define PPT_PST_TxCFStyleAtom 4004
+#define PPT_PST_TxPFStyleAtom 4005
+#define PPT_PST_TextRulerAtom 4006
+#define PPT_PST_TextBookmarkAtom 4007
+#define PPT_PST_TextBytesAtom 4008
+#define PPT_PST_TxSIStyleAtom 4009
+#define PPT_PST_TextSpecInfoAtom 4010
+#define PPT_PST_DefaultRulerAtom 4011
+
+// these atoms first was seen in ppt2000 in a private Tag atom
+#define PPT_PST_ExtendedParagraphAtom 4012
+#define PPT_PST_ExtendedParagraphMasterAtom 4013
+#define PPT_PST_ExtendedPresRuleContainer 4014 // consist of 4012, 4015,
+#define PPT_PST_ExtendedParagraphHeaderAtom 4015 // the instance of this atom indices the current presobj
+ // the first sal_uInt32 in this atom indices the current slideId
+#define PPT_PST_NewlyAddedAtom4016 4016
+
+#define PPT_PST_FontEntityAtom 4023
+#define PPT_PST_FontEmbedData 4024
+#define PPT_PST_TypeFace 4025
+#define PPT_PST_CString 4026
+#define PPT_PST_ExternalObject 4027
+#define PPT_PST_MetaFile 4033
+#define PPT_PST_ExOleObj 4034
+#define PPT_PST_ExOleObjAtom 4035
+#define PPT_PST_ExPlainLinkAtom 4036
+#define PPT_PST_CorePict 4037
+#define PPT_PST_CorePictAtom 4038
+#define PPT_PST_ExPlainAtom 4039
+#define PPT_PST_SrKinsoku 4040
+#define PPT_PST_Handout 4041
+#define PPT_PST_ExEmbed 4044
+#define PPT_PST_ExEmbedAtom 4045
+#define PPT_PST_ExLink 4046
+#define PPT_PST_ExLinkAtom_old 4047
+#define PPT_PST_BookmarkEntityAtom 4048
+#define PPT_PST_ExLinkAtom 4049
+#define PPT_PST_SrKinsokuAtom 4050
+#define PPT_PST_ExHyperlinkAtom 4051
+#define PPT_PST_ExPlain 4053
+#define PPT_PST_ExPlainLink 4054
+#define PPT_PST_ExHyperlink 4055
+#define PPT_PST_SlideNumberMCAtom 4056
+#define PPT_PST_HeadersFooters 4057
+#define PPT_PST_HeadersFootersAtom 4058
+#define PPT_PST_RecolorEntryAtom 4062
+#define PPT_PST_TxInteractiveInfoAtom 4063
+#define PPT_PST_EmFormatAtom 4065
+#define PPT_PST_CharFormatAtom 4066
+#define PPT_PST_ParaFormatAtom 4067
+#define PPT_PST_MasterText 4068
+#define PPT_PST_RecolorInfoAtom 4071
+#define PPT_PST_ExQuickTime 4073
+#define PPT_PST_ExQuickTimeMovie 4074
+#define PPT_PST_ExQuickTimeMovieData 4075
+#define PPT_PST_ExSubscription 4076
+#define PPT_PST_ExSubscriptionSection 4077
+#define PPT_PST_ExControl 4078
+#define PPT_PST_ExControlAtom 4091
+#define PPT_PST_SlideListWithText 4080
+#define PPT_PST_AnimationInfoAtom 4081
+#define PPT_PST_InteractiveInfo 4082
+#define PPT_PST_InteractiveInfoAtom 4083
+#define PPT_PST_SlideList 4084
+#define PPT_PST_UserEditAtom 4085
+#define PPT_PST_CurrentUserAtom 4086
+#define PPT_PST_DateTimeMCAtom 4087
+#define PPT_PST_GenericDateMCAtom 4088
+#define PPT_PST_HeaderMCAtom 4089
+#define PPT_PST_FooterMCAtom 4090
+#define PPT_PST_ExMediaAtom 4100
+#define PPT_PST_ExVideo 4101
+#define PPT_PST_ExAviMovie 4102
+#define PPT_PST_ExMCIMovie 4103
+#define PPT_PST_ExMIDIAudio 4109
+#define PPT_PST_ExCDAudio 4110
+#define PPT_PST_ExWAVAudioEmbedded 4111
+#define PPT_PST_ExWAVAudioLink 4112
+#define PPT_PST_ExOleObjStg 4113
+#define PPT_PST_ExCDAudioAtom 4114
+#define PPT_PST_ExWAVAudioEmbeddedAtom 4115
+#define PPT_PST_AnimationInfo 4116
+#define PPT_PST_RTFDateTimeMCAtom 4117
+#define PPT_PST_ProgTags 5000
+#define PPT_PST_ProgStringTag 5001
+#define PPT_PST_ProgBinaryTag 5002
+#define PPT_PST_BinaryTagData 5003
+#define PPT_PST_PrintOptions 6000
+#define PPT_PST_PersistPtrFullBlock 6001
+#define PPT_PST_PersistPtrIncrementalBlock 6002
+
+// these atoms first was seen in ppt2000 in a private Tag atom
+#define PPT_PST_NewlyAddedAtomByPPT2000_6010 6010
+#define PPT_PST_NewlyAddedAtomByPPT2000_6011 6011
+
+#define PPT_PST_RulerIndentAtom 10000
+#define PPT_PST_GscalingAtom 10001
+#define PPT_PST_GrColorAtom 10002
+#define PPT_PST_GLPointAtom 10003
+#define PPT_PST_GlineAtom 10004
+
+#define PPT_PST_NewlyAddedAtomByXP11008 11008
+#define PPT_PST_NewlyAddedAtomByXP11010 11010
+#define PPT_PST_Comment10 12000
+#define PPT_PST_CommentAtom10 12001
+#define PPT_PST_NewlyAddedAtomByXP12004 12004
+#define PPT_PST_NewlyAddedAtomByXP12010 12010
+#define PPT_PST_NewlyAddedAtomByXP12011 12011
+#define PPT_PST_NewlyAddedAtomByXP14001 14001
+
+// Attribute fuer PptTextStyleSheet
+#define PPT_ParaAttr_BulletOn 0 //00000001
+#define PPT_ParaAttr_BuHardFont 1 //00000002
+#define PPT_ParaAttr_BuHardColor 2 //00000004
+#define PPT_ParaAttr_BuHardHeight 3 //00000008
+#define PPT_ParaAttr_BulletFont 4 //00000010
+#define PPT_ParaAttr_BulletColor 5 //00000020
+#define PPT_ParaAttr_BulletHeight 6 //00000040
+#define PPT_ParaAttr_BulletChar 7 //00000080
+
+#define PPT_ParaAttr_DontKnow1 8 //00000100
+#define PPT_ParaAttr_DontKnow2 9 //00000200
+#define PPT_ParaAttr_DontKnow3 10 //00000400
+#define PPT_ParaAttr_Adjust 11 //00000800 0000=Left, 0001=Center, 0002=Right, 0003=Block
+
+#define PPT_ParaAttr_LineFeed 12 //00001000
+#define PPT_ParaAttr_UpperDist 13 //00002000 ist bei Textframes default immer auf 0032 gesetzt
+#define PPT_ParaAttr_LowerDist 14 //00004000
+#define PPT_ParaAttr_TextOfs 15 //00008000
+
+#define PPT_ParaAttr_BulletOfs 16 //00010000
+#define PPT_ParaAttr_DefaultTab 17 //00020000
+#define PPT_ParaAttr_AsianLB_1 18
+#define PPT_ParaAttr_AsianLB_2 19
+#define PPT_ParaAttr_AsianLB_3 20
+#define PPT_ParaAttr_BiDi 21 //00200000
+
+#define PPT_CharAttr_Bold 0 //00000001
+#define PPT_CharAttr_Italic 1 //00000002
+#define PPT_CharAttr_Underline 2 //00000004
+#define PPT_CharAttr_Shadow 4 //00000010
+#define PPT_CharAttr_Strikeout 8 //00000100
+#define PPT_CharAttr_Embossed 9 //00000200
+#define PPT_CharAttr_ResetNumbering 10 //00000400
+#define PPT_CharAttr_EnableNumbering1 11 //00000800
+#define PPT_CharAttr_EnableNumbering2 12 //00001000
+#define PPT_CharAttr_Font 16 //00010000
+#define PPT_CharAttr_AsianOrComplexFont 21 //00200000
+#define PPT_CharAttr_ANSITypeface 22 //00400000
+#define PPT_CharAttr_Symbol 23 //00800000
+#define PPT_CharAttr_FontHeight 17 //00020000
+#define PPT_CharAttr_FontColor 18 //00040000
+#define PPT_CharAttr_Escapement 19 //00080000
+
+// Werte fuer PptSlideLayoutAtom.eLayout
+#define PPT_LAYOUT_TITLESLIDE 0 // The slide is a title slide
+#define PPT_LAYOUT_TITLEANDBODYSLIDE 1 // Title and body slide
+#define PPT_LAYOUT_TITLEMASTERSLIDE 2 // Title master slide
+#define PPT_LAYOUT_MASTERSLIDE 3 // Master slide layout
+#define PPT_LAYOUT_MASTERNOTES 4 // Master notes layout
+#define PPT_LAYOUT_NOTESTITLEBODY 5 // Notes title/body layout
+#define PPT_LAYOUT_HANDOUTLAYOUT 6 // Handout layout, therefore it doesn't have placeholders except header, footer, and date
+#define PPT_LAYOUT_ONLYTITLE 7 // Only title placeholder
+#define PPT_LAYOUT_2COLUMNSANDTITLE 8 // Body of the slide has 2 columns and a title
+#define PPT_LAYOUT_2ROWSANDTITLE 9 // Slide's body has 2 rows and a title
+#define PPT_LAYOUT_RIGHTCOLUMN2ROWS 10 // Body contains 2 columns, right column has 2 rows
+#define PPT_LAYOUT_LEFTCOLUMN2ROWS 11 // Body contains 2 columns, left column has 2 rows
+#define PPT_LAYOUT_BOTTOMROW2COLUMNS 12 // Body contains 2 rows, bottom row has 2 columns
+#define PPT_LAYOUT_TOPROW2COLUMN 13 // Body contains 2 rows, top row has 2 columns
+#define PPT_LAYOUT_4OBJECTS 14 // 4 objects
+#define PPT_LAYOUT_BIGOBJECT 15 // Big object
+#define PPT_LAYOUT_BLANCSLIDE 16 // Blank slide
+#define PPT_LAYOUT_TITLERIGHTBODYLEFT 17 // Vertical title on the right, body on the left
+#define PPT_LAYOUT_TITLERIGHT2BODIESLEFT 18 // Vertical title on the right, body on the left split into 2 rows
+
+// the following table describes the placeholder id's (values from reality followed by values taken from the documentation)
+#define PPT_PLACEHOLDER_NONE 0 // 0 None
+#define PPT_PLACEHOLDER_MASTERTITLE 1 // 1 Master title
+#define PPT_PLACEHOLDER_MASTERBODY 2 // 2 Master body
+#define PPT_PLACEHOLDER_MASTERCENTEREDTITLE 3 // 3 Master centered title
+#define PPT_PLACEHOLDER_MASTERSUBTITLE 4 // 10 Master subtitle
+#define PPT_PLACEHOLDER_MASTERNOTESSLIDEIMAGE 5 // 4 Master notes slide image
+#define PPT_PLACEHOLDER_MASTERNOTESBODYIMAGE 6 // 5 Master notes body image
+#define PPT_PLACEHOLDER_MASTERDATE 7 // 6 Master date
+#define PPT_PLACEHOLDER_MASTERSLIDENUMBER 8 // 7 Master slide number
+#define PPT_PLACEHOLDER_MASTERFOOTER 9 // 8 Master footer
+#define PPT_PLACEHOLDER_MASTERHEADER 10 // 9 Master header
+#define PPT_PLACEHOLDER_GENERICTEXTOBJECT // 11 Generic text object
+#define PPT_PLACEHOLDER_TITLE 13 // 12 Title
+#define PPT_PLACEHOLDER_BODY 14 // 13 Body
+#define PPT_PLACEHOLDER_NOTESBODY 12 // 14 Notes body
+#define PPT_PLACEHOLDER_CENTEREDTITLE 15 // 15 Centered title
+#define PPT_PLACEHOLDER_SUBTITLE 16 // 16 Subtitle
+#define PPT_PLACEHOLDER_VERTICALTEXTTITLE 17 // 17 Vertical text title
+#define PPT_PLACEHOLDER_VERTICALTEXTBODY 18 // 18 Vertical text body
+#define PPT_PLACEHOLDER_NOTESSLIDEIMAGE 11 // 19 Notes slide image
+#define PPT_PLACEHOLDER_OBJECT 19 // 20 Object (no matter the size)
+#define PPT_PLACEHOLDER_GRAPH 20 // 21 Graph
+#define PPT_PLACEHOLDER_TABLE 21 // 22 Table
+#define PPT_PLACEHOLDER_CLIPART 22 // 23 Clip Art
+#define PPT_PLACEHOLDER_ORGANISZATIONCHART 23 // 24 Organization Chart
+#define PPT_PLACEHOLDER_MEDIACLIP 24 // 25 Media Clip
+
+#endif //_SVDFPPT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/inc/filter/msfilter/svxmsbas.hxx b/filter/inc/filter/msfilter/svxmsbas.hxx
new file mode 100644
index 000000000000..e2aa7345804c
--- /dev/null
+++ b/filter/inc/filter/msfilter/svxmsbas.hxx
@@ -0,0 +1,116 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SVXMSBAS_HXX
+#define _SVXMSBAS_HXX
+
+#include <tools/solar.h>
+#include "filter/msfilter/msfilterdllapi.h"
+
+#include <sot/storage.hxx>
+#include <map>
+#include <boost/unordered_map.hpp>
+
+class SfxObjectShell;
+
+/* Construct with the root storage of the MS document, with bImportCode
+ * set the visual basic code will be imported into the stardocument when Import
+ * is called, with bCopyStorage set, the visual basic storage tree will be
+ * copied completely into staroffice, so that any future export to a msoffice
+ * format will retain the vba code, allowing a lossless roundtrip from
+ * msoffice to staroffice and back.
+ *
+ * Setting bAsComment to true in Import will import the visual basic as a
+ * starbasic comment. Which is currently necessary, as vb is not valid sb.
+ *
+ * Setting bStripped will remove the "Attribute" lines from the vb, msoffice
+ * does this itself when it shows the vb code in the vbeditor, so this is
+ * probably what the user expects to see when viewing the code
+ */
+
+typedef boost::unordered_map< sal_Int32, String > ObjIdToName;
+
+typedef std::map< String, ObjIdToName > ControlAttributeInfo;
+
+class VBA_Impl;
+
+class MSFILTER_DLLPUBLIC SvxImportMSVBasic
+{
+public:
+ SvxImportMSVBasic( SfxObjectShell &rDocS, SotStorage &rRoot,
+ sal_Bool bImportCode = sal_True, sal_Bool bCopyStorage = sal_True )
+ : xRoot(&rRoot), rDocSh(rDocS),
+ bImport(bImportCode), bCopy(bCopyStorage)
+ {}
+ // returns the status of import:
+ // 0 - nothing has done
+ // bit 0 = 1 -> any code is imported to the SO-Basic
+ // bit 1 = 1 -> the VBA - storage is copy to the ObjectShell storage
+ int Import( const String& rStorageName, const String &rSubStorageName,
+ sal_Bool bAsComment=sal_True, sal_Bool bStripped=sal_True );
+ int Import( const String& rStorageName, const String &rSubStorageName,
+ const std::vector< String >& codeNames,
+ sal_Bool bAsComment=sal_True, sal_Bool bStripped=sal_True );
+
+ // only for the export - copy or delete the saved VBA-macro-storage
+ // form the ObjectShell
+ // - returns a warning code if a modified basic exist, in all other
+ // cases return ERRCODE_NONE.
+ sal_uLong SaveOrDelMSVBAStorage( sal_Bool bSaveInto, const String& rStorageName );
+
+ // check if the MS-VBA-Storage exist in the RootStorage of the DocShell.
+ // If it exist, then return the WarningId for loosing the information.
+ static sal_uLong GetSaveWarningOfMSVBAStorage( SfxObjectShell &rDocS );
+ const ControlAttributeInfo& ControlNameForObjectId(){ return m_ModuleNameToObjIdHash; }
+
+ static String GetMSBasicStorageName();
+ rtl::OUString GetVBAProjectName() { return msProjectName; }
+private:
+ SotStorageRef xRoot;
+ SfxObjectShell &rDocSh;
+ sal_Bool bImport;
+ sal_Bool bCopy;
+ ControlAttributeInfo m_ModuleNameToObjIdHash;
+ MSFILTER_DLLPRIVATE void extractAttribute( const String& rAttribute, const String& rModName );
+
+ MSFILTER_DLLPRIVATE sal_Bool ImportCode_Impl( const String& rStorageName,
+ const String &rSubStorageName,
+ const std::vector< String >& codeNames,
+ sal_Bool bAsComment, sal_Bool bStripped);
+ MSFILTER_DLLPRIVATE bool ImportForms_Impl(const String& rStorageName,
+ const String &rSubStorageName, sal_Bool bVBAMode);
+ MSFILTER_DLLPRIVATE sal_Bool CopyStorage_Impl( const String& rStorageName,
+ const String &rSubStorageName);
+ rtl::OUString msProjectName;
+ MSFILTER_DLLPRIVATE sal_Bool ImportCode_Impl( VBA_Impl&, const std::vector< String >&, sal_Bool, sal_Bool );
+ MSFILTER_DLLPRIVATE bool ImportForms_Impl( VBA_Impl&, const String&, const String&, sal_Bool);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/inc/makefile.mk b/filter/inc/makefile.mk
new file mode 100644
index 000000000000..ae44f91ba667
--- /dev/null
+++ b/filter/inc/makefile.mk
@@ -0,0 +1,47 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+PRJ=..
+
+PRJNAME=filter
+TARGET=inc
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+# --- Files --------------------------------------------------------
+# --- Targets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
+.IF "$(ENABLE_PCH)"!=""
+ALLTAR : \
+ $(SLO)$/precompiled.pch \
+ $(SLO)$/precompiled_ex.pch
+
+.ENDIF # "$(ENABLE_PCH)"!=""
+
diff --git a/filter/inc/pch/precompiled_filter.cxx b/filter/inc/pch/precompiled_filter.cxx
new file mode 100644
index 000000000000..de777b5e512d
--- /dev/null
+++ b/filter/inc/pch/precompiled_filter.cxx
@@ -0,0 +1,31 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_filter.hxx"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/inc/pch/precompiled_filter.hxx b/filter/inc/pch/precompiled_filter.hxx
new file mode 100644
index 000000000000..ea496150e83e
--- /dev/null
+++ b/filter/inc/pch/precompiled_filter.hxx
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): Generated on 2006-09-01 17:49:41.780248
+
+#ifdef PRECOMPILED_HEADERS
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/inc/registration.hxx b/filter/inc/registration.hxx
new file mode 100644
index 000000000000..8c46eaa52b35
--- /dev/null
+++ b/filter/inc/registration.hxx
@@ -0,0 +1,124 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef __COMPHELPER_REGISTRATION_HXX_
+#define __COMPHELPER_REGISTRATION_HXX_
+
+//_______________________________________________
+// includes
+
+#include <com/sun/star/lang/XSingleServiceFactory.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <rtl/ustrbuf.hxx>
+#include <cppuhelper/factory.hxx>
+
+//_______________________________________________
+// namespace
+
+namespace comphelper{
+
+//_______________________________________________
+// declaration
+
+//_______________________________________________
+
+/** TODO doc
+ */
+#define _COMPHELPER_COMPONENT_GETIMPLEMENTATIONENVIRONMENT \
+ extern "C" void SAL_CALL component_getImplementationEnvironment(const sal_Char** ppEnvironmentTypeName, \
+ uno_Environment** /* ppEnvironment */ ) \
+ { \
+ *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; \
+ }
+
+//_______________________________________________
+
+/** TODO doc
+ */
+#define _COMPHELPER_MULTIINSTANCEFACTORY(IMPLEMENTATIONNAME, SERVICENAMES, FACTORYMETHOD) \
+ if (IMPLEMENTATIONNAME == sImplName) \
+ xFactory = ::cppu::createSingleFactory(xSMGR , \
+ IMPLEMENTATIONNAME, \
+ FACTORYMETHOD , \
+ SERVICENAMES );
+
+//_______________________________________________
+
+/** TODO doc
+ */
+#define _COMPHELPER_ONEINSTANCEFACTORY(IMPLEMENTATIONNAME, SERVICENAMES, FACTORYMETHOD) \
+ if (IMPLEMENTATIONNAME == sImplName) \
+ xFactory = ::cppu::createOneInstanceFactory(xSMGR , \
+ IMPLEMENTATIONNAME, \
+ FACTORYMETHOD , \
+ SERVICENAMES );
+
+//_______________________________________________
+
+/** TODO doc
+ */
+#define _COMPHELPER_COMPONENT_GETFACTORY(STATIC_INIT,FACTORYLIST) \
+ extern "C" void* SAL_CALL component_getFactory(const sal_Char* pImplementationName, \
+ void* pServiceManager , \
+ void* /* pRegistryKey */ ) \
+ { \
+ if ( \
+ (!pImplementationName) || \
+ (!pServiceManager ) \
+ ) \
+ return NULL; \
+ \
+ STATIC_INIT \
+ \
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMGR = reinterpret_cast< ::com::sun::star::lang::XMultiServiceFactory* >(pServiceManager); \
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > xFactory ; \
+ rtl::OUString sImplName = ::rtl::OUString::createFromAscii(pImplementationName); \
+ \
+ /* This parameter will expand to: */ \
+ /* _COMPHELPER_xxxFACTORY(1) */ \
+ /* else */ \
+ /* ... */ \
+ /* else */ \
+ /* _COMPHELPER_xxxFACTORY(n) */ \
+ FACTORYLIST \
+ \
+ /* And if one of these checks was successfully => xFactory was set! */ \
+ if (xFactory.is()) \
+ { \
+ xFactory->acquire(); \
+ return xFactory.get(); \
+ } \
+ \
+ return NULL; \
+ }
+
+} // namespace comphelper
+
+#endif // #ifndef __COMPHELPER_REGISTRATION_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */