[ooo-build-commit] Branch 'ooo/master' - 10 commits - connectivity/source framework/source linguistic/inc linguistic/source officecfg/registry sfx2/inc sfx2/source sj2/source svx/inc svx/source xmloff/inc xmloff/source
Jan Holesovsky
kendy at kemper.freedesktop.org
Thu May 28 18:03:39 PDT 2009
connectivity/source/parse/sqlflex.l | 6
framework/source/uielement/menubarmanager.cxx | 26
linguistic/inc/lngprophelp.hxx | 291
linguistic/inc/misc.hxx | 22
linguistic/inc/prophelp.hxx | 294
linguistic/source/iprcache.cxx | 1
linguistic/source/lngopt.cxx | 7
linguistic/source/lngprophelp.cxx | 720 +
linguistic/source/lngsvcmgr.cxx | 12
linguistic/source/makefile.mk | 2
linguistic/source/misc.cxx | 68
linguistic/source/prophelp.cxx | 734 -
linguistic/source/spelldsp.cxx | 164
linguistic/source/spelldta.cxx | 4
officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu | 2
officecfg/registry/schema/org/openoffice/Office/Math.xcs | 2
sfx2/inc/sfx2/evntconf.hxx | 2
sfx2/source/config/evntconf.cxx | 23
sj2/source/jscpp/sjapplet_impl.cxx | 37
svx/inc/svx/msdffdef.hxx | 8
svx/inc/svx/msdffimp.hxx | 23
svx/inc/svx/outliner.hxx | 11
svx/source/cui/optgdlg.cxx | 2
svx/source/editeng/edtspell.cxx | 5
svx/source/form/formcontrolling.cxx | 1216 -
svx/source/inc/formcontrolling.hxx | 622
svx/source/msfilter/makefile.mk | 3
svx/source/msfilter/msashape.cxx | 6536 ----------
svx/source/msfilter/msashape.hxx | 116
svx/source/msfilter/msashape3d.cxx | 564
svx/source/msfilter/msashape3d.hxx | 83
svx/source/msfilter/msdffimp.cxx | 1117 -
svx/source/outliner/outliner.cxx | 10
svx/source/outliner/outlobj.cxx | 2
svx/source/svdraw/svddrgv.cxx | 14
svx/source/svdraw/svdfppt.cxx | 15
svx/source/svdraw/svdoole2.cxx | 84
svx/source/table/cell.cxx | 58
svx/source/table/cell.hxx | 11
svx/source/table/svdotable.cxx | 2
svx/source/table/tablecontroller.cxx | 2
xmloff/inc/xmloff/xmlexp.hxx | 3
xmloff/inc/xmloff/xmltoken.hxx | 7
xmloff/source/chart/PropertyMap.hxx | 1
xmloff/source/chart/SchXMLChartContext.cxx | 8
xmloff/source/chart/SchXMLExport.cxx | 62
xmloff/source/chart/SchXMLTableContext.cxx | 166
xmloff/source/chart/transporttypes.hxx | 2
xmloff/source/core/nmspmap.cxx | 15
xmloff/source/core/xmlexp.cxx | 4
xmloff/source/core/xmltoken.cxx | 6
xmloff/source/draw/sdxmlexp.cxx | 49
xmloff/source/draw/ximpstyl.cxx | 25
53 files changed, 3280 insertions(+), 9989 deletions(-)
New commits:
commit a509d2ac360989ed2cb87539f66fb7d9cf69d055
Author: Kurt Zenker <kz at openoffice.org>
Date: Thu May 28 16:03:55 2009 +0000
CWS-TOOLING: integrate CWS ause101
2009-05-11 14:39:16 +0200 hjs r271770 : #i101204# more selective copy
2009-05-07 19:16:08 +0200 hjs r271693 : #i101651# embed windows manifest
2009-05-07 18:43:17 +0200 hjs r271692 : #i101650# fix CHECKZIPRESULT for bash
2009-05-07 18:25:43 +0200 hjs r271690 : #i101649# workaround warnings in generated code
diff --git a/connectivity/source/parse/sqlflex.l b/connectivity/source/parse/sqlflex.l
index 7263652..8004276 100644
--- a/connectivity/source/parse/sqlflex.l
+++ b/connectivity/source/parse/sqlflex.l
@@ -70,6 +70,12 @@
#pragma disable_warn
#elif defined _MSC_VER
#pragma warning(push, 1)
+/**/
+#ifdef yywrap
+#undef yywrap
+#define yywrap() 1
+#endif
+/**/
#endif
using namespace connectivity;
commit 89c8ec1b8e128115852ec9a504bdd0ee209677c6
Author: Jens-Heiner Rechtien <hr at openoffice.org>
Date: Mon May 25 13:05:01 2009 +0000
#i10000#: partly undo changes from canvascrairo01 (build problems due to redifinition of HINSTANCE)
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index 6944aca..07b68c0 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -101,12 +101,15 @@
#include <uielement/menubarmerger.hxx>
#include <dispatch/uieventloghelper.hxx>
-#ifdef WNT
-#include <tools/prewin.h>
-#include <windows.h>
-#include <tools/postwin.h>
-#endif
-#include <vcl/sysdata.hxx>
+// Be careful removing this "bad" construct. There are serious problems
+// with #define STRICT and including windows.h. Changing this needs some
+// redesign on other projects, too. Especially sal/main.h which defines
+// HINSTANCE depending on STRCIT!!!!!!!!!!!!!!!
+struct SystemMenuData
+{
+ unsigned long nSize;
+ long hMenu;
+};
//_________________________________________________________________________________________________________________
// namespace
commit 8a10230d87ce7ea442e5a8415bb87074ce4c760b
Author: Jens-Heiner Rechtien <hr at openoffice.org>
Date: Wed May 20 15:16:13 2009 +0000
#i10000#,#i102100#: fix broken merge cause by CRLF
diff --git a/svx/source/msfilter/msdffimp.cxx b/svx/source/msfilter/msdffimp.cxx
index e69de29..554a185 100644
--- a/svx/source/msfilter/msdffimp.cxx
+++ b/svx/source/msfilter/msdffimp.cxx
@@ -0,0 +1,8123 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: msdffimp.cxx,v $
+ * $Revision: 1.157 $
+ *
+ * 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): autogen include statement, do not remove
+#include "precompiled_svx.hxx"
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
+#include <com/sun/star/embed/Aspects.hpp>
+
+#include <math.h>
+#include <limits.h>
+#include <vector>
+#include <osl/endian.h>
+#include <tools/solar.h> // UINTXX
+#include <rtl/math.hxx>
+
+#include <sot/clsids.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
+#include <unotools/streamwrap.hxx>
+#include <comphelper/processfactory.hxx>
+#include <sot/exchange.hxx>
+#include <sot/storinfo.hxx>
+#include <vcl/cvtgrf.hxx>
+
+#include "viscache.hxx"
+
+// SvxItem-Mapping. Wird benoetigt um die SvxItem-Header erfolgreich zu includen
+#include <svx/eeitem.hxx>
+#ifndef _EDITDATA_HXX
+#include <svx/editdata.hxx>
+#endif
+
+#include <svtools/urihelper.hxx>
+
+// textitem.hxx editdata.hxx
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// paraitem.hxx editdata.hxx
+
+
+#include <tools/stream.hxx>
+#include <tools/debug.hxx>
+#ifndef _TOOLS_ZCODEC_HXX
+#include <tools/zcodec.hxx>
+#endif
+#ifndef _UNOTOOLS_UCBSTREAMHELPER_HXX
+#include <unotools/ucbstreamhelper.hxx>
+#endif
+#include <unotools/localfilehelper.hxx>
+#include <svx/escherex.hxx>
+#include <basegfx/range/b2drange.hxx>
+#include <com/sun/star/container/XIdentifierContainer.hpp>
+#include <com/sun/star/drawing/XGluePointsSupplier.hpp>
+#include <com/sun/star/drawing/Position3D.hpp>
+#include <com/sun/star/drawing/Direction3D.hpp>
+#include <com/sun/star/drawing/GluePoint2.hpp>
+#include <com/sun/star/drawing/XShapes.hpp>
+#include <svx/charscaleitem.hxx>
+#include <svx/kernitem.hxx>
+#include <svtools/filter.hxx>
+#include <tools/string.hxx>
+#ifndef _TOOLS_URLOBJ_HXX
+#include <tools/urlobj.hxx>
+#endif
+#include <vcl/virdev.hxx>
+#include <vcl/bmpacc.hxx>
+#ifndef _SVSTOR_HXX //autogen
+#include <sot/storage.hxx>
+#endif
+#include <sfx2/docfac.hxx>
+#include <sfx2/docfilt.hxx>
+#include <sfx2/docfile.hxx>
+#include <sfx2/fcontnr.hxx>
+#include <sfx2/module.hxx>
+//#ifndef _SFX_INTERNO_HXX
+//#include <sfx2/interno.hxx>
+//#endif
+
+#ifndef _SDGCPITM_HXX
+
+//#endif
+#include <svx/sdgcpitm.hxx>
+#endif
+#include <svx/sdgmoitm.hxx>
+#include <svx/tstpitem.hxx>
+#include <svx/fmmodel.hxx>
+#include <svx/svdmodel.hxx>
+#include <svx/svdobj.hxx>
+#include <svx/svdpage.hxx>
+#include <svx/svdogrp.hxx>
+#include <svx/svdograf.hxx>
+#include <svx/svdotext.hxx>
+#include <svx/svdorect.hxx>
+#ifndef _SVDOCAPT_HXX
+#include <svx/svdocapt.hxx>
+#endif
+#include <svx/svdoedge.hxx>
+#include <svx/svdocirc.hxx>
+#include <svx/svdoutl.hxx>
+#include <svx/svdoole2.hxx>
+#include <svx/svdopath.hxx>
+#include <svx/frmdir.hxx>
+#include <svx/frmdiritem.hxx>
+#include <svx/svdtrans.hxx>
+#include <svx/sxenditm.hxx>
+#include <svx/sdgluitm.hxx>
+#include <svx/fhgtitem.hxx>
+#include <svx/wghtitem.hxx>
+#include <svx/postitem.hxx>
+#include <svx/udlnitem.hxx>
+#include <svx/crsditem.hxx>
+#include <svx/shdditem.hxx>
+#include <fontitem.hxx>
+#include <svx/colritem.hxx>
+#include <svx/sxekitm.hxx>
+#include <bulitem.hxx>
+#include <svx/polysc3d.hxx>
+#include <svx/extrud3d.hxx>
+#include "svditer.hxx"
+#include <svx/xpoly.hxx>
+#include "xattr.hxx"
+
+#ifndef _IMPGRF_HXX //autogen
+#include "impgrf.hxx"
+#endif
+#include <svx/msdffimp.hxx> // extern sichtbare Header-Datei
+#include <svx/outliner.hxx>
+#include <svx/outlobj.hxx>
+#include <svx/editobj.hxx>
+#include <svx/editeng.hxx>
+#include "gallery.hxx"
+#include <com/sun/star/drawing/ShadeMode.hpp>
+#include <svtools/itempool.hxx>
+#include <vcl/svapp.hxx>
+#include <svx/svx3ditems.hxx>
+#include <svx/svdoashp.hxx>
+#include <svx/sdasaitm.hxx>
+#ifndef _UCBHELPER_CONTENT_HXX_
+#include <ucbhelper/content.hxx>
+#endif
+#ifndef _UCBHELPER_CONTENTBROKER_HXX_
+#include <ucbhelper/contentbroker.hxx>
+#endif
+#include <vos/xception.hxx>
+#ifndef _VOS_NO_NAMESPACE
+using namespace vos;
+#endif
+#include "../customshapes/EnhancedCustomShapeTypeNames.hxx"
+#include "../customshapes/EnhancedCustomShapeGeometry.hxx"
+#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
+#include <com/sun/star/drawing/EnhancedCustomShapeParameterType.hpp>
+#include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp>
+#include <com/sun/star/drawing/EnhancedCustomShapeGluePointType.hpp>
+#include <com/sun/star/drawing/EnhancedCustomShapeSegmentCommand.hpp>
+#include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp>
+#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
+#include <com/sun/star/drawing/EnhancedCustomShapeTextPathMode.hpp>
+#ifndef __com_sun_star_beans_PropertyValues_hpp__
+#include <com/sun/star/beans/PropertyValues.hpp>
+#endif
+#include <com/sun/star/drawing/ProjectionMode.hpp>
+#include "../customshapes/EnhancedCustomShape2d.hxx"
+
+using namespace ::com::sun::star ;
+using namespace ::com::sun::star::drawing;
+using namespace uno ;
+using namespace beans ;
+using namespace drawing ;
+using namespace container ;
+
+#define ITEMVALUE(ItemSet,Id,Cast) ((const Cast&)(ItemSet).Get(Id)).GetValue()
+
+// static counter for OLE-Objects
+static sal_uInt32 nMSOleObjCntr = 0;
+#define MSO_OLE_Obj "MSO_OLE_Obj"
+
+
+/*************************************************************************/
+BOOL Impl_OlePres::Read( SvStream & rStm )
+{
+ ULONG nBeginPos = rStm.Tell();
+ INT32 n;
+ rStm >> n;
+ if( n != -1 )
+ {
+ pBmp = new Bitmap;
+ rStm >> *pBmp;
+ if( rStm.GetError() == SVSTREAM_OK )
+ {
+ nFormat = FORMAT_BITMAP;
+ aSize = pBmp->GetPrefSize();
+ MapMode aMMSrc;
+ if( !aSize.Width() || !aSize.Height() )
+ {
+ // letzte Chance
+ aSize = pBmp->GetSizePixel();
+ aMMSrc = MAP_PIXEL;
+ }
+ else
+ aMMSrc = pBmp->GetPrefMapMode();
+ MapMode aMMDst( MAP_100TH_MM );
+ aSize = OutputDevice::LogicToLogic( aSize, aMMSrc, aMMDst );
+ return TRUE;
+ }
+ else
+ {
+ delete pBmp;
+ pBmp = NULL;
+
+ pMtf = new GDIMetaFile();
+ rStm.ResetError();
+ rStm >> *pMtf;
+ if( rStm.GetError() == SVSTREAM_OK )
+ {
+ nFormat = FORMAT_GDIMETAFILE;
+ aSize = pMtf->GetPrefSize();
+ MapMode aMMSrc = pMtf->GetPrefMapMode();
+ MapMode aMMDst( MAP_100TH_MM );
+ aSize = OutputDevice::LogicToLogic( aSize, aMMSrc, aMMDst );
+ return TRUE;
+ }
+ else
+ {
+ delete pMtf;
+ pMtf = NULL;
+ }
+ }
+
+ }
+
+ rStm.ResetError();
+ rStm.Seek( nBeginPos );
+ nFormat = ReadClipboardFormat( rStm );
+ // JobSetup, bzw. TargetDevice ueberlesen
+ // Information aufnehmen, um sie beim Schreiben nicht zu verlieren
+ nJobLen = 0;
+ rStm >> nJobLen;
+ if( nJobLen >= 4 )
+ {
+ nJobLen -= 4;
+ if( nJobLen )
+ {
+ pJob = new BYTE[ nJobLen ];
+ rStm.Read( pJob, nJobLen );
+ }
+ }
+ else
+ {
+ rStm.SetError( SVSTREAM_GENERALERROR );
+ return FALSE;
+ }
+ UINT32 nAsp;
+ rStm >> nAsp;
+ USHORT nSvAsp = USHORT( nAsp );
+ SetAspect( nSvAsp );
+ rStm.SeekRel( 4 ); //L-Index ueberlesen
+ rStm >> nAdvFlags;
+ rStm.SeekRel( 4 ); //Compression
+ UINT32 nWidth = 0;
+ UINT32 nHeight = 0;
+ UINT32 nSize = 0;
+ rStm >> nWidth >> nHeight >> nSize;
+ aSize.Width() = nWidth;
+ aSize.Height() = nHeight;
+
+ if( nFormat == FORMAT_GDIMETAFILE )
+ {
+ pMtf = new GDIMetaFile();
+ ReadWindowMetafile( rStm, *pMtf, NULL );
+ }
+ else if( nFormat == FORMAT_BITMAP )
+ {
+ pBmp = new Bitmap();
+ rStm >> *pBmp;
+ }
+ else
+ {
+ BYTE * p = new BYTE[ nSize ];
+ rStm.Read( p, nSize );
+ delete p;
+ return FALSE;
+ }
+ return TRUE;
+}
+
+/************************************************************************/
+void Impl_OlePres::Write( SvStream & rStm )
+{
+ WriteClipboardFormat( rStm, FORMAT_GDIMETAFILE );
+ rStm << (INT32)(nJobLen +4); // immer leeres TargetDevice
+ if( nJobLen )
+ rStm.Write( pJob, nJobLen );
+ rStm << (UINT32)nAspect;
+ rStm << (INT32)-1; //L-Index immer -1
+ rStm << (INT32)nAdvFlags;
+ rStm << (INT32)0; //Compression
+ rStm << (INT32)aSize.Width();
+ rStm << (INT32)aSize.Height();
+ ULONG nPos = rStm.Tell();
+ rStm << (INT32)0;
+
+ if( GetFormat() == FORMAT_GDIMETAFILE && pMtf )
+ {
+ // Immer auf 1/100 mm, bis Mtf-Loesung gefunden
+ // Annahme (keine Skalierung, keine Org-Verschiebung)
+ DBG_ASSERT( pMtf->GetPrefMapMode().GetScaleX() == Fraction( 1, 1 ),
+ "X-Skalierung im Mtf" );
+ DBG_ASSERT( pMtf->GetPrefMapMode().GetScaleY() == Fraction( 1, 1 ),
+ "Y-Skalierung im Mtf" );
+ DBG_ASSERT( pMtf->GetPrefMapMode().GetOrigin() == Point(),
+ "Origin-Verschiebung im Mtf" );
+ MapUnit nMU = pMtf->GetPrefMapMode().GetMapUnit();
+ if( MAP_100TH_MM != nMU )
+ {
+ Size aPrefS( pMtf->GetPrefSize() );
+ Size aS( aPrefS );
+ aS = OutputDevice::LogicToLogic( aS, nMU, MAP_100TH_MM );
+
+ pMtf->Scale( Fraction( aS.Width(), aPrefS.Width() ),
+ Fraction( aS.Height(), aPrefS.Height() ) );
+ pMtf->SetPrefMapMode( MAP_100TH_MM );
+ pMtf->SetPrefSize( aS );
+ }
+ WriteWindowMetafileBits( rStm, *pMtf );
+ }
+ else
+ {
+ DBG_ERROR( "unknown format" );
+ }
+ ULONG nEndPos = rStm.Tell();
+ rStm.Seek( nPos );
+ rStm << (UINT32)(nEndPos - nPos - 4);
+ rStm.Seek( nEndPos );
+}
+
+Impl_OlePres * CreateCache_Impl( SotStorage * pStor )
+{
+ SotStorageStreamRef xOleObjStm =pStor->OpenSotStream( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "Ole-Object" ) ),
+ STREAM_READ | STREAM_NOCREATE );
+ if( xOleObjStm->GetError() )
+ return NULL;
+ SotStorageRef xOleObjStor = new SotStorage( *xOleObjStm );
+ if( xOleObjStor->GetError() )
+ return NULL;
+
+ String aStreamName;
+ if( xOleObjStor->IsContained( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\002OlePres000" ) ) ) )
+ aStreamName = String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\002OlePres000" ) );
+ else if( xOleObjStor->IsContained( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\1Ole10Native" ) ) ) )
+ aStreamName = String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\1Ole10Native" ) );
+
+ if( aStreamName.Len() == 0 )
+ return NULL;
+
+
+ for( USHORT i = 1; i < 10; i++ )
+ {
+ SotStorageStreamRef xStm = xOleObjStor->OpenSotStream( aStreamName,
+ STREAM_READ | STREAM_NOCREATE );
+ if( xStm->GetError() )
+ break;
+
+ xStm->SetBufferSize( 8192 );
+ Impl_OlePres * pEle = new Impl_OlePres( 0 );
+ if( pEle->Read( *xStm ) && !xStm->GetError() )
+ {
+ if( pEle->GetFormat() == FORMAT_GDIMETAFILE || pEle->GetFormat() == FORMAT_BITMAP )
+ return pEle;
+ }
+ delete pEle;
+ aStreamName = String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\002OlePres00" ) );
+ aStreamName += String( i );
+ };
+ return NULL;
+}
+
+
+
+//---------------------------------------------------------------------------
+// Hilfs Klassen aus MSDFFDEF.HXX
+//---------------------------------------------------------------------------
+
+SvStream& operator>>( SvStream& rIn, DffRecordHeader& rRec )
+{
+ rRec.nFilePos = rIn.Tell();
+ UINT16 nTmp(0);
+ rIn >> nTmp;
+ rRec.nImpVerInst = nTmp;
+ rRec.nRecVer = sal::static_int_cast< BYTE >(nTmp & 0x000F);
+ rRec.nRecInstance = nTmp >> 4;
+ rIn >> rRec.nRecType;
+ rIn >> rRec.nRecLen;
+ return rIn;
+}
+
+// Masse fuer dashed lines
+#define LLEN_MIDDLE (450)
+#define LLEN_SPACE_MIDDLE (360)
+#define LLEN_LONG (LLEN_MIDDLE * 2)
+#define LLEN_SPACE_LONG (LLEN_SPACE_MIDDLE + 20)
+#define LLEN_POINT (LLEN_MIDDLE / 4)
+#define LLEN_SPACE_POINT (LLEN_SPACE_MIDDLE / 4)
+
+SvStream& operator>>( SvStream& rIn, DffPropSet& rRec )
+{
+ rRec.InitializePropSet();
+
+ DffRecordHeader aHd;
+ rIn >> aHd;
+ UINT32 nPropCount = aHd.nRecInstance;
+
+ // FilePos der ComplexData merken
+ UINT32 nComplexDataFilePos = rIn.Tell() + ( nPropCount * 6 );
+
+ for( UINT32 nPropNum = 0; nPropNum < nPropCount; nPropNum++ )
+ {
+ sal_uInt16 nTmp;
+ sal_uInt32 nRecType, nContent, nContentEx = 0xffff0000;
+ rIn >> nTmp
+ >> nContent;
+
+ nRecType = nTmp & 0x3fff;
+
+ if ( nRecType > 0x3ff )
+ break;
+ if ( ( nRecType & 0x3f ) == 0x3f )
+ { // clear flags that have to be cleared
+ rRec.mpContents[ nRecType ] &= ( ( nContent >> 16 ) ^ 0xffffffff );
+ // set flags that have to be set
+ rRec.mpContents[ nRecType ] |= nContent;
+ nContentEx |= ( nContent >> 16 );
+ rRec.Replace( nRecType, (void*)nContentEx );
+ }
+ else
+ {
+ DffPropFlags aPropFlag = { 1, 0, 0, 0 };
+ if ( nTmp & 0x4000 )
+ aPropFlag.bBlip = sal_True;
+ if ( nTmp & 0x8000 )
+ aPropFlag.bComplex = sal_True;
+ if ( aPropFlag.bComplex && nContent && ( nComplexDataFilePos < aHd.GetRecEndFilePos() ) )
+ {
+ // normally nContent is the complete size of the complex property,
+ // but this is not always true for IMsoArrays ( what the hell is a IMsoArray ? )
+
+ // I love special threatments :-(
+ if ( ( nRecType == DFF_Prop_pVertices ) || ( nRecType == DFF_Prop_pSegmentInfo )
+ || ( nRecType == DFF_Prop_fillShadeColors ) || ( nRecType == DFF_Prop_lineDashStyle )
+ || ( nRecType == DFF_Prop_pWrapPolygonVertices ) || ( nRecType == DFF_Prop_connectorPoints )
+ || ( nRecType == DFF_Prop_Handles ) || ( nRecType == DFF_Prop_pFormulas )
+ || ( nRecType == DFF_Prop_textRectangles ) )
+ {
+ // now check if the current content size is possible, or 6 bytes too small
+ sal_uInt32 nOldPos = rIn.Tell();
+ sal_Int16 nNumElem, nNumElemReserved, nSize;
+
+ rIn.Seek( nComplexDataFilePos );
+ rIn >> nNumElem >> nNumElemReserved >> nSize;
+ if ( nNumElemReserved >= nNumElem )
+ {
+ // the size of these array elements is nowhere defined,
+ // what if the size is negative ?
+ // ok, we will make it positive and shift it.
+ // for -16 this works
+ if ( nSize < 0 )
+ nSize = ( -nSize ) >> 2;
+ sal_uInt32 nDataSize = (sal_uInt32)( nSize * nNumElem );
+
+ // sometimes the content size is 6 bytes too small (array header information is missing )
+ if ( nDataSize == nContent )
+ nContent += 6;
+
+ // check if array fits into the PropertyContainer
+ if ( ( nComplexDataFilePos + nContent ) > aHd.GetRecEndFilePos() )
+ nContent = 0;
+ }
+ else
+ nContent = 0;
+ rIn.Seek( nOldPos );
+ }
+ if ( nContent )
+ {
+ nContentEx = nComplexDataFilePos; // insert the filepos of this property;
+ nComplexDataFilePos += nContent; // store filepos, that is used for the next complex property
+ }
+ else // a complex property needs content
+ aPropFlag.bSet = sal_False; // otherwise something is wrong
+ }
+ rRec.mpContents[ nRecType ] = nContent;
+ rRec.mpFlags[ nRecType ] = aPropFlag;
+ rRec.Insert( nRecType, (void*)nContentEx );
+ }
+ }
+ aHd.SeekToEndOfRecord( rIn );
+ return rIn;
+}
+
+void DffPropSet::InitializePropSet() const
+{
+ /*
+ cmc:
+ " Boolean properties are grouped in bitfields by property set; note that
+ the Boolean properties in each property set are contiguous. They are saved
+ under the property ID of the last Boolean property in the set, and are
+ placed in the value field in reverse order starting with the last property
+ in the low bit. "
+
+ e.g.
+
+ fEditedWrap
+ fBehindDocument
+ fOnDblClickNotify
+ fIsButton
+ fOneD
+ fHidden
+ fPrint
+
+ are all part of a group and all are by default false except for fPrint,
+ which equates to a default bit sequence for the group of 0000001 -> 0x1
+
+ If at a later stage word sets fBehindDocument away from the default it
+ will be done by having a property named fPrint whose bitsequence will have
+ the fBehindDocument bit set. e.g. a DFF_Prop_fPrint with value 0x200020
+ has set bit 6 on so as to enable fBehindDocument (as well as disabling
+ everything else)
+ */
+
+ memset( ( (DffPropSet*) this )->mpFlags, 0, 0x400 * sizeof(DffPropFlags) );
+ ( (DffPropSet*) this )->Clear();
+
+ DffPropFlags nFlags = { 1, 0, 0, 1 };
+
+ ( (DffPropSet*) this )->mpContents[ DFF_Prop_LockAgainstGrouping ] = 0x0000; //0x01ff0000;
+ ( (DffPropSet*) this )->mpFlags[ DFF_Prop_LockAgainstGrouping ] = nFlags;
+ ( (DffPropSet*) this )->Insert( DFF_Prop_LockAgainstGrouping, (void*)0xffff0000 );
+
+ ( (DffPropSet*) this )->mpContents[ DFF_Prop_FitTextToShape ] = 0x0010; //0x001f0010;
+ ( (DffPropSet*) this )->mpFlags[ DFF_Prop_FitTextToShape ] = nFlags;
+ ( (DffPropSet*) this )->Insert( DFF_Prop_FitTextToShape, (void*)0xffff0000 );
+
+ ( (DffPropSet*) this )->mpContents[ DFF_Prop_gtextFStrikethrough ] = 0x0000; //0xffff0000;
+ ( (DffPropSet*) this )->mpFlags[ DFF_Prop_gtextFStrikethrough ] = nFlags;
+ ( (DffPropSet*) this )->Insert( DFF_Prop_gtextFStrikethrough, (void*)0xffff0000 );
+
+ ( (DffPropSet*) this )->mpContents[ DFF_Prop_pictureActive ] = 0x0000; //0x000f0000;
+ ( (DffPropSet*) this )->mpFlags[ DFF_Prop_pictureActive ] = nFlags;
+ ( (DffPropSet*) this )->Insert( DFF_Prop_pictureActive, (void*)0xffff0000 );
+
+ ( (DffPropSet*) this )->mpContents[ DFF_Prop_fFillOK ] = 0x0039; //0x003f0039;
+ ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fFillOK ] = nFlags;
+ ( (DffPropSet*) this )->Insert( DFF_Prop_fFillOK, (void*)0xffff0000 );
+
+ ( (DffPropSet*) this )->mpContents[ DFF_Prop_fNoFillHitTest ] = 0x001c; //0x001f001c;
+ ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fNoFillHitTest ] = nFlags;
+ ( (DffPropSet*) this )->Insert( DFF_Prop_fNoFillHitTest, (void*)0xffff0000 );
+
+ ( (DffPropSet*) this )->mpContents[ DFF_Prop_fNoLineDrawDash ] = 0x001e; //0x001f000e;
+ ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fNoLineDrawDash ] = nFlags;
+ ( (DffPropSet*) this )->Insert( DFF_Prop_fNoLineDrawDash, (void*)0xffff0000 );
+
+ ( (DffPropSet*) this )->mpContents[ DFF_Prop_fshadowObscured ] = 0x0000; //0x00030000;
+ ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fshadowObscured ] = nFlags;
+ ( (DffPropSet*) this )->Insert( DFF_Prop_fshadowObscured, (void*)0xffff0000 );
+
+ ( (DffPropSet*) this )->mpContents[ DFF_Prop_fPerspective ] = 0x0000; //0x00010000;
+ ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fPerspective ] = nFlags;
+ ( (DffPropSet*) this )->Insert( DFF_Prop_fPerspective, (void*)0xffff0000 );
+
+ ( (DffPropSet*) this )->mpContents[ DFF_Prop_fc3DLightFace ] = 0x0001; //0x000f0001;
+ ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fc3DLightFace ] = nFlags;
+ ( (DffPropSet*) this )->Insert( DFF_Prop_fc3DLightFace, (void*)0xffff0000 );
+
+ ( (DffPropSet*) this )->mpContents[ DFF_Prop_fc3DFillHarsh ] = 0x0016; //0x001f0016;
+ ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fc3DFillHarsh ] = nFlags;
+ ( (DffPropSet*) this )->Insert( DFF_Prop_fc3DFillHarsh, (void*)0xffff0000 );
+
+ ( (DffPropSet*) this )->mpContents[ DFF_Prop_fBackground ] = 0x0000; //0x001f0000;
+ ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fBackground ] = nFlags;
+ ( (DffPropSet*) this )->Insert( DFF_Prop_fBackground, (void*)0xffff0000 );
+
+ ( (DffPropSet*) this )->mpContents[ DFF_Prop_fCalloutLengthSpecified ] = 0x0010; //0x00ef0010;
+ ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fCalloutLengthSpecified ] = nFlags;
+ ( (DffPropSet*) this )->Insert( DFF_Prop_fCalloutLengthSpecified, (void*)0xffff0000 );
+
+ ( (DffPropSet*) this )->mpContents[ DFF_Prop_fPrint ] = 0x0001; //0x00ef0001;
+ ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fPrint ] = nFlags;
+ ( (DffPropSet*) this )->Insert( DFF_Prop_fPrint, (void*)0xffff0000 );
+
+ ( (DffPropSet*) this )->mpContents[ DFF_Prop_fillColor ] = 0xffffff;
+ ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fillColor ] = nFlags;
+ ( (DffPropSet*) this )->Insert( DFF_Prop_fillColor, (void*)0xffff0000 );
+}
+
+void DffPropSet::Merge( DffPropSet& rMaster ) const
+{
+ for ( void* pDummy = rMaster.First(); pDummy; pDummy = rMaster.Next() )
+ {
+ UINT32 nRecType = rMaster.GetCurKey();
+ if ( ( nRecType & 0x3f ) == 0x3f ) // this is something called FLAGS
+ {
+ UINT32 nCurrentFlags = mpContents[ nRecType ];
+ UINT32 nMergeFlags = rMaster.mpContents[ nRecType ];
+ nMergeFlags &= ( nMergeFlags >> 16 ) | 0xffff0000; // clearing low word
+ nMergeFlags &= ( ( nCurrentFlags & 0xffff0000 ) // remove allready hard set
+ | ( nCurrentFlags >> 16 ) ) ^ 0xffffffff; // attributes from mergeflags
+ nCurrentFlags &= ( ( nMergeFlags & 0xffff0000 ) // apply zero master bits
+ | ( nMergeFlags >> 16 ) ) ^ 0xffffffff;
+ nCurrentFlags |= (UINT16)nMergeFlags; // apply filled master bits
+ ( (DffPropSet*) this )->mpContents[ nRecType ] = nCurrentFlags;
+
+
+ sal_uInt32 nNewContentEx = (sal_uInt32)(sal_uIntPtr)rMaster.GetCurObject();
+ if ( ((DffPropSet*)this)->Seek( nRecType ) )
+ nNewContentEx |= (sal_uInt32)(sal_uIntPtr)GetCurObject();
+ ( (DffPropSet*) this )->Replace( nRecType, (void*)nNewContentEx );
+ }
+ else
+ {
+ if ( !IsProperty( nRecType ) || !IsHardAttribute( nRecType ) )
+ {
+ ( (DffPropSet*) this )->mpContents[ nRecType ] = rMaster.mpContents[ nRecType ];
+ DffPropFlags nFlags( rMaster.mpFlags[ nRecType ] );
+ nFlags.bSoftAttr = TRUE;
+ ( (DffPropSet*) this )->mpFlags[ nRecType ] = nFlags;
+ ( (DffPropSet*) this )->Insert( nRecType, pDummy );
+ }
+ }
+ }
+}
+
+BOOL DffPropSet::IsHardAttribute( UINT32 nId ) const
+{
+ BOOL bRetValue = TRUE;
+ nId &= 0x3ff;
+ if ( ( nId & 0x3f ) >= 48 ) // is this a flag id
+ {
+ if ( ((DffPropSet*)this)->Seek( nId | 0x3f ) )
+ {
+ sal_uInt32 nContentEx = (sal_uInt32)(sal_uIntPtr)GetCurObject();
+ bRetValue = ( nContentEx & ( 1 << ( 0xf - ( nId & 0xf ) ) ) ) != 0;
+ }
+ }
+ else
+ bRetValue = ( mpFlags[ nId ].bSoftAttr == 0 );
+ return bRetValue;
+};
+
+UINT32 DffPropSet::GetPropertyValue( UINT32 nId, UINT32 nDefault ) const
+{
+ nId &= 0x3ff;
+ return ( mpFlags[ nId ].bSet ) ? mpContents[ nId ] : nDefault;
+};
+
+bool DffPropSet::GetPropertyBool( UINT32 nId, bool bDefault ) const
+{
+ UINT32 nBaseId = nId | 31; // base ID to get the UINT32 property value
+ UINT32 nMask = 1 << (nBaseId - nId); // bit mask of the boolean property
+
+ UINT32 nPropValue = GetPropertyValue( nBaseId, bDefault ? nMask : 0 );
+ return (nPropValue & nMask) != 0;
+}
+
+::rtl::OUString DffPropSet::GetPropertyString( UINT32 nId, SvStream& rStrm ) const
+{
+ sal_Size nOldPos = rStrm.Tell();
+ ::rtl::OUStringBuffer aBuffer;
+ sal_uInt32 nBufferSize = GetPropertyValue( nId );
+ if( (nBufferSize > 0) && SeekToContent( nId, rStrm ) )
+ {
+ sal_Int32 nStrLen = static_cast< sal_Int32 >( nBufferSize / 2 );
+ aBuffer.ensureCapacity( nStrLen );
+ for( sal_Int32 nCharIdx = 0; nCharIdx < nStrLen; ++nCharIdx )
+ {
+ sal_uInt16 nChar = 0;
+ rStrm >> nChar;
+ if( nChar > 0 )
+ aBuffer.append( static_cast< sal_Unicode >( nChar ) );
+ else
+ break;
+ }
+ }
+ rStrm.Seek( nOldPos );
+ return aBuffer.makeStringAndClear();
+}
+
+void DffPropSet::SetPropertyValue( UINT32 nId, UINT32 nValue ) const
+{
+ if ( !mpFlags[ nId ].bSet )
+ {
+ ( (DffPropSet*) this )->Insert( nId, (void*)nValue );
+ ( (DffPropSet*) this )->mpFlags[ nId ].bSet = TRUE;
+ }
+ ( (DffPropSet*) this )->mpContents[ nId ] = nValue;
+};
+
+BOOL DffPropSet::SeekToContent( UINT32 nRecType, SvStream& rStrm ) const
+{
+ nRecType &= 0x3ff;
+ if ( mpFlags[ nRecType ].bSet )
+ {
+ if ( mpFlags[ nRecType ].bComplex )
+ {
+ if ( ((DffPropSet*)this)->Seek( nRecType ) )
+ {
+ sal_uInt32 nOffset = (sal_uInt32)(sal_uIntPtr)GetCurObject();
+ if ( nOffset && ( ( nOffset & 0xffff0000 ) != 0xffff0000 ) )
+ {
+ rStrm.Seek( nOffset );
+ return TRUE;
+ }
+ }
+ }
+ }
+ return FALSE;
+}
+
+DffPropertyReader::DffPropertyReader( const SvxMSDffManager& rMan ) :
+ rManager( rMan ),
+ pDefaultPropSet( NULL )
+{
+ InitializePropSet();
+}
+
+void DffPropertyReader::SetDefaultPropSet( SvStream& rStCtrl, UINT32 nOffsDgg ) const
+{
+ delete pDefaultPropSet;
+ UINT32 nMerk = rStCtrl.Tell();
+ rStCtrl.Seek( nOffsDgg );
+ DffRecordHeader aRecHd;
+ rStCtrl >> aRecHd;
+ if ( aRecHd.nRecType == DFF_msofbtDggContainer )
+ {
+ if ( rManager.SeekToRec( rStCtrl, DFF_msofbtOPT, aRecHd.GetRecEndFilePos() ) )
+ {
+ ( (DffPropertyReader*) this )->pDefaultPropSet = new DffPropSet;
+ rStCtrl >> *pDefaultPropSet;
+ }
+ }
+ rStCtrl.Seek( nMerk );
+}
+
+#ifdef DBG_CUSTOMSHAPE
+void DffPropertyReader::ReadPropSet( SvStream& rIn, void* pClientData, UINT32 nShapeId ) const
+#else
+void DffPropertyReader::ReadPropSet( SvStream& rIn, void* pClientData ) const
+#endif
+{
+ ULONG nFilePos = rIn.Tell();
+ rIn >> (DffPropertyReader&)*this;
+
+ if ( IsProperty( DFF_Prop_hspMaster ) )
+ {
+ if ( rManager.SeekToShape( rIn, pClientData, GetPropertyValue( DFF_Prop_hspMaster ) ) )
+ {
+ DffRecordHeader aRecHd;
+ rIn >> aRecHd;
+ if ( rManager.SeekToRec( rIn, DFF_msofbtOPT, aRecHd.GetRecEndFilePos() ) )
+ {
+ DffPropSet aMasterPropSet;
+ rIn >> aMasterPropSet;
+ Merge( aMasterPropSet );
+ }
+ }
+ }
+// if ( pDefaultPropSet )
+// Merge( *( pDefaultPropSet ) );
+
+ ( (DffPropertyReader*) this )->mnFix16Angle = Fix16ToAngle( GetPropertyValue( DFF_Prop_Rotation, 0 ) );
+
+#ifdef DBG_CUSTOMSHAPE
+
+ String aURLStr;
+
+ if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( String( RTL_CONSTASCII_STRINGPARAM( "d:\\ashape.dbg" ) ), aURLStr ) )
+ {
+ SvStream* pOut = ::utl::UcbStreamHelper::CreateStream( aURLStr, STREAM_WRITE );
+
+ if( pOut )
+ {
+ pOut->Seek( STREAM_SEEK_TO_END );
+
+ if ( IsProperty( DFF_Prop_adjustValue ) || IsProperty( DFF_Prop_pVertices ) )
+ {
+ pOut->WriteLine( "" );
+ ByteString aString( "ShapeId: " );
+ aString.Append( ByteString::CreateFromInt32( nShapeId ) );
+ pOut->WriteLine( aString );
+ }
+ for ( sal_uInt32 i = DFF_Prop_adjustValue; i <= DFF_Prop_adjust10Value; i++ )
+ {
+ if ( IsProperty( i ) )
+ {
+ ByteString aString( "Prop_adjustValue" );
+ aString.Append( ByteString::CreateFromInt32( ( i - DFF_Prop_adjustValue ) + 1 ) );
+ aString.Append( ":" );
+ aString.Append( ByteString::CreateFromInt32( GetPropertyValue( i ) ) );
+ pOut->WriteLine( aString );
+ }
+ }
+ sal_Int32 i;
+ for ( i = 320; i < 383; i++ )
+ {
+ if ( ( i >= DFF_Prop_adjustValue ) && ( i <= DFF_Prop_adjust10Value ) )
+ continue;
+ if ( IsProperty( i ) )
+ {
+ if ( SeekToContent( i, rIn ) )
+ {
+ INT32 nLen = (INT32)GetPropertyValue( i );
+ if ( nLen )
+ {
+ pOut->WriteLine( "" );
+ ByteString aDesc( "Property:" );
+ aDesc.Append( ByteString::CreateFromInt32( i ) );
+ aDesc.Append( ByteString( " Size:" ) );
+ aDesc.Append( ByteString::CreateFromInt32( nLen ) );
+ pOut->WriteLine( aDesc );
+ INT16 nNumElem, nNumElemMem, nNumSize;
+ rIn >> nNumElem >> nNumElemMem >> nNumSize;
+ aDesc = ByteString( "Entries: " );
+ aDesc.Append( ByteString::CreateFromInt32( nNumElem ) );
+ aDesc.Append( ByteString( " Size:" ) );
+ aDesc.Append( ByteString::CreateFromInt32( nNumSize ) );
+ pOut->WriteLine( aDesc );
+ if ( nNumSize < 0 )
+ nNumSize = ( ( -nNumSize ) >> 2 );
+ if ( !nNumSize )
+ nNumSize = 16;
+ nLen -= 6;
+ while ( nLen > 0 )
+ {
+ ByteString aString;
+ for ( UINT32 j = 0; nLen && ( j < ( nNumSize >> 1 ) ); j++ )
+ {
+ for ( UINT32 k = 0; k < 2; k++ )
+ {
+ if ( nLen )
+ {
+ BYTE nVal;
+ rIn >> nVal;
+ if ( ( nVal >> 4 ) > 9 )
+ *pOut << (BYTE)( ( nVal >> 4 ) + 'A' - 10 );
+ else
+ *pOut << (BYTE)( ( nVal >> 4 ) + '0' );
+
+ if ( ( nVal & 0xf ) > 9 )
+ *pOut << (BYTE)( ( nVal & 0xf ) + 'A' - 10 );
+ else
+ *pOut << (BYTE)( ( nVal & 0xf ) + '0' );
+
+ nLen--;
+ }
+ }
+ *pOut << (char)( ' ' );
+ }
+ pOut->WriteLine( aString );
+ }
+ }
+ }
+ else
+ {
+ ByteString aString( "Property" );
+ aString.Append( ByteString::CreateFromInt32( i ) );
+ aString.Append( ":" );
+ aString.Append( ByteString::CreateFromInt32( GetPropertyValue( i ) ) );
+ pOut->WriteLine( aString );
+ }
+ }
+ }
+
+ delete pOut;
+ }
+ }
+
+#endif
+
+ rIn.Seek( nFilePos );
+}
+
+
+INT32 DffPropertyReader::Fix16ToAngle( INT32 nContent ) const
+{
+ INT32 nAngle = 0;
+ if ( nContent )
+ {
+ nAngle = ( (INT16)( nContent >> 16) * 100L ) + ( ( ( nContent & 0x0000ffff) * 100L ) >> 16 );
+ nAngle = NormAngle360( -nAngle );
+ }
+ return nAngle;
+}
+
+DffPropertyReader::~DffPropertyReader()
+{
+ delete pDefaultPropSet;
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+SvStream& operator>>( SvStream& rIn, SvxMSDffConnectorRule& rRule )
+{
+ rIn >> rRule.nRuleId
+ >> rRule.nShapeA
+ >> rRule.nShapeB
+ >> rRule.nShapeC
+ >> rRule.ncptiA
+ >> rRule.ncptiB;
+
+ return rIn;
+}
+
+SvxMSDffSolverContainer::SvxMSDffSolverContainer()
+{
+}
+
+SvxMSDffSolverContainer::~SvxMSDffSolverContainer()
+{
+ for ( SvxMSDffConnectorRule* pPtr = (SvxMSDffConnectorRule*)aCList.First();
+ pPtr; pPtr = (SvxMSDffConnectorRule*)aCList.Next() )
+ delete pPtr;
+}
+
+SvStream& operator>>( SvStream& rIn, SvxMSDffSolverContainer& rContainer )
+{
+ DffRecordHeader aHd;
+ rIn >> aHd;
+ if ( aHd.nRecType == DFF_msofbtSolverContainer )
+ {
+ DffRecordHeader aCRule;
+ while ( ( rIn.GetError() == 0 ) && ( rIn.Tell() < aHd.GetRecEndFilePos() ) )
+ {
+ rIn >> aCRule;
+ if ( aCRule.nRecType == DFF_msofbtConnectorRule )
+ {
+ SvxMSDffConnectorRule* pRule = new SvxMSDffConnectorRule;
+ rIn >> *pRule;
+ rContainer.aCList.Insert( pRule, LIST_APPEND );
+ }
+ aCRule.SeekToEndOfRecord( rIn );
+ }
+ }
+ return rIn;
+}
+
+void SvxMSDffManager::SolveSolver( const SvxMSDffSolverContainer& rSolver )
+{
+ sal_Int32 i, nCnt;
+ for ( i = 0, nCnt = rSolver.aCList.Count(); i < nCnt; i++ )
+ {
+ SvxMSDffConnectorRule* pPtr = (SvxMSDffConnectorRule*)rSolver.aCList.GetObject( i );
+ if ( pPtr->pCObj )
+ {
+ for ( int nN = 0; nN < 2; nN++ )
+ {
+ SdrObject* pO;
+ sal_uInt32 nC, nSpFlags;
+ sal_Bool bTail;
+ if ( !nN )
+ {
+ bTail = sal_True;
+ pO = pPtr->pAObj;
+ nC = pPtr->ncptiA;
+ nSpFlags = pPtr->nSpFlagsA;
+ }
+ else
+ {
+ bTail = sal_False;
+ pO = pPtr->pBObj;
+ nC = pPtr->ncptiB;
+ nSpFlags = pPtr->nSpFlagsB;
+ }
+ if ( pO )
+ {
+ Any aAny;
+ SdrGluePoint aGluePoint;
+ Reference< XShape > aXShape( pO->getUnoShape(), UNO_QUERY );
+ Reference< XShape > aXConnector( pPtr->pCObj->getUnoShape(), UNO_QUERY );
+ SdrGluePointList* pList = pO->ForceGluePointList();
+
+ sal_Bool bValidGluePoint = sal_False;
+ sal_Int32 nId = nC;
+ sal_uInt32 nInventor = pO->GetObjInventor();
+
+ if( nInventor == SdrInventor )
+ {
+ sal_uInt32 nObjId = pO->GetObjIdentifier();
+ switch( nObjId )
+ {
+ case OBJ_GRUP :
+ case OBJ_GRAF :
+ case OBJ_RECT :
+ case OBJ_TEXT :
+ case OBJ_PAGE :
+ case OBJ_TEXTEXT :
+ case OBJ_wegFITTEXT :
+ case OBJ_wegFITALLTEXT :
+ case OBJ_TITLETEXT :
+ case OBJ_OUTLINETEXT :
+ {
+ if ( nC & 1 )
+ {
+ if ( nSpFlags & SP_FFLIPH )
+ nC ^= 2; // 1 <-> 3
+ }
+ else
+ {
+ if ( nSpFlags & SP_FFLIPV )
+ nC ^= 1; // 0 <-> 2
+ }
+ switch( nC )
+ {
+ case 0 :
+ nId = 0; // SDRVERTALIGN_TOP;
+ break;
+ case 1 :
+ nId = 3; // SDRHORZALIGN_RIGHT;
+ break;
+ case 2 :
+ nId = 2; // SDRVERTALIGN_BOTTOM;
+ break;
+ case 3 :
+ nId = 1; // SDRHORZALIGN_LEFT;
+ break;
+ }
+ if ( nId <= 3 )
+ bValidGluePoint = sal_True;
+ }
+ break;
+ case OBJ_POLY :
+ case OBJ_PLIN :
+ case OBJ_LINE :
+ case OBJ_PATHLINE :
+ case OBJ_PATHFILL :
+ case OBJ_FREELINE :
+ case OBJ_FREEFILL :
+ case OBJ_SPLNLINE :
+ case OBJ_SPLNFILL :
+ case OBJ_PATHPOLY :
+ case OBJ_PATHPLIN :
+ {
+ if ( pList && ( pList->GetCount() > nC ) )
+ {
+ bValidGluePoint = sal_True;
+ nId = (sal_Int32)((*pList)[ (sal_uInt16)nC].GetId() + 3 );
+ }
+ else
+ {
+ sal_Bool bNotFound = sal_True;
+
+ PolyPolygon aPolyPoly( EscherPropertyContainer::GetPolyPolygon( aXShape ) );
+ sal_uInt16 k, j, nPolySize = aPolyPoly.Count();
+ if ( nPolySize )
+ {
+ sal_uInt32 nPointCount = 0;
+ Rectangle aBoundRect( aPolyPoly.GetBoundRect() );
+ if ( aBoundRect.GetWidth() && aBoundRect.GetHeight() )
+ {
+ for ( k = 0; bNotFound && ( k < nPolySize ); k++ )
+ {
+ const Polygon& rPolygon = aPolyPoly.GetObject( k );
+ for ( j = 0; bNotFound && ( j < rPolygon.GetSize() ); j++ )
+ {
+ PolyFlags eFlags = rPolygon.GetFlags( j );
+ if ( eFlags == POLY_NORMAL )
+ {
+ if ( nC == nPointCount )
+ {
+ const Point& rPoint = rPolygon.GetPoint( j );
+ double fXRel = rPoint.X() - aBoundRect.Left();
+ double fYRel = rPoint.Y() - aBoundRect.Top();
+ sal_Int32 nWidth = aBoundRect.GetWidth();
+ if ( !nWidth )
+ nWidth = 1;
+ sal_Int32 nHeight= aBoundRect.GetHeight();
+ if ( !nHeight )
+ nHeight = 1;
+ fXRel /= (double)nWidth;
+ fXRel *= 10000;
+ fYRel /= (double)nHeight;
+ fYRel *= 10000;
+ aGluePoint.SetPos( Point( (sal_Int32)fXRel, (sal_Int32)fYRel ) );
+ aGluePoint.SetPercent( sal_True );
+ aGluePoint.SetAlign( SDRVERTALIGN_TOP | SDRHORZALIGN_LEFT );
+ aGluePoint.SetEscDir( SDRESC_SMART );
+ nId = (sal_Int32)((*pList)[ pList->Insert( aGluePoint ) ].GetId() + 3 );
+ bNotFound = sal_False;
+ }
+ nPointCount++;
+ }
+ }
+ }
+ }
+ }
+ if ( !bNotFound )
+ {
+ bValidGluePoint = sal_True;
+ }
+ }
+ }
+ break;
+
+ case OBJ_CUSTOMSHAPE :
+ {
+ SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)((SdrObjCustomShape*)pO)->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+ const rtl::OUString sPath( RTL_CONSTASCII_USTRINGPARAM ( "Path" ) );
+ const rtl::OUString sGluePointType( RTL_CONSTASCII_USTRINGPARAM ( "GluePointType" ) );
+ sal_Int16 nGluePointType = EnhancedCustomShapeGluePointType::SEGMENTS;
+ com::sun::star::uno::Any* pAny = aGeometryItem.GetPropertyValueByName( sPath, sGluePointType );
+ if ( pAny )
+ *pAny >>= nGluePointType;
+ else
+ {
+ const rtl::OUString sType( RTL_CONSTASCII_USTRINGPARAM ( "Type" ) );
+ rtl::OUString sShapeType;
+ pAny = aGeometryItem.GetPropertyValueByName( sType );
+ if ( pAny )
+ *pAny >>= sShapeType;
+ MSO_SPT eSpType = EnhancedCustomShapeTypeNames::Get( sShapeType );
+ nGluePointType = GetCustomShapeConnectionTypeDefault( eSpType );
+ }
+ if ( nGluePointType == EnhancedCustomShapeGluePointType::CUSTOM )
+ {
+ if ( pList && ( pList->GetCount() > nC ) )
+ {
+ bValidGluePoint = sal_True;
+ nId = (sal_Int32)((*pList)[ (sal_uInt16)nC].GetId() + 3 );
+ }
+ }
+ else if ( nGluePointType == EnhancedCustomShapeGluePointType::RECT )
+ {
+ if ( nC & 1 )
+ {
+ if ( nSpFlags & SP_FFLIPH )
+ nC ^= 2; // 1 <-> 3
+ }
+ else
+ {
+ if ( nSpFlags & SP_FFLIPV )
+ nC ^= 1; // 0 <-> 2
+ }
+ switch( nC )
+ {
+ case 0 :
+ nId = 0; // SDRVERTALIGN_TOP;
+ break;
+ case 1 :
+ nId = 3; // SDRHORZALIGN_RIGHT;
+ break;
+ case 2 :
+ nId = 2; // SDRVERTALIGN_BOTTOM;
+ break;
+ case 3 :
+ nId = 1; // SDRHORZALIGN_LEFT;
+ break;
+ }
+ if ( nId <= 3 )
+ bValidGluePoint = sal_True;
+ }
+ else if ( nGluePointType == EnhancedCustomShapeGluePointType::SEGMENTS )
+ {
+ const rtl::OUString sSegments( RTL_CONSTASCII_USTRINGPARAM ( "Segments" ) );
+ const rtl::OUString sCoordinates( RTL_CONSTASCII_USTRINGPARAM ( "Coordinates" ) );
+
+ sal_uInt32 k, nPt = nC;
+ com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeSegment > aSegments;
+ pAny = aGeometryItem.GetPropertyValueByName( sPath, sSegments );
+ if ( pAny )
+ {
+ if ( *pAny >>= aSegments )
+ {
+ for ( nPt = 0, k = 1; nC && ( k < (sal_uInt32)aSegments.getLength() ); k++ )
+ {
+ sal_Int16 j, nCnt2 = aSegments[ k ].Count;
+ if ( aSegments[ k ].Command != EnhancedCustomShapeSegmentCommand::UNKNOWN )
+ {
+ for ( j = 0; nC && ( j < nCnt2 ); j++ )
+ {
+ switch( aSegments[ k ].Command )
+ {
+ case EnhancedCustomShapeSegmentCommand::ENDSUBPATH :
+ case EnhancedCustomShapeSegmentCommand::CLOSESUBPATH :
+ case EnhancedCustomShapeSegmentCommand::LINETO :
+ case EnhancedCustomShapeSegmentCommand::MOVETO :
+ {
+ nC--;
+ nPt++;
+ }
+ break;
+ case EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTX :
+ case EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTY :
+ break;
+
+ case EnhancedCustomShapeSegmentCommand::CURVETO :
+ {
+ nC--;
+ nPt += 3;
+ }
+ break;
+
+ case EnhancedCustomShapeSegmentCommand::ANGLEELLIPSETO :
+ case EnhancedCustomShapeSegmentCommand::ANGLEELLIPSE :
+ {
+ nC--;
+ nPt += 3;
+ }
+ break;
+ case EnhancedCustomShapeSegmentCommand::ARCTO :
+ case EnhancedCustomShapeSegmentCommand::ARC :
+ case EnhancedCustomShapeSegmentCommand::CLOCKWISEARCTO :
+ case EnhancedCustomShapeSegmentCommand::CLOCKWISEARC :
+ {
+ nC--;
+ nPt += 4;
+ }
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ pAny = aGeometryItem.GetPropertyValueByName( sPath, sCoordinates );
+ if ( pAny )
+ {
+ com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aCoordinates;
+ *pAny >>= aCoordinates;
+ if ( nPt < (sal_uInt32)aCoordinates.getLength() )
+ {
+ nId = 4;
+ com::sun::star::drawing::EnhancedCustomShapeParameterPair& rPara = aCoordinates[ nPt ];
+ sal_Int32 nX = 0, nY = 0;
+ if ( ( rPara.First.Value >>= nX ) && ( rPara.Second.Value >>= nY ) )
+ {
+ const rtl::OUString sGluePoints( RTL_CONSTASCII_USTRINGPARAM ( "GluePoints" ) );
+ com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aGluePoints;
+ pAny = aGeometryItem.GetPropertyValueByName( sPath, sGluePoints );
+ if ( pAny )
+ *pAny >>= aGluePoints;
+ sal_Int32 nGluePoints = aGluePoints.getLength();
+ aGluePoints.realloc( nGluePoints + 1 );
+ EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aGluePoints[ nGluePoints ].First, nX );
+ EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aGluePoints[ nGluePoints ].Second, nY );
+ PropertyValue aProp;
+ aProp.Name = sGluePoints;
+ aProp.Value <<= aGluePoints;
+ aGeometryItem.SetPropertyValue( sPath, aProp );
+ bValidGluePoint = sal_True;
+ ((SdrObjCustomShape*)pO)->SetMergedItem( aGeometryItem );
+ SdrGluePointList* pLst = pO->ForceGluePointList();
+ if ( pLst->GetCount() > nGluePoints )
+ nId = (sal_Int32)((*pLst)[ (sal_uInt16)nGluePoints ].GetId() + 3 );
+ }
+ }
+ }
+ }
+ }
+ break;
+ }
+ if ( bValidGluePoint )
+ {
+ Reference< XPropertySet > xPropSet( aXConnector, UNO_QUERY );
+ if ( xPropSet.is() )
+ {
+ if ( nN )
+ {
+ String aPropName( RTL_CONSTASCII_USTRINGPARAM( "EndShape" ) );
+ aAny <<= aXShape;
+ SetPropValue( aAny, xPropSet, aPropName, sal_True );
+ aPropName = String( RTL_CONSTASCII_USTRINGPARAM( "EndGluePointIndex" ) );
+ aAny <<= nId;
+ SetPropValue( aAny, xPropSet, aPropName, sal_True );
+ }
+ else
+ {
+ String aPropName( RTL_CONSTASCII_USTRINGPARAM( "StartShape" ) );
+ aAny <<= aXShape;
+ SetPropValue( aAny, xPropSet, aPropName, sal_True );
+ aPropName = String( RTL_CONSTASCII_USTRINGPARAM( "StartGluePointIndex" ) );
+ aAny <<= nId;
+ SetPropValue( aAny, xPropSet, aPropName, sal_True );
+ }
+
+ // Not sure what this is good for, repaint or broadcast of object change.
+ //( Thus i am adding repaint here
+ pO->SetChanged();
+ pO->BroadcastObjectChange();
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+static basegfx::B2DPolygon GetLineArrow( const sal_Int32 nLineWidth, const MSO_LineEnd eLineEnd,
+ const MSO_LineEndWidth eLineWidth, const MSO_LineEndLength eLineLenght,
+ sal_Int32& rnArrowWidth, sal_Bool& rbArrowCenter,
+ String& rsArrowName, sal_Bool bScaleArrow )
+{
+ basegfx::B2DPolygon aRetval;
+ double fLineWidth = nLineWidth < 70 ? 70.0 : nLineWidth;
+ double fLenghtMul, fWidthMul;
+ sal_Int32 nLineNumber;
+ switch( eLineLenght )
+ {
+ default :
+ case mso_lineMediumLenArrow : fLenghtMul = 3.0; nLineNumber = 2; break;
+ case mso_lineShortArrow : fLenghtMul = 2.0; nLineNumber = 1; break;
+ case mso_lineLongArrow : fLenghtMul = 5.0; nLineNumber = 3; break;
+ }
+ switch( eLineWidth )
+ {
+ default :
+ case mso_lineMediumWidthArrow : fWidthMul = 3.0; nLineNumber += 3; break;
+ case mso_lineNarrowArrow : fWidthMul = 2.0; break;
+ case mso_lineWideArrow : fWidthMul = 5.0; nLineNumber += 6; break;
+ }
+
+ if ( bScaleArrow ) // #i33630 arrows imported from Word are too big
+ {
+ fWidthMul /= 1.75;
+ fLenghtMul/= 1.75;
+ }
+
+ rbArrowCenter = sal_False;
+ switch ( eLineEnd )
+ {
+ case mso_lineArrowEnd :
+ {
+ basegfx::B2DPolygon aTriangle;
+ aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50, 0.0 ));
+ aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth, fLenghtMul * fLineWidth ));
+ aTriangle.append(basegfx::B2DPoint( 0.0, fLenghtMul * fLineWidth ));
+ aTriangle.setClosed(true);
+ aRetval = aTriangle;
+ rsArrowName = String( RTL_CONSTASCII_STRINGPARAM( "msArrowEnd " ), RTL_TEXTENCODING_UTF8 );
+ }
+ break;
+
+ case mso_lineArrowOpenEnd :
+ {
+ switch( eLineLenght )
+ {
+ default :
+ case mso_lineMediumLenArrow : fLenghtMul = 4.5; break;
+ case mso_lineShortArrow : fLenghtMul = 3.5; break;
+ case mso_lineLongArrow : fLenghtMul = 6.0; break;
+ }
+ switch( eLineWidth )
+ {
+ default :
+ case mso_lineMediumWidthArrow : fWidthMul = 4.5; break;
+ case mso_lineNarrowArrow : fWidthMul = 3.5; break;
+ case mso_lineWideArrow : fWidthMul = 6.0; break;
+ }
+ basegfx::B2DPolygon aTriangle;
+ aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50 , 0.0 ));
+ aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth, fLenghtMul * fLineWidth * 0.91 ));
+ aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.85, fLenghtMul * fLineWidth ));
+ aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50, fLenghtMul * fLineWidth * 0.36 ));
+ aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.15, fLenghtMul * fLineWidth ));
+ aTriangle.append(basegfx::B2DPoint( 0.0, fLenghtMul * fLineWidth * 0.91 ));
+ aTriangle.setClosed(true);
+ aRetval = aTriangle;
+ rsArrowName = String( RTL_CONSTASCII_STRINGPARAM( "msArrowOpenEnd " ), RTL_TEXTENCODING_UTF8 );
+ }
+ break;
+ case mso_lineArrowStealthEnd :
+ {
+ basegfx::B2DPolygon aTriangle;
+ aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50 , 0.0 ));
+ aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth , fLenghtMul * fLineWidth ));
+ aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50 , fLenghtMul * fLineWidth * 0.60 ));
+ aTriangle.append(basegfx::B2DPoint( 0.0, fLenghtMul * fLineWidth ));
+ aTriangle.setClosed(true);
+ aRetval = aTriangle;
+ rsArrowName = String( RTL_CONSTASCII_STRINGPARAM( "msArrowStealthEnd " ), RTL_TEXTENCODING_UTF8 );
+ }
+ break;
+ case mso_lineArrowDiamondEnd :
+ {
+ basegfx::B2DPolygon aTriangle;
+ aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50 , 0.0 ));
+ aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth , fLenghtMul * fLineWidth * 0.50 ));
+ aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50 , fLenghtMul * fLineWidth ));
+ aTriangle.append(basegfx::B2DPoint( 0.0, fLenghtMul * fLineWidth * 0.50 ));
+ aTriangle.setClosed(true);
+ aRetval = aTriangle;
+ rbArrowCenter = sal_True;
+ rsArrowName = String( RTL_CONSTASCII_STRINGPARAM( "msArrowDiamondEnd " ), RTL_TEXTENCODING_UTF8 );
+ }
+ break;
+ case mso_lineArrowOvalEnd :
+ {
+ aRetval = XPolygon( Point( (sal_Int32)( fWidthMul * fLineWidth * 0.50 ), 0 ),
+ (sal_Int32)( fWidthMul * fLineWidth * 0.50 ),
+ (sal_Int32)( fLenghtMul * fLineWidth * 0.50 ), 0, 3600 ).getB2DPolygon();
+ rbArrowCenter = sal_True;
+ rsArrowName = String( RTL_CONSTASCII_STRINGPARAM( "msArrowOvalEnd " ), RTL_TEXTENCODING_UTF8 );
+ }
+ break;
+ default: break;
+ }
+ rsArrowName.Append( String::CreateFromInt32( nLineNumber ) );
+ rnArrowWidth = (sal_Int32)( fLineWidth * fWidthMul );
+
+ return aRetval;
+}
+
+void DffPropertyReader::ApplyLineAttributes( SfxItemSet& rSet, const MSO_SPT eShapeType ) const // #i28269#
+{
+ UINT32 nLineFlags(GetPropertyValue( DFF_Prop_fNoLineDrawDash ));
+
+ if(!IsHardAttribute( DFF_Prop_fLine ) && !IsCustomShapeStrokedByDefault( eShapeType ))
+ {
+ nLineFlags &= ~0x08;
+ }
+
+ if ( nLineFlags & 8 )
+ {
+ // Linienattribute
+ sal_Int32 nLineWidth = (INT32)GetPropertyValue( DFF_Prop_lineWidth, 9525 );
+
+ MSO_LineDashing eLineDashing = (MSO_LineDashing)GetPropertyValue( DFF_Prop_lineDashing, mso_lineSolid );
+ if ( eLineDashing == mso_lineSolid )
+ rSet.Put(XLineStyleItem( XLINE_SOLID ) );
+ else
+ {
+// MSO_LineCap eLineCap = (MSO_LineCap)GetPropertyValue( DFF_Prop_lineEndCapStyle, mso_lineEndCapSquare );
+
+ XDashStyle eDash = XDASH_RECT;
+ sal_uInt16 nDots = 1;
+ sal_uInt32 nDotLen = nLineWidth / 360;
+ sal_uInt16 nDashes = 0;
+ sal_uInt32 nDashLen = ( 8 * nLineWidth ) / 360;
+ sal_uInt32 nDistance = ( 3 * nLineWidth ) / 360;;
+
+ switch ( eLineDashing )
+ {
+ default:
+ case mso_lineDotSys :
+ {
+ nDots = 1;
+ nDashes = 0;
+ nDistance = nDotLen;
+ }
+ break;
+
+ case mso_lineDashGEL :
+ {
+ nDots = 0;
+ nDashes = 1;
+ nDashLen = ( 4 * nLineWidth ) / 360;
+ }
+ break;
+
+ case mso_lineDashDotGEL :
+ {
+ nDots = 1;
+ nDashes = 1;
+ nDashLen = ( 4 * nLineWidth ) / 360;
+ }
+ break;
+
+ case mso_lineLongDashGEL :
+ {
+ nDots = 0;
+ nDashes = 1;
+ }
+ break;
+
+ case mso_lineLongDashDotGEL :
+ {
+ nDots = 1;
+ nDashes = 1;
+ }
+ break;
+
+ case mso_lineLongDashDotDotGEL:
+ {
+ nDots = 2;
+ nDashes = 1;
+ }
+ break;
+ }
+
+ rSet.Put( XLineDashItem( String(), XDash( eDash, nDots, nDotLen, nDashes, nDashLen, nDistance ) ) );
+ rSet.Put( XLineStyleItem( XLINE_DASH ) );
+ }
+ rSet.Put( XLineColorItem( String(), rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_lineColor ), DFF_Prop_lineColor ) ) );
+ if ( IsProperty( DFF_Prop_lineOpacity ) )
+ {
+ double nTrans = GetPropertyValue(DFF_Prop_lineOpacity, 0x10000);
+ nTrans = (nTrans * 100) / 65536;
+ rSet.Put(XLineTransparenceItem(
+ sal_uInt16(100 - ::rtl::math::round(nTrans))));
+ }
+
+ rManager.ScaleEmu( nLineWidth );
+ rSet.Put( XLineWidthItem( nLineWidth ) );
+
+ // SJ: LineJoint (setting each time a line is set, because our internal joint type has another default)
+ MSO_LineJoin eLineJointDefault = mso_lineJoinMiter;
+ if ( eShapeType == mso_sptMin )
+ eLineJointDefault = mso_lineJoinRound;
+ MSO_LineJoin eLineJoint = (MSO_LineJoin)GetPropertyValue( DFF_Prop_lineJoinStyle, eLineJointDefault );
+ XLineJoint eXLineJoint( XLINEJOINT_MITER );
+ if ( eLineJoint == mso_lineJoinBevel )
+ eXLineJoint = XLINEJOINT_BEVEL;
+ else if ( eLineJoint == mso_lineJoinRound )
+ eXLineJoint = XLINEJOINT_ROUND;
+ rSet.Put( XLineJointItem( eXLineJoint ) );
+
+ if ( nLineFlags & 0x10 )
+ {
+ sal_Bool bScaleArrows = rManager.pSdrModel->GetScaleUnit() == MAP_TWIP;
+ ///////////////
+ // LineStart //
+ ///////////////
+ if ( IsProperty( DFF_Prop_lineStartArrowhead ) )
+ {
+ MSO_LineEnd eLineEnd = (MSO_LineEnd)GetPropertyValue( DFF_Prop_lineStartArrowhead );
+ MSO_LineEndWidth eWidth = (MSO_LineEndWidth)GetPropertyValue( DFF_Prop_lineStartArrowWidth, mso_lineMediumWidthArrow );
+ MSO_LineEndLength eLenght = (MSO_LineEndLength)GetPropertyValue( DFF_Prop_lineStartArrowLength, mso_lineMediumLenArrow );
+
+ sal_Int32 nArrowWidth;
+ sal_Bool bArrowCenter;
+ String aArrowName;
+ basegfx::B2DPolygon aPoly(GetLineArrow( nLineWidth, eLineEnd, eWidth, eLenght, nArrowWidth, bArrowCenter, aArrowName, bScaleArrows ));
+
+ rSet.Put( XLineStartWidthItem( nArrowWidth ) );
+ rSet.Put( XLineStartItem( aArrowName, basegfx::B2DPolyPolygon(aPoly) ) );
+ rSet.Put( XLineStartCenterItem( bArrowCenter ) );
+ }
+ /////////////
+ // LineEnd //
+ /////////////
+ if ( IsProperty( DFF_Prop_lineEndArrowhead ) )
+ {
+ MSO_LineEnd eLineEnd = (MSO_LineEnd)GetPropertyValue( DFF_Prop_lineEndArrowhead );
+ MSO_LineEndWidth eWidth = (MSO_LineEndWidth)GetPropertyValue( DFF_Prop_lineEndArrowWidth, mso_lineMediumWidthArrow );
+ MSO_LineEndLength eLenght = (MSO_LineEndLength)GetPropertyValue( DFF_Prop_lineEndArrowLength, mso_lineMediumLenArrow );
+
+ sal_Int32 nArrowWidth;
+ sal_Bool bArrowCenter;
+ String aArrowName;
+ basegfx::B2DPolygon aPoly(GetLineArrow( nLineWidth, eLineEnd, eWidth, eLenght, nArrowWidth, bArrowCenter, aArrowName, bScaleArrows ));
+
+ rSet.Put( XLineEndWidthItem( nArrowWidth ) );
+ rSet.Put( XLineEndItem( aArrowName, basegfx::B2DPolyPolygon(aPoly) ) );
+ rSet.Put( XLineEndCenterItem( bArrowCenter ) );
+ }
+ if ( IsProperty( DFF_Prop_lineEndCapStyle ) )
+ {
+ MSO_LineCap eLineCap = (MSO_LineCap)GetPropertyValue( DFF_Prop_lineEndCapStyle );
+ const SfxPoolItem* pPoolItem = NULL;
+ if ( rSet.GetItemState( XATTR_LINEDASH, FALSE, &pPoolItem ) == SFX_ITEM_SET )
+ {
+ XDashStyle eNewStyle = XDASH_RECT;
+ if ( eLineCap == mso_lineEndCapRound )
+ eNewStyle = XDASH_ROUND;
+ const XDash& rOldDash = ( (const XLineDashItem*)pPoolItem )->GetDashValue();
+ if ( rOldDash.GetDashStyle() != eNewStyle )
+ {
+ XDash aNew( rOldDash );
+ aNew.SetDashStyle( eNewStyle );
+ rSet.Put( XLineDashItem( XubString(), aNew ) );
+ }
+ }
+ }
+ }
+ }
+ else
+ rSet.Put( XLineStyleItem( XLINE_NONE ) );
+}
+
+struct ShadeColor
+{
+ Color aColor;
+ double fDist;
+
+ ShadeColor( const Color& rC, double fR ) : aColor( rC ), fDist( fR ) {};
+};
+
+void GetShadeColors( const SvxMSDffManager& rManager, const DffPropertyReader& rProperties, SvStream& rIn, std::vector< ShadeColor >& rShadeColors )
+{
+ sal_uInt32 nPos = rIn.Tell();
+ if ( rProperties.IsProperty( DFF_Prop_fillShadeColors ) )
+ {
+ if ( rProperties.SeekToContent( DFF_Prop_fillShadeColors, rIn ) )
+ {
+ sal_uInt16 i = 0, nNumElem = 0, nNumElemReserved = 0, nSize = 0;
+ rIn >> nNumElem >> nNumElemReserved >> nSize;
+ for ( ; i < nNumElem; i++ )
+ {
+ sal_Int32 nColor;
+ sal_Int32 nDist;
+
+ rIn >> nColor >> nDist;
+ rShadeColors.push_back( ShadeColor( rManager.MSO_CLR_ToColor( nColor, DFF_Prop_fillColor ), 1.0 - ( nDist / 65536.0 ) ) );
+ }
+ }
+ }
+ if ( !rShadeColors.size() )
+ {
+ rShadeColors.push_back( ShadeColor( rManager.MSO_CLR_ToColor( rProperties.GetPropertyValue( DFF_Prop_fillBackColor, COL_WHITE ), DFF_Prop_fillBackColor ), 0 ) );
+ rShadeColors.push_back( ShadeColor( rManager.MSO_CLR_ToColor( rProperties.GetPropertyValue( DFF_Prop_fillColor, COL_WHITE ), DFF_Prop_fillColor ), 1 ) );
+ }
+ rIn.Seek( nPos );
+}
+
+struct QuantErr
+{
+ double fRed;
+ double fGreen;
+ double fBlue;
+
+ QuantErr() : fRed( 0.0 ), fGreen( 0.0 ), fBlue( 0.0 ){};
+};
+
+void ApplyRectangularGradientAsBitmap( const SvxMSDffManager& rManager, SvStream& rIn, SfxItemSet& rSet, const std::vector< ShadeColor >& rShadeColors, const DffObjData& rObjData, sal_Int32 nFix16Angle )
+{
+ Size aBitmapSizePixel( static_cast< sal_Int32 >( ( rObjData.aBoundRect.GetWidth() / 2540.0 ) * 90.0 ), // we will create a bitmap with 90 dpi
+ static_cast< sal_Int32 >( ( rObjData.aBoundRect.GetHeight() / 2540.0 ) * 90.0 ) );
+ if ( aBitmapSizePixel.Width() && aBitmapSizePixel.Height() && ( aBitmapSizePixel.Width() <= 1024 ) && ( aBitmapSizePixel.Height() <= 1024 ) )
+ {
+// std::vector< QuantErr > aQuantErrCurrScan( aBitmapSizePixel.Width() + 1 );
+// std::vector< QuantErr > aQuantErrNextScan( aBitmapSizePixel.Width() + 1 );
+
+ double fFocusX = rManager.GetPropertyValue( DFF_Prop_fillToRight, 0 ) / 65536.0;
+ double fFocusY = rManager.GetPropertyValue( DFF_Prop_fillToBottom, 0 ) / 65536.0;
+
+ Bitmap aBitmap( aBitmapSizePixel, 24 );
+ BitmapWriteAccess* pAcc = aBitmap.AcquireWriteAccess();
+ if ( pAcc )
+ {
+ sal_Int32 nX, nY;
+ for ( nY = 0; nY < aBitmapSizePixel.Height(); nY++ )
+ {
+ for ( nX = 0; nX < aBitmapSizePixel.Width(); nX++ )
+ {
+ double fX = static_cast< double >( nX ) / aBitmapSizePixel.Width();
+ double fY = static_cast< double >( nY ) / aBitmapSizePixel.Height();
+
+ double fD, fDist;
+ if ( fX < fFocusX )
+ {
+ if ( fY < fFocusY )
+ {
+ if ( fX > fY )
+ fDist = fY, fD = fFocusY;
+ else
+ fDist = fX, fD = fFocusX;
+ }
+ else
+ {
+ if ( fX > ( 1 - fY ) )
+ fDist = ( 1 - fY ), fD = 1 - fFocusY;
+ else
+ fDist = fX, fD = fFocusX;
+ }
+ }
+ else
+ {
+ if ( fY < fFocusY )
+ {
+ if ( ( 1 - fX ) > fY )
+ fDist = fY, fD = fFocusY;
+ else
+ fDist = ( 1 - fX ), fD = 1 - fFocusX;
+ }
+ else
+ {
+ if ( ( 1 - fX ) > ( 1 - fY ) )
+ fDist = ( 1 - fY ), fD = 1 - fFocusY;
+ else
+ fDist = ( 1 - fX ), fD = 1 - fFocusX;
+ }
+ }
+ if ( fD != 0.0 )
+ fDist /= fD;
+
+ std::vector< ShadeColor >::const_iterator aIter( rShadeColors.begin() );
+ double fA = 0.0;
+ Color aColorA = aIter->aColor;
+ double fB = 1.0;
+ Color aColorB( aColorA );
+ while ( aIter != rShadeColors.end() )
+ {
+ if ( aIter->fDist <= fDist )
+ {
+ if ( aIter->fDist >= fA )
+ {
+ fA = aIter->fDist;
+ aColorA = aIter->aColor;
+ }
+ }
+ if ( aIter->fDist > fDist )
+ {
+ if ( aIter->fDist <= fB )
+ {
+ fB = aIter->fDist;
+ aColorB = aIter->aColor;
+ }
+ }
+ aIter++;
+ }
+ double fRed = aColorA.GetRed(), fGreen = aColorA.GetGreen(), fBlue = aColorA.GetBlue();
+ double fD1 = fB - fA;
+ if ( fD1 != 0.0 )
+ {
+ fRed += ( ( ( fDist - fA ) * ( aColorB.GetRed() - aColorA.GetRed() ) ) / fD1 ); // + aQuantErrCurrScan[ nX ].fRed;
+ fGreen += ( ( ( fDist - fA ) * ( aColorB.GetGreen() - aColorA.GetGreen() ) ) / fD1 ); // + aQuantErrCurrScan[ nX ].fGreen;
+ fBlue += ( ( ( fDist - fA ) * ( aColorB.GetBlue() - aColorA.GetBlue() ) ) / fD1 ); // + aQuantErrCurrScan[ nX ].fBlue;
+ }
+ sal_Int16 nRed = static_cast< sal_Int16 >( fRed + 0.5 );
+ sal_Int16 nGreen = static_cast< sal_Int16 >( fGreen + 0.5 );
+ sal_Int16 nBlue = static_cast< sal_Int16 >( fBlue + 0.5 );
+/*
+ double fErr = fRed - nRed;
+ aQuantErrCurrScan[ nX + 1 ].fRed += 7.0 * fErr / 16.0;
+ if ( nX )
+ aQuantErrNextScan[ nX - 1 ].fRed += 3.0 * fErr / 16.0;
+ aQuantErrNextScan[ nX ].fRed += 5.0 * fErr / 16.0;
+ aQuantErrNextScan[ nX + 1 ].fRed += 1.0 * fErr / 16.0;
+
+ fErr = fGreen - nGreen;
+ aQuantErrCurrScan[ nX + 1 ].fGreen += 7.0 * fErr / 16.0;
+ if ( nX )
+ aQuantErrNextScan[ nX - 1 ].fGreen += 3.0 * fErr / 16.0;
+ aQuantErrNextScan[ nX ].fGreen += 5.0 * fErr / 16.0;
+ aQuantErrNextScan[ nX + 1 ].fGreen += 1.0 * fErr / 16.0;
+
+ fErr = fBlue - nBlue;
+ aQuantErrCurrScan[ nX + 1 ].fBlue += 7.0 * fErr / 16.0;
+ if ( nX )
+ aQuantErrNextScan[ nX - 1 ].fBlue += 3.0 * fErr / 16.0;
+ aQuantErrNextScan[ nX ].fBlue += 5.0 * fErr / 16.0;
+ aQuantErrNextScan[ nX + 1 ].fBlue += 1.0 * fErr / 16.0;
+*/
+ if ( nRed < 0 )
+ nRed = 0;
+ if ( nRed > 255 )
+ nRed = 255;
+ if ( nGreen < 0 )
+ nGreen = 0;
+ if ( nGreen > 255 )
+ nGreen = 255;
+ if ( nBlue < 0 )
+ nBlue = 0;
+ if ( nBlue > 255 )
+ nBlue = 255;
+
+ pAcc->SetPixel( nY, nX, BitmapColor( static_cast< sal_Int8 >( nRed ), static_cast< sal_Int8 >( nGreen ), static_cast< sal_Int8 >( nBlue ) ) );
+ }
+/*
+ aQuantErrCurrScan.swap( aQuantErrNextScan );
+ std::vector< QuantErr >::iterator aIter( aQuantErrNextScan.begin() );
+ while( aIter != aQuantErrNextScan.end() )
+ {
+ *aIter = QuantErr();
+ aIter++;
+ }
+*/
+ }
+ aBitmap.ReleaseAccess( pAcc );
+
+ if ( nFix16Angle )
+ {
+ sal_Bool bRotateWithShape = sal_True; // TRUE seems to be default
+ sal_uInt32 nPos = rIn.Tell();
+ if ( const_cast< SvxMSDffManager& >( rManager ).maShapeRecords.SeekToContent( rIn, DFF_msofbtUDefProp, SEEK_FROM_CURRENT_AND_RESTART ) )
+ {
+ const_cast< SvxMSDffManager& >( rManager ).maShapeRecords.Current()->SeekToBegOfRecord( rIn );
+ DffPropertyReader aSecPropSet( rManager );
+ aSecPropSet.ReadPropSet( rIn, NULL );
+ sal_Int32 nSecFillProperties = aSecPropSet.GetPropertyValue( DFF_Prop_fNoFillHitTest, 0x200020 );
+ bRotateWithShape = ( nSecFillProperties & 0x0020 );
+ }
+ rIn.Seek( nPos );
+ if ( bRotateWithShape )
+ {
+ aBitmap.Rotate( nFix16Angle / 10, rShadeColors[ 0 ].aColor );
+
+ ULONG nMirrorFlags = BMP_MIRROR_NONE;
+ if ( rObjData.nSpFlags & SP_FFLIPV )
+ nMirrorFlags |= BMP_MIRROR_VERT;
+ if ( rObjData.nSpFlags & SP_FFLIPH )
+ nMirrorFlags |= BMP_MIRROR_HORZ;
+ if ( nMirrorFlags != BMP_MIRROR_NONE )
+ aBitmap.Mirror( nMirrorFlags );
+ }
+ }
+
+ XOBitmap aXBmp( aBitmap, XBITMAP_STRETCH );
+ rSet.Put( XFillBmpTileItem( sal_False ) );
+ rSet.Put( XFillBitmapItem( String(), aXBmp ) );
+ }
+ }
+}
+
+void DffPropertyReader::ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, const DffObjData& rObjData ) const
+{
+ UINT32 nFillFlags(GetPropertyValue( DFF_Prop_fNoFillHitTest ));
+
+ std::vector< ShadeColor > aShadeColors;
+ GetShadeColors( rManager, *this, rIn, aShadeColors );
+
+ if(!IsHardAttribute( DFF_Prop_fFilled ) && !IsCustomShapeFilledByDefault( rObjData.eShapeType ))
+ {
+ nFillFlags &= ~0x10;
+ }
+
+ if ( nFillFlags & 0x10 )
+ {
+ MSO_FillType eMSO_FillType = (MSO_FillType)GetPropertyValue( DFF_Prop_fillType, mso_fillSolid );
+ XFillStyle eXFill = XFILL_NONE;
+ switch( eMSO_FillType )
+ {
+ case mso_fillSolid : // Fill with a solid color
+ eXFill = XFILL_SOLID;
+ break;
+ case mso_fillPattern : // Fill with a pattern (bitmap)
+ case mso_fillTexture : // A texture (pattern with its own color map)
+ case mso_fillPicture : // Center a picture in the shape
+ eXFill = XFILL_BITMAP;
+ break;
+ case mso_fillShadeCenter : // Shade from bounding rectangle to end point
+ {
+ if ( rObjData.aBoundRect.IsEmpty() )// size of object needed to be able
+ eXFill = XFILL_GRADIENT; // to create a bitmap substitution
+ else
+ eXFill = XFILL_BITMAP;
+ }
+ break;
+ case mso_fillShade : // Shade from start to end points
+ case mso_fillShadeShape : // Shade from shape outline to end point
+ case mso_fillShadeScale : // Similar to mso_fillShade, but the fillAngle
+ case mso_fillShadeTitle : // special type - shade to title --- for PP
+ eXFill = XFILL_GRADIENT;
+ break;
+// case mso_fillBackground : // Use the background fill color/pattern
+ default: break;
+ }
+ rSet.Put( XFillStyleItem( eXFill ) );
+
+ if (IsProperty(DFF_Prop_fillOpacity))
+ {
+ double nTrans = GetPropertyValue(DFF_Prop_fillOpacity);
+ nTrans = (nTrans * 100) / 65536;
+ rSet.Put(XFillTransparenceItem(
+ sal_uInt16(100 - ::rtl::math::round(nTrans))));
+ }
+
+ if ( ( eMSO_FillType == mso_fillShadeCenter ) && ( eXFill == XFILL_BITMAP ) )
+ {
+ ApplyRectangularGradientAsBitmap( rManager, rIn, rSet, aShadeColors, rObjData, mnFix16Angle );
+ }
+ else if ( eXFill == XFILL_GRADIENT )
+ {
+ sal_Int32 nAngle = 3600 - ( ( Fix16ToAngle( GetPropertyValue( DFF_Prop_fillAngle, 0 ) ) + 5 ) / 10 );
+
+ // Rotationswinkel in Bereich zwingen
+ while ( nAngle >= 3600 )
+ nAngle -= 3600;
+ while ( nAngle < 0 )
+ nAngle += 3600;
+
+ sal_Int32 nFocus = GetPropertyValue( DFF_Prop_fillFocus, 0 );
+ XGradientStyle eGrad = XGRAD_LINEAR;
+ sal_Int32 nChgColors = 0;
+
+ if ( !nAngle )
+ nChgColors ^= 1;
+
+ if ( !nFocus )
+ nChgColors ^= 1;
+ else if ( nFocus < 0 ) // Bei negativem Focus sind die Farben zu tauschen
+ {
+ nFocus =- nFocus;
+ nChgColors ^= 1;
+ }
+ if( nFocus > 40 && nFocus < 60 )
+ {
+ eGrad = XGRAD_AXIAL; // Besser gehts leider nicht
+ nChgColors ^= 1;
+ }
+ USHORT nFocusX = (USHORT)nFocus;
+ USHORT nFocusY = (USHORT)nFocus;
+
+ switch( eMSO_FillType )
+ {
+ case mso_fillShadeShape :
+ {
+ eGrad = XGRAD_RECT;
+ nFocusY = nFocusX = 50;
+ nChgColors ^= 1;
+ }
+ break;
+ case mso_fillShadeCenter :
+ {
+ eGrad = XGRAD_RECT;
+ nFocusX = ( IsProperty( DFF_Prop_fillToRight ) ) ? 100 : 0;
+ nFocusY = ( IsProperty( DFF_Prop_fillToBottom ) ) ? 100 : 0;
+ nChgColors ^= 1;
+ }
+ break;
+ default: break;
+ }
+ Color aCol1( rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillColor, COL_WHITE ), DFF_Prop_fillColor ) );
+ Color aCol2( rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillBackColor, COL_WHITE ), DFF_Prop_fillBackColor ) );
+
+ if ( nChgColors )
+ {
+ Color aZwi( aCol1 );
+ aCol1 = aCol2;
+ aCol2 = aZwi;
+ }
+ XGradient aGrad( aCol2, aCol1, eGrad, nAngle, nFocusX, nFocusY );
+ aGrad.SetStartIntens( 100 );
+ aGrad.SetEndIntens( 100 );
+ rSet.Put( XFillGradientItem( String(), aGrad ) );
+ }
+ else if ( eXFill == XFILL_BITMAP )
+ {
+ if( IsProperty( DFF_Prop_fillBlip ) )
+ {
+ Graphic aGraf;
+ // first try to get BLIP from cache
+ BOOL bOK = rManager.GetBLIP( GetPropertyValue( DFF_Prop_fillBlip ), aGraf, NULL );
+ // then try directly from stream (i.e. Excel chart hatches/bitmaps)
+ if ( !bOK )
+ bOK = SeekToContent( DFF_Prop_fillBlip, rIn ) && rManager.GetBLIPDirect( rIn, aGraf, NULL );
+ if ( bOK )
+ {
+ Bitmap aBmp( aGraf.GetBitmap() );
+
+ if ( eMSO_FillType == mso_fillPattern )
+ {
+ Color aCol1( COL_WHITE ), aCol2( COL_WHITE );
+ if ( IsProperty( DFF_Prop_fillColor ) )
+ aCol1 = rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillColor ), DFF_Prop_fillColor );
+ if ( IsProperty( DFF_Prop_fillBackColor ) )
+ aCol2 = rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillBackColor ), DFF_Prop_fillBackColor );
+
+ XOBitmap aXOBitmap;
+
+ // Bitmap einsetzen
+ aXOBitmap.SetBitmap( aBmp );
+ aXOBitmap.SetBitmapType( XBITMAP_IMPORT );
+
+ if( aBmp.GetSizePixel().Width() == 8 && aBmp.GetSizePixel().Height() == 8 && aBmp.GetColorCount() == 2)
+ {
+ aXOBitmap.Bitmap2Array();
+ aXOBitmap.SetBitmapType( XBITMAP_8X8 );
+ aXOBitmap.SetPixelSize( aBmp.GetSizePixel() );
+
+ if( aXOBitmap.GetBackgroundColor() == COL_BLACK )
+ {
+ aXOBitmap.SetPixelColor( aCol1 );
+ aXOBitmap.SetBackgroundColor( aCol2 );
+ }
+ else
+ {
+ aXOBitmap.SetPixelColor( aCol2 );
+ aXOBitmap.SetBackgroundColor( aCol1 );
+ }
+ }
+ rSet.Put( XFillBitmapItem( String(), aXOBitmap ) );
+ }
+ else if ( eMSO_FillType == mso_fillTexture )
+ {
+ XOBitmap aXBmp( aBmp, XBITMAP_STRETCH );
+ rSet.Put( XFillBmpTileItem( sal_True ) );
+ rSet.Put( XFillBitmapItem( String(), aXBmp ) );
+ rSet.Put( XFillBmpSizeXItem( GetPropertyValue( DFF_Prop_fillWidth, 0 ) / 360 ) );
+ rSet.Put( XFillBmpSizeYItem( GetPropertyValue( DFF_Prop_fillHeight, 0 ) / 360 ) );
+ rSet.Put( XFillBmpSizeLogItem( sal_True ) );
+ }
+ else
+ {
+ XOBitmap aXBmp( aBmp, XBITMAP_STRETCH );
+ rSet.Put( XFillBitmapItem( String(), aXBmp ) );
+ rSet.Put( XFillBmpTileItem( sal_False ) );
+ }
+ }
+ }
+ }
+ }
+ else
+ rSet.Put( XFillStyleItem( XFILL_NONE ) );
+}
+
+void DffPropertyReader::ApplyCustomShapeTextAttributes( SfxItemSet& rSet ) const
+{
+// sal_uInt32 nTextFlags = aTextObj.GetTextFlags();
+ sal_Bool bVerticalText = sal_False;
+ sal_Int32 nTextLeft = GetPropertyValue( DFF_Prop_dxTextLeft, 25 * 3600 ) / 360; // 0.25 cm (emu)
+ sal_Int32 nTextRight = GetPropertyValue( DFF_Prop_dxTextRight, 25 * 3600 ) / 360; // 0.25 cm (emu)
+ sal_Int32 nTextTop = GetPropertyValue( DFF_Prop_dyTextTop, 13 * 3600 ) / 360; // 0.13 cm (emu)
+ sal_Int32 nTextBottom = GetPropertyValue( DFF_Prop_dyTextBottom, 13 * 3600 ) /360; // 0.13 cm (emu)
+
+ SdrTextVertAdjust eTVA;
+ SdrTextHorzAdjust eTHA;
+
+ if ( IsProperty( DFF_Prop_txflTextFlow ) )
+ {
+ MSO_TextFlow eTextFlow = (MSO_TextFlow)( GetPropertyValue( DFF_Prop_txflTextFlow ) & 0xFFFF );
+ switch( eTextFlow )
+ {
+ case mso_txflTtoBA : /* #68110# */ // Top to Bottom @-font, oben -> unten
+ case mso_txflTtoBN : // Top to Bottom non-@, oben -> unten
+ case mso_txflVertN : // Vertical, non-@, oben -> unten
+ bVerticalText = sal_True; // nTextRotationAngle += 27000;
+ break;
+ default: break;
+ }
+ }
+ sal_Int32 nFontDirection = GetPropertyValue( DFF_Prop_cdirFont, mso_cdir0 );
+ if ( ( nFontDirection == 1 ) || ( nFontDirection == 3 ) )
+ bVerticalText = !bVerticalText;
+
+ if ( bVerticalText )
+ {
+ eTVA = SDRTEXTVERTADJUST_BLOCK;
+ eTHA = SDRTEXTHORZADJUST_CENTER;
+
+ // Textverankerung lesen
+ MSO_Anchor eTextAnchor = (MSO_Anchor)GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop );
+
+ switch( eTextAnchor )
+ {
+ case mso_anchorTop:
+ case mso_anchorTopCentered:
+ case mso_anchorTopBaseline:
+ case mso_anchorTopCenteredBaseline:
+ eTHA = SDRTEXTHORZADJUST_RIGHT;
+ break;
+
+ case mso_anchorMiddle :
+ case mso_anchorMiddleCentered:
+ eTHA = SDRTEXTHORZADJUST_CENTER;
+ break;
+
+ case mso_anchorBottom:
+ case mso_anchorBottomCentered:
+ case mso_anchorBottomBaseline:
+ case mso_anchorBottomCenteredBaseline:
+ eTHA = SDRTEXTHORZADJUST_LEFT;
+ break;
+ }
+ // if there is a 100% use of following attributes, the textbox can been aligned also in vertical direction
+ switch ( eTextAnchor )
+ {
+ case mso_anchorTopCentered :
+ case mso_anchorMiddleCentered :
+ case mso_anchorBottomCentered :
+ case mso_anchorTopCenteredBaseline:
+ case mso_anchorBottomCenteredBaseline:
+ eTVA = SDRTEXTVERTADJUST_CENTER;
+ break;
+
+ default :
+ eTVA = SDRTEXTVERTADJUST_TOP;
+ break;
+ }
+ }
+ else
+ {
+ eTVA = SDRTEXTVERTADJUST_CENTER;
+ eTHA = SDRTEXTHORZADJUST_BLOCK;
+
+ // Textverankerung lesen
+ MSO_Anchor eTextAnchor = (MSO_Anchor)GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop );
+
+ switch( eTextAnchor )
+ {
+ case mso_anchorTop:
+ case mso_anchorTopCentered:
+ case mso_anchorTopBaseline:
+ case mso_anchorTopCenteredBaseline:
+ eTVA = SDRTEXTVERTADJUST_TOP;
+ break;
+
+ case mso_anchorMiddle :
+ case mso_anchorMiddleCentered:
+ eTVA = SDRTEXTVERTADJUST_CENTER;
+ break;
+
+ case mso_anchorBottom:
+ case mso_anchorBottomCentered:
+ case mso_anchorBottomBaseline:
+ case mso_anchorBottomCenteredBaseline:
+ eTVA = SDRTEXTVERTADJUST_BOTTOM;
+ break;
+ }
+ // if there is a 100% usage of following attributes, the textbox can be aligned also in horizontal direction
+ switch ( eTextAnchor )
+ {
+ case mso_anchorTopCentered :
+ case mso_anchorMiddleCentered :
+ case mso_anchorBottomCentered :
+ case mso_anchorTopCenteredBaseline:
+ case mso_anchorBottomCenteredBaseline:
+ eTHA = SDRTEXTHORZADJUST_CENTER; // the text has to be displayed using the full width;
+ break;
+
+ default :
+ eTHA = SDRTEXTHORZADJUST_LEFT;
+ break;
+ }
+ }
+ rSet.Put( SvxFrameDirectionItem( bVerticalText ? FRMDIR_VERT_TOP_RIGHT : FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ) );
+
+ rSet.Put( SdrTextVertAdjustItem( eTVA ) );
+ rSet.Put( SdrTextHorzAdjustItem( eTHA ) );
+
+ rSet.Put( SdrTextLeftDistItem( nTextLeft ) );
+ rSet.Put( SdrTextRightDistItem( nTextRight ) );
+ rSet.Put( SdrTextUpperDistItem( nTextTop ) );
+ rSet.Put( SdrTextLowerDistItem( nTextBottom ) );
+
+ rSet.Put( SdrTextWordWrapItem( (MSO_WrapMode)GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare ) != mso_wrapNone ? sal_True : sal_False ) );
+ rSet.Put( SdrTextAutoGrowHeightItem( ( GetPropertyValue( DFF_Prop_FitTextToShape ) & 2 ) != 0 ) );
+
+// rSet.Put( SdrTextAutoGrowWidthItem( (MSO_WrapMode)GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare ) != mso_wrapNone ? sal_False : sal_True ) );
+// rSet.Put( SdrTextAutoGrowHeightItem( ( GetPropertyValue( DFF_Prop_FitTextToShape ) & 2 ) != 0 ) );
+}
+
+void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxItemSet& rSet, const DffObjData& rObjData ) const
+{
+
+ sal_uInt32 nAdjustmentsWhichNeedsToBeConverted = 0;
+
+ ///////////////////////////////////////
+ // creating SdrCustomShapeGeometryItem //
+ ///////////////////////////////////////
+ typedef uno::Sequence< beans::PropertyValue > PropSeq;
+ typedef std::vector< beans::PropertyValue > PropVec;
+ typedef PropVec::iterator PropVecIter;
+ PropVecIter aIter;
+ PropVecIter aEnd;
+
+
+ // aPropVec will be filled with all PropertyValues
+ PropVec aPropVec;
+ PropertyValue aProp;
+
+ /////////////////////////////////////////////////////////////////////
+ // "Type" property, including the predefined CustomShape type name //
+ /////////////////////////////////////////////////////////////////////
+ const rtl::OUString sType( RTL_CONSTASCII_USTRINGPARAM ( "Type" ) );
+ aProp.Name = sType;
+ aProp.Value <<= EnhancedCustomShapeTypeNames::Get( rObjData.eShapeType );
+ aPropVec.push_back( aProp );
+
+/*
+ /////////////////
+ // "MirroredX" //
+ /////////////////
+ if ( nShapeFlags & SP_FFLIPH )
+ {
+ const rtl::OUString sMirroredX( RTL_CONSTASCII_USTRINGPARAM ( "MirroredX" ) );
+ sal_Bool bMirroredX = sal_True;
+ aProp.Name = sMirroredX;
+ aProp.Value <<= bMirroredX;
+ aPropVec.push_back( aProp );
+ }
+ /////////////////
+ // "MirroredY" //
+ /////////////////
+ if ( nShapeFlags & SP_FFLIPV )
+ {
+ const rtl::OUString sMirroredY( RTL_CONSTASCII_USTRINGPARAM ( "MirroredY" ) );
+ sal_Bool bMirroredY = sal_True;
+ aProp.Name = sMirroredY;
+ aProp.Value <<= bMirroredY;
+ aPropVec.push_back( aProp );
+ }
+*/
+ ///////////////
+ // "ViewBox" //
+ ///////////////
+
+ sal_Int32 nCoordWidth = 21600; // needed to replace handle type center with absolute value
+ sal_Int32 nCoordHeight= 21600;
+ if ( IsProperty( DFF_Prop_geoLeft ) || IsProperty( DFF_Prop_geoTop ) || IsProperty( DFF_Prop_geoRight ) || IsProperty( DFF_Prop_geoBottom ) )
+ {
+ com::sun::star::awt::Rectangle aViewBox;
+ const rtl::OUString sViewBox( RTL_CONSTASCII_USTRINGPARAM ( "ViewBox" ) );
+ aViewBox.X = GetPropertyValue( DFF_Prop_geoLeft, 0 );
+ aViewBox.Y = GetPropertyValue( DFF_Prop_geoTop, 0 );
+ aViewBox.Width = nCoordWidth = ((sal_Int32)GetPropertyValue( DFF_Prop_geoRight, 21600 ) ) - aViewBox.X;
+ aViewBox.Height = nCoordHeight = ((sal_Int32)GetPropertyValue( DFF_Prop_geoBottom, 21600 ) ) - aViewBox.Y;
+ aProp.Name = sViewBox;
+ aProp.Value <<= aViewBox;
+ aPropVec.push_back( aProp );
+ }
+ /////////////////////
+ // TextRotateAngle //
+ /////////////////////
+ if ( IsProperty( DFF_Prop_txflTextFlow ) || IsProperty( DFF_Prop_cdirFont ) )
+ {
+ sal_Int32 nTextRotateAngle = 0;
+ MSO_TextFlow eTextFlow = (MSO_TextFlow)( GetPropertyValue( DFF_Prop_txflTextFlow ) & 0xFFFF );
+/* sal_Int32 nFontDirection = GetPropertyValue( DFF_Prop_cdirFont, mso_cdir0 ); */
+
+ if ( eTextFlow == mso_txflBtoT ) // Bottom to Top non-@, unten -> oben
+ nTextRotateAngle += 90;
+ switch( GetPropertyValue( DFF_Prop_cdirFont, mso_cdir0 ) ) // SJ: mso_cdir90 and mso_cdir270 will be simulated by
+ { // activating vertical writing for the text objects
+ case mso_cdir90 :
+ {
+ if ( eTextFlow == mso_txflTtoBA )
+ nTextRotateAngle -= 180;
+ }
+ break;
+ case mso_cdir180: nTextRotateAngle -= 180; break;
+ case mso_cdir270:
+ {
+ if ( eTextFlow != mso_txflTtoBA )
+ nTextRotateAngle -= 180;
+ }
+ break;
+ default: break;
+ }
+ if ( nTextRotateAngle )
+ {
+ double fTextRotateAngle = nTextRotateAngle;
+ const rtl::OUString sTextRotateAngle( RTL_CONSTASCII_USTRINGPARAM ( "TextRotateAngle" ) );
+ aProp.Name = sTextRotateAngle;
+ aProp.Value <<= fTextRotateAngle;
+ aPropVec.push_back( aProp );
+ }
+ }
+ //////////////////////////////////////////
+ // "Extrusion" PropertySequence element //
+ //////////////////////////////////////////
+ sal_Bool bExtrusionOn = ( GetPropertyValue( DFF_Prop_fc3DLightFace ) & 8 ) != 0;
+ if ( bExtrusionOn )
+ {
+ PropVec aExtrusionPropVec;
+
+ // "Extrusion"
+ const rtl::OUString sExtrusionOn( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
+ aProp.Name = sExtrusionOn;
+ aProp.Value <<= bExtrusionOn;
+ aExtrusionPropVec.push_back( aProp );
+
+ // "Brightness"
+ if ( IsProperty( DFF_Prop_c3DAmbientIntensity ) )
+ {
+ const rtl::OUString sExtrusionBrightness( RTL_CONSTASCII_USTRINGPARAM ( "Brightness" ) );
+ double fBrightness = (sal_Int32)GetPropertyValue( DFF_Prop_c3DAmbientIntensity );
+ fBrightness /= 655.36;
+ aProp.Name = sExtrusionBrightness;
+ aProp.Value <<= fBrightness;
+ aExtrusionPropVec.push_back( aProp );
+ }
+ // "Depth" in 1/100mm
+ if ( IsProperty( DFF_Prop_c3DExtrudeBackward ) || IsProperty( DFF_Prop_c3DExtrudeForward ) )
+ {
+ const rtl::OUString sDepth( RTL_CONSTASCII_USTRINGPARAM ( "Depth" ) );
+ double fBackDepth = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DExtrudeBackward, 1270 * 360 )) / 360.0;
+ double fForeDepth = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DExtrudeForward ), 0 ) / 360.0;
+ double fDepth = fBackDepth + fForeDepth;
+ double fFraction = fDepth != 0.0 ? fForeDepth / fDepth : 0;
+ EnhancedCustomShapeParameterPair aDepthParaPair;
+ aDepthParaPair.First.Value <<= fDepth;
+ aDepthParaPair.First.Type = EnhancedCustomShapeParameterType::NORMAL;
+ aDepthParaPair.Second.Value <<= fFraction;
+ aDepthParaPair.Second.Type = EnhancedCustomShapeParameterType::NORMAL;
+ aProp.Name = sDepth;
+ aProp.Value <<= aDepthParaPair;
+ aExtrusionPropVec.push_back( aProp );
+ }
+ // "Diffusion"
+ if ( IsProperty( DFF_Prop_c3DDiffuseAmt ) )
+ {
+ const rtl::OUString sExtrusionDiffusion( RTL_CONSTASCII_USTRINGPARAM ( "Diffusion" ) );
+ double fDiffusion = (sal_Int32)GetPropertyValue( DFF_Prop_c3DDiffuseAmt );
+ fDiffusion /= 655.36;
+ aProp.Name = sExtrusionDiffusion;
+ aProp.Value <<= fDiffusion;
+ aExtrusionPropVec.push_back( aProp );
+ }
+ // "NumberOfLineSegments"
+ if ( IsProperty( DFF_Prop_c3DTolerance ) )
+ {
+ const rtl::OUString sExtrusionNumberOfLineSegments( RTL_CONSTASCII_USTRINGPARAM ( "NumberOfLineSegments" ) );
+ aProp.Name = sExtrusionNumberOfLineSegments;
+ aProp.Value <<= (sal_Int32)GetPropertyValue( DFF_Prop_c3DTolerance );
+ aExtrusionPropVec.push_back( aProp );
+ }
+ // "LightFace"
+ const rtl::OUString sExtrusionLightFace( RTL_CONSTASCII_USTRINGPARAM ( "LightFace" ) );
+ sal_Bool bExtrusionLightFace = ( GetPropertyValue( DFF_Prop_fc3DLightFace ) & 1 ) != 0;
+ aProp.Name = sExtrusionLightFace;
+ aProp.Value <<= bExtrusionLightFace;
+ aExtrusionPropVec.push_back( aProp );
+ // "FirstLightHarsh"
+ const rtl::OUString sExtrusionFirstLightHarsh( RTL_CONSTASCII_USTRINGPARAM ( "FirstLightHarsh" ) );
+ sal_Bool bExtrusionFirstLightHarsh = ( GetPropertyValue( DFF_Prop_fc3DFillHarsh ) & 2 ) != 0;
+ aProp.Name = sExtrusionFirstLightHarsh;
+ aProp.Value <<= bExtrusionFirstLightHarsh;
+ aExtrusionPropVec.push_back( aProp );
+ // "SecondLightHarsh"
+ const rtl::OUString sExtrusionSecondLightHarsh( RTL_CONSTASCII_USTRINGPARAM ( "SecondLightHarsh" ) );
+ sal_Bool bExtrusionSecondLightHarsh = ( GetPropertyValue( DFF_Prop_fc3DFillHarsh ) & 1 ) != 0;
+ aProp.Name = sExtrusionSecondLightHarsh;
+ aProp.Value <<= bExtrusionSecondLightHarsh;
+ aExtrusionPropVec.push_back( aProp );
+ // "FirstLightLevel"
+ if ( IsProperty( DFF_Prop_c3DKeyIntensity ) )
+ {
+ const rtl::OUString sExtrusionFirstLightLevel( RTL_CONSTASCII_USTRINGPARAM ( "FirstLightLevel" ) );
+ double fFirstLightLevel = (sal_Int32)GetPropertyValue( DFF_Prop_c3DKeyIntensity );
+ fFirstLightLevel /= 655.36;
+ aProp.Name = sExtrusionFirstLightLevel;
+ aProp.Value <<= fFirstLightLevel;
+ aExtrusionPropVec.push_back( aProp );
+ }
+ // "SecondLightLevel"
+ if ( IsProperty( DFF_Prop_c3DFillIntensity ) )
+ {
+ const rtl::OUString sExtrusionSecondLightLevel( RTL_CONSTASCII_USTRINGPARAM ( "SecondLightLevel" ) );
+ double fSecondLightLevel = (sal_Int32)GetPropertyValue( DFF_Prop_c3DFillIntensity );
+ fSecondLightLevel /= 655.36;
+ aProp.Name = sExtrusionSecondLightLevel;
+ aProp.Value <<= fSecondLightLevel;
+ aExtrusionPropVec.push_back( aProp );
+ }
+ // "FirtstLightDirection"
+ if ( IsProperty( DFF_Prop_c3DKeyX ) || IsProperty( DFF_Prop_c3DKeyY ) || IsProperty( DFF_Prop_c3DKeyZ ) )
+ {
+ double fLightX = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DKeyX, 50000 ));
+ double fLightY = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DKeyY, 0 ));
+ double fLightZ = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DKeyZ, 10000 ));
+ ::com::sun::star::drawing::Direction3D aExtrusionFirstLightDirection( fLightX, fLightY, fLightZ );
+ const rtl::OUString sExtrusionFirstLightDirection( RTL_CONSTASCII_USTRINGPARAM ( "FirstLightDirection" ) );
+ aProp.Name = sExtrusionFirstLightDirection;
+ aProp.Value <<= aExtrusionFirstLightDirection;
+ aExtrusionPropVec.push_back( aProp );
+ }
+ // "SecondLightDirection"
+ if ( IsProperty( DFF_Prop_c3DFillX ) || IsProperty( DFF_Prop_c3DFillY ) || IsProperty( DFF_Prop_c3DFillZ ) )
+ {
+ double fLight2X = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DFillX, (sal_uInt32)-50000 ));
+ double fLight2Y = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DFillY, 0 ));
+ double fLight2Z = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DFillZ, 10000 ));
+ ::com::sun::star::drawing::Direction3D aExtrusionSecondLightDirection( fLight2X, fLight2Y, fLight2Z );
+ const rtl::OUString sExtrusionSecondLightDirection( RTL_CONSTASCII_USTRINGPARAM ( "SecondLightDirection" ) );
+ aProp.Name = sExtrusionSecondLightDirection;
+ aProp.Value <<= aExtrusionSecondLightDirection;
+ aExtrusionPropVec.push_back( aProp );
+ }
+
+/* LockRotationCenter, OrientationAngle and Orientation needs to be converted to use the properties AngleX, AngleY and RotationAngle instead.
+ // "LockRotationCenter"
+ const rtl::OUString sExtrusionLockRotationCenter( RTL_CONSTASCII_USTRINGPARAM ( "LockRotationCenter" ) );
+ sal_Bool bExtrusionLockRotationCenter = ( GetPropertyValue( DFF_Prop_fc3DFillHarsh ) & 16 ) != 0;
+ aProp.Name = sExtrusionLockRotationCenter;
+ aProp.Value <<= bExtrusionLockRotationCenter;
+ aExtrusionPropVec.push_back( aProp );
+
+ // "Orientation"
+ if ( IsProperty( DFF_Prop_c3DRotationAxisX ) || IsProperty( DFF_Prop_c3DRotationAxisY ) || IsProperty( DFF_Prop_c3DRotationAxisZ ) )
+ {
+ double fRotX = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DRotationAxisX, 100 ));
+ double fRotY = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DRotationAxisY, 0 ));
+ double fRotZ = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DRotationAxisZ, 0 ));
+ ::com::sun::star::drawing::Direction3D aExtrusionDirection( fRotX, fRotY, fRotZ );
+ const rtl::OUString sExtrusionDirection( RTL_CONSTASCII_USTRINGPARAM ( "Orientation" ) );
+ aProp.Name = sExtrusionDirection;
+ aProp.Value <<= aExtrusionDirection;
+ aExtrusionPropVec.push_back( aProp );
+ }
+ // "OrientationAngle" in Grad
+ if ( IsProperty( DFF_Prop_c3DRotationAngle ) )
+ {
+ const rtl::OUString sExtrusionOrientationAngle( RTL_CONSTASCII_USTRINGPARAM ( "OrientationAngle" ) );
+ double fOrientationAngle = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DRotationAngle )) / 65536.0;
+ aProp.Name = sExtrusionOrientationAngle;
+ aProp.Value <<= fOrientationAngle;
+ aExtrusionPropVec.push_back( aProp );
+ }
+*/
+
+ // "Metal"
+ const rtl::OUString sExtrusionMetal( RTL_CONSTASCII_USTRINGPARAM ( "Metal" ) );
+ sal_Bool bExtrusionMetal = ( GetPropertyValue( DFF_Prop_fc3DLightFace ) & 4 ) != 0;
+ aProp.Name = sExtrusionMetal;
+ aProp.Value <<= bExtrusionMetal;
+ aExtrusionPropVec.push_back( aProp );
+// if ( IsProperty( DFF_Prop_c3DExtrudePlane ) )
+// {
+// UPS
+// }
+ // "ShadeMode"
+ if ( IsProperty( DFF_Prop_c3DRenderMode ) )
+ {
+ const rtl::OUString sExtrusionShadeMode( RTL_CONSTASCII_USTRINGPARAM ( "ShadeMode" ) );
+ sal_uInt32 nExtrusionRenderMode = GetPropertyValue( DFF_Prop_c3DRenderMode );
+ com::sun::star::drawing::ShadeMode eExtrusionShadeMode( com::sun::star::drawing::ShadeMode_FLAT );
+ if ( nExtrusionRenderMode == mso_Wireframe )
+ eExtrusionShadeMode = com::sun::star::drawing::ShadeMode_DRAFT;
+
+ aProp.Name = sExtrusionShadeMode;
+ aProp.Value <<= eExtrusionShadeMode;
+ aExtrusionPropVec.push_back( aProp );
+ }
+ // "RotateAngle" in Grad
+ if ( IsProperty( DFF_Prop_c3DXRotationAngle ) || IsProperty( DFF_Prop_c3DYRotationAngle ) )
+ {
+ const rtl::OUString sExtrusionAngle( RTL_CONSTASCII_USTRINGPARAM ( "RotateAngle" ) );
+ double fAngleX = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DXRotationAngle, 0 )) / 65536.0;
+ double fAngleY = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DYRotationAngle, 0 )) / 65536.0;
+ EnhancedCustomShapeParameterPair aRotateAnglePair;
+ aRotateAnglePair.First.Value <<= fAngleX;
+ aRotateAnglePair.First.Type = EnhancedCustomShapeParameterType::NORMAL;
+ aRotateAnglePair.Second.Value <<= fAngleY;
+ aRotateAnglePair.Second.Type = EnhancedCustomShapeParameterType::NORMAL;
+ aProp.Name = sExtrusionAngle;
+ aProp.Value <<= aRotateAnglePair;
+ aExtrusionPropVec.push_back( aProp );
+ }
+
+ // "AutoRotationCenter"
+ if ( ( GetPropertyValue( DFF_Prop_fc3DFillHarsh ) & 8 ) == 0 )
+ {
+ // "RotationCenter"
+ if ( IsProperty( DFF_Prop_c3DRotationCenterX ) || IsProperty( DFF_Prop_c3DRotationCenterY ) || IsProperty( DFF_Prop_c3DRotationCenterZ ) )
+ {
+ ::com::sun::star::drawing::Direction3D aRotationCenter(
+ (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DRotationCenterX, 0 )) / 360.0,
+ (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DRotationCenterY, 0 )) / 360.0,
+ (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DRotationCenterZ, 0 )) / 360.0 );
+
+ const rtl::OUString sExtrusionRotationCenter( RTL_CONSTASCII_USTRINGPARAM ( "RotationCenter" ) );
+ aProp.Name = sExtrusionRotationCenter;
+ aProp.Value <<= aRotationCenter;
+ aExtrusionPropVec.push_back( aProp );
+ }
+ }
+ // "Shininess"
+ if ( IsProperty( DFF_Prop_c3DShininess ) )
+ {
+ const rtl::OUString sExtrusionShininess( RTL_CONSTASCII_USTRINGPARAM ( "Shininess" ) );
+ double fShininess = (sal_Int32)GetPropertyValue( DFF_Prop_c3DShininess );
+ fShininess /= 655.36;
+ aProp.Name = sExtrusionShininess;
+ aProp.Value <<= fShininess;
+ aExtrusionPropVec.push_back( aProp );
+ }
+ // "Skew"
+ if ( IsProperty( DFF_Prop_c3DSkewAmount ) || IsProperty( DFF_Prop_c3DSkewAngle ) )
+ {
+ const rtl::OUString sExtrusionSkew( RTL_CONSTASCII_USTRINGPARAM ( "Skew" ) );
+ double fSkewAmount = (sal_Int32)GetPropertyValue( DFF_Prop_c3DSkewAmount, 50 );
+ double fSkewAngle = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DSkewAngle, sal::static_int_cast< UINT32 >(-135 * 65536) )) / 65536.0;
+
+ EnhancedCustomShapeParameterPair aSkewPair;
+ aSkewPair.First.Value <<= fSkewAmount;
+ aSkewPair.First.Type = EnhancedCustomShapeParameterType::NORMAL;
+ aSkewPair.Second.Value <<= fSkewAngle;
+ aSkewPair.Second.Type = EnhancedCustomShapeParameterType::NORMAL;
+ aProp.Name = sExtrusionSkew;
+ aProp.Value <<= aSkewPair;
+ aExtrusionPropVec.push_back( aProp );
+ }
+ // "Specularity"
+ if ( IsProperty( DFF_Prop_c3DSpecularAmt ) )
+ {
+ const rtl::OUString sExtrusionSpecularity( RTL_CONSTASCII_USTRINGPARAM ( "Specularity" ) );
+ double fSpecularity = (sal_Int32)GetPropertyValue( DFF_Prop_c3DSpecularAmt );
+ fSpecularity /= 1333;
+ aProp.Name = sExtrusionSpecularity;
+ aProp.Value <<= fSpecularity;
+ aExtrusionPropVec.push_back( aProp );
+ }
+ // "ProjectionMode"
+ const rtl::OUString sExtrusionProjectionMode( RTL_CONSTASCII_USTRINGPARAM ( "ProjectionMode" ) );
+ ProjectionMode eProjectionMode = GetPropertyValue( DFF_Prop_fc3DFillHarsh ) & 4 ? ProjectionMode_PARALLEL : ProjectionMode_PERSPECTIVE;
+ aProp.Name = sExtrusionProjectionMode;
+ aProp.Value <<= eProjectionMode;
+ aExtrusionPropVec.push_back( aProp );
+
+ // "ViewPoint" in 1/100mm
+ if ( IsProperty( DFF_Prop_c3DXViewpoint ) || IsProperty( DFF_Prop_c3DYViewpoint ) || IsProperty( DFF_Prop_c3DZViewpoint ) )
+ {
+ double fViewX = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DXViewpoint, 1249920 )) / 360.0;
+ double fViewY = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DYViewpoint, (sal_uInt32)-1249920 ))/ 360.0;
+ double fViewZ = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DZViewpoint, 9000000 )) / 360.0;
+ ::com::sun::star::drawing::Position3D aExtrusionViewPoint( fViewX, fViewY, fViewZ );
+ const rtl::OUString sExtrusionViewPoint( RTL_CONSTASCII_USTRINGPARAM ( "ViewPoint" ) );
+ aProp.Name = sExtrusionViewPoint;
+ aProp.Value <<= aExtrusionViewPoint;
+ aExtrusionPropVec.push_back( aProp );
+ }
+ // "Origin"
+ if ( IsProperty( DFF_Prop_c3DOriginX ) || IsProperty( DFF_Prop_c3DOriginY ) )
+ {
+ const rtl::OUString sExtrusionOrigin( RTL_CONSTASCII_USTRINGPARAM ( "Origin" ) );
+ double fOriginX = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DOriginX, 0 ));
+ double fOriginY = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DOriginY, 0 ));
+ fOriginX /= 65536;
+ fOriginY /= 65536;
+ EnhancedCustomShapeParameterPair aOriginPair;
+ aOriginPair.First.Value <<= fOriginX;
+ aOriginPair.First.Type = EnhancedCustomShapeParameterType::NORMAL;
+ aOriginPair.Second.Value <<= fOriginY;
+ aOriginPair.Second.Type = EnhancedCustomShapeParameterType::NORMAL;
+ aProp.Name = sExtrusionOrigin;
+ aProp.Value <<= aOriginPair;
+ aExtrusionPropVec.push_back( aProp );
+ }
+ // "ExtrusionColor"
+ const rtl::OUString sExtrusionColor( RTL_CONSTASCII_USTRINGPARAM ( "Color" ) );
+ sal_Bool bExtrusionColor = IsProperty( DFF_Prop_c3DExtrusionColor ); // ( GetPropertyValue( DFF_Prop_fc3DLightFace ) & 2 ) != 0;
+ aProp.Name = sExtrusionColor;
+ aProp.Value <<= bExtrusionColor;
+ aExtrusionPropVec.push_back( aProp );
+ if ( IsProperty( DFF_Prop_c3DExtrusionColor ) )
+ rSet.Put( XSecondaryFillColorItem( String(), rManager.MSO_CLR_ToColor(
+ GetPropertyValue( DFF_Prop_c3DExtrusionColor ), DFF_Prop_c3DExtrusionColor ) ) );
+ // pushing the whole Extrusion element
+ const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
+ PropSeq aExtrusionPropSeq( aExtrusionPropVec.size() );
+ aIter = aExtrusionPropVec.begin();
+ aEnd = aExtrusionPropVec.end();
+ beans::PropertyValue* pExtrusionValues = aExtrusionPropSeq.getArray();
+ while ( aIter != aEnd )
+ *pExtrusionValues++ = *aIter++;
+ aProp.Name = sExtrusion;
+ aProp.Value <<= aExtrusionPropSeq;
+ aPropVec.push_back( aProp );
+ }
+
+ /////////////////////////////////////////
+ // "Equations" PropertySequence element //
+ /////////////////////////////////////////
+ if ( IsProperty( DFF_Prop_pFormulas ) )
+ {
+ sal_uInt16 i;
+ sal_uInt16 nNumElem = 0;
+ sal_uInt16 nNumElemMem = 0;
+ sal_uInt16 nElemSize = 8;
+
+ if ( SeekToContent( DFF_Prop_pFormulas, rIn ) )
+ rIn >> nNumElem >> nNumElemMem >> nElemSize;
+
+ sal_Int16 nP1, nP2, nP3;
+ sal_uInt16 nFlags;
+
+ uno::Sequence< rtl::OUString > aEquations( nNumElem );
+ for ( i = 0; i < nNumElem; i++ )
+ {
+ rIn >> nFlags >> nP1 >> nP2 >> nP3;
+ aEquations[ i ] = EnhancedCustomShape2d::GetEquation( nFlags, nP1, nP2, nP3 );
+ }
+ // pushing the whole Equations element
+ const rtl::OUString sEquations( RTL_CONSTASCII_USTRINGPARAM ( "Equations" ) );
+ aProp.Name = sEquations;
+ aProp.Value <<= aEquations;
+ aPropVec.push_back( aProp );
+ }
+
+ ////////////////////////////////////////
+ // "Handles" PropertySequence element //
+ ////////////////////////////////////////
+ if ( IsProperty( DFF_Prop_Handles ) )
+ {
+ sal_uInt16 i;
+ sal_uInt16 nNumElem = 0;
+ sal_uInt16 nNumElemMem = 0;
+ sal_uInt16 nElemSize = 36;
+
+ if ( SeekToContent( DFF_Prop_Handles, rIn ) )
+ rIn >> nNumElem >> nNumElemMem >> nElemSize;
+ if ( nElemSize == 36 )
+ {
+ uno::Sequence< beans::PropertyValues > aHandles( nNumElem );
+ for ( i = 0; i < nNumElem; i++ )
+ {
+ PropVec aHandlePropVec;
+ sal_uInt32 nFlags;
+ sal_Int32 nPositionX, nPositionY, nCenterX, nCenterY, nRangeXMin, nRangeXMax, nRangeYMin, nRangeYMax;
+ rIn >> nFlags
+ >> nPositionX
+ >> nPositionY
+ >> nCenterX
+ >> nCenterY
+ >> nRangeXMin
+ >> nRangeXMax
+ >> nRangeYMin
+ >> nRangeYMax;
+
+ if ( nPositionX == 2 ) // replacing center position with absolute value
+ nPositionX = nCoordWidth / 2;
+ if ( nPositionY == 2 )
+ nPositionY = nCoordHeight / 2;
+ EnhancedCustomShapeParameterPair aPosition;
+ EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aPosition.First, nPositionX, sal_True, sal_True );
+ EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aPosition.Second, nPositionY, sal_True, sal_False );
+ const rtl::OUString sHandlePosition( RTL_CONSTASCII_USTRINGPARAM ( "Position" ) );
+ aProp.Name = sHandlePosition;
+ aProp.Value <<= aPosition;
+ aHandlePropVec.push_back( aProp );
+
+ if ( nFlags & MSDFF_HANDLE_FLAGS_MIRRORED_X )
+ {
+ sal_Bool bMirroredX = sal_True;
+ const rtl::OUString sHandleMirroredX( RTL_CONSTASCII_USTRINGPARAM ( "MirroredX" ) );
+ aProp.Name = sHandleMirroredX;
+ aProp.Value <<= bMirroredX;
+ aHandlePropVec.push_back( aProp );
+ }
+ if ( nFlags & MSDFF_HANDLE_FLAGS_MIRRORED_Y )
+ {
+ sal_Bool bMirroredY = sal_True;
+ const rtl::OUString sHandleMirroredY( RTL_CONSTASCII_USTRINGPARAM ( "MirroredY" ) );
+ aProp.Name = sHandleMirroredY;
+ aProp.Value <<= bMirroredY;
+ aHandlePropVec.push_back( aProp );
+ }
+ if ( nFlags & MSDFF_HANDLE_FLAGS_SWITCHED )
+ {
+ sal_Bool bSwitched = sal_True;
+ const rtl::OUString sHandleSwitched( RTL_CONSTASCII_USTRINGPARAM ( "Switched" ) );
+ aProp.Name = sHandleSwitched;
+ aProp.Value <<= bSwitched;
+ aHandlePropVec.push_back( aProp );
+ }
+ if ( nFlags & MSDFF_HANDLE_FLAGS_POLAR )
+ {
+ if ( nCenterX == 2 )
+ nCenterX = nCoordWidth / 2;
+ if ( nCenterY == 2 )
+ nCenterY = nCoordHeight / 2;
+ if ( ( nPositionY >= 0x256 ) || ( nPositionY <= 0x107 ) ) // position y
+ nAdjustmentsWhichNeedsToBeConverted |= ( 1 << i );
+ EnhancedCustomShapeParameterPair aPolar;
+ EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aPolar.First, nCenterX, ( nFlags & 0x800 ) != 0, sal_True );
+ EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aPolar.Second, nCenterY, ( nFlags & 0x1000 ) != 0, sal_False );
+ const rtl::OUString sHandlePolar( RTL_CONSTASCII_USTRINGPARAM ( "Polar" ) );
+ aProp.Name = sHandlePolar;
+ aProp.Value <<= aPolar;
+ aHandlePropVec.push_back( aProp );
+ }
+ if ( nFlags & MSDFF_HANDLE_FLAGS_MAP )
+ {
+ if ( nCenterX == 2 )
+ nCenterX = nCoordWidth / 2;
+ if ( nCenterY == 2 )
+ nCenterY = nCoordHeight / 2;
+ EnhancedCustomShapeParameterPair aMap;
+ EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aMap.First, nCenterX, ( nFlags & 0x800 ) != 0, sal_True );
+ EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aMap.Second, nCenterY, ( nFlags & 0x1000 ) != 0, sal_False );
+ const rtl::OUString sHandleMap( RTL_CONSTASCII_USTRINGPARAM ( "Map" ) );
+ aProp.Name = sHandleMap;
+ aProp.Value <<= aMap;
+ aHandlePropVec.push_back( aProp );
+ }
+ if ( nFlags & MSDFF_HANDLE_FLAGS_RANGE )
+ {
+ if ( (sal_uInt32)nRangeXMin != 0x80000000 )
+ {
+ if ( nRangeXMin == 2 )
+ nRangeXMin = nCoordWidth / 2;
+ EnhancedCustomShapeParameter aRangeXMinimum;
+ EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRangeXMinimum, nRangeXMin,
+ ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL ) != 0, sal_True );
+ const rtl::OUString sHandleRangeXMinimum( RTL_CONSTASCII_USTRINGPARAM ( "RangeXMinimum" ) );
+ aProp.Name = sHandleRangeXMinimum;
+ aProp.Value <<= aRangeXMinimum;
+ aHandlePropVec.push_back( aProp );
+ }
+ if ( (sal_uInt32)nRangeXMax != 0x7fffffff )
+ {
+ if ( nRangeXMax == 2 )
+ nRangeXMax = nCoordWidth / 2;
+ EnhancedCustomShapeParameter aRangeXMaximum;
+ EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRangeXMaximum, nRangeXMax,
+ ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL ) != 0, sal_False );
+ const rtl::OUString sHandleRangeXMaximum( RTL_CONSTASCII_USTRINGPARAM ( "RangeXMaximum" ) );
+ aProp.Name = sHandleRangeXMaximum;
+ aProp.Value <<= aRangeXMaximum;
+ aHandlePropVec.push_back( aProp );
+ }
+ if ( (sal_uInt32)nRangeYMin != 0x80000000 )
+ {
+ if ( nRangeYMin == 2 )
+ nRangeYMin = nCoordHeight / 2;
+ EnhancedCustomShapeParameter aRangeYMinimum;
+ EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRangeYMinimum, nRangeYMin,
+ ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL ) != 0, sal_True );
+ const rtl::OUString sHandleRangeYMinimum( RTL_CONSTASCII_USTRINGPARAM ( "RangeYMinimum" ) );
+ aProp.Name = sHandleRangeYMinimum;
+ aProp.Value <<= aRangeYMinimum;
+ aHandlePropVec.push_back( aProp );
+ }
+ if ( (sal_uInt32)nRangeYMax != 0x7fffffff )
+ {
+ if ( nRangeYMax == 2 )
+ nRangeYMax = nCoordHeight / 2;
+ EnhancedCustomShapeParameter aRangeYMaximum;
+ EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRangeYMaximum, nRangeYMax,
+ ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL ) != 0, sal_False );
+ const rtl::OUString sHandleRangeYMaximum( RTL_CONSTASCII_USTRINGPARAM ( "RangeYMaximum" ) );
+ aProp.Name = sHandleRangeYMaximum;
+ aProp.Value <<= aRangeYMaximum;
+ aHandlePropVec.push_back( aProp );
+ }
+ }
+ if ( nFlags & MSDFF_HANDLE_FLAGS_RADIUS_RANGE )
+ {
+ if ( (sal_uInt32)nRangeXMin != 0x7fffffff )
+ {
+ if ( nRangeXMin == 2 )
+ nRangeXMin = nCoordWidth / 2;
+ EnhancedCustomShapeParameter aRadiusRangeMinimum;
+ EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRadiusRangeMinimum, nRangeXMin,
+ ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL ) != 0, sal_True );
+ const rtl::OUString sHandleRadiusRangeMinimum( RTL_CONSTASCII_USTRINGPARAM ( "RadiusRangeMinimum" ) );
+ aProp.Name = sHandleRadiusRangeMinimum;
+ aProp.Value <<= aRadiusRangeMinimum;
+ aHandlePropVec.push_back( aProp );
+ }
+ if ( (sal_uInt32)nRangeXMax != 0x80000000 )
+ {
+ if ( nRangeXMax == 2 )
+ nRangeXMax = nCoordWidth / 2;
+ EnhancedCustomShapeParameter aRadiusRangeMaximum;
+ EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRadiusRangeMaximum, nRangeXMax,
+ ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL ) != 0, sal_False );
+ const rtl::OUString sHandleRadiusRangeMaximum( RTL_CONSTASCII_USTRINGPARAM ( "RadiusRangeMaximum" ) );
+ aProp.Name = sHandleRadiusRangeMaximum;
+ aProp.Value <<= aRadiusRangeMaximum;
+ aHandlePropVec.push_back( aProp );
+ }
+ }
+ if ( aHandlePropVec.size() )
+ {
+ PropSeq aHandlePropSeq( aHandlePropVec.size() );
+ aIter = aHandlePropVec.begin();
+ aEnd = aHandlePropVec.end();
+ beans::PropertyValue* pHandleValues = aHandlePropSeq.getArray();
+ while ( aIter != aEnd )
+ *pHandleValues++ = *aIter++;
+ aHandles[ i ] = aHandlePropSeq;
+ }
+ }
+ // pushing the whole Handles element
+ const rtl::OUString sHandles( RTL_CONSTASCII_USTRINGPARAM ( "Handles" ) );
+ aProp.Name = sHandles;
+ aProp.Value <<= aHandles;
+ aPropVec.push_back( aProp );
+ }
+ }
+ else
+ {
+ const mso_CustomShape* pDefCustomShape = GetCustomShapeContent( rObjData.eShapeType );
+ if ( pDefCustomShape && pDefCustomShape->nHandles && pDefCustomShape->pHandles )
+ {
+ sal_Int32 i, nCnt = pDefCustomShape->nHandles;
+ const SvxMSDffHandle* pData = pDefCustomShape->pHandles;
+ for ( i = 0; i < nCnt; i++, pData++ )
+ {
+ if ( pData->nFlags & MSDFF_HANDLE_FLAGS_POLAR )
+ {
+ if ( ( pData->nPositionY >= 0x256 ) || ( pData->nPositionY <= 0x107 ) )
+ nAdjustmentsWhichNeedsToBeConverted |= ( 1 << i );
+ }
+ }
+ }
+ }
+ /////////////////////////////////////
+ // "Path" PropertySequence element //
+ /////////////////////////////////////
+ {
+ PropVec aPathPropVec;
+
+ // "Path/ExtrusionAllowed"
+ if ( IsHardAttribute( DFF_Prop_f3DOK ) )
+ {
+ const rtl::OUString sExtrusionAllowed( RTL_CONSTASCII_USTRINGPARAM ( "ExtrusionAllowed" ) );
+ sal_Bool bExtrusionAllowed = ( GetPropertyValue( DFF_Prop_fFillOK ) & 16 ) != 0;
+ aProp.Name = sExtrusionAllowed;
+ aProp.Value <<= bExtrusionAllowed;
+ aPathPropVec.push_back( aProp );
+ }
+ // "Path/ConcentricGradientFillAllowed"
+ if ( IsHardAttribute( DFF_Prop_fFillShadeShapeOK ) )
+ {
+ const rtl::OUString sConcentricGradientFillAllowed( RTL_CONSTASCII_USTRINGPARAM ( "ConcentricGradientFillAllowed" ) );
+ sal_Bool bConcentricGradientFillAllowed = ( GetPropertyValue( DFF_Prop_fFillOK ) & 2 ) != 0;
+ aProp.Name = sConcentricGradientFillAllowed;
+ aProp.Value <<= bConcentricGradientFillAllowed;
+ aPathPropVec.push_back( aProp );
+ }
+ // "Path/TextPathAllowed"
+ if ( IsHardAttribute( DFF_Prop_fGtextOK ) || ( GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ) & 0x4000 ) )
+ {
+ const rtl::OUString sTextPathAllowed( RTL_CONSTASCII_USTRINGPARAM ( "TextPathAllowed" ) );
+ sal_Bool bTextPathAllowed = ( GetPropertyValue( DFF_Prop_fFillOK ) & 4 ) != 0;
+ aProp.Name = sTextPathAllowed;
+ aProp.Value <<= bTextPathAllowed;
+ aPathPropVec.push_back( aProp );
+ }
+ // Path/Coordinates
+ if ( IsProperty( DFF_Prop_pVertices ) )
+ {
+ com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aCoordinates;
+
+ sal_uInt16 i;
+ sal_uInt16 nNumElemVert = 0;
+ sal_uInt16 nNumElemMemVert = 0;
+ sal_uInt16 nElemSizeVert = 8;
+
+ if ( SeekToContent( DFF_Prop_pVertices, rIn ) )
+ rIn >> nNumElemVert >> nNumElemMemVert >> nElemSizeVert;
+ if ( nNumElemVert )
+ {
+ sal_Int32 nX, nY;
+ sal_Int16 nTmpA, nTmpB;
+ aCoordinates.realloc( nNumElemVert );
+ for ( i = 0; i < nNumElemVert; i++ )
+ {
+ if ( nElemSizeVert == 8 )
+ {
+ rIn >> nX
+ >> nY;
+ }
+ else
+ {
+ rIn >> nTmpA
+ >> nTmpB;
+
+ nX = nTmpA;
+ nY = nTmpB;
+ }
+ EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aCoordinates[ i ].First, nX );
+ EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aCoordinates[ i ].Second, nY );
+ }
+ }
+ const rtl::OUString sCoordinates( RTL_CONSTASCII_USTRINGPARAM ( "Coordinates" ) );
+ aProp.Name = sCoordinates;
+ aProp.Value <<= aCoordinates;
+ aPathPropVec.push_back( aProp );
+ }
+ // Path/Segments
+ if ( IsProperty( DFF_Prop_pSegmentInfo ) )
+ {
+ com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeSegment > aSegments;
+
+ sal_uInt16 i, nTmp;
+ sal_uInt16 nNumElemSeg = 0;
+ sal_uInt16 nNumElemMemSeg = 0;
+ sal_uInt16 nElemSizeSeg = 2;
+
+ if ( SeekToContent( DFF_Prop_pSegmentInfo, rIn ) )
+ rIn >> nNumElemSeg >> nNumElemMemSeg >> nElemSizeSeg;
+ if ( nNumElemSeg )
+ {
+ sal_Int16 nCommand;
+ sal_Int16 nCnt;
+ aSegments.realloc( nNumElemSeg );
+ for ( i = 0; i < nNumElemSeg; i++ )
+ {
+ rIn >> nTmp;
+ nCommand = EnhancedCustomShapeSegmentCommand::UNKNOWN;
+ nCnt = (sal_Int16)( nTmp & 0xfff );
+ switch( nTmp >> 12 )
+ {
+ case 0x0: nCommand = EnhancedCustomShapeSegmentCommand::LINETO; if ( !nCnt ) nCnt = 1; break;
+ case 0x1: nCommand = EnhancedCustomShapeSegmentCommand::LINETO; if ( !nCnt ) nCnt = 1; break; // seems to the relative lineto
+ case 0x4: nCommand = EnhancedCustomShapeSegmentCommand::MOVETO; if ( !nCnt ) nCnt = 1; break;
+ case 0x2: nCommand = EnhancedCustomShapeSegmentCommand::CURVETO; if ( !nCnt ) nCnt = 1; break;
+ case 0x3: nCommand = EnhancedCustomShapeSegmentCommand::CURVETO; if ( !nCnt ) nCnt = 1; break; // seems to be the relative curveto
+ case 0x8: nCommand = EnhancedCustomShapeSegmentCommand::ENDSUBPATH; nCnt = 0; break;
+ case 0x6: nCommand = EnhancedCustomShapeSegmentCommand::CLOSESUBPATH; nCnt = 0; break;
+ case 0xa:
+ case 0xb:
+ {
+ switch ( ( nTmp >> 8 ) & 0xf )
+ {
+ case 0x0:
+ {
+ nCommand = EnhancedCustomShapeSegmentCommand::LINETO;
+ if ( !nCnt )
+ nCnt = 1;
+ }
+ break;
+ case 0x1:
+ {
+ nCommand = EnhancedCustomShapeSegmentCommand::ANGLEELLIPSETO;
+ nCnt = ( nTmp & 0xff ) / 3;
+ }
+ break;
+ case 0x2:
+ {
+ nCommand = EnhancedCustomShapeSegmentCommand::ANGLEELLIPSE;
+ nCnt = ( nTmp & 0xff ) / 3;
+ }
+ break;
+ case 0x3:
+ {
+ nCommand = EnhancedCustomShapeSegmentCommand::ARCTO;
+ nCnt = ( nTmp & 0xff ) >> 2;
+ };
+ break;
+ case 0x4:
+ {
+ nCommand = EnhancedCustomShapeSegmentCommand::ARC;
+ nCnt = ( nTmp & 0xff ) >> 2;
+ }
+ break;
+ case 0x5:
+ {
+ nCommand = EnhancedCustomShapeSegmentCommand::CLOCKWISEARCTO;
+ nCnt = ( nTmp & 0xff ) >> 2;
+ }
+ break;
+ case 0x6:
+ {
+ nCommand = EnhancedCustomShapeSegmentCommand::CLOCKWISEARC;
+ nCnt = ( nTmp & 0xff ) >> 2;
+ }
+ break;
+ case 0x7:
+ {
+ nCommand = EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTX;
+ nCnt = nTmp & 0xff;
+ }
+ break;
+ case 0x8:
+ {
+ nCommand = EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTY;
+ nCnt = nTmp & 0xff;
+ }
+ break;
+ case 0xa: nCommand = EnhancedCustomShapeSegmentCommand::NOFILL; nCnt = 0; break;
+ case 0xb: nCommand = EnhancedCustomShapeSegmentCommand::NOSTROKE; nCnt = 0; break;
+ }
+ }
+ break;
+ }
+ // if the command is unknown, we will store all the data in nCnt, so it will be possible to export without loss
+ if ( nCommand == EnhancedCustomShapeSegmentCommand::UNKNOWN )
+ nCnt = (sal_Int16)nTmp;
+ aSegments[ i ].Command = nCommand;
+ aSegments[ i ].Count = nCnt;
+ }
+ }
+ const rtl::OUString sSegments( RTL_CONSTASCII_USTRINGPARAM ( "Segments" ) );
+ aProp.Name = sSegments;
+ aProp.Value <<= aSegments;
+ aPathPropVec.push_back( aProp );
+ }
+ // Path/StretchX
+ if ( IsProperty( DFF_Prop_stretchPointX ) )
+ {
+ const rtl::OUString sStretchX( RTL_CONSTASCII_USTRINGPARAM ( "StretchX" ) );
+ sal_Int32 nStretchX = GetPropertyValue( DFF_Prop_stretchPointX, 0 );
+ aProp.Name = sStretchX;
+ aProp.Value <<= nStretchX;
+ aPathPropVec.push_back( aProp );
+ }
+ // Path/StretchX
+ if ( IsProperty( DFF_Prop_stretchPointY ) )
+ {
+ const rtl::OUString sStretchY( RTL_CONSTASCII_USTRINGPARAM ( "StretchY" ) );
+ sal_Int32 nStretchY = GetPropertyValue( DFF_Prop_stretchPointY, 0 );
+ aProp.Name = sStretchY;
+ aProp.Value <<= nStretchY;
+ aPathPropVec.push_back( aProp );
+ }
+ // Path/TextFrames
+ if ( IsProperty( DFF_Prop_textRectangles ) )
+ {
+ sal_uInt16 i;
+ sal_uInt16 nNumElem = 0;
+ sal_uInt16 nNumElemMem = 0;
+ sal_uInt16 nElemSize = 16;
+
+ if ( SeekToContent( DFF_Prop_textRectangles, rIn ) )
+ rIn >> nNumElem >> nNumElemMem >> nElemSize;
+ if ( nElemSize == 16 )
+ {
+ sal_Int32 nLeft, nTop, nRight, nBottom;
+ com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeTextFrame > aTextFrames( nNumElem );
+ for ( i = 0; i < nNumElem; i++ )
+ {
+ rIn >> nLeft
+ >> nTop
+ >> nRight
+ >> nBottom;
+
+ EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrames[ i ].TopLeft.First, nLeft );
+ EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrames[ i ].TopLeft.Second, nTop );
+ EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrames[ i ].BottomRight.First, nRight );
+ EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrames[ i ].BottomRight.Second, nBottom);
+ }
+ const rtl::OUString sTextFrames( RTL_CONSTASCII_USTRINGPARAM ( "TextFrames" ) );
+ aProp.Name = sTextFrames;
+ aProp.Value <<= aTextFrames;
+ aPathPropVec.push_back( aProp );
+ }
+ }
+ //Path/GluePoints
+ if ( IsProperty( DFF_Prop_connectorPoints ) )
+ {
+ com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aGluePoints;
+
+ sal_uInt16 i;
+ sal_uInt16 nNumElemVert = 0;
+ sal_uInt16 nNumElemMemVert = 0;
+ sal_uInt16 nElemSizeVert = 8;
+
+ if ( SeekToContent( DFF_Prop_connectorPoints, rIn ) )
+ rIn >> nNumElemVert >> nNumElemMemVert >> nElemSizeVert;
+
+ sal_Int32 nX, nY;
+ sal_Int16 nTmpA, nTmpB;
+ aGluePoints.realloc( nNumElemVert );
+ for ( i = 0; i < nNumElemVert; i++ )
+ {
+ if ( nElemSizeVert == 8 )
+ {
+ rIn >> nX
+ >> nY;
+ }
+ else
+ {
+ rIn >> nTmpA
+ >> nTmpB;
+
+ nX = nTmpA;
+ nY = nTmpB;
+ }
+ EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aGluePoints[ i ].First, nX );
+ EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aGluePoints[ i ].Second, nY );
+ }
+ const rtl::OUString sGluePoints( RTL_CONSTASCII_USTRINGPARAM ( "GluePoints" ) );
+ aProp.Name = sGluePoints;
+ aProp.Value <<= aGluePoints;
+ aPathPropVec.push_back( aProp );
+ }
+ if ( IsProperty( DFF_Prop_connectorType ) )
+ {
+ sal_Int16 nGluePointType = (sal_uInt16)GetPropertyValue( DFF_Prop_connectorType );
+ const rtl::OUString sGluePointType( RTL_CONSTASCII_USTRINGPARAM ( "GluePointType" ) );
+ aProp.Name = sGluePointType;
+ aProp.Value <<= nGluePointType;
+ aPathPropVec.push_back( aProp );
+ }
+ // pushing the whole Path element
+ if ( aPathPropVec.size() )
+ {
+ const rtl::OUString sPath( RTL_CONSTASCII_USTRINGPARAM ( "Path" ) );
+ PropSeq aPathPropSeq( aPathPropVec.size() );
+ aIter = aPathPropVec.begin();
+ aEnd = aPathPropVec.end();
+ beans::PropertyValue* pPathValues = aPathPropSeq.getArray();
+ while ( aIter != aEnd )
+ *pPathValues++ = *aIter++;
+ aProp.Name = sPath;
+ aProp.Value <<= aPathPropSeq;
+ aPropVec.push_back( aProp );
+ }
+ }
+ /////////////////////////////////////////
+ // "TextPath" PropertySequence element //
+ /////////////////////////////////////////
+ sal_Bool bTextPathOn = ( GetPropertyValue( DFF_Prop_gtextFStrikethrough ) & 0x4000 ) != 0;
+ if ( bTextPathOn )
+ {
+ PropVec aTextPathPropVec;
+
+ // TextPath
+ const rtl::OUString sTextPathOn( RTL_CONSTASCII_USTRINGPARAM ( "TextPath" ) );
+ aProp.Name = sTextPathOn;
+ aProp.Value <<= bTextPathOn;
+ aTextPathPropVec.push_back( aProp );
+
+ // TextPathMode
+ const rtl::OUString sTextPathMode( RTL_CONSTASCII_USTRINGPARAM ( "TextPathMode" ) );
+ sal_Bool bTextPathFitPath = ( GetPropertyValue( DFF_Prop_gtextFStrikethrough ) & 0x100 ) != 0;
+
+ sal_Bool bTextPathFitShape;
+ if ( IsHardAttribute( DFF_Prop_gtextFStretch ) )
+ bTextPathFitShape = ( GetPropertyValue( DFF_Prop_gtextFStrikethrough ) & 0x400 ) != 0;
+ else
+ {
+ bTextPathFitShape = true;
+ switch( rObjData.eShapeType )
+ {
+ case mso_sptTextArchUpCurve :
+ case mso_sptTextArchDownCurve :
+ case mso_sptTextCircleCurve :
+ case mso_sptTextButtonCurve :
+ bTextPathFitShape = false;
+ default : break;
+ }
+ }
+ EnhancedCustomShapeTextPathMode eTextPathMode( EnhancedCustomShapeTextPathMode_NORMAL );
+ if ( bTextPathFitShape )
+ eTextPathMode = EnhancedCustomShapeTextPathMode_SHAPE;
+ else if ( bTextPathFitPath )
+ eTextPathMode = EnhancedCustomShapeTextPathMode_PATH;
+ aProp.Name = sTextPathMode;
+ aProp.Value <<= eTextPathMode;
+ aTextPathPropVec.push_back( aProp );
+
+ // ScaleX
+ const rtl::OUString sTextPathScaleX( RTL_CONSTASCII_USTRINGPARAM ( "ScaleX" ) );
+ sal_Bool bTextPathScaleX = ( GetPropertyValue( DFF_Prop_gtextFStrikethrough ) & 0x40 ) != 0;
+ aProp.Name = sTextPathScaleX;
+ aProp.Value <<= bTextPathScaleX;
+ aTextPathPropVec.push_back( aProp );
+ // SameLetterHeights
+ const rtl::OUString sSameLetterHeight( RTL_CONSTASCII_USTRINGPARAM ( "SameLetterHeights" ) );
+ sal_Bool bSameLetterHeight = ( GetPropertyValue( DFF_Prop_gtextFStrikethrough ) & 0x80 ) != 0;
+ aProp.Name = sSameLetterHeight;
+ aProp.Value <<= bSameLetterHeight;
+ aTextPathPropVec.push_back( aProp );
+
+ // pushing the whole TextPath element
+ const rtl::OUString sTextPath( RTL_CONSTASCII_USTRINGPARAM ( "TextPath" ) );
+ PropSeq aTextPathPropSeq( aTextPathPropVec.size() );
+ aIter = aTextPathPropVec.begin();
+ aEnd = aTextPathPropVec.end();
+ beans::PropertyValue* pTextPathValues = aTextPathPropSeq.getArray();
+ while ( aIter != aEnd )
+ *pTextPathValues++ = *aIter++;
+ aProp.Name = sTextPath;
+ aProp.Value <<= aTextPathPropSeq;
+ aPropVec.push_back( aProp );
+ }
+ ////////////////////////
+ // "AdjustmentValues" // The AdjustmentValues are imported at last, because depending to the type of the
+ //////////////////////// handle (POLAR) we will convert the adjustment value from a fixed float to double
+
+ // checking the last used adjustment handle, so we can determine how many handles are to allocate
+ sal_Int32 i = DFF_Prop_adjust10Value;
+ while ( ( i >= DFF_Prop_adjustValue ) && !IsProperty( i ) )
+ i--;
+ sal_Int32 nAdjustmentValues = ( i - DFF_Prop_adjustValue ) + 1;
+ if ( nAdjustmentValues )
+ {
+ uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue > aAdjustmentSeq( nAdjustmentValues );
+ while( --nAdjustmentValues >= 0 )
+ {
+ sal_Int32 nValue = 0;
+ beans::PropertyState ePropertyState = beans::PropertyState_DEFAULT_VALUE;
+ if ( IsProperty( i ) )
+ {
+ nValue = GetPropertyValue( i );
+ ePropertyState = beans::PropertyState_DIRECT_VALUE;
+ }
+ if ( nAdjustmentsWhichNeedsToBeConverted & ( 1 << ( i - DFF_Prop_adjustValue ) ) )
+ {
+ double fValue = nValue;
+ fValue /= 65536;
+ aAdjustmentSeq[ nAdjustmentValues ].Value <<= fValue;
+ }
+ else
+ aAdjustmentSeq[ nAdjustmentValues ].Value <<= nValue;
+ aAdjustmentSeq[ nAdjustmentValues ].State = ePropertyState;
+ i--;
+ }
+ const rtl::OUString sAdjustmentValues( RTL_CONSTASCII_USTRINGPARAM ( "AdjustmentValues" ) );
+ aProp.Name = sAdjustmentValues;
+ aProp.Value <<= aAdjustmentSeq;
+ aPropVec.push_back( aProp );
+ }
+
+ // creating the whole property set
+ PropSeq aSeq( aPropVec.size() );
+ beans::PropertyValue* pValues = aSeq.getArray();
+ aIter = aPropVec.begin();
+ aEnd = aPropVec.end();
+ while ( aIter != aEnd )
+ *pValues++ = *aIter++;
+ rSet.Put( SdrCustomShapeGeometryItem( aSeq ) );
+}
+
+void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet ) const
+{
+ Rectangle aEmptyRect;
+ DffRecordHeader aHdTemp;
+ DffObjData aDffObjTemp( aHdTemp, aEmptyRect, 0 );
+ ApplyAttributes( rIn, rSet, aDffObjTemp );
+}
+
+void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, const DffObjData& rObjData ) const
+{
+// MapUnit eMap( rManager.GetModel()->GetScaleUnit() );
+
+ for ( void* pDummy = ((DffPropertyReader*)this)->First(); pDummy; pDummy = ((DffPropertyReader*)this)->Next() )
+ {
+ UINT32 nRecType = GetCurKey();
+ UINT32 nContent = mpContents[ nRecType ];
+ switch ( nRecType )
+ {
+ case DFF_Prop_gtextSize :
+ rSet.Put( SvxFontHeightItem( rManager.ScalePt( nContent ), 100, EE_CHAR_FONTHEIGHT ) );
+ break;
+ // GeoText
+ case DFF_Prop_gtextFStrikethrough :
+ {
+ if ( nContent & 0x20 )
+ rSet.Put( SvxWeightItem( nContent ? WEIGHT_BOLD : WEIGHT_NORMAL, EE_CHAR_WEIGHT ) );
+ if ( nContent & 0x10 )
+ rSet.Put( SvxPostureItem( nContent ? ITALIC_NORMAL : ITALIC_NONE, EE_CHAR_ITALIC ) );
+ if ( nContent & 0x08 )
+ rSet.Put( SvxUnderlineItem( nContent ? UNDERLINE_SINGLE : UNDERLINE_NONE, EE_CHAR_UNDERLINE ) );
+ if ( nContent & 0x40 )
+ rSet.Put(SvxShadowedItem( nContent != 0, EE_CHAR_SHADOW ) );
+// if ( nContent & 0x02 )
+// rSet.Put( SvxCaseMapItem( nContent ? SVX_CASEMAP_KAPITAELCHEN : SVX_CASEMAP_NOT_MAPPED ) );
+ if ( nContent & 0x01 )
+ rSet.Put( SvxCrossedOutItem( nContent ? STRIKEOUT_SINGLE : STRIKEOUT_NONE, EE_CHAR_STRIKEOUT ) );
+ }
+ break;
+
+ case DFF_Prop_fillColor :
+ rSet.Put( XFillColorItem( String(), rManager.MSO_CLR_ToColor( nContent, DFF_Prop_fillColor ) ) );
+ break;
+
+ // ShadowStyle
+ case DFF_Prop_shadowType :
+ {
+ MSO_ShadowType eShadowType = (MSO_ShadowType)nContent;
+ if( eShadowType != mso_shadowOffset )
+ {
+ // mso_shadowDouble
+ // mso_shadowRich
+ // mso_shadowEmbossOrEngrave
+ // koennen wir nicht, kreiere Default-Schatten mit default-
+ // Abstand
+ rSet.Put( SdrShadowXDistItem( 35 ) ); // 0,35 mm Schattendistanz
+ rSet.Put( SdrShadowYDistItem( 35 ) );
+ }
+ }
+ break;
+ case DFF_Prop_shadowColor :
+ rSet.Put( SdrShadowColorItem( String(), rManager.MSO_CLR_ToColor( nContent, DFF_Prop_shadowColor ) ) );
+ break;
+ case DFF_Prop_shadowOpacity :
+ rSet.Put( SdrShadowTransparenceItem( (sal_uInt16)( ( 0x10000 - nContent ) / 655 ) ) );
+ break;
+ case DFF_Prop_shadowOffsetX :
+ {
+ INT32 nVal = (INT32)nContent;
+ rManager.ScaleEmu( nVal );
+ if ( nVal )
+ rSet.Put( SdrShadowXDistItem( nVal ) );
+ }
+ break;
+ case DFF_Prop_shadowOffsetY :
+ {
+ INT32 nVal = (INT32)nContent;
+ rManager.ScaleEmu( nVal );
+ if ( nVal )
+ rSet.Put( SdrShadowYDistItem( nVal ) );
+ }
+ break;
+ case DFF_Prop_fshadowObscured :
+ {
+ sal_Bool bHasShadow = ( nContent & 2 ) != 0;
+ rSet.Put( SdrShadowItem( bHasShadow ) );
+ if ( bHasShadow )
+ {
+ if ( !IsProperty( DFF_Prop_shadowOffsetX ) )
+ rSet.Put( SdrShadowXDistItem( 35 ) );
+ if ( !IsProperty( DFF_Prop_shadowOffsetY ) )
+ rSet.Put( SdrShadowYDistItem( 35 ) );
+ }
+ }
+ break;
+ }
+ }
+
+ ApplyLineAttributes( rSet, rObjData.eShapeType ); // #i28269#
+ ApplyFillAttributes( rIn, rSet, rObjData );
+ if ( rObjData.eShapeType != mso_sptNil )
+ {
+ ApplyCustomShapeGeometryAttributes( rIn, rSet, rObjData );
+ ApplyCustomShapeTextAttributes( rSet );
+ }
+}
+
+//---------------------------------------------------------------------------
+//- Record Manager ----------------------------------------------------------
+//---------------------------------------------------------------------------
+
+DffRecordList::DffRecordList( DffRecordList* pList ) :
+ nCount ( 0 ),
+ nCurrent ( 0 ),
+ pPrev ( pList ),
+ pNext ( NULL )
+{
+ if ( pList )
+ pList->pNext = this;
+}
+
+DffRecordList::~DffRecordList()
+{
+ delete pNext;
+}
+
+DffRecordManager::DffRecordManager() :
+ DffRecordList ( NULL ),
+ pCList ( (DffRecordList*)this )
+{
+}
+
+DffRecordManager::DffRecordManager( SvStream& rIn ) :
+ DffRecordList ( NULL ),
+ pCList ( (DffRecordList*)this )
+{
+ Consume( rIn );
+}
+
+DffRecordManager::~DffRecordManager()
+{
+};
+
+
+void DffRecordManager::Consume( SvStream& rIn, BOOL bAppend, UINT32 nStOfs )
+{
+ if ( !bAppend )
+ Clear();
+ UINT32 nOldPos = rIn.Tell();
+ if ( !nStOfs )
+ {
+ DffRecordHeader aHd;
+ rIn >> aHd;
+ if ( aHd.nRecVer == DFF_PSFLAG_CONTAINER )
+ nStOfs = aHd.GetRecEndFilePos();
+ }
+ if ( nStOfs )
+ {
+ pCList = (DffRecordList*)this;
+ while ( pCList->pNext )
+ pCList = pCList->pNext;
+ while ( ( rIn.GetError() == 0 ) && ( ( rIn.Tell() + 8 ) <= nStOfs ) )
+ {
+ if ( pCList->nCount == DFF_RECORD_MANAGER_BUF_SIZE )
+ pCList = new DffRecordList( pCList );
+ rIn >> pCList->mHd[ pCList->nCount ];
+ pCList->mHd[ pCList->nCount++ ].SeekToEndOfRecord( rIn );
+ }
+ rIn.Seek( nOldPos );
+ }
+}
+
+void DffRecordManager::Clear()
+{
+ pCList = (DffRecordList*)this;
+ delete pNext, pNext = NULL;
+ nCurrent = 0;
+ nCount = 0;
+}
+
+DffRecordHeader* DffRecordManager::Current()
+{
+ DffRecordHeader* pRet = NULL;
+ if ( pCList->nCurrent < pCList->nCount )
+ pRet = &pCList->mHd[ pCList->nCurrent ];
+ return pRet;
+}
+
+DffRecordHeader* DffRecordManager::First()
+{
+ DffRecordHeader* pRet = NULL;
+ pCList = (DffRecordList*)this;
+ if ( pCList->nCount )
+ {
+ pCList->nCurrent = 0;
+ pRet = &pCList->mHd[ 0 ];
+ }
+ return pRet;
+}
+
+DffRecordHeader* DffRecordManager::Next()
+{
+ DffRecordHeader* pRet = NULL;
+ UINT32 nC = pCList->nCurrent + 1;
+ if ( nC < pCList->nCount )
+ {
+ pCList->nCurrent++;
+ pRet = &pCList->mHd[ nC ];
+ }
+ else if ( pCList->pNext )
+ {
+ pCList = pCList->pNext;
+ pCList->nCurrent = 0;
+ pRet = &pCList->mHd[ 0 ];
+ }
+ return pRet;
+}
+
+DffRecordHeader* DffRecordManager::Prev()
+{
+ DffRecordHeader* pRet = NULL;
+ UINT32 nCur = pCList->nCurrent;
+ if ( !nCur && pCList->pPrev )
+ {
+ pCList = pCList->pPrev;
+ nCur = pCList->nCount;
+ }
+ if ( nCur-- )
+ {
+ pCList->nCurrent = nCur;
+ pRet = &pCList->mHd[ nCur ];
+ }
+ return pRet;
+}
+
+DffRecordHeader* DffRecordManager::Last()
+{
+ DffRecordHeader* pRet = NULL;
+ while ( pCList->pNext )
+ pCList = pCList->pNext;
+ UINT32 nCnt = pCList->nCount;
+ if ( nCnt-- )
+ {
+ pCList->nCurrent = nCnt;
+ pRet = &pCList->mHd[ nCnt ];
+ }
+ return pRet;
+}
+
+BOOL DffRecordManager::SeekToContent( SvStream& rIn, UINT16 nRecId, DffSeekToContentMode eMode )
+{
+ DffRecordHeader* pHd = GetRecordHeader( nRecId, eMode );
+ if ( pHd )
+ {
+ pHd->SeekToContent( rIn );
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
+
+DffRecordHeader* DffRecordManager::GetRecordHeader( UINT16 nRecId, DffSeekToContentMode eMode )
+{
+ UINT32 nOldCurrent = pCList->nCurrent;
+ DffRecordList* pOldList = pCList;
+ DffRecordHeader* pHd;
+
+ if ( eMode == SEEK_FROM_BEGINNING )
+ pHd = First();
+ else
+ pHd = Next();
+
+ while ( pHd )
+ {
+ if ( pHd->nRecType == nRecId )
+ break;
+ pHd = Next();
+ }
+ if ( !pHd && eMode == SEEK_FROM_CURRENT_AND_RESTART )
+ {
+ DffRecordHeader* pBreak = &pOldList->mHd[ nOldCurrent ];
+ pHd = First();
+ if ( pHd )
+ {
+ while ( pHd != pBreak )
+ {
+ if ( pHd->nRecType == nRecId )
+ break;
+ pHd = Next();
+ }
+ if ( pHd->nRecType != nRecId )
+ pHd = NULL;
+ }
+ }
+ if ( !pHd )
+ {
+ pCList = pOldList;
+ pOldList->nCurrent = nOldCurrent;
+ }
+ return pHd;
+}
+
+//---------------------------------------------------------------------------
+// private Methoden
+//---------------------------------------------------------------------------
+
+struct EscherBlipCacheEntry
+{
+ ByteString aUniqueID;
+ sal_uInt32 nBlip;
+
+ EscherBlipCacheEntry( sal_uInt32 nBlipId, const ByteString& rUniqueID ) :
+ aUniqueID( rUniqueID ),
+ nBlip( nBlipId ) {}
+};
+
+void SvxMSDffManager::Scale( sal_Int32& rVal ) const
+{
+ if ( bNeedMap )
+ rVal = BigMulDiv( rVal, nMapMul, nMapDiv );
+}
+
+void SvxMSDffManager::Scale( Point& rPos ) const
+{
+ rPos.X() += nMapXOfs;
+ rPos.Y() += nMapYOfs;
+ if ( bNeedMap )
+ {
+ rPos.X() = BigMulDiv( rPos.X(), nMapMul, nMapDiv );
+ rPos.Y() = BigMulDiv( rPos.Y(), nMapMul, nMapDiv );
+ }
+}
+
+void SvxMSDffManager::Scale( Size& rSiz ) const
+{
+ if ( bNeedMap )
+ {
+ rSiz.Width() = BigMulDiv( rSiz.Width(), nMapMul, nMapDiv );
+ rSiz.Height() = BigMulDiv( rSiz.Height(), nMapMul, nMapDiv );
+ }
+}
+
+void SvxMSDffManager::Scale( Rectangle& rRect ) const
+{
+ rRect.Move( nMapXOfs, nMapYOfs );
+ if ( bNeedMap )
+ {
+ rRect.Left() =BigMulDiv( rRect.Left() , nMapMul, nMapDiv );
+ rRect.Top() =BigMulDiv( rRect.Top() , nMapMul, nMapDiv );
+ rRect.Right() =BigMulDiv( rRect.Right() , nMapMul, nMapDiv );
+ rRect.Bottom()=BigMulDiv( rRect.Bottom(), nMapMul, nMapDiv );
+ }
+}
+
+void SvxMSDffManager::Scale( Polygon& rPoly ) const
+{
+ if ( !bNeedMap )
+ return;
+ USHORT nPointAnz = rPoly.GetSize();
+ for ( USHORT nPointNum = 0; nPointNum < nPointAnz; nPointNum++ )
+ Scale( rPoly[ nPointNum ] );
+}
+
+void SvxMSDffManager::Scale( PolyPolygon& rPoly ) const
+{
+ if ( !bNeedMap )
+ return;
+ USHORT nPolyAnz = rPoly.Count();
+ for ( USHORT nPolyNum = 0; nPolyNum < nPolyAnz; nPolyNum++ )
+ Scale( rPoly[ nPolyNum ] );
+}
+
+void SvxMSDffManager::ScaleEmu( sal_Int32& rVal ) const
+{
+ rVal = BigMulDiv( rVal, nEmuMul, nEmuDiv );
+}
+
+UINT32 SvxMSDffManager::ScalePt( UINT32 nVal ) const
+{
+ MapUnit eMap = pSdrModel->GetScaleUnit();
+ Fraction aFact( GetMapFactor( MAP_POINT, eMap ).X() );
+ long aMul = aFact.GetNumerator();
+ long aDiv = aFact.GetDenominator() * 65536;
+ aFact = Fraction( aMul, aDiv ); // nochmal versuchen zu kuerzen
+ return BigMulDiv( nVal, aFact.GetNumerator(), aFact.GetDenominator() );
+}
+
+INT32 SvxMSDffManager::ScalePoint( INT32 nVal ) const
+{
+ return BigMulDiv( nVal, nPntMul, nPntDiv );
+};
+
+void SvxMSDffManager::SetModel(SdrModel* pModel, long nApplicationScale)
+{
+ pSdrModel = pModel;
+ if( pModel && (0 < nApplicationScale) )
+ {
+ // PPT arbeitet nur mit Einheiten zu 576DPI
+ // WW hingegen verwendet twips, dh. 1440DPI.
+ MapUnit eMap = pSdrModel->GetScaleUnit();
+ Fraction aFact( GetMapFactor(MAP_INCH, eMap).X() );
+ long nMul=aFact.GetNumerator();
+ long nDiv=aFact.GetDenominator()*nApplicationScale;
+ aFact=Fraction(nMul,nDiv); // nochmal versuchen zu kuerzen
+ // Bei 100TH_MM -> 2540/576=635/144
+ // Bei Twip -> 1440/576=5/2
+ nMapMul = aFact.GetNumerator();
+ nMapDiv = aFact.GetDenominator();
+ bNeedMap = nMapMul!=nMapDiv;
+
+ // MS-DFF-Properties sind grossteils in EMU (English Metric Units) angegeben
+ // 1mm=36000emu, 1twip=635emu
+ aFact=GetMapFactor(MAP_100TH_MM,eMap).X();
+ nMul=aFact.GetNumerator();
+ nDiv=aFact.GetDenominator()*360;
+ aFact=Fraction(nMul,nDiv); // nochmal versuchen zu kuerzen
+ // Bei 100TH_MM -> 1/360
+ // Bei Twip -> 14,40/(25,4*360)=144/91440=1/635
+ nEmuMul=aFact.GetNumerator();
+ nEmuDiv=aFact.GetDenominator();
+
+ // Und noch was fuer typografische Points
+ aFact=GetMapFactor(MAP_POINT,eMap).X();
+ nPntMul=aFact.GetNumerator();
+ nPntDiv=aFact.GetDenominator();
+ }
+ else
+ {
+ pModel = 0;
+ nMapMul = nMapDiv = nMapXOfs = nMapYOfs = nEmuMul = nEmuDiv = nPntMul = nPntDiv = 0;
+ bNeedMap = FALSE;
+ }
+}
+
+BOOL SvxMSDffManager::SeekToShape( SvStream& rSt, void* /* pClientData */, UINT32 nId ) const
+{
+ BOOL bRet = FALSE;
+ if ( mpFidcls )
+ {
+ UINT32 nMerk = rSt.Tell();
+ UINT32 nShapeId, nSec = ( nId >> 10 ) - 1;
+ if ( nSec < mnIdClusters )
+ {
+ sal_IntPtr nOfs = (sal_IntPtr)maDgOffsetTable.Get( mpFidcls[ nSec ].dgid );
+ if ( nOfs )
+ {
+ rSt.Seek( nOfs );
+ DffRecordHeader aEscherF002Hd;
+ rSt >> aEscherF002Hd;
+ ULONG nEscherF002End = aEscherF002Hd.GetRecEndFilePos();
+ DffRecordHeader aEscherObjListHd;
+ while ( rSt.Tell() < nEscherF002End )
+ {
+ rSt >> aEscherObjListHd;
+ if ( aEscherObjListHd.nRecVer != 0xf )
+ aEscherObjListHd.SeekToEndOfRecord( rSt );
+ else if ( aEscherObjListHd.nRecType == DFF_msofbtSpContainer )
+ {
+ DffRecordHeader aShapeHd;
+ if ( SeekToRec( rSt, DFF_msofbtSp, aEscherObjListHd.GetRecEndFilePos(), &aShapeHd ) )
+ {
+ rSt >> nShapeId;
+ if ( nId == nShapeId )
+ {
+ aEscherObjListHd.SeekToBegOfRecord( rSt );
+ bRet = TRUE;
+ break;
+ }
+ }
+ aEscherObjListHd.SeekToEndOfRecord( rSt );
+ }
+ }
+ }
+ }
+ if ( !bRet )
+ rSt.Seek( nMerk );
+ }
+ return bRet;
+}
+
+FASTBOOL SvxMSDffManager::SeekToRec( SvStream& rSt, USHORT nRecId, ULONG nMaxFilePos, DffRecordHeader* pRecHd, ULONG nSkipCount ) const
+{
+ FASTBOOL bRet = FALSE;
+ ULONG nFPosMerk = rSt.Tell(); // FilePos merken fuer ggf. spaetere Restauration
+ DffRecordHeader aHd;
+ do
+ {
+ rSt >> aHd;
+ if ( aHd.nRecType == nRecId )
+ {
+ if ( nSkipCount )
+ nSkipCount--;
+ else
+ {
+ bRet = TRUE;
+ if ( pRecHd != NULL )
+ *pRecHd = aHd;
+ else
+ aHd.SeekToBegOfRecord( rSt );
+ }
+ }
+ if ( !bRet )
+ aHd.SeekToEndOfRecord( rSt );
+ }
+ while ( rSt.GetError() == 0 && rSt.Tell() < nMaxFilePos && !bRet );
+ if ( !bRet )
+ rSt.Seek( nFPosMerk ); // FilePos restaurieren
+ return bRet;
+}
+
+FASTBOOL SvxMSDffManager::SeekToRec2( USHORT nRecId1, USHORT nRecId2, ULONG nMaxFilePos, DffRecordHeader* pRecHd, ULONG nSkipCount ) const
+{
+ FASTBOOL bRet = FALSE;
+ ULONG nFPosMerk = rStCtrl.Tell(); // FilePos merken fuer ggf. spaetere Restauration
+ DffRecordHeader aHd;
+ do
+ {
+ rStCtrl >> aHd;
+ if ( aHd.nRecType == nRecId1 || aHd.nRecType == nRecId2 )
+ {
+ if ( nSkipCount )
+ nSkipCount--;
+ else
+ {
+ bRet = TRUE;
+ if ( pRecHd )
+ *pRecHd = aHd;
+ else
+ aHd.SeekToBegOfRecord( rStCtrl );
+ }
+ }
+ if ( !bRet )
+ aHd.SeekToEndOfRecord( rStCtrl );
+ }
+ while ( rStCtrl.GetError() == 0 && rStCtrl.Tell() < nMaxFilePos && !bRet );
+ if ( !bRet )
+ rStCtrl.Seek( nFPosMerk ); // FilePos restaurieren
+ return bRet;
+}
+
+
+FASTBOOL SvxMSDffManager::GetColorFromPalette( USHORT /* nNum */, Color& rColor ) const
+{
+ // diese Methode ist in der zum Excel-Import
+ // abgeleiteten Klasse zu ueberschreiben...
+ rColor.SetColor( COL_WHITE );
+ return TRUE;
+}
+
+
+Color SvxMSDffManager::MSO_CLR_ToColor( sal_uInt32 nColorCode, sal_uInt16 nContentProperty ) const
+{
+ Color aColor( mnDefaultColor );
+
+ // Fuer Textfarben: Header ist 0xfeRRGGBB
+ if ( ( nColorCode & 0xfe000000 ) == 0xfe000000 )
+ nColorCode &= 0x00ffffff;
+
+ sal_uInt8 nUpper = (sal_uInt8)( nColorCode >> 24 );
+ if( nUpper & 0x19 ) // if( nUpper & 0x1f )
+ {
+ if( ( nUpper & 0x08 ) || ( ( nUpper & 0x10 ) == 0 ) )
+ {
+ // SCHEMECOLOR
+ if ( !GetColorFromPalette( ( nUpper & 8 ) ? (sal_uInt16)nColorCode : nUpper, aColor ) )
+ {
+ switch( nContentProperty )
+ {
+ case DFF_Prop_pictureTransparent :
+ case DFF_Prop_shadowColor :
+ case DFF_Prop_fillBackColor :
+ case DFF_Prop_fillColor :
+ aColor = Color( COL_WHITE );
+ break;
+ case DFF_Prop_lineColor :
+ {
+ aColor = Color( COL_BLACK );
+ }
+ break;
+ }
+ }
+ }
+ else // SYSCOLOR
+ {
+ const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
+
+// UINT16 nParameter = (BYTE)( nColorCode >> 16); // SJ: nice compiler optimization bug on windows, though downcasting
+ UINT16 nParameter = sal_uInt16(( nColorCode >> 16 ) & 0x00ff); // the HiByte of nParameter is not zero, an exclusive AND is helping :o
+ UINT16 nFunctionBits = (UINT16)( ( nColorCode & 0x00000f00 ) >> 8 );
+ UINT16 nAdditionalFlags = (UINT16)( ( nColorCode & 0x0000f000) >> 8 );
+ UINT16 nColorIndex = sal_uInt16(nColorCode & 0x00ff);
+ UINT32 nPropColor = 0;
+
+ sal_uInt16 nCProp = 0;
+
+ switch ( nColorIndex )
+ {
+ case mso_syscolorButtonFace : aColor = rStyleSettings.GetFaceColor(); break;
+ case mso_syscolorWindowText : aColor = rStyleSettings.GetWindowTextColor(); break;
+ case mso_syscolorMenu : aColor = rStyleSettings.GetMenuColor(); break;
+ case mso_syscolor3DLight :
+ case mso_syscolorButtonHighlight :
+ case mso_syscolorHighlight : aColor = rStyleSettings.GetHighlightColor(); break;
+ case mso_syscolorHighlightText : aColor = rStyleSettings.GetHighlightTextColor(); break;
+ case mso_syscolorCaptionText : aColor = rStyleSettings.GetMenuTextColor(); break;
+ case mso_syscolorActiveCaption : aColor = rStyleSettings.GetHighlightColor(); break;
+ case mso_syscolorButtonShadow : aColor = rStyleSettings.GetShadowColor(); break;
+ case mso_syscolorButtonText : aColor = rStyleSettings.GetButtonTextColor(); break;
+ case mso_syscolorGrayText : aColor = rStyleSettings.GetDeactiveColor(); break;
+ case mso_syscolorInactiveCaption : aColor = rStyleSettings.GetDeactiveColor(); break;
+ case mso_syscolorInactiveCaptionText : aColor = rStyleSettings.GetDeactiveColor(); break;
+ case mso_syscolorInfoBackground : aColor = rStyleSettings.GetFaceColor(); break;
+ case mso_syscolorInfoText : aColor = rStyleSettings.GetInfoTextColor(); break;
+ case mso_syscolorMenuText : aColor = rStyleSettings.GetMenuTextColor(); break;
+ case mso_syscolorScrollbar : aColor = rStyleSettings.GetFaceColor(); break;
+ case mso_syscolorWindow : aColor = rStyleSettings.GetWindowColor(); break;
+ case mso_syscolorWindowFrame : aColor = rStyleSettings.GetWindowColor(); break;
+
+ case mso_colorFillColor :
+ {
+ nPropColor = GetPropertyValue( DFF_Prop_fillColor, 0xffffff );
+ nCProp = DFF_Prop_fillColor;
+ }
+ break;
+ case mso_colorLineOrFillColor : // ( use the line color only if there is a line )
+ {
+ if ( GetPropertyValue( DFF_Prop_fNoLineDrawDash ) & 8 )
+ {
+ nPropColor = GetPropertyValue( DFF_Prop_lineColor, 0 );
+ nCProp = DFF_Prop_lineColor;
+ }
+ else
+ {
+ nPropColor = GetPropertyValue( DFF_Prop_fillColor, 0xffffff );
+ nCProp = DFF_Prop_fillColor;
+ }
+ }
+ break;
+ case mso_colorLineColor :
+ {
+ nPropColor = GetPropertyValue( DFF_Prop_lineColor, 0 );
+ nCProp = DFF_Prop_lineColor;
+ }
+ break;
+ case mso_colorShadowColor :
+ {
+ nPropColor = GetPropertyValue( DFF_Prop_shadowColor, 0x808080 );
+ nCProp = DFF_Prop_shadowColor;
+ }
+ break;
+ case mso_colorThis : // ( use this color ... )
+ {
+ nPropColor = GetPropertyValue( DFF_Prop_fillColor, 0xffffff ); //?????????????
+ nCProp = DFF_Prop_fillColor;
+ }
+ break;
+ case mso_colorFillBackColor :
+ {
+ nPropColor = GetPropertyValue( DFF_Prop_fillBackColor, 0xffffff );
+ nCProp = DFF_Prop_fillBackColor;
+ }
+ break;
+ case mso_colorLineBackColor :
+ {
+ nPropColor = GetPropertyValue( DFF_Prop_lineBackColor, 0xffffff );
+ nCProp = DFF_Prop_lineBackColor;
+ }
+ break;
+ case mso_colorFillThenLine : // ( use the fillcolor unless no fill and line )
+ {
+ nPropColor = GetPropertyValue( DFF_Prop_fillColor, 0xffffff ); //?????????????
+ nCProp = DFF_Prop_fillColor;
+ }
+ break;
+ case mso_colorIndexMask : // ( extract the color index ) ?
+ {
+ nPropColor = GetPropertyValue( DFF_Prop_fillColor, 0xffffff ); //?????????????
+ nCProp = DFF_Prop_fillColor;
+ }
+ break;
+ }
+ if ( nCProp && ( nPropColor & 0x10000000 ) == 0 ) // beware of looping recursive
+ aColor = MSO_CLR_ToColor( nPropColor, nCProp );
+
+ if( nAdditionalFlags & 0x80 ) // make color gray
+ {
+ UINT8 nZwi = aColor.GetLuminance();
+ aColor = Color( nZwi, nZwi, nZwi );
+ }
+ switch( nFunctionBits )
+ {
+ case 0x01 : // darken color by parameter
+ {
+ aColor.SetRed( sal::static_int_cast< UINT8 >( ( nParameter * aColor.GetRed() ) >> 8 ) );
+ aColor.SetGreen( sal::static_int_cast< UINT8 >( ( nParameter * aColor.GetGreen() ) >> 8 ) );
+ aColor.SetBlue( sal::static_int_cast< UINT8 >( ( nParameter * aColor.GetBlue() ) >> 8 ) );
+ }
+ break;
+ case 0x02 : // lighten color by parameter
+ {
+ UINT16 nInvParameter = ( 0x00ff - nParameter ) * 0xff;
+ aColor.SetRed( sal::static_int_cast< UINT8 >( ( nInvParameter + ( nParameter * aColor.GetRed() ) ) >> 8 ) );
+ aColor.SetGreen( sal::static_int_cast< UINT8 >( ( nInvParameter + ( nParameter * aColor.GetGreen() ) ) >> 8 ) );
+ aColor.SetBlue( sal::static_int_cast< UINT8 >( ( nInvParameter + ( nParameter * aColor.GetBlue() ) ) >> 8 ) );
+ }
+ break;
+ case 0x03 : // add grey level RGB(p,p,p)
+ {
+ INT16 nR = (INT16)aColor.GetRed() + (INT16)nParameter;
+ INT16 nG = (INT16)aColor.GetGreen() + (INT16)nParameter;
+ INT16 nB = (INT16)aColor.GetBlue() + (INT16)nParameter;
+ if ( nR > 0x00ff )
+ nR = 0x00ff;
+ if ( nG > 0x00ff )
+ nG = 0x00ff;
+ if ( nB > 0x00ff )
+ nB = 0x00ff;
+ aColor = Color( (UINT8)nR, (UINT8)nG, (UINT8)nB );
+ }
+ break;
+ case 0x04 : // substract grey level RGB(p,p,p)
+ {
+ INT16 nR = (INT16)aColor.GetRed() - (INT16)nParameter;
+ INT16 nG = (INT16)aColor.GetGreen() - (INT16)nParameter;
+ INT16 nB = (INT16)aColor.GetBlue() - (INT16)nParameter;
+ if ( nR < 0 )
+ nR = 0;
+ if ( nG < 0 )
+ nG = 0;
+ if ( nB < 0 )
+ nB = 0;
+ aColor = Color( (UINT8)nR, (UINT8)nG, (UINT8)nB );
+ }
+ break;
+ case 0x05 : // substract from grey level RGB(p,p,p)
+ {
+ INT16 nR = (INT16)nParameter - (INT16)aColor.GetRed();
+ INT16 nG = (INT16)nParameter - (INT16)aColor.GetGreen();
+ INT16 nB = (INT16)nParameter - (INT16)aColor.GetBlue();
+ if ( nR < 0 )
+ nR = 0;
+ if ( nG < 0 )
+ nG = 0;
+ if ( nB < 0 )
+ nB = 0;
+ aColor = Color( (UINT8)nR, (UINT8)nG, (UINT8)nB );
+ }
+ break;
+ case 0x06 : // per component: black if < p, white if >= p
+ {
+ aColor.SetRed( aColor.GetRed() < nParameter ? 0x00 : 0xff );
+ aColor.SetGreen( aColor.GetGreen() < nParameter ? 0x00 : 0xff );
+ aColor.SetBlue( aColor.GetBlue() < nParameter ? 0x00 : 0xff );
+ }
+ break;
+ }
+ if ( nAdditionalFlags & 0x40 ) // top-bit invert
+ aColor = Color( aColor.GetRed() ^ 0x80, aColor.GetGreen() ^ 0x80, aColor.GetBlue() ^ 0x80 );
+
+ if ( nAdditionalFlags & 0x20 ) // invert color
+ aColor = Color(0xff - aColor.GetRed(), 0xff - aColor.GetGreen(), 0xff - aColor.GetBlue());
+ }
+ }
+ else if ( ( nUpper & 4 ) && ( ( nColorCode & 0xfffff8 ) == 0 ) )
+ { // case of nUpper == 4 powerpoint takes this as agrument for a colorschemecolor
+ GetColorFromPalette( nUpper, aColor );
+ }
+ else // hart attributiert, eventuell mit Hinweis auf SYSTEMRGB
+ aColor = Color( (BYTE)nColorCode, (BYTE)( nColorCode >> 8 ), (BYTE)( nColorCode >> 16 ) );
+ return aColor;
+}
+
+FASTBOOL SvxMSDffManager::ReadDffString(SvStream& rSt, String& rTxt) const
+{
+ FASTBOOL bRet=FALSE;
+ DffRecordHeader aStrHd;
+ if( !ReadCommonRecordHeader(aStrHd, rSt) )
+ rSt.Seek( aStrHd.nFilePos );
+ else if ( aStrHd.nRecType == DFF_PST_TextBytesAtom || aStrHd.nRecType == DFF_PST_TextCharsAtom )
+ {
+ FASTBOOL bUniCode=aStrHd.nRecType==DFF_PST_TextCharsAtom;
+ bRet=TRUE;
+ ULONG nBytes = aStrHd.nRecLen;
+ MSDFFReadZString( rSt, rTxt, nBytes, bUniCode );
+ if( !bUniCode )
+ {
+ for ( xub_StrLen n = 0; n < nBytes; n++ )
+ {
+ if( rTxt.GetChar( n ) == 0x0B )
+ rTxt.SetChar( n, ' ' ); // Weicher Umbruch
+ // TODO: Zeilenumbruch im Absatz via Outliner setzen.
+ }
+ }
+ aStrHd.SeekToEndOfRecord( rSt );
+ }
+ else
+ aStrHd.SeekToBegOfRecord( rSt );
+ return bRet;
+}
+
+// sj: I just want to set a string for a text object that may contain multiple
+// paragraphs. If I now take a look at the follwing code I get the impression that
+// our outliner is too complicate to be used properly,
+void SvxMSDffManager::ReadObjText( const String& rText, SdrObject* pObj ) const
+{
+ SdrTextObj* pText = PTR_CAST( SdrTextObj, pObj );
+ if ( pText )
+ {
+ SdrOutliner& rOutliner = pText->ImpGetDrawOutliner();
+ rOutliner.Init( OUTLINERMODE_TEXTOBJECT );
+
+ BOOL bOldUpdateMode = rOutliner.GetUpdateMode();
+ rOutliner.SetUpdateMode( FALSE );
+ rOutliner.SetVertical( pText->IsVerticalWriting() );
+
+ sal_uInt16 nParaIndex = 0;
+ sal_uInt32 nParaSize;
+ const sal_Unicode* pCurrent, *pBuf = rText.GetBuffer();
+ const sal_Unicode* pEnd = rText.GetBuffer() + rText.Len();
+
+ while( pBuf < pEnd )
+ {
+ pCurrent = pBuf;
+
+ for ( nParaSize = 0; pBuf < pEnd; )
+ {
+ sal_Unicode nChar = *pBuf++;
+ if ( nChar == 0xa )
+ {
+ if ( ( pBuf < pEnd ) && ( *pBuf == 0xd ) )
+ pBuf++;
+ break;
+ }
+ else if ( nChar == 0xd )
+ {
+ if ( ( pBuf < pEnd ) && ( *pBuf == 0xa ) )
+ pBuf++;
+ break;
+ }
+ else
+ nParaSize++;
+ }
+ ESelection aSelection( nParaIndex, 0, nParaIndex, 0 );
+ String aParagraph( pCurrent, (sal_uInt16)nParaSize );
+ if ( !nParaIndex && !aParagraph.Len() ) // SJ: we are crashing if the first paragraph is empty ?
+ aParagraph += (sal_Unicode)' '; // otherwise these two lines can be removed.
+ rOutliner.Insert( aParagraph, nParaIndex, 0 );
+ rOutliner.SetParaAttribs( nParaIndex, rOutliner.GetEmptyItemSet() );
+
+ SfxItemSet aParagraphAttribs( rOutliner.GetEmptyItemSet() );
+ if ( !aSelection.nStartPos )
+ aParagraphAttribs.Put( SfxBoolItem( EE_PARA_BULLETSTATE, FALSE ) );
+ aSelection.nStartPos = 0;
+ rOutliner.QuickSetAttribs( aParagraphAttribs, aSelection );
+ nParaIndex++;
+ }
+ OutlinerParaObject* pNewText = rOutliner.CreateParaObject();
+ rOutliner.Clear();
+ rOutliner.SetUpdateMode( bOldUpdateMode );
+ pText->SetOutlinerParaObject( pNewText );
+ }
+}
+
+FASTBOOL SvxMSDffManager::ReadObjText(SvStream& rSt, SdrObject* pObj) const
+{
+ FASTBOOL bRet=FALSE;
+ SdrTextObj* pText = PTR_CAST(SdrTextObj, pObj);
+ if( pText )
+ {
+ DffRecordHeader aTextHd;
+ if( !ReadCommonRecordHeader(aTextHd, rSt) )
+ rSt.Seek( aTextHd.nFilePos );
+ else if ( aTextHd.nRecType==DFF_msofbtClientTextbox )
+ {
+ bRet=TRUE;
+ ULONG nRecEnd=aTextHd.GetRecEndFilePos();
+ DffRecordHeader aHd;
+ String aText;
+// UINT32 nInvent=pText->GetObjInventor();
+// UINT16 nIdent=pText->GetObjIdentifier();
+
+ SdrOutliner& rOutliner=pText->ImpGetDrawOutliner();
+// sal_Int16 nMinDepth = rOutliner.GetMinDepth();
+ USHORT nOutlMode = rOutliner.GetMode();
+
+ { // Wohl 'nen kleiner Bug der EditEngine, das die
+ // Absastzattribute bei Clear() nicht entfernt werden.
+ FASTBOOL bClearParaAttribs = TRUE;
+ rOutliner.SetStyleSheet( 0, NULL );
+ SfxItemSet aSet(rOutliner.GetEmptyItemSet());
+ aSet.Put(SvxColorItem( COL_BLACK ));
+ rOutliner.SetParaAttribs(0,aSet);
+ pText->SetMergedItemSet(aSet);
+
+ bClearParaAttribs = FALSE;
+ if( bClearParaAttribs )
+ {
+ // Wohl 'nen kleiner Bug der EditEngine, dass die
+ // Absastzattribute bei Clear() nicht entfernt werden.
+ rOutliner.SetParaAttribs(0,rOutliner.GetEmptyItemSet());
+ }
+ }
+ rOutliner.Init( OUTLINERMODE_TEXTOBJECT );
+
+// ULONG nFilePosMerker=rSt.Tell();
+ ////////////////////////////////////
+ // TextString und MetaChars lesen //
+ ////////////////////////////////////
+ do
+ {
+ if( !ReadCommonRecordHeader(aHd, rSt) )
+ rSt.Seek( aHd.nFilePos );
+ else
+ {
+ switch (aHd.nRecType)
+ {
+ //case TextHeaderAtom
+ //case TextSpecInfoAtom
+ case DFF_PST_TextBytesAtom:
+ case DFF_PST_TextCharsAtom:
+ {
+ aHd.SeekToBegOfRecord(rSt);
+ ReadDffString(rSt, aText);
+ }
+ break;
+ case DFF_PST_TextRulerAtom :
+ {
+ UINT16 nLen = (UINT16)aHd.nRecLen;
+ if(nLen)
+ {
+ UINT16 nVal1, nVal2, nVal3;
+ UINT16 nDefaultTab = 2540; // PPT def: 1 Inch //rOutliner.GetDefTab();
+ UINT16 nMostrightTab = 0;
+ SfxItemSet aSet(rOutliner.GetEmptyItemSet());
+ SvxTabStopItem aTabItem(0, 0, SVX_TAB_ADJUST_DEFAULT, EE_PARA_TABS);
+
+ rSt >> nVal1;
+ rSt >> nVal2;
+ nLen -= 4;
+
+ // Allg. TAB verstellt auf Wert in nVal3
+ if(nLen && (nVal1 & 0x0001))
+ {
+ rSt >> nVal3;
+ nLen -= 2;
+ nDefaultTab = (UINT16)(((UINT32)nVal3 * 1000) / 240);
+ }
+
+ // Weitere, frei gesetzte TABs
+ if(nLen && (nVal1 & 0x0004))
+ {
+ rSt >> nVal1;
+ nLen -= 2;
+
+ // fest gesetzte TABs importieren
+ while(nLen && nVal1--)
+ {
+ rSt >> nVal2;
+ rSt >> nVal3;
+ nLen -= 4;
+
+ UINT16 nNewTabPos = (UINT16)(((UINT32)nVal2 * 1000) / 240);
+ if(nNewTabPos > nMostrightTab)
+ nMostrightTab = nNewTabPos;
+
+ SvxTabStop aTabStop(nNewTabPos);
+ aTabItem.Insert(aTabStop);
+ }
+ }
+
+ // evtl. noch default-TABs ergaenzen (immer)
+ UINT16 nObjWidth = sal_uInt16(pObj->GetSnapRect().GetWidth() + 1);
+ UINT16 nDefaultTabPos = nDefaultTab;
+
+ while(nDefaultTabPos <= nObjWidth && nDefaultTabPos <= nMostrightTab)
+ nDefaultTabPos =
+ nDefaultTabPos + nDefaultTab;
+
+ while(nDefaultTabPos <= nObjWidth)
+ {
+ SvxTabStop aTabStop(nDefaultTabPos);
+ aTabItem.Insert(aTabStop);
+ nDefaultTabPos =
+ nDefaultTabPos + nDefaultTab;
+ }
+
+ // Falls TABs angelegt wurden, setze diese
+ if(aTabItem.Count())
+ {
+ aSet.Put(aTabItem);
+ rOutliner.SetParaAttribs(0, aSet);
+ }
+ }
+ }
+ break;
+ }
+ aHd.SeekToEndOfRecord( rSt );
+ }
+ }
+ while ( rSt.GetError() == 0 && rSt.Tell() < nRecEnd );
+
+ ////////////////////////
+ // SHIFT-Ret ersetzen //
+ ////////////////////////
+ if ( aText.Len() )
+ {
+ aText += ' ';
+ aText.SetChar( aText.Len()-1, 0x0D );
+ rOutliner.SetText( aText, rOutliner.GetParagraph( 0 ) );
+
+ // SHIFT-Ret ersetzen im Outliner
+ if(aText.GetTokenCount(0x0B) > 1)
+ {
+ UINT32 nParaCount = rOutliner.GetParagraphCount();
+ for(UINT16 a=0;a<nParaCount;a++)
+ {
+ Paragraph* pActPara = rOutliner.GetParagraph(a);
+ String aParaText = rOutliner.GetText(pActPara);
+ for(UINT16 b=0;b<aParaText.Len();b++)
+ {
+ if( aParaText.GetChar( b ) == 0x0B)
+ {
+ ESelection aSelection(a, b, a, b+1);
+ rOutliner.QuickInsertLineBreak(aSelection);
+ }
+ }
+ }
+ }
+ }
+ OutlinerParaObject* pNewText=rOutliner.CreateParaObject();
+ rOutliner.Init( nOutlMode );
+ pText->NbcSetOutlinerParaObject(pNewText);
+ }
+ else
+ aTextHd.SeekToBegOfRecord(rSt);
+
+ }
+ return bRet;
+}
+
+//static
+void SvxMSDffManager::MSDFFReadZString( SvStream& rIn, String& rStr,
+ ULONG nRecLen, FASTBOOL bUniCode )
+{
+ sal_uInt16 nLen = (sal_uInt16)nRecLen;
+ if( nLen )
+ {
+ if ( bUniCode )
+ nLen >>= 1;
+
+ String sBuf;
+ sal_Unicode* pBuf = sBuf.AllocBuffer( nLen );
+
+ if( bUniCode )
+ {
+ rIn.Read( (sal_Char*)pBuf, nLen << 1 );
+
+#ifdef OSL_BIGENDIAN
+ for( sal_uInt16 n = 0; n < nLen; ++n, ++pBuf )
+ *pBuf = SWAPSHORT( *pBuf );
+#endif // ifdef OSL_BIGENDIAN
+ }
+ else
+ {
+ // use the String-Data as buffer for the 8bit characters and
+ // change then all to unicode
+ sal_Char* pReadPos = ((sal_Char*)pBuf) + nLen;
+ rIn.Read( (sal_Char*)pReadPos, nLen );
+ for( sal_uInt16 n = 0; n < nLen; ++n, ++pBuf, ++pReadPos )
+ *pBuf = ByteString::ConvertToUnicode( *pReadPos, RTL_TEXTENCODING_MS_1252 );
+ }
+
+ rStr = sBuf.EraseTrailingChars( 0 );
+ }
+ else
+ rStr.Erase();
+}
+
+SdrObject* SvxMSDffManager::ImportFontWork( SvStream& rStCt, SfxItemSet& rSet, Rectangle& rBoundRect ) const
+{
+ SdrObject* pRet = NULL;
+ String aObjectText;
+ String aFontName;
+ BOOL bTextRotate = FALSE;
+
+ ((SvxMSDffManager*)this)->mnFix16Angle = 0; // we don't want to use this property in future
+ if ( SeekToContent( DFF_Prop_gtextUNICODE, rStCt ) )
+ MSDFFReadZString( rStCt, aObjectText, GetPropertyValue( DFF_Prop_gtextUNICODE ), TRUE );
+ if ( SeekToContent( DFF_Prop_gtextFont, rStCt ) )
+ MSDFFReadZString( rStCt, aFontName, GetPropertyValue( DFF_Prop_gtextFont ), TRUE );
+ if ( GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ) & 0x2000 )
+ {
+ // Text ist senkrecht formatiert, Box Kippen
+ INT32 nHalfWidth = ( rBoundRect.GetWidth() + 1) >> 1;
+ INT32 nHalfHeight = ( rBoundRect.GetHeight() + 1) >> 1;
+ Point aTopLeft( rBoundRect.Left() + nHalfWidth - nHalfHeight,
+ rBoundRect.Top() + nHalfHeight - nHalfWidth);
+ Size aNewSize( rBoundRect.GetHeight(), rBoundRect.GetWidth() );
+ Rectangle aNewRect( aTopLeft, aNewSize );
+ rBoundRect = aNewRect;
+
+ String aSrcText( aObjectText );
+ aObjectText.Erase();
+ for( UINT16 a = 0; a < aSrcText.Len(); a++ )
+ {
+ aObjectText += aSrcText.GetChar( a );
+ aObjectText += '\n';
+ }
+ rSet.Put( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_CENTER ) );
+ bTextRotate = TRUE;
+ }
+ if ( aObjectText.Len() )
+ { // FontWork-Objekt Mit dem Text in aObjectText erzeugen
+ SdrObject* pNewObj = new SdrRectObj( OBJ_TEXT, rBoundRect );
+ if( pNewObj )
+ {
+ pNewObj->SetModel( pSdrModel );
+ ((SdrRectObj*)pNewObj)->SetText( aObjectText );
+ SdrFitToSizeType eFTS = SDRTEXTFIT_PROPORTIONAL;
+ rSet.Put( SdrTextFitToSizeTypeItem( eFTS ) );
+ rSet.Put( SdrTextAutoGrowHeightItem( FALSE ) );
+ rSet.Put( SdrTextAutoGrowWidthItem( FALSE ) );
+ rSet.Put( SvxFontItem( FAMILY_DONTKNOW, aFontName, String(),
+ PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, EE_CHAR_FONTINFO ));
+
+ pNewObj->SetMergedItemSet(rSet);
+
+ pRet = pNewObj->ConvertToPolyObj( FALSE, FALSE );
+ if( !pRet )
+ pRet = pNewObj;
+ else
+ {
+ pRet->NbcSetSnapRect( rBoundRect );
+ SdrObject::Free( pNewObj );
+ }
+ if( bTextRotate )
+ {
+ double a = 9000 * nPi180;
+ pRet->NbcRotate( rBoundRect.Center(), 9000, sin( a ), cos( a ) );
+ }
+ }
+ }
+ return pRet;
+}
+
+static Size lcl_GetPrefSize(const Graphic& rGraf, MapMode aWanted)
+{
+ MapMode aPrefMapMode(rGraf.GetPrefMapMode());
+ if (aPrefMapMode == aWanted)
+ return rGraf.GetPrefSize();
+ Size aRetSize;
+ if (aPrefMapMode == MAP_PIXEL)
+ {
+ aRetSize = Application::GetDefaultDevice()->PixelToLogic(
+ rGraf.GetPrefSize(), aWanted);
+ }
+ else
+ {
+ aRetSize = Application::GetDefaultDevice()->LogicToLogic(
+ rGraf.GetPrefSize(), rGraf.GetPrefMapMode(), aWanted);
+ }
+ return aRetSize;
+}
+
+// sj: if the parameter pSet is null, then the resulting crop bitmap will be stored in rGraf,
+// otherwise rGraf is untouched and pSet is used to store the corresponding SdrGrafCropItem
+static void lcl_ApplyCropping( const DffPropSet& rPropSet, SfxItemSet* pSet, Graphic& rGraf )
+{
+ sal_Int32 nCropTop = (sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_cropFromTop, 0 );
+ sal_Int32 nCropBottom = (sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_cropFromBottom, 0 );
+ sal_Int32 nCropLeft = (sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_cropFromLeft, 0 );
+ sal_Int32 nCropRight = (sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_cropFromRight, 0 );
+
+ if( nCropTop || nCropBottom || nCropLeft || nCropRight )
+ {
+ double fFactor;
+ Size aCropSize;
+ BitmapEx aCropBitmap;
+ sal_uInt32 nTop( 0 ), nBottom( 0 ), nLeft( 0 ), nRight( 0 );
+
+ if ( pSet ) // use crop attributes ?
+ aCropSize = lcl_GetPrefSize( rGraf, MAP_100TH_MM );
+ else
+ {
+ aCropBitmap = rGraf.GetBitmapEx();
+ aCropSize = aCropBitmap.GetSizePixel();
+ }
+ if ( nCropTop )
+ {
+ fFactor = (double)nCropTop / 65536.0;
+ nTop = (sal_uInt32)( ( (double)( aCropSize.Height() + 1 ) * fFactor ) + 0.5 );
+ }
+ if ( nCropBottom )
+ {
+ fFactor = (double)nCropBottom / 65536.0;
+ nBottom = (sal_uInt32)( ( (double)( aCropSize.Height() + 1 ) * fFactor ) + 0.5 );
+ }
+ if ( nCropLeft )
+ {
+ fFactor = (double)nCropLeft / 65536.0;
+ nLeft = (sal_uInt32)( ( (double)( aCropSize.Width() + 1 ) * fFactor ) + 0.5 );
+ }
+ if ( nCropRight )
+ {
+ fFactor = (double)nCropRight / 65536.0;
+ nRight = (sal_uInt32)( ( (double)( aCropSize.Width() + 1 ) * fFactor ) + 0.5 );
+ }
+ if ( pSet ) // use crop attributes ?
+ pSet->Put( SdrGrafCropItem( nLeft, nTop, nRight, nBottom ) );
+ else
+ {
+ Rectangle aCropRect( nLeft, nTop, aCropSize.Width() - nRight, aCropSize.Height() - nBottom );
+ aCropBitmap.Crop( aCropRect );
+ rGraf = aCropBitmap;
+ }
+ }
+}
+
+SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, const DffObjData& rObjData ) const
+{
+ SdrObject* pRet = NULL;
+ String aFilename;
+ String aLinkFileName, aLinkFilterName;
+ Rectangle aVisArea;
+
+ MSO_BlipFlags eFlags = (MSO_BlipFlags)GetPropertyValue( DFF_Prop_pibFlags, mso_blipflagDefault );
+ sal_uInt32 nBlipId = GetPropertyValue( DFF_Prop_pib, 0 );
+ sal_Bool bGrfRead = sal_False,
+
+ // Grafik verlinkt
+ bLinkGrf = 0 != ( eFlags & mso_blipflagLinkToFile );
+ {
+ Graphic aGraf; // be sure this graphic is deleted before swapping out
+ if( SeekToContent( DFF_Prop_pibName, rSt ) )
+ MSDFFReadZString( rSt, aFilename, GetPropertyValue( DFF_Prop_pibName ), TRUE );
+
+ // UND, ODER folgendes:
+ if( !( eFlags & mso_blipflagDoNotSave ) ) // Grafik embedded
+ {
+ bGrfRead = GetBLIP( nBlipId, aGraf, &aVisArea );
+ if ( !bGrfRead )
+ {
+ /*
+ Still no luck, lets look at the end of this record for a FBSE pool,
+ this fallback is a specific case for how word does it sometimes
+ */
+ rObjData.rSpHd.SeekToEndOfRecord( rSt );
+ DffRecordHeader aHd;
+ rSt >> aHd;
+ if( DFF_msofbtBSE == aHd.nRecType )
+ {
+ const ULONG nSkipBLIPLen = 20;
+ const ULONG nSkipShapePos = 4;
+ const ULONG nSkipBLIP = 4;
+ const ULONG nSkip =
+ nSkipBLIPLen + 4 + nSkipShapePos + 4 + nSkipBLIP;
+
+ if (nSkip <= aHd.nRecLen)
+ {
+ rSt.SeekRel(nSkip);
+ if (0 == rSt.GetError())
+ bGrfRead = GetBLIPDirect( rSt, aGraf, &aVisArea );
+ }
+ }
+ }
+ }
+ if ( bGrfRead )
+ {
+ // the writer is doing it's own cropping, so this part affects only impress and calc
+ if ( GetSvxMSDffSettings() & SVXMSDFF_SETTINGS_CROP_BITMAPS )
+ lcl_ApplyCropping( *this, ( rObjData.nSpFlags & SP_FOLESHAPE ) == 0 ? &rSet : NULL, aGraf );
+
+ if ( IsProperty( DFF_Prop_pictureTransparent ) )
+ {
+ UINT32 nTransColor = GetPropertyValue( DFF_Prop_pictureTransparent, 0 );
+
+ if ( aGraf.GetType() == GRAPHIC_BITMAP )
+ {
+ BitmapEx aBitmapEx( aGraf.GetBitmapEx() );
+ Bitmap aBitmap( aBitmapEx.GetBitmap() );
+ Bitmap aMask( aBitmap.CreateMask( MSO_CLR_ToColor( nTransColor, DFF_Prop_pictureTransparent ), 9 ) );
+ if ( aBitmapEx.IsTransparent() )
+ aMask.CombineSimple( aBitmapEx.GetMask(), BMP_COMBINE_OR );
+ aGraf = BitmapEx( aBitmap, aMask );
+ }
+ }
+
+ sal_Int32 nContrast = GetPropertyValue( DFF_Prop_pictureContrast, 0x10000 );
+ /*
+ 0x10000 is msoffice 50%
+ < 0x10000 is in units of 1/50th of 0x10000 per 1%
+ > 0x10000 is in units where
+ a msoffice x% is stored as 50/(100-x) * 0x10000
+
+ plus, a (ui) microsoft % ranges from 0 to 100, OOO
+ from -100 to 100, so also normalize into that range
+ */
+ if ( nContrast > 0x10000 )
+ {
+ double fX = nContrast;
+ fX /= 0x10000;
+ fX /= 51; // 50 + 1 to round
+ fX = 1/fX;
+ nContrast = static_cast<sal_Int32>(fX);
+ nContrast -= 100;
+ nContrast = -nContrast;
+ nContrast = (nContrast-50)*2;
+ }
+ else if ( nContrast == 0x10000 )
+ nContrast = 0;
+ else
+ {
+ nContrast *= 101; //100 + 1 to round
+ nContrast /= 0x10000;
+ nContrast -= 100;
+ }
+ sal_Int16 nBrightness = (sal_Int16)( (sal_Int32)GetPropertyValue( DFF_Prop_pictureBrightness, 0 ) / 327 );
+ sal_Int32 nGamma = GetPropertyValue( DFF_Prop_pictureGamma, 0x10000 );
+ GraphicDrawMode eDrawMode = GRAPHICDRAWMODE_STANDARD;
+ switch ( GetPropertyValue( DFF_Prop_pictureActive ) & 6 )
+ {
+ case 4 : eDrawMode = GRAPHICDRAWMODE_GREYS; break;
+ case 6 : eDrawMode = GRAPHICDRAWMODE_MONO; break;
+ case 0 :
+ {
+ //office considers the converted values of (in OOo) 70 to be the
+ //"watermark" values, which can vary slightly due to rounding from the
+ //above values
+ if (( nContrast == -70 ) && ( nBrightness == 70 ))
+ {
+ nContrast = 0;
+ nBrightness = 0;
+ eDrawMode = GRAPHICDRAWMODE_WATERMARK;
+ };
+ }
+ break;
+ }
+
+ if ( nContrast || nBrightness || ( nGamma != 0x10000 ) || ( eDrawMode != GRAPHICDRAWMODE_STANDARD ) )
+ {
+ if ( ( rObjData.nSpFlags & SP_FOLESHAPE ) == 0 )
+ {
+ if ( nBrightness )
+ rSet.Put( SdrGrafLuminanceItem( nBrightness ) );
+ if ( nContrast )
+ rSet.Put( SdrGrafContrastItem( (sal_Int16)nContrast ) );
+ if ( nGamma != 0x10000 )
+ rSet.Put( SdrGrafGamma100Item( nGamma / 655 ) );
+ if ( eDrawMode != GRAPHICDRAWMODE_STANDARD )
+ rSet.Put( SdrGrafModeItem( eDrawMode ) );
+ }
+ else
+ {
+ if ( eDrawMode == GRAPHICDRAWMODE_WATERMARK )
+ {
+ nContrast = 60;
+ nBrightness = 70;
+ eDrawMode = GRAPHICDRAWMODE_STANDARD;
+ }
+ switch ( aGraf.GetType() )
+ {
+ case GRAPHIC_BITMAP :
+ {
+ BitmapEx aBitmapEx( aGraf.GetBitmapEx() );
+ if ( nBrightness || nContrast || ( nGamma != 0x10000 ) )
+ aBitmapEx.Adjust( nBrightness, (sal_Int16)nContrast, 0, 0, 0, (double)nGamma / 0x10000, FALSE );
+ if ( eDrawMode == GRAPHICDRAWMODE_GREYS )
+ aBitmapEx.Convert( BMP_CONVERSION_8BIT_GREYS );
+ else if ( eDrawMode == GRAPHICDRAWMODE_MONO )
+ aBitmapEx.Convert( BMP_CONVERSION_1BIT_THRESHOLD );
+ aGraf = aBitmapEx;
+
+ }
+ break;
+
+ case GRAPHIC_GDIMETAFILE :
+ {
+ GDIMetaFile aGdiMetaFile( aGraf.GetGDIMetaFile() );
+ if ( nBrightness || nContrast || ( nGamma != 0x10000 ) )
+ aGdiMetaFile.Adjust( nBrightness, (sal_Int16)nContrast, 0, 0, 0, (double)nGamma / 0x10000, FALSE );
+ if ( eDrawMode == GRAPHICDRAWMODE_GREYS )
+ aGdiMetaFile.Convert( MTF_CONVERSION_8BIT_GREYS );
+ else if ( eDrawMode == GRAPHICDRAWMODE_MONO )
+ aGdiMetaFile.Convert( MTF_CONVERSION_1BIT_THRESHOLD );
+ aGraf = aGdiMetaFile;
+ }
+ break;
+ default: break;
+ }
+ }
+ }
+ }
+
+ // sollte es ein OLE-Object sein?
+ if( bGrfRead && !bLinkGrf && IsProperty( DFF_Prop_pictureId ) )
+ {
+ // TODO/LATER: in future probably the correct aspect should be provided here
+ sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT;
+ // --> OD 2004-12-14 #i32596# - pass <nCalledByGroup> to method
+ pRet = ImportOLE( GetPropertyValue( DFF_Prop_pictureId ), aGraf, rObjData.aBoundRect, aVisArea, rObjData.nCalledByGroup, nAspect );
+ // <--
+ }
+ if( !pRet )
+ {
+ pRet = new SdrGrafObj;
+ if( bGrfRead )
+ ((SdrGrafObj*)pRet)->SetGraphic( aGraf );
+
+ if( bLinkGrf && !bGrfRead ) // sj: #i55484# if the graphic was embedded ( bGrfRead == true ) then
+ { // we do not need to set a link. TODO: not to lose the information where the graphic is linked from
+ UniString aName( ::URIHelper::SmartRel2Abs( INetURLObject(maBaseURL), aFilename, URIHelper::GetMaybeFileHdl(), true, false,
+ INetURLObject::WAS_ENCODED,
+ INetURLObject::DECODE_UNAMBIGUOUS ) );
+
+ String aFilterName;
+ INetURLObject aURLObj( aName );
+
+ if( aURLObj.GetProtocol() == INET_PROT_NOT_VALID )
+ {
+ String aValidURL;
+
+ if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aName, aValidURL ) )
+ aURLObj = INetURLObject( aValidURL );
+ }
+
+ if( aURLObj.GetProtocol() != INET_PROT_NOT_VALID )
+ {
+ GraphicFilter* pGrfFilter = GetGrfFilter();
+ aFilterName = pGrfFilter->GetImportFormatName(
+ pGrfFilter->GetImportFormatNumberForShortName( aURLObj.getExtension() ) );
+ }
+
+ aLinkFileName = aName;
+ aLinkFilterName = aFilterName;
+ }
+ }
+
+ // set the size from BLIP if there is one
+ if ( pRet && bGrfRead && !aVisArea.IsEmpty() )
+ pRet->SetBLIPSizeRectangle( aVisArea );
+
+ if ( !pRet->GetName().Len() ) // SJ 22.02.00 : PPT OLE IMPORT:
+ { // name is already set in ImportOLE !!
+ // JP 01.12.99: SetName before SetModel - because in the other order the Bug 70098 is active
+ if ( ( eFlags & mso_blipflagType ) != mso_blipflagComment )
+ {
+ INetURLObject aURL;
+ aURL.SetSmartURL( aFilename );
+ pRet->SetName( aURL.getBase() );
+ }
+ else
+ pRet->SetName( aFilename );
+ }
+ }
+ pRet->SetModel( pSdrModel ); // fuer GraphicLink erforderlich
+ pRet->SetLogicRect( rObjData.aBoundRect );
+
+ if ( pRet->ISA( SdrGrafObj ) )
+ {
+ if( aLinkFileName.Len() )
+ ((SdrGrafObj*)pRet)->SetGraphicLink( aLinkFileName, aLinkFilterName );
+
+ if ( bLinkGrf && !bGrfRead )
+ {
+ ((SdrGrafObj*)pRet)->ForceSwapIn();
+ Graphic aGraf(((SdrGrafObj*)pRet)->GetGraphic());
+ lcl_ApplyCropping( *this, &rSet, aGraf );
+ }
+ ((SdrGrafObj*)pRet)->ForceSwapOut();
+ }
+
+ return pRet;
+}
+
+// PptSlidePersistEntry& rPersistEntry, SdPage* pPage
+SdrObject* SvxMSDffManager::ImportObj( SvStream& rSt, void* pClientData,
+ Rectangle& rClientRect, const Rectangle& rGlobalChildRect, int nCalledByGroup, sal_Int32* pShapeId )
+{
+ SdrObject* pRet = NULL;
+ DffRecordHeader aObjHd;
+ rSt >> aObjHd;
+ if ( aObjHd.nRecType == DFF_msofbtSpgrContainer )
+ {
+ pRet = ImportGroup( aObjHd, rSt, pClientData, rClientRect, rGlobalChildRect, nCalledByGroup, pShapeId );
+ }
+ else if ( aObjHd.nRecType == DFF_msofbtSpContainer )
+ {
+ pRet = ImportShape( aObjHd, rSt, pClientData, rClientRect, rGlobalChildRect, nCalledByGroup, pShapeId );
+ }
+ aObjHd.SeekToBegOfRecord( rSt ); // FilePos restaurieren
+ return pRet;
+}
+
+SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& rSt, void* pClientData,
+ Rectangle& rClientRect, const Rectangle& rGlobalChildRect,
+ int nCalledByGroup, sal_Int32* pShapeId )
+{
+ SdrObject* pRet = NULL;
+
+ if( pShapeId )
+ *pShapeId = 0;
+
+ rHd.SeekToContent( rSt );
+ DffRecordHeader aRecHd; // the first atom has to be the SpContainer for the GroupObject
+ rSt >> aRecHd;
+ if ( aRecHd.nRecType == DFF_msofbtSpContainer )
+ {
+ INT32 nGroupRotateAngle = 0;
+ INT32 nSpFlags = 0;
+ mnFix16Angle = 0;
+ aRecHd.SeekToBegOfRecord( rSt );
+ pRet = ImportObj( rSt, pClientData, rClientRect, rGlobalChildRect, nCalledByGroup + 1, pShapeId );
+ if ( pRet )
+ {
+ nSpFlags = nGroupShapeFlags;
+ nGroupRotateAngle = mnFix16Angle;
+
+ Rectangle aClientRect( rClientRect );
+
+ Rectangle aGlobalChildRect;
+ if ( !nCalledByGroup || rGlobalChildRect.IsEmpty() )
+ aGlobalChildRect = GetGlobalChildAnchor( rHd, rSt, aClientRect );
+ else
+ aGlobalChildRect = rGlobalChildRect;
+
+ if ( ( nGroupRotateAngle > 4500 && nGroupRotateAngle <= 13500 )
+ || ( nGroupRotateAngle > 22500 && nGroupRotateAngle <= 31500 ) )
+ {
+ sal_Int32 nHalfWidth = ( aGlobalChildRect.GetWidth() + 1 ) >> 1;
+ sal_Int32 nHalfHeight = ( aGlobalChildRect.GetHeight() + 1 ) >> 1;
+ Point aTopLeft( aGlobalChildRect.Left() + nHalfWidth - nHalfHeight,
+ aGlobalChildRect.Top() + nHalfHeight - nHalfWidth );
+ Size aNewSize( aGlobalChildRect.GetHeight(), aGlobalChildRect.GetWidth() );
+ Rectangle aNewRect( aTopLeft, aNewSize );
+ aGlobalChildRect = aNewRect;
+ }
+
+ // now importing the inner objects of the group
+ aRecHd.SeekToEndOfRecord( rSt );
+ while ( ( rSt.GetError() == 0 ) && ( rSt.Tell() < rHd.GetRecEndFilePos() ) )
+ {
+ DffRecordHeader aRecHd2;
+ rSt >> aRecHd2;
+ if ( aRecHd2.nRecType == DFF_msofbtSpgrContainer )
+ {
+ Rectangle aGroupClientAnchor, aGroupChildAnchor;
+ GetGroupAnchors( aRecHd2, rSt, aGroupClientAnchor, aGroupChildAnchor, aClientRect, aGlobalChildRect );
+ aRecHd2.SeekToBegOfRecord( rSt );
+ sal_Int32 nShapeId;
+ SdrObject* pTmp = ImportGroup( aRecHd2, rSt, pClientData, aGroupClientAnchor, aGroupChildAnchor, nCalledByGroup + 1, &nShapeId );
+ if ( pTmp )
+ {
+ ((SdrObjGroup*)pRet)->GetSubList()->NbcInsertObject( pTmp );
+ if( nShapeId )
+ insertShapeId( nShapeId, pTmp );
+ }
+ }
+ else if ( aRecHd2.nRecType == DFF_msofbtSpContainer )
+ {
+ aRecHd2.SeekToBegOfRecord( rSt );
+ sal_Int32 nShapeId;
+ SdrObject* pTmp = ImportShape( aRecHd2, rSt, pClientData, aClientRect, aGlobalChildRect, nCalledByGroup + 1, &nShapeId );
+ if ( pTmp )
+ {
+ ((SdrObjGroup*)pRet)->GetSubList()->NbcInsertObject( pTmp );
+ if( nShapeId )
+ insertShapeId( nShapeId, pTmp );
+ }
+ }
+ aRecHd2.SeekToEndOfRecord( rSt );
+ }
+
+ // pRet->NbcSetSnapRect( aGroupBound );
+ if ( nGroupRotateAngle )
+ {
+ double a = nGroupRotateAngle * nPi180;
+ pRet->NbcRotate( aClientRect.Center(), nGroupRotateAngle, sin( a ), cos( a ) );
+ }
+ if ( nSpFlags & SP_FFLIPV ) // Vertikal gespiegelt?
+ { // BoundRect in aBoundRect
+ Point aLeft( aClientRect.Left(), ( aClientRect.Top() + aClientRect.Bottom() ) >> 1 );
+ Point aRight( aLeft.X() + 1000, aLeft.Y() );
+ pRet->NbcMirror( aLeft, aRight );
+ }
+ if ( nSpFlags & SP_FFLIPH ) // Horizontal gespiegelt?
+ { // BoundRect in aBoundRect
+ Point aTop( ( aClientRect.Left() + aClientRect.Right() ) >> 1, aClientRect.Top() );
+ Point aBottom( aTop.X(), aTop.Y() + 1000 );
+ pRet->NbcMirror( aTop, aBottom );
+ }
+ }
+ }
+ return pRet;
+}
+
+SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& rSt, void* pClientData,
+ Rectangle& rClientRect, const Rectangle& rGlobalChildRect,
+ int nCalledByGroup, sal_Int32* pShapeId )
+{
+ SdrObject* pRet = NULL;
+
+ if( pShapeId )
+ *pShapeId = 0;
+
+ rHd.SeekToBegOfRecord( rSt );
+ DffObjData aObjData( rHd, rClientRect, nCalledByGroup );
+ maShapeRecords.Consume( rSt, FALSE );
+ aObjData.bShapeType = maShapeRecords.SeekToContent( rSt, DFF_msofbtSp, SEEK_FROM_BEGINNING );
+ if ( aObjData.bShapeType )
+ {
+ rSt >> aObjData.nShapeId
+ >> aObjData.nSpFlags;
+ aObjData.eShapeType = (MSO_SPT)maShapeRecords.Current()->nRecInstance;
+ }
+ else
+ {
+ aObjData.nShapeId = 0;
+ aObjData.nSpFlags = 0;
+ aObjData.eShapeType = mso_sptNil;
+ }
+
+ if( pShapeId )
+ *pShapeId = aObjData.nShapeId;
+
+ if ( mbTracing )
+ mpTracer->AddAttribute( aObjData.nSpFlags & SP_FGROUP
+ ? rtl::OUString::createFromAscii( "GroupShape" )
+ : rtl::OUString::createFromAscii( "Shape" ),
+ rtl::OUString::valueOf( (sal_Int32)aObjData.nShapeId ) );
+ aObjData.bOpt = maShapeRecords.SeekToContent( rSt, DFF_msofbtOPT, SEEK_FROM_CURRENT_AND_RESTART );
+ if ( aObjData.bOpt )
+ {
+ maShapeRecords.Current()->SeekToBegOfRecord( rSt );
+#ifdef DBG_AUTOSHAPE
+ ReadPropSet( rSt, pClientData, (UINT32)aObjData.eShapeType );
+#else
+ ReadPropSet( rSt, pClientData );
+#endif
+ }
+ else
+ {
+ InitializePropSet(); // get the default PropSet
+ ( (DffPropertyReader*) this )->mnFix16Angle = 0;
+ }
+
+ aObjData.bChildAnchor = maShapeRecords.SeekToContent( rSt, DFF_msofbtChildAnchor, SEEK_FROM_CURRENT_AND_RESTART );
+ if ( aObjData.bChildAnchor )
+ {
+ INT32 l, o, r, u;
+ rSt >> l >> o >> r >> u;
+ Scale( l );
+ Scale( o );
+ Scale( r );
+ Scale( u );
+ aObjData.aChildAnchor = Rectangle( l, o, r, u );
+ if ( !rGlobalChildRect.IsEmpty() && !rClientRect.IsEmpty() && rGlobalChildRect.GetWidth() && rGlobalChildRect.GetHeight() )
+ {
+ double fl = l;
+ double fo = o;
+ double fWidth = r - l;
+ double fHeight= u - o;
+ double fXScale = (double)rClientRect.GetWidth() / (double)rGlobalChildRect.GetWidth();
+ double fYScale = (double)rClientRect.GetHeight() / (double)rGlobalChildRect.GetHeight();
+ fl = ( ( l - rGlobalChildRect.Left() ) * fXScale ) + rClientRect.Left();
+ fo = ( ( o - rGlobalChildRect.Top() ) * fYScale ) + rClientRect.Top();
+ fWidth *= fXScale;
+ fHeight *= fYScale;
+ aObjData.aChildAnchor = Rectangle( Point( (sal_Int32)fl, (sal_Int32)fo ), Size( (sal_Int32)( fWidth + 1 ), (sal_Int32)( fHeight + 1 ) ) );
+ }
+ }
+
+ aObjData.bClientAnchor = maShapeRecords.SeekToContent( rSt, DFF_msofbtClientAnchor, SEEK_FROM_CURRENT_AND_RESTART );
+ if ( aObjData.bClientAnchor )
+ ProcessClientAnchor2( rSt, *maShapeRecords.Current(), pClientData, aObjData );
+
+ if ( aObjData.bChildAnchor )
+ aObjData.aBoundRect = aObjData.aChildAnchor;
+
+ if ( aObjData.nSpFlags & SP_FBACKGROUND )
+ aObjData.aBoundRect = Rectangle( Point(), Size( 1, 1 ) );
+
+ Rectangle aTextRect;
+ if ( !aObjData.aBoundRect.IsEmpty() )
+ { // Rotation auf BoundingBox anwenden, BEVOR ien Objekt generiert wurde
+ if( mnFix16Angle )
+ {
+ long nAngle = mnFix16Angle;
+ if ( ( nAngle > 4500 && nAngle <= 13500 ) || ( nAngle > 22500 && nAngle <= 31500 ) )
+ {
+ INT32 nHalfWidth = ( aObjData.aBoundRect.GetWidth() + 1 ) >> 1;
+ INT32 nHalfHeight = ( aObjData.aBoundRect.GetHeight() + 1 ) >> 1;
+ Point aTopLeft( aObjData.aBoundRect.Left() + nHalfWidth - nHalfHeight,
+ aObjData.aBoundRect.Top() + nHalfHeight - nHalfWidth );
+ Size aNewSize( aObjData.aBoundRect.GetHeight(), aObjData.aBoundRect.GetWidth() );
+ Rectangle aNewRect( aTopLeft, aNewSize );
+ aObjData.aBoundRect = aNewRect;
+ }
+ }
+ aTextRect = aObjData.aBoundRect;
+ FASTBOOL bGraphic = IsProperty( DFF_Prop_pib ) ||
+ IsProperty( DFF_Prop_pibName ) ||
+ IsProperty( DFF_Prop_pibFlags );
+
+ if ( aObjData.nSpFlags & SP_FGROUP )
+ {
+ pRet = new SdrObjGroup;
+ /* After CWS aw033 has been integrated, an empty group object
+ cannot store its resulting bounding rectangle anymore. We have
+ to return this rectangle via rClientRect now, but only, if
+ caller has not passed an own bounding ractangle. */
+ if ( rClientRect.IsEmpty() )
+ rClientRect = aObjData.aBoundRect;
+ nGroupShapeFlags = aObjData.nSpFlags; // #73013#
+ }
+ else if ( ( aObjData.eShapeType != mso_sptNil ) || IsProperty( DFF_Prop_pVertices ) || bGraphic )
+ {
+ SfxItemSet aSet( pSdrModel->GetItemPool() );
+
+ sal_Bool bIsConnector = ( ( aObjData.eShapeType >= mso_sptStraightConnector1 ) && ( aObjData.eShapeType <= mso_sptCurvedConnector5 ) );
+ sal_Bool bIsCustomShape = sal_False;
+ sal_Int32 nObjectRotation = mnFix16Angle;
+ sal_uInt32 nSpFlags = aObjData.nSpFlags;
+
+ if ( bGraphic )
+ {
+ pRet = ImportGraphic( rSt, aSet, aObjData ); // SJ: #68396# is no longer true (fixed in ppt2000)
+ ApplyAttributes( rSt, aSet, aObjData );
+ pRet->SetMergedItemSet(aSet);
+ }
+ else
+ {
+ if ( GetCustomShapeContent( aObjData.eShapeType ) || IsProperty( DFF_Prop_pVertices ) )
+ {
+
+ ApplyAttributes( rSt, aSet, aObjData );
+
+// the com.sun.star.drawing.EnhancedCustomShapeEngine is default, so we do not need to set a hard attribute
+// aSet.Put( SdrCustomShapeEngineItem( String::CreateFromAscii( "com.sun.star.drawing.EnhancedCustomShapeEngine" ) ) );
+ pRet = new SdrObjCustomShape();
+ pRet->SetModel( pSdrModel );
+
+ sal_Bool bIsFontwork = ( GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ) & 0x4000 ) != 0;
+
+ // in case of a FontWork, the text is set by the escher import
+ if ( bIsFontwork )
+ {
+ String aObjectText;
+ String aFontName;
+ MSO_GeoTextAlign eGeoTextAlign;
+
+ if ( SeekToContent( DFF_Prop_gtextFont, rSt ) )
+ {
+ SvxFontItem aLatin(EE_CHAR_FONTINFO), aAsian(EE_CHAR_FONTINFO_CJK), aComplex(EE_CHAR_FONTINFO_CTL);
+ GetDefaultFonts( aLatin, aAsian, aComplex );
+
+ MSDFFReadZString( rSt, aFontName, GetPropertyValue( DFF_Prop_gtextFont ), TRUE );
+ aSet.Put( SvxFontItem( aLatin.GetFamily(), aFontName, aLatin.GetStyleName(),
+ PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, EE_CHAR_FONTINFO ));
+ aSet.Put( SvxFontItem( aLatin.GetFamily(), aFontName, aLatin.GetStyleName(),
+ PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, EE_CHAR_FONTINFO_CJK ) );
+ aSet.Put( SvxFontItem( aLatin.GetFamily(), aFontName, aLatin.GetStyleName(),
+ PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, EE_CHAR_FONTINFO_CTL ) );
+ }
+
+ // SJ: applying fontattributes for Fontwork :
+ if ( IsHardAttribute( DFF_Prop_gtextFItalic ) )
+ aSet.Put( SvxPostureItem( ( GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ) & 0x0010 ) != 0 ? ITALIC_NORMAL : ITALIC_NONE, EE_CHAR_ITALIC ) );
+
+ if ( IsHardAttribute( DFF_Prop_gtextFBold ) )
+ aSet.Put( SvxWeightItem( ( GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ) & 0x0020 ) != 0 ? WEIGHT_BOLD : WEIGHT_NORMAL, EE_CHAR_WEIGHT ) );
+
+ // SJ TODO: Vertical Writing is not correct, instead this should be
+ // replaced through "CharacterRotation" by 90°, therefore a new Item has to be
+ // supported by svx core, api and xml file format
+ ((SdrObjCustomShape*)pRet)->SetVerticalWriting( ( GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ) & 0x2000 ) != 0 );
+
+ if ( SeekToContent( DFF_Prop_gtextUNICODE, rSt ) )
+ {
+ MSDFFReadZString( rSt, aObjectText, GetPropertyValue( DFF_Prop_gtextUNICODE ), TRUE );
+ ReadObjText( aObjectText, pRet );
+ }
+
+ eGeoTextAlign = ( (MSO_GeoTextAlign)GetPropertyValue( DFF_Prop_gtextAlign, mso_alignTextCenter ) );
+ {
+ SdrTextHorzAdjust eHorzAdjust;
+ switch( eGeoTextAlign )
+ {
+ case mso_alignTextLetterJust :
+ case mso_alignTextWordJust :
+ case mso_alignTextStretch : eHorzAdjust = SDRTEXTHORZADJUST_BLOCK; break;
+ default:
+ case mso_alignTextInvalid :
+ case mso_alignTextCenter : eHorzAdjust = SDRTEXTHORZADJUST_CENTER; break;
+ case mso_alignTextLeft : eHorzAdjust = SDRTEXTHORZADJUST_LEFT; break;
+ case mso_alignTextRight : eHorzAdjust = SDRTEXTHORZADJUST_RIGHT; break;
+ }
+ aSet.Put( SdrTextHorzAdjustItem( eHorzAdjust ) );
+
+ SdrFitToSizeType eFTS = SDRTEXTFIT_NONE;
+ if ( eGeoTextAlign == mso_alignTextStretch )
+ eFTS = SDRTEXTFIT_ALLLINES;
+ aSet.Put( SdrTextFitToSizeTypeItem( eFTS ) );
+ }
+ if ( IsProperty( DFF_Prop_gtextSpacing ) )
+ {
+ sal_Int32 nTextWidth = GetPropertyValue( DFF_Prop_gtextSpacing, 100 < 16 ) / 655;
+ if ( nTextWidth != 100 )
+ aSet.Put( SvxCharScaleWidthItem( (sal_uInt16)nTextWidth, EE_CHAR_FONTWIDTH ) );
+ }
+ if ( GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ) & 0x1000 ) // SJ: Font Kerning On ?
+ aSet.Put( SvxKerningItem( 1, EE_CHAR_KERNING ) );
+ }
+ pRet->SetMergedItemSet( aSet );
+
+ // sj: taking care of rtl, ltr. In case of fontwork mso. seems not to be able to set
+ // proper text directions, instead the text default is depending to the string.
+ // so we have to calculate the a text direction from string:
+ if ( bIsFontwork )
+ {
+ OutlinerParaObject* pParaObj = ((SdrObjCustomShape*)pRet)->GetOutlinerParaObject();
+ if ( pParaObj )
+ {
+ SdrOutliner& rOutliner = ((SdrObjCustomShape*)pRet)->ImpGetDrawOutliner();
+ BOOL bOldUpdateMode = rOutliner.GetUpdateMode();
+ SdrModel* pModel = pRet->GetModel();
+ if ( pModel )
+ rOutliner.SetStyleSheetPool( (SfxStyleSheetPool*)pModel->GetStyleSheetPool() );
+ rOutliner.SetUpdateMode( FALSE );
+ rOutliner.SetText( *pParaObj );
+ VirtualDevice aVirDev( 1 );
+ aVirDev.SetMapMode( MAP_100TH_MM );
+ sal_uInt32 i, nParagraphs = rOutliner.GetParagraphCount();
+ if ( nParagraphs )
+ {
+ sal_Bool bCreateNewParaObject = sal_False;
+ for ( i = 0; i < nParagraphs; i++ )
+ {
+ BOOL bIsRTL = aVirDev.GetTextIsRTL( rOutliner.GetText( rOutliner.GetParagraph( i ) ), 0, STRING_LEN );
+ if ( bIsRTL )
+ {
+ SfxItemSet aSet2( rOutliner.GetParaAttribs( (USHORT)i ) );
+ aSet2.Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) );
+ rOutliner.SetParaAttribs( (USHORT)i, aSet2 );
+ bCreateNewParaObject = sal_True;
+ }
+ }
+ if ( bCreateNewParaObject )
+ {
+ OutlinerParaObject* pNewText = rOutliner.CreateParaObject();
+ rOutliner.Init( OUTLINERMODE_TEXTOBJECT );
+ ((SdrObjCustomShape*)pRet)->NbcSetOutlinerParaObject( pNewText );
+ }
+ }
+ rOutliner.Clear();
+ rOutliner.SetUpdateMode( bOldUpdateMode );
+ }
+ }
+
+ // mso_sptArc special treating:
+ // sj: since we actually can't render the arc because of its weird SnapRect settings,
+ // we will create a new CustomShape, that can be saved/loaded without problems.
+ // We will change the shape type, so this code applys only if importing arcs from msoffice.
+ if ( aObjData.eShapeType == mso_sptArc )
+ {
+ const rtl::OUString sAdjustmentValues( RTL_CONSTASCII_USTRINGPARAM ( "AdjustmentValues" ) );
+ const rtl::OUString sCoordinates( RTL_CONSTASCII_USTRINGPARAM ( "Coordinates" ) );
+ const rtl::OUString sHandles( RTL_CONSTASCII_USTRINGPARAM ( "Handles" ) );
+ const rtl::OUString sEquations( RTL_CONSTASCII_USTRINGPARAM ( "Equations" ) );
+ const rtl::OUString sViewBox( RTL_CONSTASCII_USTRINGPARAM ( "ViewBox" ) );
+ const rtl::OUString sPath( RTL_CONSTASCII_USTRINGPARAM ( "Path" ) );
+ const rtl::OUString sTextFrames( RTL_CONSTASCII_USTRINGPARAM ( "TextFrames" ) );
+ SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)((SdrObjCustomShape*)pRet)->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+ com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair> seqCoordinates;
+ com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue > seqAdjustmentValues;
+
+ // before clearing the GeometryItem we have to store the current Coordinates
+ const uno::Any* pAny = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sPath, sCoordinates );
+ Rectangle aPolyBoundRect;
+ if ( pAny && ( *pAny >>= seqCoordinates ) && ( seqCoordinates.getLength() >= 4 ) )
+ {
+ sal_Int32 nPtNum, nNumElemVert = seqCoordinates.getLength();
+ XPolygon aXP( (sal_uInt16)nNumElemVert );
+// const EnhancedCustomShapeParameterPair* pTmp = seqCoordinates.getArray();
+ for ( nPtNum = 0; nPtNum < nNumElemVert; nPtNum++ )
+ {
+ Point aP;
+ sal_Int32 nX = 0, nY = 0;
+ seqCoordinates[ nPtNum ].First.Value >>= nX;
+ seqCoordinates[ nPtNum ].Second.Value >>= nY;
+ aP.X() = nX;
+ aP.Y() = nY;
+ aXP[ (sal_uInt16)nPtNum ] = aP;
+ }
+ aPolyBoundRect = Rectangle( aXP.GetBoundRect() );
+ }
+ else
+ aPolyBoundRect = Rectangle( -21600, 0, 21600, 43200 ); // defaulting
+
+ // clearing items, so MergeDefaultAttributes will set the corresponding defaults from EnhancedCustomShapeGeometry
+ aGeometryItem.ClearPropertyValue( sHandles );
+ aGeometryItem.ClearPropertyValue( sEquations );
+ aGeometryItem.ClearPropertyValue( sViewBox );
+ aGeometryItem.ClearPropertyValue( sPath );
+
+ sal_Int32 nEndAngle = 9000;
+ sal_Int32 nStartAngle = 0;
+ pAny = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sAdjustmentValues );
+ if ( pAny && ( *pAny >>= seqAdjustmentValues ) && seqAdjustmentValues.getLength() > 1 )
+ {
+ double fNumber;
+ if ( seqAdjustmentValues[ 0 ].State == com::sun::star::beans::PropertyState_DIRECT_VALUE )
+ {
+ seqAdjustmentValues[ 0 ].Value >>= fNumber;
+ nEndAngle = NormAngle360( - (sal_Int32)fNumber * 100 );
+ }
+ else
+ {
+ fNumber = 270.0;
+ seqAdjustmentValues[ 0 ].Value <<= fNumber;
+ seqAdjustmentValues[ 0 ].State = com::sun::star::beans::PropertyState_DIRECT_VALUE; // so this value will properly be stored
+ }
+
+ if ( seqAdjustmentValues[ 1 ].State == com::sun::star::beans::PropertyState_DIRECT_VALUE )
+ {
+ seqAdjustmentValues[ 1 ].Value >>= fNumber;
+ nStartAngle = NormAngle360( - (sal_Int32)fNumber * 100 );
+ }
+ else
+ {
+ fNumber = 0.0;
+ seqAdjustmentValues[ 0 ].Value <<= fNumber;
+ seqAdjustmentValues[ 1 ].State = com::sun::star::beans::PropertyState_DIRECT_VALUE;
+ }
+
+ PropertyValue aPropVal;
+ aPropVal.Name = sAdjustmentValues;
+ aPropVal.Value <<= seqAdjustmentValues;
+ aGeometryItem.SetPropertyValue( aPropVal ); // storing the angle attribute
+ }
+ if ( nStartAngle != nEndAngle )
+ {
+ XPolygon aXPoly( aPolyBoundRect.Center(), aPolyBoundRect.GetWidth() / 2, aPolyBoundRect.GetHeight() / 2,
+ (USHORT)nStartAngle / 10, (USHORT)nEndAngle / 10, TRUE );
+ Rectangle aPolyPieRect( aXPoly.GetBoundRect() );
+
+ double fYScale, fXScale;
+ double fYOfs, fXOfs;
+
+ Point aP( aObjData.aBoundRect.Center() );
+ Size aS( aObjData.aBoundRect.GetSize() );
+ aP.X() -= aS.Width() / 2;
+ aP.Y() -= aS.Height() / 2;
+ Rectangle aLogicRect( aP, aS );
+
+ fYOfs = fXOfs = 0.0;
+
+ if ( aPolyBoundRect.GetWidth() && aPolyPieRect.GetWidth() )
+ {
+ fXScale = (double)aLogicRect.GetWidth() / (double)aPolyPieRect.GetWidth();
+ if ( nSpFlags & SP_FFLIPH )
+ fXOfs = ( (double)aPolyPieRect.Right() - (double)aPolyBoundRect.Right() ) * fXScale;
+ else
+ fXOfs = ( (double)aPolyBoundRect.Left() - (double)aPolyPieRect.Left() ) * fXScale;
+ }
+ if ( aPolyBoundRect.GetHeight() && aPolyPieRect.GetHeight() )
+ {
+ fYScale = (double)aLogicRect.GetHeight() / (double)aPolyPieRect.GetHeight();
+ if ( nSpFlags & SP_FFLIPV )
+ fYOfs = ( (double)aPolyPieRect.Bottom() - (double)aPolyBoundRect.Bottom() ) * fYScale;
+ else
+ fYOfs = ((double)aPolyBoundRect.Top() - (double)aPolyPieRect.Top() ) * fYScale;
+ }
+
+ fXScale = (double)aPolyBoundRect.GetWidth() / (double)aPolyPieRect.GetWidth();
+ fYScale = (double)aPolyBoundRect.GetHeight() / (double)aPolyPieRect.GetHeight();
+
+ Rectangle aOldBoundRect( aObjData.aBoundRect );
+ aObjData.aBoundRect = Rectangle( Point( aLogicRect.Left() + (sal_Int32)fXOfs, aLogicRect.Top() + (sal_Int32)fYOfs ),
+ Size( (sal_Int32)( aLogicRect.GetWidth() * fXScale ), (sal_Int32)( aLogicRect.GetHeight() * fYScale ) ) );
+
+ // creating the text frame -> scaling into (0,0),(21600,21600) destination coordinate system
+ double fTextFrameScaleX = (double)21600 / (double)aPolyBoundRect.GetWidth();
+ double fTextFrameScaleY = (double)21600 / (double)aPolyBoundRect.GetHeight();
+ sal_Int32 nLeft = (sal_Int32)(( aPolyPieRect.Left() - aPolyBoundRect.Left() ) * fTextFrameScaleX );
+ sal_Int32 nTop = (sal_Int32)(( aPolyPieRect.Top() - aPolyBoundRect.Top() ) * fTextFrameScaleY );
+ sal_Int32 nRight = (sal_Int32)(( aPolyPieRect.Right() - aPolyBoundRect.Left() ) * fTextFrameScaleX );
+ sal_Int32 nBottom= (sal_Int32)(( aPolyPieRect.Bottom()- aPolyBoundRect.Top() ) * fTextFrameScaleY );
+ com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeTextFrame > aTextFrame( 1 );
+ EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrame[ 0 ].TopLeft.First, nLeft );
+ EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrame[ 0 ].TopLeft.Second, nTop );
+ EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrame[ 0 ].BottomRight.First, nRight );
+ EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrame[ 0 ].BottomRight.Second,nBottom );
+ PropertyValue aProp;
+ aProp.Name = sTextFrames;
+ aProp.Value <<= aTextFrame;
+ aGeometryItem.SetPropertyValue( sPath, aProp );
+
+ // sj: taking care of the different rotation points, since the new arc is having a bigger snaprect
+ if ( mnFix16Angle )
+ {
+ sal_Int32 nAngle = mnFix16Angle;
+ if ( nSpFlags & SP_FFLIPH )
+ nAngle = 36000 - nAngle;
+ if ( nSpFlags & SP_FFLIPV )
+ nAngle = -nAngle;
+ double a = nAngle * F_PI18000;
+ double ss = sin( a );
+ double cc = cos( a );
+ Point aP1( aOldBoundRect.TopLeft() );
+ Point aC1( aObjData.aBoundRect.Center() );
+ Point aP2( aOldBoundRect.TopLeft() );
+ Point aC2( aOldBoundRect.Center() );
+ RotatePoint( aP1, aC1, ss, cc );
+ RotatePoint( aP2, aC2, ss, cc );
+ aObjData.aBoundRect.Move( aP2.X() - aP1.X(), aP2.Y() - aP1.Y() );
+ }
+ }
+ ((SdrObjCustomShape*)pRet)->SetMergedItem( aGeometryItem );
+ ((SdrObjCustomShape*)pRet)->MergeDefaultAttributes();
+
+ // now setting a new name, so the above correction is only done once when importing from ms
+ SdrCustomShapeGeometryItem aGeoName( (SdrCustomShapeGeometryItem&)((SdrObjCustomShape*)pRet)->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+ const rtl::OUString sType( RTL_CONSTASCII_USTRINGPARAM ( "Type" ) );
+ const rtl::OUString sName( RTL_CONSTASCII_USTRINGPARAM ( "mso-spt100" ) );
+ PropertyValue aPropVal;
+ aPropVal.Name = sType;
+ aPropVal.Value <<= sName;
+ aGeoName.SetPropertyValue( aPropVal );
+ ((SdrObjCustomShape*)pRet)->SetMergedItem( aGeoName );
+ }
+ else
+ ((SdrObjCustomShape*)pRet)->MergeDefaultAttributes();
+
+ pRet->SetSnapRect( aObjData.aBoundRect );
+ EnhancedCustomShape2d aCustomShape2d( pRet );
+ aTextRect = aCustomShape2d.GetTextRect();
+
+ bIsCustomShape = TRUE;
+
+ if( bIsConnector )
+ {
+ if( nObjectRotation )
+ {
+ double a = nObjectRotation * nPi180;
+ pRet->NbcRotate( aObjData.aBoundRect.Center(), nObjectRotation, sin( a ), cos( a ) );
+ }
+ // Horizontal gespiegelt?
+ if ( nSpFlags & SP_FFLIPH )
+ {
+ Rectangle aBndRect( pRet->GetSnapRect() );
+ Point aTop( ( aBndRect.Left() + aBndRect.Right() ) >> 1, aBndRect.Top() );
+ Point aBottom( aTop.X(), aTop.Y() + 1000 );
+ pRet->NbcMirror( aTop, aBottom );
+ }
+ // Vertikal gespiegelt?
+ if ( nSpFlags & SP_FFLIPV )
+ {
+ Rectangle aBndRect( pRet->GetSnapRect() );
+ Point aLeft( aBndRect.Left(), ( aBndRect.Top() + aBndRect.Bottom() ) >> 1 );
+ Point aRight( aLeft.X() + 1000, aLeft.Y() );
+ pRet->NbcMirror( aLeft, aRight );
+ }
+ basegfx::B2DPolyPolygon aPoly( SdrObjCustomShape::GetLineGeometry( (SdrObjCustomShape*)pRet, sal_True ) );
+ SdrObject::Free( pRet );
+
+ pRet = new SdrEdgeObj();
+ pRet->SetLogicRect( aObjData.aBoundRect );
+
+ // Konnektoren
+ MSO_ConnectorStyle eConnectorStyle = (MSO_ConnectorStyle)GetPropertyValue( DFF_Prop_cxstyle, mso_cxstyleStraight );
+
+ ((SdrEdgeObj*)pRet)->ConnectToNode(TRUE, NULL);
+ ((SdrEdgeObj*)pRet)->ConnectToNode(FALSE, NULL);
+
+ Point aPoint1( aObjData.aBoundRect.TopLeft() );
+ Point aPoint2( aObjData.aBoundRect.BottomRight() );
+
+ // Rotationen beachten
+ if ( nObjectRotation )
+ {
+ double a = nObjectRotation * nPi180;
+ Point aCenter( aObjData.aBoundRect.Center() );
+ double ss = sin(a);
+ double cc = cos(a);
+
+ RotatePoint(aPoint1, aCenter, ss, cc);
+ RotatePoint(aPoint2, aCenter, ss, cc);
+ }
+
+ // Linie innerhalb des Bereiches zurechtdrehen/spiegeln
+ if ( nSpFlags & SP_FFLIPH )
+ {
+ INT32 n = aPoint1.X();
+ aPoint1.X() = aPoint2.X();
+ aPoint2.X() = n;
+ }
+ if ( nSpFlags & SP_FFLIPV )
+ {
+ INT32 n = aPoint1.Y();
+ aPoint1.Y() = aPoint2.Y();
+ aPoint2.Y() = n;
+ }
+ nSpFlags &= ~( SP_FFLIPV | SP_FFLIPH );
+
+ pRet->NbcSetPoint(aPoint1, 0L); // Startpunkt
+ pRet->NbcSetPoint(aPoint2, 1L); // Endpunkt
+
+ sal_Int32 n1HorzDist, n1VertDist, n2HorzDist, n2VertDist;
+ n1HorzDist = n1VertDist = n2HorzDist = n2VertDist = 0;
+ switch( eConnectorStyle )
+ {
+ case mso_cxstyleBent:
+ {
+ aSet.Put( SdrEdgeKindItem( SDREDGE_ORTHOLINES ) );
+ n1HorzDist = n1VertDist = n2HorzDist = n2VertDist = 630;
+ }
+ break;
+ case mso_cxstyleCurved:
+ aSet.Put( SdrEdgeKindItem( SDREDGE_BEZIER ) );
+ break;
+ default: // mso_cxstyleStraight || mso_cxstyleNone
+ aSet.Put( SdrEdgeKindItem( SDREDGE_ONELINE ) );
+ break;
+ }
+ aSet.Put( SdrEdgeNode1HorzDistItem( n1HorzDist ) );
+ aSet.Put( SdrEdgeNode1VertDistItem( n1VertDist ) );
+ aSet.Put( SdrEdgeNode2HorzDistItem( n2HorzDist ) );
+ aSet.Put( SdrEdgeNode2VertDistItem( n2VertDist ) );
+
+ ((SdrEdgeObj*)pRet)->SetEdgeTrackPath( aPoly );
+ }
+ }
+ }
+
+ if ( pRet )
+ {
+ if( nObjectRotation )
+ {
+ double a = nObjectRotation * nPi180;
+ pRet->NbcRotate( aObjData.aBoundRect.Center(), nObjectRotation, sin( a ), cos( a ) );
+ }
+ // Horizontal gespiegelt?
+ if ( nSpFlags & SP_FFLIPH )
+ {
+ Rectangle aBndRect( pRet->GetSnapRect() );
+ Point aTop( ( aBndRect.Left() + aBndRect.Right() ) >> 1, aBndRect.Top() );
+ Point aBottom( aTop.X(), aTop.Y() + 1000 );
+ pRet->NbcMirror( aTop, aBottom );
+ }
+ // Vertikal gespiegelt?
+ if ( nSpFlags & SP_FFLIPV )
+ {
+ Rectangle aBndRect( pRet->GetSnapRect() );
+ Point aLeft( aBndRect.Left(), ( aBndRect.Top() + aBndRect.Bottom() ) >> 1 );
+ Point aRight( aLeft.X() + 1000, aLeft.Y() );
+ pRet->NbcMirror( aLeft, aRight );
+ }
+ }
+ }
+ }
+
+ // #i51348# #118052# name of the shape
+ if( pRet )
+ {
+ ::rtl::OUString aObjName = GetPropertyString( DFF_Prop_wzName, rSt );
+ if( aObjName.getLength() > 0 )
+ pRet->SetName( aObjName );
+ }
+
+ pRet =
+ ProcessObj( rSt, aObjData, pClientData, aTextRect, pRet);
+
+ if ( mbTracing )
+ mpTracer->RemoveAttribute( aObjData.nSpFlags & SP_FGROUP
+ ? rtl::OUString::createFromAscii( "GroupShape" )
+ : rtl::OUString::createFromAscii( "Shape" ) );
+ return pRet;
+}
+
+Rectangle SvxMSDffManager::GetGlobalChildAnchor( const DffRecordHeader& rHd, SvStream& rSt, Rectangle& aClientRect )
+{
+ Rectangle aChildAnchor;
+ rHd.SeekToContent( rSt );
+ while ( ( rSt.GetError() == 0 ) && ( rSt.Tell() < rHd.GetRecEndFilePos() ) )
+ {
+ DffRecordHeader aShapeHd;
+ rSt >> aShapeHd;
+ if ( ( aShapeHd.nRecType == DFF_msofbtSpContainer ) ||
+ ( aShapeHd.nRecType == DFF_msofbtSpgrContainer ) )
+ {
+ DffRecordHeader aShapeHd2( aShapeHd );
+ if ( aShapeHd.nRecType == DFF_msofbtSpgrContainer )
+ rSt >> aShapeHd2;
+ while( ( rSt.GetError() == 0 ) && ( rSt.Tell() < aShapeHd2.GetRecEndFilePos() ) )
+ {
+ DffRecordHeader aShapeAtom;
+ rSt >> aShapeAtom;
+
+ if ( aShapeAtom.nRecType == DFF_msofbtClientAnchor )
+ {
+ if ( GetSvxMSDffSettings() & SVXMSDFF_SETTINGS_IMPORT_PPT )
+ {
+ sal_Int32 l, t, r, b;
+ if ( aShapeAtom.nRecLen == 16 )
+ {
+ rSt >> l >> t >> r >> b;
+ }
+ else
+ {
+ INT16 ls, ts, rs, bs;
+ rSt >> ts >> ls >> rs >> bs; // etwas seltsame Koordinatenreihenfolge ...
+ l = ls, t = ts, r = rs, b = bs;
+ }
+ Scale( l );
+ Scale( t );
+ Scale( r );
+ Scale( b );
+ aClientRect = Rectangle( l, t, r, b );
+ }
+ break;
+ }
+ else if ( aShapeAtom.nRecType == DFF_msofbtChildAnchor )
+ {
+ sal_Int32 l, o, r, u;
+ rSt >> l >> o >> r >> u;
+ Scale( l );
+ Scale( o );
+ Scale( r );
+ Scale( u );
+ Rectangle aChild( l, o, r, u );
+ aChildAnchor.Union( aChild );
+ break;
+ }
+ aShapeAtom.SeekToEndOfRecord( rSt );
+ }
+ }
+ aShapeHd.SeekToEndOfRecord( rSt );
+ }
+ return aChildAnchor;
+}
+
+void SvxMSDffManager::GetGroupAnchors( const DffRecordHeader& rHd, SvStream& rSt,
+ Rectangle& rGroupClientAnchor, Rectangle& rGroupChildAnchor,
+ const Rectangle& rClientRect, const Rectangle& rGlobalChildRect )
+{
+ sal_Bool bFirst = sal_True;
+ rHd.SeekToContent( rSt );
+ DffRecordHeader aShapeHd;
+ while ( ( rSt.GetError() == 0 ) && ( rSt.Tell() < rHd.GetRecEndFilePos() ) )
+ {
+ rSt >> aShapeHd;
+ if ( ( aShapeHd.nRecType == DFF_msofbtSpContainer ) ||
+ ( aShapeHd.nRecType == DFF_msofbtSpgrContainer ) )
+ {
+ DffRecordHeader aShapeHd2( aShapeHd );
+ if ( aShapeHd.nRecType == DFF_msofbtSpgrContainer )
+ rSt >> aShapeHd2;
+ while( ( rSt.GetError() == 0 ) && ( rSt.Tell() < aShapeHd2.GetRecEndFilePos() ) )
+ {
+ DffRecordHeader aShapeAtom;
+ rSt >> aShapeAtom;
+ if ( aShapeAtom.nRecType == DFF_msofbtChildAnchor )
+ {
+ sal_Int32 l, o, r, u;
+ rSt >> l >> o >> r >> u;
+ Scale( l );
+ Scale( o );
+ Scale( r );
+ Scale( u );
+ Rectangle aChild( l, o, r, u );
+
+ if ( bFirst )
+ {
+ if ( !rGlobalChildRect.IsEmpty() && !rClientRect.IsEmpty() && rGlobalChildRect.GetWidth() && rGlobalChildRect.GetHeight() )
+ {
+ double fl = l;
+ double fo = o;
+ double fWidth = r - l;
+ double fHeight= u - o;
+ double fXScale = (double)rClientRect.GetWidth() / (double)rGlobalChildRect.GetWidth();
+ double fYScale = (double)rClientRect.GetHeight() / (double)rGlobalChildRect.GetHeight();
+ fl = ( ( l - rGlobalChildRect.Left() ) * fXScale ) + rClientRect.Left();
+ fo = ( ( o - rGlobalChildRect.Top() ) * fYScale ) + rClientRect.Top();
+ fWidth *= fXScale;
+ fHeight *= fYScale;
+ rGroupClientAnchor = Rectangle( Point( (sal_Int32)fl, (sal_Int32)fo ), Size( (sal_Int32)( fWidth + 1 ), (sal_Int32)( fHeight + 1 ) ) );
+ }
+ bFirst = sal_False;
+ }
+ else
+ rGroupChildAnchor.Union( aChild );
+ break;
+ }
+ aShapeAtom.SeekToEndOfRecord( rSt );
+ }
+ }
+ aShapeHd.SeekToEndOfRecord( rSt );
+ }
+}
+
+SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
+ DffObjData& rObjData,
+ void* pData,
+ Rectangle& rTextRect,
+ SdrObject* pObj
+ )
+{
+ if( !rTextRect.IsEmpty() )
+ {
+ SvxMSDffImportData& rImportData = *(SvxMSDffImportData*)pData;
+ SvxMSDffImportRec* pImpRec = new SvxMSDffImportRec;
+ SvxMSDffImportRec* pTextImpRec = pImpRec;
+
+ // fill Import Record with data
+ pImpRec->nShapeId = rObjData.nShapeId;
+ pImpRec->eShapeType = rObjData.eShapeType;
+
+ MSO_WrapMode eWrapMode( (MSO_WrapMode)GetPropertyValue(
+ DFF_Prop_WrapText,
+ mso_wrapSquare ) );
+ rObjData.bClientAnchor = maShapeRecords.SeekToContent( rSt,
+ DFF_msofbtClientAnchor,
+ SEEK_FROM_CURRENT_AND_RESTART );
+ if( rObjData.bClientAnchor )
+ ProcessClientAnchor( rSt,
+ maShapeRecords.Current()->nRecLen,
+ pImpRec->pClientAnchorBuffer, pImpRec->nClientAnchorLen );
+
+ rObjData.bClientData = maShapeRecords.SeekToContent( rSt,
+ DFF_msofbtClientData,
+ SEEK_FROM_CURRENT_AND_RESTART );
+ if( rObjData.bClientData )
+ ProcessClientData( rSt,
+ maShapeRecords.Current()->nRecLen,
+ pImpRec->pClientDataBuffer, pImpRec->nClientDataLen );
+
+
+ // process user (== Winword) defined parameters in 0xF122 record
+ if( maShapeRecords.SeekToContent( rSt,
+ DFF_msofbtUDefProp,
+ SEEK_FROM_CURRENT_AND_RESTART )
+ && maShapeRecords.Current()->nRecLen )
+ {
+ UINT32 nBytesLeft = maShapeRecords.Current()->nRecLen;
+ UINT32 nUDData;
+ UINT16 nPID;
+ while( 5 < nBytesLeft )
+ {
+ rSt >> nPID;
+ if ( rSt.GetError() != 0 )
+ break;
+ rSt >> nUDData;
+ switch( nPID )
+ {
+ case 0x038F: pImpRec->nXAlign = nUDData; break;
+ case 0x0390: pImpRec->nXRelTo = nUDData; break;
+ case 0x0391: pImpRec->nYAlign = nUDData; break;
+ case 0x0392: pImpRec->nYRelTo = nUDData; break;
+ case 0x03BF: pImpRec->nLayoutInTableCell = nUDData; break;
+ }
+ if ( rSt.GetError() != 0 )
+ break;
+ pImpRec->bHasUDefProp = TRUE;
+ nBytesLeft -= 6;
+ }
+ }
+
+ // Textrahmen, auch Title oder Outline
+ SdrObject* pOrgObj = pObj;
+ SdrRectObj* pTextObj = 0;
+ UINT32 nTextId = GetPropertyValue( DFF_Prop_lTxid, 0 );
+ if( nTextId )
+ {
+ SfxItemSet aSet( pSdrModel->GetItemPool() );
+
+ //Originally anything that as a mso_sptTextBox was created as a
+ //textbox, this was changed for #88277# to be created as a simple
+ //rect to keep impress happy. For the rest of us we'd like to turn
+ //it back into a textbox again.
+ FASTBOOL bTextFrame = (pImpRec->eShapeType == mso_sptTextBox);
+ if (!bTextFrame)
+ {
+ //Either
+ //a) its a simple text object or
+ //b) its a rectangle with text and square wrapping.
+ bTextFrame =
+ (
+ (pImpRec->eShapeType == mso_sptTextSimple) ||
+ (
+ (pImpRec->eShapeType == mso_sptRectangle)
+ && (eWrapMode == mso_wrapSquare)
+ && ShapeHasText(pImpRec->nShapeId, rObjData.rSpHd.GetRecBegFilePos() )
+ )
+ );
+ }
+
+ if (bTextFrame)
+ {
+ SdrObject::Free( pObj );
+ pObj = pOrgObj = 0;
+ }
+
+ // Distance of Textbox to it's surrounding Customshape
+ INT32 nTextLeft = GetPropertyValue( DFF_Prop_dxTextLeft, 91440L);
+ INT32 nTextRight = GetPropertyValue( DFF_Prop_dxTextRight, 91440L );
+ INT32 nTextTop = GetPropertyValue( DFF_Prop_dyTextTop, 45720L );
+ INT32 nTextBottom = GetPropertyValue( DFF_Prop_dyTextBottom, 45720L );
+
+ ScaleEmu( nTextLeft );
+ ScaleEmu( nTextRight );
+ ScaleEmu( nTextTop );
+ ScaleEmu( nTextBottom );
+
+ INT32 nTextRotationAngle=0;
+ bool bVerticalText = false;
+ if ( IsProperty( DFF_Prop_txflTextFlow ) )
+ {
+ MSO_TextFlow eTextFlow = (MSO_TextFlow)(GetPropertyValue(
+ DFF_Prop_txflTextFlow) & 0xFFFF);
+ switch( eTextFlow )
+ {
+ case mso_txflBtoT:
+ nTextRotationAngle = 9000;
+ break;
+ case mso_txflVertN:
+ case mso_txflTtoBN:
+ nTextRotationAngle = 27000;
+ break;
+ case mso_txflTtoBA:
+ bVerticalText = true;
+ break;
+ case mso_txflHorzA:
+ bVerticalText = true;
+ nTextRotationAngle = 9000;
+ case mso_txflHorzN:
+ default :
+ break;
+ }
+ }
+
+ if (nTextRotationAngle)
+ {
+ while (nTextRotationAngle > 360000)
+ nTextRotationAngle-=9000;
+ switch (nTextRotationAngle)
+ {
+ case 9000:
+ {
+ long nWidth = rTextRect.GetWidth();
+ rTextRect.Right() = rTextRect.Left() + rTextRect.GetHeight();
+ rTextRect.Bottom() = rTextRect.Top() + nWidth;
+
+ INT32 nOldTextLeft = nTextLeft;
+ INT32 nOldTextRight = nTextRight;
+ INT32 nOldTextTop = nTextTop;
+ INT32 nOldTextBottom = nTextBottom;
+
+ nTextLeft = nOldTextBottom;
+ nTextRight = nOldTextTop;
+ nTextTop = nOldTextLeft;
+ nTextBottom = nOldTextRight;
+ }
+ break;
+ case 27000:
+ {
+ long nWidth = rTextRect.GetWidth();
+ rTextRect.Right() = rTextRect.Left() + rTextRect.GetHeight();
+ rTextRect.Bottom() = rTextRect.Top() + nWidth;
+
+ INT32 nOldTextLeft = nTextLeft;
+ INT32 nOldTextRight = nTextRight;
+ INT32 nOldTextTop = nTextTop;
+ INT32 nOldTextBottom = nTextBottom;
+
+ nTextLeft = nOldTextTop;
+ nTextRight = nOldTextBottom;
+ nTextTop = nOldTextRight;
+ nTextBottom = nOldTextLeft;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ pTextObj = new SdrRectObj(OBJ_TEXT, rTextRect);
+ pTextImpRec = new SvxMSDffImportRec(*pImpRec);
+
+ // Die vertikalen Absatzeinrueckungen sind im BoundRect mit drin,
+ // hier rausrechnen
+ Rectangle aNewRect(rTextRect);
+ aNewRect.Bottom() -= nTextTop + nTextBottom;
+ aNewRect.Right() -= nTextLeft + nTextRight;
+
+ // Nur falls es eine einfache Textbox ist, darf der Writer
+ // das Objekt durch einen Rahmen ersetzen, ansonsten
+ if( bTextFrame )
+ {
+ SvxMSDffShapeInfo aTmpRec( 0, pImpRec->nShapeId );
+ aTmpRec.bSortByShapeId = TRUE;
+
+ USHORT nFound;
+ if( pShapeInfos->Seek_Entry( &aTmpRec, &nFound ) )
+ {
+ SvxMSDffShapeInfo& rInfo = *pShapeInfos->GetObject(nFound);
+ pTextImpRec->bReplaceByFly = rInfo.bReplaceByFly;
+ pTextImpRec->bLastBoxInChain = rInfo.bLastBoxInChain;
+ }
+ }
+
+ if( !pObj )
+ ApplyAttributes( rSt, aSet, rObjData );
+
+ bool bFitText = false;
+ if (GetPropertyValue(DFF_Prop_FitTextToShape) & 2)
+ {
+ aSet.Put( SdrTextAutoGrowHeightItem( TRUE ) );
+ aSet.Put( SdrTextMinFrameHeightItem(
+ aNewRect.Bottom() - aNewRect.Top() ) );
+ aSet.Put( SdrTextMinFrameWidthItem(
+ aNewRect.Right() - aNewRect.Left() ) );
+ bFitText = true;
+ }
+ else
+ {
+ aSet.Put( SdrTextAutoGrowHeightItem( FALSE ) );
+ aSet.Put( SdrTextAutoGrowWidthItem( FALSE ) );
+ }
+
+ switch ( (MSO_WrapMode)
+ GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare ) )
+ {
+ case mso_wrapNone :
+ aSet.Put( SdrTextAutoGrowWidthItem( TRUE ) );
+ if (bFitText)
+ {
+ //can't do autowidth in flys #i107184#
+ pTextImpRec->bReplaceByFly = false;
+ }
+ break;
+ case mso_wrapByPoints :
+ aSet.Put( SdrTextContourFrameItem( TRUE ) );
+ break;
+ default: break;
+ }
+
+ // Abstaende an den Raendern der Textbox setzen
+ aSet.Put( SdrTextLeftDistItem( nTextLeft ) );
+ aSet.Put( SdrTextRightDistItem( nTextRight ) );
+ aSet.Put( SdrTextUpperDistItem( nTextTop ) );
+ aSet.Put( SdrTextLowerDistItem( nTextBottom ) );
+ pTextImpRec->nDxTextLeft = nTextLeft;
+ pTextImpRec->nDyTextTop = nTextTop;
+ pTextImpRec->nDxTextRight = nTextRight;
+ pTextImpRec->nDyTextBottom = nTextBottom;
+
+ // Textverankerung lesen
+ if ( IsProperty( DFF_Prop_anchorText ) )
+ {
+ MSO_Anchor eTextAnchor =
+ (MSO_Anchor)GetPropertyValue( DFF_Prop_anchorText );
+
+ SdrTextVertAdjust eTVA = SDRTEXTVERTADJUST_CENTER;
+ BOOL bTVASet(FALSE);
+ SdrTextHorzAdjust eTHA = SDRTEXTHORZADJUST_CENTER;
+ BOOL bTHASet(FALSE);
+
+ switch( eTextAnchor )
+ {
+ case mso_anchorTop:
+ {
+ eTVA = SDRTEXTVERTADJUST_TOP;
+ bTVASet = TRUE;
+ }
+ break;
+ case mso_anchorTopCentered:
+ {
+ eTVA = SDRTEXTVERTADJUST_TOP;
+ bTVASet = TRUE;
+ bTHASet = TRUE;
+ }
+ break;
+
+ case mso_anchorMiddle:
+ bTVASet = TRUE;
+ break;
+ case mso_anchorMiddleCentered:
+ {
+ bTVASet = TRUE;
+ bTHASet = TRUE;
+ }
+ break;
+ case mso_anchorBottom:
+ {
+ eTVA = SDRTEXTVERTADJUST_BOTTOM;
+ bTVASet = TRUE;
+ }
+ break;
+ case mso_anchorBottomCentered:
+ {
+ eTVA = SDRTEXTVERTADJUST_BOTTOM;
+ bTVASet = TRUE;
+ bTHASet = TRUE;
+ }
+ break;
+ /*
+ case mso_anchorTopBaseline:
+ case mso_anchorBottomBaseline:
+ case mso_anchorTopCenteredBaseline:
+ case mso_anchorBottomCenteredBaseline:
+ break;
+ */
+ default : break;
+ }
+ // Einsetzen
+ if ( bTVASet )
+ aSet.Put( SdrTextVertAdjustItem( eTVA ) );
+ if ( bTHASet )
+ aSet.Put( SdrTextHorzAdjustItem( eTHA ) );
+ }
+
+ pTextObj->SetMergedItemSet(aSet);
+ pTextObj->SetModel(pSdrModel);
+
+ if (bVerticalText)
+ pTextObj->SetVerticalWriting(sal_True);
+
+ if (nTextRotationAngle)
+ {
+ long nMinWH = rTextRect.GetWidth() < rTextRect.GetHeight() ?
+ rTextRect.GetWidth() : rTextRect.GetHeight();
+ nMinWH /= 2;
+ Point aPivot(rTextRect.TopLeft());
+ aPivot.X() += nMinWH;
+ aPivot.Y() += nMinWH;
+ double a = nTextRotationAngle * nPi180;
+ pTextObj->NbcRotate(aPivot, nTextRotationAngle, sin(a), cos(a));
+ }
+
+ // rotate text with shape ?
+ if ( mnFix16Angle )
+ {
+ double a = mnFix16Angle * nPi180;
+ pTextObj->NbcRotate( rObjData.aBoundRect.Center(), mnFix16Angle,
+ sin( a ), cos( a ) );
+ }
+
+ if( !pObj )
+ {
+ pObj = pTextObj;
+ }
+ else
+ {
+ if( pTextObj != pObj )
+ {
+ SdrObject* pGroup = new SdrObjGroup;
+ pGroup->GetSubList()->NbcInsertObject( pObj );
+ pGroup->GetSubList()->NbcInsertObject( pTextObj );
+ if (pOrgObj == pObj)
+ pOrgObj = pGroup;
+ else
+ pOrgObj = pObj;
+ pObj = pGroup;
+ }
+ }
+ }
+ else if( !pObj )
+ {
+ // simple rectangular objects are ignored by ImportObj() :-(
+ // this is OK for Draw but not for Calc and Writer
+ // cause here these objects have a default border
+ pObj = new SdrRectObj(rTextRect);
+ pOrgObj = pObj;
+ pObj->SetModel( pSdrModel );
+ SfxItemSet aSet( pSdrModel->GetItemPool() );
+ ApplyAttributes( rSt, aSet, rObjData );
+
+ const SfxPoolItem* pPoolItem=NULL;
+ SfxItemState eState = aSet.GetItemState( XATTR_FILLCOLOR,
+ FALSE, &pPoolItem );
+ if( SFX_ITEM_DEFAULT == eState )
+ aSet.Put( XFillColorItem( String(),
+ Color( mnDefaultColor ) ) );
+ pObj->SetMergedItemSet(aSet);
+ }
+
+ //Means that fBehindDocument is set
+ if (GetPropertyValue(DFF_Prop_fPrint) & 0x20)
+ pImpRec->bDrawHell = TRUE;
+ else
+ pImpRec->bDrawHell = FALSE;
+ if (GetPropertyValue(DFF_Prop_fPrint) & 0x02)
+ pImpRec->bHidden = TRUE;
+ pTextImpRec->bDrawHell = pImpRec->bDrawHell;
+ pTextImpRec->bHidden = pImpRec->bHidden;
+ pImpRec->nNextShapeId = GetPropertyValue( DFF_Prop_hspNext, 0 );
+ pTextImpRec->nNextShapeId=pImpRec->nNextShapeId;
+
+ if ( nTextId )
+ {
+ pTextImpRec->aTextId.nTxBxS = (UINT16)( nTextId >> 16 );
+ pTextImpRec->aTextId.nSequence = (UINT16)nTextId;
+ }
+
+ pTextImpRec->nDxWrapDistLeft = GetPropertyValue(
+ DFF_Prop_dxWrapDistLeft, 114935L ) / 635L;
+ pTextImpRec->nDyWrapDistTop = GetPropertyValue(
+ DFF_Prop_dyWrapDistTop, 0 ) / 635L;
+ pTextImpRec->nDxWrapDistRight = GetPropertyValue(
+ DFF_Prop_dxWrapDistRight, 114935L ) / 635L;
+ pTextImpRec->nDyWrapDistBottom = GetPropertyValue(
+ DFF_Prop_dyWrapDistBottom, 0 ) / 635L;
+ // 16.16 fraction times total image width or height, as appropriate.
+
+ if (SeekToContent(DFF_Prop_pWrapPolygonVertices, rSt))
+ {
+ delete pTextImpRec->pWrapPolygon;
+ sal_uInt16 nNumElemVert, nNumElemMemVert, nElemSizeVert;
+ rSt >> nNumElemVert >> nNumElemMemVert >> nElemSizeVert;
+ if (nNumElemVert && ((nElemSizeVert == 8) || (nElemSizeVert == 4)))
+ {
+ pTextImpRec->pWrapPolygon = new Polygon(nNumElemVert);
+ for (sal_uInt16 i = 0; i < nNumElemVert; ++i)
+ {
+ sal_Int32 nX, nY;
+ if (nElemSizeVert == 8)
+ rSt >> nX >> nY;
+ else
+ {
+ sal_Int16 nSmallX, nSmallY;
+ rSt >> nSmallX >> nSmallY;
+ nX = nSmallX;
+ nY = nSmallY;
+ }
+ (*(pTextImpRec->pWrapPolygon))[i].X() = nX;
+ (*(pTextImpRec->pWrapPolygon))[i].Y() = nY;
+ }
+ }
+ }
+
+ pImpRec->nCropFromTop = GetPropertyValue(
+ DFF_Prop_cropFromTop, 0 );
+ pImpRec->nCropFromBottom = GetPropertyValue(
+ DFF_Prop_cropFromBottom, 0 );
+ pImpRec->nCropFromLeft = GetPropertyValue(
+ DFF_Prop_cropFromLeft, 0 );
+ pImpRec->nCropFromRight = GetPropertyValue(
+ DFF_Prop_cropFromRight, 0 );
+
+ pImpRec->bVFlip = (rObjData.nSpFlags & SP_FFLIPV) ? true : false;
+ pImpRec->bHFlip = (rObjData.nSpFlags & SP_FFLIPH) ? true : false;
+
+ UINT32 nLineFlags = GetPropertyValue( DFF_Prop_fNoLineDrawDash );
+ pImpRec->eLineStyle = (nLineFlags & 8)
+ ? (MSO_LineStyle)GetPropertyValue(
+ DFF_Prop_lineStyle,
+ mso_lineSimple )
+ : (MSO_LineStyle)USHRT_MAX;
+ pTextImpRec->eLineStyle = pImpRec->eLineStyle;
+
+ if( pImpRec->nShapeId )
+ {
+ // Import-Record-Liste ergaenzen
+ if( pOrgObj )
+ {
+ pImpRec->pObj = pOrgObj;
+ rImportData.aRecords.Insert( pImpRec );
+ }
+
+ if( pTextObj && (pOrgObj != pTextObj) )
+ {
+ // Modify ShapeId (must be unique)
+ pImpRec->nShapeId |= 0x8000000;
+ pTextImpRec->pObj = pTextObj;
+ rImportData.aRecords.Insert( pTextImpRec );
+ }
+
+ // Eintrag in Z-Order-Liste um Zeiger auf dieses Objekt ergaenzen
+ /*Only store objects which are not deep inside the tree*/
+ if( ( rObjData.nCalledByGroup == 0 )
+ ||
+ ( (rObjData.nSpFlags & SP_FGROUP)
+ && (rObjData.nCalledByGroup < 2) )
+ )
+ StoreShapeOrder( pImpRec->nShapeId,
+ ( ( (ULONG)pImpRec->aTextId.nTxBxS ) << 16 )
+ + pImpRec->aTextId.nSequence, pObj );
+ }
+ else
+ delete pImpRec;
+ }
+
+ return pObj;
+};
+
+void SvxMSDffManager::StoreShapeOrder(ULONG nId,
+ ULONG nTxBx,
+ SdrObject* pObject,
+ SwFlyFrmFmt* pFly,
+ short nHdFtSection) const
+{
+ USHORT nShpCnt = pShapeOrders->Count();
+ for (USHORT nShapeNum=0; nShapeNum < nShpCnt; nShapeNum++)
+ {
+ SvxMSDffShapeOrder& rOrder
+ = *(SvxMSDffShapeOrder*)(pShapeOrders->GetObject( nShapeNum ));
+
+ if( rOrder.nShapeId == nId )
+ {
+ rOrder.nTxBxComp = nTxBx;
+ rOrder.pObj = pObject;
+ rOrder.pFly = pFly;
+ rOrder.nHdFtSection = nHdFtSection;
+ }
+ }
+}
+
+
+void SvxMSDffManager::ExchangeInShapeOrder( SdrObject* pOldObject,
+ ULONG nTxBx,
+ SwFlyFrmFmt* pFly,
+ SdrObject* pObject) const
+{
+ USHORT nShpCnt = pShapeOrders->Count();
+ for (USHORT nShapeNum=0; nShapeNum < nShpCnt; nShapeNum++)
+ {
+ SvxMSDffShapeOrder& rOrder
+ = *(SvxMSDffShapeOrder*)(pShapeOrders->GetObject( nShapeNum ));
+
+ if( rOrder.pObj == pOldObject )
+ {
+ rOrder.pFly = pFly;
+ rOrder.pObj = pObject;
+ rOrder.nTxBxComp = nTxBx;
+ }
+ }
+}
+
+
+void SvxMSDffManager::RemoveFromShapeOrder( SdrObject* pObject ) const
+{
+ USHORT nShpCnt = pShapeOrders->Count();
+ for (USHORT nShapeNum=0; nShapeNum < nShpCnt; nShapeNum++)
+ {
+ SvxMSDffShapeOrder& rOrder
+ = *(SvxMSDffShapeOrder*)(pShapeOrders->GetObject( nShapeNum ));
+
+ if( rOrder.pObj == pObject )
+ {
+ rOrder.pObj = 0;
+ rOrder.pFly = 0;
+ rOrder.nTxBxComp = 0;
+ }
+ }
+}
+
+
+
+
+//---------------------------------------------------------------------------
+// Hilfs Deklarationen
+//---------------------------------------------------------------------------
+
+/*struct SvxMSDffBLIPInfo -> in's Header-File
+{
+ USHORT nBLIPType; // Art des BLIP: z.B. 6 fuer PNG
+ ULONG nFilePos; // Offset des BLIP im Daten-Stream
+ ULONG nBLIPSize; // Anzahl Bytes, die der BLIP im Stream einnimmt
+ SvxMSDffBLIPInfo(USHORT nBType, ULONG nFPos, ULONG nBSize):
+ nBLIPType( nBType ), nFilePos( nFPos ), nBLIPSize( nBSize ){}
+};
+*/
+
+SV_IMPL_PTRARR( SvxMSDffBLIPInfos, SvxMSDffBLIPInfo_Ptr );
+
+SV_IMPL_PTRARR( SvxMSDffShapeOrders, SvxMSDffShapeOrder_Ptr );
+
+SV_IMPL_OP_PTRARR_SORT( SvxMSDffShapeInfos, SvxMSDffShapeInfo_Ptr );
+
+SV_IMPL_OP_PTRARR_SORT( SvxMSDffShapeTxBxSort, SvxMSDffShapeOrder_Ptr );
+
+
+// Liste aller SvxMSDffImportRec fuer eine Gruppe
+SV_IMPL_OP_PTRARR_SORT(MSDffImportRecords, MSDffImportRec_Ptr)
+
+//---------------------------------------------------------------------------
+// exportierte Klasse: oeffentliche Methoden
+//---------------------------------------------------------------------------
+
+SvxMSDffManager::SvxMSDffManager(SvStream& rStCtrl_,
+ const String& rBaseURL,
+ long nOffsDgg_,
+ SvStream* pStData_,
+ SdrModel* pSdrModel_,// s. unten: SetModel()
+ long nApplicationScale,
+ ColorData mnDefaultColor_,
+ ULONG nDefaultFontHeight_,
+ SvStream* pStData2_,
+ MSFilterTracer* pTracer )
+ :DffPropertyReader( *this ),
+ pFormModel( NULL ),
+ pBLIPInfos( new SvxMSDffBLIPInfos ),
+ pShapeInfos( new SvxMSDffShapeInfos ),
+ pShapeOrders( new SvxMSDffShapeOrders ),
+ nDefaultFontHeight( nDefaultFontHeight_),
+ nOffsDgg( nOffsDgg_ ),
+ nBLIPCount( USHRT_MAX ), // mit Error initialisieren, da wir erst pruefen,
+ nShapeCount( USHRT_MAX ), // ob Kontroll-Stream korrekte Daten enthaellt
+ maBaseURL( rBaseURL ),
+ mpFidcls( NULL ),
+ rStCtrl( rStCtrl_ ),
+ pStData( pStData_ ),
+ pStData2( pStData2_ ),
+ nSvxMSDffSettings( 0 ),
+ nSvxMSDffOLEConvFlags( 0 ),
+ pEscherBlipCache( NULL ),
+ mnDefaultColor( mnDefaultColor_),
+ mpTracer( pTracer ),
+ mbTracing( sal_False )
+{
+ if ( mpTracer )
+ {
+ uno::Any aAny( mpTracer->GetProperty( rtl::OUString::createFromAscii( "On" ) ) );
+ aAny >>= mbTracing;
+ }
+ SetModel( pSdrModel_, nApplicationScale );
+
+ // FilePos des/der Stream(s) merken
+ ULONG nOldPosCtrl = rStCtrl.Tell();
+ ULONG nOldPosData = pStData ? pStData->Tell() : nOldPosCtrl;
+
+ // Falls kein Datenstream angegeben, gehen wir davon aus,
+ // dass die BLIPs im Steuerstream stehen.
+ if( !pStData )
+ pStData = &rStCtrl;
+
+ SetDefaultPropSet( rStCtrl, nOffsDgg );
+
+ // Steuer Stream auslesen, im Erfolgsfall nBLIPCount setzen
+ GetCtrlData( nOffsDgg );
+
+ // Text-Box-Story-Ketten-Infos ueberpruefen
+ CheckTxBxStoryChain();
+
+ // alte FilePos des/der Stream(s) restaurieren
+ rStCtrl.Seek( nOldPosCtrl );
+ if( &rStCtrl != pStData )
+ pStData->Seek( nOldPosData );
+}
+
+SvxMSDffManager::SvxMSDffManager( SvStream& rStCtrl_, const String& rBaseURL, MSFilterTracer* pTracer )
+ :DffPropertyReader( *this ),
+ pFormModel( NULL ),
+ pBLIPInfos( new SvxMSDffBLIPInfos ),
+ pShapeInfos( new SvxMSDffShapeInfos ),
+ pShapeOrders( new SvxMSDffShapeOrders ),
+ nDefaultFontHeight( 24 ),
+ nOffsDgg( 0 ),
+ nBLIPCount( USHRT_MAX ), // mit Error initialisieren, da wir erst pruefen,
+ nShapeCount( USHRT_MAX ), // ob Kontroll-Stream korrekte Daten enthaellt
+ maBaseURL( rBaseURL ),
+ mpFidcls( NULL ),
+ rStCtrl( rStCtrl_ ),
+ pStData( 0 ),
+ pStData2( 0 ),
+ nSvxMSDffSettings( 0 ),
+ nSvxMSDffOLEConvFlags( 0 ),
+ pEscherBlipCache( NULL ),
+ mnDefaultColor( COL_DEFAULT ),
+ mpTracer( pTracer ),
+ mbTracing( sal_False )
+{
+ if ( mpTracer )
+ {
+ uno::Any aAny( mpTracer->GetProperty( rtl::OUString::createFromAscii( "On" ) ) );
+ aAny >>= mbTracing;
+ }
+ SetModel( NULL, 0 );
+}
+
+SvxMSDffManager::~SvxMSDffManager()
+{
+ if ( pEscherBlipCache )
+ {
+ void* pPtr;
+ for ( pPtr = pEscherBlipCache->First(); pPtr; pPtr = pEscherBlipCache->Next() )
+ delete (EscherBlipCacheEntry*)pPtr;
+ delete pEscherBlipCache;
+ }
+ delete pBLIPInfos;
+ delete pShapeInfos;
+ delete pShapeOrders;
+ delete pFormModel;
+ delete[] mpFidcls;
+}
+
+void SvxMSDffManager::InitSvxMSDffManager( long nOffsDgg_, SvStream* pStData_, sal_uInt32 nOleConvFlags )
+{
+ nOffsDgg = nOffsDgg_;
+ pStData = pStData_;
+ nSvxMSDffOLEConvFlags = nOleConvFlags;
+
+ // FilePos des/der Stream(s) merken
+ ULONG nOldPosCtrl = rStCtrl.Tell();
+
+ SetDefaultPropSet( rStCtrl, nOffsDgg );
+
+ // insert fidcl cluster table
+ GetFidclData( nOffsDgg );
+
+ // Steuer Stream auslesen, im Erfolgsfall nBLIPCount setzen
+ GetCtrlData( nOffsDgg );
+
+ // Text-Box-Story-Ketten-Infos ueberpruefen
+ CheckTxBxStoryChain();
+
+ // alte FilePos des/der Stream(s) restaurieren
+ rStCtrl.Seek( nOldPosCtrl );
+}
+
+void SvxMSDffManager::SetDgContainer( SvStream& rSt )
+{
+ UINT32 nFilePos = rSt.Tell();
+ DffRecordHeader aDgContHd;
+ rSt >> aDgContHd;
+ // insert this container only if there is also a DgAtom
+ if ( SeekToRec( rSt, DFF_msofbtDg, aDgContHd.GetRecEndFilePos() ) )
+ {
+ DffRecordHeader aRecHd;
+ rSt >> aRecHd;
+ UINT32 nDrawingId = aRecHd.nRecInstance;
+ maDgOffsetTable.Insert( nDrawingId, (void*)nFilePos );
+ rSt.Seek( nFilePos );
+ }
+}
+
+void SvxMSDffManager::GetFidclData( long nOffsDggL )
+{
+ if ( nOffsDggL )
+ {
+ UINT32 nDummy, nMerk = rStCtrl.Tell();
+ rStCtrl.Seek( nOffsDggL );
+
+ DffRecordHeader aRecHd;
+ rStCtrl >> aRecHd;
+
+ DffRecordHeader aDggAtomHd;
+ if ( SeekToRec( rStCtrl, DFF_msofbtDgg, aRecHd.GetRecEndFilePos(), &aDggAtomHd ) )
+ {
+ aDggAtomHd.SeekToContent( rStCtrl );
+ rStCtrl >> mnCurMaxShapeId
+ >> mnIdClusters
+ >> nDummy
+ >> mnDrawingsSaved;
+
+ if ( mnIdClusters-- > 2 )
+ {
+ if ( aDggAtomHd.nRecLen == ( mnIdClusters * sizeof( FIDCL ) + 16 ) )
+ {
+ mpFidcls = new FIDCL[ mnIdClusters ];
+ for ( UINT32 i = 0; i < mnIdClusters; i++ )
+ {
+ rStCtrl >> mpFidcls[ i ].dgid
+ >> mpFidcls[ i ].cspidCur;
+ }
+ }
+ }
+ }
+ rStCtrl.Seek( nMerk );
+ }
+}
+
+void SvxMSDffManager::CheckTxBxStoryChain()
+{
+ SvxMSDffShapeInfos* pOld = pShapeInfos;
+ USHORT nCnt = pOld->Count();
+ pShapeInfos = new SvxMSDffShapeInfos( (nCnt < 255)
+ ? nCnt
+ : 255 );
+ // altes Info-Array ueberarbeiten
+ // (ist sortiert nach nTxBxComp)
+ ULONG nChain = ULONG_MAX;
+ USHORT nObjMark = 0;
+ BOOL bSetReplaceFALSE = FALSE;
+ USHORT nObj;
+ for( nObj = 0; nObj < nCnt; ++nObj )
+ {
+ SvxMSDffShapeInfo* pObj = pOld->GetObject( nObj );
+ if( pObj->nTxBxComp )
+ {
+ pObj->bLastBoxInChain = FALSE;
+ // Gruppenwechsel ?
+ // --> OD 2008-07-28 #156763#
+ // the text id also contains an internal drawing container id
+ // to distinguish between text id of drawing objects in different
+ // drawing containers.
+// if( nChain != (pObj->nTxBxComp & 0xFFFF0000) )
+ if( nChain != pObj->nTxBxComp )
+ // <--
+ {
+ // voriger war letzter seiner Gruppe
+ if( nObj )
+ pOld->GetObject( nObj-1 )->bLastBoxInChain = TRUE;
+ // Merker und Hilfs-Flag zuruecksetzen
+ nObjMark = nObj;
+ // --> OD 2008-07-28 #156763#
+// nChain = pObj->nTxBxComp & 0xFFFF0000;
+ nChain = pObj->nTxBxComp;
+ // <--
+ bSetReplaceFALSE = !pObj->bReplaceByFly;
+ }
+ else
+ if( !pObj->bReplaceByFly )
+ {
+ // Objekt, das NICHT durch Rahmen ersetzt werden darf ?
+ // Hilfs-Flag setzen
+ bSetReplaceFALSE = TRUE;
+ // ggfs Flag in Anfang der Gruppe austragen
+ for( USHORT nObj2 = nObjMark; nObj2 < nObj; ++nObj2 )
+ pOld->GetObject( nObj2 )->bReplaceByFly = FALSE;
+ }
+
+ if( bSetReplaceFALSE )
+ {
+ pObj->bReplaceByFly = FALSE;
+ }
+ }
+ // alle Shape-Info-Objekte in pShapeInfos umkopieren
+ // (aber nach nShapeId sortieren)
+ pObj->bSortByShapeId = TRUE;
+ // --> OD 2008-07-28 #156763#
+ pObj->nTxBxComp = pObj->nTxBxComp & 0xFFFF0000;
+ // <--
+ pShapeInfos->Insert( pObj );
+ }
+ // voriger war letzter seiner Gruppe
+ if( nObj )
+ pOld->GetObject( nObj-1 )->bLastBoxInChain = TRUE;
+ // urspruengliches Array freigeben, ohne Objekte zu zerstoeren
+ pOld->Remove((USHORT)0, nCnt);
+ delete pOld;
+}
+
+
+/*****************************************************************************
+
+ Einlesen der Shape-Infos im Ctor:
+ ---------------------------------
+ merken der Shape-Ids und zugehoerigen Blip-Nummern und TextBox-Infos
+ ========= ============ =============
+ und merken des File-Offsets fuer jedes Blip
+ ============
+******************************************************************************/
+void SvxMSDffManager::GetCtrlData( long nOffsDgg_ )
+{
+ // Start Offset unbedingt merken, falls wir nochmal aufsetzen muessen
+ long nOffsDggL = nOffsDgg_;
+
+ // Kontroll Stream positionieren
+ rStCtrl.Seek( nOffsDggL );
+
+ BYTE nVer;
+ USHORT nInst;
+ USHORT nFbt;
+ UINT32 nLength;
+ if( !this->ReadCommonRecordHeader( rStCtrl, nVer, nInst, nFbt, nLength ) ) return;
+
+ BOOL bOk;
+ ULONG nPos = nOffsDggL + DFF_COMMON_RECORD_HEADER_SIZE;
+
+ // Fall A: erst Drawing Group Container, dann n Mal Drawing Container
+ if( DFF_msofbtDggContainer == nFbt )
+ {
+ GetDrawingGroupContainerData( rStCtrl, nLength );
+
+ rStCtrl.Seek( STREAM_SEEK_TO_END );
+ UINT32 nMaxStrPos = rStCtrl.Tell();
+
+ nPos += nLength;
+ // --> OD 2008-07-28 #156763#
+ unsigned long nDrawingContainerId = 1;
+ // <--
+ do
+ {
+ rStCtrl.Seek( nPos );
+
+ bOk = ReadCommonRecordHeader( rStCtrl, nVer, nInst, nFbt, nLength ) && ( DFF_msofbtDgContainer == nFbt );
+
+ if( !bOk )
+ {
+ nPos++;
+ rStCtrl.Seek( nPos );
+ bOk = ReadCommonRecordHeader( rStCtrl, nVer, nInst, nFbt, nLength )
+ && ( DFF_msofbtDgContainer == nFbt );
+ }
+ if( bOk )
+ {
+ // --> OD 2008-07-28 #156763#
+ GetDrawingContainerData( rStCtrl, nLength, nDrawingContainerId );
+ // <--
+ }
+ nPos += DFF_COMMON_RECORD_HEADER_SIZE + nLength;
+ // --> OD 2008-07-28 #156763#
+ ++nDrawingContainerId;
+ // <--
+ }
+ while( nPos < nMaxStrPos && bOk );
+ }
+}
+
+
+// ab hier: Drawing Group Container d.h. Dokument - weit gueltige Daten
+// ======================= ========
+//
+void SvxMSDffManager::GetDrawingGroupContainerData( SvStream& rSt, ULONG nLenDgg )
+{
+ BYTE nVer;
+ USHORT nInst;
+ USHORT nFbt;
+ UINT32 nLength;
+
+ ULONG nLenBStoreCont = 0, nLenFBSE = 0, nRead = 0;
+
+ // Nach einem BStore Container suchen
+ do
+ {
+ if(!this->ReadCommonRecordHeader( rSt, nVer, nInst, nFbt, nLength)) return;
+ nRead += DFF_COMMON_RECORD_HEADER_SIZE + nLength;
+ if( DFF_msofbtBstoreContainer == nFbt )
+ {
+ nLenBStoreCont = nLength; break;
+ }
+ rSt.SeekRel( nLength );
+ }
+ while( nRead < nLenDgg );
+
+ if( !nLenBStoreCont ) return;
+
+ // Im BStore Container alle Header der Container und Atome auslesen und die
+ // relevanten Daten aller enthaltenen FBSEs in unserem Pointer Array ablegen.
+ // Dabei zaehlen wir die gefundenen FBSEs im Member nBLIPCount mit.
+
+ const ULONG nSkipBLIPLen = 20; // bis zu nBLIPLen zu ueberspringende Bytes
+ const ULONG nSkipBLIPPos = 4; // dahinter bis zu nBLIPPos zu skippen
+
+ sal_uInt32 nBLIPLen = 0, nBLIPPos = 0;
+
+ nRead = 0;
+ do
+ {
+ if(!this->ReadCommonRecordHeader( rSt, nVer, nInst, nFbt, nLength)) return;
+ nRead += DFF_COMMON_RECORD_HEADER_SIZE + nLength;
+ if( DFF_msofbtBSE == nFbt )
+ {
+ nLenFBSE = nLength;
+ // ist FBSE gross genug fuer unsere Daten
+ BOOL bOk = ( nSkipBLIPLen + 4 + nSkipBLIPPos + 4 <= nLenFBSE );
+
+ if( bOk )
+ {
+ rSt.SeekRel( nSkipBLIPLen );
+ rSt >> nBLIPLen;
+ rSt.SeekRel( nSkipBLIPPos );
+ rSt >> nBLIPPos;
+ bOk = rSt.GetError() == 0;
+
+ nLength -= nSkipBLIPLen+ 4 + nSkipBLIPPos + 4;
+ }
+
+ if( bOk )
+ {
+ // Besonderheit:
+ // Falls nBLIPLen kleiner ist als nLenFBSE UND nBLIPPos Null ist,
+ // nehmen wir an, dass das Bild IM FBSE drin steht!
+ if( (!nBLIPPos) && (nBLIPLen < nLenFBSE) )
+ nBLIPPos = rSt.Tell() + 4;
+
+ // Das hat ja fein geklappt!
+ // Wir merken uns, dass wir einen FBSE mehr im Pointer Array haben.
+ nBLIPPos = Calc_nBLIPPos(nBLIPPos, rSt.Tell());
+
+ if( USHRT_MAX == nBLIPCount )
+ nBLIPCount = 1;
+ else
+ nBLIPCount++;
+
+ // Jetzt die Infos fuer spaetere Zugriffe speichern
+ pBLIPInfos->Insert( new SvxMSDffBLIPInfo( nInst, nBLIPPos, nBLIPLen ),
+ pBLIPInfos->Count() );
+ }
+ }
+ rSt.SeekRel( nLength );
+ }
+ while( nRead < nLenBStoreCont );
+}
+
+
+// ab hier: Drawing Container d.h. Seiten (Blatt, Dia) - weit gueltige Daten
+// ================= ======
+//
+void SvxMSDffManager::GetDrawingContainerData( SvStream& rSt, ULONG nLenDg,
+ const unsigned long nDrawingContainerId )
+{
+ BYTE nVer;USHORT nInst;USHORT nFbt;UINT32 nLength;
+
+ ULONG nReadDg = 0;
+
+ // Wir stehen in einem Drawing Container (je einer pro Seite)
+ // und muessen nun
+ // alle enthaltenen Shape Group Container abklappern
+ do
+ {
+ if(!this->ReadCommonRecordHeader( rSt, nVer, nInst, nFbt, nLength)) return;
+ nReadDg += DFF_COMMON_RECORD_HEADER_SIZE;
+ // Patriarch gefunden (der oberste Shape Group Container) ?
+ if( DFF_msofbtSpgrContainer == nFbt )
+ {
+ if(!this->GetShapeGroupContainerData( rSt, nLength, TRUE, nDrawingContainerId )) return;
+ }
+ else
+ // blanker Shape Container ? (ausserhalb vom Shape Group Container)
+ if( DFF_msofbtSpContainer == nFbt )
+ {
+ if(!this->GetShapeContainerData( rSt, nLength, ULONG_MAX, nDrawingContainerId )) return;
+ }
+ else
+ rSt.SeekRel( nLength );
+ nReadDg += nLength;
+ }
+ while( nReadDg < nLenDg );
+}
+
+BOOL SvxMSDffManager::GetShapeGroupContainerData( SvStream& rSt,
+ ULONG nLenShapeGroupCont,
+ BOOL bPatriarch,
+ const unsigned long nDrawingContainerId )
+{
+ BYTE nVer;USHORT nInst;USHORT nFbt;UINT32 nLength;
+ long nStartShapeGroupCont = rSt.Tell();
+ // Wir stehen in einem Shape Group Container (ggfs. mehrere pro Seite)
+ // und muessen nun
+ // alle enthaltenen Shape Container abklappern
+ BOOL bFirst = !bPatriarch;
+ ULONG nReadSpGrCont = 0;
+ do
+ {
+ if( !this->ReadCommonRecordHeader( rSt, nVer, nInst, nFbt, nLength ) )
+ return FALSE;
+ nReadSpGrCont += DFF_COMMON_RECORD_HEADER_SIZE;
+ // Shape Container ?
+ if( DFF_msofbtSpContainer == nFbt )
+ {
+ ULONG nGroupOffs = bFirst ? nStartShapeGroupCont - DFF_COMMON_RECORD_HEADER_SIZE : ULONG_MAX;
+ if ( !this->GetShapeContainerData( rSt, nLength, nGroupOffs, nDrawingContainerId ) )
+ return FALSE;
+ bFirst = FALSE;
+ }
+ else
+ // eingeschachtelter Shape Group Container ?
+ if( DFF_msofbtSpgrContainer == nFbt )
+ {
+ if ( !this->GetShapeGroupContainerData( rSt, nLength, FALSE, nDrawingContainerId ) )
+ return FALSE;
+ }
+ else
+ rSt.SeekRel( nLength );
+ nReadSpGrCont += nLength;
+ }
+ while( nReadSpGrCont < nLenShapeGroupCont );
+ // den Stream wieder korrekt positionieren
+ rSt.Seek( nStartShapeGroupCont + nLenShapeGroupCont );
+ return TRUE;
+}
+
+BOOL SvxMSDffManager::GetShapeContainerData( SvStream& rSt,
+ ULONG nLenShapeCont,
+ ULONG nPosGroup,
+ const unsigned long nDrawingContainerId )
+{
+ BYTE nVer;USHORT nInst;USHORT nFbt;UINT32 nLength;
+ long nStartShapeCont = rSt.Tell();
+ // Wir stehen in einem Shape Container (ggfs. mehrere pro Sh. Group)
+ // und muessen nun
+ // die Shape Id und File-Pos (fuer spaetere, erneute Zugriffe)
+ // und den ersten BStore Verweis (falls vorhanden) entnehmen
+ ULONG nLenShapePropTbl = 0;
+ ULONG nReadSpCont = 0;
+
+ // File Offset des Shape-Containers bzw. der Gruppe(!) vermerken
+ //
+ ULONG nStartOffs = (ULONG_MAX > nPosGroup) ?
+ nPosGroup : nStartShapeCont - DFF_COMMON_RECORD_HEADER_SIZE;
+ SvxMSDffShapeInfo aInfo( nStartOffs );
+
+ // duerfte das Shape durch einen Rahmen ersetzt werden ?
+ // (vorausgesetzt, es zeigt sich, dass es eine TextBox ist,
+ // und der Text nicht gedreht ist)
+ BOOL bCanBeReplaced = (ULONG_MAX > nPosGroup) ? FALSE : TRUE;
+
+ // wir wissen noch nicht, ob es eine TextBox ist
+ MSO_SPT eShapeType = mso_sptNil;
+ MSO_WrapMode eWrapMode = mso_wrapSquare;
+// BOOL bIsTextBox = FALSE;
+
+ // Shape analysieren
+ //
+ do
+ {
+ if(!this->ReadCommonRecordHeader( rSt, nVer, nInst, nFbt, nLength)) return FALSE;
+ nReadSpCont += DFF_COMMON_RECORD_HEADER_SIZE;
+ // FSP ?
+ if( ( DFF_msofbtSp == nFbt ) && ( 4 <= nLength ) )
+ {
+ // Wir haben den FSP gefunden: Shape Typ und Id vermerken!
+ eShapeType = (MSO_SPT)nInst;
+ rSt >> aInfo.nShapeId;
+ rSt.SeekRel( nLength - 4 );
+ nReadSpCont += nLength;
+ }
+ else if( DFF_msofbtOPT == nFbt ) // Shape Property Table ?
+ {
+ // Wir haben die Property Table gefunden:
+ // nach der Blip Property suchen!
+ ULONG nPropRead = 0;
+ USHORT nPropId;
+ sal_uInt32 nPropVal;
+ nLenShapePropTbl = nLength;
+// UINT32 nPropCount = nInst;
+ long nStartShapePropTbl = rSt.Tell();
+// UINT32 nComplexDataFilePos = nStartShapePropTbl + (nPropCount * 6);
+ do
+ {
+ rSt >> nPropId
+ >> nPropVal;
+ nPropRead += 6;
+
+ switch( nPropId )
+ {
+ case DFF_Prop_txflTextFlow :
+ //Writer can now handle vertical textflows in its
+ //native frames, to only need to do this for the
+ //other two formats
+
+ //Writer will handle all textflow except BtoT
+ if (GetSvxMSDffSettings() &
+ (SVXMSDFF_SETTINGS_IMPORT_PPT |
+ SVXMSDFF_SETTINGS_IMPORT_EXCEL))
+ {
+ if( 0 != nPropVal )
+ bCanBeReplaced = false;
+ }
+ else if (
+ (nPropVal != mso_txflHorzN) &&
+ (nPropVal != mso_txflTtoBA)
+ )
+ {
+ bCanBeReplaced = false;
+ }
+ break;
+ case DFF_Prop_cdirFont :
+ //Writer can now handle right to left and left
+ //to right in its native frames, so only do
+ //this for the other two formats.
+ if (GetSvxMSDffSettings() &
+ (SVXMSDFF_SETTINGS_IMPORT_PPT |
+ SVXMSDFF_SETTINGS_IMPORT_EXCEL))
+ {
+ if( 0 != nPropVal )
+ bCanBeReplaced = FALSE;
+ }
+ break;
+ case DFF_Prop_Rotation :
+ if( 0 != nPropVal )
+ bCanBeReplaced = FALSE;
+ break;
+
+ case DFF_Prop_gtextFStrikethrough :
+ if( ( 0x20002000 & nPropVal ) == 0x20002000 )
+ bCanBeReplaced = FALSE;
+ break;
+
+ case DFF_Prop_fc3DLightFace :
+ if( ( 0x00080008 & nPropVal ) == 0x00080008 )
+ bCanBeReplaced = FALSE;
+ break;
+
+ case DFF_Prop_WrapText :
+ eWrapMode = (MSO_WrapMode)nPropVal;
+ break;
+
+ default:
+ {
+ // Bit gesetzt und gueltig?
+ if( 0x4000 == ( nPropId & 0xC000 ) )
+ {
+ // Blip Property gefunden: BStore Idx vermerken!
+ nPropRead = nLenShapePropTbl;
+ }
+ else if( 0x8000 & nPropId )
+ {
+ // komplexe Prop gefunden:
+ // Laenge ist immer 6, nur die Laenge der nach der
+ // eigentlichen Prop-Table anhaengenden Extra-Daten
+ // ist unterschiedlich
+ nPropVal = 6;
+ }
+ }
+ break;
+ }
+
+/*
+//JP 21.04.99: Bug 64510
+// alte Version, die unter OS/2 zu Compilerfehlern fuehrt und damit arge
+// Performance einbussen hat.
+
+ if( 0x4000 == ( nPropId & 0xC000 ) )// Bit gesetzt und gueltig?
+ {
+ // Blip Property gefunden: BStore Idx vermerken!
+ aInfo.nBStoreIdx = nPropVal; // Index im BStore Container
+ break;
+ }
+ else
+ if( ( ( (DFF_Prop_txflTextFlow == nPropId)
+ || (DFF_Prop_Rotation == nPropId)
+ || (DFF_Prop_cdirFont == nPropId) )
+ && (0 != nPropVal) )
+
+ || ( (DFF_Prop_gtextFStrikethrough == nPropId)
+ && ( (0x20002000 & nPropVal) == 0x20002000) ) // also DFF_Prop_gtextFVertical
+ || ( (DFF_Prop_fc3DLightFace == nPropId)
+ && ( (0x00080008 & nPropVal) == 0x00080008) ) // also DFF_Prop_f3D
+ )
+ {
+ bCanBeReplaced = FALSE; // Mist: gedrehter Text oder 3D-Objekt!
+ }
+ else
+ if( DFF_Prop_WrapText == nPropId )
+ {
+ eWrapMode = (MSO_WrapMode)nPropVal;
+ }
+ ////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////
+ // keine weitere Property-Auswertung: folge beim Shape-Import //
+ ////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////
+ else
+ if( 0x8000 & nPropId )
+ {
+ // komplexe Prop gefunden: Laenge lesen und ueberspringen
+ if(!SkipBytes( rSt, nPropVal )) return FALSE;
+ nPropRead += nPropVal;
+ }
+*/
+ }
+ while( nPropRead < nLenShapePropTbl );
+ rSt.Seek( nStartShapePropTbl + nLenShapePropTbl );
+ nReadSpCont += nLenShapePropTbl;
+ }
+ else if( ( DFF_msofbtClientTextbox == nFbt ) && ( 4 == nLength ) ) // Text-Box-Story-Eintrag gefunden
+ {
+ rSt >> aInfo.nTxBxComp;
+ // --> OD 2008-07-28 #156763#
+ // Add internal drawing container id to text id.
+ // Note: The text id uses the first two bytes, while the internal
+ // drawing container id used the second two bytes.
+ aInfo.nTxBxComp = ( aInfo.nTxBxComp & 0xFFFF0000 ) +
+ nDrawingContainerId;
+ DBG_ASSERT( (aInfo.nTxBxComp & 0x0000FFFF) == nDrawingContainerId,
+ "<SvxMSDffManager::GetShapeContainerData(..)> - internal drawing container Id could not be correctly merged into DFF_msofbtClientTextbox value." );
+ // <--
+ }
+ else
+ {
+ rSt.SeekRel( nLength );
+ nReadSpCont += nLength;
+ }
+ }
+ while( nReadSpCont < nLenShapeCont );
+
+ //
+ // Jetzt ggfs. die Infos fuer spaetere Zugriffe auf das Shape speichern
+ //
+ if( aInfo.nShapeId )
+ {
+ // fuer Textboxen ggfs. ersetzen durch Rahmen erlauben
+ if( bCanBeReplaced
+ && aInfo.nTxBxComp
+ && (
+ ( eShapeType == mso_sptTextSimple )
+ || ( eShapeType == mso_sptTextBox )
+ || ( ( ( eShapeType == mso_sptRectangle )
+ || ( eShapeType == mso_sptRoundRectangle )
+ )
+ ) ) )
+ {
+ aInfo.bReplaceByFly = TRUE;
+ }
+ pShapeInfos->Insert( new SvxMSDffShapeInfo( aInfo ) );
+ pShapeOrders->Insert( new SvxMSDffShapeOrder( aInfo.nShapeId ),
+ pShapeOrders->Count() );
+ }
+
+ // und den Stream wieder korrekt positionieren
+ rSt.Seek( nStartShapeCont + nLenShapeCont );
+ return TRUE;
+}
+
+
+
+/*****************************************************************************
+
+ Zugriff auf ein Shape zur Laufzeit (ueber die Shape-Id)
+ ----------------------------------
+******************************************************************************/
+BOOL SvxMSDffManager::GetShape(ULONG nId, SdrObject*& rpShape,
+ SvxMSDffImportData& rData)
+{
+ SvxMSDffShapeInfo aTmpRec(0, nId);
+ aTmpRec.bSortByShapeId = TRUE;
+
+ USHORT nFound;
+ if( pShapeInfos->Seek_Entry(&aTmpRec, &nFound) )
+ {
+ SvxMSDffShapeInfo& rInfo = *pShapeInfos->GetObject( nFound );
+
+ // eventuell altes Errorflag loeschen
+ if( rStCtrl.GetError() )
+ rStCtrl.ResetError();
+ // FilePos des/der Stream(s) merken
+ ULONG nOldPosCtrl = rStCtrl.Tell();
+ ULONG nOldPosData = pStData ? pStData->Tell() : nOldPosCtrl;
+ // das Shape im Steuer Stream anspringen
+ rStCtrl.Seek( rInfo.nFilePos );
+
+ // Falls missglueckt, den Fehlerstatus zuruecksetzen und Pech gehabt!
+ if( rStCtrl.GetError() )
+ rStCtrl.ResetError();
+ else
+ rpShape = ImportObj( rStCtrl, &rData, rData.aParentRect, rData.aParentRect );
+
+ // alte FilePos des/der Stream(s) restaurieren
+ rStCtrl.Seek( nOldPosCtrl );
+ if( &rStCtrl != pStData )
+ pStData->Seek( nOldPosData );
+ return ( 0 != rpShape );
+ }
+ return FALSE;
+}
+
+
+
+/* Zugriff auf ein BLIP zur Laufzeit (bei bereits bekannter Blip-Nr)
+ ---------------------------------
+******************************************************************************/
+BOOL SvxMSDffManager::GetBLIP( ULONG nIdx_, Graphic& rData, Rectangle* pVisArea ) const
+{
+ BOOL bOk = FALSE; // Ergebnisvariable initialisieren
+ if ( pStData )
+ {
+ // check if a graphic for this blipId is already imported
+ if ( nIdx_ && pEscherBlipCache )
+ {
+ EscherBlipCacheEntry* pEntry;
+ for ( pEntry = (EscherBlipCacheEntry*)pEscherBlipCache->First(); pEntry;
+ pEntry = (EscherBlipCacheEntry*)pEscherBlipCache->Next() )
+ {
+ if ( pEntry->nBlip == nIdx_ )
+ { /* if this entry is available, then it should be possible
+ to get the Graphic via GraphicObject */
+ GraphicObject aGraphicObject( pEntry->aUniqueID );
+ rData = aGraphicObject.GetGraphic();
+ if ( rData.GetType() != GRAPHIC_NONE )
+ bOk = sal_True;
+ else
+ delete (EscherBlipCacheEntry*)pEscherBlipCache->Remove();
+ break;
+ }
+ }
+ }
+ if ( !bOk )
+ {
+ USHORT nIdx = USHORT( nIdx_ );
+ if( !nIdx || (pBLIPInfos->Count() < nIdx) ) return FALSE;
+
+ // eventuell alte(s) Errorflag(s) loeschen
+ if( rStCtrl.GetError() )
+ rStCtrl.ResetError();
+ if( ( &rStCtrl != pStData )
+ && pStData->GetError() )
+ pStData->ResetError();
+
+ // FilePos des/der Stream(s) merken
+ ULONG nOldPosCtrl = rStCtrl.Tell();
+ ULONG nOldPosData = pStData ? pStData->Tell() : nOldPosCtrl;
+
+ // passende Info-Struct aus unserem Pointer Array nehmen
+ SvxMSDffBLIPInfo& rInfo = *(*pBLIPInfos)[ nIdx-1 ];
+
+ // das BLIP Atom im Daten Stream anspringen
+ pStData->Seek( rInfo.nFilePos );
+ // ggfs. Fehlerstatus zuruecksetzen
+ if( pStData->GetError() )
+ pStData->ResetError();
+ else
+ bOk = GetBLIPDirect( *pStData, rData, pVisArea );
+ if( pStData2 && !bOk )
+ {
+ // Fehler, aber zweite Chance: es gibt noch einen zweiten
+ // Datenstream, in dem die Grafik liegen koennte!
+ if( pStData2->GetError() )
+ pStData2->ResetError();
+ ULONG nOldPosData2 = pStData2->Tell();
+ // das BLIP Atom im zweiten Daten Stream anspringen
+ pStData2->Seek( rInfo.nFilePos );
+ // ggfs. Fehlerstatus zuruecksetzen
+ if( pStData2->GetError() )
+ pStData2->ResetError();
+ else
+ bOk = GetBLIPDirect( *pStData2, rData, pVisArea );
+ // alte FilePos des zweiten Daten-Stream restaurieren
+ pStData2->Seek( nOldPosData2 );
+ }
+ // alte FilePos des/der Stream(s) restaurieren
+ rStCtrl.Seek( nOldPosCtrl );
+ if( &rStCtrl != pStData )
+ pStData->Seek( nOldPosData );
+
+ if ( bOk )
+ {
+ // create new BlipCacheEntry for this graphic
+ GraphicObject aGraphicObject( rData );
+ if ( !pEscherBlipCache )
+ const_cast <SvxMSDffManager*> (this)->pEscherBlipCache = new List();
+ EscherBlipCacheEntry* pNewEntry = new EscherBlipCacheEntry( nIdx_, aGraphicObject.GetUniqueID() );
+ pEscherBlipCache->Insert( pNewEntry, LIST_APPEND );
+ }
+ }
+ }
+ return bOk;
+}
+
+/* Zugriff auf ein BLIP zur Laufzeit (mit korrekt positioniertem Stream)
+ ---------------------------------
+******************************************************************************/
+BOOL SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData, Rectangle* pVisArea ) const
+{
+ ULONG nOldPos = rBLIPStream.Tell();
+
+ int nRes = GRFILTER_OPENERROR; // Fehlervariable initialisieren
+
+ // nachschauen, ob es sich auch wirklich um ein BLIP handelt
+ UINT32 nLength;
+ USHORT nInst, nFbt( 0 );
+ BYTE nVer;
+ if( ReadCommonRecordHeader( rBLIPStream, nVer, nInst, nFbt, nLength) && ( 0xF018 <= nFbt ) && ( 0xF117 >= nFbt ) )
+ {
+ Size aMtfSize100;
+ BOOL bMtfBLIP = FALSE;
+ BOOL bZCodecCompression = FALSE;
+ // Nun exakt auf den Beginn der eingebetteten Grafik positionieren
+ ULONG nSkip = ( nInst & 0x0001 ) ? 32 : 16;
+
+ switch( nInst & 0xFFFE )
+ {
+ case 0x216 : // Metafile header then compressed WMF
+ case 0x3D4 : // Metafile header then compressed EMF
+ case 0x542 : // Metafile hd. then compressed PICT
+ {
+ rBLIPStream.SeekRel( nSkip + 20 );
+
+ // read in size of metafile in EMUS
+ rBLIPStream >> aMtfSize100.Width() >> aMtfSize100.Height();
+
+ // scale to 1/100mm
+ aMtfSize100.Width() /= 360, aMtfSize100.Height() /= 360;
+
+ if ( pVisArea ) // seem that we currently are skipping the visarea position
+ *pVisArea = Rectangle( Point(), aMtfSize100 );
+
+ // skip rest of header
+ nSkip = 6;
+ bMtfBLIP = bZCodecCompression = TRUE;
+ }
+ break;
+ case 0x46A : // One byte tag then JPEG (= JFIF) data
+ case 0x6E0 : // One byte tag then PNG data
+ case 0x7A8 :
+ nSkip += 1; // One byte tag then DIB data
+ break;
+ }
+ rBLIPStream.SeekRel( nSkip );
+
+ SvStream* pGrStream = &rBLIPStream;
+ SvMemoryStream* pOut = NULL;
+ if( bZCodecCompression )
+ {
+ pOut = new SvMemoryStream( 0x8000, 0x4000 );
+ ZCodec aZCodec( 0x8000, 0x8000 );
+ aZCodec.BeginCompression();
+ aZCodec.Decompress( rBLIPStream, *pOut );
+ aZCodec.EndCompression();
+ pOut->Seek( STREAM_SEEK_TO_BEGIN );
+ pGrStream = pOut;
+ }
+
+//#define DBG_EXTRACTGRAPHICS
+#ifdef DBG_EXTRACTGRAPHICS
+
+ static sal_Int32 nCount;
+
+ String aFileName( String( RTL_CONSTASCII_STRINGPARAM( "dbggfx" ) ) );
+ aFileName.Append( String::CreateFromInt32( nCount++ ) );
+ switch( nInst &~ 1 )
+ {
+ case 0x216 : aFileName.Append( String( RTL_CONSTASCII_STRINGPARAM( ".wmf" ) ) ); break;
+ case 0x3d4 : aFileName.Append( String( RTL_CONSTASCII_STRINGPARAM( ".emf" ) ) ); break;
+ case 0x542 : aFileName.Append( String( RTL_CONSTASCII_STRINGPARAM( ".pct" ) ) ); break;
+ case 0x46a : aFileName.Append( String( RTL_CONSTASCII_STRINGPARAM( ".jpg" ) ) ); break;
+ case 0x6e0 : aFileName.Append( String( RTL_CONSTASCII_STRINGPARAM( ".png" ) ) ); break;
+ case 0x7a8 : aFileName.Append( String( RTL_CONSTASCII_STRINGPARAM( ".bmp" ) ) ); break;
+ }
+
+ String aURLStr;
+
+ if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( Application::GetAppFileName(), aURLStr ) )
+ {
+ INetURLObject aURL( aURLStr );
+
+ aURL.removeSegment();
+ aURL.removeFinalSlash();
+ aURL.Append( aFileName );
+
+ SvStream* pDbgOut = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_TRUNC | STREAM_WRITE );
+
+ if( pDbgOut )
+ {
+ if ( bZCodecCompression )
+ {
+ pOut->Seek( STREAM_SEEK_TO_END );
+ pDbgOut->Write( pOut->GetData(), pOut->Tell() );
+ pOut->Seek( STREAM_SEEK_TO_BEGIN );
+ }
+ else
+ {
+ sal_Int32 nDbgLen = nLength - nSkip;
+ if ( nDbgLen )
+ {
+ sal_Char* pDat = new sal_Char[ nDbgLen ];
+ pGrStream->Read( pDat, nDbgLen );
+ pDbgOut->Write( pDat, nDbgLen );
+ pGrStream->SeekRel( -nDbgLen );
+ delete[] pDat;
+ }
+ }
+
+ delete pDbgOut;
+ }
+ }
+#endif
+
+ if( ( nInst & 0xFFFE ) == 0x7A8 )
+ { // DIBs direkt holen
+ Bitmap aNew;
+ if( aNew.Read( *pGrStream, FALSE ) )
+ {
+ rData = Graphic( aNew );
+ nRes = GRFILTER_OK;
+ }
+ }
+ else
+ { // und unsere feinen Filter darauf loslassen
+ GraphicFilter* pGF = GetGrfFilter();
+ String aEmptyStr;
+ nRes = pGF->ImportGraphic( rData, aEmptyStr, *pGrStream, GRFILTER_FORMAT_DONTKNOW );
+
+ // SJ: I40472, sometimes the aspect ratio (aMtfSize100) does not match and we get scaling problems,
+ // then it is better to use the prefsize that is stored within the metafile. Bug #72846# for what the
+ // scaling has been implemented does not happen anymore.
+ //
+ // For pict graphics we will furthermore scale the metafile, because font scaling leads to error if the
+ // dxarray is empty (this has been solved in wmf/emf but not for pict)
+ if( bMtfBLIP && ( GRFILTER_OK == nRes ) && ( rData.GetType() == GRAPHIC_GDIMETAFILE ) && ( ( nInst & 0xFFFE ) == 0x542 ) )
+ {
+ if ( ( aMtfSize100.Width() >= 1000 ) && ( aMtfSize100.Height() >= 1000 ) )
+ { // #75956#, scaling does not work properly, if the graphic is less than 1cm
+ GDIMetaFile aMtf( rData.GetGDIMetaFile() );
+ const Size aOldSize( aMtf.GetPrefSize() );
+
+ if( aOldSize.Width() && ( aOldSize.Width() != aMtfSize100.Width() ) &&
+ aOldSize.Height() && ( aOldSize.Height() != aMtfSize100.Height() ) )
+ {
+ aMtf.Scale( (double) aMtfSize100.Width() / aOldSize.Width(),
+ (double) aMtfSize100.Height() / aOldSize.Height() );
+ aMtf.SetPrefSize( aMtfSize100 );
+ aMtf.SetPrefMapMode( MAP_100TH_MM );
+ rData = aMtf;
+ }
+ }
+ }
+ }
+ // ggfs. Fehlerstatus zuruecksetzen
+ if ( ERRCODE_IO_PENDING == pGrStream->GetError() )
+ pGrStream->ResetError();
+ delete pOut;
+ }
+ rBLIPStream.Seek( nOldPos ); // alte FilePos des Streams restaurieren
+
+ return ( GRFILTER_OK == nRes ); // Ergebniss melden
+}
+
+/* static */
+BOOL SvxMSDffManager::ReadCommonRecordHeader(DffRecordHeader& rRec, SvStream& rIn)
+{
+ rRec.nFilePos = rIn.Tell();
+ return SvxMSDffManager::ReadCommonRecordHeader( rIn,rRec.nRecVer,
+ rRec.nRecInstance,
+ rRec.nRecType,
+ rRec.nRecLen );
+}
+
+
+/* auch static */
+BOOL SvxMSDffManager::ReadCommonRecordHeader( SvStream& rSt,
+ BYTE& rVer,
+ USHORT& rInst,
+ USHORT& rFbt,
+ UINT32& rLength )
+{
+ sal_uInt16 nTmp;
+ rSt >> nTmp >> rFbt >> rLength;
+ rVer = sal::static_int_cast< BYTE >(nTmp & 15);
+ rInst = nTmp >> 4;
+ return rSt.GetError() == 0;
+}
+
+
+
+
+BOOL SvxMSDffManager::ProcessClientAnchor(SvStream& rStData, ULONG nDatLen,
+ char*& rpBuff, UINT32& rBuffLen ) const
+{
+ if( nDatLen )
+ {
+ rpBuff = new char[ nDatLen ];
+ rBuffLen = nDatLen;
+ rStData.Read( rpBuff, nDatLen );
+ }
+ return TRUE;
+}
+
+BOOL SvxMSDffManager::ProcessClientData(SvStream& rStData, ULONG nDatLen,
+ char*& rpBuff, UINT32& rBuffLen ) const
+{
+ if( nDatLen )
+ {
+ rpBuff = new char[ nDatLen ];
+ rBuffLen = nDatLen;
+ rStData.Read( rpBuff, nDatLen );
+ }
+ return TRUE;
+}
+
+
+void SvxMSDffManager::ProcessClientAnchor2( SvStream& /* rSt */, DffRecordHeader& /* rHd */ , void* /* pData */, DffObjData& /* rObj */ )
+{
+ return; // wird von SJ im Draw ueberladen
+}
+
+ULONG SvxMSDffManager::Calc_nBLIPPos( ULONG nOrgVal, ULONG /* nStreamPos */ ) const
+{
+ return nOrgVal;
+}
+
+BOOL SvxMSDffManager::GetOLEStorageName( long /* nOLEId */, String&, SvStorageRef&, uno::Reference < embed::XStorage >& ) const
+{
+ return FALSE;
+}
+
+BOOL SvxMSDffManager::ShapeHasText( ULONG /* nShapeId */, ULONG /* nFilePos */ ) const
+{
+ return TRUE;
+}
+
+// --> OD 2004-12-14 #i32596# - add new parameter <_nCalledByGroup>
+SdrObject* SvxMSDffManager::ImportOLE( long nOLEId,
+ const Graphic& rGrf,
+ const Rectangle& rBoundRect,
+ const Rectangle& rVisArea,
+ const int /* _nCalledByGroup */,
+ sal_Int64 nAspect ) const
+// <--
+{
+ SdrObject* pRet = 0;
+ String sStorageName;
+ SvStorageRef xSrcStg;
+ ErrCode nError = ERRCODE_NONE;
+ uno::Reference < embed::XStorage > xDstStg;
+ if( GetOLEStorageName( nOLEId, sStorageName, xSrcStg, xDstStg ))
+ pRet = CreateSdrOLEFromStorage( sStorageName, xSrcStg, xDstStg,
+ rGrf, rBoundRect, rVisArea, pStData, nError,
+ nSvxMSDffOLEConvFlags, nAspect );
+ return pRet;
+}
+
+const GDIMetaFile* SvxMSDffManager::lcl_GetMetaFileFromGrf_Impl( const Graphic& rGrf,
+ GDIMetaFile& rMtf )
+{
+ const GDIMetaFile* pMtf;
+ if( GRAPHIC_BITMAP == rGrf.GetType() )
+ {
+ Point aPt;
+ const Size aSz(lcl_GetPrefSize(rGrf, MAP_100TH_MM));
+
+ VirtualDevice aVirtDev;
+ aVirtDev.EnableOutput( FALSE );
+ MapMode aMM(MAP_100TH_MM);
+ aVirtDev.SetMapMode( aMM );
+
+ rMtf.Record( &aVirtDev );
+ rGrf.Draw( &aVirtDev, aPt, aSz );
+ rMtf.Stop();
+ rMtf.SetPrefMapMode(aMM);
+ rMtf.SetPrefSize( aSz );
+
+ pMtf = &rMtf;
+ }
+ else
+ pMtf = &rGrf.GetGDIMetaFile();
+ return pMtf;
+}
+
+BOOL SvxMSDffManager::MakeContentStream( SotStorage * pStor, const GDIMetaFile & rMtf )
+{
+ String aPersistStream( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( SVEXT_PERSIST_STREAM ) ) );
+ SotStorageStreamRef xStm = pStor->OpenSotStream( aPersistStream );
+ xStm->SetVersion( pStor->GetVersion() );
+ xStm->SetBufferSize( 8192 );
+
+ USHORT nAspect = ASPECT_CONTENT;
+ ULONG nAdviseModes = 2;
+
+ Impl_OlePres aEle( FORMAT_GDIMETAFILE );
+ // Die Groesse in 1/100 mm umrechnen
+ // Falls eine nicht anwendbare MapUnit (Device abhaengig) verwendet wird,
+ // versucht SV einen BestMatchden richtigen Wert zu raten.
+ Size aSize = rMtf.GetPrefSize();
+ MapMode aMMSrc = rMtf.GetPrefMapMode();
+ MapMode aMMDst( MAP_100TH_MM );
+ aSize = OutputDevice::LogicToLogic( aSize, aMMSrc, aMMDst );
+ aEle.SetSize( aSize );
+ aEle.SetAspect( nAspect );
+ aEle.SetAdviseFlags( nAdviseModes );
+ aEle.SetMtf( rMtf );
+ aEle.Write( *xStm );
+
+ xStm->SetBufferSize( 0 );
+ return xStm->GetError() == SVSTREAM_OK;
+}
+
+struct ClsIDs {
+ UINT32 nId;
+ const sal_Char* pSvrName;
+ const sal_Char* pDspName;
+};
+static ClsIDs aClsIDs[] = {
+
+ { 0x000212F0, "MSWordArt", "Microsoft Word Art" },
+ { 0x000212F0, "MSWordArt.2", "Microsoft Word Art 2.0" },
+
+ // MS Apps
+ { 0x00030000, "ExcelWorksheet", "Microsoft Excel Worksheet" },
+ { 0x00030001, "ExcelChart", "Microsoft Excel Chart" },
+ { 0x00030002, "ExcelMacrosheet", "Microsoft Excel Macro" },
+ { 0x00030003, "WordDocument", "Microsoft Word Document" },
+ { 0x00030004, "MSPowerPoint", "Microsoft PowerPoint" },
+ { 0x00030005, "MSPowerPointSho", "Microsoft PowerPoint Slide Show"},
+ { 0x00030006, "MSGraph", "Microsoft Graph" },
+ { 0x00030007, "MSDraw", "Microsoft Draw" },
+ { 0x00030008, "Note-It", "Microsoft Note-It" },
+ { 0x00030009, "WordArt", "Microsoft Word Art" },
+ { 0x0003000a, "PBrush", "Microsoft PaintBrush Picture" },
+ { 0x0003000b, "Equation", "Microsoft Equation Editor" },
+ { 0x0003000c, "Package", "Package" },
+ { 0x0003000d, "SoundRec", "Sound" },
+ { 0x0003000e, "MPlayer", "Media Player" },
+ // MS Demos
+ { 0x0003000f, "ServerDemo", "OLE 1.0 Server Demo" },
+ { 0x00030010, "Srtest", "OLE 1.0 Test Demo" },
+ { 0x00030011, "SrtInv", "OLE 1.0 Inv Demo" },
+ { 0x00030012, "OleDemo", "OLE 1.0 Demo" },
+
+ // Coromandel / Dorai Swamy / 718-793-7963
+ { 0x00030013, "CoromandelIntegra", "Coromandel Integra" },
+ { 0x00030014, "CoromandelObjServer","Coromandel Object Server" },
+
+ // 3-d Visions Corp / Peter Hirsch / 310-325-1339
+ { 0x00030015, "StanfordGraphics", "Stanford Graphics" },
+
+ // Deltapoint / Nigel Hearne / 408-648-4000
+ { 0x00030016, "DGraphCHART", "DeltaPoint Graph Chart" },
+ { 0x00030017, "DGraphDATA", "DeltaPoint Graph Data" },
+
+ // Corel / Richard V. Woodend / 613-728-8200 x1153
+ { 0x00030018, "PhotoPaint", "Corel PhotoPaint" },
+ { 0x00030019, "CShow", "Corel Show" },
+ { 0x0003001a, "CorelChart", "Corel Chart" },
+ { 0x0003001b, "CDraw", "Corel Draw" },
+
+ // Inset Systems / Mark Skiba / 203-740-2400
+ { 0x0003001c, "HJWIN1.0", "Inset Systems" },
+
+ // Mark V Systems / Mark McGraw / 818-995-7671
+ { 0x0003001d, "ObjMakerOLE", "MarkV Systems Object Maker" },
+
+ // IdentiTech / Mike Gilger / 407-951-9503
+ { 0x0003001e, "FYI", "IdentiTech FYI" },
+ { 0x0003001f, "FYIView", "IdentiTech FYI Viewer" },
+
+ // Inventa Corporation / Balaji Varadarajan / 408-987-0220
+ { 0x00030020, "Stickynote", "Inventa Sticky Note" },
+
+ // ShapeWare Corp. / Lori Pearce / 206-467-6723
+ { 0x00030021, "ShapewareVISIO10", "Shapeware Visio 1.0" },
+ { 0x00030022, "ImportServer", "Spaheware Import Server" },
+
+ // test app SrTest
+ { 0x00030023, "SrvrTest", "OLE 1.0 Server Test" },
+
+ // test app ClTest. Doesn't really work as a server but is in reg db
+ { 0x00030025, "Cltest", "OLE 1.0 Client Test" },
+
+ // Microsoft ClipArt Gallery Sherry Larsen-Holmes
+ { 0x00030026, "MS_ClipArt_Gallery", "Microsoft ClipArt Gallery" },
+ // Microsoft Project Cory Reina
+ { 0x00030027, "MSProject", "Microsoft Project" },
+
+ // Microsoft Works Chart
+ { 0x00030028, "MSWorksChart", "Microsoft Works Chart" },
+
+ // Microsoft Works Spreadsheet
+ { 0x00030029, "MSWorksSpreadsheet", "Microsoft Works Spreadsheet" },
+
+ // AFX apps - Dean McCrory
+ { 0x0003002A, "MinSvr", "AFX Mini Server" },
+ { 0x0003002B, "HierarchyList", "AFX Hierarchy List" },
+ { 0x0003002C, "BibRef", "AFX BibRef" },
+ { 0x0003002D, "MinSvrMI", "AFX Mini Server MI" },
+ { 0x0003002E, "TestServ", "AFX Test Server" },
+
+ // Ami Pro
+ { 0x0003002F, "AmiProDocument", "Ami Pro Document" },
+
+ // WordPerfect Presentations For Windows
+ { 0x00030030, "WPGraphics", "WordPerfect Presentation" },
+ { 0x00030031, "WPCharts", "WordPerfect Chart" },
+
+ // MicroGrafx Charisma
+ { 0x00030032, "Charisma", "MicroGrafx Charisma" },
+ { 0x00030033, "Charisma_30", "MicroGrafx Charisma 3.0" },
+ { 0x00030034, "CharPres_30", "MicroGrafx Charisma 3.0 Pres" },
+ // MicroGrafx Draw
+ { 0x00030035, "Draw", "MicroGrafx Draw" },
+ // MicroGrafx Designer
+ { 0x00030036, "Designer_40", "MicroGrafx Designer 4.0" },
+
+ // STAR DIVISION
+// { 0x000424CA, "StarMath", "StarMath 1.0" },
+ { 0x00043AD2, "FontWork", "Star FontWork" },
+// { 0x000456EE, "StarMath2", "StarMath 2.0" },
+
+ { 0, "", "" } };
+
+
+BOOL SvxMSDffManager::ConvertToOle2( SvStream& rStm, UINT32 nReadLen,
+ const GDIMetaFile * pMtf, const SotStorageRef& rDest )
+{
+ BOOL bMtfRead = FALSE;
+ SotStorageStreamRef xOle10Stm = rDest->OpenSotStream( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\1Ole10Native" ) ),
+ STREAM_WRITE| STREAM_SHARE_DENYALL );
+ if( xOle10Stm->GetError() )
+ return FALSE;
+
+ UINT32 nType;
+ UINT32 nRecType;
+ UINT32 nStrLen;
+ String aSvrName;
+ UINT32 nDummy0;
+ UINT32 nDummy1;
+ UINT32 nDataLen;
+ BYTE * pData;
+ UINT32 nBytesRead = 0;
+ do
+ {
+ rStm >> nType;
+ rStm >> nRecType;
+ rStm >> nStrLen;
+ if( nStrLen )
+ {
+ if( 0x10000L > nStrLen )
+ {
+ sal_Char * pBuf = new sal_Char[ nStrLen ];
+ rStm.Read( pBuf, nStrLen );
+ aSvrName.Assign( String( pBuf, (USHORT) nStrLen-1, gsl_getSystemTextEncoding() ) );
+ delete[] pBuf;
+ }
+ else
+ break;
+ }
+ rStm >> nDummy0;
+ rStm >> nDummy1;
+ rStm >> nDataLen;
+
+ nBytesRead += 6 * sizeof( UINT32 ) + nStrLen + nDataLen;
+
+ if( !rStm.IsEof() && nReadLen > nBytesRead && nDataLen )
+ {
+ if( xOle10Stm.Is() )
+ {
+ pData = new BYTE[ nDataLen ];
+ if( !pData )
+ return FALSE;
+
+ rStm.Read( pData, nDataLen );
+
+ // write to ole10 stream
+ *xOle10Stm << nDataLen;
+ xOle10Stm->Write( pData, nDataLen );
+ xOle10Stm = SotStorageStreamRef();
+
+ // set the compobj stream
+ ClsIDs* pIds;
+ for( pIds = aClsIDs; pIds->nId; pIds++ )
+ {
+ if( COMPARE_EQUAL == aSvrName.CompareToAscii( pIds->pSvrName ) )
+ break;
+ }
+// SvGlobalName* pClsId = NULL;
+ String aShort, aFull;
+ if( pIds->nId )
+ {
+ // gefunden!
+ ULONG nCbFmt = SotExchange::RegisterFormatName( aSvrName );
+ rDest->SetClass( SvGlobalName( pIds->nId, 0, 0, 0xc0,0,0,0,0,0,0,0x46 ), nCbFmt,
+ String( pIds->pDspName, RTL_TEXTENCODING_ASCII_US ) );
+ }
+ else
+ {
+ ULONG nCbFmt = SotExchange::RegisterFormatName( aSvrName );
+ rDest->SetClass( SvGlobalName(), nCbFmt, aSvrName );
+ }
+
+ delete[] pData;
+ }
+ else if( nRecType == 5 && !pMtf )
+ {
+ ULONG nPos = rStm.Tell();
+ UINT16 sz[4];
+ rStm.Read( sz, 8 );
+ //rStm.SeekRel( 8 );
+ Graphic aGraphic;
+ if( ERRCODE_NONE == GraphicConverter::Import( rStm, aGraphic ) && aGraphic.GetType() )
+ {
+ const GDIMetaFile& rMtf = aGraphic.GetGDIMetaFile();
+ MakeContentStream( rDest, rMtf );
+ bMtfRead = TRUE;
+ }
+ // set behind the data
+ rStm.Seek( nPos + nDataLen );
+ }
+ else
+ rStm.SeekRel( nDataLen );
+ }
+ } while( !rStm.IsEof() && nReadLen >= nBytesRead );
+
+ if( !bMtfRead && pMtf )
+ {
+ MakeContentStream( rDest, *pMtf );
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+const char* GetInternalServerName_Impl( const SvGlobalName& aGlobName )
+{
+ if ( aGlobName == SvGlobalName( SO3_SW_OLE_EMBED_CLASSID_60 )
+ || aGlobName == SvGlobalName( SO3_SW_OLE_EMBED_CLASSID_8 ) )
+ return "swriter";
+ else if ( aGlobName == SvGlobalName( SO3_SC_OLE_EMBED_CLASSID_60 )
+ || aGlobName == SvGlobalName( SO3_SC_OLE_EMBED_CLASSID_8 ) )
+ return "scalc";
+ else if ( aGlobName == SvGlobalName( SO3_SIMPRESS_OLE_EMBED_CLASSID_60 )
+ || aGlobName == SvGlobalName( SO3_SIMPRESS_OLE_EMBED_CLASSID_8 ) )
+ return "simpress";
+ else if ( aGlobName == SvGlobalName( SO3_SDRAW_OLE_EMBED_CLASSID_60 )
+ || aGlobName == SvGlobalName( SO3_SDRAW_OLE_EMBED_CLASSID_8 ) )
+ return "sdraw";
+ else if ( aGlobName == SvGlobalName( SO3_SM_OLE_EMBED_CLASSID_60 )
+ || aGlobName == SvGlobalName( SO3_SM_OLE_EMBED_CLASSID_8 ) )
+ return "smath";
+ else if ( aGlobName == SvGlobalName( SO3_SCH_OLE_EMBED_CLASSID_60 )
+ || aGlobName == SvGlobalName( SO3_SCH_OLE_EMBED_CLASSID_8 ) )
+ return "schart";
+ return 0;
+}
+
+::rtl::OUString GetFilterNameFromClassID_Impl( const SvGlobalName& aGlobName )
+{
+ if ( aGlobName == SvGlobalName( SO3_SW_OLE_EMBED_CLASSID_60 ) )
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StarOffice XML (Writer)" ) );
+
+ if ( aGlobName == SvGlobalName( SO3_SW_OLE_EMBED_CLASSID_8 ) )
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "writer8" ) );
+
+ if ( aGlobName == SvGlobalName( SO3_SC_OLE_EMBED_CLASSID_60 ) )
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StarOffice XML (Calc)" ) );
+
+ if ( aGlobName == SvGlobalName( SO3_SC_OLE_EMBED_CLASSID_8 ) )
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "calc8" ) );
+
+ if ( aGlobName == SvGlobalName( SO3_SIMPRESS_OLE_EMBED_CLASSID_60 ) )
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StarOffice XML (Impress)" ) );
+
+ if ( aGlobName == SvGlobalName( SO3_SIMPRESS_OLE_EMBED_CLASSID_8 ) )
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "impress8" ) );
+
+ if ( aGlobName == SvGlobalName( SO3_SDRAW_OLE_EMBED_CLASSID_60 ) )
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StarOffice XML (Draw)" ) );
+
+ if ( aGlobName == SvGlobalName( SO3_SDRAW_OLE_EMBED_CLASSID_8 ) )
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "draw8" ) );
+
+ if ( aGlobName == SvGlobalName( SO3_SM_OLE_EMBED_CLASSID_60 ) )
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StarOffice XML (Math)" ) );
+
+ if ( aGlobName == SvGlobalName( SO3_SM_OLE_EMBED_CLASSID_8 ) )
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "math8" ) );
+
+ if ( aGlobName == SvGlobalName( SO3_SCH_OLE_EMBED_CLASSID_60 ) )
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StarOffice XML (Chart)" ) );
+
+ if ( aGlobName == SvGlobalName( SO3_SCH_OLE_EMBED_CLASSID_8 ) )
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "chart8" ) );
+
+ return ::rtl::OUString();
+}
+
+com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > SvxMSDffManager::CheckForConvertToSOObj( UINT32 nConvertFlags,
+ SotStorage& rSrcStg, const uno::Reference < embed::XStorage >& rDestStorage,
+ const Graphic& rGrf,
+ const Rectangle& rVisArea )
+{
+ uno::Reference < embed::XEmbeddedObject > xObj;
+ SvGlobalName aStgNm = rSrcStg.GetClassName();
+ const char* pName = GetInternalServerName_Impl( aStgNm );
+ String sStarName;
+ if ( pName )
+ sStarName = String::CreateFromAscii( pName );
+ else if ( nConvertFlags )
+ {
+ static struct _ObjImpType
+ {
+ UINT32 nFlag;
+ const char* pFactoryNm;
+ // GlobalNameId
+ UINT32 n1;
+ USHORT n2, n3;
+ BYTE b8, b9, b10, b11, b12, b13, b14, b15;
+ } aArr[] = {
+ { OLE_MATHTYPE_2_STARMATH, "smath",
+ 0x0002ce02L, 0x0000, 0x0000,
+ 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 },
+ { OLE_MATHTYPE_2_STARMATH, "smath",
+ 0x00021700L, 0x0000, 0x0000,
+ 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 },
+ { OLE_WINWORD_2_STARWRITER, "swriter",
+ 0x00020906L, 0x0000, 0x0000,
+ 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 },
+ { OLE_EXCEL_2_STARCALC, "scalc", // Excel table
+ 0x00020810L, 0x0000, 0x0000,
+ 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 },
+ { OLE_EXCEL_2_STARCALC, "scalc", // Excel chart
+ 0x00020820L, 0x0000, 0x0000,
+ 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 },
+ // 114465: additional Excel OLE chart classId to above.
+ { OLE_EXCEL_2_STARCALC, "scalc",
+ 0x00020821L, 0x0000, 0x0000,
+ 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 },
+ { OLE_POWERPOINT_2_STARIMPRESS, "simpress", // PowerPoint presentation
+ 0x64818d10L, 0x4f9b, 0x11cf,
+ 0x86,0xea,0x00,0xaa,0x00,0xb9,0x29,0xe8 },
+ { OLE_POWERPOINT_2_STARIMPRESS, "simpress", // PowerPoint slide
+ 0x64818d11L, 0x4f9b, 0x11cf,
+ 0x86,0xea,0x00,0xaa,0x00,0xb9,0x29,0xe8 },
+ { 0, 0,
+ 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0 }
+ };
+
+ for( const _ObjImpType* pArr = aArr; pArr->nFlag; ++pArr )
+ {
+ if( nConvertFlags & pArr->nFlag )
+ {
+ SvGlobalName aTypeName( pArr->n1, pArr->n2, pArr->n3,
+ pArr->b8, pArr->b9, pArr->b10, pArr->b11,
+ pArr->b12, pArr->b13, pArr->b14, pArr->b15 );
+
+ if ( aStgNm == aTypeName )
+ {
+ sStarName = String::CreateFromAscii( pArr->pFactoryNm );
+ break;
+ }
+ }
+ }
+ }
+
+ if ( sStarName.Len() )
+ {
+ //TODO/MBA: check if (and when) storage and stream will be destroyed!
+ const SfxFilter* pFilter = 0;
+ SvMemoryStream* pStream = new SvMemoryStream;
+ if ( pName )
+ {
+ // TODO/LATER: perhaps we need to retrieve VisArea and Metafile from the storage also
+ SotStorageStreamRef xStr = rSrcStg.OpenSotStream( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "package_stream" ) ), STREAM_STD_READ );
+ *xStr >> *pStream;
+ }
+ else
+ {
+ SfxFilterMatcher aMatch( sStarName );
+ SotStorageRef xStorage = new SotStorage( FALSE, *pStream );
+ rSrcStg.CopyTo( xStorage );
+ xStorage->Commit();
+ xStorage.Clear();
+ String aType = SfxFilter::GetTypeFromStorage( rSrcStg );
+ if ( aType.Len() )
+ pFilter = aMatch.GetFilter4EA( aType );
+ }
+
+ if ( pName || pFilter )
+ {
+ //Reuse current ole name
+ String aDstStgName(String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(MSO_OLE_Obj)));
+ aDstStgName += String::CreateFromInt32(nMSOleObjCntr);
+
+ ::rtl::OUString aFilterName;
+ if ( pFilter )
+ aFilterName = pFilter->GetName();
+ else
+ aFilterName = GetFilterNameFromClassID_Impl( aStgNm );
+
+ uno::Sequence < beans::PropertyValue > aMedium( aFilterName.getLength() ? 3 : 2);
+ aMedium[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InputStream" ) );
+ uno::Reference < io::XInputStream > xStream = new ::utl::OSeekableInputStreamWrapper( *pStream );
+ aMedium[0].Value <<= xStream;
+ aMedium[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) );
+ aMedium[1].Value <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:stream" ) );
+
+ if ( aFilterName.getLength() )
+ {
+ aMedium[2].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ) );
+ aMedium[2].Value <<= aFilterName;
+ }
+
+ ::rtl::OUString aName( aDstStgName );
+ comphelper::EmbeddedObjectContainer aCnt( rDestStorage );
+ xObj = aCnt.InsertEmbeddedObject( aMedium, aName );
+
+ if ( !xObj.is() )
+ {
+ if( aFilterName.getLength() )
+ {
+ // throw the filter parameter away as workaround
+ aMedium.realloc( 2 );
+ xObj = aCnt.InsertEmbeddedObject( aMedium, aName );
+ }
+
+ if ( !xObj.is() )
+ return xObj;
+ }
+
+ // TODO/LATER: ViewAspect must be passed from outside!
+ sal_Int64 nViewAspect = embed::Aspects::MSOLE_CONTENT;
+
+ // JP 26.10.2001: Bug 93374 / 91928 the writer
+ // objects need the correct visarea needs the
+ // correct visarea, but this is not true for
+ // PowerPoint (see bugdoc 94908b)
+ // SJ: 19.11.2001 bug 94908, also chart objects
+ // needs the correct visarea
+
+ // If pName is set this is an own embedded object, it should have the correct size internally
+ // TODO/LATER: it might make sence in future to set the size stored in internal object
+ if( !pName && ( sStarName.EqualsAscii( "swriter" ) || sStarName.EqualsAscii( "scalc" ) ) )
+ {
+ MapMode aMapMode( VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nViewAspect ) ) );
+ Size aSz;
+ if ( rVisArea.IsEmpty() )
+ aSz = lcl_GetPrefSize(rGrf, aMapMode );
+ else
+ {
+ aSz = rVisArea.GetSize();
+ aSz = OutputDevice::LogicToLogic( aSz, MapMode( MAP_100TH_MM ), aMapMode );
+ }
+
+ // don't modify the object
+ //TODO/LATER: remove those hacks, that needs to be done differently!
+ //xIPObj->EnableSetModified( FALSE );
+ awt::Size aSize;
+ aSize.Width = aSz.Width();
+ aSize.Height = aSz.Height();
+ xObj->setVisualAreaSize( nViewAspect, aSize );
+ //xIPObj->EnableSetModified( TRUE );
+ }
+ else if ( sStarName.EqualsAscii( "smath" ) )
+ { // SJ: force the object to recalc its visarea
+ //TODO/LATER: wait for PrinterChangeNotification
+ //xIPObj->OnDocumentPrinterChanged( NULL );
+ }
+ }
+ }
+
+ return xObj;
+}
+
+// TODO/MBA: code review and testing!
+SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage(
+ const String& rStorageName,
+ SotStorageRef& rSrcStorage,
+ const uno::Reference < embed::XStorage >& xDestStorage,
+ const Graphic& rGrf,
+ const Rectangle& rBoundRect,
+ const Rectangle& rVisArea,
+ SvStream* pDataStrm,
+ ErrCode& rError,
+ UINT32 nConvertFlags,
+ sal_Int64 nReccomendedAspect )
+{
+ sal_Int64 nAspect = nReccomendedAspect;
+ SdrOle2Obj* pRet = 0;
+ if( rSrcStorage.Is() && xDestStorage.is() && rStorageName.Len() )
+ {
+ comphelper::EmbeddedObjectContainer aCnt( xDestStorage );
+ // Ist der 01Ole-Stream ueberhaupt vorhanden ?
+ // ( ist er z.B. bei FontWork nicht )
+ // Wenn nicht -> Einbindung als Grafik
+ BOOL bValidStorage = FALSE;
+ String aDstStgName( String::CreateFromAscii(
+ RTL_CONSTASCII_STRINGPARAM(MSO_OLE_Obj)));
+
+ aDstStgName += String::CreateFromInt32( ++nMSOleObjCntr );
+
+ {
+ SvStorageRef xObjStg = rSrcStorage->OpenSotStorage( rStorageName,
+ STREAM_READWRITE| STREAM_SHARE_DENYALL );
+ if( xObjStg.Is() )
+ {
+ {
+ BYTE aTestA[10]; // exist the \1CompObj-Stream ?
+ SvStorageStreamRef xSrcTst = xObjStg->OpenSotStream(
+ String(RTL_CONSTASCII_STRINGPARAM("\1CompObj"),
+ RTL_TEXTENCODING_MS_1252 ));
+ bValidStorage = xSrcTst.Is() && sizeof( aTestA ) ==
+ xSrcTst->Read( aTestA, sizeof( aTestA ) );
+ if( !bValidStorage )
+ {
+ // or the \1Ole-Stream ?
+ xSrcTst = xObjStg->OpenSotStream(
+ String(RTL_CONSTASCII_STRINGPARAM("\1Ole"),
+ RTL_TEXTENCODING_MS_1252 ));
+ bValidStorage = xSrcTst.Is() && sizeof(aTestA) ==
+ xSrcTst->Read(aTestA, sizeof(aTestA));
+ }
+ }
+
+ if( bValidStorage )
+ {
+ if ( nAspect != embed::Aspects::MSOLE_ICON )
+ {
+ // check whether the object is iconified one
+ // usually this information is already known, the only exception
+ // is a kind of embedded objects in Word documents
+ // TODO/LATER: should the caller be notified if the aspect changes in future?
+
+ SvStorageStreamRef xObjInfoSrc = xObjStg->OpenSotStream(
+ String( RTL_CONSTASCII_STRINGPARAM( "\3ObjInfo" ) ),
+ STREAM_STD_READ | STREAM_NOCREATE );
+ if ( xObjInfoSrc.Is() && !xObjInfoSrc->GetError() )
+ {
+ BYTE nByte = 0;
+ *xObjInfoSrc >> nByte;
+ if ( ( nByte >> 4 ) & embed::Aspects::MSOLE_ICON )
+ nAspect = embed::Aspects::MSOLE_ICON;
+ }
+ }
+
+ uno::Reference < embed::XEmbeddedObject > xObj( CheckForConvertToSOObj(
+ nConvertFlags, *xObjStg, xDestStorage, rGrf, rVisArea ));
+ if ( xObj.is() )
+ {
+ svt::EmbeddedObjectRef aObj( xObj, nAspect );
+
+ // TODO/LATER: need MediaType
+ aObj.SetGraphic( rGrf, ::rtl::OUString() );
+
+ // TODO/MBA: check setting of PersistName
+ pRet = new SdrOle2Obj( aObj, String(), rBoundRect, false);
+ // we have the Object, don't create another
+ bValidStorage = false;
+ }
+ }
+ }
+ }
+
+ if( bValidStorage )
+ {
+ // object is not an own object
+ SotStorageRef xObjStor = SotStorage::OpenOLEStorage( xDestStorage, aDstStgName, STREAM_READWRITE );
+
+ if ( xObjStor.Is() )
+ {
+ SotStorageRef xSrcStor = rSrcStorage->OpenSotStorage( rStorageName, STREAM_READ );
+ xSrcStor->CopyTo( xObjStor );
+
+ if( !xObjStor->GetError() )
+ xObjStor->Commit();
+
+ if( xObjStor->GetError() )
+ {
+ rError = xObjStor->GetError();
+ bValidStorage = FALSE;
+ }
+ else if( !xObjStor.Is() )
+ bValidStorage = FALSE;
+ }
+ }
+ else if( pDataStrm )
+ {
+ UINT32 nLen, nDummy;
+ *pDataStrm >> nLen >> nDummy;
+ if( SVSTREAM_OK != pDataStrm->GetError() ||
+ // Id in BugDoc - exist there other Ids?
+ // The ConvertToOle2 - does not check for consistent
+ 0x30008 != nDummy )
+ bValidStorage = FALSE;
+ else
+ {
+ // or is it an OLE-1 Stream in the DataStream?
+ SvStorageRef xObjStor = SotStorage::OpenOLEStorage( xDestStorage, aDstStgName );
+ //TODO/MBA: remove metafile conversion from ConvertToOle2
+ //when is this code used?!
+ GDIMetaFile aMtf;
+ bValidStorage = ConvertToOle2( *pDataStrm, nLen, &aMtf, xObjStor );
+ xObjStor->Commit();
+ }
+ }
+
+ if( bValidStorage )
+ {
+ uno::Reference < embed::XEmbeddedObject > xObj = aCnt.GetEmbeddedObject( aDstStgName );
+ if( xObj.is() )
+ {
+ // the visual area must be retrieved from the metafile (object doesn't know it so far)
+
+ if ( nAspect != embed::Aspects::MSOLE_ICON )
+ {
+ // working with visual area can switch the object to running state
+ awt::Size aAwtSz;
+ try
+ {
+ // the provided visual area should be used, if there is any
+ if ( rVisArea.IsEmpty() )
+ {
+ MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
+ Size aSz(lcl_GetPrefSize(rGrf, MapMode(aMapUnit)));
+ aAwtSz.Width = aSz.Width();
+ aAwtSz.Height = aSz.Height();
+ }
+ else
+ {
+ aAwtSz.Width = rVisArea.GetWidth();
+ aAwtSz.Height = rVisArea.GetHeight();
+ }
+ //xInplaceObj->EnableSetModified( FALSE );
+ xObj->setVisualAreaSize( nAspect, aAwtSz );
+ //xInplaceObj->EnableSetModified( TRUE );*/
+ }
+ catch( uno::Exception& )
+ {
+ OSL_ENSURE( sal_False, "Could not set visual area of the object!\n" );
+ }
+ }
+
+ svt::EmbeddedObjectRef aObj( xObj, nAspect );
+
+ // TODO/LATER: need MediaType
+ aObj.SetGraphic( rGrf, ::rtl::OUString() );
+
+ pRet = new SdrOle2Obj( aObj, aDstStgName, rBoundRect, false);
+ }
+ }
+ }
+
+ return pRet;
+}
+
+SdrObject* SvxMSDffManager::GetAutoForm( MSO_SPT eTyp ) const
+{
+ SdrObject* pRet = NULL;
+
+ if(120 >= UINT16(eTyp))
+ {
+ pRet = new SdrRectObj();
+ }
+
+ DBG_ASSERT(pRet, "SvxMSDffManager::GetAutoForm -> UNKNOWN AUTOFORM");
+
+ return pRet;
+}
+
+sal_Bool SvxMSDffManager::SetPropValue( const uno::Any& rAny, const uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
+ const String& rPropName, sal_Bool bTestPropertyAvailability )
+{
+ sal_Bool bRetValue = sal_True;
+ if ( bTestPropertyAvailability )
+ {
+ bRetValue = sal_False;
+ try
+ {
+ uno::Reference< beans::XPropertySetInfo >
+ aXPropSetInfo( rXPropSet->getPropertySetInfo() );
+ if ( aXPropSetInfo.is() )
+ bRetValue = aXPropSetInfo->hasPropertyByName( rPropName );
+ }
+ catch( uno::Exception& )
+ {
+ bRetValue = sal_False;
+ }
+ }
+ if ( bRetValue )
+ {
+ try
+ {
+ rXPropSet->setPropertyValue( rPropName, rAny );
+ bRetValue = sal_True;
+ }
+ catch( uno::Exception& )
+ {
+ bRetValue = sal_False;
+ }
+ }
+ return bRetValue;
+}
+
+SvxMSDffImportRec::SvxMSDffImportRec()
+ : pObj( 0 ),
+ pWrapPolygon(0),
+ pClientAnchorBuffer( 0 ),
+ nClientAnchorLen( 0 ),
+ pClientDataBuffer( 0 ),
+ nClientDataLen( 0 ),
+ nXAlign( 0 ), // position n cm from left
+ nXRelTo( 2 ), // relative to column
+ nYAlign( 0 ), // position n cm below
+ nYRelTo( 2 ), // relative to paragraph
+ nLayoutInTableCell( 0 ), // element is laid out in table cell
+ nTextRotationAngle( 0 ),
+ nDxTextLeft( 144 ),
+ nDyTextTop( 72 ),
+ nDxTextRight( 144 ),
+ nDyTextBottom( 72 ),
+ nDxWrapDistLeft( 0 ),
+ nDyWrapDistTop( 0 ),
+ nDxWrapDistRight( 0 ),
+ nDyWrapDistBottom(0 ),
+ nCropFromTop( 0 ),
+ nCropFromBottom( 0 ),
+ nCropFromLeft( 0 ),
+ nCropFromRight( 0 ),
+ aTextId( 0, 0 ),
+ nNextShapeId( 0 ),
+ nShapeId( 0 ),
+ eShapeType( mso_sptNil )
+{
+ eLineStyle = mso_lineSimple; // GPF-Bug #66227#
+ bDrawHell = FALSE;
+ bHidden = FALSE;
+// bInGroup = FALSE;
+ bReplaceByFly = FALSE;
+ bLastBoxInChain = TRUE;
+ bHasUDefProp = FALSE; // was the DFF_msofbtUDefProp record set?
+ bVFlip = FALSE;
+ bHFlip = FALSE;
+ bAutoWidth = FALSE;
+}
+
+SvxMSDffImportRec::SvxMSDffImportRec(const SvxMSDffImportRec& rCopy)
+ : pObj( rCopy.pObj ),
+ nXAlign( rCopy.nXAlign ),
+ nXRelTo( rCopy.nXRelTo ),
+ nYAlign( rCopy.nYAlign ),
+ nYRelTo( rCopy.nYRelTo ),
+ nLayoutInTableCell( rCopy.nLayoutInTableCell ),
+ nTextRotationAngle( rCopy.nTextRotationAngle ),
+ nDxTextLeft( rCopy.nDxTextLeft ),
+ nDyTextTop( rCopy.nDyTextTop ),
+ nDxTextRight( rCopy.nDxTextRight ),
+ nDyTextBottom( rCopy.nDyTextBottom ),
+ nDxWrapDistLeft( rCopy.nDxWrapDistLeft ),
+ nDyWrapDistTop( rCopy.nDyWrapDistTop ),
+ nDxWrapDistRight( rCopy.nDxWrapDistRight ),
+ nDyWrapDistBottom(rCopy.nDyWrapDistBottom ),
+ nCropFromTop( rCopy.nCropFromTop ),
+ nCropFromBottom( rCopy.nCropFromBottom ),
+ nCropFromLeft( rCopy.nCropFromLeft ),
+ nCropFromRight( rCopy.nCropFromRight ),
+ aTextId( rCopy.aTextId ),
+ nNextShapeId( rCopy.nNextShapeId ),
+ nShapeId( rCopy.nShapeId ),
+ eShapeType( rCopy.eShapeType )
+{
+ eLineStyle = rCopy.eLineStyle; // GPF-Bug #66227#
+ bDrawHell = rCopy.bDrawHell;
+ bHidden = rCopy.bHidden;
+// bInGroup = rCopy.bInGroup;
+ bReplaceByFly = rCopy.bReplaceByFly;
+ bAutoWidth = rCopy.bAutoWidth;
+ bLastBoxInChain = rCopy.bLastBoxInChain;
+ bHasUDefProp = rCopy.bHasUDefProp;
+ bVFlip = rCopy.bVFlip;
+ bHFlip = rCopy.bHFlip;
+ nClientAnchorLen = rCopy.nClientAnchorLen;
+ if( rCopy.nClientAnchorLen )
+ {
+ pClientAnchorBuffer = new char[ nClientAnchorLen ];
+ memcpy( pClientAnchorBuffer,
+ rCopy.pClientAnchorBuffer,
+ nClientAnchorLen );
+ }
+ else
+ pClientAnchorBuffer = 0;
+
+ nClientDataLen = rCopy.nClientDataLen;
+ if( rCopy.nClientDataLen )
+ {
+ pClientDataBuffer = new char[ nClientDataLen ];
+ memcpy( pClientDataBuffer,
+ rCopy.pClientDataBuffer,
+ nClientDataLen );
+ }
+ else
+ pClientDataBuffer = 0;
+
+ if (rCopy.pWrapPolygon)
+ pWrapPolygon = new Polygon(*rCopy.pWrapPolygon);
+ else
+ pWrapPolygon = 0;
+}
+
+SvxMSDffImportRec::~SvxMSDffImportRec()
+{
+ if (pClientAnchorBuffer)
+ delete[] pClientAnchorBuffer;
+ if (pClientDataBuffer)
+ delete[] pClientDataBuffer;
+ if (pWrapPolygon)
+ delete pWrapPolygon;
+}
+
+/* vi:set tabstop=4 shiftwidth=4 expandtab: */
+
+void SvxMSDffManager::insertShapeId( sal_Int32 nShapeId, SdrObject* pShape )
+{
+ maShapeIdContainer[nShapeId] = pShape;
+}
+
+void SvxMSDffManager::removeShapeId( SdrObject* pShape )
+{
+ SvxMSDffShapeIdContainer::iterator aIter( maShapeIdContainer.begin() );
+ const SvxMSDffShapeIdContainer::iterator aEnd( maShapeIdContainer.end() );
+ while( aIter != aEnd )
+ {
+ if( (*aIter).second == pShape )
+ {
+ maShapeIdContainer.erase( aIter );
+ break;
+ }
+ }
+}
+
+SdrObject* SvxMSDffManager::getShapeForId( sal_Int32 nShapeId )
+{
+ SvxMSDffShapeIdContainer::iterator aIter( maShapeIdContainer.find(nShapeId) );
+ return aIter != maShapeIdContainer.end() ? (*aIter).second : 0;
+}
commit fd853bf95728a84ff55ce71fab2abfdbb1a42c41
Author: Jens-Heiner Rechtien <hr at openoffice.org>
Date: Wed May 20 12:24:06 2009 +0000
#i10000#: remove unused variable
diff --git a/sfx2/source/config/evntconf.cxx b/sfx2/source/config/evntconf.cxx
index 1decfa2..1b76a3c 100644
--- a/sfx2/source/config/evntconf.cxx
+++ b/sfx2/source/config/evntconf.cxx
@@ -173,7 +173,6 @@ USHORT SfxEventNamesItem::GetVersion( USHORT ) const
void SfxEventNamesItem::AddEvent( const String& rName, const String& rUIName, USHORT nID )
{
- SfxEventName* pName;
aEventsList.Insert( new SfxEventName( nID, rName, rUIName.Len() ? rUIName : rName ) );
}
commit 274ad24f8085df4f5ac667fd1ed211b23758ec68
Author: Jens-Heiner Rechtien <hr at openoffice.org>
Date: Tue May 19 16:14:08 2009 +0000
#i10000#: fix CRLF. Sigh
diff --git a/svx/source/form/formcontrolling.cxx b/svx/source/form/formcontrolling.cxx
index 668267e..e3f2a48 100644
--- a/svx/source/form/formcontrolling.cxx
+++ b/svx/source/form/formcontrolling.cxx
@@ -1,608 +1,608 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: formcontrolling.cxx,v $
- * $Revision: 1.13 $
- *
- * 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): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#include "formcontrolling.hxx"
-#include "fmurl.hxx"
-#include <svx/svxids.hrc>
-#include "fmprop.hrc"
-#include "fmtools.hxx"
-
-/** === begin UNO includes === **/
-#include <com/sun/star/form/runtime/FormOperations.hpp>
-#include <com/sun/star/form/runtime/FormFeature.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/sdb/XSQLErrorBroadcaster.hpp>
-/** === end UNO includes === **/
-
-#include <tools/diagnose_ex.h>
-#include <comphelper/anytostring.hxx>
-#include <cppuhelper/exc_hlp.hxx>
-#include <osl/diagnose.h>
-
-#include <functional>
-#include <algorithm>
-
-//........................................................................
-namespace svx
-{
-//........................................................................
-
- using namespace ::svxform;
- /** === begin UNO using === **/
- using ::com::sun::star::uno::Reference;
- using ::com::sun::star::lang::XMultiServiceFactory;
- using ::com::sun::star::form::XFormController;
- using ::com::sun::star::form::XForm;
- using ::com::sun::star::form::runtime::FormOperations;
- using ::com::sun::star::uno::Exception;
- using ::com::sun::star::sdbc::XRowSet;
- using ::com::sun::star::form::runtime::FeatureState;
- using ::com::sun::star::uno::Any;
- using ::com::sun::star::uno::Sequence;
- using ::com::sun::star::beans::NamedValue;
- using ::com::sun::star::uno::RuntimeException;
- using ::com::sun::star::beans::XPropertySet;
- using ::com::sun::star::uno::UNO_QUERY_THROW;
- using ::com::sun::star::sdbc::SQLException;
- using ::com::sun::star::sdb::XSQLErrorBroadcaster;
- using ::com::sun::star::sdb::SQLErrorEvent;
- using ::com::sun::star::lang::EventObject;
- /** === end UNO using === **/
- namespace FormFeature = ::com::sun::star::form::runtime::FormFeature;
-
- //====================================================================
- //= FeatureSlotTranslation
- //====================================================================
- namespace
- {
- struct FeatureDescription
- {
- ::rtl::OUString sURL; // the URL
- sal_Int32 nSlotId; // the SFX-compatible slot ID
- sal_Int16 nFormFeature; // the css.form.runtime.FormFeature ID
- };
- typedef ::std::vector< FeatureDescription > FeatureDescriptions;
-
- //................................................................
- const FeatureDescriptions& getFeatureDescriptions()
- {
- static FeatureDescriptions s_aFeatureDescriptions;
- if ( s_aFeatureDescriptions.empty() )
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if ( s_aFeatureDescriptions.empty() )
- {
- FeatureDescription aDescriptions[] = {
- { FMURL_FORM_POSITION, SID_FM_RECORD_ABSOLUTE, FormFeature::MoveAbsolute },
- { FMURL_FORM_RECORDCOUNT, SID_FM_RECORD_TOTAL, FormFeature::TotalRecords },
- { FMURL_RECORD_MOVEFIRST, SID_FM_RECORD_FIRST, FormFeature::MoveToFirst },
- { FMURL_RECORD_MOVEPREV, SID_FM_RECORD_PREV, FormFeature::MoveToPrevious },
- { FMURL_RECORD_MOVENEXT, SID_FM_RECORD_NEXT, FormFeature::MoveToNext },
- { FMURL_RECORD_MOVELAST, SID_FM_RECORD_LAST, FormFeature::MoveToLast },
- { FMURL_RECORD_MOVETONEW, SID_FM_RECORD_NEW, FormFeature::MoveToInsertRow },
- { FMURL_RECORD_SAVE, SID_FM_RECORD_SAVE, FormFeature::SaveRecordChanges },
- { FMURL_RECORD_DELETE, SID_FM_RECORD_DELETE, FormFeature::DeleteRecord },
- { FMURL_FORM_REFRESH, SID_FM_REFRESH, FormFeature::ReloadForm },
- { FMURL_FORM_REFRESH_CURRENT_CONTROL,
- SID_FM_REFRESH_FORM_CONTROL,FormFeature::RefreshCurrentControl },
- { FMURL_RECORD_UNDO, SID_FM_RECORD_UNDO, FormFeature::UndoRecordChanges },
- { FMURL_FORM_SORT_UP, SID_FM_SORTUP, FormFeature::SortAscending },
- { FMURL_FORM_SORT_DOWN, SID_FM_SORTDOWN, FormFeature::SortDescending },
- { FMURL_FORM_SORT, SID_FM_ORDERCRIT, FormFeature::InteractiveSort },
- { FMURL_FORM_AUTO_FILTER, SID_FM_AUTOFILTER, FormFeature::AutoFilter },
- { FMURL_FORM_FILTER, SID_FM_FILTERCRIT, FormFeature::InteractiveFilter },
- { FMURL_FORM_APPLY_FILTER, SID_FM_FORM_FILTERED, FormFeature::ToggleApplyFilter },
- { FMURL_FORM_REMOVE_FILTER, SID_FM_REMOVE_FILTER_SORT, FormFeature::RemoveFilterAndSort }
- };
- for ( size_t i=0; i<sizeof(aDescriptions)/sizeof(aDescriptions[0]); ++i )
- s_aFeatureDescriptions.push_back( aDescriptions[i] );
- }
- };
- return s_aFeatureDescriptions;
- }
- }
-
- //--------------------------------------------------------------------
- namespace
- {
- //................................................................
- struct MatchFeatureDescriptionByURL : public ::std::unary_function< FeatureDescription, bool >
- {
- const ::rtl::OUString& m_rURL;
- MatchFeatureDescriptionByURL( const ::rtl::OUString& _rURL ) :m_rURL( _rURL ) { }
-
- bool operator()( const FeatureDescription& _compare )
- {
- return m_rURL == _compare.sURL;
- }
- };
-
- //................................................................
- struct MatchFeatureDescriptionBySlotId : public ::std::unary_function< FeatureDescription, bool >
- {
- sal_Int32 m_nSlotId;
- MatchFeatureDescriptionBySlotId( sal_Int32 _nSlotId ) :m_nSlotId( _nSlotId ) { }
-
- bool operator()( const FeatureDescription& _compare )
- {
- return m_nSlotId == _compare.nSlotId;
- }
- };
-
- //................................................................
- struct MatchFeatureDescriptionByFormFeature : public ::std::unary_function< FeatureDescription, bool >
- {
- sal_Int32 m_nFormFeature;
- MatchFeatureDescriptionByFormFeature( sal_Int32 _nFormFeature ) :m_nFormFeature( _nFormFeature ) { }
-
- bool operator()( const FeatureDescription& _compare )
- {
- return m_nFormFeature == _compare.nFormFeature;
- }
- };
-
- //................................................................
- struct FormFeatureToSlotId : public ::std::unary_function< sal_Int16, sal_Int32 >
- {
- sal_Int32 operator()( sal_Int16 _FormFeature )
- {
- return FeatureSlotTranslation::getSlotIdForFormFeature( _FormFeature );
- }
- };
- }
-
- //--------------------------------------------------------------------
- sal_Int32 FeatureSlotTranslation::getControllerFeatureSlotIdForURL( const ::rtl::OUString& _rMainURL )
- {
- const FeatureDescriptions& rDescriptions( getFeatureDescriptions() );
- FeatureDescriptions::const_iterator pos = ::std::find_if( rDescriptions.begin(), rDescriptions.end(), MatchFeatureDescriptionByURL( _rMainURL ) );
- return ( pos != rDescriptions.end() ) ? pos->nSlotId : -1;
- }
-
- //--------------------------------------------------------------------
- ::rtl::OUString FeatureSlotTranslation::getControllerFeatureURLForSlotId( sal_Int32 _nSlotId )
- {
- const FeatureDescriptions& rDescriptions( getFeatureDescriptions() );
- FeatureDescriptions::const_iterator pos = ::std::find_if( rDescriptions.begin(), rDescriptions.end(), MatchFeatureDescriptionBySlotId( _nSlotId ) );
- OSL_ENSURE( pos != rDescriptions.end(), "FeatureSlotTranslation::getControllerFeatureURLForSlotId: not found!" );
- return ( pos != rDescriptions.end() ) ? pos->sURL : ::rtl::OUString();
- }
-
- //--------------------------------------------------------------------
- sal_Bool FeatureSlotTranslation::isFeatureURL( const ::rtl::OUString& _rMainURL )
- {
- return ( _rMainURL.indexOf( FMURL_FORMSLOTS_PREFIX ) == 0 );
- }
-
- //--------------------------------------------------------------------
- sal_Int16 FeatureSlotTranslation::getFormFeatureForSlotId( sal_Int32 _nSlotId )
- {
- const FeatureDescriptions& rDescriptions( getFeatureDescriptions() );
- FeatureDescriptions::const_iterator pos = ::std::find_if( rDescriptions.begin(), rDescriptions.end(), MatchFeatureDescriptionBySlotId( _nSlotId ) );
- OSL_ENSURE( pos != rDescriptions.end(), "FeatureSlotTranslation::getFormFeatureForSlotId: not found!" );
- return ( pos != rDescriptions.end() ) ? pos->nFormFeature : -1;
- }
-
- //--------------------------------------------------------------------
- sal_Int32 FeatureSlotTranslation::getSlotIdForFormFeature( sal_Int16 _nFormFeature )
- {
- const FeatureDescriptions& rDescriptions( getFeatureDescriptions() );
- FeatureDescriptions::const_iterator pos = ::std::find_if( rDescriptions.begin(), rDescriptions.end(), MatchFeatureDescriptionByFormFeature( _nFormFeature ) );
- OSL_ENSURE( pos != rDescriptions.end(), "FeatureSlotTranslation::getSlotIdForFormFeature: not found!" );
- return ( pos != rDescriptions.end() ) ? pos->nSlotId : -1;
- }
-
- //====================================================================
- //= ControllerFeatures
- //====================================================================
- //--------------------------------------------------------------------
- ControllerFeatures::ControllerFeatures( const Reference< XMultiServiceFactory >& _rxORB, IControllerFeatureInvalidation* _pInvalidationCallback )
- :m_aContext( _rxORB )
- ,m_pInvalidationCallback( _pInvalidationCallback )
- ,m_pImpl( NULL )
- {
- }
-
- //--------------------------------------------------------------------
- ControllerFeatures::ControllerFeatures( const Reference< XMultiServiceFactory >& _rxORB,
- const Reference< XFormController >& _rxController, IControllerFeatureInvalidation* _pInvalidationCallback )
- :m_aContext( _rxORB )
- ,m_pInvalidationCallback( _pInvalidationCallback )
- ,m_pImpl( NULL )
- {
- assign( _rxController );
- }
-
- //--------------------------------------------------------------------
- ControllerFeatures::ControllerFeatures( const Reference< XMultiServiceFactory >& _rxORB,
- const Reference< XForm >& _rxForm, IControllerFeatureInvalidation* _pInvalidationCallback )
- :m_aContext( _rxORB )
- ,m_pInvalidationCallback( _pInvalidationCallback )
- ,m_pImpl( NULL )
- {
- assign( _rxForm );
- }
-
- //--------------------------------------------------------------------
- void ControllerFeatures::assign( const Reference< XFormController >& _rxController )
- {
- dispose();
- m_pImpl = new FormControllerHelper( m_aContext, _rxController, m_pInvalidationCallback );
- m_pImpl->acquire();
- }
-
- //--------------------------------------------------------------------
- void ControllerFeatures::assign( const Reference< XForm >& _rxForm )
- {
- dispose();
- m_pImpl = new FormControllerHelper( m_aContext, _rxForm, m_pInvalidationCallback );
- m_pImpl->acquire();
- }
-
- //--------------------------------------------------------------------
- ControllerFeatures::~ControllerFeatures()
- {
- dispose();
- }
-
- //--------------------------------------------------------------------
- void ControllerFeatures::dispose()
- {
- if ( m_pImpl )
- {
- m_pImpl->dispose();
- m_pImpl->release();
- m_pImpl = NULL;
- }
- }
-
- //====================================================================
- //= FormControllerHelper
- //====================================================================
- //--------------------------------------------------------------------
- FormControllerHelper::FormControllerHelper( const ::comphelper::ComponentContext& _rContext,
- const Reference< XFormController >& _rxController, IControllerFeatureInvalidation* _pInvalidationCallback )
- :m_aContext( _rContext )
- ,m_pInvalidationCallback( _pInvalidationCallback )
- {
- osl_incrementInterlockedCount( &m_refCount );
- try
- {
- m_xFormOperations = FormOperations::createWithFormController( m_aContext.getUNOContext(), _rxController );
- if ( m_xFormOperations.is() )
- m_xFormOperations->setFeatureInvalidation( this );
-
- // to prevent the controller from displaying any error messages which happen while we operate on it,
- // we add ourself as XSQLErrorListener. By contract, a FormController displays errors if and only if
- // no SQLErrorListeners are registered.
- Reference< XSQLErrorBroadcaster > xErrorBroadcast( _rxController, UNO_QUERY_THROW );
- xErrorBroadcast->addSQLErrorListener( this );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- osl_decrementInterlockedCount( &m_refCount );
- }
-
- //--------------------------------------------------------------------
- FormControllerHelper::FormControllerHelper( const ::comphelper::ComponentContext& _rContext,
- const Reference< XForm >& _rxForm, IControllerFeatureInvalidation* _pInvalidationCallback )
- :m_aContext( _rContext )
- ,m_pInvalidationCallback( _pInvalidationCallback )
- {
- osl_incrementInterlockedCount( &m_refCount );
- try
- {
- m_xFormOperations = FormOperations::createWithForm( m_aContext.getUNOContext(), _rxForm );
- if ( m_xFormOperations.is() )
- m_xFormOperations->setFeatureInvalidation( this );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- osl_decrementInterlockedCount( &m_refCount );
- }
-
- //--------------------------------------------------------------------
- FormControllerHelper::~FormControllerHelper( )
- {
- try
- {
- acquire();
- dispose();
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- }
-
- //--------------------------------------------------------------------
- void FormControllerHelper::dispose()
- {
- if ( m_xFormOperations.is() )
- m_xFormOperations->dispose();
- m_xFormOperations.clear();
- }
-
- //--------------------------------------------------------------------
- sal_Bool FormControllerHelper::isEnabled( sal_Int32 _nSlotId ) const
- {
- if ( !m_xFormOperations.is() )
- return sal_False;
- return m_xFormOperations->isEnabled( FeatureSlotTranslation::getFormFeatureForSlotId( _nSlotId ) );
- }
-
- //--------------------------------------------------------------------
- Reference< XRowSet > FormControllerHelper::getCursor() const
- {
- Reference< XRowSet > xCursor;
- if ( m_xFormOperations.is() )
- xCursor = m_xFormOperations->getCursor();
- return xCursor;
- }
-
- //--------------------------------------------------------------------
- void FormControllerHelper::getState( sal_Int32 _nSlotId, FeatureState& _rState ) const
- {
- if ( m_xFormOperations.is() )
- _rState = m_xFormOperations->getState( FeatureSlotTranslation::getFormFeatureForSlotId( _nSlotId ) );
- }
-
- //--------------------------------------------------------------------
- sal_Bool FormControllerHelper::commitCurrentControl( ) const
- {
- return impl_operateForm_nothrow( COMMIT_CONTROL );
- }
-
- //--------------------------------------------------------------------
- sal_Bool FormControllerHelper::commitCurrentRecord() const
- {
- return impl_operateForm_nothrow( COMMIT_RECORD );
- }
-
- //--------------------------------------------------------------------
- bool FormControllerHelper::moveRight( ) const
- {
- return impl_operateForm_nothrow( FormFeature::MoveToNext );
- }
-
- //--------------------------------------------------------------------
- bool FormControllerHelper::moveLeft( ) const
- {
- return impl_operateForm_nothrow( FormFeature::MoveToPrevious );
- }
-
- //--------------------------------------------------------------------
- void FormControllerHelper::execute( sal_Int32 _nSlotId, const ::rtl::OUString& _rParamName, const Any& _rParamValue ) const
- {
- Sequence< NamedValue > aArguments(1);
- aArguments[0].Name = _rParamName;
- aArguments[0].Value = _rParamValue;
-
- impl_operateForm_nothrow( EXECUTE_ARGS, FeatureSlotTranslation::getFormFeatureForSlotId( _nSlotId ), aArguments );
- }
-
- //--------------------------------------------------------------------
- bool FormControllerHelper::impl_operateForm_nothrow( const FormOperation _eWhat, const sal_Int16 _nFeature,
- const Sequence< NamedValue >& _rArguments ) const
- {
- if ( !m_xFormOperations.is() )
- return false;
-
- Any aError;
- bool bSuccess = false;
- const_cast< FormControllerHelper* >( this )->m_aOperationError.clear();
- try
- {
- switch ( _eWhat )
- {
- case COMMIT_CONTROL:
- bSuccess = m_xFormOperations->commitCurrentControl();
- break;
-
- case COMMIT_RECORD:
- {
- sal_Bool bDummy( sal_False );
- bSuccess = m_xFormOperations->commitCurrentRecord( bDummy );
- }
- break;
-
- case EXECUTE:
- m_xFormOperations->execute( _nFeature );
- bSuccess = true;
- break;
-
- case EXECUTE_ARGS:
- m_xFormOperations->executeWithArguments( _nFeature, _rArguments );
- bSuccess = true;
- break;
- }
- }
- catch ( const SQLException& )
- {
- aError = ::cppu::getCaughtException();
- }
- catch( const Exception& )
- {
- SQLException aFallbackError;
- aFallbackError.Message = ::comphelper::anyToString( ::cppu::getCaughtException() );
- aError <<= aFallbackError;
- }
-
- if ( bSuccess )
- return true;
-
- // display the error. Prefer the one reported in errorOccured over the one caught.
- if ( m_aOperationError.hasValue() )
- displayException( m_aOperationError );
- else if ( aError.hasValue() )
- displayException( aError );
- else
- OSL_ENSURE( false, "FormControllerHelper::impl_operateForm_nothrow: no success, but no error?" );
-
- return false;
- }
-
- //--------------------------------------------------------------------
- void FormControllerHelper::execute( sal_Int32 _nSlotId ) const
- {
- impl_operateForm_nothrow( EXECUTE, FeatureSlotTranslation::getFormFeatureForSlotId( _nSlotId ),
- Sequence< NamedValue >() );
- }
-
- //--------------------------------------------------------------------
- void SAL_CALL FormControllerHelper::invalidateFeatures( const Sequence< ::sal_Int16 >& _Features ) throw (RuntimeException)
- {
- if ( !m_pInvalidationCallback )
- // nobody's interested in ...
- return;
-
- ::std::vector< sal_Int32 > aFeatures( _Features.getLength() );
- ::std::transform(
- _Features.getConstArray(),
- _Features.getConstArray() + _Features.getLength(),
- aFeatures.begin(),
- FormFeatureToSlotId()
- );
-
- m_pInvalidationCallback->invalidateFeatures( aFeatures );
- }
-
- //--------------------------------------------------------------------
- void SAL_CALL FormControllerHelper::invalidateAllFeatures() throw (RuntimeException)
- {
- if ( !m_pInvalidationCallback )
- // nobody's interested in ...
- return;
-
- // actually, it's a little bit more than the supported features,
- // but on the medium term, we are to support everything listed
- // here
- ::std::vector< sal_Int32 > aSupportedFeatures;
- sal_Int32 pSupportedFeatures[] =
- {
- SID_FM_RECORD_FIRST,
- SID_FM_RECORD_NEXT,
- SID_FM_RECORD_PREV,
- SID_FM_RECORD_LAST,
- SID_FM_RECORD_NEW,
- SID_FM_RECORD_DELETE,
- SID_FM_RECORD_ABSOLUTE,
- SID_FM_RECORD_TOTAL,
- SID_FM_RECORD_SAVE,
- SID_FM_RECORD_UNDO,
- SID_FM_REMOVE_FILTER_SORT,
- SID_FM_SORTUP,
- SID_FM_SORTDOWN,
- SID_FM_ORDERCRIT,
- SID_FM_AUTOFILTER,
- SID_FM_FILTERCRIT,
- SID_FM_FORM_FILTERED,
- SID_FM_REFRESH,
- SID_FM_REFRESH_FORM_CONTROL,
- SID_FM_SEARCH,
- SID_FM_FILTER_START,
- SID_FM_VIEW_AS_GRID
- };
- sal_Int32 nFeatureCount = sizeof( pSupportedFeatures ) / sizeof( pSupportedFeatures[ 0 ] );
- aSupportedFeatures.resize( nFeatureCount );
- ::std::copy( pSupportedFeatures, pSupportedFeatures + nFeatureCount, aSupportedFeatures.begin() );
-
- m_pInvalidationCallback->invalidateFeatures( aSupportedFeatures );
- }
-
- //--------------------------------------------------------------------
- void SAL_CALL FormControllerHelper::errorOccured( const SQLErrorEvent& _Event ) throw (RuntimeException)
- {
- OSL_ENSURE( !m_aOperationError.hasValue(), "FormControllerHelper::errorOccured: two errors during one operation?" );
- m_aOperationError = _Event.Reason;
- }
-
- //--------------------------------------------------------------------
- void SAL_CALL FormControllerHelper::disposing( const EventObject& /*_Source*/ ) throw (RuntimeException)
- {
- // not interested in
- }
-
- //--------------------------------------------------------------------
- sal_Bool FormControllerHelper::isInsertionRow() const
- {
- sal_Bool bIs = sal_False;
- if ( m_xFormOperations.is() )
- bIs = m_xFormOperations->isInsertionRow();
- return bIs;
- }
-
- //--------------------------------------------------------------------
- sal_Bool FormControllerHelper::isModifiedRow() const
- {
- sal_Bool bIs = sal_False;
- if ( m_xFormOperations.is() )
- bIs = m_xFormOperations->isModifiedRow();
- return bIs;
- }
- //--------------------------------------------------------------------
- bool FormControllerHelper::canDoFormFilter() const
- {
- if ( !m_xFormOperations.is() )
- return false;
-
- bool bCanDo = false;
- try
- {
- Reference< XPropertySet > xCursorProperties( m_xFormOperations->getCursor(), UNO_QUERY_THROW );
-
- bool bEscapeProcessing( false );
- OSL_VERIFY( xCursorProperties->getPropertyValue( FM_PROP_ESCAPE_PROCESSING ) >>= bEscapeProcessing );
-
- ::rtl::OUString sActiveCommand;
- OSL_VERIFY( xCursorProperties->getPropertyValue( FM_PROP_ACTIVECOMMAND ) >>= sActiveCommand );
-
- bool bInsertOnlyForm( false );
- OSL_VERIFY( xCursorProperties->getPropertyValue( FM_PROP_INSERTONLY ) >>= bInsertOnlyForm );
-
- bCanDo = bEscapeProcessing && ( sActiveCommand.getLength() > 0 ) && !bInsertOnlyForm;
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- return bCanDo;
- }
-
-//........................................................................
-} // namespace svx
-//........................................................................
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: formcontrolling.cxx,v $
+ * $Revision: 1.13 $
+ *
+ * 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): autogen include statement, do not remove
+#include "precompiled_svx.hxx"
+
+#include "formcontrolling.hxx"
+#include "fmurl.hxx"
+#include <svx/svxids.hrc>
+#include "fmprop.hrc"
+#include "fmtools.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/form/runtime/FormOperations.hpp>
+#include <com/sun/star/form/runtime/FormFeature.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/sdb/XSQLErrorBroadcaster.hpp>
+/** === end UNO includes === **/
+
+#include <tools/diagnose_ex.h>
+#include <comphelper/anytostring.hxx>
+#include <cppuhelper/exc_hlp.hxx>
+#include <osl/diagnose.h>
+
+#include <functional>
+#include <algorithm>
+
+//........................................................................
+namespace svx
+{
+//........................................................................
+
+ using namespace ::svxform;
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::lang::XMultiServiceFactory;
+ using ::com::sun::star::form::XFormController;
+ using ::com::sun::star::form::XForm;
+ using ::com::sun::star::form::runtime::FormOperations;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::sdbc::XRowSet;
+ using ::com::sun::star::form::runtime::FeatureState;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::beans::NamedValue;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::beans::XPropertySet;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::sdbc::SQLException;
+ using ::com::sun::star::sdb::XSQLErrorBroadcaster;
+ using ::com::sun::star::sdb::SQLErrorEvent;
+ using ::com::sun::star::lang::EventObject;
+ /** === end UNO using === **/
+ namespace FormFeature = ::com::sun::star::form::runtime::FormFeature;
+
+ //====================================================================
+ //= FeatureSlotTranslation
+ //====================================================================
+ namespace
+ {
+ struct FeatureDescription
+ {
+ ::rtl::OUString sURL; // the URL
+ sal_Int32 nSlotId; // the SFX-compatible slot ID
+ sal_Int16 nFormFeature; // the css.form.runtime.FormFeature ID
+ };
+ typedef ::std::vector< FeatureDescription > FeatureDescriptions;
+
+ //................................................................
+ const FeatureDescriptions& getFeatureDescriptions()
+ {
+ static FeatureDescriptions s_aFeatureDescriptions;
+ if ( s_aFeatureDescriptions.empty() )
+ {
+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+ if ( s_aFeatureDescriptions.empty() )
+ {
+ FeatureDescription aDescriptions[] = {
+ { FMURL_FORM_POSITION, SID_FM_RECORD_ABSOLUTE, FormFeature::MoveAbsolute },
+ { FMURL_FORM_RECORDCOUNT, SID_FM_RECORD_TOTAL, FormFeature::TotalRecords },
+ { FMURL_RECORD_MOVEFIRST, SID_FM_RECORD_FIRST, FormFeature::MoveToFirst },
+ { FMURL_RECORD_MOVEPREV, SID_FM_RECORD_PREV, FormFeature::MoveToPrevious },
+ { FMURL_RECORD_MOVENEXT, SID_FM_RECORD_NEXT, FormFeature::MoveToNext },
+ { FMURL_RECORD_MOVELAST, SID_FM_RECORD_LAST, FormFeature::MoveToLast },
+ { FMURL_RECORD_MOVETONEW, SID_FM_RECORD_NEW, FormFeature::MoveToInsertRow },
+ { FMURL_RECORD_SAVE, SID_FM_RECORD_SAVE, FormFeature::SaveRecordChanges },
+ { FMURL_RECORD_DELETE, SID_FM_RECORD_DELETE, FormFeature::DeleteRecord },
+ { FMURL_FORM_REFRESH, SID_FM_REFRESH, FormFeature::ReloadForm },
+ { FMURL_FORM_REFRESH_CURRENT_CONTROL,
+ SID_FM_REFRESH_FORM_CONTROL,FormFeature::RefreshCurrentControl },
+ { FMURL_RECORD_UNDO, SID_FM_RECORD_UNDO, FormFeature::UndoRecordChanges },
+ { FMURL_FORM_SORT_UP, SID_FM_SORTUP, FormFeature::SortAscending },
+ { FMURL_FORM_SORT_DOWN, SID_FM_SORTDOWN, FormFeature::SortDescending },
+ { FMURL_FORM_SORT, SID_FM_ORDERCRIT, FormFeature::InteractiveSort },
+ { FMURL_FORM_AUTO_FILTER, SID_FM_AUTOFILTER, FormFeature::AutoFilter },
+ { FMURL_FORM_FILTER, SID_FM_FILTERCRIT, FormFeature::InteractiveFilter },
+ { FMURL_FORM_APPLY_FILTER, SID_FM_FORM_FILTERED, FormFeature::ToggleApplyFilter },
+ { FMURL_FORM_REMOVE_FILTER, SID_FM_REMOVE_FILTER_SORT, FormFeature::RemoveFilterAndSort }
+ };
+ for ( size_t i=0; i<sizeof(aDescriptions)/sizeof(aDescriptions[0]); ++i )
+ s_aFeatureDescriptions.push_back( aDescriptions[i] );
+ }
+ };
+ return s_aFeatureDescriptions;
+ }
+ }
+
+ //--------------------------------------------------------------------
+ namespace
+ {
+ //................................................................
+ struct MatchFeatureDescriptionByURL : public ::std::unary_function< FeatureDescription, bool >
+ {
+ const ::rtl::OUString& m_rURL;
+ MatchFeatureDescriptionByURL( const ::rtl::OUString& _rURL ) :m_rURL( _rURL ) { }
+
+ bool operator()( const FeatureDescription& _compare )
+ {
+ return m_rURL == _compare.sURL;
+ }
+ };
+
+ //................................................................
+ struct MatchFeatureDescriptionBySlotId : public ::std::unary_function< FeatureDescription, bool >
+ {
+ sal_Int32 m_nSlotId;
+ MatchFeatureDescriptionBySlotId( sal_Int32 _nSlotId ) :m_nSlotId( _nSlotId ) { }
+
+ bool operator()( const FeatureDescription& _compare )
+ {
+ return m_nSlotId == _compare.nSlotId;
+ }
+ };
+
+ //................................................................
+ struct MatchFeatureDescriptionByFormFeature : public ::std::unary_function< FeatureDescription, bool >
+ {
+ sal_Int32 m_nFormFeature;
+ MatchFeatureDescriptionByFormFeature( sal_Int32 _nFormFeature ) :m_nFormFeature( _nFormFeature ) { }
+
+ bool operator()( const FeatureDescription& _compare )
+ {
+ return m_nFormFeature == _compare.nFormFeature;
+ }
+ };
+
+ //................................................................
+ struct FormFeatureToSlotId : public ::std::unary_function< sal_Int16, sal_Int32 >
+ {
+ sal_Int32 operator()( sal_Int16 _FormFeature )
+ {
+ return FeatureSlotTranslation::getSlotIdForFormFeature( _FormFeature );
+ }
+ };
+ }
+
+ //--------------------------------------------------------------------
+ sal_Int32 FeatureSlotTranslation::getControllerFeatureSlotIdForURL( const ::rtl::OUString& _rMainURL )
+ {
+ const FeatureDescriptions& rDescriptions( getFeatureDescriptions() );
+ FeatureDescriptions::const_iterator pos = ::std::find_if( rDescriptions.begin(), rDescriptions.end(), MatchFeatureDescriptionByURL( _rMainURL ) );
+ return ( pos != rDescriptions.end() ) ? pos->nSlotId : -1;
+ }
+
+ //--------------------------------------------------------------------
+ ::rtl::OUString FeatureSlotTranslation::getControllerFeatureURLForSlotId( sal_Int32 _nSlotId )
+ {
+ const FeatureDescriptions& rDescriptions( getFeatureDescriptions() );
+ FeatureDescriptions::const_iterator pos = ::std::find_if( rDescriptions.begin(), rDescriptions.end(), MatchFeatureDescriptionBySlotId( _nSlotId ) );
+ OSL_ENSURE( pos != rDescriptions.end(), "FeatureSlotTranslation::getControllerFeatureURLForSlotId: not found!" );
+ return ( pos != rDescriptions.end() ) ? pos->sURL : ::rtl::OUString();
+ }
+
+ //--------------------------------------------------------------------
+ sal_Bool FeatureSlotTranslation::isFeatureURL( const ::rtl::OUString& _rMainURL )
+ {
+ return ( _rMainURL.indexOf( FMURL_FORMSLOTS_PREFIX ) == 0 );
+ }
+
+ //--------------------------------------------------------------------
+ sal_Int16 FeatureSlotTranslation::getFormFeatureForSlotId( sal_Int32 _nSlotId )
+ {
+ const FeatureDescriptions& rDescriptions( getFeatureDescriptions() );
+ FeatureDescriptions::const_iterator pos = ::std::find_if( rDescriptions.begin(), rDescriptions.end(), MatchFeatureDescriptionBySlotId( _nSlotId ) );
+ OSL_ENSURE( pos != rDescriptions.end(), "FeatureSlotTranslation::getFormFeatureForSlotId: not found!" );
+ return ( pos != rDescriptions.end() ) ? pos->nFormFeature : -1;
+ }
+
+ //--------------------------------------------------------------------
+ sal_Int32 FeatureSlotTranslation::getSlotIdForFormFeature( sal_Int16 _nFormFeature )
+ {
+ const FeatureDescriptions& rDescriptions( getFeatureDescriptions() );
+ FeatureDescriptions::const_iterator pos = ::std::find_if( rDescriptions.begin(), rDescriptions.end(), MatchFeatureDescriptionByFormFeature( _nFormFeature ) );
+ OSL_ENSURE( pos != rDescriptions.end(), "FeatureSlotTranslation::getSlotIdForFormFeature: not found!" );
+ return ( pos != rDescriptions.end() ) ? pos->nSlotId : -1;
+ }
+
+ //====================================================================
+ //= ControllerFeatures
+ //====================================================================
+ //--------------------------------------------------------------------
+ ControllerFeatures::ControllerFeatures( const Reference< XMultiServiceFactory >& _rxORB, IControllerFeatureInvalidation* _pInvalidationCallback )
+ :m_aContext( _rxORB )
+ ,m_pInvalidationCallback( _pInvalidationCallback )
+ ,m_pImpl( NULL )
+ {
+ }
+
+ //--------------------------------------------------------------------
+ ControllerFeatures::ControllerFeatures( const Reference< XMultiServiceFactory >& _rxORB,
+ const Reference< XFormController >& _rxController, IControllerFeatureInvalidation* _pInvalidationCallback )
+ :m_aContext( _rxORB )
+ ,m_pInvalidationCallback( _pInvalidationCallback )
+ ,m_pImpl( NULL )
+ {
+ assign( _rxController );
+ }
+
+ //--------------------------------------------------------------------
+ ControllerFeatures::ControllerFeatures( const Reference< XMultiServiceFactory >& _rxORB,
+ const Reference< XForm >& _rxForm, IControllerFeatureInvalidation* _pInvalidationCallback )
+ :m_aContext( _rxORB )
+ ,m_pInvalidationCallback( _pInvalidationCallback )
+ ,m_pImpl( NULL )
+ {
+ assign( _rxForm );
+ }
+
+ //--------------------------------------------------------------------
+ void ControllerFeatures::assign( const Reference< XFormController >& _rxController )
+ {
+ dispose();
+ m_pImpl = new FormControllerHelper( m_aContext, _rxController, m_pInvalidationCallback );
+ m_pImpl->acquire();
+ }
+
+ //--------------------------------------------------------------------
+ void ControllerFeatures::assign( const Reference< XForm >& _rxForm )
+ {
+ dispose();
+ m_pImpl = new FormControllerHelper( m_aContext, _rxForm, m_pInvalidationCallback );
+ m_pImpl->acquire();
+ }
+
+ //--------------------------------------------------------------------
+ ControllerFeatures::~ControllerFeatures()
+ {
+ dispose();
+ }
+
+ //--------------------------------------------------------------------
+ void ControllerFeatures::dispose()
+ {
+ if ( m_pImpl )
+ {
+ m_pImpl->dispose();
+ m_pImpl->release();
+ m_pImpl = NULL;
+ }
+ }
+
+ //====================================================================
+ //= FormControllerHelper
+ //====================================================================
+ //--------------------------------------------------------------------
+ FormControllerHelper::FormControllerHelper( const ::comphelper::ComponentContext& _rContext,
+ const Reference< XFormController >& _rxController, IControllerFeatureInvalidation* _pInvalidationCallback )
+ :m_aContext( _rContext )
+ ,m_pInvalidationCallback( _pInvalidationCallback )
+ {
+ osl_incrementInterlockedCount( &m_refCount );
+ try
+ {
+ m_xFormOperations = FormOperations::createWithFormController( m_aContext.getUNOContext(), _rxController );
+ if ( m_xFormOperations.is() )
+ m_xFormOperations->setFeatureInvalidation( this );
+
+ // to prevent the controller from displaying any error messages which happen while we operate on it,
+ // we add ourself as XSQLErrorListener. By contract, a FormController displays errors if and only if
+ // no SQLErrorListeners are registered.
+ Reference< XSQLErrorBroadcaster > xErrorBroadcast( _rxController, UNO_QUERY_THROW );
+ xErrorBroadcast->addSQLErrorListener( this );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ osl_decrementInterlockedCount( &m_refCount );
+ }
+
+ //--------------------------------------------------------------------
+ FormControllerHelper::FormControllerHelper( const ::comphelper::ComponentContext& _rContext,
+ const Reference< XForm >& _rxForm, IControllerFeatureInvalidation* _pInvalidationCallback )
+ :m_aContext( _rContext )
+ ,m_pInvalidationCallback( _pInvalidationCallback )
+ {
+ osl_incrementInterlockedCount( &m_refCount );
+ try
+ {
+ m_xFormOperations = FormOperations::createWithForm( m_aContext.getUNOContext(), _rxForm );
+ if ( m_xFormOperations.is() )
+ m_xFormOperations->setFeatureInvalidation( this );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ osl_decrementInterlockedCount( &m_refCount );
+ }
+
+ //--------------------------------------------------------------------
+ FormControllerHelper::~FormControllerHelper( )
+ {
+ try
+ {
+ acquire();
+ dispose();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //--------------------------------------------------------------------
+ void FormControllerHelper::dispose()
+ {
+ if ( m_xFormOperations.is() )
+ m_xFormOperations->dispose();
+ m_xFormOperations.clear();
+ }
+
+ //--------------------------------------------------------------------
+ sal_Bool FormControllerHelper::isEnabled( sal_Int32 _nSlotId ) const
+ {
+ if ( !m_xFormOperations.is() )
+ return sal_False;
+ return m_xFormOperations->isEnabled( FeatureSlotTranslation::getFormFeatureForSlotId( _nSlotId ) );
+ }
+
+ //--------------------------------------------------------------------
+ Reference< XRowSet > FormControllerHelper::getCursor() const
+ {
+ Reference< XRowSet > xCursor;
+ if ( m_xFormOperations.is() )
+ xCursor = m_xFormOperations->getCursor();
+ return xCursor;
+ }
+
+ //--------------------------------------------------------------------
+ void FormControllerHelper::getState( sal_Int32 _nSlotId, FeatureState& _rState ) const
+ {
+ if ( m_xFormOperations.is() )
+ _rState = m_xFormOperations->getState( FeatureSlotTranslation::getFormFeatureForSlotId( _nSlotId ) );
+ }
+
+ //--------------------------------------------------------------------
+ sal_Bool FormControllerHelper::commitCurrentControl( ) const
+ {
+ return impl_operateForm_nothrow( COMMIT_CONTROL );
+ }
+
+ //--------------------------------------------------------------------
+ sal_Bool FormControllerHelper::commitCurrentRecord() const
+ {
+ return impl_operateForm_nothrow( COMMIT_RECORD );
+ }
+
+ //--------------------------------------------------------------------
+ bool FormControllerHelper::moveRight( ) const
+ {
+ return impl_operateForm_nothrow( FormFeature::MoveToNext );
+ }
+
+ //--------------------------------------------------------------------
+ bool FormControllerHelper::moveLeft( ) const
+ {
+ return impl_operateForm_nothrow( FormFeature::MoveToPrevious );
+ }
+
+ //--------------------------------------------------------------------
+ void FormControllerHelper::execute( sal_Int32 _nSlotId, const ::rtl::OUString& _rParamName, const Any& _rParamValue ) const
+ {
+ Sequence< NamedValue > aArguments(1);
+ aArguments[0].Name = _rParamName;
+ aArguments[0].Value = _rParamValue;
+
+ impl_operateForm_nothrow( EXECUTE_ARGS, FeatureSlotTranslation::getFormFeatureForSlotId( _nSlotId ), aArguments );
+ }
+
+ //--------------------------------------------------------------------
+ bool FormControllerHelper::impl_operateForm_nothrow( const FormOperation _eWhat, const sal_Int16 _nFeature,
+ const Sequence< NamedValue >& _rArguments ) const
+ {
+ if ( !m_xFormOperations.is() )
+ return false;
+
+ Any aError;
+ bool bSuccess = false;
+ const_cast< FormControllerHelper* >( this )->m_aOperationError.clear();
+ try
+ {
+ switch ( _eWhat )
+ {
+ case COMMIT_CONTROL:
+ bSuccess = m_xFormOperations->commitCurrentControl();
+ break;
+
+ case COMMIT_RECORD:
+ {
+ sal_Bool bDummy( sal_False );
+ bSuccess = m_xFormOperations->commitCurrentRecord( bDummy );
+ }
+ break;
+
+ case EXECUTE:
+ m_xFormOperations->execute( _nFeature );
+ bSuccess = true;
+ break;
+
+ case EXECUTE_ARGS:
+ m_xFormOperations->executeWithArguments( _nFeature, _rArguments );
+ bSuccess = true;
+ break;
+ }
+ }
+ catch ( const SQLException& )
+ {
+ aError = ::cppu::getCaughtException();
+ }
+ catch( const Exception& )
+ {
+ SQLException aFallbackError;
+ aFallbackError.Message = ::comphelper::anyToString( ::cppu::getCaughtException() );
+ aError <<= aFallbackError;
+ }
+
+ if ( bSuccess )
+ return true;
+
+ // display the error. Prefer the one reported in errorOccured over the one caught.
+ if ( m_aOperationError.hasValue() )
+ displayException( m_aOperationError );
+ else if ( aError.hasValue() )
+ displayException( aError );
+ else
+ OSL_ENSURE( false, "FormControllerHelper::impl_operateForm_nothrow: no success, but no error?" );
+
+ return false;
+ }
+
+ //--------------------------------------------------------------------
+ void FormControllerHelper::execute( sal_Int32 _nSlotId ) const
+ {
+ impl_operateForm_nothrow( EXECUTE, FeatureSlotTranslation::getFormFeatureForSlotId( _nSlotId ),
+ Sequence< NamedValue >() );
+ }
+
+ //--------------------------------------------------------------------
+ void SAL_CALL FormControllerHelper::invalidateFeatures( const Sequence< ::sal_Int16 >& _Features ) throw (RuntimeException)
+ {
+ if ( !m_pInvalidationCallback )
+ // nobody's interested in ...
+ return;
+
+ ::std::vector< sal_Int32 > aFeatures( _Features.getLength() );
+ ::std::transform(
+ _Features.getConstArray(),
+ _Features.getConstArray() + _Features.getLength(),
+ aFeatures.begin(),
+ FormFeatureToSlotId()
+ );
+
+ m_pInvalidationCallback->invalidateFeatures( aFeatures );
+ }
+
+ //--------------------------------------------------------------------
+ void SAL_CALL FormControllerHelper::invalidateAllFeatures() throw (RuntimeException)
+ {
+ if ( !m_pInvalidationCallback )
+ // nobody's interested in ...
+ return;
+
+ // actually, it's a little bit more than the supported features,
+ // but on the medium term, we are to support everything listed
+ // here
+ ::std::vector< sal_Int32 > aSupportedFeatures;
+ sal_Int32 pSupportedFeatures[] =
+ {
+ SID_FM_RECORD_FIRST,
+ SID_FM_RECORD_NEXT,
+ SID_FM_RECORD_PREV,
+ SID_FM_RECORD_LAST,
+ SID_FM_RECORD_NEW,
+ SID_FM_RECORD_DELETE,
+ SID_FM_RECORD_ABSOLUTE,
+ SID_FM_RECORD_TOTAL,
+ SID_FM_RECORD_SAVE,
+ SID_FM_RECORD_UNDO,
+ SID_FM_REMOVE_FILTER_SORT,
+ SID_FM_SORTUP,
+ SID_FM_SORTDOWN,
+ SID_FM_ORDERCRIT,
+ SID_FM_AUTOFILTER,
+ SID_FM_FILTERCRIT,
+ SID_FM_FORM_FILTERED,
+ SID_FM_REFRESH,
+ SID_FM_REFRESH_FORM_CONTROL,
+ SID_FM_SEARCH,
+ SID_FM_FILTER_START,
+ SID_FM_VIEW_AS_GRID
+ };
+ sal_Int32 nFeatureCount = sizeof( pSupportedFeatures ) / sizeof( pSupportedFeatures[ 0 ] );
+ aSupportedFeatures.resize( nFeatureCount );
+ ::std::copy( pSupportedFeatures, pSupportedFeatures + nFeatureCount, aSupportedFeatures.begin() );
+
+ m_pInvalidationCallback->invalidateFeatures( aSupportedFeatures );
+ }
+
+ //--------------------------------------------------------------------
+ void SAL_CALL FormControllerHelper::errorOccured( const SQLErrorEvent& _Event ) throw (RuntimeException)
+ {
+ OSL_ENSURE( !m_aOperationError.hasValue(), "FormControllerHelper::errorOccured: two errors during one operation?" );
+ m_aOperationError = _Event.Reason;
+ }
+
+ //--------------------------------------------------------------------
+ void SAL_CALL FormControllerHelper::disposing( const EventObject& /*_Source*/ ) throw (RuntimeException)
+ {
+ // not interested in
+ }
+
+ //--------------------------------------------------------------------
+ sal_Bool FormControllerHelper::isInsertionRow() const
+ {
+ sal_Bool bIs = sal_False;
+ if ( m_xFormOperations.is() )
+ bIs = m_xFormOperations->isInsertionRow();
+ return bIs;
+ }
+
+ //--------------------------------------------------------------------
+ sal_Bool FormControllerHelper::isModifiedRow() const
+ {
+ sal_Bool bIs = sal_False;
+ if ( m_xFormOperations.is() )
+ bIs = m_xFormOperations->isModifiedRow();
+ return bIs;
+ }
+ //--------------------------------------------------------------------
+ bool FormControllerHelper::canDoFormFilter() const
+ {
+ if ( !m_xFormOperations.is() )
+ return false;
+
+ bool bCanDo = false;
+ try
+ {
+ Reference< XPropertySet > xCursorProperties( m_xFormOperations->getCursor(), UNO_QUERY_THROW );
+
+ bool bEscapeProcessing( false );
+ OSL_VERIFY( xCursorProperties->getPropertyValue( FM_PROP_ESCAPE_PROCESSING ) >>= bEscapeProcessing );
+
+ ::rtl::OUString sActiveCommand;
+ OSL_VERIFY( xCursorProperties->getPropertyValue( FM_PROP_ACTIVECOMMAND ) >>= sActiveCommand );
+
+ bool bInsertOnlyForm( false );
+ OSL_VERIFY( xCursorProperties->getPropertyValue( FM_PROP_INSERTONLY ) >>= bInsertOnlyForm );
+
+ bCanDo = bEscapeProcessing && ( sActiveCommand.getLength() > 0 ) && !bInsertOnlyForm;
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return bCanDo;
+ }
+
+//........................................................................
+} // namespace svx
+//........................................................................
diff --git a/svx/source/inc/formcontrolling.hxx b/svx/source/inc/formcontrolling.hxx
index 50f27f4..eb99d80 100644
--- a/svx/source/inc/formcontrolling.hxx
+++ b/svx/source/inc/formcontrolling.hxx
@@ -1,311 +1,311 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: formcontrolling.hxx,v $
- * $Revision: 1.7 $
- *
- * 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_FORMCONTROLLING_HXX
-#define SVX_FORMCONTROLLING_HXX
-
-#include <com/sun/star/form/XFormController.hpp>
-#include <com/sun/star/form/XForm.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/form/runtime/FeatureState.hpp>
-#include <com/sun/star/form/runtime/XFormOperations.hpp>
-#include <com/sun/star/sdb/XSQLErrorListener.hpp>
-
-#include <cppuhelper/implbase2.hxx>
-#include <comphelper/componentcontext.hxx>
-
-#include <vector>
-
-//........................................................................
-namespace svx
-{
-//........................................................................
-
- //====================================================================
- //= FeatureSlotTranslation
- //====================================================================
- class FeatureSlotTranslation
- {
- public:
- /// retrieves the feature id for a given feature URL
- static sal_Int32 getControllerFeatureSlotIdForURL( const ::rtl::OUString& _rMainURL );
-
- /// retrieves the feature URL for a given feature id
- static ::rtl::OUString getControllerFeatureURLForSlotId( sal_Int32 _nSlotId );
-
- /// determines whether the given URL is a controller feature URL
- static sal_Bool isFeatureURL( const ::rtl::OUString& _rMainURL );
-
- /// retrieves the css.form.runtime.FormFeature ID for a given slot ID
- static sal_Int16 getFormFeatureForSlotId( sal_Int32 _nSlotId );
-
- /// retrieves the slot id for a given css.form.runtime.FormFeature ID
- static sal_Int32 getSlotIdForFormFeature( sal_Int16 _nFormFeature );
- };
-
- //====================================================================
- //= IControllerFeatureInvalidation
- //====================================================================
- class IControllerFeatureInvalidation
- {
- public:
- /** invalidates the given features
-
- Invalidation means that any user interface representation (such as toolbox buttons), or
- any dispatches associated with the features in question are potentially out-of-date, and
- need to be updated
-
- @param _rFeatures
- Ids of the features to be invalidated.
- */
- virtual void invalidateFeatures( const ::std::vector< sal_Int32 >& _rFeatures ) = 0;
- };
-
- //====================================================================
- //= ControllerFeatures
- //====================================================================
- class FormControllerHelper;
- /** easier access to an FormControllerHelper instance
- */
- class ControllerFeatures
- {
- protected:
- ::comphelper::ComponentContext m_aContext;
- IControllerFeatureInvalidation* m_pInvalidationCallback; // necessary as long as m_pImpl is not yet constructed
- FormControllerHelper* m_pImpl;
-
- public:
- /** standard ctor
-
- The instance is not functional until <method>assign</method> is used.
-
- @param _rxORB
- a multi service factory for creating various needed components
-
- @param _pInvalidationCallback
- the callback for invalidating feature states
- */
- ControllerFeatures(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
- IControllerFeatureInvalidation* _pInvalidationCallback
- );
-
- /** constructs the instance from a <type scope="com::sun::star::form">XFormController<type> instance
-
- @param _rxORB
- a multi service factory for creating various needed components
-
- @param _rxController
- The form controller which the helper should be responsible for. Must not
- be <NULL/>, and must have a valid model (form).
-
- @param _pInvalidationCallback
- the callback for invalidating feature states
- */
- ControllerFeatures(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
- const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormController >& _rxController,
- IControllerFeatureInvalidation* _pInvalidationCallback
- );
-
- /** constructs the helper form a <type scope="com::sun::star::form">XForm<type> instance
-
- Any functionality which depends on a controller will not be available.
-
- @param _rxORB
- a multi service factory for creating various needed components
-
- @param _rxForm
- The form which the helper should be responsible for. Must not be <NULL/>.
-
- @param _pInvalidationCallback
- the callback for invalidating feature states
- */
- ControllerFeatures(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
- const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >& _rxForm,
- IControllerFeatureInvalidation* _pInvalidationCallback
- );
-
- /// dtor
- ~ControllerFeatures();
-
- /// checks whether the instance is properly assigned to a form and/or controller
- inline bool isAssigned( ) const { return m_pImpl != NULL; }
-
- /** assign to a controller
- */
- void assign(
- const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormController >& _rxController
- );
-
- /** assign to a controller
- */
- void assign(
- const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >& _rxForm
- );
-
- /// clears the instance so that it cannot be used afterwards
- void dispose();
-
- // access to the instance which implements the functionality. Not to be used when not assigned
- inline const FormControllerHelper* operator->() const { return m_pImpl; }
- inline FormControllerHelper* operator->() { return m_pImpl; }
- inline const FormControllerHelper& operator*() const { return *m_pImpl; }
- inline FormControllerHelper& operator*() { return *m_pImpl; }
- };
-
- //====================================================================
- //= FormControllerHelper
- //====================================================================
- typedef ::cppu::WeakImplHelper2 < ::com::sun::star::form::runtime::XFeatureInvalidation
- , ::com::sun::star::sdb::XSQLErrorListener
- > FormControllerHelper_Base;
- /** is a helper class which manages form controller functionality (such as moveNext etc.).
-
- <p>The class helps implementing form controller functionality, by providing
- methods to determine the state of, and execute, various common form features.<br/>
- A <em>feature</em> is for instance moving the form associated with the controller
- to a certain position, or reloading the form, and so on.</p>
- */
- class FormControllerHelper : public FormControllerHelper_Base
- {
- protected:
- ::comphelper::ComponentContext m_aContext;
- IControllerFeatureInvalidation* m_pInvalidationCallback;
- ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormOperations >
- m_xFormOperations;
-
- ::com::sun::star::uno::Any m_aOperationError;
-
- public:
- /** constructs the helper from a <type scope="com::sun::star::form">XFormController<type> instance
-
- @param _rContext
- the context the component lives in
- @param _rxController
- The form controller which the helper should be responsible for. Must not
- be <NULL/>, and must have a valid model (form).
- @param _pInvalidationCallback
- the callback for invalidating feature states
- */
- FormControllerHelper(
- const ::comphelper::ComponentContext& _rContext,
- const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormController >& _rxController,
- IControllerFeatureInvalidation* _pInvalidationCallback
- );
-
- /** constructs the helper form a <type scope="com::sun::star::form">XForm<type> instance
-
- Any functionality which depends on a controller will not be available.
-
- @param _rContext
- the context the component lives in
- @param _rxForm
- The form which the helper should be responsible for. Must not be <NULL/>.
- @param _pInvalidationCallback
- the callback for invalidating feature states
- */
- FormControllerHelper(
- const ::comphelper::ComponentContext& _rContext,
- const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >& _rxForm,
- IControllerFeatureInvalidation* _pInvalidationCallback
- );
-
- // forwards to the XFormOperations implementation
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >
- getCursor() const;
- void getState(
- sal_Int32 _nSlotId,
- ::com::sun::star::form::runtime::FeatureState& _out_rState
- ) const;
- sal_Bool isEnabled( sal_Int32 _nSlotId ) const;
- void execute( sal_Int32 _nSlotId ) const;
- void execute( sal_Int32 _nSlotId, const ::rtl::OUString& _rParamName, const ::com::sun::star::uno::Any& _rParamValue ) const;
- sal_Bool commitCurrentRecord() const;
- sal_Bool commitCurrentControl( ) const;
- sal_Bool isInsertionRow() const;
- sal_Bool isModifiedRow() const;
-
- bool moveLeft( ) const;
- bool moveRight( ) const;
-
- bool canDoFormFilter() const;
-
- /** disposes this instance.
-
- After this method has been called, the instance is not functional anymore
- */
- void dispose();
-
- const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormOperations >&
- getFormOperations() const { return m_xFormOperations; }
- protected:
- /// dtor
- ~FormControllerHelper();
-
- // XFeatureInvalidation
- virtual void SAL_CALL invalidateFeatures( const ::com::sun::star::uno::Sequence< ::sal_Int16 >& Features ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL invalidateAllFeatures() throw (::com::sun::star::uno::RuntimeException);
-
- // XSQLErrorListener
- virtual void SAL_CALL errorOccured( const ::com::sun::star::sdb::SQLErrorEvent& _Event ) throw (::com::sun::star::uno::RuntimeException);
-
- // XEventListener
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
-
- private:
- enum FormOperation { EXECUTE, EXECUTE_ARGS, COMMIT_CONTROL, COMMIT_RECORD };
-
- bool impl_operateForm_nothrow(
- const FormOperation _eWhat,
- const sal_Int16 _nFeature, /* ignore for COMMIT_* */
- const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& _rArguments /* ignore except for EXECUTE_ARGS */
- ) const;
- bool impl_operateForm_nothrow( const FormOperation _eWhat ) const
- {
- return impl_operateForm_nothrow( _eWhat, 0, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >() );
- }
- bool impl_operateForm_nothrow( const sal_Int16 _nFeature ) const
- {
- return impl_operateForm_nothrow( EXECUTE, _nFeature, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >() );
- }
-
- private:
- FormControllerHelper(); // never implemented
- FormControllerHelper( const FormControllerHelper& ); // never implemented
- FormControllerHelper& operator=( const FormControllerHelper& ); // never implemented
- };
-
-//........................................................................
-} // namespace svx
-//........................................................................
-
-#endif // SVX_FORMCONTROLLING_HXX
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: formcontrolling.hxx,v $
+ * $Revision: 1.7 $
+ *
+ * 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_FORMCONTROLLING_HXX
+#define SVX_FORMCONTROLLING_HXX
+
+#include <com/sun/star/form/XFormController.hpp>
+#include <com/sun/star/form/XForm.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/form/runtime/FeatureState.hpp>
+#include <com/sun/star/form/runtime/XFormOperations.hpp>
+#include <com/sun/star/sdb/XSQLErrorListener.hpp>
+
+#include <cppuhelper/implbase2.hxx>
+#include <comphelper/componentcontext.hxx>
+
+#include <vector>
+
+//........................................................................
+namespace svx
+{
+//........................................................................
+
+ //====================================================================
+ //= FeatureSlotTranslation
+ //====================================================================
+ class FeatureSlotTranslation
+ {
+ public:
+ /// retrieves the feature id for a given feature URL
+ static sal_Int32 getControllerFeatureSlotIdForURL( const ::rtl::OUString& _rMainURL );
+
+ /// retrieves the feature URL for a given feature id
+ static ::rtl::OUString getControllerFeatureURLForSlotId( sal_Int32 _nSlotId );
+
+ /// determines whether the given URL is a controller feature URL
+ static sal_Bool isFeatureURL( const ::rtl::OUString& _rMainURL );
+
+ /// retrieves the css.form.runtime.FormFeature ID for a given slot ID
+ static sal_Int16 getFormFeatureForSlotId( sal_Int32 _nSlotId );
+
+ /// retrieves the slot id for a given css.form.runtime.FormFeature ID
+ static sal_Int32 getSlotIdForFormFeature( sal_Int16 _nFormFeature );
+ };
+
+ //====================================================================
+ //= IControllerFeatureInvalidation
+ //====================================================================
+ class IControllerFeatureInvalidation
+ {
+ public:
+ /** invalidates the given features
+
+ Invalidation means that any user interface representation (such as toolbox buttons), or
+ any dispatches associated with the features in question are potentially out-of-date, and
+ need to be updated
+
+ @param _rFeatures
+ Ids of the features to be invalidated.
+ */
+ virtual void invalidateFeatures( const ::std::vector< sal_Int32 >& _rFeatures ) = 0;
+ };
+
+ //====================================================================
+ //= ControllerFeatures
+ //====================================================================
+ class FormControllerHelper;
+ /** easier access to an FormControllerHelper instance
+ */
+ class ControllerFeatures
+ {
+ protected:
+ ::comphelper::ComponentContext m_aContext;
+ IControllerFeatureInvalidation* m_pInvalidationCallback; // necessary as long as m_pImpl is not yet constructed
+ FormControllerHelper* m_pImpl;
+
+ public:
+ /** standard ctor
+
+ The instance is not functional until <method>assign</method> is used.
+
+ @param _rxORB
+ a multi service factory for creating various needed components
+
+ @param _pInvalidationCallback
+ the callback for invalidating feature states
+ */
+ ControllerFeatures(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
+ IControllerFeatureInvalidation* _pInvalidationCallback
+ );
+
+ /** constructs the instance from a <type scope="com::sun::star::form">XFormController<type> instance
+
+ @param _rxORB
+ a multi service factory for creating various needed components
+
+ @param _rxController
+ The form controller which the helper should be responsible for. Must not
+ be <NULL/>, and must have a valid model (form).
+
+ @param _pInvalidationCallback
+ the callback for invalidating feature states
+ */
+ ControllerFeatures(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormController >& _rxController,
+ IControllerFeatureInvalidation* _pInvalidationCallback
+ );
+
+ /** constructs the helper form a <type scope="com::sun::star::form">XForm<type> instance
+
+ Any functionality which depends on a controller will not be available.
+
+ @param _rxORB
+ a multi service factory for creating various needed components
+
+ @param _rxForm
+ The form which the helper should be responsible for. Must not be <NULL/>.
+
+ @param _pInvalidationCallback
+ the callback for invalidating feature states
+ */
+ ControllerFeatures(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >& _rxForm,
+ IControllerFeatureInvalidation* _pInvalidationCallback
+ );
+
+ /// dtor
+ ~ControllerFeatures();
+
+ /// checks whether the instance is properly assigned to a form and/or controller
+ inline bool isAssigned( ) const { return m_pImpl != NULL; }
+
+ /** assign to a controller
+ */
+ void assign(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormController >& _rxController
+ );
+
+ /** assign to a controller
+ */
+ void assign(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >& _rxForm
+ );
+
+ /// clears the instance so that it cannot be used afterwards
+ void dispose();
+
+ // access to the instance which implements the functionality. Not to be used when not assigned
+ inline const FormControllerHelper* operator->() const { return m_pImpl; }
+ inline FormControllerHelper* operator->() { return m_pImpl; }
+ inline const FormControllerHelper& operator*() const { return *m_pImpl; }
+ inline FormControllerHelper& operator*() { return *m_pImpl; }
+ };
+
+ //====================================================================
+ //= FormControllerHelper
+ //====================================================================
+ typedef ::cppu::WeakImplHelper2 < ::com::sun::star::form::runtime::XFeatureInvalidation
+ , ::com::sun::star::sdb::XSQLErrorListener
+ > FormControllerHelper_Base;
+ /** is a helper class which manages form controller functionality (such as moveNext etc.).
+
+ <p>The class helps implementing form controller functionality, by providing
+ methods to determine the state of, and execute, various common form features.<br/>
+ A <em>feature</em> is for instance moving the form associated with the controller
+ to a certain position, or reloading the form, and so on.</p>
+ */
+ class FormControllerHelper : public FormControllerHelper_Base
+ {
+ protected:
+ ::comphelper::ComponentContext m_aContext;
+ IControllerFeatureInvalidation* m_pInvalidationCallback;
+ ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormOperations >
+ m_xFormOperations;
+
+ ::com::sun::star::uno::Any m_aOperationError;
+
+ public:
+ /** constructs the helper from a <type scope="com::sun::star::form">XFormController<type> instance
+
+ @param _rContext
+ the context the component lives in
+ @param _rxController
+ The form controller which the helper should be responsible for. Must not
+ be <NULL/>, and must have a valid model (form).
+ @param _pInvalidationCallback
+ the callback for invalidating feature states
+ */
+ FormControllerHelper(
+ const ::comphelper::ComponentContext& _rContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormController >& _rxController,
+ IControllerFeatureInvalidation* _pInvalidationCallback
+ );
+
+ /** constructs the helper form a <type scope="com::sun::star::form">XForm<type> instance
+
+ Any functionality which depends on a controller will not be available.
+
+ @param _rContext
+ the context the component lives in
+ @param _rxForm
+ The form which the helper should be responsible for. Must not be <NULL/>.
+ @param _pInvalidationCallback
+ the callback for invalidating feature states
+ */
+ FormControllerHelper(
+ const ::comphelper::ComponentContext& _rContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >& _rxForm,
+ IControllerFeatureInvalidation* _pInvalidationCallback
+ );
+
+ // forwards to the XFormOperations implementation
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >
+ getCursor() const;
+ void getState(
+ sal_Int32 _nSlotId,
+ ::com::sun::star::form::runtime::FeatureState& _out_rState
+ ) const;
+ sal_Bool isEnabled( sal_Int32 _nSlotId ) const;
+ void execute( sal_Int32 _nSlotId ) const;
+ void execute( sal_Int32 _nSlotId, const ::rtl::OUString& _rParamName, const ::com::sun::star::uno::Any& _rParamValue ) const;
+ sal_Bool commitCurrentRecord() const;
+ sal_Bool commitCurrentControl( ) const;
+ sal_Bool isInsertionRow() const;
+ sal_Bool isModifiedRow() const;
+
+ bool moveLeft( ) const;
+ bool moveRight( ) const;
+
+ bool canDoFormFilter() const;
+
+ /** disposes this instance.
+
+ After this method has been called, the instance is not functional anymore
+ */
+ void dispose();
+
+ const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormOperations >&
+ getFormOperations() const { return m_xFormOperations; }
+ protected:
+ /// dtor
+ ~FormControllerHelper();
+
+ // XFeatureInvalidation
+ virtual void SAL_CALL invalidateFeatures( const ::com::sun::star::uno::Sequence< ::sal_Int16 >& Features ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL invalidateAllFeatures() throw (::com::sun::star::uno::RuntimeException);
+
+ // XSQLErrorListener
+ virtual void SAL_CALL errorOccured( const ::com::sun::star::sdb::SQLErrorEvent& _Event ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+
+ private:
+ enum FormOperation { EXECUTE, EXECUTE_ARGS, COMMIT_CONTROL, COMMIT_RECORD };
+
+ bool impl_operateForm_nothrow(
+ const FormOperation _eWhat,
+ const sal_Int16 _nFeature, /* ignore for COMMIT_* */
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& _rArguments /* ignore except for EXECUTE_ARGS */
+ ) const;
+ bool impl_operateForm_nothrow( const FormOperation _eWhat ) const
+ {
+ return impl_operateForm_nothrow( _eWhat, 0, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >() );
+ }
+ bool impl_operateForm_nothrow( const sal_Int16 _nFeature ) const
+ {
+ return impl_operateForm_nothrow( EXECUTE, _nFeature, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >() );
+ }
+
+ private:
+ FormControllerHelper(); // never implemented
+ FormControllerHelper( const FormControllerHelper& ); // never implemented
+ FormControllerHelper& operator=( const FormControllerHelper& ); // never implemented
+ };
+
+//........................................................................
+} // namespace svx
+//........................................................................
+
+#endif // SVX_FORMCONTROLLING_HXX
diff --git a/svx/source/outliner/outlobj.cxx b/svx/source/outliner/outlobj.cxx
index 728c6b9..bdcbcf8 100644
--- a/svx/source/outliner/outlobj.cxx
+++ b/svx/source/outliner/outlobj.cxx
@@ -61,7 +61,7 @@ public:
mbIsEditDoc(bIsEditDoc),
mnRefCount(0)
{
- if( (maParagraphDataVector.size() == 0) && (pEditTextObject->GetParagraphCount() != 0) )
+ if( (maParagraphDataVector.size() == 0) && (pEditTextObject->GetParagraphCount() != 0) )
maParagraphDataVector.resize(pEditTextObject->GetParagraphCount());
}
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index a2fecc2..9942aaf 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -1478,48 +1478,48 @@ void SdrOle2Obj::SetClosedObj( bool bIsClosed )
// -----------------------------------------------------------------------------
-SdrObject* SdrOle2Obj::getFullDragClone() const
-{
- // special handling for OLE. The default handling works, but is too
- // slow when the whole OLE needs to be cloned. Get the Metafile and
- // create a graphic object with it
- Graphic* pOLEGraphic = GetGraphic();
- SdrObject* pClone = 0;
-
- if(Application::GetSettings().GetStyleSettings().GetHighContrastMode())
- {
- pOLEGraphic = getEmbeddedObjectRef().GetHCGraphic();
- }
-
- if(pOLEGraphic)
- {
- pClone = new SdrGrafObj(*pOLEGraphic, GetSnapRect());
-
- // this would be the place where to copy all attributes
- // when OLE will support fill and line style
- // pClone->SetMergedItem(pOleObject->GetMergedItemSet());
- }
- else
- {
- // #i100710# pOLEGraphic may be zero (no visualisation available),
- // so we need to use the OLE replacement graphic
- pClone = new SdrRectObj(GetSnapRect());
-
- // gray outline
- pClone->SetMergedItem(XLineStyleItem(XLINE_SOLID));
- const svtools::ColorConfig aColorConfig;
- const svtools::ColorConfigValue aColor(aColorConfig.GetColorValue(svtools::OBJECTBOUNDARIES));
- pClone->SetMergedItem(XLineColorItem(String(), aColor.nColor));
-
- // bitmap fill
- pClone->SetMergedItem(XFillStyleItem(XFILL_BITMAP));
- pClone->SetMergedItem(XFillBitmapItem(String(), GetEmtyOLEReplacementBitmap()));
- pClone->SetMergedItem(XFillBmpTileItem(false));
- pClone->SetMergedItem(XFillBmpStretchItem(false));
- }
-
- return pClone;
-}
+SdrObject* SdrOle2Obj::getFullDragClone() const
+{
+ // special handling for OLE. The default handling works, but is too
+ // slow when the whole OLE needs to be cloned. Get the Metafile and
+ // create a graphic object with it
+ Graphic* pOLEGraphic = GetGraphic();
+ SdrObject* pClone = 0;
+
+ if(Application::GetSettings().GetStyleSettings().GetHighContrastMode())
+ {
+ pOLEGraphic = getEmbeddedObjectRef().GetHCGraphic();
+ }
+
+ if(pOLEGraphic)
+ {
+ pClone = new SdrGrafObj(*pOLEGraphic, GetSnapRect());
+
+ // this would be the place where to copy all attributes
+ // when OLE will support fill and line style
+ // pClone->SetMergedItem(pOleObject->GetMergedItemSet());
+ }
+ else
+ {
+ // #i100710# pOLEGraphic may be zero (no visualisation available),
+ // so we need to use the OLE replacement graphic
+ pClone = new SdrRectObj(GetSnapRect());
+
+ // gray outline
+ pClone->SetMergedItem(XLineStyleItem(XLINE_SOLID));
+ const svtools::ColorConfig aColorConfig;
+ const svtools::ColorConfigValue aColor(aColorConfig.GetColorValue(svtools::OBJECTBOUNDARIES));
+ pClone->SetMergedItem(XLineColorItem(String(), aColor.nColor));
+
+ // bitmap fill
+ pClone->SetMergedItem(XFillStyleItem(XFILL_BITMAP));
+ pClone->SetMergedItem(XFillBitmapItem(String(), GetEmtyOLEReplacementBitmap()));
+ pClone->SetMergedItem(XFillBmpTileItem(false));
+ pClone->SetMergedItem(XFillBmpStretchItem(false));
+ }
+
+ return pClone;
+}
// -----------------------------------------------------------------------------
commit 807fa686e6e3edaf63bc8f542a6eae88b2295ae3
Author: Jens-Heiner Rechtien <hr at openoffice.org>
Date: Tue May 19 09:32:45 2009 +0000
CWS-TOOLING: integrate CWS impress169
2009-05-13 17:37:21 +0200 sj r271865 : #i100942# applied patch, removed oversafe buffer check (now without warnings on 64 bit platform)
2009-05-13 12:27:18 +0200 sj r271855 : #i101769# fixed line/fill attributes for graphic objects
2009-05-12 10:25:17 +0200 cl r271799 : report correct minimum cell hight for empty cells
2009-04-28 17:29:46 +0200 cl r271334 : fixed merge error
2009-04-28 16:18:01 +0200 cl r271330 : fixed build error
2009-04-28 12:38:09 +0200 cl r271320 : #i100129# images for new layouts
2009-04-27 19:12:06 +0200 cl r271302 : CWS-TOOLING: rebase CWS impress169 to trunk at 270723 (milestone: DEV300:m46)
2009-04-20 19:13:28 +0200 sj r271012 : #i100942# applied patch, removed oversafe buffer check
2009-04-09 18:00:01 +0200 sj r270719 : #158488# added rectangular gradient support
2009-04-09 17:49:52 +0200 sj r270718 : #158488# added rectangular gradient support
2009-04-09 17:46:24 +0200 sj r270717 : #158488# added rectangular gradient support
2009-03-26 18:16:34 +0100 cl r270098 : #i99867# applied patch from jlcheng to correctly register table design pane
2009-03-26 18:12:11 +0100 cl r270097 : #i100220# leave some items default so they are not overridden if a new table style is set
2009-03-26 18:11:10 +0100 cl r270096 : #i100220# clear only those items that are also in the style when assigning a new table layout
2009-03-26 15:56:24 +0100 cl r270085 : #i99977# listen to outliner and dispose if outliner dies
2009-03-26 15:47:29 +0100 cl r270084 : #i99977# made the Outliner a SfxBroadcaster so others can listen for its death
2009-03-24 19:10:05 +0100 sj r269991 : #i100490# fixed text resize problem
2009-03-23 14:31:11 +0100 sj r269872 : #i96083# added patch, (dubious && and ||)
2009-03-19 17:55:11 +0100 sj r269764 : #i100275# applied patch, row height is now correct even for rows containing no text
2009-03-18 18:10:52 +0100 sj r269701 : #i93616# solved performance problem when loading document
2009-03-18 16:20:40 +0100 sj r269688 : removing unused code
2009-03-18 16:19:22 +0100 sj r269687 : removing unused code
2009-03-18 16:17:54 +0100 sj r269686 : removing unused code
2009-03-18 10:28:07 +0100 cl r269643 : #i100029# let cells be disposed as soon as the table model is disposed
2009-03-17 15:56:50 +0100 cl r269614 : #i99984# new impress photo layouts 3x2 and 2x2
2009-03-17 15:36:35 +0100 cl r269611 : #i99984# adding new impress photo layouts 3x2 and 2x2
2009-03-16 18:43:48 +0100 cl r269564 : #i55224# correct internal links if pages are changed
2009-03-16 16:40:38 +0100 cl r269559 : #i55224# correct internal hyperlinks if slides are changed/renamed
2009-03-16 15:34:12 +0100 cl r269553 : #i99427# invalidate slots after promote/demote
2009-03-13 18:18:20 +0100 sj r269492 : #i92421# fixed loop if loading encrypted ppt file
2009-03-13 14:51:58 +0100 sj r269481 : #i93002# fixed crash if saving presentation without master title placeholder
2009-03-13 12:26:21 +0100 sj r269468 : #i100147# do not exceed the max point count if creating simple polygon via ::GetSimple
2009-03-12 17:00:45 +0100 sj r269427 : #i82518# justifying rectangles for arc/pie and chord actions, fixed round rectangle problem
diff --git a/svx/inc/svx/msdffdef.hxx b/svx/inc/svx/msdffdef.hxx
index 5aafb8c..4205b23 100644
--- a/svx/inc/svx/msdffdef.hxx
+++ b/svx/inc/svx/msdffdef.hxx
@@ -1284,6 +1284,7 @@ class SVX_DLLPUBLIC DffPropSet : public Table
class SfxItemSet;
class SdrObject;
+struct DffObjData;
class SVX_DLLPUBLIC DffPropertyReader : public DffPropSet
{
@@ -1292,9 +1293,9 @@ class SVX_DLLPUBLIC DffPropertyReader : public DffPropSet
void ApplyCustomShapeTextAttributes( SfxItemSet& rSet ) const;
void ApplyCustomShapeAdjustmentAttributes( SfxItemSet& rSet ) const;
- void ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxItemSet& rSet, const MSO_SPT eShapeType, const sal_uInt32 nShapeFlags ) 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 MSO_SPT eShapeType ) const;
+ void ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, const DffObjData& rObjData ) const;
public:
@@ -1311,7 +1312,8 @@ public:
#endif
void SetDefaultPropSet( SvStream& rIn, UINT32 nOffDgg ) const;
- void ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, const MSO_SPT = mso_sptNil, const sal_uInt32 nShapeFlags = 0 ) const;
+ void ApplyAttributes( SvStream& rIn, SfxItemSet& rSet ) const;
+ void ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, const DffObjData& rObjData ) const;
};
#endif
diff --git a/svx/inc/svx/msdffimp.hxx b/svx/inc/svx/msdffimp.hxx
index 9168c2a..4feaead 100644
--- a/svx/inc/svx/msdffimp.hxx
+++ b/svx/inc/svx/msdffimp.hxx
@@ -96,7 +96,6 @@ SV_DECL_PTRARR_SORT_VISIBILITY(SvxMSDffShapeTxBxSort, SvxMSDffShapeOrder_Ptr, 16
#define SVXMSDFF_SETTINGS_CROP_BITMAPS 1
#define SVXMSDFF_SETTINGS_IMPORT_PPT 2
#define SVXMSDFF_SETTINGS_IMPORT_EXCEL 4
-#define SVXMSDFF_SETTINGS_IMPORT_IAS 8
#define SP_FGROUP 0x001 // This shape is a group shape
#define SP_FCHILD 0x002 // Not a top-level shape
@@ -251,10 +250,10 @@ struct SvxMSDffImportData
struct DffObjData
{
- Rectangle aChildAnchor;
-
const DffRecordHeader& rSpHd;
- Rectangle& rBoundRect;
+
+ Rectangle aBoundRect;
+ Rectangle aChildAnchor;
UINT32 nShapeId;
UINT32 nSpFlags;
@@ -270,10 +269,18 @@ struct DffObjData
int nCalledByGroup;
DffObjData( const DffRecordHeader& rObjHd,
- Rectangle& rBdRect,
- int nClByGroup ) :
+ const Rectangle& rBoundRect,
+ int nClByGroup ) :
rSpHd( rObjHd ),
- rBoundRect( rBdRect ),
+ aBoundRect( rBoundRect ),
+ nShapeId( 0 ),
+ nSpFlags( 0 ),
+ eShapeType( mso_sptNil ),
+ bShapeType( FALSE ),
+ bClientAnchor( FALSE ),
+ bClientData( FALSE ),
+ bChildAnchor( FALSE ),
+ bOpt( FALSE ),
bIsAutoText( FALSE ),
nCalledByGroup( nClByGroup ){}
};
@@ -405,7 +412,7 @@ protected :
FASTBOOL ReadGraphic( SvStream& rSt, ULONG nIndex, Graphic& rGraphic ) const;
SdrObject* ImportFontWork( SvStream&, SfxItemSet&, Rectangle& rBoundRect ) const;
- SdrObject* ImportGraphic( SvStream&, SfxItemSet&, Rectangle& rBoundRect, const DffObjData& ) const;
+ SdrObject* ImportGraphic( SvStream&, SfxItemSet&, const DffObjData& ) const;
// --> OD 2004-12-14 #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.
diff --git a/svx/inc/svx/outliner.hxx b/svx/inc/svx/outliner.hxx
index 33818cc..23ed526 100644
--- a/svx/inc/svx/outliner.hxx
+++ b/svx/inc/svx/outliner.hxx
@@ -33,22 +33,19 @@
#include <tools/gen.hxx>
#include <tools/string.hxx>
#include <tools/debug.hxx>
-#ifndef _EDITDATA_HXX //autogen
+
+#include <svtools/brdcst.hxx>
+
#include <svx/editdata.hxx>
-#endif
#include <i18npool/lang.h>
-#ifndef _SV_COLOR_HXX //autogen
#include <tools/color.hxx>
-#endif
#include <vcl/graph.hxx>
#include <tools/list.hxx>
#include <tools/link.hxx>
#include <rsc/rscsfx.hxx>
#include "svx/svxdllapi.h"
-#ifndef _GRFMGR_HXX
#include <goodies/grfmgr.hxx>
-#endif
#include <tools/rtti.hxx> // wegen typedef TypeId
#include <vector>
@@ -585,7 +582,7 @@ struct EBulletInfo
#define OUTLINERMODE_SUBTITLE (0x0100|OUTLINERMODE_TEXTOBJECT)
#define OUTLINERMODE_NOTE (0x0200|OUTLINERMODE_TEXTOBJECT)
-class SVX_DLLPUBLIC Outliner
+class SVX_DLLPUBLIC Outliner : public SfxBroadcaster
{
friend class OutlinerView;
friend class OutlinerEditEng;
diff --git a/svx/source/msfilter/makefile.mk b/svx/source/msfilter/makefile.mk
index bc246ea..85c120f 100644
--- a/svx/source/msfilter/makefile.mk
+++ b/svx/source/msfilter/makefile.mk
@@ -49,10 +49,8 @@ SLOFILES=\
$(SLO)$/msdffimp.obj \
$(SLO)$/msoleexp.obj \
$(SLO)$/msvbasic.obj \
- $(SLO)$/msashape.obj \
$(SLO)$/svxmsbas.obj \
$(SLO)$/msocximex.obj \
- $(SLO)$/msashape3d.obj \
$(SLO)$/mscodec.obj \
$(SLO)$/msfiltertracer.obj
@@ -60,7 +58,6 @@ EXCEPTIONSFILES= \
$(SLO)$/eschesdo.obj \
$(SLO)$/escherex.obj \
$(SLO)$/msdffimp.obj \
- $(SLO)$/msashape3d.obj \
$(SLO)$/msvbasic.obj \
$(SLO)$/msocximex.obj \
$(SLO)$/msoleexp.obj \
diff --git a/svx/source/msfilter/msashape.cxx b/svx/source/msfilter/msashape.cxx
deleted file mode 100644
index 8a9d37c..0000000
--- a/svx/source/msfilter/msashape.cxx
+++ /dev/null
@@ -1,6536 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: msashape.cxx,v $
- * $Revision: 1.44 $
- *
- * 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): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#include <osl/endian.h>
-#include <msashape.hxx>
-#include <svx/svdocirc.hxx>
-#include <svx/svdogrp.hxx>
-#include <svx/svdopath.hxx>
-#include <svx/svdpage.hxx>
-#include <svx/xflclit.hxx>
-#include <svx/sdasaitm.hxx>
-#include <svtools/itemset.hxx>
-#include <svx/svdmodel.hxx>
-#include <rtl/crc.h>
-#include <svx/xlnstit.hxx>
-#include <svx/xlnedit.hxx>
-#include <svx/xlnstwit.hxx>
-#include <svx/xlnedwit.hxx>
-#include <svx/xlnstcit.hxx>
-#include <svx/xlnedcit.hxx>
-
-#include <math.h>
-#include <basegfx/polygon/b2dpolypolygon.hxx>
-#include <basegfx/polygon/b2dpolygon.hxx>
-
-struct SvxMSDffVertPair
-{
- sal_Int32 nValA;
- sal_Int32 nValB;
-};
-struct SvxMSDffCalculationData
-{
- sal_uInt16 nFlags;
- sal_Int16 nVal1;
- sal_Int16 nVal2;
- sal_Int16 nVal3;
-};
-struct SvxMSDffTextRectangles
-{
- SvxMSDffVertPair nPairA;
- SvxMSDffVertPair nPairB;
-};
-
-struct mso_CustomShape
-{
- SvxMSDffVertPair* pVertices;
- sal_uInt32 nVertices;
- sal_uInt16* pElements;
- sal_uInt32 nElements;
- SvxMSDffCalculationData* pCalculation;
- sal_uInt32 nCalculation;
- sal_Int32* pDefData;
- SvxMSDffTextRectangles* pTextRect;
- sal_uInt32 nTextRect;
- sal_Int32 nCoordWidth;
- sal_Int32 nCoordHeight;
- sal_Int32 nXRef;
- sal_Int32 nYRef;
- SvxMSDffVertPair* pGluePoints;
- sal_uInt32 nGluePoints;
-};
-
-#define GEOMETRY_USED_LEFT 1
-#define GEOMETRY_USED_TOP 2
-#define GEOMETRY_USED_RIGHT 4
-#define GEOMETRY_USED_BOTTOM 8
-
-/*
-static const SvxMSDffVertPair Vert[] =
-{
- { 0, 0, }
-};
-static const sal_uInt16 Segm[] =
-{
- 0x4000,
- 0x8000
-};
-static const SvxMSDffCalculationData Calc[] =
-{
- { 0x0000, 0, 0, 0 }
-};
-static const sal_Int32 Default[] =
-{
- 0
-};
-static const SvxMSDffTextRect TextRect[] =
-{
- { { 0, 0 }, { 0, 0 } }
-};
-static const sal_Int32 BoundRect[] =
-{
- 0, 0, 21600, 21600
-};
-static const mso_CustomShape mso =
-{
- (SvxMSDffVertPair*)mso_sptVert, sizeof( mso_sptVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptSegm, sizeof( mso_sptSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptCalc, sizeof( mso_sptCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault,
- (SvxMSDffTextRectangles*)mso_sptTextRect, sizeof( mso_sptTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptVert, sizeof( mso_sptVert ) / sizeof( SvxMSDffVertPair )
-};
-*/
-
-#define MSO_I | (sal_Int32)0x80000000
-
-static const sal_Int32 mso_sptDefault0[] =
-{
- 1, 0
-};
-static const sal_Int32 mso_sptDefault1400[] =
-{
- 1, 1400
-};
-static const sal_Int32 mso_sptDefault1800[] =
-{
- 1, 1800
-};
-static const sal_Int32 mso_sptDefault2500[] =
-{
- 1, 2500
-};
-static const sal_Int32 mso_sptDefault2700[] =
-{
- 1, 2700
-};
-static const sal_Int32 mso_sptDefault3600[] =
-{
- 1, 3600
-};
-static const sal_Int32 mso_sptDefault3700[] =
-{
- 1, 3700
-};
-static const sal_Int32 mso_sptDefault5400[] =
-{
- 1, 5400
-};
-static const sal_Int32 mso_sptDefault8100[] =
-{
- 1, 5400
-};
-static const sal_Int32 mso_sptDefault10800[] =
-{
- 1, 10800
-};
-static const sal_Int32 mso_sptDefault16200and5400[] =
-{
- 2, 16200, 5400
-};
-
-static const sal_Int32 mso_sptArcDefault[] =
-{
- 2, 270 << 16, 0
-};
-static const SvxMSDffVertPair mso_sptStandardGluePoints[] =
-{
- { 10800, 0 }, { 0, 10800 }, { 10800, 21600 }, { 21600, 10800 }
-};
-static const mso_CustomShape msoArc =
-{
- NULL, 0,
- NULL, 0,
- NULL, 0,
- (sal_Int32*)mso_sptArcDefault,
- NULL, 0,
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const mso_CustomShape msoRectangle =
-{
- NULL, 0,
- NULL, 0,
- NULL, 0,
- NULL,
- NULL, 0,
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffCalculationData mso_sptRoundRectangleCalc[] = // adjustment1 : 0 - 10800
-{
- { 0x2001, DFF_Prop_adjustValue, 1, 3 },
- { 0xa000, DFF_Prop_geoRight, 0, 0x400},
- { 0xa000, DFF_Prop_geoBottom, 0, 0x400},
- { 0x6000, DFF_Prop_geoLeft, 0x400, 0 },
- { 0x6000, DFF_Prop_geoTop, 0x400, 0 }
-};
-static const SvxMSDffTextRectangles mso_sptRoundRectangleTextRect[] =
-{
- { { 3 MSO_I, 4 MSO_I }, { 1 MSO_I, 2 MSO_I } }
-};
-static const mso_CustomShape msoRoundRectangle =
-{
- NULL, 0,
- NULL, 0,
- (SvxMSDffCalculationData*)mso_sptRoundRectangleCalc, sizeof( mso_sptRoundRectangleCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault3600,
- (SvxMSDffTextRectangles*)mso_sptRoundRectangleTextRect, sizeof( mso_sptRoundRectangleTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptRightTriangleVert[] =
-{
- { 0, 0 }, { 21600, 21600 }, { 0, 21600 }, { 0, 0 }
-};
-static const SvxMSDffTextRectangles mso_sptRightTriangleTextRect[] =
-{
- { { 1900, 12700 }, { 12700, 19700 } }
-};
-static const SvxMSDffVertPair mso_sptRightTriangleGluePoints[] =
-{
- { 10800, 0 }, { 5400, 10800 }, { 0, 21600 }, { 10800, 21600 }, { 21600, 21600 }, { 16200, 10800 }
-};
-static const mso_CustomShape msoRightTriangle =
-{
- (SvxMSDffVertPair*)mso_sptRightTriangleVert, sizeof( mso_sptRightTriangleVert ) / sizeof( SvxMSDffVertPair ),
- NULL, 0,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptRightTriangleTextRect, sizeof( mso_sptRightTriangleTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptRightTriangleGluePoints, sizeof( mso_sptRightTriangleGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffTextRectangles mso_sptEllipseTextRect[] =
-{
- { { 3200, 3200 }, { 18400, 18400 } }
-};
-static const SvxMSDffVertPair mso_sptEllipseGluePoints[] =
-{
- { 10800, 0 }, { 3160, 3160 }, { 0, 10800 }, { 3160, 18440 }, { 10800, 21600 }, { 18440, 18440 }, { 21600, 10800 }, { 18440, 3160 }
-};
-static const mso_CustomShape msoEllipse =
-{
- NULL, 0,
- NULL, 0,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptEllipseTextRect, sizeof( mso_sptEllipseTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptEllipseGluePoints, sizeof( mso_sptEllipseGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptParallelogramVert[] = // adjustment1 : 0 - 21600
-{
- { 0 MSO_I, 0 }, { 21600, 0 }, { 1 MSO_I, 21600 }, { 0, 21600 }
-};
-static const sal_uInt16 mso_sptParallelogramSegm[] =
-{
- 0x4000, 0x0003, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptParallelogramCalc[] =
-{
- { 0x4000, 0, DFF_Prop_adjustValue, 0 },
- { 0x8000, 0, 21600, DFF_Prop_adjustValue },
- { 0x2001, DFF_Prop_adjustValue, 10, 24 },
- { 0x2000, 0x0402, 1750, 0 },
- { 0x8000, 21600, 0, 0x0403 },
- { 0x2001, 0x400, 1, 2 },
- { 0x4000, 10800, 0x405, 0 },
- { 0x2000, 0x400, 0, 10800 },
- { 0x6006, 0x407, 0x40d, 0 },
- { 0x8000, 10800, 0, 0x405 },
- { 0x6006, 0x407, 0x40c, 21600 },
- { 0x8000, 21600, 0, 0x405 },
- { 0x8001, 21600, 10800, 0x400 },
- { 0x8000, 21600, 0, 0x40c }
-};
-static const SvxMSDffTextRectangles mso_sptParallelogramTextRect[] =
-{
- { { 3 MSO_I, 3 MSO_I }, { 4 MSO_I, 4 MSO_I } }
-};
-static const SvxMSDffVertPair mso_sptParallelogramGluePoints[] =
-{
- { 6 MSO_I, 0 }, { 10800, 8 MSO_I }, { 11 MSO_I, 10800 }, { 9 MSO_I, 21600 }, { 10800, 10 MSO_I }, { 5 MSO_I, 10800 }
-};
-static const mso_CustomShape msoParallelogram =
-{
- (SvxMSDffVertPair*)mso_sptParallelogramVert, sizeof( mso_sptParallelogramVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptParallelogramSegm, sizeof( mso_sptParallelogramSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptParallelogramCalc, sizeof( mso_sptParallelogramCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault5400,
- (SvxMSDffTextRectangles*)mso_sptParallelogramTextRect, sizeof( mso_sptParallelogramTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptParallelogramGluePoints, sizeof( mso_sptParallelogramGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptDiamondVert[] =
-{
- { 10800, 0 }, { 21600, 10800 }, { 10800, 21600 }, { 0, 10800 }, { 10800, 0 }
-};
-static const SvxMSDffTextRectangles mso_sptDiamondTextRect[] =
-{
- { { 5400, 5400 }, { 16200, 16200 } }
-};
-static const mso_CustomShape msoDiamond =
-{
- (SvxMSDffVertPair*)mso_sptDiamondVert, sizeof( mso_sptDiamondVert ) / sizeof( SvxMSDffVertPair ),
- NULL, 0,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptDiamondTextRect, sizeof( mso_sptDiamondTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptStandardGluePoints, sizeof( mso_sptStandardGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptTrapezoidVert[] = // adjustment1 : 0 - 10800
-{
- { 0, 0 }, { 21600, 0 }, {0 MSO_I, 21600 }, { 1 MSO_I, 21600 }
-};
-static const sal_uInt16 mso_sptTrapezoidSegm[] =
-{
- 0x4000, 0x0003, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptTrapezoidCalc[] =
-{
- { 0x8000, 21600, 0, DFF_Prop_adjustValue },
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x2001, DFF_Prop_adjustValue, 10, 18 },
- { 0x2000, 0x0402, 1750, 0 },
- { 0x8000, 21600, 0, 0x403 },
- { 0x2001, DFF_Prop_adjustValue, 1, 2 },
- { 0x8000, 21600, 0, 0x405 }
-};
-static const SvxMSDffTextRectangles mso_sptTrapezoidTextRect[] =
-{
- { { 3 MSO_I, 3 MSO_I }, { 4 MSO_I, 4 MSO_I } }
-};
-static const SvxMSDffVertPair mso_sptTrapezoidGluePoints[] =
-{
- { 6 MSO_I, 10800 }, { 10800, 21600 }, { 5 MSO_I, 10800 }, { 10800, 0 }
-};
-static const mso_CustomShape msoTrapezoid =
-{
- (SvxMSDffVertPair*)mso_sptTrapezoidVert, sizeof( mso_sptTrapezoidVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptTrapezoidSegm, sizeof( mso_sptTrapezoidSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptTrapezoidCalc, sizeof( mso_sptTrapezoidCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault5400,
- (SvxMSDffTextRectangles*)mso_sptTrapezoidTextRect, sizeof( mso_sptTrapezoidTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptTrapezoidGluePoints, sizeof( mso_sptTrapezoidGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptOctagonVert[] = // adjustment1 : 0 - 10800
-{
- { 0 MSO_I, 0 }, { 2 MSO_I, 0 }, { 21600, 1 MSO_I }, { 21600, 3 MSO_I },
- { 2 MSO_I, 21600 }, { 0 MSO_I, 21600 }, { 0, 3 MSO_I }, { 0, 1 MSO_I }
-};
-static const sal_uInt16 mso_sptOctagonSegm[] =
-{
- 0x4000, 0x0007, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptOctagonCalc[] =
-{
- { 0x6000, DFF_Prop_geoLeft, DFF_Prop_adjustValue, 0 },
- { 0x6000, DFF_Prop_geoTop, DFF_Prop_adjustValue, 0 },
- { 0xa000, DFF_Prop_geoRight, 0, DFF_Prop_adjustValue },
- { 0xa000, DFF_Prop_geoBottom, 0, DFF_Prop_adjustValue },
- { 0x2001, DFF_Prop_adjustValue, 1, 2 },
- { 0x6000, DFF_Prop_geoLeft, 0x404, 0 },
- { 0x6000, DFF_Prop_geoTop, 0x404, 0 },
- { 0xa000, DFF_Prop_geoRight, 0, 0x404 },
- { 0xa000, DFF_Prop_geoBottom, 0, 0x404 }
-};
-static const sal_Int32 mso_sptOctagonDefault[] =
-{
- 1, 5000
-};
-static const SvxMSDffTextRectangles mso_sptOctagonTextRect[] =
-{
- { { 5 MSO_I, 6 MSO_I }, { 7 MSO_I, 8 MSO_I } }
-};
-static const mso_CustomShape msoOctagon =
-{
- (SvxMSDffVertPair*)mso_sptOctagonVert, sizeof( mso_sptOctagonVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptOctagonSegm, sizeof( mso_sptOctagonSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptOctagonCalc, sizeof( mso_sptOctagonCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptOctagonDefault,
- (SvxMSDffTextRectangles*)mso_sptOctagonTextRect, sizeof( mso_sptOctagonTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptStandardGluePoints, sizeof( mso_sptStandardGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptIsocelesTriangleVert[] = // adjustment1 : 0 - 21600
-{
- { 0 MSO_I, 0 }, { 21600, 21600 }, { 0, 21600 }
-};
-static const sal_uInt16 mso_sptIsocelesTriangleSegm[] =
-{
- 0x4000, 0x0002, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptIsocelesTriangleCalc[] =
-{
- { 0x4000, 0, DFF_Prop_adjustValue, 0 },
- { 0x2001, DFF_Prop_adjustValue, 1, 2 },
- { 0x2000, 0x401, 10800, 0 },
- { 0x2001, DFF_Prop_adjustValue, 2, 3 },
- { 0x2000, 0x403, 7200, 0 },
- { 0x8000, 21600, 0, 0x400 },
- { 0x2001, 0x405, 1, 2 },
- { 0x8000, 21600, 0, 0x406 }
-};
-static const SvxMSDffTextRectangles mso_sptIsocelesTriangleTextRect[] =
-{
- { { 1 MSO_I, 10800 }, { 2 MSO_I, 18000 } },
- { { 3 MSO_I, 7200 }, { 4 MSO_I, 21600 } }
-};
-static const SvxMSDffVertPair mso_sptIsocelesTriangleGluePoints[] =
-{
- { 10800, 0 }, { 1 MSO_I, 10800 }, { 0, 21600 }, { 10800, 21600 }, { 21600, 21600 }, { 7 MSO_I, 10800 }
-};
-static const mso_CustomShape msoIsocelesTriangle =
-{
- (SvxMSDffVertPair*)mso_sptIsocelesTriangleVert, sizeof( mso_sptIsocelesTriangleVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptIsocelesTriangleSegm, sizeof( mso_sptIsocelesTriangleSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptIsocelesTriangleCalc, sizeof( mso_sptIsocelesTriangleCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault10800,
- (SvxMSDffTextRectangles*)mso_sptIsocelesTriangleTextRect, sizeof( mso_sptIsocelesTriangleTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptIsocelesTriangleGluePoints, sizeof( mso_sptIsocelesTriangleGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptHexagonVert[] = // adjustment1 : 0 - 10800
-{
- { 0 MSO_I, 0 }, { 1 MSO_I, 0 }, { 21600, 10800 }, { 1 MSO_I, 21600 },
- { 0 MSO_I, 21600 }, { 0, 10800 }
-};
-static const sal_uInt16 mso_sptHexagonSegm[] =
-{
- 0x4000, 0x0005, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptHexagonCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x8000, 21600, 0, DFF_Prop_adjustValue },
- { 0x2001, DFF_Prop_adjustValue, 100, 234 },
- { 0x2000, 0x402, 1700, 0 },
- { 0x8000, 21600, 0, 0x403 }
-};
-static const SvxMSDffTextRectangles mso_sptHexagonTextRect[] =
-{
- { { 3 MSO_I, 3 MSO_I }, { 4 MSO_I, 4 MSO_I } }
-};
-static const mso_CustomShape msoHexagon =
-{
- (SvxMSDffVertPair*)mso_sptHexagonVert, sizeof( mso_sptHexagonVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptHexagonSegm, sizeof( mso_sptHexagonSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptHexagonCalc, sizeof( mso_sptHexagonCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault5400,
- (SvxMSDffTextRectangles*)mso_sptHexagonTextRect, sizeof( mso_sptHexagonTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptStandardGluePoints, sizeof( mso_sptStandardGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptPentagonVert[] =
-{
- { 10800, 0 }, { 0, 8260 }, { 4230, 21600 }, { 17370, 21600 },
- { 21600, 8260 }, { 10800, 0 }
-};
-static const SvxMSDffTextRectangles mso_sptPentagonTextRect[] =
-{
- { { 4230, 5080 }, { 17370, 21600 } }
-};
-static const SvxMSDffVertPair mso_sptPentagonGluePoints[] =
-{
- { 10800, 0 }, { 0, 8260 }, { 4230, 21600 }, { 10800, 21600 },
- { 17370, 21600 }, { 21600, 8260 }
-};
-static const mso_CustomShape msoPentagon =
-{
- (SvxMSDffVertPair*)mso_sptPentagonVert, sizeof( mso_sptPentagonVert ) / sizeof( SvxMSDffVertPair ),
- NULL, 0,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptPentagonTextRect, sizeof( mso_sptPentagonTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptPentagonGluePoints, sizeof( mso_sptPentagonGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptPlusVert[] = // adjustment1 : 0 - 10800
-{
- { 1 MSO_I, 0 }, { 2 MSO_I, 0 }, { 2 MSO_I, 1 MSO_I }, { 21600, 1 MSO_I },
- { 21600, 2 MSO_I }, { 2 MSO_I, 2 MSO_I }, { 2 MSO_I, 21600 }, { 1 MSO_I, 21600 },
- { 1 MSO_I, 2 MSO_I }, { 0, 2 MSO_I }, { 0, 1 MSO_I }, { 1 MSO_I, 1 MSO_I }, { 1 MSO_I, 0 }
-};
-static const SvxMSDffCalculationData mso_sptPlusCalc[] =
-{
- { 0x2001, DFF_Prop_adjustValue, 10799, 10800 },
- { 0x2000, 0x400, 0, 0 },
- { 0x8000, 21600, 0, 0x400 }
-};
-static const SvxMSDffTextRectangles mso_sptPlusTextRect[] =
-{
- { { 1 MSO_I, 1 MSO_I }, { 2 MSO_I, 2 MSO_I } }
-};
-static const mso_CustomShape msoPlus =
-{
- (SvxMSDffVertPair*)mso_sptPlusVert, sizeof( mso_sptPlusVert ) / sizeof( SvxMSDffVertPair ),
- NULL, 0,
- (SvxMSDffCalculationData*)mso_sptPlusCalc, sizeof( mso_sptPlusCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault5400,
- (SvxMSDffTextRectangles*)mso_sptPlusTextRect, sizeof( mso_sptPlusTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 10800, 10800,
- (SvxMSDffVertPair*)mso_sptStandardGluePoints, sizeof( mso_sptStandardGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptCanVert[] = // adjustment1 : 0 - 10800
-{
- { 44, 0 },
- { 20, 0 }, { 0, 2 MSO_I }, { 0, 0 MSO_I }, // ccp
- { 0, 3 MSO_I }, // p
- { 0, 4 MSO_I }, { 20, 10800 }, { 44, 10800 }, // ccp
- { 68, 10800 }, { 88, 4 MSO_I }, { 88, 3 MSO_I }, // ccp
- { 88, 0 MSO_I }, // p
- { 88, 2 MSO_I }, { 68, 0 }, { 44, 0 }, // ccp
- { 44, 0 }, // p
- { 20, 0 }, { 0, 2 MSO_I }, { 0, 0 MSO_I }, // ccp
- { 0, 5 MSO_I }, { 20, 6 MSO_I }, { 44, 6 MSO_I }, // ccp
- { 68, 6 MSO_I },{ 88, 5 MSO_I }, { 88, 0 MSO_I }, // ccp
- { 88, 2 MSO_I },{ 68, 0 }, { 44, 0 } // ccp
-};
-static const sal_uInt16 mso_sptCanSegm[] =
-{
- 0x4000, 0x2001, 0x0001, 0x2002, 0x0001, 0x2001, 0x6001, 0x8000,
- 0x4000, 0x2004, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptCanCalc[] =
-{
- { 0x2001, DFF_Prop_adjustValue, 1, 4 }, // 1/4
- { 0x2001, 0x0400, 6, 11 },
- { 0xa000, 0x0400, 0, 0x0401 },
- { 0x8000, 10800, 0, 0x0400 },
- { 0x6000, 0x0403, 0x0401, 0 },
- { 0x6000, 0x0400, 0x0401, 0 },
- { 0x2001, DFF_Prop_adjustValue, 1, 2 }
-};
-static const SvxMSDffTextRectangles mso_sptCanTextRect[] =
-{
- { { 0, 6 MSO_I }, { 88, 3 MSO_I } }
-};
-static const SvxMSDffVertPair mso_sptCanGluePoints[] =
-{
- { 44, 6 MSO_I }, { 44, 0 }, { 0, 5400 }, { 44, 10800 }, { 88, 5400 }
-};
-static const sal_Int32 mso_sptCanBoundRect[] =
-{
- 0, 0, 88, 10800
-};
-static const mso_CustomShape msoCan =
-{
- (SvxMSDffVertPair*)mso_sptCanVert, sizeof( mso_sptCanVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptCanSegm, sizeof( mso_sptCanSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptCanCalc, sizeof( mso_sptCanCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault5400,
- (SvxMSDffTextRectangles*)mso_sptCanTextRect, sizeof( mso_sptCanTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 88, 10800,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptCanGluePoints, sizeof( mso_sptCanGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptArrowVert[] = // adjustment1: x 0 - 21600
-{ // adjustment2: y 0 - 10800
- { 0, 0 MSO_I }, { 1 MSO_I, 0 MSO_I }, { 1 MSO_I, 0 }, { 21600, 10800 },
- { 1 MSO_I, 21600 }, { 1 MSO_I, 2 MSO_I }, { 0, 2 MSO_I }
-};
-static const sal_uInt16 mso_sptArrowSegm[] =
-{
- 0x4000, 0x0006, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptArrowCalc[] =
-{
- { 0x2000, DFF_Prop_adjust2Value, 0, 0 },
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x8000, 21600, 0, DFF_Prop_adjust2Value },
- { 0x8000, 21600, 0, 0x401 },
- { 0x6001, 0x403, 0x400, 10800 },
- { 0x6000, 0x401, 0x404, 0 },
- { 0x6001, 0x401, 0x400, 10800 },
- { 0xa000, 0x401, 0, 0x406 }
-};
-static const SvxMSDffTextRectangles mso_sptArrowTextRect[] =
-{
- { { 0, 0 MSO_I }, { 5 MSO_I, 2 MSO_I } }
-};
-static const mso_CustomShape msoArrow =
-{
- (SvxMSDffVertPair*)mso_sptArrowVert, sizeof( mso_sptArrowVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptArrowSegm, sizeof( mso_sptArrowSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptArrowCalc, sizeof( mso_sptArrowCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault16200and5400,
- (SvxMSDffTextRectangles*)mso_sptArrowTextRect, sizeof( mso_sptArrowTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptLeftArrowVert[] = // adjustment1: x 0 - 21600
-{ // adjustment2: y 0 - 10800
- { 21600, 0 MSO_I }, { 1 MSO_I, 0 MSO_I }, { 1 MSO_I, 0 }, { 0, 10800 },
- { 1 MSO_I, 21600 }, { 1 MSO_I, 2 MSO_I }, { 21600, 2 MSO_I }
-};
-static const sal_uInt16 mso_sptLeftArrowSegm[] =
-{
- 0x4000, 0x0006, 0x6001, 0x8000
-};
-static const sal_Int32 mso_sptLeftArrowDefault[] =
-{
- 2, 5400, 5400
-};
-static const SvxMSDffTextRectangles mso_sptLeftArrowTextRect[] =
-{
- { { 7 MSO_I, 0 MSO_I }, { 21600, 2 MSO_I } }
-};
-static const mso_CustomShape msoLeftArrow =
-{
- (SvxMSDffVertPair*)mso_sptLeftArrowVert, sizeof( mso_sptLeftArrowVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptLeftArrowSegm, sizeof( mso_sptLeftArrowSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptArrowCalc, sizeof( mso_sptArrowCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptLeftArrowDefault,
- (SvxMSDffTextRectangles*)mso_sptLeftArrowTextRect, sizeof( mso_sptLeftArrowTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptDownArrowVert[] = // adjustment1: x 0 - 21600
-{ // adjustment2: y 0 - 10800
- { 0 MSO_I, 0 }, { 0 MSO_I, 1 MSO_I }, { 0, 1 MSO_I }, { 10800, 21600 },
- { 21600, 1 MSO_I }, { 2 MSO_I, 1 MSO_I }, { 2 MSO_I, 0 }
-};
-static const sal_uInt16 mso_sptDownArrowSegm[] =
-{
- 0x4000, 0x0006, 0x6001, 0x8000
-};
-static const SvxMSDffTextRectangles mso_sptDownArrowTextRect[] =
-{
- { { 0 MSO_I, 0 }, { 2 MSO_I, 5 MSO_I } }
-};
-static const mso_CustomShape msoDownArrow =
-{
- (SvxMSDffVertPair*)mso_sptDownArrowVert, sizeof( mso_sptDownArrowVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptDownArrowSegm, sizeof( mso_sptDownArrowSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptArrowCalc, sizeof( mso_sptArrowCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault16200and5400,
- (SvxMSDffTextRectangles*)mso_sptDownArrowTextRect, sizeof( mso_sptDownArrowTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptUpArrowVert[] = // adjustment1: x 0 - 21600
-{ // adjustment2: y 0 - 10800
- { 0 MSO_I, 21600 }, { 0 MSO_I, 1 MSO_I }, { 0, 1 MSO_I }, { 10800, 0 },
- { 21600, 1 MSO_I }, { 2 MSO_I, 1 MSO_I }, { 2 MSO_I, 21600 }
-};
-static const sal_uInt16 mso_sptUpArrowSegm[] =
-{
- 0x4000, 0x0006, 0x6001, 0x8000
-};
-static const sal_Int32 mso_sptUpArrowDefault[] =
-{
- 2, 5400, 5400
-};
-static const SvxMSDffTextRectangles mso_sptUpArrowTextRect[] =
-{
- { { 0 MSO_I, 7 MSO_I }, { 2 MSO_I, 21600 } }
-};
-static const mso_CustomShape msoUpArrow =
-{
- (SvxMSDffVertPair*)mso_sptUpArrowVert, sizeof( mso_sptUpArrowVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptUpArrowSegm, sizeof( mso_sptUpArrowSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptArrowCalc, sizeof( mso_sptArrowCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptUpArrowDefault,
- (SvxMSDffTextRectangles*)mso_sptUpArrowTextRect, sizeof( mso_sptUpArrowTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptLeftRightArrowVert[] = // adjustment1: x 0 - 10800
-{ // adjustment2: y 0 - 10800
- { 0, 10800 }, { 0 MSO_I, 0 }, { 0 MSO_I, 1 MSO_I }, { 2 MSO_I, 1 MSO_I },
- { 2 MSO_I, 0 }, { 21600, 10800 }, { 2 MSO_I, 21600 }, { 2 MSO_I, 3 MSO_I },
- { 0 MSO_I, 3 MSO_I }, { 0 MSO_I, 21600 }
-};
-static const sal_uInt16 mso_sptLeftRightArrowSegm[] =
-{
- 0x4000, 0x0009, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptDoubleArrowCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x2000, DFF_Prop_adjust2Value, 0, 0 },
- { 0x8000, 21600, 0, DFF_Prop_adjustValue },
- { 0x8000, 21600, 0, DFF_Prop_adjust2Value },
- { 0x8000, 10800, 0, DFF_Prop_adjust2Value },
- { 0x6001, DFF_Prop_adjustValue, 0x404, 10800 },
- { 0x8000, 21600, 0, 0x405 },
- { 0x8000, 10800, 0, DFF_Prop_adjustValue },
- { 0x6001, DFF_Prop_adjust2Value, 0x407, 10800 },
- { 0x8000, 21600, 0, 0x408 }
-};
-static const sal_Int32 mso_sptLeftRightArrowDefault[] =
-{
- 2, 4300, 5400
-};
-static const SvxMSDffTextRectangles mso_sptLeftRightArrowTextRect[] =
-{
- { { 5 MSO_I, 1 MSO_I }, { 6 MSO_I, 3 MSO_I } }
-};
-static const mso_CustomShape msoLeftRightArrow =
-{
- (SvxMSDffVertPair*)mso_sptLeftRightArrowVert, sizeof( mso_sptLeftRightArrowVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptLeftRightArrowSegm, sizeof( mso_sptLeftRightArrowSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptDoubleArrowCalc, sizeof( mso_sptDoubleArrowCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptLeftRightArrowDefault,
- (SvxMSDffTextRectangles*)mso_sptLeftRightArrowTextRect, sizeof( mso_sptLeftRightArrowTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptUpDownArrowVert[] = // adjustment1: x 0 - 10800
-{ // adjustment2: y 0 - 10800
- { 0, 1 MSO_I }, { 10800, 0 }, { 21600, 1 MSO_I }, { 2 MSO_I, 1 MSO_I },
- { 2 MSO_I, 3 MSO_I }, { 21600, 3 MSO_I }, { 10800, 21600 }, { 0, 3 MSO_I },
- { 0 MSO_I, 3 MSO_I }, { 0 MSO_I, 1 MSO_I }
-};
-static const sal_uInt16 mso_sptUpDownArrowSegm[] =
-{
- 0x4000, 0x0009, 0x6001, 0x8000
-};
-static const sal_Int32 mso_sptUpDownArrowDefault[] =
-{
- 2, 5400, 4300
-};
-static const SvxMSDffTextRectangles mso_sptUpDownArrowTextRect[] =
-{
- { { 0 MSO_I, 8 MSO_I }, { 2 MSO_I, 9 MSO_I } }
-};
-static const mso_CustomShape msoUpDownArrow =
-{
- (SvxMSDffVertPair*)mso_sptUpDownArrowVert, sizeof( mso_sptUpDownArrowVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptUpDownArrowSegm, sizeof( mso_sptUpDownArrowSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptDoubleArrowCalc, sizeof( mso_sptDoubleArrowCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptUpDownArrowDefault,
- (SvxMSDffTextRectangles*)mso_sptUpDownArrowTextRect, sizeof( mso_sptUpDownArrowTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptQuadArrowVert[] = // adjustment1: x 0 - 10800, adjustment2: x 0 - 10800
-{ // adjustment3: y 0 - 10800
- { 0, 10800 }, { 0 MSO_I, 1 MSO_I }, { 0 MSO_I, 2 MSO_I }, { 2 MSO_I, 2 MSO_I },
- { 2 MSO_I, 0 MSO_I }, { 1 MSO_I, 0 MSO_I }, { 10800, 0 }, { 3 MSO_I, 0 MSO_I },
- { 4 MSO_I, 0 MSO_I }, { 4 MSO_I, 2 MSO_I }, { 5 MSO_I, 2 MSO_I }, { 5 MSO_I, 1 MSO_I },
- { 21600, 10800 }, { 5 MSO_I, 3 MSO_I }, { 5 MSO_I, 4 MSO_I }, { 4 MSO_I, 4 MSO_I },
- { 4 MSO_I, 5 MSO_I }, { 3 MSO_I, 5 MSO_I }, { 10800, 21600 }, { 1 MSO_I, 5 MSO_I },
- { 2 MSO_I, 5 MSO_I }, { 2 MSO_I, 4 MSO_I }, { 0 MSO_I, 4 MSO_I }, { 0 MSO_I, 3 MSO_I }
-};
-static const sal_uInt16 mso_sptQuadArrowSegm[] =
-{
- 0x4000, 0x0017, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptQuadArrowCalc[] =
-{
- { 0x2000, DFF_Prop_adjust3Value, 0, 0 },
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x2000, DFF_Prop_adjust2Value, 0, 0 },
- { 0x8000, 21600, 0, DFF_Prop_adjustValue },
- { 0x8000, 21600, 0, DFF_Prop_adjust2Value },
- { 0x8000, 21600, 0, DFF_Prop_adjust3Value }
-};
-static const sal_Int32 mso_sptQuadArrowDefault[] =
-{
- 3, 6500, 8600, 4300
-};
-static const SvxMSDffTextRectangles mso_sptQuadArrowTextRect[] = // todo
-{
- { { 0, 0 }, { 21600, 21600 } }
-};
-static const mso_CustomShape msoQuadArrow =
-{
- (SvxMSDffVertPair*)mso_sptQuadArrowVert, sizeof( mso_sptQuadArrowVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptQuadArrowSegm, sizeof( mso_sptQuadArrowSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptQuadArrowCalc, sizeof( mso_sptQuadArrowCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptQuadArrowDefault,
- (SvxMSDffTextRectangles*)mso_sptQuadArrowTextRect, sizeof( mso_sptQuadArrowTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptLeftRightUpArrowVert[] = // adjustment1: x 0 - 10800, adjustment2: x 0 - 10800
-{ // adjustment3: y 0 - 21600
- { 10800, 0 }, { 3 MSO_I, 2 MSO_I }, { 4 MSO_I, 2 MSO_I }, { 4 MSO_I, 1 MSO_I },
- { 5 MSO_I, 1 MSO_I }, { 5 MSO_I, 0 MSO_I }, { 21600, 10800 }, { 5 MSO_I, 3 MSO_I },
- { 5 MSO_I, 4 MSO_I }, { 2 MSO_I, 4 MSO_I }, { 2 MSO_I, 3 MSO_I }, { 0, 10800 },
- { 2 MSO_I, 0 MSO_I }, { 2 MSO_I, 1 MSO_I }, { 1 MSO_I, 1 MSO_I }, { 1 MSO_I, 2 MSO_I },
- { 0 MSO_I, 2 MSO_I }
-};
-static const sal_uInt16 mso_sptLeftRightUpArrowSegm[] =
-{
- 0x4000, 0x0010, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptLeftRightUpArrowCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 }, // 0
- { 0x2000, DFF_Prop_adjust2Value, 0, 0 }, // 1
- { 0x6001, 0x0403, DFF_Prop_adjust3Value, 21600 }, // 2
- { 0x8000, 21600, 0, DFF_Prop_adjustValue }, // 3
- { 0x8000, 21600, 0, DFF_Prop_adjust2Value }, // 4
- { 0x8000, 21600, 0, 0x0402 } // 5
-};
-static const sal_Int32 mso_sptLeftRightUpArrowDefault[] =
-{
- 3, 6500, 8600, 6200
-};
-static const SvxMSDffTextRectangles mso_sptLeftRightUpArrowTextRect[] = // todo
-{
- { { 0, 0 }, { 21600, 21600 } }
-};
-static const mso_CustomShape msoLeftRightUpArrow =
-{
- (SvxMSDffVertPair*)mso_sptLeftRightUpArrowVert, sizeof( mso_sptLeftRightUpArrowVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptLeftRightUpArrowSegm, sizeof( mso_sptLeftRightUpArrowSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptLeftRightUpArrowCalc, sizeof( mso_sptLeftRightUpArrowCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptLeftRightUpArrowDefault,
- (SvxMSDffTextRectangles*)mso_sptLeftRightUpArrowTextRect, sizeof( mso_sptLeftRightUpArrowTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptBentArrowVert[] = // adjustment1 : x 12427 - 21600
-{ // adjustment2 : y 0 - 6079
- { 0, 21600 }, { 0, 12160 }, { 12427, 1 MSO_I }, { 0 MSO_I, 1 MSO_I },
- { 0 MSO_I, 0 }, { 21600, 6079 }, { 0 MSO_I, 12158 }, { 0 MSO_I, 2 MSO_I },
- { 12427, 2 MSO_I }, { 4 MSO_I, 12160 }, { 4 MSO_I, 21600 }
-};
-static const sal_uInt16 mso_sptBentArrowSegm[] =
-{
- 0x4000, 0x0001, 0xa801, 0x0006, 0xa701, 0x0001, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptBentArrowCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x2000, DFF_Prop_adjust2Value, 0, 0 },
- { 0x8000, 12158, 0, DFF_Prop_adjust2Value },
- { 0x8000, 6079, 0, DFF_Prop_adjust2Value },
- { 0x2001, 0x0403, 2, 1 }
-};
-static const sal_Int32 mso_sptBentArrowDefault[] =
-{
- 2, 15100, 2900
-};
-static const SvxMSDffTextRectangles mso_sptBentArrowTextRect[] = // todo
-{
- { { 0, 0 }, { 21600, 21600 } }
-};
-static const mso_CustomShape msoBentArrow =
-{
- (SvxMSDffVertPair*)mso_sptBentArrowVert, sizeof( mso_sptBentArrowVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptBentArrowSegm, sizeof( mso_sptBentArrowSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptBentArrowCalc, sizeof( mso_sptBentArrowCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptBentArrowDefault,
- (SvxMSDffTextRectangles*)mso_sptBentArrowTextRect, sizeof( mso_sptBentArrowTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptUturnArrowVert[] =
-{
- { 0, 21600 }, { 0, 8550 }, // pp
- { 0, 3540 }, { 4370, 0 }, { 9270, 0 }, // ccp
- { 13890, 0 }, { 18570, 3230 }, { 18600, 8300 }, // ccp
- { 21600, 8300 }, { 15680, 14260 }, { 9700, 8300 }, { 12500, 8300 }, // pppp
- { 12320, 6380 }, { 10870, 5850 }, { 9320, 5850 }, // ccp
- { 7770, 5850 }, { 6040, 6410 }, { 6110, 8520 }, // ccp
- { 6110, 21600 }
-};
-static const sal_uInt16 mso_sptUturnArrowSegm[] =
-{
- 0x4000, 0x0001, 0x2002, 0x0004, 0x2002, 0x0001, 0x6000, 0x8000
-};
-static const SvxMSDffTextRectangles mso_sptUturnArrowTextRect[] =
-{
- { { 0, 8280 }, { 6110, 21600 } }
-};
-static const mso_CustomShape msoUturnArrow =
-{
- (SvxMSDffVertPair*)mso_sptUturnArrowVert, sizeof( mso_sptUturnArrowVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptUturnArrowSegm, sizeof( mso_sptUturnArrowSegm ) >> 1,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptUturnArrowTextRect, sizeof( mso_sptUturnArrowTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptLeftUpArrowVert[] = // adjustment1 : x 0 - 21600, adjustment2 : x 0 - 21600
-{ // adjustment3 : y 0 - 21600
- { 0, 5 MSO_I }, { 2 MSO_I, 0 MSO_I }, { 2 MSO_I, 7 MSO_I }, { 7 MSO_I, 7 MSO_I },
- { 7 MSO_I, 2 MSO_I }, { 0 MSO_I, 2 MSO_I }, { 5 MSO_I, 0 }, { 21600, 2 MSO_I },
- { 1 MSO_I, 2 MSO_I }, { 1 MSO_I, 1 MSO_I }, { 2 MSO_I, 1 MSO_I }, { 2 MSO_I, 21600 }
-};
-static const sal_uInt16 mso_sptLeftUpArrowSegm[] =
-{
- 0x4000, 0x000b, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptLeftUpArrowCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 }, // 0
- { 0x2000, DFF_Prop_adjust2Value, 0, 0 }, // 1
- { 0x2000, DFF_Prop_adjust3Value, 0, 0 }, // 2
- { 0x8000, 21600, 0, DFF_Prop_adjustValue }, // 3
- { 0x2001, 0x0403, 1, 2 }, // 4
- { 0x6000, DFF_Prop_adjustValue, 0x0404, 0 }, // 5
- { 0x8000, 21600, 0, DFF_Prop_adjust2Value }, // 6
- { 0x6000, DFF_Prop_adjustValue, 0x0406, 0 } // 7
-};
-static const sal_Int32 mso_sptLeftUpArrowDefault[] =
-{
- 3, 9340, 18500, 6200
-};
-static const SvxMSDffTextRectangles mso_sptLeftUpArrowTextRect[] =
-{
- { { 2 MSO_I, 7 MSO_I }, { 1 MSO_I, 1 MSO_I } },
- { { 7 MSO_I, 2 MSO_I }, { 1 MSO_I, 1 MSO_I } }
-};
-static const mso_CustomShape msoLeftUpArrow =
-{
- (SvxMSDffVertPair*)mso_sptLeftUpArrowVert, sizeof( mso_sptLeftUpArrowVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptLeftUpArrowSegm, sizeof( mso_sptLeftUpArrowSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptLeftUpArrowCalc, sizeof( mso_sptLeftUpArrowCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptLeftUpArrowDefault,
- (SvxMSDffTextRectangles*)mso_sptLeftUpArrowTextRect, sizeof( mso_sptLeftUpArrowTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptBentUpArrowVert[] = // adjustment1 : x 0 - 21600, adjustment2 : x 0 - 21600
-{ // adjustment3 : y 0 - 21600
- { 0, 8 MSO_I }, { 7 MSO_I, 8 MSO_I }, { 7 MSO_I, 2 MSO_I }, { 0 MSO_I, 2 MSO_I },
- { 5 MSO_I, 0 }, { 21600, 2 MSO_I }, { 1 MSO_I, 2 MSO_I }, { 1 MSO_I, 21600 },
- { 0, 21600 }
-};
-static const sal_uInt16 mso_sptBentUpArrowSegm[] =
-{
- 0x4000, 0x0008, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptBentUpArrowCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 }, // 0
- { 0x2000, DFF_Prop_adjust2Value, 0, 0 }, // 1
- { 0x2000, DFF_Prop_adjust3Value, 0, 0 }, // 2
- { 0x8000, 21600, 0, DFF_Prop_adjustValue }, // 3
- { 0x2001, 0x0403, 1, 2 }, // 4
- { 0x6000, DFF_Prop_adjustValue, 0x0404, 0 }, // 5
- { 0x8000, 21600, 0, DFF_Prop_adjust2Value }, // 6
- { 0x6000, DFF_Prop_adjustValue, 0x0406, 0 }, // 7
- { 0x6000, 0x0407, 0x0406, 0 } // 8
-};
-static const sal_Int32 mso_sptBentUpArrowDefault[] =
-{
- 3, 9340, 18500, 7200
-};
-static const SvxMSDffTextRectangles mso_sptBentUpArrowTextRect[] =
-{
- { { 2 MSO_I, 7 MSO_I }, { 1 MSO_I, 1 MSO_I } },
- { { 7 MSO_I, 2 MSO_I }, { 1 MSO_I, 1 MSO_I } }
-};
-static const mso_CustomShape msoBentUpArrow =
-{
- (SvxMSDffVertPair*)mso_sptBentUpArrowVert, sizeof( mso_sptBentUpArrowVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptBentUpArrowSegm, sizeof( mso_sptBentUpArrowSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptBentUpArrowCalc, sizeof( mso_sptBentUpArrowCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptBentUpArrowDefault,
- (SvxMSDffTextRectangles*)mso_sptBentUpArrowTextRect, sizeof( mso_sptBentUpArrowTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptCurvedArrowVert[] = // adjustment1 : y 10800 - 21600, adjustment2 : y 16424 - 21600
-{ // adjustment3 : x 0 - 21600
- { 21600, 0 },
- { 9675, 0 }, { 0, 10 MSO_I }, { 0, 9 MSO_I }, // ccp
- { 0, 11 MSO_I },
- { 0, 14 MSO_I }, { 15 MSO_I, 1 MSO_I }, { 2 MSO_I, 1 MSO_I }, // ccp
- { 2 MSO_I, 21600 }, { 21600, 7 MSO_I }, { 2 MSO_I, 0 MSO_I }, { 2 MSO_I, 16 MSO_I },// pppp
- { 2 MSO_I, 16 MSO_I }, { 80, 8 MSO_I }, { 80, 8 MSO_I }, // ccp
- { 80, 8 MSO_I }, { 21600, 5 MSO_I }, { 21600, 0 } // ccp
-};
-static const sal_uInt16 mso_sptCurvedArrowSegm[] =
-{
- 0x4000, 0x2001, 0x0001, 0x2001, 0x0004, 0x2002, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptCurvedArrowCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 }, // 0
- { 0x2000, DFF_Prop_adjust2Value, 0, 0 }, // 1
- { 0x2000, DFF_Prop_adjust3Value, 0, 0 }, // 2
- { 0x8000, 21600, 0, DFF_Prop_adjust2Value }, // 3
- { 0xa000, DFF_Prop_adjust2Value, 0, DFF_Prop_adjustValue }, // 4
- { 0xa000, 0x0404, 0, 0x0403 }, // 5
- { 0x2001, 0x0405, 1, 2 }, // 6
- { 0xa000, DFF_Prop_adjust2Value, 0, 0x0406 }, // 7
- { 0x2001, DFF_Prop_adjust2Value, 1, 2 }, // 8
- { 0xa000, 0x0408, 0, 0x0406 }, // 9
- { 0x2001, 0x0409, 10000, 22326 }, // 10
- { 0x6000, 0x0409, 0x0405, 0 }, // 11
- { 0xa000, DFF_Prop_adjust2Value, 0, 0x040b }, // 12
- { 0x2001, 0x040c, 10000, 23148 }, // 13
- { 0x6000, 0x040d, 0x040b, 0 }, // 14
- { 0x2001, DFF_Prop_adjust3Value, 10000, 25467 }, // 15
- { 0x6000, DFF_Prop_adjustValue, 0x0403, 0 } // 16
-};
-static const sal_Int32 mso_sptCurvedArrowDefault[] =
-{
- 3, 13000, 19400, 14400
-};
-static const SvxMSDffTextRectangles mso_sptCurvedArrowTextRect[] = // todo
-{
- { { 0, 0 }, { 21600, 21600 } }
-};
-static const mso_CustomShape msoCurvedArrow =
-{
- (SvxMSDffVertPair*)mso_sptCurvedArrowVert, sizeof( mso_sptCurvedArrowVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptCurvedArrowSegm, sizeof( mso_sptCurvedArrowSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptCurvedArrowCalc, sizeof( mso_sptCurvedArrowCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptCurvedArrowDefault,
- (SvxMSDffTextRectangles*)mso_sptCurvedArrowTextRect, sizeof( mso_sptCurvedArrowTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptStripedRightArrowVert[] = // adjustment1 : x 3375 - 21600
-{ // adjustment2 : y 0 - 10800
- { 3375, 0 MSO_I }, { 1 MSO_I, 0 MSO_I }, { 1 MSO_I, 0 }, { 21600, 10800 },
- { 1 MSO_I, 21600 }, { 1 MSO_I, 2 MSO_I }, { 3375, 2 MSO_I }, { 0, 0 MSO_I },
- { 675, 0 MSO_I }, { 675, 2 MSO_I }, { 0, 2 MSO_I }, { 1350, 0 MSO_I },
- { 2700, 0 MSO_I }, { 2700, 2 MSO_I }, { 1350, 2 MSO_I }
-};
-static const sal_uInt16 mso_sptStripedRightArrowSegm[] =
-{
- 0x4000, 0x0006, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptStripedRightArrowCalc[] =
-{
- { 0x2000, DFF_Prop_adjust2Value, 0, 0 },
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x8000, 21600, 0, DFF_Prop_adjust2Value },
- { 0x8000, 21600, 0, 0x401 },
- { 0x6001, 0x403, 0x400, 10800 },
- { 0x6000, 0x401, 0x404, 0 }
-};
-static const SvxMSDffTextRectangles mso_sptStripedRightArrowTextRect[] =
-{
- { { 3375, 0 MSO_I }, { 5 MSO_I, 2 MSO_I } }
-};
-static const mso_CustomShape msoStripedRightArrow =
-{
- (SvxMSDffVertPair*)mso_sptStripedRightArrowVert, sizeof( mso_sptStripedRightArrowVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptStripedRightArrowSegm, sizeof( mso_sptStripedRightArrowSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptStripedRightArrowCalc, sizeof( mso_sptStripedRightArrowCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault16200and5400,
- (SvxMSDffTextRectangles*)mso_sptStripedRightArrowTextRect, sizeof( mso_sptStripedRightArrowTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptNotchedRightArrowVert[] = // adjustment1 : x 0 - 21600 (default 16200)
-{ // adjustment2 : y 0 - 10800 (default 5400)
- { 0, 1 MSO_I }, { 0 MSO_I, 1 MSO_I }, { 0 MSO_I, 0 }, { 21600, 10800 },
- { 0 MSO_I, 21600 }, { 0 MSO_I, 2 MSO_I }, { 0, 2 MSO_I }, { 5 MSO_I, 10800 }, { 0, 1 MSO_I }
-};
-static const SvxMSDffCalculationData mso_sptNotchedRightArrowCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x2000, DFF_Prop_adjust2Value, 0, 0 },
- { 0x8000, 21600, 0, DFF_Prop_adjust2Value },
- { 0x8000, 21600, 0, DFF_Prop_adjustValue },
- { 0x8000, 10800, 0, DFF_Prop_adjust2Value },
- { 0x6001, 0x403, 0x404, 10800 }
-};
-static const SvxMSDffTextRectangles mso_sptNotchedRightArrowTextRect[] = // todo
-{
- { { 0, 0 }, { 21600, 21600 } }
-};
-static const mso_CustomShape msoNotchedRightArrow =
-{
- (SvxMSDffVertPair*)mso_sptNotchedRightArrowVert, sizeof( mso_sptNotchedRightArrowVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)NULL, 0,
- (SvxMSDffCalculationData*)mso_sptNotchedRightArrowCalc, sizeof( mso_sptNotchedRightArrowCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault16200and5400,
- (SvxMSDffTextRectangles*)mso_sptNotchedRightArrowTextRect, sizeof( mso_sptNotchedRightArrowTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptHomePlateVert[] = // adjustment1 : x 0 - 21600
-{
- { 0, 0 }, { 0 MSO_I, 0 }, { 21600, 10800 }, { 0 MSO_I, 21600 },
- { 0, 21600 }
-};
-static const sal_uInt16 mso_sptHomePlateSegm[] =
-{
- 0x4000, 0x0004, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptHomePlateCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 }
-};
-static const sal_Int32 mso_sptHomePlateDefault[] =
-{
- 1, 16200
-};
-static const SvxMSDffTextRectangles mso_sptHomePlateTextRect[] = // todo
-{
- { { 0, 0 }, { 21600, 21600 } }
-};
-static const mso_CustomShape msoHomePlate =
-{
- (SvxMSDffVertPair*)mso_sptHomePlateVert, sizeof( mso_sptHomePlateVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptHomePlateSegm, sizeof( mso_sptHomePlateSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptHomePlateCalc, sizeof( mso_sptHomePlateCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptHomePlateDefault,
- (SvxMSDffTextRectangles*)mso_sptHomePlateTextRect, sizeof( mso_sptHomePlateTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptChevronVert[] = // adjustment1 : x 0 - 21600
-{
- { 0, 0 }, { 0 MSO_I, 0 }, { 21600, 10800 }, { 0 MSO_I, 21600 },
- { 0, 21600 }, { 1 MSO_I, 10800 }
-};
-static const sal_uInt16 mso_sptChevronSegm[] =
-{
- 0x4000, 0x0005, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptChevronCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x8000, 21600, 0, 0x0400 }
-};
-static const sal_Int32 mso_sptChevronDefault[] =
-{
- 1, 16200
-};
-static const SvxMSDffTextRectangles mso_sptChevronTextRect[] = // todo
-{
- { { 0, 0 }, { 21600, 21600 } }
-};
-static const mso_CustomShape msoChevron =
-{
- (SvxMSDffVertPair*)mso_sptChevronVert, sizeof( mso_sptChevronVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptChevronSegm, sizeof( mso_sptChevronSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptChevronCalc, sizeof( mso_sptChevronCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptChevronDefault,
- (SvxMSDffTextRectangles*)mso_sptChevronTextRect, sizeof( mso_sptChevronTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptRightArrowCalloutVert[] = // adjustment1 : x 0 - 21000
-{ // adjustment2 : y 0 - 10800
- { 0, 0 }, { 0 MSO_I, 0 }, { 0 MSO_I, 3 MSO_I }, { 2 MSO_I, 3 MSO_I },
- { 2 MSO_I, 1 MSO_I }, { 21600, 10800 }, { 2 MSO_I, 4 MSO_I }, { 2 MSO_I, 5 MSO_I },
- { 0 MSO_I, 5 MSO_I }, { 0 MSO_I, 21600 }, { 0, 21600 }
-};
-static const sal_uInt16 mso_sptRightArrowCalloutSegm[] =
-{
- 0x4000, 0x000a, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptRightArrowCalloutCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x2000, DFF_Prop_adjust2Value, 0, 0 },
- { 0x2000, DFF_Prop_adjust3Value, 0, 0 },
- { 0x2000, DFF_Prop_adjust4Value, 0, 0 },
- { 0x8000, 21600, 0, 0x0401 },
- { 0x8000, 21600, 0, 0x0403 }
-};
-static const sal_Int32 mso_sptRightArrowCalloutDefault[] =
-{
- 4, 14400, 5400, 18000, 8100
-};
-static const SvxMSDffTextRectangles mso_sptRightArrowCalloutTextRect[] =
-{
- { { 0, 0 }, { 0 MSO_I, 21600 } }
-};
-static const mso_CustomShape msoRightArrowCallout =
-{
- (SvxMSDffVertPair*)mso_sptRightArrowCalloutVert, sizeof( mso_sptRightArrowCalloutVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptRightArrowCalloutSegm, sizeof( mso_sptRightArrowCalloutSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptRightArrowCalloutCalc, sizeof( mso_sptRightArrowCalloutCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptRightArrowCalloutDefault,
- (SvxMSDffTextRectangles*)mso_sptRightArrowCalloutTextRect, sizeof( mso_sptRightArrowCalloutTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptLeftArrowCalloutVert[] = // adjustment1 : x 0 - 21600, adjustment2 : y 0 - 10800
-{ // adjustment3 : x 0 - 21600, adjustment4 : y 0 - 10800
- { 0 MSO_I, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0 MSO_I, 21600 },
- { 0 MSO_I, 5 MSO_I }, { 2 MSO_I, 5 MSO_I }, { 2 MSO_I, 4 MSO_I }, { 0, 10800 },
- { 2 MSO_I, 1 MSO_I }, { 2 MSO_I, 3 MSO_I }, { 0 MSO_I, 3 MSO_I }
-};
-static const sal_uInt16 mso_sptLeftArrowCalloutSegm[] =
-{
- 0x4000, 0x000a, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptLeftArrowCalloutCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x2000, DFF_Prop_adjust2Value, 0, 0 },
- { 0x2000, DFF_Prop_adjust3Value, 0, 0 },
- { 0x2000, DFF_Prop_adjust4Value, 0, 0 },
- { 0x8000, 21600, 0, 0x0401 },
- { 0x8000, 21600, 0, 0x0403 }
-};
-static const sal_Int32 mso_sptLeftArrowCalloutDefault[] =
-{
- 4, 7200, 5400, 3600, 8100
-};
-static const SvxMSDffTextRectangles mso_sptLeftArrowCalloutTextRect[] =
-{
- { { 0 MSO_I, 0 }, { 21600, 21600 } }
-};
-static const mso_CustomShape msoLeftArrowCallout =
-{
- (SvxMSDffVertPair*)mso_sptLeftArrowCalloutVert, sizeof( mso_sptLeftArrowCalloutVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptLeftArrowCalloutSegm, sizeof( mso_sptLeftArrowCalloutSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptLeftArrowCalloutCalc, sizeof( mso_sptLeftArrowCalloutCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptLeftArrowCalloutDefault,
- (SvxMSDffTextRectangles*)mso_sptLeftArrowCalloutTextRect, sizeof( mso_sptLeftArrowCalloutTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptUpArrowCalloutVert[] =
-{
- { 21600, 0 MSO_I }, { 21600, 21600 }, { 0, 21600 }, { 0, 0 MSO_I },
- { 3 MSO_I, 0 MSO_I }, { 3 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I }, { 10800, 0 },
- { 4 MSO_I, 2 MSO_I }, { 5 MSO_I, 2 MSO_I }, { 5 MSO_I, 0 MSO_I }
-};
-static const sal_uInt16 mso_sptUpArrowCalloutSegm[] =
-{
- 0x4000, 0x000a, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptUpArrowCalloutCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x2000, DFF_Prop_adjust2Value, 0, 0 },
- { 0x2000, DFF_Prop_adjust3Value, 0, 0 },
- { 0x2000, DFF_Prop_adjust4Value, 0, 0 },
- { 0x8000, 21600, 0, 0x0401 },
- { 0x8000, 21600, 0, 0x0403 }
-};
-static const sal_Int32 mso_sptUpArrowCalloutDefault[] =
-{
- 4, 7200, 5400, 3600, 8100
-};
-static const SvxMSDffTextRectangles mso_sptUpArrowCalloutTextRect[] =
-{
- { { 0, 0 MSO_I }, { 21600, 21600 } }
-};
-static const mso_CustomShape msoUpArrowCallout =
-{
- (SvxMSDffVertPair*)mso_sptUpArrowCalloutVert, sizeof( mso_sptUpArrowCalloutVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptUpArrowCalloutSegm, sizeof( mso_sptUpArrowCalloutSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptUpArrowCalloutCalc, sizeof( mso_sptUpArrowCalloutCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptUpArrowCalloutDefault,
- (SvxMSDffTextRectangles*)mso_sptUpArrowCalloutTextRect, sizeof( mso_sptUpArrowCalloutTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptDownArrowCalloutVert[] =
-{
- { 0, 0 MSO_I }, { 0, 0 }, { 21600, 0 }, { 21600, 0 MSO_I },
- { 5 MSO_I, 0 MSO_I }, { 5 MSO_I, 2 MSO_I }, { 4 MSO_I, 2 MSO_I }, { 10800, 21600 },
- { 1 MSO_I, 2 MSO_I }, { 3 MSO_I, 2 MSO_I }, { 3 MSO_I, 0 MSO_I }
-};
-static const sal_uInt16 mso_sptDownArrowCalloutSegm[] =
-{
- 0x4000, 0x000a, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptDownArrowCalloutCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x2000, DFF_Prop_adjust2Value, 0, 0 },
- { 0x2000, DFF_Prop_adjust3Value, 0, 0 },
- { 0x2000, DFF_Prop_adjust4Value, 0, 0 },
- { 0x8000, 21600, 0, 0x0401 },
- { 0x8000, 21600, 0, 0x0403 }
-};
-static const sal_Int32 mso_sptDownArrowCalloutDefault[] =
-{
- 4, 14400, 5400, 18000, 8100
-};
-static const SvxMSDffTextRectangles mso_sptDownArrowCalloutTextRect[] =
-{
- { { 0, 0 }, { 21600, 0 MSO_I } }
-};
-static const mso_CustomShape msoDownArrowCallout =
-{
- (SvxMSDffVertPair*)mso_sptDownArrowCalloutVert, sizeof( mso_sptDownArrowCalloutVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptDownArrowCalloutSegm, sizeof( mso_sptDownArrowCalloutSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptDownArrowCalloutCalc, sizeof( mso_sptDownArrowCalloutCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDownArrowCalloutDefault,
- (SvxMSDffTextRectangles*)mso_sptDownArrowCalloutTextRect, sizeof( mso_sptDownArrowCalloutTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptLeftRightArrowCalloutVert[] =
-{
- { 0 MSO_I, 0 }, { 4 MSO_I, 0 }, { 4 MSO_I, 3 MSO_I }, { 6 MSO_I, 3 MSO_I },
- { 6 MSO_I, 1 MSO_I }, { 21600, 10800 }, { 6 MSO_I, 5 MSO_I }, { 6 MSO_I, 7 MSO_I },
- { 4 MSO_I, 7 MSO_I }, { 4 MSO_I, 21600 }, { 0 MSO_I, 21600 }, { 0 MSO_I, 7 MSO_I },
- { 2 MSO_I, 7 MSO_I }, { 2 MSO_I, 5 MSO_I }, { 0, 10800 }, { 2 MSO_I, 1 MSO_I },
- { 2 MSO_I, 3 MSO_I }, { 0 MSO_I, 3 MSO_I }
-};
-static const sal_uInt16 mso_sptLeftRightArrowCalloutSegm[] =
-{
- 0x4000, 0x0011, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptLeftRightArrowCalloutCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x2000, DFF_Prop_adjust2Value, 0, 0 },
- { 0x2000, DFF_Prop_adjust3Value, 0, 0 },
- { 0x2000, DFF_Prop_adjust4Value, 0, 0 },
- { 0x8000, 21600, 0, 0x0400 },
- { 0x8000, 21600, 0, 0x0401 },
- { 0x8000, 21600, 0, 0x0402 },
- { 0x8000, 21600, 0, 0x0403 }
-};
-static const sal_Int32 mso_sptLeftRightArrowCalloutDefault[] =
-{
- 4, 5400, 5500, 2700, 8100
-};
-static const SvxMSDffTextRectangles mso_sptLeftRightArrowCalloutTextRect[] =
-{
- { { 0 MSO_I, 0 }, { 4 MSO_I, 21600 } }
-};
-static const mso_CustomShape msoLeftRightArrowCallout =
-{
- (SvxMSDffVertPair*)mso_sptLeftRightArrowCalloutVert, sizeof( mso_sptLeftRightArrowCalloutVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptLeftRightArrowCalloutSegm, sizeof( mso_sptLeftRightArrowCalloutSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptLeftRightArrowCalloutCalc, sizeof( mso_sptLeftRightArrowCalloutCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptLeftRightArrowCalloutDefault,
- (SvxMSDffTextRectangles*)mso_sptLeftRightArrowCalloutTextRect, sizeof( mso_sptLeftRightArrowCalloutTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptUpDownArrowCalloutVert[] =
-{
- { 0, 0 MSO_I }, { 0, 4 MSO_I }, { 3 MSO_I, 4 MSO_I }, { 3 MSO_I, 6 MSO_I },
- { 1 MSO_I, 6 MSO_I }, { 10800, 21600 }, { 5 MSO_I, 6 MSO_I }, { 7 MSO_I, 6 MSO_I },
- { 7 MSO_I, 4 MSO_I }, { 21600, 4 MSO_I }, { 21600, 0 MSO_I }, { 7 MSO_I, 0 MSO_I },
- { 7 MSO_I, 2 MSO_I }, { 5 MSO_I, 2 MSO_I }, { 10800, 0 }, { 1 MSO_I, 2 MSO_I },
- { 3 MSO_I, 2 MSO_I }, { 3 MSO_I, 0 MSO_I }
-};
-static const sal_uInt16 mso_sptUpDownArrowCalloutSegm[] =
-{
- 0x4000, 0x0011, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptUpDownArrowCalloutCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x2000, DFF_Prop_adjust2Value, 0, 0 },
- { 0x2000, DFF_Prop_adjust3Value, 0, 0 },
- { 0x2000, DFF_Prop_adjust4Value, 0, 0 },
- { 0x8000, 21600, 0, 0x0400 },
- { 0x8000, 21600, 0, 0x0401 },
- { 0x8000, 21600, 0, 0x0402 },
- { 0x8000, 21600, 0, 0x0403 }
-};
-static const sal_Int32 mso_sptUpDownArrowCalloutDefault[] =
-{
- 4, 5400, 5500, 2700, 8100
-};
-static const SvxMSDffTextRectangles mso_sptUpDownArrowCalloutTextRect[] =
-{
- { { 0, 0 MSO_I }, { 21600, 4 MSO_I } }
-};
-static const mso_CustomShape msoUpDownArrowCallout =
-{
- (SvxMSDffVertPair*)mso_sptUpDownArrowCalloutVert, sizeof( mso_sptUpDownArrowCalloutVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptUpDownArrowCalloutSegm, sizeof( mso_sptUpDownArrowCalloutSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptUpDownArrowCalloutCalc, sizeof( mso_sptUpDownArrowCalloutCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptUpDownArrowCalloutDefault,
- (SvxMSDffTextRectangles*)mso_sptUpDownArrowCalloutTextRect, sizeof( mso_sptUpDownArrowCalloutTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptQuadArrowCalloutVert[] =
-{
- { 0 MSO_I, 0 MSO_I }, { 3 MSO_I, 0 MSO_I }, { 3 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I },
- { 10800, 0 }, { 5 MSO_I, 2 MSO_I }, { 7 MSO_I, 2 MSO_I }, { 7 MSO_I, 0 MSO_I },
- { 4 MSO_I, 0 MSO_I }, { 4 MSO_I, 3 MSO_I }, { 6 MSO_I, 3 MSO_I }, { 6 MSO_I, 1 MSO_I },
- { 21600, 10800 }, { 6 MSO_I, 5 MSO_I }, { 6 MSO_I, 7 MSO_I }, { 4 MSO_I, 7 MSO_I },
- { 4 MSO_I, 4 MSO_I }, { 7 MSO_I, 4 MSO_I }, { 7 MSO_I, 6 MSO_I }, { 5 MSO_I, 6 MSO_I },
- { 10800, 21600 }, { 1 MSO_I, 6 MSO_I }, { 3 MSO_I, 6 MSO_I }, { 3 MSO_I, 4 MSO_I },
- { 0 MSO_I, 4 MSO_I }, { 0 MSO_I, 7 MSO_I }, { 2 MSO_I, 7 MSO_I }, { 2 MSO_I, 5 MSO_I },
- { 0, 10800 }, { 2 MSO_I, 1 MSO_I }, { 2 MSO_I, 3 MSO_I }, { 0 MSO_I, 3 MSO_I }
-};
-static const sal_uInt16 mso_sptQuadArrowCalloutSegm[] =
-{
- 0x4000, 0x001f, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptQuadArrowCalloutCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x2000, DFF_Prop_adjust2Value, 0, 0 },
- { 0x2000, DFF_Prop_adjust3Value, 0, 0 },
- { 0x2000, DFF_Prop_adjust4Value, 0, 0 },
- { 0x8000, 21600, 0, 0x0400 },
- { 0x8000, 21600, 0, 0x0401 },
- { 0x8000, 21600, 0, 0x0402 },
- { 0x8000, 21600, 0, 0x0403 }
-};
-static const sal_Int32 mso_sptQuadArrowCalloutDefault[] =
-{
- 4, 5400, 8100, 2700, 9400
-};
-static const SvxMSDffTextRectangles mso_sptQuadArrowCalloutTextRect[] =
-{
- { { 0 MSO_I, 0 MSO_I }, { 4 MSO_I, 4 MSO_I } }
-};
-static const mso_CustomShape msoQuadArrowCallout =
-{
- (SvxMSDffVertPair*)mso_sptQuadArrowCalloutVert, sizeof( mso_sptQuadArrowCalloutVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptQuadArrowCalloutSegm, sizeof( mso_sptQuadArrowCalloutSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptQuadArrowCalloutCalc, sizeof( mso_sptQuadArrowCalloutCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptQuadArrowCalloutDefault,
- (SvxMSDffTextRectangles*)mso_sptQuadArrowCalloutTextRect, sizeof( mso_sptQuadArrowCalloutTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptCircularArrowVert[] =
-{
- { 3 MSO_I, 3 MSO_I }, { 20 MSO_I, 20 MSO_I }, { 19 MSO_I, 18 MSO_I }, { 17 MSO_I, 16 MSO_I },
- { 0, 0 }, { 21600, 21600 }, { 9 MSO_I, 8 MSO_I }, { 11 MSO_I, 10 MSO_I },
- { 24 MSO_I, 23 MSO_I }, { 40 MSO_I, 39 MSO_I }, { 29 MSO_I, 28 MSO_I }
-};
-static const sal_uInt16 mso_sptCircularArrowSegm[] =
-{
- 0xa404, 0xa504, 0x0003, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptCircularArrowCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 }, // 0
- { 0x2000, DFF_Prop_adjust2Value, 0, 0 }, // 1
- { 0x2000, DFF_Prop_adjust3Value, 0, 0 }, // 2
- { 0x8000, 10800, 0,DFF_Prop_adjust3Value }, // 3
- { 0x4009, 10800, DFF_Prop_adjustValue, 0 }, // 4
- { 0x400a, 10800, DFF_Prop_adjustValue, 0 }, // 5
- { 0x4009, 10800, DFF_Prop_adjust2Value, 0 }, // 6
- { 0x400a, 10800, DFF_Prop_adjust2Value, 0 }, // 7
- { 0x2000, 0x0404, 10800, 0 }, // 8
- { 0x2000, 0x0405, 10800, 0 }, // 9
- { 0x2000, 0x0406, 10800, 0 }, // 10
- { 0x2000, 0x0407, 10800, 0 }, // 11
- { 0x6009, 0x0403, DFF_Prop_adjustValue, 0 }, // 12
- { 0x600a, 0x0403, DFF_Prop_adjustValue, 0 }, // 13
- { 0x6009, 0x0403, DFF_Prop_adjust2Value, 0 }, // 14
- { 0x600a, 0x0403, DFF_Prop_adjust2Value, 0 }, // 15
- { 0x2000, 0x040c, 10800, 0 }, // 16
- { 0x2000, 0x040d, 10800, 0 }, // 17
- { 0x2000, 0x040e, 10800, 0 }, // 18
- { 0x2000, 0x040f, 10800, 0 }, // 19
- { 0x8000, 21600, 0, 0x0403 }, // 20
- { 0x4009, 12600, DFF_Prop_adjust2Value, 0 }, // 21
- { 0x400a, 12600, DFF_Prop_adjust2Value, 0 }, // 22
- { 0x2000, 0x0415, 10800, 0 }, // 23
- { 0x2000, 0x0416, 10800, 0 }, // 24
- { 0x2000, DFF_Prop_adjust3Value, 0, 1800 }, // 25
- { 0x6009, 0x0419, DFF_Prop_adjust2Value, 0 }, // 26
- { 0x600a, 0x0419, DFF_Prop_adjust2Value, 0 }, // 27
- { 0x2000, 0x041a, 10800, 0 }, // 28
- { 0x2000, 0x041b, 10800, 0 }, // 29
- { 0x2001, 0x0403, 1, 2 }, // 30
- { 0x8000, 10800, 0, 0x041e }, // 31
- { 0x4001, 35, 0x0403, 10800 }, // 32
- { 0x2000, 0x0420, 10, 0 }, // 33
- { 0x2001, 0x0421, 256, 1 }, // 34
- { 0x2001, 0x0422, 256, 1 }, // 35
- { 0x6000, 0x0423, DFF_Prop_adjust2Value, 0 }, // 36
- { 0x6009, 0x041f, 0x0424, 0 }, // 37
- { 0x600a, 0x041f, 0x0424, 0 }, // 38
- { 0x2000, 0x0425, 10800, 0 }, // 39
- { 0x2000, 0x0426, 10800, 0 } // 40
-};
-static const sal_Int32 mso_sptCircularArrowDefault[] =
-{
- 3, 180 << 16, 0, 5500
-};
-static const SvxMSDffTextRectangles mso_sptCircularArrowTextRect[] = // todo
-{
- { { 0, 0 }, { 21600, 21600 } }
-};
-static const mso_CustomShape msoCircularArrow =
-{
- (SvxMSDffVertPair*)mso_sptCircularArrowVert, sizeof( mso_sptCircularArrowVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptCircularArrowSegm, sizeof( mso_sptCircularArrowSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptCircularArrowCalc, sizeof( mso_sptCircularArrowCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptCircularArrowDefault,
- (SvxMSDffTextRectangles*)mso_sptCircularArrowTextRect, sizeof( mso_sptCircularArrowTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptCubeVert[] =
-{
- { 0, 21600 }, { 0, 1 MSO_I }, { 2 MSO_I, 0 }, { 21600, 0 },
- { 21600, 3 MSO_I }, { 4 MSO_I, 21600 }, { 0, 1 MSO_I }, { 2 MSO_I, 0 },
- { 21600, 0 }, { 4 MSO_I, 1 MSO_I }, { 4 MSO_I, 21600 }, { 4 MSO_I, 1 MSO_I },
- { 21600, 0 }, { 21600, 3 MSO_I }
-};
-static const sal_uInt16 mso_sptCubeSegm[] =
-{
- 0x4000, 0x0005, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptCubeCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x6000, DFF_Prop_geoTop, 0x400, 0 },
- { 0x6000, DFF_Prop_geoLeft, 0x400, 0 },
- { 0xa000, DFF_Prop_geoBottom, 0, 0x400 },
- { 0xa000, DFF_Prop_geoRight, 0, 0x400 },
- { 0x8000, 21600, 0, 0x402 }, // 5
- { 0x2001, 0x405, 1, 2 }, // 6
- { 0x6000, 0x402, 0x406, 0 }, // 7
- { 0x2001, 0x404, 1, 2 } // 8
-
-};
-static const SvxMSDffTextRectangles mso_sptCubeTextRect[] =
-{
- { { 0, 1 MSO_I }, { 4 MSO_I, 21600 } }
-};
-static const mso_CustomShape msoCube =
-{
- (SvxMSDffVertPair*)mso_sptCubeVert, sizeof( mso_sptCubeVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptCubeSegm, sizeof( mso_sptCubeSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptCubeCalc, sizeof( mso_sptCubeCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault5400,
- (SvxMSDffTextRectangles*)mso_sptCubeTextRect, sizeof( mso_sptCubeTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 10800, 10800,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptBevelVert[] =
-{
- { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 },
- { 0, 0 }, { 21600, 0 }, { 1 MSO_I, 0 MSO_I }, { 0 MSO_I, 0 MSO_I },
- { 21600, 0 }, { 21600, 21600 }, { 1 MSO_I, 1 MSO_I }, { 1 MSO_I, 0 MSO_I },
- { 21600, 21600 }, { 0, 21600 }, { 0 MSO_I, 1 MSO_I }, { 1 MSO_I, 1 MSO_I },
- { 0, 21600 }, { 0, 0 }, { 0 MSO_I, 0 MSO_I }, { 0 MSO_I, 1 MSO_I }
-};
-static const sal_uInt16 mso_sptBevelSegm[] =
-{
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptBevelCalc[] =
-{
- { 0x2001, DFF_Prop_adjustValue, 21599, 21600 },
- { 0x8000, 21600, 0, 0x400 }
-};
-static const SvxMSDffTextRectangles mso_sptBevelTextRect[] =
-{
- { { 0 MSO_I, 0 MSO_I }, { 1 MSO_I, 1 MSO_I } }
-};
-static const mso_CustomShape msoBevel =
-{
- (SvxMSDffVertPair*)mso_sptBevelVert, sizeof( mso_sptBevelVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptBevelSegm, sizeof( mso_sptBevelSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptBevelCalc, sizeof( mso_sptBevelCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault2700,
- (SvxMSDffTextRectangles*)mso_sptBevelTextRect, sizeof( mso_sptBevelTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 10800, 10800,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptFoldedCornerVert[] = // adjustment1 : x 10800 - 21600
-{
- { 0, 0 }, { 21600, 0 }, { 21600, 0 MSO_I }, { 0 MSO_I, 21600 },
- { 0, 21600 }, { 0 MSO_I, 21600 }, { 3 MSO_I, 0 MSO_I }, { 8 MSO_I, 9 MSO_I },
- { 10 MSO_I, 11 MSO_I }, { 21600, 0 MSO_I }
-};
-static const sal_uInt16 mso_sptFoldedCornerSegm[] =
-{
- 0x4000, 0x0004, 0x6001, 0x8000,
- 0x4000, 0x0001, 0x2001, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptFoldedCornerCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x8000, 21600, 0, 0x400 },
- { 0x2001, 0x0401, 8000, 10800 },
- { 0x8000, 21600, 0, 0x0402 },
- { 0x2001, 0x0401, 1, 2 },
- { 0x2001, 0x0401, 1, 4 },
- { 0x2001, 0x0401, 1, 7 },
- { 0x2001, 0x0401, 1, 16 },
- { 0x6000, 0x0403, 0x405, 0 },
- { 0x6000, 0x0400, 0x406, 0 },
- { 0x8000, 21600, 0, 0x404 },
- { 0x6000, 0x400, 0x407, 0 }
-};
-static const sal_Int32 mso_sptFoldedCornerDefault[] =
-{
- 1, 18900
-};
-static const SvxMSDffTextRectangles mso_sptFoldedCornerTextRect[] =
-{
- { { 0, 0 }, { 21600, 11 MSO_I } }
-};
-static const mso_CustomShape msoFoldedCorner =
-{
- (SvxMSDffVertPair*)mso_sptFoldedCornerVert, sizeof( mso_sptFoldedCornerVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptFoldedCornerSegm, sizeof( mso_sptFoldedCornerSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptFoldedCornerCalc, sizeof( mso_sptFoldedCornerCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptFoldedCornerDefault,
- (SvxMSDffTextRectangles*)mso_sptFoldedCornerTextRect, sizeof( mso_sptFoldedCornerTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptStandardGluePoints, sizeof( mso_sptStandardGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptActionButtonBlankVert[] =
-{
- { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 },
- { 0, 0 }, { 21600, 0 }, { 1 MSO_I, 0 MSO_I }, { 0 MSO_I, 0 MSO_I },
- { 21600, 0 }, { 21600, 21600 }, { 1 MSO_I, 1 MSO_I }, { 1 MSO_I, 0 MSO_I },
- { 21600, 21600 }, { 0, 21600 }, { 0 MSO_I, 1 MSO_I }, { 1 MSO_I, 1 MSO_I },
- { 0, 21600 }, { 0, 0 }, { 0 MSO_I, 0 MSO_I }, { 0 MSO_I, 1 MSO_I }
-};
-static const sal_uInt16 mso_sptActionButtonBlankSegm[] =
-{
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptActionButtonBlankCalc[] =
-{
- { 0x2001, DFF_Prop_adjustValue, 21599, 21600 },
- { 0x8000, 21600, 0, 0x400 }
-};
-static const SvxMSDffTextRectangles mso_sptActionButtonBlankTextRect[] =
-{
- { { 0 MSO_I, 0 MSO_I }, { 1 MSO_I, 1 MSO_I } }
-};
-static const mso_CustomShape msoActionButtonBlank =
-{
- (SvxMSDffVertPair*)mso_sptActionButtonBlankVert, sizeof( mso_sptActionButtonBlankVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptActionButtonBlankSegm, sizeof( mso_sptActionButtonBlankSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptActionButtonBlankCalc, sizeof( mso_sptActionButtonBlankCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault1400,
- (SvxMSDffTextRectangles*)mso_sptActionButtonBlankTextRect, sizeof( mso_sptActionButtonBlankTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 10800, 10800,
- NULL, 0
-};
-
-static const SvxMSDffTextRectangles mso_sptActionButtonTextRect[] =
-{
- { { 1 MSO_I, 2 MSO_I }, { 3 MSO_I, 4 MSO_I } }
-};
-static const SvxMSDffVertPair mso_sptActionButtonHomeVert[] =
-{
- { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 },
- { 0, 0 }, { 21600, 0 }, { 3 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I },
- { 21600, 0 }, { 21600, 21600 }, { 3 MSO_I, 4 MSO_I }, { 3 MSO_I, 2 MSO_I },
- { 21600, 21600 }, { 0, 21600 }, { 1 MSO_I, 4 MSO_I }, { 3 MSO_I, 4 MSO_I },
- { 0, 21600 }, { 0, 0 }, { 1 MSO_I, 2 MSO_I }, { 1 MSO_I, 4 MSO_I },
-
- { 10800, 0xa MSO_I }, { 0xc MSO_I, 0xe MSO_I }, { 0xc MSO_I, 0x10 MSO_I }, { 0x12 MSO_I, 0x10 MSO_I },
- { 0x12 MSO_I, 0x14 MSO_I }, { 0x16 MSO_I, 10800 }, { 0x18 MSO_I, 10800 }, { 0x18 MSO_I, 0x1a MSO_I },
- { 0x1c MSO_I, 0x1a MSO_I }, { 0x1c MSO_I, 10800 }, { 0x1e MSO_I, 10800 },
-
- { 0xc MSO_I, 0xe MSO_I }, { 0xc MSO_I, 0x10 MSO_I }, { 0x12 MSO_I, 0x10 MSO_I },{ 0x12 MSO_I, 0x14 MSO_I },
-
- { 0x20 MSO_I, 0x24 MSO_I }, { 0x22 MSO_I, 0x24 MSO_I }, { 0x22 MSO_I, 0x1a MSO_I }, { 0x18 MSO_I, 0x1a MSO_I },
- { 0x18 MSO_I, 10800 }, { 0x1c MSO_I, 10800 }, { 0x1c MSO_I, 0x1a MSO_I }, { 0x20 MSO_I, 0x1a MSO_I }
-
-};
-static const sal_uInt16 mso_sptActionButtonHomeSegm[] =
-{
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x000a, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0007, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptActionButtonHomeCalc[] = // adj value 0 - 5400
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x6000, DFF_Prop_geoLeft, DFF_Prop_adjustValue, 0 },
- { 0x6000, DFF_Prop_geoTop, DFF_Prop_adjustValue, 0 },
- { 0xa000, DFF_Prop_geoRight, 0, DFF_Prop_adjustValue },
- { 0xa000, DFF_Prop_geoBottom, 0, DFF_Prop_adjustValue },
- { 0x8000, 10800, 0, DFF_Prop_adjustValue },
- { 0x2001, 0x0405, 1, 10800 }, // scaling 6
- { 0x6000, DFF_Prop_geoRight, DFF_Prop_geoLeft, 10800 }, // lr center 7
- { 0x6000, DFF_Prop_geoBottom, DFF_Prop_geoTop, 10800 }, // ul center 8
-
- { 0x4001, -8000, 0x0406, 1 }, // 9
- { 0x6000, 0x0409, 0x0408, 0 }, // a
- { 0x4001, 2960, 0x0406, 1 }, // b
- { 0x6000, 0x040b, 0x0407, 0 }, // c
- { 0x4001, -5000, 0x0406, 1 }, // d
- { 0x6000, 0x040d, 0x0408, 0 }, // e
- { 0x4001, -7000, 0x0406, 1 }, // f
- { 0x6000, 0x040f, 0x0408, 0 }, // 10
- { 0x4001, 5000, 0x0406, 1 }, // 11
- { 0x6000, 0x0411, 0x0407, 0 }, // 12
- { 0x4001, -2960, 0x0406, 1 }, // 13
- { 0x6000, 0x0413, 0x0408, 0 }, // 14
- { 0x4001, 8000, 0x0406, 1 }, // 15
- { 0x6000, 0x0415,0x0407, 0 }, // 16
- { 0x4001, 6100, 0x0406, 1 }, // 17
- { 0x6000, 0x0417,0x0407, 0 }, // 18
- { 0x4001, 8260, 0x0406, 1 }, // 19
- { 0x6000, 0x0419, 0x0408, 0 }, // 1a
- { 0x4001, -6100, 0x0406, 1 }, // 1b
- { 0x6000, 0x041b, 0x0407, 0 }, // 1c
- { 0x4001, -8000, 0x0406, 1 }, // 1d
- { 0x6000, 0x041d, 0x0407, 0 }, // 1e
- { 0x4001, -1060, 0x0406, 1 }, // 1f
- { 0x6000, 0x041f, 0x0407, 0 }, // 20
- { 0x4001, 1060, 0x0406, 1 }, // 21
- { 0x6000, 0x0421, 0x0407, 0 }, // 22
- { 0x4001, 4020, 0x0406, 1 }, // 23
- { 0x6000, 0x0423, 0x0408, 0 } // 24
-
-};
-static const mso_CustomShape msoActionButtonHome =
-{
- (SvxMSDffVertPair*)mso_sptActionButtonHomeVert, sizeof( mso_sptActionButtonHomeVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptActionButtonHomeSegm, sizeof( mso_sptActionButtonHomeSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptActionButtonHomeCalc, sizeof( mso_sptActionButtonHomeCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault1400,
- (SvxMSDffTextRectangles*)mso_sptActionButtonTextRect, sizeof( mso_sptActionButtonTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptActionButtonHelpVert[] =
-{
- { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 },
- { 0, 0 }, { 21600, 0 }, { 3 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I },
- { 21600, 0 }, { 21600, 21600 }, { 3 MSO_I, 4 MSO_I }, { 3 MSO_I, 2 MSO_I },
- { 21600, 21600 }, { 0, 21600 }, { 1 MSO_I, 4 MSO_I }, { 3 MSO_I, 4 MSO_I },
- { 0, 21600 }, { 0, 0 }, { 1 MSO_I, 2 MSO_I }, { 1 MSO_I,4 MSO_I },
-
- { 0xa MSO_I, 0xc MSO_I }, { 0xe MSO_I, 0x10 MSO_I },
-
- { 0x12 MSO_I, 0x14 MSO_I }, { 0x12 MSO_I, 0x16 MSO_I }, // pp
- { 0x12 MSO_I, 0x18 MSO_I }, { 0x1a MSO_I, 10800 }, { 0x1c MSO_I, 10800 }, // ccp
- { 0x1e MSO_I, 10800 }, { 0x20 MSO_I, 0x22 MSO_I }, { 0x20 MSO_I, 0x24 MSO_I }, // ccp
- { 0x20 MSO_I, 0x26 MSO_I }, { 0x28 MSO_I, 0x2a MSO_I }, { 10800, 0x2a MSO_I }, // ccp
- { 0x2c MSO_I, 0x2a MSO_I }, { 0x2e MSO_I, 0x26 MSO_I }, { 0x2e MSO_I, 0x24 MSO_I }, // ccp
- { 0x30 MSO_I, 0x24 MSO_I }, { 0x30 MSO_I, 0x32 MSO_I }, { 0x34 MSO_I, 0x36 MSO_I }, // ccp
- { 10800, 0x36 MSO_I }, // p
- { 0x12 MSO_I, 0x36 MSO_I }, { 0x1c MSO_I, 0x32 MSO_I }, { 0x1c MSO_I, 0x24 MSO_I }, // ccp
- { 0x1c MSO_I, 0x38 MSO_I }, { 0x3a MSO_I, 0x3c MSO_I }, { 0x12 MSO_I, 0x3c MSO_I }, // ccp
- { 10800, 0x3c MSO_I }, { 0x34 MSO_I, 10800 }, { 0x34 MSO_I, 0x16 MSO_I }, // ccp
- { 0x34 MSO_I, 0x14 MSO_I }
-};
-static const sal_uInt16 mso_sptActionButtonHelpSegm[] =
-{
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0xa302, 0x6000, 0x8000,
- 0x4000, 0x0001, 0x2004, 0x0001, 0x2004, 0x0001, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptActionButtonHelpCalc[] = // adj value 0 - 5400
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x6000, DFF_Prop_geoLeft, DFF_Prop_adjustValue, 0 },
- { 0x6000, DFF_Prop_geoTop, DFF_Prop_adjustValue, 0 },
- { 0xa000, DFF_Prop_geoRight, 0, DFF_Prop_adjustValue },
- { 0xa000, DFF_Prop_geoBottom, 0, DFF_Prop_adjustValue },
- { 0x8000, 10800, 0, DFF_Prop_adjustValue },
- { 0x2001, 0x0405, 1, 10800 }, // scaling 6
- { 0x6000, DFF_Prop_geoRight, DFF_Prop_geoLeft, 10800 }, // lr center 7
- { 0x6000, DFF_Prop_geoBottom, DFF_Prop_geoTop, 10800 }, // ul center 8
-
- { 0x4001, -1690, 0x0406, 1 }, // 9
- { 0x6000, 0x0409, 0x0407, 0 }, // a
- { 0x4001, 4600, 0x0406, 1 }, // b
- { 0x6000, 0x040b, 0x0408, 0 }, // c
- { 0x4001, 1690, 0x0406, 1 }, // d
- { 0x6000, 0x040d, 0x0407, 0 }, // e
- { 0x4001, 7980, 0x0406, 1 }, // f
- { 0x6000, 0x040f, 0x0408, 0 }, // 10
- { 0x4001, 1270, 0x0406, 1 }, // 11
- { 0x6000, 0x0411, 0x0407, 0 }, // 12
- { 0x4001, 4000, 0x0406, 1 }, // 13
- { 0x6000, 0x0413, 0x0408, 0 }, // 14
- { 0x4001, 1750, 0x0406, 1 }, // 15
- { 0x6000, 0x0415, 0x0408, 0 }, // 16
- { 0x4001, 800, 0x0406, 1 }, // 17
- { 0x6000, 0x0417, 0x0408, 0 }, // 18
- { 0x4001, 1650, 0x0406, 1 }, // 19
- { 0x6000, 0x0419, 0x0407, 0 }, // 1a
- { 0x4001, 2340, 0x0406, 1 }, // 1b
- { 0x6000, 0x041b, 0x0407, 0 }, // 1c
- { 0x4001, 3640, 0x0406, 1 }, // 1d
- { 0x6000, 0x041d, 0x0407, 0 }, // 1e
- { 0x4001, 4670, 0x0406, 1 }, // 1f
- { 0x6000, 0x041f, 0x0407, 0 }, // 20
- { 0x4001, -1570, 0x0406, 1 }, // 21
- { 0x6000, 0x0421, 0x0408, 0 }, // 22
- { 0x4001, -3390, 0x0406, 1 }, // 23
- { 0x6000, 0x0423, 0x0408, 0 }, // 24
- { 0x4001, -6050, 0x0406, 1 }, // 25
- { 0x6000, 0x0425, 0x0408, 0 }, // 26
- { 0x4001, 2540, 0x0406, 1 }, // 27
- { 0x6000, 0x0427, 0x0407, 0 }, // 28
- { 0x4001, -8050, 0x0406, 1 }, // 29
- { 0x6000, 0x0429, 0x0408, 0 }, // 2a
- { 0x4001, -2540, 0x0406, 1 }, // 2b
- { 0x6000, 0x042b, 0x0407, 0 }, // 2c
- { 0x4001, -4460, 0x0406, 1 }, // 2d
- { 0x6000, 0x042d, 0x0407, 0 }, // 2e
- { 0x4001, -2330, 0x0406, 1 }, // 2f
- { 0x6000, 0x042f, 0x0407, 0 }, // 30
- { 0x4001, -4700, 0x0406, 1 }, // 31
- { 0x6000, 0x0431, 0x0408, 0 }, // 32
- { 0x4001, -1270, 0x0406, 1 }, // 33
- { 0x6000, 0x0433, 0x0407, 0 }, // 34
- { 0x4001, -5720, 0x0406, 1 }, // 35
- { 0x6000, 0x0435, 0x0408, 0 }, // 36
- { 0x4001, -2540, 0x0406, 1 }, // 37
- { 0x6000, 0x0437, 0x0408, 0 }, // 38
- { 0x4001, 1800, 0x0406, 1 }, // 39
- { 0x6000, 0x0439, 0x0407, 0 }, // 3a
- { 0x4001, -1700, 0x0406, 1 }, // 3b
- { 0x6000, 0x043b, 0x0408, 0 } // 3c
-};
-static const mso_CustomShape msoActionButtonHelp =
-{
- (SvxMSDffVertPair*)mso_sptActionButtonHelpVert, sizeof( mso_sptActionButtonHelpVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptActionButtonHelpSegm, sizeof( mso_sptActionButtonHelpSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptActionButtonHelpCalc, sizeof( mso_sptActionButtonHelpCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault1400,
- (SvxMSDffTextRectangles*)mso_sptActionButtonTextRect, sizeof( mso_sptActionButtonTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptActionButtonInformationVert[] =
-{
- { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 },
- { 0, 0 }, { 21600, 0 }, { 3 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I },
- { 21600, 0 }, { 21600, 21600 }, { 3 MSO_I, 4 MSO_I }, { 3 MSO_I, 2 MSO_I },
- { 21600, 21600 }, { 0, 21600 }, { 1 MSO_I, 4 MSO_I }, { 3 MSO_I, 4 MSO_I },
- { 0, 21600 }, { 0, 0 }, { 1 MSO_I, 2 MSO_I }, { 1 MSO_I, 4 MSO_I },
-
- { 0xa MSO_I, 0xc MSO_I }, { 0xe MSO_I, 0x10 MSO_I },
-
- { 0x12 MSO_I, 0x14 MSO_I }, { 0x16 MSO_I, 0x18 MSO_I },
-
- { 0x1a MSO_I, 0x1c MSO_I }, { 0x1e MSO_I, 0x1c MSO_I }, { 0x1e MSO_I, 0x20 MSO_I }, { 0x22 MSO_I, 0x20 MSO_I },
- { 0x22 MSO_I, 0x24 MSO_I }, { 0x1a MSO_I, 0x24 MSO_I }, { 0x1a MSO_I, 0x20 MSO_I }, { 0x26 MSO_I, 0x20 MSO_I },
- { 0x26 MSO_I, 0x28 MSO_I }, { 0x1a MSO_I, 0x28 MSO_I }
-};
-static const sal_uInt16 mso_sptActionButtonInformationSegm[] =
-{
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0xa302, 0x6000, 0x8000,
- 0xa302, 0x6000, 0x8000,
- 0x4000, 0x0009, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptActionButtonInformationCalc[] = // adj value 0 - 5400
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x6000, DFF_Prop_geoLeft, DFF_Prop_adjustValue, 0 },
- { 0x6000, DFF_Prop_geoTop, DFF_Prop_adjustValue, 0 },
- { 0xa000, DFF_Prop_geoRight, 0, DFF_Prop_adjustValue },
- { 0xa000, DFF_Prop_geoBottom, 0, DFF_Prop_adjustValue },
- { 0x8000, 10800, 0, DFF_Prop_adjustValue },
- { 0x2001, 0x0405, 1, 10800 }, // scaling 6
- { 0x6000, DFF_Prop_geoRight, DFF_Prop_geoLeft, 10800 }, // lr center 7
- { 0x6000, DFF_Prop_geoBottom, DFF_Prop_geoTop, 10800 }, // ul center 8
-
- { 0x4001, -8050, 0x0406, 1 }, // 9
- { 0x6000, 0x0409, 0x0407, 0 }, // a
- { 0x4001, -8050, 0x0406, 1 }, // b
- { 0x6000, 0x040b, 0x0408, 0 }, // c
- { 0x4001, 8050, 0x0406, 1 }, // d
- { 0x6000, 0x040d, 0x0407, 0 }, // e
- { 0x4001, 8050, 0x0406, 1 }, // f
- { 0x6000, 0x040f, 0x0408, 0 }, // 10
-
- { 0x4001, -2060, 0x0406, 1 }, // 11
- { 0x6000, 0x0411, 0x0407, 0 }, // 12
- { 0x4001, -7620, 0x0406, 1 }, // 13
- { 0x6000, 0x0413, 0x0408, 0 }, // 14
- { 0x4001, 2060, 0x0406, 1 }, // 15
- { 0x6000, 0x0415, 0x0407, 0 }, // 16
- { 0x4001, -3500, 0x0406, 1 }, // 17
- { 0x6000, 0x0417, 0x0408, 0 }, // 18
-
- { 0x4001, -2960, 0x0406, 1 }, // 19
- { 0x6000, 0x0419, 0x0407, 0 }, // 1a
- { 0x4001, -2960, 0x0406, 1 }, // 1b
- { 0x6000, 0x041b, 0x0408, 0 }, // 1c
- { 0x4001, 1480, 0x0406, 1 }, // 1d
- { 0x6000, 0x041d, 0x0407, 0 }, // 1e
- { 0x4001, 5080, 0x0406, 1 }, // 1f
- { 0x6000, 0x041f, 0x0408, 0 }, // 20
- { 0x4001, 2960, 0x0406, 1 }, // 21
- { 0x6000, 0x0421, 0x0407, 0 }, // 22
- { 0x4001, 6140, 0x0406, 1 }, // 23
- { 0x6000, 0x0423, 0x0408, 0 }, // 24
- { 0x4001, -1480, 0x0406, 1 }, // 25
- { 0x6000, 0x0425, 0x0407, 0 }, // 26
- { 0x4001, -1920, 0x0406, 1 }, // 27
- { 0x6000, 0x0427, 0x0408, 0 } // 28
-};
-static const mso_CustomShape msoActionButtonInformation =
-{
- (SvxMSDffVertPair*)mso_sptActionButtonInformationVert, sizeof( mso_sptActionButtonInformationVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptActionButtonInformationSegm, sizeof( mso_sptActionButtonInformationSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptActionButtonInformationCalc, sizeof( mso_sptActionButtonInformationCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault1400,
- (SvxMSDffTextRectangles*)mso_sptActionButtonTextRect, sizeof( mso_sptActionButtonTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptActionButtonBackPreviousVert[] =
-{
- { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 },
- { 0, 0 }, { 21600, 0 }, { 3 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I },
- { 21600, 0 }, { 21600, 21600 }, { 3 MSO_I, 4 MSO_I }, { 3 MSO_I, 2 MSO_I },
- { 21600, 21600 }, { 0, 21600 }, { 1 MSO_I, 4 MSO_I }, { 3 MSO_I,4 MSO_I },
- { 0, 21600 }, { 0, 0 }, { 1 MSO_I, 2 MSO_I }, { 1 MSO_I, 4 MSO_I },
-
- { 0xa MSO_I, 10800 }, { 0xe MSO_I, 0xc MSO_I }, { 0xe MSO_I, 0x10 MSO_I }
-};
-static const sal_uInt16 mso_sptActionButtonForwardBackSegm[] =
-{
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0002, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptActionButtonForwardBackCalc[] = // adj value 0 - 5400
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x6000, DFF_Prop_geoLeft, DFF_Prop_adjustValue, 0 },
- { 0x6000, DFF_Prop_geoTop, DFF_Prop_adjustValue, 0 },
- { 0xa000, DFF_Prop_geoRight, 0, DFF_Prop_adjustValue },
- { 0xa000, DFF_Prop_geoBottom, 0, DFF_Prop_adjustValue },
- { 0x8000, 10800, 0, DFF_Prop_adjustValue },
- { 0x2001, 0x0405, 1, 10800 }, // scaling 6
- { 0x6000, DFF_Prop_geoRight, DFF_Prop_geoLeft, 10800 }, // lr center 7
- { 0x6000, DFF_Prop_geoBottom, DFF_Prop_geoTop, 10800 }, // ul center 8
-
- { 0x4001, -8050, 0x0406, 1 }, // 9
- { 0x6000, 0x0409, 0x0407, 0 }, // a
- { 0x4001, -8050, 0x0406, 1 }, // b
- { 0x6000, 0x040b, 0x0408, 0 }, // c
- { 0x4001, 8050, 0x0406, 1 }, // d
- { 0x6000, 0x040d, 0x0407, 0 }, // e
- { 0x4001, 8050, 0x0406, 1 }, // f
- { 0x6000, 0x040f, 0x0408, 0 } // 10
-};
-static const mso_CustomShape msoActionButtonBackPrevious =
-{
- (SvxMSDffVertPair*)mso_sptActionButtonBackPreviousVert, sizeof( mso_sptActionButtonBackPreviousVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptActionButtonForwardBackSegm, sizeof( mso_sptActionButtonForwardBackSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptActionButtonForwardBackCalc, sizeof( mso_sptActionButtonForwardBackCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault1400,
- (SvxMSDffTextRectangles*)mso_sptActionButtonTextRect, sizeof( mso_sptActionButtonTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptActionButtonForwardNextVert[] =
-{
- { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 },
- { 0, 0 }, { 21600, 0 }, { 3 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I },
- { 21600, 0 }, { 21600, 21600 }, { 3 MSO_I, 4 MSO_I }, { 3 MSO_I, 2 MSO_I },
- { 21600, 21600 }, { 0, 21600 }, { 1 MSO_I, 4 MSO_I }, { 3 MSO_I, 4 MSO_I },
- { 0, 21600 }, { 0, 0 }, { 1 MSO_I, 2 MSO_I }, { 1 MSO_I, 4 MSO_I },
-
- { 0xa MSO_I, 0xc MSO_I }, { 0xe MSO_I, 10800 }, { 0xa MSO_I, 0x10 MSO_I }
-};
-static const mso_CustomShape msoActionButtonForwardNext =
-{
- (SvxMSDffVertPair*)mso_sptActionButtonForwardNextVert, sizeof( mso_sptActionButtonForwardNextVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptActionButtonForwardBackSegm, sizeof( mso_sptActionButtonForwardBackSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptActionButtonForwardBackCalc, sizeof( mso_sptActionButtonForwardBackCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault1400,
- (SvxMSDffTextRectangles*)mso_sptActionButtonTextRect, sizeof( mso_sptActionButtonTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptActionButtonBeginningVert[] =
-{
- { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 },
- { 0, 0 }, { 21600, 0 }, { 3 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I },
- { 21600, 0 }, { 21600, 21600 }, { 3 MSO_I, 4 MSO_I }, { 3 MSO_I, 2 MSO_I },
- { 21600, 21600 }, { 0, 21600 }, { 1 MSO_I, 4 MSO_I }, { 3 MSO_I, 4 MSO_I },
- { 0, 21600 }, { 0, 0 }, { 1 MSO_I, 2 MSO_I }, { 1 MSO_I, 4 MSO_I },
-
- { 0xa MSO_I, 10800 }, { 0xe MSO_I, 0xc MSO_I }, { 0xe MSO_I, 0x10 MSO_I }, { 0x12 MSO_I, 0xc MSO_I },
- { 0x14 MSO_I, 0xc MSO_I }, { 0x14 MSO_I, 0x10 MSO_I }, { 0x12 MSO_I, 0x10 MSO_I }
-};
-static const sal_uInt16 mso_sptActionButtonBeginningEndSegm[] =
-{
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
-
- 0x4000, 0x0002, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptActionButtonBeginningEndCalc[] = // adj value 0 - 5400
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x6000, DFF_Prop_geoLeft, DFF_Prop_adjustValue, 0 },
- { 0x6000, DFF_Prop_geoTop, DFF_Prop_adjustValue, 0 },
- { 0xa000, DFF_Prop_geoRight, 0, DFF_Prop_adjustValue },
- { 0xa000, DFF_Prop_geoBottom, 0, DFF_Prop_adjustValue },
- { 0x8000, 10800, 0, DFF_Prop_adjustValue },
- { 0x2001, 0x0405, 1, 10800 }, // scaling 6
- { 0x6000, DFF_Prop_geoRight, DFF_Prop_geoLeft, 10800 }, // lr center 7
- { 0x6000, DFF_Prop_geoBottom, DFF_Prop_geoTop, 10800 }, // ul center 8
-
- { 0x4001, -4020, 0x0406, 1 }, // 9
- { 0x6000, 0x0409, 0x0407, 0 }, // a
- { 0x4001, -8050, 0x0406, 1 }, // b
- { 0x6000, 0x040b, 0x0408, 0 }, // c
- { 0x4001, 8050, 0x0406, 1 }, // d
- { 0x6000, 0x040d, 0x0407, 0 }, // e
- { 0x4001, 8050, 0x0406, 1 }, // f
- { 0x6000, 0x040f, 0x0408, 0 }, // 10
-
- { 0x4001, -8050, 0x0406, 1 }, // 11
- { 0x6000, 0x0411, 0x0407, 0 }, // 12
- { 0x4001, -6140, 0x0406, 1 }, // 13
- { 0x6000, 0x0413, 0x0407, 0 }, // 14
-
-
- { 0x4001, 4020, 0x0406, 1 }, // 15
- { 0x6000, 0x0415, 0x0407, 0 }, // 16
- { 0x4001, 6140, 0x0406, 1 }, // 17
- { 0x6000, 0x0417, 0x0407, 0 } // 18
-};
-static const mso_CustomShape msoActionButtonBeginning =
-{
- (SvxMSDffVertPair*)mso_sptActionButtonBeginningVert, sizeof( mso_sptActionButtonBeginningVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptActionButtonBeginningEndSegm, sizeof( mso_sptActionButtonBeginningEndSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptActionButtonBeginningEndCalc, sizeof( mso_sptActionButtonBeginningEndCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault1400,
- (SvxMSDffTextRectangles*)mso_sptActionButtonTextRect, sizeof( mso_sptActionButtonTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptActionButtonEndVert[] =
-{
- { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 },
- { 0, 0 }, { 21600, 0 }, { 3 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I },
- { 21600, 0 }, { 21600, 21600 }, { 3 MSO_I, 4 MSO_I }, { 3 MSO_I, 2 MSO_I },
- { 21600, 21600 }, { 0, 21600 }, { 1 MSO_I, 4 MSO_I }, { 3 MSO_I, 4 MSO_I },
- { 0, 21600 }, { 0, 0 }, { 1 MSO_I, 2 MSO_I }, { 1 MSO_I, 4 MSO_I },
-
- { 0x16 MSO_I, 10800 }, { 0x12 MSO_I, 0x10 MSO_I }, { 0x12 MSO_I, 0xc MSO_I },
-
- { 0x18 MSO_I, 0xc MSO_I }, { 0x18 MSO_I, 0x10 MSO_I }, { 0xe MSO_I, 0x10 MSO_I }, { 0xe MSO_I, 0xc MSO_I }
-};
-static const mso_CustomShape msoActionButtonEnd =
-{
- (SvxMSDffVertPair*)mso_sptActionButtonEndVert, sizeof( mso_sptActionButtonEndVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptActionButtonBeginningEndSegm, sizeof( mso_sptActionButtonBeginningEndSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptActionButtonBeginningEndCalc, sizeof( mso_sptActionButtonBeginningEndCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault1400,
- (SvxMSDffTextRectangles*)mso_sptActionButtonTextRect, sizeof( mso_sptActionButtonTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptActionButtonReturnVert[] =
-{
- { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 },
- { 0, 0 }, { 21600, 0 }, { 3 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I },
- { 21600, 0 }, { 21600, 21600 }, { 3 MSO_I, 4 MSO_I }, { 3 MSO_I, 2 MSO_I },
- { 21600, 21600 }, { 0, 21600 }, { 1 MSO_I, 4 MSO_I }, { 3 MSO_I, 4 MSO_I },
- { 0, 21600 }, { 0, 0 }, { 1 MSO_I, 2 MSO_I }, { 1 MSO_I, 4 MSO_I },
-
- { 0xa MSO_I, 0xc MSO_I }, { 0xe MSO_I, 0xc MSO_I }, { 0xe MSO_I, 0x10 MSO_I }, // ppp
- { 0xe MSO_I, 0x12 MSO_I }, { 0x14 MSO_I, 0x16 MSO_I }, { 0x18 MSO_I, 0x16 MSO_I }, // ccp
- { 10800, 0x16 MSO_I }, // p
- { 0x1a MSO_I, 0x16 MSO_I }, { 0x1c MSO_I, 0x12 MSO_I }, { 0x1c MSO_I, 0x10 MSO_I }, // ccp
- { 0x1c MSO_I, 0xc MSO_I }, { 10800, 0xc MSO_I }, { 0x1e MSO_I, 0x20 MSO_I }, { 0x22 MSO_I, 0xc MSO_I }, // pppp
- { 0x24 MSO_I, 0xc MSO_I }, { 0x24 MSO_I, 0x10 MSO_I }, // pp
- { 0x24 MSO_I, 0x26 MSO_I }, { 0x28 MSO_I, 0x2a MSO_I }, { 10800, 0x2a MSO_I }, // ccp
- { 0x18 MSO_I, 0x2a MSO_I }, // p
- { 0x2c MSO_I, 0x2a MSO_I }, { 0xa MSO_I, 0x26 MSO_I }, { 0xa MSO_I, 0x10 MSO_I } // ccp
-};
-static const sal_uInt16 mso_sptActionButtonReturnSegm[] =
-{
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0002, 0x2001, 0x0001, 0x2001, 0x0006,0x2001, 0x0001, 0x2001, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptActionButtonReturnCalc[] = // adj value 0 - 5400
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x6000, DFF_Prop_geoLeft, DFF_Prop_adjustValue, 0 },
- { 0x6000, DFF_Prop_geoTop, DFF_Prop_adjustValue, 0 },
- { 0xa000, DFF_Prop_geoRight, 0, DFF_Prop_adjustValue },
- { 0xa000, DFF_Prop_geoBottom, 0, DFF_Prop_adjustValue },
- { 0x8000, 10800, 0, DFF_Prop_adjustValue },
- { 0x2001, 0x0405, 1, 10800 }, // scaling 6
- { 0x6000, DFF_Prop_geoRight, DFF_Prop_geoLeft, 10800 }, // lr center 7
- { 0x6000, DFF_Prop_geoBottom, DFF_Prop_geoTop, 10800 }, // ul center 8
-
- { 0x4001, -8050, 0x0406, 1 }, // 9
- { 0x6000, 0x0409, 0x0407, 0 }, // a
- { 0x4001, -3800, 0x0406, 1 }, // b
- { 0x6000, 0x040b, 0x0408, 0 }, // c
- { 0x4001, -4020, 0x0406, 1 }, // d
- { 0x6000, 0x040d, 0x0407, 0 }, // e
- { 0x4001, 2330, 0x0406, 1 }, // f
- { 0x6000, 0x040f, 0x0408, 0 }, // 10
- { 0x4001, 3390, 0x0406, 1 }, // 11
- { 0x6000, 0x0411, 0x0408, 0 }, // 12
- { 0x4001, -3100, 0x0406, 1 }, // 13
- { 0x6000, 0x0413, 0x0407, 0 }, // 14
- { 0x4001, 4230, 0x0406, 1 }, // 15
- { 0x6000, 0x0415, 0x0408, 0 }, // 16
- { 0x4001, -1910, 0x0406, 1 }, // 17
- { 0x6000, 0x0417, 0x0407, 0 }, // 18
- { 0x4001, 1190, 0x0406, 1 }, // 19
- { 0x6000, 0x0419, 0x0407, 0 }, // 1a
- { 0x4001, 2110, 0x0406, 1 }, // 1b
- { 0x6000, 0x041b, 0x0407, 0 }, // 1c
- { 0x4001, 4030, 0x0406, 1 }, // 1d
- { 0x6000, 0x041d, 0x0407, 0 }, // 1e
- { 0x4001, -7830, 0x0406, 1 }, // 1f
- { 0x6000, 0x041f, 0x0408, 0 }, // 20
- { 0x4001, 8250, 0x0406, 1 }, // 21
- { 0x6000, 0x0421, 0x0407, 0 }, // 22
- { 0x4001, 6140, 0x0406, 1 }, // 23
- { 0x6000, 0x0423, 0x0407, 0 }, // 24
- { 0x4001, 5510, 0x0406, 1 }, // 25
- { 0x6000, 0x0425, 0x0408, 0 }, // 26
- { 0x4001, 3180, 0x0406, 1 }, // 27
- { 0x6000, 0x0427, 0x0407, 0 }, // 28
- { 0x4001, 8450, 0x0406, 1 }, // 29
- { 0x6000, 0x0429, 0x0408, 0 }, // 2a
- { 0x4001, -5090, 0x0406, 1 }, // 2b
- { 0x6000, 0x042b, 0x0407, 0 } // 2c
-};
-static const mso_CustomShape msoActionButtonReturn =
-{
- (SvxMSDffVertPair*)mso_sptActionButtonReturnVert, sizeof( mso_sptActionButtonReturnVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptActionButtonReturnSegm, sizeof( mso_sptActionButtonReturnSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptActionButtonReturnCalc, sizeof( mso_sptActionButtonReturnCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault1400,
- (SvxMSDffTextRectangles*)mso_sptActionButtonTextRect, sizeof( mso_sptActionButtonTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptActionButtonDocumentVert[] =
-{
- { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 },
- { 0, 0 }, { 21600, 0 }, { 3 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I },
- { 21600, 0 }, { 21600, 21600 }, { 3 MSO_I, 4 MSO_I }, { 3 MSO_I, 2 MSO_I },
- { 21600, 21600 }, { 0, 21600 }, { 1 MSO_I, 4 MSO_I }, { 3 MSO_I, 4 MSO_I },
- { 0, 21600 }, { 0, 0 }, { 1 MSO_I, 2 MSO_I }, { 1 MSO_I, 4 MSO_I },
-
- { 0xa MSO_I, 0xc MSO_I }, { 0xe MSO_I, 0xc MSO_I }, { 0x10 MSO_I, 0x12 MSO_I }, { 0x10 MSO_I, 0x14 MSO_I },
- { 0xa MSO_I, 0x14 MSO_I }, { 0xe MSO_I, 0xc MSO_I }, { 0x10 MSO_I, 0x12 MSO_I }, { 0xe MSO_I, 0x12 MSO_I }
-};
-static const sal_uInt16 mso_sptActionButtonDocumentSegm[] =
-{
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
-
- 0x4000, 0x0004, 0x6001, 0x8000,
- 0x4000, 0x0002, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptActionButtonDocumentCalc[] = // adj value 0 - 5400
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x6000, DFF_Prop_geoLeft, DFF_Prop_adjustValue, 0 },
- { 0x6000, DFF_Prop_geoTop, DFF_Prop_adjustValue, 0 },
- { 0xa000, DFF_Prop_geoRight, 0, DFF_Prop_adjustValue },
- { 0xa000, DFF_Prop_geoBottom, 0, DFF_Prop_adjustValue },
- { 0x8000, 10800, 0, DFF_Prop_adjustValue },
- { 0x2001, 0x0405, 1, 10800 }, // scaling 6
- { 0x6000, DFF_Prop_geoRight, DFF_Prop_geoLeft, 10800 }, // lr center 7
- { 0x6000, DFF_Prop_geoBottom, DFF_Prop_geoTop, 10800 }, // ul center 8
-
- { 0x4001, -6350, 0x0406, 1 }, // 9
- { 0x6000, 0x0409, 0x0407, 0 }, // a
- { 0x4001, -7830, 0x0406, 1 }, // b
- { 0x6000, 0x040b, 0x0408, 0 }, // c
- { 0x4001, 1690, 0x0406, 1 }, // d
- { 0x6000, 0x040d, 0x0407, 0 }, // e
- { 0x4001, 6350, 0x0406, 1 }, // f
- { 0x6000, 0x040f, 0x0407, 0 }, // 10
- { 0x4001, -3810, 0x0406, 1 }, // 11
- { 0x6000, 0x0411, 0x0408, 0 }, // 12
- { 0x4001, 7830, 0x0406, 1 }, // 13
- { 0x6000, 0x0413, 0x0408, 0 } // 14
-};
-static const mso_CustomShape msoActionButtonDocument =
-{
- (SvxMSDffVertPair*)mso_sptActionButtonDocumentVert, sizeof( mso_sptActionButtonDocumentVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptActionButtonDocumentSegm, sizeof( mso_sptActionButtonDocumentSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptActionButtonDocumentCalc, sizeof( mso_sptActionButtonDocumentCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault1400,
- (SvxMSDffTextRectangles*)mso_sptActionButtonTextRect, sizeof( mso_sptActionButtonTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptActionButtonSoundVert[] =
-{
- { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 },
- { 0, 0 }, { 21600, 0 }, { 3 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I },
- { 21600, 0 }, { 21600, 21600 }, { 3 MSO_I, 4 MSO_I }, { 3 MSO_I, 2 MSO_I },
- { 21600, 21600 }, { 0, 21600 }, { 1 MSO_I, 4 MSO_I }, { 3 MSO_I, 4 MSO_I },
- { 0, 21600 }, { 0, 0 }, { 1 MSO_I, 2 MSO_I }, { 1 MSO_I, 4 MSO_I },
-
- { 0xa MSO_I, 0xc MSO_I }, { 0xe MSO_I, 0xc MSO_I }, { 0x10 MSO_I, 0x12 MSO_I }, { 0x10 MSO_I, 0x14 MSO_I },
- { 0xe MSO_I, 0x16 MSO_I }, { 0xa MSO_I, 0x16 MSO_I }, { 0x18 MSO_I, 10800 }, { 0x1a MSO_I, 10800 },
-
- { 0x18 MSO_I, 0xc MSO_I }, { 0x1a MSO_I, 0x1c MSO_I },
-
- { 0x18 MSO_I, 0x16 MSO_I }, { 0x1a MSO_I, 0x1e MSO_I }
-};
-static const sal_uInt16 mso_sptActionButtonSoundSegm[] =
-{
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
-
- 0x4000, 0x0005, 0x6001, 0x8000,
- 0x4000, 0x0001, 0x8000,
- 0x4000, 0x0001, 0x8000,
- 0x4000, 0x0001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptActionButtonSoundCalc[] = // adj value 0 - 5400
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x6000, DFF_Prop_geoLeft, DFF_Prop_adjustValue, 0 },
- { 0x6000, DFF_Prop_geoTop, DFF_Prop_adjustValue, 0 },
- { 0xa000, DFF_Prop_geoRight, 0, DFF_Prop_adjustValue },
- { 0xa000, DFF_Prop_geoBottom, 0, DFF_Prop_adjustValue },
- { 0x8000, 10800, 0, DFF_Prop_adjustValue },
- { 0x2001, 0x0405, 1, 10800 }, // scaling 6
- { 0x6000, DFF_Prop_geoRight, DFF_Prop_geoLeft, 10800 }, // lr center 7
- { 0x6000, DFF_Prop_geoBottom, DFF_Prop_geoTop, 10800 }, // ul center 8
-
- { 0x4001, -8050, 0x0406, 1 }, // 9
- { 0x6000, 0x0409, 0x0407, 0 }, // a
- { 0x4001, -2750, 0x0406, 1 }, // b
- { 0x6000, 0x040b, 0x0408, 0 }, // c
- { 0x4001, -2960, 0x0406, 1 }, // d
- { 0x6000, 0x040d, 0x0407, 0 }, // e
- { 0x4001, 2120, 0x0406, 1 }, // f
- { 0x6000, 0x040f, 0x0407, 0 }, // 10
- { 0x4001, -8050, 0x0406, 1 }, // 11
- { 0x6000, 0x0411, 0x0408, 0 }, // 12
- { 0x4001, 8050, 0x0406, 1 }, // 13
- { 0x6000, 0x0413, 0x0408, 0 }, // 14
- { 0x4001, 2750, 0x0406, 1 }, // 15
- { 0x6000, 0x0415, 0x0408, 0 }, // 16
- { 0x4001, 4020, 0x0406, 1 }, // 17
- { 0x6000, 0x0417, 0x0407, 0 }, // 18
- { 0x4001, 8050, 0x0406, 1 }, // 19
- { 0x6000, 0x0419, 0x0407, 0 }, // 1a
- { 0x4001, -5930, 0x0406, 1 }, // 1b
- { 0x6000, 0x041b, 0x0408, 0 }, // 1c
- { 0x4001, 5930, 0x0406, 1 }, // 1d
- { 0x6000, 0x041d, 0x0408, 0 } // 1e
-};
-static const mso_CustomShape msoActionButtonSound =
-{
- (SvxMSDffVertPair*)mso_sptActionButtonSoundVert, sizeof( mso_sptActionButtonSoundVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptActionButtonSoundSegm, sizeof( mso_sptActionButtonSoundSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptActionButtonSoundCalc, sizeof( mso_sptActionButtonSoundCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault1400,
- (SvxMSDffTextRectangles*)mso_sptActionButtonTextRect, sizeof( mso_sptActionButtonTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptActionButtonMovieVert[] =
-{
- { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 },
- { 0, 0 }, { 21600, 0 }, { 3 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I },
- { 21600, 0 }, { 21600, 21600 }, { 3 MSO_I, 4 MSO_I }, { 3 MSO_I, 2 MSO_I },
- { 21600, 21600 }, { 0, 21600 }, { 1 MSO_I, 4 MSO_I }, { 3 MSO_I, 4 MSO_I },
- { 0, 21600 }, { 0, 0 }, { 1 MSO_I, 2 MSO_I }, { 1 MSO_I, 4 MSO_I },
-
- { 0xa MSO_I, 0xc MSO_I }, { 0xe MSO_I, 0xc MSO_I }, { 0x10 MSO_I, 0x12 MSO_I }, { 0x14 MSO_I, 0x12 MSO_I },
- { 0x16 MSO_I, 0x18 MSO_I }, { 0x16 MSO_I, 0x1a MSO_I }, { 0x1c MSO_I, 0x1a MSO_I }, { 0x1e MSO_I, 0x18 MSO_I },
- { 0x20 MSO_I, 0x18 MSO_I }, { 0x20 MSO_I, 0x22 MSO_I }, { 0x1e MSO_I, 0x22 MSO_I }, { 0x1c MSO_I, 0x24 MSO_I },
- { 0x16 MSO_I, 0x24 MSO_I }, { 0x16 MSO_I, 0x26 MSO_I }, { 0x2a MSO_I, 0x26 MSO_I }, { 0x2a MSO_I, 0x28 MSO_I },
- { 0x10 MSO_I, 0x28 MSO_I }, { 0xe MSO_I, 0x2c MSO_I }, { 0xa MSO_I, 0x2c MSO_I }
-};
-static const sal_uInt16 mso_sptActionButtonMovieSegm[] =
-{
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0003, 0x6001, 0x8000,
- 0x4000, 0x0012, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptActionButtonMovieCalc[] = // adj value 0 - 5400
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x6000, DFF_Prop_geoLeft, DFF_Prop_adjustValue, 0 },
- { 0x6000, DFF_Prop_geoTop, DFF_Prop_adjustValue, 0 },
- { 0xa000, DFF_Prop_geoRight, 0, DFF_Prop_adjustValue },
- { 0xa000, DFF_Prop_geoBottom, 0, DFF_Prop_adjustValue },
- { 0x8000, 10800, 0, DFF_Prop_adjustValue },
- { 0x2001, 0x0405, 1, 10800 }, // scaling 6
- { 0x6000, DFF_Prop_geoRight, DFF_Prop_geoLeft, 10800 }, // lr center 7
- { 0x6000, DFF_Prop_geoBottom, DFF_Prop_geoTop, 10800 }, // ul center 8
-
- { 0x4001, -8050, 0x0406, 1 }, // 9
- { 0x6000, 0x0409, 0x0407, 0 }, // a
- { 0x4001, -4020, 0x0406, 1 }, // b
- { 0x6000, 0x040b, 0x0408, 0 }, // c
- { 0x4001, -7000, 0x0406, 1 }, // d
- { 0x6000, 0x040d, 0x0407, 0 }, // e
- { 0x4001, -6560, 0x0406, 1 }, // f
- { 0x6000, 0x040f, 0x0407, 0 }, // 10
- { 0x4001, -3600, 0x0406, 1 }, // 11
- { 0x6000, 0x0411, 0x0408, 0 }, // 12
- { 0x4001, 4020, 0x0406, 1 }, // 13
- { 0x6000, 0x0413, 0x0407, 0 }, // 14
- { 0x4001, 4660, 0x0406, 1 }, // 15
- { 0x6000, 0x0415, 0x0407, 0 }, // 16
- { 0x4001, -2960, 0x0406, 1 }, // 17
- { 0x6000, 0x0417, 0x0408, 0 }, // 18
- { 0x4001, -2330, 0x0406, 1 }, // 19
- { 0x6000, 0x0419, 0x0408, 0 }, // 1a
- { 0x4001, 6780, 0x0406, 1 }, // 1b
- { 0x6000, 0x041b, 0x0407, 0 }, // 1c
- { 0x4001, 7200, 0x0406, 1 }, // 1d
- { 0x6000, 0x041d, 0x0407, 0 }, // 1e
- { 0x4001, 8050, 0x0406, 1 }, // 1f
- { 0x6000, 0x041f, 0x0407, 0 }, // 20
- { 0x4001, 2960, 0x0406, 1 }, // 21
- { 0x6000, 0x0421, 0x0408, 0 }, // 22
- { 0x4001, 2330, 0x0406, 1 }, // 23
- { 0x6000, 0x0423, 0x0408, 0 }, // 24
- { 0x4001, 3800, 0x0406, 1 }, // 25
- { 0x6000, 0x0425, 0x0408, 0 }, // 26
- { 0x4001, -1060, 0x0406, 1 }, // 27
- { 0x6000, 0x0427, 0x0408, 0 }, // 28
- { 0x4001, -6350, 0x0406, 1 }, // 29
- { 0x6000, 0x0429, 0x0407, 0 }, // 2a
- { 0x4001, -640, 0x0406, 1 }, // 2b
- { 0x6000, 0x042b, 0x0408, 0 } // 2c
-};
-static const mso_CustomShape msoActionButtonMovie =
-{
- (SvxMSDffVertPair*)mso_sptActionButtonMovieVert, sizeof( mso_sptActionButtonMovieVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptActionButtonMovieSegm, sizeof( mso_sptActionButtonMovieSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptActionButtonMovieCalc, sizeof( mso_sptActionButtonMovieCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault1400,
- (SvxMSDffTextRectangles*)mso_sptActionButtonTextRect, sizeof( mso_sptActionButtonTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptSmileyFaceVert[] = // adj value 15510 - 17520
-{
- { 0, 0 }, { 21600, 21600 }, { 6140, 6350 }, { 8470, 8680 },
- { 13130, 6350 }, { 15460, 8680 }, { 4870, 1 MSO_I }, { 8680, 2 MSO_I },
- { 12920, 2 MSO_I }, { 16730, 1 MSO_I }
-};
-static const sal_uInt16 mso_sptSmileyFaceSegm[] =
-{
- 0xa302, 0x6000, 0x8000,
- 0xa302, 0x6000, 0x8000,
- 0xa302, 0x6000, 0x8000,
- 0x4000, 0x2001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptSmileyFaceCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 15510 },
- { 0x8000, 17520, 0, 0x400 },
- { 0x4000, 15510, 0x400, 0 }
-};
-
-static const SvxMSDffTextRectangles mso_sptSmileyFaceTextRect[] =
-{
- { { 0, 1 MSO_I }, { 4 MSO_I, 21600 } }
-};
-static const sal_Int32 mso_sptSmileyFaceDefault[] =
-{
- 1, 17520
-};
-static const mso_CustomShape msoSmileyFace =
-{
- (SvxMSDffVertPair*)mso_sptSmileyFaceVert, sizeof( mso_sptSmileyFaceVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptSmileyFaceSegm, sizeof( mso_sptSmileyFaceSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptSmileyFaceCalc, sizeof( mso_sptSmileyFaceCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptSmileyFaceDefault,
- (SvxMSDffTextRectangles*)mso_sptEllipseTextRect, sizeof( mso_sptEllipseTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptEllipseGluePoints, sizeof( mso_sptEllipseGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptDonutVert[] = // adj value 0 - 10800
-{
- { 0, 0 }, { 21600, 21600 }, { 0 MSO_I, 0 MSO_I }, { 1 MSO_I, 1 MSO_I }
-};
-static const sal_uInt16 mso_sptDonutSegm[] =
-{
- 0xa302, 0xf8fe, 0xa302, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptDonutCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x8000, 21600, 0, DFF_Prop_adjustValue }
-};
-static const mso_CustomShape msoDonut =
-{
- (SvxMSDffVertPair*)mso_sptDonutVert, sizeof( mso_sptDonutVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptDonutSegm, sizeof( mso_sptDonutSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptDonutCalc, sizeof( mso_sptDonutCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault5400,
- (SvxMSDffTextRectangles*)mso_sptEllipseTextRect, sizeof( mso_sptEllipseTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptEllipseGluePoints, sizeof( mso_sptEllipseGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptNoSmokingVert[] = // adj value 0 - 7200
-{
- { 0, 0 }, { 21600, 21600 }, { 0 MSO_I, 0 MSO_I }, { 1 MSO_I, 1 MSO_I },
- { 9 MSO_I, 0xa MSO_I }, { 0xb MSO_I, 0xc MSO_I }, { 0 MSO_I, 0 MSO_I }, { 1 MSO_I, 1 MSO_I },
- { 0xd MSO_I, 0xe MSO_I }, { 0xf MSO_I, 0x10 MSO_I }
-};
-static const sal_uInt16 mso_sptNoSmokingSegm[] =
-{
- 0xa302, 0xf8fe, 0xa404, 0xf8fe, 0xa404, 0x6000, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptNoSmokingCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 }, // 0
- { 0x8000, 21600, 0, DFF_Prop_adjustValue }, // 1
- { 0x8000, 10800, 0, DFF_Prop_adjustValue }, // 2
- { 0x2001, DFF_Prop_adjustValue, 1, 2 }, // 3
- { 0xa080, 0x403, 0, 0x402 }, // 4
- { 0x8000, 10800, 0, 0x403 }, // 5 x1
- { 0x4000, 10800, 0x403, 0 }, // 6 x2
- { 0x8000, 10800, 0, 0x404 }, // 7 y1
- { 0x4000, 10800, 0x404, 0 }, // 8 y2
- { 0x6081, 0x405, 0x407, 450 }, // 9
- { 0x6082, 0x405, 0x407, 450 }, // a
- { 0x6081, 0x405, 0x408, 450 }, // b
- { 0x6082, 0x405, 0x408, 450 }, // c
- { 0x6081, 0x406, 0x408, 450 }, // d
- { 0x6082, 0x406, 0x408, 450 }, // e
- { 0x6081, 0x406, 0x407, 450 }, // f
- { 0x6082, 0x406, 0x407, 450 } // 10
-};
-static const mso_CustomShape msoNoSmoking =
-{
- (SvxMSDffVertPair*)mso_sptNoSmokingVert, sizeof( mso_sptNoSmokingVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptNoSmokingSegm, sizeof( mso_sptNoSmokingSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptNoSmokingCalc, sizeof( mso_sptNoSmokingCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault2700,
- (SvxMSDffTextRectangles*)mso_sptEllipseTextRect, sizeof( mso_sptEllipseTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptEllipseGluePoints, sizeof( mso_sptEllipseGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptBlockArcVert[] = // adj value 0 (degrees)
-{ // adj value 1: 0 -> 10800;
- { 0, 0 }, { 21600, 21600 }, { 4 MSO_I, 3 MSO_I }, { 2 MSO_I, 3 MSO_I },
- { 5 MSO_I, 5 MSO_I }, { 6 MSO_I, 6 MSO_I }, { 2 MSO_I, 3 MSO_I }, { 4 MSO_I, 3 MSO_I },
- { 0, 0 }, { 21600, 21600 }
-};
-static const sal_uInt16 mso_sptBlockArcSegm[] =
-{
- 0xA404, 0xa504, 0x6001, 0x8000, 0x0002, 0x8000, 0xf8ff
-};
-static const sal_Int32 mso_sptBlockArcDefault[] =
-{
- 2, 180 << 16, 5400
-};
-static const SvxMSDffCalculationData mso_sptBlockArcCalc[] =
-{
- { 0x400a, 10800, DFF_Prop_adjustValue, 0 },
- { 0x4009, 10800, DFF_Prop_adjustValue, 0 },
- { 0x2000, 0x400, 10800, 0 },
- { 0x2000, 0x401, 10800, 0 },
- { 0x8000, 21600, 0, 0x402 },
- { 0x8000, 10800, 0, DFF_Prop_adjust2Value },
- { 0x4000, 10800, DFF_Prop_adjust2Value, 0 },
- { 0x600a, 0x405, DFF_Prop_adjustValue, 0 },
- { 0x6009, 0x405, DFF_Prop_adjustValue, 0 }
-};
-static const mso_CustomShape msoBlockArc =
-{
- (SvxMSDffVertPair*)mso_sptBlockArcVert, sizeof( mso_sptBlockArcVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptBlockArcSegm, sizeof( mso_sptBlockArcSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptBlockArcCalc, sizeof( mso_sptBlockArcCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptBlockArcDefault,
- NULL, 0,
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-// aware : control points are always part of the bounding box
-static const SvxMSDffVertPair mso_sptHeartVert[] =
-{
- { 10800, 21599 }, { 321, 6886 }, { 70, 6036 }, // ppp
- { -9, 5766 }, { -1, 5474 }, { 2, 5192 }, // ccp
- { 6, 4918 }, { 43, 4641 }, { 101, 4370 }, // ccp
- { 159, 4103 }, { 245, 3837 }, { 353, 3582 }, // ccp
- { 460, 3326 }, { 591, 3077 }, { 741, 2839 }, // ccp
- { 892, 2598 }, { 1066, 2369 }, { 1253, 2155 }, // ccp
- { 1443, 1938 }, { 1651, 1732 }, { 1874, 1543 }, // ccp
- { 2097, 1351 }, { 2337, 1174 }, { 2587, 1014 }, // ccp
- { 2839, 854 }, { 3106, 708 }, { 3380, 584 }, // ccp
- { 3656, 459 }, { 3945, 350 }, { 4237, 264 }, // ccp
- { 4533, 176 }, { 4838, 108 }, { 5144, 66 }, // ccp
- { 5454, 22 }, { 5771, 1 }, { 6086, 3 }, // ccp
- { 6407, 7 }, { 6731, 35 }, { 7048, 89 }, // ccp
- { 7374, 144 }, { 7700, 226 }, { 8015, 335 }, // ccp
- { 8344, 447 }, { 8667, 590 }, { 8972, 756 }, // ccp
- { 9297, 932 }, { 9613, 1135 }, { 9907, 1363 }, // ccp
- { 10224, 1609 }, { 10504, 1900 }, { 10802, 2169 }, // ccp
- { 11697, 1363 }, // p
- { 11971, 1116 }, { 12304, 934 }, { 12630, 756 }, // ccp
- { 12935, 590 }, { 13528, 450 }, { 13589, 335 }, // ccp
- { 13901, 226 }, { 14227, 144 }, { 14556, 89 }, // ccp
- { 14872, 35 }, { 15195, 7 }, { 15517, 3 }, // ccp
- { 15830, 0 }, { 16147, 22 }, { 16458, 66 }, // ccp
- { 16764, 109 }, { 17068, 177 }, { 17365, 264 }, // ccp
- { 17658, 349 }, { 17946, 458 }, { 18222, 584 }, // ccp
- { 18496, 708 }, { 18762, 854 }, { 19015, 1014 }, // ccp
- { 19264, 1172 }, { 19504, 1349 }, { 19730, 1543 }, // ccp
- { 19950, 1731 }, { 20158, 1937 }, { 20350, 2155 }, // ccp
- { 20536, 2369 }, { 20710, 2598 }, { 20861, 2839 }, // ccp
- { 21010, 3074 }, { 21143, 3323 }, { 21251, 3582 }, // ccp
- { 21357, 3835 }, { 21443, 4099 }, { 21502, 4370 }, // ccp
- { 21561, 4639 }, { 21595, 4916 }, { 21600, 5192 }, // ccp
- { 21606, 5474 }, { 21584, 5760 }, { 21532, 6036 }, // ccp
- { 21478, 6326 }, { 21366, 6603 }, { 21282, 6887 }, // ccp
- { 10802, 21602 } // p
-};
-static const sal_uInt16 mso_sptHeartSegm[] =
-{
- 0x4000, 0x0002, 0x2010, 0x0001, 0x2010, 0x0001, 0x6001, 0x8000
-};
-static const SvxMSDffTextRectangles mso_sptHeartTextRect[] =
-{
- { { 5080, 2540 }, { 16520, 13550 } }
-};
-static const SvxMSDffVertPair mso_sptHeartGluePoints[] =
-{
- { 10800, 2180 }, { 3090, 10800 }, { 10800, 21600 }, { 18490, 10800 }
-};
-static const sal_Int32 mso_sptHeartBoundRect[] =
-{
- -9, 0, 21606, 21602
-};
-static const mso_CustomShape msoHeart =
-{
- (SvxMSDffVertPair*)mso_sptHeartVert, sizeof( mso_sptHeartVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptHeartSegm, sizeof( mso_sptHeartSegm ) >> 1,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptHeartTextRect, sizeof( mso_sptHeartTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21615, 21602,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptHeartGluePoints, sizeof( mso_sptHeartGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptLightningBoldVert[] =
-{
- { 8458, 0 }, { 0, 3923 }, { 7564, 8416 }, { 4993, 9720 },
- { 12197, 13904 }, { 9987, 14934 }, { 21600, 21600 }, { 14768, 12911 },
- { 16558, 12016 }, { 11030, 6840 }, { 12831, 6120 }, { 8458, 0 }
-};
-static const SvxMSDffTextRectangles mso_sptLightningBoldTextRect[] =
-{
- { { 8680, 7410 }, { 13970, 14190 } }
-};
-static const SvxMSDffVertPair mso_sptLightningBoldGluePoints[] =
-{
- { 8458, 0 }, { 0, 3923 }, { 4993, 9720 }, { 9987, 14934 }, { 21600, 21600 },
- { 16558, 12016 }, { 12831, 6120 }
-};
-static const mso_CustomShape msoLightningBold =
-{
- (SvxMSDffVertPair*)mso_sptLightningBoldVert, sizeof( mso_sptLightningBoldVert ) / sizeof( SvxMSDffVertPair ),
- NULL, 0,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptLightningBoldTextRect, sizeof( mso_sptLightningBoldTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptLightningBoldGluePoints, sizeof( mso_sptLightningBoldGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptSunVert[] = // adj value 2700 -> 10125
-{
- { 0, 10800 }, { 4 MSO_I, 8 MSO_I }, { 4 MSO_I, 9 MSO_I },
- { 0x0a MSO_I, 0x0b MSO_I }, { 0x0c MSO_I, 0x0d MSO_I }, { 0x0e MSO_I, 0x0f MSO_I },
- { 0x10 MSO_I, 0x11 MSO_I }, { 0x12 MSO_I, 0x13 MSO_I }, { 0x14 MSO_I, 0x15 MSO_I },
- { 0x16 MSO_I, 0x17 MSO_I }, { 0x18 MSO_I, 0x19 MSO_I }, { 0x1a MSO_I, 0x1b MSO_I },
- { 0x1c MSO_I, 0x1d MSO_I }, { 0x1e MSO_I, 0x1f MSO_I }, { 0x20 MSO_I, 0x21 MSO_I },
- { 0x22 MSO_I, 0x23 MSO_I }, { 0x24 MSO_I, 0x25 MSO_I }, { 0x26 MSO_I, 0x27 MSO_I },
- { 0x28 MSO_I, 0x29 MSO_I }, { 0x2a MSO_I, 0x2b MSO_I }, { 0x2c MSO_I, 0x2d MSO_I },
- { 0x2e MSO_I, 0x2f MSO_I }, { 0x30 MSO_I, 0x31 MSO_I }, { 0x32 MSO_I, 0x33 MSO_I },
- { 0 MSO_I, 0 MSO_I }, { 1 MSO_I, 1 MSO_I }
-};
-static const sal_uInt16 mso_sptSunSegm[] =
-{
- 0x4000, 0x0002, 0x6001, 0x8000,
- 0x4000, 0x0002, 0x6001, 0x8000,
- 0x4000, 0x0002, 0x6001, 0x8000,
- 0x4000, 0x0002, 0x6001, 0x8000,
- 0x4000, 0x0002, 0x6001, 0x8000,
- 0x4000, 0x0002, 0x6001, 0x8000,
- 0x4000, 0x0002, 0x6001, 0x8000,
- 0x4000, 0x0002, 0x6001, 0x8000,
- 0xa302, 0x6000, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptSunCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x8000, 21600, 0, DFF_Prop_adjustValue },
- { 0x2000, DFF_Prop_adjustValue, 0, 2700 },
- { 0x2001, 0x402, 5080, 7425 },
- { 0x2000, 0x403, 2540, 0 },
- { 0x8000, 10125, 0, DFF_Prop_adjustValue },
- { 0x2001, 0x405, 2120, 7425 },
- { 0x2000, 0x406, 210, 0 },
- { 0x4000, 10800, 0x407, 0 }, // y1 (0x8)
- { 0x8000, 10800, 0, 0x407 }, // y2 (0x9)
- { 0x0081, 0, 10800, 450 }, // 0xa
- { 0x0082, 0, 10800, 450 }, // 0xb
- { 0x6081, 0x404, 0x408, 450 }, // 0xc
- { 0x6082, 0x404, 0x408, 450 }, // 0xd
- { 0x6081, 0x404, 0x409, 450 }, // 0xe
- { 0x6082, 0x404, 0x409, 450 }, // 0xf
- { 0x0081, 0, 10800, 900 }, // 0x10
- { 0x0082, 0, 10800, 900 }, // 0x11
- { 0x6081, 0x404, 0x408, 900 }, // 0x12
- { 0x6082, 0x404, 0x408, 900 }, // 0x13
- { 0x6081, 0x404, 0x409, 900 }, // 0x14
- { 0x6082, 0x404, 0x409, 900 }, // 0x15
- { 0x0081, 0, 10800, 1350 }, // 0x16
- { 0x0082, 0, 10800, 1350 }, // 0x17
- { 0x6081, 0x404, 0x408, 1350 }, // 0x18
- { 0x6082, 0x404, 0x408, 1350 }, // 0x19
- { 0x6081, 0x404, 0x409, 1350 }, // 0x1a
- { 0x6082, 0x404, 0x409, 1350 }, // 0x1b
- { 0x0081, 0, 10800, 1800 }, // 0x1c
- { 0x0082, 0, 10800, 1800 }, // 0x1d
- { 0x6081, 0x404, 0x408, 1800 }, // 0x1e
- { 0x6082, 0x404, 0x408, 1800 }, // 0x1f
- { 0x6081, 0x404, 0x409, 1800 }, // 0x20
- { 0x6082, 0x404, 0x409, 1800 }, // 0x21
- { 0x0081, 0, 10800, 2250 }, // 0x22
- { 0x0082, 0, 10800, 2250 }, // 0x23
- { 0x6081, 0x404, 0x408, 2250 }, // 0x24
- { 0x6082, 0x404, 0x408, 2250 }, // 0x25
- { 0x6081, 0x404, 0x409, 2250 }, // 0x26
- { 0x6082, 0x404, 0x409, 2250 }, // 0x27
- { 0x0081, 0, 10800, 2700 }, // 0x28
- { 0x0082, 0, 10800, 2700 }, // 0x29
- { 0x6081, 0x404, 0x408, 2700 }, // 0x2a
- { 0x6082, 0x404, 0x408, 2700 }, // 0x2b
- { 0x6081, 0x404, 0x409, 2700 }, // 0x2c
- { 0x6082, 0x404, 0x409, 2700 }, // 0x2d
- { 0x0081, 0, 10800, 3150 }, // 0x2e
- { 0x0082, 0, 10800, 3150 }, // 0x2f
- { 0x6081, 0x404, 0x408, 3150 }, // 0x30
- { 0x6082, 0x404, 0x408, 3150 }, // 0x31
- { 0x6081, 0x404, 0x409, 3150 }, // 0x32
- { 0x6082, 0x404, 0x409, 3150 }, // 0x33
- { 0x2081, DFF_Prop_adjustValue, 10800, 450 }, // 0x34 ( textbox )
- { 0x2081, DFF_Prop_adjustValue, 10800, 2250 } // 0x35
-
-};
-static const SvxMSDffTextRectangles mso_sptSunTextRect[] =
-{
- { { 0x34 MSO_I, 0x34 MSO_I }, { 0x35 MSO_I, 0x35 MSO_I } }
-};
-static const mso_CustomShape msoSun =
-{
- (SvxMSDffVertPair*)mso_sptSunVert, sizeof( mso_sptSunVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptSunSegm, sizeof( mso_sptSunSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptSunCalc, sizeof( mso_sptSunCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault5400,
- (SvxMSDffTextRectangles*)mso_sptSunTextRect, sizeof( mso_sptSunTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptStandardGluePoints, sizeof( mso_sptStandardGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptMoonVert[] = // adj value 0 -> 18900
-{
- { 21600, 0 },
- { 3 MSO_I, 4 MSO_I }, { 0 MSO_I, 5080 }, { 0 MSO_I, 10800 }, // ccp
- { 0 MSO_I, 16520 }, { 3 MSO_I, 5 MSO_I }, { 21600, 21600 }, // ccp
- { 9740, 21600 }, { 0, 16730 }, { 0, 10800 }, // ccp
- { 0, 4870 }, { 9740, 0 }, { 21600, 0 } // ccp
-};
-static const sal_uInt16 mso_sptMoonSegm[] =
-{
- 0x4000, 0x2004, 0x6000, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptMoonCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x8000, 21600, 0, DFF_Prop_adjustValue },
- { 0x2001, 0x401, 1, 2 },
- { 0x6000, 0x402, DFF_Prop_adjustValue, 0 },
- { 0x2001, DFF_Prop_adjustValue, 1794, 10000 },
- { 0x8000, 21600, 0, 0x0404 },
- { 0x2001, DFF_Prop_adjustValue, 4000, 18900 },
- { 0x8081, 0, 10800, 0x406 },
- { 0x8082, 0, 10800, 0x406 },
- { 0x6000, 0x407, 0x407, 0 },
- { 0x8000, 21600, 0, 0x408 }
-};
-static const SvxMSDffTextRectangles mso_sptMoonTextRect[] =
-{
- { { 9 MSO_I, 8 MSO_I }, { 0 MSO_I, 0xa MSO_I } }
-};
-static const SvxMSDffVertPair mso_sptMoonGluePoints[] =
-{
- { 21600, 0 }, { 0, 10800 }, { 21600, 21600 }, { 0 MSO_I, 10800 }
-};
-static const mso_CustomShape msoMoon =
-{
- (SvxMSDffVertPair*)mso_sptMoonVert, sizeof( mso_sptMoonVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptMoonSegm, sizeof( mso_sptMoonSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptMoonCalc, sizeof( mso_sptMoonCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault10800,
- (SvxMSDffTextRectangles*)mso_sptMoonTextRect, sizeof( mso_sptMoonTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptMoonGluePoints, sizeof( mso_sptMoonGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptBracketPairVert[] = // adj value 0 -> 10800
-{
- { 0 MSO_I, 0 }, { 0, 1 MSO_I }, // left top alignment
- { 0, 2 MSO_I }, { 0 MSO_I, 21600 }, // left bottom "
- { 3 MSO_I, 21600 }, { 21600, 2 MSO_I }, // right bottom "
- { 21600, 1 MSO_I }, { 3 MSO_I, 0 } // right top "
-};
-static const sal_uInt16 mso_sptBracketPairSegm[] =
-{
- 0x4000, 0xa701, 0x0001, 0xa801, 0x8000,
- 0x4000, 0xa701, 0x0001, 0xa801, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptBracketPairCalc[] =
-{
- { 0x6000, DFF_Prop_geoLeft, DFF_Prop_adjustValue, 0 },
- { 0x6000, DFF_Prop_geoTop, DFF_Prop_adjustValue, 0 },
- { 0xa000, DFF_Prop_geoBottom, 0, DFF_Prop_adjustValue },
- { 0xa000, DFF_Prop_geoRight, 0, DFF_Prop_adjustValue },
- { 0x2082, DFF_Prop_adjustValue, 0, 450 },
- { 0x2000, 0x404, 0, 10800 },
- { 0x8000, 0, 0, DFF_Prop_adjustValue },
- { 0xa000, 0x406, 0, 0x405 },
- { 0xa000, DFF_Prop_geoLeft, 0, 0x407 },
- { 0xa000, DFF_Prop_geoTop, 0, 0x407 },
- { 0x6000, DFF_Prop_geoRight, 0x407, 0 },
- { 0x6000, DFF_Prop_geoBottom, 0x407, 0 },
- { 0xa000, DFF_Prop_geoLeft, 0, 0x405 },
- { 0xa000, DFF_Prop_geoTop, 0, 0x405 },
- { 0x6000, DFF_Prop_geoRight, 0x405, 0 },
- { 0x6000, DFF_Prop_geoBottom, 0x405, 0 }
-};
-static const SvxMSDffTextRectangles mso_sptBracketPairTextRect[] =
-{
- { { 8 MSO_I, 9 MSO_I }, { 0xa MSO_I, 0xb MSO_I } }
-};
-static const mso_CustomShape msoBracketPair =
-{
- (SvxMSDffVertPair*)mso_sptBracketPairVert, sizeof( mso_sptBracketPairVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptBracketPairSegm, sizeof( mso_sptBracketPairSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptBracketPairCalc, sizeof( mso_sptBracketPairCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault3700,
- (SvxMSDffTextRectangles*)mso_sptBracketPairTextRect, sizeof( mso_sptBracketPairTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptStandardGluePoints, sizeof( mso_sptStandardGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const sal_uInt16 mso_sptPlaqueSegm[] =
-{
- 0x4000, 0xa801, 0x0001, 0xa701, 0x0001, 0xa801, 0x0001, 0xa701, 0x6000, 0x8000
-};
-static const SvxMSDffTextRectangles mso_sptPlaqueTextRect[] =
-{
- { { 0xc MSO_I, 0xd MSO_I }, { 0xe MSO_I, 0xf MSO_I } }
-};
-static const mso_CustomShape msoPlaque =
-{
- (SvxMSDffVertPair*)mso_sptBracketPairVert, sizeof( mso_sptBracketPairVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptPlaqueSegm, sizeof( mso_sptPlaqueSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptBracketPairCalc, sizeof( mso_sptBracketPairCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault3600,
- (SvxMSDffTextRectangles*)mso_sptPlaqueTextRect, sizeof( mso_sptPlaqueTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptStandardGluePoints, sizeof( mso_sptStandardGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptBracePairVert[] = // adj value 0 -> 5400
-{
- { 4 MSO_I, 0 }, { 0 MSO_I, 1 MSO_I }, { 0 MSO_I, 6 MSO_I }, { 0 ,10800 }, // left bracket
- { 0 MSO_I, 7 MSO_I }, { 0 MSO_I, 2 MSO_I }, { 4 MSO_I, 21600 },
- { 8 MSO_I, 21600 }, { 3 MSO_I, 2 MSO_I }, { 3 MSO_I, 7 MSO_I }, { 21600, 10800 }, // right bracket
- { 3 MSO_I, 6 MSO_I }, { 3 MSO_I, 1 MSO_I }, { 8 MSO_I, 0 }
-};
-static const sal_uInt16 mso_sptBracePairSegm[] =
-{
- 0x4000, 0xa701, 0x0001, 0xa801, 0xa701, 0x0001, 0xa801, 0x8000,
- 0x4000, 0xa701, 0x0001, 0xa801, 0xa701, 0x0001, 0xa801, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptBracePairCalc[] =
-{
- { 0x6000, DFF_Prop_geoLeft, DFF_Prop_adjustValue, 0 },
- { 0x6000, DFF_Prop_geoTop, DFF_Prop_adjustValue, 0 },
- { 0xa000, DFF_Prop_geoBottom, 0, DFF_Prop_adjustValue },
- { 0xa000, DFF_Prop_geoRight, 0, DFF_Prop_adjustValue },
- { 0x2001, 0x400, 2, 1 }, // 4
- { 0x2001, DFF_Prop_adjustValue, 2, 1 }, // 5
- { 0x8000, 10800, 0, DFF_Prop_adjustValue }, // 6
- { 0x8000, 21600, 0, 0x406 }, // 7
- { 0xa000, DFF_Prop_geoRight, 0, 0x405 }, // 8
- { 0x2001, DFF_Prop_adjustValue, 1, 3 }, // 9
- { 0x6000, 0x409, DFF_Prop_adjustValue, 0 }, // xa
- { 0x6000, DFF_Prop_geoLeft, 0x40a, 0 }, // xb
- { 0x6000, DFF_Prop_geoTop, 0x409, 0 }, // xc
- { 0xa000, DFF_Prop_geoRight, 0, 0x40a }, // xd
- { 0xa000, DFF_Prop_geoBottom, 0, 0x409 } // xe
-
-};
-static const SvxMSDffTextRectangles mso_sptBracePairTextRect[] =
-{
- { { 0xb MSO_I, 0xc MSO_I }, { 0xd MSO_I, 0xe MSO_I } }
-};
-static const mso_CustomShape msoBracePair =
-{
- (SvxMSDffVertPair*)mso_sptBracePairVert, sizeof( mso_sptBracePairVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptBracePairSegm, sizeof( mso_sptBracePairSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptBracePairCalc, sizeof( mso_sptBracePairCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault1800,
- (SvxMSDffTextRectangles*)mso_sptBracePairTextRect, sizeof( mso_sptBracePairTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptStandardGluePoints, sizeof( mso_sptStandardGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffCalculationData mso_sptBracketCalc[] =
-{
- { 0x2001, DFF_Prop_adjustValue, 1, 2 },
- { 0x6000, DFF_Prop_geoTop, DFF_Prop_adjustValue, 0 },
- { 0xa000, DFF_Prop_geoBottom, 0, DFF_Prop_adjustValue },
- { 0x6000, DFF_Prop_geoTop, 0x400, 0 },
- { 0xa000, DFF_Prop_geoBottom, 0, 0x400 }
-};
-static const sal_uInt16 mso_sptBracketSegm[] =
-{
- 0x4000, 0x2001, 0x0001, 0x2001, 0x8000
-};
-static const SvxMSDffVertPair mso_sptLeftBracketVert[] = // adj value 0 -> 10800
-{
- { 21600, 0 }, { 10800, 0 }, { 0, 3 MSO_I }, { 0, 1 MSO_I },
- { 0, 2 MSO_I }, { 0, 4 MSO_I }, { 10800, 21600 }, { 21600, 21600 }
-};
-static const SvxMSDffTextRectangles mso_sptLeftBracketTextRect[] =
-{
- { { 6350, 3 MSO_I }, { 21600, 4 MSO_I } }
-};
-static const SvxMSDffVertPair mso_sptLeftBracketGluePoints[] =
-{
- { 21600, 0 }, { 0, 10800 }, { 21600, 21600 }
-};
-static const mso_CustomShape msoLeftBracket =
-{
- (SvxMSDffVertPair*)mso_sptLeftBracketVert, sizeof( mso_sptLeftBracketVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptBracketSegm, sizeof( mso_sptBracketSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptBracketCalc, sizeof( mso_sptBracketCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault1800,
- (SvxMSDffTextRectangles*)mso_sptLeftBracketTextRect, sizeof( mso_sptLeftBracketTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptLeftBracketGluePoints, sizeof( mso_sptLeftBracketGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-static const SvxMSDffVertPair mso_sptRightBracketVert[] = // adj value 0 -> 10800
-{
- { 0, 0 }, { 10800, 0 }, { 21600, 3 MSO_I }, { 21600, 1 MSO_I },
- { 21600, 2 MSO_I }, { 21600, 4 MSO_I }, { 10800, 21600 }, { 0, 21600 }
-};
-static const SvxMSDffTextRectangles mso_sptRightBracketTextRect[] =
-{
- { { 0, 3 MSO_I }, { 15150, 4 MSO_I } }
-};
-static const SvxMSDffVertPair mso_sptRightBracketGluePoints[] =
-{
- { 0, 0 }, { 0, 21600 }, { 21600, 10800 }
-};
-static const mso_CustomShape msoRightBracket =
-{
- (SvxMSDffVertPair*)mso_sptRightBracketVert, sizeof( mso_sptRightBracketVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptBracketSegm, sizeof( mso_sptBracketSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptBracketCalc, sizeof( mso_sptBracketCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault1800,
- (SvxMSDffTextRectangles*)mso_sptRightBracketTextRect, sizeof( mso_sptRightBracketTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptRightBracketGluePoints, sizeof( mso_sptRightBracketGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffCalculationData mso_sptBraceCalc[] =
-{
- { 0x2001, DFF_Prop_adjustValue, 1, 2 },
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0xa000, 0x404, 0, DFF_Prop_adjustValue },
- { 0xa000, 0x404, 0, 0x400 },
- { 0x2000, DFF_Prop_adjust2Value, 0, 0 },
- { 0x6000, 0x404, 0x400, 0 },
- { 0x6000, 0x404, DFF_Prop_adjustValue, 0 },
- { 0x8000, 21600, 0, DFF_Prop_adjustValue },
- { 0x8000, 21600, 0, 0x400 },
- { 0x2001, DFF_Prop_adjustValue, 10000, 31953 },
- { 0x8000, 21600, 0, 0x409 }
-};
-static const sal_uInt16 mso_sptBraceSegm[] =
-{
- 0x4000, 0x2001, 0x0001, 0x2002, 0x0001, 0x2001, 0x8000
-};
-static const sal_Int32 mso_sptBraceDefault[] =
-{
- 2, 1800, 10800
-};
-static const SvxMSDffVertPair mso_sptLeftBraceVert[] =
-{
- { 21600, 0 }, // p
- { 16200, 0 }, { 10800, 0 MSO_I }, { 10800, 1 MSO_I }, // ccp
- { 10800, 2 MSO_I }, // p
- { 10800, 3 MSO_I }, { 5400, 4 MSO_I }, { 0, 4 MSO_I }, // ccp
- { 5400, 4 MSO_I }, { 10800, 5 MSO_I }, { 10800, 6 MSO_I }, // ccp
- { 10800, 7 MSO_I }, // p
- { 10800, 8 MSO_I }, { 16200, 21600 }, { 21600, 21600 } // ccp
-};
-static const SvxMSDffTextRectangles mso_sptLeftBraceTextRect[] =
-{
- { { 13800, 9 MSO_I }, { 21600, 10 MSO_I } }
-};
-static const mso_CustomShape msoLeftBrace = // adj value0 0 -> 5400
-{ // adj value1 0 -> 21600
- (SvxMSDffVertPair*)mso_sptLeftBraceVert, sizeof( mso_sptLeftBraceVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptBraceSegm, sizeof( mso_sptBraceSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptBraceCalc, sizeof( mso_sptBraceCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptBraceDefault,
- (SvxMSDffTextRectangles*)mso_sptLeftBraceTextRect, sizeof( mso_sptLeftBraceTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptLeftBracketGluePoints, sizeof( mso_sptLeftBracketGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-static const SvxMSDffVertPair mso_sptRightBraceVert[] =
-{
- { 0, 0 }, // p
- { 5400, 0 }, { 10800, 0 MSO_I }, { 10800, 1 MSO_I }, // ccp
- { 10800, 2 MSO_I }, // p
- { 10800, 3 MSO_I }, { 16200, 4 MSO_I }, { 21600, 4 MSO_I }, // ccp
- { 16200, 4 MSO_I }, { 10800, 5 MSO_I }, { 10800, 6 MSO_I }, // ccp
- { 10800, 7 MSO_I }, // p
- { 10800, 8 MSO_I }, { 5400, 21600 }, { 0, 21600 } // ccp
-};
-static const SvxMSDffTextRectangles mso_sptRightBraceTextRect[] =
-{
- { { 0, 9 MSO_I }, { 7800, 10 MSO_I } }
-};
-static const mso_CustomShape msoRightBrace = // adj value0 0 -> 5400
-{ // adj value1 0 -> 21600
- (SvxMSDffVertPair*)mso_sptRightBraceVert, sizeof( mso_sptRightBraceVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptBraceSegm, sizeof( mso_sptBraceSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptBraceCalc, sizeof( mso_sptBraceCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptBraceDefault,
- (SvxMSDffTextRectangles*)mso_sptRightBraceTextRect, sizeof( mso_sptRightBraceTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptRightBracketGluePoints, sizeof( mso_sptRightBracketGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptIrregularSeal1Vert[] =
-{
- { 10901, 5905 }, { 8458, 2399 }, { 7417, 6425 }, { 476, 2399 },
- { 4732, 7722 }, { 106, 8718 }, { 3828, 11880 }, { 243, 14689 },
- { 5772, 14041 }, { 4868, 17719 }, { 7819, 15730 }, { 8590, 21600 },
- { 10637, 15038 }, { 13349, 19840 }, { 14125, 14561 }, { 18248, 18195 },
- { 16938, 13044 }, { 21600, 13393 }, { 17710, 10579 }, { 21198, 8242 },
- { 16806, 7417 }, { 18482, 4560 }, { 14257, 5429 }, { 14623, 106 }, { 10901, 5905 }
-};
-static const SvxMSDffTextRectangles mso_sptIrregularSeal1TextRect[] =
-{
- { { 4680, 6570 }, { 16140, 13280 } }
-};
-static const SvxMSDffVertPair mso_sptIrregularSeal1GluePoints[] =
-{
- { 14623, 106 }, { 106, 8718 }, { 8590, 21600 }, { 21600, 13393 }
-};
-static const mso_CustomShape msoIrregularSeal1 =
-{
- (SvxMSDffVertPair*)mso_sptIrregularSeal1Vert, sizeof( mso_sptIrregularSeal1Vert ) / sizeof( SvxMSDffVertPair ),
- NULL, 0,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptIrregularSeal1TextRect, sizeof( mso_sptIrregularSeal1TextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptIrregularSeal1GluePoints, sizeof( mso_sptIrregularSeal1GluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptIrregularSeal2Vert[] =
-{
- { 11464, 4340 }, { 9722, 1887 }, { 8548, 6383 }, { 4503, 3626 },
- { 5373, 7816 }, { 1174, 8270 }, { 3934, 11592 }, { 0, 12875 },
- { 3329, 15372 }, { 1283, 17824 }, { 4804, 18239 }, { 4918, 21600 },
- { 7525, 18125 }, { 8698, 19712 }, { 9871, 17371 }, { 11614, 18844 },
- { 12178, 15937 }, { 14943, 17371 }, { 14640, 14348 }, { 18878, 15632 },
- { 16382, 12311 }, { 18270, 11292 }, { 16986, 9404 }, { 21600, 6646 },
- { 16382, 6533 }, { 18005, 3172 }, { 14524, 5778 }, { 14789, 0 },
- { 11464, 4340 }
-};
-static const SvxMSDffTextRectangles mso_sptIrregularSeal2TextRect[] =
-{
- { { 5400, 6570 }, { 14160, 15290 } }
-};
-static const SvxMSDffVertPair mso_sptIrregularSeal2GluePoints[] =
-{
- { 9722, 1887 }, { 0, 12875 }, { 11614, 18844 }, { 21600, 6646 }
-};
-static const mso_CustomShape msoIrregularSeal2 =
-{
- (SvxMSDffVertPair*)mso_sptIrregularSeal2Vert, sizeof( mso_sptIrregularSeal2Vert ) / sizeof( SvxMSDffVertPair ),
- NULL, 0,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptIrregularSeal2TextRect, sizeof( mso_sptIrregularSeal2TextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptIrregularSeal2GluePoints, sizeof( mso_sptIrregularSeal2GluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptSeal4Vert[] = // adjustment1 : 0 - 10800
-{
- { 0, 10800 }, { 4 MSO_I, 4 MSO_I }, { 10800, 0 }, { 3 MSO_I, 4 MSO_I },
- { 21600, 10800 }, { 3 MSO_I, 3 MSO_I }, { 10800, 21600 }, { 4 MSO_I, 3 MSO_I },
- { 0, 10800 }
-};
-static const SvxMSDffCalculationData mso_sptSeal4Calc[] =
-{
- { 0x0000, 7600, 0, 0 },
- { 0x6001, 0x400, DFF_Prop_adjustValue, 10800 },
- { 0xa000, 0x400, 0, 0x401 },
- { 0x4000, 10800, 0x402, 0 },
- { 0x8000, 10800, 0, 0x402 }
-};
-static const SvxMSDffTextRectangles mso_sptSeal4TextRect[] =
-{
- { { 4 MSO_I, 4 MSO_I }, { 3 MSO_I, 3 MSO_I } }
-};
-static const mso_CustomShape msoSeal4 =
-{
- (SvxMSDffVertPair*)mso_sptSeal4Vert, sizeof( mso_sptSeal4Vert ) / sizeof( SvxMSDffVertPair ),
- NULL, 0,
- (SvxMSDffCalculationData*)mso_sptSeal4Calc, sizeof( mso_sptSeal4Calc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault8100,
- (SvxMSDffTextRectangles*)mso_sptSeal4TextRect, sizeof( mso_sptSeal4TextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptStarVert[] =
-{
- { 10797, 0 }, { 8278, 8256 }, { 0, 8256 }, { 6722, 13405 },
- { 4198, 21600 }, { 10797, 16580 }, { 17401, 21600 }, { 14878, 13405 },
- { 21600, 8256 }, { 13321, 8256 }, { 10797, 0 }
-};
-static const SvxMSDffTextRectangles mso_sptStarTextRect[] =
-{
- { { 6722, 8256 }, { 14878, 15460 } }
-};
-static const mso_CustomShape msoStar =
-{
- (SvxMSDffVertPair*)mso_sptStarVert, sizeof( mso_sptStarVert ) / sizeof( SvxMSDffVertPair ),
- NULL, 0,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptStarTextRect, sizeof( mso_sptStarTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffCalculationData mso_sptSeal24Calc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 }, // 0x00
- { 0x2081, 0x400, 10800, 3150 }, // 0x01 ( textframe )
- { 0x2082, 0x400, 10800, 3150 }, // 0x02
- { 0x2081, 0x400, 10800, 1350 }, // 0x03
- { 0x2082, 0x400, 10800, 1350 }, // 0x04
- { 0x0081, 0, 10800, 0 },
- { 0x0082, 0, 10800, 0 },
- { 0x2081, 0x400, 10800, 75 },
- { 0x2082, 0x400, 10800, 75 },
- { 0x0081, 0, 10800, 150 },
- { 0x0082, 0, 10800, 150 },
- { 0x2081, 0x400, 10800, 225 },
- { 0x2082, 0x400, 10800, 225 },
- { 0x0081, 0, 10800, 300 },
- { 0x0082, 0, 10800, 300 },
- { 0x2081, 0x400, 10800, 375 },
- { 0x2082, 0x400, 10800, 375 },
- { 0x0081, 0, 10800, 450 },
- { 0x0082, 0, 10800, 450 },
- { 0x2081, 0x400, 10800, 525 },
- { 0x2082, 0x400, 10800, 525 },
- { 0x0081, 0, 10800, 600 },
- { 0x0082, 0, 10800, 600 },
- { 0x2081, 0x400, 10800, 675 },
- { 0x2082, 0x400, 10800, 675 },
- { 0x0081, 0, 10800, 750 },
- { 0x0082, 0, 10800, 750 },
- { 0x2081, 0x400, 10800, 825 },
- { 0x2082, 0x400, 10800, 825 },
- { 0x0081, 0, 10800, 900 },
- { 0x0082, 0, 10800, 900 },
- { 0x2081, 0x400, 10800, 975 },
- { 0x2082, 0x400, 10800, 975 },
- { 0x0081, 0, 10800, 1050 },
- { 0x0082, 0, 10800, 1050 },
- { 0x2081, 0x400, 10800, 1125 },
- { 0x2082, 0x400, 10800, 1125 },
- { 0x0081, 0, 10800, 1200 },
- { 0x0082, 0, 10800, 1200 },
- { 0x2081, 0x400, 10800, 1275 },
- { 0x2082, 0x400, 10800, 1275 },
- { 0x0081, 0, 10800, 1350 },
- { 0x0082, 0, 10800, 1350 },
- { 0x2081, 0x400, 10800, 1425 },
- { 0x2082, 0x400, 10800, 1425 },
- { 0x0081, 0, 10800, 1500 },
- { 0x0082, 0, 10800, 1500 },
- { 0x2081, 0x400, 10800, 1575 },
- { 0x2082, 0x400, 10800, 1575 },
- { 0x0081, 0, 10800, 1650 },
- { 0x0082, 0, 10800, 1650 },
- { 0x2081, 0x400, 10800, 1725 },
- { 0x2082, 0x400, 10800, 1725 },
- { 0x0081, 0, 10800, 1800 },
- { 0x0082, 0, 10800, 1800 },
- { 0x2081, 0x400, 10800, 1875 },
- { 0x2082, 0x400, 10800, 1875 },
- { 0x0081, 0, 10800, 1950 },
- { 0x0082, 0, 10800, 1950 },
- { 0x2081, 0x400, 10800, 2025 },
- { 0x2082, 0x400, 10800, 2025 },
- { 0x0081, 0, 10800, 2100 },
- { 0x0082, 0, 10800, 2100 },
- { 0x2081, 0x400, 10800, 2175 },
- { 0x2082, 0x400, 10800, 2175 },
- { 0x0081, 0, 10800, 2250 },
- { 0x0082, 0, 10800, 2250 },
- { 0x2081, 0x400, 10800, 2325 },
- { 0x2082, 0x400, 10800, 2325 },
- { 0x0081, 0, 10800, 2400 },
- { 0x0082, 0, 10800, 2400 },
- { 0x2081, 0x400, 10800, 2475 },
- { 0x2082, 0x400, 10800, 2475 },
- { 0x0081, 0, 10800, 2550 },
- { 0x0082, 0, 10800, 2550 },
- { 0x2081, 0x400, 10800, 2625 },
- { 0x2082, 0x400, 10800, 2625 },
- { 0x0081, 0, 10800, 2700 },
- { 0x0082, 0, 10800, 2700 },
- { 0x2081, 0x400, 10800, 2775 },
- { 0x2082, 0x400, 10800, 2775 },
- { 0x0081, 0, 10800, 2850 },
- { 0x0082, 0, 10800, 2850 },
- { 0x2081, 0x400, 10800, 2925 },
- { 0x2082, 0x400, 10800, 2925 },
- { 0x0081, 0, 10800, 3000 },
- { 0x0082, 0, 10800, 3000 },
- { 0x2081, 0x400, 10800, 3075 },
- { 0x2082, 0x400, 10800, 3075 },
- { 0x0081, 0, 10800, 3150 },
- { 0x0082, 0, 10800, 3150 },
- { 0x2081, 0x400, 10800, 3225 },
- { 0x2082, 0x400, 10800, 3225 },
- { 0x0081, 0, 10800, 3300 },
- { 0x0082, 0, 10800, 3300 },
- { 0x2081, 0x400, 10800, 3375 },
- { 0x2082, 0x400, 10800, 3375 },
- { 0x0081, 0, 10800, 3450 },
- { 0x0082, 0, 10800, 3450 },
- { 0x2081, 0x400, 10800, 3525 },
- { 0x2082, 0x400, 10800, 3525 }
-};
-static const SvxMSDffVertPair mso_sptSeal8Vert[] = // adj value 0 -> 10800
-{
- { 5 MSO_I, 6 MSO_I }, { 11 MSO_I, 12 MSO_I }, { 17 MSO_I, 18 MSO_I }, { 23 MSO_I, 24 MSO_I },
- { 29 MSO_I, 30 MSO_I }, { 35 MSO_I, 36 MSO_I }, { 41 MSO_I, 42 MSO_I }, { 47 MSO_I, 48 MSO_I },
- { 53 MSO_I, 54 MSO_I }, { 59 MSO_I, 60 MSO_I }, { 65 MSO_I, 66 MSO_I }, { 71 MSO_I, 72 MSO_I },
- { 77 MSO_I, 78 MSO_I }, { 83 MSO_I, 84 MSO_I }, { 89 MSO_I, 90 MSO_I }, { 95 MSO_I, 96 MSO_I },
- { 5 MSO_I, 6 MSO_I }
-};
-static const SvxMSDffTextRectangles mso_sptSealTextRect[] =
-{
- { { 1 MSO_I, 2 MSO_I }, { 3 MSO_I, 4 MSO_I } }
-};
-static const mso_CustomShape msoSeal8 =
-{
- (SvxMSDffVertPair*)mso_sptSeal8Vert, sizeof( mso_sptSeal8Vert ) / sizeof( SvxMSDffVertPair ),
- NULL, 0,
- (SvxMSDffCalculationData*)mso_sptSeal24Calc, sizeof( mso_sptSeal24Calc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault2500,
- (SvxMSDffTextRectangles*)mso_sptSealTextRect, sizeof( mso_sptSealTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-static const SvxMSDffVertPair mso_sptSeal16Vert[] = // adj value 0 -> 10800
-{
- { 0x05 MSO_I, 0x06 MSO_I }, { 0x07 MSO_I, 0x08 MSO_I }, { 0x09 MSO_I, 0x0a MSO_I }, { 0x0b MSO_I, 0x0c MSO_I },
- { 0x0d MSO_I, 0x0e MSO_I }, { 0x0f MSO_I, 0x10 MSO_I }, { 0x11 MSO_I, 0x12 MSO_I }, { 0x13 MSO_I, 0x14 MSO_I },
- { 0x15 MSO_I, 0x16 MSO_I }, { 0x17 MSO_I, 0x18 MSO_I }, { 0x19 MSO_I, 0x1a MSO_I }, { 0x1b MSO_I, 0x1c MSO_I },
- { 0x1d MSO_I, 0x1e MSO_I }, { 0x1f MSO_I, 0x20 MSO_I }, { 0x21 MSO_I, 0x22 MSO_I }, { 0x23 MSO_I, 0x24 MSO_I },
- { 0x25 MSO_I, 0x26 MSO_I }, { 0x27 MSO_I, 0x28 MSO_I }, { 0x29 MSO_I, 0x2a MSO_I }, { 0x2b MSO_I, 0x2c MSO_I },
- { 0x2d MSO_I, 0x2e MSO_I }, { 0x2f MSO_I, 0x30 MSO_I }, { 0x31 MSO_I, 0x32 MSO_I }, { 0x33 MSO_I, 0x34 MSO_I },
- { 0x35 MSO_I, 0x36 MSO_I }, { 0x37 MSO_I, 0x38 MSO_I }, { 0x39 MSO_I, 0x3a MSO_I }, { 0x3b MSO_I, 0x3c MSO_I },
- { 0x3d MSO_I, 0x3e MSO_I }, { 0x3f MSO_I, 0x40 MSO_I }, { 0x41 MSO_I, 0x42 MSO_I }, { 0x43 MSO_I, 0x44 MSO_I },
- { 0x05 MSO_I, 0x06 MSO_I }
-};
-static const SvxMSDffCalculationData mso_sptSeal16Calc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 }, // 0x00
- { 0x2081, 0x400, 10800, 3150 }, // 0x01 ( textframe )
- { 0x2082, 0x400, 10800, 3150 }, // 0x02
- { 0x2081, 0x400, 10800, 1350 }, // 0x03
- { 0x2082, 0x400, 10800, 1350 }, // 0x04
- { 0x0081, 0, 10800, 0 },
- { 0x0082, 0, 10800, 0 },
- { 0x2081, 0x400, 10800, 113 },
- { 0x2082, 0x400, 10800, 113 },
- { 0x0081, 0, 10800, 225 },
- { 0x0082, 0, 10800, 225 },
- { 0x2081, 0x400, 10800, 338 },
- { 0x2082, 0x400, 10800, 338 },
- { 0x0081, 0, 10800, 450 },
- { 0x0082, 0, 10800, 450 },
- { 0x2081, 0x400, 10800, 563 },
- { 0x2082, 0x400, 10800, 563 },
- { 0x0081, 0, 10800, 675 },
- { 0x0082, 0, 10800, 675 },
- { 0x2081, 0x400, 10800, 788 },
- { 0x2082, 0x400, 10800, 788 },
- { 0x0081, 0, 10800, 900 },
- { 0x0082, 0, 10800, 900 },
- { 0x2081, 0x400, 10800, 1013 },
- { 0x2082, 0x400, 10800, 1013 },
- { 0x0081, 0, 10800, 1125 },
- { 0x0082, 0, 10800, 1125 },
- { 0x2081, 0x400, 10800, 1238 },
- { 0x2082, 0x400, 10800, 1238 },
- { 0x0081, 0, 10800, 1350 },
- { 0x0082, 0, 10800, 1350 },
- { 0x2081, 0x400, 10800, 1463 },
- { 0x2082, 0x400, 10800, 1463 },
- { 0x0081, 0, 10800, 1575 },
- { 0x0082, 0, 10800, 1575 },
- { 0x2081, 0x400, 10800, 1688 },
- { 0x2082, 0x400, 10800, 1688 },
- { 0x0081, 0, 10800, 1800 },
- { 0x0082, 0, 10800, 1800 },
- { 0x2081, 0x400, 10800, 1913 },
- { 0x2082, 0x400, 10800, 1913 },
- { 0x0081, 0, 10800, 2025 },
- { 0x0082, 0, 10800, 2025 },
- { 0x2081, 0x400, 10800, 2138 },
- { 0x2082, 0x400, 10800, 2138 },
- { 0x0081, 0, 10800, 2250 },
- { 0x0082, 0, 10800, 2250 },
- { 0x2081, 0x400, 10800, 2363 },
- { 0x2082, 0x400, 10800, 2363 },
- { 0x0081, 0, 10800, 2475 },
- { 0x0082, 0, 10800, 2475 },
- { 0x2081, 0x400, 10800, 2588 },
- { 0x2082, 0x400, 10800, 2588 },
- { 0x0081, 0, 10800, 2700 },
- { 0x0082, 0, 10800, 2700 },
- { 0x2081, 0x400, 10800, 2813 },
- { 0x2082, 0x400, 10800, 2813 },
- { 0x0081, 0, 10800, 2925 },
- { 0x0082, 0, 10800, 2925 },
- { 0x2081, 0x400, 10800, 3038 },
- { 0x2082, 0x400, 10800, 3038 },
- { 0x0081, 0, 10800, 3150 },
- { 0x0082, 0, 10800, 3150 },
- { 0x2081, 0x400, 10800, 3263 },
- { 0x2082, 0x400, 10800, 3263 },
- { 0x0081, 0, 10800, 3375 },
- { 0x0082, 0, 10800, 3375 },
- { 0x2081, 0x400, 10800, 3488 },
- { 0x2082, 0x400, 10800, 3488 }
-};
-static const mso_CustomShape msoSeal16 =
-{
- (SvxMSDffVertPair*)mso_sptSeal16Vert, sizeof( mso_sptSeal16Vert ) / sizeof( SvxMSDffVertPair ),
- NULL, 0,
- (SvxMSDffCalculationData*)mso_sptSeal16Calc, sizeof( mso_sptSeal16Calc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault2500,
- (SvxMSDffTextRectangles*)mso_sptSealTextRect, sizeof( mso_sptSealTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-static const SvxMSDffVertPair mso_sptSeal24Vert[] =
-{
- { 0x05 MSO_I, 0x06 MSO_I }, { 0x07 MSO_I, 0x08 MSO_I }, { 0x09 MSO_I, 0x0a MSO_I }, { 0x0b MSO_I, 0x0c MSO_I },
- { 0x0d MSO_I, 0x0e MSO_I }, { 0x0f MSO_I, 0x10 MSO_I }, { 0x11 MSO_I, 0x12 MSO_I }, { 0x13 MSO_I, 0x14 MSO_I },
- { 0x15 MSO_I, 0x16 MSO_I }, { 0x17 MSO_I, 0x18 MSO_I }, { 0x19 MSO_I, 0x1a MSO_I }, { 0x1b MSO_I, 0x1c MSO_I },
- { 0x1d MSO_I, 0x1e MSO_I }, { 0x1f MSO_I, 0x20 MSO_I }, { 0x21 MSO_I, 0x22 MSO_I }, { 0x23 MSO_I, 0x24 MSO_I },
- { 0x25 MSO_I, 0x26 MSO_I }, { 0x27 MSO_I, 0x28 MSO_I }, { 0x29 MSO_I, 0x2a MSO_I }, { 0x2b MSO_I, 0x2c MSO_I },
- { 0x2d MSO_I, 0x2e MSO_I }, { 0x2f MSO_I, 0x30 MSO_I }, { 0x31 MSO_I, 0x32 MSO_I }, { 0x33 MSO_I, 0x34 MSO_I },
- { 0x35 MSO_I, 0x36 MSO_I }, { 0x37 MSO_I, 0x38 MSO_I }, { 0x39 MSO_I, 0x3a MSO_I }, { 0x3b MSO_I, 0x3c MSO_I },
- { 0x3d MSO_I, 0x3e MSO_I }, { 0x3f MSO_I, 0x40 MSO_I }, { 0x41 MSO_I, 0x42 MSO_I }, { 0x43 MSO_I, 0x44 MSO_I },
- { 0x45 MSO_I, 0x46 MSO_I }, { 0x47 MSO_I, 0x48 MSO_I }, { 0x49 MSO_I, 0x4a MSO_I }, { 0x4b MSO_I, 0x4c MSO_I },
- { 0x4d MSO_I, 0x4e MSO_I }, { 0x4f MSO_I, 0x50 MSO_I }, { 0x51 MSO_I, 0x52 MSO_I }, { 0x53 MSO_I, 0x54 MSO_I },
- { 0x55 MSO_I, 0x56 MSO_I }, { 0x57 MSO_I, 0x58 MSO_I }, { 0x59 MSO_I, 0x5a MSO_I }, { 0x5b MSO_I, 0x5c MSO_I },
- { 0x5d MSO_I, 0x5e MSO_I }, { 0x5f MSO_I, 0x60 MSO_I }, { 0x61 MSO_I, 0x62 MSO_I }, { 0x63 MSO_I, 0x64 MSO_I },
- { 0x05 MSO_I, 0x06 MSO_I }
-};
-static const mso_CustomShape msoSeal24 =
-{
- (SvxMSDffVertPair*)mso_sptSeal24Vert, sizeof( mso_sptSeal24Vert ) / sizeof( SvxMSDffVertPair ),
- NULL, 0,
- (SvxMSDffCalculationData*)mso_sptSeal24Calc, sizeof( mso_sptSeal24Calc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault2500,
- (SvxMSDffTextRectangles*)mso_sptSealTextRect, sizeof( mso_sptSealTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-static const SvxMSDffCalculationData mso_sptSeal32Calc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 }, // 0x00
- { 0x2081, 0x400, 10800, 3150 }, // 0x01 ( textframe )
- { 0x2082, 0x400, 10800, 3150 }, // 0x02
- { 0x2081, 0x400, 10800, 1350 }, // 0x03
- { 0x2082, 0x400, 10800, 1350 }, // 0x04
- { 0x0081, 0, 10800, 0 },
- { 0x0082, 0, 10800, 0 },
- { 0x2081, 0x400, 10800, 56 },
- { 0x2082, 0x400, 10800, 56 },
- { 0x0081, 0, 10800, 113 },
- { 0x0082, 0, 10800, 113 },
- { 0x2081, 0x400, 10800, 169 },
- { 0x2082, 0x400, 10800, 169 },
- { 0x0081, 0, 10800, 225 },
- { 0x0082, 0, 10800, 225 },
- { 0x2081, 0x400, 10800, 281 },
- { 0x2082, 0x400, 10800, 281 },
- { 0x0081, 0, 10800, 338 },
- { 0x0082, 0, 10800, 338 },
- { 0x2081, 0x400, 10800, 394 },
- { 0x2082, 0x400, 10800, 394 },
- { 0x0081, 0, 10800, 450 },
- { 0x0082, 0, 10800, 450 },
- { 0x2081, 0x400, 10800, 506 },
- { 0x2082, 0x400, 10800, 506 },
- { 0x0081, 0, 10800, 563 },
- { 0x0082, 0, 10800, 563 },
- { 0x2081, 0x400, 10800, 619 },
- { 0x2082, 0x400, 10800, 619 },
- { 0x0081, 0, 10800, 675 },
- { 0x0082, 0, 10800, 675 },
- { 0x2081, 0x400, 10800, 731 },
- { 0x2082, 0x400, 10800, 731 },
- { 0x0081, 0, 10800, 788 },
- { 0x0082, 0, 10800, 788 },
- { 0x2081, 0x400, 10800, 843 },
- { 0x2082, 0x400, 10800, 843 },
- { 0x0081, 0, 10800, 900 },
- { 0x0082, 0, 10800, 900 },
- { 0x2081, 0x400, 10800, 956 },
- { 0x2082, 0x400, 10800, 956 },
- { 0x0081, 0, 10800, 1013 },
- { 0x0082, 0, 10800, 1013 },
- { 0x2081, 0x400, 10800, 1069 },
- { 0x2082, 0x400, 10800, 1069 },
- { 0x0081, 0, 10800, 1125 },
- { 0x0082, 0, 10800, 1125 },
- { 0x2081, 0x400, 10800, 1181 },
- { 0x2082, 0x400, 10800, 1181 },
- { 0x0081, 0, 10800, 1238 },
- { 0x0082, 0, 10800, 1238 },
- { 0x2081, 0x400, 10800, 1294 },
- { 0x2082, 0x400, 10800, 1294 },
- { 0x0081, 0, 10800, 1350 },
- { 0x0082, 0, 10800, 1350 },
- { 0x2081, 0x400, 10800, 1406 },
- { 0x2082, 0x400, 10800, 1406 },
- { 0x0081, 0, 10800, 1462 },
- { 0x0082, 0, 10800, 1462 },
- { 0x2081, 0x400, 10800, 1519 },
- { 0x2082, 0x400, 10800, 1519 },
- { 0x0081, 0, 10800, 1575 },
- { 0x0082, 0, 10800, 1575 },
- { 0x2081, 0x400, 10800, 1631 },
- { 0x2082, 0x400, 10800, 1631 },
- { 0x0081, 0, 10800, 1688 },
- { 0x0082, 0, 10800, 1688 },
- { 0x2081, 0x400, 10800, 1744 },
- { 0x2082, 0x400, 10800, 1744 },
- { 0x0081, 0, 10800, 1800 },
- { 0x0082, 0, 10800, 1800 },
- { 0x2081, 0x400, 10800, 1856 },
- { 0x2082, 0x400, 10800, 1856 },
- { 0x0081, 0, 10800, 1913 },
- { 0x0082, 0, 10800, 1913 },
- { 0x2081, 0x400, 10800, 1969 },
- { 0x2082, 0x400, 10800, 1969 },
- { 0x0081, 0, 10800, 2025 },
- { 0x0082, 0, 10800, 2025 },
- { 0x2081, 0x400, 10800, 2081 },
- { 0x2082, 0x400, 10800, 2081 },
- { 0x0081, 0, 10800, 2138 },
- { 0x0082, 0, 10800, 2138 },
- { 0x2081, 0x400, 10800, 2194 },
- { 0x2082, 0x400, 10800, 2194 },
- { 0x0081, 0, 10800, 2250 },
- { 0x0082, 0, 10800, 2250 },
- { 0x2081, 0x400, 10800, 2306 },
- { 0x2082, 0x400, 10800, 2306 },
- { 0x0081, 0, 10800, 2362 },
- { 0x0082, 0, 10800, 2362 },
- { 0x2081, 0x400, 10800, 2418 },
- { 0x2082, 0x400, 10800, 2418 },
- { 0x0081, 0, 10800, 2475 },
- { 0x0082, 0, 10800, 2475 },
- { 0x2081, 0x400, 10800, 2531 },
- { 0x2082, 0x400, 10800, 2531 },
- { 0x0081, 0, 10800, 2587 },
- { 0x0082, 0, 10800, 2587 },
- { 0x2081, 0x400, 10800, 2643 },
- { 0x2082, 0x400, 10800, 2643 },
- { 0x0081, 0, 10800, 2700 },
- { 0x0082, 0, 10800, 2700 },
- { 0x2081, 0x400, 10800, 2756 },
- { 0x2082, 0x400, 10800, 2756 },
- { 0x0081, 0, 10800, 2812 },
- { 0x0082, 0, 10800, 2812 },
- { 0x2081, 0x400, 10800, 2868 },
- { 0x2082, 0x400, 10800, 2868 },
- { 0x0081, 0, 10800, 2925 },
- { 0x0082, 0, 10800, 2925 },
- { 0x2081, 0x400, 10800, 2981 },
- { 0x2082, 0x400, 10800, 2981 },
- { 0x0081, 0, 10800, 3037 },
- { 0x0082, 0, 10800, 3037 },
- { 0x2081, 0x400, 10800, 3093 },
- { 0x2082, 0x400, 10800, 3093 },
- { 0x0081, 0, 10800, 3150 },
- { 0x0082, 0, 10800, 3150 },
- { 0x2081, 0x400, 10800, 3206 },
- { 0x2082, 0x400, 10800, 3206 },
- { 0x0081, 0, 10800, 3262 },
- { 0x0082, 0, 10800, 3262 },
- { 0x2081, 0x400, 10800, 3318 },
- { 0x2082, 0x400, 10800, 3318 },
- { 0x0081, 0, 10800, 3375 },
- { 0x0082, 0, 10800, 3375 },
- { 0x2081, 0x400, 10800, 3431 },
- { 0x2082, 0x400, 10800, 3431 },
- { 0x0081, 0, 10800, 3487 },
- { 0x0082, 0, 10800, 3487 },
- { 0x2081, 0x400, 10800, 3543 },
- { 0x2082, 0x400, 10800, 3543 }
-};
-static const SvxMSDffVertPair mso_sptSeal32Vert[] =
-{
- { 0x05 MSO_I, 0x06 MSO_I }, { 0x07 MSO_I, 0x08 MSO_I }, { 0x09 MSO_I, 0x0a MSO_I }, { 0x0b MSO_I, 0x0c MSO_I },
- { 0x0d MSO_I, 0x0e MSO_I }, { 0x0f MSO_I, 0x10 MSO_I }, { 0x11 MSO_I, 0x12 MSO_I }, { 0x13 MSO_I, 0x14 MSO_I },
- { 0x15 MSO_I, 0x16 MSO_I }, { 0x17 MSO_I, 0x18 MSO_I }, { 0x19 MSO_I, 0x1a MSO_I }, { 0x1b MSO_I, 0x1c MSO_I },
- { 0x1d MSO_I, 0x1e MSO_I }, { 0x1f MSO_I, 0x20 MSO_I }, { 0x21 MSO_I, 0x22 MSO_I }, { 0x23 MSO_I, 0x24 MSO_I },
- { 0x25 MSO_I, 0x26 MSO_I }, { 0x27 MSO_I, 0x28 MSO_I }, { 0x29 MSO_I, 0x2a MSO_I }, { 0x2b MSO_I, 0x2c MSO_I },
- { 0x2d MSO_I, 0x2e MSO_I }, { 0x2f MSO_I, 0x30 MSO_I }, { 0x31 MSO_I, 0x32 MSO_I }, { 0x33 MSO_I, 0x34 MSO_I },
- { 0x35 MSO_I, 0x36 MSO_I }, { 0x37 MSO_I, 0x38 MSO_I }, { 0x39 MSO_I, 0x3a MSO_I }, { 0x3b MSO_I, 0x3c MSO_I },
- { 0x3d MSO_I, 0x3e MSO_I }, { 0x3f MSO_I, 0x40 MSO_I }, { 0x41 MSO_I, 0x42 MSO_I }, { 0x43 MSO_I, 0x44 MSO_I },
- { 0x45 MSO_I, 0x46 MSO_I }, { 0x47 MSO_I, 0x48 MSO_I }, { 0x49 MSO_I, 0x4a MSO_I }, { 0x4b MSO_I, 0x4c MSO_I },
- { 0x4d MSO_I, 0x4e MSO_I }, { 0x4f MSO_I, 0x50 MSO_I }, { 0x51 MSO_I, 0x52 MSO_I }, { 0x53 MSO_I, 0x54 MSO_I },
- { 0x55 MSO_I, 0x56 MSO_I }, { 0x57 MSO_I, 0x58 MSO_I }, { 0x59 MSO_I, 0x5a MSO_I }, { 0x5b MSO_I, 0x5c MSO_I },
- { 0x5d MSO_I, 0x5e MSO_I }, { 0x5f MSO_I, 0x60 MSO_I }, { 0x61 MSO_I, 0x62 MSO_I }, { 0x63 MSO_I, 0x64 MSO_I },
- { 0x65 MSO_I, 0x66 MSO_I }, { 0x67 MSO_I, 0x68 MSO_I }, { 0x69 MSO_I, 0x6a MSO_I }, { 0x6b MSO_I, 0x6c MSO_I },
- { 0x6d MSO_I, 0x6e MSO_I }, { 0x6f MSO_I, 0x70 MSO_I }, { 0x71 MSO_I, 0x72 MSO_I }, { 0x73 MSO_I, 0x74 MSO_I },
- { 0x75 MSO_I, 0x76 MSO_I }, { 0x77 MSO_I, 0x78 MSO_I }, { 0x79 MSO_I, 0x7a MSO_I }, { 0x7b MSO_I, 0x7c MSO_I },
- { 0x7d MSO_I, 0x7e MSO_I }, { 0x7f MSO_I, 0x80 MSO_I }, { 0x81 MSO_I, 0x82 MSO_I }, { 0x83 MSO_I, 0x84 MSO_I },
- { 0x05 MSO_I, 0x06 MSO_I }
-};
-static const mso_CustomShape msoSeal32 =
-{
- (SvxMSDffVertPair*)mso_sptSeal32Vert, sizeof( mso_sptSeal32Vert ) / sizeof( SvxMSDffVertPair ),
- NULL, 0,
- (SvxMSDffCalculationData*)mso_sptSeal32Calc, sizeof( mso_sptSeal32Calc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault2500,
- (SvxMSDffTextRectangles*)mso_sptSealTextRect, sizeof( mso_sptSealTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptRibbon2Vert[] = // adjustment1 : x 2700 - 8100 def 5400
-{ // adjustment2 : y 14400 - 21600 def 18900
- { 12 MSO_I, 1 MSO_I }, { 12 MSO_I, 13 MSO_I }, // pp
- { 12 MSO_I, 14 MSO_I }, { 15 MSO_I, 21600 }, { 16 MSO_I, 21600 }, // ccp
- { 0, 21600 }, { 2750, 7 MSO_I }, { 0, 2 MSO_I }, { 0 MSO_I, 2 MSO_I }, // pppp
- { 0 MSO_I, 4 MSO_I }, // p
- { 0 MSO_I, 5 MSO_I }, { 10 MSO_I, 0 }, { 11 MSO_I, 0 }, // ccp
- { 17 MSO_I, 0 }, // p
- { 18 MSO_I, 0 }, { 19 MSO_I, 5 MSO_I }, { 19 MSO_I, 4 MSO_I }, // ccp
- { 19 MSO_I, 2 MSO_I }, { 21600, 2 MSO_I }, { 18850, 7 MSO_I }, { 21600, 21600 }, // pppp
- { 20 MSO_I, 21600 }, // p
- { 21 MSO_I, 21600 }, { 22 MSO_I, 14 MSO_I }, { 22 MSO_I, 13 MSO_I }, // ccp
- { 22 MSO_I, 1 MSO_I }, { 12 MSO_I, 1 MSO_I }, { 12 MSO_I, 13 MSO_I }, // ppp
- { 12 MSO_I, 23 MSO_I }, { 15 MSO_I, 24 MSO_I }, { 16 MSO_I, 24 MSO_I }, // ccp
- { 11 MSO_I, 24 MSO_I }, // p
- { 10 MSO_I, 24 MSO_I }, { 0 MSO_I, 26 MSO_I }, { 0 MSO_I, 25 MSO_I }, // ccp
- { 0 MSO_I, 27 MSO_I }, { 10 MSO_I, 1 MSO_I }, { 11 MSO_I, 1 MSO_I }, // ccp
-
- { 22 MSO_I, 1 MSO_I }, { 22 MSO_I, 13 MSO_I }, // pp
- { 22 MSO_I, 23 MSO_I }, { 21 MSO_I, 24 MSO_I }, { 20 MSO_I, 24 MSO_I }, // ccp
- { 17 MSO_I, 24 MSO_I }, // p
- { 18 MSO_I, 24 MSO_I }, { 19 MSO_I, 26 MSO_I }, { 19 MSO_I, 25 MSO_I }, // ccp
- { 19 MSO_I, 27 MSO_I }, { 18 MSO_I, 1 MSO_I }, { 17 MSO_I, 1 MSO_I }, // ccp
-
- { 0 MSO_I, 25 MSO_I }, { 0 MSO_I, 2 MSO_I }, // pp
-
- { 19 MSO_I, 25 MSO_I }, { 19 MSO_I, 2 MSO_I } // pp
-};
-static const sal_uInt16 mso_sptRibbon2Segm[] =
-{
- 0x4000, 0x0001, 0x2001, 0x0005, 0x2001, 0x0001, 0x2001, 0x0005, 0x2001, 0x0001, 0x6001, 0x8000,
- 0x4000, 0x0001, 0x2001, 0x0001, 0x2002, 0x6001, 0x8000,
- 0x4000, 0x0001, 0x2001, 0x0001, 0x2002, 0x6001, 0x8000,
- 0x4000, 0x0001, 0x8000,
- 0x4000, 0x0001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptRibbon2Calc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 }, // 00
- { 0x2000, DFF_Prop_adjust2Value, 0, 0 }, // 01
- { 0x8000, 21600, 0, 0x401 }, // 02
- { 0x2001, 0x402, 1, 2 }, // 03
- { 0x2001, 0x403, 1, 2 }, // 04
- { 0x2001, 0x404, 1, 2 }, // 05
- { 0x2001, 0x401, 1, 2 }, // 06
- { 0x8000, 21600, 0, 0x406 }, // 07
- { 0x0000, 420, 0, 0 }, // 08
- { 0x2001, 0x408, 2, 1 }, // 09
- { 0x6000, 0x400, 0x408, 0 }, // 10
- { 0x6000, 0x400, 0x409, 0 }, // 11
- { 0x2000, 0x400, 2700, 0 }, // 12
- { 0x8000, 21600, 0, 0x404 }, // 13
- { 0x8000, 21600, 0, 0x405 }, // 14
- { 0xa000, 0x40c, 0, 0x408 }, // 15
- { 0xa000, 0x40c, 0, 0x409 }, // 16
-
- { 0x8000, 21600, 0, 0x40b }, // 17
- { 0x8000, 21600, 0, 0x40a }, // 18
- { 0x8000, 21600, 0, 0x400 }, // 19
- { 0x8000, 21600, 0, 0x410 }, // 20
- { 0x8000, 21600, 0, 0x40f }, // 21
- { 0x8000, 21600, 0, 0x40c }, // 22
-
- { 0xa000, 0x40d, 0, 0x405 }, // 23
- { 0x6000, 0x401, 0x403, 0 }, // 24
- { 0x6000, 0x401, 0x404, 0 }, // 25
- { 0x6000, 0x419, 0x405, 0 }, // 26
- { 0xa000, 0x419, 0, 0x405 } // 27
-};
-static const sal_Int32 mso_sptRibbon2Default[] =
-{
- 2, 5400, 18900
-};
-static const SvxMSDffTextRectangles mso_sptRibbon2TextRect[] =
-{
- { { 0 MSO_I, 0 }, { 19 MSO_I, 1 MSO_I } }
-};
-static const mso_CustomShape msoRibbon2 =
-{
- (SvxMSDffVertPair*)mso_sptRibbon2Vert, sizeof( mso_sptRibbon2Vert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptRibbon2Segm, sizeof( mso_sptRibbon2Segm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptRibbon2Calc, sizeof( mso_sptRibbon2Calc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptRibbon2Default,
- (SvxMSDffTextRectangles*)mso_sptRibbon2TextRect, sizeof( mso_sptRibbon2TextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptVerticalScrollVert[] = // adjustment1 : 0 - 5400
-{
- { 1 MSO_I, 21600 }, { 0, 2 MSO_I }, { 1 MSO_I, 3 MSO_I }, { 0 MSO_I, 3 MSO_I },
- { 0 MSO_I, 1 MSO_I }, { 4 MSO_I, 0 }, { 2 MSO_I, 0 }, { 21600, 1 MSO_I },
- { 2 MSO_I, 0 MSO_I }, { 3 MSO_I, 0 MSO_I }, { 3 MSO_I, 2 MSO_I }, { 5 MSO_I, 21600 },
-
- { 6 MSO_I, 1 MSO_I }, { 4 MSO_I, 0 MSO_I }, { 8 MSO_I, 9 MSO_I }, { 4 MSO_I, 1 MSO_I },
-
- { 0 MSO_I, 2 MSO_I }, { 1 MSO_I, 21600 }, { 0, 2 MSO_I }, { 1 MSO_I, 3 MSO_I },
- { 9 MSO_I, 10 MSO_I }, { 1 MSO_I, 2 MSO_I },
-
- { 4 MSO_I, 0 }, { 6 MSO_I, 1 MSO_I },
-
- { 0 MSO_I, 3 MSO_I }, { 0 MSO_I, 2 MSO_I },
-
- { 4 MSO_I, 0 MSO_I },
- { 2 MSO_I, 0 MSO_I }
-};
-static const sal_uInt16 mso_sptVerticalScrollSegm[] =
-{
- 0x4000, 0xa702, 0x0002, 0xa801, 0x0001, 0xa702, 0x0002, 0xa801, 0x6001, 0x8000,
- 0x4000, 0xa801, 0xa702, 0x6000, 0x8000,
- 0x4000, 0xa803, 0xa702, 0x6001, 0x8000,
- 0x4000, 0xa701, 0x8000,
- 0x4000, 0x0001, 0x8000,
- 0x4000, 0x0001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptScrollCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 },
- { 0x2001, 0x400, 1, 2 },
- { 0x8000, 21600, 0, 0x401 },
- { 0x8000, 21600, 0, 0x400 },
- { 0x6000, 0x400, 0x401, 0 },
- { 0x8000, 21600, 0, 0x404 },
- { 0x2001, 0x400, 2, 1 },
- { 0x2001, 0x401, 1, 2 },
- { 0x6000, 0x400, 0x407, 0 },
- { 0x6000, 0x401, 0x407, 0 },
- { 0x8000, 21600, 0, 0x409 }
-};
-static const SvxMSDffTextRectangles mso_sptScrollTextRect[] =
-{
- { { 0 MSO_I, 0 MSO_I }, { 3 MSO_I, 3 MSO_I } }
-};
-static const mso_CustomShape msoVerticalScroll =
-{
- (SvxMSDffVertPair*)mso_sptVerticalScrollVert, sizeof( mso_sptVerticalScrollVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptVerticalScrollSegm, sizeof( mso_sptVerticalScrollSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptScrollCalc, sizeof( mso_sptScrollCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault2700,
- (SvxMSDffTextRectangles*)mso_sptScrollTextRect, sizeof( mso_sptScrollTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 11000, 10800,
- NULL, 0
-};
-static const SvxMSDffVertPair mso_sptHorizontalScrollVert[] = // adjustment1 : 0 - 5400
-{
- { 0, 4 MSO_I }, { 1 MSO_I, 0 MSO_I }, { 3 MSO_I, 0 MSO_I }, { 3 MSO_I, 1 MSO_I },
- { 2 MSO_I, 0 }, { 21600, 1 MSO_I }, { 21600, 5 MSO_I }, { 2 MSO_I, 3 MSO_I },
- { 0 MSO_I, 3 MSO_I }, { 0 MSO_I, 2 MSO_I }, { 1 MSO_I, 21600 }, { 0, 2 MSO_I },
-
- { 1 MSO_I, 4 MSO_I }, { 9 MSO_I, 8 MSO_I }, { 0 MSO_I, 4 MSO_I }, { 1 MSO_I, 6 MSO_I },
-
- { 2 MSO_I, 1 MSO_I }, { 10 MSO_I,9 MSO_I }, { 3 MSO_I, 1 MSO_I }, { 2 MSO_I, 0 },
- { 21600, 1 MSO_I }, { 2 MSO_I, 0 MSO_I },
-
- { 1 MSO_I, 6 MSO_I },
- { 0, 4 MSO_I },
-
- { 2 MSO_I, 0 MSO_I },
- { 3 MSO_I, 0 MSO_I },
-
- { 0 MSO_I, 4 MSO_I },
- { 0 MSO_I, 2 MSO_I }
-};
-static const sal_uInt16 mso_sptHorizontalScrollSegm[] =
-{
- 0x4000, 0xa801, 0x0002, 0xa802, 0x0001, 0xa801, 0x0002, 0xa802, 0x6001, 0x8000,
- 0x4000, 0xa803, 0x6000, 0x8000,
- 0x4000, 0xa803, 0xa702, 0x6000, 0x8000,
- 0x4000, 0xa701, 0x8000,
- 0x4000, 0x0001, 0x8000,
- 0x4000, 0x0001, 0x8000
-};
-static const mso_CustomShape msoHorizontalScroll =
-{
- (SvxMSDffVertPair*)mso_sptHorizontalScrollVert, sizeof( mso_sptHorizontalScrollVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptHorizontalScrollSegm, sizeof( mso_sptHorizontalScrollSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptScrollCalc, sizeof( mso_sptScrollCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDefault2700,
- (SvxMSDffTextRectangles*)mso_sptScrollTextRect, sizeof( mso_sptScrollTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 10800, 11000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartProcessVert[] =
-{
- { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, { 0, 0 }
-};
-static const mso_CustomShape msoFlowChartProcess =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartProcessVert, sizeof( mso_sptFlowChartProcessVert ) / sizeof( SvxMSDffVertPair ),
- NULL, 0,
- NULL, 0,
- NULL,
- NULL, 0,
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptStandardGluePoints, sizeof( mso_sptStandardGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartAlternateProcessVert[] =
-{
- { 0, 2 MSO_I }, { 0 MSO_I, 0 }, { 1 MSO_I, 0 }, { 21600, 2 MSO_I },
- { 21600, 3 MSO_I }, { 1 MSO_I, 21600 }, { 0 MSO_I, 21600 }, { 0, 3 MSO_I }
-};
-static const sal_uInt16 mso_sptFlowChartAlternateProcessSegm[] =
-{
- 0x4000, 0xa801, 0x0001, 0xa701, 0x0001, 0xa801, 0x0001, 0xa701, 0x6000, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptFlowChartAlternateProcessCalc[] =
-{
- { 0x2000, DFF_Prop_geoLeft, 2540, 0 },
- { 0x2000, DFF_Prop_geoRight, 0, 2540 },
- { 0x2000, DFF_Prop_geoTop, 2540, 0 },
- { 0x2000, DFF_Prop_geoBottom, 0, 2540 },
- { 0x2000, DFF_Prop_geoLeft, 800, 0 },
- { 0x2000, DFF_Prop_geoRight, 0, 800 },
- { 0x2000, DFF_Prop_geoTop, 800, 0 },
- { 0x2000, DFF_Prop_geoBottom,0, 800 }
-};
-static const SvxMSDffTextRectangles mso_sptFlowChartAlternateProcessTextRect[] =
-{
- { { 4 MSO_I, 6 MSO_I }, { 5 MSO_I, 7 MSO_I } }
-};
-static const mso_CustomShape msoFlowChartAlternateProcess =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartAlternateProcessVert, sizeof( mso_sptFlowChartAlternateProcessVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptFlowChartAlternateProcessSegm, sizeof( mso_sptFlowChartAlternateProcessSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptFlowChartAlternateProcessCalc, sizeof( mso_sptFlowChartAlternateProcessCalc ) / sizeof( SvxMSDffCalculationData ),
- NULL,
- (SvxMSDffTextRectangles*)mso_sptFlowChartAlternateProcessTextRect, sizeof( mso_sptFlowChartAlternateProcessTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptStandardGluePoints, sizeof( mso_sptStandardGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartDecisionVert[] =
-{
- { 0, 10800 }, { 10800, 0 }, { 21600, 10800 }, { 10800, 21600 }, { 0, 10800 }
-};
-static const SvxMSDffTextRectangles mso_sptFlowChartDecisionTextRect[] =
-{
- { { 5400, 5400 }, { 16200, 16200 } }
-};
-static const mso_CustomShape msoFlowChartDecision =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartDecisionVert, sizeof( mso_sptFlowChartDecisionVert ) / sizeof( SvxMSDffVertPair ),
- NULL, 0,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptFlowChartDecisionTextRect, sizeof( mso_sptFlowChartDecisionTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptStandardGluePoints, sizeof( mso_sptStandardGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartInputOutputVert[] =
-{
- { 4230, 0 }, { 21600, 0 }, { 17370, 21600 }, { 0, 21600 }, { 4230, 0 }
-};
-static const SvxMSDffTextRectangles mso_sptFlowChartInputOutputTextRect[] =
-{
- { { 4230, 0 }, { 17370, 21600 } }
-};
-static const SvxMSDffVertPair mso_sptFlowChartInputOutputGluePoints[] =
-{
- { 12960, 0 }, { 10800, 0 }, { 2160, 10800 }, { 8600, 21600 }, { 10800, 21600 }, { 19400, 10800 }
-};
-static const mso_CustomShape msoFlowChartInputOutput =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartInputOutputVert, sizeof( mso_sptFlowChartInputOutputVert ) / sizeof( SvxMSDffVertPair ),
- NULL, 0,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptFlowChartInputOutputTextRect, sizeof( mso_sptFlowChartInputOutputTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptFlowChartInputOutputGluePoints, sizeof( mso_sptFlowChartInputOutputGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartPredefinedProcessVert[] =
-{
- { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 },
-
- { 2540, 0 }, { 2540, 21600 },
-
- { 21600 - 2540, 0 }, { 21600 - 2540, 21600 }
-};
-static const sal_uInt16 mso_sptFlowChartPredefinedProcessSegm[] =
-{
- 0x4000, 0x0003, 0x6000, 0x8000,
- 0x4000, 0x0001, 0x8000,
- 0x4000, 0x0001, 0x8000
-};
-static const SvxMSDffTextRectangles mso_sptFlowChartPredefinedProcessTextRect[] =
-{
- { { 2540, 0 }, { 21600 - 2540, 21600 } }
-};
-static const mso_CustomShape msoFlowChartPredefinedProcess =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartPredefinedProcessVert, sizeof( mso_sptFlowChartPredefinedProcessVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptFlowChartPredefinedProcessSegm, sizeof( mso_sptFlowChartPredefinedProcessSegm ) >> 1,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptFlowChartPredefinedProcessTextRect, sizeof( mso_sptFlowChartPredefinedProcessTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartInternalStorageVert[] =
-{
- { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 },
-
- { 4230, 0 }, { 4230, 21600 },
-
- { 0, 4230 }, { 21600, 4230 }
-};
-static const sal_uInt16 mso_sptFlowChartInternalStorageSegm[] =
-{
- 0x4000, 0x0003, 0x6000, 0x8000,
- 0x4000, 0x0001, 0x8000,
- 0x4000, 0x0001, 0x8000
-};
-static const SvxMSDffTextRectangles mso_sptFlowChartInternalStorageTextRect[] =
-{
- { { 4230, 4230 }, { 21600, 21600 } }
-};
-static const mso_CustomShape msoFlowChartInternalStorage =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartInternalStorageVert, sizeof( mso_sptFlowChartInternalStorageVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptFlowChartInternalStorageSegm, sizeof( mso_sptFlowChartInternalStorageSegm ) >> 1,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptFlowChartInternalStorageTextRect, sizeof( mso_sptFlowChartInternalStorageTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartDocumentVert[] =
-{
- { 0, 0 }, { 21600, 0 }, { 21600, 17360 },
- { 13050, 17220 }, { 13340, 20770 }, { 5620, 21600 }, // ccp
- { 2860, 21100 }, { 1850, 20700 }, { 0, 20120 } // ccp
-};
-static const sal_uInt16 mso_sptFlowChartDocumentSegm[] =
-{
- 0x4000, 0x0002, 0x2002, 0x6000, 0x8000
-};
-static const SvxMSDffTextRectangles mso_sptFlowChartDocumentTextRect[] =
-{
- { { 0, 0 }, { 21600, 17360 } }
-};
-static const SvxMSDffVertPair mso_sptFlowChartDocumentGluePoints[] =
-{
- { 10800, 0 }, { 0, 10800 }, { 10800, 20320 }, { 21600, 10800 }
-};
-static const mso_CustomShape msoFlowChartDocument =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartDocumentVert, sizeof( mso_sptFlowChartDocumentVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptFlowChartDocumentSegm, sizeof( mso_sptFlowChartDocumentSegm ) >> 1,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptFlowChartDocumentTextRect, sizeof( mso_sptFlowChartDocumentTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptFlowChartDocumentGluePoints, sizeof( mso_sptFlowChartDocumentGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartMultidocumentVert[] =
-{
- { 0, 3600 }, { 1500, 3600 }, { 1500, 1800 }, { 3000, 1800 },
- { 3000, 0 }, { 21600, 0 }, { 21600, 14409 }, { 21600 - 1500, 14409 },
- { 21600 - 1500, 14409 + 1800 }, { 21600 - 3000, 14409 + 1800 }, { 21600 - 3000, 14409 + 3600 },
- { 11610, 14293 + 3600 }, { 11472, 17239 + 3600 }, { 4833, 17928 + 3600 }, // ccp
- { 2450, 17513 + 3600 }, { 1591, 17181 + 3600 }, { 0, 16700 + 3600 }, // ccp
-
- { 1500, 3600 }, { 21600 - 3000, 3600 }, { 21600 - 3000, 14409 + 1800 },
-
- { 3000, 1800 }, { 21600 - 1500, 1800 }, { 21600 - 1500, 14409 }
-};
-static const sal_uInt16 mso_sptFlowChartMultidocumentSegm[] =
-{
- 0x4000, 0x000a, 0x2002, 0x6000, 0x8000,
- 0x4000, 0x0002, 0x8000,
- 0x4000, 0x0002, 0x8000
-};
-static const SvxMSDffTextRectangles mso_sptFlowChartMultidocumentTextRect[] =
-{
- { { 0, 3600 }, { 21600 - 3000, 14409 + 3600 } }
-};
-static const SvxMSDffVertPair mso_sptFlowChartMultidocumentGluePoints[] =
-{
- { 10800, 0 }, { 0, 10800 }, { 10800, 19890 }, { 21600, 10800 }
-};
-static const mso_CustomShape msoFlowChartMultidocument =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartMultidocumentVert, sizeof( mso_sptFlowChartMultidocumentVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptFlowChartMultidocumentSegm, sizeof( mso_sptFlowChartMultidocumentSegm ) >> 1,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptFlowChartMultidocumentTextRect, sizeof( mso_sptFlowChartMultidocumentTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptFlowChartMultidocumentGluePoints, sizeof( mso_sptFlowChartMultidocumentGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartTerminatorVert[] =
-{
- { 3470, 21600 }, { 0, 10800 }, { 3470, 0 }, { 18130, 0 },
- { 21600, 10800 }, { 18130, 21600 }
-};
-static const sal_uInt16 mso_sptFlowChartTerminatorSegm[] =
-{
- 0x4000, 0xa702, 0x0001, 0xa702, 0x6000, 0x8000
-};
-static const SvxMSDffTextRectangles mso_sptFlowChartTerminatorTextRect[] =
-{
- { { 1060, 3180 }, { 20540, 18420 } }
-};
-static const mso_CustomShape msoFlowChartTerminator =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartTerminatorVert, sizeof( mso_sptFlowChartTerminatorVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptFlowChartTerminatorSegm, sizeof( mso_sptFlowChartTerminatorSegm ) >> 1,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptFlowChartTerminatorTextRect, sizeof( mso_sptFlowChartTerminatorTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptStandardGluePoints, sizeof( mso_sptStandardGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartPreparationVert[] =
-{
- { 4350, 0 }, { 17250, 0 }, { 21600, 10800 }, { 17250, 21600 },
- { 4350, 21600 }, { 0, 10800 }, { 4350, 0 }
-};
-static const SvxMSDffTextRectangles mso_sptFlowChartPreparationTextRect[] =
-{
- { { 4350, 0 }, { 17250, 21600 } }
-};
-static const mso_CustomShape msoFlowChartPreparation =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartPreparationVert, sizeof( mso_sptFlowChartPreparationVert ) / sizeof( SvxMSDffVertPair ),
- NULL, 0,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptFlowChartPreparationTextRect, sizeof( mso_sptFlowChartPreparationTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptStandardGluePoints, sizeof( mso_sptStandardGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartManualInputVert[] =
-{
- { 0, 4300 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, { 0, 4300 }
-};
-static const SvxMSDffTextRectangles mso_sptFlowChartManualInputTextRect[] =
-{
- { { 0, 4300 }, { 21600, 21600 } }
-};
-static const SvxMSDffVertPair mso_sptFlowChartManualInputGluePoints[] =
-{
- { 10800, 2150 }, { 0, 10800 }, { 10800, 19890 }, { 21600, 10800 }
-};
-static const mso_CustomShape msoFlowChartManualInput =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartManualInputVert, sizeof( mso_sptFlowChartManualInputVert ) / sizeof( SvxMSDffVertPair ),
- NULL, 0,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptFlowChartManualInputTextRect, sizeof( mso_sptFlowChartManualInputTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptFlowChartManualInputGluePoints, sizeof( mso_sptFlowChartManualInputGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartManualOperationVert[] =
-{
- { 0, 0 }, { 21600, 0 }, { 17250, 21600 }, { 4350, 21600 }, { 0, 0 }
-};
-static const SvxMSDffTextRectangles mso_sptFlowChartManualOperationTextRect[] =
-{
- { { 4350, 0 }, { 17250, 21600 } }
-};
-static const SvxMSDffVertPair mso_sptFlowChartManualOperationGluePoints[] =
-{
- { 10800, 0 }, { 2160, 10800 }, { 10800, 21600 }, { 19440, 10800 }
-};
-static const mso_CustomShape msoFlowChartManualOperation =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartManualOperationVert, sizeof( mso_sptFlowChartManualOperationVert ) / sizeof( SvxMSDffVertPair ),
- NULL, 0,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptFlowChartManualOperationTextRect, sizeof( mso_sptFlowChartManualOperationTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptFlowChartManualOperationGluePoints, sizeof( mso_sptFlowChartManualOperationGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartConnectorVert[] =
-{
- { 0, 0 }, { 21600, 21600 }
-};
-static const sal_uInt16 mso_sptFlowChartConnectorSegm[] =
-{
- 0xa302, 0x6000, 0x8000
-};
-static const SvxMSDffTextRectangles mso_sptFlowChartConnectorTextRect[] =
-{
- { { 3180, 3180 }, { 18420, 18420 } }
-};
-static const mso_CustomShape msoFlowChartConnector =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartConnectorVert, sizeof( mso_sptFlowChartConnectorVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptFlowChartConnectorSegm, sizeof( mso_sptFlowChartConnectorSegm ) >> 1,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptFlowChartConnectorTextRect, sizeof( mso_sptFlowChartConnectorTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptEllipseGluePoints, sizeof( mso_sptEllipseGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartOffpageConnectorVert[] =
-{
- { 0, 0 }, { 21600, 0 }, { 21600, 17150 }, { 10800, 21600 },
- { 0, 17150 }, { 0, 0 }
-};
-static const SvxMSDffTextRectangles mso_sptFlowChartOffpageConnectorTextRect[] =
-{
- { { 0, 0 }, { 21600, 17150 } }
-};
-static const mso_CustomShape msoFlowChartOffpageConnector =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartOffpageConnectorVert, sizeof( mso_sptFlowChartOffpageConnectorVert ) / sizeof( SvxMSDffVertPair ),
- NULL, 0,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptFlowChartOffpageConnectorTextRect, sizeof( mso_sptFlowChartOffpageConnectorTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptStandardGluePoints, sizeof( mso_sptStandardGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartPunchedCardVert[] =
-{
- { 4300, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 },
- { 0, 4300 }, { 4300, 0 }
-};
-static const SvxMSDffTextRectangles mso_sptFlowChartPunchedCardTextRect[] =
-{
- { { 0, 4300 }, { 21600, 21600 } }
-};
-static const mso_CustomShape msoFlowChartPunchedCard =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartPunchedCardVert, sizeof( mso_sptFlowChartPunchedCardVert ) / sizeof( SvxMSDffVertPair ),
- NULL, 0,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptFlowChartPunchedCardTextRect, sizeof( mso_sptFlowChartPunchedCardTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptStandardGluePoints, sizeof( mso_sptStandardGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartPunchedTapeVert[] =
-{
- { 0, 2230 }, // p
- { 820, 3990 }, { 3410, 3980 }, { 5370, 4360 }, // ccp
- { 7430, 4030 }, { 10110, 3890 }, { 10690, 2270 }, // ccp
- { 11440, 300 }, { 14200, 160 }, { 16150, 0 }, // ccp
- { 18670, 170 }, { 20690, 390 }, { 21600, 2230 }, // ccp
- { 21600, 19420 }, // p
- { 20640, 17510 }, { 18320, 17490 }, { 16140, 17240 }, // ccp
- { 14710, 17370 }, { 11310, 17510 }, { 10770, 19430 }, // ccp
- { 10150, 21150 }, { 7380, 21290 }, { 5290, 21600 }, // ccp
- { 3220, 21250 }, { 610, 21130 }, { 0, 19420 } // ccp
-};
-static const sal_uInt16 mso_sptFlowChartPunchedTapeSegm[] =
-{
- 0x4000, 0x2004, 0x0001, 0x2004, 0x6000, 0x8000
-};
-static const SvxMSDffTextRectangles mso_sptFlowChartPunchedTapeTextRect[] =
-{
- { { 0, 4360 }, { 21600, 17240 } }
-};
-static const SvxMSDffVertPair mso_sptFlowChartPunchedTapeGluePoints[] =
-{
- { 10800, 2020 }, { 0, 10800 }, { 10800, 19320 }, { 21600, 10800 }
-};
-static const mso_CustomShape msoFlowChartPunchedTape =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartPunchedTapeVert, sizeof( mso_sptFlowChartPunchedTapeVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptFlowChartPunchedTapeSegm, sizeof( mso_sptFlowChartPunchedTapeSegm ) >> 1,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptFlowChartPunchedTapeTextRect, sizeof( mso_sptFlowChartPunchedTapeTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptFlowChartPunchedTapeGluePoints, sizeof( mso_sptFlowChartPunchedTapeGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartSummingJunctionVert[] =
-{
- { 0, 0 }, { 21600, 21600 },
-
- { 3100, 3100 },
- { 18500, 18500 },
-
- { 3100, 18500 },
- { 18500, 3100 }
-};
-static const sal_uInt16 mso_sptFlowChartSummingJunctionSegm[] =
-{
- 0xa302, 0x6000, 0x8000,
- 0x4000, 0x0001, 0x8000,
- 0x4000, 0x0001, 0x8000
-};
-static const SvxMSDffTextRectangles mso_sptFlowChartSummingJunctionTextRect[] =
-{
- { { 3100, 3100 }, { 18500, 18500 } }
-};
-static const mso_CustomShape msoFlowChartSummingJunction =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartSummingJunctionVert, sizeof( mso_sptFlowChartSummingJunctionVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptFlowChartSummingJunctionSegm, sizeof( mso_sptFlowChartSummingJunctionSegm ) >> 1,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptFlowChartSummingJunctionTextRect, sizeof( mso_sptFlowChartSummingJunctionTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptEllipseGluePoints, sizeof( mso_sptEllipseGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartOrVert[] =
-{
- { 0, 0 }, { 21600, 21600 },
-
- { 0, 10800 }, { 21600, 10800 },
-
- { 10800, 0 }, { 10800, 21600 }
-};
-static const sal_uInt16 mso_sptFlowChartOrSegm[] =
-{
- 0xa302, 0x6000, 0x8000,
- 0x4000, 0x0001, 0x8000,
- 0x4000, 0x0001, 0x8000
-};
-static const SvxMSDffTextRectangles mso_sptFlowChartOrTextRect[] =
-{
- { { 3100, 3100 }, { 18500, 18500 } }
-};
-static const mso_CustomShape msoFlowChartOr =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartOrVert, sizeof( mso_sptFlowChartOrVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptFlowChartOrSegm, sizeof( mso_sptFlowChartOrSegm ) >> 1,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptFlowChartOrTextRect, sizeof( mso_sptFlowChartOrTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptEllipseGluePoints, sizeof( mso_sptEllipseGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartCollateVert[] =
-{
- { 0, 0 }, { 21600, 21600 }, { 0, 21600 }, { 21600, 0 }, { 0, 0 }
-};
-static const SvxMSDffTextRectangles mso_sptFlowChartCollateTextRect[] =
-{
- { { 5400, 5400 }, { 16200, 16200 } }
-};
-static const SvxMSDffVertPair mso_sptFlowChartCollateGluePoints[] =
-{
- { 10800, 0 }, { 10800, 10800 }, { 10800, 21600 }
-};
-static const mso_CustomShape msoFlowChartCollate =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartCollateVert, sizeof( mso_sptFlowChartCollateVert ) / sizeof( SvxMSDffVertPair ),
- NULL, 0,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptFlowChartCollateTextRect, sizeof( mso_sptFlowChartCollateTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptFlowChartCollateGluePoints, sizeof( mso_sptFlowChartCollateGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartSortVert[] =
-{
- { 0, 10800 }, { 10800, 0 }, { 21600, 10800 }, { 10800, 21600 },
-
- { 0, 10800 }, { 21600, 10800 }
-};
-static const sal_uInt16 mso_sptFlowChartSortSegm[] =
-{
- 0x4000, 0x0003, 0x6000, 0x8000,
- 0x4000, 0x0001, 0x8000
-};
-static const SvxMSDffTextRectangles mso_sptFlowChartSortTextRect[] =
-{
- { { 5400, 5400 }, { 16200, 16200 } }
-};
-static const mso_CustomShape msoFlowChartSort =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartSortVert, sizeof( mso_sptFlowChartSortVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptFlowChartSortSegm, sizeof( mso_sptFlowChartSortSegm ) >> 1,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptFlowChartSortTextRect, sizeof( mso_sptFlowChartSortTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartExtractVert[] =
-{
- { 10800, 0 }, { 21600, 21600 }, { 0, 21600 }, { 10800, 0 }
-};
-static const SvxMSDffTextRectangles mso_sptFlowChartExtractTextRect[] =
-{
- { { 5400, 10800 }, { 16200, 21600 } }
-};
-static const SvxMSDffVertPair mso_sptFlowChartExtractGluePoints[] =
-{
- { 10800, 0 }, { 5400, 10800 }, { 10800, 21600 }, { 16200, 10800 }
-};
-static const mso_CustomShape msoFlowChartExtract =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartExtractVert, sizeof( mso_sptFlowChartExtractVert ) / sizeof( SvxMSDffVertPair ),
- NULL, 0,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptFlowChartExtractTextRect, sizeof( mso_sptFlowChartExtractTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptFlowChartExtractGluePoints, sizeof( mso_sptFlowChartExtractGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartMergeVert[] =
-{
- { 0, 0 }, { 21600, 0 }, { 10800, 21600 }, { 0, 0 }
-};
-static const SvxMSDffTextRectangles mso_sptFlowChartMergeTextRect[] =
-{
- { { 5400, 0 }, { 16200, 10800 } }
-};
-static const mso_CustomShape msoFlowChartMerge =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartMergeVert, sizeof( mso_sptFlowChartMergeVert ) / sizeof( SvxMSDffVertPair ),
- NULL, 0,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptFlowChartMergeTextRect, sizeof( mso_sptFlowChartMergeTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptFlowChartExtractGluePoints, sizeof( mso_sptFlowChartExtractGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartOnlineStorageVert[] =
-{
- { 3600, 21600 }, { 0, 10800 }, { 3600, 0 }, { 21600, 0 },
- { 18000, 10800 }, { 21600, 21600 }
-};
-static const sal_uInt16 mso_sptFlowChartOnlineStorageSegm[] =
-{
- 0x4000, 0xa702, 0x0001, 0xa702, 0x6000, 0x8000
-};
-static const SvxMSDffTextRectangles mso_sptFlowChartOnlineStorageTextRect[] =
-{
- { { 3600, 0 }, { 18000, 21600 } }
-};
-static const SvxMSDffVertPair mso_sptFlowChartOnlineStorageGluePoints[] =
-{
- { 10800, 0 }, { 0, 10800 }, { 10800, 21600 }, { 18000, 10800 }
-};
-static const mso_CustomShape msoFlowChartOnlineStorage =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartOnlineStorageVert, sizeof( mso_sptFlowChartOnlineStorageVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptFlowChartOnlineStorageSegm, sizeof( mso_sptFlowChartOnlineStorageSegm ) >> 1,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptFlowChartOnlineStorageTextRect, sizeof( mso_sptFlowChartOnlineStorageTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptFlowChartOnlineStorageGluePoints, sizeof( mso_sptFlowChartOnlineStorageGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartDelayVert[] =
-{
- { 10800, 0 }, { 21600, 10800 }, { 10800, 21600 }, { 0, 21600 },
- { 0, 0 }
-};
-static const sal_uInt16 mso_sptFlowChartDelaySegm[] =
-{
- 0x4000, 0xa702, 0x0002, 0x6000, 0x8000
-};
-static const SvxMSDffTextRectangles mso_sptFlowChartDelayTextRect[] =
-{
- { { 0, 3100 }, { 18500, 18500 } }
-};
-static const mso_CustomShape msoFlowChartDelay =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartDelayVert, sizeof( mso_sptFlowChartDelayVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptFlowChartDelaySegm, sizeof( mso_sptFlowChartDelaySegm ) >> 1,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptFlowChartDelayTextRect, sizeof( mso_sptFlowChartDelayTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptStandardGluePoints, sizeof( mso_sptStandardGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartMagneticTapeVert[] =
-{
- { 20980, 18150 }, { 20980, 21600 }, { 10670, 21600 },
- { 4770, 21540 }, { 0, 16720 }, { 0, 10800 }, // ccp
- { 0, 4840 }, { 4840, 0 }, { 10800, 0 }, // ccp
- { 16740, 0 }, { 21600, 4840 }, { 21600, 10800 }, // ccp
- { 21600, 13520 }, { 20550, 16160 }, { 18670, 18170 } // ccp
-};
-static const sal_uInt16 mso_sptFlowChartMagneticTapeSegm[] =
-{
- 0x4000, 0x0002, 0x2004, 0x6000, 0x8000
-};
-static const SvxMSDffTextRectangles mso_sptFlowChartMagneticTapeTextRect[] =
-{
- { { 3100, 3100 }, { 18500, 18500 } }
-};
-static const mso_CustomShape msoFlowChartMagneticTape =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartMagneticTapeVert, sizeof( mso_sptFlowChartMagneticTapeVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptFlowChartMagneticTapeSegm, sizeof( mso_sptFlowChartMagneticTapeSegm ) >> 1,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptFlowChartMagneticTapeTextRect, sizeof( mso_sptFlowChartMagneticTapeTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptStandardGluePoints, sizeof( mso_sptStandardGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartMagneticDiskVert[] =
-{
- { 0, 3400 }, { 10800, 0 }, { 21600, 3400 }, { 21600, 18200 },
- { 10800, 21600 }, { 0, 18200 },
-
- { 0, 3400 }, { 10800, 6800 }, { 21600, 3400 }
-};
-static const sal_uInt16 mso_sptFlowChartMagneticDiskSegm[] =
-{
- 0x4000, 0xa802, 0x0001, 0xa802, 0x6000, 0x8000,
- 0x4000, 0xa802, 0x8000
-};
-static const SvxMSDffTextRectangles mso_sptFlowChartMagneticDiskTextRect[] =
-{
- { { 0, 6800 }, { 21600, 18200 } }
-};
-static const SvxMSDffVertPair mso_sptFlowChartMagneticDiskGluePoints[] =
-{
- { 10800, 6800 }, { 10800, 0 }, { 0, 10800 }, { 10800, 21600 }, { 21600, 10800 }
-};
-static const mso_CustomShape msoFlowChartMagneticDisk =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartMagneticDiskVert, sizeof( mso_sptFlowChartMagneticDiskVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptFlowChartMagneticDiskSegm, sizeof( mso_sptFlowChartMagneticDiskSegm ) >> 1,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptFlowChartMagneticDiskTextRect, sizeof( mso_sptFlowChartMagneticDiskTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptFlowChartMagneticDiskGluePoints, sizeof( mso_sptFlowChartMagneticDiskGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartMagneticDrumVert[] =
-{
- { 18200, 0 }, { 21600, 10800 }, { 18200, 21600 }, { 3400, 21600 },
- { 0, 10800 }, { 3400, 0 },
-
- { 18200, 0 }, { 14800, 10800 }, { 18200, 21600 }
-};
-static const sal_uInt16 mso_sptFlowChartMagneticDrumSegm[] =
-{
- 0x4000, 0xa702, 0x0001, 0xa702, 0x6000, 0x8000,
- 0x4000, 0xa702, 0x8000
-};
-static const SvxMSDffTextRectangles mso_sptFlowChartMagneticDrumTextRect[] =
-{
- { { 3400, 0 }, { 14800, 21600 } }
-};
-static const SvxMSDffVertPair mso_sptFlowChartMagneticDrumGluePoints[] =
-{
- { 10800, 0 }, { 0, 10800 }, { 10800, 21600 }, { 14800, 10800 }, { 21600, 10800 }
-};
-static const mso_CustomShape msoFlowChartMagneticDrum =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartMagneticDrumVert, sizeof( mso_sptFlowChartMagneticDrumVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptFlowChartMagneticDrumSegm, sizeof( mso_sptFlowChartMagneticDrumSegm ) >> 1,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptFlowChartMagneticDrumTextRect, sizeof( mso_sptFlowChartMagneticDrumTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptFlowChartMagneticDrumGluePoints, sizeof( mso_sptFlowChartMagneticDrumGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptFlowChartDisplayVert[] =
-{
- { 3600, 0 }, { 17800, 0 }, { 21600, 10800 }, { 17800, 21600 },
- { 3600, 21600 }, { 0, 10800 }
-};
-static const sal_uInt16 mso_sptFlowChartDisplaySegm[] =
-{
- 0x4000, 0x0001, 0xa702, 0x0002, 0x6000, 0x8000
-};
-static const SvxMSDffTextRectangles mso_sptFlowChartDisplayTextRect[] =
-{
- { { 3600, 0 }, { 17800, 21600 } }
-};
-static const mso_CustomShape msoFlowChartDisplay =
-{
- (SvxMSDffVertPair*)mso_sptFlowChartDisplayVert, sizeof( mso_sptFlowChartDisplayVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptFlowChartDisplaySegm, sizeof( mso_sptFlowChartDisplaySegm ) >> 1,
- NULL, 0,
- NULL,
- (SvxMSDffTextRectangles*)mso_sptFlowChartDisplayTextRect, sizeof( mso_sptFlowChartDisplayTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptStandardGluePoints, sizeof( mso_sptStandardGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptWedgeRectCalloutVert[] =
-{
- { 0, 0 },
- { 0, 3590 }, { 2 MSO_I, 3 MSO_I }, { 0, 8970 },
- { 0, 12630 },{ 4 MSO_I, 5 MSO_I }, { 0, 18010 },
- { 0, 21600 },
- { 3590, 21600 }, { 6 MSO_I, 7 MSO_I }, { 8970, 21600 },
- { 12630, 21600 }, { 8 MSO_I, 9 MSO_I }, { 18010, 21600 },
- { 21600, 21600 },
- { 21600, 18010 }, { 10 MSO_I, 11 MSO_I }, { 21600, 12630 },
- { 21600, 8970 }, { 12 MSO_I, 13 MSO_I }, { 21600, 3590 },
- { 21600, 0 },
- { 18010, 0 }, { 14 MSO_I, 15 MSO_I }, { 12630, 0 },
- { 8970, 0 }, { 16 MSO_I, 17 MSO_I }, { 3590, 0 },
- { 0, 0 }
-};
-static const SvxMSDffCalculationData mso_sptWedgeRectCalloutCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 10800 }, //0x400
- { 0x2000, DFF_Prop_adjust2Value, 0,10800 },
- { 0x6006, 0x412, DFF_Prop_adjustValue, 0 }, //0x402
- { 0x6006, 0x412, DFF_Prop_adjust2Value, 6280 },
- { 0x6006, 0x417, DFF_Prop_adjustValue, 0 }, //0x404
- { 0x6006, 0x417, DFF_Prop_adjust2Value, 15320 },
- { 0x6006, 0x41a, DFF_Prop_adjustValue, 6280 }, //0x406
- { 0x6006, 0x41a, DFF_Prop_adjust2Value, 21600 },
- { 0x6006, 0x41d, DFF_Prop_adjustValue, 15320 }, //0x408
- { 0x6006, 0x41d, DFF_Prop_adjust2Value, 21600 },
- { 0x6006, 0x420, DFF_Prop_adjustValue, 21600 }, //0x40a
- { 0x6006, 0x420, DFF_Prop_adjust2Value, 15320 },
- { 0x6006, 0x422, DFF_Prop_adjustValue, 21600 }, //0x40c
- { 0x6006, 0x422, DFF_Prop_adjust2Value, 6280 },
- { 0x6006, 0x424, DFF_Prop_adjustValue, 15320 }, //0x40e
- { 0x6006, 0x424, DFF_Prop_adjust2Value, 0 },
- { 0x6006, 0x426, DFF_Prop_adjustValue, 6280 }, //0x410
- { 0x6006, 0x426, DFF_Prop_adjust2Value, 0 },
- { 0xa006, DFF_Prop_adjustValue, -1, 0x413 }, //0x412
- { 0xa006, 0x401, -1, 0x416 },
- { 0x2003, 0x400, 0, 0 }, //0x414
- { 0x2003, 0x401, 0, 0 },
- { 0xa000, 0x414, 0, 0x415 }, //0x416
- { 0xa006, DFF_Prop_adjustValue, -1, 0x418 },
- { 0x6006, 0x401, 0x416, -1 }, //0x418
- { 0x2000, DFF_Prop_adjust2Value, 0, 21600 },
- { 0x6006, 0x419, 0x41b, -1 }, //0x41a
- { 0xa006, 0x400, -1, 0x41c },
- { 0xa000, 0x415, 0, 0x414 }, //0x41c
- { 0x6006, 0x419, 0x41e, -1 },
- { 0x6006, 0x400, 0x41c, -1 }, //0x41e
- { 0x2000, DFF_Prop_adjustValue, 0, 21600 },
- { 0x6006, 0x41f, 0x421, -1 }, //0x420
- { 0x6006, 0x401, 0x416, -1 },
- { 0x6006, 0x41f, 0x423, -1 }, //0x422
- { 0xa006, 0x401, -1, 0x416 },
- { 0xa006, DFF_Prop_adjust2Value, -1, 0x425 }, //0x424
- { 0x6006, 0x400, 0x41c, -1 },
- { 0xa006, DFF_Prop_adjust2Value, -1, 0x427 }, //0x426
- { 0xa006, 0x400, -1, 0x41c },
- { 0x2000, DFF_Prop_adjustValue, 0, 0 }, //0x428
- { 0x2000, DFF_Prop_adjust2Value, 0, 0 }
-};
-static const sal_Int32 mso_sptWedgeRectCalloutDefault[] =
-{
- 2, 1400, 25920
-};
-static const SvxMSDffTextRectangles mso_sptWedgeRectCalloutTextRect[] =
-{
- { { 0, 0 }, { 21600, 21600 } }
-};
-static const SvxMSDffVertPair mso_sptWedgeRectCalloutGluePoints[] =
-{
- { 10800, 0 }, { 0, 10800 }, { 10800, 21600 }, { 21600, 10800 }, { 40 MSO_I, 41 MSO_I }
-};
-static const mso_CustomShape msoWedgeRectCallout =
-{
- (SvxMSDffVertPair*)mso_sptWedgeRectCalloutVert, sizeof( mso_sptWedgeRectCalloutVert ) / sizeof( SvxMSDffVertPair ),
- NULL, 0,
- (SvxMSDffCalculationData*)mso_sptWedgeRectCalloutCalc, sizeof( mso_sptWedgeRectCalloutCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptWedgeRectCalloutDefault,
- (SvxMSDffTextRectangles*)mso_sptWedgeRectCalloutTextRect, sizeof( mso_sptWedgeRectCalloutTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptWedgeRectCalloutGluePoints, sizeof( mso_sptWedgeRectCalloutGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptWaveVert[] = // adjustment1 : 0 - 4460
-{ // adjustment2 : 8640 - 12960
- { 7 MSO_I, 0 MSO_I }, { 15 MSO_I, 9 MSO_I }, { 16 MSO_I, 10 MSO_I }, { 12 MSO_I, 0 MSO_I },
- { 24 MSO_I, 1 MSO_I }, { 25 MSO_I, 26 MSO_I }, { 27 MSO_I, 28 MSO_I }, { 29 MSO_I, 1 MSO_I }
-};
-static const SvxMSDffCalculationData mso_sptWaveCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 }, //400 (vert.adj)
- { 0x8000, 21600, 0, 0x400 }, //401
- { 0x2000, DFF_Prop_adjust2Value, 0, 0 },//402 (horz.adj)
- { 0x2000, 0x402, 0, 10800 }, //403 -2160 -> 2160 (horz.adj)
- { 0x2001, 0x403, 2, 1 }, //404 -4320 -> 4320 (horz.adj)
- { 0x2003, 0x404, 0, 0 }, //405 abs( 0x404 ) (horz.adj)
- { 0x8000, 4320, 0, 0x405 }, //406
- { 0xa006, 0x403, 0, 0x405 }, //407
- { 0x4001, 15800, 0x400, 4460 }, //408 0 -> 15800 (vert.adj)
- { 0xa000, 0x400, 0, 0x408 }, //409
- { 0x6000, 0x400, 0x408, 0 }, //40a
- { 0x8000, 21600, 0, 0x404 }, //40b
- { 0x6006, 0x403, 0x40b, 21600 }, //40c
- { 0xa000, 0x40c, 0, 0x407 }, //40d width between p0 and p1
- { 0x2001, 0x405, 1, 2 }, //40e
- { 0xa000, 0x407, 7200, 0x40e }, //40f
- { 0x6000, 0x40c, 0x40e, 7200 }, //410
- { 0x2001, 0x40d, 1, 2 }, //411 1/2 width
- { 0x6000, 0x407, 0x411, 0 }, //412 top center glue xpos
- { 0x8000, 21600, 0, 0x412 }, //413 bottom center glue xpos
- { 0x2001, 0x405, 1, 2 }, //414 left glue x pos
- { 0x8000, 21600, 0, 0x414 }, //415 right glue x pos
- { 0x2001, 0x400, 2, 1 }, //416 y1 (textbox)
- { 0x8000, 21600, 0, 0x416 }, //417 y2 (textbox)
-
- { 0x8000, 21600, 0, 0x407 }, //418 p2
-
- { 0x8000, 21600, 0, 0x40f }, //419 c
- { 0x6000, 0x401, 0x408, 0 }, //41a
-
- { 0x8000, 21600, 0, 0x410 }, //41b c
- { 0xa000, 0x401, 0, 0x408 }, //41c
-
- { 0x8000, 21600, 0, 0x40c } //41d p3
-};
-static const SvxMSDffVertPair mso_sptWaveGluePoints[] =
-{
- { 0x12 MSO_I, 0 MSO_I }, { 0x14 MSO_I, 10800 }, { 0x13 MSO_I, 1 MSO_I }, { 0x15 MSO_I, 10800 }
-};
-static const sal_uInt16 mso_sptWaveSegm[] =
-{
- 0x4000, 0x2001, 0x0001, 0x2001, 0x6000, 0x8000
-};
-static const sal_Int32 mso_sptWaveDefault[] =
-{
- 2, 1400, 10800
-};
-static const SvxMSDffTextRectangles mso_sptWaveTextRect[] =
-{
- { { 5 MSO_I, 22 MSO_I }, { 11 MSO_I, 23 MSO_I } }
-};
-static const mso_CustomShape msoWave =
-{
- (SvxMSDffVertPair*)mso_sptWaveVert, sizeof( mso_sptWaveVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptWaveSegm, sizeof( mso_sptWaveSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptWaveCalc, sizeof( mso_sptWaveCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptWaveDefault,
- (SvxMSDffTextRectangles*)mso_sptWaveTextRect, sizeof( mso_sptWaveTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptWaveGluePoints, sizeof( mso_sptWaveGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-static const SvxMSDffVertPair mso_sptDoubleWaveVert[] = // adjustment1 : 0 - 2230
-{ // adjustment2 : 8640 - 12960
- { 7 MSO_I, 0 MSO_I }, { 15 MSO_I, 9 MSO_I }, { 0x1e MSO_I, 10 MSO_I }, { 0x12 MSO_I, 0 MSO_I }, { 0x1f MSO_I, 9 MSO_I }, { 16 MSO_I, 10 MSO_I }, { 12 MSO_I, 0 MSO_I },
- { 24 MSO_I, 1 MSO_I }, { 25 MSO_I, 26 MSO_I }, { 0x21 MSO_I, 28 MSO_I }, { 0x13 MSO_I, 1 MSO_I }, { 0x20 MSO_I, 26 MSO_I }, { 27 MSO_I, 28 MSO_I }, { 29 MSO_I, 1 MSO_I }
-};
-static const SvxMSDffCalculationData mso_sptDoubleWaveCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 0 }, //400 (vert.adj)
- { 0x8000, 21600, 0, 0x400 }, //401
- { 0x2000, DFF_Prop_adjust2Value, 0, 0 },//402 (horz.adj)
- { 0x2000, 0x402, 0, 10800 }, //403 -2160 -> 2160 (horz.adj)
- { 0x2001, 0x403, 2, 1 }, //404 -4320 -> 4320 (horz.adj)
- { 0x2003, 0x404, 0, 0 }, //405 abs( 0x404 ) (horz.adj)
- { 0x8000, 4320, 0, 0x405 }, //406 -> not used
- { 0xa006, 0x403, 0, 0x405 }, //407
- { 0x4001, 7900, 0x400, 2230 }, //408 0 -> 7900 (vert.adj)
- { 0xa000, 0x400, 0, 0x408 }, //409
- { 0x6000, 0x400, 0x408, 0 }, //40a
- { 0x8000, 21600, 0, 0x404 }, //40b
- { 0x6006, 0x403, 0x40b, 21600 }, //40c
- { 0xa000, 0x40c, 0, 0x407 }, //40d width between p0 and p1
- { 0x2001, 0x405, 1, 2 }, //40e
- { 0xa000, 0x407, 3600, 0x40e }, //40f
- { 0x6000, 0x40c, 0x40e, 3600 }, //410
- { 0x2001, 0x40d, 1, 2 }, //411 1/2 width
- { 0x6000, 0x407, 0x411, 0 }, //412 top center glue xpos
- { 0x8000, 21600, 0, 0x412 }, //413 bottom center glue xpos
- { 0x2001, 0x405, 1, 2 }, //414 left glue x pos
- { 0x8000, 21600, 0, 0x414 }, //415 right glue x pos
- { 0x2001, 0x400, 2, 1 }, //416 y1 (textbox)
- { 0x8000, 21600, 0, 0x416 }, //417 y2 (textbox)
-
- { 0x8000, 21600, 0, 0x407 }, //418 p2
-
- { 0x8000, 21600, 0, 0x40f }, //419 c
- { 0x6000, 0x401, 0x408, 0 }, //41a
-
- { 0x8000, 21600, 0, 0x410 }, //41b c
- { 0xa000, 0x401, 0, 0x408 }, //41c
-
- { 0x8000, 21600, 0, 0x40c }, //41d p3
- { 0xa000, 0x412, 0, 0x40e }, //41e
- { 0x6000, 0x412, 0x40e, 0 }, //41f
- { 0xa000, 0x413, 0, 0x40e }, //420
- { 0x6000, 0x413, 0x40e, 0 } //421
-};
-static const SvxMSDffVertPair mso_sptDoubleWaveGluePoints[] =
-{
- { 0x12 MSO_I, 0 MSO_I }, { 0x14 MSO_I, 10800 }, { 0x13 MSO_I, 1 MSO_I }, { 0x15 MSO_I, 10800 }
-};
-static const sal_uInt16 mso_sptDoubleWaveSegm[] =
-{
- 0x4000, 0x2002, 0x0001, 0x2002, 0x6000, 0x8000
-};
-static const sal_Int32 mso_sptDoubleWaveDefault[] =
-{
- 2, 1400, 10800
-};
-static const SvxMSDffTextRectangles mso_sptDoubleWaveTextRect[] =
-{
- { { 5 MSO_I, 22 MSO_I }, { 11 MSO_I, 23 MSO_I } }
-};
-static const mso_CustomShape msoDoubleWave =
-{
- (SvxMSDffVertPair*)mso_sptDoubleWaveVert, sizeof( mso_sptDoubleWaveVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptDoubleWaveSegm, sizeof( mso_sptDoubleWaveSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptDoubleWaveCalc, sizeof( mso_sptDoubleWaveCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptDoubleWaveDefault,
- (SvxMSDffTextRectangles*)mso_sptDoubleWaveTextRect, sizeof( mso_sptDoubleWaveTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptDoubleWaveGluePoints, sizeof( mso_sptDoubleWaveGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-static const SvxMSDffVertPair mso_sptWedgeRRectCalloutVert[] =
-{
- { 3590, 0 },
- { 0, 3590 },
- { 2 MSO_I, 3 MSO_I }, { 0, 8970 },
- { 0, 12630 },{ 4 MSO_I, 5 MSO_I }, { 0, 18010 },
- { 3590, 21600 },
- { 6 MSO_I, 7 MSO_I }, { 8970, 21600 },
- { 12630, 21600 }, { 8 MSO_I, 9 MSO_I }, { 18010, 21600 },
- { 21600, 18010 },
- { 10 MSO_I, 11 MSO_I }, { 21600, 12630 },
- { 21600, 8970 }, { 12 MSO_I, 13 MSO_I }, { 21600, 3590 },
- { 18010, 0 },
- { 14 MSO_I, 15 MSO_I }, { 12630, 0 },
- { 8970, 0 }, { 16 MSO_I, 17 MSO_I }
-};
-static const sal_uInt16 mso_sptWedgeRRectCalloutSegm[] =
-{
- 0x4000, 0xa701, 0x0005, 0xa801, 0x0005, 0xa701, 0x0005, 0xa801, 0x0004, 0x6001, 0x8000
-};
-static const SvxMSDffTextRectangles mso_sptWedgeRRectCalloutTextRect[] =
-{
- { { 800, 800 }, { 20800, 20800 } }
-};
-static const mso_CustomShape msoWedgeRRectCallout =
-{
- (SvxMSDffVertPair*)mso_sptWedgeRRectCalloutVert, sizeof( mso_sptWedgeRRectCalloutVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptWedgeRRectCalloutSegm, sizeof( mso_sptWedgeRRectCalloutSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptWedgeRectCalloutCalc, sizeof( mso_sptWedgeRectCalloutCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptWedgeRectCalloutDefault,
- (SvxMSDffTextRectangles*)mso_sptWedgeRRectCalloutTextRect, sizeof( mso_sptWedgeRRectCalloutTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-static const SvxMSDffVertPair mso_sptWedgeEllipseCalloutVert[] =
-{
- { 0, 0 }, { 21600, 21600 }, { 0x16 MSO_I, 0x17 MSO_I }, { 0x12 MSO_I, 0x13 MSO_I }, { 0xe MSO_I, 0xf MSO_I }
-};
-static const sal_uInt16 mso_sptWedgeEllipseCalloutSegm[] =
-{
- 0xa504, 0x0001, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptWedgeEllipseCalloutCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 10800 }, // 00 rad x
- { 0x2000, DFF_Prop_adjust2Value, 0, 10800 }, // 01 rad y
- { 0x6001, 0x400, 0x400, 1 }, // 02 rad x^2
- { 0x6001, 0x401, 0x401, 1 }, // 03 rad y^2
- { 0x6000, 0x402, 0x403, 0 }, // 04
- { 0x200d, 0x404, 0, 0 }, // 05
- { 0x2000, 0x405, 0, 10800 }, // 06 > 0 ? spur needs to be drawn : 10800
- { 0x6008, 0x400, 0x401, 0 }, // 07 atan2 -> angle
- { 0x2000, 0x407, 0, 10 }, // 08
- { 0x2000, 0x407, 10, 0 }, // 09
- { 0x400a, 10800, 0x407, 0 }, // 0a
- { 0x4009, 10800, 0x407, 0 }, // 0b
- { 0x2000, 0x40a, 10800, 0 }, // 0c
- { 0x2000, 0x40b, 10800, 0 }, // 0d
- { 0xe006, 0x406, DFF_Prop_adjustValue, 0x40c }, // 0e
- { 0xe006, 0x406, DFF_Prop_adjust2Value, 0x40d },// 0f
- { 0x400a, 10800, 0x408, 0 }, // 10
- { 0x4009, 10800, 0x408, 0 }, // 11
- { 0x2000, 0x410, 10800, 0 }, // 12
- { 0x2000, 0x411, 10800, 0 }, // 13
- { 0x400a, 10800, 0x409, 0 }, // 14
- { 0x4009, 10800, 0x409, 0 }, // 15
- { 0x2000, 0x414, 10800, 0 }, // 16
- { 0x2000, 0x415, 10800, 0 }, // 17
-};
-static const sal_Int32 mso_sptWedgeEllipseCalloutDefault[] =
-{
- 2, 1350, 25920
-};
-static const SvxMSDffVertPair mso_sptWedgeEllipseCalloutGluePoints[] =
-{
- { 10800, 0 }, { 3160, 3160 }, { 0, 10800 }, { 3160, 18440 }, { 10800, 21600 }, { 18440, 18440 }, { 21600, 10800 }, { 18440, 3160 }, { 0xe MSO_I, 0xf MSO_I }
-};
-static const SvxMSDffTextRectangles mso_sptWedgeEllipseCalloutTextRect[] =
-{
- { { 3200, 3200 }, { 18400, 18400 } }
-};
-static const mso_CustomShape msoWedgeEllipseCallout =
-{
- (SvxMSDffVertPair*)mso_sptWedgeEllipseCalloutVert, sizeof( mso_sptWedgeEllipseCalloutVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptWedgeEllipseCalloutSegm, sizeof( mso_sptWedgeEllipseCalloutSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptWedgeEllipseCalloutCalc, sizeof( mso_sptWedgeEllipseCalloutCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptWedgeEllipseCalloutDefault,
- (SvxMSDffTextRectangles*)mso_sptWedgeEllipseCalloutTextRect, sizeof( mso_sptWedgeEllipseCalloutTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- (SvxMSDffVertPair*)mso_sptWedgeEllipseCalloutGluePoints, sizeof( mso_sptWedgeEllipseCalloutGluePoints ) / sizeof( SvxMSDffVertPair )
-};
-
-static const SvxMSDffVertPair mso_sptCloudCalloutVert[] =
-{
- { 1930,7160 }, // p
- { 1530,4490 }, { 3400,1970 }, { 5270,1970 }, // ccp
- { 5860,1950 }, { 6470,2210 }, { 6970,2600 }, // ccp
- { 7450,1390 }, { 8340,650 }, { 9340,650 }, // ccp
- { 10004,690 }, { 10710,1050 }, { 11210,1700 }, // ccp
- { 11570,630 }, { 12330,0 }, { 13150,0 }, // ccp
- { 13840,0 }, { 14470,460 }, { 14870,1160 }, // ccp
- { 15330,440 }, { 16020,0 }, { 16740,0 }, // ccp
- { 17910,0 }, { 18900,1130 }, { 19110,2710 }, // ccp
- { 20240,3150 }, { 21060,4580 }, { 21060,6220 }, // ccp
- { 21060,6720 }, { 21000,7200 }, { 20830,7660 }, // ccp
- { 21310,8460 }, { 21600,9450 }, { 21600,10460 }, // ccp
- { 21600,12750 }, { 20310,14680 }, { 18650,15010 }, // ccp
- { 18650,17200 }, { 17370,18920 }, { 15770,18920 }, // ccp
- { 15220,18920 }, { 14700,18710 }, { 14240,18310 }, // ccp
- { 13820,20240 }, { 12490,21600 }, { 11000,21600 }, // ccp
- { 9890,21600 }, { 8840,20790 }, { 8210,19510 }, // ccp
- { 7620,20000 }, { 7930,20290 }, { 6240,20290 }, // ccp
- { 4850,20290 }, { 3570,19280 }, { 2900,17640 }, // ccp
- { 1300,17600 }, { 480,16300 }, { 480,14660 }, // ccp
- { 480,13900 }, { 690,13210 }, { 1070,12640 }, // ccp
- { 380,12160 }, { 0,11210 }, { 0,10120 }, // ccp
- { 0,8590 }, { 840,7330 }, { 1930,7160 }, // ccp
-
- { 1930, 7160 }, { 1950, 7410 }, { 2040, 7690 }, { 2090, 7920 }, // pccp
- { 6970, 2600 }, { 7200, 2790 }, { 7480, 3050 }, { 7670, 3310 }, // pccp
- { 11210, 1700 }, { 11130, 1910 }, { 11080, 2160 }, { 11030, 2400 }, // pccp
- { 14870, 1160 }, { 14720, 1400 }, { 14640, 1720 }, { 14540, 2010 }, // pccp
- { 19110, 2710 }, { 19130, 2890 }, { 19230, 3290 }, { 19190, 3380 }, // pccp
- { 20830, 7660 }, { 20660, 8170 }, { 20430, 8620 }, { 20110, 8990 }, // pccp
- { 18660, 15010 }, { 18740, 14200 }, { 18280, 12200 }, { 17000, 11450 }, // pccp
- { 14240, 18310 }, { 14320, 17980 }, { 14350, 17680 }, { 14370, 17360 }, // pccp
- { 8220, 19510 }, { 8060, 19250 }, { 7960, 18950 }, { 7860, 18640 }, // pccp
- { 2900, 17640 }, { 3090, 17600 }, { 3280, 17540 }, { 3460, 17450 }, // pccp
- { 1070, 12640 }, { 1400, 12900 }, { 1780, 13130 }, { 2330, 13040 } // pccp
-};
-static const sal_uInt16 mso_sptCloudCalloutSegm[] =
-{
- 0x4000, 0x2016, 0x6001, 0x8000,
- 0x4000, 0x2001, 0xaa00, 0x8000,
- 0x4000, 0x2001, 0xaa00, 0x8000,
- 0x4000, 0x2001, 0xaa00, 0x8000,
- 0x4000, 0x2001, 0xaa00, 0x8000,
- 0x4000, 0x2001, 0xaa00, 0x8000,
- 0x4000, 0x2001, 0xaa00, 0x8000,
- 0x4000, 0x2001, 0xaa00, 0x8000,
- 0x4000, 0x2001, 0xaa00, 0x8000,
- 0x4000, 0x2001, 0xaa00, 0x8000,
- 0x4000, 0x2001, 0xaa00, 0x8000,
- 0x4000, 0x2001, 0xaa00, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptCloudCalloutCalc[] =
-{
- { 0x2000, DFF_Prop_adjustValue, 0, 10800 },
- { 0x2000, DFF_Prop_adjust2Value, 0, 10800 },
- { 0x6008, 0x400, 0x401, 0 },
- { 0x400a, 10800, 0x402, 0 }, // 3
- { 0x4009, 10800, 0x402, 0 }, // 4
- { 0x2000, 0x403, 10800, 0 }, // 5
- { 0x2000, 0x404, 10800, 0 }, // 6
- { 0xa000, DFF_Prop_adjustValue, 0, 0x405 }, // 7
- { 0xa000, DFF_Prop_adjust2Value,0, 0x406 }, // 8
- { 0x2001, 0x407, 1, 3 }, // 9
- { 0x2001, 0x408, 1, 3 }, // 0xa
- { 0x2001, 0x407, 2, 3 }, // 0xb
- { 0x2001, 0x408, 2, 3 }, // 0xc
- { 0x2000, DFF_Prop_adjustValue, 0, 0 }, // 0xd
- { 0x2000, DFF_Prop_adjust2Value, 0, 0 }, // 0xe
- { 0x2001, 0x403, 1, 10800 / 900 }, // 0xf taking half x distance of the radius from the first bobble
- { 0x2001, 0x404, 1, 10800 / 900 }, // 0x10
- { 0xe000, 0x409, 0x405, 0x40f }, // 0x11
- { 0xe000, 0x40a, 0x406, 0x410 }, // 0x12
- { 0x6000, 0x40b, 0x405, 0 }, // 0x13
- { 0x6000, 0x40c, 0x406, 0 } // 0x14
-};
-static const sal_Int32 mso_sptCloudCalloutDefault[] =
-{
- 2, 1350, 25920
-};
-static const SvxMSDffTextRectangles mso_sptCloudCalloutTextRect[] =
-{
- { { 3000, 3320 }, { 17110, 17330 } }
-};
-static const mso_CustomShape msoCloudCallout =
-{
- (SvxMSDffVertPair*)mso_sptCloudCalloutVert, sizeof( mso_sptCloudCalloutVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptCloudCalloutSegm, sizeof( mso_sptCloudCalloutSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptCloudCalloutCalc, sizeof( mso_sptCloudCalloutCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptCloudCalloutDefault,
- (SvxMSDffTextRectangles*)mso_sptCloudCalloutTextRect, sizeof( mso_sptCloudCalloutTextRect ) / sizeof( SvxMSDffTextRectangles ),
- 21600, 21600,
- 0x80000000, 0x80000000,
- NULL, 0
-};
-
-
-class SvxMSDffAdjustmentHandle
-{
- sal_Int32 nAdjustValue;
- sal_Int32 nDefaultValue;
- sal_Bool bIsDefault;
-
- public :
- SvxMSDffAdjustmentHandle() : nAdjustValue( 0 ), nDefaultValue( 0 ), bIsDefault( TRUE ) {};
-
- void SetAdjustValue( sal_Int32 nVal ) { nAdjustValue = nVal; bIsDefault = FALSE; };
- sal_Int32 GetAdjustValue() const { return bIsDefault ? nDefaultValue : nAdjustValue; };
- void SetDefaultValue( sal_Int32 nVal ) { nDefaultValue = nVal; };
- sal_Bool IsDefault() const { return bIsDefault; };
-};
-
-const mso_CustomShape* GetCustomShapeContent2( MSO_SPT eSpType )
-{
- const mso_CustomShape* pCustomShape = NULL;
- switch( eSpType )
- {
- case mso_sptArc : pCustomShape = &msoArc; break;
- case mso_sptRectangle : pCustomShape = &msoRectangle; break;
- case mso_sptParallelogram : pCustomShape = &msoParallelogram; break;
- case mso_sptTrapezoid : pCustomShape = &msoTrapezoid; break;
- case mso_sptDiamond : pCustomShape = &msoDiamond; break;
- case mso_sptRoundRectangle : pCustomShape = &msoRoundRectangle; break;
- case mso_sptOctagon : pCustomShape = &msoOctagon; break;
- case mso_sptIsocelesTriangle : pCustomShape = &msoIsocelesTriangle; break;
- case mso_sptRightTriangle : pCustomShape = &msoRightTriangle; break;
- case mso_sptEllipse : pCustomShape = &msoEllipse; break;
- case mso_sptHexagon : pCustomShape = &msoHexagon; break;
- case mso_sptPlus : pCustomShape = &msoPlus; break;
- case mso_sptPentagon : pCustomShape = &msoPentagon; break;
- case mso_sptCan : pCustomShape = &msoCan; break;
- case mso_sptCube : pCustomShape = &msoCube; break;
- case mso_sptActionButtonBlank : pCustomShape = &msoActionButtonBlank; break;
- case mso_sptActionButtonHome : pCustomShape = &msoActionButtonHome; break;
- case mso_sptActionButtonHelp : pCustomShape = &msoActionButtonHelp; break;
- case mso_sptActionButtonInformation : pCustomShape = &msoActionButtonInformation; break;
- case mso_sptActionButtonBackPrevious : pCustomShape = &msoActionButtonBackPrevious; break;
- case mso_sptActionButtonForwardNext : pCustomShape = &msoActionButtonForwardNext; break;
- case mso_sptActionButtonBeginning : pCustomShape = &msoActionButtonBeginning; break;
- case mso_sptActionButtonEnd : pCustomShape = &msoActionButtonEnd; break;
- case mso_sptActionButtonReturn : pCustomShape = &msoActionButtonReturn; break;
- case mso_sptActionButtonDocument : pCustomShape = &msoActionButtonDocument; break;
- case mso_sptActionButtonSound : pCustomShape = &msoActionButtonSound; break;
- case mso_sptActionButtonMovie : pCustomShape = &msoActionButtonMovie; break;
- case mso_sptBevel : pCustomShape = &msoBevel; break;
- case mso_sptFoldedCorner : pCustomShape = &msoFoldedCorner; break;
- case mso_sptSmileyFace : pCustomShape = &msoSmileyFace; break;
- case mso_sptDonut : pCustomShape = &msoDonut; break;
- case mso_sptNoSmoking : pCustomShape = &msoNoSmoking; break;
- case mso_sptBlockArc : pCustomShape = &msoBlockArc; break;
- case mso_sptHeart : pCustomShape = &msoHeart; break;
- case mso_sptLightningBolt : pCustomShape = &msoLightningBold; break;
- case mso_sptSun : pCustomShape = &msoSun; break;
- case mso_sptMoon : pCustomShape = &msoMoon; break;
- case mso_sptBracketPair : pCustomShape = &msoBracketPair; break;
- case mso_sptBracePair : pCustomShape = &msoBracePair; break;
- case mso_sptPlaque : pCustomShape = &msoPlaque; break;
- case mso_sptLeftBracket : pCustomShape = &msoLeftBracket; break;
- case mso_sptRightBracket : pCustomShape = &msoRightBracket; break;
- case mso_sptLeftBrace : pCustomShape = &msoLeftBrace; break;
- case mso_sptRightBrace : pCustomShape = &msoRightBrace; break;
- case mso_sptArrow : pCustomShape = &msoArrow; break;
- case mso_sptUpArrow : pCustomShape = &msoUpArrow; break;
- case mso_sptDownArrow : pCustomShape = &msoDownArrow; break;
- case mso_sptLeftArrow : pCustomShape = &msoLeftArrow; break;
- case mso_sptLeftRightArrow : pCustomShape = &msoLeftRightArrow; break;
- case mso_sptUpDownArrow : pCustomShape = &msoUpDownArrow; break;
- case mso_sptQuadArrow : pCustomShape = &msoQuadArrow; break;
- case mso_sptLeftRightUpArrow : pCustomShape = &msoLeftRightUpArrow; break;
- case mso_sptBentArrow : pCustomShape = &msoBentArrow; break;
- case mso_sptUturnArrow : pCustomShape = &msoUturnArrow; break;
- case mso_sptLeftUpArrow : pCustomShape = &msoLeftUpArrow; break;
- case mso_sptBentUpArrow : pCustomShape = &msoBentUpArrow; break;
- case mso_sptCurvedRightArrow : pCustomShape = &msoCurvedArrow; break;
- case mso_sptCurvedLeftArrow : pCustomShape = &msoCurvedArrow; break;
- case mso_sptCurvedUpArrow : pCustomShape = &msoCurvedArrow; break;
- case mso_sptCurvedDownArrow : pCustomShape = &msoCurvedArrow; break;
- case mso_sptStripedRightArrow : pCustomShape = &msoStripedRightArrow; break;
- case mso_sptNotchedRightArrow : pCustomShape = &msoNotchedRightArrow; break;
- case mso_sptHomePlate : pCustomShape = &msoHomePlate; break;
- case mso_sptChevron : pCustomShape = &msoChevron; break;
- case mso_sptRightArrowCallout : pCustomShape = &msoRightArrowCallout; break;
- case mso_sptLeftArrowCallout : pCustomShape = &msoLeftArrowCallout; break;
- case mso_sptUpArrowCallout : pCustomShape = &msoUpArrowCallout; break;
- case mso_sptDownArrowCallout : pCustomShape = &msoDownArrowCallout; break;
- case mso_sptLeftRightArrowCallout : pCustomShape = &msoLeftRightArrowCallout; break;
- case mso_sptUpDownArrowCallout : pCustomShape = &msoUpDownArrowCallout; break;
- case mso_sptQuadArrowCallout : pCustomShape = &msoQuadArrowCallout; break;
- case mso_sptCircularArrow : pCustomShape = &msoCircularArrow; break;
- case mso_sptIrregularSeal1 : pCustomShape = &msoIrregularSeal1; break;
- case mso_sptIrregularSeal2 : pCustomShape = &msoIrregularSeal2; break;
- case mso_sptSeal4 : pCustomShape = &msoSeal4; break;
- case mso_sptStar : pCustomShape = &msoStar; break;
- case mso_sptSeal8 : pCustomShape = &msoSeal8; break;
- case mso_sptSeal16 : pCustomShape = &msoSeal16; break;
- case mso_sptSeal24 : pCustomShape = &msoSeal24; break;
- case mso_sptSeal32 : pCustomShape = &msoSeal32; break;
- case mso_sptRibbon2 : pCustomShape = &msoRibbon2; break;
- case mso_sptRibbon : pCustomShape = &msoRibbon2; break;
- case mso_sptEllipseRibbon2 : pCustomShape = &msoRibbon2; break; //!!!!!
- case mso_sptEllipseRibbon : pCustomShape = &msoRibbon2; break; //!!!!!
- case mso_sptVerticalScroll : pCustomShape = &msoVerticalScroll; break;
- case mso_sptHorizontalScroll : pCustomShape = &msoHorizontalScroll; break;
- case mso_sptFlowChartProcess : pCustomShape = &msoFlowChartProcess; break;
- case mso_sptFlowChartAlternateProcess : pCustomShape = &msoFlowChartAlternateProcess; break;
- case mso_sptFlowChartDecision : pCustomShape = &msoFlowChartDecision; break;
- case mso_sptFlowChartInputOutput : pCustomShape = &msoFlowChartInputOutput; break;
- case mso_sptFlowChartPredefinedProcess :pCustomShape = &msoFlowChartPredefinedProcess; break;
- case mso_sptFlowChartInternalStorage : pCustomShape = &msoFlowChartInternalStorage; break;
- case mso_sptFlowChartDocument : pCustomShape = &msoFlowChartDocument; break;
- case mso_sptFlowChartMultidocument : pCustomShape = &msoFlowChartMultidocument; break;
- case mso_sptFlowChartTerminator : pCustomShape = &msoFlowChartTerminator; break;
- case mso_sptFlowChartPreparation : pCustomShape = &msoFlowChartPreparation; break;
- case mso_sptFlowChartManualInput : pCustomShape = &msoFlowChartManualInput; break;
- case mso_sptFlowChartManualOperation : pCustomShape = &msoFlowChartManualOperation; break;
- case mso_sptFlowChartConnector : pCustomShape = &msoFlowChartConnector; break;
- case mso_sptFlowChartOffpageConnector : pCustomShape = &msoFlowChartOffpageConnector; break;
- case mso_sptFlowChartPunchedCard : pCustomShape = &msoFlowChartPunchedCard; break;
- case mso_sptFlowChartPunchedTape : pCustomShape = &msoFlowChartPunchedTape; break;
- case mso_sptFlowChartSummingJunction : pCustomShape = &msoFlowChartSummingJunction; break;
- case mso_sptFlowChartOr : pCustomShape = &msoFlowChartOr; break;
- case mso_sptFlowChartCollate : pCustomShape = &msoFlowChartCollate; break;
- case mso_sptFlowChartSort : pCustomShape = &msoFlowChartSort; break;
- case mso_sptFlowChartExtract : pCustomShape = &msoFlowChartExtract; break;
- case mso_sptFlowChartMerge : pCustomShape = &msoFlowChartMerge; break;
- case mso_sptFlowChartOnlineStorage : pCustomShape = &msoFlowChartOnlineStorage; break;
- case mso_sptFlowChartDelay : pCustomShape = &msoFlowChartDelay; break;
- case mso_sptFlowChartMagneticTape : pCustomShape = &msoFlowChartMagneticTape; break;
- case mso_sptFlowChartMagneticDisk : pCustomShape = &msoFlowChartMagneticDisk; break;
- case mso_sptFlowChartMagneticDrum : pCustomShape = &msoFlowChartMagneticDrum; break;
- case mso_sptFlowChartDisplay : pCustomShape = &msoFlowChartDisplay; break;
- case mso_sptWave : pCustomShape = &msoWave; break;
- case mso_sptDoubleWave : pCustomShape = &msoDoubleWave; break;
- case mso_sptWedgeRectCallout : pCustomShape = &msoWedgeRectCallout; break;
- case mso_sptBalloon :
- case mso_sptWedgeRRectCallout : pCustomShape = &msoWedgeRRectCallout; break;
- case mso_sptWedgeEllipseCallout : pCustomShape = &msoWedgeEllipseCallout; break;
- case mso_sptCloudCallout : pCustomShape = &msoCloudCallout; break;
-
- default :
- break;
- }
- return pCustomShape;
-}
-
-SvxMSDffCustomShape::~SvxMSDffCustomShape()
-{
- if ( bVertAlloc )
- delete[] pVertData;
- if ( bSegAlloc )
- delete[] pSegData;
- if ( bTextRectAlloc )
- delete[] pTextRectData;
- if ( bCalcAlloc )
- delete[] pCalculationData;
- delete[] pAdjustmentHandles;
-}
-
-SvxMSDffCustomShape::SvxMSDffCustomShape( const DffPropertyReader& rPropReader, SvStream& rSt,
- DffObjData& rData, Rectangle& rSnapRect, sal_Int32 nAngle, MSFilterTracer* pT ) :
- pTracer ( pT ),
- eSpType ( rData.eShapeType ),
- aSnapRect ( rSnapRect ),
- nFix16Angle ( nAngle ),
- nXRef ( 0x80000000 ),
- nYRef ( 0x80000000 ),
- nFlags ( 0 ),
- nColorData ( 0 ),
- pVertData ( NULL ),
- pSegData ( NULL ),
- nTextRectData ( 0 ),
- pTextRectData ( NULL ),
- nCalculationData ( 0 ),
- pCalculationData ( NULL ),
- nAdjustmentHandles ( 0 ),
- pAdjustmentHandles ( NULL ),
- nGluePoints ( 0 ),
- pGluePoints ( NULL ),
- bIsEmpty ( TRUE ),
- bVertAlloc ( FALSE ),
- bSegAlloc ( FALSE ),
- bCalcAlloc ( FALSE ),
- bTextRectAlloc ( FALSE ),
- bTextFlow ( ( (MSO_TextFlow)rPropReader.GetPropertyValue( DFF_Prop_txflTextFlow ) ) == mso_txflTtoBA ),
- bFilled ( ( rPropReader.GetPropertyValue( DFF_Prop_fNoFillHitTest ) & 0x10 ) != 0 ), // pie <-> arc
- bFlipH ( ( rData.nSpFlags & SP_FFLIPH ) != 0 ),
- bFlipV ( ( rData.nSpFlags & SP_FFLIPV ) != 0 )
-{
- const sal_Int32* pDefData = NULL;
- const mso_CustomShape* pDefCustomShape = NULL;
-
-
- // cloning DFF_Prop_adjustValues from DffPropertyReader to be able
- // to manipulate them and not destroying the original properties
-
- sal_uInt32 nHandles[ 10 ];
- sal_uInt32 nHandlesSet = 0;
- sal_uInt32 i, nHandlesUsed = 0;
-
- for ( i = DFF_Prop_adjustValue; i < DFF_Prop_adjust10Value; i++ )
- {
- if ( rPropReader.IsProperty( i ) )
- {
- sal_Int32 nIndex = i - DFF_Prop_adjustValue;
- nHandles[ nIndex ] = rPropReader.GetPropertyValue( i );
- nHandlesSet |= 1 << nIndex;
- nHandlesUsed = nIndex + 1;
- }
- }
- pDefCustomShape = GetCustomShapeContent2( eSpType );
- if ( pDefCustomShape )
- {
- switch( eSpType )
- {
- case mso_sptCan : nColorData = 0x20200000; break;
- case mso_sptCube : nColorData = 0x302d0000; break;
- case mso_sptActionButtonBlank : nColorData = 0x502ad400; break;
- case mso_sptActionButtonHome : nColorData = 0x702ad4ad; break;
- case mso_sptActionButtonHelp : nColorData = 0x602ad4a0; break;
- case mso_sptActionButtonInformation : nColorData = 0x702ad4a5; break;
- case mso_sptActionButtonBackPrevious : nColorData = 0x602ad4a0; break;
- case mso_sptActionButtonForwardNext : nColorData = 0x602ad4a0; break;
- case mso_sptActionButtonBeginning : nColorData = 0x602ad4a0; break;
- case mso_sptActionButtonEnd : nColorData = 0x602ad4a0; break;
- case mso_sptActionButtonReturn : nColorData = 0x602ad4a0; break;
- case mso_sptActionButtonDocument : nColorData = 0x702ad4da; break;
- case mso_sptActionButtonSound : nColorData = 0x602ad4a0; break;
- case mso_sptActionButtonMovie : nColorData = 0x602ad4a0; break;
- case mso_sptBevel : nColorData = 0x502ad400; break;
- case mso_sptFoldedCorner : nColorData = 0x20d00000; break;
- case mso_sptSmileyFace : nColorData = 0x20d00000; break;
- case mso_sptCurvedLeftArrow :
- {
- if ( nHandlesSet & 4 )
- nHandles[ 2 ] = 21600 - nHandles[ 2 ];
- nFlags |= DFF_CUSTOMSHAPE_FLIP_H;
- }
- break;
- case mso_sptCurvedUpArrow :
- {
- if ( nHandlesSet & 4 )
- nHandles[ 2 ] = 21600 - nHandles[ 2 ];
- nFlags |= DFF_CUSTOMSHAPE_FLIP_V | DFF_CUSTOMSHAPE_EXCH;
- }
- break;
- case mso_sptCurvedDownArrow : nFlags |= DFF_CUSTOMSHAPE_EXCH; break;
- case mso_sptRibbon2 : nColorData = 0x30dd0000; break;
- case mso_sptRibbon : nColorData = 0x30dd0000; break;
-
- case mso_sptEllipseRibbon2 : nColorData = 0x30dd0000; break;
- case mso_sptEllipseRibbon : nColorData = 0x30dd0000; break;
-
- case mso_sptVerticalScroll : nColorData = 0x30dd0000; break;
- case mso_sptHorizontalScroll : nColorData = 0x30dd0000; break;
- default: break;
- }
- }
- nCoordHeight = nCoordWidth = 21600;
- if ( pDefCustomShape )
- {
- bIsEmpty = FALSE;
- nNumElemVert = pDefCustomShape->nVertices;
- pVertData = pDefCustomShape->pVertices;
- nNumElemSeg = pDefCustomShape->nElements;
- pSegData = pDefCustomShape->pElements;
- nCalculationData = pDefCustomShape->nCalculation;
- pCalculationData = pDefCustomShape->pCalculation;
- pDefData = pDefCustomShape->pDefData;
- pTextRectData = pDefCustomShape->pTextRect;
- nTextRectData = pDefCustomShape->nTextRect;
- nCoordWidth = pDefCustomShape->nCoordWidth;
- nCoordHeight = pDefCustomShape->nCoordHeight;
- nXRef = pDefCustomShape->nXRef;
- nYRef = pDefCustomShape->nYRef;
- pGluePoints = pDefCustomShape->pGluePoints;
- nGluePoints = pDefCustomShape->nGluePoints;
- }
- sal_Int32 nGeoRight = rPropReader.GetPropertyValue( DFF_Prop_geoRight, 0 );
- if ( nGeoRight )
- {
- nGeoRight -= rPropReader.GetPropertyValue( DFF_Prop_geoLeft, 0 );
- nCoordWidth = labs( nGeoRight );
- }
- sal_Int32 nGeoBottom = rPropReader.GetPropertyValue( DFF_Prop_geoBottom, 0 );
- if ( nGeoBottom )
- {
- nGeoBottom -= rPropReader.GetPropertyValue( DFF_Prop_geoTop, 0 );
- nCoordHeight = labs( nGeoBottom );
- }
-
- if ( rPropReader.SeekToContent( DFF_Prop_pVertices, rSt ) )
- {
- sal_uInt16 nTmp16, nNumElemMemVert, nElemSizeVert;
- rSt >> nTmp16 >> nNumElemMemVert >> nElemSizeVert;
- if ( nTmp16 )
- {
- bIsEmpty = FALSE;
- nNumElemVert = nTmp16;
- sal_uInt32 k = nNumElemVert;
- bVertAlloc = TRUE;
- pVertData = new SvxMSDffVertPair[ nNumElemVert ];
- SvxMSDffVertPair* pTmp = pVertData;
- if ( nElemSizeVert == 8 )
- {
- while( k-- )
- {
- rSt >> pTmp->nValA
- >> pTmp->nValB;
- pTmp++;
- }
- }
- else
- {
- sal_Int16 nTmpA, nTmpB;
- while ( k-- )
- {
- rSt >> nTmpA
- >> nTmpB;
-
- pTmp->nValA = nTmpA;
- pTmp->nValB = nTmpB;
- pTmp++;
- }
- }
- }
- }
- if ( !bIsEmpty ) // we can import an customshape if either pVertData or pDefCustomShape is set
- {
- if ( rPropReader.SeekToContent( DFF_Prop_pSegmentInfo, rSt ) )
- {
- sal_uInt16 nTmp16, nNumElemMemSeg, nElemSizeSeg;
- rSt >> nTmp16 >> nNumElemMemSeg >> nElemSizeSeg;
- if ( nTmp16 )
- {
- nNumElemSeg = nTmp16;
- bSegAlloc = TRUE;
- pSegData = new sal_uInt16[ nNumElemSeg + 1 ]; // #97948# allocate one more element,
-#ifdef OSL_BIGENDIAN // so it won't be difficult to append
- sal_uInt32 k = nNumElemSeg; // a missing end segment action
- sal_uInt16* pTmp = pSegData;
- while( k-- )
- {
- rSt >> *pTmp++;
- }
-#else
- rSt.Read( pSegData, nNumElemSeg << 1 );
-#endif
- if ( pSegData[ nNumElemSeg - 1 ] != 0x8000 ) // #97948# append the missing segm action
- pSegData[ nNumElemSeg++ ] = 0x8000;
- }
- }
- if ( rPropReader.SeekToContent( 342, rSt ) )
- {
- sal_uInt16 nTmp16, nNumElemMem, nElemSize;
- rSt >> nTmp16 >> nNumElemMem >> nElemSize;
- if ( nTmp16 && ( nElemSize == 8 ) )
- {
- nCalculationData = nTmp16;
- pCalculationData = new SvxMSDffCalculationData[ nCalculationData ];
- bCalcAlloc = TRUE;
- sal_uInt32 k;
- sal_uInt16 nVal0, nVal1, nVal2;
- for ( k = 0; k < nCalculationData; k++ )
- {
- SvxMSDffCalculationData& rDat = pCalculationData[ k ];
- rSt >> rDat.nFlags
- >> nVal0 >> nVal1 >> nVal2;
- rDat.nVal1 = nVal0;
- rDat.nVal2 = nVal1;
- rDat.nVal3 = nVal2;
- }
- }
- }
-
- if ( rPropReader.SeekToContent( 343, rSt ) )
- {
- sal_uInt16 nTmp16, nNumElemMem, nElemSize;
- rSt >> nTmp16 >> nNumElemMem >> nElemSize;
- if ( nTmp16 && ( nElemSize == 16 ) )
- {
- sal_uInt32 nNumElem = nTmp16;
- if ( nNumElem > 1 )
- nNumElem = 2;
- bTextRectAlloc = sal_True;
- nTextRectData = nNumElem;
- pTextRectData = new SvxMSDffTextRectangles[ nNumElem ];
- SvxMSDffTextRectangles* pTmp = pTextRectData;
- for ( i = 0; i < nNumElem; i++ )
- {
- rSt >> pTmp->nPairA.nValA
- >> pTmp->nPairA.nValB
- >> pTmp->nPairB.nValA
- >> pTmp->nPairB.nValB;
- pTmp++;
- }
- }
- }
-
- const sal_Int32* pTmp = pDefData;
- sal_uInt32 nDefaults = 0;
- if ( pTmp )
- nDefaults = nAdjustmentHandles = *pTmp++;
-
- if ( nHandlesUsed > nAdjustmentHandles )
- nAdjustmentHandles = nHandlesUsed;
-
- if ( nAdjustmentHandles )
- {
- pAdjustmentHandles = new SvxMSDffAdjustmentHandle[ nAdjustmentHandles ];
- for ( i = 0; i < nAdjustmentHandles; i++ )
- {
- if ( i < nDefaults )
- pAdjustmentHandles[ i ].SetDefaultValue( *pTmp++ );
- if ( nHandlesSet & ( 1 << i ) )
- pAdjustmentHandles[ i ].SetAdjustValue( nHandles[ i ] );
- }
- }
-
- fXScale = (double)aSnapRect.GetWidth() / (double)nCoordWidth;
- fYScale = (double)aSnapRect.GetHeight() / (double)nCoordHeight;
-
- if ( rPropReader.IsProperty( 339 ) )
- nXRef = rPropReader.GetPropertyValue( 339 );
- if ( rPropReader.IsProperty( 340 ) )
- nYRef = rPropReader.GetPropertyValue( 340 );
- }
-}
-
-sal_Int32 SvxMSDffCustomShape::Fix16ToAngle( sal_Int32 nAngle ) const
-{
- if ( nAngle )
- {
- nAngle = ( (sal_Int16)( nAngle >> 16) * 100L ) + ( ( ( nAngle & 0x0000ffff) * 100L ) >> 16 );
- nAngle = NormAngle360( -nAngle );
- }
- return nAngle;
-}
-
-sal_Int32 SvxMSDffCustomShape::GetAdjustValue( sal_uInt32 nIndex ) const
-{
- return ( nIndex < nAdjustmentHandles ) ? pAdjustmentHandles[ nIndex ].GetAdjustValue() : 0;
-}
-
-sal_Int32 SvxMSDffCustomShape::GetAdjustValue( sal_uInt32 nIndex, sal_Int32 nDefault ) const
-{
- if ( ( nIndex >= nAdjustmentHandles ) || pAdjustmentHandles[ nIndex ].IsDefault() )
- return nDefault;
- else
- return pAdjustmentHandles[ nIndex ].GetAdjustValue();
-}
-
-Point SvxMSDffCustomShape::GetPoint( const SvxMSDffVertPair& rPair, sal_Bool bScale ) const
-{
- Point aRetValue;
- sal_Bool bExchange = ( nFlags & DFF_CUSTOMSHAPE_EXCH ) != 0; // x <-> y
- sal_uInt32 nPass = 0;
- do
- {
- sal_uInt32 nIndex = nPass;
-
- if ( bExchange )
- nIndex ^= 1;
-
- sal_uInt32 nDat = nIndex ? (sal_uInt32)rPair.nValB : (sal_uInt32)rPair.nValA;
- sal_Bool bScaleWidth = nPass == 0;
-
- double fVal;
- sal_uInt32 nGeometryFlags = 0;
- if ( ( nDat >> 16 ) == 0x8000 )
- fVal = ImplGetValue( (sal_uInt16)nDat, nGeometryFlags );
- else
- fVal = (sal_Int32)nDat;
-
- if ( bScale )
- {
- if ( nGeometryFlags & bExchange ) // left <-> top, right <-> bottom
- {
- nGeometryFlags = ( ( nGeometryFlags & 1 ) << 1 ) | ( ( nGeometryFlags & 2 ) >> 1 ) |
- ( ( nGeometryFlags & 4 ) << 1 ) | ( ( nGeometryFlags & 8 ) >> 1 );
- }
- if ( bScaleWidth )
- {
- if ( ( aSnapRect.GetWidth() > aSnapRect.GetHeight() ) && ( ( nXRef != (sal_Int32)0x80000000 ) || nGeometryFlags ) )
- {
- sal_Bool bGeo = ( ( ( nGeometryFlags & GEOMETRY_USED_LEFT ) == 0 ) && ( fVal > nXRef ) )
- || ( ( nGeometryFlags & GEOMETRY_USED_RIGHT ) != 0 );
- if ( ( nGeometryFlags & ( GEOMETRY_USED_LEFT | GEOMETRY_USED_RIGHT ) ) == ( GEOMETRY_USED_LEFT | GEOMETRY_USED_RIGHT ) )
- {
- fVal -= (double)nCoordWidth * 0.5;
- fVal *= fYScale;
- fVal += (double)aSnapRect.GetWidth() * 0.5;
- }
- else
- {
- fVal *= fYScale;
- if ( bGeo )
- fVal += (double)nCoordWidth * fXScale - (double)nCoordWidth * fYScale;
- }
- }
- else
- fVal *= fXScale;
- if ( nFlags & DFF_CUSTOMSHAPE_FLIP_H )
- fVal = aSnapRect.GetWidth() - fVal;
- }
- else
- {
- if ( ( aSnapRect.GetHeight() > aSnapRect.GetWidth() ) && ( ( nYRef != (sal_Int32)0x80000000 ) || nGeometryFlags ) )
- {
- sal_Bool bGeo = ( ( ( nGeometryFlags & GEOMETRY_USED_TOP ) == 0 ) && ( fVal > nYRef ) )
- || ( ( nGeometryFlags & GEOMETRY_USED_BOTTOM ) != 0 );
- if ( ( nGeometryFlags & ( GEOMETRY_USED_TOP | GEOMETRY_USED_BOTTOM ) ) == ( GEOMETRY_USED_TOP | GEOMETRY_USED_BOTTOM ) )
- {
- fVal -= (double)nCoordHeight * 0.5;
- fVal *= fXScale;
- fVal += (double)aSnapRect.GetHeight() * 0.5;
- }
- else
- {
- fVal *= fXScale;
- if ( bGeo )
- fVal += (double)nCoordHeight * fYScale - (double)nCoordHeight * fXScale;
- }
- }
- else
- fVal *= fYScale;
- if ( nFlags & DFF_CUSTOMSHAPE_FLIP_V )
- fVal = aSnapRect.GetHeight() - fVal;
- }
- }
- if ( nPass )
- aRetValue.Y() = (sal_Int32)fVal;
- else
- aRetValue.X() = (sal_Int32)fVal;
- }
- while ( ++nPass < 2 );
- return aRetValue;
-}
-
-double SvxMSDffCustomShape::ImplGetValue( sal_uInt16 nIndex, sal_uInt32& nGeometryFlags ) const
-{
- if ( !pCalculationData )
- return 0;
- if ( nCalculationData <= nIndex )
- return 0;
-
- double fVal[ 3 ];
- sal_Int16 i, nF = pCalculationData[ nIndex ].nFlags;
- for ( i = 0; i < 3; i++ )
- {
- if ( nF & ( 0x2000 << i ) )
- {
- sal_Int16 nVal = 0;
- switch( i )
- {
- case 0: nVal = pCalculationData[ nIndex ].nVal1; break;
- case 1: nVal = pCalculationData[ nIndex ].nVal2; break;
- case 2: nVal = pCalculationData[ nIndex ].nVal3; break;
- }
- if ( nVal & 0x400 )
- fVal[ i ] = ImplGetValue( nVal & 0xff, nGeometryFlags );
- else
- {
- switch ( nVal )
- {
- case DFF_Prop_adjustValue :
- case DFF_Prop_adjust2Value :
- case DFF_Prop_adjust3Value :
- case DFF_Prop_adjust4Value :
- case DFF_Prop_adjust5Value :
- case DFF_Prop_adjust6Value :
- case DFF_Prop_adjust7Value :
- case DFF_Prop_adjust8Value :
- case DFF_Prop_adjust9Value :
- case DFF_Prop_adjust10Value :
- fVal[ i ] = GetAdjustValue( nVal - DFF_Prop_adjustValue );
- break;
- case DFF_Prop_geoLeft :
- {
- nGeometryFlags |= GEOMETRY_USED_LEFT;
- fVal[ i ] = 0.0;
- }
- break;
- case DFF_Prop_geoTop :
- {
- nGeometryFlags |= GEOMETRY_USED_TOP;
- fVal[ i ] = 0.0;
- }
- break;
- case DFF_Prop_geoRight :
- {
- nGeometryFlags |= GEOMETRY_USED_RIGHT;
- fVal[ i ] = nCoordWidth;
- }
- break;
- case DFF_Prop_geoBottom :
- {
- nGeometryFlags |= GEOMETRY_USED_BOTTOM;
- fVal[ i ] = nCoordWidth;
- }
- break;
- default:
- fVal[ i ] = 0.0;
- break;
- }
- }
- }
- else
- {
- switch( i )
- {
- case 0 : fVal[ 0 ] = pCalculationData[ nIndex ].nVal1; break;
- case 1 : fVal[ 1 ] = pCalculationData[ nIndex ].nVal2; break;
- case 2 : fVal[ 2 ] = pCalculationData[ nIndex ].nVal3; break;
- }
-
-
- }
- }
-
- switch ( nF & 0xff )
- {
- case 0 : // sum
- {
- fVal[ 0 ] += fVal[ 1 ];
- fVal[ 0 ] -= fVal[ 2 ];
- }
- break;
-
- case 1 : // product
- {
- if ( fVal[ 1 ] != 0.0 )
- fVal[ 0 ] *= fVal[ 1 ];
- if ( fVal[ 2 ] != 0.0 )
- fVal[ 0 ] /= fVal[ 2 ];
- }
- break;
-
- case 2 : // mid
- {
- fVal[ 0 ] += fVal[ 1 ];
- fVal[ 0 ] /= 2.0;
- }
- break;
-
- case 3 : // abs
- {
- fVal[ 0 ] = fabs( fVal[ 0 ] );
- }
- break;
-
- case 4 : // min
- {
- if ( fVal[ 1 ] < fVal[ 0 ] )
- fVal[ 0 ] = fVal[ 1 ];
- }
- break;
-
- case 5 :
- {
- if ( fVal[ 1 ] > fVal[ 0 ] ) // max
- fVal[ 0 ] = fVal[ 1 ];
- }
- break;
-
- case 6 : // if > 0 ? a : b
- {
- if ( fVal[ 0 ] > 0.0 )
- fVal[ 0 ] = fVal[ 1 ];
- else
- fVal[ 0 ] = fVal[ 2 ];
- }
- break;
-
- case 7 : // mod
- {
- fVal[ 0 ] = sqrt( fVal[ 0 ] * fVal[ 0 ] + fVal[ 1 ] * fVal[ 1 ]
- + fVal[ 2 ] * fVal[ 2 ] );
- }
- break;
-
- case 8 : // atan2
- {
- fVal[ 0 ] = atan2( fVal[ 1 ], fVal[ 0 ] ) / F_PI180;
- fVal[ 0 ] *= 65536.0;
- }
- break;
-
- case 9 : // in this special case the second parameter is a fixed fload
- { // which has to be divided by 0x10000
- fVal[ 0 ] *= sin( ( fVal[ 1 ] / 65536 ) * F_PI180 );
- }
- break;
-
- case 0xa : // in this special case the second parameter is a fixed fload
- { // which has to be divided by 0x10000
- fVal[ 0 ] *= cos( ( fVal[ 1 ] / 65536 ) * F_PI180 );
- }
- break;
-
- case 0xb : // cosatan2
- {
- fVal[ 0 ] *= cos( atan2( fVal[ 2 ], fVal[ 1 ] ) );
- }
- break;
-
- case 0xc : // sinatan2
- {
- fVal[ 0 ] *= sin( atan2( fVal[ 2 ], fVal[ 1 ] ) );
- }
- break;
-
- case 0xd : // sqrt
- {
- fVal[ 0 ] = sqrt( fVal[ 0 ] );
- }
- break;
-
- case 0xe : // sumangle
- {
- fVal[ 0 ] += fVal[ 1 ] * 65536.0;
- fVal[ 0 ] -= fVal[ 2 ] * 65536.0;
- }
- break;
-
- case 0xf : // ellipse
- {
- if ( fVal[ 1 ] != 0.0 )
- {
- fVal[ 0 ] /= fVal[ 1 ];
- fVal[ 0 ] = fVal[ 2 ] * sqrt( 1 - fVal[ 0 ] * fVal[ 0 ] );
- }
- }
- break;
-
- case 0x10 : // tan
- {
- fVal[ 0 ] *= tan( fVal[ 1 ] );
- }
- break;
-
- case 0x80 :
- {
- // fVal[0]^2 + fVal[1]^2 = fVal[2]^2
- if ( fVal[ 2 ] == 0.0 )
- fVal[ 0 ] = sqrt( fVal[ 0 ] * fVal[ 0 ] + fVal[ 1 ] * fVal[ 1 ] );
- else
- {
- double fA = fVal[ 0 ] != 0.0 ? fVal[ 0 ] : fVal[ 1 ];
- fVal[ 0 ] = sqrt( fVal[ 2 ] * fVal[ 2 ] - fA * fA );
- }
- }
- break;
- case 0x81 :
- {
- double fAngle = F_PI1800 * fVal[ 2 ];
- fVal[ 0 ] = ( cos( fAngle ) * ( fVal[ 0 ] - 10800 )
- + sin( fAngle ) * ( fVal[ 1 ] - 10800 ) ) + 10800;
- }
- break;
- case 0x82 :
- {
- double fAngle = F_PI1800 * fVal[ 2 ];
- fVal[ 0 ] = - ( sin( fAngle ) * ( fVal[ 0 ] - 10800 )
- - cos( fAngle ) * ( fVal[ 1 ] - 10800 ) ) + 10800;
- }
- break;
- default :
- {
-// sal_Bool bStop = sal_True;
- }
- break;
- }
- return fVal[ 0 ];
-}
-
-// nLumDat 28-31 = number of luminance entries in nLumDat
-// nLumDat 27-24 = nLumDatEntry 0
-// nLumDat 23-20 = nLumDatEntry 1 ...
-// each 4bit entry is to be interpreted as a 10 percent signed luminance changing
-Color SvxMSDffCustomShape::ImplGetColorData( const Color& rFillColor, sal_uInt32 nIndex )
-{
- Color aRetColor;
-
- sal_uInt32 i, nColor, nTmp, nCount = nColorData >> 28;
-
- if ( nCount )
- {
- if ( nIndex >= nCount )
- nIndex = nCount - 1;
-
- sal_uInt32 nFillColor = (sal_uInt32)rFillColor.GetRed() |
- ((sal_uInt32)rFillColor.GetGreen() << 8 ) |
- ((sal_uInt32)rFillColor.GetBlue() << 16 );
-
- sal_Int32 nLumDat = nColorData << ( ( 1 + nIndex ) << 2 );
- sal_Int32 nLuminance = ( nLumDat >> 28 ) * 12;
-
- nTmp = nFillColor;
- nColor = 0;
- for ( i = 0; i < 3; i++ )
- {
- sal_Int32 nC = (sal_uInt8)nTmp;
- nTmp >>= 8;
- nC += ( ( nLuminance * nC ) >> 8 );
- if ( nC < 0 )
- nC = 0;
- else if ( nC &~ 0xff )
- nC = 0xff;
- nColor >>= 8;
- nColor |= nC << 16;
- }
- aRetColor = Color( (sal_uInt8)nColor, (sal_uInt8)( nColor >> 8 ), (sal_uInt8)( nColor >> 16 ) );
- }
- return aRetColor;
-}
-
-sal_Bool SvxMSDffCustomShape::IsEmpty() const
-{
- return bIsEmpty;
-}
-
-Rectangle SvxMSDffCustomShape::GetTextRect() const
-{
- if ( !nTextRectData )
- return aSnapRect;
-
- sal_uInt32 nIndex = 0;
- if ( bTextFlow && ( nTextRectData > 1 ) )
- nIndex++;
-
- Point aTopLeft( GetPoint( pTextRectData[ nIndex ].nPairA, sal_True ) );
- Point aBottomRight( GetPoint( pTextRectData[ nIndex ].nPairB, sal_True ) );
- Rectangle aRect( aTopLeft, aBottomRight );
- aRect.Move( aSnapRect.Left(), aSnapRect.Top() );
- if ( bFlipH )
- {
- sal_Int32 nXDist = aSnapRect.Right() - aRect.Right();
- aRect = Rectangle( Point( nXDist + aSnapRect.Left(), aRect.Top() ), aRect.GetSize() );
- }
- if ( bFlipV )
- {
- sal_Int32 nYDist = aSnapRect.Bottom() - aRect.Bottom();
- aRect = Rectangle( Point( aRect.Left(), nYDist + aSnapRect.Top() ), aRect.GetSize() );
- }
- return aRect;
-}
-
-sal_Bool SvxMSDffCustomShape::HasGluePointList( const MSO_SPT eShapeType )
-{
- const mso_CustomShape* pCustomShape = GetCustomShapeContent2( eShapeType );
- return pCustomShape && pCustomShape->nGluePoints;
-}
-
-MSO_SPT SvxMSDffCustomShape::GetShapeTypeFromSdrObject( const SdrObject* pObj )
-{
- MSO_SPT eShapeType = mso_sptNil;
- const SfxPoolItem* pAdjustItem = NULL;
- const SfxItemSet& rItemSet = pObj->GetMergedItemSet();
- rItemSet.GetItemState( SDRATTR_CUSTOMSHAPE_ADJUSTMENT, FALSE, &pAdjustItem );
- if ( pAdjustItem )
- {
- SdrCustomShapeAdjustmentItem& rAdjustItem = *(SdrCustomShapeAdjustmentItem*)pAdjustItem;
- sal_uInt32 nCount = rAdjustItem.GetCount();
- if ( nCount >= 3 )
- {
- /* checking magic number, so we can get sure that the SdrObject was a customshape
- and we can get the customshape type */
- if ( rAdjustItem.GetValue( nCount - 1 ).GetValue() == (sal_Int32)0x80001234 )
- eShapeType = (MSO_SPT)((sal_uInt32)(rAdjustItem.GetValue( nCount - 2 ).GetValue()) >> 16);
- }
- }
- return eShapeType;
-}
-
-void SvxMSDffCustomShape::SwapStartAndEndArrow( SdrObject* pObj ) //#108274
-{
- XLineStartItem aLineStart;
- const SfxItemSet& rObjItemSet = pObj->GetMergedItemSet();
-
- aLineStart.SetLineStartValue(((XLineStartItem&)rObjItemSet.Get( XATTR_LINEEND )).GetLineStartValue());
- XLineStartWidthItem aLineStartWidth(((XLineStartWidthItem&)rObjItemSet.Get( XATTR_LINEENDWIDTH )).GetValue());
- XLineStartCenterItem aLineStartCenter(((XLineStartCenterItem&)rObjItemSet.Get( XATTR_LINEENDCENTER )).GetValue());
-
- XLineEndItem aLineEnd;
- aLineEnd.SetLineEndValue(((XLineEndItem&)rObjItemSet.Get( XATTR_LINESTART )).GetLineEndValue());
- XLineEndWidthItem aLineEndWidth(((XLineEndWidthItem&)rObjItemSet.Get( XATTR_LINESTARTWIDTH )).GetValue());
- XLineEndCenterItem aLineEndCenter(((XLineEndCenterItem&)rObjItemSet.Get( XATTR_LINESTARTCENTER )).GetValue());
-
- SfxItemSet aNew(*rObjItemSet.GetPool());
-
- aNew.Put( aLineStart );
- aNew.Put( aLineStartWidth );
- aNew.Put( aLineStartCenter );
- aNew.Put( aLineEnd );
- aNew.Put( aLineEndWidth );
- aNew.Put( aLineEndCenter );
-
- pObj->SetMergedItemSet(aNew);
-}
-
-SdrObject* SvxMSDffCustomShape::GetObject( SdrModel* pSdrModel, SfxItemSet& rSet, sal_Bool bSetCustomShapeAdjustItem )
-{
- SdrObject* pRet = NULL;
-
- if ( !IsEmpty() )
- {
- if ( eSpType == mso_sptRectangle )
- {
- pRet = new SdrRectObj( aSnapRect );
- pRet->SetModel( pSdrModel );
- pRet->SetMergedItemSet(rSet);
- }
- else if ( eSpType == mso_sptRoundRectangle )
- {
- sal_Int32 nW = aSnapRect.Right() - aSnapRect.Left();
- sal_Int32 nH = aSnapRect.Bottom() - aSnapRect.Top();
- if ( nH < nW )
- nW = nH;
- double fAdjust = (double)GetAdjustValue( 0, 3600 ) / 21600.0;
- nW = (sal_Int32)( (double)nW * fAdjust );
- rSet.Put( SdrEckenradiusItem( nW ) );
- pRet = new SdrRectObj( aSnapRect );
- pRet->SetModel( pSdrModel );
- pRet->SetMergedItemSet(rSet);
- }
- else if ( eSpType == mso_sptEllipse )
- {
- pRet = new SdrCircObj( OBJ_CIRC, aSnapRect );
- pRet->SetModel( pSdrModel );
- pRet->SetMergedItemSet(rSet);
- }
- else if ( eSpType == mso_sptArc )
- { // the arc is something special, because sometimes the snaprect does not match
- Rectangle aPolyBoundRect;
- if ( nNumElemVert )
- {
- XPolygon aXP( (sal_uInt16)nNumElemVert );
- const SvxMSDffVertPair* pTmp = pVertData;
- sal_uInt32 nPtNum;
- for ( nPtNum = 0; nPtNum < nNumElemVert; nPtNum++ )
- aXP[ (sal_uInt16)nPtNum ] = GetPoint( *pTmp++, sal_False );
- aPolyBoundRect = Rectangle( aXP.GetBoundRect() );
- }
- else
- aPolyBoundRect = aSnapRect;
-
- sal_Int32 nEndAngle = Fix16ToAngle( GetAdjustValue( 0 ) );
- sal_Int32 nStartAngle = Fix16ToAngle( GetAdjustValue( 1 ) );
-
- if ( nStartAngle == nEndAngle )
- return NULL;
-
- if ( bFilled ) // ( filled ) ? we have to import an pie : we have to construct an arc
- {
- pRet = new SdrCircObj( OBJ_SECT, aPolyBoundRect, nStartAngle, nEndAngle );
- pRet->NbcSetSnapRect( aSnapRect );
- pRet->SetModel( pSdrModel );
- pRet->SetMergedItemSet(rSet);
- }
- else
- {
- Point aStart, aEnd, aCenter( aPolyBoundRect.Center() );
- aStart.X() = (sal_Int32)( ( cos( ( (double)nStartAngle * F_PI18000 ) ) * 1000.0 ) );
- aStart.Y() = - (sal_Int32)( ( sin( ( (double)nStartAngle * F_PI18000 ) ) * 1000.0 ) );
- aEnd.X() = (sal_Int32)( ( cos( ( (double)nEndAngle * F_PI18000 ) ) * 1000.0 ) );
- aEnd.Y() = - (sal_Int32)( ( sin( ( (double)nEndAngle * F_PI18000 ) ) * 1000.0 ) );
- aStart.X() += aCenter.X();
- aStart.Y() += aCenter.Y();
- aEnd.X() += aCenter.X();
- aEnd.Y() += aCenter.Y();
-
- Polygon aPolygon( aPolyBoundRect, aStart, aEnd, POLY_PIE );
- Rectangle aPolyPieRect( aPolygon.GetBoundRect() );
-
- USHORT nPt = aPolygon.GetSize();
-
- if ( nPt < 4 )
- return NULL;
-
- aPolygon[ 0 ] = aPolygon[ 1 ]; // try to get the arc boundrect
- aPolygon[ nPt - 1 ] = aPolygon[ nPt - 2 ];
- Rectangle aPolyArcRect( aPolygon.GetBoundRect() );
-
- double fYSc, fXSc;
- double fYOfs, fXOfs;
- int nCond;
-
- fYOfs = fXOfs = 0.0;
- if ( aPolyPieRect.GetWidth() != aPolyArcRect.GetWidth() )
- {
- nCond = ( (sal_uInt32)( nStartAngle - 9000 ) > 18000 ) && ( (sal_uInt32)( nEndAngle - 9000 ) > 18000 ) ? 1 : 0;
- nCond ^= bFlipH ? 1 : 0;
- if ( nCond )
- {
- fXSc = (double)aSnapRect.GetWidth() / (double)aPolyPieRect.GetWidth();
- fXOfs = ( (double)aPolyPieRect.GetWidth() - (double)aPolyArcRect.GetWidth() ) * fXSc;
- }
- }
- if ( aPolyPieRect.GetHeight() != aPolyArcRect.GetHeight() )
- {
- nCond = ( ( nStartAngle > 18000 ) && ( nEndAngle > 18000 ) ) ? 1 : 0;
- nCond ^= bFlipV ? 1 : 0;
- if ( nCond )
- {
- fYSc = (double)aSnapRect.GetHeight() / (double)aPolyPieRect.GetHeight();
- fYOfs = ( (double)aPolyPieRect.GetHeight() - (double)aPolyArcRect.GetHeight() ) * fYSc;
- }
- }
- fXSc = (double)aPolyArcRect.GetWidth() / (double)aPolyPieRect.GetWidth();
- fYSc = (double)aPolyArcRect.GetHeight() / (double)aPolyPieRect.GetHeight();
-
- aPolyArcRect = Rectangle( Point( aSnapRect.Left() + (sal_Int32)fXOfs, aSnapRect.Top() + (sal_Int32)fYOfs ),
- Size( (sal_Int32)( aSnapRect.GetWidth() * fXSc ), (sal_Int32)( aSnapRect.GetHeight() * fYSc ) ) );
-
- SdrCircObj* pObjCirc = new SdrCircObj( OBJ_CARC, aPolyBoundRect, nStartAngle, nEndAngle );
- pObjCirc->SetSnapRect( aPolyArcRect );
- pObjCirc->SetModel( pSdrModel );
- pObjCirc->SetMergedItemSet( rSet );
-
- int nSwap = bFlipH ? 1 : 0;
- nSwap ^= bFlipV ? 1 : 0;
- if ( nSwap )
- SwapStartAndEndArrow( pObjCirc );
-
- SdrRectObj* pRect = new SdrRectObj( aPolyArcRect );
- pRect->SetSnapRect( aPolyArcRect );
- pRect->SetModel( pSdrModel );
- pRect->SetMergedItemSet( rSet );
- pRect->SetMergedItem( XLineStyleItem( XLINE_NONE ) );
- pRect->SetMergedItem( XFillStyleItem( XFILL_NONE ) );
-
- pRet = new SdrObjGroup();
- pRet->SetModel( pSdrModel );
- ((SdrObjGroup*)pRet)->GetSubList()->NbcInsertObject( pRect );
- ((SdrObjGroup*)pRet)->GetSubList()->NbcInsertObject( pObjCirc );
- }
- }
- if ( !pRet && nNumElemVert )
- {
- // Header auswerten
- XPolygon aXP( (sal_uInt16)nNumElemVert );
- const SvxMSDffVertPair* pT = pVertData;
- sal_uInt32 nPtNum;
- for ( nPtNum = 0; nPtNum < nNumElemVert; nPtNum++ )
- aXP[ (sal_uInt16)nPtNum ] = GetPoint( *pT++, sal_True );
- Rectangle aPolyBoundRect( aXP.GetBoundRect() );
-
- if ( !pSegData )
- {
- FASTBOOL bClosed = aXP[ 0 ] == aXP[ (sal_uInt16)( aXP.GetPointCount() - 1 ) ];
- Rectangle aUnion( aXP.GetBoundRect() );
- pRet = new SdrPathObj( bClosed ? OBJ_POLY : OBJ_PLIN, basegfx::B2DPolyPolygon(aXP.getB2DPolygon()));
- pRet->NbcSetSnapRect( Rectangle( Point( aSnapRect.Left() + aUnion.Left(),
- aSnapRect.Top() + aUnion.Top() ),
- aUnion.GetSize() ) );
- pRet->SetModel( pSdrModel );
- pRet->SetMergedItemSet(rSet);
- }
- else
- {
- SdrObjGroup* pGrp = NULL;
- SdrObject* pSdrPathObj = NULL;
-
- XPolyPolygon aPolyPoly;
- XPolygon aPoly;
-
- XPolyPolygon aEmptyPolyPoly;
- XPolygon aEmptyPoly;
-
- BOOL bClosed = FALSE;
- sal_uInt16 nPolyFlags;
-
- Color aFillColor( COL_WHITE );
- sal_uInt32 nColorCount = nColorData >> 28;
- sal_uInt32 nColorIndex = 0;
- sal_uInt16 nSrcPt = 0;
-
- Rectangle aUnion;
-
- const sal_uInt16* pS = pSegData;
-
- if ( nColorCount )
- {
- const SfxPoolItem* pPoolItem = NULL;
- SfxItemState eState = rSet.GetItemState( XATTR_FILLCOLOR, FALSE, &pPoolItem );
- if( SFX_ITEM_SET == eState )
- {
- if ( pPoolItem )
- aFillColor = ((XFillColorItem*)pPoolItem)->GetColorValue();
- }
- }
- for ( sal_uInt16 i = 0; i < nNumElemSeg; i++ )
- {
- nPolyFlags = *pS++;
- switch ( nPolyFlags >> 12 )
- {
- case 0x4 :
- {
- if ( aPoly.GetPointCount() > 1 )
- {
- if ( bClosed )
- aPoly[ aPoly.GetPointCount() ] = aPoly[ 0 ];
- aPolyPoly.Insert( aPoly );
- }
- bClosed = FALSE;
- aPoly = aEmptyPoly;
- aPoly[ 0 ] = aXP[ nSrcPt++ ];
- }
- break;
- case 0x8 :
- {
- if ( aPoly.GetPointCount() > 1 )
- {
- if ( bClosed )
- aPoly[ aPoly.GetPointCount() ] = aPoly[ 0 ];
- aPolyPoly.Insert( aPoly );
- }
- aPoly = aEmptyPoly;
- if ( aPolyPoly.Count() )
- {
- if ( pSdrPathObj )
- {
- pGrp = new SdrObjGroup();
- pGrp->SetModel( pSdrModel );
- pGrp->NbcSetLogicRect( aSnapRect );
- pGrp->GetSubList()->NbcInsertObject( pSdrPathObj );
- }
- aUnion.Union( aPolyPoly.GetBoundRect() );
- pSdrPathObj = new SdrPathObj( bClosed ? OBJ_POLY : OBJ_PLIN, aPolyPoly.getB2DPolyPolygon() );
- pSdrPathObj->SetModel( pSdrModel );
- if ( !bClosed )
- rSet.Put( SdrShadowItem( FALSE ) );
- else
- {
- if ( nColorIndex < nColorCount )
- {
- Color aColor( ImplGetColorData( aFillColor, nColorIndex++ ) );
- rSet.Put( XFillColorItem( String(), aColor ) );
- }
- }
- pSdrPathObj->SetMergedItemSet(rSet);
- if ( pGrp )
- {
- if ( pSdrPathObj )
- {
- pGrp->GetSubList()->NbcInsertObject( pSdrPathObj );
- pSdrPathObj = NULL;
- }
- }
- aPolyPoly = aEmptyPolyPoly;
- }
- }
- break;
- case 0x6 :
- {
- bClosed = TRUE;
- }
- break;
- case 0x2 :
- {
- sal_uInt16 nDstPt = aPoly.GetPointCount();
- for ( sal_uInt16 k = 0; k < ( nPolyFlags & 0xfff ); k++ )
- {
- aPoly[ nDstPt ] = aXP[ nSrcPt++ ];
- aPoly.SetFlags( nDstPt++, XPOLY_CONTROL );
- aPoly[ nDstPt ] = aXP[ nSrcPt++ ];
- aPoly.SetFlags( nDstPt++, XPOLY_CONTROL );
- aPoly[ nDstPt++ ] = aXP[ nSrcPt++ ];
- }
- }
- break;
- case 0xa :
- case 0xb :
- {
- sal_uInt16 nPntCount = (BYTE)nPolyFlags;
- if ( nPntCount )
- {
- sal_uInt32 nMod = ( nPolyFlags >> 8 ) & 0xf;
- switch ( nMod )
- {
- case 3 :
- case 4 :
- case 5 :
- {
- sal_uInt16 nDstPt = aPoly.GetPointCount();
- if ( nPntCount == 2 )
- { // create a circle
- Rectangle aRect( aXP[ nSrcPt ], aXP[ nSrcPt + 1 ] );
- sal_Int32 nXControl = (sal_Int32)((double)aRect.GetWidth() * 0.2835 );
- sal_Int32 nYControl = (sal_Int32)((double)aRect.GetHeight() * 0.2835 );
- Point aCenter( aRect.Center() );
- aPoly[ nDstPt++ ] = Point( aCenter.X(), aRect.Top() );
- aPoly[ nDstPt ] = Point( aCenter.X() + nXControl, aRect.Top() );
- aPoly.SetFlags( nDstPt++, XPOLY_CONTROL );
- aPoly[ nDstPt ] = Point( aRect.Right(), aCenter.Y() - nYControl );
- aPoly.SetFlags( nDstPt++, XPOLY_CONTROL );
- aPoly[ nDstPt++ ] = Point( aRect.Right(), aCenter.Y() );
- aPoly[ nDstPt ] = Point( aRect.Right(), aCenter.Y() + nYControl );
- aPoly.SetFlags( nDstPt++, XPOLY_CONTROL );
- aPoly[ nDstPt ] = Point( aCenter.X() + nXControl, aRect.Bottom() );
- aPoly.SetFlags( nDstPt++, XPOLY_CONTROL );
- aPoly[ nDstPt++ ] = Point( aCenter.X(), aRect.Bottom() );
- aPoly[ nDstPt ] = Point( aCenter.X() - nXControl, aRect.Bottom() );
- aPoly.SetFlags( nDstPt++, XPOLY_CONTROL );
- aPoly[ nDstPt ] = Point( aRect.Left(), aCenter.Y() + nYControl );
- aPoly.SetFlags( nDstPt++, XPOLY_CONTROL );
- aPoly[ nDstPt++ ] = Point( aRect.Left(), aCenter.Y() );
- aPoly[ nDstPt ] = Point( aRect.Left(), aCenter.Y() - nYControl );
- aPoly.SetFlags( nDstPt++, XPOLY_CONTROL );
- aPoly[ nDstPt ] = Point( aCenter.X() - nXControl, aRect.Top() );
- aPoly.SetFlags( nDstPt++, XPOLY_CONTROL );
- aPoly[ nDstPt++ ] = Point( aCenter.X(), aRect.Top() );
- nSrcPt += 2;
- }
- else
- {
- sal_uInt32 nXor = ( nMod == 5 ) ? 3 : 2;
- for ( sal_uInt16 k = 0; k < ( nPntCount >> 2 ); k++ )
- {
- PolyStyle ePolyStyle = POLY_ARC;
- Rectangle aRect( aXP[ nSrcPt ], aXP[ nSrcPt + 1 ] );
- Point aCenter( aRect.Center() );
- Point aStart( aXP[ (sal_uInt16)( nSrcPt + nXor ) ] );
- Point aEnd( aXP[ (sal_uInt16)( nSrcPt + ( nXor ^ 1 ) ) ] );
- aStart.X() = (sal_Int32)( ( (double)( aStart.X() - aCenter.X() ) / fXScale ) ) + aCenter.X();
- aStart.Y() = (sal_Int32)( ( (double)( aStart.Y() - aCenter.Y() ) / fYScale ) ) + aCenter.Y();
- aEnd.X() = (sal_Int32)( ( (double)( aEnd.X() - aCenter.X() ) / fXScale ) ) + aCenter.X();
- aEnd.Y() = (sal_Int32)( ( (double)( aEnd.Y() - aCenter.Y() ) / fYScale ) ) + aCenter.Y();
-
- Polygon aTempPoly( aRect, aStart, aEnd, ePolyStyle );
- if ( nMod == 5 )
- {
- for ( sal_uInt16 j = aTempPoly.GetSize(); j--; )
- aPoly[ nDstPt++ ] = aTempPoly[ j ];
- }
- else
- {
- for ( sal_uInt16 j = 0; j < aTempPoly.GetSize(); j++ )
- aPoly[ nDstPt++ ] = aTempPoly[ j ];
- }
- nSrcPt += 4;
- }
- }
- }
- break;
- case 0 :
- case 1 :
- case 2 :
- case 6 :
- case 9 :
- case 0xa :
- case 0xb :
- case 0xc :
- case 0xd :
- case 0xe :
- case 0xf :
-
- case 7 :
- case 8 :
- {
- BOOL bFirstDirection = TRUE;
- sal_uInt16 nDstPt = aPoly.GetPointCount();
- for ( sal_uInt16 k = 0; k < ( nPolyFlags & 0xff ); k++ )
- {
- sal_uInt32 nModT = ( nMod == 7 ) ? 1 : 0;
- Point aCurrent( aXP[ nSrcPt ] );
- if ( nSrcPt ) // we need a previous point
- {
- Point aPrev( aXP[ nSrcPt - 1 ] );
- sal_Int32 nX, nY;
- nX = aCurrent.X() - aPrev.X();
- nY = aCurrent.Y() - aPrev.Y();
- if ( ( nY ^ nX ) & 0x80000000 )
- {
- if ( !k )
- bFirstDirection = TRUE;
- else if ( !bFirstDirection )
- nModT ^= 1;
- }
- else
- {
- if ( !k )
- bFirstDirection = FALSE;
- else if ( bFirstDirection )
- nModT ^= 1;
- }
- if ( nModT ) // get the right corner
- {
- nX = aCurrent.X();
- nY = aPrev.Y();
- }
- else
- {
- nX = aPrev.X();
- nY = aCurrent.Y();
- }
- sal_Int32 nXVec = ( nX - aPrev.X() ) >> 1;
- sal_Int32 nYVec = ( nY - aPrev.Y() ) >> 1;
- Point aControl1( aPrev.X() + nXVec, aPrev.Y() + nYVec );
- aPoly[ nDstPt ] = aControl1;
- aPoly.SetFlags( nDstPt++, XPOLY_CONTROL );
- nXVec = ( nX - aCurrent.X() ) >> 1;
- nYVec = ( nY - aCurrent.Y() ) >> 1;
- Point aControl2( aCurrent.X() + nXVec, aCurrent.Y() + nYVec );
- aPoly[ nDstPt ] = aControl2;
- aPoly.SetFlags( nDstPt++, XPOLY_CONTROL );
- }
- aPoly[ nDstPt ] = aCurrent;
- nSrcPt++;
- nDstPt++;
- }
- }
- break;
- }
- }
- }
- break;
- case 0x0 :
- {
- sal_uInt16 nDstPt = aPoly.GetPointCount();
- for ( sal_uInt16 k = 0; k < ( nPolyFlags & 0xfff ); k++ )
- aPoly[ nDstPt++ ] = aXP[ nSrcPt++ ];
- }
- break;
- case 0xf :
- {
- sal_Bool bOwn = TRUE;
- switch ( nPolyFlags )
- {
- case 0xf8ff : // This value is not ms specific and is used
- { // to create a dummy object that is not visible.
- SdrObject* pLast = pSdrPathObj; // This solves the problem of customshapes that
- if ( !pLast ) // did not use the whole space of the boundrect.
- { // eg. the BlockArc
- if ( pGrp )
- {
- SdrObjList* pList = pGrp->GetSubList();
- if ( pList && pList->GetObjCount() )
- pLast = pList->GetObj( pList->GetObjCount() - 1 );
- }
- }
- if ( pLast )
- {
- pLast->SetMergedItem( XLineStyleItem( XLINE_NONE ) );
- pLast->SetMergedItem( XFillStyleItem( XFILL_NONE ) );
- }
- }
- break;
- case 0xf8fe : // nearly the same as 0x4000
- { // but the first point is ignored
- if ( aPoly.GetPointCount() > 1 )
- {
- if ( bClosed )
- aPoly[ aPoly.GetPointCount() ] = aPoly[ 0 ];
- aPolyPoly.Insert( aPoly );
- }
- aPoly = aEmptyPoly;
- }
- break;
- default :
- bOwn = FALSE;
- }
- if ( bOwn )
- break;
- }
-#ifdef DBG_CUSTOMSHAPE
- default :
- {
- ByteString aString( "customshapes::unknown PolyFlagValue :" );
- aString.Append( ByteString::CreateFromInt32( nPolyFlags ) );
- DBG_ERROR( aString.GetBuffer() );
- }
- break;
-#endif
- }
- }
- if ( pGrp )
- pRet = pGrp;
- else
- pRet = pSdrPathObj;
- if ( pRet )
- {
- pRet->NbcSetSnapRect( Rectangle( Point( aSnapRect.Left() + aUnion.Left(),
- aSnapRect.Top() + aUnion.Top() ),
- aUnion.GetSize() ) );
- }
- }
- }
- }
- if ( pRet )
- {
- // some objects needs to have their own GluePoint list
- if ( HasGluePointList( eSpType ) )
- {
- sal_uInt32 i;
- const SvxMSDffVertPair* pTmp = pGluePoints;
- for ( i = 0; i < nGluePoints; i++ )
- {
- SdrGluePoint aGluePoint;
- Rectangle aNewSnapRect( pRet->GetSnapRect() );
- sal_Int32 nXMove = aSnapRect.Left() - aNewSnapRect.Left();
- sal_Int32 nYMove = aSnapRect.Top() - aNewSnapRect.Top();
-
- const Point& rPoint = GetPoint( *pTmp++, sal_True );
- double fXRel = rPoint.X() + nXMove;
- double fYRel = rPoint.Y() + nYMove;
- fXRel = fXRel / aNewSnapRect.GetWidth() * 10000;
- fYRel = fYRel / aNewSnapRect.GetHeight() * 10000;
- aGluePoint.SetPos( Point( (sal_Int32)fXRel, (sal_Int32)fYRel ) );
- aGluePoint.SetPercent( sal_True );
- aGluePoint.SetAlign( SDRVERTALIGN_TOP | SDRHORZALIGN_LEFT );
- aGluePoint.SetEscDir( SDRESC_SMART );
- SdrGluePointList* pList = pRet->ForceGluePointList();
- if( pList )
- /* sal_uInt16 nId = */ pList->Insert( aGluePoint );
- }
- }
- if ( bSetCustomShapeAdjustItem )
- {
- if ( pRet->ISA( SdrObjGroup ) || pRet->ISA( SdrPathObj ) )
- {
- sal_uInt32 i, nCount = 0;
- SdrObject* pFirstObject = pRet;
- SdrObjList* pObjectList = NULL;
- if ( pRet->ISA( SdrPathObj ) )
- nCount = 1;
- else
- {
- pObjectList = ((SdrObjGroup*)pRet)->GetSubList();
- if ( pObjectList )
- nCount = pObjectList->GetObjCount();
- if ( nCount )
- pFirstObject = pObjectList->GetObj( 0 );
- }
- if ( nCount )
- {
- SdrCustomShapeAdjustmentItem aAdjustItem;
- SdrCustomShapeAdjustmentValue aAdjustValue;
- if ( nAdjustmentHandles )
- {
- for ( i = 0; i < nAdjustmentHandles; i++ )
- {
- aAdjustValue.SetValue( pAdjustmentHandles[ i ].GetAdjustValue() );
- aAdjustItem.SetValue( i, aAdjustValue );
- }
- }
- if ( bVertAlloc == FALSE )
- {
- sal_uInt32 nMagicNumber = 0x80001234; // this magic number identifies ms objects
- sal_uInt32 nType = (sal_uInt32)eSpType << 16 // hiword is the shapetype
- | nCount; // loword the number of Path objects
- sal_uInt32 nChecksum = 0; // checksum is used later to be sure that
- // the object is not changed
-
- // here we are calculating the checksum
- Rectangle aTRect( pRet->GetSnapRect() );
- sal_Int32 nLeft = aTRect.Left();
- sal_Int32 nTop = aTRect.Top();
-
- SdrObject* pNext = pFirstObject;
- for ( i = 0; i < nCount; i++ )
- {
- if ( i )
- pNext = pObjectList->GetObj( i );
-
- if ( !pNext->ISA( SdrPathObj ) ) // just only SdrPathObjs are valid as Customshapes
- {
- nChecksum = 0;
- break;
- }
-
- // #i74631# use explicit constructor here. Also XPolyPolygon is not necessary,
- // reducing to PolyPolygon
- const PolyPolygon aPolyPolygon(((SdrPathObj*)pNext)->GetPathPoly());
-
- sal_uInt16 j, k = aPolyPolygon.Count();
- sal_Int32 aVal[ 3 ];
- while( k )
- {
- const Polygon& rPoly = aPolyPolygon[ --k ];
- j = rPoly.GetSize();
- while( j )
- {
- const Point& rPoint = rPoly[ --j ];
-#ifdef OSL_LITENDIAN
- aVal[ 0 ] = SWAPLONG( rPoint.X() - nLeft );
- aVal[ 1 ] = SWAPLONG( rPoint.Y() - nTop );
- aVal[ 2 ] = SWAPLONG( rPoly.GetFlags( j ) );
-#else
- aVal[ 0 ] = rPoint.X() - nLeft;
- aVal[ 1 ] = rPoint.Y() - nTop;
- aVal[ 2 ] = rPoly.GetFlags( j );
-#endif
- nChecksum = rtl_crc32( nChecksum, &aVal[ 0 ], 12 );
- }
- }
- }
-
- if ( nChecksum )
- {
- i = aAdjustItem.GetCount();
- aAdjustValue.SetValue( nChecksum ); // the last 3 entries in the adjustment item must be in this
- aAdjustItem.SetValue( i++, aAdjustValue ); // order, otherwise it will be not possible to recreate the original
- aAdjustValue.SetValue( nType ); // customshape when exporting into ms formats
- aAdjustItem.SetValue( i++, aAdjustValue );
- aAdjustValue.SetValue( nMagicNumber );
- aAdjustItem.SetValue( i++, aAdjustValue );
- }
- }
- SfxItemSet aSet( pSdrModel->GetItemPool() );
- aSet.Put( aAdjustItem );
- pFirstObject->SetMergedItemSet(aSet);
- }
- }
- }
- }
- return pRet;
-}
diff --git a/svx/source/msfilter/msashape.hxx b/svx/source/msfilter/msashape.hxx
deleted file mode 100644
index d8691a4..0000000
--- a/svx/source/msfilter/msashape.hxx
+++ /dev/null
@@ -1,116 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: msashape.hxx,v $
- * $Revision: 1.13 $
- *
- * 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 _MSASHAPE_HXX
-#define _MSASHAPE_HXX
-
-#include <svx/msdffdef.hxx>
-#include <svx/msdffimp.hxx>
-
-#define DFF_CUSTOMSHAPE_FLIP_V 1
-#define DFF_CUSTOMSHAPE_FLIP_H 2
-#define DFF_CUSTOMSHAPE_EXCH 4
-
-class SdrModel;
-class SfxItemSet;
-struct SvxMSDffVertPair;
-struct SvxMSDffCalculationData;
-struct SvxMSDffTextRectangles;
-class SvxMSDffAdjustmentHandle;
-class SvxMSDffCustomShape
-{
- MSFilterTracer* pTracer;
- MSO_SPT eSpType;
-
- sal_Int32 nCoordWidth;
- sal_Int32 nCoordHeight;
- Rectangle aSnapRect;
-
- double fXScale;
- double fYScale;
-
- sal_Int32 nFix16Angle;
- sal_Int32 nXRef;
- sal_Int32 nYRef;
- sal_uInt32 nFlags;
-
- sal_uInt32 nNumElemVert;
- sal_uInt32 nNumElemSeg;
-
- sal_uInt32 nColorData;
-
- SvxMSDffVertPair* pVertData;
- sal_uInt16* pSegData;
-
- sal_uInt32 nTextRectData;
- SvxMSDffTextRectangles* pTextRectData;
- sal_uInt32 nCalculationData;
- SvxMSDffCalculationData* pCalculationData;
- sal_uInt32 nAdjustmentHandles;
- SvxMSDffAdjustmentHandle* pAdjustmentHandles;
- sal_uInt32 nGluePoints;
- SvxMSDffVertPair* pGluePoints;
-
- sal_Bool bIsEmpty : 1;
- sal_Bool bVertAlloc : 1;
- sal_Bool bSegAlloc : 1;
- sal_Bool bCalcAlloc : 1;
- sal_Bool bTextRectAlloc : 1;
-
- sal_Bool bTextFlow : 1;
- sal_Bool bFilled : 1;
- sal_Bool bFlipH : 1;
- sal_Bool bFlipV : 1;
-
- sal_Int32 GetAdjustValue( sal_uInt32 nIndex ) const;
- sal_Int32 GetAdjustValue( sal_uInt32 nIndex, sal_Int32 nDefault ) const;
- sal_Int32 Fix16ToAngle( sal_Int32 nAngle ) const;
- Color ImplGetColorData( const Color& rFillColor, sal_uInt32 nIndex );
- double ImplGetValue( sal_uInt16 nIndex, sal_uInt32& nGeometryFlags ) const;
- Point GetPoint( const SvxMSDffVertPair&, sal_Bool bScale = sal_True ) const;
-
- static void SwapStartAndEndArrow( SdrObject* pObj );
-
- public :
-
- SdrObject* GetObject( SdrModel* pSdrModel, SfxItemSet& rSet, sal_Bool bSetAdjustmentItem );
- sal_Bool IsEmpty() const;
-
- Rectangle GetTextRect() const;
- static sal_Bool HasGluePointList( const MSO_SPT eShapeType );
- static MSO_SPT GetShapeTypeFromSdrObject( const SdrObject* );
-
- SvxMSDffCustomShape( const DffPropertyReader& rPropReader, SvStream&,
- DffObjData& rObjDat, Rectangle& rSnapRect, sal_Int32 nFix16Angle, MSFilterTracer* pTracer );
- ~SvxMSDffCustomShape();
-};
-
-#endif
-
diff --git a/svx/source/msfilter/msashape3d.cxx b/svx/source/msfilter/msashape3d.cxx
deleted file mode 100644
index 092ccad..0000000
--- a/svx/source/msfilter/msashape3d.cxx
+++ /dev/null
@@ -1,564 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: msashape3d.cxx,v $
- * $Revision: 1.13.226.1 $
- *
- * 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): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#include <msashape3d.hxx>
-#include <tools/poly.hxx>
-#include <svditer.hxx>
-#include <svx/svdobj.hxx>
-#include <svtools/poolitem.hxx>
-#include <svtools/itemset.hxx>
-#include <svx/xfillit0.hxx>
-#include <svx/xit.hxx>
-#include <svx/xbtmpit.hxx>
-#include <svx/xflclit.hxx>
-#include <svx/svdopath.hxx>
-#include <svx/svdogrp.hxx>
-#include <svx/svdpage.hxx>
-#include <svx/polysc3d.hxx>
-#include <svx/svddef.hxx>
-#include <svx/svx3ditems.hxx>
-#include <svx/extrud3d.hxx>
-#include <svx/xflbmtit.hxx>
-#include <vcl/svapp.hxx>
-#include <svx/xlnclit.hxx>
-
-#define ITEMVALUE(ItemSet,Id,Cast) ((const Cast&)(ItemSet).Get(Id)).GetValue()
-
-double SvxMSDffCustomShape3D::Fix16ToAngle( sal_Int32 nFixAngle )
-{
- double fAngle = 0.0;
- if ( nFixAngle )
- {
- fAngle = nFixAngle;
- fAngle /= 65536.0;
- }
- return fAngle;
-}
-
-SvxMSDffCustomShape3D::Transformation2D::Transformation2D( const DffPropSet& rPropSet, const Rectangle& rSnapRect ) :
- aCenter( rSnapRect.Center() )
-{
- bParallel = ( rPropSet.GetPropertyValue( DFF_Prop_fc3DFillHarsh, 0 ) & 4 ) != 0;
- if ( bParallel )
- {
- fSkewAngle = Fix16ToAngle( rPropSet.GetPropertyValue( DFF_Prop_c3DSkewAngle, sal::static_int_cast< UINT32 >( -135 * 65536 ) ) ) * F_PI180;
- nSkewAmount = rPropSet.GetPropertyValue( DFF_Prop_c3DSkewAmount, 50 );
- }
- else
- {
- fZScreen = 0.0;
- fViewPointOriginX = ((double)((sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_c3DOriginX, 32768 )) * rSnapRect.GetWidth()) / 65536.0;
- fViewPointOriginY = ((double)((sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_c3DOriginY, (sal_uInt32)-32768 )) * rSnapRect.GetHeight()) / 65536.0;
- fViewPoint.setX((double)((sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_c3DXViewpoint, 1250000 )) / 360); // 360 emu = 0,01 mm
- fViewPoint.setY((double)((sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_c3DYViewpoint, (sal_uInt32)-1250000 )) / 360);
- fViewPoint.setZ((double)((sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_c3DZViewpoint, (sal_uInt32)-9000000 )) / 360);
- }
-}
-
-basegfx::B3DPolygon SvxMSDffCustomShape3D::Transformation2D::ApplySkewSettings( const basegfx::B3DPolygon& rPoly3D )
-{
- basegfx::B3DPolygon aRetval;
- sal_uInt32 j;
-
- for ( j = 0L; j < rPoly3D.count(); j++ )
- {
- const basegfx::B3DPoint aPoint(rPoly3D.getB3DPoint(j));
- const double fDepth(-( aPoint.getZ() * nSkewAmount ) / 100.0);
- const basegfx::B3DPoint aNewPoint(
- aPoint.getX() + (fDepth * cos( fSkewAngle )),
- aPoint.getY() - ( fDepth * sin( fSkewAngle )),
- aPoint.getZ());
- aRetval.append(aNewPoint);
- }
-
- return aRetval;
-}
-
-Point SvxMSDffCustomShape3D::Transformation2D::Transform2D( const basegfx::B3DPoint& rPoint3D )
-{
- Point aPoint2D;
- if ( bParallel )
- {
- aPoint2D.X() = (sal_Int32)rPoint3D.getX();
- aPoint2D.Y() = (sal_Int32)rPoint3D.getY();
- }
- else
- {
- double fX = rPoint3D.getX() - fViewPointOriginX;
- double fY = rPoint3D.getY() - fViewPointOriginY;
- double f = ( fZScreen - fViewPoint.getZ() ) / ( rPoint3D.getZ() - fViewPoint.getZ() );
- aPoint2D.X() = (sal_Int32)(( fX - fViewPoint.getX() ) * f + fViewPoint.getX() + fViewPointOriginX );
- aPoint2D.Y() = (sal_Int32)(( fY - fViewPoint.getY() ) * f + fViewPoint.getY() + fViewPointOriginY );
- }
- aPoint2D.Move( aCenter.X(), aCenter.Y() );
- return aPoint2D;
-}
-
-basegfx::B3DPoint SvxMSDffCustomShape3D::Rotate( const basegfx::B3DPoint& rPoint, const double x, const double y, const double z )
-{
- basegfx::B3DPoint aRetval(rPoint);
- basegfx::B3DPoint aPoint( rPoint );
-
- // rotation z axis
- aRetval.setX(aPoint.getX() * cos( z ) + aPoint.getY() * sin( z ));
- aRetval.setY(-( aPoint.getX() * sin( z ) ) + aPoint.getY() * cos( z ));
-
- // rotation y axis
- aPoint = aRetval;
- aRetval.setX(aPoint.getX() * cos( y ) + aPoint.getZ() * sin( y ));
- aRetval.setZ(-( aPoint.getX() * sin( y ) ) + aPoint.getZ() * cos( y ));
-
- // rotation x axis
- aPoint = aRetval;
- aRetval.setY(aPoint.getY() * cos( x ) + aPoint.getZ() * sin( x ));
- aRetval.setZ(-( aPoint.getY() * sin( x ) ) + aPoint.getZ() * cos( x ));
-
- return aRetval;
-}
-
-//basegfx::B3DPolyPolygon SvxMSDffCustomShape3D::Rotate( const basegfx::B3DPolyPolygon& rPolyPoly3D, const basegfx::B3DPoint& rOrigin, const double x, const double y, const double z )
-//{
-// basegfx::B3DPolyPolygon aRetval;
-// sal_uInt32 i, j;
-//
-// for( i = 0L; i < rPolyPoly3D.count(); i++ )
-// {
-// const basegfx::B3DPolygon aPoly3D(rPolyPoly3D.getB3DPolygon(i));
-// basegfx::B3DPolygon rNewPoly;
-//
-// for( j = 0L; j < aPoly3D.count(); j++ )
-// {
-// basegfx::B3DPoint aPoint(aPoly3D.getB3DPoint(j));
-//
-// aPoint -= rOrigin;
-// aPoint = Rotate( aPoint, x, y, z );
-// aPoint += rOrigin;
-//
-// rNewPoly.append(aPoint);
-// }
-//
-// aRetval.append(rNewPoly);
-// }
-//
-// return aRetval;
-//}
-
-SdrObject* SvxMSDffCustomShape3D::Create3DObject( const SdrObject* pObj, const DffPropSet& rPropSet,
- SfxItemSet& aSet, Rectangle& rSnapRect, sal_uInt32 nSpFlags )
-{
- SdrObject* pRet = NULL;
- std::vector< E3dCompoundObject* > aPlaceholderObjectList;
-
- double fExtrusionBackward = (double)((sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_c3DExtrudeBackward, 457200 )) / 360.0; // in emus
- double fExtrusionForward = (double)((sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_c3DExtrudeForward, 0 )) / 360.0;
- double fDepth = fExtrusionBackward - fExtrusionForward;
- if ( fDepth < 1.0 )
- fDepth = 1.0;
- ProjectionType eProjectionType( rPropSet.GetPropertyValue( DFF_Prop_fc3DFillHarsh, 0 ) & 4 ? PR_PARALLEL : PR_PERSPECTIVE );
-
- // pObj Umwandeln in Szene mit 3D Objekt
- E3dDefaultAttributes a3DDefaultAttr;
- a3DDefaultAttr.SetDefaultLatheCharacterMode( TRUE );
- a3DDefaultAttr.SetDefaultExtrudeCharacterMode( TRUE );
-
- E3dScene* pScene = new E3dPolyScene( a3DDefaultAttr );
-
- sal_Bool bSceneHasObjects ( sal_False );
- sal_Bool bUseTwoFillStyles( sal_False );
-
- MSO_3DRenderMode eRenderMode( (MSO_3DRenderMode)rPropSet.GetPropertyValue( DFF_Prop_c3DRenderMode, mso_FullRender ) );
- XFillStyle eFillStyle( ITEMVALUE( aSet, XATTR_FILLSTYLE, XFillStyleItem ) );
- pScene->SetMergedItem( Svx3DShadeModeItem( 0 ) );
- aSet.Put( Svx3DPercentDiagonalItem( 0 ) );
- aSet.Put( Svx3DTextureModeItem( 1 ) );
- if ( eRenderMode == mso_Wireframe )
- {
- aSet.Put( XLineStyleItem( XLINE_SOLID ) );
- aSet.Put( XFillStyleItem ( XFILL_NONE ) );
- aSet.Put( Svx3DDoubleSidedItem( TRUE ) );
- }
- else
- {
- aSet.Put( XLineStyleItem( XLINE_NONE ) );
- if ( eFillStyle == XFILL_NONE )
- aSet.Put( XFillStyleItem( XFILL_SOLID ) );
- else if ( ( eFillStyle == XFILL_BITMAP ) || ( eFillStyle == XFILL_GRADIENT ) )
- bUseTwoFillStyles = sal_True;
- }
- const SdrObject* pNext = NULL;
- SdrObjListIter* pIter = NULL;
- if ( pObj->IsGroupObject() )
- {
- pIter = new SdrObjListIter( *pObj, IM_DEEPWITHGROUPS );
- if ( pIter->IsMore() )
- pNext = pIter->Next();
- }
- else
- pNext = pObj;
- while ( pNext )
- {
- const SfxItemSet& rNextItemSet = pNext->GetMergedItemSet();
-
- sal_Bool bIsPlaceholderObject = (((XFillStyleItem&)rNextItemSet.Get( XATTR_FILLSTYLE )).GetValue() == XFILL_NONE )
- && (((XLineStyleItem&)rNextItemSet.Get( XATTR_LINESTYLE )).GetValue() == XLINE_NONE );
-
- SdrObject* pNewObj = pNext->ConvertToPolyObj( FALSE, FALSE );
- SdrPathObj* pPath = PTR_CAST( SdrPathObj, pNewObj );
- if( pPath )
- {
- const basegfx::B2DPolyPolygon aPolyPolygon(pPath->GetPathPoly());
- E3dCompoundObject* p3DObj = new E3dExtrudeObj( a3DDefaultAttr, aPolyPolygon, bUseTwoFillStyles ? 1 : fDepth );
- p3DObj->NbcSetLayer( pObj->GetLayer() );
- p3DObj->SetMergedItemSet( aSet );
- if ( bIsPlaceholderObject )
- aPlaceholderObjectList.push_back( p3DObj );
- else if ( bUseTwoFillStyles )
- {
- Bitmap aFillBmp;
- sal_Bool bFillBmpTile = ((XFillBmpTileItem&)p3DObj->GetMergedItem( XATTR_FILLBMP_TILE )).GetValue();
- if ( bFillBmpTile )
- {
- const XFillBitmapItem& rBmpItm = (XFillBitmapItem&)p3DObj->GetMergedItem( XATTR_FILLBITMAP );
- const XOBitmap& rXOBmp = rBmpItm.GetBitmapValue();
- aFillBmp = rXOBmp.GetBitmap();
- Size aLogicalSize = aFillBmp.GetPrefSize();
- if ( aFillBmp.GetPrefMapMode() == MAP_PIXEL )
- aLogicalSize = Application::GetDefaultDevice()->PixelToLogic( aLogicalSize, MAP_100TH_MM );
- else
- aLogicalSize = OutputDevice::LogicToLogic( aLogicalSize, aFillBmp.GetPrefMapMode(), MAP_100TH_MM );
- aLogicalSize.Width() *= 5; ;// :-( nice scaling, look at engine3d/obj3d.cxx
- aLogicalSize.Height() *= 5;
- aFillBmp.SetPrefSize( aLogicalSize );
- aFillBmp.SetPrefMapMode( MAP_100TH_MM );
- p3DObj->SetMergedItem( XFillBitmapItem( String(), aFillBmp ) );
- }
- else
- {
- Rectangle aBoundRect( PolyPolygon(aPolyPolygon).GetBoundRect() );
- if ( rSnapRect != aBoundRect )
- {
- const XFillBitmapItem& rBmpItm = (XFillBitmapItem&)p3DObj->GetMergedItem( XATTR_FILLBITMAP );
- const XOBitmap& rXOBmp = rBmpItm.GetBitmapValue();
- aFillBmp = rXOBmp.GetBitmap();
- Size aBmpSize( aFillBmp.GetSizePixel() );
- double fXScale = (double)aBoundRect.GetWidth() / (double)rSnapRect.GetWidth();
- double fYScale = (double)aBoundRect.GetHeight() / (double)rSnapRect.GetHeight();
-
- Point aPt( (sal_Int32)( (double)( aBoundRect.Left() - rSnapRect.Left() )* (double)aBmpSize.Width() / (double)rSnapRect.GetWidth() ),
- (sal_Int32)( (double)( aBoundRect.Top() - rSnapRect.Top() ) * (double)aBmpSize.Height() / (double)rSnapRect.GetHeight() ) );
- Size aSize( (sal_Int32)( aBmpSize.Width() * fXScale ),
- (sal_Int32)( aBmpSize.Height() * fYScale ) );
- Rectangle aCropRect( aPt, aSize );
- aFillBmp.Crop( aCropRect );
- p3DObj->SetMergedItem( XFillBitmapItem( String(), aFillBmp ) );
- }
- }
- pScene->Insert3DObj( p3DObj );
- p3DObj = new E3dExtrudeObj( a3DDefaultAttr, pPath->GetPathPoly(), fDepth );
- p3DObj->NbcSetLayer( pObj->GetLayer() );
- p3DObj->SetMergedItemSet( aSet );
- p3DObj->SetMergedItem( XFillStyleItem( XFILL_SOLID ) );
- p3DObj->SetMergedItem( Svx3DCloseFrontItem( sal_False ) );
- p3DObj->SetMergedItem( Svx3DCloseBackItem( sal_False ) );
- pScene->Insert3DObj( p3DObj );
- p3DObj = new E3dExtrudeObj( a3DDefaultAttr, pPath->GetPathPoly(), 1 );
- p3DObj->NbcSetLayer( pObj->GetLayer() );
- p3DObj->SetMergedItemSet( aSet );
- basegfx::B3DHomMatrix aFrontTransform( p3DObj->GetTransform() );
- aFrontTransform.translate( 0.0, 0.0, fDepth );
- p3DObj->NbcSetTransform( aFrontTransform );
- if ( ( eFillStyle == XFILL_BITMAP ) && !aFillBmp.IsEmpty() )
- p3DObj->SetMergedItem( XFillBitmapItem( String(), aFillBmp ) );
- }
- else if ( eFillStyle == XFILL_NONE )
- {
- XLineColorItem& rLineColor = (XLineColorItem&)p3DObj->GetMergedItem( XATTR_LINECOLOR );
- p3DObj->SetMergedItem( XFillColorItem( String(), rLineColor.GetColorValue() ) );
- p3DObj->SetMergedItem( Svx3DDoubleSidedItem( sal_True ) );
- p3DObj->SetMergedItem( Svx3DCloseFrontItem( sal_False ) );
- p3DObj->SetMergedItem( Svx3DCloseBackItem( sal_False ) );
- }
- pScene->Insert3DObj( p3DObj );
- bSceneHasObjects = sal_True;
- }
- SdrObject::Free( pNewObj );
- pNext = NULL;
- if ( pIter && pIter->IsMore() )
- pNext = pIter->Next();
- }
- delete pIter;
-
- if ( bSceneHasObjects ) // is the SdrObject properly converted
- {
- // then we can change the return value
- pRet = pScene;
-
- // Kameraeinstellungen, Perspektive ...
- Camera3D& rCamera = (Camera3D&)pScene->GetCamera();
- const basegfx::B3DRange& rVolume = pScene->GetBoundVolume();
- pScene->NbcSetSnapRect( rSnapRect );
-
- // InitScene replacement
- double fW(rVolume.getWidth());
- double fH(rVolume.getHeight());
-
- rCamera.SetAutoAdjustProjection( FALSE );
- rCamera.SetViewWindow( -fW / 2, - fH / 2, fW, fH);
- basegfx::B3DPoint aLookAt( 0.0, 0.0, 0.0 );
- basegfx::B3DPoint aCamPos( 0.0, 0.0, 100.0 );
-
- rCamera.SetDefaults( basegfx::B3DPoint( 0.0, 0.0, 100.0 ), aLookAt, 100.0 );
- rCamera.SetPosAndLookAt( aCamPos, aLookAt );
- rCamera.SetFocalLength( 1.0 );
- rCamera.SetProjection( eProjectionType );
- pScene->SetCamera( rCamera );
- pScene->SetRectsDirty();
-
- double fViewPointOriginX = ((double)((sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_c3DOriginX, 32768 )) * rSnapRect.GetWidth()) / 65536.0;
- double fViewPointOriginY = ((double)((sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_c3DOriginY, (sal_uInt32)-32768 )) * rSnapRect.GetHeight()) / 65536.0;
-
- basegfx::B3DHomMatrix aNewTransform( pScene->GetTransform() );
- Point aCenter( rSnapRect.Center() );
- aNewTransform.translate( -aCenter.X(), aCenter.Y(), -pScene->GetBoundVolume().getDepth() );
- double fXRotate = Fix16ToAngle( rPropSet.GetPropertyValue( DFF_Prop_c3DXRotationAngle, 0 ) );
- double fYRotate = Fix16ToAngle( rPropSet.GetPropertyValue( DFF_Prop_c3DYRotationAngle, 0 ) );
- double fZRotate = Fix16ToAngle( rPropSet.GetPropertyValue( DFF_Prop_Rotation, 0 ) );
- if ( fZRotate != 0.0 )
- {
- aNewTransform.rotate(0.0, 0.0, -fZRotate * F_PI180 );
- }
- if ( nSpFlags & SP_FFLIPH )
- {
- aNewTransform.scale( -1.0, 0.0, 0.0 );
- }
- if ( nSpFlags & SP_FFLIPV )
- {
- aNewTransform.scale(0.0, -1.0, 0.0 );
- }
- if( fYRotate != 0.0 )
- {
- aNewTransform.rotate( 0.0, -fYRotate * F_PI180, 0.0 );
- }
- if( fXRotate != 0.0 )
- {
- aNewTransform.rotate( -fXRotate * F_PI180, 0.0, 0.0 );
- }
- if ( eProjectionType == PR_PARALLEL )
- {
- sal_Int32 nSkewAmount = rPropSet.GetPropertyValue( DFF_Prop_c3DSkewAmount, 50 );
- if ( nSkewAmount )
- {
- sal_Int32 nSkewAngle = ((sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_c3DSkewAngle, sal::static_int_cast< UINT32 >( -135 * 65536 ) ) ) >> 16;
-
- double fAlpha( (double)nSkewAngle * F_PI180 );
- double fInvTanBeta( (double)nSkewAmount / 100.0 );
- if(fInvTanBeta)
- {
- aNewTransform.shearXY(
- fInvTanBeta * cos(fAlpha),
- fInvTanBeta * sin(fAlpha));
- }
- }
- }
- else
- {
- aNewTransform.translate( -fViewPointOriginX, fViewPointOriginY, 0.0 );
- // now set correct camera position
-// double fViewPointOriginX = ((double)((sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_c3DOriginX, 32768 )) * rSnapRect.GetWidth()) / 65536.0;
-// double fViewPointOriginY = ((double)((sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_c3DOriginY, (sal_uInt32)-32768 )) * rSnapRect.GetHeight()) / 65536.0;
- double fViewPointX = (double)((sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_c3DXViewpoint, 1250000 )) / 360;
- double fViewPointY = (double)((sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_c3DYViewpoint,(sal_uInt32)-1250000 )) / 360;
- double fViewPointZ = (double)((sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_c3DZViewpoint,(sal_uInt32)-9000000 )) / 360;
-
- basegfx::B3DPoint aNewLookAt( fViewPointX, -fViewPointY, 0 );
- basegfx::B3DPoint aNewCamPos( fViewPointX, -fViewPointY, -fViewPointZ );
- rCamera.SetPosAndLookAt( aNewCamPos, aNewLookAt );
- pScene->SetCamera( rCamera );
- }
- pScene->NbcSetTransform( aNewTransform );
-
- ///////////
- // light //
- ///////////
- double fAmbientIntensity = ((double)rPropSet.GetPropertyValue( DFF_Prop_c3DAmbientIntensity, 22178 )) / 65536.0;
-
- sal_Int32 nLightX = ((sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_c3DKeyX, 50000 )) / 360;
- sal_Int32 nLightY = - ((sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_c3DKeyY, 0 )) / 360;
- sal_Int32 nLightZ = - ((sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_c3DKeyZ, 10000 )) / 360;
- if ( !nLightZ )
- nLightZ = 1;
- double fLightIntensity = ((double)rPropSet.GetPropertyValue( DFF_Prop_c3DKeyIntensity, 43712 )) / 65536.0;
-// sal_Bool bLightHarsh = ( rPropSet.GetPropertyValue( DFF_Prop_fc3DFillHarsh, 0 ) & 2 ) != 0;
-
- sal_Int32 nLight2X = ((sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_c3DFillX, (sal_uInt32)-50000 )) / 360;
- sal_Int32 nLight2Y = - ((sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_c3DFillY, 0 )) / 360;
- sal_Int32 nLight2Z = - ((sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_c3DFillZ, 10000 )) / 360;
- if ( !nLight2Z )
- nLight2Z = -1;
- double fLight2Intensity = ((double)rPropSet.GetPropertyValue( DFF_Prop_c3DFillIntensity, 43712 )) / 65536.0;
-// sal_Bool bLight2Harsh = ( rPropSet.GetPropertyValue( DFF_Prop_fc3DFillHarsh, 0 ) & 1 ) != 0;
-// sal_Bool bLightFace = ( rPropSet.GetPropertyValue( DFF_Prop_fc3DLightFace, 0 ) & 1 ) != 0;
-
- sal_uInt16 nAmbientColor = (sal_uInt16)( fAmbientIntensity * 255.0 );
- if ( nAmbientColor > 255 )
- nAmbientColor = 255;
- Color aGlobalAmbientColor( (sal_uInt8)nAmbientColor, (sal_uInt8)nAmbientColor, (sal_uInt8)nAmbientColor );
- pScene->SetMergedItem( Svx3DAmbientcolorItem( aGlobalAmbientColor ) );
-
- sal_uInt8 nSpotLight1 = (sal_uInt8)( fLightIntensity * 255.0 );
- basegfx::B3DVector aSpotLight1( (double)nLightX, (double)nLightY, (double)nLightZ );
- aSpotLight1.normalize();
- pScene->SetMergedItem( Svx3DLightOnOff1Item( sal_True ) );
- Color aAmbientSpot1Color( nSpotLight1, nSpotLight1, nSpotLight1 );
- pScene->SetMergedItem( Svx3DLightcolor1Item( aAmbientSpot1Color ) );
- pScene->SetMergedItem( Svx3DLightDirection1Item( aSpotLight1 ) );
-
- sal_uInt8 nSpotLight2 = (sal_uInt8)( fLight2Intensity * 255.0 );
- basegfx::B3DVector aSpotLight2( (double)nLight2X, (double)nLight2Y, (double)nLight2Z );
- aSpotLight2.normalize();
- pScene->SetMergedItem( Svx3DLightOnOff2Item( sal_True ) );
- Color aAmbientSpot2Color( nSpotLight2, nSpotLight2, nSpotLight2 );
- pScene->SetMergedItem( Svx3DLightcolor2Item( aAmbientSpot2Color ) );
- pScene->SetMergedItem( Svx3DLightDirection2Item( aSpotLight2 ) );
-
- if ( nLightX || nLightY )
- {
- sal_uInt8 nSpotLight3 = 70;
- basegfx::B3DVector aSpotLight3( 0.0, 0.0, 1.0 );
- pScene->SetMergedItem( Svx3DLightOnOff3Item( sal_True ) );
- Color aAmbientSpot3Color( nSpotLight3, nSpotLight3, nSpotLight3 );
- pScene->SetMergedItem( Svx3DLightcolor3Item( aAmbientSpot3Color ) );
- pScene->SetMergedItem( Svx3DLightDirection3Item( aSpotLight3 ) );
- }
-
- double fSpecular = ((double)rPropSet.GetPropertyValue( DFF_Prop_c3DSpecularAmt, 0 )) / 65536.0;
-// double fDiffuse = ((double)rPropSet.GetPropertyValue( DFF_Prop_c3DDiffuseAmt, 0 )) / 65536.0;
-// double fShininess = ((double)rPropSet.GetPropertyValue( DFF_Prop_c3DShininess, 0 )) / 65536.0;
-
- sal_uInt16 nItensity = 25;
- Color aSpecularCol( COL_BLACK );
- if ( fSpecular == 0.0 )
- {
- aSpecularCol = Color( 51, 51, 51 );
- }
- else if ( fSpecular > 1.2 )
- {
- aSpecularCol = Color( 128, 128, 128 );
- }
- pScene->SetMergedItem( Svx3DMaterialSpecularItem( aSpecularCol ) );
- pScene->SetMergedItem( Svx3DMaterialSpecularIntensityItem( nItensity ) );
-
- pScene->SetModel( pObj->GetModel() );
- pRet->SetSnapRect( CalculateNewSnapRect( rSnapRect, rPropSet ) );
-
- // removing placeholder objects
- std::vector< E3dCompoundObject* >::iterator aObjectListIter( aPlaceholderObjectList.begin() );
- while ( aObjectListIter != aPlaceholderObjectList.end() )
- {
- pScene->Remove3DObj( *aObjectListIter );
- delete *aObjectListIter++;
- }
- }
- else
- delete pScene;
- return pRet;
-}
-
-Rectangle SvxMSDffCustomShape3D::CalculateNewSnapRect( const Rectangle& rOriginalSnapRect, const DffPropSet& rPropSet )
-{
- const Point aCenter( rOriginalSnapRect.Center() );
- //double fExtrusionBackward = (double)((sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_c3DExtrudeBackward, 457200 )) / 360.0;
- double fExtrusionForward = (double)((sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_c3DExtrudeForward, 0 )) / 360.0;
- sal_uInt32 i;
-
- // creating initial bound volume ( without rotation. skewing.and camera )
- basegfx::B3DPolygon aBoundVolume;
- const Polygon aPolygon( rOriginalSnapRect );
-
- for ( i = 0L; i < 4L; i++ )
- {
- aBoundVolume.append(basegfx::B3DPoint(
- aPolygon[ (sal_uInt16)i ].X() - aCenter.X(),
- aPolygon[ (sal_uInt16)i ].Y() - aCenter.Y(),
- fExtrusionForward));
- }
-
- for ( ; i < 8L; i++ )
- {
- aBoundVolume.append(basegfx::B3DPoint(
- aPolygon[ (sal_uInt16)i ].X() - aCenter.X(),
- aPolygon[ (sal_uInt16)i ].Y() - aCenter.Y(),
- fExtrusionForward));
- }
-
- basegfx::B3DPoint aRotateCenter;
- aRotateCenter.setX(0.0);
- aRotateCenter.setY(0.0);
- aRotateCenter.setZ(rPropSet.GetPropertyValue( DFF_Prop_c3DRotationCenterZ, 0 ) / 360);
-
- // double XCenterInGUnits = rPropSet.GetPropertyValue( DFF_Prop_c3DRotationCenterX, 0 );
- // double YCenterInGUnits = rPropSet.GetPropertyValue( DFF_Prop_c3DRotationCenterY, 0 );
-
- // sal_Int32 nRotationXAxisInProz = rPropSet.GetPropertyValue( DFF_Prop_c3DRotationAxisX, 100 );
- // sal_Int32 nRotationYAxisInProz = rPropSet.GetPropertyValue( DFF_Prop_c3DRotationAxisY, 0 );
- // sal_Int32 nRotationZAxisInProz = rPropSet.GetPropertyValue( DFF_Prop_c3DRotationAxisZ, 0 );
-
- double fXRotate = Fix16ToAngle( rPropSet.GetPropertyValue( DFF_Prop_c3DXRotationAngle, 0 ) ) * F_PI180;
- double fYRotate = Fix16ToAngle( rPropSet.GetPropertyValue( DFF_Prop_c3DYRotationAngle, 0 ) ) * F_PI180;
- double fZRotate = -Fix16ToAngle( rPropSet.GetPropertyValue( DFF_Prop_Rotation, 0 ) ) * F_PI180;
- // double fRotationAngle = Fix16ToAngle( rPropSet.GetPropertyValue( DFF_Prop_c3DRotationAngle, 0 ) ); // * F_PI180;
-
- for( i = 0; i < 8; i++ ) // rotating bound volume
- {
- basegfx::B3DPoint aPoint(aBoundVolume.getB3DPoint(i));
- aPoint -= aRotateCenter;
- aPoint = Rotate( aPoint, fXRotate, fYRotate, fZRotate );
- aPoint += aRotateCenter;
- aBoundVolume.setB3DPoint(i, aPoint);
- }
-
- Transformation2D aTransformation2D( rPropSet, rOriginalSnapRect );
- if ( aTransformation2D.IsParallel() )
- {
- aBoundVolume = aTransformation2D.ApplySkewSettings( aBoundVolume );
- }
-
- Polygon aTransformed( 8 );
- for ( i = 0L; i < 8L; i++ )
- {
- aTransformed[ (sal_uInt16)i ] = aTransformation2D.Transform2D( aBoundVolume.getB3DPoint(i) );
- }
-
- return aTransformed.GetBoundRect();
-}
-
-// eof
diff --git a/svx/source/msfilter/msashape3d.hxx b/svx/source/msfilter/msashape3d.hxx
deleted file mode 100644
index 6a325a7..0000000
--- a/svx/source/msfilter/msashape3d.hxx
+++ /dev/null
@@ -1,83 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: msashape3d.hxx,v $
- * $Revision: 1.7 $
- *
- * 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 _MSASHAPE3D_HXX
-#define _MSASHAPE3D_HXX
-
-#include <svx/msdffimp.hxx>
-#include <basegfx/point/b3dpoint.hxx>
-#include <basegfx/polygon/b3dpolygon.hxx>
-
-#include <vector>
-//#include <poly3d.hxx>
-//#include <goodies/point3d.hxx>
-
-class SvxMSDffCustomShape3D
-{
- class Transformation2D
- {
- Point aCenter;
- sal_Bool bParallel;
-
- // parallel projection
- double fSkewAngle;
- sal_Int32 nSkewAmount; // in percent
-
- // perspective projection
- double fZScreen;
- basegfx::B3DPoint fViewPoint;
- double fViewPointOriginX;
- double fViewPointOriginY;
-
- public :
-
- Transformation2D( const DffPropSet& rPropSet, const Rectangle& rSnapRect );
- basegfx::B3DPolygon ApplySkewSettings( const basegfx::B3DPolygon& rPoly3D );
- Point Transform2D( const basegfx::B3DPoint& rPoint );
- sal_Bool IsParallel() const { return bParallel; };
- };
-
- friend class Transformation2D;
-
- protected :
-
- static basegfx::B3DPoint Rotate( const basegfx::B3DPoint& rPoint, const double x, const double y, const double z );
-// static void Rotate( basegfx::B3DPolyPolygon&, const basegfx::B3DPoint& rRotateCenter, const double x, const double y, const double z );
- static double Fix16ToAngle( sal_Int32 nFixAngle );
- static Rectangle CalculateNewSnapRect( const Rectangle& rOriginalSnapRect, const DffPropSet& );
-
- public :
-
- static SdrObject* Create3DObject( const SdrObject* pSource, const DffPropSet&,
- SfxItemSet&, Rectangle& rSnapRect, sal_uInt32 nSpFlags );
-};
-
-#endif
-
diff --git a/svx/source/msfilter/msdffimp.cxx b/svx/source/msfilter/msdffimp.cxx
index fe00bce..e69de29 100644
--- a/svx/source/msfilter/msdffimp.cxx
+++ b/svx/source/msfilter/msdffimp.cxx
@@ -1,7996 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: msdffimp.cxx,v $
- * $Revision: 1.157 $
- *
- * 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): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
-#include <com/sun/star/embed/Aspects.hpp>
-
-#include <math.h>
-#include <limits.h>
-#include <vector>
-#include <osl/endian.h>
-#include <tools/solar.h> // UINTXX
-#include <rtl/math.hxx>
-
-#include <sot/clsids.hxx>
-#include <toolkit/helper/vclunohelper.hxx>
-#include <unotools/streamwrap.hxx>
-#include <comphelper/processfactory.hxx>
-#include <sot/exchange.hxx>
-#include <sot/storinfo.hxx>
-#include <vcl/cvtgrf.hxx>
-
-#include "viscache.hxx"
-
-// SvxItem-Mapping. Wird benoetigt um die SvxItem-Header erfolgreich zu includen
-#include <svx/eeitem.hxx>
-#ifndef _EDITDATA_HXX
-#include <svx/editdata.hxx>
-#endif
-
-#include <svtools/urihelper.hxx>
-
-// textitem.hxx editdata.hxx
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// paraitem.hxx editdata.hxx
-
-
-#include <tools/stream.hxx>
-#include <tools/debug.hxx>
-#ifndef _TOOLS_ZCODEC_HXX
-#include <tools/zcodec.hxx>
-#endif
-#ifndef _UNOTOOLS_UCBSTREAMHELPER_HXX
-#include <unotools/ucbstreamhelper.hxx>
-#endif
-#include <unotools/localfilehelper.hxx>
-#include <svx/escherex.hxx>
-#include <basegfx/range/b2drange.hxx>
-#include <com/sun/star/container/XIdentifierContainer.hpp>
-#include <com/sun/star/drawing/XGluePointsSupplier.hpp>
-#include <com/sun/star/drawing/Position3D.hpp>
-#include <com/sun/star/drawing/Direction3D.hpp>
-#include <com/sun/star/drawing/GluePoint2.hpp>
-#include <com/sun/star/drawing/XShapes.hpp>
-#include <svx/charscaleitem.hxx>
-#include <svx/kernitem.hxx>
-#include <svtools/filter.hxx>
-#include <tools/string.hxx>
-#ifndef _TOOLS_URLOBJ_HXX
-#include <tools/urlobj.hxx>
-#endif
-#include <vcl/virdev.hxx>
-#include <vcl/bmpacc.hxx>
-#ifndef _SVSTOR_HXX //autogen
-#include <sot/storage.hxx>
-#endif
-#include <sfx2/docfac.hxx>
-#include <sfx2/docfilt.hxx>
-#include <sfx2/docfile.hxx>
-#include <sfx2/fcontnr.hxx>
-#include <sfx2/module.hxx>
-//#ifndef _SFX_INTERNO_HXX
-//#include <sfx2/interno.hxx>
-//#endif
-
-#ifndef _SDGCPITM_HXX
-
-//#endif
-#include <svx/sdgcpitm.hxx>
-#endif
-#include <svx/sdgmoitm.hxx>
-#include <svx/tstpitem.hxx>
-#include <svx/fmmodel.hxx>
-#include <svx/svdmodel.hxx>
-#include <svx/svdobj.hxx>
-#include <svx/svdpage.hxx>
-#include <svx/svdogrp.hxx>
-#include <svx/svdograf.hxx>
-#include <svx/svdotext.hxx>
-#include <svx/svdorect.hxx>
-#ifndef _SVDOCAPT_HXX
-#include <svx/svdocapt.hxx>
-#endif
-#include <svx/svdoedge.hxx>
-#include <svx/svdocirc.hxx>
-#include <svx/svdoutl.hxx>
-#include <svx/svdoole2.hxx>
-#include <svx/svdopath.hxx>
-#include <svx/frmdir.hxx>
-#include <svx/frmdiritem.hxx>
-#include <svx/svdtrans.hxx>
-#include <svx/sxenditm.hxx>
-#include <svx/sdgluitm.hxx>
-#include <svx/fhgtitem.hxx>
-#include <svx/wghtitem.hxx>
-#include <svx/postitem.hxx>
-#include <svx/udlnitem.hxx>
-#include <svx/crsditem.hxx>
-#include <svx/shdditem.hxx>
-#include <fontitem.hxx>
-#include <svx/colritem.hxx>
-#include <svx/sxekitm.hxx>
-#include <bulitem.hxx>
-#include <svx/polysc3d.hxx>
-#include <svx/extrud3d.hxx>
-#include "svditer.hxx"
-#include <svx/xpoly.hxx>
-#include "xattr.hxx"
-
-#ifndef _IMPGRF_HXX //autogen
-#include "impgrf.hxx"
-#endif
-#include <svx/msdffimp.hxx> // extern sichtbare Header-Datei
-#include <svx/outliner.hxx>
-#include <svx/outlobj.hxx>
-#include <svx/editobj.hxx>
-#include <svx/editeng.hxx>
-#include "msashape.hxx"
-#include "msashape3d.hxx"
-#include "gallery.hxx"
-#include <com/sun/star/drawing/ShadeMode.hpp>
-#include <svtools/itempool.hxx>
-#include <vcl/svapp.hxx>
-#include <svx/svx3ditems.hxx>
-#include <svx/svdoashp.hxx>
-#include <svx/sdasaitm.hxx>
-#ifndef _UCBHELPER_CONTENT_HXX_
-#include <ucbhelper/content.hxx>
-#endif
-#ifndef _UCBHELPER_CONTENTBROKER_HXX_
-#include <ucbhelper/contentbroker.hxx>
-#endif
-#include <vos/xception.hxx>
-#ifndef _VOS_NO_NAMESPACE
-using namespace vos;
-#endif
-#include "../customshapes/EnhancedCustomShapeTypeNames.hxx"
-#include "../customshapes/EnhancedCustomShapeGeometry.hxx"
-#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
-#include <com/sun/star/drawing/EnhancedCustomShapeParameterType.hpp>
-#include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp>
-#include <com/sun/star/drawing/EnhancedCustomShapeGluePointType.hpp>
-#include <com/sun/star/drawing/EnhancedCustomShapeSegmentCommand.hpp>
-#include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp>
-#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
-#include <com/sun/star/drawing/EnhancedCustomShapeTextPathMode.hpp>
-#ifndef __com_sun_star_beans_PropertyValues_hpp__
-#include <com/sun/star/beans/PropertyValues.hpp>
-#endif
-#include <com/sun/star/drawing/ProjectionMode.hpp>
-#include "../customshapes/EnhancedCustomShape2d.hxx"
-
-using namespace ::com::sun::star ;
-using namespace ::com::sun::star::drawing;
-using namespace uno ;
-using namespace beans ;
-using namespace drawing ;
-using namespace container ;
-
-#define ITEMVALUE(ItemSet,Id,Cast) ((const Cast&)(ItemSet).Get(Id)).GetValue()
-
-// static counter for OLE-Objects
-static sal_uInt32 nMSOleObjCntr = 0;
-#define MSO_OLE_Obj "MSO_OLE_Obj"
-
-
-/*************************************************************************/
-BOOL Impl_OlePres::Read( SvStream & rStm )
-{
- ULONG nBeginPos = rStm.Tell();
- INT32 n;
- rStm >> n;
- if( n != -1 )
- {
- pBmp = new Bitmap;
- rStm >> *pBmp;
- if( rStm.GetError() == SVSTREAM_OK )
- {
- nFormat = FORMAT_BITMAP;
- aSize = pBmp->GetPrefSize();
- MapMode aMMSrc;
- if( !aSize.Width() || !aSize.Height() )
- {
- // letzte Chance
- aSize = pBmp->GetSizePixel();
- aMMSrc = MAP_PIXEL;
- }
- else
- aMMSrc = pBmp->GetPrefMapMode();
- MapMode aMMDst( MAP_100TH_MM );
- aSize = OutputDevice::LogicToLogic( aSize, aMMSrc, aMMDst );
- return TRUE;
- }
- else
- {
- delete pBmp;
- pBmp = NULL;
-
- pMtf = new GDIMetaFile();
- rStm.ResetError();
- rStm >> *pMtf;
- if( rStm.GetError() == SVSTREAM_OK )
- {
- nFormat = FORMAT_GDIMETAFILE;
- aSize = pMtf->GetPrefSize();
- MapMode aMMSrc = pMtf->GetPrefMapMode();
- MapMode aMMDst( MAP_100TH_MM );
- aSize = OutputDevice::LogicToLogic( aSize, aMMSrc, aMMDst );
- return TRUE;
- }
- else
- {
- delete pMtf;
- pMtf = NULL;
- }
- }
-
- }
-
- rStm.ResetError();
- rStm.Seek( nBeginPos );
- nFormat = ReadClipboardFormat( rStm );
- // JobSetup, bzw. TargetDevice ueberlesen
- // Information aufnehmen, um sie beim Schreiben nicht zu verlieren
- nJobLen = 0;
- rStm >> nJobLen;
- if( nJobLen >= 4 )
- {
- nJobLen -= 4;
- if( nJobLen )
- {
- pJob = new BYTE[ nJobLen ];
- rStm.Read( pJob, nJobLen );
- }
- }
- else
- {
- rStm.SetError( SVSTREAM_GENERALERROR );
- return FALSE;
- }
- UINT32 nAsp;
- rStm >> nAsp;
- USHORT nSvAsp = USHORT( nAsp );
- SetAspect( nSvAsp );
- rStm.SeekRel( 4 ); //L-Index ueberlesen
- rStm >> nAdvFlags;
- rStm.SeekRel( 4 ); //Compression
- UINT32 nWidth = 0;
- UINT32 nHeight = 0;
- UINT32 nSize = 0;
- rStm >> nWidth >> nHeight >> nSize;
- aSize.Width() = nWidth;
- aSize.Height() = nHeight;
-
- if( nFormat == FORMAT_GDIMETAFILE )
- {
- pMtf = new GDIMetaFile();
- ReadWindowMetafile( rStm, *pMtf, NULL );
- }
- else if( nFormat == FORMAT_BITMAP )
- {
- pBmp = new Bitmap();
- rStm >> *pBmp;
- }
- else
- {
- BYTE * p = new BYTE[ nSize ];
- rStm.Read( p, nSize );
- delete p;
- return FALSE;
- }
- return TRUE;
-}
-
-/************************************************************************/
-void Impl_OlePres::Write( SvStream & rStm )
-{
- WriteClipboardFormat( rStm, FORMAT_GDIMETAFILE );
- rStm << (INT32)(nJobLen +4); // immer leeres TargetDevice
- if( nJobLen )
- rStm.Write( pJob, nJobLen );
- rStm << (UINT32)nAspect;
- rStm << (INT32)-1; //L-Index immer -1
- rStm << (INT32)nAdvFlags;
- rStm << (INT32)0; //Compression
- rStm << (INT32)aSize.Width();
- rStm << (INT32)aSize.Height();
- ULONG nPos = rStm.Tell();
- rStm << (INT32)0;
-
- if( GetFormat() == FORMAT_GDIMETAFILE && pMtf )
- {
- // Immer auf 1/100 mm, bis Mtf-Loesung gefunden
- // Annahme (keine Skalierung, keine Org-Verschiebung)
- DBG_ASSERT( pMtf->GetPrefMapMode().GetScaleX() == Fraction( 1, 1 ),
- "X-Skalierung im Mtf" );
- DBG_ASSERT( pMtf->GetPrefMapMode().GetScaleY() == Fraction( 1, 1 ),
- "Y-Skalierung im Mtf" );
- DBG_ASSERT( pMtf->GetPrefMapMode().GetOrigin() == Point(),
- "Origin-Verschiebung im Mtf" );
- MapUnit nMU = pMtf->GetPrefMapMode().GetMapUnit();
- if( MAP_100TH_MM != nMU )
- {
- Size aPrefS( pMtf->GetPrefSize() );
- Size aS( aPrefS );
- aS = OutputDevice::LogicToLogic( aS, nMU, MAP_100TH_MM );
-
- pMtf->Scale( Fraction( aS.Width(), aPrefS.Width() ),
- Fraction( aS.Height(), aPrefS.Height() ) );
- pMtf->SetPrefMapMode( MAP_100TH_MM );
- pMtf->SetPrefSize( aS );
- }
- WriteWindowMetafileBits( rStm, *pMtf );
- }
- else
- {
- DBG_ERROR( "unknown format" );
- }
- ULONG nEndPos = rStm.Tell();
- rStm.Seek( nPos );
- rStm << (UINT32)(nEndPos - nPos - 4);
- rStm.Seek( nEndPos );
-}
-
-Impl_OlePres * CreateCache_Impl( SotStorage * pStor )
-{
- SotStorageStreamRef xOleObjStm =pStor->OpenSotStream( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "Ole-Object" ) ),
- STREAM_READ | STREAM_NOCREATE );
- if( xOleObjStm->GetError() )
- return NULL;
- SotStorageRef xOleObjStor = new SotStorage( *xOleObjStm );
- if( xOleObjStor->GetError() )
- return NULL;
-
- String aStreamName;
- if( xOleObjStor->IsContained( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\002OlePres000" ) ) ) )
- aStreamName = String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\002OlePres000" ) );
- else if( xOleObjStor->IsContained( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\1Ole10Native" ) ) ) )
- aStreamName = String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\1Ole10Native" ) );
-
- if( aStreamName.Len() == 0 )
- return NULL;
-
-
- for( USHORT i = 1; i < 10; i++ )
- {
- SotStorageStreamRef xStm = xOleObjStor->OpenSotStream( aStreamName,
- STREAM_READ | STREAM_NOCREATE );
- if( xStm->GetError() )
- break;
-
- xStm->SetBufferSize( 8192 );
- Impl_OlePres * pEle = new Impl_OlePres( 0 );
- if( pEle->Read( *xStm ) && !xStm->GetError() )
- {
- if( pEle->GetFormat() == FORMAT_GDIMETAFILE || pEle->GetFormat() == FORMAT_BITMAP )
- return pEle;
- }
- delete pEle;
- aStreamName = String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\002OlePres00" ) );
- aStreamName += String( i );
- };
- return NULL;
-}
-
-
-
-//---------------------------------------------------------------------------
-// Hilfs Klassen aus MSDFFDEF.HXX
-//---------------------------------------------------------------------------
-
-SvStream& operator>>( SvStream& rIn, DffRecordHeader& rRec )
-{
- rRec.nFilePos = rIn.Tell();
- UINT16 nTmp(0);
- rIn >> nTmp;
- rRec.nImpVerInst = nTmp;
- rRec.nRecVer = sal::static_int_cast< BYTE >(nTmp & 0x000F);
- rRec.nRecInstance = nTmp >> 4;
- rIn >> rRec.nRecType;
- rIn >> rRec.nRecLen;
- return rIn;
-}
-
-// Masse fuer dashed lines
-#define LLEN_MIDDLE (450)
-#define LLEN_SPACE_MIDDLE (360)
-#define LLEN_LONG (LLEN_MIDDLE * 2)
-#define LLEN_SPACE_LONG (LLEN_SPACE_MIDDLE + 20)
-#define LLEN_POINT (LLEN_MIDDLE / 4)
-#define LLEN_SPACE_POINT (LLEN_SPACE_MIDDLE / 4)
-
-SvStream& operator>>( SvStream& rIn, DffPropSet& rRec )
-{
- rRec.InitializePropSet();
-
- DffRecordHeader aHd;
- rIn >> aHd;
- UINT32 nPropCount = aHd.nRecInstance;
-
- // FilePos der ComplexData merken
- UINT32 nComplexDataFilePos = rIn.Tell() + ( nPropCount * 6 );
-
- for( UINT32 nPropNum = 0; nPropNum < nPropCount; nPropNum++ )
- {
- sal_uInt16 nTmp;
- sal_uInt32 nRecType, nContent, nContentEx = 0xffff0000;
- rIn >> nTmp
- >> nContent;
-
- nRecType = nTmp & 0x3fff;
-
- if ( nRecType > 0x3ff )
- break;
- if ( ( nRecType & 0x3f ) == 0x3f )
- { // clear flags that have to be cleared
- rRec.mpContents[ nRecType ] &= ( ( nContent >> 16 ) ^ 0xffffffff );
- // set flags that have to be set
- rRec.mpContents[ nRecType ] |= nContent;
- nContentEx |= ( nContent >> 16 );
- rRec.Replace( nRecType, (void*)nContentEx );
- }
- else
- {
- DffPropFlags aPropFlag = { 1, 0, 0, 0 };
- if ( nTmp & 0x4000 )
- aPropFlag.bBlip = sal_True;
- if ( nTmp & 0x8000 )
- aPropFlag.bComplex = sal_True;
- if ( aPropFlag.bComplex && nContent && ( nComplexDataFilePos < aHd.GetRecEndFilePos() ) )
- {
- // normally nContent is the complete size of the complex property,
- // but this is not always true for IMsoArrays ( what the hell is a IMsoArray ? )
-
- // I love special threatments :-(
- if ( ( nRecType == DFF_Prop_pVertices ) || ( nRecType == DFF_Prop_pSegmentInfo )
- || ( nRecType == DFF_Prop_fillShadeColors ) || ( nRecType == DFF_Prop_lineDashStyle )
- || ( nRecType == DFF_Prop_pWrapPolygonVertices ) || ( nRecType == DFF_Prop_connectorPoints )
- || ( nRecType == DFF_Prop_Handles ) || ( nRecType == DFF_Prop_pFormulas )
- || ( nRecType == DFF_Prop_textRectangles ) )
- {
- // now check if the current content size is possible, or 6 bytes too small
- sal_uInt32 nOldPos = rIn.Tell();
- sal_Int16 nNumElem, nNumElemReserved, nSize;
-
- rIn.Seek( nComplexDataFilePos );
- rIn >> nNumElem >> nNumElemReserved >> nSize;
- if ( nNumElemReserved >= nNumElem )
- {
- // the size of these array elements is nowhere defined,
- // what if the size is negative ?
- // ok, we will make it positive and shift it.
- // for -16 this works
- if ( nSize < 0 )
- nSize = ( -nSize ) >> 2;
- sal_uInt32 nDataSize = (sal_uInt32)( nSize * nNumElem );
-
- // sometimes the content size is 6 bytes too small (array header information is missing )
- if ( nDataSize == nContent )
- nContent += 6;
-
- // check if array fits into the PropertyContainer
- if ( ( nComplexDataFilePos + nContent ) > aHd.GetRecEndFilePos() )
- nContent = 0;
- }
- else
- nContent = 0;
- rIn.Seek( nOldPos );
- }
- if ( nContent )
- {
- nContentEx = nComplexDataFilePos; // insert the filepos of this property;
- nComplexDataFilePos += nContent; // store filepos, that is used for the next complex property
- }
- else // a complex property needs content
- aPropFlag.bSet = sal_False; // otherwise something is wrong
- }
- rRec.mpContents[ nRecType ] = nContent;
- rRec.mpFlags[ nRecType ] = aPropFlag;
- rRec.Insert( nRecType, (void*)nContentEx );
- }
- }
- aHd.SeekToEndOfRecord( rIn );
- return rIn;
-}
-
-void DffPropSet::InitializePropSet() const
-{
- /*
- cmc:
- " Boolean properties are grouped in bitfields by property set; note that
- the Boolean properties in each property set are contiguous. They are saved
- under the property ID of the last Boolean property in the set, and are
- placed in the value field in reverse order starting with the last property
- in the low bit. "
-
- e.g.
-
- fEditedWrap
- fBehindDocument
- fOnDblClickNotify
- fIsButton
- fOneD
- fHidden
- fPrint
-
- are all part of a group and all are by default false except for fPrint,
- which equates to a default bit sequence for the group of 0000001 -> 0x1
-
- If at a later stage word sets fBehindDocument away from the default it
- will be done by having a property named fPrint whose bitsequence will have
- the fBehindDocument bit set. e.g. a DFF_Prop_fPrint with value 0x200020
- has set bit 6 on so as to enable fBehindDocument (as well as disabling
- everything else)
- */
-
- memset( ( (DffPropSet*) this )->mpFlags, 0, 0x400 * sizeof(DffPropFlags) );
- ( (DffPropSet*) this )->Clear();
-
- DffPropFlags nFlags = { 1, 0, 0, 1 };
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_LockAgainstGrouping ] = 0x0000; //0x01ff0000;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_LockAgainstGrouping ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_LockAgainstGrouping, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_FitTextToShape ] = 0x0010; //0x001f0010;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_FitTextToShape ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_FitTextToShape, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_gtextFStrikethrough ] = 0x0000; //0xffff0000;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_gtextFStrikethrough ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_gtextFStrikethrough, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_pictureActive ] = 0x0000; //0x000f0000;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_pictureActive ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_pictureActive, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_fFillOK ] = 0x0039; //0x003f0039;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fFillOK ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_fFillOK, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_fNoFillHitTest ] = 0x001c; //0x001f001c;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fNoFillHitTest ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_fNoFillHitTest, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_fNoLineDrawDash ] = 0x001e; //0x001f000e;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fNoLineDrawDash ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_fNoLineDrawDash, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_fshadowObscured ] = 0x0000; //0x00030000;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fshadowObscured ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_fshadowObscured, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_fPerspective ] = 0x0000; //0x00010000;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fPerspective ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_fPerspective, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_fc3DLightFace ] = 0x0001; //0x000f0001;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fc3DLightFace ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_fc3DLightFace, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_fc3DFillHarsh ] = 0x0016; //0x001f0016;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fc3DFillHarsh ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_fc3DFillHarsh, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_fBackground ] = 0x0000; //0x001f0000;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fBackground ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_fBackground, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_fCalloutLengthSpecified ] = 0x0010; //0x00ef0010;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fCalloutLengthSpecified ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_fCalloutLengthSpecified, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_fPrint ] = 0x0001; //0x00ef0001;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fPrint ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_fPrint, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_fillColor ] = 0xffffff;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fillColor ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_fillColor, (void*)0xffff0000 );
-}
-
-void DffPropSet::Merge( DffPropSet& rMaster ) const
-{
- for ( void* pDummy = rMaster.First(); pDummy; pDummy = rMaster.Next() )
- {
- UINT32 nRecType = rMaster.GetCurKey();
- if ( ( nRecType & 0x3f ) == 0x3f ) // this is something called FLAGS
- {
- UINT32 nCurrentFlags = mpContents[ nRecType ];
- UINT32 nMergeFlags = rMaster.mpContents[ nRecType ];
- nMergeFlags &= ( nMergeFlags >> 16 ) | 0xffff0000; // clearing low word
- nMergeFlags &= ( ( nCurrentFlags & 0xffff0000 ) // remove allready hard set
- | ( nCurrentFlags >> 16 ) ) ^ 0xffffffff; // attributes from mergeflags
- nCurrentFlags &= ( ( nMergeFlags & 0xffff0000 ) // apply zero master bits
- | ( nMergeFlags >> 16 ) ) ^ 0xffffffff;
- nCurrentFlags |= (UINT16)nMergeFlags; // apply filled master bits
- ( (DffPropSet*) this )->mpContents[ nRecType ] = nCurrentFlags;
-
-
- sal_uInt32 nNewContentEx = (sal_uInt32)(sal_uIntPtr)rMaster.GetCurObject();
- if ( ((DffPropSet*)this)->Seek( nRecType ) )
- nNewContentEx |= (sal_uInt32)(sal_uIntPtr)GetCurObject();
- ( (DffPropSet*) this )->Replace( nRecType, (void*)nNewContentEx );
- }
- else
- {
- if ( !IsProperty( nRecType ) || !IsHardAttribute( nRecType ) )
- {
- ( (DffPropSet*) this )->mpContents[ nRecType ] = rMaster.mpContents[ nRecType ];
- DffPropFlags nFlags( rMaster.mpFlags[ nRecType ] );
- nFlags.bSoftAttr = TRUE;
- ( (DffPropSet*) this )->mpFlags[ nRecType ] = nFlags;
- ( (DffPropSet*) this )->Insert( nRecType, pDummy );
- }
- }
- }
-}
-
-BOOL DffPropSet::IsHardAttribute( UINT32 nId ) const
-{
- BOOL bRetValue = TRUE;
- nId &= 0x3ff;
- if ( ( nId & 0x3f ) >= 48 ) // is this a flag id
- {
- if ( ((DffPropSet*)this)->Seek( nId | 0x3f ) )
- {
- sal_uInt32 nContentEx = (sal_uInt32)(sal_uIntPtr)GetCurObject();
- bRetValue = ( nContentEx & ( 1 << ( 0xf - ( nId & 0xf ) ) ) ) != 0;
- }
- }
- else
- bRetValue = ( mpFlags[ nId ].bSoftAttr == 0 );
- return bRetValue;
-};
-
-UINT32 DffPropSet::GetPropertyValue( UINT32 nId, UINT32 nDefault ) const
-{
- nId &= 0x3ff;
- return ( mpFlags[ nId ].bSet ) ? mpContents[ nId ] : nDefault;
-};
-
-bool DffPropSet::GetPropertyBool( UINT32 nId, bool bDefault ) const
-{
- UINT32 nBaseId = nId | 31; // base ID to get the UINT32 property value
- UINT32 nMask = 1 << (nBaseId - nId); // bit mask of the boolean property
-
- UINT32 nPropValue = GetPropertyValue( nBaseId, bDefault ? nMask : 0 );
- return (nPropValue & nMask) != 0;
-}
-
-::rtl::OUString DffPropSet::GetPropertyString( UINT32 nId, SvStream& rStrm ) const
-{
- sal_Size nOldPos = rStrm.Tell();
- ::rtl::OUStringBuffer aBuffer;
- sal_uInt32 nBufferSize = GetPropertyValue( nId );
- if( (nBufferSize > 0) && SeekToContent( nId, rStrm ) )
- {
- sal_Int32 nStrLen = static_cast< sal_Int32 >( nBufferSize / 2 );
- aBuffer.ensureCapacity( nStrLen );
- for( sal_Int32 nCharIdx = 0; nCharIdx < nStrLen; ++nCharIdx )
- {
- sal_uInt16 nChar = 0;
- rStrm >> nChar;
- if( nChar > 0 )
- aBuffer.append( static_cast< sal_Unicode >( nChar ) );
- else
- break;
- }
- }
- rStrm.Seek( nOldPos );
- return aBuffer.makeStringAndClear();
-}
-
-void DffPropSet::SetPropertyValue( UINT32 nId, UINT32 nValue ) const
-{
- if ( !mpFlags[ nId ].bSet )
- {
- ( (DffPropSet*) this )->Insert( nId, (void*)nValue );
- ( (DffPropSet*) this )->mpFlags[ nId ].bSet = TRUE;
- }
- ( (DffPropSet*) this )->mpContents[ nId ] = nValue;
-};
-
-BOOL DffPropSet::SeekToContent( UINT32 nRecType, SvStream& rStrm ) const
-{
- nRecType &= 0x3ff;
- if ( mpFlags[ nRecType ].bSet )
- {
- if ( mpFlags[ nRecType ].bComplex )
- {
- if ( ((DffPropSet*)this)->Seek( nRecType ) )
- {
- sal_uInt32 nOffset = (sal_uInt32)(sal_uIntPtr)GetCurObject();
- if ( nOffset && ( ( nOffset & 0xffff0000 ) != 0xffff0000 ) )
- {
- rStrm.Seek( nOffset );
- return TRUE;
- }
- }
- }
- }
- return FALSE;
-}
-
-DffPropertyReader::DffPropertyReader( const SvxMSDffManager& rMan ) :
- rManager( rMan ),
- pDefaultPropSet( NULL )
-{
- InitializePropSet();
-}
-
-void DffPropertyReader::SetDefaultPropSet( SvStream& rStCtrl, UINT32 nOffsDgg ) const
-{
- delete pDefaultPropSet;
- UINT32 nMerk = rStCtrl.Tell();
- rStCtrl.Seek( nOffsDgg );
- DffRecordHeader aRecHd;
- rStCtrl >> aRecHd;
- if ( aRecHd.nRecType == DFF_msofbtDggContainer )
- {
- if ( rManager.SeekToRec( rStCtrl, DFF_msofbtOPT, aRecHd.GetRecEndFilePos() ) )
- {
- ( (DffPropertyReader*) this )->pDefaultPropSet = new DffPropSet;
- rStCtrl >> *pDefaultPropSet;
- }
- }
- rStCtrl.Seek( nMerk );
-}
-
-#ifdef DBG_CUSTOMSHAPE
-void DffPropertyReader::ReadPropSet( SvStream& rIn, void* pClientData, UINT32 nShapeId ) const
-#else
-void DffPropertyReader::ReadPropSet( SvStream& rIn, void* pClientData ) const
-#endif
-{
- ULONG nFilePos = rIn.Tell();
- rIn >> (DffPropertyReader&)*this;
-
- if ( IsProperty( DFF_Prop_hspMaster ) )
- {
- if ( rManager.SeekToShape( rIn, pClientData, GetPropertyValue( DFF_Prop_hspMaster ) ) )
- {
- DffRecordHeader aRecHd;
- rIn >> aRecHd;
- if ( rManager.SeekToRec( rIn, DFF_msofbtOPT, aRecHd.GetRecEndFilePos() ) )
- {
- DffPropSet aMasterPropSet;
- rIn >> aMasterPropSet;
- Merge( aMasterPropSet );
- }
- }
- }
-// if ( pDefaultPropSet )
-// Merge( *( pDefaultPropSet ) );
-
- ( (DffPropertyReader*) this )->mnFix16Angle = Fix16ToAngle( GetPropertyValue( DFF_Prop_Rotation, 0 ) );
-
-#ifdef DBG_CUSTOMSHAPE
-
- String aURLStr;
-
- if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( String( RTL_CONSTASCII_STRINGPARAM( "d:\\ashape.dbg" ) ), aURLStr ) )
- {
- SvStream* pOut = ::utl::UcbStreamHelper::CreateStream( aURLStr, STREAM_WRITE );
-
- if( pOut )
- {
- pOut->Seek( STREAM_SEEK_TO_END );
-
- if ( IsProperty( DFF_Prop_adjustValue ) || IsProperty( DFF_Prop_pVertices ) )
- {
- pOut->WriteLine( "" );
- ByteString aString( "ShapeId: " );
- aString.Append( ByteString::CreateFromInt32( nShapeId ) );
- pOut->WriteLine( aString );
- }
- for ( sal_uInt32 i = DFF_Prop_adjustValue; i <= DFF_Prop_adjust10Value; i++ )
- {
- if ( IsProperty( i ) )
- {
- ByteString aString( "Prop_adjustValue" );
- aString.Append( ByteString::CreateFromInt32( ( i - DFF_Prop_adjustValue ) + 1 ) );
- aString.Append( ":" );
- aString.Append( ByteString::CreateFromInt32( GetPropertyValue( i ) ) );
- pOut->WriteLine( aString );
- }
- }
- sal_Int32 i;
- for ( i = 320; i < 383; i++ )
- {
- if ( ( i >= DFF_Prop_adjustValue ) && ( i <= DFF_Prop_adjust10Value ) )
- continue;
- if ( IsProperty( i ) )
- {
- if ( SeekToContent( i, rIn ) )
- {
- INT32 nLen = (INT32)GetPropertyValue( i );
- if ( nLen )
- {
- pOut->WriteLine( "" );
- ByteString aDesc( "Property:" );
- aDesc.Append( ByteString::CreateFromInt32( i ) );
- aDesc.Append( ByteString( " Size:" ) );
- aDesc.Append( ByteString::CreateFromInt32( nLen ) );
- pOut->WriteLine( aDesc );
- INT16 nNumElem, nNumElemMem, nNumSize;
- rIn >> nNumElem >> nNumElemMem >> nNumSize;
- aDesc = ByteString( "Entries: " );
- aDesc.Append( ByteString::CreateFromInt32( nNumElem ) );
- aDesc.Append( ByteString( " Size:" ) );
- aDesc.Append( ByteString::CreateFromInt32( nNumSize ) );
- pOut->WriteLine( aDesc );
- if ( nNumSize < 0 )
- nNumSize = ( ( -nNumSize ) >> 2 );
- if ( !nNumSize )
- nNumSize = 16;
- nLen -= 6;
- while ( nLen > 0 )
- {
- ByteString aString;
- for ( UINT32 j = 0; nLen && ( j < ( nNumSize >> 1 ) ); j++ )
- {
- for ( UINT32 k = 0; k < 2; k++ )
- {
- if ( nLen )
- {
- BYTE nVal;
- rIn >> nVal;
- if ( ( nVal >> 4 ) > 9 )
- *pOut << (BYTE)( ( nVal >> 4 ) + 'A' - 10 );
- else
- *pOut << (BYTE)( ( nVal >> 4 ) + '0' );
-
- if ( ( nVal & 0xf ) > 9 )
- *pOut << (BYTE)( ( nVal & 0xf ) + 'A' - 10 );
- else
- *pOut << (BYTE)( ( nVal & 0xf ) + '0' );
-
- nLen--;
- }
- }
- *pOut << (char)( ' ' );
- }
- pOut->WriteLine( aString );
- }
- }
- }
- else
- {
- ByteString aString( "Property" );
- aString.Append( ByteString::CreateFromInt32( i ) );
- aString.Append( ":" );
- aString.Append( ByteString::CreateFromInt32( GetPropertyValue( i ) ) );
- pOut->WriteLine( aString );
- }
- }
- }
-
- delete pOut;
- }
- }
-
-#endif
-
- rIn.Seek( nFilePos );
-}
-
-
-INT32 DffPropertyReader::Fix16ToAngle( INT32 nContent ) const
-{
- INT32 nAngle = 0;
- if ( nContent )
- {
- nAngle = ( (INT16)( nContent >> 16) * 100L ) + ( ( ( nContent & 0x0000ffff) * 100L ) >> 16 );
- nAngle = NormAngle360( -nAngle );
- }
- return nAngle;
-}
-
-DffPropertyReader::~DffPropertyReader()
-{
- delete pDefaultPropSet;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-SvStream& operator>>( SvStream& rIn, SvxMSDffConnectorRule& rRule )
-{
- rIn >> rRule.nRuleId
- >> rRule.nShapeA
- >> rRule.nShapeB
- >> rRule.nShapeC
- >> rRule.ncptiA
- >> rRule.ncptiB;
-
- return rIn;
-}
-
-SvxMSDffSolverContainer::SvxMSDffSolverContainer()
-{
-}
-
-SvxMSDffSolverContainer::~SvxMSDffSolverContainer()
-{
- for ( SvxMSDffConnectorRule* pPtr = (SvxMSDffConnectorRule*)aCList.First();
- pPtr; pPtr = (SvxMSDffConnectorRule*)aCList.Next() )
- delete pPtr;
-}
-
-SvStream& operator>>( SvStream& rIn, SvxMSDffSolverContainer& rContainer )
-{
- DffRecordHeader aHd;
- rIn >> aHd;
- if ( aHd.nRecType == DFF_msofbtSolverContainer )
- {
- DffRecordHeader aCRule;
- while ( ( rIn.GetError() == 0 ) && ( rIn.Tell() < aHd.GetRecEndFilePos() ) )
- {
- rIn >> aCRule;
- if ( aCRule.nRecType == DFF_msofbtConnectorRule )
- {
- SvxMSDffConnectorRule* pRule = new SvxMSDffConnectorRule;
- rIn >> *pRule;
- rContainer.aCList.Insert( pRule, LIST_APPEND );
- }
- aCRule.SeekToEndOfRecord( rIn );
- }
- }
- return rIn;
-}
-
-void SvxMSDffManager::SolveSolver( const SvxMSDffSolverContainer& rSolver )
-{
- sal_Int32 i, nCnt;
- for ( i = 0, nCnt = rSolver.aCList.Count(); i < nCnt; i++ )
- {
- SvxMSDffConnectorRule* pPtr = (SvxMSDffConnectorRule*)rSolver.aCList.GetObject( i );
- if ( pPtr->pCObj )
- {
- for ( int nN = 0; nN < 2; nN++ )
- {
- SdrObject* pO;
- sal_uInt32 nC, nSpFlags;
- sal_Bool bTail;
- if ( !nN )
- {
- bTail = sal_True;
- pO = pPtr->pAObj;
- nC = pPtr->ncptiA;
- nSpFlags = pPtr->nSpFlagsA;
- }
- else
- {
- bTail = sal_False;
- pO = pPtr->pBObj;
- nC = pPtr->ncptiB;
- nSpFlags = pPtr->nSpFlagsB;
- }
- if ( pO )
- {
- Any aAny;
- SdrGluePoint aGluePoint;
- Reference< XShape > aXShape( pO->getUnoShape(), UNO_QUERY );
- Reference< XShape > aXConnector( pPtr->pCObj->getUnoShape(), UNO_QUERY );
- SdrGluePointList* pList = pO->ForceGluePointList();
-
- sal_Bool bValidGluePoint = sal_False;
- sal_Int32 nId = nC;
- sal_uInt32 nInventor = pO->GetObjInventor();
-
- if( nInventor == SdrInventor )
- {
- sal_uInt32 nObjId = pO->GetObjIdentifier();
- switch( nObjId )
- {
- case OBJ_GRUP :
- case OBJ_GRAF :
- case OBJ_RECT :
- case OBJ_TEXT :
- case OBJ_PAGE :
- case OBJ_TEXTEXT :
- case OBJ_wegFITTEXT :
- case OBJ_wegFITALLTEXT :
- case OBJ_TITLETEXT :
- case OBJ_OUTLINETEXT :
- {
- if ( nC & 1 )
- {
- if ( nSpFlags & SP_FFLIPH )
- nC ^= 2; // 1 <-> 3
- }
- else
- {
- if ( nSpFlags & SP_FFLIPV )
- nC ^= 1; // 0 <-> 2
- }
- switch( nC )
- {
- case 0 :
- nId = 0; // SDRVERTALIGN_TOP;
- break;
- case 1 :
- nId = 3; // SDRHORZALIGN_RIGHT;
- break;
- case 2 :
- nId = 2; // SDRVERTALIGN_BOTTOM;
- break;
- case 3 :
- nId = 1; // SDRHORZALIGN_LEFT;
- break;
- }
- if ( nId <= 3 )
- bValidGluePoint = sal_True;
- }
- break;
- case OBJ_POLY :
- case OBJ_PLIN :
- case OBJ_LINE :
- case OBJ_PATHLINE :
- case OBJ_PATHFILL :
- case OBJ_FREELINE :
- case OBJ_FREEFILL :
- case OBJ_SPLNLINE :
- case OBJ_SPLNFILL :
- case OBJ_PATHPOLY :
- case OBJ_PATHPLIN :
- {
- if ( pList && ( pList->GetCount() > nC ) )
- {
- bValidGluePoint = sal_True;
- nId = (sal_Int32)((*pList)[ (sal_uInt16)nC].GetId() + 3 );
- }
- else
- {
- sal_Bool bNotFound = sal_True;
-
- PolyPolygon aPolyPoly( EscherPropertyContainer::GetPolyPolygon( aXShape ) );
- sal_uInt16 k, j, nPolySize = aPolyPoly.Count();
- if ( nPolySize )
- {
- sal_uInt32 nPointCount = 0;
- Rectangle aBoundRect( aPolyPoly.GetBoundRect() );
- if ( aBoundRect.GetWidth() && aBoundRect.GetHeight() )
- {
- for ( k = 0; bNotFound && ( k < nPolySize ); k++ )
- {
- const Polygon& rPolygon = aPolyPoly.GetObject( k );
- for ( j = 0; bNotFound && ( j < rPolygon.GetSize() ); j++ )
- {
- PolyFlags eFlags = rPolygon.GetFlags( j );
- if ( eFlags == POLY_NORMAL )
- {
- if ( nC == nPointCount )
- {
- const Point& rPoint = rPolygon.GetPoint( j );
- double fXRel = rPoint.X() - aBoundRect.Left();
- double fYRel = rPoint.Y() - aBoundRect.Top();
- sal_Int32 nWidth = aBoundRect.GetWidth();
- if ( !nWidth )
- nWidth = 1;
- sal_Int32 nHeight= aBoundRect.GetHeight();
- if ( !nHeight )
- nHeight = 1;
- fXRel /= (double)nWidth;
- fXRel *= 10000;
- fYRel /= (double)nHeight;
- fYRel *= 10000;
- aGluePoint.SetPos( Point( (sal_Int32)fXRel, (sal_Int32)fYRel ) );
- aGluePoint.SetPercent( sal_True );
- aGluePoint.SetAlign( SDRVERTALIGN_TOP | SDRHORZALIGN_LEFT );
- aGluePoint.SetEscDir( SDRESC_SMART );
- nId = (sal_Int32)((*pList)[ pList->Insert( aGluePoint ) ].GetId() + 3 );
- bNotFound = sal_False;
- }
- nPointCount++;
- }
- }
- }
- }
- }
- if ( !bNotFound )
- {
- bValidGluePoint = sal_True;
- }
- }
- }
- break;
-
- case OBJ_CUSTOMSHAPE :
- {
- SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)((SdrObjCustomShape*)pO)->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
- const rtl::OUString sPath( RTL_CONSTASCII_USTRINGPARAM ( "Path" ) );
- const rtl::OUString sGluePointType( RTL_CONSTASCII_USTRINGPARAM ( "GluePointType" ) );
- sal_Int16 nGluePointType = EnhancedCustomShapeGluePointType::SEGMENTS;
- com::sun::star::uno::Any* pAny = aGeometryItem.GetPropertyValueByName( sPath, sGluePointType );
- if ( pAny )
- *pAny >>= nGluePointType;
- else
- {
- const rtl::OUString sType( RTL_CONSTASCII_USTRINGPARAM ( "Type" ) );
- rtl::OUString sShapeType;
- pAny = aGeometryItem.GetPropertyValueByName( sType );
- if ( pAny )
- *pAny >>= sShapeType;
- MSO_SPT eSpType = EnhancedCustomShapeTypeNames::Get( sShapeType );
- nGluePointType = GetCustomShapeConnectionTypeDefault( eSpType );
- }
- if ( nGluePointType == EnhancedCustomShapeGluePointType::CUSTOM )
- {
- if ( pList && ( pList->GetCount() > nC ) )
- {
- bValidGluePoint = sal_True;
- nId = (sal_Int32)((*pList)[ (sal_uInt16)nC].GetId() + 3 );
- }
- }
- else if ( nGluePointType == EnhancedCustomShapeGluePointType::RECT )
- {
- if ( nC & 1 )
- {
- if ( nSpFlags & SP_FFLIPH )
- nC ^= 2; // 1 <-> 3
- }
- else
- {
- if ( nSpFlags & SP_FFLIPV )
- nC ^= 1; // 0 <-> 2
- }
- switch( nC )
- {
- case 0 :
- nId = 0; // SDRVERTALIGN_TOP;
- break;
- case 1 :
- nId = 3; // SDRHORZALIGN_RIGHT;
- break;
- case 2 :
- nId = 2; // SDRVERTALIGN_BOTTOM;
- break;
- case 3 :
- nId = 1; // SDRHORZALIGN_LEFT;
- break;
- }
- if ( nId <= 3 )
- bValidGluePoint = sal_True;
- }
- else if ( nGluePointType == EnhancedCustomShapeGluePointType::SEGMENTS )
- {
- const rtl::OUString sSegments( RTL_CONSTASCII_USTRINGPARAM ( "Segments" ) );
- const rtl::OUString sCoordinates( RTL_CONSTASCII_USTRINGPARAM ( "Coordinates" ) );
-
- sal_uInt32 k, nPt = nC;
- com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeSegment > aSegments;
- pAny = aGeometryItem.GetPropertyValueByName( sPath, sSegments );
- if ( pAny )
- {
- if ( *pAny >>= aSegments )
- {
- for ( nPt = 0, k = 1; nC && ( k < (sal_uInt32)aSegments.getLength() ); k++ )
- {
- sal_Int16 j, nCnt2 = aSegments[ k ].Count;
- if ( aSegments[ k ].Command != EnhancedCustomShapeSegmentCommand::UNKNOWN )
- {
- for ( j = 0; nC && ( j < nCnt2 ); j++ )
- {
- switch( aSegments[ k ].Command )
- {
- case EnhancedCustomShapeSegmentCommand::ENDSUBPATH :
- case EnhancedCustomShapeSegmentCommand::CLOSESUBPATH :
- case EnhancedCustomShapeSegmentCommand::LINETO :
- case EnhancedCustomShapeSegmentCommand::MOVETO :
- {
- nC--;
- nPt++;
- }
- break;
- case EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTX :
- case EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTY :
- break;
-
- case EnhancedCustomShapeSegmentCommand::CURVETO :
- {
- nC--;
- nPt += 3;
- }
- break;
-
- case EnhancedCustomShapeSegmentCommand::ANGLEELLIPSETO :
- case EnhancedCustomShapeSegmentCommand::ANGLEELLIPSE :
- {
- nC--;
- nPt += 3;
- }
- break;
- case EnhancedCustomShapeSegmentCommand::ARCTO :
- case EnhancedCustomShapeSegmentCommand::ARC :
- case EnhancedCustomShapeSegmentCommand::CLOCKWISEARCTO :
- case EnhancedCustomShapeSegmentCommand::CLOCKWISEARC :
- {
- nC--;
- nPt += 4;
- }
- break;
- }
- }
- }
- }
- }
- }
- pAny = aGeometryItem.GetPropertyValueByName( sPath, sCoordinates );
- if ( pAny )
- {
- com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aCoordinates;
- *pAny >>= aCoordinates;
- if ( nPt < (sal_uInt32)aCoordinates.getLength() )
- {
- nId = 4;
- com::sun::star::drawing::EnhancedCustomShapeParameterPair& rPara = aCoordinates[ nPt ];
- sal_Int32 nX = 0, nY = 0;
- if ( ( rPara.First.Value >>= nX ) && ( rPara.Second.Value >>= nY ) )
- {
- const rtl::OUString sGluePoints( RTL_CONSTASCII_USTRINGPARAM ( "GluePoints" ) );
- com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aGluePoints;
- pAny = aGeometryItem.GetPropertyValueByName( sPath, sGluePoints );
- if ( pAny )
- *pAny >>= aGluePoints;
- sal_Int32 nGluePoints = aGluePoints.getLength();
- aGluePoints.realloc( nGluePoints + 1 );
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aGluePoints[ nGluePoints ].First, nX );
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aGluePoints[ nGluePoints ].Second, nY );
- PropertyValue aProp;
- aProp.Name = sGluePoints;
- aProp.Value <<= aGluePoints;
- aGeometryItem.SetPropertyValue( sPath, aProp );
- bValidGluePoint = sal_True;
- ((SdrObjCustomShape*)pO)->SetMergedItem( aGeometryItem );
- SdrGluePointList* pLst = pO->ForceGluePointList();
- if ( pLst->GetCount() > nGluePoints )
- nId = (sal_Int32)((*pLst)[ (sal_uInt16)nGluePoints ].GetId() + 3 );
- }
- }
- }
- }
- }
- break;
- }
- if ( bValidGluePoint )
- {
- Reference< XPropertySet > xPropSet( aXConnector, UNO_QUERY );
- if ( xPropSet.is() )
- {
- if ( nN )
- {
- String aPropName( RTL_CONSTASCII_USTRINGPARAM( "EndShape" ) );
- aAny <<= aXShape;
- SetPropValue( aAny, xPropSet, aPropName, sal_True );
- aPropName = String( RTL_CONSTASCII_USTRINGPARAM( "EndGluePointIndex" ) );
- aAny <<= nId;
- SetPropValue( aAny, xPropSet, aPropName, sal_True );
- }
- else
- {
- String aPropName( RTL_CONSTASCII_USTRINGPARAM( "StartShape" ) );
- aAny <<= aXShape;
- SetPropValue( aAny, xPropSet, aPropName, sal_True );
- aPropName = String( RTL_CONSTASCII_USTRINGPARAM( "StartGluePointIndex" ) );
- aAny <<= nId;
- SetPropValue( aAny, xPropSet, aPropName, sal_True );
- }
-
- // Not sure what this is good for, repaint or broadcast of object change.
- //( Thus i am adding repaint here
- pO->SetChanged();
- pO->BroadcastObjectChange();
- }
- }
- }
- }
- }
- }
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-static basegfx::B2DPolygon GetLineArrow( const sal_Int32 nLineWidth, const MSO_LineEnd eLineEnd,
- const MSO_LineEndWidth eLineWidth, const MSO_LineEndLength eLineLenght,
- sal_Int32& rnArrowWidth, sal_Bool& rbArrowCenter,
- String& rsArrowName, sal_Bool bScaleArrow )
-{
- basegfx::B2DPolygon aRetval;
- double fLineWidth = nLineWidth < 70 ? 70.0 : nLineWidth;
- double fLenghtMul, fWidthMul;
- sal_Int32 nLineNumber;
- switch( eLineLenght )
- {
- default :
- case mso_lineMediumLenArrow : fLenghtMul = 3.0; nLineNumber = 2; break;
- case mso_lineShortArrow : fLenghtMul = 2.0; nLineNumber = 1; break;
- case mso_lineLongArrow : fLenghtMul = 5.0; nLineNumber = 3; break;
- }
- switch( eLineWidth )
- {
- default :
- case mso_lineMediumWidthArrow : fWidthMul = 3.0; nLineNumber += 3; break;
- case mso_lineNarrowArrow : fWidthMul = 2.0; break;
- case mso_lineWideArrow : fWidthMul = 5.0; nLineNumber += 6; break;
- }
-
- if ( bScaleArrow ) // #i33630 arrows imported from Word are too big
- {
- fWidthMul /= 1.75;
- fLenghtMul/= 1.75;
- }
-
- rbArrowCenter = sal_False;
- switch ( eLineEnd )
- {
- case mso_lineArrowEnd :
- {
- basegfx::B2DPolygon aTriangle;
- aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50, 0.0 ));
- aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth, fLenghtMul * fLineWidth ));
- aTriangle.append(basegfx::B2DPoint( 0.0, fLenghtMul * fLineWidth ));
- aTriangle.setClosed(true);
- aRetval = aTriangle;
- rsArrowName = String( RTL_CONSTASCII_STRINGPARAM( "msArrowEnd " ), RTL_TEXTENCODING_UTF8 );
- }
- break;
-
- case mso_lineArrowOpenEnd :
- {
- switch( eLineLenght )
- {
- default :
- case mso_lineMediumLenArrow : fLenghtMul = 4.5; break;
- case mso_lineShortArrow : fLenghtMul = 3.5; break;
- case mso_lineLongArrow : fLenghtMul = 6.0; break;
- }
- switch( eLineWidth )
- {
- default :
- case mso_lineMediumWidthArrow : fWidthMul = 4.5; break;
- case mso_lineNarrowArrow : fWidthMul = 3.5; break;
- case mso_lineWideArrow : fWidthMul = 6.0; break;
- }
- basegfx::B2DPolygon aTriangle;
- aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50 , 0.0 ));
- aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth, fLenghtMul * fLineWidth * 0.91 ));
- aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.85, fLenghtMul * fLineWidth ));
- aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50, fLenghtMul * fLineWidth * 0.36 ));
- aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.15, fLenghtMul * fLineWidth ));
- aTriangle.append(basegfx::B2DPoint( 0.0, fLenghtMul * fLineWidth * 0.91 ));
- aTriangle.setClosed(true);
- aRetval = aTriangle;
- rsArrowName = String( RTL_CONSTASCII_STRINGPARAM( "msArrowOpenEnd " ), RTL_TEXTENCODING_UTF8 );
- }
- break;
- case mso_lineArrowStealthEnd :
- {
- basegfx::B2DPolygon aTriangle;
- aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50 , 0.0 ));
- aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth , fLenghtMul * fLineWidth ));
- aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50 , fLenghtMul * fLineWidth * 0.60 ));
- aTriangle.append(basegfx::B2DPoint( 0.0, fLenghtMul * fLineWidth ));
- aTriangle.setClosed(true);
- aRetval = aTriangle;
- rsArrowName = String( RTL_CONSTASCII_STRINGPARAM( "msArrowStealthEnd " ), RTL_TEXTENCODING_UTF8 );
- }
- break;
- case mso_lineArrowDiamondEnd :
- {
- basegfx::B2DPolygon aTriangle;
- aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50 , 0.0 ));
- aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth , fLenghtMul * fLineWidth * 0.50 ));
- aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50 , fLenghtMul * fLineWidth ));
- aTriangle.append(basegfx::B2DPoint( 0.0, fLenghtMul * fLineWidth * 0.50 ));
- aTriangle.setClosed(true);
- aRetval = aTriangle;
- rbArrowCenter = sal_True;
- rsArrowName = String( RTL_CONSTASCII_STRINGPARAM( "msArrowDiamondEnd " ), RTL_TEXTENCODING_UTF8 );
- }
- break;
- case mso_lineArrowOvalEnd :
- {
- aRetval = XPolygon( Point( (sal_Int32)( fWidthMul * fLineWidth * 0.50 ), 0 ),
- (sal_Int32)( fWidthMul * fLineWidth * 0.50 ),
- (sal_Int32)( fLenghtMul * fLineWidth * 0.50 ), 0, 3600 ).getB2DPolygon();
- rbArrowCenter = sal_True;
- rsArrowName = String( RTL_CONSTASCII_STRINGPARAM( "msArrowOvalEnd " ), RTL_TEXTENCODING_UTF8 );
- }
- break;
- default: break;
- }
- rsArrowName.Append( String::CreateFromInt32( nLineNumber ) );
- rnArrowWidth = (sal_Int32)( fLineWidth * fWidthMul );
-
- return aRetval;
-}
-
-void DffPropertyReader::ApplyLineAttributes( SfxItemSet& rSet, const MSO_SPT eShapeType ) const // #i28269#
-{
- UINT32 nLineFlags(GetPropertyValue( DFF_Prop_fNoLineDrawDash ));
-
- if(!IsHardAttribute( DFF_Prop_fLine ) && !IsCustomShapeStrokedByDefault( eShapeType ))
- {
- nLineFlags &= ~0x08;
- }
-
- if ( nLineFlags & 8 )
- {
- // Linienattribute
- sal_Int32 nLineWidth = (INT32)GetPropertyValue( DFF_Prop_lineWidth, 9525 );
-
- MSO_LineDashing eLineDashing = (MSO_LineDashing)GetPropertyValue( DFF_Prop_lineDashing, mso_lineSolid );
- if ( eLineDashing == mso_lineSolid )
- rSet.Put(XLineStyleItem( XLINE_SOLID ) );
- else
- {
-// MSO_LineCap eLineCap = (MSO_LineCap)GetPropertyValue( DFF_Prop_lineEndCapStyle, mso_lineEndCapSquare );
-
- XDashStyle eDash = XDASH_RECT;
- sal_uInt16 nDots = 1;
- sal_uInt32 nDotLen = nLineWidth / 360;
- sal_uInt16 nDashes = 0;
- sal_uInt32 nDashLen = ( 8 * nLineWidth ) / 360;
- sal_uInt32 nDistance = ( 3 * nLineWidth ) / 360;;
-
- switch ( eLineDashing )
- {
- default:
- case mso_lineDotSys :
- {
- nDots = 1;
- nDashes = 0;
- nDistance = nDotLen;
- }
- break;
-
- case mso_lineDashGEL :
- {
- nDots = 0;
- nDashes = 1;
- nDashLen = ( 4 * nLineWidth ) / 360;
- }
- break;
-
- case mso_lineDashDotGEL :
- {
- nDots = 1;
- nDashes = 1;
- nDashLen = ( 4 * nLineWidth ) / 360;
- }
- break;
-
- case mso_lineLongDashGEL :
- {
- nDots = 0;
- nDashes = 1;
- }
- break;
-
- case mso_lineLongDashDotGEL :
- {
- nDots = 1;
- nDashes = 1;
- }
- break;
-
- case mso_lineLongDashDotDotGEL:
- {
- nDots = 2;
- nDashes = 1;
- }
- break;
- }
-
- rSet.Put( XLineDashItem( String(), XDash( eDash, nDots, nDotLen, nDashes, nDashLen, nDistance ) ) );
- rSet.Put( XLineStyleItem( XLINE_DASH ) );
- }
- rSet.Put( XLineColorItem( String(), rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_lineColor ), DFF_Prop_lineColor ) ) );
- if ( IsProperty( DFF_Prop_lineOpacity ) )
- {
- double nTrans = GetPropertyValue(DFF_Prop_lineOpacity, 0x10000);
- nTrans = (nTrans * 100) / 65536;
- rSet.Put(XLineTransparenceItem(
- sal_uInt16(100 - ::rtl::math::round(nTrans))));
- }
-
- rManager.ScaleEmu( nLineWidth );
- rSet.Put( XLineWidthItem( nLineWidth ) );
-
- // SJ: LineJoint (setting each time a line is set, because our internal joint type has another default)
- MSO_LineJoin eLineJointDefault = mso_lineJoinMiter;
- if ( eShapeType == mso_sptMin )
- eLineJointDefault = mso_lineJoinRound;
- MSO_LineJoin eLineJoint = (MSO_LineJoin)GetPropertyValue( DFF_Prop_lineJoinStyle, eLineJointDefault );
- XLineJoint eXLineJoint( XLINEJOINT_MITER );
- if ( eLineJoint == mso_lineJoinBevel )
- eXLineJoint = XLINEJOINT_BEVEL;
- else if ( eLineJoint == mso_lineJoinRound )
- eXLineJoint = XLINEJOINT_ROUND;
- rSet.Put( XLineJointItem( eXLineJoint ) );
-
- if ( nLineFlags & 0x10 )
- {
- sal_Bool bScaleArrows = rManager.pSdrModel->GetScaleUnit() == MAP_TWIP;
- ///////////////
- // LineStart //
- ///////////////
- if ( IsProperty( DFF_Prop_lineStartArrowhead ) )
- {
- MSO_LineEnd eLineEnd = (MSO_LineEnd)GetPropertyValue( DFF_Prop_lineStartArrowhead );
- MSO_LineEndWidth eWidth = (MSO_LineEndWidth)GetPropertyValue( DFF_Prop_lineStartArrowWidth, mso_lineMediumWidthArrow );
- MSO_LineEndLength eLenght = (MSO_LineEndLength)GetPropertyValue( DFF_Prop_lineStartArrowLength, mso_lineMediumLenArrow );
-
- sal_Int32 nArrowWidth;
- sal_Bool bArrowCenter;
- String aArrowName;
- basegfx::B2DPolygon aPoly(GetLineArrow( nLineWidth, eLineEnd, eWidth, eLenght, nArrowWidth, bArrowCenter, aArrowName, bScaleArrows ));
-
- rSet.Put( XLineStartWidthItem( nArrowWidth ) );
- rSet.Put( XLineStartItem( aArrowName, basegfx::B2DPolyPolygon(aPoly) ) );
- rSet.Put( XLineStartCenterItem( bArrowCenter ) );
- }
- /////////////
- // LineEnd //
- /////////////
- if ( IsProperty( DFF_Prop_lineEndArrowhead ) )
- {
- MSO_LineEnd eLineEnd = (MSO_LineEnd)GetPropertyValue( DFF_Prop_lineEndArrowhead );
- MSO_LineEndWidth eWidth = (MSO_LineEndWidth)GetPropertyValue( DFF_Prop_lineEndArrowWidth, mso_lineMediumWidthArrow );
- MSO_LineEndLength eLenght = (MSO_LineEndLength)GetPropertyValue( DFF_Prop_lineEndArrowLength, mso_lineMediumLenArrow );
-
- sal_Int32 nArrowWidth;
- sal_Bool bArrowCenter;
- String aArrowName;
- basegfx::B2DPolygon aPoly(GetLineArrow( nLineWidth, eLineEnd, eWidth, eLenght, nArrowWidth, bArrowCenter, aArrowName, bScaleArrows ));
-
- rSet.Put( XLineEndWidthItem( nArrowWidth ) );
- rSet.Put( XLineEndItem( aArrowName, basegfx::B2DPolyPolygon(aPoly) ) );
- rSet.Put( XLineEndCenterItem( bArrowCenter ) );
- }
- if ( IsProperty( DFF_Prop_lineEndCapStyle ) )
- {
- MSO_LineCap eLineCap = (MSO_LineCap)GetPropertyValue( DFF_Prop_lineEndCapStyle );
- const SfxPoolItem* pPoolItem = NULL;
- if ( rSet.GetItemState( XATTR_LINEDASH, FALSE, &pPoolItem ) == SFX_ITEM_SET )
- {
- XDashStyle eNewStyle = XDASH_RECT;
- if ( eLineCap == mso_lineEndCapRound )
- eNewStyle = XDASH_ROUND;
- const XDash& rOldDash = ( (const XLineDashItem*)pPoolItem )->GetDashValue();
- if ( rOldDash.GetDashStyle() != eNewStyle )
- {
- XDash aNew( rOldDash );
- aNew.SetDashStyle( eNewStyle );
- rSet.Put( XLineDashItem( XubString(), aNew ) );
- }
- }
- }
- }
- }
- else
- rSet.Put( XLineStyleItem( XLINE_NONE ) );
-}
-
-
-void DffPropertyReader::ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, const MSO_SPT eShapeType ) const
-{
- UINT32 nFillFlags(GetPropertyValue( DFF_Prop_fNoFillHitTest ));
-
- if(!IsHardAttribute( DFF_Prop_fFilled ) && !IsCustomShapeFilledByDefault( eShapeType ))
- {
- nFillFlags &= ~0x10;
- }
-
- if ( nFillFlags & 0x10 )
- {
- MSO_FillType eMSO_FillType = (MSO_FillType)GetPropertyValue( DFF_Prop_fillType, mso_fillSolid );
- XFillStyle eXFill = XFILL_NONE;
- switch( eMSO_FillType )
- {
- case mso_fillSolid : // Fill with a solid color
- eXFill = XFILL_SOLID;
- break;
- case mso_fillPattern : // Fill with a pattern (bitmap)
- case mso_fillTexture : // A texture (pattern with its own color map)
- case mso_fillPicture : // Center a picture in the shape
- eXFill = XFILL_BITMAP;
- break;
- case mso_fillShadeShape : // Shade from shape outline to end point
- case mso_fillShade : // Shade from start to end points
- case mso_fillShadeCenter : // Shade from bounding rectangle to end point
- case mso_fillShadeScale : // Similar to mso_fillShade, but the fillAngle
- case mso_fillShadeTitle : // special type - shade to title --- for PP
- eXFill = XFILL_GRADIENT;
- break;
-// case mso_fillBackground : // Use the background fill color/pattern
- default: break;
- }
- rSet.Put( XFillStyleItem( eXFill ) );
-
- if (IsProperty(DFF_Prop_fillOpacity))
- {
- double nTrans = GetPropertyValue(DFF_Prop_fillOpacity);
- nTrans = (nTrans * 100) / 65536;
- rSet.Put(XFillTransparenceItem(
- sal_uInt16(100 - ::rtl::math::round(nTrans))));
- }
-
- if ( eXFill == XFILL_GRADIENT )
- {
- sal_Int32 nAngle = 3600 - ( ( Fix16ToAngle( GetPropertyValue( DFF_Prop_fillAngle, 0 ) ) + 5 ) / 10 );
-
- // Rotationswinkel in Bereich zwingen
- while ( nAngle >= 3600 )
- nAngle -= 3600;
- while ( nAngle < 0 )
- nAngle += 3600;
-
- sal_Int32 nFocus = GetPropertyValue( DFF_Prop_fillFocus, 0 );
- XGradientStyle eGrad = XGRAD_LINEAR;
- sal_Int32 nChgColors = 0;
-
- if ( !nAngle )
- nChgColors ^= 1;
-
- if ( !nFocus )
- nChgColors ^= 1;
- else if ( nFocus < 0 ) // Bei negativem Focus sind die Farben zu tauschen
- {
- nFocus =- nFocus;
- nChgColors ^= 1;
- }
- if( nFocus > 40 && nFocus < 60 )
- {
- eGrad = XGRAD_AXIAL; // Besser gehts leider nicht
- nChgColors ^= 1;
- }
- USHORT nFocusX = (USHORT)nFocus;
- USHORT nFocusY = (USHORT)nFocus;
-
- switch( eMSO_FillType )
- {
- case mso_fillShadeShape :
- {
- eGrad = XGRAD_RECT;
- nFocusY = nFocusX = 50;
- nChgColors ^= 1;
- }
- break;
- case mso_fillShadeCenter :
- {
- eGrad = XGRAD_RECT;
- nFocusX = ( IsProperty( DFF_Prop_fillToRight ) ) ? 100 : 0;
- nFocusY = ( IsProperty( DFF_Prop_fillToBottom ) ) ? 100 : 0;
- nChgColors ^= 1;
- }
- break;
- default: break;
- }
- Color aCol1( rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillColor, COL_WHITE ), DFF_Prop_fillColor ) );
- Color aCol2( rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillBackColor, COL_WHITE ), DFF_Prop_fillBackColor ) );
-
- if ( nChgColors )
- {
- Color aZwi( aCol1 );
- aCol1 = aCol2;
- aCol2 = aZwi;
- }
- if ( ( eShapeType == mso_sptEllipse ) && ( eMSO_FillType == mso_fillShadeShape ) )
- eGrad = XGRAD_ELLIPTICAL;
-
- XGradient aGrad( aCol2, aCol1, eGrad, nAngle, nFocusX, nFocusY );
- aGrad.SetStartIntens( 100 );
- aGrad.SetEndIntens( 100 );
- rSet.Put( XFillGradientItem( String(), aGrad ) );
- }
- else if ( eXFill == XFILL_BITMAP )
- {
- if( IsProperty( DFF_Prop_fillBlip ) )
- {
- Graphic aGraf;
- // first try to get BLIP from cache
- BOOL bOK = rManager.GetBLIP( GetPropertyValue( DFF_Prop_fillBlip ), aGraf, NULL );
- // then try directly from stream (i.e. Excel chart hatches/bitmaps)
- if ( !bOK )
- bOK = SeekToContent( DFF_Prop_fillBlip, rIn ) && rManager.GetBLIPDirect( rIn, aGraf, NULL );
- if ( bOK )
- {
- Bitmap aBmp( aGraf.GetBitmap() );
-
- if ( eMSO_FillType == mso_fillPattern )
- {
- Color aCol1( COL_WHITE ), aCol2( COL_WHITE );
- if ( IsProperty( DFF_Prop_fillColor ) )
- aCol1 = rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillColor ), DFF_Prop_fillColor );
- if ( IsProperty( DFF_Prop_fillBackColor ) )
- aCol2 = rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillBackColor ), DFF_Prop_fillBackColor );
-
- XOBitmap aXOBitmap;
-
- // Bitmap einsetzen
- aXOBitmap.SetBitmap( aBmp );
- aXOBitmap.SetBitmapType( XBITMAP_IMPORT );
-
- if( aBmp.GetSizePixel().Width() == 8 && aBmp.GetSizePixel().Height() == 8 && aBmp.GetColorCount() == 2)
- {
- aXOBitmap.Bitmap2Array();
- aXOBitmap.SetBitmapType( XBITMAP_8X8 );
- aXOBitmap.SetPixelSize( aBmp.GetSizePixel() );
-
- if( aXOBitmap.GetBackgroundColor() == COL_BLACK )
- {
- aXOBitmap.SetPixelColor( aCol1 );
- aXOBitmap.SetBackgroundColor( aCol2 );
- }
- else
- {
- aXOBitmap.SetPixelColor( aCol2 );
- aXOBitmap.SetBackgroundColor( aCol1 );
- }
- }
- rSet.Put( XFillBitmapItem( String(), aXOBitmap ) );
- }
- else if ( eMSO_FillType == mso_fillTexture )
- {
- XOBitmap aXBmp( aBmp, XBITMAP_STRETCH );
- rSet.Put( XFillBmpTileItem( sal_True ) );
- rSet.Put( XFillBitmapItem( String(), aXBmp ) );
- rSet.Put( XFillBmpSizeXItem( GetPropertyValue( DFF_Prop_fillWidth, 0 ) / 360 ) );
- rSet.Put( XFillBmpSizeYItem( GetPropertyValue( DFF_Prop_fillHeight, 0 ) / 360 ) );
- rSet.Put( XFillBmpSizeLogItem( sal_True ) );
- }
- else
- {
- XOBitmap aXBmp( aBmp, XBITMAP_STRETCH );
- rSet.Put( XFillBitmapItem( String(), aXBmp ) );
- rSet.Put( XFillBmpTileItem( sal_False ) );
- }
- }
- }
- }
- }
- else
- rSet.Put( XFillStyleItem( XFILL_NONE ) );
-}
-
-void DffPropertyReader::ApplyCustomShapeTextAttributes( SfxItemSet& rSet ) const
-{
-// sal_uInt32 nTextFlags = aTextObj.GetTextFlags();
- sal_Bool bVerticalText = sal_False;
- sal_Int32 nTextLeft = GetPropertyValue( DFF_Prop_dxTextLeft, 25 * 3600 ) / 360; // 0.25 cm (emu)
- sal_Int32 nTextRight = GetPropertyValue( DFF_Prop_dxTextRight, 25 * 3600 ) / 360; // 0.25 cm (emu)
- sal_Int32 nTextTop = GetPropertyValue( DFF_Prop_dyTextTop, 13 * 3600 ) / 360; // 0.13 cm (emu)
- sal_Int32 nTextBottom = GetPropertyValue( DFF_Prop_dyTextBottom, 13 * 3600 ) /360; // 0.13 cm (emu)
-
- SdrTextVertAdjust eTVA;
- SdrTextHorzAdjust eTHA;
-
- if ( IsProperty( DFF_Prop_txflTextFlow ) )
- {
- MSO_TextFlow eTextFlow = (MSO_TextFlow)( GetPropertyValue( DFF_Prop_txflTextFlow ) & 0xFFFF );
- switch( eTextFlow )
- {
- case mso_txflTtoBA : /* #68110# */ // Top to Bottom @-font, oben -> unten
- case mso_txflTtoBN : // Top to Bottom non-@, oben -> unten
- case mso_txflVertN : // Vertical, non-@, oben -> unten
- bVerticalText = sal_True; // nTextRotationAngle += 27000;
- break;
- default: break;
- }
- }
- sal_Int32 nFontDirection = GetPropertyValue( DFF_Prop_cdirFont, mso_cdir0 );
- if ( ( nFontDirection == 1 ) || ( nFontDirection == 3 ) )
- bVerticalText = !bVerticalText;
-
- if ( bVerticalText )
- {
- eTVA = SDRTEXTVERTADJUST_BLOCK;
- eTHA = SDRTEXTHORZADJUST_CENTER;
-
- // Textverankerung lesen
- MSO_Anchor eTextAnchor = (MSO_Anchor)GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop );
-
- switch( eTextAnchor )
- {
- case mso_anchorTop:
- case mso_anchorTopCentered:
- case mso_anchorTopBaseline:
- case mso_anchorTopCenteredBaseline:
- eTHA = SDRTEXTHORZADJUST_RIGHT;
- break;
-
- case mso_anchorMiddle :
- case mso_anchorMiddleCentered:
- eTHA = SDRTEXTHORZADJUST_CENTER;
- break;
-
- case mso_anchorBottom:
- case mso_anchorBottomCentered:
- case mso_anchorBottomBaseline:
- case mso_anchorBottomCenteredBaseline:
- eTHA = SDRTEXTHORZADJUST_LEFT;
- break;
- }
- // if there is a 100% use of following attributes, the textbox can been aligned also in vertical direction
- switch ( eTextAnchor )
- {
- case mso_anchorTopCentered :
- case mso_anchorMiddleCentered :
- case mso_anchorBottomCentered :
- case mso_anchorTopCenteredBaseline:
- case mso_anchorBottomCenteredBaseline:
- eTVA = SDRTEXTVERTADJUST_CENTER;
- break;
-
- default :
- eTVA = SDRTEXTVERTADJUST_TOP;
- break;
- }
- }
- else
- {
- eTVA = SDRTEXTVERTADJUST_CENTER;
- eTHA = SDRTEXTHORZADJUST_BLOCK;
-
- // Textverankerung lesen
- MSO_Anchor eTextAnchor = (MSO_Anchor)GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop );
-
- switch( eTextAnchor )
- {
- case mso_anchorTop:
- case mso_anchorTopCentered:
- case mso_anchorTopBaseline:
- case mso_anchorTopCenteredBaseline:
- eTVA = SDRTEXTVERTADJUST_TOP;
- break;
-
- case mso_anchorMiddle :
- case mso_anchorMiddleCentered:
- eTVA = SDRTEXTVERTADJUST_CENTER;
- break;
-
- case mso_anchorBottom:
- case mso_anchorBottomCentered:
- case mso_anchorBottomBaseline:
- case mso_anchorBottomCenteredBaseline:
- eTVA = SDRTEXTVERTADJUST_BOTTOM;
- break;
- }
- // if there is a 100% usage of following attributes, the textbox can be aligned also in horizontal direction
- switch ( eTextAnchor )
- {
- case mso_anchorTopCentered :
- case mso_anchorMiddleCentered :
- case mso_anchorBottomCentered :
- case mso_anchorTopCenteredBaseline:
- case mso_anchorBottomCenteredBaseline:
- eTHA = SDRTEXTHORZADJUST_CENTER; // the text has to be displayed using the full width;
- break;
-
- default :
- eTHA = SDRTEXTHORZADJUST_LEFT;
- break;
- }
- }
- rSet.Put( SvxFrameDirectionItem( bVerticalText ? FRMDIR_VERT_TOP_RIGHT : FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ) );
-
- rSet.Put( SdrTextVertAdjustItem( eTVA ) );
- rSet.Put( SdrTextHorzAdjustItem( eTHA ) );
-
- rSet.Put( SdrTextLeftDistItem( nTextLeft ) );
- rSet.Put( SdrTextRightDistItem( nTextRight ) );
- rSet.Put( SdrTextUpperDistItem( nTextTop ) );
- rSet.Put( SdrTextLowerDistItem( nTextBottom ) );
-
- rSet.Put( SdrTextWordWrapItem( (MSO_WrapMode)GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare ) != mso_wrapNone ? sal_True : sal_False ) );
- rSet.Put( SdrTextAutoGrowHeightItem( ( GetPropertyValue( DFF_Prop_FitTextToShape ) & 2 ) != 0 ) );
-
-// rSet.Put( SdrTextAutoGrowWidthItem( (MSO_WrapMode)GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare ) != mso_wrapNone ? sal_False : sal_True ) );
-// rSet.Put( SdrTextAutoGrowHeightItem( ( GetPropertyValue( DFF_Prop_FitTextToShape ) & 2 ) != 0 ) );
-}
-
-void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxItemSet& rSet, const MSO_SPT eShapeType, const sal_uInt32 /* nShapeFlags */ ) const
-{
-
- sal_uInt32 nAdjustmentsWhichNeedsToBeConverted = 0;
-
- ///////////////////////////////////////
- // creating SdrCustomShapeGeometryItem //
- ///////////////////////////////////////
- typedef uno::Sequence< beans::PropertyValue > PropSeq;
- typedef std::vector< beans::PropertyValue > PropVec;
- typedef PropVec::iterator PropVecIter;
- PropVecIter aIter;
- PropVecIter aEnd;
-
-
- // aPropVec will be filled with all PropertyValues
- PropVec aPropVec;
- PropertyValue aProp;
-
- /////////////////////////////////////////////////////////////////////
- // "Type" property, including the predefined CustomShape type name //
- /////////////////////////////////////////////////////////////////////
- const rtl::OUString sType( RTL_CONSTASCII_USTRINGPARAM ( "Type" ) );
- aProp.Name = sType;
- aProp.Value <<= EnhancedCustomShapeTypeNames::Get( eShapeType );
- aPropVec.push_back( aProp );
-
-/*
- /////////////////
- // "MirroredX" //
- /////////////////
- if ( nShapeFlags & SP_FFLIPH )
- {
- const rtl::OUString sMirroredX( RTL_CONSTASCII_USTRINGPARAM ( "MirroredX" ) );
- sal_Bool bMirroredX = sal_True;
- aProp.Name = sMirroredX;
- aProp.Value <<= bMirroredX;
- aPropVec.push_back( aProp );
- }
- /////////////////
- // "MirroredY" //
- /////////////////
- if ( nShapeFlags & SP_FFLIPV )
- {
- const rtl::OUString sMirroredY( RTL_CONSTASCII_USTRINGPARAM ( "MirroredY" ) );
- sal_Bool bMirroredY = sal_True;
- aProp.Name = sMirroredY;
- aProp.Value <<= bMirroredY;
- aPropVec.push_back( aProp );
- }
-*/
- ///////////////
- // "ViewBox" //
- ///////////////
-
- sal_Int32 nCoordWidth = 21600; // needed to replace handle type center with absolute value
- sal_Int32 nCoordHeight= 21600;
- if ( IsProperty( DFF_Prop_geoLeft ) || IsProperty( DFF_Prop_geoTop ) || IsProperty( DFF_Prop_geoRight ) || IsProperty( DFF_Prop_geoBottom ) )
- {
- com::sun::star::awt::Rectangle aViewBox;
- const rtl::OUString sViewBox( RTL_CONSTASCII_USTRINGPARAM ( "ViewBox" ) );
- aViewBox.X = GetPropertyValue( DFF_Prop_geoLeft, 0 );
- aViewBox.Y = GetPropertyValue( DFF_Prop_geoTop, 0 );
- aViewBox.Width = nCoordWidth = ((sal_Int32)GetPropertyValue( DFF_Prop_geoRight, 21600 ) ) - aViewBox.X;
- aViewBox.Height = nCoordHeight = ((sal_Int32)GetPropertyValue( DFF_Prop_geoBottom, 21600 ) ) - aViewBox.Y;
- aProp.Name = sViewBox;
- aProp.Value <<= aViewBox;
- aPropVec.push_back( aProp );
- }
- /////////////////////
- // TextRotateAngle //
- /////////////////////
- if ( IsProperty( DFF_Prop_txflTextFlow ) || IsProperty( DFF_Prop_cdirFont ) )
- {
- sal_Int32 nTextRotateAngle = 0;
- MSO_TextFlow eTextFlow = (MSO_TextFlow)( GetPropertyValue( DFF_Prop_txflTextFlow ) & 0xFFFF );
-/* sal_Int32 nFontDirection = GetPropertyValue( DFF_Prop_cdirFont, mso_cdir0 ); */
-
- if ( eTextFlow == mso_txflBtoT ) // Bottom to Top non-@, unten -> oben
- nTextRotateAngle += 90;
- switch( GetPropertyValue( DFF_Prop_cdirFont, mso_cdir0 ) ) // SJ: mso_cdir90 and mso_cdir270 will be simulated by
- { // activating vertical writing for the text objects
- case mso_cdir90 :
- {
- if ( eTextFlow == mso_txflTtoBA )
- nTextRotateAngle -= 180;
- }
- break;
- case mso_cdir180: nTextRotateAngle -= 180; break;
- case mso_cdir270:
- {
- if ( eTextFlow != mso_txflTtoBA )
- nTextRotateAngle -= 180;
- }
- break;
- default: break;
- }
- if ( nTextRotateAngle )
- {
- double fTextRotateAngle = nTextRotateAngle;
- const rtl::OUString sTextRotateAngle( RTL_CONSTASCII_USTRINGPARAM ( "TextRotateAngle" ) );
- aProp.Name = sTextRotateAngle;
- aProp.Value <<= fTextRotateAngle;
- aPropVec.push_back( aProp );
- }
- }
- //////////////////////////////////////////
- // "Extrusion" PropertySequence element //
- //////////////////////////////////////////
- sal_Bool bExtrusionOn = ( GetPropertyValue( DFF_Prop_fc3DLightFace ) & 8 ) != 0;
- if ( bExtrusionOn )
- {
- PropVec aExtrusionPropVec;
-
- // "Extrusion"
- const rtl::OUString sExtrusionOn( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
- aProp.Name = sExtrusionOn;
- aProp.Value <<= bExtrusionOn;
- aExtrusionPropVec.push_back( aProp );
-
- // "Brightness"
- if ( IsProperty( DFF_Prop_c3DAmbientIntensity ) )
- {
- const rtl::OUString sExtrusionBrightness( RTL_CONSTASCII_USTRINGPARAM ( "Brightness" ) );
- double fBrightness = (sal_Int32)GetPropertyValue( DFF_Prop_c3DAmbientIntensity );
- fBrightness /= 655.36;
- aProp.Name = sExtrusionBrightness;
- aProp.Value <<= fBrightness;
- aExtrusionPropVec.push_back( aProp );
- }
- // "Depth" in 1/100mm
- if ( IsProperty( DFF_Prop_c3DExtrudeBackward ) || IsProperty( DFF_Prop_c3DExtrudeForward ) )
- {
- const rtl::OUString sDepth( RTL_CONSTASCII_USTRINGPARAM ( "Depth" ) );
- double fBackDepth = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DExtrudeBackward, 1270 * 360 )) / 360.0;
- double fForeDepth = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DExtrudeForward ), 0 ) / 360.0;
- double fDepth = fBackDepth + fForeDepth;
- double fFraction = fDepth != 0.0 ? fForeDepth / fDepth : 0;
- EnhancedCustomShapeParameterPair aDepthParaPair;
- aDepthParaPair.First.Value <<= fDepth;
- aDepthParaPair.First.Type = EnhancedCustomShapeParameterType::NORMAL;
- aDepthParaPair.Second.Value <<= fFraction;
- aDepthParaPair.Second.Type = EnhancedCustomShapeParameterType::NORMAL;
- aProp.Name = sDepth;
- aProp.Value <<= aDepthParaPair;
- aExtrusionPropVec.push_back( aProp );
- }
- // "Diffusion"
- if ( IsProperty( DFF_Prop_c3DDiffuseAmt ) )
- {
- const rtl::OUString sExtrusionDiffusion( RTL_CONSTASCII_USTRINGPARAM ( "Diffusion" ) );
- double fDiffusion = (sal_Int32)GetPropertyValue( DFF_Prop_c3DDiffuseAmt );
- fDiffusion /= 655.36;
- aProp.Name = sExtrusionDiffusion;
- aProp.Value <<= fDiffusion;
- aExtrusionPropVec.push_back( aProp );
- }
- // "NumberOfLineSegments"
- if ( IsProperty( DFF_Prop_c3DTolerance ) )
- {
- const rtl::OUString sExtrusionNumberOfLineSegments( RTL_CONSTASCII_USTRINGPARAM ( "NumberOfLineSegments" ) );
- aProp.Name = sExtrusionNumberOfLineSegments;
- aProp.Value <<= (sal_Int32)GetPropertyValue( DFF_Prop_c3DTolerance );
- aExtrusionPropVec.push_back( aProp );
- }
- // "LightFace"
- const rtl::OUString sExtrusionLightFace( RTL_CONSTASCII_USTRINGPARAM ( "LightFace" ) );
- sal_Bool bExtrusionLightFace = ( GetPropertyValue( DFF_Prop_fc3DLightFace ) & 1 ) != 0;
- aProp.Name = sExtrusionLightFace;
- aProp.Value <<= bExtrusionLightFace;
- aExtrusionPropVec.push_back( aProp );
- // "FirstLightHarsh"
- const rtl::OUString sExtrusionFirstLightHarsh( RTL_CONSTASCII_USTRINGPARAM ( "FirstLightHarsh" ) );
- sal_Bool bExtrusionFirstLightHarsh = ( GetPropertyValue( DFF_Prop_fc3DFillHarsh ) & 2 ) != 0;
- aProp.Name = sExtrusionFirstLightHarsh;
- aProp.Value <<= bExtrusionFirstLightHarsh;
- aExtrusionPropVec.push_back( aProp );
- // "SecondLightHarsh"
- const rtl::OUString sExtrusionSecondLightHarsh( RTL_CONSTASCII_USTRINGPARAM ( "SecondLightHarsh" ) );
- sal_Bool bExtrusionSecondLightHarsh = ( GetPropertyValue( DFF_Prop_fc3DFillHarsh ) & 1 ) != 0;
- aProp.Name = sExtrusionSecondLightHarsh;
- aProp.Value <<= bExtrusionSecondLightHarsh;
- aExtrusionPropVec.push_back( aProp );
- // "FirstLightLevel"
- if ( IsProperty( DFF_Prop_c3DKeyIntensity ) )
- {
- const rtl::OUString sExtrusionFirstLightLevel( RTL_CONSTASCII_USTRINGPARAM ( "FirstLightLevel" ) );
- double fFirstLightLevel = (sal_Int32)GetPropertyValue( DFF_Prop_c3DKeyIntensity );
- fFirstLightLevel /= 655.36;
- aProp.Name = sExtrusionFirstLightLevel;
- aProp.Value <<= fFirstLightLevel;
- aExtrusionPropVec.push_back( aProp );
- }
- // "SecondLightLevel"
- if ( IsProperty( DFF_Prop_c3DFillIntensity ) )
- {
- const rtl::OUString sExtrusionSecondLightLevel( RTL_CONSTASCII_USTRINGPARAM ( "SecondLightLevel" ) );
- double fSecondLightLevel = (sal_Int32)GetPropertyValue( DFF_Prop_c3DFillIntensity );
- fSecondLightLevel /= 655.36;
- aProp.Name = sExtrusionSecondLightLevel;
- aProp.Value <<= fSecondLightLevel;
- aExtrusionPropVec.push_back( aProp );
- }
- // "FirtstLightDirection"
- if ( IsProperty( DFF_Prop_c3DKeyX ) || IsProperty( DFF_Prop_c3DKeyY ) || IsProperty( DFF_Prop_c3DKeyZ ) )
- {
- double fLightX = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DKeyX, 50000 ));
- double fLightY = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DKeyY, 0 ));
- double fLightZ = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DKeyZ, 10000 ));
- ::com::sun::star::drawing::Direction3D aExtrusionFirstLightDirection( fLightX, fLightY, fLightZ );
- const rtl::OUString sExtrusionFirstLightDirection( RTL_CONSTASCII_USTRINGPARAM ( "FirstLightDirection" ) );
- aProp.Name = sExtrusionFirstLightDirection;
- aProp.Value <<= aExtrusionFirstLightDirection;
- aExtrusionPropVec.push_back( aProp );
- }
- // "SecondLightDirection"
- if ( IsProperty( DFF_Prop_c3DFillX ) || IsProperty( DFF_Prop_c3DFillY ) || IsProperty( DFF_Prop_c3DFillZ ) )
- {
- double fLight2X = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DFillX, (sal_uInt32)-50000 ));
- double fLight2Y = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DFillY, 0 ));
- double fLight2Z = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DFillZ, 10000 ));
- ::com::sun::star::drawing::Direction3D aExtrusionSecondLightDirection( fLight2X, fLight2Y, fLight2Z );
- const rtl::OUString sExtrusionSecondLightDirection( RTL_CONSTASCII_USTRINGPARAM ( "SecondLightDirection" ) );
- aProp.Name = sExtrusionSecondLightDirection;
- aProp.Value <<= aExtrusionSecondLightDirection;
- aExtrusionPropVec.push_back( aProp );
- }
-
-/* LockRotationCenter, OrientationAngle and Orientation needs to be converted to use the properties AngleX, AngleY and RotationAngle instead.
- // "LockRotationCenter"
- const rtl::OUString sExtrusionLockRotationCenter( RTL_CONSTASCII_USTRINGPARAM ( "LockRotationCenter" ) );
- sal_Bool bExtrusionLockRotationCenter = ( GetPropertyValue( DFF_Prop_fc3DFillHarsh ) & 16 ) != 0;
- aProp.Name = sExtrusionLockRotationCenter;
- aProp.Value <<= bExtrusionLockRotationCenter;
- aExtrusionPropVec.push_back( aProp );
-
- // "Orientation"
- if ( IsProperty( DFF_Prop_c3DRotationAxisX ) || IsProperty( DFF_Prop_c3DRotationAxisY ) || IsProperty( DFF_Prop_c3DRotationAxisZ ) )
- {
- double fRotX = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DRotationAxisX, 100 ));
- double fRotY = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DRotationAxisY, 0 ));
- double fRotZ = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DRotationAxisZ, 0 ));
- ::com::sun::star::drawing::Direction3D aExtrusionDirection( fRotX, fRotY, fRotZ );
- const rtl::OUString sExtrusionDirection( RTL_CONSTASCII_USTRINGPARAM ( "Orientation" ) );
- aProp.Name = sExtrusionDirection;
- aProp.Value <<= aExtrusionDirection;
- aExtrusionPropVec.push_back( aProp );
- }
- // "OrientationAngle" in Grad
- if ( IsProperty( DFF_Prop_c3DRotationAngle ) )
- {
- const rtl::OUString sExtrusionOrientationAngle( RTL_CONSTASCII_USTRINGPARAM ( "OrientationAngle" ) );
- double fOrientationAngle = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DRotationAngle )) / 65536.0;
- aProp.Name = sExtrusionOrientationAngle;
- aProp.Value <<= fOrientationAngle;
- aExtrusionPropVec.push_back( aProp );
- }
-*/
-
- // "Metal"
- const rtl::OUString sExtrusionMetal( RTL_CONSTASCII_USTRINGPARAM ( "Metal" ) );
- sal_Bool bExtrusionMetal = ( GetPropertyValue( DFF_Prop_fc3DLightFace ) & 4 ) != 0;
- aProp.Name = sExtrusionMetal;
- aProp.Value <<= bExtrusionMetal;
- aExtrusionPropVec.push_back( aProp );
-// if ( IsProperty( DFF_Prop_c3DExtrudePlane ) )
-// {
-// UPS
-// }
- // "ShadeMode"
- if ( IsProperty( DFF_Prop_c3DRenderMode ) )
- {
- const rtl::OUString sExtrusionShadeMode( RTL_CONSTASCII_USTRINGPARAM ( "ShadeMode" ) );
- sal_uInt32 nExtrusionRenderMode = GetPropertyValue( DFF_Prop_c3DRenderMode );
- com::sun::star::drawing::ShadeMode eExtrusionShadeMode( com::sun::star::drawing::ShadeMode_FLAT );
- if ( nExtrusionRenderMode == mso_Wireframe )
- eExtrusionShadeMode = com::sun::star::drawing::ShadeMode_DRAFT;
-
- aProp.Name = sExtrusionShadeMode;
- aProp.Value <<= eExtrusionShadeMode;
- aExtrusionPropVec.push_back( aProp );
- }
- // "RotateAngle" in Grad
- if ( IsProperty( DFF_Prop_c3DXRotationAngle ) || IsProperty( DFF_Prop_c3DYRotationAngle ) )
- {
- const rtl::OUString sExtrusionAngle( RTL_CONSTASCII_USTRINGPARAM ( "RotateAngle" ) );
- double fAngleX = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DXRotationAngle, 0 )) / 65536.0;
- double fAngleY = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DYRotationAngle, 0 )) / 65536.0;
- EnhancedCustomShapeParameterPair aRotateAnglePair;
- aRotateAnglePair.First.Value <<= fAngleX;
- aRotateAnglePair.First.Type = EnhancedCustomShapeParameterType::NORMAL;
- aRotateAnglePair.Second.Value <<= fAngleY;
- aRotateAnglePair.Second.Type = EnhancedCustomShapeParameterType::NORMAL;
- aProp.Name = sExtrusionAngle;
- aProp.Value <<= aRotateAnglePair;
- aExtrusionPropVec.push_back( aProp );
- }
-
- // "AutoRotationCenter"
- if ( ( GetPropertyValue( DFF_Prop_fc3DFillHarsh ) & 8 ) == 0 )
- {
- // "RotationCenter"
- if ( IsProperty( DFF_Prop_c3DRotationCenterX ) || IsProperty( DFF_Prop_c3DRotationCenterY ) || IsProperty( DFF_Prop_c3DRotationCenterZ ) )
- {
- ::com::sun::star::drawing::Direction3D aRotationCenter(
- (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DRotationCenterX, 0 )) / 360.0,
- (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DRotationCenterY, 0 )) / 360.0,
- (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DRotationCenterZ, 0 )) / 360.0 );
-
- const rtl::OUString sExtrusionRotationCenter( RTL_CONSTASCII_USTRINGPARAM ( "RotationCenter" ) );
- aProp.Name = sExtrusionRotationCenter;
- aProp.Value <<= aRotationCenter;
- aExtrusionPropVec.push_back( aProp );
- }
- }
- // "Shininess"
- if ( IsProperty( DFF_Prop_c3DShininess ) )
- {
- const rtl::OUString sExtrusionShininess( RTL_CONSTASCII_USTRINGPARAM ( "Shininess" ) );
- double fShininess = (sal_Int32)GetPropertyValue( DFF_Prop_c3DShininess );
- fShininess /= 655.36;
- aProp.Name = sExtrusionShininess;
- aProp.Value <<= fShininess;
- aExtrusionPropVec.push_back( aProp );
- }
- // "Skew"
- if ( IsProperty( DFF_Prop_c3DSkewAmount ) || IsProperty( DFF_Prop_c3DSkewAngle ) )
- {
- const rtl::OUString sExtrusionSkew( RTL_CONSTASCII_USTRINGPARAM ( "Skew" ) );
- double fSkewAmount = (sal_Int32)GetPropertyValue( DFF_Prop_c3DSkewAmount, 50 );
- double fSkewAngle = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DSkewAngle, sal::static_int_cast< UINT32 >(-135 * 65536) )) / 65536.0;
-
- EnhancedCustomShapeParameterPair aSkewPair;
- aSkewPair.First.Value <<= fSkewAmount;
- aSkewPair.First.Type = EnhancedCustomShapeParameterType::NORMAL;
- aSkewPair.Second.Value <<= fSkewAngle;
- aSkewPair.Second.Type = EnhancedCustomShapeParameterType::NORMAL;
- aProp.Name = sExtrusionSkew;
- aProp.Value <<= aSkewPair;
- aExtrusionPropVec.push_back( aProp );
- }
- // "Specularity"
- if ( IsProperty( DFF_Prop_c3DSpecularAmt ) )
- {
- const rtl::OUString sExtrusionSpecularity( RTL_CONSTASCII_USTRINGPARAM ( "Specularity" ) );
- double fSpecularity = (sal_Int32)GetPropertyValue( DFF_Prop_c3DSpecularAmt );
- fSpecularity /= 1333;
- aProp.Name = sExtrusionSpecularity;
- aProp.Value <<= fSpecularity;
- aExtrusionPropVec.push_back( aProp );
- }
- // "ProjectionMode"
- const rtl::OUString sExtrusionProjectionMode( RTL_CONSTASCII_USTRINGPARAM ( "ProjectionMode" ) );
- ProjectionMode eProjectionMode = GetPropertyValue( DFF_Prop_fc3DFillHarsh ) & 4 ? ProjectionMode_PARALLEL : ProjectionMode_PERSPECTIVE;
- aProp.Name = sExtrusionProjectionMode;
- aProp.Value <<= eProjectionMode;
- aExtrusionPropVec.push_back( aProp );
-
- // "ViewPoint" in 1/100mm
- if ( IsProperty( DFF_Prop_c3DXViewpoint ) || IsProperty( DFF_Prop_c3DYViewpoint ) || IsProperty( DFF_Prop_c3DZViewpoint ) )
- {
- double fViewX = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DXViewpoint, 1249920 )) / 360.0;
- double fViewY = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DYViewpoint, (sal_uInt32)-1249920 ))/ 360.0;
- double fViewZ = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DZViewpoint, 9000000 )) / 360.0;
- ::com::sun::star::drawing::Position3D aExtrusionViewPoint( fViewX, fViewY, fViewZ );
- const rtl::OUString sExtrusionViewPoint( RTL_CONSTASCII_USTRINGPARAM ( "ViewPoint" ) );
- aProp.Name = sExtrusionViewPoint;
- aProp.Value <<= aExtrusionViewPoint;
- aExtrusionPropVec.push_back( aProp );
- }
- // "Origin"
- if ( IsProperty( DFF_Prop_c3DOriginX ) || IsProperty( DFF_Prop_c3DOriginY ) )
- {
- const rtl::OUString sExtrusionOrigin( RTL_CONSTASCII_USTRINGPARAM ( "Origin" ) );
- double fOriginX = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DOriginX, 0 ));
- double fOriginY = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DOriginY, 0 ));
- fOriginX /= 65536;
- fOriginY /= 65536;
- EnhancedCustomShapeParameterPair aOriginPair;
- aOriginPair.First.Value <<= fOriginX;
- aOriginPair.First.Type = EnhancedCustomShapeParameterType::NORMAL;
- aOriginPair.Second.Value <<= fOriginY;
- aOriginPair.Second.Type = EnhancedCustomShapeParameterType::NORMAL;
- aProp.Name = sExtrusionOrigin;
- aProp.Value <<= aOriginPair;
- aExtrusionPropVec.push_back( aProp );
- }
- // "ExtrusionColor"
- const rtl::OUString sExtrusionColor( RTL_CONSTASCII_USTRINGPARAM ( "Color" ) );
- sal_Bool bExtrusionColor = IsProperty( DFF_Prop_c3DExtrusionColor ); // ( GetPropertyValue( DFF_Prop_fc3DLightFace ) & 2 ) != 0;
- aProp.Name = sExtrusionColor;
- aProp.Value <<= bExtrusionColor;
- aExtrusionPropVec.push_back( aProp );
- if ( IsProperty( DFF_Prop_c3DExtrusionColor ) )
- rSet.Put( XSecondaryFillColorItem( String(), rManager.MSO_CLR_ToColor(
- GetPropertyValue( DFF_Prop_c3DExtrusionColor ), DFF_Prop_c3DExtrusionColor ) ) );
- // pushing the whole Extrusion element
- const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
- PropSeq aExtrusionPropSeq( aExtrusionPropVec.size() );
- aIter = aExtrusionPropVec.begin();
- aEnd = aExtrusionPropVec.end();
- beans::PropertyValue* pExtrusionValues = aExtrusionPropSeq.getArray();
- while ( aIter != aEnd )
- *pExtrusionValues++ = *aIter++;
- aProp.Name = sExtrusion;
- aProp.Value <<= aExtrusionPropSeq;
- aPropVec.push_back( aProp );
- }
-
- /////////////////////////////////////////
- // "Equations" PropertySequence element //
- /////////////////////////////////////////
- if ( IsProperty( DFF_Prop_pFormulas ) )
- {
- sal_uInt16 i;
- sal_uInt16 nNumElem = 0;
- sal_uInt16 nNumElemMem = 0;
- sal_uInt16 nElemSize = 8;
-
- if ( SeekToContent( DFF_Prop_pFormulas, rIn ) )
- rIn >> nNumElem >> nNumElemMem >> nElemSize;
-
- sal_Int16 nP1, nP2, nP3;
- sal_uInt16 nFlags;
-
- uno::Sequence< rtl::OUString > aEquations( nNumElem );
- for ( i = 0; i < nNumElem; i++ )
- {
- rIn >> nFlags >> nP1 >> nP2 >> nP3;
- aEquations[ i ] = EnhancedCustomShape2d::GetEquation( nFlags, nP1, nP2, nP3 );
- }
- // pushing the whole Equations element
- const rtl::OUString sEquations( RTL_CONSTASCII_USTRINGPARAM ( "Equations" ) );
- aProp.Name = sEquations;
- aProp.Value <<= aEquations;
- aPropVec.push_back( aProp );
- }
-
- ////////////////////////////////////////
- // "Handles" PropertySequence element //
- ////////////////////////////////////////
- if ( IsProperty( DFF_Prop_Handles ) )
- {
- sal_uInt16 i;
- sal_uInt16 nNumElem = 0;
- sal_uInt16 nNumElemMem = 0;
- sal_uInt16 nElemSize = 36;
-
- if ( SeekToContent( DFF_Prop_Handles, rIn ) )
- rIn >> nNumElem >> nNumElemMem >> nElemSize;
- if ( nElemSize == 36 )
- {
- uno::Sequence< beans::PropertyValues > aHandles( nNumElem );
- for ( i = 0; i < nNumElem; i++ )
- {
- PropVec aHandlePropVec;
- sal_uInt32 nFlags;
- sal_Int32 nPositionX, nPositionY, nCenterX, nCenterY, nRangeXMin, nRangeXMax, nRangeYMin, nRangeYMax;
- rIn >> nFlags
- >> nPositionX
- >> nPositionY
- >> nCenterX
- >> nCenterY
- >> nRangeXMin
- >> nRangeXMax
- >> nRangeYMin
- >> nRangeYMax;
-
- if ( nPositionX == 2 ) // replacing center position with absolute value
- nPositionX = nCoordWidth / 2;
- if ( nPositionY == 2 )
- nPositionY = nCoordHeight / 2;
- EnhancedCustomShapeParameterPair aPosition;
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aPosition.First, nPositionX, sal_True, sal_True );
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aPosition.Second, nPositionY, sal_True, sal_False );
- const rtl::OUString sHandlePosition( RTL_CONSTASCII_USTRINGPARAM ( "Position" ) );
- aProp.Name = sHandlePosition;
- aProp.Value <<= aPosition;
- aHandlePropVec.push_back( aProp );
-
- if ( nFlags & MSDFF_HANDLE_FLAGS_MIRRORED_X )
- {
- sal_Bool bMirroredX = sal_True;
- const rtl::OUString sHandleMirroredX( RTL_CONSTASCII_USTRINGPARAM ( "MirroredX" ) );
- aProp.Name = sHandleMirroredX;
- aProp.Value <<= bMirroredX;
- aHandlePropVec.push_back( aProp );
- }
- if ( nFlags & MSDFF_HANDLE_FLAGS_MIRRORED_Y )
- {
- sal_Bool bMirroredY = sal_True;
- const rtl::OUString sHandleMirroredY( RTL_CONSTASCII_USTRINGPARAM ( "MirroredY" ) );
- aProp.Name = sHandleMirroredY;
- aProp.Value <<= bMirroredY;
- aHandlePropVec.push_back( aProp );
- }
- if ( nFlags & MSDFF_HANDLE_FLAGS_SWITCHED )
- {
- sal_Bool bSwitched = sal_True;
- const rtl::OUString sHandleSwitched( RTL_CONSTASCII_USTRINGPARAM ( "Switched" ) );
- aProp.Name = sHandleSwitched;
- aProp.Value <<= bSwitched;
- aHandlePropVec.push_back( aProp );
- }
- if ( nFlags & MSDFF_HANDLE_FLAGS_POLAR )
- {
- if ( nCenterX == 2 )
- nCenterX = nCoordWidth / 2;
- if ( nCenterY == 2 )
- nCenterY = nCoordHeight / 2;
- if ( ( nPositionY >= 0x256 ) || ( nPositionY <= 0x107 ) ) // position y
- nAdjustmentsWhichNeedsToBeConverted |= ( 1 << i );
- EnhancedCustomShapeParameterPair aPolar;
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aPolar.First, nCenterX, ( nFlags & 0x800 ) != 0, sal_True );
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aPolar.Second, nCenterY, ( nFlags & 0x1000 ) != 0, sal_False );
- const rtl::OUString sHandlePolar( RTL_CONSTASCII_USTRINGPARAM ( "Polar" ) );
- aProp.Name = sHandlePolar;
- aProp.Value <<= aPolar;
- aHandlePropVec.push_back( aProp );
- }
- if ( nFlags & MSDFF_HANDLE_FLAGS_MAP )
- {
- if ( nCenterX == 2 )
- nCenterX = nCoordWidth / 2;
- if ( nCenterY == 2 )
- nCenterY = nCoordHeight / 2;
- EnhancedCustomShapeParameterPair aMap;
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aMap.First, nCenterX, ( nFlags & 0x800 ) != 0, sal_True );
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aMap.Second, nCenterY, ( nFlags & 0x1000 ) != 0, sal_False );
- const rtl::OUString sHandleMap( RTL_CONSTASCII_USTRINGPARAM ( "Map" ) );
- aProp.Name = sHandleMap;
- aProp.Value <<= aMap;
- aHandlePropVec.push_back( aProp );
- }
- if ( nFlags & MSDFF_HANDLE_FLAGS_RANGE )
- {
- if ( (sal_uInt32)nRangeXMin != 0x80000000 )
- {
- if ( nRangeXMin == 2 )
- nRangeXMin = nCoordWidth / 2;
- EnhancedCustomShapeParameter aRangeXMinimum;
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRangeXMinimum, nRangeXMin,
- ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL ) != 0, sal_True );
- const rtl::OUString sHandleRangeXMinimum( RTL_CONSTASCII_USTRINGPARAM ( "RangeXMinimum" ) );
- aProp.Name = sHandleRangeXMinimum;
- aProp.Value <<= aRangeXMinimum;
- aHandlePropVec.push_back( aProp );
- }
- if ( (sal_uInt32)nRangeXMax != 0x7fffffff )
- {
- if ( nRangeXMax == 2 )
- nRangeXMax = nCoordWidth / 2;
- EnhancedCustomShapeParameter aRangeXMaximum;
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRangeXMaximum, nRangeXMax,
- ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL ) != 0, sal_False );
- const rtl::OUString sHandleRangeXMaximum( RTL_CONSTASCII_USTRINGPARAM ( "RangeXMaximum" ) );
- aProp.Name = sHandleRangeXMaximum;
- aProp.Value <<= aRangeXMaximum;
- aHandlePropVec.push_back( aProp );
- }
- if ( (sal_uInt32)nRangeYMin != 0x80000000 )
- {
- if ( nRangeYMin == 2 )
- nRangeYMin = nCoordHeight / 2;
- EnhancedCustomShapeParameter aRangeYMinimum;
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRangeYMinimum, nRangeYMin,
- ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL ) != 0, sal_True );
- const rtl::OUString sHandleRangeYMinimum( RTL_CONSTASCII_USTRINGPARAM ( "RangeYMinimum" ) );
- aProp.Name = sHandleRangeYMinimum;
- aProp.Value <<= aRangeYMinimum;
- aHandlePropVec.push_back( aProp );
- }
- if ( (sal_uInt32)nRangeYMax != 0x7fffffff )
- {
- if ( nRangeYMax == 2 )
- nRangeYMax = nCoordHeight / 2;
- EnhancedCustomShapeParameter aRangeYMaximum;
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRangeYMaximum, nRangeYMax,
- ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL ) != 0, sal_False );
- const rtl::OUString sHandleRangeYMaximum( RTL_CONSTASCII_USTRINGPARAM ( "RangeYMaximum" ) );
- aProp.Name = sHandleRangeYMaximum;
- aProp.Value <<= aRangeYMaximum;
- aHandlePropVec.push_back( aProp );
- }
- }
- if ( nFlags & MSDFF_HANDLE_FLAGS_RADIUS_RANGE )
- {
- if ( (sal_uInt32)nRangeXMin != 0x7fffffff )
- {
- if ( nRangeXMin == 2 )
- nRangeXMin = nCoordWidth / 2;
- EnhancedCustomShapeParameter aRadiusRangeMinimum;
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRadiusRangeMinimum, nRangeXMin,
- ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL ) != 0, sal_True );
- const rtl::OUString sHandleRadiusRangeMinimum( RTL_CONSTASCII_USTRINGPARAM ( "RadiusRangeMinimum" ) );
- aProp.Name = sHandleRadiusRangeMinimum;
- aProp.Value <<= aRadiusRangeMinimum;
- aHandlePropVec.push_back( aProp );
- }
- if ( (sal_uInt32)nRangeXMax != 0x80000000 )
- {
- if ( nRangeXMax == 2 )
- nRangeXMax = nCoordWidth / 2;
- EnhancedCustomShapeParameter aRadiusRangeMaximum;
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRadiusRangeMaximum, nRangeXMax,
- ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL ) != 0, sal_False );
- const rtl::OUString sHandleRadiusRangeMaximum( RTL_CONSTASCII_USTRINGPARAM ( "RadiusRangeMaximum" ) );
- aProp.Name = sHandleRadiusRangeMaximum;
- aProp.Value <<= aRadiusRangeMaximum;
- aHandlePropVec.push_back( aProp );
- }
- }
- if ( aHandlePropVec.size() )
- {
- PropSeq aHandlePropSeq( aHandlePropVec.size() );
- aIter = aHandlePropVec.begin();
- aEnd = aHandlePropVec.end();
- beans::PropertyValue* pHandleValues = aHandlePropSeq.getArray();
- while ( aIter != aEnd )
- *pHandleValues++ = *aIter++;
- aHandles[ i ] = aHandlePropSeq;
- }
- }
- // pushing the whole Handles element
- const rtl::OUString sHandles( RTL_CONSTASCII_USTRINGPARAM ( "Handles" ) );
- aProp.Name = sHandles;
- aProp.Value <<= aHandles;
- aPropVec.push_back( aProp );
- }
- }
- else
- {
- const mso_CustomShape* pDefCustomShape = GetCustomShapeContent( eShapeType );
- if ( pDefCustomShape && pDefCustomShape->nHandles && pDefCustomShape->pHandles )
- {
- sal_Int32 i, nCnt = pDefCustomShape->nHandles;
- const SvxMSDffHandle* pData = pDefCustomShape->pHandles;
- for ( i = 0; i < nCnt; i++, pData++ )
- {
- if ( pData->nFlags & MSDFF_HANDLE_FLAGS_POLAR )
- {
- if ( ( pData->nPositionY >= 0x256 ) || ( pData->nPositionY <= 0x107 ) )
- nAdjustmentsWhichNeedsToBeConverted |= ( 1 << i );
- }
- }
- }
- }
- /////////////////////////////////////
- // "Path" PropertySequence element //
- /////////////////////////////////////
- {
- PropVec aPathPropVec;
-
- // "Path/ExtrusionAllowed"
- if ( IsHardAttribute( DFF_Prop_f3DOK ) )
- {
- const rtl::OUString sExtrusionAllowed( RTL_CONSTASCII_USTRINGPARAM ( "ExtrusionAllowed" ) );
- sal_Bool bExtrusionAllowed = ( GetPropertyValue( DFF_Prop_fFillOK ) & 16 ) != 0;
- aProp.Name = sExtrusionAllowed;
- aProp.Value <<= bExtrusionAllowed;
- aPathPropVec.push_back( aProp );
- }
- // "Path/ConcentricGradientFillAllowed"
- if ( IsHardAttribute( DFF_Prop_fFillShadeShapeOK ) )
- {
- const rtl::OUString sConcentricGradientFillAllowed( RTL_CONSTASCII_USTRINGPARAM ( "ConcentricGradientFillAllowed" ) );
- sal_Bool bConcentricGradientFillAllowed = ( GetPropertyValue( DFF_Prop_fFillOK ) & 2 ) != 0;
- aProp.Name = sConcentricGradientFillAllowed;
- aProp.Value <<= bConcentricGradientFillAllowed;
- aPathPropVec.push_back( aProp );
- }
- // "Path/TextPathAllowed"
- if ( IsHardAttribute( DFF_Prop_fGtextOK ) || ( GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ) & 0x4000 ) )
- {
- const rtl::OUString sTextPathAllowed( RTL_CONSTASCII_USTRINGPARAM ( "TextPathAllowed" ) );
- sal_Bool bTextPathAllowed = ( GetPropertyValue( DFF_Prop_fFillOK ) & 4 ) != 0;
- aProp.Name = sTextPathAllowed;
- aProp.Value <<= bTextPathAllowed;
- aPathPropVec.push_back( aProp );
- }
- // Path/Coordinates
- if ( IsProperty( DFF_Prop_pVertices ) )
- {
- com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aCoordinates;
-
- sal_uInt16 i;
- sal_uInt16 nNumElemVert = 0;
- sal_uInt16 nNumElemMemVert = 0;
- sal_uInt16 nElemSizeVert = 8;
-
- if ( SeekToContent( DFF_Prop_pVertices, rIn ) )
- rIn >> nNumElemVert >> nNumElemMemVert >> nElemSizeVert;
- if ( nNumElemVert )
- {
- sal_Int32 nX, nY;
- sal_Int16 nTmpA, nTmpB;
- aCoordinates.realloc( nNumElemVert );
- for ( i = 0; i < nNumElemVert; i++ )
- {
- if ( nElemSizeVert == 8 )
- {
- rIn >> nX
- >> nY;
- }
- else
- {
- rIn >> nTmpA
- >> nTmpB;
-
- nX = nTmpA;
- nY = nTmpB;
- }
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aCoordinates[ i ].First, nX );
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aCoordinates[ i ].Second, nY );
- }
- }
- const rtl::OUString sCoordinates( RTL_CONSTASCII_USTRINGPARAM ( "Coordinates" ) );
- aProp.Name = sCoordinates;
- aProp.Value <<= aCoordinates;
- aPathPropVec.push_back( aProp );
- }
- // Path/Segments
- if ( IsProperty( DFF_Prop_pSegmentInfo ) )
- {
- com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeSegment > aSegments;
-
- sal_uInt16 i, nTmp;
- sal_uInt16 nNumElemSeg = 0;
- sal_uInt16 nNumElemMemSeg = 0;
- sal_uInt16 nElemSizeSeg = 2;
-
- if ( SeekToContent( DFF_Prop_pSegmentInfo, rIn ) )
- rIn >> nNumElemSeg >> nNumElemMemSeg >> nElemSizeSeg;
- if ( nNumElemSeg )
- {
- sal_Int16 nCommand;
- sal_Int16 nCnt;
- aSegments.realloc( nNumElemSeg );
- for ( i = 0; i < nNumElemSeg; i++ )
- {
- rIn >> nTmp;
- nCommand = EnhancedCustomShapeSegmentCommand::UNKNOWN;
- nCnt = (sal_Int16)( nTmp & 0xfff );
- switch( nTmp >> 12 )
- {
- case 0x0: nCommand = EnhancedCustomShapeSegmentCommand::LINETO; if ( !nCnt ) nCnt = 1; break;
- case 0x1: nCommand = EnhancedCustomShapeSegmentCommand::LINETO; if ( !nCnt ) nCnt = 1; break; // seems to the relative lineto
- case 0x4: nCommand = EnhancedCustomShapeSegmentCommand::MOVETO; if ( !nCnt ) nCnt = 1; break;
- case 0x2: nCommand = EnhancedCustomShapeSegmentCommand::CURVETO; if ( !nCnt ) nCnt = 1; break;
- case 0x3: nCommand = EnhancedCustomShapeSegmentCommand::CURVETO; if ( !nCnt ) nCnt = 1; break; // seems to be the relative curveto
- case 0x8: nCommand = EnhancedCustomShapeSegmentCommand::ENDSUBPATH; nCnt = 0; break;
- case 0x6: nCommand = EnhancedCustomShapeSegmentCommand::CLOSESUBPATH; nCnt = 0; break;
- case 0xa:
- case 0xb:
- {
- switch ( ( nTmp >> 8 ) & 0xf )
- {
- case 0x0:
- {
- nCommand = EnhancedCustomShapeSegmentCommand::LINETO;
- if ( !nCnt )
- nCnt = 1;
- }
- break;
- case 0x1:
- {
- nCommand = EnhancedCustomShapeSegmentCommand::ANGLEELLIPSETO;
- nCnt = ( nTmp & 0xff ) / 3;
- }
- break;
- case 0x2:
- {
- nCommand = EnhancedCustomShapeSegmentCommand::ANGLEELLIPSE;
- nCnt = ( nTmp & 0xff ) / 3;
- }
- break;
- case 0x3:
- {
- nCommand = EnhancedCustomShapeSegmentCommand::ARCTO;
- nCnt = ( nTmp & 0xff ) >> 2;
- };
- break;
- case 0x4:
- {
- nCommand = EnhancedCustomShapeSegmentCommand::ARC;
- nCnt = ( nTmp & 0xff ) >> 2;
- }
- break;
- case 0x5:
- {
- nCommand = EnhancedCustomShapeSegmentCommand::CLOCKWISEARCTO;
- nCnt = ( nTmp & 0xff ) >> 2;
- }
- break;
- case 0x6:
- {
- nCommand = EnhancedCustomShapeSegmentCommand::CLOCKWISEARC;
- nCnt = ( nTmp & 0xff ) >> 2;
- }
- break;
- case 0x7:
- {
- nCommand = EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTX;
- nCnt = nTmp & 0xff;
- }
- break;
- case 0x8:
- {
- nCommand = EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTY;
- nCnt = nTmp & 0xff;
- }
- break;
- case 0xa: nCommand = EnhancedCustomShapeSegmentCommand::NOFILL; nCnt = 0; break;
- case 0xb: nCommand = EnhancedCustomShapeSegmentCommand::NOSTROKE; nCnt = 0; break;
- }
- }
- break;
- }
- // if the command is unknown, we will store all the data in nCnt, so it will be possible to export without loss
- if ( nCommand == EnhancedCustomShapeSegmentCommand::UNKNOWN )
- nCnt = (sal_Int16)nTmp;
- aSegments[ i ].Command = nCommand;
- aSegments[ i ].Count = nCnt;
- }
- }
- const rtl::OUString sSegments( RTL_CONSTASCII_USTRINGPARAM ( "Segments" ) );
- aProp.Name = sSegments;
- aProp.Value <<= aSegments;
- aPathPropVec.push_back( aProp );
- }
- // Path/StretchX
- if ( IsProperty( DFF_Prop_stretchPointX ) )
- {
- const rtl::OUString sStretchX( RTL_CONSTASCII_USTRINGPARAM ( "StretchX" ) );
- sal_Int32 nStretchX = GetPropertyValue( DFF_Prop_stretchPointX, 0 );
- aProp.Name = sStretchX;
- aProp.Value <<= nStretchX;
- aPathPropVec.push_back( aProp );
- }
- // Path/StretchX
- if ( IsProperty( DFF_Prop_stretchPointY ) )
- {
- const rtl::OUString sStretchY( RTL_CONSTASCII_USTRINGPARAM ( "StretchY" ) );
- sal_Int32 nStretchY = GetPropertyValue( DFF_Prop_stretchPointY, 0 );
- aProp.Name = sStretchY;
- aProp.Value <<= nStretchY;
- aPathPropVec.push_back( aProp );
- }
- // Path/TextFrames
- if ( IsProperty( DFF_Prop_textRectangles ) )
- {
- sal_uInt16 i;
- sal_uInt16 nNumElem = 0;
- sal_uInt16 nNumElemMem = 0;
- sal_uInt16 nElemSize = 16;
-
- if ( SeekToContent( DFF_Prop_textRectangles, rIn ) )
- rIn >> nNumElem >> nNumElemMem >> nElemSize;
- if ( nElemSize == 16 )
- {
- sal_Int32 nLeft, nTop, nRight, nBottom;
- com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeTextFrame > aTextFrames( nNumElem );
- for ( i = 0; i < nNumElem; i++ )
- {
- rIn >> nLeft
- >> nTop
- >> nRight
- >> nBottom;
-
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrames[ i ].TopLeft.First, nLeft );
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrames[ i ].TopLeft.Second, nTop );
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrames[ i ].BottomRight.First, nRight );
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrames[ i ].BottomRight.Second, nBottom);
- }
- const rtl::OUString sTextFrames( RTL_CONSTASCII_USTRINGPARAM ( "TextFrames" ) );
- aProp.Name = sTextFrames;
- aProp.Value <<= aTextFrames;
- aPathPropVec.push_back( aProp );
- }
- }
- //Path/GluePoints
- if ( IsProperty( DFF_Prop_connectorPoints ) )
- {
- com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aGluePoints;
-
- sal_uInt16 i;
- sal_uInt16 nNumElemVert = 0;
- sal_uInt16 nNumElemMemVert = 0;
- sal_uInt16 nElemSizeVert = 8;
-
- if ( SeekToContent( DFF_Prop_connectorPoints, rIn ) )
- rIn >> nNumElemVert >> nNumElemMemVert >> nElemSizeVert;
-
- sal_Int32 nX, nY;
- sal_Int16 nTmpA, nTmpB;
- aGluePoints.realloc( nNumElemVert );
- for ( i = 0; i < nNumElemVert; i++ )
- {
- if ( nElemSizeVert == 8 )
- {
- rIn >> nX
- >> nY;
- }
- else
- {
- rIn >> nTmpA
- >> nTmpB;
-
- nX = nTmpA;
- nY = nTmpB;
- }
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aGluePoints[ i ].First, nX );
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aGluePoints[ i ].Second, nY );
- }
- const rtl::OUString sGluePoints( RTL_CONSTASCII_USTRINGPARAM ( "GluePoints" ) );
- aProp.Name = sGluePoints;
- aProp.Value <<= aGluePoints;
- aPathPropVec.push_back( aProp );
- }
- if ( IsProperty( DFF_Prop_connectorType ) )
- {
- sal_Int16 nGluePointType = (sal_uInt16)GetPropertyValue( DFF_Prop_connectorType );
- const rtl::OUString sGluePointType( RTL_CONSTASCII_USTRINGPARAM ( "GluePointType" ) );
- aProp.Name = sGluePointType;
- aProp.Value <<= nGluePointType;
- aPathPropVec.push_back( aProp );
- }
- // pushing the whole Path element
- if ( aPathPropVec.size() )
- {
- const rtl::OUString sPath( RTL_CONSTASCII_USTRINGPARAM ( "Path" ) );
- PropSeq aPathPropSeq( aPathPropVec.size() );
- aIter = aPathPropVec.begin();
- aEnd = aPathPropVec.end();
- beans::PropertyValue* pPathValues = aPathPropSeq.getArray();
- while ( aIter != aEnd )
- *pPathValues++ = *aIter++;
- aProp.Name = sPath;
- aProp.Value <<= aPathPropSeq;
- aPropVec.push_back( aProp );
- }
- }
- /////////////////////////////////////////
- // "TextPath" PropertySequence element //
- /////////////////////////////////////////
- sal_Bool bTextPathOn = ( GetPropertyValue( DFF_Prop_gtextFStrikethrough ) & 0x4000 ) != 0;
- if ( bTextPathOn )
- {
- PropVec aTextPathPropVec;
-
- // TextPath
- const rtl::OUString sTextPathOn( RTL_CONSTASCII_USTRINGPARAM ( "TextPath" ) );
- aProp.Name = sTextPathOn;
- aProp.Value <<= bTextPathOn;
- aTextPathPropVec.push_back( aProp );
-
- // TextPathMode
- const rtl::OUString sTextPathMode( RTL_CONSTASCII_USTRINGPARAM ( "TextPathMode" ) );
- sal_Bool bTextPathFitPath = ( GetPropertyValue( DFF_Prop_gtextFStrikethrough ) & 0x100 ) != 0;
-
- sal_Bool bTextPathFitShape;
- if ( IsHardAttribute( DFF_Prop_gtextFStretch ) )
- bTextPathFitShape = ( GetPropertyValue( DFF_Prop_gtextFStrikethrough ) & 0x400 ) != 0;
- else
- {
- bTextPathFitShape = true;
- switch( eShapeType )
- {
- case mso_sptTextArchUpCurve :
- case mso_sptTextArchDownCurve :
- case mso_sptTextCircleCurve :
- case mso_sptTextButtonCurve :
- bTextPathFitShape = false;
- default : break;
- }
- }
- EnhancedCustomShapeTextPathMode eTextPathMode( EnhancedCustomShapeTextPathMode_NORMAL );
- if ( bTextPathFitShape )
- eTextPathMode = EnhancedCustomShapeTextPathMode_SHAPE;
- else if ( bTextPathFitPath )
- eTextPathMode = EnhancedCustomShapeTextPathMode_PATH;
- aProp.Name = sTextPathMode;
- aProp.Value <<= eTextPathMode;
- aTextPathPropVec.push_back( aProp );
-
- // ScaleX
- const rtl::OUString sTextPathScaleX( RTL_CONSTASCII_USTRINGPARAM ( "ScaleX" ) );
- sal_Bool bTextPathScaleX = ( GetPropertyValue( DFF_Prop_gtextFStrikethrough ) & 0x40 ) != 0;
- aProp.Name = sTextPathScaleX;
- aProp.Value <<= bTextPathScaleX;
- aTextPathPropVec.push_back( aProp );
- // SameLetterHeights
- const rtl::OUString sSameLetterHeight( RTL_CONSTASCII_USTRINGPARAM ( "SameLetterHeights" ) );
- sal_Bool bSameLetterHeight = ( GetPropertyValue( DFF_Prop_gtextFStrikethrough ) & 0x80 ) != 0;
- aProp.Name = sSameLetterHeight;
- aProp.Value <<= bSameLetterHeight;
- aTextPathPropVec.push_back( aProp );
-
- // pushing the whole TextPath element
- const rtl::OUString sTextPath( RTL_CONSTASCII_USTRINGPARAM ( "TextPath" ) );
- PropSeq aTextPathPropSeq( aTextPathPropVec.size() );
- aIter = aTextPathPropVec.begin();
- aEnd = aTextPathPropVec.end();
- beans::PropertyValue* pTextPathValues = aTextPathPropSeq.getArray();
- while ( aIter != aEnd )
- *pTextPathValues++ = *aIter++;
- aProp.Name = sTextPath;
- aProp.Value <<= aTextPathPropSeq;
- aPropVec.push_back( aProp );
- }
- ////////////////////////
- // "AdjustmentValues" // The AdjustmentValues are imported at last, because depending to the type of the
- //////////////////////// handle (POLAR) we will convert the adjustment value from a fixed float to double
-
- // checking the last used adjustment handle, so we can determine how many handles are to allocate
- sal_Int32 i = DFF_Prop_adjust10Value;
- while ( ( i >= DFF_Prop_adjustValue ) && !IsProperty( i ) )
- i--;
- sal_Int32 nAdjustmentValues = ( i - DFF_Prop_adjustValue ) + 1;
- if ( nAdjustmentValues )
- {
- uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue > aAdjustmentSeq( nAdjustmentValues );
- while( --nAdjustmentValues >= 0 )
- {
- sal_Int32 nValue = 0;
- beans::PropertyState ePropertyState = beans::PropertyState_DEFAULT_VALUE;
- if ( IsProperty( i ) )
- {
- nValue = GetPropertyValue( i );
- ePropertyState = beans::PropertyState_DIRECT_VALUE;
- }
- if ( nAdjustmentsWhichNeedsToBeConverted & ( 1 << ( i - DFF_Prop_adjustValue ) ) )
- {
- double fValue = nValue;
- fValue /= 65536;
- aAdjustmentSeq[ nAdjustmentValues ].Value <<= fValue;
- }
- else
- aAdjustmentSeq[ nAdjustmentValues ].Value <<= nValue;
- aAdjustmentSeq[ nAdjustmentValues ].State = ePropertyState;
- i--;
- }
- const rtl::OUString sAdjustmentValues( RTL_CONSTASCII_USTRINGPARAM ( "AdjustmentValues" ) );
- aProp.Name = sAdjustmentValues;
- aProp.Value <<= aAdjustmentSeq;
- aPropVec.push_back( aProp );
- }
-
- // creating the whole property set
- PropSeq aSeq( aPropVec.size() );
- beans::PropertyValue* pValues = aSeq.getArray();
- aIter = aPropVec.begin();
- aEnd = aPropVec.end();
- while ( aIter != aEnd )
- *pValues++ = *aIter++;
- rSet.Put( SdrCustomShapeGeometryItem( aSeq ) );
-}
-
-void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, const MSO_SPT eShapeType, const sal_uInt32 nShapeFlags ) const
-{
-// MapUnit eMap( rManager.GetModel()->GetScaleUnit() );
-
- for ( void* pDummy = ((DffPropertyReader*)this)->First(); pDummy; pDummy = ((DffPropertyReader*)this)->Next() )
- {
- UINT32 nRecType = GetCurKey();
- UINT32 nContent = mpContents[ nRecType ];
- switch ( nRecType )
- {
- case DFF_Prop_gtextSize :
- rSet.Put( SvxFontHeightItem( rManager.ScalePt( nContent ), 100, EE_CHAR_FONTHEIGHT ) );
- break;
- // GeoText
- case DFF_Prop_gtextFStrikethrough :
- {
- if ( nContent & 0x20 )
- rSet.Put( SvxWeightItem( nContent ? WEIGHT_BOLD : WEIGHT_NORMAL, EE_CHAR_WEIGHT ) );
- if ( nContent & 0x10 )
- rSet.Put( SvxPostureItem( nContent ? ITALIC_NORMAL : ITALIC_NONE, EE_CHAR_ITALIC ) );
- if ( nContent & 0x08 )
- rSet.Put( SvxUnderlineItem( nContent ? UNDERLINE_SINGLE : UNDERLINE_NONE, EE_CHAR_UNDERLINE ) );
- if ( nContent & 0x40 )
- rSet.Put(SvxShadowedItem( nContent != 0, EE_CHAR_SHADOW ) );
-// if ( nContent & 0x02 )
-// rSet.Put( SvxCaseMapItem( nContent ? SVX_CASEMAP_KAPITAELCHEN : SVX_CASEMAP_NOT_MAPPED ) );
- if ( nContent & 0x01 )
- rSet.Put( SvxCrossedOutItem( nContent ? STRIKEOUT_SINGLE : STRIKEOUT_NONE, EE_CHAR_STRIKEOUT ) );
- }
- break;
-
- case DFF_Prop_fillColor :
- rSet.Put( XFillColorItem( String(), rManager.MSO_CLR_ToColor( nContent, DFF_Prop_fillColor ) ) );
- break;
-
- // ShadowStyle
- case DFF_Prop_shadowType :
- {
- MSO_ShadowType eShadowType = (MSO_ShadowType)nContent;
- if( eShadowType != mso_shadowOffset )
- {
- // mso_shadowDouble
- // mso_shadowRich
- // mso_shadowEmbossOrEngrave
- // koennen wir nicht, kreiere Default-Schatten mit default-
- // Abstand
- rSet.Put( SdrShadowXDistItem( 35 ) ); // 0,35 mm Schattendistanz
- rSet.Put( SdrShadowYDistItem( 35 ) );
- }
- }
- break;
- case DFF_Prop_shadowColor :
- rSet.Put( SdrShadowColorItem( String(), rManager.MSO_CLR_ToColor( nContent, DFF_Prop_shadowColor ) ) );
- break;
- case DFF_Prop_shadowOpacity :
- rSet.Put( SdrShadowTransparenceItem( (sal_uInt16)( ( 0x10000 - nContent ) / 655 ) ) );
- break;
- case DFF_Prop_shadowOffsetX :
- {
- INT32 nVal = (INT32)nContent;
- rManager.ScaleEmu( nVal );
- if ( nVal )
- rSet.Put( SdrShadowXDistItem( nVal ) );
- }
- break;
- case DFF_Prop_shadowOffsetY :
- {
- INT32 nVal = (INT32)nContent;
- rManager.ScaleEmu( nVal );
- if ( nVal )
- rSet.Put( SdrShadowYDistItem( nVal ) );
- }
- break;
- case DFF_Prop_fshadowObscured :
- {
- sal_Bool bHasShadow = ( nContent & 2 ) != 0;
- rSet.Put( SdrShadowItem( bHasShadow ) );
- if ( bHasShadow )
- {
- if ( !IsProperty( DFF_Prop_shadowOffsetX ) )
- rSet.Put( SdrShadowXDistItem( 35 ) );
- if ( !IsProperty( DFF_Prop_shadowOffsetY ) )
- rSet.Put( SdrShadowYDistItem( 35 ) );
- }
- }
- break;
- }
- }
-
- ApplyLineAttributes( rSet, eShapeType ); // #i28269#
- ApplyFillAttributes( rIn, rSet, eShapeType );
- if ( rManager.GetSvxMSDffSettings() & SVXMSDFF_SETTINGS_IMPORT_IAS )
- {
- if ( eShapeType != mso_sptNil )
- {
- ApplyCustomShapeGeometryAttributes( rIn, rSet, eShapeType, nShapeFlags );
- ApplyCustomShapeTextAttributes( rSet );
- }
- }
-}
-
-//---------------------------------------------------------------------------
-//- Record Manager ----------------------------------------------------------
-//---------------------------------------------------------------------------
-
-DffRecordList::DffRecordList( DffRecordList* pList ) :
- nCount ( 0 ),
- nCurrent ( 0 ),
- pPrev ( pList ),
- pNext ( NULL )
-{
- if ( pList )
- pList->pNext = this;
-}
-
-DffRecordList::~DffRecordList()
-{
- delete pNext;
-}
-
-DffRecordManager::DffRecordManager() :
- DffRecordList ( NULL ),
- pCList ( (DffRecordList*)this )
-{
-}
-
-DffRecordManager::DffRecordManager( SvStream& rIn ) :
- DffRecordList ( NULL ),
- pCList ( (DffRecordList*)this )
-{
- Consume( rIn );
-}
-
-DffRecordManager::~DffRecordManager()
-{
-};
-
-
-void DffRecordManager::Consume( SvStream& rIn, BOOL bAppend, UINT32 nStOfs )
-{
- if ( !bAppend )
- Clear();
- UINT32 nOldPos = rIn.Tell();
- if ( !nStOfs )
- {
- DffRecordHeader aHd;
- rIn >> aHd;
- if ( aHd.nRecVer == DFF_PSFLAG_CONTAINER )
- nStOfs = aHd.GetRecEndFilePos();
- }
- if ( nStOfs )
- {
- pCList = (DffRecordList*)this;
- while ( pCList->pNext )
- pCList = pCList->pNext;
- while ( ( rIn.GetError() == 0 ) && ( ( rIn.Tell() + 8 ) <= nStOfs ) )
- {
- if ( pCList->nCount == DFF_RECORD_MANAGER_BUF_SIZE )
- pCList = new DffRecordList( pCList );
- rIn >> pCList->mHd[ pCList->nCount ];
- pCList->mHd[ pCList->nCount++ ].SeekToEndOfRecord( rIn );
- }
- rIn.Seek( nOldPos );
- }
-}
-
-void DffRecordManager::Clear()
-{
- pCList = (DffRecordList*)this;
- delete pNext, pNext = NULL;
- nCurrent = 0;
- nCount = 0;
-}
-
-DffRecordHeader* DffRecordManager::Current()
-{
- DffRecordHeader* pRet = NULL;
- if ( pCList->nCurrent < pCList->nCount )
- pRet = &pCList->mHd[ pCList->nCurrent ];
- return pRet;
-}
-
-DffRecordHeader* DffRecordManager::First()
-{
- DffRecordHeader* pRet = NULL;
- pCList = (DffRecordList*)this;
- if ( pCList->nCount )
- {
- pCList->nCurrent = 0;
- pRet = &pCList->mHd[ 0 ];
- }
- return pRet;
-}
-
-DffRecordHeader* DffRecordManager::Next()
-{
- DffRecordHeader* pRet = NULL;
- UINT32 nC = pCList->nCurrent + 1;
- if ( nC < pCList->nCount )
- {
- pCList->nCurrent++;
- pRet = &pCList->mHd[ nC ];
- }
- else if ( pCList->pNext )
- {
- pCList = pCList->pNext;
- pCList->nCurrent = 0;
- pRet = &pCList->mHd[ 0 ];
- }
- return pRet;
-}
-
-DffRecordHeader* DffRecordManager::Prev()
-{
- DffRecordHeader* pRet = NULL;
- UINT32 nCur = pCList->nCurrent;
- if ( !nCur && pCList->pPrev )
- {
- pCList = pCList->pPrev;
- nCur = pCList->nCount;
- }
- if ( nCur-- )
- {
- pCList->nCurrent = nCur;
- pRet = &pCList->mHd[ nCur ];
- }
- return pRet;
-}
-
-DffRecordHeader* DffRecordManager::Last()
-{
- DffRecordHeader* pRet = NULL;
- while ( pCList->pNext )
- pCList = pCList->pNext;
- UINT32 nCnt = pCList->nCount;
- if ( nCnt-- )
- {
- pCList->nCurrent = nCnt;
- pRet = &pCList->mHd[ nCnt ];
- }
- return pRet;
-}
-
-BOOL DffRecordManager::SeekToContent( SvStream& rIn, UINT16 nRecId, DffSeekToContentMode eMode )
-{
- DffRecordHeader* pHd = GetRecordHeader( nRecId, eMode );
- if ( pHd )
- {
- pHd->SeekToContent( rIn );
- return TRUE;
- }
- else
- return FALSE;
-}
-
-DffRecordHeader* DffRecordManager::GetRecordHeader( UINT16 nRecId, DffSeekToContentMode eMode )
-{
- UINT32 nOldCurrent = pCList->nCurrent;
- DffRecordList* pOldList = pCList;
- DffRecordHeader* pHd;
-
- if ( eMode == SEEK_FROM_BEGINNING )
- pHd = First();
- else
- pHd = Next();
-
- while ( pHd )
- {
- if ( pHd->nRecType == nRecId )
- break;
- pHd = Next();
- }
- if ( !pHd && eMode == SEEK_FROM_CURRENT_AND_RESTART )
- {
- DffRecordHeader* pBreak = &pOldList->mHd[ nOldCurrent ];
- pHd = First();
- if ( pHd )
- {
- while ( pHd != pBreak )
- {
- if ( pHd->nRecType == nRecId )
- break;
- pHd = Next();
- }
- if ( pHd->nRecType != nRecId )
- pHd = NULL;
- }
- }
- if ( !pHd )
- {
- pCList = pOldList;
- pOldList->nCurrent = nOldCurrent;
- }
- return pHd;
-}
-
-//---------------------------------------------------------------------------
-// private Methoden
-//---------------------------------------------------------------------------
-
-struct EscherBlipCacheEntry
-{
- ByteString aUniqueID;
- sal_uInt32 nBlip;
-
- EscherBlipCacheEntry( sal_uInt32 nBlipId, const ByteString& rUniqueID ) :
- aUniqueID( rUniqueID ),
- nBlip( nBlipId ) {}
-};
-
-void SvxMSDffManager::Scale( sal_Int32& rVal ) const
-{
- if ( bNeedMap )
- rVal = BigMulDiv( rVal, nMapMul, nMapDiv );
-}
-
-void SvxMSDffManager::Scale( Point& rPos ) const
-{
- rPos.X() += nMapXOfs;
- rPos.Y() += nMapYOfs;
- if ( bNeedMap )
- {
- rPos.X() = BigMulDiv( rPos.X(), nMapMul, nMapDiv );
- rPos.Y() = BigMulDiv( rPos.Y(), nMapMul, nMapDiv );
- }
-}
-
-void SvxMSDffManager::Scale( Size& rSiz ) const
-{
- if ( bNeedMap )
- {
- rSiz.Width() = BigMulDiv( rSiz.Width(), nMapMul, nMapDiv );
- rSiz.Height() = BigMulDiv( rSiz.Height(), nMapMul, nMapDiv );
- }
-}
-
-void SvxMSDffManager::Scale( Rectangle& rRect ) const
-{
- rRect.Move( nMapXOfs, nMapYOfs );
- if ( bNeedMap )
- {
- rRect.Left() =BigMulDiv( rRect.Left() , nMapMul, nMapDiv );
- rRect.Top() =BigMulDiv( rRect.Top() , nMapMul, nMapDiv );
- rRect.Right() =BigMulDiv( rRect.Right() , nMapMul, nMapDiv );
- rRect.Bottom()=BigMulDiv( rRect.Bottom(), nMapMul, nMapDiv );
- }
-}
-
-void SvxMSDffManager::Scale( Polygon& rPoly ) const
-{
- if ( !bNeedMap )
- return;
- USHORT nPointAnz = rPoly.GetSize();
- for ( USHORT nPointNum = 0; nPointNum < nPointAnz; nPointNum++ )
- Scale( rPoly[ nPointNum ] );
-}
-
-void SvxMSDffManager::Scale( PolyPolygon& rPoly ) const
-{
- if ( !bNeedMap )
- return;
- USHORT nPolyAnz = rPoly.Count();
- for ( USHORT nPolyNum = 0; nPolyNum < nPolyAnz; nPolyNum++ )
- Scale( rPoly[ nPolyNum ] );
-}
-
-void SvxMSDffManager::ScaleEmu( sal_Int32& rVal ) const
-{
- rVal = BigMulDiv( rVal, nEmuMul, nEmuDiv );
-}
-
-UINT32 SvxMSDffManager::ScalePt( UINT32 nVal ) const
-{
- MapUnit eMap = pSdrModel->GetScaleUnit();
- Fraction aFact( GetMapFactor( MAP_POINT, eMap ).X() );
- long aMul = aFact.GetNumerator();
- long aDiv = aFact.GetDenominator() * 65536;
- aFact = Fraction( aMul, aDiv ); // nochmal versuchen zu kuerzen
- return BigMulDiv( nVal, aFact.GetNumerator(), aFact.GetDenominator() );
-}
-
-INT32 SvxMSDffManager::ScalePoint( INT32 nVal ) const
-{
- return BigMulDiv( nVal, nPntMul, nPntDiv );
-};
-
-void SvxMSDffManager::SetModel(SdrModel* pModel, long nApplicationScale)
-{
- pSdrModel = pModel;
- if( pModel && (0 < nApplicationScale) )
- {
- // PPT arbeitet nur mit Einheiten zu 576DPI
- // WW hingegen verwendet twips, dh. 1440DPI.
- MapUnit eMap = pSdrModel->GetScaleUnit();
- Fraction aFact( GetMapFactor(MAP_INCH, eMap).X() );
- long nMul=aFact.GetNumerator();
- long nDiv=aFact.GetDenominator()*nApplicationScale;
- aFact=Fraction(nMul,nDiv); // nochmal versuchen zu kuerzen
- // Bei 100TH_MM -> 2540/576=635/144
- // Bei Twip -> 1440/576=5/2
- nMapMul = aFact.GetNumerator();
- nMapDiv = aFact.GetDenominator();
- bNeedMap = nMapMul!=nMapDiv;
-
- // MS-DFF-Properties sind grossteils in EMU (English Metric Units) angegeben
- // 1mm=36000emu, 1twip=635emu
- aFact=GetMapFactor(MAP_100TH_MM,eMap).X();
- nMul=aFact.GetNumerator();
- nDiv=aFact.GetDenominator()*360;
- aFact=Fraction(nMul,nDiv); // nochmal versuchen zu kuerzen
- // Bei 100TH_MM -> 1/360
- // Bei Twip -> 14,40/(25,4*360)=144/91440=1/635
- nEmuMul=aFact.GetNumerator();
- nEmuDiv=aFact.GetDenominator();
-
- // Und noch was fuer typografische Points
- aFact=GetMapFactor(MAP_POINT,eMap).X();
- nPntMul=aFact.GetNumerator();
- nPntDiv=aFact.GetDenominator();
- }
- else
- {
- pModel = 0;
- nMapMul = nMapDiv = nMapXOfs = nMapYOfs = nEmuMul = nEmuDiv = nPntMul = nPntDiv = 0;
- bNeedMap = FALSE;
- }
-}
-
-BOOL SvxMSDffManager::SeekToShape( SvStream& rSt, void* /* pClientData */, UINT32 nId ) const
-{
- BOOL bRet = FALSE;
- if ( mpFidcls )
- {
- UINT32 nMerk = rSt.Tell();
- UINT32 nShapeId, nSec = ( nId >> 10 ) - 1;
- if ( nSec < mnIdClusters )
- {
- sal_IntPtr nOfs = (sal_IntPtr)maDgOffsetTable.Get( mpFidcls[ nSec ].dgid );
- if ( nOfs )
- {
- rSt.Seek( nOfs );
- DffRecordHeader aEscherF002Hd;
- rSt >> aEscherF002Hd;
- ULONG nEscherF002End = aEscherF002Hd.GetRecEndFilePos();
- DffRecordHeader aEscherObjListHd;
- while ( rSt.Tell() < nEscherF002End )
- {
- rSt >> aEscherObjListHd;
- if ( aEscherObjListHd.nRecVer != 0xf )
- aEscherObjListHd.SeekToEndOfRecord( rSt );
- else if ( aEscherObjListHd.nRecType == DFF_msofbtSpContainer )
- {
- DffRecordHeader aShapeHd;
- if ( SeekToRec( rSt, DFF_msofbtSp, aEscherObjListHd.GetRecEndFilePos(), &aShapeHd ) )
- {
- rSt >> nShapeId;
- if ( nId == nShapeId )
- {
- aEscherObjListHd.SeekToBegOfRecord( rSt );
- bRet = TRUE;
- break;
- }
- }
- aEscherObjListHd.SeekToEndOfRecord( rSt );
- }
- }
- }
- }
- if ( !bRet )
- rSt.Seek( nMerk );
- }
- return bRet;
-}
-
-FASTBOOL SvxMSDffManager::SeekToRec( SvStream& rSt, USHORT nRecId, ULONG nMaxFilePos, DffRecordHeader* pRecHd, ULONG nSkipCount ) const
-{
- FASTBOOL bRet = FALSE;
- ULONG nFPosMerk = rSt.Tell(); // FilePos merken fuer ggf. spaetere Restauration
- DffRecordHeader aHd;
- do
- {
- rSt >> aHd;
- if ( aHd.nRecType == nRecId )
- {
- if ( nSkipCount )
- nSkipCount--;
- else
- {
- bRet = TRUE;
- if ( pRecHd != NULL )
- *pRecHd = aHd;
- else
- aHd.SeekToBegOfRecord( rSt );
- }
- }
- if ( !bRet )
- aHd.SeekToEndOfRecord( rSt );
- }
- while ( rSt.GetError() == 0 && rSt.Tell() < nMaxFilePos && !bRet );
- if ( !bRet )
- rSt.Seek( nFPosMerk ); // FilePos restaurieren
- return bRet;
-}
-
-FASTBOOL SvxMSDffManager::SeekToRec2( USHORT nRecId1, USHORT nRecId2, ULONG nMaxFilePos, DffRecordHeader* pRecHd, ULONG nSkipCount ) const
-{
- FASTBOOL bRet = FALSE;
- ULONG nFPosMerk = rStCtrl.Tell(); // FilePos merken fuer ggf. spaetere Restauration
- DffRecordHeader aHd;
- do
- {
- rStCtrl >> aHd;
- if ( aHd.nRecType == nRecId1 || aHd.nRecType == nRecId2 )
- {
- if ( nSkipCount )
- nSkipCount--;
- else
- {
- bRet = TRUE;
- if ( pRecHd )
- *pRecHd = aHd;
- else
- aHd.SeekToBegOfRecord( rStCtrl );
- }
- }
- if ( !bRet )
- aHd.SeekToEndOfRecord( rStCtrl );
- }
- while ( rStCtrl.GetError() == 0 && rStCtrl.Tell() < nMaxFilePos && !bRet );
- if ( !bRet )
- rStCtrl.Seek( nFPosMerk ); // FilePos restaurieren
- return bRet;
-}
-
-
-FASTBOOL SvxMSDffManager::GetColorFromPalette( USHORT /* nNum */, Color& rColor ) const
-{
- // diese Methode ist in der zum Excel-Import
- // abgeleiteten Klasse zu ueberschreiben...
- rColor.SetColor( COL_WHITE );
- return TRUE;
-}
-
-
-Color SvxMSDffManager::MSO_CLR_ToColor( sal_uInt32 nColorCode, sal_uInt16 nContentProperty ) const
-{
- Color aColor( mnDefaultColor );
-
- // Fuer Textfarben: Header ist 0xfeRRGGBB
- if ( ( nColorCode & 0xfe000000 ) == 0xfe000000 )
- nColorCode &= 0x00ffffff;
-
- sal_uInt8 nUpper = (sal_uInt8)( nColorCode >> 24 );
- if( nUpper & 0x19 ) // if( nUpper & 0x1f )
- {
- if( ( nUpper & 0x08 ) || ( ( nUpper & 0x10 ) == 0 ) )
- {
- // SCHEMECOLOR
- if ( !GetColorFromPalette( ( nUpper & 8 ) ? (sal_uInt16)nColorCode : nUpper, aColor ) )
- {
- switch( nContentProperty )
- {
- case DFF_Prop_pictureTransparent :
- case DFF_Prop_shadowColor :
- case DFF_Prop_fillBackColor :
- case DFF_Prop_fillColor :
- aColor = Color( COL_WHITE );
- break;
- case DFF_Prop_lineColor :
- {
- aColor = Color( COL_BLACK );
- }
- break;
- }
- }
- }
- else // SYSCOLOR
- {
- const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
-
-// UINT16 nParameter = (BYTE)( nColorCode >> 16); // SJ: nice compiler optimization bug on windows, though downcasting
- UINT16 nParameter = sal_uInt16(( nColorCode >> 16 ) & 0x00ff); // the HiByte of nParameter is not zero, an exclusive AND is helping :o
- UINT16 nFunctionBits = (UINT16)( ( nColorCode & 0x00000f00 ) >> 8 );
- UINT16 nAdditionalFlags = (UINT16)( ( nColorCode & 0x0000f000) >> 8 );
- UINT16 nColorIndex = sal_uInt16(nColorCode & 0x00ff);
- UINT32 nPropColor = 0;
-
- sal_uInt16 nCProp = 0;
-
- switch ( nColorIndex )
- {
- case mso_syscolorButtonFace : aColor = rStyleSettings.GetFaceColor(); break;
- case mso_syscolorWindowText : aColor = rStyleSettings.GetWindowTextColor(); break;
- case mso_syscolorMenu : aColor = rStyleSettings.GetMenuColor(); break;
- case mso_syscolor3DLight :
- case mso_syscolorButtonHighlight :
- case mso_syscolorHighlight : aColor = rStyleSettings.GetHighlightColor(); break;
- case mso_syscolorHighlightText : aColor = rStyleSettings.GetHighlightTextColor(); break;
- case mso_syscolorCaptionText : aColor = rStyleSettings.GetMenuTextColor(); break;
- case mso_syscolorActiveCaption : aColor = rStyleSettings.GetHighlightColor(); break;
- case mso_syscolorButtonShadow : aColor = rStyleSettings.GetShadowColor(); break;
- case mso_syscolorButtonText : aColor = rStyleSettings.GetButtonTextColor(); break;
- case mso_syscolorGrayText : aColor = rStyleSettings.GetDeactiveColor(); break;
- case mso_syscolorInactiveCaption : aColor = rStyleSettings.GetDeactiveColor(); break;
- case mso_syscolorInactiveCaptionText : aColor = rStyleSettings.GetDeactiveColor(); break;
- case mso_syscolorInfoBackground : aColor = rStyleSettings.GetFaceColor(); break;
- case mso_syscolorInfoText : aColor = rStyleSettings.GetInfoTextColor(); break;
- case mso_syscolorMenuText : aColor = rStyleSettings.GetMenuTextColor(); break;
- case mso_syscolorScrollbar : aColor = rStyleSettings.GetFaceColor(); break;
- case mso_syscolorWindow : aColor = rStyleSettings.GetWindowColor(); break;
- case mso_syscolorWindowFrame : aColor = rStyleSettings.GetWindowColor(); break;
-
- case mso_colorFillColor :
- {
- nPropColor = GetPropertyValue( DFF_Prop_fillColor, 0xffffff );
- nCProp = DFF_Prop_fillColor;
- }
- break;
- case mso_colorLineOrFillColor : // ( use the line color only if there is a line )
- {
- if ( GetPropertyValue( DFF_Prop_fNoLineDrawDash ) & 8 )
- {
- nPropColor = GetPropertyValue( DFF_Prop_lineColor, 0 );
- nCProp = DFF_Prop_lineColor;
- }
- else
- {
- nPropColor = GetPropertyValue( DFF_Prop_fillColor, 0xffffff );
- nCProp = DFF_Prop_fillColor;
- }
- }
- break;
- case mso_colorLineColor :
- {
- nPropColor = GetPropertyValue( DFF_Prop_lineColor, 0 );
- nCProp = DFF_Prop_lineColor;
- }
- break;
- case mso_colorShadowColor :
- {
- nPropColor = GetPropertyValue( DFF_Prop_shadowColor, 0x808080 );
- nCProp = DFF_Prop_shadowColor;
- }
- break;
- case mso_colorThis : // ( use this color ... )
- {
- nPropColor = GetPropertyValue( DFF_Prop_fillColor, 0xffffff ); //?????????????
- nCProp = DFF_Prop_fillColor;
- }
- break;
- case mso_colorFillBackColor :
- {
- nPropColor = GetPropertyValue( DFF_Prop_fillBackColor, 0xffffff );
- nCProp = DFF_Prop_fillBackColor;
- }
- break;
- case mso_colorLineBackColor :
- {
- nPropColor = GetPropertyValue( DFF_Prop_lineBackColor, 0xffffff );
- nCProp = DFF_Prop_lineBackColor;
- }
- break;
- case mso_colorFillThenLine : // ( use the fillcolor unless no fill and line )
- {
- nPropColor = GetPropertyValue( DFF_Prop_fillColor, 0xffffff ); //?????????????
- nCProp = DFF_Prop_fillColor;
- }
- break;
- case mso_colorIndexMask : // ( extract the color index ) ?
- {
- nPropColor = GetPropertyValue( DFF_Prop_fillColor, 0xffffff ); //?????????????
- nCProp = DFF_Prop_fillColor;
- }
- break;
- }
- if ( nCProp && ( nPropColor & 0x10000000 ) == 0 ) // beware of looping recursive
- aColor = MSO_CLR_ToColor( nPropColor, nCProp );
-
- if( nAdditionalFlags & 0x80 ) // make color gray
- {
- UINT8 nZwi = aColor.GetLuminance();
- aColor = Color( nZwi, nZwi, nZwi );
- }
- switch( nFunctionBits )
- {
- case 0x01 : // darken color by parameter
- {
- aColor.SetRed( sal::static_int_cast< UINT8 >( ( nParameter * aColor.GetRed() ) >> 8 ) );
- aColor.SetGreen( sal::static_int_cast< UINT8 >( ( nParameter * aColor.GetGreen() ) >> 8 ) );
- aColor.SetBlue( sal::static_int_cast< UINT8 >( ( nParameter * aColor.GetBlue() ) >> 8 ) );
- }
- break;
- case 0x02 : // lighten color by parameter
- {
- UINT16 nInvParameter = ( 0x00ff - nParameter ) * 0xff;
- aColor.SetRed( sal::static_int_cast< UINT8 >( ( nInvParameter + ( nParameter * aColor.GetRed() ) ) >> 8 ) );
- aColor.SetGreen( sal::static_int_cast< UINT8 >( ( nInvParameter + ( nParameter * aColor.GetGreen() ) ) >> 8 ) );
- aColor.SetBlue( sal::static_int_cast< UINT8 >( ( nInvParameter + ( nParameter * aColor.GetBlue() ) ) >> 8 ) );
- }
- break;
- case 0x03 : // add grey level RGB(p,p,p)
- {
- INT16 nR = (INT16)aColor.GetRed() + (INT16)nParameter;
- INT16 nG = (INT16)aColor.GetGreen() + (INT16)nParameter;
- INT16 nB = (INT16)aColor.GetBlue() + (INT16)nParameter;
- if ( nR > 0x00ff )
- nR = 0x00ff;
- if ( nG > 0x00ff )
- nG = 0x00ff;
- if ( nB > 0x00ff )
- nB = 0x00ff;
- aColor = Color( (UINT8)nR, (UINT8)nG, (UINT8)nB );
- }
- break;
- case 0x04 : // substract grey level RGB(p,p,p)
- {
- INT16 nR = (INT16)aColor.GetRed() - (INT16)nParameter;
- INT16 nG = (INT16)aColor.GetGreen() - (INT16)nParameter;
- INT16 nB = (INT16)aColor.GetBlue() - (INT16)nParameter;
- if ( nR < 0 )
- nR = 0;
- if ( nG < 0 )
- nG = 0;
- if ( nB < 0 )
- nB = 0;
- aColor = Color( (UINT8)nR, (UINT8)nG, (UINT8)nB );
- }
- break;
- case 0x05 : // substract from grey level RGB(p,p,p)
- {
- INT16 nR = (INT16)nParameter - (INT16)aColor.GetRed();
- INT16 nG = (INT16)nParameter - (INT16)aColor.GetGreen();
- INT16 nB = (INT16)nParameter - (INT16)aColor.GetBlue();
- if ( nR < 0 )
- nR = 0;
- if ( nG < 0 )
- nG = 0;
- if ( nB < 0 )
- nB = 0;
- aColor = Color( (UINT8)nR, (UINT8)nG, (UINT8)nB );
- }
- break;
- case 0x06 : // per component: black if < p, white if >= p
- {
- aColor.SetRed( aColor.GetRed() < nParameter ? 0x00 : 0xff );
- aColor.SetGreen( aColor.GetGreen() < nParameter ? 0x00 : 0xff );
- aColor.SetBlue( aColor.GetBlue() < nParameter ? 0x00 : 0xff );
- }
- break;
- }
- if ( nAdditionalFlags & 0x40 ) // top-bit invert
- aColor = Color( aColor.GetRed() ^ 0x80, aColor.GetGreen() ^ 0x80, aColor.GetBlue() ^ 0x80 );
-
- if ( nAdditionalFlags & 0x20 ) // invert color
- aColor = Color(0xff - aColor.GetRed(), 0xff - aColor.GetGreen(), 0xff - aColor.GetBlue());
- }
- }
- else if ( ( nUpper & 4 ) && ( ( nColorCode & 0xfffff8 ) == 0 ) )
- { // case of nUpper == 4 powerpoint takes this as agrument for a colorschemecolor
- GetColorFromPalette( nUpper, aColor );
- }
- else // hart attributiert, eventuell mit Hinweis auf SYSTEMRGB
- aColor = Color( (BYTE)nColorCode, (BYTE)( nColorCode >> 8 ), (BYTE)( nColorCode >> 16 ) );
- return aColor;
-}
-
-FASTBOOL SvxMSDffManager::ReadDffString(SvStream& rSt, String& rTxt) const
-{
- FASTBOOL bRet=FALSE;
- DffRecordHeader aStrHd;
- if( !ReadCommonRecordHeader(aStrHd, rSt) )
- rSt.Seek( aStrHd.nFilePos );
- else if ( aStrHd.nRecType == DFF_PST_TextBytesAtom || aStrHd.nRecType == DFF_PST_TextCharsAtom )
- {
- FASTBOOL bUniCode=aStrHd.nRecType==DFF_PST_TextCharsAtom;
- bRet=TRUE;
- ULONG nBytes = aStrHd.nRecLen;
- MSDFFReadZString( rSt, rTxt, nBytes, bUniCode );
- if( !bUniCode )
- {
- for ( xub_StrLen n = 0; n < nBytes; n++ )
- {
- if( rTxt.GetChar( n ) == 0x0B )
- rTxt.SetChar( n, ' ' ); // Weicher Umbruch
- // TODO: Zeilenumbruch im Absatz via Outliner setzen.
- }
- }
- aStrHd.SeekToEndOfRecord( rSt );
- }
- else
- aStrHd.SeekToBegOfRecord( rSt );
- return bRet;
-}
-
-// sj: I just want to set a string for a text object that may contain multiple
-// paragraphs. If I now take a look at the follwing code I get the impression that
-// our outliner is too complicate to be used properly,
-void SvxMSDffManager::ReadObjText( const String& rText, SdrObject* pObj ) const
-{
- SdrTextObj* pText = PTR_CAST( SdrTextObj, pObj );
- if ( pText )
- {
- SdrOutliner& rOutliner = pText->ImpGetDrawOutliner();
- rOutliner.Init( OUTLINERMODE_TEXTOBJECT );
-
- BOOL bOldUpdateMode = rOutliner.GetUpdateMode();
- rOutliner.SetUpdateMode( FALSE );
- rOutliner.SetVertical( pText->IsVerticalWriting() );
-
- sal_uInt16 nParaIndex = 0;
- sal_uInt32 nParaSize;
- const sal_Unicode* pCurrent, *pBuf = rText.GetBuffer();
- const sal_Unicode* pEnd = rText.GetBuffer() + rText.Len();
-
- while( pBuf < pEnd )
- {
- pCurrent = pBuf;
-
- for ( nParaSize = 0; pBuf < pEnd; )
- {
- sal_Unicode nChar = *pBuf++;
- if ( nChar == 0xa )
- {
- if ( ( pBuf < pEnd ) && ( *pBuf == 0xd ) )
- pBuf++;
- break;
- }
- else if ( nChar == 0xd )
- {
- if ( ( pBuf < pEnd ) && ( *pBuf == 0xa ) )
- pBuf++;
- break;
- }
- else
- nParaSize++;
- }
- ESelection aSelection( nParaIndex, 0, nParaIndex, 0 );
- String aParagraph( pCurrent, (sal_uInt16)nParaSize );
- if ( !nParaIndex && !aParagraph.Len() ) // SJ: we are crashing if the first paragraph is empty ?
- aParagraph += (sal_Unicode)' '; // otherwise these two lines can be removed.
- rOutliner.Insert( aParagraph, nParaIndex, 0 );
- rOutliner.SetParaAttribs( nParaIndex, rOutliner.GetEmptyItemSet() );
-
- SfxItemSet aParagraphAttribs( rOutliner.GetEmptyItemSet() );
- if ( !aSelection.nStartPos )
- aParagraphAttribs.Put( SfxBoolItem( EE_PARA_BULLETSTATE, FALSE ) );
- aSelection.nStartPos = 0;
- rOutliner.QuickSetAttribs( aParagraphAttribs, aSelection );
- nParaIndex++;
- }
- OutlinerParaObject* pNewText = rOutliner.CreateParaObject();
- rOutliner.Clear();
- rOutliner.SetUpdateMode( bOldUpdateMode );
- pText->SetOutlinerParaObject( pNewText );
- }
-}
-
-FASTBOOL SvxMSDffManager::ReadObjText(SvStream& rSt, SdrObject* pObj) const
-{
- FASTBOOL bRet=FALSE;
- SdrTextObj* pText = PTR_CAST(SdrTextObj, pObj);
- if( pText )
- {
- DffRecordHeader aTextHd;
- if( !ReadCommonRecordHeader(aTextHd, rSt) )
- rSt.Seek( aTextHd.nFilePos );
- else if ( aTextHd.nRecType==DFF_msofbtClientTextbox )
- {
- bRet=TRUE;
- ULONG nRecEnd=aTextHd.GetRecEndFilePos();
- DffRecordHeader aHd;
- String aText;
-// UINT32 nInvent=pText->GetObjInventor();
-// UINT16 nIdent=pText->GetObjIdentifier();
-
- SdrOutliner& rOutliner=pText->ImpGetDrawOutliner();
-// sal_Int16 nMinDepth = rOutliner.GetMinDepth();
- USHORT nOutlMode = rOutliner.GetMode();
-
- { // Wohl 'nen kleiner Bug der EditEngine, das die
- // Absastzattribute bei Clear() nicht entfernt werden.
- FASTBOOL bClearParaAttribs = TRUE;
- rOutliner.SetStyleSheet( 0, NULL );
- SfxItemSet aSet(rOutliner.GetEmptyItemSet());
- aSet.Put(SvxColorItem( COL_BLACK ));
- rOutliner.SetParaAttribs(0,aSet);
- pText->SetMergedItemSet(aSet);
-
- bClearParaAttribs = FALSE;
- if( bClearParaAttribs )
- {
- // Wohl 'nen kleiner Bug der EditEngine, dass die
- // Absastzattribute bei Clear() nicht entfernt werden.
- rOutliner.SetParaAttribs(0,rOutliner.GetEmptyItemSet());
- }
- }
- rOutliner.Init( OUTLINERMODE_TEXTOBJECT );
-
-// ULONG nFilePosMerker=rSt.Tell();
- ////////////////////////////////////
- // TextString und MetaChars lesen //
- ////////////////////////////////////
- do
- {
- if( !ReadCommonRecordHeader(aHd, rSt) )
- rSt.Seek( aHd.nFilePos );
- else
- {
- switch (aHd.nRecType)
- {
- //case TextHeaderAtom
- //case TextSpecInfoAtom
- case DFF_PST_TextBytesAtom:
- case DFF_PST_TextCharsAtom:
- {
- aHd.SeekToBegOfRecord(rSt);
- ReadDffString(rSt, aText);
- }
- break;
- case DFF_PST_TextRulerAtom :
- {
- UINT16 nLen = (UINT16)aHd.nRecLen;
- if(nLen)
- {
- UINT16 nVal1, nVal2, nVal3;
- UINT16 nDefaultTab = 2540; // PPT def: 1 Inch //rOutliner.GetDefTab();
- UINT16 nMostrightTab = 0;
- SfxItemSet aSet(rOutliner.GetEmptyItemSet());
- SvxTabStopItem aTabItem(0, 0, SVX_TAB_ADJUST_DEFAULT, EE_PARA_TABS);
-
- rSt >> nVal1;
- rSt >> nVal2;
- nLen -= 4;
-
- // Allg. TAB verstellt auf Wert in nVal3
- if(nLen && (nVal1 & 0x0001))
- {
- rSt >> nVal3;
- nLen -= 2;
- nDefaultTab = (UINT16)(((UINT32)nVal3 * 1000) / 240);
- }
-
- // Weitere, frei gesetzte TABs
- if(nLen && (nVal1 & 0x0004))
- {
- rSt >> nVal1;
- nLen -= 2;
-
- // fest gesetzte TABs importieren
- while(nLen && nVal1--)
- {
- rSt >> nVal2;
- rSt >> nVal3;
- nLen -= 4;
-
- UINT16 nNewTabPos = (UINT16)(((UINT32)nVal2 * 1000) / 240);
- if(nNewTabPos > nMostrightTab)
- nMostrightTab = nNewTabPos;
-
- SvxTabStop aTabStop(nNewTabPos);
- aTabItem.Insert(aTabStop);
- }
- }
-
- // evtl. noch default-TABs ergaenzen (immer)
- UINT16 nObjWidth = sal_uInt16(pObj->GetSnapRect().GetWidth() + 1);
- UINT16 nDefaultTabPos = nDefaultTab;
-
- while(nDefaultTabPos <= nObjWidth && nDefaultTabPos <= nMostrightTab)
- nDefaultTabPos =
- nDefaultTabPos + nDefaultTab;
-
- while(nDefaultTabPos <= nObjWidth)
- {
- SvxTabStop aTabStop(nDefaultTabPos);
- aTabItem.Insert(aTabStop);
- nDefaultTabPos =
- nDefaultTabPos + nDefaultTab;
- }
-
- // Falls TABs angelegt wurden, setze diese
- if(aTabItem.Count())
- {
- aSet.Put(aTabItem);
- rOutliner.SetParaAttribs(0, aSet);
- }
- }
- }
- break;
- }
- aHd.SeekToEndOfRecord( rSt );
- }
- }
- while ( rSt.GetError() == 0 && rSt.Tell() < nRecEnd );
-
- ////////////////////////
- // SHIFT-Ret ersetzen //
- ////////////////////////
- if ( aText.Len() )
- {
- aText += ' ';
- aText.SetChar( aText.Len()-1, 0x0D );
- rOutliner.SetText( aText, rOutliner.GetParagraph( 0 ) );
-
- // SHIFT-Ret ersetzen im Outliner
- if(aText.GetTokenCount(0x0B) > 1)
- {
- UINT32 nParaCount = rOutliner.GetParagraphCount();
- for(UINT16 a=0;a<nParaCount;a++)
- {
- Paragraph* pActPara = rOutliner.GetParagraph(a);
- String aParaText = rOutliner.GetText(pActPara);
- for(UINT16 b=0;b<aParaText.Len();b++)
- {
- if( aParaText.GetChar( b ) == 0x0B)
- {
- ESelection aSelection(a, b, a, b+1);
- rOutliner.QuickInsertLineBreak(aSelection);
- }
- }
- }
- }
- }
- OutlinerParaObject* pNewText=rOutliner.CreateParaObject();
- rOutliner.Init( nOutlMode );
- pText->NbcSetOutlinerParaObject(pNewText);
- }
- else
- aTextHd.SeekToBegOfRecord(rSt);
-
- }
- return bRet;
-}
-
-//static
-void SvxMSDffManager::MSDFFReadZString( SvStream& rIn, String& rStr,
- ULONG nRecLen, FASTBOOL bUniCode )
-{
- sal_uInt16 nLen = (sal_uInt16)nRecLen;
- if( nLen )
- {
- if ( bUniCode )
- nLen >>= 1;
-
- String sBuf;
- sal_Unicode* pBuf = sBuf.AllocBuffer( nLen );
-
- if( bUniCode )
- {
- rIn.Read( (sal_Char*)pBuf, nLen << 1 );
-
-#ifdef OSL_BIGENDIAN
- for( sal_uInt16 n = 0; n < nLen; ++n, ++pBuf )
- *pBuf = SWAPSHORT( *pBuf );
-#endif // ifdef OSL_BIGENDIAN
- }
- else
- {
- // use the String-Data as buffer for the 8bit characters and
- // change then all to unicode
- sal_Char* pReadPos = ((sal_Char*)pBuf) + nLen;
- rIn.Read( (sal_Char*)pReadPos, nLen );
- for( sal_uInt16 n = 0; n < nLen; ++n, ++pBuf, ++pReadPos )
- *pBuf = ByteString::ConvertToUnicode( *pReadPos, RTL_TEXTENCODING_MS_1252 );
- }
-
- rStr = sBuf.EraseTrailingChars( 0 );
- }
- else
- rStr.Erase();
-}
-
-SdrObject* SvxMSDffManager::ImportFontWork( SvStream& rStCt, SfxItemSet& rSet, Rectangle& rBoundRect ) const
-{
- SdrObject* pRet = NULL;
- String aObjectText;
- String aFontName;
- BOOL bTextRotate = FALSE;
-
- ((SvxMSDffManager*)this)->mnFix16Angle = 0; // we don't want to use this property in future
- if ( SeekToContent( DFF_Prop_gtextUNICODE, rStCt ) )
- MSDFFReadZString( rStCt, aObjectText, GetPropertyValue( DFF_Prop_gtextUNICODE ), TRUE );
- if ( SeekToContent( DFF_Prop_gtextFont, rStCt ) )
- MSDFFReadZString( rStCt, aFontName, GetPropertyValue( DFF_Prop_gtextFont ), TRUE );
- if ( GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ) & 0x2000 )
- {
- // Text ist senkrecht formatiert, Box Kippen
- INT32 nHalfWidth = ( rBoundRect.GetWidth() + 1) >> 1;
- INT32 nHalfHeight = ( rBoundRect.GetHeight() + 1) >> 1;
- Point aTopLeft( rBoundRect.Left() + nHalfWidth - nHalfHeight,
- rBoundRect.Top() + nHalfHeight - nHalfWidth);
- Size aNewSize( rBoundRect.GetHeight(), rBoundRect.GetWidth() );
- Rectangle aNewRect( aTopLeft, aNewSize );
- rBoundRect = aNewRect;
-
- String aSrcText( aObjectText );
- aObjectText.Erase();
- for( UINT16 a = 0; a < aSrcText.Len(); a++ )
- {
- aObjectText += aSrcText.GetChar( a );
- aObjectText += '\n';
- }
- rSet.Put( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_CENTER ) );
- bTextRotate = TRUE;
- }
- if ( aObjectText.Len() )
- { // FontWork-Objekt Mit dem Text in aObjectText erzeugen
- SdrObject* pNewObj = new SdrRectObj( OBJ_TEXT, rBoundRect );
- if( pNewObj )
- {
- pNewObj->SetModel( pSdrModel );
- ((SdrRectObj*)pNewObj)->SetText( aObjectText );
- SdrFitToSizeType eFTS = SDRTEXTFIT_PROPORTIONAL;
- rSet.Put( SdrTextFitToSizeTypeItem( eFTS ) );
- rSet.Put( SdrTextAutoGrowHeightItem( FALSE ) );
- rSet.Put( SdrTextAutoGrowWidthItem( FALSE ) );
- rSet.Put( SvxFontItem( FAMILY_DONTKNOW, aFontName, String(),
- PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, EE_CHAR_FONTINFO ));
-
- pNewObj->SetMergedItemSet(rSet);
-
- pRet = pNewObj->ConvertToPolyObj( FALSE, FALSE );
- if( !pRet )
- pRet = pNewObj;
- else
- {
- pRet->NbcSetSnapRect( rBoundRect );
- SdrObject::Free( pNewObj );
- }
- if( bTextRotate )
- {
- double a = 9000 * nPi180;
- pRet->NbcRotate( rBoundRect.Center(), 9000, sin( a ), cos( a ) );
- }
- }
- }
- return pRet;
-}
-
-static Size lcl_GetPrefSize(const Graphic& rGraf, MapMode aWanted)
-{
- MapMode aPrefMapMode(rGraf.GetPrefMapMode());
- if (aPrefMapMode == aWanted)
- return rGraf.GetPrefSize();
- Size aRetSize;
- if (aPrefMapMode == MAP_PIXEL)
- {
- aRetSize = Application::GetDefaultDevice()->PixelToLogic(
- rGraf.GetPrefSize(), aWanted);
- }
- else
- {
- aRetSize = Application::GetDefaultDevice()->LogicToLogic(
- rGraf.GetPrefSize(), rGraf.GetPrefMapMode(), aWanted);
- }
- return aRetSize;
-}
-
-// sj: if the parameter pSet is null, then the resulting crop bitmap will be stored in rGraf,
-// otherwise rGraf is untouched and pSet is used to store the corresponding SdrGrafCropItem
-static void lcl_ApplyCropping( const DffPropSet& rPropSet, SfxItemSet* pSet, Graphic& rGraf )
-{
- sal_Int32 nCropTop = (sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_cropFromTop, 0 );
- sal_Int32 nCropBottom = (sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_cropFromBottom, 0 );
- sal_Int32 nCropLeft = (sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_cropFromLeft, 0 );
- sal_Int32 nCropRight = (sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_cropFromRight, 0 );
-
- if( nCropTop || nCropBottom || nCropLeft || nCropRight )
- {
- double fFactor;
- Size aCropSize;
- BitmapEx aCropBitmap;
- sal_uInt32 nTop( 0 ), nBottom( 0 ), nLeft( 0 ), nRight( 0 );
-
- if ( pSet ) // use crop attributes ?
- aCropSize = lcl_GetPrefSize( rGraf, MAP_100TH_MM );
- else
- {
- aCropBitmap = rGraf.GetBitmapEx();
- aCropSize = aCropBitmap.GetSizePixel();
- }
- if ( nCropTop )
- {
- fFactor = (double)nCropTop / 65536.0;
- nTop = (sal_uInt32)( ( (double)( aCropSize.Height() + 1 ) * fFactor ) + 0.5 );
- }
- if ( nCropBottom )
- {
- fFactor = (double)nCropBottom / 65536.0;
- nBottom = (sal_uInt32)( ( (double)( aCropSize.Height() + 1 ) * fFactor ) + 0.5 );
- }
- if ( nCropLeft )
- {
- fFactor = (double)nCropLeft / 65536.0;
- nLeft = (sal_uInt32)( ( (double)( aCropSize.Width() + 1 ) * fFactor ) + 0.5 );
- }
- if ( nCropRight )
- {
- fFactor = (double)nCropRight / 65536.0;
- nRight = (sal_uInt32)( ( (double)( aCropSize.Width() + 1 ) * fFactor ) + 0.5 );
- }
- if ( pSet ) // use crop attributes ?
- pSet->Put( SdrGrafCropItem( nLeft, nTop, nRight, nBottom ) );
- else
- {
- Rectangle aCropRect( nLeft, nTop, aCropSize.Width() - nRight, aCropSize.Height() - nBottom );
- aCropBitmap.Crop( aCropRect );
- rGraf = aCropBitmap;
- }
- }
-}
-
-SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, Rectangle& aBoundRect, const DffObjData& rObjData ) const
-{
- SdrObject* pRet = NULL;
- String aFilename;
- String aLinkFileName, aLinkFilterName;
- Rectangle aVisArea;
-
- MSO_BlipFlags eFlags = (MSO_BlipFlags)GetPropertyValue( DFF_Prop_pibFlags, mso_blipflagDefault );
- sal_uInt32 nBlipId = GetPropertyValue( DFF_Prop_pib, 0 );
- sal_Bool bGrfRead = sal_False,
-
- // Grafik verlinkt
- bLinkGrf = 0 != ( eFlags & mso_blipflagLinkToFile );
- {
- Graphic aGraf; // be sure this graphic is deleted before swapping out
- if( SeekToContent( DFF_Prop_pibName, rSt ) )
- MSDFFReadZString( rSt, aFilename, GetPropertyValue( DFF_Prop_pibName ), TRUE );
-
- // UND, ODER folgendes:
- if( !( eFlags & mso_blipflagDoNotSave ) ) // Grafik embedded
- {
- bGrfRead = GetBLIP( nBlipId, aGraf, &aVisArea );
- if ( !bGrfRead )
- {
- /*
- Still no luck, lets look at the end of this record for a FBSE pool,
- this fallback is a specific case for how word does it sometimes
- */
- rObjData.rSpHd.SeekToEndOfRecord( rSt );
- DffRecordHeader aHd;
- rSt >> aHd;
- if( DFF_msofbtBSE == aHd.nRecType )
- {
- const ULONG nSkipBLIPLen = 20;
- const ULONG nSkipShapePos = 4;
- const ULONG nSkipBLIP = 4;
- const ULONG nSkip =
- nSkipBLIPLen + 4 + nSkipShapePos + 4 + nSkipBLIP;
-
- if (nSkip <= aHd.nRecLen)
- {
- rSt.SeekRel(nSkip);
- if (0 == rSt.GetError())
- bGrfRead = GetBLIPDirect( rSt, aGraf, &aVisArea );
- }
- }
- }
- }
- if ( bGrfRead )
- {
- // the writer is doing it's own cropping, so this part affects only impress and calc
- if ( GetSvxMSDffSettings() & SVXMSDFF_SETTINGS_CROP_BITMAPS )
- lcl_ApplyCropping( *this, ( rObjData.nSpFlags & SP_FOLESHAPE ) == 0 ? &rSet : NULL, aGraf );
-
- if ( IsProperty( DFF_Prop_pictureTransparent ) )
- {
- UINT32 nTransColor = GetPropertyValue( DFF_Prop_pictureTransparent, 0 );
-
- if ( aGraf.GetType() == GRAPHIC_BITMAP )
- {
- BitmapEx aBitmapEx( aGraf.GetBitmapEx() );
- Bitmap aBitmap( aBitmapEx.GetBitmap() );
- Bitmap aMask( aBitmap.CreateMask( MSO_CLR_ToColor( nTransColor, DFF_Prop_pictureTransparent ), 9 ) );
- if ( aBitmapEx.IsTransparent() )
- aMask.CombineSimple( aBitmapEx.GetMask(), BMP_COMBINE_OR );
- aGraf = BitmapEx( aBitmap, aMask );
- }
- }
-
- sal_Int32 nContrast = GetPropertyValue( DFF_Prop_pictureContrast, 0x10000 );
- /*
- 0x10000 is msoffice 50%
- < 0x10000 is in units of 1/50th of 0x10000 per 1%
- > 0x10000 is in units where
- a msoffice x% is stored as 50/(100-x) * 0x10000
-
- plus, a (ui) microsoft % ranges from 0 to 100, OOO
- from -100 to 100, so also normalize into that range
- */
- if ( nContrast > 0x10000 )
- {
- double fX = nContrast;
- fX /= 0x10000;
- fX /= 51; // 50 + 1 to round
- fX = 1/fX;
- nContrast = static_cast<sal_Int32>(fX);
- nContrast -= 100;
- nContrast = -nContrast;
- nContrast = (nContrast-50)*2;
- }
- else if ( nContrast == 0x10000 )
- nContrast = 0;
- else
- {
- nContrast *= 101; //100 + 1 to round
- nContrast /= 0x10000;
- nContrast -= 100;
- }
- sal_Int16 nBrightness = (sal_Int16)( (sal_Int32)GetPropertyValue( DFF_Prop_pictureBrightness, 0 ) / 327 );
- sal_Int32 nGamma = GetPropertyValue( DFF_Prop_pictureGamma, 0x10000 );
- GraphicDrawMode eDrawMode = GRAPHICDRAWMODE_STANDARD;
- switch ( GetPropertyValue( DFF_Prop_pictureActive ) & 6 )
- {
- case 4 : eDrawMode = GRAPHICDRAWMODE_GREYS; break;
- case 6 : eDrawMode = GRAPHICDRAWMODE_MONO; break;
- case 0 :
- {
- //office considers the converted values of (in OOo) 70 to be the
- //"watermark" values, which can vary slightly due to rounding from the
- //above values
- if (( nContrast == -70 ) && ( nBrightness == 70 ))
- {
- nContrast = 0;
- nBrightness = 0;
- eDrawMode = GRAPHICDRAWMODE_WATERMARK;
- };
- }
- break;
- }
-
- if ( nContrast || nBrightness || ( nGamma != 0x10000 ) || ( eDrawMode != GRAPHICDRAWMODE_STANDARD ) )
- {
- if ( ( rObjData.nSpFlags & SP_FOLESHAPE ) == 0 )
- {
- if ( nBrightness )
- rSet.Put( SdrGrafLuminanceItem( nBrightness ) );
- if ( nContrast )
- rSet.Put( SdrGrafContrastItem( (sal_Int16)nContrast ) );
- if ( nGamma != 0x10000 )
- rSet.Put( SdrGrafGamma100Item( nGamma / 655 ) );
- if ( eDrawMode != GRAPHICDRAWMODE_STANDARD )
- rSet.Put( SdrGrafModeItem( eDrawMode ) );
- }
- else
- {
- if ( eDrawMode == GRAPHICDRAWMODE_WATERMARK )
- {
- nContrast = 60;
- nBrightness = 70;
- eDrawMode = GRAPHICDRAWMODE_STANDARD;
- }
- switch ( aGraf.GetType() )
- {
- case GRAPHIC_BITMAP :
- {
- BitmapEx aBitmapEx( aGraf.GetBitmapEx() );
- if ( nBrightness || nContrast || ( nGamma != 0x10000 ) )
- aBitmapEx.Adjust( nBrightness, (sal_Int16)nContrast, 0, 0, 0, (double)nGamma / 0x10000, FALSE );
- if ( eDrawMode == GRAPHICDRAWMODE_GREYS )
- aBitmapEx.Convert( BMP_CONVERSION_8BIT_GREYS );
- else if ( eDrawMode == GRAPHICDRAWMODE_MONO )
- aBitmapEx.Convert( BMP_CONVERSION_1BIT_THRESHOLD );
- aGraf = aBitmapEx;
-
- }
- break;
-
- case GRAPHIC_GDIMETAFILE :
- {
- GDIMetaFile aGdiMetaFile( aGraf.GetGDIMetaFile() );
- if ( nBrightness || nContrast || ( nGamma != 0x10000 ) )
- aGdiMetaFile.Adjust( nBrightness, (sal_Int16)nContrast, 0, 0, 0, (double)nGamma / 0x10000, FALSE );
- if ( eDrawMode == GRAPHICDRAWMODE_GREYS )
- aGdiMetaFile.Convert( MTF_CONVERSION_8BIT_GREYS );
- else if ( eDrawMode == GRAPHICDRAWMODE_MONO )
- aGdiMetaFile.Convert( MTF_CONVERSION_1BIT_THRESHOLD );
- aGraf = aGdiMetaFile;
- }
- break;
- default: break;
- }
- }
- }
- }
-
- // sollte es ein OLE-Object sein?
- if( bGrfRead && !bLinkGrf && IsProperty( DFF_Prop_pictureId ) )
- {
- // TODO/LATER: in future probably the correct aspect should be provided here
- sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT;
- // --> OD 2004-12-14 #i32596# - pass <nCalledByGroup> to method
- pRet = ImportOLE( GetPropertyValue( DFF_Prop_pictureId ), aGraf, aBoundRect, aVisArea, rObjData.nCalledByGroup, nAspect );
- // <--
- }
- if( !pRet )
- {
- pRet = new SdrGrafObj;
- if( bGrfRead )
- ((SdrGrafObj*)pRet)->SetGraphic( aGraf );
-
- if( bLinkGrf && !bGrfRead ) // sj: #i55484# if the graphic was embedded ( bGrfRead == true ) then
- { // we do not need to set a link. TODO: not to lose the information where the graphic is linked from
- UniString aName( ::URIHelper::SmartRel2Abs( INetURLObject(maBaseURL), aFilename, URIHelper::GetMaybeFileHdl(), true, false,
- INetURLObject::WAS_ENCODED,
- INetURLObject::DECODE_UNAMBIGUOUS ) );
-
- String aFilterName;
- INetURLObject aURLObj( aName );
-
- if( aURLObj.GetProtocol() == INET_PROT_NOT_VALID )
- {
- String aValidURL;
-
- if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aName, aValidURL ) )
- aURLObj = INetURLObject( aValidURL );
- }
-
- if( aURLObj.GetProtocol() != INET_PROT_NOT_VALID )
- {
- GraphicFilter* pGrfFilter = GetGrfFilter();
- aFilterName = pGrfFilter->GetImportFormatName(
- pGrfFilter->GetImportFormatNumberForShortName( aURLObj.getExtension() ) );
- }
-
- aLinkFileName = aName;
- aLinkFilterName = aFilterName;
- }
- }
-
- // set the size from BLIP if there is one
- if ( pRet && bGrfRead && !aVisArea.IsEmpty() )
- pRet->SetBLIPSizeRectangle( aVisArea );
-
- if ( !pRet->GetName().Len() ) // SJ 22.02.00 : PPT OLE IMPORT:
- { // name is already set in ImportOLE !!
- // JP 01.12.99: SetName before SetModel - because in the other order the Bug 70098 is active
- if ( ( eFlags & mso_blipflagType ) != mso_blipflagComment )
- {
- INetURLObject aURL;
- aURL.SetSmartURL( aFilename );
- pRet->SetName( aURL.getBase() );
- }
- else
- pRet->SetName( aFilename );
- }
- }
- pRet->SetModel( pSdrModel ); // fuer GraphicLink erforderlich
- pRet->SetLogicRect( aBoundRect );
-
- if ( pRet->ISA( SdrGrafObj ) )
- {
- if( aLinkFileName.Len() )
- ((SdrGrafObj*)pRet)->SetGraphicLink( aLinkFileName, aLinkFilterName );
-
- if ( bLinkGrf && !bGrfRead )
- {
- ((SdrGrafObj*)pRet)->ForceSwapIn();
- Graphic aGraf(((SdrGrafObj*)pRet)->GetGraphic());
- lcl_ApplyCropping( *this, &rSet, aGraf );
- }
- ((SdrGrafObj*)pRet)->ForceSwapOut();
- }
-
- return pRet;
-}
-
-// PptSlidePersistEntry& rPersistEntry, SdPage* pPage
-SdrObject* SvxMSDffManager::ImportObj( SvStream& rSt, void* pClientData,
- Rectangle& rClientRect, const Rectangle& rGlobalChildRect, int nCalledByGroup, sal_Int32* pShapeId )
-{
- SdrObject* pRet = NULL;
- DffRecordHeader aObjHd;
- rSt >> aObjHd;
- if ( aObjHd.nRecType == DFF_msofbtSpgrContainer )
- {
- pRet = ImportGroup( aObjHd, rSt, pClientData, rClientRect, rGlobalChildRect, nCalledByGroup, pShapeId );
- }
- else if ( aObjHd.nRecType == DFF_msofbtSpContainer )
- {
- pRet = ImportShape( aObjHd, rSt, pClientData, rClientRect, rGlobalChildRect, nCalledByGroup, pShapeId );
- }
- aObjHd.SeekToBegOfRecord( rSt ); // FilePos restaurieren
- return pRet;
-}
-
-SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& rSt, void* pClientData,
- Rectangle& rClientRect, const Rectangle& rGlobalChildRect,
- int nCalledByGroup, sal_Int32* pShapeId )
-{
- SdrObject* pRet = NULL;
-
- if( pShapeId )
- *pShapeId = 0;
-
- rHd.SeekToContent( rSt );
- DffRecordHeader aRecHd; // the first atom has to be the SpContainer for the GroupObject
- rSt >> aRecHd;
- if ( aRecHd.nRecType == DFF_msofbtSpContainer )
- {
- INT32 nGroupRotateAngle = 0;
- INT32 nSpFlags = 0;
- mnFix16Angle = 0;
- aRecHd.SeekToBegOfRecord( rSt );
- pRet = ImportObj( rSt, pClientData, rClientRect, rGlobalChildRect, nCalledByGroup + 1, pShapeId );
- if ( pRet )
- {
- nSpFlags = nGroupShapeFlags;
- nGroupRotateAngle = mnFix16Angle;
-
- Rectangle aClientRect( rClientRect );
-
- Rectangle aGlobalChildRect;
- if ( !nCalledByGroup || rGlobalChildRect.IsEmpty() )
- aGlobalChildRect = GetGlobalChildAnchor( rHd, rSt, aClientRect );
- else
- aGlobalChildRect = rGlobalChildRect;
-
- if ( ( nGroupRotateAngle > 4500 && nGroupRotateAngle <= 13500 )
- || ( nGroupRotateAngle > 22500 && nGroupRotateAngle <= 31500 ) )
- {
- sal_Int32 nHalfWidth = ( aGlobalChildRect.GetWidth() + 1 ) >> 1;
- sal_Int32 nHalfHeight = ( aGlobalChildRect.GetHeight() + 1 ) >> 1;
- Point aTopLeft( aGlobalChildRect.Left() + nHalfWidth - nHalfHeight,
- aGlobalChildRect.Top() + nHalfHeight - nHalfWidth );
- Size aNewSize( aGlobalChildRect.GetHeight(), aGlobalChildRect.GetWidth() );
- Rectangle aNewRect( aTopLeft, aNewSize );
- aGlobalChildRect = aNewRect;
- }
-
- // now importing the inner objects of the group
- aRecHd.SeekToEndOfRecord( rSt );
- while ( ( rSt.GetError() == 0 ) && ( rSt.Tell() < rHd.GetRecEndFilePos() ) )
- {
- DffRecordHeader aRecHd2;
- rSt >> aRecHd2;
- if ( aRecHd2.nRecType == DFF_msofbtSpgrContainer )
- {
- Rectangle aGroupClientAnchor, aGroupChildAnchor;
- GetGroupAnchors( aRecHd2, rSt, aGroupClientAnchor, aGroupChildAnchor, aClientRect, aGlobalChildRect );
- aRecHd2.SeekToBegOfRecord( rSt );
- sal_Int32 nShapeId;
- SdrObject* pTmp = ImportGroup( aRecHd2, rSt, pClientData, aGroupClientAnchor, aGroupChildAnchor, nCalledByGroup + 1, &nShapeId );
- if ( pTmp )
- {
- ((SdrObjGroup*)pRet)->GetSubList()->NbcInsertObject( pTmp );
- if( nShapeId )
- insertShapeId( nShapeId, pTmp );
- }
- }
- else if ( aRecHd2.nRecType == DFF_msofbtSpContainer )
- {
- aRecHd2.SeekToBegOfRecord( rSt );
- sal_Int32 nShapeId;
- SdrObject* pTmp = ImportShape( aRecHd2, rSt, pClientData, aClientRect, aGlobalChildRect, nCalledByGroup + 1, &nShapeId );
- if ( pTmp )
- {
- ((SdrObjGroup*)pRet)->GetSubList()->NbcInsertObject( pTmp );
- if( nShapeId )
- insertShapeId( nShapeId, pTmp );
- }
- }
- aRecHd2.SeekToEndOfRecord( rSt );
- }
-
- // pRet->NbcSetSnapRect( aGroupBound );
- if ( nGroupRotateAngle )
- {
- double a = nGroupRotateAngle * nPi180;
- pRet->NbcRotate( aClientRect.Center(), nGroupRotateAngle, sin( a ), cos( a ) );
- }
- if ( nSpFlags & SP_FFLIPV ) // Vertikal gespiegelt?
- { // BoundRect in aBoundRect
- Point aLeft( aClientRect.Left(), ( aClientRect.Top() + aClientRect.Bottom() ) >> 1 );
- Point aRight( aLeft.X() + 1000, aLeft.Y() );
- pRet->NbcMirror( aLeft, aRight );
- }
- if ( nSpFlags & SP_FFLIPH ) // Horizontal gespiegelt?
- { // BoundRect in aBoundRect
- Point aTop( ( aClientRect.Left() + aClientRect.Right() ) >> 1, aClientRect.Top() );
- Point aBottom( aTop.X(), aTop.Y() + 1000 );
- pRet->NbcMirror( aTop, aBottom );
- }
- }
- }
- return pRet;
-}
-
-SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& rSt, void* pClientData,
- Rectangle& rClientRect, const Rectangle& rGlobalChildRect,
- int nCalledByGroup, sal_Int32* pShapeId )
-{
- SdrObject* pRet = NULL;
-
- if( pShapeId )
- *pShapeId = 0;
-
- rHd.SeekToBegOfRecord( rSt );
- Rectangle aBoundRect( rClientRect );
- DffObjData aObjData( rHd, aBoundRect, nCalledByGroup );
- maShapeRecords.Consume( rSt, FALSE );
- aObjData.bShapeType = maShapeRecords.SeekToContent( rSt, DFF_msofbtSp, SEEK_FROM_BEGINNING );
- if ( aObjData.bShapeType )
- {
- rSt >> aObjData.nShapeId
- >> aObjData.nSpFlags;
- aObjData.eShapeType = (MSO_SPT)maShapeRecords.Current()->nRecInstance;
- }
- else
- {
- aObjData.nShapeId = 0;
- aObjData.nSpFlags = 0;
- aObjData.eShapeType = mso_sptNil;
- }
-
- if( pShapeId )
- *pShapeId = aObjData.nShapeId;
-
- if ( mbTracing )
- mpTracer->AddAttribute( aObjData.nSpFlags & SP_FGROUP
- ? rtl::OUString::createFromAscii( "GroupShape" )
- : rtl::OUString::createFromAscii( "Shape" ),
- rtl::OUString::valueOf( (sal_Int32)aObjData.nShapeId ) );
- aObjData.bOpt = maShapeRecords.SeekToContent( rSt, DFF_msofbtOPT, SEEK_FROM_CURRENT_AND_RESTART );
- if ( aObjData.bOpt )
- {
- maShapeRecords.Current()->SeekToBegOfRecord( rSt );
-#ifdef DBG_AUTOSHAPE
- ReadPropSet( rSt, pClientData, (UINT32)aObjData.eShapeType );
-#else
- ReadPropSet( rSt, pClientData );
-#endif
- }
- else
- {
- InitializePropSet(); // get the default PropSet
- ( (DffPropertyReader*) this )->mnFix16Angle = 0;
- }
-
- aObjData.bChildAnchor = maShapeRecords.SeekToContent( rSt, DFF_msofbtChildAnchor, SEEK_FROM_CURRENT_AND_RESTART );
- if ( aObjData.bChildAnchor )
- {
- INT32 l, o, r, u;
- rSt >> l >> o >> r >> u;
- Scale( l );
- Scale( o );
- Scale( r );
- Scale( u );
- aObjData.aChildAnchor = Rectangle( l, o, r, u );
- if ( !rGlobalChildRect.IsEmpty() && !rClientRect.IsEmpty() && rGlobalChildRect.GetWidth() && rGlobalChildRect.GetHeight() )
- {
- double fl = l;
- double fo = o;
- double fWidth = r - l;
- double fHeight= u - o;
- double fXScale = (double)rClientRect.GetWidth() / (double)rGlobalChildRect.GetWidth();
- double fYScale = (double)rClientRect.GetHeight() / (double)rGlobalChildRect.GetHeight();
- fl = ( ( l - rGlobalChildRect.Left() ) * fXScale ) + rClientRect.Left();
- fo = ( ( o - rGlobalChildRect.Top() ) * fYScale ) + rClientRect.Top();
- fWidth *= fXScale;
- fHeight *= fYScale;
- aObjData.aChildAnchor = Rectangle( Point( (sal_Int32)fl, (sal_Int32)fo ), Size( (sal_Int32)( fWidth + 1 ), (sal_Int32)( fHeight + 1 ) ) );
- }
- }
-
- aObjData.bClientAnchor = maShapeRecords.SeekToContent( rSt, DFF_msofbtClientAnchor, SEEK_FROM_CURRENT_AND_RESTART );
- if ( aObjData.bClientAnchor )
- ProcessClientAnchor2( rSt, *maShapeRecords.Current(), pClientData, aObjData );
-
- if ( aObjData.bChildAnchor )
- aBoundRect = aObjData.aChildAnchor;
-
- if ( aObjData.nSpFlags & SP_FBACKGROUND )
- aBoundRect = Rectangle( Point(), Size( 1, 1 ) );
-
- Rectangle aTextRect;
- if ( !aBoundRect.IsEmpty() )
- { // Rotation auf BoundingBox anwenden, BEVOR ien Objekt generiert wurde
- if( mnFix16Angle )
- {
- long nAngle = mnFix16Angle;
- if ( ( nAngle > 4500 && nAngle <= 13500 ) || ( nAngle > 22500 && nAngle <= 31500 ) )
- {
- INT32 nHalfWidth = ( aBoundRect.GetWidth() + 1 ) >> 1;
- INT32 nHalfHeight = ( aBoundRect.GetHeight() + 1 ) >> 1;
- Point aTopLeft( aBoundRect.Left() + nHalfWidth - nHalfHeight,
- aBoundRect.Top() + nHalfHeight - nHalfWidth );
- Size aNewSize( aBoundRect.GetHeight(), aBoundRect.GetWidth() );
- Rectangle aNewRect( aTopLeft, aNewSize );
- aBoundRect = aNewRect;
- }
- }
- aTextRect = aBoundRect;
- FASTBOOL bGraphic = IsProperty( DFF_Prop_pib ) ||
- IsProperty( DFF_Prop_pibName ) ||
- IsProperty( DFF_Prop_pibFlags );
-
- if ( aObjData.nSpFlags & SP_FGROUP )
- {
- pRet = new SdrObjGroup;
- /* After CWS aw033 has been integrated, an empty group object
- cannot store its resulting bounding rectangle anymore. We have
- to return this rectangle via rClientRect now, but only, if
- caller has not passed an own bounding ractangle. */
- if ( rClientRect.IsEmpty() )
- rClientRect = aBoundRect;
- nGroupShapeFlags = aObjData.nSpFlags; // #73013#
- }
- else if ( ( aObjData.eShapeType != mso_sptNil ) || IsProperty( DFF_Prop_pVertices ) || bGraphic )
- {
- SfxItemSet aSet( pSdrModel->GetItemPool() );
-
- sal_Bool bIsConnector = ( ( aObjData.eShapeType >= mso_sptStraightConnector1 ) && ( aObjData.eShapeType <= mso_sptCurvedConnector5 ) );
- sal_Bool bIsCustomShape = sal_False;
- sal_Int32 nObjectRotation = mnFix16Angle;
- sal_uInt32 nSpFlags = aObjData.nSpFlags;
-
- if ( bGraphic )
- pRet = ImportGraphic( rSt, aSet, aBoundRect, aObjData ); // SJ: #68396# is no longer true (fixed in ppt2000)
- else
- {
- // Check if we are using our new as shape type. This is done by
- // the PowerPoint import now. As result nearly each escher object
- // will be imported as customshape, this is also done in the case for
- // simple text objects.
- // The new shape is having the advantage to fully support wordwrapping
- // and autogrow size attributes.
-
- if ( GetSvxMSDffSettings() & SVXMSDFF_SETTINGS_IMPORT_IAS )
- {
- if ( GetCustomShapeContent( aObjData.eShapeType ) || IsProperty( DFF_Prop_pVertices ) )
- {
-
- ApplyAttributes( rSt, aSet, aObjData.eShapeType, aObjData.nSpFlags );
-
-// the com.sun.star.drawing.EnhancedCustomShapeEngine is default, so we do not need to set a hard attribute
-// aSet.Put( SdrCustomShapeEngineItem( String::CreateFromAscii( "com.sun.star.drawing.EnhancedCustomShapeEngine" ) ) );
- pRet = new SdrObjCustomShape();
- pRet->SetModel( pSdrModel );
-
- sal_Bool bIsFontwork = ( GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ) & 0x4000 ) != 0;
-
- // in case of a FontWork, the text is set by the escher import
- if ( bIsFontwork )
- {
- String aObjectText;
- String aFontName;
- MSO_GeoTextAlign eGeoTextAlign;
-
- if ( SeekToContent( DFF_Prop_gtextFont, rSt ) )
- {
- SvxFontItem aLatin(EE_CHAR_FONTINFO), aAsian(EE_CHAR_FONTINFO_CJK), aComplex(EE_CHAR_FONTINFO_CTL);
- GetDefaultFonts( aLatin, aAsian, aComplex );
-
- MSDFFReadZString( rSt, aFontName, GetPropertyValue( DFF_Prop_gtextFont ), TRUE );
- aSet.Put( SvxFontItem( aLatin.GetFamily(), aFontName, aLatin.GetStyleName(),
- PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, EE_CHAR_FONTINFO ));
- aSet.Put( SvxFontItem( aLatin.GetFamily(), aFontName, aLatin.GetStyleName(),
- PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, EE_CHAR_FONTINFO_CJK ) );
- aSet.Put( SvxFontItem( aLatin.GetFamily(), aFontName, aLatin.GetStyleName(),
- PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, EE_CHAR_FONTINFO_CTL ) );
- }
-
- // SJ: applying fontattributes for Fontwork :
- if ( IsHardAttribute( DFF_Prop_gtextFItalic ) )
- aSet.Put( SvxPostureItem( ( GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ) & 0x0010 ) != 0 ? ITALIC_NORMAL : ITALIC_NONE, EE_CHAR_ITALIC ) );
-
- if ( IsHardAttribute( DFF_Prop_gtextFBold ) )
- aSet.Put( SvxWeightItem( ( GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ) & 0x0020 ) != 0 ? WEIGHT_BOLD : WEIGHT_NORMAL, EE_CHAR_WEIGHT ) );
-
- // SJ TODO: Vertical Writing is not correct, instead this should be
- // replaced through "CharacterRotation" by 90°, therefore a new Item has to be
- // supported by svx core, api and xml file format
- ((SdrObjCustomShape*)pRet)->SetVerticalWriting( ( GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ) & 0x2000 ) != 0 );
-
- if ( SeekToContent( DFF_Prop_gtextUNICODE, rSt ) )
- {
- MSDFFReadZString( rSt, aObjectText, GetPropertyValue( DFF_Prop_gtextUNICODE ), TRUE );
- ReadObjText( aObjectText, pRet );
- }
-
- eGeoTextAlign = ( (MSO_GeoTextAlign)GetPropertyValue( DFF_Prop_gtextAlign, mso_alignTextCenter ) );
- {
- SdrTextHorzAdjust eHorzAdjust;
- switch( eGeoTextAlign )
- {
- case mso_alignTextLetterJust :
- case mso_alignTextWordJust :
- case mso_alignTextStretch : eHorzAdjust = SDRTEXTHORZADJUST_BLOCK; break;
- default:
- case mso_alignTextInvalid :
- case mso_alignTextCenter : eHorzAdjust = SDRTEXTHORZADJUST_CENTER; break;
- case mso_alignTextLeft : eHorzAdjust = SDRTEXTHORZADJUST_LEFT; break;
- case mso_alignTextRight : eHorzAdjust = SDRTEXTHORZADJUST_RIGHT; break;
- }
- aSet.Put( SdrTextHorzAdjustItem( eHorzAdjust ) );
-
- SdrFitToSizeType eFTS = SDRTEXTFIT_NONE;
- if ( eGeoTextAlign == mso_alignTextStretch )
- eFTS = SDRTEXTFIT_ALLLINES;
- aSet.Put( SdrTextFitToSizeTypeItem( eFTS ) );
- }
- if ( IsProperty( DFF_Prop_gtextSpacing ) )
- {
- sal_Int32 nTextWidth = GetPropertyValue( DFF_Prop_gtextSpacing, 100 < 16 ) / 655;
- if ( nTextWidth != 100 )
- aSet.Put( SvxCharScaleWidthItem( (sal_uInt16)nTextWidth, EE_CHAR_FONTWIDTH ) );
- }
- if ( GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ) & 0x1000 ) // SJ: Font Kerning On ?
- aSet.Put( SvxKerningItem( 1, EE_CHAR_KERNING ) );
- }
- pRet->SetMergedItemSet( aSet );
-
- // sj: taking care of rtl, ltr. In case of fontwork mso. seems not to be able to set
- // proper text directions, instead the text default is depending to the string.
- // so we have to calculate the a text direction from string:
- if ( bIsFontwork )
- {
- OutlinerParaObject* pParaObj = ((SdrObjCustomShape*)pRet)->GetOutlinerParaObject();
- if ( pParaObj )
- {
- SdrOutliner& rOutliner = ((SdrObjCustomShape*)pRet)->ImpGetDrawOutliner();
- BOOL bOldUpdateMode = rOutliner.GetUpdateMode();
- SdrModel* pModel = pRet->GetModel();
- if ( pModel )
- rOutliner.SetStyleSheetPool( (SfxStyleSheetPool*)pModel->GetStyleSheetPool() );
- rOutliner.SetUpdateMode( FALSE );
- rOutliner.SetText( *pParaObj );
- VirtualDevice aVirDev( 1 );
- aVirDev.SetMapMode( MAP_100TH_MM );
- sal_uInt32 i, nParagraphs = rOutliner.GetParagraphCount();
- if ( nParagraphs )
- {
- sal_Bool bCreateNewParaObject = sal_False;
- for ( i = 0; i < nParagraphs; i++ )
- {
- BOOL bIsRTL = aVirDev.GetTextIsRTL( rOutliner.GetText( rOutliner.GetParagraph( i ) ), 0, STRING_LEN );
- if ( bIsRTL )
- {
- SfxItemSet aSet2( rOutliner.GetParaAttribs( (USHORT)i ) );
- aSet2.Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) );
- rOutliner.SetParaAttribs( (USHORT)i, aSet2 );
- bCreateNewParaObject = sal_True;
- }
- }
- if ( bCreateNewParaObject )
- {
- OutlinerParaObject* pNewText = rOutliner.CreateParaObject();
- rOutliner.Init( OUTLINERMODE_TEXTOBJECT );
- ((SdrObjCustomShape*)pRet)->NbcSetOutlinerParaObject( pNewText );
- }
- }
- rOutliner.Clear();
- rOutliner.SetUpdateMode( bOldUpdateMode );
- }
- }
-
- // mso_sptArc special treating:
- // sj: since we actually can't render the arc because of its weird SnapRect settings,
- // we will create a new CustomShape, that can be saved/loaded without problems.
- // We will change the shape type, so this code applys only if importing arcs from msoffice.
- if ( aObjData.eShapeType == mso_sptArc )
- {
- const rtl::OUString sAdjustmentValues( RTL_CONSTASCII_USTRINGPARAM ( "AdjustmentValues" ) );
- const rtl::OUString sCoordinates( RTL_CONSTASCII_USTRINGPARAM ( "Coordinates" ) );
- const rtl::OUString sHandles( RTL_CONSTASCII_USTRINGPARAM ( "Handles" ) );
- const rtl::OUString sEquations( RTL_CONSTASCII_USTRINGPARAM ( "Equations" ) );
- const rtl::OUString sViewBox( RTL_CONSTASCII_USTRINGPARAM ( "ViewBox" ) );
- const rtl::OUString sPath( RTL_CONSTASCII_USTRINGPARAM ( "Path" ) );
- const rtl::OUString sTextFrames( RTL_CONSTASCII_USTRINGPARAM ( "TextFrames" ) );
- SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)((SdrObjCustomShape*)pRet)->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
- com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair> seqCoordinates;
- com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue > seqAdjustmentValues;
-
- // before clearing the GeometryItem we have to store the current Coordinates
- const uno::Any* pAny = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sPath, sCoordinates );
- Rectangle aPolyBoundRect;
- if ( pAny && ( *pAny >>= seqCoordinates ) && ( seqCoordinates.getLength() >= 4 ) )
- {
- sal_Int32 nPtNum, nNumElemVert = seqCoordinates.getLength();
- XPolygon aXP( (sal_uInt16)nNumElemVert );
-// const EnhancedCustomShapeParameterPair* pTmp = seqCoordinates.getArray();
- for ( nPtNum = 0; nPtNum < nNumElemVert; nPtNum++ )
- {
- Point aP;
- sal_Int32 nX = 0, nY = 0;
- seqCoordinates[ nPtNum ].First.Value >>= nX;
- seqCoordinates[ nPtNum ].Second.Value >>= nY;
- aP.X() = nX;
- aP.Y() = nY;
- aXP[ (sal_uInt16)nPtNum ] = aP;
- }
- aPolyBoundRect = Rectangle( aXP.GetBoundRect() );
- }
- else
- aPolyBoundRect = Rectangle( -21600, 0, 21600, 43200 ); // defaulting
-
- // clearing items, so MergeDefaultAttributes will set the corresponding defaults from EnhancedCustomShapeGeometry
- aGeometryItem.ClearPropertyValue( sHandles );
- aGeometryItem.ClearPropertyValue( sEquations );
- aGeometryItem.ClearPropertyValue( sViewBox );
- aGeometryItem.ClearPropertyValue( sPath );
-
- sal_Int32 nEndAngle = 9000;
- sal_Int32 nStartAngle = 0;
- pAny = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sAdjustmentValues );
- if ( pAny && ( *pAny >>= seqAdjustmentValues ) && seqAdjustmentValues.getLength() > 1 )
- {
- double fNumber;
- if ( seqAdjustmentValues[ 0 ].State == com::sun::star::beans::PropertyState_DIRECT_VALUE )
- {
- seqAdjustmentValues[ 0 ].Value >>= fNumber;
- nEndAngle = NormAngle360( - (sal_Int32)fNumber * 100 );
- }
- else
- {
- fNumber = 270.0;
- seqAdjustmentValues[ 0 ].Value <<= fNumber;
- seqAdjustmentValues[ 0 ].State = com::sun::star::beans::PropertyState_DIRECT_VALUE; // so this value will properly be stored
- }
-
- if ( seqAdjustmentValues[ 1 ].State == com::sun::star::beans::PropertyState_DIRECT_VALUE )
- {
- seqAdjustmentValues[ 1 ].Value >>= fNumber;
- nStartAngle = NormAngle360( - (sal_Int32)fNumber * 100 );
- }
- else
- {
- fNumber = 0.0;
- seqAdjustmentValues[ 0 ].Value <<= fNumber;
- seqAdjustmentValues[ 1 ].State = com::sun::star::beans::PropertyState_DIRECT_VALUE;
- }
-
- PropertyValue aPropVal;
- aPropVal.Name = sAdjustmentValues;
- aPropVal.Value <<= seqAdjustmentValues;
- aGeometryItem.SetPropertyValue( aPropVal ); // storing the angle attribute
- }
- if ( nStartAngle != nEndAngle )
- {
- XPolygon aXPoly( aPolyBoundRect.Center(), aPolyBoundRect.GetWidth() / 2, aPolyBoundRect.GetHeight() / 2,
- (USHORT)nStartAngle / 10, (USHORT)nEndAngle / 10, TRUE );
- Rectangle aPolyPieRect( aXPoly.GetBoundRect() );
-
- double fYScale, fXScale;
- double fYOfs, fXOfs;
-
- Point aP( aBoundRect.Center() );
- Size aS( aBoundRect.GetSize() );
- aP.X() -= aS.Width() / 2;
- aP.Y() -= aS.Height() / 2;
- Rectangle aLogicRect( aP, aS );
-
- fYOfs = fXOfs = 0.0;
-
- if ( aPolyBoundRect.GetWidth() && aPolyPieRect.GetWidth() )
- {
- fXScale = (double)aLogicRect.GetWidth() / (double)aPolyPieRect.GetWidth();
- if ( nSpFlags & SP_FFLIPH )
- fXOfs = ( (double)aPolyPieRect.Right() - (double)aPolyBoundRect.Right() ) * fXScale;
- else
- fXOfs = ( (double)aPolyBoundRect.Left() - (double)aPolyPieRect.Left() ) * fXScale;
- }
- if ( aPolyBoundRect.GetHeight() && aPolyPieRect.GetHeight() )
- {
- fYScale = (double)aLogicRect.GetHeight() / (double)aPolyPieRect.GetHeight();
- if ( nSpFlags & SP_FFLIPV )
- fYOfs = ( (double)aPolyPieRect.Bottom() - (double)aPolyBoundRect.Bottom() ) * fYScale;
- else
- fYOfs = ((double)aPolyBoundRect.Top() - (double)aPolyPieRect.Top() ) * fYScale;
- }
-
- fXScale = (double)aPolyBoundRect.GetWidth() / (double)aPolyPieRect.GetWidth();
- fYScale = (double)aPolyBoundRect.GetHeight() / (double)aPolyPieRect.GetHeight();
-
- Rectangle aOldBoundRect( aBoundRect );
- aBoundRect = Rectangle( Point( aLogicRect.Left() + (sal_Int32)fXOfs, aLogicRect.Top() + (sal_Int32)fYOfs ),
- Size( (sal_Int32)( aLogicRect.GetWidth() * fXScale ), (sal_Int32)( aLogicRect.GetHeight() * fYScale ) ) );
-
- // creating the text frame -> scaling into (0,0),(21600,21600) destination coordinate system
- double fTextFrameScaleX = (double)21600 / (double)aPolyBoundRect.GetWidth();
- double fTextFrameScaleY = (double)21600 / (double)aPolyBoundRect.GetHeight();
- sal_Int32 nLeft = (sal_Int32)(( aPolyPieRect.Left() - aPolyBoundRect.Left() ) * fTextFrameScaleX );
- sal_Int32 nTop = (sal_Int32)(( aPolyPieRect.Top() - aPolyBoundRect.Top() ) * fTextFrameScaleY );
- sal_Int32 nRight = (sal_Int32)(( aPolyPieRect.Right() - aPolyBoundRect.Left() ) * fTextFrameScaleX );
- sal_Int32 nBottom= (sal_Int32)(( aPolyPieRect.Bottom()- aPolyBoundRect.Top() ) * fTextFrameScaleY );
- com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeTextFrame > aTextFrame( 1 );
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrame[ 0 ].TopLeft.First, nLeft );
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrame[ 0 ].TopLeft.Second, nTop );
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrame[ 0 ].BottomRight.First, nRight );
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrame[ 0 ].BottomRight.Second,nBottom );
- PropertyValue aProp;
- aProp.Name = sTextFrames;
- aProp.Value <<= aTextFrame;
- aGeometryItem.SetPropertyValue( sPath, aProp );
-
- // sj: taking care of the different rotation points, since the new arc is having a bigger snaprect
- if ( mnFix16Angle )
- {
- sal_Int32 nAngle = mnFix16Angle;
- if ( nSpFlags & SP_FFLIPH )
- nAngle = 36000 - nAngle;
- if ( nSpFlags & SP_FFLIPV )
- nAngle = -nAngle;
- double a = nAngle * F_PI18000;
- double ss = sin( a );
- double cc = cos( a );
- Point aP1( aOldBoundRect.TopLeft() );
- Point aC1( aBoundRect.Center() );
- Point aP2( aOldBoundRect.TopLeft() );
- Point aC2( aOldBoundRect.Center() );
- RotatePoint( aP1, aC1, ss, cc );
- RotatePoint( aP2, aC2, ss, cc );
- aBoundRect.Move( aP2.X() - aP1.X(), aP2.Y() - aP1.Y() );
- }
- }
- ((SdrObjCustomShape*)pRet)->SetMergedItem( aGeometryItem );
- ((SdrObjCustomShape*)pRet)->MergeDefaultAttributes();
-
- // now setting a new name, so the above correction is only done once when importing from ms
- SdrCustomShapeGeometryItem aGeoName( (SdrCustomShapeGeometryItem&)((SdrObjCustomShape*)pRet)->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
- const rtl::OUString sType( RTL_CONSTASCII_USTRINGPARAM ( "Type" ) );
- const rtl::OUString sName( RTL_CONSTASCII_USTRINGPARAM ( "mso-spt100" ) );
- PropertyValue aPropVal;
- aPropVal.Name = sType;
- aPropVal.Value <<= sName;
- aGeoName.SetPropertyValue( aPropVal );
- ((SdrObjCustomShape*)pRet)->SetMergedItem( aGeoName );
- }
- else
- ((SdrObjCustomShape*)pRet)->MergeDefaultAttributes();
-
- pRet->SetSnapRect( aBoundRect );
- EnhancedCustomShape2d aCustomShape2d( pRet );
- aTextRect = aCustomShape2d.GetTextRect();
-
- bIsCustomShape = TRUE;
-
- if( bIsConnector )
- {
- if( nObjectRotation )
- {
- double a = nObjectRotation * nPi180;
- pRet->NbcRotate( aBoundRect.Center(), nObjectRotation, sin( a ), cos( a ) );
- }
- // Horizontal gespiegelt?
- if ( nSpFlags & SP_FFLIPH )
- {
- Rectangle aBndRect( pRet->GetSnapRect() );
- Point aTop( ( aBndRect.Left() + aBndRect.Right() ) >> 1, aBndRect.Top() );
- Point aBottom( aTop.X(), aTop.Y() + 1000 );
- pRet->NbcMirror( aTop, aBottom );
- }
- // Vertikal gespiegelt?
- if ( nSpFlags & SP_FFLIPV )
- {
- Rectangle aBndRect( pRet->GetSnapRect() );
- Point aLeft( aBndRect.Left(), ( aBndRect.Top() + aBndRect.Bottom() ) >> 1 );
- Point aRight( aLeft.X() + 1000, aLeft.Y() );
- pRet->NbcMirror( aLeft, aRight );
- }
- basegfx::B2DPolyPolygon aPoly( SdrObjCustomShape::GetLineGeometry( (SdrObjCustomShape*)pRet, sal_True ) );
- SdrObject::Free( pRet );
-
- pRet = new SdrEdgeObj();
- pRet->SetLogicRect(aBoundRect);
-
- // Konnektoren
- MSO_ConnectorStyle eConnectorStyle = (MSO_ConnectorStyle)GetPropertyValue( DFF_Prop_cxstyle, mso_cxstyleStraight );
-
- ((SdrEdgeObj*)pRet)->ConnectToNode(TRUE, NULL);
- ((SdrEdgeObj*)pRet)->ConnectToNode(FALSE, NULL);
-
- Point aPoint1( aBoundRect.TopLeft() );
- Point aPoint2( aBoundRect.BottomRight() );
-
- // Rotationen beachten
- if ( nObjectRotation )
- {
- double a = nObjectRotation * nPi180;
- Point aCenter( aBoundRect.Center() );
- double ss = sin(a);
- double cc = cos(a);
-
- RotatePoint(aPoint1, aCenter, ss, cc);
- RotatePoint(aPoint2, aCenter, ss, cc);
- }
-
- // Linie innerhalb des Bereiches zurechtdrehen/spiegeln
- if ( nSpFlags & SP_FFLIPH )
- {
- INT32 n = aPoint1.X();
- aPoint1.X() = aPoint2.X();
- aPoint2.X() = n;
- }
- if ( nSpFlags & SP_FFLIPV )
- {
- INT32 n = aPoint1.Y();
- aPoint1.Y() = aPoint2.Y();
- aPoint2.Y() = n;
- }
- nSpFlags &= ~( SP_FFLIPV | SP_FFLIPH );
-
- pRet->NbcSetPoint(aPoint1, 0L); // Startpunkt
- pRet->NbcSetPoint(aPoint2, 1L); // Endpunkt
-
- sal_Int32 n1HorzDist, n1VertDist, n2HorzDist, n2VertDist;
- n1HorzDist = n1VertDist = n2HorzDist = n2VertDist = 0;
- switch( eConnectorStyle )
- {
- case mso_cxstyleBent:
- {
- aSet.Put( SdrEdgeKindItem( SDREDGE_ORTHOLINES ) );
- n1HorzDist = n1VertDist = n2HorzDist = n2VertDist = 630;
- }
- break;
- case mso_cxstyleCurved:
- aSet.Put( SdrEdgeKindItem( SDREDGE_BEZIER ) );
- break;
- default: // mso_cxstyleStraight || mso_cxstyleNone
- aSet.Put( SdrEdgeKindItem( SDREDGE_ONELINE ) );
- break;
- }
- aSet.Put( SdrEdgeNode1HorzDistItem( n1HorzDist ) );
- aSet.Put( SdrEdgeNode1VertDistItem( n1VertDist ) );
- aSet.Put( SdrEdgeNode2HorzDistItem( n2HorzDist ) );
- aSet.Put( SdrEdgeNode2VertDistItem( n2VertDist ) );
-
- ((SdrEdgeObj*)pRet)->SetEdgeTrackPath( aPoly );
- }
- }
- }
- else
- {
- SvxMSDffCustomShape aCustomShape( *this, rSt, aObjData, aBoundRect, nObjectRotation, mpTracer );
- if ( !aCustomShape.IsEmpty() )
- {
- ApplyAttributes( rSt, aSet, aObjData.eShapeType, aObjData.nSpFlags );
- pRet = aCustomShape.GetObject( pSdrModel, aSet, TRUE );
- aTextRect = aCustomShape.GetTextRect();
- bIsCustomShape = TRUE;
- }
- }
- if ( !bIsCustomShape )
- {
- if ( aObjData.eShapeType == mso_sptTextBox )
- {
- if ( ( GetPropertyValue( DFF_Prop_fNoLineDrawDash ) & 8 )
- || ( GetPropertyValue( DFF_Prop_fNoFillHitTest ) & 0x10 ) )
- {
- pRet = new SdrRectObj( aBoundRect ); // SJ: changed the type from OBJ_TEXT to OBJ_RECT (#88277#)
- }
- }
- else if ( ( ( aObjData.eShapeType >= mso_sptCallout1 ) && ( aObjData.eShapeType <= mso_sptAccentBorderCallout3 ) )
- || ( aObjData.eShapeType == mso_sptCallout90 )
- || ( aObjData.eShapeType == mso_sptAccentCallout90 )
- || ( aObjData.eShapeType == mso_sptBorderCallout90 )
- || ( aObjData.eShapeType == mso_sptAccentBorderCallout90 ) )
- {
- pRet = new SdrCaptionObj( aBoundRect );
- INT32 nAdjust0 = GetPropertyValue( DFF_Prop_adjustValue, 0 );
- INT32 nAdjust1 = GetPropertyValue( DFF_Prop_adjust2Value, 0 );
- if( nAdjust0 | nAdjust1 )
- { // AdjustValues anwenden, nur welche ?!?
- nAdjust0 = ( nAdjust0 * 100 ) / 850;
- nAdjust1 = ( nAdjust1 * 100 ) / 1275;
- Point aTailPos( nAdjust0 + aBoundRect.Left(), nAdjust1 + aBoundRect.Top() );
- ((SdrCaptionObj*)pRet)->NbcSetTailPos( aTailPos );
- }
- }
- else if( ( aObjData.eShapeType >= mso_sptTextPlainText ) && ( aObjData.eShapeType <= mso_sptTextCanDown ) ) // FontWork
- {
- aObjData.bIsAutoText = TRUE;
- if ( mbTracing )
- mpTracer->Trace( rtl::OUString::createFromAscii( "escher1000" ), rtl::OUString::valueOf( (sal_Int32)aObjData.eShapeType ) );
- pRet = ImportFontWork( rSt, aSet, aBoundRect );
- }
- else if ( aObjData.eShapeType == mso_sptLine )
- {
- basegfx::B2DPolygon aPoly;
- aPoly.append(basegfx::B2DPoint(aBoundRect.Left(), aBoundRect.Top()));
- aPoly.append(basegfx::B2DPoint(aBoundRect.Right(), aBoundRect.Bottom()));
- pRet = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPoly));
- }
- else if ( ( (int)aObjData.eShapeType > (int)mso_sptRectangle ) && ( (int)aObjData.eShapeType < (int)mso_sptHostControl ) )
- {
- pRet = GetAutoForm( aObjData.eShapeType );
- if ( pRet )
- {
- mpTracer->Trace( rtl::OUString::createFromAscii( "escher1001" ), rtl::OUString::valueOf( (sal_Int32)aObjData.eShapeType ) );
- pRet->NbcSetSnapRect( aBoundRect ); // Groesse setzen
- }
- }
- }
- }
- if ( pRet )
- {
- if ( bIsConnector || !bIsCustomShape )
- {
- ApplyAttributes( rSt, aSet, aObjData.eShapeType, aObjData.nSpFlags );
- if ( !GetPropertyValue( DFF_Prop_gtextSize, 0 ) )
- aSet.Put( SvxFontHeightItem( ScalePt( 24 << 16 ), 100, EE_CHAR_FONTHEIGHT ) );
- if ( aObjData.eShapeType == mso_sptTextBox )
- aSet.Put( SdrTextMinFrameHeightItem( aBoundRect.GetHeight() ) );
- pRet->SetModel( pSdrModel );
- pRet->SetMergedItemSet(aSet);
- // Rotieren
- if ( pRet->ISA( SdrCaptionObj ) ) // sj: #96758# SetModel is changing
- pRet->SetSnapRect( aBoundRect ); // the original snaprect
- }
- // FillStyle != XFILL_NONE und nicht geschlossenes Polygon-Objekt?
- if( pRet->ISA( SdrPathObj ) )
- {
- XFillStyle eFillStyle = ITEMVALUE( aSet, XATTR_FILLSTYLE, XFillStyleItem );
- if( eFillStyle != XFILL_NONE )
- {
- // Das Polygon des Objektes muss geschlossen werden
- if(!((SdrPathObj*)pRet)->IsClosed())
- ((SdrPathObj*)pRet)->ToggleClosed(); //0);
- }
- }
- // Handelt es sich um 3D?
- if( GetPropertyValue( DFF_Prop_fc3DLightFace ) & 8 )
- {
- // #81981# not all objects are effected by 3d effects
- if ( !bGraphic )
- {
- SdrObject* p3d = SvxMSDffCustomShape3D::Create3DObject( pRet, *this, aSet, aBoundRect, nSpFlags );
- if ( p3d )
- {
- nSpFlags &= ~( SP_FFLIPV | SP_FFLIPH );
- nObjectRotation = 0;
- SdrObject::Free( pRet );
- pRet = p3d;
- }
- }
- }
- }
- if ( pRet )
- {
- if( nObjectRotation /* && !bIsConnector */ )
- {
- double a = nObjectRotation * nPi180;
- pRet->NbcRotate( aBoundRect.Center(), nObjectRotation, sin( a ), cos( a ) );
- }
- // Horizontal gespiegelt?
- if ( nSpFlags & SP_FFLIPH )
- {
- Rectangle aBndRect( pRet->GetSnapRect() );
- Point aTop( ( aBndRect.Left() + aBndRect.Right() ) >> 1, aBndRect.Top() );
- Point aBottom( aTop.X(), aTop.Y() + 1000 );
- pRet->NbcMirror( aTop, aBottom );
- }
- // Vertikal gespiegelt?
- if ( nSpFlags & SP_FFLIPV )
- {
- Rectangle aBndRect( pRet->GetSnapRect() );
- Point aLeft( aBndRect.Left(), ( aBndRect.Top() + aBndRect.Bottom() ) >> 1 );
- Point aRight( aLeft.X() + 1000, aLeft.Y() );
- pRet->NbcMirror( aLeft, aRight );
- }
- }
- }
- }
-
- // #i51348# #118052# name of the shape
- if( pRet )
- {
- ::rtl::OUString aObjName = GetPropertyString( DFF_Prop_wzName, rSt );
- if( aObjName.getLength() > 0 )
- pRet->SetName( aObjName );
- }
-
- pRet =
- ProcessObj( rSt, aObjData, pClientData, aTextRect, pRet);
-
- if ( mbTracing )
- mpTracer->RemoveAttribute( aObjData.nSpFlags & SP_FGROUP
- ? rtl::OUString::createFromAscii( "GroupShape" )
- : rtl::OUString::createFromAscii( "Shape" ) );
- return pRet;
-}
-
-Rectangle SvxMSDffManager::GetGlobalChildAnchor( const DffRecordHeader& rHd, SvStream& rSt, Rectangle& aClientRect )
-{
- Rectangle aChildAnchor;
- rHd.SeekToContent( rSt );
- while ( ( rSt.GetError() == 0 ) && ( rSt.Tell() < rHd.GetRecEndFilePos() ) )
- {
- DffRecordHeader aShapeHd;
- rSt >> aShapeHd;
- if ( ( aShapeHd.nRecType == DFF_msofbtSpContainer ) ||
- ( aShapeHd.nRecType == DFF_msofbtSpgrContainer ) )
- {
- DffRecordHeader aShapeHd2( aShapeHd );
- if ( aShapeHd.nRecType == DFF_msofbtSpgrContainer )
- rSt >> aShapeHd2;
- while( ( rSt.GetError() == 0 ) && ( rSt.Tell() < aShapeHd2.GetRecEndFilePos() ) )
- {
- DffRecordHeader aShapeAtom;
- rSt >> aShapeAtom;
-
- if ( aShapeAtom.nRecType == DFF_msofbtClientAnchor )
- {
- if ( GetSvxMSDffSettings() & SVXMSDFF_SETTINGS_IMPORT_PPT )
- {
- sal_Int32 l, t, r, b;
- if ( aShapeAtom.nRecLen == 16 )
- {
- rSt >> l >> t >> r >> b;
- }
- else
- {
- INT16 ls, ts, rs, bs;
- rSt >> ts >> ls >> rs >> bs; // etwas seltsame Koordinatenreihenfolge ...
- l = ls, t = ts, r = rs, b = bs;
- }
- Scale( l );
- Scale( t );
- Scale( r );
- Scale( b );
- aClientRect = Rectangle( l, t, r, b );
- }
- break;
- }
- else if ( aShapeAtom.nRecType == DFF_msofbtChildAnchor )
- {
- sal_Int32 l, o, r, u;
- rSt >> l >> o >> r >> u;
- Scale( l );
- Scale( o );
- Scale( r );
- Scale( u );
- Rectangle aChild( l, o, r, u );
- aChildAnchor.Union( aChild );
- break;
- }
- aShapeAtom.SeekToEndOfRecord( rSt );
- }
- }
- aShapeHd.SeekToEndOfRecord( rSt );
- }
- return aChildAnchor;
-}
-
-void SvxMSDffManager::GetGroupAnchors( const DffRecordHeader& rHd, SvStream& rSt,
- Rectangle& rGroupClientAnchor, Rectangle& rGroupChildAnchor,
- const Rectangle& rClientRect, const Rectangle& rGlobalChildRect )
-{
- sal_Bool bFirst = sal_True;
- rHd.SeekToContent( rSt );
- DffRecordHeader aShapeHd;
- while ( ( rSt.GetError() == 0 ) && ( rSt.Tell() < rHd.GetRecEndFilePos() ) )
- {
- rSt >> aShapeHd;
- if ( ( aShapeHd.nRecType == DFF_msofbtSpContainer ) ||
- ( aShapeHd.nRecType == DFF_msofbtSpgrContainer ) )
- {
- DffRecordHeader aShapeHd2( aShapeHd );
- if ( aShapeHd.nRecType == DFF_msofbtSpgrContainer )
- rSt >> aShapeHd2;
- while( ( rSt.GetError() == 0 ) && ( rSt.Tell() < aShapeHd2.GetRecEndFilePos() ) )
- {
- DffRecordHeader aShapeAtom;
- rSt >> aShapeAtom;
- if ( aShapeAtom.nRecType == DFF_msofbtChildAnchor )
- {
- sal_Int32 l, o, r, u;
- rSt >> l >> o >> r >> u;
- Scale( l );
- Scale( o );
- Scale( r );
- Scale( u );
- Rectangle aChild( l, o, r, u );
-
- if ( bFirst )
- {
- if ( !rGlobalChildRect.IsEmpty() && !rClientRect.IsEmpty() && rGlobalChildRect.GetWidth() && rGlobalChildRect.GetHeight() )
- {
- double fl = l;
- double fo = o;
- double fWidth = r - l;
- double fHeight= u - o;
- double fXScale = (double)rClientRect.GetWidth() / (double)rGlobalChildRect.GetWidth();
- double fYScale = (double)rClientRect.GetHeight() / (double)rGlobalChildRect.GetHeight();
- fl = ( ( l - rGlobalChildRect.Left() ) * fXScale ) + rClientRect.Left();
- fo = ( ( o - rGlobalChildRect.Top() ) * fYScale ) + rClientRect.Top();
- fWidth *= fXScale;
- fHeight *= fYScale;
- rGroupClientAnchor = Rectangle( Point( (sal_Int32)fl, (sal_Int32)fo ), Size( (sal_Int32)( fWidth + 1 ), (sal_Int32)( fHeight + 1 ) ) );
- }
- bFirst = sal_False;
- }
- else
- rGroupChildAnchor.Union( aChild );
- break;
- }
- aShapeAtom.SeekToEndOfRecord( rSt );
- }
- }
- aShapeHd.SeekToEndOfRecord( rSt );
- }
-}
-
-SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
- DffObjData& rObjData,
- void* pData,
- Rectangle& rTextRect,
- SdrObject* pObj
- )
-{
- if( !rTextRect.IsEmpty() )
- {
- SvxMSDffImportData& rImportData = *(SvxMSDffImportData*)pData;
- SvxMSDffImportRec* pImpRec = new SvxMSDffImportRec;
- SvxMSDffImportRec* pTextImpRec = pImpRec;
-
- // fill Import Record with data
- pImpRec->nShapeId = rObjData.nShapeId;
- pImpRec->eShapeType = rObjData.eShapeType;
-
- MSO_WrapMode eWrapMode( (MSO_WrapMode)GetPropertyValue(
- DFF_Prop_WrapText,
- mso_wrapSquare ) );
- rObjData.bClientAnchor = maShapeRecords.SeekToContent( rSt,
- DFF_msofbtClientAnchor,
- SEEK_FROM_CURRENT_AND_RESTART );
- if( rObjData.bClientAnchor )
- ProcessClientAnchor( rSt,
- maShapeRecords.Current()->nRecLen,
- pImpRec->pClientAnchorBuffer, pImpRec->nClientAnchorLen );
-
- rObjData.bClientData = maShapeRecords.SeekToContent( rSt,
- DFF_msofbtClientData,
- SEEK_FROM_CURRENT_AND_RESTART );
- if( rObjData.bClientData )
- ProcessClientData( rSt,
- maShapeRecords.Current()->nRecLen,
- pImpRec->pClientDataBuffer, pImpRec->nClientDataLen );
-
-
- // process user (== Winword) defined parameters in 0xF122 record
- if( maShapeRecords.SeekToContent( rSt,
- DFF_msofbtUDefProp,
- SEEK_FROM_CURRENT_AND_RESTART )
- && maShapeRecords.Current()->nRecLen )
- {
- UINT32 nBytesLeft = maShapeRecords.Current()->nRecLen;
- UINT32 nUDData;
- UINT16 nPID;
- while( 5 < nBytesLeft )
- {
- rSt >> nPID;
- if ( rSt.GetError() != 0 )
- break;
- rSt >> nUDData;
- switch( nPID )
- {
- case 0x038F: pImpRec->nXAlign = nUDData; break;
- case 0x0390: pImpRec->nXRelTo = nUDData; break;
- case 0x0391: pImpRec->nYAlign = nUDData; break;
- case 0x0392: pImpRec->nYRelTo = nUDData; break;
- case 0x03BF: pImpRec->nLayoutInTableCell = nUDData; break;
- }
- if ( rSt.GetError() != 0 )
- break;
- pImpRec->bHasUDefProp = TRUE;
- nBytesLeft -= 6;
- }
- }
-
- // Textrahmen, auch Title oder Outline
- SdrObject* pOrgObj = pObj;
- SdrRectObj* pTextObj = 0;
- UINT32 nTextId = GetPropertyValue( DFF_Prop_lTxid, 0 );
- if( nTextId )
- {
- SfxItemSet aSet( pSdrModel->GetItemPool() );
-
- //Originally anything that as a mso_sptTextBox was created as a
- //textbox, this was changed for #88277# to be created as a simple
- //rect to keep impress happy. For the rest of us we'd like to turn
- //it back into a textbox again.
- FASTBOOL bTextFrame = (pImpRec->eShapeType == mso_sptTextBox);
- if (!bTextFrame)
- {
- //Either
- //a) its a simple text object or
- //b) its a rectangle with text and square wrapping.
- bTextFrame =
- (
- (pImpRec->eShapeType == mso_sptTextSimple) ||
- (
- (pImpRec->eShapeType == mso_sptRectangle)
- && (eWrapMode == mso_wrapSquare)
- && ShapeHasText(pImpRec->nShapeId, rObjData.rSpHd.GetRecBegFilePos() )
- )
- );
- }
-
- if (bTextFrame)
- {
- SdrObject::Free( pObj );
- pObj = pOrgObj = 0;
- }
-
- // Distance of Textbox to it's surrounding Customshape
- INT32 nTextLeft = GetPropertyValue( DFF_Prop_dxTextLeft, 91440L);
- INT32 nTextRight = GetPropertyValue( DFF_Prop_dxTextRight, 91440L );
- INT32 nTextTop = GetPropertyValue( DFF_Prop_dyTextTop, 45720L );
- INT32 nTextBottom = GetPropertyValue( DFF_Prop_dyTextBottom, 45720L );
-
- ScaleEmu( nTextLeft );
- ScaleEmu( nTextRight );
- ScaleEmu( nTextTop );
- ScaleEmu( nTextBottom );
-
- INT32 nTextRotationAngle=0;
- bool bVerticalText = false;
- if ( IsProperty( DFF_Prop_txflTextFlow ) )
- {
- MSO_TextFlow eTextFlow = (MSO_TextFlow)(GetPropertyValue(
- DFF_Prop_txflTextFlow) & 0xFFFF);
- switch( eTextFlow )
- {
- case mso_txflBtoT:
- nTextRotationAngle = 9000;
- break;
- case mso_txflVertN:
- case mso_txflTtoBN:
- nTextRotationAngle = 27000;
- break;
- case mso_txflTtoBA:
- bVerticalText = true;
- break;
- case mso_txflHorzA:
- bVerticalText = true;
- nTextRotationAngle = 9000;
- case mso_txflHorzN:
- default :
- break;
- }
- }
-
- if (nTextRotationAngle)
- {
- while (nTextRotationAngle > 360000)
- nTextRotationAngle-=9000;
- switch (nTextRotationAngle)
- {
- case 9000:
- {
- long nWidth = rTextRect.GetWidth();
- rTextRect.Right() = rTextRect.Left() + rTextRect.GetHeight();
- rTextRect.Bottom() = rTextRect.Top() + nWidth;
-
- INT32 nOldTextLeft = nTextLeft;
- INT32 nOldTextRight = nTextRight;
- INT32 nOldTextTop = nTextTop;
- INT32 nOldTextBottom = nTextBottom;
-
- nTextLeft = nOldTextBottom;
- nTextRight = nOldTextTop;
- nTextTop = nOldTextLeft;
- nTextBottom = nOldTextRight;
- }
- break;
- case 27000:
- {
- long nWidth = rTextRect.GetWidth();
- rTextRect.Right() = rTextRect.Left() + rTextRect.GetHeight();
- rTextRect.Bottom() = rTextRect.Top() + nWidth;
-
- INT32 nOldTextLeft = nTextLeft;
- INT32 nOldTextRight = nTextRight;
- INT32 nOldTextTop = nTextTop;
- INT32 nOldTextBottom = nTextBottom;
-
- nTextLeft = nOldTextTop;
- nTextRight = nOldTextBottom;
- nTextTop = nOldTextRight;
- nTextBottom = nOldTextLeft;
- }
- break;
- default:
- break;
- }
- }
-
- pTextObj = new SdrRectObj(OBJ_TEXT, rTextRect);
- pTextImpRec = new SvxMSDffImportRec(*pImpRec);
-
- // Die vertikalen Absatzeinrueckungen sind im BoundRect mit drin,
- // hier rausrechnen
- Rectangle aNewRect(rTextRect);
- aNewRect.Bottom() -= nTextTop + nTextBottom;
- aNewRect.Right() -= nTextLeft + nTextRight;
-
- // Nur falls es eine einfache Textbox ist, darf der Writer
- // das Objekt durch einen Rahmen ersetzen, ansonsten
- if( bTextFrame )
- {
- SvxMSDffShapeInfo aTmpRec( 0, pImpRec->nShapeId );
- aTmpRec.bSortByShapeId = TRUE;
-
- USHORT nFound;
- if( pShapeInfos->Seek_Entry( &aTmpRec, &nFound ) )
- {
- SvxMSDffShapeInfo& rInfo = *pShapeInfos->GetObject(nFound);
- pTextImpRec->bReplaceByFly = rInfo.bReplaceByFly;
- pTextImpRec->bLastBoxInChain = rInfo.bLastBoxInChain;
- }
- }
-
- if( !pObj )
- ApplyAttributes( rSt, aSet, rObjData.eShapeType, rObjData.nSpFlags );
-
- bool bFitText = false;
- if (GetPropertyValue(DFF_Prop_FitTextToShape) & 2)
- {
- aSet.Put( SdrTextAutoGrowHeightItem( TRUE ) );
- aSet.Put( SdrTextMinFrameHeightItem(
- aNewRect.Bottom() - aNewRect.Top() ) );
- aSet.Put( SdrTextMinFrameWidthItem(
- aNewRect.Right() - aNewRect.Left() ) );
- bFitText = true;
- }
- else
- {
- aSet.Put( SdrTextAutoGrowHeightItem( FALSE ) );
- aSet.Put( SdrTextAutoGrowWidthItem( FALSE ) );
- }
-
- switch ( (MSO_WrapMode)
- GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare ) )
- {
- case mso_wrapNone :
- aSet.Put( SdrTextAutoGrowWidthItem( TRUE ) );
- if (bFitText)
- {
- //can't do autowidth in flys #i107184#
- pTextImpRec->bReplaceByFly = false;
- }
- break;
- case mso_wrapByPoints :
- aSet.Put( SdrTextContourFrameItem( TRUE ) );
- break;
- default: break;
- }
-
- // Abstaende an den Raendern der Textbox setzen
- aSet.Put( SdrTextLeftDistItem( nTextLeft ) );
- aSet.Put( SdrTextRightDistItem( nTextRight ) );
- aSet.Put( SdrTextUpperDistItem( nTextTop ) );
- aSet.Put( SdrTextLowerDistItem( nTextBottom ) );
- pTextImpRec->nDxTextLeft = nTextLeft;
- pTextImpRec->nDyTextTop = nTextTop;
- pTextImpRec->nDxTextRight = nTextRight;
- pTextImpRec->nDyTextBottom = nTextBottom;
-
- // Textverankerung lesen
- if ( IsProperty( DFF_Prop_anchorText ) )
- {
- MSO_Anchor eTextAnchor =
- (MSO_Anchor)GetPropertyValue( DFF_Prop_anchorText );
-
- SdrTextVertAdjust eTVA = SDRTEXTVERTADJUST_CENTER;
- BOOL bTVASet(FALSE);
- SdrTextHorzAdjust eTHA = SDRTEXTHORZADJUST_CENTER;
- BOOL bTHASet(FALSE);
-
- switch( eTextAnchor )
- {
- case mso_anchorTop:
- {
- eTVA = SDRTEXTVERTADJUST_TOP;
- bTVASet = TRUE;
- }
- break;
- case mso_anchorTopCentered:
- {
- eTVA = SDRTEXTVERTADJUST_TOP;
- bTVASet = TRUE;
- bTHASet = TRUE;
- }
- break;
-
- case mso_anchorMiddle:
- bTVASet = TRUE;
- break;
- case mso_anchorMiddleCentered:
- {
- bTVASet = TRUE;
- bTHASet = TRUE;
- }
- break;
- case mso_anchorBottom:
- {
- eTVA = SDRTEXTVERTADJUST_BOTTOM;
- bTVASet = TRUE;
- }
- break;
- case mso_anchorBottomCentered:
- {
- eTVA = SDRTEXTVERTADJUST_BOTTOM;
- bTVASet = TRUE;
- bTHASet = TRUE;
- }
- break;
- /*
- case mso_anchorTopBaseline:
- case mso_anchorBottomBaseline:
- case mso_anchorTopCenteredBaseline:
- case mso_anchorBottomCenteredBaseline:
- break;
- */
- default : break;
- }
- // Einsetzen
- if ( bTVASet )
- aSet.Put( SdrTextVertAdjustItem( eTVA ) );
- if ( bTHASet )
- aSet.Put( SdrTextHorzAdjustItem( eTHA ) );
- }
-
- pTextObj->SetMergedItemSet(aSet);
- pTextObj->SetModel(pSdrModel);
-
- if (bVerticalText)
- pTextObj->SetVerticalWriting(sal_True);
-
- if (nTextRotationAngle)
- {
- long nMinWH = rTextRect.GetWidth() < rTextRect.GetHeight() ?
- rTextRect.GetWidth() : rTextRect.GetHeight();
- nMinWH /= 2;
- Point aPivot(rTextRect.TopLeft());
- aPivot.X() += nMinWH;
- aPivot.Y() += nMinWH;
- double a = nTextRotationAngle * nPi180;
- pTextObj->NbcRotate(aPivot, nTextRotationAngle, sin(a), cos(a));
- }
-
- // rotate text with shape ?
- if ( mnFix16Angle )
- {
- double a = mnFix16Angle * nPi180;
- pTextObj->NbcRotate( rObjData.rBoundRect.Center(), mnFix16Angle,
- sin( a ), cos( a ) );
- }
-
- if( !pObj )
- {
- pObj = pTextObj;
- }
- else
- {
- if( pTextObj != pObj )
- {
- SdrObject* pGroup = new SdrObjGroup;
- pGroup->GetSubList()->NbcInsertObject( pObj );
- pGroup->GetSubList()->NbcInsertObject( pTextObj );
- if (pOrgObj == pObj)
- pOrgObj = pGroup;
- else
- pOrgObj = pObj;
- pObj = pGroup;
- }
- }
- }
- else if( !pObj )
- {
- // simple rectangular objects are ignored by ImportObj() :-(
- // this is OK for Draw but not for Calc and Writer
- // cause here these objects have a default border
- pObj = new SdrRectObj(rTextRect);
- pOrgObj = pObj;
- pObj->SetModel( pSdrModel );
- SfxItemSet aSet( pSdrModel->GetItemPool() );
- ApplyAttributes( rSt, aSet, rObjData.eShapeType, rObjData.nSpFlags );
-
- const SfxPoolItem* pPoolItem=NULL;
- SfxItemState eState = aSet.GetItemState( XATTR_FILLCOLOR,
- FALSE, &pPoolItem );
- if( SFX_ITEM_DEFAULT == eState )
- aSet.Put( XFillColorItem( String(),
- Color( mnDefaultColor ) ) );
- pObj->SetMergedItemSet(aSet);
- }
-
- //Means that fBehindDocument is set
- if (GetPropertyValue(DFF_Prop_fPrint) & 0x20)
- pImpRec->bDrawHell = TRUE;
- else
- pImpRec->bDrawHell = FALSE;
- if (GetPropertyValue(DFF_Prop_fPrint) & 0x02)
- pImpRec->bHidden = TRUE;
- pTextImpRec->bDrawHell = pImpRec->bDrawHell;
- pTextImpRec->bHidden = pImpRec->bHidden;
- pImpRec->nNextShapeId = GetPropertyValue( DFF_Prop_hspNext, 0 );
- pTextImpRec->nNextShapeId=pImpRec->nNextShapeId;
-
- if ( nTextId )
- {
- pTextImpRec->aTextId.nTxBxS = (UINT16)( nTextId >> 16 );
- pTextImpRec->aTextId.nSequence = (UINT16)nTextId;
- }
-
- pTextImpRec->nDxWrapDistLeft = GetPropertyValue(
- DFF_Prop_dxWrapDistLeft, 114935L ) / 635L;
- pTextImpRec->nDyWrapDistTop = GetPropertyValue(
- DFF_Prop_dyWrapDistTop, 0 ) / 635L;
- pTextImpRec->nDxWrapDistRight = GetPropertyValue(
- DFF_Prop_dxWrapDistRight, 114935L ) / 635L;
- pTextImpRec->nDyWrapDistBottom = GetPropertyValue(
- DFF_Prop_dyWrapDistBottom, 0 ) / 635L;
- // 16.16 fraction times total image width or height, as appropriate.
-
- if (SeekToContent(DFF_Prop_pWrapPolygonVertices, rSt))
- {
- delete pTextImpRec->pWrapPolygon;
- sal_uInt16 nNumElemVert, nNumElemMemVert, nElemSizeVert;
- rSt >> nNumElemVert >> nNumElemMemVert >> nElemSizeVert;
- if (nNumElemVert && ((nElemSizeVert == 8) || (nElemSizeVert == 4)))
- {
- pTextImpRec->pWrapPolygon = new Polygon(nNumElemVert);
- for (sal_uInt16 i = 0; i < nNumElemVert; ++i)
- {
- sal_Int32 nX, nY;
- if (nElemSizeVert == 8)
- rSt >> nX >> nY;
- else
- {
- sal_Int16 nSmallX, nSmallY;
- rSt >> nSmallX >> nSmallY;
- nX = nSmallX;
- nY = nSmallY;
- }
- (*(pTextImpRec->pWrapPolygon))[i].X() = nX;
- (*(pTextImpRec->pWrapPolygon))[i].Y() = nY;
- }
- }
- }
-
- pImpRec->nCropFromTop = GetPropertyValue(
- DFF_Prop_cropFromTop, 0 );
- pImpRec->nCropFromBottom = GetPropertyValue(
- DFF_Prop_cropFromBottom, 0 );
- pImpRec->nCropFromLeft = GetPropertyValue(
- DFF_Prop_cropFromLeft, 0 );
- pImpRec->nCropFromRight = GetPropertyValue(
- DFF_Prop_cropFromRight, 0 );
-
- pImpRec->bVFlip = (rObjData.nSpFlags & SP_FFLIPV) ? true : false;
- pImpRec->bHFlip = (rObjData.nSpFlags & SP_FFLIPH) ? true : false;
-
- UINT32 nLineFlags = GetPropertyValue( DFF_Prop_fNoLineDrawDash );
- pImpRec->eLineStyle = (nLineFlags & 8)
- ? (MSO_LineStyle)GetPropertyValue(
- DFF_Prop_lineStyle,
- mso_lineSimple )
- : (MSO_LineStyle)USHRT_MAX;
- pTextImpRec->eLineStyle = pImpRec->eLineStyle;
-
- if( pImpRec->nShapeId )
- {
- // Import-Record-Liste ergaenzen
- if( pOrgObj )
- {
- pImpRec->pObj = pOrgObj;
- rImportData.aRecords.Insert( pImpRec );
- }
-
- if( pTextObj && (pOrgObj != pTextObj) )
- {
- // Modify ShapeId (must be unique)
- pImpRec->nShapeId |= 0x8000000;
- pTextImpRec->pObj = pTextObj;
- rImportData.aRecords.Insert( pTextImpRec );
- }
-
- // Eintrag in Z-Order-Liste um Zeiger auf dieses Objekt ergaenzen
- /*Only store objects which are not deep inside the tree*/
- if( ( rObjData.nCalledByGroup == 0 )
- ||
- ( (rObjData.nSpFlags & SP_FGROUP)
- && (rObjData.nCalledByGroup < 2) )
- )
- StoreShapeOrder( pImpRec->nShapeId,
- ( ( (ULONG)pImpRec->aTextId.nTxBxS ) << 16 )
- + pImpRec->aTextId.nSequence, pObj );
- }
- else
- delete pImpRec;
- }
-
- return pObj;
-};
-
-void SvxMSDffManager::StoreShapeOrder(ULONG nId,
- ULONG nTxBx,
- SdrObject* pObject,
- SwFlyFrmFmt* pFly,
- short nHdFtSection) const
-{
- USHORT nShpCnt = pShapeOrders->Count();
- for (USHORT nShapeNum=0; nShapeNum < nShpCnt; nShapeNum++)
- {
- SvxMSDffShapeOrder& rOrder
- = *(SvxMSDffShapeOrder*)(pShapeOrders->GetObject( nShapeNum ));
-
- if( rOrder.nShapeId == nId )
- {
- rOrder.nTxBxComp = nTxBx;
- rOrder.pObj = pObject;
- rOrder.pFly = pFly;
- rOrder.nHdFtSection = nHdFtSection;
- }
- }
-}
-
-
-void SvxMSDffManager::ExchangeInShapeOrder( SdrObject* pOldObject,
- ULONG nTxBx,
- SwFlyFrmFmt* pFly,
- SdrObject* pObject) const
-{
- USHORT nShpCnt = pShapeOrders->Count();
- for (USHORT nShapeNum=0; nShapeNum < nShpCnt; nShapeNum++)
- {
- SvxMSDffShapeOrder& rOrder
- = *(SvxMSDffShapeOrder*)(pShapeOrders->GetObject( nShapeNum ));
-
- if( rOrder.pObj == pOldObject )
- {
- rOrder.pFly = pFly;
- rOrder.pObj = pObject;
- rOrder.nTxBxComp = nTxBx;
- }
- }
-}
-
-
-void SvxMSDffManager::RemoveFromShapeOrder( SdrObject* pObject ) const
-{
- USHORT nShpCnt = pShapeOrders->Count();
- for (USHORT nShapeNum=0; nShapeNum < nShpCnt; nShapeNum++)
- {
- SvxMSDffShapeOrder& rOrder
- = *(SvxMSDffShapeOrder*)(pShapeOrders->GetObject( nShapeNum ));
-
- if( rOrder.pObj == pObject )
- {
- rOrder.pObj = 0;
- rOrder.pFly = 0;
- rOrder.nTxBxComp = 0;
- }
- }
-}
-
-
-
-
-//---------------------------------------------------------------------------
-// Hilfs Deklarationen
-//---------------------------------------------------------------------------
-
-/*struct SvxMSDffBLIPInfo -> in's Header-File
-{
- USHORT nBLIPType; // Art des BLIP: z.B. 6 fuer PNG
- ULONG nFilePos; // Offset des BLIP im Daten-Stream
- ULONG nBLIPSize; // Anzahl Bytes, die der BLIP im Stream einnimmt
- SvxMSDffBLIPInfo(USHORT nBType, ULONG nFPos, ULONG nBSize):
- nBLIPType( nBType ), nFilePos( nFPos ), nBLIPSize( nBSize ){}
-};
-*/
-
-SV_IMPL_PTRARR( SvxMSDffBLIPInfos, SvxMSDffBLIPInfo_Ptr );
-
-SV_IMPL_PTRARR( SvxMSDffShapeOrders, SvxMSDffShapeOrder_Ptr );
-
-SV_IMPL_OP_PTRARR_SORT( SvxMSDffShapeInfos, SvxMSDffShapeInfo_Ptr );
-
-SV_IMPL_OP_PTRARR_SORT( SvxMSDffShapeTxBxSort, SvxMSDffShapeOrder_Ptr );
-
-
-// Liste aller SvxMSDffImportRec fuer eine Gruppe
-SV_IMPL_OP_PTRARR_SORT(MSDffImportRecords, MSDffImportRec_Ptr)
-
-//---------------------------------------------------------------------------
-// exportierte Klasse: oeffentliche Methoden
-//---------------------------------------------------------------------------
-
-SvxMSDffManager::SvxMSDffManager(SvStream& rStCtrl_,
- const String& rBaseURL,
- long nOffsDgg_,
- SvStream* pStData_,
- SdrModel* pSdrModel_,// s. unten: SetModel()
- long nApplicationScale,
- ColorData mnDefaultColor_,
- ULONG nDefaultFontHeight_,
- SvStream* pStData2_,
- MSFilterTracer* pTracer )
- :DffPropertyReader( *this ),
- pFormModel( NULL ),
- pBLIPInfos( new SvxMSDffBLIPInfos ),
- pShapeInfos( new SvxMSDffShapeInfos ),
- pShapeOrders( new SvxMSDffShapeOrders ),
- nDefaultFontHeight( nDefaultFontHeight_),
- nOffsDgg( nOffsDgg_ ),
- nBLIPCount( USHRT_MAX ), // mit Error initialisieren, da wir erst pruefen,
- nShapeCount( USHRT_MAX ), // ob Kontroll-Stream korrekte Daten enthaellt
- maBaseURL( rBaseURL ),
- mpFidcls( NULL ),
- rStCtrl( rStCtrl_ ),
- pStData( pStData_ ),
- pStData2( pStData2_ ),
- nSvxMSDffSettings( 0 ),
- nSvxMSDffOLEConvFlags( 0 ),
- pEscherBlipCache( NULL ),
- mnDefaultColor( mnDefaultColor_),
- mpTracer( pTracer ),
- mbTracing( sal_False )
-{
- if ( mpTracer )
- {
- uno::Any aAny( mpTracer->GetProperty( rtl::OUString::createFromAscii( "On" ) ) );
- aAny >>= mbTracing;
- }
- SetModel( pSdrModel_, nApplicationScale );
-
- // FilePos des/der Stream(s) merken
- ULONG nOldPosCtrl = rStCtrl.Tell();
- ULONG nOldPosData = pStData ? pStData->Tell() : nOldPosCtrl;
-
- // Falls kein Datenstream angegeben, gehen wir davon aus,
- // dass die BLIPs im Steuerstream stehen.
- if( !pStData )
- pStData = &rStCtrl;
-
- SetDefaultPropSet( rStCtrl, nOffsDgg );
-
- // Steuer Stream auslesen, im Erfolgsfall nBLIPCount setzen
- GetCtrlData( nOffsDgg );
-
- // Text-Box-Story-Ketten-Infos ueberpruefen
- CheckTxBxStoryChain();
-
- // alte FilePos des/der Stream(s) restaurieren
- rStCtrl.Seek( nOldPosCtrl );
- if( &rStCtrl != pStData )
- pStData->Seek( nOldPosData );
-}
-
-SvxMSDffManager::SvxMSDffManager( SvStream& rStCtrl_, const String& rBaseURL, MSFilterTracer* pTracer )
- :DffPropertyReader( *this ),
- pFormModel( NULL ),
- pBLIPInfos( new SvxMSDffBLIPInfos ),
- pShapeInfos( new SvxMSDffShapeInfos ),
- pShapeOrders( new SvxMSDffShapeOrders ),
- nDefaultFontHeight( 24 ),
- nOffsDgg( 0 ),
- nBLIPCount( USHRT_MAX ), // mit Error initialisieren, da wir erst pruefen,
- nShapeCount( USHRT_MAX ), // ob Kontroll-Stream korrekte Daten enthaellt
- maBaseURL( rBaseURL ),
- mpFidcls( NULL ),
- rStCtrl( rStCtrl_ ),
- pStData( 0 ),
- pStData2( 0 ),
- nSvxMSDffSettings( 0 ),
- nSvxMSDffOLEConvFlags( 0 ),
- pEscherBlipCache( NULL ),
- mnDefaultColor( COL_DEFAULT ),
- mpTracer( pTracer ),
- mbTracing( sal_False )
-{
- if ( mpTracer )
- {
- uno::Any aAny( mpTracer->GetProperty( rtl::OUString::createFromAscii( "On" ) ) );
- aAny >>= mbTracing;
- }
- SetModel( NULL, 0 );
-}
-
-SvxMSDffManager::~SvxMSDffManager()
-{
- if ( pEscherBlipCache )
- {
- void* pPtr;
- for ( pPtr = pEscherBlipCache->First(); pPtr; pPtr = pEscherBlipCache->Next() )
- delete (EscherBlipCacheEntry*)pPtr;
- delete pEscherBlipCache;
- }
- delete pBLIPInfos;
- delete pShapeInfos;
- delete pShapeOrders;
- delete pFormModel;
- delete[] mpFidcls;
-}
-
-void SvxMSDffManager::InitSvxMSDffManager( long nOffsDgg_, SvStream* pStData_, sal_uInt32 nOleConvFlags )
-{
- nOffsDgg = nOffsDgg_;
- pStData = pStData_;
- nSvxMSDffOLEConvFlags = nOleConvFlags;
-
- // FilePos des/der Stream(s) merken
- ULONG nOldPosCtrl = rStCtrl.Tell();
-
- SetDefaultPropSet( rStCtrl, nOffsDgg );
-
- // insert fidcl cluster table
- GetFidclData( nOffsDgg );
-
- // Steuer Stream auslesen, im Erfolgsfall nBLIPCount setzen
- GetCtrlData( nOffsDgg );
-
- // Text-Box-Story-Ketten-Infos ueberpruefen
- CheckTxBxStoryChain();
-
- // alte FilePos des/der Stream(s) restaurieren
- rStCtrl.Seek( nOldPosCtrl );
-}
-
-void SvxMSDffManager::SetDgContainer( SvStream& rSt )
-{
- UINT32 nFilePos = rSt.Tell();
- DffRecordHeader aDgContHd;
- rSt >> aDgContHd;
- // insert this container only if there is also a DgAtom
- if ( SeekToRec( rSt, DFF_msofbtDg, aDgContHd.GetRecEndFilePos() ) )
- {
- DffRecordHeader aRecHd;
- rSt >> aRecHd;
- UINT32 nDrawingId = aRecHd.nRecInstance;
- maDgOffsetTable.Insert( nDrawingId, (void*)nFilePos );
- rSt.Seek( nFilePos );
- }
-}
-
-void SvxMSDffManager::GetFidclData( long nOffsDggL )
-{
- if ( nOffsDggL )
- {
- UINT32 nDummy, nMerk = rStCtrl.Tell();
- rStCtrl.Seek( nOffsDggL );
-
- DffRecordHeader aRecHd;
- rStCtrl >> aRecHd;
-
- DffRecordHeader aDggAtomHd;
- if ( SeekToRec( rStCtrl, DFF_msofbtDgg, aRecHd.GetRecEndFilePos(), &aDggAtomHd ) )
- {
- aDggAtomHd.SeekToContent( rStCtrl );
- rStCtrl >> mnCurMaxShapeId
- >> mnIdClusters
- >> nDummy
- >> mnDrawingsSaved;
-
- if ( mnIdClusters-- > 2 )
- {
- if ( aDggAtomHd.nRecLen == ( mnIdClusters * sizeof( FIDCL ) + 16 ) )
- {
- mpFidcls = new FIDCL[ mnIdClusters ];
- for ( UINT32 i = 0; i < mnIdClusters; i++ )
- {
- rStCtrl >> mpFidcls[ i ].dgid
- >> mpFidcls[ i ].cspidCur;
- }
- }
- }
- }
- rStCtrl.Seek( nMerk );
- }
-}
-
-void SvxMSDffManager::CheckTxBxStoryChain()
-{
- SvxMSDffShapeInfos* pOld = pShapeInfos;
- USHORT nCnt = pOld->Count();
- pShapeInfos = new SvxMSDffShapeInfos( (nCnt < 255)
- ? nCnt
- : 255 );
- // altes Info-Array ueberarbeiten
- // (ist sortiert nach nTxBxComp)
- ULONG nChain = ULONG_MAX;
- USHORT nObjMark = 0;
- BOOL bSetReplaceFALSE = FALSE;
- USHORT nObj;
- for( nObj = 0; nObj < nCnt; ++nObj )
- {
- SvxMSDffShapeInfo* pObj = pOld->GetObject( nObj );
- if( pObj->nTxBxComp )
- {
- pObj->bLastBoxInChain = FALSE;
- // Gruppenwechsel ?
- // --> OD 2008-07-28 #156763#
- // the text id also contains an internal drawing container id
- // to distinguish between text id of drawing objects in different
- // drawing containers.
-// if( nChain != (pObj->nTxBxComp & 0xFFFF0000) )
- if( nChain != pObj->nTxBxComp )
- // <--
- {
- // voriger war letzter seiner Gruppe
- if( nObj )
- pOld->GetObject( nObj-1 )->bLastBoxInChain = TRUE;
- // Merker und Hilfs-Flag zuruecksetzen
- nObjMark = nObj;
- // --> OD 2008-07-28 #156763#
-// nChain = pObj->nTxBxComp & 0xFFFF0000;
- nChain = pObj->nTxBxComp;
- // <--
- bSetReplaceFALSE = !pObj->bReplaceByFly;
- }
- else
- if( !pObj->bReplaceByFly )
- {
- // Objekt, das NICHT durch Rahmen ersetzt werden darf ?
- // Hilfs-Flag setzen
- bSetReplaceFALSE = TRUE;
- // ggfs Flag in Anfang der Gruppe austragen
- for( USHORT nObj2 = nObjMark; nObj2 < nObj; ++nObj2 )
- pOld->GetObject( nObj2 )->bReplaceByFly = FALSE;
- }
-
- if( bSetReplaceFALSE )
- {
- pObj->bReplaceByFly = FALSE;
- }
- }
- // alle Shape-Info-Objekte in pShapeInfos umkopieren
- // (aber nach nShapeId sortieren)
- pObj->bSortByShapeId = TRUE;
- // --> OD 2008-07-28 #156763#
- pObj->nTxBxComp = pObj->nTxBxComp & 0xFFFF0000;
- // <--
- pShapeInfos->Insert( pObj );
- }
- // voriger war letzter seiner Gruppe
- if( nObj )
- pOld->GetObject( nObj-1 )->bLastBoxInChain = TRUE;
- // urspruengliches Array freigeben, ohne Objekte zu zerstoeren
- pOld->Remove((USHORT)0, nCnt);
- delete pOld;
-}
-
-
-/*****************************************************************************
-
- Einlesen der Shape-Infos im Ctor:
- ---------------------------------
- merken der Shape-Ids und zugehoerigen Blip-Nummern und TextBox-Infos
- ========= ============ =============
- und merken des File-Offsets fuer jedes Blip
- ============
-******************************************************************************/
-void SvxMSDffManager::GetCtrlData( long nOffsDgg_ )
-{
- // Start Offset unbedingt merken, falls wir nochmal aufsetzen muessen
- long nOffsDggL = nOffsDgg_;
-
- // Kontroll Stream positionieren
- rStCtrl.Seek( nOffsDggL );
-
- BYTE nVer;
- USHORT nInst;
- USHORT nFbt;
- UINT32 nLength;
- if( !this->ReadCommonRecordHeader( rStCtrl, nVer, nInst, nFbt, nLength ) ) return;
-
- BOOL bOk;
- ULONG nPos = nOffsDggL + DFF_COMMON_RECORD_HEADER_SIZE;
-
- // Fall A: erst Drawing Group Container, dann n Mal Drawing Container
- if( DFF_msofbtDggContainer == nFbt )
- {
- GetDrawingGroupContainerData( rStCtrl, nLength );
-
- rStCtrl.Seek( STREAM_SEEK_TO_END );
- UINT32 nMaxStrPos = rStCtrl.Tell();
-
- nPos += nLength;
- // --> OD 2008-07-28 #156763#
- unsigned long nDrawingContainerId = 1;
- // <--
- do
- {
- rStCtrl.Seek( nPos );
-
- bOk = ReadCommonRecordHeader( rStCtrl, nVer, nInst, nFbt, nLength ) && ( DFF_msofbtDgContainer == nFbt );
-
- if( !bOk )
- {
- nPos++;
- rStCtrl.Seek( nPos );
- bOk = ReadCommonRecordHeader( rStCtrl, nVer, nInst, nFbt, nLength )
- && ( DFF_msofbtDgContainer == nFbt );
- }
- if( bOk )
- {
- // --> OD 2008-07-28 #156763#
- GetDrawingContainerData( rStCtrl, nLength, nDrawingContainerId );
- // <--
- }
- nPos += DFF_COMMON_RECORD_HEADER_SIZE + nLength;
- // --> OD 2008-07-28 #156763#
- ++nDrawingContainerId;
- // <--
- }
- while( nPos < nMaxStrPos && bOk );
- }
-}
-
-
-// ab hier: Drawing Group Container d.h. Dokument - weit gueltige Daten
-// ======================= ========
-//
-void SvxMSDffManager::GetDrawingGroupContainerData( SvStream& rSt, ULONG nLenDgg )
-{
- BYTE nVer;
- USHORT nInst;
- USHORT nFbt;
- UINT32 nLength;
-
- ULONG nLenBStoreCont = 0, nLenFBSE = 0, nRead = 0;
-
- // Nach einem BStore Container suchen
- do
- {
- if(!this->ReadCommonRecordHeader( rSt, nVer, nInst, nFbt, nLength)) return;
- nRead += DFF_COMMON_RECORD_HEADER_SIZE + nLength;
- if( DFF_msofbtBstoreContainer == nFbt )
- {
- nLenBStoreCont = nLength; break;
- }
- rSt.SeekRel( nLength );
- }
- while( nRead < nLenDgg );
-
- if( !nLenBStoreCont ) return;
-
- // Im BStore Container alle Header der Container und Atome auslesen und die
- // relevanten Daten aller enthaltenen FBSEs in unserem Pointer Array ablegen.
- // Dabei zaehlen wir die gefundenen FBSEs im Member nBLIPCount mit.
-
- const ULONG nSkipBLIPLen = 20; // bis zu nBLIPLen zu ueberspringende Bytes
- const ULONG nSkipBLIPPos = 4; // dahinter bis zu nBLIPPos zu skippen
-
- sal_uInt32 nBLIPLen = 0, nBLIPPos = 0;
-
- nRead = 0;
- do
- {
- if(!this->ReadCommonRecordHeader( rSt, nVer, nInst, nFbt, nLength)) return;
- nRead += DFF_COMMON_RECORD_HEADER_SIZE + nLength;
- if( DFF_msofbtBSE == nFbt )
- {
- nLenFBSE = nLength;
- // ist FBSE gross genug fuer unsere Daten
- BOOL bOk = ( nSkipBLIPLen + 4 + nSkipBLIPPos + 4 <= nLenFBSE );
-
- if( bOk )
- {
- rSt.SeekRel( nSkipBLIPLen );
- rSt >> nBLIPLen;
- rSt.SeekRel( nSkipBLIPPos );
- rSt >> nBLIPPos;
- bOk = rSt.GetError() == 0;
-
- nLength -= nSkipBLIPLen+ 4 + nSkipBLIPPos + 4;
- }
-
- if( bOk )
- {
- // Besonderheit:
- // Falls nBLIPLen kleiner ist als nLenFBSE UND nBLIPPos Null ist,
- // nehmen wir an, dass das Bild IM FBSE drin steht!
- if( (!nBLIPPos) && (nBLIPLen < nLenFBSE) )
- nBLIPPos = rSt.Tell() + 4;
-
- // Das hat ja fein geklappt!
- // Wir merken uns, dass wir einen FBSE mehr im Pointer Array haben.
- nBLIPPos = Calc_nBLIPPos(nBLIPPos, rSt.Tell());
-
- if( USHRT_MAX == nBLIPCount )
- nBLIPCount = 1;
- else
- nBLIPCount++;
-
- // Jetzt die Infos fuer spaetere Zugriffe speichern
- pBLIPInfos->Insert( new SvxMSDffBLIPInfo( nInst, nBLIPPos, nBLIPLen ),
- pBLIPInfos->Count() );
- }
- }
- rSt.SeekRel( nLength );
- }
- while( nRead < nLenBStoreCont );
-}
-
-
-// ab hier: Drawing Container d.h. Seiten (Blatt, Dia) - weit gueltige Daten
-// ================= ======
-//
-void SvxMSDffManager::GetDrawingContainerData( SvStream& rSt, ULONG nLenDg,
- const unsigned long nDrawingContainerId )
-{
- BYTE nVer;USHORT nInst;USHORT nFbt;UINT32 nLength;
-
- ULONG nReadDg = 0;
-
- // Wir stehen in einem Drawing Container (je einer pro Seite)
- // und muessen nun
- // alle enthaltenen Shape Group Container abklappern
- do
- {
- if(!this->ReadCommonRecordHeader( rSt, nVer, nInst, nFbt, nLength)) return;
- nReadDg += DFF_COMMON_RECORD_HEADER_SIZE;
- // Patriarch gefunden (der oberste Shape Group Container) ?
- if( DFF_msofbtSpgrContainer == nFbt )
- {
- if(!this->GetShapeGroupContainerData( rSt, nLength, TRUE, nDrawingContainerId )) return;
- }
- else
- // blanker Shape Container ? (ausserhalb vom Shape Group Container)
- if( DFF_msofbtSpContainer == nFbt )
- {
- if(!this->GetShapeContainerData( rSt, nLength, ULONG_MAX, nDrawingContainerId )) return;
- }
- else
- rSt.SeekRel( nLength );
- nReadDg += nLength;
- }
- while( nReadDg < nLenDg );
-}
-
-BOOL SvxMSDffManager::GetShapeGroupContainerData( SvStream& rSt,
- ULONG nLenShapeGroupCont,
- BOOL bPatriarch,
- const unsigned long nDrawingContainerId )
-{
- BYTE nVer;USHORT nInst;USHORT nFbt;UINT32 nLength;
- long nStartShapeGroupCont = rSt.Tell();
- // Wir stehen in einem Shape Group Container (ggfs. mehrere pro Seite)
- // und muessen nun
- // alle enthaltenen Shape Container abklappern
- BOOL bFirst = !bPatriarch;
- ULONG nReadSpGrCont = 0;
- do
- {
- if( !this->ReadCommonRecordHeader( rSt, nVer, nInst, nFbt, nLength ) )
- return FALSE;
- nReadSpGrCont += DFF_COMMON_RECORD_HEADER_SIZE;
- // Shape Container ?
- if( DFF_msofbtSpContainer == nFbt )
- {
- ULONG nGroupOffs = bFirst ? nStartShapeGroupCont - DFF_COMMON_RECORD_HEADER_SIZE : ULONG_MAX;
- if ( !this->GetShapeContainerData( rSt, nLength, nGroupOffs, nDrawingContainerId ) )
- return FALSE;
- bFirst = FALSE;
- }
- else
- // eingeschachtelter Shape Group Container ?
- if( DFF_msofbtSpgrContainer == nFbt )
- {
- if ( !this->GetShapeGroupContainerData( rSt, nLength, FALSE, nDrawingContainerId ) )
- return FALSE;
- }
- else
- rSt.SeekRel( nLength );
- nReadSpGrCont += nLength;
- }
- while( nReadSpGrCont < nLenShapeGroupCont );
- // den Stream wieder korrekt positionieren
- rSt.Seek( nStartShapeGroupCont + nLenShapeGroupCont );
- return TRUE;
-}
-
-BOOL SvxMSDffManager::GetShapeContainerData( SvStream& rSt,
- ULONG nLenShapeCont,
- ULONG nPosGroup,
- const unsigned long nDrawingContainerId )
-{
- BYTE nVer;USHORT nInst;USHORT nFbt;UINT32 nLength;
- long nStartShapeCont = rSt.Tell();
- // Wir stehen in einem Shape Container (ggfs. mehrere pro Sh. Group)
- // und muessen nun
- // die Shape Id und File-Pos (fuer spaetere, erneute Zugriffe)
- // und den ersten BStore Verweis (falls vorhanden) entnehmen
- ULONG nLenShapePropTbl = 0;
- ULONG nReadSpCont = 0;
-
- // File Offset des Shape-Containers bzw. der Gruppe(!) vermerken
- //
- ULONG nStartOffs = (ULONG_MAX > nPosGroup) ?
- nPosGroup : nStartShapeCont - DFF_COMMON_RECORD_HEADER_SIZE;
- SvxMSDffShapeInfo aInfo( nStartOffs );
-
- // duerfte das Shape durch einen Rahmen ersetzt werden ?
- // (vorausgesetzt, es zeigt sich, dass es eine TextBox ist,
- // und der Text nicht gedreht ist)
- BOOL bCanBeReplaced = (ULONG_MAX > nPosGroup) ? FALSE : TRUE;
-
- // wir wissen noch nicht, ob es eine TextBox ist
- MSO_SPT eShapeType = mso_sptNil;
- MSO_WrapMode eWrapMode = mso_wrapSquare;
-// BOOL bIsTextBox = FALSE;
-
- // Shape analysieren
- //
- do
- {
- if(!this->ReadCommonRecordHeader( rSt, nVer, nInst, nFbt, nLength)) return FALSE;
- nReadSpCont += DFF_COMMON_RECORD_HEADER_SIZE;
- // FSP ?
- if( ( DFF_msofbtSp == nFbt ) && ( 4 <= nLength ) )
- {
- // Wir haben den FSP gefunden: Shape Typ und Id vermerken!
- eShapeType = (MSO_SPT)nInst;
- rSt >> aInfo.nShapeId;
- rSt.SeekRel( nLength - 4 );
- nReadSpCont += nLength;
- }
- else if( DFF_msofbtOPT == nFbt ) // Shape Property Table ?
- {
- // Wir haben die Property Table gefunden:
- // nach der Blip Property suchen!
- ULONG nPropRead = 0;
- USHORT nPropId;
- sal_uInt32 nPropVal;
- nLenShapePropTbl = nLength;
-// UINT32 nPropCount = nInst;
- long nStartShapePropTbl = rSt.Tell();
-// UINT32 nComplexDataFilePos = nStartShapePropTbl + (nPropCount * 6);
- do
- {
- rSt >> nPropId
- >> nPropVal;
- nPropRead += 6;
-
- switch( nPropId )
- {
- case DFF_Prop_txflTextFlow :
- //Writer can now handle vertical textflows in its
- //native frames, to only need to do this for the
- //other two formats
-
- //Writer will handle all textflow except BtoT
- if (GetSvxMSDffSettings() &
- (SVXMSDFF_SETTINGS_IMPORT_PPT |
- SVXMSDFF_SETTINGS_IMPORT_EXCEL))
- {
- if( 0 != nPropVal )
- bCanBeReplaced = false;
- }
- else if (
- (nPropVal != mso_txflHorzN) &&
- (nPropVal != mso_txflTtoBA)
- )
- {
- bCanBeReplaced = false;
- }
- break;
- case DFF_Prop_cdirFont :
- //Writer can now handle right to left and left
- //to right in its native frames, so only do
- //this for the other two formats.
- if (GetSvxMSDffSettings() &
- (SVXMSDFF_SETTINGS_IMPORT_PPT |
- SVXMSDFF_SETTINGS_IMPORT_EXCEL))
- {
- if( 0 != nPropVal )
- bCanBeReplaced = FALSE;
- }
- break;
- case DFF_Prop_Rotation :
- if( 0 != nPropVal )
- bCanBeReplaced = FALSE;
- break;
-
- case DFF_Prop_gtextFStrikethrough :
- if( ( 0x20002000 & nPropVal ) == 0x20002000 )
- bCanBeReplaced = FALSE;
- break;
-
- case DFF_Prop_fc3DLightFace :
- if( ( 0x00080008 & nPropVal ) == 0x00080008 )
- bCanBeReplaced = FALSE;
- break;
-
- case DFF_Prop_WrapText :
- eWrapMode = (MSO_WrapMode)nPropVal;
- break;
-
- default:
- {
- // Bit gesetzt und gueltig?
- if( 0x4000 == ( nPropId & 0xC000 ) )
- {
- // Blip Property gefunden: BStore Idx vermerken!
- nPropRead = nLenShapePropTbl;
- }
- else if( 0x8000 & nPropId )
- {
- // komplexe Prop gefunden:
- // Laenge ist immer 6, nur die Laenge der nach der
- // eigentlichen Prop-Table anhaengenden Extra-Daten
- // ist unterschiedlich
- nPropVal = 6;
- }
- }
- break;
- }
-
-/*
-//JP 21.04.99: Bug 64510
-// alte Version, die unter OS/2 zu Compilerfehlern fuehrt und damit arge
-// Performance einbussen hat.
-
- if( 0x4000 == ( nPropId & 0xC000 ) )// Bit gesetzt und gueltig?
- {
- // Blip Property gefunden: BStore Idx vermerken!
- aInfo.nBStoreIdx = nPropVal; // Index im BStore Container
- break;
- }
- else
- if( ( ( (DFF_Prop_txflTextFlow == nPropId)
- || (DFF_Prop_Rotation == nPropId)
- || (DFF_Prop_cdirFont == nPropId) )
- && (0 != nPropVal) )
-
- || ( (DFF_Prop_gtextFStrikethrough == nPropId)
- && ( (0x20002000 & nPropVal) == 0x20002000) ) // also DFF_Prop_gtextFVertical
- || ( (DFF_Prop_fc3DLightFace == nPropId)
- && ( (0x00080008 & nPropVal) == 0x00080008) ) // also DFF_Prop_f3D
- )
- {
- bCanBeReplaced = FALSE; // Mist: gedrehter Text oder 3D-Objekt!
- }
- else
- if( DFF_Prop_WrapText == nPropId )
- {
- eWrapMode = (MSO_WrapMode)nPropVal;
- }
- ////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////
- // keine weitere Property-Auswertung: folge beim Shape-Import //
- ////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////
- else
- if( 0x8000 & nPropId )
- {
- // komplexe Prop gefunden: Laenge lesen und ueberspringen
- if(!SkipBytes( rSt, nPropVal )) return FALSE;
- nPropRead += nPropVal;
- }
-*/
- }
- while( nPropRead < nLenShapePropTbl );
- rSt.Seek( nStartShapePropTbl + nLenShapePropTbl );
- nReadSpCont += nLenShapePropTbl;
- }
- else if( ( DFF_msofbtClientTextbox == nFbt ) && ( 4 == nLength ) ) // Text-Box-Story-Eintrag gefunden
- {
- rSt >> aInfo.nTxBxComp;
- // --> OD 2008-07-28 #156763#
- // Add internal drawing container id to text id.
- // Note: The text id uses the first two bytes, while the internal
- // drawing container id used the second two bytes.
- aInfo.nTxBxComp = ( aInfo.nTxBxComp & 0xFFFF0000 ) +
- nDrawingContainerId;
- DBG_ASSERT( (aInfo.nTxBxComp & 0x0000FFFF) == nDrawingContainerId,
- "<SvxMSDffManager::GetShapeContainerData(..)> - internal drawing container Id could not be correctly merged into DFF_msofbtClientTextbox value." );
- // <--
- }
- else
- {
- rSt.SeekRel( nLength );
- nReadSpCont += nLength;
- }
- }
- while( nReadSpCont < nLenShapeCont );
-
- //
- // Jetzt ggfs. die Infos fuer spaetere Zugriffe auf das Shape speichern
- //
- if( aInfo.nShapeId )
- {
- // fuer Textboxen ggfs. ersetzen durch Rahmen erlauben
- if( bCanBeReplaced
- && aInfo.nTxBxComp
- && (
- ( eShapeType == mso_sptTextSimple )
- || ( eShapeType == mso_sptTextBox )
- || ( ( ( eShapeType == mso_sptRectangle )
- || ( eShapeType == mso_sptRoundRectangle )
- )
- ) ) )
- {
- aInfo.bReplaceByFly = TRUE;
- }
- pShapeInfos->Insert( new SvxMSDffShapeInfo( aInfo ) );
- pShapeOrders->Insert( new SvxMSDffShapeOrder( aInfo.nShapeId ),
- pShapeOrders->Count() );
- }
-
- // und den Stream wieder korrekt positionieren
- rSt.Seek( nStartShapeCont + nLenShapeCont );
- return TRUE;
-}
-
-
-
-/*****************************************************************************
-
- Zugriff auf ein Shape zur Laufzeit (ueber die Shape-Id)
- ----------------------------------
-******************************************************************************/
-BOOL SvxMSDffManager::GetShape(ULONG nId, SdrObject*& rpShape,
- SvxMSDffImportData& rData)
-{
- SvxMSDffShapeInfo aTmpRec(0, nId);
- aTmpRec.bSortByShapeId = TRUE;
-
- USHORT nFound;
- if( pShapeInfos->Seek_Entry(&aTmpRec, &nFound) )
- {
- SvxMSDffShapeInfo& rInfo = *pShapeInfos->GetObject( nFound );
-
- // eventuell altes Errorflag loeschen
- if( rStCtrl.GetError() )
- rStCtrl.ResetError();
- // FilePos des/der Stream(s) merken
- ULONG nOldPosCtrl = rStCtrl.Tell();
- ULONG nOldPosData = pStData ? pStData->Tell() : nOldPosCtrl;
- // das Shape im Steuer Stream anspringen
- rStCtrl.Seek( rInfo.nFilePos );
-
- // Falls missglueckt, den Fehlerstatus zuruecksetzen und Pech gehabt!
- if( rStCtrl.GetError() )
- rStCtrl.ResetError();
- else
- rpShape = ImportObj( rStCtrl, &rData, rData.aParentRect, rData.aParentRect );
-
- // alte FilePos des/der Stream(s) restaurieren
- rStCtrl.Seek( nOldPosCtrl );
- if( &rStCtrl != pStData )
- pStData->Seek( nOldPosData );
- return ( 0 != rpShape );
- }
- return FALSE;
-}
-
-
-
-/* Zugriff auf ein BLIP zur Laufzeit (bei bereits bekannter Blip-Nr)
- ---------------------------------
-******************************************************************************/
-BOOL SvxMSDffManager::GetBLIP( ULONG nIdx_, Graphic& rData, Rectangle* pVisArea ) const
-{
- BOOL bOk = FALSE; // Ergebnisvariable initialisieren
- if ( pStData )
- {
- // check if a graphic for this blipId is already imported
- if ( nIdx_ && pEscherBlipCache )
- {
- EscherBlipCacheEntry* pEntry;
- for ( pEntry = (EscherBlipCacheEntry*)pEscherBlipCache->First(); pEntry;
- pEntry = (EscherBlipCacheEntry*)pEscherBlipCache->Next() )
- {
- if ( pEntry->nBlip == nIdx_ )
- { /* if this entry is available, then it should be possible
- to get the Graphic via GraphicObject */
- GraphicObject aGraphicObject( pEntry->aUniqueID );
- rData = aGraphicObject.GetGraphic();
- if ( rData.GetType() != GRAPHIC_NONE )
- bOk = sal_True;
- else
- delete (EscherBlipCacheEntry*)pEscherBlipCache->Remove();
- break;
- }
- }
- }
- if ( !bOk )
- {
- USHORT nIdx = USHORT( nIdx_ );
- if( !nIdx || (pBLIPInfos->Count() < nIdx) ) return FALSE;
-
- // eventuell alte(s) Errorflag(s) loeschen
- if( rStCtrl.GetError() )
- rStCtrl.ResetError();
- if( ( &rStCtrl != pStData )
- && pStData->GetError() )
- pStData->ResetError();
-
- // FilePos des/der Stream(s) merken
- ULONG nOldPosCtrl = rStCtrl.Tell();
- ULONG nOldPosData = pStData ? pStData->Tell() : nOldPosCtrl;
-
- // passende Info-Struct aus unserem Pointer Array nehmen
- SvxMSDffBLIPInfo& rInfo = *(*pBLIPInfos)[ nIdx-1 ];
-
- // das BLIP Atom im Daten Stream anspringen
- pStData->Seek( rInfo.nFilePos );
- // ggfs. Fehlerstatus zuruecksetzen
- if( pStData->GetError() )
- pStData->ResetError();
- else
- bOk = GetBLIPDirect( *pStData, rData, pVisArea );
- if( pStData2 && !bOk )
- {
- // Fehler, aber zweite Chance: es gibt noch einen zweiten
- // Datenstream, in dem die Grafik liegen koennte!
- if( pStData2->GetError() )
- pStData2->ResetError();
- ULONG nOldPosData2 = pStData2->Tell();
- // das BLIP Atom im zweiten Daten Stream anspringen
- pStData2->Seek( rInfo.nFilePos );
- // ggfs. Fehlerstatus zuruecksetzen
- if( pStData2->GetError() )
- pStData2->ResetError();
- else
- bOk = GetBLIPDirect( *pStData2, rData, pVisArea );
- // alte FilePos des zweiten Daten-Stream restaurieren
- pStData2->Seek( nOldPosData2 );
- }
- // alte FilePos des/der Stream(s) restaurieren
- rStCtrl.Seek( nOldPosCtrl );
- if( &rStCtrl != pStData )
- pStData->Seek( nOldPosData );
-
- if ( bOk )
- {
- // create new BlipCacheEntry for this graphic
- GraphicObject aGraphicObject( rData );
- if ( !pEscherBlipCache )
- const_cast <SvxMSDffManager*> (this)->pEscherBlipCache = new List();
- EscherBlipCacheEntry* pNewEntry = new EscherBlipCacheEntry( nIdx_, aGraphicObject.GetUniqueID() );
- pEscherBlipCache->Insert( pNewEntry, LIST_APPEND );
- }
- }
- }
- return bOk;
-}
-
-/* Zugriff auf ein BLIP zur Laufzeit (mit korrekt positioniertem Stream)
- ---------------------------------
-******************************************************************************/
-BOOL SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData, Rectangle* pVisArea ) const
-{
- ULONG nOldPos = rBLIPStream.Tell();
-
- int nRes = GRFILTER_OPENERROR; // Fehlervariable initialisieren
-
- // nachschauen, ob es sich auch wirklich um ein BLIP handelt
- UINT32 nLength;
- USHORT nInst, nFbt( 0 );
- BYTE nVer;
- if( ReadCommonRecordHeader( rBLIPStream, nVer, nInst, nFbt, nLength) && ( 0xF018 <= nFbt ) && ( 0xF117 >= nFbt ) )
- {
- Size aMtfSize100;
- BOOL bMtfBLIP = FALSE;
- BOOL bZCodecCompression = FALSE;
- // Nun exakt auf den Beginn der eingebetteten Grafik positionieren
- ULONG nSkip = ( nInst & 0x0001 ) ? 32 : 16;
-
- switch( nInst & 0xFFFE )
- {
- case 0x216 : // Metafile header then compressed WMF
- case 0x3D4 : // Metafile header then compressed EMF
- case 0x542 : // Metafile hd. then compressed PICT
- {
- rBLIPStream.SeekRel( nSkip + 20 );
-
- // read in size of metafile in EMUS
- rBLIPStream >> aMtfSize100.Width() >> aMtfSize100.Height();
-
- // scale to 1/100mm
- aMtfSize100.Width() /= 360, aMtfSize100.Height() /= 360;
-
- if ( pVisArea ) // seem that we currently are skipping the visarea position
- *pVisArea = Rectangle( Point(), aMtfSize100 );
-
- // skip rest of header
- nSkip = 6;
- bMtfBLIP = bZCodecCompression = TRUE;
- }
- break;
- case 0x46A : // One byte tag then JPEG (= JFIF) data
- case 0x6E0 : // One byte tag then PNG data
- case 0x7A8 :
- nSkip += 1; // One byte tag then DIB data
- break;
- }
- rBLIPStream.SeekRel( nSkip );
-
- SvStream* pGrStream = &rBLIPStream;
- SvMemoryStream* pOut = NULL;
- if( bZCodecCompression )
- {
- pOut = new SvMemoryStream( 0x8000, 0x4000 );
- ZCodec aZCodec( 0x8000, 0x8000 );
- aZCodec.BeginCompression();
- aZCodec.Decompress( rBLIPStream, *pOut );
- aZCodec.EndCompression();
- pOut->Seek( STREAM_SEEK_TO_BEGIN );
- pGrStream = pOut;
- }
-
-//#define DBG_EXTRACTGRAPHICS
-#ifdef DBG_EXTRACTGRAPHICS
-
- static sal_Int32 nCount;
-
- String aFileName( String( RTL_CONSTASCII_STRINGPARAM( "dbggfx" ) ) );
- aFileName.Append( String::CreateFromInt32( nCount++ ) );
- switch( nInst &~ 1 )
- {
- case 0x216 : aFileName.Append( String( RTL_CONSTASCII_STRINGPARAM( ".wmf" ) ) ); break;
- case 0x3d4 : aFileName.Append( String( RTL_CONSTASCII_STRINGPARAM( ".emf" ) ) ); break;
- case 0x542 : aFileName.Append( String( RTL_CONSTASCII_STRINGPARAM( ".pct" ) ) ); break;
- case 0x46a : aFileName.Append( String( RTL_CONSTASCII_STRINGPARAM( ".jpg" ) ) ); break;
- case 0x6e0 : aFileName.Append( String( RTL_CONSTASCII_STRINGPARAM( ".png" ) ) ); break;
- case 0x7a8 : aFileName.Append( String( RTL_CONSTASCII_STRINGPARAM( ".bmp" ) ) ); break;
- }
-
- String aURLStr;
-
- if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( Application::GetAppFileName(), aURLStr ) )
- {
- INetURLObject aURL( aURLStr );
-
- aURL.removeSegment();
- aURL.removeFinalSlash();
- aURL.Append( aFileName );
-
- SvStream* pDbgOut = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_TRUNC | STREAM_WRITE );
-
- if( pDbgOut )
- {
- if ( bZCodecCompression )
- {
- pOut->Seek( STREAM_SEEK_TO_END );
- pDbgOut->Write( pOut->GetData(), pOut->Tell() );
- pOut->Seek( STREAM_SEEK_TO_BEGIN );
- }
- else
- {
- sal_Int32 nDbgLen = nLength - nSkip;
- if ( nDbgLen )
- {
- sal_Char* pDat = new sal_Char[ nDbgLen ];
- pGrStream->Read( pDat, nDbgLen );
- pDbgOut->Write( pDat, nDbgLen );
- pGrStream->SeekRel( -nDbgLen );
- delete[] pDat;
- }
- }
-
- delete pDbgOut;
- }
- }
-#endif
-
- if( ( nInst & 0xFFFE ) == 0x7A8 )
- { // DIBs direkt holen
- Bitmap aNew;
- if( aNew.Read( *pGrStream, FALSE ) )
- {
- rData = Graphic( aNew );
- nRes = GRFILTER_OK;
- }
- }
- else
- { // und unsere feinen Filter darauf loslassen
- GraphicFilter* pGF = GetGrfFilter();
- String aEmptyStr;
- nRes = pGF->ImportGraphic( rData, aEmptyStr, *pGrStream, GRFILTER_FORMAT_DONTKNOW );
-
- // SJ: I40472, sometimes the aspect ratio (aMtfSize100) does not match and we get scaling problems,
- // then it is better to use the prefsize that is stored within the metafile. Bug #72846# for what the
- // scaling has been implemented does not happen anymore.
- //
- // For pict graphics we will furthermore scale the metafile, because font scaling leads to error if the
- // dxarray is empty (this has been solved in wmf/emf but not for pict)
- if( bMtfBLIP && ( GRFILTER_OK == nRes ) && ( rData.GetType() == GRAPHIC_GDIMETAFILE ) && ( ( nInst & 0xFFFE ) == 0x542 ) )
- {
- if ( ( aMtfSize100.Width() >= 1000 ) && ( aMtfSize100.Height() >= 1000 ) )
- { // #75956#, scaling does not work properly, if the graphic is less than 1cm
- GDIMetaFile aMtf( rData.GetGDIMetaFile() );
- const Size aOldSize( aMtf.GetPrefSize() );
-
- if( aOldSize.Width() && ( aOldSize.Width() != aMtfSize100.Width() ) &&
- aOldSize.Height() && ( aOldSize.Height() != aMtfSize100.Height() ) )
- {
- aMtf.Scale( (double) aMtfSize100.Width() / aOldSize.Width(),
- (double) aMtfSize100.Height() / aOldSize.Height() );
- aMtf.SetPrefSize( aMtfSize100 );
- aMtf.SetPrefMapMode( MAP_100TH_MM );
- rData = aMtf;
- }
- }
- }
- }
- // ggfs. Fehlerstatus zuruecksetzen
- if ( ERRCODE_IO_PENDING == pGrStream->GetError() )
- pGrStream->ResetError();
- delete pOut;
- }
- rBLIPStream.Seek( nOldPos ); // alte FilePos des Streams restaurieren
-
- return ( GRFILTER_OK == nRes ); // Ergebniss melden
-}
-
-/* static */
-BOOL SvxMSDffManager::ReadCommonRecordHeader(DffRecordHeader& rRec, SvStream& rIn)
-{
- rRec.nFilePos = rIn.Tell();
- return SvxMSDffManager::ReadCommonRecordHeader( rIn,rRec.nRecVer,
- rRec.nRecInstance,
- rRec.nRecType,
- rRec.nRecLen );
-}
-
-
-/* auch static */
-BOOL SvxMSDffManager::ReadCommonRecordHeader( SvStream& rSt,
- BYTE& rVer,
- USHORT& rInst,
- USHORT& rFbt,
- UINT32& rLength )
-{
- sal_uInt16 nTmp;
- rSt >> nTmp >> rFbt >> rLength;
- rVer = sal::static_int_cast< BYTE >(nTmp & 15);
- rInst = nTmp >> 4;
- return rSt.GetError() == 0;
-}
-
-
-
-
-BOOL SvxMSDffManager::ProcessClientAnchor(SvStream& rStData, ULONG nDatLen,
- char*& rpBuff, UINT32& rBuffLen ) const
-{
- if( nDatLen )
- {
- rpBuff = new char[ nDatLen ];
- rBuffLen = nDatLen;
- rStData.Read( rpBuff, nDatLen );
- }
- return TRUE;
-}
-
-BOOL SvxMSDffManager::ProcessClientData(SvStream& rStData, ULONG nDatLen,
- char*& rpBuff, UINT32& rBuffLen ) const
-{
- if( nDatLen )
- {
- rpBuff = new char[ nDatLen ];
- rBuffLen = nDatLen;
- rStData.Read( rpBuff, nDatLen );
- }
- return TRUE;
-}
-
-
-void SvxMSDffManager::ProcessClientAnchor2( SvStream& /* rSt */, DffRecordHeader& /* rHd */ , void* /* pData */, DffObjData& /* rObj */ )
-{
- return; // wird von SJ im Draw ueberladen
-}
-
-ULONG SvxMSDffManager::Calc_nBLIPPos( ULONG nOrgVal, ULONG /* nStreamPos */ ) const
-{
- return nOrgVal;
-}
-
-BOOL SvxMSDffManager::GetOLEStorageName( long /* nOLEId */, String&, SvStorageRef&, uno::Reference < embed::XStorage >& ) const
-{
- return FALSE;
-}
-
-BOOL SvxMSDffManager::ShapeHasText( ULONG /* nShapeId */, ULONG /* nFilePos */ ) const
-{
- return TRUE;
-}
-
-// --> OD 2004-12-14 #i32596# - add new parameter <_nCalledByGroup>
-SdrObject* SvxMSDffManager::ImportOLE( long nOLEId,
- const Graphic& rGrf,
- const Rectangle& rBoundRect,
- const Rectangle& rVisArea,
- const int /* _nCalledByGroup */,
- sal_Int64 nAspect ) const
-// <--
-{
- SdrObject* pRet = 0;
- String sStorageName;
- SvStorageRef xSrcStg;
- ErrCode nError = ERRCODE_NONE;
- uno::Reference < embed::XStorage > xDstStg;
- if( GetOLEStorageName( nOLEId, sStorageName, xSrcStg, xDstStg ))
- pRet = CreateSdrOLEFromStorage( sStorageName, xSrcStg, xDstStg,
- rGrf, rBoundRect, rVisArea, pStData, nError,
- nSvxMSDffOLEConvFlags, nAspect );
- return pRet;
-}
-
-const GDIMetaFile* SvxMSDffManager::lcl_GetMetaFileFromGrf_Impl( const Graphic& rGrf,
- GDIMetaFile& rMtf )
-{
- const GDIMetaFile* pMtf;
- if( GRAPHIC_BITMAP == rGrf.GetType() )
- {
- Point aPt;
- const Size aSz(lcl_GetPrefSize(rGrf, MAP_100TH_MM));
-
- VirtualDevice aVirtDev;
- aVirtDev.EnableOutput( FALSE );
- MapMode aMM(MAP_100TH_MM);
- aVirtDev.SetMapMode( aMM );
-
- rMtf.Record( &aVirtDev );
- rGrf.Draw( &aVirtDev, aPt, aSz );
- rMtf.Stop();
- rMtf.SetPrefMapMode(aMM);
- rMtf.SetPrefSize( aSz );
-
- pMtf = &rMtf;
- }
- else
- pMtf = &rGrf.GetGDIMetaFile();
- return pMtf;
-}
-
-BOOL SvxMSDffManager::MakeContentStream( SotStorage * pStor, const GDIMetaFile & rMtf )
-{
- String aPersistStream( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( SVEXT_PERSIST_STREAM ) ) );
- SotStorageStreamRef xStm = pStor->OpenSotStream( aPersistStream );
- xStm->SetVersion( pStor->GetVersion() );
- xStm->SetBufferSize( 8192 );
-
- USHORT nAspect = ASPECT_CONTENT;
- ULONG nAdviseModes = 2;
-
- Impl_OlePres aEle( FORMAT_GDIMETAFILE );
- // Die Groesse in 1/100 mm umrechnen
- // Falls eine nicht anwendbare MapUnit (Device abhaengig) verwendet wird,
- // versucht SV einen BestMatchden richtigen Wert zu raten.
- Size aSize = rMtf.GetPrefSize();
- MapMode aMMSrc = rMtf.GetPrefMapMode();
- MapMode aMMDst( MAP_100TH_MM );
- aSize = OutputDevice::LogicToLogic( aSize, aMMSrc, aMMDst );
- aEle.SetSize( aSize );
- aEle.SetAspect( nAspect );
- aEle.SetAdviseFlags( nAdviseModes );
- aEle.SetMtf( rMtf );
- aEle.Write( *xStm );
-
- xStm->SetBufferSize( 0 );
- return xStm->GetError() == SVSTREAM_OK;
-}
-
-struct ClsIDs {
- UINT32 nId;
- const sal_Char* pSvrName;
- const sal_Char* pDspName;
-};
-static ClsIDs aClsIDs[] = {
-
- { 0x000212F0, "MSWordArt", "Microsoft Word Art" },
- { 0x000212F0, "MSWordArt.2", "Microsoft Word Art 2.0" },
-
- // MS Apps
- { 0x00030000, "ExcelWorksheet", "Microsoft Excel Worksheet" },
- { 0x00030001, "ExcelChart", "Microsoft Excel Chart" },
- { 0x00030002, "ExcelMacrosheet", "Microsoft Excel Macro" },
- { 0x00030003, "WordDocument", "Microsoft Word Document" },
- { 0x00030004, "MSPowerPoint", "Microsoft PowerPoint" },
- { 0x00030005, "MSPowerPointSho", "Microsoft PowerPoint Slide Show"},
- { 0x00030006, "MSGraph", "Microsoft Graph" },
- { 0x00030007, "MSDraw", "Microsoft Draw" },
- { 0x00030008, "Note-It", "Microsoft Note-It" },
- { 0x00030009, "WordArt", "Microsoft Word Art" },
- { 0x0003000a, "PBrush", "Microsoft PaintBrush Picture" },
- { 0x0003000b, "Equation", "Microsoft Equation Editor" },
- { 0x0003000c, "Package", "Package" },
- { 0x0003000d, "SoundRec", "Sound" },
- { 0x0003000e, "MPlayer", "Media Player" },
- // MS Demos
- { 0x0003000f, "ServerDemo", "OLE 1.0 Server Demo" },
- { 0x00030010, "Srtest", "OLE 1.0 Test Demo" },
- { 0x00030011, "SrtInv", "OLE 1.0 Inv Demo" },
- { 0x00030012, "OleDemo", "OLE 1.0 Demo" },
-
- // Coromandel / Dorai Swamy / 718-793-7963
- { 0x00030013, "CoromandelIntegra", "Coromandel Integra" },
- { 0x00030014, "CoromandelObjServer","Coromandel Object Server" },
-
- // 3-d Visions Corp / Peter Hirsch / 310-325-1339
- { 0x00030015, "StanfordGraphics", "Stanford Graphics" },
-
- // Deltapoint / Nigel Hearne / 408-648-4000
- { 0x00030016, "DGraphCHART", "DeltaPoint Graph Chart" },
- { 0x00030017, "DGraphDATA", "DeltaPoint Graph Data" },
-
- // Corel / Richard V. Woodend / 613-728-8200 x1153
- { 0x00030018, "PhotoPaint", "Corel PhotoPaint" },
- { 0x00030019, "CShow", "Corel Show" },
- { 0x0003001a, "CorelChart", "Corel Chart" },
- { 0x0003001b, "CDraw", "Corel Draw" },
-
- // Inset Systems / Mark Skiba / 203-740-2400
- { 0x0003001c, "HJWIN1.0", "Inset Systems" },
-
- // Mark V Systems / Mark McGraw / 818-995-7671
- { 0x0003001d, "ObjMakerOLE", "MarkV Systems Object Maker" },
-
- // IdentiTech / Mike Gilger / 407-951-9503
- { 0x0003001e, "FYI", "IdentiTech FYI" },
- { 0x0003001f, "FYIView", "IdentiTech FYI Viewer" },
-
- // Inventa Corporation / Balaji Varadarajan / 408-987-0220
- { 0x00030020, "Stickynote", "Inventa Sticky Note" },
-
- // ShapeWare Corp. / Lori Pearce / 206-467-6723
- { 0x00030021, "ShapewareVISIO10", "Shapeware Visio 1.0" },
- { 0x00030022, "ImportServer", "Spaheware Import Server" },
-
- // test app SrTest
- { 0x00030023, "SrvrTest", "OLE 1.0 Server Test" },
-
- // test app ClTest. Doesn't really work as a server but is in reg db
- { 0x00030025, "Cltest", "OLE 1.0 Client Test" },
-
- // Microsoft ClipArt Gallery Sherry Larsen-Holmes
- { 0x00030026, "MS_ClipArt_Gallery", "Microsoft ClipArt Gallery" },
- // Microsoft Project Cory Reina
- { 0x00030027, "MSProject", "Microsoft Project" },
-
- // Microsoft Works Chart
- { 0x00030028, "MSWorksChart", "Microsoft Works Chart" },
-
- // Microsoft Works Spreadsheet
- { 0x00030029, "MSWorksSpreadsheet", "Microsoft Works Spreadsheet" },
-
- // AFX apps - Dean McCrory
- { 0x0003002A, "MinSvr", "AFX Mini Server" },
- { 0x0003002B, "HierarchyList", "AFX Hierarchy List" },
- { 0x0003002C, "BibRef", "AFX BibRef" },
- { 0x0003002D, "MinSvrMI", "AFX Mini Server MI" },
- { 0x0003002E, "TestServ", "AFX Test Server" },
-
- // Ami Pro
- { 0x0003002F, "AmiProDocument", "Ami Pro Document" },
-
- // WordPerfect Presentations For Windows
- { 0x00030030, "WPGraphics", "WordPerfect Presentation" },
- { 0x00030031, "WPCharts", "WordPerfect Chart" },
-
- // MicroGrafx Charisma
- { 0x00030032, "Charisma", "MicroGrafx Charisma" },
- { 0x00030033, "Charisma_30", "MicroGrafx Charisma 3.0" },
- { 0x00030034, "CharPres_30", "MicroGrafx Charisma 3.0 Pres" },
- // MicroGrafx Draw
- { 0x00030035, "Draw", "MicroGrafx Draw" },
- // MicroGrafx Designer
- { 0x00030036, "Designer_40", "MicroGrafx Designer 4.0" },
-
- // STAR DIVISION
-// { 0x000424CA, "StarMath", "StarMath 1.0" },
- { 0x00043AD2, "FontWork", "Star FontWork" },
-// { 0x000456EE, "StarMath2", "StarMath 2.0" },
-
- { 0, "", "" } };
-
-
-BOOL SvxMSDffManager::ConvertToOle2( SvStream& rStm, UINT32 nReadLen,
- const GDIMetaFile * pMtf, const SotStorageRef& rDest )
-{
- BOOL bMtfRead = FALSE;
- SotStorageStreamRef xOle10Stm = rDest->OpenSotStream( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\1Ole10Native" ) ),
- STREAM_WRITE| STREAM_SHARE_DENYALL );
- if( xOle10Stm->GetError() )
- return FALSE;
-
- UINT32 nType;
- UINT32 nRecType;
- UINT32 nStrLen;
- String aSvrName;
- UINT32 nDummy0;
- UINT32 nDummy1;
- UINT32 nDataLen;
- BYTE * pData;
- UINT32 nBytesRead = 0;
- do
- {
- rStm >> nType;
- rStm >> nRecType;
- rStm >> nStrLen;
- if( nStrLen )
- {
- if( 0x10000L > nStrLen )
- {
- sal_Char * pBuf = new sal_Char[ nStrLen ];
- rStm.Read( pBuf, nStrLen );
- aSvrName.Assign( String( pBuf, (USHORT) nStrLen-1, gsl_getSystemTextEncoding() ) );
- delete[] pBuf;
- }
- else
- break;
- }
- rStm >> nDummy0;
- rStm >> nDummy1;
- rStm >> nDataLen;
-
- nBytesRead += 6 * sizeof( UINT32 ) + nStrLen + nDataLen;
-
- if( !rStm.IsEof() && nReadLen > nBytesRead && nDataLen )
- {
- if( xOle10Stm.Is() )
- {
- pData = new BYTE[ nDataLen ];
- if( !pData )
- return FALSE;
-
- rStm.Read( pData, nDataLen );
-
- // write to ole10 stream
- *xOle10Stm << nDataLen;
- xOle10Stm->Write( pData, nDataLen );
- xOle10Stm = SotStorageStreamRef();
-
- // set the compobj stream
- ClsIDs* pIds;
- for( pIds = aClsIDs; pIds->nId; pIds++ )
- {
- if( COMPARE_EQUAL == aSvrName.CompareToAscii( pIds->pSvrName ) )
- break;
- }
-// SvGlobalName* pClsId = NULL;
- String aShort, aFull;
- if( pIds->nId )
- {
- // gefunden!
- ULONG nCbFmt = SotExchange::RegisterFormatName( aSvrName );
- rDest->SetClass( SvGlobalName( pIds->nId, 0, 0, 0xc0,0,0,0,0,0,0,0x46 ), nCbFmt,
- String( pIds->pDspName, RTL_TEXTENCODING_ASCII_US ) );
- }
- else
- {
- ULONG nCbFmt = SotExchange::RegisterFormatName( aSvrName );
- rDest->SetClass( SvGlobalName(), nCbFmt, aSvrName );
- }
-
- delete[] pData;
- }
- else if( nRecType == 5 && !pMtf )
- {
- ULONG nPos = rStm.Tell();
- UINT16 sz[4];
- rStm.Read( sz, 8 );
- //rStm.SeekRel( 8 );
- Graphic aGraphic;
- if( ERRCODE_NONE == GraphicConverter::Import( rStm, aGraphic ) && aGraphic.GetType() )
- {
- const GDIMetaFile& rMtf = aGraphic.GetGDIMetaFile();
- MakeContentStream( rDest, rMtf );
- bMtfRead = TRUE;
- }
- // set behind the data
- rStm.Seek( nPos + nDataLen );
- }
- else
- rStm.SeekRel( nDataLen );
- }
- } while( !rStm.IsEof() && nReadLen >= nBytesRead );
-
- if( !bMtfRead && pMtf )
- {
- MakeContentStream( rDest, *pMtf );
- return TRUE;
- }
-
- return FALSE;
-}
-
-const char* GetInternalServerName_Impl( const SvGlobalName& aGlobName )
-{
- if ( aGlobName == SvGlobalName( SO3_SW_OLE_EMBED_CLASSID_60 )
- || aGlobName == SvGlobalName( SO3_SW_OLE_EMBED_CLASSID_8 ) )
- return "swriter";
- else if ( aGlobName == SvGlobalName( SO3_SC_OLE_EMBED_CLASSID_60 )
- || aGlobName == SvGlobalName( SO3_SC_OLE_EMBED_CLASSID_8 ) )
- return "scalc";
- else if ( aGlobName == SvGlobalName( SO3_SIMPRESS_OLE_EMBED_CLASSID_60 )
- || aGlobName == SvGlobalName( SO3_SIMPRESS_OLE_EMBED_CLASSID_8 ) )
- return "simpress";
- else if ( aGlobName == SvGlobalName( SO3_SDRAW_OLE_EMBED_CLASSID_60 )
- || aGlobName == SvGlobalName( SO3_SDRAW_OLE_EMBED_CLASSID_8 ) )
- return "sdraw";
- else if ( aGlobName == SvGlobalName( SO3_SM_OLE_EMBED_CLASSID_60 )
- || aGlobName == SvGlobalName( SO3_SM_OLE_EMBED_CLASSID_8 ) )
- return "smath";
- else if ( aGlobName == SvGlobalName( SO3_SCH_OLE_EMBED_CLASSID_60 )
- || aGlobName == SvGlobalName( SO3_SCH_OLE_EMBED_CLASSID_8 ) )
- return "schart";
- return 0;
-}
-
-::rtl::OUString GetFilterNameFromClassID_Impl( const SvGlobalName& aGlobName )
-{
- if ( aGlobName == SvGlobalName( SO3_SW_OLE_EMBED_CLASSID_60 ) )
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StarOffice XML (Writer)" ) );
-
- if ( aGlobName == SvGlobalName( SO3_SW_OLE_EMBED_CLASSID_8 ) )
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "writer8" ) );
-
- if ( aGlobName == SvGlobalName( SO3_SC_OLE_EMBED_CLASSID_60 ) )
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StarOffice XML (Calc)" ) );
-
- if ( aGlobName == SvGlobalName( SO3_SC_OLE_EMBED_CLASSID_8 ) )
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "calc8" ) );
-
- if ( aGlobName == SvGlobalName( SO3_SIMPRESS_OLE_EMBED_CLASSID_60 ) )
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StarOffice XML (Impress)" ) );
-
- if ( aGlobName == SvGlobalName( SO3_SIMPRESS_OLE_EMBED_CLASSID_8 ) )
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "impress8" ) );
-
- if ( aGlobName == SvGlobalName( SO3_SDRAW_OLE_EMBED_CLASSID_60 ) )
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StarOffice XML (Draw)" ) );
-
- if ( aGlobName == SvGlobalName( SO3_SDRAW_OLE_EMBED_CLASSID_8 ) )
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "draw8" ) );
-
- if ( aGlobName == SvGlobalName( SO3_SM_OLE_EMBED_CLASSID_60 ) )
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StarOffice XML (Math)" ) );
-
- if ( aGlobName == SvGlobalName( SO3_SM_OLE_EMBED_CLASSID_8 ) )
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "math8" ) );
-
- if ( aGlobName == SvGlobalName( SO3_SCH_OLE_EMBED_CLASSID_60 ) )
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StarOffice XML (Chart)" ) );
-
- if ( aGlobName == SvGlobalName( SO3_SCH_OLE_EMBED_CLASSID_8 ) )
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "chart8" ) );
-
- return ::rtl::OUString();
-}
-
-com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > SvxMSDffManager::CheckForConvertToSOObj( UINT32 nConvertFlags,
- SotStorage& rSrcStg, const uno::Reference < embed::XStorage >& rDestStorage,
- const Graphic& rGrf,
- const Rectangle& rVisArea )
-{
- uno::Reference < embed::XEmbeddedObject > xObj;
- SvGlobalName aStgNm = rSrcStg.GetClassName();
- const char* pName = GetInternalServerName_Impl( aStgNm );
- String sStarName;
- if ( pName )
- sStarName = String::CreateFromAscii( pName );
- else if ( nConvertFlags )
- {
- static struct _ObjImpType
- {
- UINT32 nFlag;
- const char* pFactoryNm;
- // GlobalNameId
- UINT32 n1;
- USHORT n2, n3;
- BYTE b8, b9, b10, b11, b12, b13, b14, b15;
- } aArr[] = {
- { OLE_MATHTYPE_2_STARMATH, "smath",
- 0x0002ce02L, 0x0000, 0x0000,
- 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 },
- { OLE_MATHTYPE_2_STARMATH, "smath",
- 0x00021700L, 0x0000, 0x0000,
- 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 },
- { OLE_WINWORD_2_STARWRITER, "swriter",
- 0x00020906L, 0x0000, 0x0000,
- 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 },
- { OLE_EXCEL_2_STARCALC, "scalc", // Excel table
- 0x00020810L, 0x0000, 0x0000,
- 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 },
- { OLE_EXCEL_2_STARCALC, "scalc", // Excel chart
- 0x00020820L, 0x0000, 0x0000,
- 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 },
- // 114465: additional Excel OLE chart classId to above.
- { OLE_EXCEL_2_STARCALC, "scalc",
- 0x00020821L, 0x0000, 0x0000,
- 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 },
- { OLE_POWERPOINT_2_STARIMPRESS, "simpress", // PowerPoint presentation
- 0x64818d10L, 0x4f9b, 0x11cf,
- 0x86,0xea,0x00,0xaa,0x00,0xb9,0x29,0xe8 },
- { OLE_POWERPOINT_2_STARIMPRESS, "simpress", // PowerPoint slide
- 0x64818d11L, 0x4f9b, 0x11cf,
- 0x86,0xea,0x00,0xaa,0x00,0xb9,0x29,0xe8 },
- { 0, 0,
- 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0 }
- };
-
- for( const _ObjImpType* pArr = aArr; pArr->nFlag; ++pArr )
- {
- if( nConvertFlags & pArr->nFlag )
- {
- SvGlobalName aTypeName( pArr->n1, pArr->n2, pArr->n3,
- pArr->b8, pArr->b9, pArr->b10, pArr->b11,
- pArr->b12, pArr->b13, pArr->b14, pArr->b15 );
-
- if ( aStgNm == aTypeName )
- {
- sStarName = String::CreateFromAscii( pArr->pFactoryNm );
- break;
- }
- }
- }
- }
-
- if ( sStarName.Len() )
- {
- //TODO/MBA: check if (and when) storage and stream will be destroyed!
- const SfxFilter* pFilter = 0;
- SvMemoryStream* pStream = new SvMemoryStream;
- if ( pName )
- {
- // TODO/LATER: perhaps we need to retrieve VisArea and Metafile from the storage also
- SotStorageStreamRef xStr = rSrcStg.OpenSotStream( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "package_stream" ) ), STREAM_STD_READ );
- *xStr >> *pStream;
- }
- else
- {
- SfxFilterMatcher aMatch( sStarName );
- SotStorageRef xStorage = new SotStorage( FALSE, *pStream );
- rSrcStg.CopyTo( xStorage );
- xStorage->Commit();
- xStorage.Clear();
- String aType = SfxFilter::GetTypeFromStorage( rSrcStg );
- if ( aType.Len() )
- pFilter = aMatch.GetFilter4EA( aType );
- }
-
- if ( pName || pFilter )
- {
- //Reuse current ole name
- String aDstStgName(String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(MSO_OLE_Obj)));
- aDstStgName += String::CreateFromInt32(nMSOleObjCntr);
-
- ::rtl::OUString aFilterName;
- if ( pFilter )
- aFilterName = pFilter->GetName();
- else
- aFilterName = GetFilterNameFromClassID_Impl( aStgNm );
-
- uno::Sequence < beans::PropertyValue > aMedium( aFilterName.getLength() ? 3 : 2);
- aMedium[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InputStream" ) );
- uno::Reference < io::XInputStream > xStream = new ::utl::OSeekableInputStreamWrapper( *pStream );
- aMedium[0].Value <<= xStream;
- aMedium[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) );
- aMedium[1].Value <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:stream" ) );
-
- if ( aFilterName.getLength() )
- {
- aMedium[2].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ) );
- aMedium[2].Value <<= aFilterName;
- }
-
- ::rtl::OUString aName( aDstStgName );
- comphelper::EmbeddedObjectContainer aCnt( rDestStorage );
- xObj = aCnt.InsertEmbeddedObject( aMedium, aName );
-
- if ( !xObj.is() )
- {
- if( aFilterName.getLength() )
- {
- // throw the filter parameter away as workaround
- aMedium.realloc( 2 );
- xObj = aCnt.InsertEmbeddedObject( aMedium, aName );
- }
-
- if ( !xObj.is() )
- return xObj;
- }
-
- // TODO/LATER: ViewAspect must be passed from outside!
- sal_Int64 nViewAspect = embed::Aspects::MSOLE_CONTENT;
-
- // JP 26.10.2001: Bug 93374 / 91928 the writer
- // objects need the correct visarea needs the
- // correct visarea, but this is not true for
- // PowerPoint (see bugdoc 94908b)
- // SJ: 19.11.2001 bug 94908, also chart objects
- // needs the correct visarea
-
- // If pName is set this is an own embedded object, it should have the correct size internally
- // TODO/LATER: it might make sence in future to set the size stored in internal object
- if( !pName && ( sStarName.EqualsAscii( "swriter" ) || sStarName.EqualsAscii( "scalc" ) ) )
- {
- MapMode aMapMode( VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nViewAspect ) ) );
- Size aSz;
- if ( rVisArea.IsEmpty() )
- aSz = lcl_GetPrefSize(rGrf, aMapMode );
- else
- {
- aSz = rVisArea.GetSize();
- aSz = OutputDevice::LogicToLogic( aSz, MapMode( MAP_100TH_MM ), aMapMode );
- }
-
- // don't modify the object
- //TODO/LATER: remove those hacks, that needs to be done differently!
- //xIPObj->EnableSetModified( FALSE );
- awt::Size aSize;
- aSize.Width = aSz.Width();
- aSize.Height = aSz.Height();
- xObj->setVisualAreaSize( nViewAspect, aSize );
- //xIPObj->EnableSetModified( TRUE );
- }
- else if ( sStarName.EqualsAscii( "smath" ) )
- { // SJ: force the object to recalc its visarea
- //TODO/LATER: wait for PrinterChangeNotification
- //xIPObj->OnDocumentPrinterChanged( NULL );
- }
- }
- }
-
- return xObj;
-}
-
-// TODO/MBA: code review and testing!
-SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage(
- const String& rStorageName,
- SotStorageRef& rSrcStorage,
- const uno::Reference < embed::XStorage >& xDestStorage,
- const Graphic& rGrf,
- const Rectangle& rBoundRect,
- const Rectangle& rVisArea,
- SvStream* pDataStrm,
- ErrCode& rError,
- UINT32 nConvertFlags,
- sal_Int64 nReccomendedAspect )
-{
- sal_Int64 nAspect = nReccomendedAspect;
- SdrOle2Obj* pRet = 0;
- if( rSrcStorage.Is() && xDestStorage.is() && rStorageName.Len() )
- {
- comphelper::EmbeddedObjectContainer aCnt( xDestStorage );
- // Ist der 01Ole-Stream ueberhaupt vorhanden ?
- // ( ist er z.B. bei FontWork nicht )
- // Wenn nicht -> Einbindung als Grafik
- BOOL bValidStorage = FALSE;
- String aDstStgName( String::CreateFromAscii(
- RTL_CONSTASCII_STRINGPARAM(MSO_OLE_Obj)));
-
- aDstStgName += String::CreateFromInt32( ++nMSOleObjCntr );
-
- {
- SvStorageRef xObjStg = rSrcStorage->OpenSotStorage( rStorageName,
- STREAM_READWRITE| STREAM_SHARE_DENYALL );
- if( xObjStg.Is() )
- {
- {
- BYTE aTestA[10]; // exist the \1CompObj-Stream ?
- SvStorageStreamRef xSrcTst = xObjStg->OpenSotStream(
- String(RTL_CONSTASCII_STRINGPARAM("\1CompObj"),
- RTL_TEXTENCODING_MS_1252 ));
- bValidStorage = xSrcTst.Is() && sizeof( aTestA ) ==
- xSrcTst->Read( aTestA, sizeof( aTestA ) );
- if( !bValidStorage )
- {
- // or the \1Ole-Stream ?
- xSrcTst = xObjStg->OpenSotStream(
- String(RTL_CONSTASCII_STRINGPARAM("\1Ole"),
- RTL_TEXTENCODING_MS_1252 ));
- bValidStorage = xSrcTst.Is() && sizeof(aTestA) ==
- xSrcTst->Read(aTestA, sizeof(aTestA));
- }
- }
-
- if( bValidStorage )
- {
- if ( nAspect != embed::Aspects::MSOLE_ICON )
- {
- // check whether the object is iconified one
- // usually this information is already known, the only exception
- // is a kind of embedded objects in Word documents
- // TODO/LATER: should the caller be notified if the aspect changes in future?
-
- SvStorageStreamRef xObjInfoSrc = xObjStg->OpenSotStream(
- String( RTL_CONSTASCII_STRINGPARAM( "\3ObjInfo" ) ),
- STREAM_STD_READ | STREAM_NOCREATE );
- if ( xObjInfoSrc.Is() && !xObjInfoSrc->GetError() )
- {
- BYTE nByte = 0;
- *xObjInfoSrc >> nByte;
- if ( ( nByte >> 4 ) & embed::Aspects::MSOLE_ICON )
- nAspect = embed::Aspects::MSOLE_ICON;
- }
- }
-
- uno::Reference < embed::XEmbeddedObject > xObj( CheckForConvertToSOObj(
- nConvertFlags, *xObjStg, xDestStorage, rGrf, rVisArea ));
- if ( xObj.is() )
- {
- svt::EmbeddedObjectRef aObj( xObj, nAspect );
-
- // TODO/LATER: need MediaType
- aObj.SetGraphic( rGrf, ::rtl::OUString() );
-
- // TODO/MBA: check setting of PersistName
- pRet = new SdrOle2Obj( aObj, String(), rBoundRect, false);
- // we have the Object, don't create another
- bValidStorage = false;
- }
- }
- }
- }
-
- if( bValidStorage )
- {
- // object is not an own object
- SotStorageRef xObjStor = SotStorage::OpenOLEStorage( xDestStorage, aDstStgName, STREAM_READWRITE );
-
- if ( xObjStor.Is() )
- {
- SotStorageRef xSrcStor = rSrcStorage->OpenSotStorage( rStorageName, STREAM_READ );
- xSrcStor->CopyTo( xObjStor );
-
- if( !xObjStor->GetError() )
- xObjStor->Commit();
-
- if( xObjStor->GetError() )
- {
- rError = xObjStor->GetError();
- bValidStorage = FALSE;
- }
- else if( !xObjStor.Is() )
- bValidStorage = FALSE;
- }
- }
- else if( pDataStrm )
- {
- UINT32 nLen, nDummy;
- *pDataStrm >> nLen >> nDummy;
- if( SVSTREAM_OK != pDataStrm->GetError() ||
- // Id in BugDoc - exist there other Ids?
- // The ConvertToOle2 - does not check for consistent
- 0x30008 != nDummy )
- bValidStorage = FALSE;
- else
- {
- // or is it an OLE-1 Stream in the DataStream?
- SvStorageRef xObjStor = SotStorage::OpenOLEStorage( xDestStorage, aDstStgName );
- //TODO/MBA: remove metafile conversion from ConvertToOle2
- //when is this code used?!
- GDIMetaFile aMtf;
- bValidStorage = ConvertToOle2( *pDataStrm, nLen, &aMtf, xObjStor );
- xObjStor->Commit();
- }
- }
-
- if( bValidStorage )
- {
- uno::Reference < embed::XEmbeddedObject > xObj = aCnt.GetEmbeddedObject( aDstStgName );
- if( xObj.is() )
- {
- // the visual area must be retrieved from the metafile (object doesn't know it so far)
-
- if ( nAspect != embed::Aspects::MSOLE_ICON )
- {
- // working with visual area can switch the object to running state
- awt::Size aAwtSz;
- try
- {
- // the provided visual area should be used, if there is any
- if ( rVisArea.IsEmpty() )
- {
- MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
- Size aSz(lcl_GetPrefSize(rGrf, MapMode(aMapUnit)));
- aAwtSz.Width = aSz.Width();
- aAwtSz.Height = aSz.Height();
- }
- else
- {
- aAwtSz.Width = rVisArea.GetWidth();
- aAwtSz.Height = rVisArea.GetHeight();
- }
- //xInplaceObj->EnableSetModified( FALSE );
- xObj->setVisualAreaSize( nAspect, aAwtSz );
- //xInplaceObj->EnableSetModified( TRUE );*/
- }
- catch( uno::Exception& )
- {
- OSL_ENSURE( sal_False, "Could not set visual area of the object!\n" );
- }
- }
-
- svt::EmbeddedObjectRef aObj( xObj, nAspect );
-
- // TODO/LATER: need MediaType
- aObj.SetGraphic( rGrf, ::rtl::OUString() );
-
- pRet = new SdrOle2Obj( aObj, aDstStgName, rBoundRect, false);
- }
- }
- }
-
- return pRet;
-}
-
-SdrObject* SvxMSDffManager::GetAutoForm( MSO_SPT eTyp ) const
-{
- SdrObject* pRet = NULL;
-
- if(120 >= UINT16(eTyp))
- {
- pRet = new SdrRectObj();
- }
-
- DBG_ASSERT(pRet, "SvxMSDffManager::GetAutoForm -> UNKNOWN AUTOFORM");
-
- return pRet;
-}
-
-sal_Bool SvxMSDffManager::SetPropValue( const uno::Any& rAny, const uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
- const String& rPropName, sal_Bool bTestPropertyAvailability )
-{
- sal_Bool bRetValue = sal_True;
- if ( bTestPropertyAvailability )
- {
- bRetValue = sal_False;
- try
- {
- uno::Reference< beans::XPropertySetInfo >
- aXPropSetInfo( rXPropSet->getPropertySetInfo() );
- if ( aXPropSetInfo.is() )
- bRetValue = aXPropSetInfo->hasPropertyByName( rPropName );
- }
- catch( uno::Exception& )
- {
- bRetValue = sal_False;
- }
- }
- if ( bRetValue )
- {
- try
- {
- rXPropSet->setPropertyValue( rPropName, rAny );
- bRetValue = sal_True;
- }
- catch( uno::Exception& )
- {
- bRetValue = sal_False;
- }
- }
- return bRetValue;
-}
-
-SvxMSDffImportRec::SvxMSDffImportRec()
- : pObj( 0 ),
- pWrapPolygon(0),
- pClientAnchorBuffer( 0 ),
- nClientAnchorLen( 0 ),
- pClientDataBuffer( 0 ),
- nClientDataLen( 0 ),
- nXAlign( 0 ), // position n cm from left
- nXRelTo( 2 ), // relative to column
- nYAlign( 0 ), // position n cm below
- nYRelTo( 2 ), // relative to paragraph
- nLayoutInTableCell( 0 ), // element is laid out in table cell
- nTextRotationAngle( 0 ),
- nDxTextLeft( 144 ),
- nDyTextTop( 72 ),
- nDxTextRight( 144 ),
- nDyTextBottom( 72 ),
- nDxWrapDistLeft( 0 ),
- nDyWrapDistTop( 0 ),
- nDxWrapDistRight( 0 ),
- nDyWrapDistBottom(0 ),
- nCropFromTop( 0 ),
- nCropFromBottom( 0 ),
- nCropFromLeft( 0 ),
- nCropFromRight( 0 ),
- aTextId( 0, 0 ),
- nNextShapeId( 0 ),
- nShapeId( 0 ),
- eShapeType( mso_sptNil )
-{
- eLineStyle = mso_lineSimple; // GPF-Bug #66227#
- bDrawHell = FALSE;
- bHidden = FALSE;
-// bInGroup = FALSE;
- bReplaceByFly = FALSE;
- bLastBoxInChain = TRUE;
- bHasUDefProp = FALSE; // was the DFF_msofbtUDefProp record set?
- bVFlip = FALSE;
- bHFlip = FALSE;
- bAutoWidth = FALSE;
-}
-
-SvxMSDffImportRec::SvxMSDffImportRec(const SvxMSDffImportRec& rCopy)
- : pObj( rCopy.pObj ),
- nXAlign( rCopy.nXAlign ),
- nXRelTo( rCopy.nXRelTo ),
- nYAlign( rCopy.nYAlign ),
- nYRelTo( rCopy.nYRelTo ),
- nLayoutInTableCell( rCopy.nLayoutInTableCell ),
- nTextRotationAngle( rCopy.nTextRotationAngle ),
- nDxTextLeft( rCopy.nDxTextLeft ),
- nDyTextTop( rCopy.nDyTextTop ),
- nDxTextRight( rCopy.nDxTextRight ),
- nDyTextBottom( rCopy.nDyTextBottom ),
- nDxWrapDistLeft( rCopy.nDxWrapDistLeft ),
- nDyWrapDistTop( rCopy.nDyWrapDistTop ),
- nDxWrapDistRight( rCopy.nDxWrapDistRight ),
- nDyWrapDistBottom(rCopy.nDyWrapDistBottom ),
- nCropFromTop( rCopy.nCropFromTop ),
- nCropFromBottom( rCopy.nCropFromBottom ),
- nCropFromLeft( rCopy.nCropFromLeft ),
- nCropFromRight( rCopy.nCropFromRight ),
- aTextId( rCopy.aTextId ),
- nNextShapeId( rCopy.nNextShapeId ),
- nShapeId( rCopy.nShapeId ),
- eShapeType( rCopy.eShapeType )
-{
- eLineStyle = rCopy.eLineStyle; // GPF-Bug #66227#
- bDrawHell = rCopy.bDrawHell;
- bHidden = rCopy.bHidden;
-// bInGroup = rCopy.bInGroup;
- bReplaceByFly = rCopy.bReplaceByFly;
- bAutoWidth = rCopy.bAutoWidth;
- bLastBoxInChain = rCopy.bLastBoxInChain;
- bHasUDefProp = rCopy.bHasUDefProp;
- bVFlip = rCopy.bVFlip;
- bHFlip = rCopy.bHFlip;
- nClientAnchorLen = rCopy.nClientAnchorLen;
- if( rCopy.nClientAnchorLen )
- {
- pClientAnchorBuffer = new char[ nClientAnchorLen ];
- memcpy( pClientAnchorBuffer,
- rCopy.pClientAnchorBuffer,
- nClientAnchorLen );
- }
- else
- pClientAnchorBuffer = 0;
-
- nClientDataLen = rCopy.nClientDataLen;
- if( rCopy.nClientDataLen )
- {
- pClientDataBuffer = new char[ nClientDataLen ];
- memcpy( pClientDataBuffer,
- rCopy.pClientDataBuffer,
- nClientDataLen );
- }
- else
- pClientDataBuffer = 0;
-
- if (rCopy.pWrapPolygon)
- pWrapPolygon = new Polygon(*rCopy.pWrapPolygon);
- else
- pWrapPolygon = 0;
-}
-
-SvxMSDffImportRec::~SvxMSDffImportRec()
-{
- if (pClientAnchorBuffer)
- delete[] pClientAnchorBuffer;
- if (pClientDataBuffer)
- delete[] pClientDataBuffer;
- if (pWrapPolygon)
- delete pWrapPolygon;
-}
-
-/* vi:set tabstop=4 shiftwidth=4 expandtab: */
-
-void SvxMSDffManager::insertShapeId( sal_Int32 nShapeId, SdrObject* pShape )
-{
- maShapeIdContainer[nShapeId] = pShape;
-}
-
-void SvxMSDffManager::removeShapeId( SdrObject* pShape )
-{
- SvxMSDffShapeIdContainer::iterator aIter( maShapeIdContainer.begin() );
- const SvxMSDffShapeIdContainer::iterator aEnd( maShapeIdContainer.end() );
- while( aIter != aEnd )
- {
- if( (*aIter).second == pShape )
- {
- maShapeIdContainer.erase( aIter );
- break;
- }
- }
-}
-
-SdrObject* SvxMSDffManager::getShapeForId( sal_Int32 nShapeId )
-{
- SvxMSDffShapeIdContainer::iterator aIter( maShapeIdContainer.find(nShapeId) );
- return aIter != maShapeIdContainer.end() ? (*aIter).second : 0;
-}
diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx
index fca4106..4946ea6 100644
--- a/svx/source/svdraw/svddrgv.cxx
+++ b/svx/source/svdraw/svddrgv.cxx
@@ -446,7 +446,19 @@ BOOL SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl
return FALSE;
}
- mpCurrentSdrDragMethod = new SdrDragResize(*this);
+ sal_Bool bSingleTextObjMark = sal_False; // SJ: #i100490#
+ if ( GetMarkedObjectCount() == 1 )
+ {
+ pMarkedObj=GetMarkedObjectByIndex(0);
+ if ( pMarkedObj &&
+ pMarkedObj->ISA( SdrTextObj ) &&
+ static_cast<SdrTextObj*>(pMarkedObj)->IsTextFrame() )
+ bSingleTextObjMark = sal_True;
+ }
+ if ( bSingleTextObjMark )
+ mpCurrentSdrDragMethod = new SdrDragObjOwn(*this);
+ else
+ mpCurrentSdrDragMethod = new SdrDragResize(*this);
}
}
else
diff --git a/svx/source/svdraw/svdfppt.cxx b/svx/source/svdraw/svdfppt.cxx
index 5216c4a..23982e9 100644
--- a/svx/source/svdraw/svdfppt.cxx
+++ b/svx/source/svdraw/svdfppt.cxx
@@ -887,7 +887,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
// replacing the object which we will return with a SdrPageObj
SdrObject::Free( pRet );
- pRet = new SdrPageObj( rObjData.rBoundRect, pSdrModel->GetPage( nPageNum - 1 ) );
+ pRet = new SdrPageObj( rObjData.aBoundRect, pSdrModel->GetPage( nPageNum - 1 ) );
}
else
{
@@ -1155,7 +1155,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
pTObj->SetModel( pSdrModel );
SfxItemSet aSet( pSdrModel->GetItemPool() );
if ( !pRet )
- ((SdrEscherImport*)this)->ApplyAttributes( rSt, aSet, rObjData.eShapeType, rObjData.nSpFlags );
+ ((SdrEscherImport*)this)->ApplyAttributes( rSt, aSet, rObjData );
pTObj->SetMergedItemSet( aSet );
if ( pRet )
{
@@ -1278,7 +1278,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
if ( nAngle )
{
double a = nAngle * nPi180;
- pTObj->NbcRotate( rObjData.rBoundRect.Center(), nAngle, sin( a ), cos( a ) );
+ pTObj->NbcRotate( rObjData.aBoundRect.Center(), nAngle, sin( a ), cos( a ) );
}
}
if ( pRet )
@@ -2911,7 +2911,7 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
{
case DFF_msofbtSpContainer :
{
- Rectangle aEmpty;
+ Rectangle aPageSize( Point(), pRet->GetSize() );
if ( rSlidePersist.aSlideAtom.nFlags & 4 ) // follow master background ?
{
if ( HasMasterPage( nAktPageNum, eAktPageKind ) )
@@ -2933,7 +2933,7 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
sal_Bool bTemporary = ( rSlidePersist.aSlideAtom.nFlags & 2 ) != 0;
sal_uInt32 nPos = rStCtrl.Tell();
rStCtrl.Seek( pE->nBackgroundOffset );
- rSlidePersist.pBObj = ImportObj( rStCtrl, (void*)&aProcessData, aEmpty, aEmpty );
+ rSlidePersist.pBObj = ImportObj( rStCtrl, (void*)&aProcessData, aPageSize, aPageSize );
rSlidePersist.bBObjIsTemporary = bTemporary;
rStCtrl.Seek( nPos );
}
@@ -2950,7 +2950,7 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
if ( nSpFlags & SP_FBACKGROUND )
{
aEscherObjListHd.SeekToBegOfRecord( rStCtrl );
- rSlidePersist.pBObj = ImportObj( rStCtrl, (void*)&aProcessData, aEmpty, aEmpty );
+ rSlidePersist.pBObj = ImportObj( rStCtrl, (void*)&aProcessData, aPageSize, aPageSize );
rSlidePersist.bBObjIsTemporary = sal_False;
}
}
@@ -3150,7 +3150,8 @@ SdrObject* SdrPowerPointImport::ImportPageBackgroundObject( const SdrPage& rPage
mnFix16Angle = Fix16ToAngle( GetPropertyValue( DFF_Prop_Rotation, 0 ) );
UINT32 nColor = GetPropertyValue( DFF_Prop_fillColor, 0xffffff );
pSet = new SfxItemSet( pSdrModel->GetItemPool() );
- ApplyAttributes( rStCtrl, *pSet );
+ DffObjData aObjData( aEscherObjectHd, Rectangle( 0, 0, 28000, 21000 ), 0 );
+ ApplyAttributes( rStCtrl, *pSet, aObjData );
Color aColor( MSO_CLR_ToColor( nColor ) );
pSet->Put( XFillColorItem( String(), aColor ) );
}
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index 7f2f2d3..dbfaa84 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -142,6 +142,8 @@ namespace sdr
void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem);
+ void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+
sdr::table::CellRef mxCell;
};
@@ -271,7 +273,24 @@ namespace sdr
// call parent
AttributeProperties::ItemChange( nWhich, pNewItem );
}
+
+ void CellProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
+ {
+ TextProperties::SetStyleSheet( pNewStyleSheet, bDontRemoveHardAttr );
+
+ if( bDontRemoveHardAttr && pNewStyleSheet )
+ {
+ GetObjectItemSet();
+ const SfxItemSet& rStyleAttribs = pNewStyleSheet->GetItemSet();
+
+ for ( USHORT nWhich = SDRATTR_START; nWhich <= SDRATTR_TABLE_LAST; nWhich++ )
+ {
+ if ( rStyleAttribs.GetItemState( nWhich ) == SFX_ITEM_ON )
+ mpItemSet->ClearItem( nWhich );
+ }
+ }
+ }
} // end of namespace properties
} // end of namespace sdr
@@ -281,6 +300,19 @@ namespace sdr { namespace table {
// Cell
// -----------------------------------------------------------------------------
+rtl::Reference< Cell > Cell::create( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject )
+{
+ rtl::Reference< Cell > xCell( new Cell( rTableObj, pOutlinerParaObject ) );
+ if( xCell->mxTable.is() )
+ {
+ Reference< XEventListener > xListener( xCell.get() );
+ xCell->mxTable->addEventListener( xListener );
+ }
+ return xCell;
+}
+
+// -----------------------------------------------------------------------------
+
Cell::Cell( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject ) throw()
: SdrText( rTableObj, pOutlinerParaObject )
, SvxUnoTextBase( ImplGetSvxUnoOutlinerTextCursorPropertyMap() )
@@ -309,7 +341,19 @@ Cell::~Cell() throw()
void Cell::dispose()
{
- mxTable.clear();
+ if( mxTable.is() )
+ {
+ try
+ {
+ Reference< XEventListener > xThis( this );
+ mxTable->removeEventListener( xThis );
+ }
+ catch( Exception& )
+ {
+ DBG_ERROR("Cell::dispose(), exception caught!");
+ }
+ mxTable.clear();
+ }
if( mpProperties )
{
@@ -621,7 +665,7 @@ sal_Int32 Cell::getMinimumHeight()
pEditOutliner->SetMaxAutoPaperSize(aSize);
nMinimumHeight = pEditOutliner->GetTextHeight()+1;
}
- else
+ else /*if ( hasText() )*/
{
Outliner& rOutliner=rTableObj.ImpGetDrawOutliner();
rOutliner.SetPaperSize(aSize);
@@ -737,6 +781,9 @@ Any SAL_CALL Cell::queryInterface( const Type & rType ) throw(RuntimeException)
if( rType == XLayoutConstrains::static_type() )
return Any( Reference< XLayoutConstrains >( this ) );
+ if( rType == XEventListener::static_type() )
+ return Any( Reference< XEventListener >( this ) );
+
Any aRet( SvxUnoTextBase::queryAggregation( rType ) );
if( aRet.hasValue() )
return aRet;
@@ -1697,5 +1744,12 @@ void SAL_CALL Cell::setString( const OUString& aString ) throw (RuntimeException
notifyModified();
}
+// XEventListener
+void SAL_CALL Cell::disposing( const EventObject& /*Source*/ ) throw (RuntimeException)
+{
+ mxTable.clear();
+ dispose();
+}
+
} }
diff --git a/svx/source/table/cell.hxx b/svx/source/table/cell.hxx
index 3500230..dc3b2ad 100644
--- a/svx/source/table/cell.hxx
+++ b/svx/source/table/cell.hxx
@@ -34,6 +34,7 @@
#include <com/sun/star/table/XMergeableCell.hpp>
#include <com/sun/star/awt/XLayoutConstrains.hpp>
#include <com/sun/star/beans/XMultiPropertyStates.hpp>
+#include <com/sun/star/lang/XEventListener.hpp>
#include <rtl/ref.hxx>
@@ -61,13 +62,13 @@ class Cell : public SdrText,
public SvxUnoTextBase,
public ::com::sun::star::table::XMergeableCell,
public ::com::sun::star::awt::XLayoutConstrains,
+ public ::com::sun::star::lang::XEventListener,
public ::cppu::OWeakObject
{
friend class CellUndo;
public:
- Cell( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject ) throw();
- virtual ~Cell() throw();
+ static rtl::Reference< Cell > create( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject );
// private
void dispose();
@@ -192,6 +193,9 @@ public:
virtual ::rtl::OUString SAL_CALL getString( ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setString( const ::rtl::OUString& aString ) throw (::com::sun::star::uno::RuntimeException);
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+
virtual void SetOutlinerParaObject( OutlinerParaObject* pTextObject );
void AddUndo();
@@ -212,6 +216,9 @@ protected:
::com::sun::star::uno::Any GetAnyForItem( SfxItemSet& aSet, const SfxItemPropertyMap* pMap );
private:
+ Cell( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject ) throw();
+ virtual ~Cell() throw();
+
SvxItemPropertySet maPropSet;
sdr::properties::TextProperties* mpProperties;
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index deceadd..211afa5 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -2676,7 +2676,7 @@ Pointer SdrTableObj::GetCreatePointer() const
void SdrTableObj::createCell( CellRef& xNewCell )
{
- xNewCell.set( new Cell( *this, 0 ) );
+ xNewCell = Cell::create( *this, 0 );
}
// --------------------------------------------------------------------
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index a43796d..ab5d250 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -847,6 +847,7 @@ void SvxTableController::SetTableStyle( const SfxItemSet* pArgs )
pModel->AddUndo( new TableStyleUndo( *pTableObj ) );
+/*
const sal_Int32 nRowCount = mxTable->getRowCount();
const sal_Int32 nColCount = mxTable->getColumnCount();
for( sal_Int32 nRow = 0; nRow < nRowCount; nRow++ )
@@ -866,6 +867,7 @@ void SvxTableController::SetTableStyle( const SfxItemSet* pArgs )
DBG_ERROR( "svx::SvxTableController::SetTableStyle(), exception caught!" );
}
}
+*/
pTableObj->setTableStyle( xNewTableStyle );
pModel->EndUndo();
diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx
index fce9ef0..765b5b8 100644
--- a/xmloff/source/draw/sdxmlexp.cxx
+++ b/xmloff/source/draw/sdxmlexp.cxx
@@ -208,7 +208,7 @@ DECLARE_LIST(ImpXMLEXPPageMasterList, ImpXMLEXPPageMasterInfo*)
//////////////////////////////////////////////////////////////////////////////
-#define IMP_AUTOLAYOUT_INFO_MAX (33L)
+#define IMP_AUTOLAYOUT_INFO_MAX (35L)
class ImpXMLAutoLayoutInfo
{
@@ -1250,6 +1250,53 @@ void SdXMLExport::ImpWriteAutoLayoutInfos()
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderSubtitle, pInfo->GetPresRectangle());
break;
}
+
+ case 33 : // AUTOLAYOUT_4CLIPART
+ {
+ Rectangle aTopLeft(pInfo->GetPresRectangle());
+ aTopLeft.setHeight(long(aTopLeft.GetHeight() * 0.477));
+ aTopLeft.setWidth(long(aTopLeft.GetWidth() * 0.488));
+ Rectangle aBottomLeft(aTopLeft);
+ aBottomLeft.Top() = long(aBottomLeft.Top() + aBottomLeft.GetHeight() * 1.095);
+ Rectangle aTopRight(aTopLeft);
+ aTopRight.Left() = long(aTopRight.Left() + aTopRight.GetWidth() * 1.05);
+ Rectangle aBottomRight(aTopRight);
+ aBottomRight.Top() = long(aBottomRight.Top() + aBottomRight.GetHeight() * 1.095);
+
+ ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
+ ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aTopLeft);
+ ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aTopRight);
+ ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aBottomLeft);
+ ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aBottomRight);
+ break;
+ }
+
+ case 34 : // AUTOLAYOUT_6CLIPART
+ {
+ Rectangle aTopLeft(pInfo->GetPresRectangle());
+ aTopLeft.setHeight(long(aTopLeft.GetHeight() * 0.477));
+ aTopLeft.setWidth(long(aTopLeft.GetWidth() * 0.322));
+ Rectangle aTopCenter(aTopLeft);
+ aTopCenter.Left() = long(aTopCenter.Left() + aTopCenter.GetWidth() * 1.05);
+ Rectangle aTopRight(aTopLeft);
+ aTopRight.Left() = long(aTopRight.Left() + aTopRight.GetWidth() * 2 * 1.05);
+
+ Rectangle aBottomLeft(aTopLeft);
+ aBottomLeft.Top() = long(aBottomLeft.Top() + aBottomLeft.GetHeight() * 1.095);
+ Rectangle aBottomCenter(aTopCenter);
+ aBottomCenter.Top() = long(aBottomCenter.Top() + aBottomCenter.GetHeight() * 1.095);
+ Rectangle aBottomRight(aTopRight);
+ aBottomRight.Top() = long(aBottomRight.Top() + aBottomRight.GetHeight() * 1.095);
+
+ ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
+ ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aTopLeft);
+ ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aTopCenter);
+ ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aTopRight);
+ ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aBottomLeft);
+ ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aBottomCenter);
+ ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aBottomRight);
+ break;
+ }
default:
{
DBG_ERROR("XMLEXP: unknown autolayout export");
diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx
index a96b5bf..e47b144 100644
--- a/xmloff/source/draw/ximpstyl.cxx
+++ b/xmloff/source/draw/ximpstyl.cxx
@@ -730,9 +730,30 @@ void SdXMLPresentationPageLayoutContext::EndElement()
}
break;
}
- default: // 5 items
+ case 5:
{
- mnTypeId = 18; // AUTOLAYOUT_4OBJ
+ SdXMLPresentationPlaceholderContext* pObj1 = maList.GetObject(1);
+
+ if(pObj1->GetName().equals(
+ OUString(RTL_CONSTASCII_USTRINGPARAM("object"))))
+ {
+ mnTypeId = 18; // AUTOLAYOUT_4OBJ
+ }
+ else
+ {
+ mnTypeId = 33; // AUTOLAYOUT_4CLIPART
+ }
+ break;
+
+ }
+ case 7:
+ {
+ mnTypeId = 33; // AUTOLAYOUT_6CLIPART
+ break;
+ }
+ default:
+ {
+ mnTypeId = 20; // AUTOLAYOUT_NONE
break;
}
}
commit ef6d9aae143378e3ca4410311ae68825cefd4918
Author: Jens-Heiner Rechtien <hr at openoffice.org>
Date: Tue May 19 09:31:27 2009 +0000
CWS-TOOLING: integrate CWS tl66
2009-05-15 12:28:55 +0200 tl r271932 : #i91812# include fixed
2009-05-07 16:52:41 +0200 tl r271680 : #i97200# one more MathML export problem to fix
2009-05-05 08:33:29 +0200 tl r271494 : #i99401# positiv user-dicts vs negativ user-dicts
2009-05-04 14:14:03 +0200 tl r271452 : #i97200# warning free code; MathML 2.0 export
2009-05-04 13:26:30 +0200 tl r271448 : #i97200# write valid MathML 2.0 on export
2009-04-29 14:21:54 +0200 tl r271371 : #i97200# new MathML token
2009-04-29 11:12:07 +0200 tl r271360 : #i97200# inroducing separate files for import and export
2009-04-28 16:47:42 +0200 tl r271331 : #i97200# better MathML pretty printing
2009-04-28 11:21:57 +0200 tl r271315 : #i97200# MathML attributes and default namespace for MathML
2009-04-28 11:21:24 +0200 tl r271314 : #i97200# MathML attributes and default namespace for MathML
2009-04-23 12:44:18 +0200 tl r271154 : #i97200# math.dtd removed
2009-04-23 12:31:56 +0200 tl r271151 : #i97200# MathML: don't use namespace on attributes
2009-04-22 13:21:11 +0200 tl r271099 : warning-free code
2009-04-22 12:20:13 +0200 tl r271092 : #i100757# loop fixed
2009-04-22 11:29:51 +0200 tl r271086 : #97327# adding mongolian fingerprint for language guessing
2009-04-22 11:25:56 +0200 tl r271083 : #97327# adding mongolian fingerprint for language guessing
2009-04-21 10:39:21 +0200 tl r271025 : #99599# code fix for LRE/RLE embedding
2009-04-20 16:36:33 +0200 tl r270992 : #i99604# HasDigits fixed
2009-04-20 14:44:19 +0200 tl r270985 : #i99604# warning-free code for Windows
2009-04-20 13:48:13 +0200 tl r270980 : #i99604# HasDigits fix for non-ASCII characters
2009-04-20 13:47:50 +0200 tl r270979 : #i99604# HasDigits fix for non-ASCII characters
2009-04-20 12:28:15 +0200 tl r270973 : warning-free code after merging
2009-04-20 10:16:19 +0200 tl r270964 : warning-free code after merging
2009-04-17 14:43:36 +0200 tl r270948 : #i96846#
2009-04-16 13:09:15 +0200 tl r270883 : CWS-TOOLING: rebase CWS tl66 to trunk at 270723 (milestone: DEV300:m46)
2009-04-14 14:34:08 +0200 tl r270770 : #101067# warning-free code
2009-04-02 09:07:44 +0200 tl r270368 : #i100757# performance patch for start-up (initialize language guessing on demand only)
2009-03-11 10:37:59 +0100 tl r269301 : #i100083# fixed system dictionary lookup
2009-03-06 13:10:23 +0100 tl r268998 : warning-free code for Windows non-pro
2009-02-23 14:01:23 +0100 tl r268355 : #i99401# winning rules for user-dictionaries changed
2009-02-19 14:05:57 +0100 tl r268281 : #i98644# suggestion improvement when first checker does not know any suggestions
2009-02-19 14:05:02 +0100 tl r268280 : #i98644# suggestion improvement when first checker does not know any suggestions
2009-02-19 13:58:51 +0100 tl r268279 : #i98644# suggestion improvement when first checker does not know any suggestions
2009-02-19 11:38:03 +0100 tl r268266 : #i98644# suggestion improvement when first checker does not know any suggestions
2009-02-12 11:58:34 +0100 tl r267642 : #i96846# some properties declared as maybevoid
2009-02-06 12:43:55 +0100 tl r267454 : #i98644# provide sugestions from secondary spell checkers if the primary does not provide ones
2009-02-05 13:02:26 +0100 tl r267418 : #i98880# a bit clean-up in the grammar checking framework
2009-02-04 12:15:37 +0100 tl r267363 : #i91812# remove unused/duplicate code
2009-02-04 12:09:34 +0100 tl r267362 : #i91812# remove unused/duplicate code
2009-02-04 11:07:57 +0100 tl r267355 : #i91812# remove unused code
2009-02-04 11:06:48 +0100 tl r267354 : #i91812# remove unused code
2009-02-03 14:52:43 +0100 tl r267331 : #i91812# remove unused code
2009-02-03 14:26:00 +0100 tl r267324 : #i91198# adding fingerprint for luxembourgish
2009-02-03 14:20:58 +0100 tl r267323 : #i91198# adding fingerprint for luxembourgish
2009-02-03 14:18:33 +0100 tl r267322 : #i91198# adding fingerprint for luxembourgish
2009-02-03 13:56:39 +0100 tl r267319 : #i91812# remove unused code
2009-02-03 12:41:50 +0100 tl r267314 : #i48400# auto-spellcheck improvement when deleting wrong chars
2009-02-03 11:48:51 +0100 tl r267310 : #i91812# remove unused code
2009-02-03 11:14:29 +0100 tl r267307 : warning free code
2009-02-03 10:45:21 +0100 tl r267306 : #i91812# remove unused code
2009-02-03 10:37:04 +0100 tl r267304 : #i33387# name change for 'View/Selection'
2009-02-03 10:36:17 +0100 tl r267303 : #i33387# name change for 'View/Selection'
2009-02-03 10:32:12 +0100 tl r267302 : #i30642# spelling error in context menu fixed
2009-02-03 10:27:34 +0100 tl r267301 : #i92210# remove unused code types.cxx cfgitem.*
diff --git a/linguistic/inc/lngprophelp.hxx b/linguistic/inc/lngprophelp.hxx
new file mode 100644
index 0000000..ef5e913
--- /dev/null
+++ b/linguistic/inc/lngprophelp.hxx
@@ -0,0 +1,291 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: prophelp.hxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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 _LINGUISTIC_LNGPROPHELP_HXX_
+#define _LINGUISTIC_LNGPROPHELP_HXX_
+
+#include <tools/solar.h>
+
+#include <uno/lbnames.h>
+#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/interfacecontainer.h>
+#include <com/sun/star/beans/XPropertyChangeListener.hpp>
+#include <com/sun/star/beans/PropertyValues.hpp>
+
+#include <com/sun/star/linguistic2/XLinguServiceEventBroadcaster.hpp>
+
+namespace com { namespace sun { namespace star { namespace beans {
+ class XPropertySet;
+}}}}
+
+namespace com { namespace sun { namespace star { namespace linguistic2 {
+ struct LinguServiceEvent;
+}}}}
+
+
+namespace linguistic
+{
+
+///////////////////////////////////////////////////////////////////////////
+// PropertyChgHelper
+// Base class for all XPropertyChangeListener members of the
+// various lingu services.
+
+
+// Flags for type of events allowed to be launched
+#define AE_SPELLCHECKER 1
+#define AE_HYPHENATOR 2
+//#define AE_THESAURUS 4
+
+typedef cppu::WeakImplHelper2
+<
+ ::com::sun::star::beans::XPropertyChangeListener,
+ ::com::sun::star::linguistic2::XLinguServiceEventBroadcaster
+> PropertyChgHelperBase;
+
+class PropertyChgHelper :
+ public PropertyChgHelperBase
+{
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > aPropNames;
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface > xMyEvtObj;
+ ::cppu::OInterfaceContainerHelper aLngSvcEvtListeners;
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > xPropSet;
+
+ int nEvtFlags; // flags for event types allowed to be launched
+
+ // default values
+ BOOL bIsIgnoreControlCharacters;
+ BOOL bIsUseDictionaryList;
+
+ // return values, will be set to default value or current temporary value
+ BOOL bResIsIgnoreControlCharacters;
+ BOOL bResIsUseDictionaryList;
+
+
+ // disallow use of copy-constructor and assignment-operator
+ PropertyChgHelper( const PropertyChgHelper & );
+ PropertyChgHelper & operator = ( const PropertyChgHelper & );
+
+protected:
+ virtual void SetDefaultValues();
+ virtual void GetCurrentValues();
+
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > &
+ GetPropNames() { return aPropNames; }
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > &
+ GetPropSet() { return xPropSet; }
+
+ void AddPropNames( const char *pNewNames[], INT32 nCount );
+
+ virtual BOOL propertyChange_Impl(
+ const ::com::sun::star::beans::PropertyChangeEvent& rEvt );
+
+public:
+ PropertyChgHelper(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface > &rxSource,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > &rxPropSet,
+ int nAllowedEvents );
+ virtual ~PropertyChgHelper();
+
+ virtual void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals );
+
+ // XEventListener
+ virtual void SAL_CALL
+ disposing( const ::com::sun::star::lang::EventObject& rSource )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // XPropertyChangeListener
+ virtual void SAL_CALL
+ propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& rEvt )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // XLinguServiceEventBroadcaster
+ virtual sal_Bool SAL_CALL
+ addLinguServiceEventListener(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL
+ removeLinguServiceEventListener(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // non-UNO functions
+ void AddAsPropListener();
+ void RemoveAsPropListener();
+ void LaunchEvent(
+ const ::com::sun::star::linguistic2::LinguServiceEvent& rEvt );
+
+ const ::com::sun::star::uno::Sequence< ::rtl::OUString > &
+ GetPropNames() const { return aPropNames; }
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > &
+ GetPropSet() const { return xPropSet; }
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface > &
+ GetEvtObj() const { return xMyEvtObj; }
+
+ BOOL IsIgnoreControlCharacters() const { return bResIsIgnoreControlCharacters; }
+ BOOL IsUseDictionaryList() const { return bResIsUseDictionaryList; }
+};
+
+
+///////////////////////////////////////////////////////////////////////////
+
+class PropertyHelper_Thes :
+ public PropertyChgHelper
+{
+ // disallow use of copy-constructor and assignment-operator
+ PropertyHelper_Thes( const PropertyHelper_Thes & );
+ PropertyHelper_Thes & operator = ( const PropertyHelper_Thes & );
+
+public:
+ PropertyHelper_Thes(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface > &rxSource,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > &rxPropSet );
+ virtual ~PropertyHelper_Thes();
+
+ // XPropertyChangeListener
+ virtual void SAL_CALL
+ propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& rEvt )
+ throw(::com::sun::star::uno::RuntimeException);
+};
+
+///////////////////////////////////////////////////////////////////////////
+
+class PropertyHelper_Spell :
+ public PropertyChgHelper
+{
+ // default values
+ BOOL bIsSpellUpperCase;
+ BOOL bIsSpellWithDigits;
+ BOOL bIsSpellCapitalization;
+
+ // return values, will be set to default value or current temporary value
+ INT16 nResMaxNumberOfSuggestions; // special value that is not part of the property set and thus needs to be handled differently
+ BOOL bResIsSpellUpperCase;
+ BOOL bResIsSpellWithDigits;
+ BOOL bResIsSpellCapitalization;
+
+
+ // disallow use of copy-constructor and assignment-operator
+ PropertyHelper_Spell( const PropertyHelper_Spell & );
+ PropertyHelper_Spell & operator = ( const PropertyHelper_Spell & );
+
+protected:
+ // PropertyChgHelper
+ virtual void SetDefaultValues();
+ virtual void GetCurrentValues();
+ virtual BOOL propertyChange_Impl(
+ const ::com::sun::star::beans::PropertyChangeEvent& rEvt );
+
+public:
+ PropertyHelper_Spell(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface > &rxSource,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > &rxPropSet );
+ virtual ~PropertyHelper_Spell();
+
+ virtual void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals );
+
+ // XPropertyChangeListener
+ virtual void SAL_CALL
+ propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& rEvt )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ virtual INT16 GetDefaultNumberOfSuggestions() const;
+
+ INT16 GetMaxNumberOfSuggestions() const { return nResMaxNumberOfSuggestions; }
+ BOOL IsSpellUpperCase() const { return bResIsSpellUpperCase; }
+ BOOL IsSpellWithDigits() const { return bResIsSpellWithDigits; }
+ BOOL IsSpellCapitalization() const { return bResIsSpellCapitalization; }
+};
+
+///////////////////////////////////////////////////////////////////////////
+
+class PropertyHelper_Hyphen :
+ public PropertyChgHelper
+{
+ // default values
+ INT16 nHyphMinLeading,
+ nHyphMinTrailing,
+ nHyphMinWordLength;
+
+ // return values, will be set to default value or current temporary value
+ INT16 nResHyphMinLeading,
+ nResHyphMinTrailing,
+ nResHyphMinWordLength;
+
+ // disallow use of copy-constructor and assignment-operator
+ PropertyHelper_Hyphen( const PropertyHelper_Hyphen & );
+ PropertyHelper_Hyphen & operator = ( const PropertyHelper_Hyphen & );
+
+protected:
+ // PropertyChgHelper
+ virtual void SetDefaultValues();
+ virtual void GetCurrentValues();
+ virtual BOOL propertyChange_Impl(
+ const ::com::sun::star::beans::PropertyChangeEvent& rEvt );
+
+public:
+ PropertyHelper_Hyphen(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface > &rxSource,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > &rxPropSet);
+ virtual ~PropertyHelper_Hyphen();
+
+ virtual void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals );
+
+ // XPropertyChangeListener
+ virtual void SAL_CALL
+ propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& rEvt )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ INT16 GetMinLeading() const { return nResHyphMinLeading; }
+ INT16 GetMinTrailing() const { return nResHyphMinTrailing; }
+ INT16 GetMinWordLength() const { return nResHyphMinWordLength; }
+};
+
+///////////////////////////////////////////////////////////////////////////
+
+} // namespace linguistic
+
+#endif
+
diff --git a/linguistic/inc/misc.hxx b/linguistic/inc/misc.hxx
index 9dfec44..803341b 100644
--- a/linguistic/inc/misc.hxx
+++ b/linguistic/inc/misc.hxx
@@ -196,26 +196,16 @@ String ToUpper( const String &rText, INT16 nLanguage );
String ToTitle( const String &rText, INT16 nLanguage );
sal_Unicode ToLower( const sal_Unicode cChar, INT16 nLanguage );
sal_Unicode ToUpper( const sal_Unicode cChar, INT16 nLanguage );
-BOOL HasDigits( const String &rText );
+BOOL HasDigits( const ::rtl::OUString &rText );
BOOL IsNumeric( const String &rText );
///////////////////////////////////////////////////////////////////////////
-::com::sun::star::uno::Reference<
- ::com::sun::star::uno::XInterface >
- GetOneInstanceService( const char *pServiceName );
-
-::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- GetLinguProperties();
-
-::com::sun::star::uno::Reference<
- ::com::sun::star::linguistic2::XSearchableDictionaryList >
- GetSearchableDictionaryList();
-
-::com::sun::star::uno::Reference<
- ::com::sun::star::linguistic2::XDictionaryList >
- GetDictionaryList();
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > GetOneInstanceService( const char *pServiceName );
+::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > GetLinguProperties();
+::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSearchableDictionaryList > GetSearchableDictionaryList();
+::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionaryList > GetDictionaryList();
+::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionary > GetIgnoreAllList();
///////////////////////////////////////////////////////////////////////////
diff --git a/linguistic/inc/prophelp.hxx b/linguistic/inc/prophelp.hxx
deleted file mode 100644
index b393555..0000000
--- a/linguistic/inc/prophelp.hxx
+++ /dev/null
@@ -1,294 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: prophelp.hxx,v $
- * $Revision: 1.5 $
- *
- * 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 _LINGUISTIC_PROPHELP_HXX_
-#define _LINGUISTIC_PROPHELP_HXX_
-
-#include <tools/solar.h>
-
-#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type
-#include <cppuhelper/implbase2.hxx> // helper for implementations
-#include <cppuhelper/interfacecontainer.h>
-#include <com/sun/star/beans/XPropertyChangeListener.hpp>
-#include <com/sun/star/beans/PropertyValues.hpp>
-
-#include <com/sun/star/linguistic2/XLinguServiceEventBroadcaster.hpp>
-
-namespace com { namespace sun { namespace star { namespace beans {
- class XPropertySet;
-}}}}
-
-namespace com { namespace sun { namespace star { namespace linguistic2 {
- struct LinguServiceEvent;
-}}}}
-
-
-namespace linguistic
-{
-
-///////////////////////////////////////////////////////////////////////////
-// PropertyChgHelper
-// Base class for all XPropertyChangeListener members of the
-// various lingu services.
-
-
-// Flags for type of events allowed to be launched
-#define AE_SPELLCHECKER 1
-#define AE_HYPHENATOR 2
-//#define AE_THESAURUS 4
-
-typedef cppu::WeakImplHelper2
-<
- ::com::sun::star::beans::XPropertyChangeListener,
- ::com::sun::star::linguistic2::XLinguServiceEventBroadcaster
-> PropertyChgHelperBase;
-
-class PropertyChgHelper :
- public PropertyChgHelperBase
-{
- ::com::sun::star::uno::Sequence< ::rtl::OUString > aPropNames;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::uno::XInterface > xMyEvtObj;
- ::cppu::OInterfaceContainerHelper aLngSvcEvtListeners;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet > xPropSet;
-
- int nEvtFlags; // flags for event types allowed to be launched
-
- // default values
- BOOL bIsGermanPreReform;
- BOOL bIsIgnoreControlCharacters;
- BOOL bIsUseDictionaryList;
-
- // return values, will be set to default value or current temporary value
- BOOL bResIsGermanPreReform;
- BOOL bResIsIgnoreControlCharacters;
- BOOL bResIsUseDictionaryList;
-
-
- // disallow use of copy-constructor and assignment-operator
- PropertyChgHelper( const PropertyChgHelper & );
- PropertyChgHelper & operator = ( const PropertyChgHelper & );
-
-protected:
- virtual void SetDefaultValues();
- virtual void GetCurrentValues();
-
- ::com::sun::star::uno::Sequence< ::rtl::OUString > &
- GetPropNames() { return aPropNames; }
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet > &
- GetPropSet() { return xPropSet; }
-
- void AddPropNames( const char *pNewNames[], INT32 nCount );
-
- virtual BOOL propertyChange_Impl(
- const ::com::sun::star::beans::PropertyChangeEvent& rEvt );
-
-public:
- PropertyChgHelper(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::uno::XInterface > &rxSource,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet > &rxPropSet,
- int nAllowedEvents );
- virtual ~PropertyChgHelper();
-
- virtual void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals );
-
- // XEventListener
- virtual void SAL_CALL
- disposing( const ::com::sun::star::lang::EventObject& rSource )
- throw(::com::sun::star::uno::RuntimeException);
-
- // XPropertyChangeListener
- virtual void SAL_CALL
- propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& rEvt )
- throw(::com::sun::star::uno::RuntimeException);
-
- // XLinguServiceEventBroadcaster
- virtual sal_Bool SAL_CALL
- addLinguServiceEventListener(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener )
- throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL
- removeLinguServiceEventListener(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener )
- throw(::com::sun::star::uno::RuntimeException);
-
- // non-UNO functions
- void AddAsPropListener();
- void RemoveAsPropListener();
- void LaunchEvent(
- const ::com::sun::star::linguistic2::LinguServiceEvent& rEvt );
-
- const ::com::sun::star::uno::Sequence< ::rtl::OUString > &
- GetPropNames() const { return aPropNames; }
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet > &
- GetPropSet() const { return xPropSet; }
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::uno::XInterface > &
- GetEvtObj() const { return xMyEvtObj; }
-
- BOOL IsGermanPreReform() const { return bResIsGermanPreReform; }
- BOOL IsIgnoreControlCharacters() const { return bResIsIgnoreControlCharacters; }
- BOOL IsUseDictionaryList() const { return bResIsUseDictionaryList; }
-};
-
-
-///////////////////////////////////////////////////////////////////////////
-
-class PropertyHelper_Thes :
- public PropertyChgHelper
-{
- // disallow use of copy-constructor and assignment-operator
- PropertyHelper_Thes( const PropertyHelper_Thes & );
- PropertyHelper_Thes & operator = ( const PropertyHelper_Thes & );
-
-public:
- PropertyHelper_Thes(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::uno::XInterface > &rxSource,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet > &rxPropSet );
- virtual ~PropertyHelper_Thes();
-
- // XPropertyChangeListener
- virtual void SAL_CALL
- propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& rEvt )
- throw(::com::sun::star::uno::RuntimeException);
-};
-
-///////////////////////////////////////////////////////////////////////////
-
-class PropertyHelper_Spell :
- public PropertyChgHelper
-{
- // default values
- BOOL bIsSpellUpperCase;
- BOOL bIsSpellWithDigits;
- BOOL bIsSpellCapitalization;
-
- // return values, will be set to default value or current temporary value
- INT16 nResMaxNumberOfSuggestions; // special value that is not part of the property set and thus needs to be handled differently
- BOOL bResIsSpellUpperCase;
- BOOL bResIsSpellWithDigits;
- BOOL bResIsSpellCapitalization;
-
-
- // disallow use of copy-constructor and assignment-operator
- PropertyHelper_Spell( const PropertyHelper_Spell & );
- PropertyHelper_Spell & operator = ( const PropertyHelper_Spell & );
-
-protected:
- // PropertyChgHelper
- virtual void SetDefaultValues();
- virtual void GetCurrentValues();
- virtual BOOL propertyChange_Impl(
- const ::com::sun::star::beans::PropertyChangeEvent& rEvt );
-
-public:
- PropertyHelper_Spell(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::uno::XInterface > &rxSource,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet > &rxPropSet );
- virtual ~PropertyHelper_Spell();
-
- virtual void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals );
-
- // XPropertyChangeListener
- virtual void SAL_CALL
- propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& rEvt )
- throw(::com::sun::star::uno::RuntimeException);
-
- virtual INT16 GetDefaultNumberOfSuggestions() const;
-
- INT16 GetMaxNumberOfSuggestions() const { return nResMaxNumberOfSuggestions; }
- BOOL IsSpellUpperCase() const { return bResIsSpellUpperCase; }
- BOOL IsSpellWithDigits() const { return bResIsSpellWithDigits; }
- BOOL IsSpellCapitalization() const { return bResIsSpellCapitalization; }
-};
-
-///////////////////////////////////////////////////////////////////////////
-
-class PropertyHelper_Hyph :
- public PropertyChgHelper
-{
- // default values
- INT16 nHyphMinLeading,
- nHyphMinTrailing,
- nHyphMinWordLength;
-
- // return values, will be set to default value or current temporary value
- INT16 nResHyphMinLeading,
- nResHyphMinTrailing,
- nResHyphMinWordLength;
-
- // disallow use of copy-constructor and assignment-operator
- PropertyHelper_Hyph( const PropertyHelper_Hyph & );
- PropertyHelper_Hyph & operator = ( const PropertyHelper_Hyph & );
-
-protected:
- // PropertyChgHelper
- virtual void SetDefaultValues();
- virtual void GetCurrentValues();
- virtual BOOL propertyChange_Impl(
- const ::com::sun::star::beans::PropertyChangeEvent& rEvt );
-
-public:
- PropertyHelper_Hyph(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::uno::XInterface > &rxSource,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet > &rxPropSet);
- virtual ~PropertyHelper_Hyph();
-
- virtual void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals );
-
- // XPropertyChangeListener
- virtual void SAL_CALL
- propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& rEvt )
- throw(::com::sun::star::uno::RuntimeException);
-
- INT16 GetMinLeading() const { return nResHyphMinLeading; }
- INT16 GetMinTrailing() const { return nResHyphMinTrailing; }
- INT16 GetMinWordLength() const { return nResHyphMinWordLength; }
-};
-
-///////////////////////////////////////////////////////////////////////////
-
-} // namespace linguistic
-
-#endif
-
diff --git a/linguistic/source/iprcache.cxx b/linguistic/source/iprcache.cxx
index 12ea412..f5d050b 100644
--- a/linguistic/source/iprcache.cxx
+++ b/linguistic/source/iprcache.cxx
@@ -85,7 +85,6 @@ static const struct
INT32 nPropHdl;
} aFlushProperties[ NUM_FLUSH_PROPS ] =
{
- { UPN_IS_GERMAN_PRE_REFORM, UPH_IS_GERMAN_PRE_REFORM }, /* deprecated */
{ UPN_IS_USE_DICTIONARY_LIST, UPH_IS_USE_DICTIONARY_LIST },
{ UPN_IS_IGNORE_CONTROL_CHARACTERS, UPH_IS_IGNORE_CONTROL_CHARACTERS },
{ UPN_IS_SPELL_UPPER_CASE, UPH_IS_SPELL_UPPER_CASE },
diff --git a/linguistic/source/lngopt.cxx b/linguistic/source/lngopt.cxx
index 692122e..53be907 100644
--- a/linguistic/source/lngopt.cxx
+++ b/linguistic/source/lngopt.cxx
@@ -204,17 +204,18 @@ void LinguOptions::GetValue( Any &rVal, INT32 nWID ) const
INT16 *pnVal = 0;
BOOL *pbVal = 0;
+ BOOL bDummy = FALSE;
switch( nWID )
{
- case WID_IS_GERMAN_PRE_REFORM : /*! deprecated !*/ break;
+ case WID_IS_GERMAN_PRE_REFORM : pbVal = &bDummy; /*! deprecated !*/ break;
case WID_IS_USE_DICTIONARY_LIST : pbVal = &pData->bIsUseDictionaryList; break;
case WID_IS_IGNORE_CONTROL_CHARACTERS : pbVal = &pData->bIsIgnoreControlCharacters; break;
case WID_IS_HYPH_AUTO : pbVal = &pData->bIsHyphAuto; break;
case WID_IS_HYPH_SPECIAL : pbVal = &pData->bIsHyphSpecial; break;
case WID_IS_SPELL_AUTO : pbVal = &pData->bIsSpellAuto; break;
- case WID_IS_SPELL_HIDE : /*! deprecated !*/ break;
- case WID_IS_SPELL_IN_ALL_LANGUAGES :/*! deprecated !*/ break;
+ case WID_IS_SPELL_HIDE : pbVal = &bDummy; /*! deprecated !*/ break;
+ case WID_IS_SPELL_IN_ALL_LANGUAGES :pbVal = &bDummy; /*! deprecated !*/ break;
case WID_IS_SPELL_SPECIAL : pbVal = &pData->bIsSpellSpecial; break;
case WID_IS_WRAP_REVERSE : pbVal = &pData->bIsSpellReverse; break;
case WID_DEFAULT_LANGUAGE : pnVal = &pData->nDefaultLanguage; break;
diff --git a/linguistic/source/lngprophelp.cxx b/linguistic/source/lngprophelp.cxx
new file mode 100644
index 0000000..c233fdc
--- /dev/null
+++ b/linguistic/source/lngprophelp.cxx
@@ -0,0 +1,720 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: prophelp.cxx,v $
+ * $Revision: 1.6 $
+ *
+ * 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): autogen include statement, do not remove
+#include "precompiled_linguistic.hxx"
+
+#include <tools/debug.hxx>
+
+#include <com/sun/star/linguistic2/LinguServiceEvent.hpp>
+#include <com/sun/star/linguistic2/LinguServiceEventFlags.hpp>
+#include <com/sun/star/linguistic2/XLinguServiceEventListener.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <osl/mutex.hxx>
+
+#include <misc.hxx>
+#include <lngprops.hxx>
+
+#include <lngprophelp.hxx>
+
+
+//using namespace utl;
+using namespace osl;
+using namespace rtl;
+using namespace com::sun::star;
+using namespace com::sun::star::beans;
+using namespace com::sun::star::lang;
+using namespace com::sun::star::uno;
+using namespace com::sun::star::linguistic2;
+using namespace linguistic;
+
+namespace linguistic
+{
+
+///////////////////////////////////////////////////////////////////////////
+
+static const char *aCH[] =
+{
+ UPN_IS_IGNORE_CONTROL_CHARACTERS,
+ UPN_IS_USE_DICTIONARY_LIST,
+};
+
+static int nCHCount = sizeof(aCH) / sizeof(aCH[0]);
+
+
+PropertyChgHelper::PropertyChgHelper(
+ const Reference< XInterface > &rxSource,
+ Reference< XPropertySet > &rxPropSet,
+ int nAllowedEvents ) :
+ PropertyChgHelperBase(),
+ aPropNames (nCHCount),
+ xMyEvtObj (rxSource),
+ aLngSvcEvtListeners (GetLinguMutex()),
+ xPropSet (rxPropSet),
+ nEvtFlags (nAllowedEvents)
+{
+ OUString *pName = aPropNames.getArray();
+ for (INT32 i = 0; i < nCHCount; ++i)
+ {
+ pName[i] = A2OU( aCH[i] );
+ }
+
+ SetDefaultValues();
+}
+
+
+PropertyChgHelper::PropertyChgHelper( const PropertyChgHelper &rHelper ) :
+ PropertyChgHelperBase(),
+ aLngSvcEvtListeners (GetLinguMutex())
+{
+ RemoveAsPropListener();
+ aPropNames = rHelper.aPropNames;
+ xMyEvtObj = rHelper.xMyEvtObj;
+ xPropSet = rHelper.xPropSet;
+ nEvtFlags = rHelper.nEvtFlags;
+ AddAsPropListener();
+
+ SetDefaultValues();
+ GetCurrentValues();
+}
+
+
+PropertyChgHelper::~PropertyChgHelper()
+{
+}
+
+
+void PropertyChgHelper::AddPropNames( const char *pNewNames[], INT32 nCount )
+{
+ if (pNewNames && nCount)
+ {
+ INT32 nLen = GetPropNames().getLength();
+ GetPropNames().realloc( nLen + nCount );
+ OUString *pName = GetPropNames().getArray();
+ for (INT32 i = 0; i < nCount; ++i)
+ {
+ pName[ nLen + i ] = A2OU( pNewNames[ i ] );
+ }
+ }
+}
+
+
+void PropertyChgHelper::SetDefaultValues()
+{
+ bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters = TRUE;
+ bResIsUseDictionaryList = bIsUseDictionaryList = TRUE;
+}
+
+
+void PropertyChgHelper::GetCurrentValues()
+{
+ INT32 nLen = GetPropNames().getLength();
+ if (GetPropSet().is() && nLen)
+ {
+ const OUString *pPropName = GetPropNames().getConstArray();
+ for (INT32 i = 0; i < nLen; ++i)
+ {
+ BOOL *pbVal = NULL,
+ *pbResVal = NULL;
+
+ if (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_IS_IGNORE_CONTROL_CHARACTERS ) ))
+ {
+ pbVal = &bIsIgnoreControlCharacters;
+ pbResVal = &bResIsIgnoreControlCharacters;
+ }
+ else if (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_IS_USE_DICTIONARY_LIST ) ))
+ {
+ pbVal = &bIsUseDictionaryList;
+ pbResVal = &bResIsUseDictionaryList;
+ }
+
+ if (pbVal && pbResVal)
+ {
+ GetPropSet()->getPropertyValue( pPropName[i] ) >>= *pbVal;
+ *pbResVal = *pbVal;
+ }
+ }
+ }
+}
+
+
+void PropertyChgHelper::SetTmpPropVals( const PropertyValues &rPropVals )
+{
+ // return value is default value unless there is an explicitly supplied
+ // temporary value
+ bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters;
+ bResIsUseDictionaryList = bIsUseDictionaryList;
+ //
+ INT32 nLen = rPropVals.getLength();
+ if (nLen)
+ {
+ const PropertyValue *pVal = rPropVals.getConstArray();
+ for (INT32 i = 0; i < nLen; ++i)
+ {
+ BOOL *pbResVal = NULL;
+ switch (pVal[i].Handle)
+ {
+ case UPH_IS_IGNORE_CONTROL_CHARACTERS :
+ pbResVal = &bResIsIgnoreControlCharacters; break;
+ case UPH_IS_USE_DICTIONARY_LIST :
+ pbResVal = &bResIsUseDictionaryList; break;
+ default:
+ ;
+ //DBG_ASSERT( 0, "unknown property" );
+ }
+ if (pbResVal)
+ pVal[i].Value >>= *pbResVal;
+ }
+ }
+}
+
+
+BOOL PropertyChgHelper::propertyChange_Impl( const PropertyChangeEvent& rEvt )
+{
+ BOOL bRes = FALSE;
+
+ if (GetPropSet().is() && rEvt.Source == GetPropSet())
+ {
+ INT16 nLngSvcFlags = (nEvtFlags & AE_HYPHENATOR) ?
+ LinguServiceEventFlags::HYPHENATE_AGAIN : 0;
+ BOOL bSCWA = FALSE, // SPELL_CORRECT_WORDS_AGAIN ?
+ bSWWA = FALSE; // SPELL_WRONG_WORDS_AGAIN ?
+
+ BOOL *pbVal = NULL;
+ switch (rEvt.PropertyHandle)
+ {
+ case UPH_IS_IGNORE_CONTROL_CHARACTERS :
+ {
+ pbVal = &bIsIgnoreControlCharacters;
+ nLngSvcFlags = 0;
+ break;
+ }
+ case UPH_IS_USE_DICTIONARY_LIST :
+ {
+ pbVal = &bIsUseDictionaryList;
+ bSCWA = bSWWA = TRUE;
+ break;
+ }
+ default:
+ {
+ bRes = FALSE;
+ //DBG_ASSERT( 0, "unknown property" );
+ }
+ }
+ if (pbVal)
+ rEvt.NewValue >>= *pbVal;
+
+ bRes = 0 != pbVal; // sth changed?
+ if (bRes)
+ {
+ BOOL bSpellEvts = (nEvtFlags & AE_SPELLCHECKER) ? TRUE : FALSE;
+ if (bSCWA && bSpellEvts)
+ nLngSvcFlags |= LinguServiceEventFlags::SPELL_CORRECT_WORDS_AGAIN;
+ if (bSWWA && bSpellEvts)
+ nLngSvcFlags |= LinguServiceEventFlags::SPELL_WRONG_WORDS_AGAIN;
+ if (nLngSvcFlags)
+ {
+ LinguServiceEvent aEvt( GetEvtObj(), nLngSvcFlags );
+ LaunchEvent( aEvt );
+ }
+ }
+ }
+
+ return bRes;
+}
+
+
+void SAL_CALL
+ PropertyChgHelper::propertyChange( const PropertyChangeEvent& rEvt )
+ throw(RuntimeException)
+{
+ MutexGuard aGuard( GetLinguMutex() );
+ propertyChange_Impl( rEvt );
+}
+
+
+void PropertyChgHelper::AddAsPropListener()
+{
+ if (xPropSet.is())
+ {
+ INT32 nLen = aPropNames.getLength();
+ const OUString *pPropName = aPropNames.getConstArray();
+ for (INT32 i = 0; i < nLen; ++i)
+ {
+ if (pPropName[i].getLength())
+ xPropSet->addPropertyChangeListener( pPropName[i], this );
+ }
+ }
+}
+
+void PropertyChgHelper::RemoveAsPropListener()
+{
+ if (xPropSet.is())
+ {
+ INT32 nLen = aPropNames.getLength();
+ const OUString *pPropName = aPropNames.getConstArray();
+ for (INT32 i = 0; i < nLen; ++i)
+ {
+ if (pPropName[i].getLength())
+ xPropSet->removePropertyChangeListener( pPropName[i], this );
+ }
+ }
+}
+
+
+void PropertyChgHelper::LaunchEvent( const LinguServiceEvent &rEvt )
+{
+ cppu::OInterfaceIteratorHelper aIt( aLngSvcEvtListeners );
+ while (aIt.hasMoreElements())
+ {
+ Reference< XLinguServiceEventListener > xRef( aIt.next(), UNO_QUERY );
+ if (xRef.is())
+ xRef->processLinguServiceEvent( rEvt );
+ }
+}
+
+
+void SAL_CALL PropertyChgHelper::disposing( const EventObject& rSource )
+ throw(RuntimeException)
+{
+ MutexGuard aGuard( GetLinguMutex() );
+ if (rSource.Source == xPropSet)
+ {
+ RemoveAsPropListener();
+ xPropSet = NULL;
+ aPropNames.realloc( 0 );
+ }
+}
+
+
+sal_Bool SAL_CALL
+ PropertyChgHelper::addLinguServiceEventListener(
+ const Reference< XLinguServiceEventListener >& rxListener )
+ throw(RuntimeException)
+{
+ MutexGuard aGuard( GetLinguMutex() );
+
+ BOOL bRes = FALSE;
+ if (rxListener.is())
+ {
+ INT32 nCount = aLngSvcEvtListeners.getLength();
+ bRes = aLngSvcEvtListeners.addInterface( rxListener ) != nCount;
+ }
+ return bRes;
+}
+
+
+sal_Bool SAL_CALL
+ PropertyChgHelper::removeLinguServiceEventListener(
+ const Reference< XLinguServiceEventListener >& rxListener )
+ throw(RuntimeException)
+{
+ MutexGuard aGuard( GetLinguMutex() );
+
+ BOOL bRes = FALSE;
+ if (rxListener.is())
+ {
+ INT32 nCount = aLngSvcEvtListeners.getLength();
+ bRes = aLngSvcEvtListeners.removeInterface( rxListener ) != nCount;
+ }
+ return bRes;
+}
+
+///////////////////////////////////////////////////////////////////////////
+
+
+PropertyHelper_Thes::PropertyHelper_Thes(
+ const Reference< XInterface > &rxSource,
+ Reference< XPropertySet > &rxPropSet ) :
+ PropertyChgHelper ( rxSource, rxPropSet, 0 )
+{
+ SetDefaultValues();
+ GetCurrentValues();
+}
+
+
+PropertyHelper_Thes::~PropertyHelper_Thes()
+{
+}
+
+
+void SAL_CALL
+ PropertyHelper_Thes::propertyChange( const PropertyChangeEvent& rEvt )
+ throw(RuntimeException)
+{
+ MutexGuard aGuard( GetLinguMutex() );
+ PropertyChgHelper::propertyChange_Impl( rEvt );
+}
+
+
+///////////////////////////////////////////////////////////////////////////
+
+// list of properties from the property set to be used
+// and listened to
+static const char *aSP[] =
+{
+ UPN_IS_SPELL_UPPER_CASE,
+ UPN_IS_SPELL_WITH_DIGITS,
+ UPN_IS_SPELL_CAPITALIZATION
+};
+
+
+PropertyHelper_Spell::PropertyHelper_Spell(
+ const Reference< XInterface > & rxSource,
+ Reference< XPropertySet > &rxPropSet ) :
+ PropertyChgHelper ( rxSource, rxPropSet, AE_SPELLCHECKER )
+{
+ AddPropNames( aSP, sizeof(aSP) / sizeof(aSP[0]) );
+ SetDefaultValues();
+ GetCurrentValues();
+
+ nResMaxNumberOfSuggestions = GetDefaultNumberOfSuggestions();
+}
+
+
+PropertyHelper_Spell::~PropertyHelper_Spell()
+{
+}
+
+
+void PropertyHelper_Spell::SetDefaultValues()
+{
+ PropertyChgHelper::SetDefaultValues();
+
+ bResIsSpellUpperCase = bIsSpellUpperCase = FALSE;
+ bResIsSpellWithDigits = bIsSpellWithDigits = FALSE;
+ bResIsSpellCapitalization = bIsSpellCapitalization = TRUE;
+}
+
+
+void PropertyHelper_Spell::GetCurrentValues()
+{
+ PropertyChgHelper::GetCurrentValues();
+
+ INT32 nLen = GetPropNames().getLength();
+ if (GetPropSet().is() && nLen)
+ {
+ const OUString *pPropName = GetPropNames().getConstArray();
+ for (INT32 i = 0; i < nLen; ++i)
+ {
+ BOOL *pbVal = NULL,
+ *pbResVal = NULL;
+
+ if (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_IS_SPELL_UPPER_CASE ) ))
+ {
+ pbVal = &bIsSpellUpperCase;
+ pbResVal = &bResIsSpellUpperCase;
+ }
+ else if (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_IS_SPELL_WITH_DIGITS ) ))
+ {
+ pbVal = &bIsSpellWithDigits;
+ pbResVal = &bResIsSpellWithDigits;
+ }
+ else if (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_IS_SPELL_CAPITALIZATION ) ))
+ {
+ pbVal = &bIsSpellCapitalization;
+ pbResVal = &bResIsSpellCapitalization;
+ }
+
+ if (pbVal && pbResVal)
+ {
+ GetPropSet()->getPropertyValue( pPropName[i] ) >>= *pbVal;
+ *pbResVal = *pbVal;
+ }
+ }
+ }
+}
+
+
+BOOL PropertyHelper_Spell::propertyChange_Impl( const PropertyChangeEvent& rEvt )
+{
+ BOOL bRes = PropertyChgHelper::propertyChange_Impl( rEvt );
+
+ if (!bRes && GetPropSet().is() && rEvt.Source == GetPropSet())
+ {
+ INT16 nLngSvcFlags = 0;
+ BOOL bSCWA = FALSE, // SPELL_CORRECT_WORDS_AGAIN ?
+ bSWWA = FALSE; // SPELL_WRONG_WORDS_AGAIN ?
+
+ BOOL *pbVal = NULL;
+ switch (rEvt.PropertyHandle)
+ {
+ case UPH_IS_SPELL_UPPER_CASE :
+ {
+ pbVal = &bIsSpellUpperCase;
+ bSCWA = FALSE == *pbVal; // FALSE->TRUE change?
+ bSWWA = !bSCWA; // TRUE->FALSE change?
+ break;
+ }
+ case UPH_IS_SPELL_WITH_DIGITS :
+ {
+ pbVal = &bIsSpellWithDigits;
+ bSCWA = FALSE == *pbVal; // FALSE->TRUE change?
+ bSWWA = !bSCWA; // TRUE->FALSE change?
+ break;
+ }
+ case UPH_IS_SPELL_CAPITALIZATION :
+ {
+ pbVal = &bIsSpellCapitalization;
+ bSCWA = FALSE == *pbVal; // FALSE->TRUE change?
+ bSWWA = !bSCWA; // TRUE->FALSE change?
+ break;
+ }
+ default:
+ DBG_ASSERT( 0, "unknown property" );
+ }
+ if (pbVal)
+ rEvt.NewValue >>= *pbVal;
+
+ bRes = (pbVal != 0);
+ if (bRes)
+ {
+ if (bSCWA)
+ nLngSvcFlags |= LinguServiceEventFlags::SPELL_CORRECT_WORDS_AGAIN;
+ if (bSWWA)
+ nLngSvcFlags |= LinguServiceEventFlags::SPELL_WRONG_WORDS_AGAIN;
+ if (nLngSvcFlags)
+ {
+ LinguServiceEvent aEvt( GetEvtObj(), nLngSvcFlags );
+ LaunchEvent( aEvt );
+ }
+ }
+ }
+
+ return bRes;
+}
+
+
+void SAL_CALL
+ PropertyHelper_Spell::propertyChange( const PropertyChangeEvent& rEvt )
+ throw(RuntimeException)
+{
+ MutexGuard aGuard( GetLinguMutex() );
+ propertyChange_Impl( rEvt );
+}
+
+
+void PropertyHelper_Spell::SetTmpPropVals( const PropertyValues &rPropVals )
+{
+ PropertyChgHelper::SetTmpPropVals( rPropVals );
+
+ // return value is default value unless there is an explicitly supplied
+ // temporary value
+ nResMaxNumberOfSuggestions = GetDefaultNumberOfSuggestions();
+ bResIsSpellWithDigits = bIsSpellWithDigits;
+ bResIsSpellCapitalization = bIsSpellCapitalization;
+ //
+ INT32 nLen = rPropVals.getLength();
+ if (nLen)
+ {
+ const PropertyValue *pVal = rPropVals.getConstArray();
+ for (INT32 i = 0; i < nLen; ++i)
+ {
+ if (pVal[i].Name.equalsAscii( UPN_MAX_NUMBER_OF_SUGGESTIONS ))
+ {
+ pVal[i].Value >>= nResMaxNumberOfSuggestions;
+ }
+ else
+ {
+ BOOL *pbResVal = NULL;
+ switch (pVal[i].Handle)
+ {
+ case UPH_IS_SPELL_UPPER_CASE : pbResVal = &bResIsSpellUpperCase; break;
+ case UPH_IS_SPELL_WITH_DIGITS : pbResVal = &bResIsSpellWithDigits; break;
+ case UPH_IS_SPELL_CAPITALIZATION : pbResVal = &bResIsSpellCapitalization; break;
+ default:
+ DBG_ASSERT( 0, "unknown property" );
+ }
+ if (pbResVal)
+ pVal[i].Value >>= *pbResVal;
+ }
+ }
+ }
+}
+
+INT16 PropertyHelper_Spell::GetDefaultNumberOfSuggestions() const
+{
+ return 16;
+}
+
+///////////////////////////////////////////////////////////////////////////
+
+static const char *aHP[] =
+{
+ UPN_HYPH_MIN_LEADING,
+ UPN_HYPH_MIN_TRAILING,
+ UPN_HYPH_MIN_WORD_LENGTH
+};
+
+
+PropertyHelper_Hyphen::PropertyHelper_Hyphen(
+ const Reference< XInterface > & rxSource,
+ Reference< XPropertySet > &rxPropSet ) :
+ PropertyChgHelper ( rxSource, rxPropSet, AE_HYPHENATOR )
+{
+ AddPropNames( aHP, sizeof(aHP) / sizeof(aHP[0]) );
+ SetDefaultValues();
+ GetCurrentValues();
+}
+
+
+PropertyHelper_Hyphen::~PropertyHelper_Hyphen()
+{
+}
+
+
+void PropertyHelper_Hyphen::SetDefaultValues()
+{
+ PropertyChgHelper::SetDefaultValues();
+
+ nResHyphMinLeading = nHyphMinLeading = 2;
+ nResHyphMinTrailing = nHyphMinTrailing = 2;
+ nResHyphMinWordLength = nHyphMinWordLength = 0;
+}
+
+
+void PropertyHelper_Hyphen::GetCurrentValues()
+{
+ PropertyChgHelper::GetCurrentValues();
+
+ INT32 nLen = GetPropNames().getLength();
+ if (GetPropSet().is() && nLen)
+ {
+ const OUString *pPropName = GetPropNames().getConstArray();
+ for (INT32 i = 0; i < nLen; ++i)
+ {
+ INT16 *pnVal = NULL,
+ *pnResVal = NULL;
+
+ if (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_HYPH_MIN_LEADING ) ))
+ {
+ pnVal = &nHyphMinLeading;
+ pnResVal = &nResHyphMinLeading;
+ }
+ else if (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_HYPH_MIN_TRAILING ) ))
+ {
+ pnVal = &nHyphMinTrailing;
+ pnResVal = &nResHyphMinTrailing;
+ }
+ else if (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_HYPH_MIN_WORD_LENGTH ) ))
+ {
+ pnVal = &nHyphMinWordLength;
+ pnResVal = &nResHyphMinWordLength;
+ }
+
+ if (pnVal && pnResVal)
+ {
+ GetPropSet()->getPropertyValue( pPropName[i] ) >>= *pnVal;
+ *pnResVal = *pnVal;
+ }
+ }
+ }
+}
+
+
+BOOL PropertyHelper_Hyphen::propertyChange_Impl( const PropertyChangeEvent& rEvt )
+{
+ BOOL bRes = PropertyChgHelper::propertyChange_Impl( rEvt );
+
+ if (!bRes && GetPropSet().is() && rEvt.Source == GetPropSet())
+ {
+ INT16 nLngSvcFlags = LinguServiceEventFlags::HYPHENATE_AGAIN;
+
+ INT16 *pnVal = NULL;
+ switch (rEvt.PropertyHandle)
+ {
+ case UPH_HYPH_MIN_LEADING : pnVal = &nHyphMinLeading; break;
+ case UPH_HYPH_MIN_TRAILING : pnVal = &nHyphMinTrailing; break;
+ case UPH_HYPH_MIN_WORD_LENGTH : pnVal = &nHyphMinWordLength; break;
+ default:
+ DBG_ASSERT( 0, "unknown property" );
+ }
+ if (pnVal)
+ rEvt.NewValue >>= *pnVal;
+
+ bRes = (pnVal != 0);
+ if (bRes)
+ {
+ if (nLngSvcFlags)
+ {
+ LinguServiceEvent aEvt( GetEvtObj(), nLngSvcFlags );
+ LaunchEvent( aEvt );
+ }
+ }
+ }
+
+ return bRes;
+}
+
+
+void SAL_CALL
+ PropertyHelper_Hyphen::propertyChange( const PropertyChangeEvent& rEvt )
+ throw(RuntimeException)
+{
+ MutexGuard aGuard( GetLinguMutex() );
+ propertyChange_Impl( rEvt );
+}
+
+
+void PropertyHelper_Hyphen::SetTmpPropVals( const PropertyValues &rPropVals )
+{
+ PropertyChgHelper::SetTmpPropVals( rPropVals );
+
+ // return value is default value unless there is an explicitly supplied
+ // temporary value
+ nResHyphMinLeading = nHyphMinLeading;
+ nResHyphMinTrailing = nHyphMinTrailing;
+ nResHyphMinWordLength = nHyphMinWordLength;
+ //
+ INT32 nLen = rPropVals.getLength();
+ if (nLen)
+ {
+ const PropertyValue *pVal = rPropVals.getConstArray();
+ for (INT32 i = 0; i < nLen; ++i)
+ {
+ INT16 *pnResVal = NULL;
+ switch (pVal[i].Handle)
+ {
+ case UPH_HYPH_MIN_LEADING : pnResVal = &nResHyphMinLeading; break;
+ case UPH_HYPH_MIN_TRAILING : pnResVal = &nResHyphMinTrailing; break;
+ case UPH_HYPH_MIN_WORD_LENGTH : pnResVal = &nResHyphMinWordLength; break;
+ default:
+ DBG_ASSERT( 0, "unknown property" );
+ }
+ if (pnResVal)
+ pVal[i].Value >>= *pnResVal;
+ }
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////
+
+} // namespace linguistic
+
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index 630593c..2a70e9e 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -881,8 +881,9 @@ void LngSvcMgr::GetAvailableSpellSvcs_Impl()
xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))) >>= xContext;
xSvc = uno::Reference< linguistic2::XSpellChecker >( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), uno::UNO_QUERY );
}
- catch (uno::Exception &)
+ catch (uno::Exception &rEx)
{
+ (void) rEx;
DBG_ASSERT( 0, "createInstance failed" );
}
}
@@ -946,8 +947,9 @@ void LngSvcMgr::GetAvailableGrammarSvcs_Impl()
xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))) >>= xContext;
xSvc = uno::Reference< linguistic2::XProofreader >( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), uno::UNO_QUERY );
}
- catch (uno::Exception &)
+ catch (uno::Exception &rEx)
{
+ (void) rEx;
DBG_ASSERT( 0, "createInstance failed" );
}
}
@@ -1010,8 +1012,9 @@ void LngSvcMgr::GetAvailableHyphSvcs_Impl()
xSvc = uno::Reference< linguistic2::XHyphenator >( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), uno::UNO_QUERY );
}
- catch (uno::Exception &)
+ catch (uno::Exception &rEx)
{
+ (void) rEx;
DBG_ASSERT( 0, "createInstance failed" );
}
}
@@ -1076,8 +1079,9 @@ void LngSvcMgr::GetAvailableThesSvcs_Impl()
xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))) >>= xContext;
xSvc = uno::Reference< linguistic2::XThesaurus >( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), uno::UNO_QUERY );
}
- catch (uno::Exception &)
+ catch (uno::Exception &rEx)
{
+ (void) rEx;
DBG_ASSERT( 0, "createInstance failed" );
}
}
diff --git a/linguistic/source/makefile.mk b/linguistic/source/makefile.mk
index 037f595..0012a9a 100644
--- a/linguistic/source/makefile.mk
+++ b/linguistic/source/makefile.mk
@@ -52,11 +52,11 @@ SLOFILES = \
$(SLO)$/hyphdta.obj\
$(SLO)$/iprcache.obj\
$(SLO)$/lngopt.obj\
+ $(SLO)$/lngprophelp.obj\
$(SLO)$/lngreg.obj\
$(SLO)$/lngsvcmgr.obj\
$(SLO)$/misc.obj\
$(SLO)$/misc2.obj\
- $(SLO)$/prophelp.obj\
$(SLO)$/spelldsp.obj\
$(SLO)$/spelldta.obj\
$(SLO)$/thesdsp.obj\
diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx
index 7353ec1..2df1921 100644
--- a/linguistic/source/misc.cxx
+++ b/linguistic/source/misc.cxx
@@ -796,17 +796,62 @@ sal_Unicode ToUpper( const sal_Unicode cChar, INT16 nLanguage )
return rCC.upper( cChar ).GetChar(0);
}
+// sorted(!) array of unicode ranges for code points that are exclusively(!) used as numbers
+// and thus may NOT not be part of names or words like the Chinese/Japanese number characters
+static const sal_uInt32 the_aDigitZeroes [] =
+{
+ 0x00000030, //0039 ; Decimal # Nd [10] DIGIT ZERO..DIGIT NINE
+ 0x00000660, //0669 ; Decimal # Nd [10] ARABIC-INDIC DIGIT ZERO..ARABIC-INDIC DIGIT NINE
+ 0x000006F0, //06F9 ; Decimal # Nd [10] EXTENDED ARABIC-INDIC DIGIT ZERO..EXTENDED ARABIC-INDIC DIGIT NINE
+ 0x000007C0, //07C9 ; Decimal # Nd [10] NKO DIGIT ZERO..NKO DIGIT NINE
+ 0x00000966, //096F ; Decimal # Nd [10] DEVANAGARI DIGIT ZERO..DEVANAGARI DIGIT NINE
+ 0x000009E6, //09EF ; Decimal # Nd [10] BENGALI DIGIT ZERO..BENGALI DIGIT NINE
+ 0x00000A66, //0A6F ; Decimal # Nd [10] GURMUKHI DIGIT ZERO..GURMUKHI DIGIT NINE
+ 0x00000AE6, //0AEF ; Decimal # Nd [10] GUJARATI DIGIT ZERO..GUJARATI DIGIT NINE
+ 0x00000B66, //0B6F ; Decimal # Nd [10] ORIYA DIGIT ZERO..ORIYA DIGIT NINE
+ 0x00000BE6, //0BEF ; Decimal # Nd [10] TAMIL DIGIT ZERO..TAMIL DIGIT NINE
+ 0x00000C66, //0C6F ; Decimal # Nd [10] TELUGU DIGIT ZERO..TELUGU DIGIT NINE
+ 0x00000CE6, //0CEF ; Decimal # Nd [10] KANNADA DIGIT ZERO..KANNADA DIGIT NINE
+ 0x00000D66, //0D6F ; Decimal # Nd [10] MALAYALAM DIGIT ZERO..MALAYALAM DIGIT NINE
+ 0x00000E50, //0E59 ; Decimal # Nd [10] THAI DIGIT ZERO..THAI DIGIT NINE
+ 0x00000ED0, //0ED9 ; Decimal # Nd [10] LAO DIGIT ZERO..LAO DIGIT NINE
+ 0x00000F20, //0F29 ; Decimal # Nd [10] TIBETAN DIGIT ZERO..TIBETAN DIGIT NINE
+ 0x00001040, //1049 ; Decimal # Nd [10] MYANMAR DIGIT ZERO..MYANMAR DIGIT NINE
+ 0x00001090, //1099 ; Decimal # Nd [10] MYANMAR SHAN DIGIT ZERO..MYANMAR SHAN DIGIT NINE
+ 0x000017E0, //17E9 ; Decimal # Nd [10] KHMER DIGIT ZERO..KHMER DIGIT NINE
+ 0x00001810, //1819 ; Decimal # Nd [10] MONGOLIAN DIGIT ZERO..MONGOLIAN DIGIT NINE
+ 0x00001946, //194F ; Decimal # Nd [10] LIMBU DIGIT ZERO..LIMBU DIGIT NINE
+ 0x000019D0, //19D9 ; Decimal # Nd [10] NEW TAI LUE DIGIT ZERO..NEW TAI LUE DIGIT NINE
+ 0x00001B50, //1B59 ; Decimal # Nd [10] BALINESE DIGIT ZERO..BALINESE DIGIT NINE
+ 0x00001BB0, //1BB9 ; Decimal # Nd [10] SUNDANESE DIGIT ZERO..SUNDANESE DIGIT NINE
+ 0x00001C40, //1C49 ; Decimal # Nd [10] LEPCHA DIGIT ZERO..LEPCHA DIGIT NINE
+ 0x00001C50, //1C59 ; Decimal # Nd [10] OL CHIKI DIGIT ZERO..OL CHIKI DIGIT NINE
+ 0x0000A620, //A629 ; Decimal # Nd [10] VAI DIGIT ZERO..VAI DIGIT NINE
+ 0x0000A8D0, //A8D9 ; Decimal # Nd [10] SAURASHTRA DIGIT ZERO..SAURASHTRA DIGIT NINE
+ 0x0000A900, //A909 ; Decimal # Nd [10] KAYAH LI DIGIT ZERO..KAYAH LI DIGIT NINE
+ 0x0000AA50, //AA59 ; Decimal # Nd [10] CHAM DIGIT ZERO..CHAM DIGIT NINE
+ 0x0000FF10, //FF19 ; Decimal # Nd [10] FULLWIDTH DIGIT ZERO..FULLWIDTH DIGIT NINE
+ 0x000104A0, //104A9 ; Decimal # Nd [10] OSMANYA DIGIT ZERO..OSMANYA DIGIT NINE
+ 0x0001D7CE //1D7FF ; Decimal # Nd [50] MATHEMATICAL BOLD DIGIT ZERO..MATHEMATICAL MONOSPACE DIGIT NINE
+};
-BOOL HasDigits( const String &rText )
+BOOL HasDigits( const OUString &rText )
{
- xub_StrLen nLen = rText.Len();
+ static const int nNumDigitZeroes = sizeof(the_aDigitZeroes) / sizeof(the_aDigitZeroes[0]);
+ const sal_Int32 nLen = rText.getLength();
- xub_StrLen i = 0;
- while (i < nLen)
+ sal_Int32 i = 0;
+ while (i < nLen) // for all characters ...
{
- sal_Unicode cChar = rText.GetChar( i++ );
- if ((sal_Unicode)'0' <= cChar && cChar <= (sal_Unicode)'9')
- return TRUE;
+ const sal_uInt32 nCodePoint = rText.iterateCodePoints( &i ); // handle unicode surrogates correctly...
+ for (int j = 0; j < nNumDigitZeroes; ++j) // ... check in all 0..9 ranges
+ {
+ sal_uInt32 nDigitZero = the_aDigitZeroes[ j ];
+ if (nDigitZero > nCodePoint)
+ break;
+ if (/*nDigitZero <= nCodePoint &&*/ nCodePoint <= nDigitZero + 9)
+ return TRUE;
+ }
}
return FALSE;
}
@@ -877,6 +922,15 @@ uno::Reference< XDictionaryList > GetDictionaryList()
GetOneInstanceService( SN_DICTIONARY_LIST ), UNO_QUERY );
}
+uno::Reference< XDictionary > GetIgnoreAllList()
+{
+ uno::Reference< XDictionary > xRes;
+ uno::Reference< XDictionaryList > xDL( GetDictionaryList() );
+ if (xDL.is())
+ xRes = xDL->getDictionaryByName( A2OU("IgnoreAllList") );
+ return xRes;
+}
+
///////////////////////////////////////////////////////////////////////////
AppExitListener::AppExitListener()
diff --git a/linguistic/source/prophelp.cxx b/linguistic/source/prophelp.cxx
deleted file mode 100644
index 7782395..0000000
--- a/linguistic/source/prophelp.cxx
+++ /dev/null
@@ -1,734 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: prophelp.cxx,v $
- * $Revision: 1.6 $
- *
- * 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): autogen include statement, do not remove
-#include "precompiled_linguistic.hxx"
-#include <tools/debug.hxx>
-
-#include <com/sun/star/linguistic2/LinguServiceEvent.hpp>
-#include <com/sun/star/linguistic2/LinguServiceEventFlags.hpp>
-#include <com/sun/star/linguistic2/XLinguServiceEventListener.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <osl/mutex.hxx>
-
-#include "misc.hxx"
-#include "lngprops.hxx"
-#include "prophelp.hxx"
-
-
-//using namespace utl;
-using namespace osl;
-using namespace rtl;
-using namespace com::sun::star;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::linguistic2;
-using namespace linguistic;
-
-namespace linguistic
-{
-
-///////////////////////////////////////////////////////////////////////////
-
-static const char *aCH[] =
-{
- UPN_IS_GERMAN_PRE_REFORM, /* deprectaed */
- UPN_IS_IGNORE_CONTROL_CHARACTERS,
- UPN_IS_USE_DICTIONARY_LIST,
-};
-
-static int nCHCount = sizeof(aCH) / sizeof(aCH[0]);
-
-
-PropertyChgHelper::PropertyChgHelper(
- const Reference< XInterface > &rxSource,
- Reference< XPropertySet > &rxPropSet,
- int nAllowedEvents ) :
- PropertyChgHelperBase(),
- aPropNames (nCHCount),
- xMyEvtObj (rxSource),
- aLngSvcEvtListeners (GetLinguMutex()),
- xPropSet (rxPropSet),
- nEvtFlags (nAllowedEvents)
-{
- OUString *pName = aPropNames.getArray();
- for (INT32 i = 0; i < nCHCount; ++i)
- {
- pName[i] = A2OU( aCH[i] );
- }
-
- SetDefaultValues();
-}
-
-
-PropertyChgHelper::PropertyChgHelper( const PropertyChgHelper &rHelper ) :
- PropertyChgHelperBase(),
- aLngSvcEvtListeners (GetLinguMutex())
-{
- RemoveAsPropListener();
- aPropNames = rHelper.aPropNames;
- xMyEvtObj = rHelper.xMyEvtObj;
- xPropSet = rHelper.xPropSet;
- nEvtFlags = rHelper.nEvtFlags;
- AddAsPropListener();
-
- SetDefaultValues();
- GetCurrentValues();
-}
-
-
-PropertyChgHelper::~PropertyChgHelper()
-{
-}
-
-
-void PropertyChgHelper::AddPropNames( const char *pNewNames[], INT32 nCount )
-{
- if (pNewNames && nCount)
- {
- INT32 nLen = GetPropNames().getLength();
- GetPropNames().realloc( nLen + nCount );
- OUString *pName = GetPropNames().getArray();
- for (INT32 i = 0; i < nCount; ++i)
- {
- pName[ nLen + i ] = A2OU( pNewNames[ i ] );
- }
- }
-}
-
-
-void PropertyChgHelper::SetDefaultValues()
-{
- bResIsGermanPreReform = bIsGermanPreReform = FALSE;
- bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters = TRUE;
- bResIsUseDictionaryList = bIsUseDictionaryList = TRUE;
-}
-
-
-void PropertyChgHelper::GetCurrentValues()
-{
- INT32 nLen = GetPropNames().getLength();
- if (GetPropSet().is() && nLen)
- {
- const OUString *pPropName = GetPropNames().getConstArray();
- for (INT32 i = 0; i < nLen; ++i)
- {
- BOOL *pbVal = NULL,
- *pbResVal = NULL;
-
- if (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_IS_GERMAN_PRE_REFORM ) )) /* deprecated */
- {
- pbVal = &bIsGermanPreReform;
- pbResVal = &bResIsGermanPreReform;
- }
- else if (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_IS_IGNORE_CONTROL_CHARACTERS ) ))
- {
- pbVal = &bIsIgnoreControlCharacters;
- pbResVal = &bResIsIgnoreControlCharacters;
- }
- else if (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_IS_USE_DICTIONARY_LIST ) ))
- {
- pbVal = &bIsUseDictionaryList;
- pbResVal = &bResIsUseDictionaryList;
- }
-
- if (pbVal && pbResVal)
- {
- GetPropSet()->getPropertyValue( pPropName[i] ) >>= *pbVal;
- *pbResVal = *pbVal;
- }
- }
- }
-}
-
-
-void PropertyChgHelper::SetTmpPropVals( const PropertyValues &rPropVals )
-{
- // return value is default value unless there is an explicitly supplied
- // temporary value
- bResIsGermanPreReform = bIsGermanPreReform;
- bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters;
- bResIsUseDictionaryList = bIsUseDictionaryList;
- //
- INT32 nLen = rPropVals.getLength();
- if (nLen)
- {
- const PropertyValue *pVal = rPropVals.getConstArray();
- for (INT32 i = 0; i < nLen; ++i)
- {
- BOOL *pbResVal = NULL;
- switch (pVal[i].Handle)
- {
- case UPH_IS_GERMAN_PRE_REFORM :
- pbResVal = &bResIsGermanPreReform; break; /* deprecated */
- case UPH_IS_IGNORE_CONTROL_CHARACTERS :
- pbResVal = &bResIsIgnoreControlCharacters; break;
- case UPH_IS_USE_DICTIONARY_LIST :
- pbResVal = &bResIsUseDictionaryList; break;
- default:
- ;
- //DBG_ASSERT( 0, "unknown property" );
- }
- if (pbResVal)
- pVal[i].Value >>= *pbResVal;
- }
- }
-}
-
-
-BOOL PropertyChgHelper::propertyChange_Impl( const PropertyChangeEvent& rEvt )
-{
- BOOL bRes = FALSE;
-
- if (GetPropSet().is() && rEvt.Source == GetPropSet())
- {
- INT16 nLngSvcFlags = (nEvtFlags & AE_HYPHENATOR) ?
- LinguServiceEventFlags::HYPHENATE_AGAIN : 0;
- BOOL bSCWA = FALSE, // SPELL_CORRECT_WORDS_AGAIN ?
- bSWWA = FALSE; // SPELL_WRONG_WORDS_AGAIN ?
-
- BOOL *pbVal = NULL;
- switch (rEvt.PropertyHandle)
- {
- case UPH_IS_IGNORE_CONTROL_CHARACTERS :
- {
- pbVal = &bIsIgnoreControlCharacters;
- nLngSvcFlags = 0;
- break;
- }
- case UPH_IS_GERMAN_PRE_REFORM : /* deprecated */
- {
- pbVal = &bIsGermanPreReform;
- bSCWA = bSWWA = TRUE;
- break;
- }
- case UPH_IS_USE_DICTIONARY_LIST :
- {
- pbVal = &bIsUseDictionaryList;
- bSCWA = bSWWA = TRUE;
- break;
- }
- default:
- {
- bRes = FALSE;
- //DBG_ASSERT( 0, "unknown property" );
- }
- }
- if (pbVal)
- rEvt.NewValue >>= *pbVal;
-
- bRes = 0 != pbVal; // sth changed?
- if (bRes)
- {
- BOOL bSpellEvts = (nEvtFlags & AE_SPELLCHECKER) ? TRUE : FALSE;
- if (bSCWA && bSpellEvts)
- nLngSvcFlags |= LinguServiceEventFlags::SPELL_CORRECT_WORDS_AGAIN;
- if (bSWWA && bSpellEvts)
- nLngSvcFlags |= LinguServiceEventFlags::SPELL_WRONG_WORDS_AGAIN;
- if (nLngSvcFlags)
- {
- LinguServiceEvent aEvt( GetEvtObj(), nLngSvcFlags );
- LaunchEvent( aEvt );
- }
- }
- }
-
- return bRes;
-}
-
-
-void SAL_CALL
- PropertyChgHelper::propertyChange( const PropertyChangeEvent& rEvt )
- throw(RuntimeException)
-{
- MutexGuard aGuard( GetLinguMutex() );
- propertyChange_Impl( rEvt );
-}
-
-
-void PropertyChgHelper::AddAsPropListener()
-{
- if (xPropSet.is())
- {
- INT32 nLen = aPropNames.getLength();
- const OUString *pPropName = aPropNames.getConstArray();
- for (INT32 i = 0; i < nLen; ++i)
- {
- if (pPropName[i].getLength())
- xPropSet->addPropertyChangeListener( pPropName[i], this );
- }
- }
-}
-
-void PropertyChgHelper::RemoveAsPropListener()
-{
- if (xPropSet.is())
- {
- INT32 nLen = aPropNames.getLength();
- const OUString *pPropName = aPropNames.getConstArray();
- for (INT32 i = 0; i < nLen; ++i)
- {
- if (pPropName[i].getLength())
- xPropSet->removePropertyChangeListener( pPropName[i], this );
- }
- }
-}
-
-
-void PropertyChgHelper::LaunchEvent( const LinguServiceEvent &rEvt )
-{
- cppu::OInterfaceIteratorHelper aIt( aLngSvcEvtListeners );
- while (aIt.hasMoreElements())
- {
- Reference< XLinguServiceEventListener > xRef( aIt.next(), UNO_QUERY );
- if (xRef.is())
- xRef->processLinguServiceEvent( rEvt );
- }
-}
-
-
-void SAL_CALL PropertyChgHelper::disposing( const EventObject& rSource )
- throw(RuntimeException)
-{
- MutexGuard aGuard( GetLinguMutex() );
- if (rSource.Source == xPropSet)
- {
- RemoveAsPropListener();
- xPropSet = NULL;
- aPropNames.realloc( 0 );
- }
-}
-
-
-sal_Bool SAL_CALL
- PropertyChgHelper::addLinguServiceEventListener(
- const Reference< XLinguServiceEventListener >& rxListener )
- throw(RuntimeException)
-{
- MutexGuard aGuard( GetLinguMutex() );
-
- BOOL bRes = FALSE;
- if (rxListener.is())
- {
- INT32 nCount = aLngSvcEvtListeners.getLength();
- bRes = aLngSvcEvtListeners.addInterface( rxListener ) != nCount;
- }
- return bRes;
-}
-
-
-sal_Bool SAL_CALL
- PropertyChgHelper::removeLinguServiceEventListener(
- const Reference< XLinguServiceEventListener >& rxListener )
- throw(RuntimeException)
-{
- MutexGuard aGuard( GetLinguMutex() );
-
- BOOL bRes = FALSE;
- if (rxListener.is())
- {
- INT32 nCount = aLngSvcEvtListeners.getLength();
- bRes = aLngSvcEvtListeners.removeInterface( rxListener ) != nCount;
- }
- return bRes;
-}
-
-///////////////////////////////////////////////////////////////////////////
-
-
-PropertyHelper_Thes::PropertyHelper_Thes(
- const Reference< XInterface > &rxSource,
- Reference< XPropertySet > &rxPropSet ) :
- PropertyChgHelper ( rxSource, rxPropSet, 0 )
-{
- SetDefaultValues();
- GetCurrentValues();
-}
-
-
-PropertyHelper_Thes::~PropertyHelper_Thes()
-{
-}
-
-
-void SAL_CALL
- PropertyHelper_Thes::propertyChange( const PropertyChangeEvent& rEvt )
- throw(RuntimeException)
-{
- MutexGuard aGuard( GetLinguMutex() );
- PropertyChgHelper::propertyChange_Impl( rEvt );
-}
-
-
-///////////////////////////////////////////////////////////////////////////
-
-// list of properties from the property set to be used
-// and listened to
-static const char *aSP[] =
-{
- UPN_IS_SPELL_UPPER_CASE,
- UPN_IS_SPELL_WITH_DIGITS,
- UPN_IS_SPELL_CAPITALIZATION
-};
-
-
-PropertyHelper_Spell::PropertyHelper_Spell(
- const Reference< XInterface > & rxSource,
- Reference< XPropertySet > &rxPropSet ) :
- PropertyChgHelper ( rxSource, rxPropSet, AE_SPELLCHECKER )
-{
- AddPropNames( aSP, sizeof(aSP) / sizeof(aSP[0]) );
- SetDefaultValues();
- GetCurrentValues();
-
- nResMaxNumberOfSuggestions = GetDefaultNumberOfSuggestions();
-}
-
-
-PropertyHelper_Spell::~PropertyHelper_Spell()
-{
-}
-
-
-void PropertyHelper_Spell::SetDefaultValues()
-{
- PropertyChgHelper::SetDefaultValues();
-
- bResIsSpellUpperCase = bIsSpellUpperCase = FALSE;
- bResIsSpellWithDigits = bIsSpellWithDigits = FALSE;
- bResIsSpellCapitalization = bIsSpellCapitalization = TRUE;
-}
-
-
-void PropertyHelper_Spell::GetCurrentValues()
-{
- PropertyChgHelper::GetCurrentValues();
-
- INT32 nLen = GetPropNames().getLength();
- if (GetPropSet().is() && nLen)
- {
- const OUString *pPropName = GetPropNames().getConstArray();
- for (INT32 i = 0; i < nLen; ++i)
- {
- BOOL *pbVal = NULL,
- *pbResVal = NULL;
-
- if (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_IS_SPELL_UPPER_CASE ) ))
- {
- pbVal = &bIsSpellUpperCase;
- pbResVal = &bResIsSpellUpperCase;
- }
- else if (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_IS_SPELL_WITH_DIGITS ) ))
- {
- pbVal = &bIsSpellWithDigits;
- pbResVal = &bResIsSpellWithDigits;
- }
- else if (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_IS_SPELL_CAPITALIZATION ) ))
- {
- pbVal = &bIsSpellCapitalization;
- pbResVal = &bResIsSpellCapitalization;
- }
-
- if (pbVal && pbResVal)
- {
- GetPropSet()->getPropertyValue( pPropName[i] ) >>= *pbVal;
- *pbResVal = *pbVal;
- }
- }
- }
-}
-
-
-BOOL PropertyHelper_Spell::propertyChange_Impl( const PropertyChangeEvent& rEvt )
-{
- BOOL bRes = PropertyChgHelper::propertyChange_Impl( rEvt );
-
- if (!bRes && GetPropSet().is() && rEvt.Source == GetPropSet())
- {
- INT16 nLngSvcFlags = 0;
- BOOL bSCWA = FALSE, // SPELL_CORRECT_WORDS_AGAIN ?
- bSWWA = FALSE; // SPELL_WRONG_WORDS_AGAIN ?
-
- BOOL *pbVal = NULL;
- switch (rEvt.PropertyHandle)
- {
- case UPH_IS_SPELL_UPPER_CASE :
- {
- pbVal = &bIsSpellUpperCase;
- bSCWA = FALSE == *pbVal; // FALSE->TRUE change?
- bSWWA = !bSCWA; // TRUE->FALSE change?
- break;
- }
- case UPH_IS_SPELL_WITH_DIGITS :
- {
- pbVal = &bIsSpellWithDigits;
- bSCWA = FALSE == *pbVal; // FALSE->TRUE change?
- bSWWA = !bSCWA; // TRUE->FALSE change?
- break;
- }
- case UPH_IS_SPELL_CAPITALIZATION :
- {
- pbVal = &bIsSpellCapitalization;
- bSCWA = FALSE == *pbVal; // FALSE->TRUE change?
- bSWWA = !bSCWA; // TRUE->FALSE change?
- break;
- }
- default:
- DBG_ASSERT( 0, "unknown property" );
- }
- if (pbVal)
- rEvt.NewValue >>= *pbVal;
-
- bRes = (pbVal != 0);
- if (bRes)
- {
- if (bSCWA)
- nLngSvcFlags |= LinguServiceEventFlags::SPELL_CORRECT_WORDS_AGAIN;
- if (bSWWA)
- nLngSvcFlags |= LinguServiceEventFlags::SPELL_WRONG_WORDS_AGAIN;
- if (nLngSvcFlags)
- {
- LinguServiceEvent aEvt( GetEvtObj(), nLngSvcFlags );
- LaunchEvent( aEvt );
- }
- }
- }
-
- return bRes;
-}
-
-
-void SAL_CALL
- PropertyHelper_Spell::propertyChange( const PropertyChangeEvent& rEvt )
- throw(RuntimeException)
-{
- MutexGuard aGuard( GetLinguMutex() );
- propertyChange_Impl( rEvt );
-}
-
-
-void PropertyHelper_Spell::SetTmpPropVals( const PropertyValues &rPropVals )
-{
- PropertyChgHelper::SetTmpPropVals( rPropVals );
-
- // return value is default value unless there is an explicitly supplied
- // temporary value
- nResMaxNumberOfSuggestions = GetDefaultNumberOfSuggestions();
- bResIsSpellWithDigits = bIsSpellWithDigits;
- bResIsSpellCapitalization = bIsSpellCapitalization;
- //
- INT32 nLen = rPropVals.getLength();
- if (nLen)
- {
- const PropertyValue *pVal = rPropVals.getConstArray();
- for (INT32 i = 0; i < nLen; ++i)
- {
- if (pVal[i].Name.equalsAscii( UPN_MAX_NUMBER_OF_SUGGESTIONS ))
- {
- pVal[i].Value >>= nResMaxNumberOfSuggestions;
- }
- else
- {
- BOOL *pbResVal = NULL;
- switch (pVal[i].Handle)
- {
- case UPH_IS_SPELL_UPPER_CASE : pbResVal = &bResIsSpellUpperCase; break;
- case UPH_IS_SPELL_WITH_DIGITS : pbResVal = &bResIsSpellWithDigits; break;
- case UPH_IS_SPELL_CAPITALIZATION : pbResVal = &bResIsSpellCapitalization; break;
- default:
- DBG_ASSERT( 0, "unknown property" );
- }
- if (pbResVal)
- pVal[i].Value >>= *pbResVal;
- }
- }
- }
-}
-
-INT16 PropertyHelper_Spell::GetDefaultNumberOfSuggestions() const
-{
- return 16;
-}
-
-///////////////////////////////////////////////////////////////////////////
-
-static const char *aHP[] =
-{
- UPN_HYPH_MIN_LEADING,
- UPN_HYPH_MIN_TRAILING,
- UPN_HYPH_MIN_WORD_LENGTH
-};
-
-
-PropertyHelper_Hyph::PropertyHelper_Hyph(
- const Reference< XInterface > & rxSource,
- Reference< XPropertySet > &rxPropSet ) :
- PropertyChgHelper ( rxSource, rxPropSet, AE_HYPHENATOR )
-{
- AddPropNames( aHP, sizeof(aHP) / sizeof(aHP[0]) );
- SetDefaultValues();
- GetCurrentValues();
-}
-
-
-PropertyHelper_Hyph::~PropertyHelper_Hyph()
-{
-}
-
-
-void PropertyHelper_Hyph::SetDefaultValues()
-{
- PropertyChgHelper::SetDefaultValues();
-
- nResHyphMinLeading = nHyphMinLeading = 2;
- nResHyphMinTrailing = nHyphMinTrailing = 2;
- nResHyphMinWordLength = nHyphMinWordLength = 0;
-}
-
-
-void PropertyHelper_Hyph::GetCurrentValues()
-{
- PropertyChgHelper::GetCurrentValues();
-
- INT32 nLen = GetPropNames().getLength();
- if (GetPropSet().is() && nLen)
- {
- const OUString *pPropName = GetPropNames().getConstArray();
- for (INT32 i = 0; i < nLen; ++i)
- {
- INT16 *pnVal = NULL,
- *pnResVal = NULL;
-
- if (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_HYPH_MIN_LEADING ) ))
- {
- pnVal = &nHyphMinLeading;
- pnResVal = &nResHyphMinLeading;
- }
- else if (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_HYPH_MIN_TRAILING ) ))
- {
- pnVal = &nHyphMinTrailing;
- pnResVal = &nResHyphMinTrailing;
- }
- else if (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_HYPH_MIN_WORD_LENGTH ) ))
- {
- pnVal = &nHyphMinWordLength;
- pnResVal = &nResHyphMinWordLength;
- }
-
- if (pnVal && pnResVal)
- {
- GetPropSet()->getPropertyValue( pPropName[i] ) >>= *pnVal;
- *pnResVal = *pnVal;
- }
- }
- }
-}
-
-
-BOOL PropertyHelper_Hyph::propertyChange_Impl( const PropertyChangeEvent& rEvt )
-{
- BOOL bRes = PropertyChgHelper::propertyChange_Impl( rEvt );
-
- if (!bRes && GetPropSet().is() && rEvt.Source == GetPropSet())
- {
- INT16 nLngSvcFlags = LinguServiceEventFlags::HYPHENATE_AGAIN;
-
- INT16 *pnVal = NULL;
- switch (rEvt.PropertyHandle)
- {
- case UPH_HYPH_MIN_LEADING : pnVal = &nHyphMinLeading; break;
- case UPH_HYPH_MIN_TRAILING : pnVal = &nHyphMinTrailing; break;
- case UPH_HYPH_MIN_WORD_LENGTH : pnVal = &nHyphMinWordLength; break;
- default:
- DBG_ASSERT( 0, "unknown property" );
- }
- if (pnVal)
- rEvt.NewValue >>= *pnVal;
-
- bRes = (pnVal != 0);
- if (bRes)
- {
- if (nLngSvcFlags)
- {
- LinguServiceEvent aEvt( GetEvtObj(), nLngSvcFlags );
- LaunchEvent( aEvt );
- }
- }
- }
-
- return bRes;
-}
-
-
-void SAL_CALL
- PropertyHelper_Hyph::propertyChange( const PropertyChangeEvent& rEvt )
- throw(RuntimeException)
-{
- MutexGuard aGuard( GetLinguMutex() );
- propertyChange_Impl( rEvt );
-}
-
-
-void PropertyHelper_Hyph::SetTmpPropVals( const PropertyValues &rPropVals )
-{
- PropertyChgHelper::SetTmpPropVals( rPropVals );
-
- // return value is default value unless there is an explicitly supplied
- // temporary value
- nResHyphMinLeading = nHyphMinLeading;
- nResHyphMinTrailing = nHyphMinTrailing;
- nResHyphMinWordLength = nHyphMinWordLength;
- //
- INT32 nLen = rPropVals.getLength();
- if (nLen)
- {
- const PropertyValue *pVal = rPropVals.getConstArray();
- for (INT32 i = 0; i < nLen; ++i)
- {
- INT16 *pnResVal = NULL;
- switch (pVal[i].Handle)
- {
- case UPH_HYPH_MIN_LEADING : pnResVal = &nResHyphMinLeading; break;
- case UPH_HYPH_MIN_TRAILING : pnResVal = &nResHyphMinTrailing; break;
- case UPH_HYPH_MIN_WORD_LENGTH : pnResVal = &nResHyphMinWordLength; break;
- default:
- DBG_ASSERT( 0, "unknown property" );
- }
- if (pnResVal)
- pVal[i].Value >>= *pnResVal;
- }
- }
-}
-
-///////////////////////////////////////////////////////////////////////////
-
-} // namespace linguistic
-
diff --git a/linguistic/source/spelldsp.cxx b/linguistic/source/spelldsp.cxx
index 3f84fe0..e88a509 100644
--- a/linguistic/source/spelldsp.cxx
+++ b/linguistic/source/spelldsp.cxx
@@ -30,30 +30,25 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_linguistic.hxx"
+
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/linguistic2/XSearchableDictionaryList.hpp>
-
#include <com/sun/star/linguistic2/SpellFailure.hpp>
-#include <cppuhelper/factory.hxx> // helper for factories
#include <com/sun/star/registry/XRegistryKey.hpp>
+
+#include <cppuhelper/factory.hxx> // helper for factories
#include <unotools/localedatawrapper.hxx>
+#include <unotools/processfactory.hxx>
#include <tools/debug.hxx>
#include <svtools/lngmisc.hxx>
-#include <unotools/processfactory.hxx>
+#include <osl/mutex.hxx>
#include <vector>
-#ifndef _SPELLIMP_HXX
-#include <spelldsp.hxx>
-#endif
-#ifndef _LNGPROPS_HXX
-#include <lngprops.hxx>
-#endif
-
#include "spelldsp.hxx"
#include "spelldta.hxx"
#include "lngsvcmgr.hxx"
-#include <osl/mutex.hxx>
+#include "lngprops.hxx"
using namespace utl;
@@ -90,6 +85,7 @@ public:
//size_t Size() const { return aVec.size(); }
size_t Count() const;
+ void Prepend( const OUString &rText );
void Append( const OUString &rNew );
void Append( const std::vector< OUString > &rNew );
void Append( const Sequence< OUString > &rNew );
@@ -110,6 +106,12 @@ BOOL ProposalList::HasEntry( const OUString &rText ) const
return bFound;
}
+void ProposalList::Prepend( const OUString &rText )
+{
+ if (!HasEntry( rText ))
+ aVec.insert( aVec.begin(), rText );
+}
+
void ProposalList::Append( const OUString &rText )
{
if (!HasEntry( rText ))
@@ -279,6 +281,40 @@ Reference< XSpellAlternatives > SAL_CALL
}
+// returns the overall result of cross-checking with all user-dictionaries
+// including the IgnoreAll list
+static Reference< XDictionaryEntry > lcl_GetRulingDictionaryEntry(
+ const OUString &rWord,
+ LanguageType nLanguage )
+{
+ Reference< XDictionaryEntry > xRes;
+
+ // the order of winning from top to bottom is:
+ // 1) IgnoreAll list will always win
+ // 2) Negative dictionaries will win over positive dictionaries
+ Reference< XDictionary > xIgnoreAll( GetIgnoreAllList() );
+ if (xIgnoreAll.is())
+ xRes = xIgnoreAll->getEntry( rWord );
+ if (!xRes.is())
+ {
+ Reference< XDictionaryList > xDList( GetDictionaryList() );
+ Reference< XDictionaryEntry > xNegEntry( SearchDicList( xDList,
+ rWord, nLanguage, FALSE, TRUE ) );
+ if (xNegEntry.is())
+ xRes = xNegEntry;
+ else
+ {
+ Reference< XDictionaryEntry > xPosEntry( SearchDicList( xDList,
+ rWord, nLanguage, TRUE, TRUE ) );
+ if (xPosEntry.is())
+ xRes = xPosEntry;
+ }
+ }
+
+ return xRes;
+}
+
+
BOOL SpellCheckerDispatcher::isValid_Impl(
const OUString& rWord,
LanguageType nLanguage,
@@ -432,22 +468,13 @@ BOOL SpellCheckerDispatcher::isValid_Impl(
}
}
- // countercheck against results from dictionary which have precedence!
+ // cross-check against results from dictionaries which have precedence!
if (bCheckDics &&
GetDicList().is() && IsUseDicList( rProperties, GetPropSet() ))
{
- Reference< XDictionaryList > xDList( GetDicList(), UNO_QUERY );
- Reference< XDictionaryEntry > xPosEntry( SearchDicList( xDList,
- aChkWord, nLanguage, TRUE, TRUE ) );
- if (xPosEntry.is())
- bRes = TRUE;
- else
- {
- Reference< XDictionaryEntry > xNegEntry( SearchDicList( xDList,
- aChkWord, nLanguage, FALSE, TRUE ) );
- if (xNegEntry.is())
- bRes = FALSE;
- }
+ Reference< XDictionaryEntry > xTmp( lcl_GetRulingDictionaryEntry( aChkWord, nLanguage ) );
+ if (xTmp.is())
+ bRes = !xTmp->isNegative();
}
}
@@ -505,8 +532,8 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl(
// try already instantiated services first
{
- const Reference< XSpellChecker > *pRef =
- pEntry->aSvcRefs.getConstArray();
+ const Reference< XSpellChecker > *pRef = pEntry->aSvcRefs.getConstArray();
+ sal_Int32 nNumSugestions = -1;
while (i <= pEntry->nLastTriedSvcIndex
&& (!bTmpResValid || xTmpRes.is()) )
{
@@ -530,9 +557,24 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl(
else
bTmpResValid = FALSE;
- // remember first found alternatives only
+ // return first found result if the word is not known by any checker.
+ // But if that result has no suggestions use the first one that does
+ // provide suggestions for the misspelled word.
if (!xRes.is() && bTmpResValid)
+ {
xRes = xTmpRes;
+ nNumSugestions = 0;
+ if (xRes.is())
+ nNumSugestions = xRes->getAlternatives().getLength();
+ }
+ sal_Int32 nTmpNumSugestions = 0;
+ if (xTmpRes.is() && bTmpResValid)
+ nTmpNumSugestions = xTmpRes->getAlternatives().getLength();
+ if (xRes.is() && nNumSugestions == 0 && nTmpNumSugestions > 0)
+ {
+ xRes = xTmpRes;
+ nNumSugestions = nTmpNumSugestions;
+ }
++i;
}
@@ -555,6 +597,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl(
//! thus the service needs not to now about it
//aArgs.getArray()[1] <<= GetDicList();
+ sal_Int32 nNumSugestions = -1;
while (i < nLen && (!bTmpResValid || xTmpRes.is()))
{
// create specific service via it's implementation name
@@ -596,9 +639,24 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl(
else
bTmpResValid = FALSE;
- // remember first found alternatives only
+ // return first found result if the word is not known by any checker.
+ // But if that result has no suggestions use the first one that does
+ // provide suggestions for the misspelled word.
if (!xRes.is() && bTmpResValid)
+ {
+ xRes = xTmpRes;
+ nNumSugestions = 0;
+ if (xRes.is())
+ nNumSugestions = xRes->getAlternatives().getLength();
+ }
+ sal_Int32 nTmpNumSugestions = 0;
+ if (xTmpRes.is() && bTmpResValid)
+ nTmpNumSugestions = xTmpRes->getAlternatives().getLength();
+ if (xRes.is() && nNumSugestions == 0 && nTmpNumSugestions > 0)
+ {
xRes = xTmpRes;
+ nNumSugestions = nTmpNumSugestions;
+ }
pEntry->nLastTriedSvcIndex = (INT16) i;
++i;
@@ -634,42 +692,31 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl(
if (GetDicList().is() && IsUseDicList( rProperties, GetPropSet() ))
xDList = Reference< XDictionaryList >( GetDicList(), UNO_QUERY );
- // countercheck against results from dictionary which have precedence!
+ // cross-check against results from user-dictionaries which have precedence!
if (bCheckDics && xDList.is())
{
- Reference< XDictionaryEntry > xPosEntry( SearchDicList( xDList,
- aChkWord, nLanguage, TRUE, TRUE ) );
-
- if (xPosEntry.is())
+ Reference< XDictionaryEntry > xTmp( lcl_GetRulingDictionaryEntry( aChkWord, nLanguage ) );
+ if (xTmp.is())
{
- xRes = NULL; // positive dictionaries have precedence over negative ones
- eFailureType = -1; // no failure
- }
- else
- {
- Reference< XDictionaryEntry > xNegEntry( SearchDicList( xDList,
- aChkWord, nLanguage, FALSE, TRUE ) );
- if (xNegEntry.is())
+ if (xTmp->isNegative()) // positive entry found
{
eFailureType = SpellFailure::IS_NEGATIVE_WORD;
// replacement text to be added to suggestions, if not empty
- OUString aAddRplcTxt( xNegEntry->getReplacementText() );
+ OUString aAddRplcTxt( xTmp->getReplacementText() );
// replacement text must not be in negative dictionary itself
if (aAddRplcTxt.getLength() &&
!SearchDicList( xDList, aAddRplcTxt, nLanguage, FALSE, TRUE ).is())
{
- aProposalList.Append( aAddRplcTxt );
-// // add suggestion if not already part of proposals
-// if (!SeqHasEntry( aProposals, aAddRplcTxt))
-// {
-// INT32 nLen = aProposals.getLength();
-// aProposals.realloc( nLen + 1);
-// aProposals.getArray()[ nLen ] = aAddRplcTxt;
-// }
+ aProposalList.Prepend( aAddRplcTxt );
}
- }
+ }
+ else // positive entry found
+ {
+ xRes = NULL;
+ eFailureType = -1; // no failure
+ }
}
}
@@ -683,6 +730,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl(
Sequence< OUString > aProposals = aProposalList.GetSequence();
// remove entries listed in negative dictionaries
+ // (we don't want to display suggestions that will be regarded as misspelledlater on)
if (bCheckDics && xDList.is())
SeqRemoveNegEntries( aProposals, xDList, nLanguage );
@@ -693,7 +741,19 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl(
xSetAlt->setFailureType( eFailureType );
}
else
- DBG_ASSERT( 0, "XSetSpellAlternatives not implemented!" );
+ {
+ if (xRes.is())
+ {
+ DBG_ASSERT( 0, "XSetSpellAlternatives not implemented!" );
+ }
+ else if (aProposals.getLength() > 0)
+ {
+ // no xRes but Proposals found from the user-dictionaries.
+ // Thus we need to create an xRes...
+ xRes = new linguistic::SpellAlternatives( rWord, nLanguage,
+ SpellFailure::IS_NEGATIVE_WORD, aProposals );
+ }
+ }
}
}
diff --git a/linguistic/source/spelldta.cxx b/linguistic/source/spelldta.cxx
index f4e9889..5004e84 100644
--- a/linguistic/source/spelldta.cxx
+++ b/linguistic/source/spelldta.cxx
@@ -151,8 +151,8 @@ void SearchSimilarText( const OUString &rText, INT16 nLanguage,
{
#if OSL_DEBUG_LEVEL > 1
DictionaryType eType = xDic->getDictionaryType();
- DBG_ASSERT( eType != DictionaryType_MIXED,
- "unexpected dictionary type" );
+ (void) eType;
+ DBG_ASSERT( eType != DictionaryType_MIXED, "unexpected dictionary type" );
#endif
const Sequence< Reference< XDictionaryEntry > > aEntries = xDic->getEntries();
const Reference< XDictionaryEntry > *pEntries = aEntries.getConstArray();
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu
index dc5d6c9..e69558f 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu
@@ -156,7 +156,7 @@
</node>
<node oor:name=".uno:ToolBox" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Selection</value>
+ <value xml:lang="en-US">Formula Elements</value>
</prop>
</node>
<node oor:name=".uno:FormelCursor" oor:op="replace">
diff --git a/officecfg/registry/schema/org/openoffice/Office/Math.xcs b/officecfg/registry/schema/org/openoffice/Office/Math.xcs
index 88a7ff4..d0d8ad0 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Math.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Math.xcs
@@ -354,7 +354,7 @@
<prop oor:name="ToolboxVisible" oor:type="xs:boolean">
<!-- OldPath: Math/View -->
<!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: View - Selection -->
+ <!-- UIHints: View - Formula Elements -->
<info>
<author>TL</author>
<desc>Toggles the visibility of the ToolBox (Selection Box).</desc>
diff --git a/svx/source/cui/optgdlg.cxx b/svx/source/cui/optgdlg.cxx
index 7b4bb28..b4a642e 100644
--- a/svx/source/cui/optgdlg.cxx
+++ b/svx/source/cui/optgdlg.cxx
@@ -1283,7 +1283,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage( Window* pParent, const SfxItemSet& rSe
String aStr_( pCurr->GetBankSymbol() );
aStr_ += aTwoSpace;
aStr_ += pCurr->GetSymbol();
- aStr = ApplyLreOrRleEmbedding( aStr_ );
+ aStr_ = ApplyLreOrRleEmbedding( aStr_ );
aStr_ += aTwoSpace;
aStr_ += ApplyLreOrRleEmbedding( pLanguageTable->GetString( pCurr->GetLanguage() ) );
USHORT nPos = aCurrencyLB.InsertEntry( aStr_ );
diff --git a/svx/source/editeng/edtspell.cxx b/svx/source/editeng/edtspell.cxx
index 25ba541..cad0602 100644
--- a/svx/source/editeng/edtspell.cxx
+++ b/svx/source/editeng/edtspell.cxx
@@ -291,8 +291,9 @@ void WrongList::TextDeleted( sal_uInt16 nPos, sal_uInt16 nDeleted )
sal_uInt16 nEndChanges = nPos+nDeleted;
if ( !IsInvalid() )
{
- nInvalidStart = nPos;
- nInvalidEnd = nPos+1; // Nicht nDeleted, weil da ja wegfaellt.
+ sal_uInt16 nNewInvalidStart = nPos ? nPos - 1 : 0;
+ nInvalidStart = nNewInvalidStart;
+ nInvalidEnd = nNewInvalidStart + 1;
}
else
{
diff --git a/svx/source/outliner/outliner.cxx b/svx/source/outliner/outliner.cxx
index 7a298c4..66aa954 100644
--- a/svx/source/outliner/outliner.cxx
+++ b/svx/source/outliner/outliner.cxx
@@ -1523,11 +1523,11 @@ void Outliner::ImplCheckParagraphs( USHORT nStart, USHORT nEnd )
// <--
{
Paragraph* pPara = pParaList->GetParagraph( n );
- if (pPara)
- {
- pPara->Invalidate();
- ImplCalcBulletText( n, FALSE, FALSE );
- }
+ if (pPara)
+ {
+ pPara->Invalidate();
+ ImplCalcBulletText( static_cast< USHORT >(n), FALSE, FALSE );
+ }
}
}
diff --git a/xmloff/inc/xmloff/xmlexp.hxx b/xmloff/inc/xmloff/xmlexp.hxx
index 9d62b7c..935537b 100644
--- a/xmloff/inc/xmloff/xmlexp.hxx
+++ b/xmloff/inc/xmloff/xmlexp.hxx
@@ -197,6 +197,9 @@ protected:
// Get (modifyable) namespace map
SvXMLNamespaceMap& _GetNamespaceMap() { return *mpNamespaceMap; }
+ // get a new namespave map (used in starmath to have a default namespace)
+ void ResetNamespaceMap();
+
// This method can be overloaded to export the content of <office:meta>.
// There is a default implementation.
virtual void _ExportMeta();
diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx
index 9a3f785..14ccf7a 100644
--- a/xmloff/inc/xmloff/xmltoken.hxx
+++ b/xmloff/inc/xmloff/xmltoken.hxx
@@ -3072,6 +3072,12 @@ namespace xmloff { namespace token {
XML_AT_AXIS,
XML_AT_LABELS_AND_AXIS,
+ // MathML only
+ XML_MATHVARIANT,
+ XML_MATHSIZE,
+ XML_MATHWEIGHT,
+ XML_MATHCOLOR,
+
XML_TOKEN_END
};
diff --git a/xmloff/source/core/nmspmap.cxx b/xmloff/source/core/nmspmap.cxx
index c09d8a3..e33a2ae 100644
--- a/xmloff/source/core/nmspmap.cxx
+++ b/xmloff/source/core/nmspmap.cxx
@@ -199,8 +199,12 @@ OUString SvXMLNamespaceMap::GetAttrNameByKey( sal_uInt16 nKey ) const
if (aIter != aNameMap.end())
{
sAttrName.append( sXMLNS );
- sAttrName.append( sal_Unicode(':') );
- sAttrName.append( (*aIter).second->sPrefix);
+ const ::rtl::OUString & prefix( (*aIter).second->sPrefix );
+ if (prefix.getLength()) // not default namespace
+ {
+ sAttrName.append( sal_Unicode(':') );
+ sAttrName.append( prefix );
+ }
}
return sAttrName.makeStringAndClear();
}
@@ -225,8 +229,11 @@ OUString SvXMLNamespaceMap::GetQNameByKey( sal_uInt16 nKey,
// don't bother caching this, it rarely happens
OUStringBuffer sQName;
sQName.append ( sXMLNS );
- sQName.append ( sal_Unicode(':') );
- sQName.append ( rLocalName );
+ if (rLocalName.getLength()) // not default namespace
+ {
+ sQName.append ( sal_Unicode(':') );
+ sQName.append ( rLocalName );
+ }
return sQName.makeStringAndClear();;
}
case XML_NAMESPACE_XML:
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 8068012..589572c 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -1393,6 +1393,10 @@ sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass )
return 0;
}
+void SvXMLExport::ResetNamespaceMap()
+{
+ delete mpNamespaceMap; mpNamespaceMap = new SvXMLNamespaceMap;
+}
void SvXMLExport::_ExportMeta()
{
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 7c53c83..fdb378f 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -3074,6 +3074,11 @@ namespace xmloff { namespace token {
TOKEN( "at-axis", XML_AT_AXIS ),
TOKEN( "at-labels-and-axis", XML_AT_LABELS_AND_AXIS ),
+ TOKEN( "mathvariant", XML_MATHVARIANT ),
+ TOKEN( "mathsize", XML_MATHSIZE ),
+ TOKEN( "mathweight", XML_MATHWEIGHT ),
+ TOKEN( "mathcolor", XML_MATHCOLOR ),
+
#if OSL_DEBUG_LEVEL > 0
{ 0, NULL, NULL, XML_TOKEN_END }
#else
commit 00bded81da15fe9f555fba90a0a5f7731f8f4108
Author: Jens-Heiner Rechtien <hr at openoffice.org>
Date: Mon May 18 16:46:40 2009 +0000
CWS-TOOLING: integrate CWS koheichart01
2009-05-15 06:32:38 +0200 hde r271925 : header fixed
2009-04-14 16:23:35 +0200 hde r270792 : #100231#
2009-04-14 16:13:48 +0200 hde r270790 : #100231#
2009-04-14 15:56:14 +0200 hde r270787 : #100231#
2009-04-14 14:28:40 +0200 hde r270767 : #100231#
2009-04-14 14:27:30 +0200 hde r270766 : #100231#
2009-04-14 09:43:07 +0200 hde r270749 : #100231#
2009-04-14 09:25:52 +0200 hde r270748 : #100231#
2009-03-25 16:18:26 +0100 iha r270034 : #i91578# removed compiler warning
2009-03-25 03:20:36 +0100 kohei r269992 : fixed a silly typo in in-line comment.
2009-03-24 17:03:57 +0100 kohei r269977 : Let's use row and column's hidden flags, instead of width/height, to determine cell's
hidden state.
2009-03-24 16:53:10 +0100 kohei r269973 : The chart positioner no longer needs to skip hidden cells, as hidden cells are handled
elsewhere.
2009-03-24 16:50:12 +0100 kohei r269971 : the index should be 0-based (although chart2 doesn't appear to make use of this data any more).
2009-03-24 16:47:56 +0100 kohei r269969 : Skip hidden cells during cache (re-)build, when the include hidden cells flag is
false. Also avoid adding data cache when the cell is hidden.
2009-03-24 06:05:53 +0100 kohei r269909 : fixed the build breakage after the resync.
2009-03-24 06:05:34 +0100 kohei r269908 : fixed the build breakage after the resync.
2009-03-23 23:38:36 +0100 kohei r269900 : CWS-TOOLING: rebase CWS koheichart01 to trunk at 269781 (milestone: DEV300:m44)
2009-03-17 13:11:40 +0100 iha r269597 : #i91578# import IncludeHiddenCells from xlsx
2009-03-17 12:56:09 +0100 iha r269594 : #i91578# import IncludeHiddenCells from xls correctly
2009-03-17 12:49:13 +0100 iha r269592 : #i91578# import IncludeHiddenCells from xls correctly
2009-03-16 17:03:55 +0100 iha r269561 : #i91578# remove unused variable
2009-03-16 10:22:30 +0100 iha r269509 : #i91578# changed wording
2009-03-04 17:07:16 +0100 iha r268846 : #i91578# display of hidden cells - remove unused property 'IsHidden'
2009-03-04 17:04:22 +0100 iha r268845 : #i91578# display of hidden cells - remove unused property 'IsHidden'
2009-03-04 17:03:43 +0100 iha r268844 : #i91578# display of hidden cells - remove unused property 'IsHidden'
2009-03-04 16:24:30 +0100 iha r268843 : #i91578# display of hidden cells - added missing property description
2009-03-04 15:13:04 +0100 iha r268835 : #i91578# display of hidden cells - remove unused code
2009-03-04 14:38:44 +0100 iha r268832 : #i91578# display of hidden cells - reset state corretly when doing undo/redo
2009-03-04 13:42:10 +0100 iha r268822 : #i81209# #i91578# display of hidden cells - don't show hidden cells per default but keep the hidden ranges
2009-03-04 13:40:10 +0100 iha r268821 : #i81209# #i91578# display of hidden cells - don't show hidden cells per default but keep the hidden ranges
2009-03-04 13:37:05 +0100 iha r268820 : #i81209# #i91578# display of hidden cells - don't show hidden cells per default but keep the hidden ranges
2009-03-03 11:18:39 +0100 iha r268713 : #i91578# display of hidden cells - hide control if the functionality is not offered by the data provider
2009-03-02 17:41:37 +0100 kohei r268684 : removed unintended change from DEV300_m38, which was probably introduced due to some sort of
problem during rebase.
2009-02-27 18:51:34 +0100 iha r268613 : #i91578# display of hidden cells - interface redesign: data provider+sequences are now controlled by the chart via a new parameter 'IncludeHiddenCells' thus unwanted values can be removed early in the communication
2009-02-27 18:45:48 +0100 iha r268612 : #i91578# display of hidden cells - interface redesign: data provider+sequences are now controlled by the chart via a new parameter 'IncludeHiddenCells' thus unwanted values can be removed early in the communication
2009-02-27 18:44:17 +0100 iha r268611 : #i91578# display of hidden cells - interface redesign: data provider+sequences are now controlled by the chart via a new parameter 'IncludeHiddenCells' thus unwanted values can be removed early in the communication
2009-02-27 18:35:09 +0100 iha r268610 : #i91578# display of hidden cells - copy-paste-scenario: export hidden flag per column on copy for migration to locale table during import upon paste
2009-02-19 06:47:56 +0100 kohei r268257 : also, set the default value of a cached cell to NaN just in case.
2009-02-19 06:42:08 +0100 kohei r268256 : Set the IsValue flag to false by default so that an empty cell is properly flaged as non-value.
This fixes the broken missing value treatment.
2009-02-18 20:16:30 +0100 iha r268255 : #i91578# display of hidden cells - radio button 'leave gap' was not clickable anymore
2009-02-17 17:57:24 +0100 iha r268185 : #i91578# display of hidden cells - corrected range highlighting
2009-02-17 15:39:52 +0100 iha r268174 : #i91578# display of hidden cells - still display data point value in tip help of data points in writer
2009-02-17 11:21:00 +0100 iha r267861 : #i91578# display of hidden cells - do not show a space nor a legend entry for hidden series
2009-02-17 11:15:14 +0100 iha r267853 : #i91578# display of hidden cells - do not show a space nor a legend entry for hidden series
2009-02-16 16:48:10 +0100 iha r267826 : #i91578# display of hidden cells - group related ids and minimize changes
2009-02-16 14:32:11 +0100 iha r267813 : #i91578# display of hidden cells - don't share resource identifier as this easily produces conflicts -> move IDs for series options page into a separate file
2009-02-16 13:21:44 +0100 iha r267795 : #i91578# display of hidden cells - remove unused member
2009-02-16 13:13:40 +0100 iha r267794 : #i91578# display of hidden cells - remove unused methods
2009-02-16 13:00:10 +0100 iha r267792 : #i91578# display of hidden - avoid unnecessary data copy
2009-02-16 11:40:41 +0100 iha r267785 : #i91578# display of hidden - corrected typo
2009-02-16 11:28:39 +0100 iha r267783 : #i91578# display of hidden - set correct dirty state in method setIncludeHiddenCells
2009-02-13 17:04:50 +0100 iha r267734 : #i91578# corrected position and visibility of the controls for display of hidden cells in case of stock charts
2009-02-13 15:30:17 +0100 iha r267724 : #i91578# charts without category range and charts with data from writer table were broken causes by features changes for display of hidden cells
2009-01-14 19:47:28 +0100 kohei r266330 : #i91578# Fixed the issue with incorrect tooltip category values.
2009-01-05 22:27:03 +0100 kohei r265887 : fixed a regression where the x-axis failed to display values when they were numeric or dates.
2008-12-24 17:01:15 +0100 kohei r265800 : CWS-TOOLING: rebase CWS koheichart01 to trunk at 265758 (milestone: DEV300:m38)
2008-12-24 16:03:08 +0100 kohei r265799 : a little more code cleanup, mostly on tab to whitespace conversion on
modified lines and removal of unnecessary 'using' statements.
2008-12-24 15:52:00 +0100 kohei r265798 : removed unnecessary header inclusion & remove hidden data *only when* the 'include hidden cells'
options it false! I'm glad I caught this.
2008-12-24 07:41:23 +0100 kohei r265796 : replaced duplicated local functions with a single template function.
2008-12-24 06:37:15 +0100 kohei r265795 : reverted my last commit, because it was not the right approach.
Instead of using the original data point index in the object name,
leave that index alone, and remove hidden data in the tooltip text
value lookup code.
2008-12-23 23:10:42 +0100 kohei r265793 : fixed the tooltips so that they would display correct values, taking into account
the hidden data points (if any).
2008-12-20 05:26:07 +0100 kohei r265739 : CWS-TOOLING: rebase CWS koheichart01 to trunk at 264807 (milestone: DEV300:m37)
2008-12-18 15:49:59 +0100 kohei r265696 : removed markRangeDirty() for now, since that method is still a bit controvertial per Niklas's comment in i#91578.
2008-12-05 20:27:24 +0100 kohei r264918 : removed a compiler warning.
2008-12-05 20:24:02 +0100 kohei r264917 : removed a compilar warning.
2008-12-03 17:06:22 +0100 kohei r264800 : recovered the original keyword file before it was stripped.
2008-12-01 22:00:24 +0100 kohei r264640 : by default, "include hidden cells" attribute is true.
2008-12-01 19:03:07 +0100 kohei r264628 : added accelerator for the plot hidden values check box.
2008-12-01 18:32:02 +0100 kohei r264626 : changed wording per Ingrid's suggestion.
2008-11-26 08:09:36 +0100 kohei r264341 : the 'Starnding angle' fixed line was 6 pixel short.
2008-11-26 08:02:47 +0100 kohei r264340 : added include-hidden-cells check box for the pie chart type too & some code cleanup.
2008-11-26 07:41:45 +0100 kohei r264339 : relocate the controls correctly for line chart types.
2008-11-26 07:14:26 +0100 kohei r264337 : #i95714# fixed typos that caused incorrect scaling of the y-axis under some conditions.
2008-11-26 07:11:54 +0100 kohei r264336 : added "Include hidden cells" check box in the data series options tab page.
2008-11-25 21:04:58 +0100 kohei r264333 : don't check for the number of charts; when importing from xls, the count may be
zero even when the document has charts.
2008-11-25 19:55:50 +0100 kohei r264332 : patch from ooo-build applied. This implements chart listener
that listens on cells show/hide state for the chart's data areas.
2008-11-25 19:52:38 +0100 kohei r264331 : patch from ooo-build applied.
2008-11-25 19:29:54 +0100 kohei r264329 : new xml token for include-hidden-cells attribute.
diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx
index 1ed5b0f..9a3f785 100644
--- a/xmloff/inc/xmloff/xmltoken.hxx
+++ b/xmloff/inc/xmloff/xmltoken.hxx
@@ -2967,6 +2967,7 @@ namespace xmloff { namespace token {
XML_PERCENTAGE_DATA_STYLE_NAME,
XML_VALUE_AND_PERCENTAGE,
XML_GROUP_BARS_PER_AXIS,
+ XML_INCLUDE_HIDDEN_CELLS,
XML_AUTOMATIC_POSITION,
XML_AUTOMATIC_SIZE,
XML_REVERSE_DIRECTION,
diff --git a/xmloff/source/chart/PropertyMap.hxx b/xmloff/source/chart/PropertyMap.hxx
index 72a7788..f801d63 100644
--- a/xmloff/source/chart/PropertyMap.hxx
+++ b/xmloff/source/chart/PropertyMap.hxx
@@ -139,6 +139,7 @@ const XMLPropertyMapEntry aXMLChartPropMap[] =
MAP_ENTRY( "StackedBarsConnected", CHART, XML_CONNECT_BARS, XML_TYPE_BOOL ),
MAP_ENTRY_ODF12( "GroupBarsPerAxis", CHART, XML_GROUP_BARS_PER_AXIS, XML_TYPE_BOOL ),
+ MAP_ENTRY_ODF12( "IncludeHiddenCells", CHART, XML_INCLUDE_HIDDEN_CELLS, XML_TYPE_BOOL ),
MAP_ENTRY_ODF12( "AutomaticPosition", CHART, XML_AUTOMATIC_POSITION, XML_TYPE_BOOL ),
MAP_ENTRY_ODF12( "AutomaticSize", CHART, XML_AUTOMATIC_SIZE, XML_TYPE_BOOL ),
MAP_ENTRY_ODF12( "StartingAngle", CHART, XML_ANGLE_OFFSET, XML_TYPE_NUMBER ),
diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx
index 11b119f..44f1fdf 100644
--- a/xmloff/source/chart/SchXMLChartContext.cxx
+++ b/xmloff/source/chart/SchXMLChartContext.cxx
@@ -800,10 +800,8 @@ void SchXMLChartContext::EndElement()
else if( msChartAddress.getLength() )
{
// in this case there are range addresses that are simply wrong.
- bool bOldFileWithOwnDataFromRows =
- (mbHasOwnTable && (meDataRowSource==chart::ChartDataRowSource_ROWS) &&
- SchXMLTools::isDocumentGeneratedWithOpenOfficeOlderThan2_3(
- Reference< frame::XModel >( xNewDoc, uno::UNO_QUERY )));
+ bool bOlderThan2_3 = SchXMLTools::isDocumentGeneratedWithOpenOfficeOlderThan2_3( Reference< frame::XModel >( xNewDoc, uno::UNO_QUERY ));
+ bool bOldFileWithOwnDataFromRows = (bOlderThan2_3 && mbHasOwnTable && (meDataRowSource==chart::ChartDataRowSource_ROWS));
if( mbAllRangeAddressesAvailable && !bSpecialHandlingForDonutChart && !mbIsStockChart &&
!bOldFileWithOwnDataFromRows )
{
@@ -826,6 +824,8 @@ void SchXMLChartContext::EndElement()
// parameters and change the diagram via template mechanism
try
{
+ if( bOlderThan2_3 && xDiaProp.is() )//for older charts the hidden cells were removed by calc on the fly
+ xDiaProp->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IncludeHiddenCells")),uno::makeAny(false));
ChangeDiagramAccordingToTemplate( xNewDoc );
}
catch( uno::Exception & )
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index 9576fc4..251f209 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -552,6 +552,31 @@ double lcl_getValueFromSequence( const Reference< chart2::data::XDataSequence >
return aResult;
}
+bool lcl_SequenceHasUnhiddenData( const uno::Reference< chart2::data::XDataSequence >& xDataSequence )
+{
+ if( !xDataSequence.is() )
+ return false;
+ uno::Reference< beans::XPropertySet > xProp( xDataSequence, uno::UNO_QUERY );
+ if( xProp.is() )
+ {
+ uno::Sequence< sal_Int32 > aHiddenValues;
+ try
+ {
+ xProp->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "HiddenValues" ) ) ) >>= aHiddenValues;
+ if( !aHiddenValues.getLength() )
+ return true;
+ }
+ catch( uno::Exception& e )
+ {
+ (void)e; // avoid warning
+ return true;
+ }
+ }
+ if( xDataSequence->getData().getLength() )
+ return true;
+ return false;
+}
+
struct lcl_TableData
{
typedef ::std::vector< OUString > tStringContainer;
@@ -563,6 +588,8 @@ struct lcl_TableData
tStringContainer aFirstRowRangeRepresentations;
tStringContainer aFirstColumnStrings;
tStringContainer aFirstColumnRangeRepresentations;
+
+ ::std::vector< sal_Int32 > aHiddenColumns;
};
// ::std::bind2nd( ::std::mem_fun_ref( &T::resize ), nSize ) does not work
@@ -739,6 +766,10 @@ lcl_TableData lcl_getDataForLocalTable(
aRange = xRangeConversion->convertRangeToXML( aRange );
}
aResult.aDataRangeRepresentations.push_back( aRange );
+
+ //is column hidden?
+ if( !lcl_SequenceHasUnhiddenData(aIt->first) && !lcl_SequenceHasUnhiddenData(aIt->second) )
+ aResult.aHiddenColumns.push_back(nSeqIdx);
}
return aResult;
@@ -1383,9 +1414,34 @@ void SchXMLExportHelper::exportTable()
}
{
SvXMLElementExport aColumns( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_COLUMNS, sal_True, sal_True );
- mrExport.AddAttribute( XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_REPEATED,
- OUString::valueOf( static_cast< sal_Int64 >( aData.aFirstRowStrings.size())));
- SvXMLElementExport aColumn( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_COLUMN, sal_True, sal_True );
+
+ sal_Int32 nNextIndex = 0;
+ for( size_t nN=0; nN< aData.aHiddenColumns.size(); nN++ )
+ {
+ //i91578 display of hidden values (copy paste scenario; export hidden flag thus it can be used during migration to locale table upon paste )
+ sal_Int32 nHiddenIndex = aData.aHiddenColumns[nN];
+ if( nHiddenIndex > nNextIndex )
+ {
+ sal_Int64 nRepeat = static_cast< sal_Int64 >( nHiddenIndex - nNextIndex );
+ if(nRepeat>1)
+ mrExport.AddAttribute( XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_REPEATED,
+ OUString::valueOf( nRepeat ));
+ SvXMLElementExport aColumn( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_COLUMN, sal_True, sal_True );
+ }
+ mrExport.AddAttribute( XML_NAMESPACE_TABLE, XML_VISIBILITY, GetXMLToken( XML_COLLAPSE ) );
+ SvXMLElementExport aColumn( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_COLUMN, sal_True, sal_True );
+ nNextIndex = nHiddenIndex+1;
+ }
+
+ sal_Int32 nEndIndex = aData.aFirstRowStrings.size()-1;
+ if( nEndIndex >= nNextIndex )
+ {
+ sal_Int64 nRepeat = static_cast< sal_Int64 >( nEndIndex - nNextIndex + 1 );
+ if(nRepeat>1)
+ mrExport.AddAttribute( XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_REPEATED,
+ OUString::valueOf( nRepeat ));
+ SvXMLElementExport aColumn( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_COLUMN, sal_True, sal_True );
+ }
}
// export rows with content
diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx
index 9b530a8..cacdc13 100644
--- a/xmloff/source/chart/SchXMLTableContext.cxx
+++ b/xmloff/source/chart/SchXMLTableContext.cxx
@@ -43,7 +43,10 @@
#include <xmloff/nmspmap.hxx>
#include <xmloff/xmluconv.hxx>
#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
+#include <com/sun/star/chart2/XChartTypeContainer.hpp>
+#include <com/sun/star/chart2/XInternalDataProvider.hpp>
#include <com/sun/star/chart/XChartDataArray.hpp>
#include <com/sun/star/chart/ChartSeriesAddress.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -672,7 +675,8 @@ void SchXMLTableColumnContext::StartElement( const uno::Reference< xml::sax::XAt
{
// get number-columns-repeated attribute
sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
- rtl::OUString aValue;
+ sal_Int32 nRepeated = 1;
+ bool bHidden = false;
for( sal_Int16 i = 0; i < nAttrCount; i++ )
{
@@ -683,19 +687,32 @@ void SchXMLTableColumnContext::StartElement( const uno::Reference< xml::sax::XAt
if( nPrefix == XML_NAMESPACE_TABLE &&
IsXMLToken( aLocalName, XML_NUMBER_COLUMNS_REPEATED ) )
{
- aValue = xAttrList->getValueByIndex( i );
- break; // we only need this attribute
+ rtl::OUString aValue = xAttrList->getValueByIndex( i );
+ if( aValue.getLength())
+ nRepeated = aValue.toInt32();
+ }
+ else if( nPrefix == XML_NAMESPACE_TABLE &&
+ IsXMLToken( aLocalName, XML_VISIBILITY ) )
+ {
+ rtl::OUString aVisibility = xAttrList->getValueByIndex( i );
+ bHidden = aVisibility.equals( GetXMLToken( XML_COLLAPSE ) );
}
}
- if( aValue.getLength())
- {
- sal_Int32 nRepeated = aValue.toInt32();
- mrTable.nNumberOfColsEstimate += nRepeated;
- }
- else
+ sal_Int32 nOldCount = mrTable.nNumberOfColsEstimate;
+ sal_Int32 nNewCount = nOldCount + nRepeated;
+ mrTable.nNumberOfColsEstimate = nNewCount;
+
+ if( bHidden )
{
- mrTable.nNumberOfColsEstimate++;
+ //i91578 display of hidden values (copy paste scenario; use hidden flag during migration to locale table upon paste )
+ sal_Int32 nColOffset = ( mrTable.bHasHeaderColumn ? 1 : 0 );
+ for( sal_Int32 nN = nOldCount; nN<nNewCount; nN++ )
+ {
+ sal_Int32 nHiddenColumnIndex = nN-nColOffset;
+ if( nHiddenColumnIndex>=0 )
+ mrTable.aHiddenColumns.push_back(nHiddenColumnIndex);
+ }
}
}
@@ -1143,5 +1160,134 @@ void SchXMLTableHelper::postProcessTable(
xDataProv, xChartDoc, OUString(RTL_CONSTASCII_USTRINGPARAM("categories")),
0 /* nCooSysIndex */, 0 /* nDimension */ );
}
+
+ //i91578 display of hidden values (copy paste scenario; use hidden flag during migration to locale table upon paste )
+ //remove series that consist only of hidden columns
+ Reference< chart2::XInternalDataProvider > xInternalDataProvider( xDataProv, uno::UNO_QUERY );
+ if( xInternalDataProvider.is() && !rTable.aHiddenColumns.empty() )
+ {
+ try
+ {
+ Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xChartDoc->getFirstDiagram(), uno::UNO_QUERY_THROW );
+ Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems() );
+ for( sal_Int32 nC=0; nC<aCooSysSeq.getLength(); ++nC )
+ {
+ Reference< chart2::XChartTypeContainer > xCooSysContainer( aCooSysSeq[nC], uno::UNO_QUERY_THROW );
+ Sequence< Reference< chart2::XChartType > > aChartTypeSeq( xCooSysContainer->getChartTypes());
+ for( sal_Int32 nT=0; nT<aChartTypeSeq.getLength(); ++nT )
+ {
+ Reference< chart2::XDataSeriesContainer > xSeriesContainer( aChartTypeSeq[nT], uno::UNO_QUERY );
+ if(!xSeriesContainer.is())
+ continue;
+ Sequence< Reference< chart2::XDataSeries > > aSeriesSeq( xSeriesContainer->getDataSeries() );
+ std::vector< Reference< chart2::XDataSeries > > aRemainingSeries;
+
+ for( sal_Int32 nS = 0; nS < aSeriesSeq.getLength(); nS++ )
+ {
+ Reference< chart2::data::XDataSource > xDataSource( aSeriesSeq[nS], uno::UNO_QUERY );
+ if( xDataSource.is() )
+ {
+ bool bHasUnhiddenColumns = false;
+ rtl::OUString aRange;
+ uno::Sequence< Reference< chart2::data::XLabeledDataSequence > > aSequences( xDataSource->getDataSequences() );
+ for( sal_Int32 nN=0; nN< aSequences.getLength(); ++nN )
+ {
+ Reference< chart2::data::XLabeledDataSequence > xLabeledSequence( aSequences[nN] );
+ if(!xLabeledSequence.is())
+ continue;
+ Reference< chart2::data::XDataSequence > xValues( xLabeledSequence->getValues() );
+ if( xValues.is() )
+ {
+ aRange = xValues->getSourceRangeRepresentation();
+ if( ::std::find( rTable.aHiddenColumns.begin(), rTable.aHiddenColumns.end(), aRange.toInt32() ) == rTable.aHiddenColumns.end() )
+ bHasUnhiddenColumns = true;
+ }
+ if( !bHasUnhiddenColumns )
+ {
+ Reference< chart2::data::XDataSequence > xLabel( xLabeledSequence->getLabel() );
+ if( xLabel.is() )
+ {
+ aRange = xLabel->getSourceRangeRepresentation();
+ sal_Int32 nSearchIndex = 0;
+ OUString aSecondToken = aRange.getToken( 1, ' ', nSearchIndex );
+ if( ::std::find( rTable.aHiddenColumns.begin(), rTable.aHiddenColumns.end(), aSecondToken.toInt32() ) == rTable.aHiddenColumns.end() )
+ bHasUnhiddenColumns = true;
+ }
+ }
+ }
+ if( bHasUnhiddenColumns )
+ aRemainingSeries.push_back( aSeriesSeq[nS] );
+ }
+ }
+
+ if( static_cast<sal_Int32>(aRemainingSeries.size()) != aSeriesSeq.getLength() )
+ {
+ //remove the series that have only hidden data
+ Sequence< Reference< chart2::XDataSeries > > aRemainingSeriesSeq( aRemainingSeries.size());
+ ::std::copy( aRemainingSeries.begin(), aRemainingSeries.end(), aRemainingSeriesSeq.getArray());
+ xSeriesContainer->setDataSeries( aRemainingSeriesSeq );
+
+ //remove unused sequences
+ Reference< chart2::data::XDataSource > xDataSource( xChartDoc, uno::UNO_QUERY );
+ if( xDataSource.is() )
+ {
+ //first detect which collumns are really used
+ std::map< sal_Int32, bool > aUsageMap;
+ rtl::OUString aRange;
+ Sequence< Reference< chart2::data::XLabeledDataSequence > > aUsedSequences( xDataSource->getDataSequences() );
+ for( sal_Int32 nN=0; nN< aUsedSequences.getLength(); ++nN )
+ {
+ Reference< chart2::data::XLabeledDataSequence > xLabeledSequence( aUsedSequences[nN] );
+ if(!xLabeledSequence.is())
+ continue;
+ Reference< chart2::data::XDataSequence > xValues( xLabeledSequence->getValues() );
+ if( xValues.is() )
+ {
+ aRange = xValues->getSourceRangeRepresentation();
+ sal_Int32 nIndex = aRange.toInt32();
+ if( nIndex!=0 || !aRange.equals(lcl_aCategoriesRange) )
+ aUsageMap[nIndex] = true;
+ }
+ Reference< chart2::data::XDataSequence > xLabel( xLabeledSequence->getLabel() );
+ if( xLabel.is() )
+ {
+ aRange = xLabel->getSourceRangeRepresentation();
+ sal_Int32 nSearchIndex = 0;
+ OUString aSecondToken = aRange.getToken( 1, ' ', nSearchIndex );
+ if( aSecondToken.getLength() )
+ aUsageMap[aSecondToken.toInt32()] = true;
+ }
+ }
+
+ ::std::vector< sal_Int32 > aSequenceIndexesToDelete;
+ for( ::std::vector< sal_Int32 >::const_iterator aIt(
+ rTable.aHiddenColumns.begin()); aIt != rTable.aHiddenColumns.end(); ++aIt )
+ {
+ sal_Int32 nSequenceIndex = *aIt;
+ if( aUsageMap.find(nSequenceIndex) != aUsageMap.end() )
+ continue;
+ aSequenceIndexesToDelete.push_back(nSequenceIndex);
+ }
+
+ // delete unnecessary sequences of the internal data
+ // iterate using greatest index first, so that deletion does not
+ // shift other sequences that will be deleted later
+ ::std::sort( aSequenceIndexesToDelete.begin(), aSequenceIndexesToDelete.end());
+ for( ::std::vector< sal_Int32 >::reverse_iterator aIt(
+ aSequenceIndexesToDelete.rbegin()); aIt != aSequenceIndexesToDelete.rend(); ++aIt )
+ {
+ if( *aIt != -1 )
+ xInternalDataProvider->deleteSequence( *aIt );
+ }
+ }
+ }
+ }
+ }
+ }
+ catch( uno::Exception & ex )
+ {
+ (void)ex; // avoid warning for pro build
+ }
+ }
}
diff --git a/xmloff/source/chart/transporttypes.hxx b/xmloff/source/chart/transporttypes.hxx
index 104f411..7e4d790 100644
--- a/xmloff/source/chart/transporttypes.hxx
+++ b/xmloff/source/chart/transporttypes.hxx
@@ -68,6 +68,8 @@ struct SchXMLTable
::rtl::OUString aTableNameOfFile; /// the table name read at the table:table element
+ ::std::vector< sal_Int32 > aHiddenColumns;
+
SchXMLTable() : nRowIndex( -1 ),
nColumnIndex( -1 ),
nMaxColumnIndex( -1 ),
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index d20e05c..7c53c83 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -2967,6 +2967,7 @@ namespace xmloff { namespace token {
TOKEN( "percentage-data-style-name", XML_PERCENTAGE_DATA_STYLE_NAME ),
TOKEN( "value-and-percentage", XML_VALUE_AND_PERCENTAGE ),
TOKEN( "group-bars-per-axis", XML_GROUP_BARS_PER_AXIS ),
+ TOKEN( "include-hidden-cells", XML_INCLUDE_HIDDEN_CELLS ),
TOKEN( "auto-position", XML_AUTOMATIC_POSITION ),
TOKEN( "auto-size", XML_AUTOMATIC_SIZE ),
TOKEN( "reverse-direction", XML_REVERSE_DIRECTION ),
commit 111458457b0cf663fe1b780b4c07c0e1a890fe46
Author: Jens-Heiner Rechtien <hr at openoffice.org>
Date: Mon May 18 13:36:04 2009 +0000
CWS-TOOLING: integrate CWS m48fixshorttrack
2009-05-18 14:54:14 +0200 mba r272025 : #i101919#: fix event list
diff --git a/sfx2/inc/sfx2/evntconf.hxx b/sfx2/inc/sfx2/evntconf.hxx
index ecfa7fb..e7038ba 100644
--- a/sfx2/inc/sfx2/evntconf.hxx
+++ b/sfx2/inc/sfx2/evntconf.hxx
@@ -71,7 +71,7 @@ struct SFX2_DLLPUBLIC SfxEventName
, maUIName( rUIName ) {}
};
-DECLARE_TABLE( _SfxEventNamesList, SfxEventName* )
+DECLARE_LIST( _SfxEventNamesList, SfxEventName* )
class SFX2_DLLPUBLIC SfxEventNamesList : public _SfxEventNamesList
{
diff --git a/sfx2/source/config/evntconf.cxx b/sfx2/source/config/evntconf.cxx
index 9606795..1decfa2 100644
--- a/sfx2/source/config/evntconf.cxx
+++ b/sfx2/source/config/evntconf.cxx
@@ -94,12 +94,11 @@ using namespace com::sun::star;
SfxEventNamesList& SfxEventNamesList::operator=( const SfxEventNamesList& rTbl )
{
DelDtor();
- SfxEventName* pTmp = ((SfxEventNamesList&)rTbl).First();
- while( pTmp )
+ for (USHORT n=0; n<rTbl.Count(); n++ )
{
+ SfxEventName* pTmp = ((SfxEventNamesList&)rTbl).GetObject(n);
SfxEventName *pNew = new SfxEventName( *pTmp );
- Insert( rTbl.GetCurKey(), pNew );
- pTmp = ((SfxEventNamesList&)rTbl).Next();
+ Insert( pNew, n );
}
return *this;
}
@@ -122,16 +121,14 @@ int SfxEventNamesItem::operator==( const SfxPoolItem& rAttr ) const
const SfxEventNamesList& rOwn = aEventsList;
const SfxEventNamesList& rOther = ( (SfxEventNamesItem&) rAttr ).aEventsList;
- // Anzahl unterschiedlich => auf jeden Fall ungleich
if ( rOwn.Count() != rOther.Count() )
return FALSE;
- // einzeln verleichen; wegen Performance ist die Reihenfolge wichtig
for ( USHORT nNo = 0; nNo < rOwn.Count(); ++nNo )
{
const SfxEventName *pOwn = rOwn.GetObject(nNo);
const SfxEventName *pOther = rOther.GetObject(nNo);
- if ( rOwn.GetKey(pOwn) != rOther.GetKey(pOther) ||
+ if ( pOwn->mnId != pOther->mnId ||
pOwn->maEventName != pOther->maEventName ||
pOwn->maUIName != pOther->maUIName )
return FALSE;
@@ -177,12 +174,7 @@ USHORT SfxEventNamesItem::GetVersion( USHORT ) const
void SfxEventNamesItem::AddEvent( const String& rName, const String& rUIName, USHORT nID )
{
SfxEventName* pName;
- if ( 0 != (pName=aEventsList.Get(nID)) )
- {
- DBG_WARNING("Event already added!");
- }
- else
- aEventsList.Insert( nID, new SfxEventName( nID, rName, rUIName.Len() ? rUIName : rName ) );
+ aEventsList.Insert( new SfxEventName( nID, rName, rUIName.Len() ? rUIName : rName ) );
}
// class SfxAsyncEvent_Impl ----------------------------------------------
@@ -606,12 +598,12 @@ void SfxEventConfiguration::RegisterEvent( USHORT nId,
return;
}
- gp_Id_SortList->Insert( nPos, new SfxEventName( nId, rMacroName, rUIName ) );
+ gp_Id_SortList->Insert( new SfxEventName( nId, rMacroName, rUIName ), nPos );
nPos = GetPos_Impl( rMacroName, bFound );
DBG_ASSERT( !bFound, "RegisterEvent: Name in List, but ID not?" );
- gp_Name_SortList->Insert( nPos, new SfxEventName( nId, rMacroName, rUIName ) );
+ gp_Name_SortList->Insert( new SfxEventName( nId, rMacroName, rUIName ), nPos );
SFX_APP()->GetEventConfig();
}
commit 48c24c5f4a9962cbac86d84e8e0649f845f4b5e6
Author: Jens-Heiner Rechtien <hr at openoffice.org>
Date: Mon May 18 12:01:49 2009 +0000
CWS-TOOLING: integrate CWS cairocanvastext01
2009-05-12 07:10:00 +0200 mox r271795 : Rename ::GetLayoutData() to ::GetSysTextLayoutData() to avoid build
breakage in sc module.
2009-05-11 23:40:57 +0200 mox r271794 : merge fixes (again). These files should have been removed by the rebase.
2009-05-11 20:17:44 +0200 mox r271791 : fix build breakage on UNX
2009-05-11 16:53:15 +0200 mox r271779 : Documentation fix
2009-05-11 16:49:16 +0200 mox r271778 : merge fixes
2009-05-11 14:10:36 +0200 mox r271769 : CWS-TOOLING: rebase CWS cairocanvastext01 to trunk at 271427 (milestone: DEV300:m47)
2009-05-11 10:55:11 +0200 mox r271760 : merge fixes
2009-05-11 10:49:44 +0200 mox r271759 : manual merge to DEV300_m47
2009-05-11 10:42:11 +0200 mox r271758 : merge fixes
2009-05-11 10:29:16 +0200 mox r271757 : Manual merge to DEV300_m47
2009-05-11 10:21:13 +0200 mox r271756 : manual merge to DEV300_m47
2009-05-11 10:10:29 +0200 mox r271755 : manual merge to DEV300_m47
2009-05-11 10:01:33 +0200 mox r271754 : Manual merge to DEV300_m47
2009-05-11 09:59:30 +0200 mox r271753 : manual merge to DEV300_m47
2009-05-11 09:57:33 +0200 mox r271752 : merge fixes
2009-05-11 09:56:05 +0200 mox r271751 : merge fixes
2009-05-11 09:53:26 +0200 mox r271749 : Manual merge to DEV300_m47
2009-05-11 09:49:34 +0200 mox r271748 : manual merge to DEV300_m47
2009-05-11 09:43:20 +0200 mox r271747 : manual merge to DEV300_m47
2009-05-11 09:30:10 +0200 mox r271745 : Manual merge to DEV300_m47
2009-05-11 09:28:59 +0200 mox r271744 : manual merge to DEV300_m47
2009-05-11 09:24:49 +0200 mox r271743 : Fix to merge
2009-05-11 09:21:55 +0200 mox r271742 : Manual merge to DEV300_m47
2009-05-11 09:18:13 +0200 mox r271741 : merge fixes
2009-05-11 09:00:50 +0200 mox r271739 : Manual merge to DEV300_m47
2009-05-09 13:26:10 +0200 mox r271734 : cleanup
2009-05-09 13:17:22 +0200 mox r271733 : WNT build fixes
2009-05-09 09:23:59 +0200 mox r271732 : Implement proper cross-platform font width calculation
Implement faux bold support
2009-02-21 19:47:08 +0100 mox r268339 : CWS-TOOLING: rebase CWS cairocanvastext01 to trunk at 267171 (milestone: DEV300:m41)
2009-01-19 21:51:21 +0100 mox r266530 : Fix compilation on win32
2009-01-19 21:37:20 +0100 mox r266529 : Fix typo
2009-01-19 21:35:28 +0100 mox r266528 : Better debug
2009-01-19 21:13:30 +0100 mox r266527 : Win32 fixes for proper text rendering
2009-01-19 21:12:56 +0100 mox r266526 : Win32 fixes for proper text rendering
2008-12-27 13:04:05 +0100 mox r265814 : configure fixes
2008-12-27 11:37:00 +0100 mox r265813 : x86_64 works only with system-cairo
2008-12-26 20:02:32 +0100 mox r265809 : Use the fix for 64bit builds
2008-12-25 16:58:11 +0100 mox r265802 : Fix build breaker on WNT
2008-12-24 23:04:58 +0100 mox r265801 : Unbreak build after rebase.
2008-12-23 18:52:32 +0100 mox r265790 : CWS-TOOLING: rebase CWS cairocanvastext01 to trunk at 265758 (milestone: DEV300:m38)
2008-12-23 18:23:09 +0100 mox r265789 : Fix the fix
2008-12-23 18:21:27 +0100 mox r265788 : Fix OS2 stuff
2008-12-11 19:50:40 +0100 mox r265354 : Fix build breaker on Mac
2008-12-09 22:00:53 +0100 mox r265139 : CWS-TOOLING: rebase CWS cairocanvastext01 to trunk at 264807 (milestone: DEV300:m37)
2008-12-08 23:02:32 +0100 thb r265052 : Removed outdated parts from readme
2008-12-08 22:26:54 +0100 mox r265051 : cleanup
2008-12-07 19:55:31 +0100 mox r264967 : Fix for non-intel processors.
2008-12-07 19:47:11 +0100 mox r264963 : sysdata fixes
2008-12-07 19:23:27 +0100 mox r264959 : Sysdata fixes
2008-12-07 19:01:48 +0100 mox r264958 : Fix sysdata usage
2008-12-07 11:41:33 +0100 mox r264951 : sysdata fixes
2008-12-07 11:38:32 +0100 mox r264950 : sysdata fixes
2008-12-06 23:15:06 +0100 mox r264947 : Try to fix error: __sync_val_compare_and_swap_4
2008-12-06 23:09:30 +0100 mox r264945 : Revert unnecessary change.
2008-12-06 23:04:40 +0100 mox r264944 : Use pre/postx from tools module.
2008-12-06 22:49:08 +0100 mox r264943 : Use proper pre/post includes.
2008-12-06 22:48:03 +0100 mox r264942 : Use pre/postx from tools module.
2008-12-06 22:24:10 +0100 mox r264941 : Fix build breaker.
2008-12-06 21:55:46 +0100 mox r264940 : Make pre/postx.h properly available
2008-12-06 21:54:23 +0100 mox r264939 : Make pre/postx.h properly available.
2008-12-06 21:43:09 +0100 mox r264938 : Try to fix error: __sync_val_compare_and_swap_4
2008-12-06 21:12:18 +0100 mox r264937 : Remove obsolete pre-built binaries
2008-12-06 21:07:40 +0100 mox r264936 : WNT: do not hardcode pixman version in cairo build
2008-12-06 19:26:44 +0100 mox r264934 : Revert pixman upgrade.
2008-12-06 18:35:14 +0100 mox r264933 : Fix build breaker
2008-12-06 18:31:11 +0100 mox r264932 : Use static pixman lib on unx/32bit to avoid linking problems
2008-12-06 17:22:52 +0100 mox r264930 : Update pixman to 0.13.2
2008-12-06 13:30:41 +0100 mox r264928 : Fix accidentally changed property
2008-12-06 13:09:00 +0100 mox r264927 : Fix accidental prop changes
2008-12-06 12:40:08 +0100 mox r264926 : Fix build breaker on Win32
2008-12-06 12:39:22 +0100 mox r264925 : Fix build breaker on Win32
2008-12-06 12:30:23 +0100 mox r264924 : Fix build breakers on win32
2008-12-06 11:45:33 +0100 mox r264923 : revert.
2008-12-06 11:43:05 +0100 mox r264922 : Try to fix header include problems on WNT
2008-12-06 09:57:35 +0100 mox r264921 : Cleanup accidental props
2008-11-29 14:43:51 +0100 mox r264580 : Move headers around to make all platforms compile
2008-11-29 14:41:59 +0100 mox r264579 : WaE fixes for X11
2008-11-29 13:13:49 +0100 mox r264578 : Fix build breaker on linux
2008-11-29 12:21:03 +0100 mox r264577 : Fix build breaker
2008-11-29 12:13:50 +0100 mox r264576 : Try to fix build breaker
2008-11-28 22:51:27 +0100 mox r264573 : Revert header includes to common style
2008-11-18 18:59:15 +0100 mox r263794 : Fix build breaker.
2008-11-17 20:28:19 +0100 mox r263740 : Revert most configure hacks
2008-11-17 20:12:51 +0100 mox r263739 : CWS-TOOLING: rebase CWS cairocanvastext01 to trunk at 263288 (milestone: DEV300:m35)
2008-11-14 21:22:22 +0100 mox r263698 : ZLIB_FIX define set
2008-11-14 18:48:22 +0100 mox r263694 : hardcode zlib paths
2008-11-14 16:23:07 +0100 mox r263683 : Fix typo
2008-11-13 20:16:13 +0100 mox r263662 : WaE fix
2008-11-13 19:44:29 +0100 mox r263661 : Properly include zlib headers for win32
2008-11-12 20:05:51 +0100 mox r263610 : Add debugging code.
2008-11-10 19:44:35 +0100 mox r263537 : Try to fix build breaker
2008-11-09 22:34:35 +0100 mox r263504 : Remove accidentally added svn:ignore properties.
2008-11-09 22:33:21 +0100 mox r263503 : prop should be actually deleted.
2008-11-09 22:30:06 +0100 mox r263502 : props should be empty.
2008-11-09 22:23:22 +0100 mox r263501 : Try fix props again...
2008-11-09 22:11:26 +0100 mox r263500 : try to fix svn:ignore
2008-11-09 21:30:01 +0100 mox r263499 : CWS-TOOLING: rebase CWS cairocanvastext01 to trunk at 262620 (milestone: DEV300:m34)
2008-11-09 20:30:55 +0100 mox r263498 : add missing cairo patch
2008-11-09 10:56:33 +0100 mox r263494 : Resync cairo module with cws cairosource01
2008-11-01 09:32:19 +0100 mox r262870 : CWS-TOOLING: rebase CWS cairocanvastext01 to trunk at 262620 (milestone: DEV300:m34)
2008-10-26 20:55:48 +0100 mox r262663 : Fix build breaker
2008-10-25 13:10:00 +0200 mox r262662 : CWS rebase to m33
2008-10-12 19:47:56 +0200 mox r262170 : Migrate CWS cairocanvastext01 to SVN.
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index bde93eb..6944aca 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -101,6 +101,13 @@
#include <uielement/menubarmerger.hxx>
#include <dispatch/uieventloghelper.hxx>
+#ifdef WNT
+#include <tools/prewin.h>
+#include <windows.h>
+#include <tools/postwin.h>
+#endif
+#include <vcl/sysdata.hxx>
+
//_________________________________________________________________________________________________________________
// namespace
//_________________________________________________________________________________________________________________
@@ -135,12 +142,6 @@ const sal_Int32 LEN_DESCRIPTOR_DISPATCHPROVIDER = 16;
const sal_uInt16 ADDONMENU_MERGE_ITEMID_START = 1500;
-struct SystemMenuData
-{
- unsigned long nSize; // size in bytes of this structure
- long aMenu; // ???
-};
-
class StringLength : public ::cppu::WeakImplHelper1< ::com::sun::star::util::XStringWidth >
{
public:
@@ -463,14 +464,18 @@ Any SAL_CALL MenuBarManager::getMenuHandle( const ::com::sun::star::uno::Sequenc
aSystemMenuData.nSize = sizeof( SystemMenuData );
m_pVCLMenu->GetSystemMenuData( &aSystemMenuData );
-#ifdef UNX
- if( SystemType == ::com::sun::star::lang::SystemDependent::SYSTEM_XWINDOW )
+#ifdef QUARTZ
+ if( SystemType == ::com::sun::star::lang::SystemDependent::SYSTEM_MAC )
{
}
#elif (defined WNT)
if( SystemType == ::com::sun::star::lang::SystemDependent::SYSTEM_WIN32 )
{
- a <<= aSystemMenuData.aMenu;
+ a <<= (long) aSystemMenuData.hMenu;
+ }
+#elif (defined UNX)
+ if( SystemType == ::com::sun::star::lang::SystemDependent::SYSTEM_XWINDOW )
+ {
}
#endif
}
diff --git a/sj2/source/jscpp/sjapplet_impl.cxx b/sj2/source/jscpp/sjapplet_impl.cxx
index ee2ee6f..31a419e 100644
--- a/sj2/source/jscpp/sjapplet_impl.cxx
+++ b/sj2/source/jscpp/sjapplet_impl.cxx
@@ -30,10 +30,18 @@
#include "sjapplet_impl.hxx"
-#ifndef OS2
-#define HWND int
-#define HMENU int
-#define HDC int
+#ifdef WNT
+#include <tools/prewin.h>
+#include <windows.h>
+#include <tools/postwin.h>
+#elif (defined QUARTZ)
+#include "premac.h"
+#include <Cocoa/Cocoa.h>
+#include "postmac.h"
+#elif (defined UNX)
+#include <tools/prex.h>
+#include "X11/Xlib.h"
+#include <tools/postx.h>
#endif
#include "rtl/ustring.hxx"
@@ -45,12 +53,6 @@
#include <svtools/ownlist.hxx>
-#ifdef QUARTZ
-#include "premac.h"
-#include <Cocoa/Cocoa.h>
-#include "postmac.h"
-#endif
-
#include <vcl/svapp.hxx>
#include <vcl/window.hxx>
#include <vcl/wrkwin.hxx>
@@ -61,21 +63,6 @@
#include "com/sun/star/uno/XComponentContext.hpp"
#include "jvmaccess/classpath.hxx"
-#if defined(UNX) && !defined(QUARTZ)
-#define Time xlib_time
-#define Window xlib_window
-#define Font xlib_font
-#define Cursor xlib_cursor
-#define KeyCode xlib_keycode
-
-#include "X11/Xlib.h"
-#undef Time
-#undef Window
-#undef Font
-#undef Cursor
-#undef KeyCode
-#endif
-
using namespace ::rtl;
using namespace ::osl;
#ifdef SOLAR_JAVA
More information about the ooo-build-commit
mailing list