summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-09-30 13:51:36 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-09-30 13:51:36 +0000
commitff916ccce1527b63aad17bbae0ad02a834cd31d6 (patch)
tree23096c4a5873e0545c6134ec4ee8668605a18b6b
parentCWS-TOOLING: integrate CWS docmacroassignments_DEV300 (diff)
downloadcore-ff916ccce1527b63aad17bbae0ad02a834cd31d6.tar.gz
core-ff916ccce1527b63aad17bbae0ad02a834cd31d6.zip
CWS-TOOLING: integrate CWS dr63
-rw-r--r--sc/source/filter/excel/colrowst.cxx6
-rw-r--r--sc/source/filter/excel/excdoc.cxx4
-rw-r--r--sc/source/filter/excel/excel.cxx58
-rw-r--r--sc/source/filter/excel/excform.cxx5
-rw-r--r--sc/source/filter/excel/excimp8.cxx9
-rw-r--r--sc/source/filter/excel/excobj.cxx184
-rw-r--r--sc/source/filter/excel/expop2.cxx4
-rw-r--r--sc/source/filter/excel/impop.cxx43
-rw-r--r--sc/source/filter/excel/makefile.mk11
-rw-r--r--sc/source/filter/excel/namebuff.cxx4
-rw-r--r--sc/source/filter/excel/read.cxx26
-rw-r--r--sc/source/filter/excel/xechart.cxx89
-rw-r--r--sc/source/filter/excel/xeescher.cxx249
-rw-r--r--sc/source/filter/excel/xehelper.cxx123
-rw-r--r--sc/source/filter/excel/xepage.cxx56
-rw-r--r--sc/source/filter/excel/xestring.cxx7
-rw-r--r--sc/source/filter/excel/xichart.cxx133
-rw-r--r--sc/source/filter/excel/xicontent.cxx84
-rw-r--r--sc/source/filter/excel/xiescher.cxx4103
-rw-r--r--sc/source/filter/excel/xipage.cxx50
-rw-r--r--sc/source/filter/excel/xipivot.cxx4
-rw-r--r--sc/source/filter/excel/xiroot.cxx10
-rw-r--r--sc/source/filter/excel/xistring.cxx17
-rw-r--r--sc/source/filter/excel/xistyle.cxx317
-rw-r--r--sc/source/filter/excel/xiview.cxx14
-rw-r--r--sc/source/filter/excel/xlchart.cxx48
-rw-r--r--sc/source/filter/excel/xldumper.cxx2801
-rw-r--r--sc/source/filter/excel/xldumper.dat1649
-rw-r--r--sc/source/filter/excel/xlescher.cxx352
-rw-r--r--sc/source/filter/excel/xlocx.cxx371
-rw-r--r--sc/source/filter/excel/xlpivot.cxx8
-rw-r--r--sc/source/filter/excel/xlroot.cxx4
-rw-r--r--sc/source/filter/ftools/fapihelper.cxx18
-rw-r--r--sc/source/filter/ftools/fdumper.cxx2274
-rw-r--r--sc/source/filter/ftools/fdumper.dat440
-rw-r--r--sc/source/filter/ftools/fdumperdff.cxx233
-rw-r--r--sc/source/filter/ftools/fdumperole.cxx675
-rw-r--r--sc/source/filter/ftools/ftools.cxx2
-rw-r--r--sc/source/filter/ftools/makefile.mk11
-rw-r--r--sc/source/filter/inc/excimp8.hxx3
-rw-r--r--sc/source/filter/inc/fapihelper.hxx3
-rw-r--r--sc/source/filter/inc/fdumperdff.hxx113
-rw-r--r--sc/source/filter/inc/ftools.hxx10
-rw-r--r--sc/source/filter/inc/imp_op.hxx10
-rw-r--r--sc/source/filter/inc/namebuff.hxx32
-rw-r--r--sc/source/filter/inc/root.hxx4
-rw-r--r--sc/source/filter/inc/xcl97esc.hxx85
-rw-r--r--sc/source/filter/inc/xcl97rec.hxx2
-rw-r--r--sc/source/filter/inc/xechart.hxx14
-rw-r--r--sc/source/filter/inc/xeescher.hxx40
-rw-r--r--sc/source/filter/inc/xepage.hxx19
-rw-r--r--sc/source/filter/inc/xichart.hxx40
-rw-r--r--sc/source/filter/inc/xiescher.hxx1111
-rw-r--r--sc/source/filter/inc/xipage.hxx6
-rw-r--r--sc/source/filter/inc/xiroot.hxx2
-rw-r--r--sc/source/filter/inc/xistring.hxx6
-rw-r--r--sc/source/filter/inc/xistyle.hxx29
-rw-r--r--sc/source/filter/inc/xlchart.hxx13
-rw-r--r--sc/source/filter/inc/xlescher.hxx473
-rw-r--r--sc/source/filter/inc/xlocx.hxx152
-rw-r--r--sc/source/filter/inc/xlpage.hxx9
-rw-r--r--sc/source/filter/inc/xlstyle.hxx3
-rw-r--r--sc/source/filter/xcl97/makefile.mk5
-rw-r--r--sc/source/filter/xcl97/xcl97esc.cxx201
-rw-r--r--sc/source/filter/xcl97/xcl97rec.cxx114
-rw-r--r--sc/source/ui/inc/cellsh.hxx6
-rw-r--r--sc/source/ui/inc/formatsh.hxx1
-rw-r--r--sc/source/ui/inc/navipi.hxx52
-rw-r--r--sc/source/ui/navipi/makefile.mk15
-rw-r--r--sc/source/ui/navipi/navipi.cxx2
-rw-r--r--sc/source/ui/navipi/scenwnd.cxx268
-rw-r--r--sc/source/ui/src/popup.src4
-rw-r--r--sc/source/ui/view/cellsh2.cxx1
-rw-r--r--sc/source/ui/view/cellsh3.cxx26
-rw-r--r--scaddins/source/analysis/analysis.cxx4
75 files changed, 5652 insertions, 11722 deletions
diff --git a/sc/source/filter/excel/colrowst.cxx b/sc/source/filter/excel/colrowst.cxx
index f7d4b3e50e5c..312604d7ab92 100644
--- a/sc/source/filter/excel/colrowst.cxx
+++ b/sc/source/filter/excel/colrowst.cxx
@@ -158,6 +158,12 @@ void XclImpColRowSettings::SetRowSettings( SCROW nScRow, sal_uInt16 nHeight, sal
}
}
+void XclImpColRowSettings::SetManualRowHeight( SCROW nScRow )
+{
+ if( ValidRow( nScRow ) )
+ ::set_flag( maRowFlags[ nScRow ], EXC_COLROW_MAN );
+}
+
void XclImpColRowSettings::SetDefaultXF( SCCOL nScCol1, SCCOL nScCol2, sal_uInt16 nXFIndex )
{
/* #109555# assign the default column formatting here to ensure that
diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx
index efc103be83c1..f8a202ee3a62 100644
--- a/sc/source/filter/excel/excdoc.cxx
+++ b/sc/source/filter/excel/excdoc.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: excdoc.cxx,v $
- * $Revision: 1.70 $
+ * $Revision: 1.69.60.2 $
*
* This file is part of OpenOffice.org.
*
@@ -348,7 +348,7 @@ void ExcTable::FillAsTable( size_t nCodeNameIdx )
if( eBiff == EXC_BIFF8 )
{
- rR.pEscher->AddSdrPage( GetRoot() );
+ rR.pEscher->AddSdrPage();
//! close Escher group shape and ESCHER_DgContainer
//! opened by XclObjList ctor MSODRAWING
rR.pObjRecs->EndSheet();
diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx
index 8fb15fb9c5c7..753c3bc57d45 100644
--- a/sc/source/filter/excel/excel.cxx
+++ b/sc/source/filter/excel/excel.cxx
@@ -32,15 +32,19 @@
#include "precompiled_sc.hxx"
#include <sfx2/docfile.hxx>
+#include <sfx2/objsh.hxx>
#include <sfx2/app.hxx>
#include <sot/storage.hxx>
#include <sot/exchange.hxx>
#include <tools/globname.hxx>
+#include <comphelper/mediadescriptor.hxx>
+#include <comphelper/processfactory.hxx>
+#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/document/XImporter.hpp>
#include "scitems.hxx"
#include <svtools/stritem.hxx>
#include "filter.hxx"
#include "document.hxx"
-#include "xldumper.hxx"
#include "xistream.hxx"
#include "scerrors.hxx"
@@ -56,15 +60,6 @@ FltError ScImportExcel( SfxMedium& rMedium, ScDocument* pDocument, const EXCIMPF
DBG_ASSERT( pDocument, "::ScImportExcel - no document" );
if( !pDocument ) return eERR_INTERN; // should not happen
-#if SCF_INCL_DUMPER
- {
- ::scf::dump::xls::Dumper aDumper( rMedium, pDocument->GetDocumentShell() );
- aDumper.Dump();
- if( !aDumper.IsImportEnabled() )
- return ERRCODE_ABORT;
- }
-#endif
-
/* Import all BIFF versions regardless on eFormat, needed for import of
external cells (file type detection returns Excel4.0). */
if( (eFormat != EIF_AUTO) && (eFormat != EIF_BIFF_LE4) && (eFormat != EIF_BIFF5) && (eFormat != EIF_BIFF8) )
@@ -78,6 +73,49 @@ FltError ScImportExcel( SfxMedium& rMedium, ScDocument* pDocument, const EXCIMPF
DBG_ASSERT( pMedStrm, "::ScImportExcel - medium without input stream" );
if( !pMedStrm ) return eERR_OPEN; // should not happen
+#if OSL_DEBUG_LEVEL > 0
+ using namespace ::com::sun::star;
+ using namespace ::comphelper;
+
+ // false = use old sc filter for import (OOX only as file dumper), true = use new OOX filter for import
+ bool bUseOoxFilter = false;
+ if( SfxObjectShell* pDocShell = pDocument->GetDocumentShell() ) try
+ {
+ uno::Reference< lang::XComponent > xComponent( pDocShell->GetModel(), uno::UNO_QUERY_THROW );
+
+ uno::Sequence< uno::Any > aArgs( 2 );
+ aArgs[ 0 ] <<= getProcessServiceFactory();
+ aArgs[ 1 ] <<= !bUseOoxFilter;
+ uno::Reference< document::XImporter > xImporter( ScfApiHelper::CreateInstanceWithArgs(
+ CREATE_STRING( "com.sun.star.comp.oox.ExcelBiffFilter" ), aArgs ), uno::UNO_QUERY_THROW );
+ xImporter->setTargetDocument( xComponent );
+
+ MediaDescriptor aDescriptor;
+ if( const SfxItemSet* pItemSet = rMedium.GetItemSet() )
+ if( const SfxStringItem* pItem = static_cast< const SfxStringItem* >( pItemSet->GetItem( SID_FILE_NAME ) ) )
+ aDescriptor[ MediaDescriptor::PROP_URL() ] <<= ::rtl::OUString( pItem->GetValue() );
+ aDescriptor[ MediaDescriptor::PROP_INPUTSTREAM() ] <<= rMedium.GetInputStream();
+
+ // call the filter
+ uno::Reference< document::XFilter > xFilter( xImporter, uno::UNO_QUERY_THROW );
+ bool bResult = xFilter->filter( aDescriptor.getAsConstPropertyValueList() );
+
+ // if filter returns false, document is invalid, or dumper has disabled import -> exit here
+ if( !bResult )
+ return ERRCODE_ABORT;
+
+ // if OOX filter has been used, exit with OK code
+ if( bUseOoxFilter )
+ return eERR_OK;
+ }
+ catch( uno::Exception& )
+ {
+ if( bUseOoxFilter )
+ return ERRCODE_ABORT;
+ // else ignore exception and import the document with this filter
+ }
+#endif
+
SvStream* pBookStrm = 0; // The "Book"/"Workbook" stream containing main data.
XclBiff eBiff = EXC_BIFF_UNKNOWN; // The BIFF version of the main stream.
diff --git a/sc/source/filter/excel/excform.cxx b/sc/source/filter/excel/excform.cxx
index e39fac57f8ef..659e39c5ed99 100644
--- a/sc/source/filter/excel/excform.cxx
+++ b/sc/source/filter/excel/excform.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: excform.cxx,v $
- * $Revision: 1.52 $
+ * $Revision: 1.52.4.1 $
*
* This file is part of OpenOffice.org.
*
@@ -695,8 +695,7 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s
aIn >> nUINT16;
if( nINT16 >= 0 )
{
- const ExtName* pExtName;
- pExtName = rR.pExtNameBuff->GetName( nUINT16 );
+ const ExtName* pExtName = rR.pExtNameBuff->GetNameByIndex( nINT16, nUINT16 );
if( pExtName && pExtName->IsDDE() &&
rR.pExtSheetBuff->IsLink( ( UINT16 ) nINT16 ) )
{
diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx
index b16f42cca746..7c45d7f9a45f 100644
--- a/sc/source/filter/excel/excimp8.cxx
+++ b/sc/source/filter/excel/excimp8.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: excimp8.cxx,v $
- * $Revision: 1.127 $
+ * $Revision: 1.127.4.2 $
*
* This file is part of OpenOffice.org.
*
@@ -86,7 +86,6 @@
#include "docoptio.hxx"
#include "globstr.hrc"
#include "fprogressbar.hxx"
-#include "xlocx.hxx"
#include "xltracer.hxx"
#include "xihelper.hxx"
#include "xipage.hxx"
@@ -167,12 +166,6 @@ void ImportExcel8:: WinProtection( void )
GetExtDocOptions().GetDocSettings().mbWinProtected = true;
}
-void ImportExcel8::Note( void )
-{
- GetObjectManager().ReadNote( maStrm );
-}
-
-
void ImportExcel8::Boundsheet( void )
{
UINT8 nLen;
diff --git a/sc/source/filter/excel/excobj.cxx b/sc/source/filter/excel/excobj.cxx
index 944188f97191..e69de29bb2d1 100644
--- a/sc/source/filter/excel/excobj.cxx
+++ b/sc/source/filter/excel/excobj.cxx
@@ -1,184 +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: excobj.cxx,v $
- * $Revision: 1.46 $
- *
- * 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_sc.hxx"
-
-#include "scitems.hxx"
-#include <svx/eeitem.hxx>
-
-#include <svx/colritem.hxx>
-#include <svx/svddef.hxx>
-#include <svx/svdoole2.hxx>
-#include <svx/svdopath.hxx>
-#include <svx/svdorect.hxx>
-#include <svx/svdotext.hxx>
-#include <svx/svdpage.hxx>
-#include <svx/xcolit.hxx>
-#include <svx/xfillit.hxx>
-#include <svx/xfillit0.hxx>
-#include <svx/xlineit.hxx>
-#include <svx/xlineit0.hxx>
-#include <svx/xsetit.hxx>
-#include <svx/outlobj.hxx>
-#include <svx/outliner.hxx>
-#include <sfx2/objsh.hxx>
-#include <sot/storage.hxx>
-#include <svtools/itemset.hxx>
-#include <sfx2/app.hxx>
-#include <svx/editdata.hxx>
-#include <svx/editeng.hxx>
-#include <svx/editobj.hxx>
-#include <svx/editstat.hxx>
-#include <sot/clsids.hxx>
-#include <svx/svdograf.hxx>
-
-#include "document.hxx"
-#include "drwlayer.hxx"
-#include "editutil.hxx"
-#include "xltracer.hxx"
-#include "xilink.hxx"
-#include "xiescher.hxx"
-
-#include "imp_op.hxx"
-#include <basegfx/point/b2dpoint.hxx>
-#include <basegfx/polygon/b2dpolygon.hxx>
-
-void ImportExcel::Obj()
-{
- ScDocument& rDoc = GetDoc();
- SCTAB nScTab = GetCurrScTab();
-
- UINT32 nObj;
- UINT16 nType, nId, nFlags;
- UINT16 nMacroLen;
- XclEscherAnchor aAnchor( nScTab );
-
- aIn >> nObj >> nType >> nId >> nFlags >> aAnchor >> nMacroLen;
- bool bBiff5 = GetBiff() == EXC_BIFF5;
- aIn.Ignore( bBiff5 ? 6 : 2 );
-
- if( bBiff5 && (nType == EXC_OBJ_CMO_CHART) )
- {
- maStrm.Seek( EXC_REC_SEEK_TO_BEGIN );
- GetObjectManager().ReadObj5( maStrm );
- }
- else
- {
- Rectangle aRect( aAnchor.GetRect( rDoc, MAP_100TH_MM ) );
- Point aTL( aRect.TopLeft() );
- Point aBR( aRect.BottomRight() );
-
- SfxItemSet aSet( rDoc.GetDrawLayer()->GetItemPool(), SDRATTR_START, SDRATTR_END );
- SdrObject* pObj = NULL;
- switch( nType )
- {
- case EXC_OBJ_CMO_LINE: pObj = LineObj( aSet, aTL, aBR ); break;
- case EXC_OBJ_CMO_RECTANGLE: pObj = RectObj( aSet, aTL, aBR ); break;
- default: pExcRoot->pIR->GetTracer().TraceUnsupportedObjects(); break;
- }
-
- if( pObj )
- {
- pObj->NbcSetSnapRect( aRect );
- pObj->NbcSetLayer( SC_LAYER_FRONT );
-
- pObj->ClearMergedItem();
- pObj->SetMergedItemSetAndBroadcast( aSet );
-
- if( SdrPage* pSdrPage = GetSdrPage( nScTab ) )
- pSdrPage->InsertObject( pObj );
- if( bBiff5 && aIn.GetRecLeft() )
- {
- sal_uInt8 nNameLen;
- aIn >> nNameLen;
- aIn.Ignore( nNameLen + nMacroLen );
- }
- }
- }
-}
-
-
-void ImportExcel::SetLineStyle( SfxItemSet& rSet, sal_uInt16 nColor, sal_uInt16 nStyle, sal_uInt16 nWidth )
-{
- rSet.Put( XLineColorItem( String(), GetPalette().GetColor( nColor ) ) );
- XLineStyle eStyle = (nStyle == 255) ? XLINE_NONE : (((nStyle == 1) || (nStyle == 2)) ? XLINE_DASH : XLINE_SOLID);
- rSet.Put( XLineStyleItem( eStyle ) );
- rSet.Put( XLineWidthItem( nWidth * 40 ) );
-}
-
-
-void ImportExcel::SetFillStyle( SfxItemSet& rSet, sal_uInt16 nBackIdx, sal_uInt16 nPattIdx, sal_uInt16 nPattern )
-{
- if( nPattern == EXC_PATT_NONE )
- {
- rSet.Put( XFillStyleItem( XFILL_NONE ) );
- }
- else
- {
- rSet.Put( XFillStyleItem( XFILL_SOLID ) );
- Color aPattColor = GetPalette().GetColor( nPattIdx );
- Color aBackColor = GetPalette().GetColor( nBackIdx );
- Color aColor = XclTools::GetPatternColor( aPattColor, aBackColor, nPattern );
- rSet.Put( XFillColorItem( String(), aColor ) );
- }
-}
-
-
-SdrObject* ImportExcel::LineObj( SfxItemSet& rSet, const Point& rUL, const Point& rLR )
-{
- BYTE nLc, nStyle, nWeight, nAuto;
- UINT16 nEndStyles;
- BYTE nQuadrant;
- aIn >> nLc >> nStyle >> nWeight >> nAuto >> nEndStyles >> nQuadrant;
- aIn.Ignore( 1 );
-
- basegfx::B2DPolygon aB2DPolygon;
- aB2DPolygon.append(basegfx::B2DPoint(rUL.X(), rUL.Y()));
- aB2DPolygon.append(basegfx::B2DPoint(rLR.X(), rLR.Y()));
- SdrPathObj* pObj = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aB2DPolygon));
- SetLineStyle( rSet, nLc, nStyle, nWeight );
- return pObj;
-}
-
-
-SdrObject* ImportExcel::RectObj( SfxItemSet& rSet, const Point& rUL, const Point& rLR )
-{
- BYTE nBg, nFg, nPat, fAuto1, nLc, nLStyle, nLWeight, fAuto2;
- UINT16 nFRS;
- aIn >> nBg >> nFg >> nPat >> fAuto1 >> nLc >> nLStyle
- >> nLWeight >> fAuto2 >> nFRS;
-
- SdrRectObj* pObj = new SdrRectObj( Rectangle( rUL, rLR ) );
- SetLineStyle( rSet, nLc, nLStyle, nLWeight );
- SetFillStyle( rSet, nBg, nFg, nPat );
- return pObj;
-}
-
diff --git a/sc/source/filter/excel/expop2.cxx b/sc/source/filter/excel/expop2.cxx
index 80266ead6c87..5d7ee8c115c5 100644
--- a/sc/source/filter/excel/expop2.cxx
+++ b/sc/source/filter/excel/expop2.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: expop2.cxx,v $
- * $Revision: 1.35 $
+ * $Revision: 1.35.14.1 $
*
* This file is part of OpenOffice.org.
*
@@ -144,7 +144,7 @@ ExportBiff8::ExportBiff8( XclExpRootData& rExpData, SvStream& rStrm ) :
ExportBiff5( rExpData, rStrm )
{
pExcRoot->eDateiTyp = Biff8;
- pExcRoot->pEscher = new XclEscher( GetDoc().GetTableCount(), *pExcRoot );
+ pExcRoot->pEscher = new XclEscher( GetRoot(), GetDoc().GetTableCount() );
}
diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx
index b287e6804f1b..96e1ad36f1bf 100644
--- a/sc/source/filter/excel/impop.cxx
+++ b/sc/source/filter/excel/impop.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: impop.cxx,v $
- * $Revision: 1.96 $
+ * $Revision: 1.95.4.4 $
*
* This file is part of OpenOffice.org.
*
@@ -125,6 +125,7 @@ ImportExcel::ImportExcel( XclImpRootData& rImpData, SvStream& rStrm ):
maStrm( rStrm, GetRoot() ),
aIn( maStrm )
{
+ mnLastRefIdx = 0;
nBdshtTab = 0;
nIxfeIndex = 0; // zur Sicherheit auf 0
@@ -135,7 +136,7 @@ ImportExcel::ImportExcel( XclImpRootData& rImpData, SvStream& rStrm ):
pExcRoot->pExtSheetBuff = new ExtSheetBuffer( pExcRoot ); //&aExtSheetBuff;
pExcRoot->pTabNameBuff = new NameBuffer( pExcRoot ); //&aTabNameBuff;
pExcRoot->pShrfmlaBuff = new ShrfmlaBuffer( pExcRoot ); //&aShrfrmlaBuff;
- pExcRoot->pExtNameBuff = new ExtNameBuff ( pExcRoot );
+ pExcRoot->pExtNameBuff = new ExtNameBuff ( *this );
pExtNameBuff = new NameBuffer( pExcRoot ); //#94039# prevent empty rootdata
pExtNameBuff->SetBase( 1 );
@@ -383,8 +384,7 @@ void ImportExcel::Row25( void )
aIn.Ignore( 2 ); // reserved
aIn >> nGrbit;
- BYTE nLevel = 0;
- ::extract_value( nLevel, nGrbit, 0, 3 );
+ sal_uInt8 nLevel = ::extract_value< sal_uInt8 >( nGrbit, 0, 3 );
pRowOutlineBuff->SetLevel( nRow, nLevel,
::get_flag( nGrbit, EXC_ROW_COLLAPSED ), ::get_flag( nGrbit, EXC_ROW_HIDDEN ) );
@@ -435,21 +435,7 @@ void ImportExcel::Externsheet( void )
bool bSameWorkBook;
String aEncodedUrl( aIn.ReadByteString( false ) );
XclImpUrlHelper::DecodeUrl( aUrl, aTabName, bSameWorkBook, *pExcRoot->pIR, aEncodedUrl );
- pExcRoot->pExtSheetBuff->Add( aUrl, aTabName, bSameWorkBook );
-}
-
-
-void ImportExcel::Note( void )
-{
- XclAddress aXclPos;
- aIn >> aXclPos;
-
- ScAddress aScPos( ScAddress::UNINITIALIZED );
- if( GetAddressConverter().ConvertAddress( aScPos, aXclPos, GetCurrScTab(), true ) )
- {
- ScPostIt aScNote( aIn.ReadByteString( TRUE ), GetDocPtr() );
- GetDoc().SetNote( aScPos.Col(), aScPos.Row(), aScPos.Tab(), aScNote );
- }
+ mnLastRefIdx = pExcRoot->pExtSheetBuff->Add( aUrl, aTabName, bSameWorkBook );
}
@@ -546,15 +532,15 @@ void ImportExcel::Externname25( void )
if( ( nOpt & 0x0001 ) || ( ( nOpt & 0xFFFE ) == 0x0000 ) )
{// external name
ScfTools::ConvertToScDefinedName( aName );
- pExcRoot->pExtNameBuff->AddName( aName );
+ pExcRoot->pExtNameBuff->AddName( aName, mnLastRefIdx );
}
else if( nOpt & 0x0010 )
{// ole link
- pExcRoot->pExtNameBuff->AddOLE( aName, nRes ); // nRes is storage ID
+ pExcRoot->pExtNameBuff->AddOLE( aName, mnLastRefIdx, nRes ); // nRes is storage ID
}
else
{// dde link
- pExcRoot->pExtNameBuff->AddDDE( aName );
+ pExcRoot->pExtNameBuff->AddDDE( aName, mnLastRefIdx );
}
}
@@ -649,8 +635,7 @@ void ImportExcel::Colinfo( void )
bool bHidden = ::get_flag( nOpt, EXC_COLINFO_HIDDEN );
bool bCollapsed = ::get_flag( nOpt, EXC_COLINFO_COLLAPSED );
- sal_uInt8 nLevel;
- ::extract_value( nLevel, nOpt, 8, 3 );
+ sal_uInt8 nLevel = ::extract_value< sal_uInt8 >( nOpt, 8, 3 );
pColOutlineBuff->SetLevelRange( nColFirst, nColLast, nLevel, bCollapsed, bHidden );
if( bHidden )
@@ -926,8 +911,7 @@ void ImportExcel::Row34( void )
aIn >> nGrbit >> nXF;
- BYTE nLevel = 0;
- ::extract_value( nLevel, nGrbit, 0, 3 );
+ sal_uInt8 nLevel = ::extract_value< sal_uInt8 >( nGrbit, 0, 3 );
pRowOutlineBuff->SetLevel( nScRow, nLevel,
::get_flag( nGrbit, EXC_ROW_COLLAPSED ), ::get_flag( nGrbit, EXC_ROW_HIDDEN ) );
@@ -1126,12 +1110,13 @@ void ImportExcel::Bof5( void )
void ImportExcel::EndSheet( void )
{
- pColRowBuff->Convert( GetCurrScTab() );
-
pExcRoot->pExtSheetBuff->Reset();
if( GetBiff() <= EXC_BIFF5 )
+ {
pExcRoot->pExtNameBuff->Reset();
+ mnLastRefIdx = 0;
+ }
FinalizeTable();
}
@@ -1149,7 +1134,7 @@ void ImportExcel::NeueTabelle( void )
pOutlineListBuffer->Append( new XclImpOutlineDataBuffer( GetRoot(), nTab ) );
- pColRowBuff = pOutlineListBuffer->Last()->GetColRowBuff();
+ pExcRoot->pColRowBuff = pColRowBuff = pOutlineListBuffer->Last()->GetColRowBuff();
pColOutlineBuff = pOutlineListBuffer->Last()->GetColOutline();
pRowOutlineBuff = pOutlineListBuffer->Last()->GetRowOutline();
}
diff --git a/sc/source/filter/excel/makefile.mk b/sc/source/filter/excel/makefile.mk
index 7c990aa02a56..d7429978d451 100644
--- a/sc/source/filter/excel/makefile.mk
+++ b/sc/source/filter/excel/makefile.mk
@@ -1,14 +1,14 @@
#*************************************************************************
#
# 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: makefile.mk,v $
#
-# $Revision: 1.42 $
+# $Revision: 1.42.90.3 $
#
# This file is part of OpenOffice.org.
#
@@ -57,7 +57,6 @@ SLOFILES = \
$(SLO)$/excform.obj \
$(SLO)$/excform8.obj \
$(SLO)$/excimp8.obj \
- $(SLO)$/excobj.obj \
$(SLO)$/excrecds.obj \
$(SLO)$/exctools.obj \
$(SLO)$/expop2.obj \
@@ -99,10 +98,8 @@ SLOFILES = \
$(SLO)$/xiview.obj \
$(SLO)$/xladdress.obj \
$(SLO)$/xlchart.obj \
- $(SLO)$/xldumper.obj \
$(SLO)$/xlescher.obj \
$(SLO)$/xlformula.obj \
- $(SLO)$/xlocx.obj \
$(SLO)$/xlpage.obj \
$(SLO)$/xlpivot.obj \
$(SLO)$/xlroot.obj \
@@ -119,10 +116,10 @@ NOOPTFILES = \
EXCEPTIONSFILES = \
$(SLO)$/excdoc.obj \
+ $(SLO)$/excel.obj \
$(SLO)$/excform.obj \
$(SLO)$/excform8.obj \
$(SLO)$/excimp8.obj \
- $(SLO)$/excobj.obj \
$(SLO)$/excrecds.obj \
$(SLO)$/expop2.obj \
$(SLO)$/namebuff.obj \
@@ -152,9 +149,7 @@ EXCEPTIONSFILES = \
$(SLO)$/xladdress.obj \
$(SLO)$/xiescher.obj \
$(SLO)$/xlchart.obj \
- $(SLO)$/xldumper.obj \
$(SLO)$/xlformula.obj \
- $(SLO)$/xlocx.obj \
$(SLO)$/xlpivot.obj \
$(SLO)$/xlstyle.obj \
$(SLO)$/xlview.obj
diff --git a/sc/source/filter/excel/namebuff.cxx b/sc/source/filter/excel/namebuff.cxx
index e243f9bf9504..16ddd53939cf 100644
--- a/sc/source/filter/excel/namebuff.cxx
+++ b/sc/source/filter/excel/namebuff.cxx
@@ -180,9 +180,11 @@ ExtSheetBuffer::~ExtSheetBuffer()
}
-void ExtSheetBuffer::Add( const String& rFPAN, const String& rTN, const BOOL bSWB )
+sal_Int16 ExtSheetBuffer::Add( const String& rFPAN, const String& rTN, const BOOL bSWB )
{
List::Insert( new Cont( rFPAN, rTN, bSWB ), LIST_APPEND );
+ // return 1-based index of EXTERNSHEET
+ return static_cast< sal_Int16 >( List::Count() );
}
diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx
index 73e44a2825be..9029b5867b6e 100644
--- a/sc/source/filter/excel/read.cxx
+++ b/sc/source/filter/excel/read.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: read.cxx,v $
- * $Revision: 1.70 $
+ * $Revision: 1.70.88.4 $
*
* This file is part of OpenOffice.org.
*
@@ -75,8 +75,7 @@ FltError ImportExcel::Read( void )
XclImpNumFmtBuffer& rNumFmtBfr = GetNumFmtBuffer();
XclImpXFBuffer& rXFBfr = GetXFBuffer();
XclImpNameManager& rNameMgr = GetNameManager();
-
- const BOOL bWithDrawLayer = pD->GetDrawLayer() != NULL;
+ XclImpObjectManager& rObjMgr = GetObjectManager();
enum Zustand {
Z_BiffNull, // Nicht in gueltigem Biff-Format
@@ -237,7 +236,7 @@ FltError ImportExcel::Read( void )
case 0x15: rPageSett.ReadHeaderFooter( maStrm ); break;
case 0x17: Externsheet(); break; // EXTERNSHEET [ 2345]
case 0x18: rNameMgr.ReadName( maStrm ); break;
- case 0x1C: Note(); break; // NOTE [ 2345]
+ case 0x1C: rObjMgr.ReadNote( maStrm ); break;
case 0x1D: rTabViewSett.ReadSelection( maStrm ); break;
case 0x1E: rNumFmtBfr.ReadFormat( maStrm ); break;
case 0x20: Columndefault(); break; // COLUMNDEFAULT[ 2 ]
@@ -300,7 +299,7 @@ FltError ImportExcel::Read( void )
case 0x17: Externsheet(); break; // EXTERNSHEET [ 2345]
case 0x1A:
case 0x1B: rPageSett.ReadPageBreaks( maStrm ); break;
- case 0x1C: Note(); break; // NOTE [ 2345]
+ case 0x1C: rObjMgr.ReadNote( maStrm ); break;
case 0x1D: rTabViewSett.ReadSelection( maStrm ); break;
case 0x1E: rNumFmtBfr.ReadFormat( maStrm ); break;
case 0x22: Rec1904(); break; // 1904 [ 2345]
@@ -318,6 +317,7 @@ FltError ImportExcel::Read( void )
case 0x41: rTabViewSett.ReadPane( maStrm ); break;
case 0x42: Codepage(); break; // CODEPAGE [ 2345]
case 0x56: Builtinfmtcnt(); break; // BUILTINFMTCNT[ 34 ]
+ case 0x5D: rObjMgr.ReadObj( maStrm ); break;
case 0x7D: Colinfo(); break; // COLINFO [ 345]
case 0x8C: Country(); break; // COUNTRY [ 345]
case 0x92: rPal.ReadPalette( maStrm ); break;
@@ -369,7 +369,7 @@ FltError ImportExcel::Read( void )
case 0x17: Externsheet(); break; // EXTERNSHEET [ 2345]
case 0x1A:
case 0x1B: rPageSett.ReadPageBreaks( maStrm ); break;
- case 0x1C: Note(); break; // NOTE [ 2345]
+ case 0x1C: rObjMgr.ReadNote( maStrm ); break;
case 0x1D: rTabViewSett.ReadSelection( maStrm ); break;
case 0x22: Rec1904(); break; // 1904 [ 2345]
case 0x26:
@@ -387,6 +387,7 @@ FltError ImportExcel::Read( void )
case 0x42: Codepage(); break; // CODEPAGE [ 2345]
case 0x55: DefColWidth(); break;
case 0x56: Builtinfmtcnt(); break; // BUILTINFMTCNT[ 34 ]
+ case 0x5D: rObjMgr.ReadObj( maStrm ); break;
case 0x7D: Colinfo(); break; // COLINFO [ 345]
case 0x8C: Country(); break; // COUNTRY [ 345]
case 0x92: rPal.ReadPalette( maStrm ); break;
@@ -482,7 +483,7 @@ FltError ImportExcel::Read( void )
case 0x15: rPageSett.ReadHeaderFooter( maStrm ); break;
case 0x1A:
case 0x1B: rPageSett.ReadPageBreaks( maStrm ); break;
- case 0x1C: Note(); break;
+ case 0x1C: rObjMgr.ReadNote( maStrm ); break;
case 0x1D: rTabViewSett.ReadSelection( maStrm ); break;
case 0x2F: // FILEPASS [ 2345]
eLastErr = XclImpDecryptHelper::ReadFilepass( maStrm );
@@ -493,6 +494,7 @@ FltError ImportExcel::Read( void )
case 0x42: Codepage(); break; // CODEPAGE [ 2345]
case 0x55: DefColWidth(); break;
case 0x56: Builtinfmtcnt(); break; // BUILTINFMTCNT[ 34 ]
+ case 0x5D: rObjMgr.ReadObj( maStrm ); break;
case 0x7D: Colinfo(); break; // COLINFO [ 345]
case 0x8C: Country(); break; // COUNTRY [ 345]
case 0x8F: Bundleheader(); break; // BUNDLEHEADER [ 4 ]
@@ -650,7 +652,7 @@ FltError ImportExcel::Read( void )
case 0x14:
case 0x15: rPageSett.ReadHeaderFooter( maStrm ); break;
case 0x17: Externsheet(); break; // EXTERNSHEET [ 2345]
- case 0x1C: Note(); break; // NOTE [ 2345]
+ case 0x1C: rObjMgr.ReadNote( maStrm ); break;
case 0x1D: rTabViewSett.ReadSelection( maStrm ); break;
case 0x23: Externname25(); break; // EXTERNNAME [ 2 5]
case 0x26:
@@ -664,7 +666,7 @@ FltError ImportExcel::Read( void )
if( eLastErr != ERRCODE_NONE )
eAkt = Z_Ende;
break;
- case 0x5D: if( bWithDrawLayer ) Obj(); break;
+ case 0x5D: rObjMgr.ReadObj( maStrm ); break;
case 0x83:
case 0x84: rPageSett.ReadCenter( maStrm ); break;
case 0xA0: rTabViewSett.ReadScl( maStrm ); break;
@@ -1097,7 +1099,6 @@ FltError ImportExcel8::Read( void )
case 0x000C: Calccount(); break; // CALCCOUNT
case 0x0010: Delta(); break; // DELTA
case 0x0011: Iteration(); break; // ITERATION
- case 0x001C: Note(); break; // NOTE [ 2345 ]
case 0x007E:
case 0x00AE: Scenman(); break; // SCENMAN
case 0x00AF: Scenario(); break; // SCENARIO
@@ -1121,9 +1122,12 @@ FltError ImportExcel8::Read( void )
case EXC_ID_HCENTER:
case EXC_ID_VCENTER: rPageSett.ReadCenter( maStrm ); break;
case EXC_ID_SETUP: rPageSett.ReadSetup( maStrm ); break;
- case EXC_ID_BITMAP: rPageSett.ReadBitmap( maStrm ); break;
+ case EXC_ID8_IMGDATA: rPageSett.ReadImgData( maStrm ); break;
case EXC_ID_MSODRAWING: rObjMgr.ReadMsoDrawing( maStrm ); break;
+ // #i61786# weird documents: OBJ without MSODRAWING -> read in BIFF5 format
+ case EXC_ID_OBJ: rObjMgr.ReadObj( maStrm ); break;
+ case EXC_ID_NOTE: rObjMgr.ReadNote( maStrm ); break;
case EXC_ID_HLINK: XclImpHyperlink::ReadHlink( maStrm ); break;
case EXC_ID_LABELRANGES: XclImpLabelranges::ReadLabelranges( maStrm ); break;
diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx
index 368627fdcb25..eaf943791d06 100644
--- a/sc/source/filter/excel/xechart.cxx
+++ b/sc/source/filter/excel/xechart.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xechart.cxx,v $
- * $Revision: 1.11 $
+ * $Revision: 1.10.62.4 $
*
* This file is part of OpenOffice.org.
*
@@ -35,6 +35,7 @@
#include <com/sun/star/i18n/XBreakIterator.hpp>
#include <com/sun/star/i18n/ScriptType.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
@@ -42,6 +43,7 @@
#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
#include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
#include <com/sun/star/chart2/XTitled.hpp>
+#include <com/sun/star/chart2/XColorScheme.hpp>
#include <com/sun/star/chart2/data/XDataSource.hpp>
#include <com/sun/star/chart2/AxisType.hpp>
#include <com/sun/star/chart2/CurveStyle.hpp>
@@ -91,6 +93,7 @@ using ::com::sun::star::chart2::XLegend;
using ::com::sun::star::chart2::XTitled;
using ::com::sun::star::chart2::XTitle;
using ::com::sun::star::chart2::XFormattedString;
+using ::com::sun::star::chart2::XColorScheme;
using ::com::sun::star::chart2::data::XDataSource;
using ::com::sun::star::chart2::data::XLabeledDataSequence;
@@ -231,7 +234,7 @@ void XclExpChRoot::ConvertEscherFormat(
const ScfPropertySet& rPropSet, XclChPropertyMode ePropMode ) const
{
GetChartPropSetHelper().ReadEscherProperties( rEscherFmt, rPicFmt,
- mxChData->GetGradientTable(), mxChData->GetBitmapTable(), rPropSet, ePropMode );
+ mxChData->GetGradientTable(), mxChData->GetHatchTable(), mxChData->GetBitmapTable(), rPropSet, ePropMode );
}
sal_uInt16 XclExpChRoot::ConvertFont( const ScfPropertySet& rPropSet, sal_Int16 nScript ) const
@@ -311,8 +314,8 @@ void XclExpChLineFormat::Convert( const XclExpChRoot& rRoot,
rRoot.ConvertLineFormat( maData, rPropSet, rFmtInfo.mePropMode );
if( HasLine() )
{
- // detect system color, set color identifier
- if( rRoot.IsSystemColor( maData.maColor, rFmtInfo.mnAutoLineColorIdx ) )
+ // detect system color, set color identifier (TODO: detect automatic series line)
+ if( (eObjType != EXC_CHOBJTYPE_LINEARSERIES) && rRoot.IsSystemColor( maData.maColor, rFmtInfo.mnAutoLineColorIdx ) )
{
// store color index from automatic format data
mnColorId = XclExpPalette::GetColorIdFromIndex( rFmtInfo.mnAutoLineColorIdx );
@@ -380,8 +383,8 @@ bool XclExpChAreaFormat::Convert( const XclExpChRoot& rRoot,
if( HasArea() )
{
bool bSolid = maData.mnPattern == EXC_PATT_SOLID;
- // detect system color, set color identifier
- if( rRoot.IsSystemColor( maData.maPattColor, rFmtInfo.mnAutoPattColorIdx ) )
+ // detect system color, set color identifier (TODO: detect automatic series area)
+ if( (eObjType != EXC_CHOBJTYPE_FILLEDSERIES) && rRoot.IsSystemColor( maData.maPattColor, rFmtInfo.mnAutoPattColorIdx ) )
{
// store color index from automatic format data
mnPattColorId = XclExpPalette::GetColorIdFromIndex( rFmtInfo.mnAutoPattColorIdx );
@@ -686,7 +689,7 @@ sal_uInt16 XclExpChSourceLink::ConvertDataSequence( Reference< XDataSequence > x
}
mxLinkFmla = GetFormulaCompiler().CreateFormula( EXC_FMLATYPE_CHART, aNewScRanges );
maData.mnLinkType = EXC_CHSRCLINK_WORKSHEET;
- nValueCount = limit_cast< sal_uInt16 >( aScRanges.GetCellCount() );
+ nValueCount = ulimit_cast< sal_uInt16 >( aScRanges.GetCellCount(), EXC_CHDATAFORMAT_MAXPOINTCOUNT );
}
}
return nValueCount;
@@ -1466,7 +1469,8 @@ XclExpChSeries::XclExpChSeries( const XclExpChRoot& rRoot, sal_uInt16 nSeriesIdx
mxBubbleLink.reset( new XclExpChSourceLink( GetChRoot(), EXC_CHSRCLINK_BUBBLES ) );
}
-bool XclExpChSeries::ConvertDataSeries( Reference< XDataSeries > xDataSeries,
+bool XclExpChSeries::ConvertDataSeries(
+ Reference< XDiagram > xDiagram, Reference< XDataSeries > xDataSeries,
const XclChExtTypeInfo& rTypeInfo, sal_uInt16 nGroupIdx, sal_uInt16 nFormatIdx )
{
bool bOk = false;
@@ -1524,20 +1528,51 @@ bool XclExpChSeries::ConvertDataSeries( Reference< XDataSeries > xDataSeries,
CreateErrorBars( aSeriesProp, EXC_CHPROP_ERRORBARX, EXC_CHSERERR_XPLUS, EXC_CHSERERR_XMINUS );
CreateErrorBars( aSeriesProp, EXC_CHPROP_ERRORBARY, EXC_CHSERERR_YPLUS, EXC_CHSERERR_YMINUS );
- // data point formatting
- Sequence< sal_Int32 > aPointIndexes;
- if( (maData.mnValueCount > 0) && aSeriesProp.GetProperty( aPointIndexes, EXC_CHPROP_ATTRIBDATAPOINTS ) )
+ if( maData.mnValueCount > 0 )
{
- const sal_Int32* pnBeg = aPointIndexes.getConstArray();
- const sal_Int32* pnEnd = pnBeg + aPointIndexes.getLength();
- const sal_Int32 nMaxPointIdx = ::std::min< sal_Int32 >( maData.mnValueCount - 1, EXC_CHDATAFORMAT_MAXPOINT );
- for( const sal_Int32* pnIt = pnBeg; (pnIt != pnEnd) && (*pnIt <= nMaxPointIdx); ++pnIt )
+ const sal_Int32 nMaxPointCount = maData.mnValueCount;
+
+ /* #i91063# Create missing fill properties in pie/doughnut charts.
+ If freshly created (never saved to ODF), these charts show
+ varying point colors but do not return these points via API. */
+ if( xDiagram.is() && (rTypeInfo.meTypeCateg == EXC_CHTYPECATEG_PIE) )
{
- aPointPos.mnPointIdx = static_cast< sal_uInt16 >( *pnIt );
- ScfPropertySet aPointProp = lclGetPointPropSet( xDataSeries, *pnIt );
- XclExpChDataFormatRef xPointFmt( new XclExpChDataFormat( GetChRoot(), aPointPos, nFormatIdx ) );
- xPointFmt->ConvertDataSeries( aPointProp, rTypeInfo );
- maPointFmts.AppendRecord( xPointFmt );
+ Reference< XColorScheme > xColorScheme = xDiagram->getDefaultColorScheme();
+ if( xColorScheme.is() )
+ {
+ const OUString aFillStyleName = CREATE_OUSTRING( "FillStyle" );
+ const OUString aColorName = CREATE_OUSTRING( "Color" );
+ namespace csscd = ::com::sun::star::drawing;
+ for( sal_Int32 nPointIdx = 0; nPointIdx < nMaxPointCount; ++nPointIdx )
+ {
+ aPointPos.mnPointIdx = static_cast< sal_uInt16 >( nPointIdx );
+ ScfPropertySet aPointProp = lclGetPointPropSet( xDataSeries, nPointIdx );
+ // test that the point fill style is solid, but no color is set
+ csscd::FillStyle eFillStyle = csscd::FillStyle_NONE;
+ if( aPointProp.GetProperty( eFillStyle, aFillStyleName ) &&
+ (eFillStyle == csscd::FillStyle_SOLID) &&
+ !aPointProp.HasProperty( aColorName ) )
+ {
+ aPointProp.SetProperty( aColorName, xColorScheme->getColorByIndex( nPointIdx ) );
+ }
+ }
+ }
+ }
+
+ // data point formatting
+ Sequence< sal_Int32 > aPointIndexes;
+ if( aSeriesProp.GetProperty( aPointIndexes, EXC_CHPROP_ATTRIBDATAPOINTS ) && aPointIndexes.hasElements() )
+ {
+ const sal_Int32* pnBeg = aPointIndexes.getConstArray();
+ const sal_Int32* pnEnd = pnBeg + aPointIndexes.getLength();
+ for( const sal_Int32* pnIt = pnBeg; (pnIt != pnEnd) && (*pnIt < nMaxPointCount); ++pnIt )
+ {
+ aPointPos.mnPointIdx = static_cast< sal_uInt16 >( *pnIt );
+ ScfPropertySet aPointProp = lclGetPointPropSet( xDataSeries, *pnIt );
+ XclExpChDataFormatRef xPointFmt( new XclExpChDataFormat( GetChRoot(), aPointPos, nFormatIdx ) );
+ xPointFmt->ConvertDataSeries( aPointProp, rTypeInfo );
+ maPointFmts.AppendRecord( xPointFmt );
+ }
}
}
}
@@ -1946,7 +1981,8 @@ void XclExpChTypeGroup::ConvertType(
}
}
-void XclExpChTypeGroup::ConvertSeries( Reference< XChartType > xChartType,
+void XclExpChTypeGroup::ConvertSeries(
+ Reference< XDiagram > xDiagram, Reference< XChartType > xChartType,
sal_Int32 nGroupAxesSetIdx, bool bPercent, bool bConnectBars )
{
Reference< XDataSeriesContainer > xSeriesCont( xChartType, UNO_QUERY );
@@ -2008,7 +2044,7 @@ void XclExpChTypeGroup::ConvertSeries( Reference< XChartType > xChartType,
if( maTypeInfo.meTypeId == EXC_CHTYPEID_STOCK )
CreateAllStockSeries( xChartType, *aIt );
else
- CreateDataSeries( *aIt );
+ CreateDataSeries( xDiagram, *aIt );
}
}
}
@@ -2045,13 +2081,14 @@ sal_uInt16 XclExpChTypeGroup::GetFreeFormatIdx() const
return static_cast< sal_uInt16 >( maSeries.GetSize() );
}
-void XclExpChTypeGroup::CreateDataSeries( Reference< XDataSeries > xDataSeries )
+void XclExpChTypeGroup::CreateDataSeries(
+ Reference< XDiagram > xDiagram, Reference< XDataSeries > xDataSeries )
{
// let chart create series object with correct series index
XclExpChSeriesRef xSeries = GetChartData().CreateSeries();
if( xSeries.is() )
{
- if( xSeries->ConvertDataSeries( xDataSeries, maTypeInfo, GetGroupIdx(), GetFreeFormatIdx() ) )
+ if( xSeries->ConvertDataSeries( xDiagram, xDataSeries, maTypeInfo, GetGroupIdx(), GetFreeFormatIdx() ) )
maSeries.AppendRecord( xSeries );
else
GetChartData().RemoveLastSeries();
@@ -2485,11 +2522,11 @@ sal_uInt16 XclExpChAxesSet::Convert( Reference< XDiagram > xDiagram, sal_uInt16
XclExpChTypeGroupRef xLastGroup = GetLastTypeGroup();
if( xLastGroup.is() && !(xTypeGroup->IsCombinable2d() && xLastGroup->IsCombinable2d()) )
{
- xLastGroup->ConvertSeries( *pIt, nApiAxesSetIdx, bPercent, bConnectBars );
+ xLastGroup->ConvertSeries( xDiagram, *pIt, nApiAxesSetIdx, bPercent, bConnectBars );
}
else
{
- xTypeGroup->ConvertSeries( *pIt, nApiAxesSetIdx, bPercent, bConnectBars );
+ xTypeGroup->ConvertSeries( xDiagram, *pIt, nApiAxesSetIdx, bPercent, bConnectBars );
if( xTypeGroup->IsValidGroup() )
{
maTypeGroups.AppendRecord( xTypeGroup );
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index d09b4370711e..1bf7c0060532 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xeescher.cxx,v $
- * $Revision: 1.24 $
+ * $Revision: 1.24.90.8 $
*
* This file is part of OpenOffice.org.
*
@@ -44,7 +44,7 @@
#include <com/sun/star/form/binding/XListEntrySource.hpp>
#include <com/sun/star/script/ScriptEventDescriptor.hpp>
-#include <svx/unoapi.hxx>
+#include <vcl/bmpacc.hxx>
#include <svx/svdoole2.hxx>
#include "editutil.hxx"
@@ -79,24 +79,74 @@ using ::com::sun::star::table::CellRangeAddress;
// ============================================================================
-XclExpControlObjHelper::XclExpControlObjHelper( const XclExpRoot& rRoot ) :
+XclExpImgData::XclExpImgData( const Graphic& rGraphic, sal_uInt16 nRecId ) :
+ maGraphic( rGraphic ),
+ mnRecId( nRecId )
+{
+}
+
+void XclExpImgData::Save( XclExpStream& rStrm )
+{
+ Bitmap aBmp = maGraphic.GetBitmap();
+ if( aBmp.GetBitCount() != 24 )
+ aBmp.Convert( BMP_CONVERSION_24BIT );
+
+ if( BitmapReadAccess* pAccess = aBmp.AcquireReadAccess() )
+ {
+ sal_Int32 nWidth = ::std::min< sal_Int32 >( pAccess->Width(), 0xFFFF );
+ sal_Int32 nHeight = ::std::min< sal_Int32 >( pAccess->Height(), 0xFFFF );
+ if( (nWidth > 0) && (nHeight > 0) )
+ {
+ sal_uInt8 nPadding = static_cast< sal_uInt8 >( nWidth & 0x03 );
+ sal_uInt32 nTmpSize = static_cast< sal_uInt32 >( (nWidth * 3 + nPadding) * nHeight + 12 );
+
+ rStrm.StartRecord( mnRecId, nTmpSize + 4 );
+
+ rStrm << EXC_IMGDATA_BMP // BMP format
+ << EXC_IMGDATA_WIN // Windows
+ << nTmpSize // size after _this_ field
+ << sal_uInt32( 12 ) // BITMAPCOREHEADER size
+ << static_cast< sal_uInt16 >( nWidth ) // width
+ << static_cast< sal_uInt16 >( nHeight ) // height
+ << sal_uInt16( 1 ) // planes
+ << sal_uInt16( 24 ); // bits per pixel
+
+ for( sal_Int32 nY = nHeight - 1; nY >= 0; --nY )
+ {
+ for( sal_Int32 nX = 0; nX < nWidth; ++nX )
+ {
+ const BitmapColor& rBmpColor = pAccess->GetPixel( nY, nX );
+ rStrm << rBmpColor.GetBlue() << rBmpColor.GetGreen() << rBmpColor.GetRed();
+ }
+ rStrm.WriteZeroBytes( nPadding );
+ }
+
+ rStrm.EndRecord();
+ }
+ aBmp.ReleaseAccess( pAccess );
+ }
+}
+
+// ============================================================================
+
+XclExpControlHelper::XclExpControlHelper( const XclExpRoot& rRoot ) :
XclExpRoot( rRoot ),
mnEntryCount( 0 )
{
}
-XclExpControlObjHelper::~XclExpControlObjHelper()
+XclExpControlHelper::~XclExpControlHelper()
{
}
-void XclExpControlObjHelper::ConvertSheetLinks( Reference< XShape > xShape )
+void XclExpControlHelper::ConvertSheetLinks( Reference< XShape > xShape )
{
mxCellLink.reset();
mxSrcRange.reset();
mnEntryCount = 0;
// get control model
- Reference< XControlModel > xCtrlModel = XclControlObjHelper::GetModelFromShape( xShape );
+ Reference< XControlModel > xCtrlModel = XclControlHelper::GetControlModel( xShape );
if( !xCtrlModel.is() )
return;
@@ -142,7 +192,7 @@ void XclExpControlObjHelper::ConvertSheetLinks( Reference< XShape > xShape )
}
}
-void XclExpControlObjHelper::WriteFormula( XclExpStream& rStrm, const XclTokenArray& rTokArr ) const
+void XclExpControlHelper::WriteFormula( XclExpStream& rStrm, const XclTokenArray& rTokArr ) const
{
sal_uInt16 nFmlaSize = rTokArr.GetSize();
rStrm << nFmlaSize << sal_uInt32( 0 );
@@ -151,7 +201,7 @@ void XclExpControlObjHelper::WriteFormula( XclExpStream& rStrm, const XclTokenAr
rStrm << sal_uInt8( 0 );
}
-void XclExpControlObjHelper::WriteFormulaSubRec( XclExpStream& rStrm, sal_uInt16 nSubRecId, const XclTokenArray& rTokArr ) const
+void XclExpControlHelper::WriteFormulaSubRec( XclExpStream& rStrm, sal_uInt16 nSubRecId, const XclTokenArray& rTokArr ) const
{
rStrm.StartRecord( nSubRecId, (rTokArr.GetSize() + 5) & ~1 );
WriteFormula( rStrm, rTokArr );
@@ -164,13 +214,13 @@ void XclExpControlObjHelper::WriteFormulaSubRec( XclExpStream& rStrm, sal_uInt16
XclExpOcxControlObj::XclExpOcxControlObj( const XclExpRoot& rRoot, Reference< XShape > xShape,
const String& rClassName, sal_uInt32 nStrmStart, sal_uInt32 nStrmSize ) :
- XclObj( rRoot, EXC_OBJ_CMO_PICTURE, true ),
- XclExpControlObjHelper( rRoot ),
+ XclObj( rRoot, EXC_OBJTYPE_PICTURE, true ),
+ XclExpControlHelper( rRoot ),
maClassName( rClassName ),
mnStrmStart( nStrmStart ),
mnStrmSize( nStrmSize )
{
- ScfPropertySet aCtrlProp( XclControlObjHelper::GetModelFromShape( xShape ) );
+ ScfPropertySet aCtrlProp( XclControlHelper::GetControlModel( xShape ) );
// OBJ record flags
SetLocked( TRUE );
@@ -207,8 +257,8 @@ XclExpOcxControlObj::XclExpOcxControlObj( const XclExpRoot& rRoot, Reference< XS
aPropOpt.Commit( rEscherEx.GetStream() );
// anchor
- if( SdrObject* pSdrObj = ::GetSdrObjectFromXShape( xShape ) )
- XclExpEscherAnchor( rRoot, *pSdrObj ).WriteData( rEscherEx );
+ if( SdrObject* pSdrObj = SdrObject::getSdrObjectFromXShape( xShape ) )
+ XclExpDffAnchor( rRoot, *pSdrObj ).WriteData( rEscherEx );
rEscherEx.AddAtom( 0, ESCHER_ClientData ); // OBJ record
rEscherEx.CloseContainer(); // ESCHER_SpContainer
@@ -220,17 +270,17 @@ XclExpOcxControlObj::XclExpOcxControlObj( const XclExpRoot& rRoot, Reference< XS
void XclExpOcxControlObj::WriteSubRecs( XclExpStream& rStrm )
{
- // ftCf - clipboard format
- rStrm.StartRecord( EXC_ID_OBJ_FTCF, 2 );
+ // OBJCF - clipboard format
+ rStrm.StartRecord( EXC_ID_OBJCF, 2 );
rStrm << sal_uInt16( 2 );
rStrm.EndRecord();
- // ftPioGrbit
- rStrm.StartRecord( EXC_ID_OBJ_FTPIOGRBIT, 2 );
+ // OBJFLAGS
+ rStrm.StartRecord( EXC_ID_OBJFLAGS, 2 );
rStrm << sal_uInt16( 0x0031 );
rStrm.EndRecord();
- // ftPictFmla
+ // OBJPICTFMLA
XclExpString aClass( maClassName );
sal_uInt16 nClassNameSize = static_cast< sal_uInt16 >( aClass.GetSize() );
sal_uInt16 nClassNamePad = nClassNameSize & 1;
@@ -243,7 +293,7 @@ void XclExpOcxControlObj::WriteSubRecs( XclExpStream& rStrm )
sal_uInt16 nSrcRangeSize = pSrcRange ? ((pSrcRange->GetSize() + 7) & 0xFFFE) : 0;
sal_uInt16 nPictFmlaSize = nFirstPartSize + nCellLinkSize + nSrcRangeSize + 18;
- rStrm.StartRecord( EXC_ID_OBJ_FTPICTFMLA, nPictFmlaSize );
+ rStrm.StartRecord( EXC_ID_OBJPICTFMLA, nPictFmlaSize );
rStrm << sal_uInt16( nFirstPartSize ) // size of first part
<< sal_uInt16( 5 ) // formula size
@@ -254,7 +304,7 @@ void XclExpOcxControlObj::WriteSubRecs( XclExpStream& rStrm )
rStrm.WriteZeroBytes( nClassNamePad ); // pad to word
rStrm << mnStrmStart // start in 'Ctls' stream
<< mnStrmSize // size in 'Ctls' stream
- << sal_uInt32( 0 ); // unknown
+ << sal_uInt32( 0 ); // class ID size
// cell link
rStrm << nCellLinkSize;
if( pCellLink )
@@ -270,8 +320,8 @@ void XclExpOcxControlObj::WriteSubRecs( XclExpStream& rStrm )
#else
XclExpTbxControlObj::XclExpTbxControlObj( const XclExpRoot& rRoot, Reference< XShape > xShape ) :
- XclObj( rRoot, EXC_OBJ_CMO_UNKNOWN, true ),
- XclExpControlObjHelper( rRoot ),
+ XclObj( rRoot, EXC_OBJTYPE_UNKNOWN, true ),
+ XclExpControlHelper( rRoot ),
mnHeight( 0 ),
mnState( 0 ),
mnLineCount( 0 ),
@@ -290,7 +340,7 @@ XclExpTbxControlObj::XclExpTbxControlObj( const XclExpRoot& rRoot, Reference< XS
namespace AwtVisualEffect = ::com::sun::star::awt::VisualEffect;
namespace AwtScrollOrient = ::com::sun::star::awt::ScrollBarOrientation;
- ScfPropertySet aCtrlProp( XclControlObjHelper::GetModelFromShape( xShape ) );
+ ScfPropertySet aCtrlProp( XclControlHelper::GetControlModel( xShape ) );
if( !xShape.is() || !aCtrlProp.Is() )
return;
@@ -304,18 +354,18 @@ XclExpTbxControlObj::XclExpTbxControlObj( const XclExpRoot& rRoot, Reference< XS
{
switch( nClassId )
{
- case FormCompType::COMMANDBUTTON: mnObjType = EXC_OBJ_CMO_BUTTON; break;
- case FormCompType::RADIOBUTTON: mnObjType = EXC_OBJ_CMO_OPTIONBUTTON; break;
- case FormCompType::CHECKBOX: mnObjType = EXC_OBJ_CMO_CHECKBOX; break;
- case FormCompType::LISTBOX: mnObjType = EXC_OBJ_CMO_LISTBOX; break;
- case FormCompType::COMBOBOX: mnObjType = EXC_OBJ_CMO_COMBOBOX; break;
- case FormCompType::GROUPBOX: mnObjType = EXC_OBJ_CMO_GROUPBOX; break;
- case FormCompType::FIXEDTEXT: mnObjType = EXC_OBJ_CMO_LABEL; break;
- case FormCompType::SCROLLBAR: mnObjType = EXC_OBJ_CMO_SCROLLBAR; break;
- case FormCompType::SPINBUTTON: mnObjType = EXC_OBJ_CMO_SPIN; break;
+ case FormCompType::COMMANDBUTTON: mnObjType = EXC_OBJTYPE_BUTTON; meEventType = EXC_TBX_EVENT_ACTION; break;
+ case FormCompType::RADIOBUTTON: mnObjType = EXC_OBJTYPE_OPTIONBUTTON; meEventType = EXC_TBX_EVENT_ACTION; break;
+ case FormCompType::CHECKBOX: mnObjType = EXC_OBJTYPE_CHECKBOX; meEventType = EXC_TBX_EVENT_ACTION; break;
+ case FormCompType::LISTBOX: mnObjType = EXC_OBJTYPE_LISTBOX; meEventType = EXC_TBX_EVENT_CHANGE; break;
+ case FormCompType::COMBOBOX: mnObjType = EXC_OBJTYPE_DROPDOWN; meEventType = EXC_TBX_EVENT_CHANGE; break;
+ case FormCompType::GROUPBOX: mnObjType = EXC_OBJTYPE_GROUPBOX; meEventType = EXC_TBX_EVENT_MOUSE; break;
+ case FormCompType::FIXEDTEXT: mnObjType = EXC_OBJTYPE_LABEL; meEventType = EXC_TBX_EVENT_MOUSE; break;
+ case FormCompType::SCROLLBAR: mnObjType = EXC_OBJTYPE_SCROLLBAR; meEventType = EXC_TBX_EVENT_VALUE; break;
+ case FormCompType::SPINBUTTON: mnObjType = EXC_OBJTYPE_SPIN; meEventType = EXC_TBX_EVENT_VALUE; break;
}
}
- if( mnObjType == EXC_OBJ_CMO_UNKNOWN )
+ if( mnObjType == EXC_OBJTYPE_UNKNOWN )
return;
// OBJ record flags
@@ -345,8 +395,8 @@ XclExpTbxControlObj::XclExpTbxControlObj( const XclExpRoot& rRoot, Reference< XS
aPropOpt.Commit( rEscherEx.GetStream() );
// anchor
- if( SdrObject* pSdrObj = ::GetSdrObjectFromXShape( xShape ) )
- XclExpEscherAnchor( rRoot, *pSdrObj ).WriteData( rEscherEx );
+ if( SdrObject* pSdrObj = SdrObject::getSdrObjectFromXShape( xShape ) )
+ XclExpDffAnchor( rRoot, *pSdrObj ).WriteData( rEscherEx );
rEscherEx.AddAtom( 0, ESCHER_ClientData ); // OBJ record
pMsodrawing->UpdateStopPos();
@@ -371,8 +421,8 @@ XclExpTbxControlObj::XclExpTbxControlObj( const XclExpRoot& rRoot, Reference< XS
}
pTxo = new XclTxo( aString, nXclFont );
- pTxo->SetHorAlign( (mnObjType == EXC_OBJ_CMO_BUTTON) ? EXC_TXO_HOR_CENTER : EXC_TXO_HOR_LEFT );
- pTxo->SetVerAlign( EXC_TXO_VER_CENTER );
+ pTxo->SetHorAlign( (mnObjType == EXC_OBJTYPE_BUTTON) ? EXC_OBJ_HOR_CENTER : EXC_OBJ_HOR_LEFT );
+ pTxo->SetVerAlign( EXC_OBJ_VER_CENTER );
}
rEscherEx.CloseContainer(); // ESCHER_SpContainer
@@ -423,9 +473,9 @@ XclExpTbxControlObj::XclExpTbxControlObj( const XclExpRoot& rRoot, Reference< XS
{
switch( nApiState )
{
- case 0: mnState = EXC_OBJ_CBLS_STATE_UNCHECK; break;
- case 1: mnState = EXC_OBJ_CBLS_STATE_CHECK; break;
- case 2: mnState = EXC_OBJ_CBLS_STATE_TRI; break;
+ case 0: mnState = EXC_OBJ_CHECKBOX_UNCHECKED; break;
+ case 1: mnState = EXC_OBJ_CHECKBOX_CHECKED; break;
+ case 2: mnState = EXC_OBJ_CHECKBOX_TRISTATE; break;
}
}
@@ -448,9 +498,9 @@ XclExpTbxControlObj::XclExpTbxControlObj( const XclExpRoot& rRoot, Reference< XS
}
}
- // convert listbox with dropdown button to Excel combobox
+ // convert listbox with dropdown button to Excel dropdown
if( aCtrlProp.GetBoolProperty( CREATE_OUSTRING( "Dropdown" ) ) )
- mnObjType = EXC_OBJ_CMO_COMBOBOX;
+ mnObjType = EXC_OBJTYPE_DROPDOWN;
}
break;
@@ -473,7 +523,7 @@ XclExpTbxControlObj::XclExpTbxControlObj( const XclExpRoot& rRoot, Reference< XS
// convert combobox without dropdown button to Excel listbox
if( !aCtrlProp.GetBoolProperty( CREATE_OUSTRING( "Dropdown" ) ) )
- mnObjType = EXC_OBJ_CMO_LISTBOX;
+ mnObjType = EXC_OBJTYPE_LISTBOX;
}
break;
@@ -481,15 +531,15 @@ XclExpTbxControlObj::XclExpTbxControlObj( const XclExpRoot& rRoot, Reference< XS
{
sal_Int32 nApiValue = 0;
if( aCtrlProp.GetProperty( nApiValue, CREATE_OUSTRING( "ScrollValueMin" ) ) )
- mnScrollMin = limit_cast< sal_Int16 >( nApiValue, EXC_OBJ_SBS_MINSCROLL, EXC_OBJ_SBS_MAXSCROLL );
+ mnScrollMin = limit_cast< sal_uInt16 >( nApiValue, EXC_OBJ_SCROLLBAR_MIN, EXC_OBJ_SCROLLBAR_MAX );
if( aCtrlProp.GetProperty( nApiValue, CREATE_OUSTRING( "ScrollValueMax" ) ) )
- mnScrollMax = limit_cast< sal_Int16 >( nApiValue, mnScrollMin, EXC_OBJ_SBS_MAXSCROLL );
+ mnScrollMax = limit_cast< sal_uInt16 >( nApiValue, mnScrollMin, EXC_OBJ_SCROLLBAR_MIN );
if( aCtrlProp.GetProperty( nApiValue, CREATE_OUSTRING( "ScrollValue" ) ) )
- mnScrollValue = limit_cast< sal_Int16 >( nApiValue, mnScrollMin, mnScrollMax );
+ mnScrollValue = limit_cast< sal_uInt16 >( nApiValue, mnScrollMin, mnScrollMax );
if( aCtrlProp.GetProperty( nApiValue, CREATE_OUSTRING( "LineIncrement" ) ) )
- mnScrollStep = limit_cast< sal_Int16 >( nApiValue, EXC_OBJ_SBS_MINSCROLL, EXC_OBJ_SBS_MAXSCROLL );
+ mnScrollStep = limit_cast< sal_uInt16 >( nApiValue, EXC_OBJ_SCROLLBAR_MIN, EXC_OBJ_SCROLLBAR_MAX );
if( aCtrlProp.GetProperty( nApiValue, CREATE_OUSTRING( "BlockIncrement" ) ) )
- mnScrollPage = limit_cast< sal_Int16 >( nApiValue, EXC_OBJ_SBS_MINSCROLL, EXC_OBJ_SBS_MAXSCROLL );
+ mnScrollPage = limit_cast< sal_uInt16 >( nApiValue, EXC_OBJ_SCROLLBAR_MIN, EXC_OBJ_SCROLLBAR_MAX );
if( aCtrlProp.GetProperty( nApiValue, CREATE_OUSTRING( "Orientation" ) ) )
mbScrollHor = nApiValue == AwtScrollOrient::HORIZONTAL;
}
@@ -499,13 +549,13 @@ XclExpTbxControlObj::XclExpTbxControlObj( const XclExpRoot& rRoot, Reference< XS
{
sal_Int32 nApiValue = 0;
if( aCtrlProp.GetProperty( nApiValue, CREATE_OUSTRING( "SpinValueMin" ) ) )
- mnScrollMin = limit_cast< sal_Int16 >( nApiValue, EXC_OBJ_SBS_MINSCROLL, EXC_OBJ_SBS_MAXSCROLL );
+ mnScrollMin = limit_cast< sal_uInt16 >( nApiValue, EXC_OBJ_SCROLLBAR_MIN, EXC_OBJ_SCROLLBAR_MAX );
if( aCtrlProp.GetProperty( nApiValue, CREATE_OUSTRING( "SpinValueMax" ) ) )
- mnScrollMax = limit_cast< sal_Int16 >( nApiValue, mnScrollMin, EXC_OBJ_SBS_MAXSCROLL );
+ mnScrollMax = limit_cast< sal_uInt16 >( nApiValue, mnScrollMin, EXC_OBJ_SCROLLBAR_MAX );
if( aCtrlProp.GetProperty( nApiValue, CREATE_OUSTRING( "SpinValue" ) ) )
- mnScrollValue = limit_cast< sal_Int16 >( nApiValue, mnScrollMin, mnScrollMax );
+ mnScrollValue = limit_cast< sal_uInt16 >( nApiValue, mnScrollMin, mnScrollMax );
if( aCtrlProp.GetProperty( nApiValue, CREATE_OUSTRING( "SpinIncrement" ) ) )
- mnScrollStep = limit_cast< sal_Int16 >( nApiValue, EXC_OBJ_SBS_MINSCROLL, EXC_OBJ_SBS_MAXSCROLL );
+ mnScrollStep = limit_cast< sal_uInt16 >( nApiValue, EXC_OBJ_SCROLLBAR_MIN, EXC_OBJ_SCROLLBAR_MAX );
if( aCtrlProp.GetProperty( nApiValue, CREATE_OUSTRING( "Orientation" ) ) )
mbScrollHor = nApiValue == AwtScrollOrient::HORIZONTAL;
}
@@ -518,19 +568,13 @@ XclExpTbxControlObj::XclExpTbxControlObj( const XclExpRoot& rRoot, Reference< XS
bool XclExpTbxControlObj::SetMacroLink( const ScriptEventDescriptor& rEvent )
{
- if( rEvent.ListenerType.getLength() && (rEvent.ListenerType == XclControlObjHelper::GetTbxListenerType( mnObjType )) &&
- rEvent.EventMethod.getLength() && (rEvent.EventMethod == XclControlObjHelper::GetTbxEventMethod( mnObjType )) &&
- (rEvent.ScriptType == XclControlObjHelper::GetTbxScriptType()) )
+ String aMacroName = XclControlHelper::ExtractFromMacroDescriptor( rEvent, meEventType );
+ if( aMacroName.Len() )
{
- // macro name is stored in a NAME record, and referred to by a formula containing a tNameXR token
- String aMacroName( XclControlObjHelper::GetXclMacroName( rEvent.ScriptCode ) );
- if( aMacroName.Len() )
- {
- sal_uInt16 nExtSheet = GetLocalLinkManager().FindExtSheet( EXC_EXTSH_OWNDOC );
- sal_uInt16 nNameIdx = GetNameManager().InsertMacroCall( aMacroName, true, false );
- mxMacroLink = GetFormulaCompiler().CreateNameXFormula( nExtSheet, nNameIdx );
- return true;
- }
+ sal_uInt16 nExtSheet = GetLocalLinkManager().FindExtSheet( EXC_EXTSH_OWNDOC );
+ sal_uInt16 nNameIdx = GetNameManager().InsertMacroCall( aMacroName, true, false );
+ mxMacroLink = GetFormulaCompiler().CreateNameXFormula( nExtSheet, nNameIdx );
+ return true;
}
return false;
}
@@ -541,22 +585,22 @@ void XclExpTbxControlObj::WriteSubRecs( XclExpStream& rStrm )
{
// *** Push buttons, labels ***
- case EXC_OBJ_CMO_BUTTON:
- case EXC_OBJ_CMO_LABEL:
+ case EXC_OBJTYPE_BUTTON:
+ case EXC_OBJTYPE_LABEL:
// ftMacro - macro link
WriteMacroSubRec( rStrm );
break;
// *** Check boxes, option buttons ***
- case EXC_OBJ_CMO_CHECKBOX:
- case EXC_OBJ_CMO_OPTIONBUTTON:
+ case EXC_OBJTYPE_CHECKBOX:
+ case EXC_OBJTYPE_OPTIONBUTTON:
{
// ftCbls - box properties
sal_uInt16 nStyle = 0;
- ::set_flag( nStyle, EXC_OBJ_CBLS_FLAT, mbFlatButton );
+ ::set_flag( nStyle, EXC_OBJ_CHECKBOX_FLAT, mbFlatButton );
- rStrm.StartRecord( EXC_ID_OBJ_FTCBLS, 12 );
+ rStrm.StartRecord( EXC_ID_OBJCBLS, 12 );
rStrm << mnState;
rStrm.WriteZeroBytes( 8 );
rStrm << nStyle;
@@ -565,40 +609,48 @@ void XclExpTbxControlObj::WriteSubRecs( XclExpStream& rStrm )
// ftMacro - macro link
WriteMacroSubRec( rStrm );
// ftCblsFmla subrecord - cell link
- WriteCellLinkSubRec( rStrm, EXC_ID_OBJ_FTCBLSFMLA );
+ WriteCellLinkSubRec( rStrm, EXC_ID_OBJCBLSFMLA );
+
+ // ftCblsData subrecord - box properties, again
+ rStrm.StartRecord( EXC_ID_OBJCBLS, 8 );
+ rStrm << mnState;
+ rStrm.WriteZeroBytes( 4 );
+ rStrm << nStyle;
+ rStrm.EndRecord();
}
break;
// *** List boxes, combo boxes ***
- case EXC_OBJ_CMO_LISTBOX:
- case EXC_OBJ_CMO_COMBOBOX:
+ case EXC_OBJTYPE_LISTBOX:
+ case EXC_OBJTYPE_DROPDOWN:
{
sal_uInt16 nEntryCount = GetSourceEntryCount();
// ftSbs subrecord - Scroll bars
sal_Int32 nLineHeight = XclTools::GetHmmFromTwips( 200 ); // always 10pt
- if( mnObjType == EXC_OBJ_CMO_LISTBOX )
+ if( mnObjType == EXC_OBJTYPE_LISTBOX )
mnLineCount = static_cast< sal_uInt16 >( mnHeight / nLineHeight );
mnScrollValue = 0;
mnScrollMin = 0;
sal_uInt16 nInvisLines = (nEntryCount >= mnLineCount) ? (nEntryCount - mnLineCount) : 0;
- mnScrollMax = limit_cast< sal_Int16 >( nInvisLines, EXC_OBJ_SBS_MINSCROLL, EXC_OBJ_SBS_MAXSCROLL );
+ mnScrollMax = limit_cast< sal_uInt16 >( nInvisLines, EXC_OBJ_SCROLLBAR_MIN, EXC_OBJ_SCROLLBAR_MAX );
mnScrollStep = 1;
- mnScrollPage = limit_cast< sal_Int16 >( mnLineCount, EXC_OBJ_SBS_MINSCROLL, EXC_OBJ_SBS_MAXSCROLL );
+ mnScrollPage = limit_cast< sal_uInt16 >( mnLineCount, EXC_OBJ_SCROLLBAR_MIN, EXC_OBJ_SCROLLBAR_MAX );
mbScrollHor = false;
WriteSbs( rStrm );
// ftMacro - macro link
WriteMacroSubRec( rStrm );
// ftSbsFmla subrecord - cell link
- WriteCellLinkSubRec( rStrm, EXC_ID_OBJ_FTSBSFMLA );
+ WriteCellLinkSubRec( rStrm, EXC_ID_OBJSBSFMLA );
// ftLbsData - source data range and box properties
- sal_uInt16 nStyle = mbMultiSel ? EXC_OBJ_LBS_SEL_MULTI : EXC_OBJ_LBS_SEL_SIMPLE;
- ::set_flag( nStyle, EXC_OBJ_LBS_FLAT, mbFlatBorder );
+ sal_uInt16 nStyle = 0;
+ ::insert_value( nStyle, mbMultiSel ? EXC_OBJ_LISTBOX_MULTI : EXC_OBJ_LISTBOX_SINGLE, 4, 2 );
+ ::set_flag( nStyle, EXC_OBJ_LISTBOX_FLAT, mbFlatBorder );
- rStrm.StartRecord( EXC_ID_OBJ_FTLBSDATA, 0 );
+ rStrm.StartRecord( EXC_ID_OBJLBSDATA, 0 );
if( const XclTokenArray* pSrcRange = GetSourceRangeTokArr() )
{
@@ -609,7 +661,7 @@ void XclExpTbxControlObj::WriteSubRecs( XclExpStream& rStrm )
rStrm << sal_uInt16( 0 );
rStrm << nEntryCount << mnSelEntry << nStyle << sal_uInt16( 0 );
- if( mnObjType == EXC_OBJ_CMO_LISTBOX )
+ if( mnObjType == EXC_OBJTYPE_LISTBOX )
{
if( nEntryCount )
{
@@ -620,9 +672,9 @@ void XclExpTbxControlObj::WriteSubRecs( XclExpStream& rStrm )
rStrm.Write( &aSelEx[ 0 ], aSelEx.size() );
}
}
- else if( mnObjType == EXC_OBJ_CMO_COMBOBOX )
+ else if( mnObjType == EXC_OBJTYPE_DROPDOWN )
{
- rStrm << EXC_OBJ_LBS_COMBO_STD << mnLineCount;
+ rStrm << sal_uInt16( 0 ) << mnLineCount;
}
rStrm.EndRecord();
@@ -631,30 +683,30 @@ void XclExpTbxControlObj::WriteSubRecs( XclExpStream& rStrm )
// *** Spin buttons, scrollbars ***
- case EXC_OBJ_CMO_SPIN:
- case EXC_OBJ_CMO_SCROLLBAR:
+ case EXC_OBJTYPE_SPIN:
+ case EXC_OBJTYPE_SCROLLBAR:
{
// ftSbs subrecord - scroll bars
WriteSbs( rStrm );
// ftMacro - macro link
WriteMacroSubRec( rStrm );
// ftSbsFmla subrecord - cell link
- WriteCellLinkSubRec( rStrm, EXC_ID_OBJ_FTSBSFMLA );
+ WriteCellLinkSubRec( rStrm, EXC_ID_OBJSBSFMLA );
}
break;
// *** Group boxes ***
- case EXC_OBJ_CMO_GROUPBOX:
+ case EXC_OBJTYPE_GROUPBOX:
{
// ftMacro - macro link
WriteMacroSubRec( rStrm );
// ftGboData subrecord - group box properties
sal_uInt16 nStyle = 0;
- ::set_flag( nStyle, EXC_OBJ_GBO_FLAT, mbFlatBorder );
+ ::set_flag( nStyle, EXC_OBJ_GROUPBOX_FLAT, mbFlatBorder );
- rStrm.StartRecord( EXC_ID_OBJ_FTGBODATA, 6 );
+ rStrm.StartRecord( EXC_ID_OBJGBODATA, 6 );
rStrm << sal_uInt32( 0 )
<< nStyle;
rStrm.EndRecord();
@@ -666,7 +718,7 @@ void XclExpTbxControlObj::WriteSubRecs( XclExpStream& rStrm )
void XclExpTbxControlObj::WriteMacroSubRec( XclExpStream& rStrm )
{
if( mxMacroLink.is() )
- WriteFormulaSubRec( rStrm, EXC_ID_OBJ_FTMACRO, *mxMacroLink );
+ WriteFormulaSubRec( rStrm, EXC_ID_OBJMACRO, *mxMacroLink );
}
void XclExpTbxControlObj::WriteCellLinkSubRec( XclExpStream& rStrm, sal_uInt16 nSubRecId )
@@ -678,11 +730,11 @@ void XclExpTbxControlObj::WriteCellLinkSubRec( XclExpStream& rStrm, sal_uInt16 n
void XclExpTbxControlObj::WriteSbs( XclExpStream& rStrm )
{
sal_uInt16 nOrient = 0;
- ::set_flag( nOrient, EXC_OBJ_SBS_HORIZONTAL, mbScrollHor );
- sal_uInt16 nStyle = EXC_OBJ_SBS_DEFAULTFLAGS;
- ::set_flag( nStyle, EXC_OBJ_SBS_FLAT, mbFlatButton );
+ ::set_flag( nOrient, EXC_OBJ_SCROLLBAR_HOR, mbScrollHor );
+ sal_uInt16 nStyle = EXC_OBJ_SCROLLBAR_DEFFLAGS;
+ ::set_flag( nStyle, EXC_OBJ_SCROLLBAR_FLAT, mbFlatButton );
- rStrm.StartRecord( EXC_ID_OBJ_FTSBS, 20 );
+ rStrm.StartRecord( EXC_ID_OBJSBS, 20 );
rStrm << sal_uInt32( 0 ) // reserved
<< mnScrollValue // thumb position
<< mnScrollMin // thumb min pos
@@ -700,7 +752,7 @@ void XclExpTbxControlObj::WriteSbs( XclExpStream& rStrm )
// ----------------------------------------------------------------------------
XclExpChartObj::XclExpChartObj( const XclExpRoot& rRoot, Reference< XShape > xShape ) :
- XclObj( rRoot, EXC_OBJ_CMO_CHART ),
+ XclObj( rRoot, EXC_OBJTYPE_CHART ),
XclExpRoot( rRoot )
{
// create the MSODRAWING record contents for the chart object
@@ -720,8 +772,9 @@ XclExpChartObj::XclExpChartObj( const XclExpRoot& rRoot, Reference< XShape > xSh
aPropOpt.Commit( rEscherEx.GetStream() );
// client anchor
- if( SdrObject* pSdrObj = ::GetSdrObjectFromXShape( xShape ) )
- XclExpEscherAnchor( rRoot, *pSdrObj ).WriteData( rEscherEx );
+ SdrObject* pSdrObj = SdrObject::getSdrObjectFromXShape( xShape );
+ if( pSdrObj )
+ XclExpDffAnchor( rRoot, *pSdrObj ).WriteData( rEscherEx );
// client data (the following OBJ record)
rEscherEx.AddAtom( 0, ESCHER_ClientData );
@@ -729,7 +782,7 @@ XclExpChartObj::XclExpChartObj( const XclExpRoot& rRoot, Reference< XShape > xSh
pMsodrawing->UpdateStopPos();
// load the chart OLE object
- if( SdrOle2Obj* pSdrOleObj = dynamic_cast< SdrOle2Obj* >( ::GetSdrObjectFromXShape( xShape ) ) )
+ if( SdrOle2Obj* pSdrOleObj = dynamic_cast< SdrOle2Obj* >( pSdrObj ) )
svt::EmbeddedObjectRef::TryRunningState( pSdrOleObj->GetObjRef() );
// create the chart substream object
diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx
index 032e0d576f43..b175dc2e2579 100644
--- a/sc/source/filter/excel/xehelper.cxx
+++ b/sc/source/filter/excel/xehelper.cxx
@@ -475,79 +475,78 @@ XclExpStringRef lclCreateFormattedString(
{
ESelection aSel( nPara, 0 );
String aParaText( rEE.GetText( nPara ) );
- if( aParaText.Len() )
- {
- SvUShorts aPosList;
- rEE.GetPortions( nPara, aPosList );
- // process all portions in the paragraph
- sal_uInt16 nPosCount = aPosList.Count();
- for( sal_uInt16 nPos = 0; nPos < nPosCount; ++nPos )
- {
- aSel.nEndPos = static_cast< xub_StrLen >( aPosList.GetObject( nPos ) );
- String aXclPortionText( aParaText, aSel.nStartPos, aSel.nEndPos - aSel.nStartPos );
+ SvUShorts aPosList;
+ rEE.GetPortions( nPara, aPosList );
- aItemSet.ClearItem();
- SfxItemSet aEditSet( rEE.GetAttribs( aSel ) );
- ScPatternAttr::GetFromEditItemSet( aItemSet, aEditSet );
+ // process all portions in the paragraph
+ sal_uInt16 nPosCount = aPosList.Count();
+ for( sal_uInt16 nPos = 0; nPos < nPosCount; ++nPos )
+ {
+ aSel.nEndPos = static_cast< xub_StrLen >( aPosList.GetObject( nPos ) );
+ String aXclPortionText( aParaText, aSel.nStartPos, aSel.nEndPos - aSel.nStartPos );
+
+ aItemSet.ClearItem();
+ SfxItemSet aEditSet( rEE.GetAttribs( aSel ) );
+ ScPatternAttr::GetFromEditItemSet( aItemSet, aEditSet );
- // get escapement value
- short nEsc = GETITEM( aEditSet, SvxEscapementItem, EE_CHAR_ESCAPEMENT ).GetEsc();
+ // get escapement value
+ short nEsc = GETITEM( aEditSet, SvxEscapementItem, EE_CHAR_ESCAPEMENT ).GetEsc();
- // process text fields
- bool bIsHyperlink = false;
- if( aSel.nStartPos + 1 == aSel.nEndPos )
+ // process text fields
+ bool bIsHyperlink = false;
+ if( aSel.nStartPos + 1 == aSel.nEndPos )
+ {
+ // test if the character is a text field
+ const SfxPoolItem* pItem;
+ if( aEditSet.GetItemState( EE_FEATURE_FIELD, FALSE, &pItem ) == SFX_ITEM_SET )
{
- // test if the character is a text field
- const SfxPoolItem* pItem;
- if( aEditSet.GetItemState( EE_FEATURE_FIELD, FALSE, &pItem ) == SFX_ITEM_SET )
+ const SvxFieldData* pField = static_cast< const SvxFieldItem* >( pItem )->GetField();
+ if( const SvxURLField* pUrlField = PTR_CAST( SvxURLField, pField ) )
{
- const SvxFieldData* pField = static_cast< const SvxFieldItem* >( pItem )->GetField();
- if( const SvxURLField* pUrlField = PTR_CAST( SvxURLField, pField ) )
- {
- // convert URL field to string representation
- aXclPortionText = pLinkHelper ?
- pLinkHelper->ProcessUrlField( *pUrlField ) :
- lclGetUrlRepresentation( *pUrlField );
- bIsHyperlink = true;
- }
- else
- {
- DBG_ERRORFILE( "lclCreateFormattedString - unknown text field" );
- aXclPortionText.Erase();
- }
+ // convert URL field to string representation
+ aXclPortionText = pLinkHelper ?
+ pLinkHelper->ProcessUrlField( *pUrlField ) :
+ lclGetUrlRepresentation( *pUrlField );
+ bIsHyperlink = true;
+ }
+ else
+ {
+ DBG_ERRORFILE( "lclCreateFormattedString - unknown text field" );
+ aXclPortionText.Erase();
}
}
+ }
- // Excel start position of this portion
- sal_uInt16 nXclPortionStart = xString->Len();
- // add portion text to Excel string
- XclExpStringHelper::AppendString( *xString, rRoot, aXclPortionText );
- if( nXclPortionStart < xString->Len() )
- {
- /* Construct font from current edit engine text portion. Edit engine
- creates different portions for different script types, no need to loop. */
- sal_Int16 nScript = xBreakIt->getScriptType( aXclPortionText, 0 );
- if( nScript == ApiScriptType::WEAK )
- nScript = nLastScript;
- SvxFont aFont( XclExpFontBuffer::GetFontFromItemSet( aItemSet, nScript ) );
- nLastScript = nScript;
-
- // add escapement
- aFont.SetEscapement( nEsc );
- // modify automatic font color for hyperlinks
- if( bIsHyperlink && (GETITEM( aItemSet, SvxColorItem, ATTR_FONT_COLOR ).GetValue().GetColor() == COL_AUTO) )
- aFont.SetColor( Color( COL_LIGHTBLUE ) );
-
- // insert font into buffer
- sal_uInt16 nFontIdx = rFontBuffer.Insert( aFont, EXC_COLOR_CELLTEXT );
- // insert font index into format run vector
- xString->AppendFormat( nXclPortionStart, nFontIdx );
- }
-
- aSel.nStartPos = aSel.nEndPos;
+ // Excel start position of this portion
+ sal_uInt16 nXclPortionStart = xString->Len();
+ // add portion text to Excel string
+ XclExpStringHelper::AppendString( *xString, rRoot, aXclPortionText );
+ if( (nXclPortionStart < xString->Len()) || (aParaText.Len() == 0) )
+ {
+ /* Construct font from current edit engine text portion. Edit engine
+ creates different portions for different script types, no need to loop. */
+ sal_Int16 nScript = xBreakIt->getScriptType( aXclPortionText, 0 );
+ if( nScript == ApiScriptType::WEAK )
+ nScript = nLastScript;
+ SvxFont aFont( XclExpFontBuffer::GetFontFromItemSet( aItemSet, nScript ) );
+ nLastScript = nScript;
+
+ // add escapement
+ aFont.SetEscapement( nEsc );
+ // modify automatic font color for hyperlinks
+ if( bIsHyperlink && (GETITEM( aItemSet, SvxColorItem, ATTR_FONT_COLOR ).GetValue().GetColor() == COL_AUTO) )
+ aFont.SetColor( Color( COL_LIGHTBLUE ) );
+
+ // insert font into buffer
+ sal_uInt16 nFontIdx = rFontBuffer.Insert( aFont, EXC_COLOR_CELLTEXT );
+ // insert font index into format run vector
+ xString->AppendFormat( nXclPortionStart, nFontIdx );
}
+
+ aSel.nStartPos = aSel.nEndPos;
}
+
// add trailing newline (important for correct character index calculation)
if( nPara + 1 < nParaCount )
XclExpStringHelper::AppendChar( *xString, rRoot, '\n' );
diff --git a/sc/source/filter/excel/xepage.cxx b/sc/source/filter/excel/xepage.cxx
index e5e0b8f53f9f..c43fc1596410 100644
--- a/sc/source/filter/excel/xepage.cxx
+++ b/sc/source/filter/excel/xepage.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xepage.cxx,v $
- * $Revision: 1.15 $
+ * $Revision: 1.15.90.1 $
*
* This file is part of OpenOffice.org.
*
@@ -30,10 +30,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
+
#include "xepage.hxx"
#include <svtools/itemset.hxx>
-#include <vcl/graph.hxx>
-#include <vcl/bmpacc.hxx>
#include "scitems.hxx"
#include <svtools/eitem.hxx>
#include <svtools/intitem.hxx>
@@ -47,6 +46,7 @@
#include "stlsheet.hxx"
#include "attrib.hxx"
#include "xehelper.hxx"
+#include "xeescher.hxx"
// Page settings records ======================================================
@@ -139,54 +139,6 @@ void XclExpPageBreaks::WriteBody( XclExpStream& rStrm )
}
}
-// Background bitmap ----------------------------------------------------------
-
-XclExpBitmap::XclExpBitmap( const Graphic& rGraphic ) :
- mrGraphic( rGraphic )
-{
-}
-
-void XclExpBitmap::Save( XclExpStream& rStrm )
-{
- Bitmap aBmp( mrGraphic.GetBitmap() );
- if( aBmp.GetBitCount() != 24 )
- aBmp.Convert( BMP_CONVERSION_24BIT );
-
- if( BitmapReadAccess* pAccess = aBmp.AcquireReadAccess() )
- {
- sal_Int32 nWidth = ::std::min< sal_Int32 >( pAccess->Width(), 0xFFFF );
- sal_Int32 nHeight = ::std::min< sal_Int32 >( pAccess->Height(), 0xFFFF );
- if( (nWidth > 0) && (nHeight > 0) )
- {
- sal_uInt8 nPadding = static_cast< sal_uInt8 >( nWidth & 0x03 );
- sal_uInt32 nTmpSize = static_cast< sal_uInt32 >( (nWidth * 3 + nPadding) * nHeight + 12 );
-
- rStrm.StartRecord( EXC_ID_BITMAP, nTmpSize + 4 );
-
- rStrm << EXC_BITMAP_UNKNOWNID
- << nTmpSize // size after _this_ field
- << sal_uInt32( 12 ) // unknown
- << static_cast< sal_uInt16 >( nWidth ) // width
- << static_cast< sal_uInt16 >( nHeight ) // height
- << sal_uInt16( 1 ) // planes
- << sal_uInt16( 24 ); // bits per pixel
-
- for( sal_Int32 nY = nHeight - 1; nY >= 0; --nY )
- {
- for( sal_Int32 nX = 0; nX < nWidth; ++nX )
- {
- const BitmapColor& rBmpColor = pAccess->GetPixel( nY, nX );
- rStrm << rBmpColor.GetBlue() << rBmpColor.GetGreen() << rBmpColor.GetRed();
- }
- rStrm.WriteZeroBytes( nPadding );
- }
-
- rStrm.EndRecord();
- }
- aBmp.ReleaseAccess( pAccess );
- }
-}
-
// Page settings ==============================================================
XclExpPageSettings::XclExpPageSettings( const XclExpRoot& rRoot ) :
@@ -321,7 +273,7 @@ void XclExpPageSettings::Save( XclExpStream& rStrm )
if( (GetBiff() == EXC_BIFF8) && maData.mxBrushItem.get() )
if( const Graphic* pGraphic = maData.mxBrushItem->GetGraphic() )
- XclExpBitmap( *pGraphic ).Save( rStrm );
+ XclExpImgData( *pGraphic, EXC_ID8_IMGDATA ).Save( rStrm );
}
// ----------------------------------------------------------------------------
diff --git a/sc/source/filter/excel/xestring.cxx b/sc/source/filter/excel/xestring.cxx
index 74647717a390..f50b5bf6a24e 100644
--- a/sc/source/filter/excel/xestring.cxx
+++ b/sc/source/filter/excel/xestring.cxx
@@ -210,8 +210,11 @@ void XclExpString::Append( const String& rString )
void XclExpString::AppendByte( const String& rString, rtl_TextEncoding eTextEnc )
{
- ByteString aByteStr( rString, eTextEnc ); // length may differ from length of rString
- BuildAppend( aByteStr.GetBuffer(), aByteStr.Len() );
+ if( rString.Len() > 0 )
+ {
+ ByteString aByteStr( rString, eTextEnc ); // length may differ from length of rString
+ BuildAppend( aByteStr.GetBuffer(), aByteStr.Len() );
+ }
}
void XclExpString::AppendByte( sal_Unicode cChar, rtl_TextEncoding eTextEnc )
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index 46cb411944a6..b10fa1defe56 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xichart.cxx,v $
- * $Revision: 1.21 $
+ * $Revision: 1.20.62.14 $
*
* This file is part of OpenOffice.org.
*
@@ -269,7 +269,8 @@ void XclImpChRoot::ConvertEscherFormat( ScfPropertySet& rPropSet,
XclChPropertyMode ePropMode ) const
{
GetChartPropSetHelper().WriteEscherProperties( rPropSet,
- mxChData->GetGradientTable(), mxChData->GetBitmapTable(), rEscherFmt, rPicFmt, ePropMode );
+ mxChData->GetGradientTable(), mxChData->GetHatchTable(), mxChData->GetBitmapTable(),
+ rEscherFmt, rPicFmt, ePropMode );
}
void XclImpChRoot::ConvertFont( ScfPropertySet& rPropSet,
@@ -420,12 +421,12 @@ XclImpChEscherFormat::XclImpChEscherFormat( const XclImpRoot& rRoot )
void XclImpChEscherFormat::ReadHeaderRecord( XclImpStream& rStrm )
{
// read from stream - CHESCHERFORMAT uses own ID for record continuation
- XclImpEscherPropSet aPropSet( rStrm.GetRoot() );
+ XclImpDffPropSet aPropSet( rStrm.GetRoot() );
rStrm.ResetRecord( true, rStrm.GetRecId() );
rStrm >> aPropSet;
// get the data
aPropSet.FillToItemSet( *maData.mxItemSet );
- // get bitmap mode from Escher item set
+ // get bitmap mode from DFF item set
sal_uInt32 nType = aPropSet.GetPropertyValue( DFF_Prop_fillType, mso_fillSolid );
maPicFmt.mnBmpMode = (nType == mso_fillPicture) ? EXC_CHPICFORMAT_STRETCH : EXC_CHPICFORMAT_STACK;
}
@@ -478,13 +479,6 @@ XclImpChFrameBase::XclImpChFrameBase( const XclChFormatInfo& rFmtInfo )
}
}
-XclImpChFrameBase::XclImpChFrameBase(
- const XclChLineFormat& rLineFmt, const XclChAreaFormat& rAreaFmt ) :
- mxLineFmt( new XclImpChLineFormat( rLineFmt ) ),
- mxAreaFmt( new XclImpChAreaFormat( rAreaFmt ) )
-{
-}
-
void XclImpChFrameBase::ReadSubRecord( XclImpStream& rStrm )
{
switch( rStrm.GetRecId() )
@@ -498,20 +492,22 @@ void XclImpChFrameBase::ReadSubRecord( XclImpStream& rStrm )
mxAreaFmt->ReadChAreaFormat( rStrm );
break;
case EXC_ID_CHESCHERFORMAT:
- // pass unique object name to escher format object
mxEscherFmt.reset( new XclImpChEscherFormat( rStrm.GetRoot() ) );
mxEscherFmt->ReadRecordGroup( rStrm );
break;
}
}
-void XclImpChFrameBase::ConvertFrameBase( const XclImpChRoot& rRoot,
+void XclImpChFrameBase::ConvertLineBase( const XclImpChRoot& rRoot,
ScfPropertySet& rPropSet, XclChObjectType eObjType, sal_uInt16 nFormatIdx ) const
{
- // line format
if( mxLineFmt.is() )
mxLineFmt->Convert( rRoot, rPropSet, eObjType, nFormatIdx );
- // area format (only for frame objects)
+}
+
+void XclImpChFrameBase::ConvertAreaBase( const XclImpChRoot& rRoot,
+ ScfPropertySet& rPropSet, XclChObjectType eObjType, sal_uInt16 nFormatIdx ) const
+{
if( rRoot.GetFormatInfo( eObjType ).mbIsFrame )
{
// CHESCHERFORMAT overrides CHAREAFORMAT (even if it is auto)
@@ -522,6 +518,13 @@ void XclImpChFrameBase::ConvertFrameBase( const XclImpChRoot& rRoot,
}
}
+void XclImpChFrameBase::ConvertFrameBase( const XclImpChRoot& rRoot,
+ ScfPropertySet& rPropSet, XclChObjectType eObjType, sal_uInt16 nFormatIdx ) const
+{
+ ConvertLineBase( rRoot, rPropSet, eObjType, nFormatIdx );
+ ConvertAreaBase( rRoot, rPropSet, eObjType, nFormatIdx );
+}
+
// ----------------------------------------------------------------------------
XclImpChFrame::XclImpChFrame( const XclImpChRoot& rRoot, XclChObjectType eObjType ) :
@@ -531,18 +534,55 @@ XclImpChFrame::XclImpChFrame( const XclImpChRoot& rRoot, XclChObjectType eObjTyp
{
}
-XclImpChFrame::XclImpChFrame( const XclImpChRoot& rRoot,
- const XclChLineFormat& rLineFmt, const XclChAreaFormat& rAreaFmt,
- XclChObjectType eObjType ) :
- XclImpChFrameBase( rLineFmt, rAreaFmt ),
- XclImpChRoot( rRoot ),
- meObjType( eObjType )
+void XclImpChFrame::ReadHeaderRecord( XclImpStream& rStrm )
{
+ rStrm >> maData.mnFormat >> maData.mnFlags;
}
-void XclImpChFrame::ReadHeaderRecord( XclImpStream& rStrm )
+void XclImpChFrame::UpdateObjFrame( const XclObjLineData& rLineData, const XclObjFillData& rFillData )
{
- rStrm >> maData.mnFormat >> maData.mnFlags;
+ const XclImpPalette& rPal = GetPalette();
+
+ if( rLineData.IsVisible() && (!mxLineFmt || !mxLineFmt->HasLine()) )
+ {
+ // line formatting
+ XclChLineFormat aLineFmt;
+ aLineFmt.maColor = rPal.GetColor( rLineData.mnColorIdx );
+ switch( rLineData.mnStyle )
+ {
+ case EXC_OBJ_LINE_SOLID: aLineFmt.mnPattern = EXC_CHLINEFORMAT_SOLID; break;
+ case EXC_OBJ_LINE_DASH: aLineFmt.mnPattern = EXC_CHLINEFORMAT_DASH; break;
+ case EXC_OBJ_LINE_DOT: aLineFmt.mnPattern = EXC_CHLINEFORMAT_DOT; break;
+ case EXC_OBJ_LINE_DASHDOT: aLineFmt.mnPattern = EXC_CHLINEFORMAT_DASHDOT; break;
+ case EXC_OBJ_LINE_DASHDOTDOT: aLineFmt.mnPattern = EXC_CHLINEFORMAT_DASHDOTDOT; break;
+ case EXC_OBJ_LINE_MEDTRANS: aLineFmt.mnPattern = EXC_CHLINEFORMAT_MEDTRANS; break;
+ case EXC_OBJ_LINE_DARKTRANS: aLineFmt.mnPattern = EXC_CHLINEFORMAT_DARKTRANS; break;
+ case EXC_OBJ_LINE_LIGHTTRANS: aLineFmt.mnPattern = EXC_CHLINEFORMAT_LIGHTTRANS; break;
+ case EXC_OBJ_LINE_NONE: aLineFmt.mnPattern = EXC_CHLINEFORMAT_NONE; break;
+ default: aLineFmt.mnPattern = EXC_CHLINEFORMAT_SOLID;
+ }
+ switch( rLineData.mnWidth )
+ {
+ case EXC_OBJ_LINE_HAIR: aLineFmt.mnWeight = EXC_CHLINEFORMAT_HAIR; break;
+ case EXC_OBJ_LINE_THIN: aLineFmt.mnWeight = EXC_CHLINEFORMAT_SINGLE; break;
+ case EXC_OBJ_LINE_MEDIUM: aLineFmt.mnWeight = EXC_CHLINEFORMAT_DOUBLE; break;
+ case EXC_OBJ_LINE_THICK: aLineFmt.mnWeight = EXC_CHLINEFORMAT_TRIPLE; break;
+ default: aLineFmt.mnWeight = EXC_CHLINEFORMAT_HAIR;
+ }
+ ::set_flag( aLineFmt.mnFlags, EXC_CHLINEFORMAT_AUTO, rLineData.IsAuto() );
+ mxLineFmt.reset( new XclImpChLineFormat( aLineFmt ) );
+ }
+
+ if( rFillData.IsFilled() && (!mxAreaFmt || !mxAreaFmt->HasArea()) && !mxEscherFmt )
+ {
+ // area formatting
+ XclChAreaFormat aAreaFmt;
+ aAreaFmt.maPattColor = rPal.GetColor( rFillData.mnPattColorIdx );
+ aAreaFmt.maBackColor = rPal.GetColor( rFillData.mnBackColorIdx );
+ aAreaFmt.mnPattern = rFillData.mnPattern;
+ ::set_flag( aAreaFmt.mnFlags, EXC_CHAREAFORMAT_AUTO, rFillData.IsAuto() );
+ mxAreaFmt.reset( new XclImpChAreaFormat( aAreaFmt ) );
+ }
}
void XclImpChFrame::Convert( ScfPropertySet& rPropSet ) const
@@ -763,8 +803,7 @@ void XclImpChText::ReadHeaderRecord( XclImpStream& rStrm )
else
{
// BIFF2-BIFF7: get rotation from text orientation
- sal_uInt8 nOrient = 0;
- ::extract_value( nOrient, maData.mnFlags, 8, 3 );
+ sal_uInt8 nOrient = ::extract_value< sal_uInt8 >( maData.mnFlags, 8, 3 );
maData.mnRotation = XclTools::GetXclRotFromOrient( nOrient );
}
}
@@ -1251,16 +1290,14 @@ void XclImpChDataFormat::Convert( ScfPropertySet& rPropSet, const XclChExtTypeIn
mxMarkerFmt->ConvertColor( GetChRoot(), rPropSet, maData.mnFormatIdx );
}
-void XclImpChDataFormat::ConvertVarPoint( ScfPropertySet& rPropSet, sal_uInt16 nFormatIdx ) const
+void XclImpChDataFormat::ConvertLine( ScfPropertySet& rPropSet, XclChObjectType eObjType ) const
{
- if( !mxEscherFmt && mxAreaFmt.is() && IsAutoArea() )
- mxAreaFmt->Convert( GetChRoot(), rPropSet, EXC_CHOBJTYPE_FILLEDSERIES, nFormatIdx );
+ ConvertLineBase( GetChRoot(), rPropSet, eObjType );
}
-void XclImpChDataFormat::ConvertLine( ScfPropertySet& rPropSet, XclChObjectType eObjType ) const
+void XclImpChDataFormat::ConvertArea( ScfPropertySet& rPropSet, sal_uInt16 nFormatIdx ) const
{
- if( mxLineFmt.is() )
- mxLineFmt->Convert( GetChRoot(), rPropSet, eObjType );
+ ConvertAreaBase( GetChRoot(), rPropSet, EXC_CHOBJTYPE_FILLEDSERIES, nFormatIdx );
}
void XclImpChDataFormat::RemoveUnusedFormats( const XclChExtTypeInfo& rTypeInfo )
@@ -1691,14 +1728,13 @@ Reference< XDataSeries > XclImpChSeries::CreateDataSeries() const
#else
aSeriesProp.SetBoolProperty( EXC_CHPROP_VARYCOLORSBY, rTypeInfo.meTypeCateg == EXC_CHTYPECATEG_PIE );
#endif
- if( bVarPointFmt && mxSeriesFmt.is() && mxSeriesFmt->IsAutoArea() )
+ // #i91271# always set area formatting for every point in pie/doughnut charts
+ if( mxSeriesFmt.is() && ((bVarPointFmt && mxSeriesFmt->IsAutoArea()) || (rTypeInfo.meTypeCateg == EXC_CHTYPECATEG_PIE)) )
{
- sal_uInt16 nPointCount = mxValueLink->GetCellCount();
- for( sal_uInt16 nPointIdx = 0; nPointIdx < nPointCount; ++nPointIdx )
+ for( sal_uInt16 nPointIdx = 0, nPointCount = mxValueLink->GetCellCount(); nPointIdx < nPointCount; ++nPointIdx )
{
ScfPropertySet aPointProp = lclGetPointPropSet( xDataSeries, nPointIdx );
- // nPointIdx is used as automatic format index
- mxSeriesFmt->ConvertVarPoint( aPointProp, nPointIdx );
+ mxSeriesFmt->ConvertArea( aPointProp, bVarPointFmt ? nPointIdx : mnSeriesIdx );
}
}
@@ -1766,14 +1802,14 @@ XclImpChDataFormatRef* XclImpChSeries::GetDataFormatRef( sal_uInt16 nPointIdx )
{
if( nPointIdx == EXC_CHDATAFORMAT_ALLPOINTS )
return &mxSeriesFmt;
- if( nPointIdx <= EXC_CHDATAFORMAT_MAXPOINT )
+ if( nPointIdx < EXC_CHDATAFORMAT_MAXPOINTCOUNT )
return &maPointFmts[ nPointIdx ];
return 0;
}
XclImpChTextRef* XclImpChSeries::GetDataLabelRef( sal_uInt16 nPointIdx )
{
- if( (nPointIdx == EXC_CHDATAFORMAT_ALLPOINTS) || (nPointIdx <= EXC_CHDATAFORMAT_MAXPOINT) )
+ if( (nPointIdx == EXC_CHDATAFORMAT_ALLPOINTS) || (nPointIdx < EXC_CHDATAFORMAT_MAXPOINTCOUNT) )
return &maLabels[ nPointIdx ];
return 0;
}
@@ -2628,8 +2664,7 @@ void XclImpChTick::ReadChTick( XclImpStream& rStrm )
else
{
// BIFF2-BIFF7: get rotation from text orientation
- sal_uInt8 nOrient = 0;
- ::extract_value( nOrient, maData.mnFlags, 2, 3 );
+ sal_uInt8 nOrient = ::extract_value< sal_uInt8 >( maData.mnFlags, 2, 3 );
maData.mnRotation = XclTools::GetXclRotFromOrient( nOrient );
}
}
@@ -3269,9 +3304,11 @@ void XclImpChChart::ReadChDataFormat( XclImpStream& rStrm )
}
}
-void XclImpChChart::SetChartFrameFormat( const XclChLineFormat& rLineFmt, const XclChAreaFormat& rAreaFmt )
+void XclImpChChart::UpdateObjFrame( const XclObjLineData& rLineData, const XclObjFillData& rFillData )
{
- mxFrame.reset( new XclImpChFrame( GetChRoot(), rLineFmt, rAreaFmt, EXC_CHOBJTYPE_BACKGROUND ) );
+ if( !mxFrame )
+ mxFrame.reset( new XclImpChFrame( GetChRoot(), EXC_CHOBJTYPE_BACKGROUND ) );
+ mxFrame->UpdateObjFrame( rLineData, rFillData );
}
XclImpChTypeGroupRef XclImpChChart::GetTypeGroup( sal_uInt16 nGroupIdx ) const
@@ -3474,9 +3511,6 @@ void XclImpChart::ReadChartSubStream( XclImpStream& rStrm )
bool bLoop = true;
while( bLoop && rStrm.StartNextRecord() )
{
- sal_uInt16 nRecId = rStrm.GetRecId();
- bLoop = nRecId != EXC_ID_EOF;
-
// page settings - only for charts in entire sheet
if( mbOwnTab ) switch( rStrm.GetRecId() )
{
@@ -3493,7 +3527,7 @@ void XclImpChart::ReadChartSubStream( XclImpStream& rStrm )
case EXC_ID_HCENTER:
case EXC_ID_VCENTER: rPageSett.ReadCenter( rStrm ); break;
case EXC_ID_SETUP: rPageSett.ReadSetup( rStrm ); break;
- case EXC_ID_BITMAP: rPageSett.ReadBitmap( rStrm ); break;
+ case EXC_ID8_IMGDATA: rPageSett.ReadImgData( rStrm ); break;
case EXC_ID_WINDOW2: rTabViewSett.ReadWindow2( rStrm, true );break;
case EXC_ID_SCL: rTabViewSett.ReadScl( rStrm ); break;
@@ -3501,6 +3535,8 @@ void XclImpChart::ReadChartSubStream( XclImpStream& rStrm )
switch( rStrm.GetRecId() )
{
+ case EXC_ID_EOF: bLoop = false; break;
+
// #i31882# ignore embedded chart objects
case EXC_ID2_BOF:
case EXC_ID3_BOF:
@@ -3509,6 +3545,7 @@ void XclImpChart::ReadChartSubStream( XclImpStream& rStrm )
case EXC_ID_CHCHART: ReadChChart( rStrm ); break;
case EXC_ID_OBJ: GetTracer().TraceChartEmbeddedObj(); break;
+
case EXC_ID8_CHPIVOTREF:
GetTracer().TracePivotChartExists();
mbIsPivotChart = true;
@@ -3517,11 +3554,11 @@ void XclImpChart::ReadChartSubStream( XclImpStream& rStrm )
}
}
-void XclImpChart::SetChartFrameFormat( const XclChLineFormat& rLineFmt, const XclChAreaFormat& rAreaFmt )
+void XclImpChart::UpdateObjFrame( const XclObjLineData& rLineData, const XclObjFillData& rFillData )
{
if( !mxChartData )
mxChartData.reset( new XclImpChChart( GetRoot() ) );
- mxChartData->SetChartFrameFormat( rLineFmt, rAreaFmt );
+ mxChartData->UpdateObjFrame( rLineData, rFillData );
}
sal_Size XclImpChart::GetProgressSize() const
diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx
index cbc7d2af9c90..36b85deab8ed 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xicontent.cxx,v $
- * $Revision: 1.32 $
+ * $Revision: 1.31.88.5 $
*
* This file is part of OpenOffice.org.
*
@@ -169,40 +169,63 @@ void lclInsertUrl( const XclImpRoot& rRoot, const String& rUrl, SCCOL nScCol, SC
ScDocument& rDoc = rRoot.GetDoc();
ScAddress aScPos( nScCol, nScRow, nScTab );
CellType eCellType = rDoc.GetCellType( aScPos );
-
- // #i54261# hyperlinks only in string cells
- if( (eCellType == CELLTYPE_STRING) || (eCellType == CELLTYPE_EDIT) )
+ switch( eCellType )
{
- String aDisplText;
- rDoc.GetString( nScCol, nScRow, nScTab, aDisplText );
- if( !aDisplText.Len() )
- aDisplText = rUrl;
+ // #i54261# hyperlinks in string cells
+ case CELLTYPE_STRING:
+ case CELLTYPE_EDIT:
+ {
+ String aDisplText;
+ rDoc.GetString( nScCol, nScRow, nScTab, aDisplText );
+ if( !aDisplText.Len() )
+ aDisplText = rUrl;
- ScEditEngineDefaulter& rEE = rRoot.GetEditEngine();
- SvxURLField aUrlField( rUrl, aDisplText, SVXURLFORMAT_APPDEFAULT );
+ ScEditEngineDefaulter& rEE = rRoot.GetEditEngine();
+ SvxURLField aUrlField( rUrl, aDisplText, SVXURLFORMAT_APPDEFAULT );
- const ScEditCell* pEditCell = (eCellType == CELLTYPE_EDIT) ? static_cast< const ScEditCell* >( rDoc.GetCell( aScPos ) ) : 0;
- const EditTextObject* pEditObj = pEditCell ? pEditCell->GetData() : 0;
- if( pEditObj )
- {
- rEE.SetText( *pEditObj );
- rEE.QuickInsertField( SvxFieldItem( aUrlField, EE_FEATURE_FIELD ), ESelection( 0, 0, 0xFFFF, 0 ) );
- }
- else
- {
- rEE.SetText( EMPTY_STRING );
- rEE.QuickInsertField( SvxFieldItem( aUrlField, EE_FEATURE_FIELD ), ESelection() );
- if( const ScPatternAttr* pPattern = rDoc.GetPattern( aScPos.Col(), aScPos.Row(), nScTab ) )
+ const ScEditCell* pEditCell = (eCellType == CELLTYPE_EDIT) ? static_cast< const ScEditCell* >( rDoc.GetCell( aScPos ) ) : 0;
+ const EditTextObject* pEditObj = pEditCell ? pEditCell->GetData() : 0;
+ if( pEditObj )
{
- SfxItemSet aItemSet( rEE.GetEmptyItemSet() );
- pPattern->FillEditItemSet( &aItemSet );
- rEE.QuickSetAttribs( aItemSet, ESelection( 0, 0, 0xFFFF, 0 ) );
+ rEE.SetText( *pEditObj );
+ rEE.QuickInsertField( SvxFieldItem( aUrlField, EE_FEATURE_FIELD ), ESelection( 0, 0, 0xFFFF, 0 ) );
}
+ else
+ {
+ rEE.SetText( EMPTY_STRING );
+ rEE.QuickInsertField( SvxFieldItem( aUrlField, EE_FEATURE_FIELD ), ESelection() );
+ if( const ScPatternAttr* pPattern = rDoc.GetPattern( aScPos.Col(), aScPos.Row(), nScTab ) )
+ {
+ SfxItemSet aItemSet( rEE.GetEmptyItemSet() );
+ pPattern->FillEditItemSet( &aItemSet );
+ rEE.QuickSetAttribs( aItemSet, ESelection( 0, 0, 0xFFFF, 0 ) );
+ }
+ }
+ ::std::auto_ptr< EditTextObject > xTextObj( rEE.CreateTextObject() );
+
+ ScEditCell* pCell = new ScEditCell( xTextObj.get(), &rDoc, rEE.GetEditTextObjectPool() );
+ rDoc.PutCell( aScPos, pCell );
+ }
+ break;
+
+ // fix for #i31050# disabled, HYPERLINK is not able to return numeric value (#i91351#)
+#if 0
+ case CELLTYPE_VALUE:
+ {
+ // #i31050# replace number with HYPERLINK function
+ ScTokenArray aTokenArray;
+ aTokenArray.AddOpCode( ocHyperLink );
+ aTokenArray.AddOpCode( ocOpen );
+ aTokenArray.AddString( rUrl );
+ aTokenArray.AddOpCode( ocSep );
+ aTokenArray.AddDouble( rDoc.GetValue( aScPos ) );
+ aTokenArray.AddOpCode( ocClose );
+ rDoc.PutCell( aScPos, new ScFormulaCell( &rDoc, aScPos, &aTokenArray ) );
}
- ::std::auto_ptr< EditTextObject > xTextObj( rEE.CreateTextObject() );
+ break;
+#endif
- ScEditCell* pCell = new ScEditCell( xTextObj.get(), &rDoc, rEE.GetEditTextObjectPool() );
- rDoc.PutCell( aScPos, pCell );
+ default:;
}
}
@@ -664,7 +687,7 @@ void XclImpValidation::ReadDval( XclImpStream& rStrm )
if( nObjId != EXC_DVAL_NOOBJ )
{
DBG_ASSERT( nObjId <= 0xFFFF, "XclImpValidation::ReadDval - invalid object ID" );
- rRoot.GetObjectManager().SetInvalidObj( rRoot.GetCurrScTab(), static_cast< sal_uInt16 >( nObjId ) );
+ rRoot.GetObjectManager().SetSkipObj( rRoot.GetCurrScTab(), static_cast< sal_uInt16 >( nObjId ) );
}
}
@@ -830,8 +853,7 @@ XclImpWebQuery::XclImpWebQuery( const ScRange& rDestRange ) :
void XclImpWebQuery::ReadParamqry( XclImpStream& rStrm )
{
sal_uInt16 nFlags = rStrm.ReaduInt16();
- sal_uInt16 nType = 0;
- ::extract_value( nType, nFlags, 0, 3 );
+ sal_uInt16 nType = ::extract_value< sal_uInt16 >( nFlags, 0, 3 );
if( (nType == EXC_PQRYTYPE_WEBQUERY) && ::get_flag( nFlags, EXC_PQRY_WEBQUERY ) )
{
if( ::get_flag( nFlags, EXC_PQRY_TABLES ) )
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index 11987ba3949f..a9a5c2dc0a14 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xiescher.cxx,v $
- * $Revision: 1.57 $
+ * $Revision: 1.56.88.20 $
*
* This file is part of OpenOffice.org.
*
@@ -31,53 +31,70 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-#include <stdio.h>
-
#include "xiescher.hxx"
#include <com/sun/star/beans/NamedValue.hpp>
+#include <com/sun/star/container/XIndexContainer.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/embed/Aspects.hpp>
#include <com/sun/star/embed/XEmbeddedObject.hpp>
#include <com/sun/star/embed/XEmbedPersist.hpp>
-#include <com/sun/star/awt/VisualEffect.hpp>
+#include <com/sun/star/awt/PushButtonType.hpp>
#include <com/sun/star/awt/ScrollBarOrientation.hpp>
+#include <com/sun/star/awt/VisualEffect.hpp>
+#include <com/sun/star/style/HorizontalAlignment.hpp>
#include <com/sun/star/style/VerticalAlignment.hpp>
+#include <com/sun/star/drawing/XControlShape.hpp>
+#include <com/sun/star/form/XForm.hpp>
+#include <com/sun/star/form/XFormsSupplier.hpp>
#include <com/sun/star/form/binding/XBindableValue.hpp>
#include <com/sun/star/form/binding/XValueBinding.hpp>
#include <com/sun/star/form/binding/XListEntrySink.hpp>
#include <com/sun/star/form/binding/XListEntrySource.hpp>
#include <com/sun/star/script/ScriptEventDescriptor.hpp>
+#include <com/sun/star/script/XEventAttacherManager.hpp>
#include <rtl/logfile.hxx>
#include <sfx2/objsh.hxx>
#include <svtools/moduleoptions.hxx>
#include <svtools/fltrcfg.hxx>
+#include <svtools/wmf.hxx>
#include <comphelper/types.hxx>
#include <comphelper/classids.hxx>
#include <toolkit/helper/vclunohelper.hxx>
+#include <basegfx/point/b2dpoint.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
#include <basic/sbstar.hxx>
#include <basic/sbmod.hxx>
#include <basic/sbmeth.hxx>
#include <svx/svdobj.hxx>
+#include <svx/svdopath.hxx>
+#include <svx/svdocirc.hxx>
+#include <svx/svdoedge.hxx>
#include <svx/svdogrp.hxx>
+#include <svx/svdoashp.hxx>
+#include <svx/svdograf.hxx>
#include <svx/svdoole2.hxx>
+#include <svx/svdouno.hxx>
#include <svx/svdpage.hxx>
#include <svx/editobj.hxx>
#include <svx/outliner.hxx>
#include <svx/outlobj.hxx>
-#include <svx/svdouno.hxx>
#include <svx/unoapi.hxx>
#include <svx/svditer.hxx>
#include <svx/writingmodeitem.hxx>
-#include <svx/svdoedge.hxx>
#include "scitems.hxx"
#include <svx/eeitem.hxx>
#include <svx/colritem.hxx>
#include <svx/xflclit.hxx>
#include <svx/adjitem.hxx>
+#include <svx/xlineit.hxx>
+#include <svx/xlinjoit.hxx>
+#include <svx/xlntrit.hxx>
+#include <svx/xbtmpit.hxx>
#include "document.hxx"
#include "drwlayer.hxx"
@@ -90,7 +107,6 @@
#include "globstr.hrc"
#include "fprogressbar.hxx"
-#include "xlocx.hxx"
#include "xltracer.hxx"
#include "xistream.hxx"
#include "xihelper.hxx"
@@ -100,6 +116,7 @@
#include "xipage.hxx"
#include "xichart.hxx"
#include "xicontent.hxx"
+#include "namebuff.hxx"
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
@@ -109,296 +126,290 @@ using ::com::sun::star::uno::Any;
using ::com::sun::star::uno::XInterface;
using ::com::sun::star::uno::Exception;
using ::com::sun::star::uno::UNO_QUERY;
+using ::com::sun::star::uno::UNO_QUERY_THROW;
using ::com::sun::star::beans::NamedValue;
using ::com::sun::star::lang::XMultiServiceFactory;
+using ::com::sun::star::container::XIndexContainer;
+using ::com::sun::star::container::XNameContainer;
using ::com::sun::star::frame::XModel;
using ::com::sun::star::awt::XControlModel;
using ::com::sun::star::embed::XEmbeddedObject;
using ::com::sun::star::embed::XEmbedPersist;
+using ::com::sun::star::drawing::XControlShape;
+using ::com::sun::star::drawing::XShape;
+using ::com::sun::star::form::XForm;
+using ::com::sun::star::form::XFormComponent;
+using ::com::sun::star::form::XFormsSupplier;
using ::com::sun::star::form::binding::XBindableValue;
using ::com::sun::star::form::binding::XValueBinding;
using ::com::sun::star::form::binding::XListEntrySink;
using ::com::sun::star::form::binding::XListEntrySource;
using ::com::sun::star::script::ScriptEventDescriptor;
+using ::com::sun::star::script::XEventAttacherManager;
using ::com::sun::star::table::CellAddress;
using ::com::sun::star::table::CellRangeAddress;
-/** helper class which mimics the auto_ptr< SdrObject > semantics, but calls SdrObject::Free instead
- of deleting the SdrObject directly
-*/
-class SdrObjectPtr
-{
-private:
- SdrObject* mpObject;
+// ============================================================================
+
+namespace {
+/** Helper class which mimics the auto_ptr< SdrObject > semantics, but calls
+ SdrObject::Free instead of deleting the SdrObject directly. */
+template< typename SdrObjType >
+class TSdrObjectPtr
+{
public:
- SdrObjectPtr() : mpObject( NULL ) { }
- SdrObjectPtr( SdrObject* _pObject ) : mpObject( _pObject ) { }
- ~SdrObjectPtr() { free(); }
+ inline explicit TSdrObjectPtr( SdrObjType* pObj = 0 ) : mpObj( pObj ) {}
+ inline ~TSdrObjectPtr() { free(); }
- const SdrObject* operator->() const { return mpObject; }
- SdrObject* operator->() { return mpObject; }
+ inline const SdrObjType* operator->() const { return mpObj; }
+ inline SdrObjType* operator->() { return mpObj; }
- void reset( SdrObject* _pObject = NULL ) { free(); mpObject = _pObject; }
+ inline const SdrObjType* get() const { return mpObj; }
+ inline SdrObjType* get() { return mpObj; }
- SdrObject* get() const { return mpObject; }
- SdrObject& operator*() { return *mpObject; }
+ inline const SdrObjType& operator*() const { return *mpObj; }
+ inline SdrObjType& operator*() { return *mpObj; }
- SdrObject* release() { SdrObject* pRet = get(); mpObject = NULL; return pRet; }
+ inline bool is() const { return mpObj != 0; }
+ inline bool operator!() const { return mpObj == 0; }
- SdrObjectPtr& operator=( SdrObjectPtr& _rLHS )
- {
- SdrObject* pNew = _rLHS.release();
- reset( pNew );
- return *this;
- }
+ inline void reset( SdrObjType* pObj = 0 ) { free(); mpObj = pObj; }
+ inline SdrObjType* release() { SdrObjType* pObj = mpObj; mpObj = 0; return pObj; }
private:
- SdrObjectPtr( const SdrObjectPtr& ); // not implemented
+ TSdrObjectPtr( const TSdrObjectPtr& ); // not implemented
+ TSdrObjectPtr& operator=( TSdrObjectPtr& rxObj ); // not implemented
+
+ inline void free() { SdrObject* pObj = mpObj; mpObj = 0; SdrObject::Free( pObj ); }
private:
- void free() { SdrObject::Free( mpObject ); }
+ SdrObjType* mpObj;
};
-// Text box data ==============================================================
+typedef TSdrObjectPtr< SdrObject > SdrObjectPtr;
-namespace {
-
-SvxAdjust lclGetSvxHorAlignment( sal_uInt8 nXclAlign )
-{
- SvxAdjust eHorAlign = SVX_ADJUST_LEFT;
- switch( nXclAlign )
- {
- case EXC_TXO_HOR_LEFT: eHorAlign = SVX_ADJUST_LEFT; break;
- case EXC_TXO_HOR_CENTER: eHorAlign = SVX_ADJUST_CENTER; break;
- case EXC_TXO_HOR_RIGHT: eHorAlign = SVX_ADJUST_RIGHT; break;
- case EXC_TXO_HOR_JUSTIFY: eHorAlign = SVX_ADJUST_BLOCK; break;
- }
- return eHorAlign;
-}
+} // namespace
-SdrTextVertAdjust lclGetSvxVerAlignment( sal_uInt8 nXclAlign )
-{
- SdrTextVertAdjust eVerAlign = SDRTEXTVERTADJUST_TOP;
- switch( nXclAlign )
- {
- case EXC_TXO_VER_TOP: eVerAlign = SDRTEXTVERTADJUST_TOP; break;
- case EXC_TXO_VER_CENTER: eVerAlign = SDRTEXTVERTADJUST_CENTER; break;
- case EXC_TXO_VER_BOTTOM: eVerAlign = SDRTEXTVERTADJUST_BOTTOM; break;
- case EXC_TXO_VER_JUSTIFY: eVerAlign = SDRTEXTVERTADJUST_BLOCK; break;
- }
- return eVerAlign;
-}
+// Drawing objects ============================================================
-::com::sun::star::text::WritingMode lclGetApiWritingMode( sal_uInt16 nXclOrient )
+XclImpDrawObjBase::XclImpDrawObjBase( const XclImpRoot& rRoot ) :
+ XclImpRoot( rRoot ),
+ maObjId( rRoot.GetCurrScTab(), EXC_OBJ_INVALID_ID ),
+ mnObjType( EXC_OBJTYPE_UNKNOWN ),
+ mnDffShapeId( 0 ),
+ mnDffFlags( 0 ),
+ mbHidden( false ),
+ mbVisible( true ),
+ mbPrintable( true ),
+ mbAreaObj( false ),
+ mbAutoMargin( true ),
+ mbSimpleMacro( true ),
+ mbProcessSdr( true ),
+ mbInsertSdr( true ),
+ mbCustomDff( false )
{
- // this is only a fake, drawing does not support real text orientation
- namespace csst = ::com::sun::star::text;
- csst::WritingMode eWriteMode = csst::WritingMode_LR_TB;
- switch( nXclOrient )
- {
- case EXC_TXO_TEXTROT_NONE: eWriteMode = csst::WritingMode_LR_TB; break;
- case EXC_TXO_TEXTROT_STACKED: eWriteMode = csst::WritingMode_TB_RL; break;
- case EXC_TXO_TEXTROT_90_CCW: eWriteMode = csst::WritingMode_TB_RL; break;
- case EXC_TXO_TEXTROT_90_CW: eWriteMode = csst::WritingMode_TB_RL; break;
- }
- return eWriteMode;
}
-} // namespace
-
-// ----------------------------------------------------------------------------
-
-XclImpTxoData::XclImpTxoData( const XclImpRoot& rRoot ) :
- XclImpRoot( rRoot )
+XclImpDrawObjBase::~XclImpDrawObjBase()
{
}
-void XclImpTxoData::ReadTxo( XclImpStream& rStrm )
+XclImpDrawObjRef XclImpDrawObjBase::ReadObj3( XclImpStream& rStrm )
{
- mxString.reset();
-
- // Step 1: TXO record
- rStrm >> maData;
-
- // Step 2: First CONTINUE with string
- bool bValid = true;
- if( maData.mnTextLen > 0 )
- {
- bValid = (rStrm.GetNextRecId() == EXC_ID_CONT) && rStrm.StartNextRecord();
- DBG_ASSERT( bValid, "XclImpTxoData::ReadTxo - missing CONTINUE record" );
- if( bValid )
- mxString.reset( new XclImpString( rStrm.ReadUniString( maData.mnTextLen ) ) );
- }
+ const XclImpRoot& rRoot = rStrm.GetRoot();
+ XclImpDrawObjRef xDrawObj;
- // Step 3: Second CONTINUE with formatting runs
- if( maData.mnFormatSize > 0 )
+ if( rStrm.GetRecLeft() >= 30 )
{
- bValid = (rStrm.GetNextRecId() == EXC_ID_CONT) && rStrm.StartNextRecord();
- DBG_ASSERT( bValid, "XclImpTxoData::ReadTxo - missing CONTINUE record" );
- if( bValid && mxString.is() )
+ sal_uInt16 nObjType;
+ rStrm.Ignore( 4 );
+ rStrm >> nObjType;
+ switch( nObjType )
{
- // number of formatting runs, each takes 8 bytes, but ignore last run
- sal_uInt16 nFormatRuns = maData.mnFormatSize / 8 - 1;
- for( sal_uInt16 nRun = 0; nRun < nFormatRuns; ++nRun )
- {
- sal_uInt16 nChar, nFont;
- rStrm >> nChar >> nFont;
- rStrm.Ignore( 4 );
- mxString->AppendFormat( nChar, nFont );
- }
+ case EXC_OBJTYPE_GROUP: xDrawObj.reset( new XclImpGroupObj( rRoot ) ); break;
+ case EXC_OBJTYPE_LINE: xDrawObj.reset( new XclImpLineObj( rRoot ) ); break;
+ case EXC_OBJTYPE_RECTANGLE: xDrawObj.reset( new XclImpRectObj( rRoot ) ); break;
+ case EXC_OBJTYPE_OVAL: xDrawObj.reset( new XclImpOvalObj( rRoot ) ); break;
+ case EXC_OBJTYPE_ARC: xDrawObj.reset( new XclImpArcObj( rRoot ) ); break;
+ case EXC_OBJTYPE_CHART: xDrawObj.reset( new XclImpChartObj( rRoot ) ); break;
+ case EXC_OBJTYPE_TEXT: xDrawObj.reset( new XclImpTextObj( rRoot ) ); break;
+ case EXC_OBJTYPE_BUTTON: xDrawObj.reset( new XclImpButtonObj( rRoot ) ); break;
+ case EXC_OBJTYPE_PICTURE: xDrawObj.reset( new XclImpPictureObj( rRoot ) ); break;
+ default:
+ DBG_ERROR1( "XclImpDrawObjBase::ReadObj3 - unknown object type 0x%04hX", nObjType );
+ rRoot.GetTracer().TraceUnsupportedObjects();
+ xDrawObj.reset( new XclImpPhObj( rRoot ) );
}
}
+
+ xDrawObj->ImplReadObj3( rStrm );
+ return xDrawObj;
}
-void XclImpTxoData::ProcessSdrObject( SdrObject& rSdrObj ) const
+XclImpDrawObjRef XclImpDrawObjBase::ReadObj4( XclImpStream& rStrm )
{
- if( SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( &rSdrObj ) )
+ const XclImpRoot& rRoot = rStrm.GetRoot();
+ XclImpDrawObjRef xDrawObj;
+
+ if( rStrm.GetRecLeft() >= 30 )
{
- if( mxString.is() )
+ sal_uInt16 nObjType;
+ rStrm.Ignore( 4 );
+ rStrm >> nObjType;
+ switch( nObjType )
{
- if( mxString->IsRich() )
- {
- // rich text
- ::std::auto_ptr< EditTextObject > xEditObj(
- XclImpStringHelper::CreateTextObject( GetRoot(), *mxString ) );
- OutlinerParaObject* pOutlineObj = new OutlinerParaObject( *xEditObj );
- pOutlineObj->SetOutlinerMode( OUTLINERMODE_TEXTOBJECT );
- // text object takes ownership of the outliner object
- pTextObj->NbcSetOutlinerParaObject( pOutlineObj );
- }
- else
- {
- // plain text
- pTextObj->SetText( mxString->GetText() );
- }
+ case EXC_OBJTYPE_GROUP: xDrawObj.reset( new XclImpGroupObj( rRoot ) ); break;
+ case EXC_OBJTYPE_LINE: xDrawObj.reset( new XclImpLineObj( rRoot ) ); break;
+ case EXC_OBJTYPE_RECTANGLE: xDrawObj.reset( new XclImpRectObj( rRoot ) ); break;
+ case EXC_OBJTYPE_OVAL: xDrawObj.reset( new XclImpOvalObj( rRoot ) ); break;
+ case EXC_OBJTYPE_ARC: xDrawObj.reset( new XclImpArcObj( rRoot ) ); break;
+ case EXC_OBJTYPE_CHART: xDrawObj.reset( new XclImpChartObj( rRoot ) ); break;
+ case EXC_OBJTYPE_TEXT: xDrawObj.reset( new XclImpTextObj( rRoot ) ); break;
+ case EXC_OBJTYPE_BUTTON: xDrawObj.reset( new XclImpButtonObj( rRoot ) ); break;
+ case EXC_OBJTYPE_PICTURE: xDrawObj.reset( new XclImpPictureObj( rRoot ) ); break;
+ case EXC_OBJTYPE_POLYGON: xDrawObj.reset( new XclImpPolygonObj( rRoot ) ); break;
+ default:
+ DBG_ERROR1( "XclImpDrawObjBase::ReadObj4 - unknown object type 0x%04hX", nObjType );
+ rRoot.GetTracer().TraceUnsupportedObjects();
+ xDrawObj.reset( new XclImpPhObj( rRoot ) );
}
-
- // #i12188# text alignment not stored in Escher stream, but in TXO record
- SvxAdjust eHorAlign = lclGetSvxHorAlignment( maData.GetXclHorAlignment() );
- pTextObj->SetMergedItem( SvxAdjustItem( eHorAlign, EE_PARA_JUST ) );
- SdrTextVertAdjust eVerAlign = lclGetSvxVerAlignment( maData.GetXclVerAlignment() );
- pTextObj->SetMergedItem( SdrTextVertAdjustItem( eVerAlign ) );
- ::com::sun::star::text::WritingMode eWriteMode = lclGetApiWritingMode( GetOrientation() );
- pTextObj->SetMergedItem( SvxWritingModeItem( eWriteMode, SDRATTR_TEXTDIRECTION ) );
}
-}
-
-// Escher objects =============================================================
-XclImpDrawObjBase::XclImpDrawObjBase( const XclImpRoot& rRoot ) :
- XclImpRoot( rRoot ),
- maObjId( rRoot.GetCurrScTab(), EXC_OBJ_INVALID_ID ),
- mnObjType( EXC_OBJ_CMO_UNKNOWN ),
- mnObjFlags( 0 ),
- mnShapeId( 0 ),
- mnShapeFlags( 0 ),
- mnShapeBlipId( 0 ),
- mbValid( true ),
- mbAreaObj( false ),
- mbInsSdr( true )
-{
-}
-
-XclImpDrawObjBase::~XclImpDrawObjBase()
-{
+ xDrawObj->ImplReadObj4( rStrm );
+ return xDrawObj;
}
-XclImpDrawObjRef XclImpDrawObjBase::ReadObjCmo( XclImpStream& rStrm )
+XclImpDrawObjRef XclImpDrawObjBase::ReadObj5( XclImpStream& rStrm )
{
+ const XclImpRoot& rRoot = rStrm.GetRoot();
XclImpDrawObjRef xDrawObj;
- sal_uInt16 nObjType, nObjId, nFlags;
- rStrm >> nObjType >> nObjId >> nFlags;
-
- switch( nObjType )
+ if( rStrm.GetRecLeft() >= 34 )
{
- case EXC_OBJ_CMO_GROUP:
- case EXC_OBJ_CMO_LINE:
- case EXC_OBJ_CMO_ARC:
- xDrawObj.reset( new XclImpDrawingObj( rStrm.GetRoot(), false ) );
- break;
- case EXC_OBJ_CMO_RECTANGLE:
- case EXC_OBJ_CMO_ELLIPSE:
- case EXC_OBJ_CMO_POLYGON:
- case EXC_OBJ_CMO_DRAWING:
- case EXC_OBJ_CMO_TEXT:
- xDrawObj.reset( new XclImpDrawingObj( rStrm.GetRoot(), true ) );
- break;
- case EXC_OBJ_CMO_NOTE:
- xDrawObj.reset( new XclImpNoteObj( rStrm.GetRoot() ) );
- break;
- case EXC_OBJ_CMO_BUTTON:
- case EXC_OBJ_CMO_CHECKBOX:
- case EXC_OBJ_CMO_OPTIONBUTTON:
- case EXC_OBJ_CMO_LABEL:
- case EXC_OBJ_CMO_GROUPBOX:
- case EXC_OBJ_CMO_LISTBOX:
- case EXC_OBJ_CMO_COMBOBOX:
- case EXC_OBJ_CMO_SPIN:
- case EXC_OBJ_CMO_SCROLLBAR:
- xDrawObj.reset( new XclImpTbxControlObj( rStrm.GetRoot() ) );
- break;
- case EXC_OBJ_CMO_PICTURE:
- xDrawObj.reset( new XclImpOleObj( rStrm.GetRoot() ) );
- break;
- case EXC_OBJ_CMO_CHART:
- xDrawObj.reset( new XclImpChartObj( rStrm.GetRoot(), false ) );
- break;
- case EXC_OBJ_CMO_EDIT: // only in dialogs
- case EXC_OBJ_CMO_DIALOG: // not supported
- break;
- default:
- DBG_ERROR1( "XclImpDrawObjBase::ReadObjCmo - unknown object type 0x%04hX", nObjType );
- xDrawObj.reset( new XclImpDrawingObj( rStrm.GetRoot(), true ) );
+ sal_uInt16 nObjType;
+ rStrm.Ignore( 4 );
+ rStrm >> nObjType;
+ switch( nObjType )
+ {
+ case EXC_OBJTYPE_GROUP: xDrawObj.reset( new XclImpGroupObj( rRoot ) ); break;
+ case EXC_OBJTYPE_LINE: xDrawObj.reset( new XclImpLineObj( rRoot ) ); break;
+ case EXC_OBJTYPE_RECTANGLE: xDrawObj.reset( new XclImpRectObj( rRoot ) ); break;
+ case EXC_OBJTYPE_OVAL: xDrawObj.reset( new XclImpOvalObj( rRoot ) ); break;
+ case EXC_OBJTYPE_ARC: xDrawObj.reset( new XclImpArcObj( rRoot ) ); break;
+ case EXC_OBJTYPE_CHART: xDrawObj.reset( new XclImpChartObj( rRoot ) ); break;
+ case EXC_OBJTYPE_TEXT: xDrawObj.reset( new XclImpTextObj( rRoot ) ); break;
+ case EXC_OBJTYPE_BUTTON: xDrawObj.reset( new XclImpButtonObj( rRoot ) ); break;
+ case EXC_OBJTYPE_PICTURE: xDrawObj.reset( new XclImpPictureObj( rRoot ) ); break;
+ case EXC_OBJTYPE_POLYGON: xDrawObj.reset( new XclImpPolygonObj( rRoot ) ); break;
+ case EXC_OBJTYPE_CHECKBOX: xDrawObj.reset( new XclImpCheckBoxObj( rRoot ) ); break;
+ case EXC_OBJTYPE_OPTIONBUTTON: xDrawObj.reset( new XclImpOptionButtonObj( rRoot ) ); break;
+ case EXC_OBJTYPE_EDIT: xDrawObj.reset( new XclImpEditObj( rRoot ) ); break;
+ case EXC_OBJTYPE_LABEL: xDrawObj.reset( new XclImpLabelObj( rRoot ) ); break;
+ case EXC_OBJTYPE_DIALOG: xDrawObj.reset( new XclImpDialogObj( rRoot ) ); break;
+ case EXC_OBJTYPE_SPIN: xDrawObj.reset( new XclImpSpinButtonObj( rRoot ) ); break;
+ case EXC_OBJTYPE_SCROLLBAR: xDrawObj.reset( new XclImpScrollBarObj( rRoot ) ); break;
+ case EXC_OBJTYPE_LISTBOX: xDrawObj.reset( new XclImpListBoxObj( rRoot ) ); break;
+ case EXC_OBJTYPE_GROUPBOX: xDrawObj.reset( new XclImpGroupBoxObj( rRoot ) ); break;
+ case EXC_OBJTYPE_DROPDOWN: xDrawObj.reset( new XclImpDropDownObj( rRoot ) ); break;
+ default:
+ DBG_ERROR1( "XclImpDrawObjBase::ReadObj5 - unknown object type 0x%04hX", nObjType );
+ rRoot.GetTracer().TraceUnsupportedObjects();
+ xDrawObj.reset( new XclImpPhObj( rRoot ) );
+ }
}
- if( xDrawObj.is() )
- xDrawObj->SetObjData( nObjType, nObjId, nFlags );
+ xDrawObj->ImplReadObj5( rStrm );
return xDrawObj;
}
-void XclImpDrawObjBase::ReadSubRecord( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 /*nSubRecSize*/ )
+XclImpDrawObjRef XclImpDrawObjBase::ReadObj8( XclImpStream& rStrm )
{
- switch( nSubRecId )
+ const XclImpRoot& rRoot = rStrm.GetRoot();
+ XclImpDrawObjRef xDrawObj;
+
+ if( rStrm.GetRecLeft() >= 10 )
{
- case EXC_ID_OBJ_FTMACRO:
- ReadMacro( rStrm );
- break;
+ sal_uInt16 nSubRecId, nSubRecSize, nObjType;
+ rStrm >> nSubRecId >> nSubRecSize >> nObjType;
+ DBG_ASSERT( nSubRecId == EXC_ID_OBJCMO, "XclImpDrawObjBase::ReadObj8 - OBJCMO subrecord expected" );
+ if( (nSubRecId == EXC_ID_OBJCMO) && (nSubRecSize >= 6) )
+ {
+ switch( nObjType )
+ {
+ // in BIFF8, all simple objects support text
+ case EXC_OBJTYPE_LINE:
+ case EXC_OBJTYPE_ARC:
+ xDrawObj.reset( new XclImpTextObj( rRoot ) );
+ // lines and arcs may be 2-dimensional
+ xDrawObj->SetAreaObj( false );
+ break;
+
+ // in BIFF8, all simple objects support text
+ case EXC_OBJTYPE_RECTANGLE:
+ case EXC_OBJTYPE_OVAL:
+ case EXC_OBJTYPE_POLYGON:
+ case EXC_OBJTYPE_DRAWING:
+ case EXC_OBJTYPE_TEXT:
+ xDrawObj.reset( new XclImpTextObj( rRoot ) );
+ break;
+
+ case EXC_OBJTYPE_GROUP: xDrawObj.reset( new XclImpGroupObj( rRoot ) ); break;
+ case EXC_OBJTYPE_CHART: xDrawObj.reset( new XclImpChartObj( rRoot ) ); break;
+ case EXC_OBJTYPE_BUTTON: xDrawObj.reset( new XclImpButtonObj( rRoot ) ); break;
+ case EXC_OBJTYPE_PICTURE: xDrawObj.reset( new XclImpPictureObj( rRoot ) ); break;
+ case EXC_OBJTYPE_CHECKBOX: xDrawObj.reset( new XclImpCheckBoxObj( rRoot ) ); break;
+ case EXC_OBJTYPE_OPTIONBUTTON: xDrawObj.reset( new XclImpOptionButtonObj( rRoot ) ); break;
+ case EXC_OBJTYPE_EDIT: xDrawObj.reset( new XclImpEditObj( rRoot ) ); break;
+ case EXC_OBJTYPE_LABEL: xDrawObj.reset( new XclImpLabelObj( rRoot ) ); break;
+ case EXC_OBJTYPE_DIALOG: xDrawObj.reset( new XclImpDialogObj( rRoot ) ); break;
+ case EXC_OBJTYPE_SPIN: xDrawObj.reset( new XclImpSpinButtonObj( rRoot ) ); break;
+ case EXC_OBJTYPE_SCROLLBAR: xDrawObj.reset( new XclImpScrollBarObj( rRoot ) ); break;
+ case EXC_OBJTYPE_LISTBOX: xDrawObj.reset( new XclImpListBoxObj( rRoot ) ); break;
+ case EXC_OBJTYPE_GROUPBOX: xDrawObj.reset( new XclImpGroupBoxObj( rRoot ) ); break;
+ case EXC_OBJTYPE_DROPDOWN: xDrawObj.reset( new XclImpDropDownObj( rRoot ) ); break;
+ case EXC_OBJTYPE_NOTE: xDrawObj.reset( new XclImpNoteObj( rRoot ) ); break;
+
+ default:
+ DBG_ERROR1( "XclImpDrawObjBase::ReadObj8 - unknown object type 0x%04hX", nObjType );
+ rRoot.GetTracer().TraceUnsupportedObjects();
+ xDrawObj.reset( new XclImpPhObj( rRoot ) );
+ }
+ }
}
-}
-void XclImpDrawObjBase::ReadClientAnchor( SvStream& rEscherStrm, const DffRecordHeader& rHeader )
-{
- DBG_ASSERT( rHeader.nRecType == DFF_msofbtClientAnchor, "XclImpDrawObjBase::ReadClientAnchor - no client anchor record" );
- mxAnchor.reset( new XclEscherAnchor( GetScTab() ) );
- rHeader.SeekToContent( rEscherStrm );
- rEscherStrm.SeekRel( 2 );
- rEscherStrm >> *mxAnchor;
+ xDrawObj->ImplReadObj8( rStrm );
+ return xDrawObj;
}
-void XclImpDrawObjBase::SetObjData( sal_uInt16 nObjType, sal_uInt16 nObjId, sal_uInt16 nObjFlags )
+void XclImpDrawObjBase::SetDffData( const DffObjData& rDffObjData, const String& rObjName, const String& rHyperlink, bool bVisible, bool bAutoMargin )
{
- maObjId.mnObjId = nObjId;
- mnObjType = nObjType;
- mnObjFlags = nObjFlags;
+ mnDffShapeId = rDffObjData.nShapeId;
+ mnDffFlags = rDffObjData.nSpFlags;
+ maObjName = rObjName;
+ maHyperlink = rHyperlink;
+ mbVisible = bVisible;
+ mbAutoMargin = bAutoMargin;
+
}
-void XclImpDrawObjBase::SetShapeData( sal_uInt32 nShapeId, sal_uInt32 nShapeFlags, sal_uInt32 nShapeBlipId )
+void XclImpDrawObjBase::SetAnchor( const XclObjAnchor& rAnchor )
{
- mnShapeId = nShapeId;
- mnShapeFlags = nShapeFlags;
- mnShapeBlipId = nShapeBlipId;
+ mxAnchor.reset( new XclObjAnchor( rAnchor ) );
}
-void XclImpDrawObjBase::SetClientAnchor( const XclEscherAnchor& rAnchor )
+String XclImpDrawObjBase::GetObjName() const
{
- mxAnchor.reset( new XclEscherAnchor( rAnchor ) );
+ /* #118053# #i51348# Always return a non-empty name. Create English
+ default names depending on the object type. This is not implemented as
+ virtual functions in derived classes, as class type and object type may
+ not match. */
+ return (maObjName.Len() > 0) ? maObjName : GetObjectManager().GetDefaultObjName( *this );
}
bool XclImpDrawObjBase::IsValidSize( const Rectangle& rAnchorRect ) const
{
- // XclEscherAnchor rounds up the width, width of 3 is the result of an Excel width of 0
+ // XclObjAnchor rounds up the width, width of 3 is the result of an Excel width of 0
return mbAreaObj ?
((rAnchorRect.GetWidth() > 3) && (rAnchorRect.GetHeight() > 1)) :
((rAnchorRect.GetWidth() > 3) || (rAnchorRect.GetHeight() > 1));
@@ -410,7 +421,7 @@ ScRange XclImpDrawObjBase::GetUsedArea() const
if( mxAnchor.is() )
{
// #i44077# object inserted -> update used area for OLE object import
- if( GetAddressConverter().ConvertRange( aScUsedArea, mxAnchor->maXclRange, GetScTab(), GetScTab(), false ) )
+ if( GetAddressConverter().ConvertRange( aScUsedArea, *mxAnchor, GetScTab(), GetScTab(), false ) )
{
// reduce range, if object ends directly on borders between two columns or rows
if( (mxAnchor->mnRX == 0) && (aScUsedArea.aStart.Col() < aScUsedArea.aEnd.Col()) )
@@ -435,13 +446,98 @@ sal_Size XclImpDrawObjBase::GetProgressSize() const
return DoGetProgressSize();
}
+SdrObject* XclImpDrawObjBase::CreateSdrObject( const Rectangle& rAnchorRect, ScfProgressBar& rProgress, bool bDffImport ) const
+{
+ SdrObjectPtr xSdrObj;
+ if( bDffImport && !mbCustomDff )
+ {
+ rProgress.Progress( GetProgressSize() );
+ }
+ else
+ {
+ xSdrObj.reset( DoCreateSdrObj( rAnchorRect, rProgress ) );
+ if( xSdrObj.is() )
+ xSdrObj->SetModel( GetDoc().GetDrawLayer() );
+ }
+ return xSdrObj.release();
+}
+
void XclImpDrawObjBase::ProcessSdrObject( SdrObject& rSdrObj ) const
{
+ // default: front layer, derived classes may have to set other layer in DoProcessSdrObj()
+ rSdrObj.NbcSetLayer( SC_LAYER_FRONT );
+
+ // set object name (GetObjName() will always return a non-empty name)
+ rSdrObj.SetName( GetObjName() );
+
+ // #i39167# full width for all objects regardless of horizontal alignment
+ rSdrObj.SetMergedItem( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_BLOCK ) );
+
+ // automatic text margin
+ if( mbAutoMargin )
+ {
+ sal_Int32 nMargin = GetObjectManager().GetDffManager().GetDefaultTextMargin();
+ rSdrObj.SetMergedItem( SdrTextLeftDistItem( nMargin ) );
+ rSdrObj.SetMergedItem( SdrTextRightDistItem( nMargin ) );
+ rSdrObj.SetMergedItem( SdrTextUpperDistItem( nMargin ) );
+ rSdrObj.SetMergedItem( SdrTextLowerDistItem( nMargin ) );
+ }
+
+ // macro and hyperlink
+#ifdef ISSUE66550_HLINK_FOR_SHAPES
+ if( mbSimpleMacro && ((maMacroName.Len() > 0) || (maHyperlink.getLength() > 0)) )
+ {
+ if( ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( &rSdrObj, TRUE ) )
+ {
+ pInfo->SetMacro( XclControlHelper::GetScMacroName( maMacroName ) );
+ pInfo->SetHlink( maHyperlink );
+ }
+ }
+#else
+ if( mbSimpleMacro && (maMacroName.Len() > 0) )
+ if( ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( &rSdrObj, TRUE ) )
+ pInfo->SetMacro( XclControlHelper::GetScMacroName( maMacroName ) );
+#endif
+
// call virtual function for object type specific processing
DoProcessSdrObj( rSdrObj );
}
-void XclImpDrawObjBase::ReadMacro( XclImpStream& rStrm )
+// protected ------------------------------------------------------------------
+
+void XclImpDrawObjBase::ReadName5( XclImpStream& rStrm, sal_uInt16 nNameLen )
+{
+ maObjName.Erase();
+ if( nNameLen > 0 )
+ {
+ // name length field is repeated before the name
+ maObjName = rStrm.ReadByteString( false );
+ // skip padding byte for word boundaries
+ if( rStrm.GetRecPos() & 1 ) rStrm.Ignore( 1 );
+ }
+}
+
+void XclImpDrawObjBase::ReadMacro3( XclImpStream& rStrm, sal_uInt16 nMacroSize )
+{
+ maMacroName.Erase();
+ rStrm.Ignore( nMacroSize );
+ // skip padding byte for word boundaries, not contained in nMacroSize
+ if( rStrm.GetRecPos() & 1 ) rStrm.Ignore( 1 );
+}
+
+void XclImpDrawObjBase::ReadMacro4( XclImpStream& rStrm, sal_uInt16 nMacroSize )
+{
+ maMacroName.Erase();
+ rStrm.Ignore( nMacroSize );
+}
+
+void XclImpDrawObjBase::ReadMacro5( XclImpStream& rStrm, sal_uInt16 nMacroSize )
+{
+ maMacroName.Erase();
+ rStrm.Ignore( nMacroSize );
+}
+
+void XclImpDrawObjBase::ReadMacro8( XclImpStream& rStrm )
{
maMacroName.Erase();
if( rStrm.GetRecLeft() > 6 )
@@ -473,11 +569,205 @@ void XclImpDrawObjBase::ReadMacro( XclImpStream& rStrm )
}
}
+void XclImpDrawObjBase::ConvertLineStyle( SdrObject& rSdrObj, const XclObjLineData& rLineData ) const
+{
+ if( rLineData.IsAuto() )
+ {
+ XclObjLineData aAutoData;
+ aAutoData.mnAuto = 0;
+ ConvertLineStyle( rSdrObj, aAutoData );
+ }
+ else
+ {
+ long nLineWidth = 35 * ::std::min( rLineData.mnWidth, EXC_OBJ_LINE_THICK );
+ rSdrObj.SetMergedItem( XLineWidthItem( nLineWidth ) );
+ rSdrObj.SetMergedItem( XLineColorItem( EMPTY_STRING, GetPalette().GetColor( rLineData.mnColorIdx ) ) );
+ rSdrObj.SetMergedItem( XLineJointItem( XLINEJOINT_MITER ) );
+
+ ULONG nDotLen = ::std::max< ULONG >( 70 * rLineData.mnWidth, 35 );
+ ULONG nDashLen = 3 * nDotLen;
+ ULONG nDist = 2 * nDotLen;
+
+ switch( rLineData.mnStyle )
+ {
+ default:
+ case EXC_OBJ_LINE_SOLID:
+ rSdrObj.SetMergedItem( XLineStyleItem( XLINE_SOLID ) );
+ break;
+ case EXC_OBJ_LINE_DASH:
+ rSdrObj.SetMergedItem( XLineStyleItem( XLINE_DASH ) );
+ rSdrObj.SetMergedItem( XLineDashItem( EMPTY_STRING, XDash( XDASH_RECT, 0, nDotLen, 1, nDashLen, nDist ) ) );
+ break;
+ case EXC_OBJ_LINE_DOT:
+ rSdrObj.SetMergedItem( XLineStyleItem( XLINE_DASH ) );
+ rSdrObj.SetMergedItem( XLineDashItem( EMPTY_STRING, XDash( XDASH_RECT, 1, nDotLen, 0, nDashLen, nDist ) ) );
+ break;
+ case EXC_OBJ_LINE_DASHDOT:
+ rSdrObj.SetMergedItem( XLineStyleItem( XLINE_DASH ) );
+ rSdrObj.SetMergedItem( XLineDashItem( EMPTY_STRING, XDash( XDASH_RECT, 1, nDotLen, 1, nDashLen, nDist ) ) );
+ break;
+ case EXC_OBJ_LINE_DASHDOTDOT:
+ rSdrObj.SetMergedItem( XLineStyleItem( XLINE_DASH ) );
+ rSdrObj.SetMergedItem( XLineDashItem( EMPTY_STRING, XDash( XDASH_RECT, 2, nDotLen, 1, nDashLen, nDist ) ) );
+ break;
+ case EXC_OBJ_LINE_MEDTRANS:
+ rSdrObj.SetMergedItem( XLineStyleItem( XLINE_SOLID ) );
+ rSdrObj.SetMergedItem( XLineTransparenceItem( 50 ) );
+ break;
+ case EXC_OBJ_LINE_DARKTRANS:
+ rSdrObj.SetMergedItem( XLineStyleItem( XLINE_SOLID ) );
+ rSdrObj.SetMergedItem( XLineTransparenceItem( 25 ) );
+ break;
+ case EXC_OBJ_LINE_LIGHTTRANS:
+ rSdrObj.SetMergedItem( XLineStyleItem( XLINE_SOLID ) );
+ rSdrObj.SetMergedItem( XLineTransparenceItem( 75 ) );
+ break;
+ case EXC_OBJ_LINE_NONE:
+ rSdrObj.SetMergedItem( XLineStyleItem( XLINE_NONE ) );
+ break;
+ }
+ }
+}
+
+void XclImpDrawObjBase::ConvertFillStyle( SdrObject& rSdrObj, const XclObjFillData& rFillData ) const
+{
+ if( rFillData.IsAuto() )
+ {
+ XclObjFillData aAutoData;
+ aAutoData.mnAuto = 0;
+ ConvertFillStyle( rSdrObj, aAutoData );
+ }
+ else if( rFillData.mnPattern == EXC_PATT_NONE )
+ {
+ rSdrObj.SetMergedItem( XFillStyleItem( XFILL_NONE ) );
+ }
+ else
+ {
+ Color aPattColor = GetPalette().GetColor( rFillData.mnPattColorIdx );
+ Color aBackColor = GetPalette().GetColor( rFillData.mnBackColorIdx );
+ if( (rFillData.mnPattern == EXC_PATT_SOLID) || (aPattColor == aBackColor) )
+ {
+ rSdrObj.SetMergedItem( XFillStyleItem( XFILL_SOLID ) );
+ rSdrObj.SetMergedItem( XFillColorItem( EMPTY_STRING, aPattColor ) );
+ }
+ else
+ {
+ static const sal_uInt8 sppnPatterns[][ 8 ] =
+ {
+ { 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55 },
+ { 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD },
+ { 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22 },
+ { 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00 },
+ { 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC },
+ { 0x33, 0x66, 0xCC, 0x99, 0x33, 0x66, 0xCC, 0x99 },
+ { 0xCC, 0x66, 0x33, 0x99, 0xCC, 0x66, 0x33, 0x99 },
+ { 0xCC, 0xCC, 0x33, 0x33, 0xCC, 0xCC, 0x33, 0x33 },
+ { 0xCC, 0xFF, 0x33, 0xFF, 0xCC, 0xFF, 0x33, 0xFF },
+ { 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00 },
+ { 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88 },
+ { 0x11, 0x22, 0x44, 0x88, 0x11, 0x22, 0x44, 0x88 },
+ { 0x88, 0x44, 0x22, 0x11, 0x88, 0x44, 0x22, 0x11 },
+ { 0xFF, 0x11, 0x11, 0x11, 0xFF, 0x11, 0x11, 0x11 },
+ { 0xAA, 0x44, 0xAA, 0x11, 0xAA, 0x44, 0xAA, 0x11 },
+ { 0x88, 0x00, 0x22, 0x00, 0x88, 0x00, 0x22, 0x00 },
+ { 0x80, 0x00, 0x08, 0x00, 0x80, 0x00, 0x08, 0x00 }
+ };
+ const sal_uInt8* const pnPattern = sppnPatterns[ ::std::min< size_t >( rFillData.mnPattern - 2, STATIC_TABLE_SIZE( sppnPatterns ) ) ];
+ // create 2-colored 8x8 DIB
+ SvMemoryStream aMemStrm;
+ aMemStrm << sal_uInt32( 12 ) << sal_Int16( 8 ) << sal_Int16( 8 ) << sal_uInt16( 1 ) << sal_uInt16( 1 );
+ aMemStrm << sal_uInt8( 0xFF ) << sal_uInt8( 0xFF ) << sal_uInt8( 0xFF );
+ aMemStrm << sal_uInt8( 0x00 ) << sal_uInt8( 0x00 ) << sal_uInt8( 0x00 );
+ for( size_t nIdx = 0; nIdx < 8; ++nIdx )
+ aMemStrm << sal_uInt32( pnPattern[ nIdx ] ); // 32-bit little-endian
+ aMemStrm.Seek( STREAM_SEEK_TO_BEGIN );
+ Bitmap aBitmap;
+ aBitmap.Read( aMemStrm, FALSE );
+ XOBitmap aXOBitmap( aBitmap );
+ aXOBitmap.Bitmap2Array();
+ aXOBitmap.SetBitmapType( XBITMAP_8X8 );
+ if( aXOBitmap.GetBackgroundColor().GetColor() == COL_BLACK )
+ ::std::swap( aPattColor, aBackColor );
+ aXOBitmap.SetPixelColor( aPattColor );
+ aXOBitmap.SetBackgroundColor( aBackColor );
+ rSdrObj.SetMergedItem( XFillStyleItem( XFILL_BITMAP ) );
+ rSdrObj.SetMergedItem( XFillBitmapItem( EMPTY_STRING, aXOBitmap ) );
+ }
+ }
+}
+
+void XclImpDrawObjBase::ConvertFrameStyle( SdrObject& rSdrObj, sal_uInt16 nFrameFlags ) const
+{
+ if( ::get_flag( nFrameFlags, EXC_OBJ_FRAME_SHADOW ) )
+ {
+ rSdrObj.SetMergedItem( SdrShadowItem( TRUE ) );
+ rSdrObj.SetMergedItem( SdrShadowXDistItem( 35 ) );
+ rSdrObj.SetMergedItem( SdrShadowYDistItem( 35 ) );
+ rSdrObj.SetMergedItem( SdrShadowColorItem( EMPTY_STRING, GetPalette().GetColor( EXC_COLOR_WINDOWTEXT ) ) );
+ }
+}
+
+Color XclImpDrawObjBase::GetSolidLineColor( const XclObjLineData& rLineData ) const
+{
+ Color aColor( COL_TRANSPARENT );
+ if( rLineData.IsAuto() )
+ {
+ XclObjLineData aAutoData;
+ aAutoData.mnAuto = 0;
+ aColor = GetSolidLineColor( aAutoData );
+ }
+ else if( rLineData.mnStyle != EXC_OBJ_LINE_NONE )
+ {
+ aColor = GetPalette().GetColor( rLineData.mnColorIdx );
+ }
+ return aColor;
+}
+
+Color XclImpDrawObjBase::GetSolidFillColor( const XclObjFillData& rFillData ) const
+{
+ Color aColor( COL_TRANSPARENT );
+ if( rFillData.IsAuto() )
+ {
+ XclObjFillData aAutoData;
+ aAutoData.mnAuto = 0;
+ aColor = GetSolidFillColor( aAutoData );
+ }
+ else if( rFillData.mnPattern != EXC_PATT_NONE )
+ {
+ Color aPattColor = GetPalette().GetColor( rFillData.mnPattColorIdx );
+ Color aBackColor = GetPalette().GetColor( rFillData.mnBackColorIdx );
+ aColor = XclTools::GetPatternColor( aPattColor, aBackColor, rFillData.mnPattern );
+ }
+ return aColor;
+}
+
+void XclImpDrawObjBase::DoReadObj3( XclImpStream&, sal_uInt16 )
+{
+}
+
+void XclImpDrawObjBase::DoReadObj4( XclImpStream&, sal_uInt16 )
+{
+}
+
+void XclImpDrawObjBase::DoReadObj5( XclImpStream&, sal_uInt16, sal_uInt16 )
+{
+}
+
+void XclImpDrawObjBase::DoReadObj8SubRec( XclImpStream&, sal_uInt16, sal_uInt16 )
+{
+}
+
sal_Size XclImpDrawObjBase::DoGetProgressSize() const
{
return 1;
}
+SdrObject* XclImpDrawObjBase::DoCreateSdrObj( const Rectangle&, ScfProgressBar& rProgress ) const
+{
+ rProgress.Progress( GetProgressSize() );
+ return 0;
+}
+
void XclImpDrawObjBase::DoProcessSdrObj( SdrObject& /*rSdrObj*/ ) const
{
// trace if object is not printable
@@ -485,32 +775,859 @@ void XclImpDrawObjBase::DoProcessSdrObj( SdrObject& /*rSdrObj*/ ) const
GetTracer().TraceObjectNotPrintable();
}
+void XclImpDrawObjBase::ImplReadObj3( XclImpStream& rStrm )
+{
+ sal_uInt16 nObjFlags, nMacroSize;
+ XclObjAnchor aAnchor( GetCurrScTab() );
+
+ // back to offset 4 (ignore object count field)
+ rStrm.Seek( 4 );
+ rStrm >> mnObjType >> maObjId.mnObjId >> nObjFlags >> aAnchor >> nMacroSize;
+ rStrm.Ignore( 2 );
+
+ mbHidden = ::get_flag( nObjFlags, EXC_OBJ_HIDDEN );
+ mbVisible = ::get_flag( nObjFlags, EXC_OBJ_VISIBLE );
+ SetAnchor( aAnchor );
+ DoReadObj3( rStrm, nMacroSize );
+}
+
+void XclImpDrawObjBase::ImplReadObj4( XclImpStream& rStrm )
+{
+ sal_uInt16 nObjFlags, nMacroSize;
+ XclObjAnchor aAnchor( GetCurrScTab() );
+
+ // back to offset 4 (ignore object count field)
+ rStrm.Seek( 4 );
+ rStrm >> mnObjType >> maObjId.mnObjId >> nObjFlags >> aAnchor >> nMacroSize;
+ rStrm.Ignore( 2 );
+
+ mbHidden = ::get_flag( nObjFlags, EXC_OBJ_HIDDEN );
+ mbVisible = ::get_flag( nObjFlags, EXC_OBJ_VISIBLE );
+ mbPrintable = ::get_flag( nObjFlags, EXC_OBJ_PRINTABLE );
+ SetAnchor( aAnchor );
+ DoReadObj4( rStrm, nMacroSize );
+}
+
+void XclImpDrawObjBase::ImplReadObj5( XclImpStream& rStrm )
+{
+ sal_uInt16 nObjFlags, nMacroSize, nNameLen;
+ XclObjAnchor aAnchor( GetCurrScTab() );
+
+ // back to offset 4 (ignore object count field)
+ rStrm.Seek( 4 );
+ rStrm >> mnObjType >> maObjId.mnObjId >> nObjFlags >> aAnchor >> nMacroSize;
+ rStrm.Ignore( 2 );
+ rStrm >> nNameLen;
+ rStrm.Ignore( 2 );
+
+ mbHidden = ::get_flag( nObjFlags, EXC_OBJ_HIDDEN );
+ mbVisible = ::get_flag( nObjFlags, EXC_OBJ_VISIBLE );
+ mbPrintable = ::get_flag( nObjFlags, EXC_OBJ_PRINTABLE );
+ SetAnchor( aAnchor );
+ DoReadObj5( rStrm, nNameLen, nMacroSize );
+}
+
+void XclImpDrawObjBase::ImplReadObj8( XclImpStream& rStrm )
+{
+ // back to beginning
+ rStrm.Seek( EXC_REC_SEEK_TO_BEGIN );
+
+ bool bLoop = true;
+ while( bLoop && (rStrm.GetRecLeft() >= 4) )
+ {
+ sal_uInt16 nSubRecId, nSubRecSize;
+ rStrm >> nSubRecId >> nSubRecSize;
+ rStrm.PushPosition();
+ // sometimes the last subrecord has an invalid length (OBJLBSDATA) -> min()
+ nSubRecSize = static_cast< sal_uInt16 >( ::std::min< sal_Size >( nSubRecSize, rStrm.GetRecLeft() ) );
+
+ switch( nSubRecId )
+ {
+ case EXC_ID_OBJCMO:
+ DBG_ASSERT( rStrm.GetRecPos() == 4, "XclImpDrawObjBase::ImplReadObj8 - unexpected OBJCMO subrecord" );
+ if( (rStrm.GetRecPos() == 4) && (nSubRecSize >= 6) )
+ {
+ sal_uInt16 nObjFlags;
+ rStrm >> mnObjType >> maObjId.mnObjId >> nObjFlags;
+ mbPrintable = ::get_flag( nObjFlags, EXC_OBJCMO_PRINTABLE );
+ }
+ break;
+ case EXC_ID_OBJMACRO:
+ ReadMacro8( rStrm );
+ break;
+ case EXC_ID_OBJEND:
+ bLoop = false;
+ break;
+ default:
+ DoReadObj8SubRec( rStrm, nSubRecId, nSubRecSize );
+ }
+
+ rStrm.PopPosition();
+ rStrm.Ignore( nSubRecSize );
+ }
+
+ /* Call DoReadObj8SubRec() with EXC_ID_OBJEND for further stream
+ processing (e.g. charts), even if the OBJEND subrecord is missing. */
+ DoReadObj8SubRec( rStrm, EXC_ID_OBJEND, 0 );
+
+ /* Pictures that Excel reads from BIFF5 and writes to BIFF8 still have the
+ IMGDATA record following the OBJ record (but they use the image data
+ stored in DFF). The IMGDATA record may be continued by several CONTINUE
+ records. But the last CONTINUE record may be in fact an MSODRAWING
+ record that contains the DFF data of the next drawing object! So we
+ have to skip just enough CONTINUE records to look at the next
+ MSODRAWING/CONTINUE record. */
+ if( (rStrm.GetNextRecId() == EXC_ID3_IMGDATA) && rStrm.StartNextRecord() )
+ {
+ sal_uInt32 nDataSize;
+ rStrm.Ignore( 4 );
+ rStrm >> nDataSize;
+ nDataSize -= rStrm.GetRecLeft();
+ // skip following CONTINUE records until IMGDATA ends
+ while( (nDataSize > 0) && (rStrm.GetNextRecId() == EXC_ID_CONT) && rStrm.StartNextRecord() )
+ {
+ DBG_ASSERT( nDataSize >= rStrm.GetRecLeft(), "XclImpDrawObjBase::ImplReadObj8 - CONTINUE too long" );
+ nDataSize -= ::std::min< sal_uInt32 >( rStrm.GetRecLeft(), nDataSize );
+ }
+ DBG_ASSERT( nDataSize == 0, "XclImpDrawObjBase::ImplReadObj8 - missing CONTINUE records" );
+ // next record may be MSODRAWING or CONTINUE or anything else
+ }
+}
+
// ----------------------------------------------------------------------------
-XclImpDrawingObj::XclImpDrawingObj( const XclImpRoot& rRoot, bool bAreaObj ) :
+void XclImpDrawObjVector::InsertGrouped( XclImpDrawObjRef xDrawObj )
+{
+ if( !empty() )
+ if( XclImpGroupObj* pGroupObj = dynamic_cast< XclImpGroupObj* >( back().get() ) )
+ if( pGroupObj->TryInsert( xDrawObj ) )
+ return;
+ push_back( xDrawObj );
+}
+
+sal_Size XclImpDrawObjVector::GetProgressSize() const
+{
+ sal_Size nProgressSize = 0;
+ for( const_iterator aIt = begin(), aEnd = end(); aIt != aEnd; ++aIt )
+ nProgressSize += (*aIt)->GetProgressSize();
+ return nProgressSize;
+}
+
+// ----------------------------------------------------------------------------
+
+XclImpPhObj::XclImpPhObj( const XclImpRoot& rRoot ) :
XclImpDrawObjBase( rRoot )
{
- SetAreaObj( bAreaObj );
+ SetProcessSdrObj( false );
+}
+
+// ----------------------------------------------------------------------------
+
+XclImpGroupObj::XclImpGroupObj( const XclImpRoot& rRoot ) :
+ XclImpDrawObjBase( rRoot ),
+ mnFirstUngrouped( 0 )
+{
}
-void XclImpDrawingObj::DoProcessSdrObj( SdrObject& rSdrObj ) const
+bool XclImpGroupObj::TryInsert( XclImpDrawObjRef xDrawObj )
+{
+ if( (xDrawObj->GetScTab() != GetScTab()) || (xDrawObj->GetObjId().mnObjId == mnFirstUngrouped) )
+ return false;
+ // insert into own list or into nested group
+ maChildren.InsertGrouped( xDrawObj );
+ return true;
+}
+
+void XclImpGroupObj::DoReadObj3( XclImpStream& rStrm, sal_uInt16 nMacroSize )
+{
+ rStrm.Ignore( 4 );
+ rStrm >> mnFirstUngrouped;
+ rStrm.Ignore( 16 );
+ ReadMacro3( rStrm, nMacroSize );
+}
+
+void XclImpGroupObj::DoReadObj4( XclImpStream& rStrm, sal_uInt16 nMacroSize )
+{
+ rStrm.Ignore( 4 );
+ rStrm >> mnFirstUngrouped;
+ rStrm.Ignore( 16 );
+ ReadMacro4( rStrm, nMacroSize );
+}
+
+void XclImpGroupObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize )
+{
+ rStrm.Ignore( 4 );
+ rStrm >> mnFirstUngrouped;
+ rStrm.Ignore( 16 );
+ ReadName5( rStrm, nNameLen );
+ ReadMacro5( rStrm, nMacroSize );
+}
+
+sal_Size XclImpGroupObj::DoGetProgressSize() const
+{
+ return XclImpDrawObjBase::DoGetProgressSize() + maChildren.GetProgressSize();
+}
+
+SdrObject* XclImpGroupObj::DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const
+{
+ TSdrObjectPtr< SdrObjGroup > xSdrObj( new SdrObjGroup );
+ xSdrObj->NbcSetSnapRect( rAnchorRect );
+ for( XclImpDrawObjVector::const_iterator aIt = maChildren.begin(), aEnd = maChildren.end(); aIt != aEnd; ++aIt )
+ GetObjectManager().GetDffManager().ProcessObject( xSdrObj->GetSubList(), **aIt );
+ rProgress.Progress();
+ return xSdrObj.release();
+}
+
+// ----------------------------------------------------------------------------
+
+XclImpLineObj::XclImpLineObj( const XclImpRoot& rRoot ) :
+ XclImpDrawObjBase( rRoot ),
+ mnArrows( 0 ),
+ mnStartPoint( EXC_OBJ_LINE_TL )
+{
+ SetAreaObj( false );
+}
+
+void XclImpLineObj::DoReadObj3( XclImpStream& rStrm, sal_uInt16 nMacroSize )
+{
+ rStrm >> maLineData >> mnArrows >> mnStartPoint;
+ rStrm.Ignore( 1 );
+ ReadMacro3( rStrm, nMacroSize );
+}
+
+void XclImpLineObj::DoReadObj4( XclImpStream& rStrm, sal_uInt16 nMacroSize )
+{
+ rStrm >> maLineData >> mnArrows >> mnStartPoint;
+ rStrm.Ignore( 1 );
+ ReadMacro4( rStrm, nMacroSize );
+}
+
+void XclImpLineObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize )
+{
+ rStrm >> maLineData >> mnArrows >> mnStartPoint;
+ rStrm.Ignore( 1 );
+ ReadName5( rStrm, nNameLen );
+ ReadMacro5( rStrm, nMacroSize );
+}
+
+SdrObject* XclImpLineObj::DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const
+{
+ ::basegfx::B2DPolygon aB2DPolygon;
+ switch( mnStartPoint )
+ {
+ default:
+ case EXC_OBJ_LINE_TL:
+ aB2DPolygon.append( ::basegfx::B2DPoint( rAnchorRect.Left(), rAnchorRect.Top() ) );
+ aB2DPolygon.append( ::basegfx::B2DPoint( rAnchorRect.Right(), rAnchorRect.Bottom() ) );
+ break;
+ case EXC_OBJ_LINE_TR:
+ aB2DPolygon.append( ::basegfx::B2DPoint( rAnchorRect.Right(), rAnchorRect.Top() ) );
+ aB2DPolygon.append( ::basegfx::B2DPoint( rAnchorRect.Left(), rAnchorRect.Bottom() ) );
+ break;
+ case EXC_OBJ_LINE_BR:
+ aB2DPolygon.append( ::basegfx::B2DPoint( rAnchorRect.Right(), rAnchorRect.Bottom() ) );
+ aB2DPolygon.append( ::basegfx::B2DPoint( rAnchorRect.Left(), rAnchorRect.Top() ) );
+ break;
+ case EXC_OBJ_LINE_BL:
+ aB2DPolygon.append( ::basegfx::B2DPoint( rAnchorRect.Left(), rAnchorRect.Bottom() ) );
+ aB2DPolygon.append( ::basegfx::B2DPoint( rAnchorRect.Right(), rAnchorRect.Top() ) );
+ break;
+ }
+ SdrObjectPtr xSdrObj( new SdrPathObj( OBJ_LINE, ::basegfx::B2DPolyPolygon( aB2DPolygon ) ) );
+ ConvertLineStyle( *xSdrObj, maLineData );
+
+ // line ends
+ sal_uInt8 nArrowType = ::extract_value< sal_uInt8 >( mnArrows, 0, 4 );
+ bool bLineStart = false;
+ bool bLineEnd = false;
+ bool bFilled = false;
+ switch( nArrowType )
+ {
+ case EXC_OBJ_ARROW_OPEN: bLineStart = false; bLineEnd = true; bFilled = false; break;
+ case EXC_OBJ_ARROW_OPENBOTH: bLineStart = true; bLineEnd = true; bFilled = false; break;
+ case EXC_OBJ_ARROW_FILLED: bLineStart = false; bLineEnd = true; bFilled = true; break;
+ case EXC_OBJ_ARROW_FILLEDBOTH: bLineStart = true; bLineEnd = true; bFilled = true; break;
+ }
+ if( bLineStart || bLineEnd )
+ {
+ sal_uInt8 nArrowWidth = ::extract_value< sal_uInt8 >( mnArrows, 4, 4 );
+ double fArrowWidth = 3.0;
+ switch( nArrowWidth )
+ {
+ case EXC_OBJ_ARROW_NARROW: fArrowWidth = 2.0; break;
+ case EXC_OBJ_ARROW_MEDIUM: fArrowWidth = 3.0; break;
+ case EXC_OBJ_ARROW_WIDE: fArrowWidth = 5.0; break;
+ }
+
+ sal_uInt8 nArrowLength = ::extract_value< sal_uInt8 >( mnArrows, 8, 4 );
+ double fArrowLength = 3.0;
+ switch( nArrowLength )
+ {
+ case EXC_OBJ_ARROW_NARROW: fArrowLength = 2.5; break;
+ case EXC_OBJ_ARROW_MEDIUM: fArrowLength = 3.5; break;
+ case EXC_OBJ_ARROW_WIDE: fArrowLength = 6.0; break;
+ }
+
+ ::basegfx::B2DPolygon aArrowPoly;
+#define EXC_ARROW_POINT( x, y ) ::basegfx::B2DPoint( fArrowWidth * (x), fArrowLength * (y) )
+ if( bFilled )
+ {
+ aArrowPoly.append( EXC_ARROW_POINT( 0, 100 ) );
+ aArrowPoly.append( EXC_ARROW_POINT( 50, 0 ) );
+ aArrowPoly.append( EXC_ARROW_POINT( 100, 100 ) );
+ }
+ else
+ {
+ sal_uInt8 nLineWidth = ::limit_cast< sal_uInt8 >( maLineData.mnWidth, EXC_OBJ_LINE_THIN, EXC_OBJ_LINE_THICK );
+ aArrowPoly.append( EXC_ARROW_POINT( 50, 0 ) );
+ aArrowPoly.append( EXC_ARROW_POINT( 100, 100 - 3 * nLineWidth ) );
+ aArrowPoly.append( EXC_ARROW_POINT( 100 - 5 * nLineWidth, 100 ) );
+ aArrowPoly.append( EXC_ARROW_POINT( 50, 12 * nLineWidth ) );
+ aArrowPoly.append( EXC_ARROW_POINT( 5 * nLineWidth, 100 ) );
+ aArrowPoly.append( EXC_ARROW_POINT( 0, 100 - 3 * nLineWidth ) );
+ }
+#undef EXC_ARROW_POINT
+
+ ::basegfx::B2DPolyPolygon aArrowPolyPoly( aArrowPoly );
+ long nWidth = static_cast< long >( 125 * fArrowWidth );
+ if( bLineStart )
+ {
+ xSdrObj->SetMergedItem( XLineStartItem( EMPTY_STRING, aArrowPolyPoly ) );
+ xSdrObj->SetMergedItem( XLineStartWidthItem( nWidth ) );
+ xSdrObj->SetMergedItem( XLineStartCenterItem( FALSE ) );
+ }
+ if( bLineEnd )
+ {
+ xSdrObj->SetMergedItem( XLineEndItem( EMPTY_STRING, aArrowPolyPoly ) );
+ xSdrObj->SetMergedItem( XLineEndWidthItem( nWidth ) );
+ xSdrObj->SetMergedItem( XLineEndCenterItem( FALSE ) );
+ }
+ }
+ rProgress.Progress();
+ return xSdrObj.release();
+}
+
+// ----------------------------------------------------------------------------
+
+XclImpRectObj::XclImpRectObj( const XclImpRoot& rRoot ) :
+ XclImpDrawObjBase( rRoot ),
+ mnFrameFlags( 0 )
+{
+ SetAreaObj( true );
+}
+
+void XclImpRectObj::ReadFrameData( XclImpStream& rStrm )
+{
+ rStrm >> maFillData >> maLineData >> mnFrameFlags;
+}
+
+void XclImpRectObj::ConvertRectStyle( SdrObject& rSdrObj ) const
+{
+ ConvertLineStyle( rSdrObj, maLineData );
+ ConvertFillStyle( rSdrObj, maFillData );
+ ConvertFrameStyle( rSdrObj, mnFrameFlags );
+}
+
+void XclImpRectObj::DoReadObj3( XclImpStream& rStrm, sal_uInt16 nMacroSize )
+{
+ ReadFrameData( rStrm );
+ ReadMacro3( rStrm, nMacroSize );
+}
+
+void XclImpRectObj::DoReadObj4( XclImpStream& rStrm, sal_uInt16 nMacroSize )
+{
+ ReadFrameData( rStrm );
+ ReadMacro4( rStrm, nMacroSize );
+}
+
+void XclImpRectObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize )
+{
+ ReadFrameData( rStrm );
+ ReadName5( rStrm, nNameLen );
+ ReadMacro5( rStrm, nMacroSize );
+}
+
+SdrObject* XclImpRectObj::DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const
+{
+ SdrObjectPtr xSdrObj( new SdrRectObj( rAnchorRect ) );
+ ConvertRectStyle( *xSdrObj );
+ rProgress.Progress();
+ return xSdrObj.release();
+}
+
+// ----------------------------------------------------------------------------
+
+XclImpOvalObj::XclImpOvalObj( const XclImpRoot& rRoot ) :
+ XclImpRectObj( rRoot )
+{
+}
+
+SdrObject* XclImpOvalObj::DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const
+{
+ SdrObjectPtr xSdrObj( new SdrCircObj( OBJ_CIRC, rAnchorRect ) );
+ ConvertRectStyle( *xSdrObj );
+ rProgress.Progress();
+ return xSdrObj.release();
+}
+
+// ----------------------------------------------------------------------------
+
+XclImpArcObj::XclImpArcObj( const XclImpRoot& rRoot ) :
+ XclImpDrawObjBase( rRoot ),
+ mnQuadrant( EXC_OBJ_ARC_TR )
+{
+ SetAreaObj( false ); // arc may be 2-dimensional
+}
+
+void XclImpArcObj::DoReadObj3( XclImpStream& rStrm, sal_uInt16 nMacroSize )
+{
+ rStrm >> maFillData >> maLineData >> mnQuadrant;
+ rStrm.Ignore( 1 );
+ ReadMacro3( rStrm, nMacroSize );
+}
+
+void XclImpArcObj::DoReadObj4( XclImpStream& rStrm, sal_uInt16 nMacroSize )
+{
+ rStrm >> maFillData >> maLineData >> mnQuadrant;
+ rStrm.Ignore( 1 );
+ ReadMacro4( rStrm, nMacroSize );
+}
+
+void XclImpArcObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize )
+{
+ rStrm >> maFillData >> maLineData >> mnQuadrant;
+ rStrm.Ignore( 1 );
+ ReadName5( rStrm, nNameLen );
+ ReadMacro5( rStrm, nMacroSize );
+}
+
+SdrObject* XclImpArcObj::DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const
+{
+ Rectangle aNewRect = rAnchorRect;
+ long nStartAngle = 0;
+ long nEndAngle = 0;
+ switch( mnQuadrant )
+ {
+ default:
+ case EXC_OBJ_ARC_TR:
+ nStartAngle = 0;
+ nEndAngle = 9000;
+ aNewRect.Left() -= rAnchorRect.GetWidth();
+ aNewRect.Bottom() += rAnchorRect.GetHeight();
+ break;
+ case EXC_OBJ_ARC_TL:
+ nStartAngle = 9000;
+ nEndAngle = 18000;
+ aNewRect.Right() += rAnchorRect.GetWidth();
+ aNewRect.Bottom() += rAnchorRect.GetHeight();
+ break;
+ case EXC_OBJ_ARC_BL:
+ nStartAngle = 18000;
+ nEndAngle = 27000;
+ aNewRect.Right() += rAnchorRect.GetWidth();
+ aNewRect.Top() -= rAnchorRect.GetHeight();
+ break;
+ case EXC_OBJ_ARC_BR:
+ nStartAngle = 27000;
+ nEndAngle = 0;
+ aNewRect.Left() -= rAnchorRect.GetWidth();
+ aNewRect.Top() -= rAnchorRect.GetHeight();
+ break;
+ }
+ SdrObjKind eObjKind = maFillData.IsFilled() ? OBJ_SECT : OBJ_CARC;
+ SdrObjectPtr xSdrObj( new SdrCircObj( eObjKind, aNewRect, nStartAngle, nEndAngle ) );
+ ConvertFillStyle( *xSdrObj, maFillData );
+ ConvertLineStyle( *xSdrObj, maLineData );
+ rProgress.Progress();
+ return xSdrObj.release();
+}
+
+// ----------------------------------------------------------------------------
+
+XclImpPolygonObj::XclImpPolygonObj( const XclImpRoot& rRoot ) :
+ XclImpRectObj( rRoot ),
+ mnPolyFlags( 0 ),
+ mnPointCount( 0 )
+{
+ SetAreaObj( false ); // polygon may be 2-dimensional
+}
+
+void XclImpPolygonObj::ReadCoordList( XclImpStream& rStrm )
+{
+ if( (rStrm.GetNextRecId() == EXC_ID_COORDLIST) && rStrm.StartNextRecord() )
+ {
+ DBG_ASSERT( rStrm.GetRecLeft() / 4 == mnPointCount, "XclImpPolygonObj::ReadCoordList - wrong polygon point count" );
+ while( rStrm.GetRecLeft() >= 4 )
+ {
+ sal_uInt16 nX, nY;
+ rStrm >> nX >> nY;
+ maCoords.push_back( Point( nX, nY ) );
+ }
+ }
+}
+
+void XclImpPolygonObj::DoReadObj4( XclImpStream& rStrm, sal_uInt16 nMacroSize )
+{
+ ReadFrameData( rStrm );
+ rStrm >> mnPolyFlags;
+ rStrm.Ignore( 10 );
+ rStrm >> mnPointCount;
+ rStrm.Ignore( 8 );
+ ReadMacro4( rStrm, nMacroSize );
+ ReadCoordList( rStrm );
+}
+
+void XclImpPolygonObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize )
+{
+ ReadFrameData( rStrm );
+ rStrm >> mnPolyFlags;
+ rStrm.Ignore( 10 );
+ rStrm >> mnPointCount;
+ rStrm.Ignore( 8 );
+ ReadName5( rStrm, nNameLen );
+ ReadMacro5( rStrm, nMacroSize );
+ ReadCoordList( rStrm );
+}
+
+namespace {
+
+::basegfx::B2DPoint lclGetPolyPoint( const Rectangle& rAnchorRect, const Point& rPoint )
+{
+ return ::basegfx::B2DPoint(
+ rAnchorRect.Left() + static_cast< sal_Int32 >( ::std::min< double >( rPoint.X(), 16384.0 ) / 16384.0 * rAnchorRect.GetWidth() + 0.5 ),
+ rAnchorRect.Top() + static_cast< sal_Int32 >( ::std::min< double >( rPoint.Y(), 16384.0 ) / 16384.0 * rAnchorRect.GetHeight() + 0.5 ) );
+}
+
+} // namespace
+
+SdrObject* XclImpPolygonObj::DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const
+{
+ SdrObjectPtr xSdrObj;
+ if( maCoords.size() >= 2 )
+ {
+ // create the polygon
+ ::basegfx::B2DPolygon aB2DPolygon;
+ for( PointVector::const_iterator aIt = maCoords.begin(), aEnd = maCoords.end(); aIt != aEnd; ++aIt )
+ aB2DPolygon.append( lclGetPolyPoint( rAnchorRect, *aIt ) );
+ // close polygon if specified
+ if( ::get_flag( mnPolyFlags, EXC_OBJ_POLY_CLOSED ) && (maCoords.front() != maCoords.back()) )
+ aB2DPolygon.append( lclGetPolyPoint( rAnchorRect, maCoords.front() ) );
+ // create the SdrObject
+ SdrObjKind eObjKind = maFillData.IsFilled() ? OBJ_PATHPOLY : OBJ_PATHPLIN;
+ xSdrObj.reset( new SdrPathObj( eObjKind, ::basegfx::B2DPolyPolygon( aB2DPolygon ) ) );
+ ConvertRectStyle( *xSdrObj );
+ }
+ rProgress.Progress();
+ return xSdrObj.release();
+}
+
+// ----------------------------------------------------------------------------
+
+void XclImpObjTextData::ReadByteString( XclImpStream& rStrm )
+{
+ mxString.reset();
+ if( maData.mnTextLen > 0 )
+ {
+ mxString.reset( new XclImpString( rStrm.ReadRawByteString( maData.mnTextLen ) ) );
+ // skip padding byte for word boundaries
+ if( rStrm.GetRecPos() & 1 ) rStrm.Ignore( 1 );
+ }
+}
+
+void XclImpObjTextData::ReadFormats( XclImpStream& rStrm )
+{
+ if( mxString.is() )
+ mxString->ReadObjFormats( rStrm, maData.mnFormatSize );
+ else
+ rStrm.Ignore( maData.mnFormatSize );
+}
+
+// ----------------------------------------------------------------------------
+
+XclImpTextObj::XclImpTextObj( const XclImpRoot& rRoot ) :
+ XclImpRectObj( rRoot )
+{
+}
+
+void XclImpTextObj::DoReadObj3( XclImpStream& rStrm, sal_uInt16 nMacroSize )
+{
+ ReadFrameData( rStrm );
+ maTextData.maData.ReadObj3( rStrm );
+ ReadMacro3( rStrm, nMacroSize );
+ maTextData.ReadByteString( rStrm );
+ maTextData.ReadFormats( rStrm );
+}
+
+void XclImpTextObj::DoReadObj4( XclImpStream& rStrm, sal_uInt16 nMacroSize )
+{
+ ReadFrameData( rStrm );
+ maTextData.maData.ReadObj3( rStrm );
+ ReadMacro4( rStrm, nMacroSize );
+ maTextData.ReadByteString( rStrm );
+ maTextData.ReadFormats( rStrm );
+}
+
+void XclImpTextObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize )
+{
+ ReadFrameData( rStrm );
+ maTextData.maData.ReadObj5( rStrm );
+ ReadName5( rStrm, nNameLen );
+ ReadMacro5( rStrm, nMacroSize );
+ maTextData.ReadByteString( rStrm );
+ rStrm.Ignore( maTextData.maData.mnLinkSize ); // ignore text link formula
+ maTextData.ReadFormats( rStrm );
+}
+
+SdrObject* XclImpTextObj::DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const
+{
+ TSdrObjectPtr< SdrObjCustomShape > xSdrObj( new SdrObjCustomShape );
+ xSdrObj->NbcSetSnapRect( rAnchorRect );
+ OUString aRectType = CREATE_OUSTRING( "rectangle" );
+ xSdrObj->MergeDefaultAttributes( &aRectType );
+ ConvertRectStyle( *xSdrObj );
+ BOOL bAutoSize = ::get_flag( maTextData.maData.mnFlags, EXC_OBJ_TEXT_AUTOSIZE );
+ xSdrObj->SetMergedItem( SdrTextAutoGrowWidthItem( bAutoSize ) );
+ xSdrObj->SetMergedItem( SdrTextAutoGrowHeightItem( bAutoSize ) );
+ xSdrObj->SetMergedItem( SdrTextWordWrapItem( TRUE ) );
+ rProgress.Progress();
+ return xSdrObj.release();
+}
+
+void XclImpTextObj::DoProcessSdrObj( SdrObject& rSdrObj ) const
{
// set text data
- if( mxTxoData.is() )
- mxTxoData->ProcessSdrObject( rSdrObj );
+ if( SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( &rSdrObj ) )
+ {
+ if( maTextData.mxString.is() )
+ {
+ if( maTextData.mxString->IsRich() )
+ {
+ // rich text
+ ::std::auto_ptr< EditTextObject > xEditObj(
+ XclImpStringHelper::CreateTextObject( GetRoot(), *maTextData.mxString ) );
+ OutlinerParaObject* pOutlineObj = new OutlinerParaObject( *xEditObj );
+ pOutlineObj->SetOutlinerMode( OUTLINERMODE_TEXTOBJECT );
+ // text object takes ownership of the outliner object
+ pTextObj->NbcSetOutlinerParaObject( pOutlineObj );
+ }
+ else
+ {
+ // plain text
+ pTextObj->NbcSetText( maTextData.mxString->GetText() );
+ }
+ }
+
+ // horizontal text alignment
+ SvxAdjust eHorAlign = SVX_ADJUST_LEFT;
+ switch( maTextData.maData.GetHorAlign() )
+ {
+ case EXC_OBJ_HOR_LEFT: eHorAlign = SVX_ADJUST_LEFT; break;
+ case EXC_OBJ_HOR_CENTER: eHorAlign = SVX_ADJUST_CENTER; break;
+ case EXC_OBJ_HOR_RIGHT: eHorAlign = SVX_ADJUST_RIGHT; break;
+ case EXC_OBJ_HOR_JUSTIFY: eHorAlign = SVX_ADJUST_BLOCK; break;
+ }
+ rSdrObj.SetMergedItem( SvxAdjustItem( eHorAlign, EE_PARA_JUST ) );
+
+ // vertical text alignment
+ SdrTextVertAdjust eVerAlign = SDRTEXTVERTADJUST_TOP;
+ switch( maTextData.maData.GetVerAlign() )
+ {
+ case EXC_OBJ_VER_TOP: eVerAlign = SDRTEXTVERTADJUST_TOP; break;
+ case EXC_OBJ_VER_CENTER: eVerAlign = SDRTEXTVERTADJUST_CENTER; break;
+ case EXC_OBJ_VER_BOTTOM: eVerAlign = SDRTEXTVERTADJUST_BOTTOM; break;
+ case EXC_OBJ_VER_JUSTIFY: eVerAlign = SDRTEXTVERTADJUST_BLOCK; break;
+ }
+ rSdrObj.SetMergedItem( SdrTextVertAdjustItem( eVerAlign ) );
+
+ // orientation (this is only a fake, drawing does not support real text orientation)
+ namespace csst = ::com::sun::star::text;
+ csst::WritingMode eWriteMode = csst::WritingMode_LR_TB;
+ switch( maTextData.maData.mnOrient )
+ {
+ case EXC_OBJ_ORIENT_NONE: eWriteMode = csst::WritingMode_LR_TB; break;
+ case EXC_OBJ_ORIENT_STACKED: eWriteMode = csst::WritingMode_TB_RL; break;
+ case EXC_OBJ_ORIENT_90CCW: eWriteMode = csst::WritingMode_TB_RL; break;
+ case EXC_OBJ_ORIENT_90CW: eWriteMode = csst::WritingMode_TB_RL; break;
+ }
+ rSdrObj.SetMergedItem( SvxWritingModeItem( eWriteMode, SDRATTR_TEXTDIRECTION ) );
+ }
// base class processing
- XclImpDrawObjBase::DoProcessSdrObj( rSdrObj );
+ XclImpRectObj::DoProcessSdrObj( rSdrObj );
+}
+
+// ----------------------------------------------------------------------------
+
+XclImpChartObj::XclImpChartObj( const XclImpRoot& rRoot, bool bOwnTab ) :
+ XclImpRectObj( rRoot ),
+ mbOwnTab( bOwnTab )
+{
+ SetSimpleMacro( false );
+ SetCustomDffObj( true );
+}
+
+void XclImpChartObj::ReadChartSubStream( XclImpStream& rStrm )
+{
+ if( mbOwnTab ? (rStrm.GetRecId() == EXC_ID5_BOF) : ((rStrm.GetNextRecId() == EXC_ID5_BOF) && rStrm.StartNextRecord()) )
+ {
+ sal_uInt16 nBofType;
+ rStrm.Seek( 2 );
+ rStrm >> nBofType;
+ DBG_ASSERT( nBofType == EXC_BOF_CHART, "XclImpChartObj::ReadChartSubStream - no chart BOF record" );
+
+ // read chart, even if BOF record contains wrong substream identifier
+ mxChart.reset( new XclImpChart( GetRoot(), mbOwnTab ) );
+ mxChart->ReadChartSubStream( rStrm );
+ if( mbOwnTab )
+ FinalizeTabChart();
+ }
+ else
+ {
+ DBG_ERRORFILE( "XclImpChartObj::ReadChartSubStream - missing chart substream" );
+ }
+}
+
+void XclImpChartObj::DoReadObj3( XclImpStream& rStrm, sal_uInt16 nMacroSize )
+{
+ // read OBJ record and the following chart substream
+ ReadFrameData( rStrm );
+ rStrm.Ignore( 18 );
+ ReadMacro3( rStrm, nMacroSize );
+#if 0
+ ReadChartSubStream( rStrm );
+#endif
+ // set frame format from OBJ record, it is used if chart itself is transparent
+ if( mxChart.is() )
+ mxChart->UpdateObjFrame( maLineData, maFillData );
+}
+
+void XclImpChartObj::DoReadObj4( XclImpStream& rStrm, sal_uInt16 nMacroSize )
+{
+ // read OBJ record and the following chart substream
+ ReadFrameData( rStrm );
+ rStrm.Ignore( 18 );
+ ReadMacro4( rStrm, nMacroSize );
+#if 0
+ ReadChartSubStream( rStrm );
+#endif
+ // set frame format from OBJ record, it is used if chart itself is transparent
+ if( mxChart.is() )
+ mxChart->UpdateObjFrame( maLineData, maFillData );
+}
+
+void XclImpChartObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize )
+{
+ // read OBJ record and the following chart substream
+ ReadFrameData( rStrm );
+ rStrm.Ignore( 18 );
+ ReadName5( rStrm, nNameLen );
+ ReadMacro5( rStrm, nMacroSize );
+ ReadChartSubStream( rStrm );
+ // set frame format from OBJ record, it is used if chart itself is transparent
+ if( mxChart.is() )
+ mxChart->UpdateObjFrame( maLineData, maFillData );
+}
+
+void XclImpChartObj::DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 /*nSubRecSize*/ )
+{
+ // read the following chart substream
+ if( nSubRecId == EXC_ID_OBJEND )
+ {
+ // enable CONTINUE handling for the entire chart substream
+ rStrm.ResetRecord( true );
+ ReadChartSubStream( rStrm );
+ /* #90118# disable CONTINUE handling again to be able to read
+ following CONTINUE records as MSODRAWING records. */
+ rStrm.ResetRecord( false );
+ }
+}
+
+sal_Size XclImpChartObj::DoGetProgressSize() const
+{
+ return mxChart.is() ? mxChart->GetProgressSize() : 1;
+}
+
+SdrObject* XclImpChartObj::DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const
+{
+ SdrObjectPtr xSdrObj;
+ SfxObjectShell* pDocShell = GetDocShell();
+ if( SvtModuleOptions().IsChart() && pDocShell && mxChart.is() && !mxChart->IsPivotChart() )
+ {
+ // create embedded chart object
+ OUString aEmbObjName;
+ Reference< XEmbeddedObject > xEmbObj = pDocShell->GetEmbeddedObjectContainer().
+ CreateEmbeddedObject( SvGlobalName( SO3_SCH_CLASSID ).GetByteSequence(), aEmbObjName );
+
+ /* Set the size to the embedded object, this prevents that font sizes
+ of text objects are changed in the chart when the object is
+ inserted into the draw page. */
+ sal_Int64 nAspect = ::com::sun::star::embed::Aspects::MSOLE_CONTENT;
+ MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xEmbObj->getMapUnit( nAspect ) );
+ Size aSize( Window::LogicToLogic( rAnchorRect.GetSize(), MapMode( MAP_100TH_MM ), MapMode( aUnit ) ) );
+ ::com::sun::star::awt::Size aAwtSize( aSize.Width(), aSize.Height() );
+ xEmbObj->setVisualAreaSize( nAspect, aAwtSize );
+
+ // create the container OLE object
+ xSdrObj.reset( new SdrOle2Obj( svt::EmbeddedObjectRef( xEmbObj, nAspect ), aEmbObjName, rAnchorRect ) );
+
+ // convert Excel chart to OOo Chart
+ if( svt::EmbeddedObjectRef::TryRunningState( xEmbObj ) )
+ {
+ Reference< XModel > xModel( xEmbObj->getComponent(), UNO_QUERY );
+ mxChart->Convert( xModel, rProgress );
+
+ Reference< XEmbedPersist > xPers( xEmbObj, UNO_QUERY );
+ if( xPers.is() )
+ xPers->storeOwn();
+ }
+ }
+
+ return xSdrObj.release();
+}
+
+void XclImpChartObj::FinalizeTabChart()
+{
+ /* #i44077# Calculate and store DFF anchor for sheet charts.
+ Needed to get used area if this chart is inserted as OLE object. */
+ DBG_ASSERT( mbOwnTab, "XclImpChartObj::FinalizeTabChart - not allowed for embedded chart objects" );
+
+ // set uninitialized page to landscape
+ if( !GetPageSettings().GetPageData().mbValid )
+ GetPageSettings().SetPaperSize( EXC_PAPERSIZE_DEFAULT, false );
+
+ // calculate size of the chart object
+ const XclPageData& rPageData = GetPageSettings().GetPageData();
+ Size aPaperSize( rPageData.GetScPaperSize() );
+
+ long nWidth = XclTools::GetHmmFromTwips( aPaperSize.Width() );
+ long nHeight = XclTools::GetHmmFromTwips( aPaperSize.Height() );
+
+ // subtract page margins, give 1cm extra space
+ nWidth -= (XclTools::GetHmmFromInch( rPageData.mfLeftMargin + rPageData.mfRightMargin ) + 2000);
+ nHeight -= (XclTools::GetHmmFromInch( rPageData.mfTopMargin + rPageData.mfBottomMargin ) + 1000);
+
+ // print column/row headers?
+ if( rPageData.mbPrintHeadings )
+ {
+ nWidth -= 2000;
+ nHeight -= 1000;
+ }
+
+ // create the object anchor
+ XclObjAnchor aAnchor( GetScTab() );
+ aAnchor.SetRect( GetDoc(), Rectangle( 1000, 500, nWidth, nHeight ), MAP_100TH_MM );
+ SetAnchor( aAnchor );
}
// ----------------------------------------------------------------------------
XclImpNoteObj::XclImpNoteObj( const XclImpRoot& rRoot ) :
- XclImpDrawingObj( rRoot, true ),
+ XclImpTextObj( rRoot ),
maScPos( ScAddress::INITIALIZE_INVALID ),
mnNoteFlags( 0 )
{
+ SetSimpleMacro( false );
// note object will be processed, but not inserted into the draw page
- SetSkipInsertSdr();
+ SetInsertSdrObj( false );
}
void XclImpNoteObj::SetNoteData( const ScAddress& rScPos, sal_uInt16 nNoteFlags )
@@ -521,544 +1638,1132 @@ void XclImpNoteObj::SetNoteData( const ScAddress& rScPos, sal_uInt16 nNoteFlags
void XclImpNoteObj::DoProcessSdrObj( SdrObject& rSdrObj ) const
{
- if( maScPos.IsValid() )
+ if( maScPos.IsValid() && maTextData.mxString.is() )
{
- if( const XclImpString* pString = GetString() )
+ SCCOL nScCol = maScPos.Col();
+ SCROW nScRow = maScPos.Row();
+ SCTAB nScTab = GetScTab();
+ bool bVisible = ::get_flag( mnNoteFlags, EXC_NOTE_VISIBLE );
+
+ // create the note object
+ ::std::auto_ptr< EditTextObject > pEditObj(
+ XclImpStringHelper::CreateNoteObject( GetRoot(), *maTextData.mxString ) );
+ // ScPostIt does not take ownership of the passed note
+ ScPostIt aNote( pEditObj.get(), GetDocPtr() );
+ aNote.SetRectangle( rSdrObj.GetSnapRect() );
+ aNote.SetShown( bVisible );
+
+ // get the actual container from this group object
+ SdrObject* pBoxSdrObj = &rSdrObj;
+ if( rSdrObj.IsGroupObject() && rSdrObj.GetSubList() )
{
- SCCOL nScCol = maScPos.Col();
- SCROW nScRow = maScPos.Row();
- SCTAB nScTab = GetScTab();
- bool bVisible = ::get_flag( mnNoteFlags, EXC_NOTE_VISIBLE );
-
- // create the note object
- ::std::auto_ptr< EditTextObject > pEditObj(
- XclImpStringHelper::CreateNoteObject( GetRoot(), *pString ) );
- // ScPostIt does not take ownership of the passed note
- ScPostIt aNote( pEditObj.get(), GetDocPtr() );
- aNote.SetRectangle( rSdrObj.GetSnapRect() );
- aNote.SetShown( bVisible );
-
- // get the actual container from this group object
- SdrObject* pBoxSdrObj = &rSdrObj;
- if( rSdrObj.IsGroupObject() && rSdrObj.GetSubList() )
+ SdrObjListIter aIt( *rSdrObj.GetSubList() );
+ pBoxSdrObj = aIt.Next();
+ }
+
+ // set textbox properties
+ if( pBoxSdrObj )
+ {
+ XclImpTextObj::DoProcessSdrObj( *pBoxSdrObj );
+ pBoxSdrObj->SetMergedItem( SdrTextAutoGrowWidthItem( FALSE ) );
+ pBoxSdrObj->SetMergedItem( SdrTextAutoGrowHeightItem( FALSE ) );
+ aNote.SetAndApplyItemSet( pBoxSdrObj->GetMergedItemSet() );
+ }
+
+ // insert the note into the document
+ GetDoc().SetNote( nScCol, nScRow, nScTab, aNote );
+
+ // make the note visible via ScDetectiveFunc
+ if( bVisible )
+ {
+ ScDetectiveFunc aDetFunc( GetDocPtr(), nScTab );
+ aDetFunc.ShowComment( nScCol, nScRow, TRUE );
+ }
+ }
+}
+
+// ----------------------------------------------------------------------------
+
+XclImpControlHelper::XclImpControlHelper( const XclImpRoot& rRoot, XclCtrlBindMode eBindMode ) :
+ mrRoot( rRoot ),
+ meBindMode( eBindMode )
+{
+}
+
+XclImpControlHelper::~XclImpControlHelper()
+{
+}
+
+SdrObject* XclImpControlHelper::CreateSdrObjectFromShape(
+ const Reference< XShape >& rxShape, const Rectangle& rAnchorRect ) const
+{
+ mxShape = rxShape;
+ SdrObjectPtr xSdrObj( SdrObject::getSdrObjectFromXShape( rxShape ) );
+ if( xSdrObj.is() )
+ {
+ xSdrObj->NbcSetSnapRect( rAnchorRect );
+ // #i30543# insert into control layer
+ xSdrObj->NbcSetLayer( SC_LAYER_CONTROLS );
+ }
+ return xSdrObj.release();
+}
+
+void XclImpControlHelper::ProcessControl( const XclImpDrawObjBase& rDrawObj ) const
+{
+ Reference< XControlModel > xCtrlModel = XclControlHelper::GetControlModel( mxShape );
+ if( !xCtrlModel.is() )
+ return;
+
+ ScfPropertySet aPropSet( xCtrlModel );
+
+ // #118053# #i51348# set object name at control model
+ aPropSet.SetStringProperty( CREATE_OUSTRING( "Name" ), rDrawObj.GetObjName() );
+
+ // control visible and printable?
+// aPropSet.SetBoolProperty( CREATE_OUSTRING( "EnableVisible" ), rDrawObj.IsVisible() ); // waiting for #i88878#
+ aPropSet.SetBoolProperty( CREATE_OUSTRING( "Printable" ), rDrawObj.IsPrintable() );
+
+ // sheet links
+ if( SfxObjectShell* pDocShell = mrRoot.GetDocShell() )
+ {
+ Reference< XMultiServiceFactory > xFactory( pDocShell->GetModel(), UNO_QUERY );
+ if( xFactory.is() )
+ {
+ // cell link
+ if( mxCellLink.is() ) try
{
- SdrObjListIter aIt( *rSdrObj.GetSubList() );
- pBoxSdrObj = aIt.Next();
- }
+ Reference< XBindableValue > xBindable( xCtrlModel, UNO_QUERY_THROW );
+
+ // create argument sequence for createInstanceWithArguments()
+ CellAddress aApiAddress;
+ ScUnoConversion::FillApiAddress( aApiAddress, *mxCellLink );
+
+ NamedValue aValue;
+ aValue.Name = CREATE_OUSTRING( SC_UNONAME_BOUNDCELL );
+ aValue.Value <<= aApiAddress;
+
+ Sequence< Any > aArgs( 1 );
+ aArgs[ 0 ] <<= aValue;
- // set textbox properties
- if( pBoxSdrObj )
+ // create the CellValueBinding instance and set at the control model
+ OUString aServiceName;
+ switch( meBindMode )
+ {
+ case EXC_CTRL_BINDCONTENT: aServiceName = CREATE_OUSTRING( SC_SERVICENAME_VALBIND ); break;
+ case EXC_CTRL_BINDPOSITION: aServiceName = CREATE_OUSTRING( SC_SERVICENAME_LISTCELLBIND ); break;
+ }
+ Reference< XValueBinding > xBinding(
+ xFactory->createInstanceWithArguments( aServiceName, aArgs ), UNO_QUERY_THROW );
+ xBindable->setValueBinding( xBinding );
+ }
+ catch( const Exception& )
{
- XclImpDrawingObj::DoProcessSdrObj( *pBoxSdrObj );
- pBoxSdrObj->SetMergedItem( SdrTextAutoGrowWidthItem( false ) );
- pBoxSdrObj->SetMergedItem( SdrTextAutoGrowHeightItem( false ) );
- aNote.SetAndApplyItemSet( pBoxSdrObj->GetMergedItemSet() );
}
- // insert the note into the document
- GetDoc().SetNote( nScCol, nScRow, nScTab, aNote );
+ // source range
+ if( mxSrcRange.is() ) try
+ {
+ Reference< XListEntrySink > xEntrySink( xCtrlModel, UNO_QUERY_THROW );
+
+ // create argument sequence for createInstanceWithArguments()
+ CellRangeAddress aApiRange;
+ ScUnoConversion::FillApiRange( aApiRange, *mxSrcRange );
- // make the note visible via ScDetectiveFunc
- if( bVisible )
+ NamedValue aValue;
+ aValue.Name = CREATE_OUSTRING( SC_UNONAME_CELLRANGE );
+ aValue.Value <<= aApiRange;
+
+ Sequence< Any > aArgs( 1 );
+ aArgs[ 0 ] <<= aValue;
+
+ // create the EntrySource instance and set at the control model
+ Reference< XListEntrySource > xEntrySource( xFactory->createInstanceWithArguments(
+ CREATE_OUSTRING( SC_SERVICENAME_LISTSOURCE ), aArgs ), UNO_QUERY_THROW );
+ xEntrySink->setListEntrySource( xEntrySource );
+ }
+ catch( const Exception& )
{
- ScDetectiveFunc aDetFunc( GetDocPtr(), nScTab );
- aDetFunc.ShowComment( nScCol, nScRow, TRUE );
}
}
}
+
+ // virtual call for type specific processing
+ DoProcessControl( aPropSet );
}
-// ----------------------------------------------------------------------------
+void XclImpControlHelper::ReadCellLinkFormula( XclImpStream& rStrm, bool bWithBoundSize )
+{
+ ScRangeList aScRanges;
+ ReadRangeList( aScRanges, rStrm, bWithBoundSize );
+ // Use first cell of first range
+ if( const ScRange* pScRange = aScRanges.GetObject( 0 ) )
+ mxCellLink.reset( new ScAddress( pScRange->aStart ) );
+}
-namespace {
+void XclImpControlHelper::ReadSourceRangeFormula( XclImpStream& rStrm, bool bWithBoundSize )
+{
+ ScRangeList aScRanges;
+ ReadRangeList( aScRanges, rStrm, bWithBoundSize );
+ // Use first range
+ if( const ScRange* pScRange = aScRanges.GetObject( 0 ) )
+ mxSrcRange.reset( new ScRange( *pScRange ) );
+}
+
+void XclImpControlHelper::DoProcessControl( ScfPropertySet& ) const
+{
+}
-void lclReadRangeList( ScRangeList& rScRanges, XclImpStream& rStrm )
+void XclImpControlHelper::ReadRangeList( ScRangeList& rScRanges, XclImpStream& rStrm )
{
XclTokenArray aXclTokArr;
aXclTokArr.ReadSize( rStrm );
rStrm.Ignore( 4 );
aXclTokArr.ReadArray( rStrm );
- rStrm.GetRoot().GetFormulaCompiler().CreateRangeList( rScRanges, EXC_FMLATYPE_CONTROL, aXclTokArr, rStrm );
+ mrRoot.GetFormulaCompiler().CreateRangeList( rScRanges, EXC_FMLATYPE_CONTROL, aXclTokArr, rStrm );
+}
+
+void XclImpControlHelper::ReadRangeList( ScRangeList& rScRanges, XclImpStream& rStrm, bool bWithBoundSize )
+{
+ if( bWithBoundSize )
+ {
+ sal_uInt16 nSize;
+ rStrm >> nSize;
+ if( nSize > 0 )
+ {
+ rStrm.PushPosition();
+ ReadRangeList( rScRanges, rStrm );
+ rStrm.PopPosition();
+ rStrm.Ignore( nSize );
+ }
+ }
+ else
+ {
+ ReadRangeList( rScRanges, rStrm );
+ }
+}
+
+// ----------------------------------------------------------------------------
+
+XclImpTbxObjBase::XclImpTbxObjBase( const XclImpRoot& rRoot ) :
+ XclImpTextObj( rRoot ),
+ XclImpControlHelper( rRoot, EXC_CTRL_BINDPOSITION )
+{
+ SetSimpleMacro( false );
+ SetCustomDffObj( true );
+}
+
+namespace {
+
+void lclExtractColor( sal_uInt8& rnColorIdx, const DffPropSet& rDffPropSet, sal_uInt32 nPropId )
+{
+ if( rDffPropSet.IsProperty( nPropId ) )
+ {
+ sal_uInt32 nColor = rDffPropSet.GetPropertyValue( nPropId );
+ if( (nColor & 0xFF000000) == 0x08000000 )
+ rnColorIdx = ::extract_value< sal_uInt8 >( nColor, 0, 8 );
+ }
}
} // namespace
-XclImpControlObjHelper::XclImpControlObjHelper( XclCtrlBindMode eBindMode ) :
- meBindMode( eBindMode )
+void XclImpTbxObjBase::SetDffProperties( const DffPropSet& rDffPropSet )
{
+ maFillData.mnPattern = rDffPropSet.GetPropertyBool( DFF_Prop_fFilled ) ? EXC_PATT_SOLID : EXC_PATT_NONE;
+ lclExtractColor( maFillData.mnBackColorIdx, rDffPropSet, DFF_Prop_fillBackColor );
+ lclExtractColor( maFillData.mnPattColorIdx, rDffPropSet, DFF_Prop_fillColor );
+ ::set_flag( maFillData.mnAuto, EXC_OBJ_LINE_AUTO, false );
+
+ maLineData.mnStyle = rDffPropSet.GetPropertyBool( DFF_Prop_fLine ) ? EXC_OBJ_LINE_SOLID : EXC_OBJ_LINE_NONE;
+ lclExtractColor( maLineData.mnColorIdx, rDffPropSet, DFF_Prop_lineColor );
+ ::set_flag( maLineData.mnAuto, EXC_OBJ_FILL_AUTO, false );
}
-XclImpControlObjHelper::~XclImpControlObjHelper()
+bool XclImpTbxObjBase::FillMacroDescriptor( ScriptEventDescriptor& rDescriptor ) const
{
+ return XclControlHelper::FillMacroDescriptor( rDescriptor, DoGetEventType(), GetMacroName() );
}
-void XclImpControlObjHelper::ReadCellLinkFormula( XclImpStream& rStrm )
+void XclImpTbxObjBase::ConvertFont( ScfPropertySet& rPropSet ) const
{
- ScRangeList aScRanges;
- lclReadRangeList( aScRanges, rStrm );
- if( aScRanges.Count() > 0 )
+ if( maTextData.mxString.is() )
{
- // Use first cell of first range
- ::std::auto_ptr< ScRange > xScRange( aScRanges.Remove( 0UL ) );
- if( xScRange.get() )
- mxCellLink.reset( new ScAddress( xScRange->aStart ) );
+ const XclFormatRunVec& rFormatRuns = maTextData.mxString->GetFormats();
+ if( rFormatRuns.empty() )
+ GetFontBuffer().WriteDefaultCtrlFontProperties( rPropSet );
+ else
+ GetFontBuffer().WriteFontProperties( rPropSet, EXC_FONTPROPSET_CONTROL, rFormatRuns.front().mnFontIdx );
}
}
-void XclImpControlObjHelper::ReadSrcRangeFormula( XclImpStream& rStrm )
+void XclImpTbxObjBase::ConvertLabel( ScfPropertySet& rPropSet ) const
{
- ScRangeList aScRanges;
- lclReadRangeList( aScRanges, rStrm );
- // Use first range
- if( aScRanges.Count() > 0 )
- mxSrcRange.reset( aScRanges.Remove( 0UL ) );
+ if( maTextData.mxString.is() )
+ {
+ String aLabel = maTextData.mxString->GetText();
+ if( maTextData.maData.mnShortcut > 0 )
+ {
+ xub_StrLen nPos = aLabel.Search( static_cast< sal_Unicode >( maTextData.maData.mnShortcut ) );
+ if( nPos != STRING_NOTFOUND )
+ aLabel.Insert( '~', nPos );
+ }
+ rPropSet.SetStringProperty( CREATE_OUSTRING( "Label" ), aLabel );
+ }
+ ConvertFont( rPropSet );
}
-ScfPropertySet XclImpControlObjHelper::GetControlPropSet() const
+SdrObject* XclImpTbxObjBase::DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const
{
- return ScfPropertySet( mxCtrlModel );
+ SdrObjectPtr xSdrObj( GetObjectManager().GetDffManager().CreateSdrObject( *this, rAnchorRect ) );
+ rProgress.Progress();
+ return xSdrObj.release();
}
-void XclImpControlObjHelper::ConvertSheetLinks( const XclImpRoot& rRoot, SdrObject& /* rSdrObj */ ) const
+void XclImpTbxObjBase::DoProcessSdrObj( SdrObject& /*rSdrObj*/ ) const
{
- // get service factory from Calc document
- Reference< XMultiServiceFactory > xFactory;
- if( SfxObjectShell* pDocShell = rRoot.GetDocShell() )
- xFactory.set( pDocShell->GetModel(), UNO_QUERY );
- if( !mxCtrlModel.is() || !xFactory.is() )
- return;
+ // do not call DoProcessSdrObj() from base class (to skip text processing)
+ ProcessControl( *this );
+}
- // *** cell link *** ------------------------------------------------------
+// ----------------------------------------------------------------------------
- Reference< XBindableValue > xBindable( mxCtrlModel, UNO_QUERY );
- if( mxCellLink.is() && xBindable.is() )
+XclImpButtonObj::XclImpButtonObj( const XclImpRoot& rRoot ) :
+ XclImpTbxObjBase( rRoot )
+{
+}
+
+void XclImpButtonObj::DoProcessControl( ScfPropertySet& rPropSet ) const
+{
+ // label and text formatting
+ ConvertLabel( rPropSet );
+
+ /* Horizontal text alignment. For unknown reason, the property type is a
+ simple sal_Int16 and not a com.sun.star.style.HorizontalAlignment. */
+ sal_Int16 nHorAlign = 1;
+ switch( maTextData.maData.GetHorAlign() )
{
- // create argument sequence for createInstanceWithArguments()
- CellAddress aApiAddress;
- ScUnoConversion::FillApiAddress( aApiAddress, *mxCellLink );
+ case EXC_OBJ_HOR_LEFT: nHorAlign = 0; break;
+ case EXC_OBJ_HOR_CENTER: nHorAlign = 1; break;
+ case EXC_OBJ_HOR_RIGHT: nHorAlign = 2; break;
+ }
+ rPropSet.SetProperty( CREATE_OUSTRING( "Align" ), nHorAlign );
- NamedValue aValue;
- aValue.Name = CREATE_OUSTRING( SC_UNONAME_BOUNDCELL );
- aValue.Value <<= aApiAddress;
+ // vertical text alignment
+ namespace csss = ::com::sun::star::style;
+ csss::VerticalAlignment eVerAlign = csss::VerticalAlignment_MIDDLE;
+ switch( maTextData.maData.GetVerAlign() )
+ {
+ case EXC_OBJ_VER_TOP: eVerAlign = csss::VerticalAlignment_TOP; break;
+ case EXC_OBJ_VER_CENTER: eVerAlign = csss::VerticalAlignment_MIDDLE; break;
+ case EXC_OBJ_VER_BOTTOM: eVerAlign = csss::VerticalAlignment_BOTTOM; break;
+ }
+ rPropSet.SetProperty( CREATE_OUSTRING( "VerticalAlign" ), eVerAlign );
- Sequence< Any > aArgs( 1 );
- aArgs[ 0 ] <<= aValue;
+ // always wrap text automatically
+ rPropSet.SetBoolProperty( CREATE_OUSTRING( "MultiLine" ), true );
- // create the CellValueBinding instance
- Reference< XInterface > xInt;
- try
- {
- switch( meBindMode )
- {
- case EXC_CTRL_BINDCONTENT:
- xInt = xFactory->createInstanceWithArguments(
- CREATE_OUSTRING( SC_SERVICENAME_VALBIND ), aArgs );
- break;
- case EXC_CTRL_BINDPOSITION:
- xInt = xFactory->createInstanceWithArguments(
- CREATE_OUSTRING( SC_SERVICENAME_LISTCELLBIND ), aArgs );
- break;
- default:
- DBG_ERRORFILE( "XclImpOcxConverter::ConvertSheetLinks - unknown binding mode" );
- }
- }
- catch( const Exception& )
- {
- }
+ // default button
+ bool bDefButton = ::get_flag( maTextData.maData.mnButtonFlags, EXC_OBJ_BUTTON_DEFAULT );
+ rPropSet.SetBoolProperty( CREATE_OUSTRING( "DefaultButton" ), bDefButton );
+
+ // button type (flags cannot be combined in OOo)
+ namespace cssa = ::com::sun::star::awt;
+ cssa::PushButtonType eButtonType = cssa::PushButtonType_STANDARD;
+ if( ::get_flag( maTextData.maData.mnButtonFlags, EXC_OBJ_BUTTON_CLOSE ) )
+ eButtonType = cssa::PushButtonType_OK;
+ else if( ::get_flag( maTextData.maData.mnButtonFlags, EXC_OBJ_BUTTON_CANCEL ) )
+ eButtonType = cssa::PushButtonType_CANCEL;
+ else if( ::get_flag( maTextData.maData.mnButtonFlags, EXC_OBJ_BUTTON_HELP ) )
+ eButtonType = cssa::PushButtonType_HELP;
+ // property type is short, not enum
+ rPropSet.SetProperty( CREATE_OUSTRING( "PushButtonType" ), sal_Int16( eButtonType ) );
+}
+
+OUString XclImpButtonObj::DoGetServiceName() const
+{
+ return CREATE_OUSTRING( "com.sun.star.form.component.CommandButton" );
+}
- // set the binding at the control
- Reference< XValueBinding > xBinding( xInt, UNO_QUERY );
- if( xBinding.is() )
- xBindable->setValueBinding( xBinding );
+XclTbxEventType XclImpButtonObj::DoGetEventType() const
+{
+ return EXC_TBX_EVENT_ACTION;
+}
+
+// ----------------------------------------------------------------------------
+
+XclImpCheckBoxObj::XclImpCheckBoxObj( const XclImpRoot& rRoot ) :
+ XclImpTbxObjBase( rRoot ),
+ mnState( EXC_OBJ_CHECKBOX_UNCHECKED ),
+ mnCheckBoxFlags( 0 )
+{
+}
+
+void XclImpCheckBoxObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 /*nMacroSize*/ )
+{
+ ReadFrameData( rStrm );
+ rStrm.Ignore( 10 );
+ rStrm >> maTextData.maData.mnFlags;
+ rStrm.Ignore( 20 );
+ ReadName5( rStrm, nNameLen );
+ ReadMacro5( rStrm, rStrm.ReaduInt16() ); // fist macro size invalid and unused
+ ReadCellLinkFormula( rStrm, true );
+ rStrm >> maTextData.maData.mnTextLen;
+ maTextData.ReadByteString( rStrm );
+ rStrm >> mnState >> maTextData.maData.mnShortcut >> maTextData.maData.mnShortcutEA >> mnCheckBoxFlags;
+}
+
+void XclImpCheckBoxObj::DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize )
+{
+ switch( nSubRecId )
+ {
+ case EXC_ID_OBJCBLS:
+ // do not read EXC_ID_OBJCBLSDATA, not written by OOo Excel export
+ rStrm >> mnState;
+ rStrm.Ignore( 4 );
+ rStrm >> maTextData.maData.mnShortcut >> maTextData.maData.mnShortcutEA >> mnCheckBoxFlags;
+ break;
+ case EXC_ID_OBJCBLSFMLA:
+ ReadCellLinkFormula( rStrm, false );
+ break;
+ default:
+ XclImpTbxObjBase::DoReadObj8SubRec( rStrm, nSubRecId, nSubRecSize );
}
+}
- // *** source range *** ---------------------------------------------------
+void XclImpCheckBoxObj::DoProcessControl( ScfPropertySet& rPropSet ) const
+{
+ // label and text formatting
+ ConvertLabel( rPropSet );
- Reference< XListEntrySink > xEntrySink( mxCtrlModel, UNO_QUERY );
- if( mxSrcRange.is() && xEntrySink.is() )
+ // state
+ bool bSupportsTristate = GetObjType() == EXC_OBJTYPE_CHECKBOX;
+ sal_Int16 nApiState = 0;
+ switch( mnState )
{
- // create argument sequence for createInstanceWithArguments()
- CellRangeAddress aApiRange;
- ScUnoConversion::FillApiRange( aApiRange, *mxSrcRange );
+ case EXC_OBJ_CHECKBOX_UNCHECKED: nApiState = 0; break;
+ case EXC_OBJ_CHECKBOX_CHECKED: nApiState = 1; break;
+ case EXC_OBJ_CHECKBOX_TRISTATE: nApiState = bSupportsTristate ? 2 : 1; break;
+ }
+ if( bSupportsTristate )
+ rPropSet.SetBoolProperty( CREATE_OUSTRING( "TriState" ), nApiState == 2 );
+ rPropSet.SetProperty( CREATE_OUSTRING( "DefaultState" ), nApiState );
- NamedValue aValue;
- aValue.Name = CREATE_OUSTRING( SC_UNONAME_CELLRANGE );
- aValue.Value <<= aApiRange;
+ // box style
+ namespace AwtVisualEffect = ::com::sun::star::awt::VisualEffect;
+ sal_Int16 nEffect = ::get_flagvalue( mnCheckBoxFlags, EXC_OBJ_CHECKBOX_FLAT, AwtVisualEffect::FLAT, AwtVisualEffect::LOOK3D );
+ rPropSet.SetProperty( CREATE_OUSTRING( "VisualEffect" ), nEffect );
- Sequence< Any > aArgs( 1 );
- aArgs[ 0 ] <<= aValue;
+ // do not wrap text automatically
+ rPropSet.SetBoolProperty( CREATE_OUSTRING( "MultiLine" ), false );
- // create the CellValueBinding instance
- Reference< XInterface > xInt;
- try
- {
- xInt = xFactory->createInstanceWithArguments(
- CREATE_OUSTRING( SC_SERVICENAME_LISTSOURCE ), aArgs );
- }
- catch( const Exception& )
- {
- }
+ // #i40279# always centered vertically
+ namespace csss = ::com::sun::star::style;
+ rPropSet.SetProperty( CREATE_OUSTRING( "VerticalAlign" ), csss::VerticalAlignment_MIDDLE );
- // set the binding at the control
- Reference< XListEntrySource > xEntrySource( xInt, UNO_QUERY );
- if( xEntrySource.is() )
- xEntrySink->setListEntrySource( xEntrySource );
+ // background color
+ if( maFillData.IsFilled() )
+ {
+ sal_Int32 nColor = static_cast< sal_Int32 >( GetSolidFillColor( maFillData ).GetColor() );
+ rPropSet.SetProperty( CREATE_OUSTRING( "BackgroundColor" ), nColor );
}
}
+OUString XclImpCheckBoxObj::DoGetServiceName() const
+{
+ return CREATE_OUSTRING( "com.sun.star.form.component.CheckBox" );
+}
+
+XclTbxEventType XclImpCheckBoxObj::DoGetEventType() const
+{
+ return EXC_TBX_EVENT_ACTION;
+}
+
// ----------------------------------------------------------------------------
-XclImpTbxControlObj::XclImpTbxControlObj( const XclImpRoot& rRoot ) :
- XclImpDrawingObj( rRoot, true ),
- XclImpControlObjHelper( EXC_CTRL_BINDPOSITION ),
- mnState( EXC_OBJ_CBLS_STATE_UNCHECK ),
- mnSelEntry( 0 ),
- mnSelType( EXC_OBJ_LBS_SEL_SIMPLE ),
- mnLineCount( 0 ),
- mnScrollValue( 0 ),
- mnScrollMin( 0 ),
- mnScrollMax( 100 ),
- mnScrollStep( 1 ),
- mnScrollPage( 10 ),
- mbFlatButton( false ),
- mbFlatBorder( false ),
- mbScrollHor( false )
+XclImpOptionButtonObj::XclImpOptionButtonObj( const XclImpRoot& rRoot ) :
+ XclImpCheckBoxObj( rRoot ),
+ mnNextInGroup( 0 ),
+ mnFirstInGroup( 1 )
+{
+}
+
+void XclImpOptionButtonObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 /*nMacroSize*/ )
{
+ ReadFrameData( rStrm );
+ rStrm.Ignore( 10 );
+ rStrm >> maTextData.maData.mnFlags;
+ rStrm.Ignore( 32 );
+ ReadName5( rStrm, nNameLen );
+ ReadMacro5( rStrm, rStrm.ReaduInt16() ); // fist macro size invalid and unused
+ ReadCellLinkFormula( rStrm, true );
+ rStrm >> maTextData.maData.mnTextLen;
+ maTextData.ReadByteString( rStrm );
+ rStrm >> mnState >> maTextData.maData.mnShortcut >> maTextData.maData.mnShortcutEA;
+ rStrm >> mnCheckBoxFlags >> mnNextInGroup >> mnFirstInGroup;
}
-void XclImpTbxControlObj::ReadSubRecord( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize )
+void XclImpOptionButtonObj::DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize )
{
switch( nSubRecId )
{
- case EXC_ID_OBJ_FTCBLS:
- ReadCbls( rStrm );
- break;
- case EXC_ID_OBJ_FTLBSDATA:
- ReadLbsData( rStrm );
- break;
- case EXC_ID_OBJ_FTSBSFMLA: // equal to ftCblsFmla
- case EXC_ID_OBJ_FTCBLSFMLA:
- ReadCblsFmla( rStrm );
- break;
- case EXC_ID_OBJ_FTSBS:
- ReadSbs( rStrm );
- break;
- case EXC_ID_OBJ_FTGBODATA:
- ReadGboData( rStrm );
+ case EXC_ID_OBJRBODATA:
+ rStrm >> mnNextInGroup >> mnFirstInGroup;
break;
default:
- XclImpDrawObjBase::ReadSubRecord( rStrm, nSubRecId, nSubRecSize );
+ XclImpCheckBoxObj::DoReadObj8SubRec( rStrm, nSubRecId, nSubRecSize );
}
}
-OUString XclImpTbxControlObj::GetServiceName() const
+void XclImpOptionButtonObj::DoProcessControl( ScfPropertySet& rPropSet ) const
{
- return XclControlObjHelper::GetTbxServiceName( GetObjType() );
+ XclImpCheckBoxObj::DoProcessControl( rPropSet );
+ // TODO: grouping
}
-bool XclImpTbxControlObj::FillMacroDescriptor( ScriptEventDescriptor& rEvent ) const
+OUString XclImpOptionButtonObj::DoGetServiceName() const
{
- if( GetMacroName().Len() > 0 )
+ return CREATE_OUSTRING( "com.sun.star.form.component.RadioButton" );
+}
+
+XclTbxEventType XclImpOptionButtonObj::DoGetEventType() const
+{
+ return EXC_TBX_EVENT_ACTION;
+}
+
+// ----------------------------------------------------------------------------
+
+XclImpLabelObj::XclImpLabelObj( const XclImpRoot& rRoot ) :
+ XclImpTbxObjBase( rRoot )
+{
+}
+
+void XclImpLabelObj::DoProcessControl( ScfPropertySet& rPropSet ) const
+{
+ // label and text formatting
+ ConvertLabel( rPropSet );
+
+ // text alignment (always top/left aligned)
+ rPropSet.SetProperty( CREATE_OUSTRING( "Align" ), sal_Int16( 0 ) );
+ namespace csss = ::com::sun::star::style;
+ rPropSet.SetProperty( CREATE_OUSTRING( "VerticalAlign" ), csss::VerticalAlignment_TOP );
+
+ // always wrap text automatically
+ rPropSet.SetBoolProperty( CREATE_OUSTRING( "MultiLine" ), true );
+}
+
+OUString XclImpLabelObj::DoGetServiceName() const
+{
+ return CREATE_OUSTRING( "com.sun.star.form.component.FixedText" );
+}
+
+XclTbxEventType XclImpLabelObj::DoGetEventType() const
+{
+ return EXC_TBX_EVENT_MOUSE;
+}
+
+// ----------------------------------------------------------------------------
+
+XclImpGroupBoxObj::XclImpGroupBoxObj( const XclImpRoot& rRoot ) :
+ XclImpTbxObjBase( rRoot ),
+ mnGroupBoxFlags( 0 )
+{
+}
+
+void XclImpGroupBoxObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 /*nMacroSize*/ )
+{
+ ReadFrameData( rStrm );
+ rStrm.Ignore( 10 );
+ rStrm >> maTextData.maData.mnFlags;
+ rStrm.Ignore( 26 );
+ ReadName5( rStrm, nNameLen );
+ ReadMacro5( rStrm, rStrm.ReaduInt16() ); // fist macro size invalid and unused
+ rStrm >> maTextData.maData.mnTextLen;
+ maTextData.ReadByteString( rStrm );
+ rStrm >> maTextData.maData.mnShortcut >> maTextData.maData.mnShortcutEA >> mnGroupBoxFlags;
+}
+
+void XclImpGroupBoxObj::DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize )
+{
+ switch( nSubRecId )
{
- // type of action is dependent on control type
- rEvent.ListenerType = XclControlObjHelper::GetTbxListenerType( GetObjType() );
- rEvent.EventMethod = XclControlObjHelper::GetTbxEventMethod( GetObjType() );
- if( (rEvent.ListenerType.getLength() > 0) && (rEvent.EventMethod.getLength() > 0) )
- {
- // set the macro name
- rEvent.ScriptType = XclControlObjHelper::GetTbxScriptType();
- rEvent.ScriptCode = XclControlObjHelper::GetScMacroName( GetMacroName() );
- return true;
- }
+ case EXC_ID_OBJGBODATA:
+ rStrm >> maTextData.maData.mnShortcut >> maTextData.maData.mnShortcutEA >> mnGroupBoxFlags;
+ break;
+ default:
+ XclImpTbxObjBase::DoReadObj8SubRec( rStrm, nSubRecId, nSubRecSize );
}
- return false;
}
-void XclImpTbxControlObj::DoProcessSdrObj( SdrObject& rSdrObj ) const
+void XclImpGroupBoxObj::DoProcessControl( ScfPropertySet& rPropSet ) const
{
- // do not call DoProcessSdrObj() from base class to skip text processing
+ // label and text formatting
+ ConvertLabel( rPropSet );
+}
- ScfPropertySet aPropSet = GetControlPropSet();
- if( !aPropSet.Is() )
- return;
+OUString XclImpGroupBoxObj::DoGetServiceName() const
+{
+ return CREATE_OUSTRING( "com.sun.star.form.component.GroupBox" );
+}
- namespace AwtVisualEffect = ::com::sun::star::awt::VisualEffect;
- namespace AwtScrollOrient = ::com::sun::star::awt::ScrollBarOrientation;
- using ::com::sun::star::style::VerticalAlignment_MIDDLE;
+XclTbxEventType XclImpGroupBoxObj::DoGetEventType() const
+{
+ return EXC_TBX_EVENT_MOUSE;
+}
- // control name, printable, sheet links -----------------------------------
+// ----------------------------------------------------------------------------
- // control printable?
- aPropSet.SetBoolProperty( CREATE_OUSTRING( "Printable" ), IsPrintable() );
+XclImpDialogObj::XclImpDialogObj( const XclImpRoot& rRoot ) :
+ XclImpTbxObjBase( rRoot )
+{
+}
- // #118053# #i51348# set internal name of the control (use name from SdrObject, if extant)
- OUString aCtrlName = rSdrObj.GetName();
- if( aCtrlName.getLength() == 0 )
- aCtrlName = XclControlObjHelper::GetTbxControlName( GetObjType() );
- if( aCtrlName.getLength() > 0 )
- aPropSet.SetProperty( CREATE_OUSTRING( "Name" ), aCtrlName );
+void XclImpDialogObj::DoProcessControl( ScfPropertySet& rPropSet ) const
+{
+ // label and text formatting
+ ConvertLabel( rPropSet );
+}
- // sheet links
- ConvertSheetLinks( GetRoot(), rSdrObj );
+OUString XclImpDialogObj::DoGetServiceName() const
+{
+ // dialog frame faked by a groupbox
+ return CREATE_OUSTRING( "com.sun.star.form.component.GroupBox" );
+}
- // control label ----------------------------------------------------------
+XclTbxEventType XclImpDialogObj::DoGetEventType() const
+{
+ return EXC_TBX_EVENT_MOUSE;
+}
- if( const XclImpString* pString = GetString() )
- {
- // the visible label (caption)
- aPropSet.SetStringProperty( CREATE_OUSTRING( "Label" ), pString->GetText() );
+// ----------------------------------------------------------------------------
- // font properties
- const XclFormatRunVec& rFormatRuns = pString->GetFormats();
- if( !rFormatRuns.empty() )
- GetFontBuffer().WriteFontProperties(
- aPropSet, EXC_FONTPROPSET_CONTROL, rFormatRuns.front().mnFontIdx );
- }
+XclImpEditObj::XclImpEditObj( const XclImpRoot& rRoot ) :
+ XclImpTbxObjBase( rRoot ),
+ mnContentType( EXC_OBJ_EDIT_TEXT ),
+ mnMultiLine( 0 ),
+ mnScrollBar( 0 ),
+ mnListBoxObjId( 0 )
+{
+}
+
+bool XclImpEditObj::IsNumeric() const
+{
+ return (mnContentType == EXC_OBJ_EDIT_INTEGER) || (mnContentType == EXC_OBJ_EDIT_DOUBLE);
+}
- // special control contents -----------------------------------------------
+void XclImpEditObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 /*nMacroSize*/ )
+{
+ ReadFrameData( rStrm );
+ rStrm.Ignore( 10 );
+ rStrm >> maTextData.maData.mnFlags;
+ rStrm.Ignore( 14 );
+ ReadName5( rStrm, nNameLen );
+ ReadMacro5( rStrm, rStrm.ReaduInt16() ); // fist macro size invalid and unused
+ rStrm >> maTextData.maData.mnTextLen;
+ maTextData.ReadByteString( rStrm );
+ rStrm >> mnContentType >> mnMultiLine >> mnScrollBar >> mnListBoxObjId;
+}
- switch( GetObjType() )
+void XclImpEditObj::DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize )
+{
+ switch( nSubRecId )
{
- // checkbox/option button
+ case EXC_ID_OBJEDODATA:
+ rStrm >> mnContentType >> mnMultiLine >> mnScrollBar >> mnListBoxObjId;
+ break;
+ default:
+ XclImpTbxObjBase::DoReadObj8SubRec( rStrm, nSubRecId, nSubRecSize );
+ }
+}
- case EXC_OBJ_CMO_CHECKBOX:
- case EXC_OBJ_CMO_OPTIONBUTTON:
+void XclImpEditObj::DoProcessControl( ScfPropertySet& rPropSet ) const
+{
+ if( maTextData.mxString.is() )
+ {
+ OUString aText = maTextData.mxString->GetText();
+ if( IsNumeric() )
{
- bool bCheckBox = GetObjType() == EXC_OBJ_CMO_CHECKBOX;
+ // TODO: OUString::toDouble() does not handle local decimal separator
+ rPropSet.SetProperty( CREATE_OUSTRING( "DefaultValue" ), aText.toDouble() );
+ rPropSet.SetBoolProperty( CREATE_OUSTRING( "Spin" ), mnScrollBar != 0 );
+ }
+ else
+ {
+ rPropSet.SetProperty( CREATE_OUSTRING( "DefaultText" ), aText );
+ rPropSet.SetBoolProperty( CREATE_OUSTRING( "MultiLine" ), mnMultiLine != 0 );
+ rPropSet.SetBoolProperty( CREATE_OUSTRING( "VScroll" ), mnScrollBar != 0 );
+ }
+ }
+ ConvertFont( rPropSet );
+}
- sal_Int16 nApiState = 0;
- switch( mnState )
- {
- case EXC_OBJ_CBLS_STATE_UNCHECK: nApiState = 0; break;
- case EXC_OBJ_CBLS_STATE_CHECK: nApiState = 1; break;
- case EXC_OBJ_CBLS_STATE_TRI: nApiState = bCheckBox ? 2 : 1; break;
- }
- if( bCheckBox )
- aPropSet.SetBoolProperty( CREATE_OUSTRING( "TriState" ), nApiState == 2 );
- aPropSet.SetProperty( CREATE_OUSTRING( "DefaultState" ), nApiState );
+OUString XclImpEditObj::DoGetServiceName() const
+{
+ return IsNumeric() ?
+ CREATE_OUSTRING( "com.sun.star.form.component.NumericField" ) :
+ CREATE_OUSTRING( "com.sun.star.form.component.TextField" );
+}
- sal_Int16 nApiBorder = mbFlatButton ? AwtVisualEffect::FLAT : AwtVisualEffect::LOOK3D;
- aPropSet.SetProperty( CREATE_OUSTRING( "VisualEffect" ), nApiBorder );
+XclTbxEventType XclImpEditObj::DoGetEventType() const
+{
+ return EXC_TBX_EVENT_TEXT;
+}
- // #i40279# always centered vertically
- aPropSet.SetProperty( CREATE_OUSTRING( "VerticalAlign" ), VerticalAlignment_MIDDLE );
- }
+// ----------------------------------------------------------------------------
+
+XclImpTbxObjScrollableBase::XclImpTbxObjScrollableBase( const XclImpRoot& rRoot ) :
+ XclImpTbxObjBase( rRoot ),
+ mnValue( 0 ),
+ mnMin( 0 ),
+ mnMax( 100 ),
+ mnStep( 1 ),
+ mnPageStep( 10 ),
+ mnOrient( 0 ),
+ mnThumbWidth( 1 ),
+ mnScrollFlags( 0 )
+{
+}
+
+void XclImpTbxObjScrollableBase::ReadSbs( XclImpStream& rStrm )
+{
+ rStrm.Ignore( 4 );
+ rStrm >> mnValue >> mnMin >> mnMax >> mnStep >> mnPageStep >> mnOrient >> mnThumbWidth >> mnScrollFlags;
+}
+
+void XclImpTbxObjScrollableBase::DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize )
+{
+ switch( nSubRecId )
+ {
+ case EXC_ID_OBJSBS:
+ ReadSbs( rStrm );
break;
+ case EXC_ID_OBJSBSFMLA:
+ ReadCellLinkFormula( rStrm, false );
+ break;
+ default:
+ XclImpTbxObjBase::DoReadObj8SubRec( rStrm, nSubRecId, nSubRecSize );
+ }
+}
- // listbox/combobox
+// ----------------------------------------------------------------------------
- case EXC_OBJ_CMO_LISTBOX:
- case EXC_OBJ_CMO_COMBOBOX:
- {
- sal_Int16 nApiBorder = mbFlatBorder ? AwtVisualEffect::FLAT : AwtVisualEffect::LOOK3D;
- aPropSet.SetProperty( CREATE_OUSTRING( "Border" ), nApiBorder );
+XclImpSpinButtonObj::XclImpSpinButtonObj( const XclImpRoot& rRoot ) :
+ XclImpTbxObjScrollableBase( rRoot )
+{
+}
- Sequence< sal_Int16 > aSelection;
+void XclImpSpinButtonObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 /*nMacroSize*/ )
+{
+ ReadFrameData( rStrm );
+ ReadSbs( rStrm );
+ ReadName5( rStrm, nNameLen );
+ ReadMacro5( rStrm, rStrm.ReaduInt16() ); // fist macro size invalid and unused
+ ReadCellLinkFormula( rStrm, true );
+}
- switch( GetObjType() )
- {
- case EXC_OBJ_CMO_LISTBOX:
- {
- // selection type
- bool bMultiSel = (mnSelType != EXC_OBJ_LBS_SEL_SIMPLE);
- aPropSet.SetBoolProperty( CREATE_OUSTRING( "MultiSelection" ), bMultiSel );
+void XclImpSpinButtonObj::DoProcessControl( ScfPropertySet& rPropSet ) const
+{
+ // Calc's "Border" property is not the 3D/flat style effect in Excel (#i34712#)
+ rPropSet.SetProperty( CREATE_OUSTRING( "Border" ), ::com::sun::star::awt::VisualEffect::NONE );
+ rPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "DefaultSpinValue" ), mnValue );
+ rPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "SpinValueMin" ), mnMin );
+ rPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "SpinValueMax" ), mnMax );
+ rPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "SpinIncrement" ), mnStep );
- // selection
- if( bMultiSel )
- {
- aSelection.realloc( static_cast< sal_Int32 >( maMultiSel.size() ) );
- sal_Int32 nSeqIndex = 0;
- for( ScfInt16Vec::const_iterator aIter = maMultiSel.begin(), aEnd = maMultiSel.end();
- aIter != aEnd; ++aIter, ++nSeqIndex )
- aSelection[ nSeqIndex ] = *aIter;
- }
- else if( mnSelEntry > 0 )
- {
- aSelection.realloc( 1 );
- aSelection[ 0 ] = mnSelEntry - 1;
- }
- }
- break;
+ // Excel spin buttons always vertical
+ rPropSet.SetProperty( CREATE_OUSTRING( "Orientation" ), ::com::sun::star::awt::ScrollBarOrientation::VERTICAL );
+}
- case EXC_OBJ_CMO_COMBOBOX:
- {
- // dropdown button
- aPropSet.SetBoolProperty( CREATE_OUSTRING( "Dropdown" ), true );
- // dropdown line count
- aPropSet.SetProperty( CREATE_OUSTRING( "LineCount" ), mnLineCount );
- // selection
- if( mnSelEntry > 0 )
- {
- aSelection.realloc( 1 );
- aSelection[ 0 ] = mnSelEntry - 1;
- }
- }
- break;
- }
+OUString XclImpSpinButtonObj::DoGetServiceName() const
+{
+ return CREATE_OUSTRING( "com.sun.star.form.component.SpinButton" );
+}
- if( !HasCellLink() && aSelection.getLength() )
- aPropSet.SetProperty( CREATE_OUSTRING( "DefaultSelection" ), aSelection );
- }
- break;
+XclTbxEventType XclImpSpinButtonObj::DoGetEventType() const
+{
+ return EXC_TBX_EVENT_VALUE;
+}
- // spin button
+// ----------------------------------------------------------------------------
- case EXC_OBJ_CMO_SPIN:
- {
- // Calc's "Border" property is not the 3D/flat style effect in Excel (#i34712#)
- aPropSet.SetProperty( CREATE_OUSTRING( "Border" ), AwtVisualEffect::NONE );
- aPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "SpinValueMin" ), mnScrollMin );
- aPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "SpinValueMax" ), mnScrollMax );
- aPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "SpinIncrement" ), mnScrollStep );
- // Excel spin buttons always vertical
- aPropSet.SetProperty( CREATE_OUSTRING( "Orientation" ), AwtScrollOrient::VERTICAL );
- aPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "DefaultSpinValue" ), mnScrollValue );
- }
+XclImpScrollBarObj::XclImpScrollBarObj( const XclImpRoot& rRoot ) :
+ XclImpTbxObjScrollableBase( rRoot )
+{
+}
+
+void XclImpScrollBarObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 /*nMacroSize*/ )
+{
+ ReadFrameData( rStrm );
+ ReadSbs( rStrm );
+ ReadName5( rStrm, nNameLen );
+ ReadMacro5( rStrm, rStrm.ReaduInt16() ); // fist macro size invalid and unused
+ ReadCellLinkFormula( rStrm, true );
+}
+
+void XclImpScrollBarObj::DoProcessControl( ScfPropertySet& rPropSet ) const
+{
+ // Calc's "Border" property is not the 3D/flat style effect in Excel (#i34712#)
+ rPropSet.SetProperty( CREATE_OUSTRING( "Border" ), ::com::sun::star::awt::VisualEffect::NONE );
+ rPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "DefaultScrollValue" ), mnValue );
+ rPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "ScrollValueMin" ), mnMin );
+ rPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "ScrollValueMax" ), mnMax );
+ rPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "LineIncrement" ), mnStep );
+ rPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "BlockIncrement" ), mnPageStep );
+ rPropSet.SetProperty( CREATE_OUSTRING( "VisibleSize" ), ::std::min< sal_Int32 >( mnPageStep, 1 ) );
+
+ namespace AwtScrollOrient = ::com::sun::star::awt::ScrollBarOrientation;
+ sal_Int32 nApiOrient = ::get_flagvalue( mnOrient, EXC_OBJ_SCROLLBAR_HOR, AwtScrollOrient::HORIZONTAL, AwtScrollOrient::VERTICAL );
+ rPropSet.SetProperty( CREATE_OUSTRING( "Orientation" ), nApiOrient );
+}
+
+OUString XclImpScrollBarObj::DoGetServiceName() const
+{
+ return CREATE_OUSTRING( "com.sun.star.form.component.ScrollBar" );
+}
+
+XclTbxEventType XclImpScrollBarObj::DoGetEventType() const
+{
+ return EXC_TBX_EVENT_VALUE;
+}
+
+// ----------------------------------------------------------------------------
+
+XclImpTbxObjListBase::XclImpTbxObjListBase( const XclImpRoot& rRoot ) :
+ XclImpTbxObjScrollableBase( rRoot ),
+ mnEntryCount( 0 ),
+ mnSelEntry( 0 ),
+ mnListFlags( 0 ),
+ mnEditObjId( 0 ),
+ mbHasDefFontIdx( false )
+{
+}
+
+void XclImpTbxObjListBase::ReadLbsData( XclImpStream& rStrm )
+{
+ ReadSourceRangeFormula( rStrm, true );
+ rStrm >> mnEntryCount >> mnSelEntry >> mnListFlags >> mnEditObjId;
+}
+
+void XclImpTbxObjListBase::SetBoxFormatting( ScfPropertySet& rPropSet ) const
+{
+ // border style
+ namespace AwtVisualEffect = ::com::sun::star::awt::VisualEffect;
+ sal_Int16 nApiBorder = ::get_flagvalue( mnListFlags, EXC_OBJ_LISTBOX_FLAT, AwtVisualEffect::FLAT, AwtVisualEffect::LOOK3D );
+ rPropSet.SetProperty( CREATE_OUSTRING( "Border" ), nApiBorder );
+
+ // font formatting
+ if( mbHasDefFontIdx )
+ GetFontBuffer().WriteFontProperties( rPropSet, EXC_FONTPROPSET_CONTROL, maTextData.maData.mnDefFontIdx );
+ else
+ GetFontBuffer().WriteDefaultCtrlFontProperties( rPropSet );
+}
+
+// ----------------------------------------------------------------------------
+
+XclImpListBoxObj::XclImpListBoxObj( const XclImpRoot& rRoot ) :
+ XclImpTbxObjListBase( rRoot )
+{
+}
+
+void XclImpListBoxObj::ReadFullLbsData( XclImpStream& rStrm, sal_Size nRecLeft )
+{
+ sal_Size nRecEnd = rStrm.GetRecPos() + nRecLeft;
+ ReadLbsData( rStrm );
+ DBG_ASSERT( (rStrm.GetRecPos() == nRecEnd) || (rStrm.GetRecPos() + mnEntryCount == nRecEnd),
+ "XclImpListBoxObj::ReadFullLbsData - invalid size of OBJLBSDATA record" );
+ while( rStrm.IsValid() && (rStrm.GetRecPos() < nRecEnd) )
+ maSelection.push_back( rStrm.ReaduInt8() );
+}
+
+void XclImpListBoxObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 /*nMacroSize*/ )
+{
+ ReadFrameData( rStrm );
+ ReadSbs( rStrm );
+ rStrm.Ignore( 18 );
+ rStrm >> maTextData.maData.mnDefFontIdx;
+ rStrm.Ignore( 4 );
+ ReadName5( rStrm, nNameLen );
+ ReadMacro5( rStrm, rStrm.ReaduInt16() ); // fist macro size invalid and unused
+ ReadCellLinkFormula( rStrm, true );
+ ReadFullLbsData( rStrm, rStrm.GetRecLeft() );
+ mbHasDefFontIdx = true;
+}
+
+void XclImpListBoxObj::DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize )
+{
+ switch( nSubRecId )
+ {
+ case EXC_ID_OBJLBSDATA:
+ ReadFullLbsData( rStrm, nSubRecSize );
break;
+ default:
+ XclImpTbxObjListBase::DoReadObj8SubRec( rStrm, nSubRecId, nSubRecSize );
+ }
+}
- // scrollbar
+void XclImpListBoxObj::DoProcessControl( ScfPropertySet& rPropSet ) const
+{
+ // listbox formatting
+ SetBoxFormatting( rPropSet );
+
+ // selection type
+ sal_uInt8 nSelType = ::extract_value< sal_uInt8 >( mnListFlags, 4, 2 );
+ bool bMultiSel = nSelType != EXC_OBJ_LISTBOX_SINGLE;
+ rPropSet.SetBoolProperty( CREATE_OUSTRING( "MultiSelection" ), bMultiSel );
- case EXC_OBJ_CMO_SCROLLBAR:
+ // selection (do not set, if listbox is linked to a cell)
+ if( !HasCellLink() )
+ {
+ ScfInt16Vec aSelVec;
+
+ // multi selection: API expects sequence of list entry indexes
+ if( bMultiSel )
+ for( ScfUInt8Vec::const_iterator aBeg = maSelection.begin(), aIt = aBeg, aEnd = maSelection.end(); aIt != aEnd; ++aIt )
+ if( *aIt != 0 )
+ aSelVec.push_back( static_cast< sal_Int16 >( aIt - aBeg ) );
+ // single selection: mnSelEntry is one-based, API expects zero-based
+ else if( mnSelEntry > 0 )
+ aSelVec.push_back( static_cast< sal_Int16 >( mnSelEntry - 1 ) );
+
+ if( !aSelVec.empty() )
{
- sal_Int32 nApiOrient = mbScrollHor ? AwtScrollOrient::HORIZONTAL : AwtScrollOrient::VERTICAL;
- sal_Int32 nVisSize = std::min< sal_Int32 >( static_cast< sal_Int32 >( mnScrollPage ), 1 );
-
- // Calc's "Border" property is not the 3D/flat style effect in Excel (#i34712#)
- aPropSet.SetProperty( CREATE_OUSTRING( "Border" ), AwtVisualEffect::NONE );
- aPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "ScrollValueMin" ), mnScrollMin );
- aPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "ScrollValueMax" ), mnScrollMax );
- aPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "LineIncrement" ), mnScrollStep );
- aPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "BlockIncrement" ), mnScrollPage );
- aPropSet.SetProperty( CREATE_OUSTRING( "VisibleSize" ), nVisSize );
- aPropSet.SetProperty( CREATE_OUSTRING( "Orientation" ), nApiOrient );
- aPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "DefaultScrollValue" ), mnScrollValue );
+ Sequence< sal_Int16 > aSelSeq( &aSelVec.front(), static_cast< sal_Int32 >( aSelVec.size() ) );
+ rPropSet.SetProperty( CREATE_OUSTRING( "DefaultSelection" ), aSelSeq );
}
- break;
}
}
-void XclImpTbxControlObj::ReadCbls( XclImpStream& rStrm )
+OUString XclImpListBoxObj::DoGetServiceName() const
{
- sal_uInt16 nStyle;
- rStrm >> mnState;
- rStrm.Ignore( 8 );
- rStrm >> nStyle;
- mnState &= EXC_OBJ_CBLS_STATEMASK;
- mbFlatButton = ::get_flag( nStyle, EXC_OBJ_CBLS_FLAT );
+ return CREATE_OUSTRING( "com.sun.star.form.component.ListBox" );
}
-void XclImpTbxControlObj::ReadCblsFmla( XclImpStream& rStrm )
+XclTbxEventType XclImpListBoxObj::DoGetEventType() const
{
- ReadCellLinkFormula( rStrm );
+ return EXC_TBX_EVENT_CHANGE;
}
-void XclImpTbxControlObj::ReadLbsData( XclImpStream& rStrm )
+// ----------------------------------------------------------------------------
+
+XclImpDropDownObj::XclImpDropDownObj( const XclImpRoot& rRoot ) :
+ XclImpTbxObjListBase( rRoot ),
+ mnLeft( 0 ),
+ mnTop( 0 ),
+ mnRight( 0 ),
+ mnBottom( 0 ),
+ mnDropDownFlags( 0 ),
+ mnLineCount( 0 ),
+ mnMinWidth( 0 )
{
- sal_uInt16 nSubSize;
- rStrm >> nSubSize;
- if( nSubSize )
- {
- // read the address of the data source range
- rStrm.PushPosition();
- ReadSrcRangeFormula( rStrm );
- rStrm.PopPosition();
- rStrm.Ignore( nSubSize );
- }
+}
- // other list box settings
- sal_Int16 nEntryCount;
- sal_uInt16 nStyle, nComboStyle;
- rStrm >> nEntryCount >> mnSelEntry >> nStyle;
- rStrm.Ignore( 2 ); // linked edit field
+sal_uInt16 XclImpDropDownObj::GetDropDownType() const
+{
+ return ::extract_value< sal_uInt8 >( mnDropDownFlags, 0, 2 );
+}
- mnSelType = nStyle & EXC_OBJ_LBS_SELMASK;
- mbFlatBorder = ::get_flag( nStyle, EXC_OBJ_LBS_FLAT );
+void XclImpDropDownObj::ReadFullLbsData( XclImpStream& rStrm )
+{
+ ReadLbsData( rStrm );
+ rStrm >> mnDropDownFlags >> mnLineCount >> mnMinWidth >> maTextData.maData.mnTextLen;
+ maTextData.ReadByteString( rStrm );
+ // dropdowns of auto-filters have 'simple' style, they don't have a text area
+ if( GetDropDownType() == EXC_OBJ_DROPDOWN_SIMPLE )
+ SetProcessSdrObj( false );
+}
+
+void XclImpDropDownObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 /*nMacroSize*/ )
+{
+ ReadFrameData( rStrm );
+ ReadSbs( rStrm );
+ rStrm.Ignore( 18 );
+ rStrm >> maTextData.maData.mnDefFontIdx;
+ rStrm.Ignore( 14 );
+ rStrm >> mnLeft >> mnTop >> mnRight >> mnBottom;
+ rStrm.Ignore( 4 );
+ ReadName5( rStrm, nNameLen );
+ ReadMacro5( rStrm, rStrm.ReaduInt16() ); // fist macro size invalid and unused
+ ReadCellLinkFormula( rStrm, true );
+ ReadFullLbsData( rStrm );
+ mbHasDefFontIdx = true;
+}
- switch( GetObjType() )
+void XclImpDropDownObj::DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize )
+{
+ switch( nSubRecId )
{
- case EXC_OBJ_CMO_LISTBOX:
- if( mnSelType != EXC_OBJ_LBS_SEL_SIMPLE )
- for( sal_Int16 nEntry = 0; nEntry < nEntryCount; ++nEntry )
- if( rStrm.ReaduInt8() != 0 )
- maMultiSel.push_back( nEntry );
- break;
- case EXC_OBJ_CMO_COMBOBOX:
- rStrm >> nComboStyle >> mnLineCount;
- // comboboxes of auto-filters have 'simple' style, they don't have an edit area
- if( (nComboStyle & EXC_OBJ_LBS_COMBOMASK) == EXC_OBJ_LBS_COMBO_SIMPLE )
- SetInvalid();
+ case EXC_ID_OBJLBSDATA:
+ ReadFullLbsData( rStrm );
break;
+ default:
+ XclImpTbxObjListBase::DoReadObj8SubRec( rStrm, nSubRecId, nSubRecSize );
}
}
-void XclImpTbxControlObj::ReadSbs( XclImpStream& rStrm )
+void XclImpDropDownObj::DoProcessControl( ScfPropertySet& rPropSet ) const
{
- sal_uInt16 nOrient, nStyle;
- rStrm.Ignore( 4 );
- rStrm >> mnScrollValue >> mnScrollMin >> mnScrollMax >> mnScrollStep >> mnScrollPage >> nOrient;
- rStrm.Ignore( 2 );
- rStrm >> nStyle;
+ // dropdown listbox formatting
+ SetBoxFormatting( rPropSet );
+ // enable dropdown button
+ rPropSet.SetBoolProperty( CREATE_OUSTRING( "Dropdown" ), true );
+ // dropdown line count
+ rPropSet.SetProperty( CREATE_OUSTRING( "LineCount" ), mnLineCount );
+
+ if( GetDropDownType() == EXC_OBJ_DROPDOWN_COMBOBOX )
+ {
+ // text of editable combobox
+ if( maTextData.mxString.is() )
+ rPropSet.SetStringProperty( CREATE_OUSTRING( "DefaultText" ), maTextData.mxString->GetText() );
+ }
+ else
+ {
+ // selection (do not set, if dropdown is linked to a cell)
+ if( !HasCellLink() && (mnSelEntry > 0) )
+ {
+ Sequence< sal_Int16 > aSelSeq( 1 );
+ aSelSeq[ 0 ] = mnSelEntry - 1;
+ rPropSet.SetProperty( CREATE_OUSTRING( "DefaultSelection" ), aSelSeq );
+ }
+ }
+}
- mbScrollHor = ::get_flag( nOrient, EXC_OBJ_SBS_HORIZONTAL );
- mbFlatButton = ::get_flag( nStyle, EXC_OBJ_SBS_FLAT );
+OUString XclImpDropDownObj::DoGetServiceName() const
+{
+ return (GetDropDownType() == EXC_OBJ_DROPDOWN_COMBOBOX) ?
+ CREATE_OUSTRING( "com.sun.star.form.component.ComboBox" ) :
+ CREATE_OUSTRING( "com.sun.star.form.component.ListBox" );
}
-void XclImpTbxControlObj::ReadGboData( XclImpStream& rStrm )
+XclTbxEventType XclImpDropDownObj::DoGetEventType() const
{
- sal_uInt16 nStyle;
- rStrm.Ignore( 4 );
- rStrm >> nStyle;
- mbFlatBorder = ::get_flag( nStyle, EXC_OBJ_GBO_FLAT );
+ return (GetDropDownType() == EXC_OBJ_DROPDOWN_COMBOBOX) ? EXC_TBX_EVENT_TEXT : EXC_TBX_EVENT_CHANGE;
}
// ----------------------------------------------------------------------------
-XclImpOleObj::XclImpOleObj( const XclImpRoot& rRoot ) :
- XclImpDrawObjBase( rRoot ),
- XclImpControlObjHelper( EXC_CTRL_BINDCONTENT ),
+XclImpPictureObj::XclImpPictureObj( const XclImpRoot& rRoot ) :
+ XclImpRectObj( rRoot ),
+ XclImpControlHelper( rRoot, EXC_CTRL_BINDCONTENT ),
+ mnStorageId( 0 ),
mnCtlsStrmPos( 0 ),
- mbAsSymbol( false ),
+ mnCtlsStrmSize( 0 ),
+ mbEmbedded( false ),
mbLinked( false ),
+ mbSymbol( false ),
mbControl( false ),
mbUseCtlsStrm( false )
{
SetAreaObj( true );
+ SetSimpleMacro( false );
+ SetCustomDffObj( true );
+}
+
+String XclImpPictureObj::GetOleStorageName() const
+{
+ String aStrgName;
+ if( (mbEmbedded || mbLinked) && !mbControl && (mnStorageId > 0) )
+ {
+ aStrgName = mbEmbedded ? EXC_STORAGE_OLE_EMBEDDED : EXC_STORAGE_OLE_LINKED;
+ static const sal_Char spcHexChars[] = "0123456789ABCDEF";
+ for( sal_uInt8 nIndex = 32; nIndex > 0; nIndex -= 4 )
+ aStrgName.Append( sal_Unicode( spcHexChars[ ::extract_value< sal_uInt8 >( mnStorageId, nIndex - 4, 4 ) ] ) );
+ }
+ return aStrgName;
+}
+
+void XclImpPictureObj::DoReadObj3( XclImpStream& rStrm, sal_uInt16 nMacroSize )
+{
+ sal_uInt16 nLinkSize;
+ ReadFrameData( rStrm );
+ rStrm.Ignore( 6 );
+ rStrm >> nLinkSize;
+ rStrm.Ignore( 2 );
+ ReadFlags3( rStrm );
+ ReadMacro3( rStrm, nMacroSize );
+ ReadPictFmla( rStrm, nLinkSize );
+
+ if( (rStrm.GetNextRecId() == EXC_ID3_IMGDATA) && rStrm.StartNextRecord() )
+ maGraphic = XclImpObjectManager::ReadImgData( rStrm );
+}
+
+void XclImpPictureObj::DoReadObj4( XclImpStream& rStrm, sal_uInt16 nMacroSize )
+{
+ sal_uInt16 nLinkSize;
+ ReadFrameData( rStrm );
+ rStrm.Ignore( 6 );
+ rStrm >> nLinkSize;
+ rStrm.Ignore( 2 );
+ ReadFlags3( rStrm );
+ ReadMacro4( rStrm, nMacroSize );
+ ReadPictFmla( rStrm, nLinkSize );
+
+ if( (rStrm.GetNextRecId() == EXC_ID3_IMGDATA) && rStrm.StartNextRecord() )
+ maGraphic = XclImpObjectManager::ReadImgData( rStrm );
+}
+
+void XclImpPictureObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize )
+{
+ sal_uInt16 nLinkSize;
+ ReadFrameData( rStrm );
+ rStrm.Ignore( 6 );
+ rStrm >> nLinkSize;
+ rStrm.Ignore( 2 );
+ ReadFlags3( rStrm );
+ rStrm.Ignore( 4 );
+ ReadName5( rStrm, nNameLen );
+ ReadMacro5( rStrm, nMacroSize );
+ ReadPictFmla( rStrm, nLinkSize );
+
+ if( (rStrm.GetNextRecId() == EXC_ID3_IMGDATA) && rStrm.StartNextRecord() )
+ {
+ // page background is stored as hidden picture with name "__BkgndObj"
+ if( IsHidden() && (GetObjName() == CREATE_STRING( "__BkgndObj" )) )
+ GetPageSettings().ReadImgData( rStrm );
+ else
+ maGraphic = XclImpObjectManager::ReadImgData( rStrm );
+ }
}
-void XclImpOleObj::ReadSubRecord( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize )
+void XclImpPictureObj::DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize )
{
switch( nSubRecId )
{
- case EXC_ID_OBJ_FTPIOGRBIT:
- ReadPioGrbit( rStrm );
+ case EXC_ID_OBJFLAGS:
+ ReadFlags8( rStrm );
break;
- case EXC_ID_OBJ_FTPICTFMLA:
- ReadPictFmla( rStrm, nSubRecSize );
+ case EXC_ID_OBJPICTFMLA:
+ ReadPictFmla( rStrm, rStrm.ReaduInt16() );
break;
default:
- XclImpDrawObjBase::ReadSubRecord( rStrm, nSubRecId, nSubRecSize );
+ XclImpDrawObjBase::DoReadObj8SubRec( rStrm, nSubRecId, nSubRecSize );
}
}
-void XclImpOleObj::DoProcessSdrObj( SdrObject& rSdrObj ) const
+SdrObject* XclImpPictureObj::DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const
{
- if( IsControl() )
+ // try to create an OLE object or form control
+ SdrObjectPtr xSdrObj( GetObjectManager().GetDffManager().CreateSdrObject( *this, rAnchorRect ) );
+
+ // no OLE - create a plain picture from IMGDATA record data
+ if( !xSdrObj && (maGraphic.GetType() != GRAPHIC_NONE) )
{
- // do not call XclImpDrawObjBase::DoProcessSdrObj(), it would trace missing "printable" feature
+ xSdrObj.reset( new SdrGrafObj( maGraphic, rAnchorRect ) );
+ ConvertRectStyle( *xSdrObj );
+ }
- ScfPropertySet aPropSet = GetControlPropSet();
- // printable
- aPropSet.SetBoolProperty( CREATE_OUSTRING( "Printable" ), IsPrintable() );
- // #118053# #i51348# set name from SdrObject as internal name of the control
- if( rSdrObj.GetName().Len() > 0 )
- aPropSet.SetStringProperty( CREATE_OUSTRING( "Name" ), rSdrObj.GetName() );
- // sheet links
- ConvertSheetLinks( GetRoot(), rSdrObj );
+ rProgress.Progress();
+ return xSdrObj.release();
+}
+
+void XclImpPictureObj::DoProcessSdrObj( SdrObject& rSdrObj ) const
+{
+ if( IsOcxControl() )
+ {
+ // do not call XclImpRectObj::DoProcessSdrObj(), it would trace missing "printable" feature
+ ProcessControl( *this );
}
- else
+ else if( mbEmbedded || mbLinked )
{
// trace missing "printable" feature
- XclImpDrawObjBase::DoProcessSdrObj( rSdrObj );
+ XclImpRectObj::DoProcessSdrObj( rSdrObj );
SfxObjectShell* pDocShell = GetDocShell();
SdrOle2Obj* pOleSdrObj = dynamic_cast< SdrOle2Obj* >( &rSdrObj );
@@ -1078,7 +2783,7 @@ void XclImpOleObj::DoProcessSdrObj( SdrObject& rSdrObj ) const
}
else
{
- /* If the object is still not in container it must be iserted
+ /* If the object is still not in container it must be inserted
there, the name must be generated in this case. */
OUString aNewName;
rEmbObjCont.InsertEmbeddedObject( xEmbObj, aNewName );
@@ -1090,294 +2795,168 @@ void XclImpOleObj::DoProcessSdrObj( SdrObject& rSdrObj ) const
}
}
-void XclImpOleObj::ReadPioGrbit( XclImpStream& rStrm )
+void XclImpPictureObj::ReadFlags3( XclImpStream& rStrm )
{
sal_uInt16 nFlags;
rStrm >> nFlags;
- mbAsSymbol = ::get_flag( nFlags, EXC_OBJ_PIO_SYMBOL );
- mbLinked = ::get_flag( nFlags, EXC_OBJ_PIO_LINKED );
- mbControl = ::get_flag( nFlags, EXC_OBJ_PIO_CONTROL );
- mbUseCtlsStrm = ::get_flag( nFlags, EXC_OBJ_PIO_CTLSSTREAM );
+ mbSymbol = ::get_flag( nFlags, EXC_OBJ_PIC_SYMBOL );
}
-void XclImpOleObj::ReadPictFmla( XclImpStream& rStrm, sal_uInt16 nRecSize )
+void XclImpPictureObj::ReadFlags8( XclImpStream& rStrm )
{
- sal_uInt32 nStorageId = 0;
- sal_uInt16 nFmlaLen;
- rStrm >> nFmlaLen;
-
- // --- linked ---
-
- if( mbLinked )
- {
- DBG_ASSERT( nFmlaLen + 2 == nRecSize, "XclImpOleObj::ReadPictFmla - bad linked size" );
- rStrm.Ignore( 7 );
- sal_uInt16 nXti, nExtName;
- rStrm >> nXti >> nExtName;
- const XclImpExtName* pExtName = GetLinkManager().GetExternName( nXti, nExtName );
- bool bOk = pExtName && (pExtName->GetType() == xlExtOLE);
- DBG_ASSERT( bOk, "XclImpOleObj::ReadPictFmla - EXTERNNAME not found or not OLE" );
- if( bOk )
- nStorageId = pExtName->GetStorageId();
- }
-
- // --- embedded ---
+ sal_uInt16 nFlags;
+ rStrm >> nFlags;
+ mbSymbol = ::get_flag( nFlags, EXC_OBJ_PIC_SYMBOL );
+ mbControl = ::get_flag( nFlags, EXC_OBJ_PIC_CONTROL );
+ mbUseCtlsStrm = ::get_flag( nFlags, EXC_OBJ_PIC_CTLSSTREAM );
+ DBG_ASSERT( mbControl || !mbUseCtlsStrm, "XclImpPictureObj::ReadFlags8 - CTLS stream for controls only" );
+ SetProcessSdrObj( mbControl || !mbUseCtlsStrm );
+}
- else if( nFmlaLen + 2 < nRecSize ) // #107158# ignore picture links (are embedded OLE obj's too)
+void XclImpPictureObj::ReadPictFmla( XclImpStream& rStrm, sal_uInt16 nLinkSize )
+{
+ sal_Size nLinkEnd = rStrm.GetRecPos() + nLinkSize;
+ if( nLinkSize >= 6 )
{
- String aUserName;
- sal_Size nPos0 = rStrm.GetRecPos(); // fmla start
-
- sal_uInt16 n16;
- rStrm >> n16; // should be 5 but who knows ...
- DBG_ASSERT( n16 + 4 <= nFmlaLen, "XclImpOleObj::ReadPictFmla - embedded length mismatch" );
- if( n16 + 4 <= nFmlaLen )
- {
- rStrm.Ignore( n16 + 4 );
- sal_uInt8 n8;
- rStrm >> n8;
- DBG_ASSERT( n8 == 0x03, "XclImpOleObj::ReadPictFmla - no name start" );
- if( n8 == 0x03 )
- {
- rStrm >> n16; // string length
- if( n16 )
- { // the 4th way Xcl stores a unicode string: not even a Grbit byte present if length 0
- aUserName = rStrm.ReadUniString( n16 );
- // 0:= ID follows, 1:= pad byte + ID
-#ifndef PRODUCT
- sal_sSize nLeft = static_cast< sal_sSize >( nFmlaLen + nPos0 - rStrm.GetRecPos() );
- DBG_ASSERT( (nLeft == 0) || (nLeft == 1), "XclImpOleObj::ReadPictFmla - unknown left over" );
-#endif
- }
- }
- }
- rStrm.Seek( nPos0 + nFmlaLen );
- rStrm >> nStorageId;
-
- if( IsControl() )
+ sal_uInt16 nFmlaSize;
+ rStrm >> nFmlaSize;
+ DBG_ASSERT( nFmlaSize > 0, "XclImpPictureObj::ReadPictFmla - missing link formula" );
+ // BIFF3/BIFF4 do not support storages, nothing to do here
+ if( (nFmlaSize > 0) && (GetBiff() >= EXC_BIFF5) )
{
- mnCtlsStrmPos = static_cast< sal_Size >( nStorageId );
- nStorageId = 0;
+ rStrm.Ignore( 4 );
+ sal_uInt8 nToken;
+ rStrm >> nToken;
- if( aUserName.EqualsAscii( "Forms.HTML:Hidden.1" ) )
- {
- // #i26521# form controls to be ignored
- SetInvalid();
- }
- else if( rStrm.GetRecLeft() > 8 )
+ // different processing for linked vs. embedded OLE objects
+ if( nToken == XclTokenArrayHelper::GetTokenId( EXC_TOKID_NAMEX, EXC_TOKCLASS_REF ) )
{
- // data size in 'Ctls'
- rStrm.Ignore( 4 );
-
- // a class ID (16-bit string), e.g. for progress bar control
- sal_uInt32 nClassIdSize;
- rStrm >> nClassIdSize;
- DBG_ASSERT( rStrm.GetRecLeft() >= nClassIdSize + 4, "XclImpOleObj::ReadPictFmla - missing data" );
- if( rStrm.GetRecLeft() >= nClassIdSize + 4 )
+ mbLinked = true;
+ switch( GetBiff() )
{
- rStrm.Ignore( nClassIdSize );
-
- // read additional link data
- sal_uInt16 nDataSize;
-
- // cell link
- rStrm >> nDataSize;
- if( nDataSize )
+ case EXC_BIFF5:
{
- rStrm.PushPosition();
- ReadCellLinkFormula( rStrm );
- rStrm.PopPosition();
- rStrm.Ignore( nDataSize );
+ sal_Int16 nRefIdx;
+ sal_uInt16 nNameIdx;
+ rStrm >> nRefIdx;
+ rStrm.Ignore( 8 );
+ rStrm >> nNameIdx;
+ rStrm.Ignore( 12 );
+ const ExtName* pExtName = GetOldRoot().pExtNameBuff->GetNameByIndex( nRefIdx, nNameIdx );
+ if( pExtName && pExtName->IsOLE() )
+ mnStorageId = pExtName->nStorageId;
}
- // source data range
- rStrm >> nDataSize;
- if( nDataSize )
+ break;
+ case EXC_BIFF8:
{
- rStrm.PushPosition();
- ReadSrcRangeFormula( rStrm );
- rStrm.PopPosition();
- rStrm.Ignore( nDataSize );
+ sal_uInt16 nXti, nExtName;
+ rStrm >> nXti >> nExtName;
+ const XclImpExtName* pExtName = GetLinkManager().GetExternName( nXti, nExtName );
+ if( pExtName && (pExtName->GetType() == xlExtOLE) )
+ mnStorageId = pExtName->GetStorageId();
}
+ break;
+ default:
+ DBG_ERROR_BIFF();
+ }
+ }
+ else if( nToken == XclTokenArrayHelper::GetTokenId( EXC_TOKID_TBL, EXC_TOKCLASS_NONE ) )
+ {
+ mbEmbedded = true;
+ DBG_ASSERT( nFmlaSize == 5, "XclImpPictureObj::ReadPictFmla - unexpected formula size" );
+ rStrm.Ignore( nFmlaSize - 1 ); // token ID already read
+ if( nFmlaSize & 1 )
+ rStrm.Ignore( 1 ); // padding byte
+
+ // a class name may follow inside the picture link
+ if( rStrm.GetRecPos() + 2 <= nLinkEnd )
+ {
+ sal_uInt16 nLen;
+ rStrm >> nLen;
+ if( nLen > 0 )
+ maClassName = (GetBiff() == EXC_BIFF8) ? rStrm.ReadUniString( nLen ) : rStrm.ReadRawByteString( nLen );
}
}
+ // else: ignore other formulas, e.g. pictures linked to cell ranges
}
}
- if( nStorageId != 0 )
- {
- if( mbLinked )
- maStorageName = EXC_STORAGE_OLE_LINKED;
- else
- maStorageName = EXC_STORAGE_OLE_EMBEDDED;
- sal_Char aBuf[ 2 * sizeof( sal_uInt32 ) + 1 ];
- sprintf( aBuf, "%08X", static_cast< unsigned int >( nStorageId ) ); // #100211# - checked
- maStorageName.AppendAscii( aBuf );
- }
-}
+ // seek behind picture link data
+ rStrm.Seek( nLinkEnd );
-// ----------------------------------------------------------------------------
+ // read additional data for embedded OLE objects following the picture link
+ if( IsOcxControl() )
+ {
+ // #i26521# form controls to be ignored
+ if( maClassName.EqualsAscii( "Forms.HTML:Hidden.1" ) )
+ {
+ SetProcessSdrObj( false );
+ return;
+ }
-XclImpChartObj::XclImpChartObj( const XclImpRoot& rRoot, bool bOwnTab ) :
- XclImpDrawObjBase( rRoot ),
- mbOwnTab( bOwnTab )
-{
- SetAreaObj( true );
-}
+ if( rStrm.GetRecLeft() <= 8 ) return;
-void XclImpChartObj::ReadObj5( XclImpStream& rStrm )
-{
- const XclImpPalette& rPal = GetPalette();
+ // position and size of control data in 'Ctls' stream
+ mnCtlsStrmPos = static_cast< sal_Size >( rStrm.ReaduInt32() );
+ mnCtlsStrmSize = static_cast< sal_Size >( rStrm.ReaduInt32() );
- // area formatting
- sal_uInt8 nBackIdx, nPattIdx, nPattern, nAreaFlags;
- rStrm >> nBackIdx >> nPattIdx >> nPattern >> nAreaFlags;
- mxAreaFmt.reset( new XclChAreaFormat );
- mxAreaFmt->maPattColor = rPal.GetColor( nPattIdx );
- mxAreaFmt->maBackColor = rPal.GetColor( nBackIdx );
- mxAreaFmt->mnPattern = nPattern;
- ::set_flag( mxAreaFmt->mnFlags, EXC_CHAREAFORMAT_AUTO, nAreaFlags & 1 );
+ if( rStrm.GetRecLeft() <= 8 ) return;
- // line formatting
- sal_uInt8 nLineIdx, nLineType, nLineWeight, nLineFlags;
- rStrm >> nLineIdx >> nLineType >> nLineWeight >> nLineFlags;
- mxLineFmt.reset( new XclChLineFormat );
- mxLineFmt->maColor = rPal.GetColor( nLineIdx );
- switch( nLineType )
- {
- case 0: mxLineFmt->mnPattern = EXC_CHLINEFORMAT_SOLID; break;
- case 1: mxLineFmt->mnPattern = EXC_CHLINEFORMAT_DASH; break;
- case 2: mxLineFmt->mnPattern = EXC_CHLINEFORMAT_DOT; break;
- case 3: mxLineFmt->mnPattern = EXC_CHLINEFORMAT_DASHDOT; break;
- case 4: mxLineFmt->mnPattern = EXC_CHLINEFORMAT_DASHDOTDOT; break;
- case 5: mxLineFmt->mnPattern = EXC_CHLINEFORMAT_DARKTRANS; break;
- case 6: mxLineFmt->mnPattern = EXC_CHLINEFORMAT_MEDTRANS; break;
- case 7: mxLineFmt->mnPattern = EXC_CHLINEFORMAT_LIGHTTRANS; break;
- case 255: mxLineFmt->mnPattern = EXC_CHLINEFORMAT_NONE; break;
- default: mxLineFmt->mnPattern = EXC_CHLINEFORMAT_SOLID;
+ // additional string (16-bit characters), e.g. for progress bar control
+ sal_uInt32 nAddStrSize;
+ rStrm >> nAddStrSize;
+ DBG_ASSERT( rStrm.GetRecLeft() >= nAddStrSize + 4, "XclImpPictureObj::ReadPictFmla - missing data" );
+ if( rStrm.GetRecLeft() >= nAddStrSize + 4 )
+ {
+ rStrm.Ignore( nAddStrSize );
+ // cell link and source range
+ ReadCellLinkFormula( rStrm, true );
+ ReadSourceRangeFormula( rStrm, true );
+ }
}
- switch( nLineWeight )
+ else if( mbEmbedded && (rStrm.GetRecLeft() >= 4) )
{
- case 0: mxLineFmt->mnWeight = EXC_CHLINEFORMAT_HAIR; break;
- case 1: mxLineFmt->mnWeight = EXC_CHLINEFORMAT_SINGLE; break;
- case 2: mxLineFmt->mnWeight = EXC_CHLINEFORMAT_DOUBLE; break;
- case 3: mxLineFmt->mnWeight = EXC_CHLINEFORMAT_TRIPLE; break;
- default: mxLineFmt->mnWeight = EXC_CHLINEFORMAT_HAIR;
+ rStrm >> mnStorageId;
}
- ::set_flag( mxLineFmt->mnFlags, EXC_CHLINEFORMAT_AUTO, nLineFlags & 1 );
}
-void XclImpChartObj::ReadChartSubStream( XclImpStream& rStrm )
+// DFF stream conversion ======================================================
+
+void XclImpSolverContainer::ReadSolverContainer( SvStream& rDffStrm )
{
- DBG_ASSERT( rStrm.GetRecId() == EXC_ID5_BOF, "XclImpChartObj::ReadChartSubStream - no BOF record found" );
- if( rStrm.GetRecId() == EXC_ID5_BOF )
- {
- mxChart.reset( new XclImpChart( GetRoot(), mbOwnTab ) );
- mxChart->ReadChartSubStream( rStrm );
- if( mxLineFmt.is() && mxAreaFmt.is() )
- mxChart->SetChartFrameFormat( *mxLineFmt, *mxAreaFmt );
- if( mbOwnTab )
- FinalizeTabChart();
- }
+ rDffStrm >> *this;
}
-SdrObject* XclImpChartObj::CreateSdrObject( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const
+void XclImpSolverContainer::InsertSdrObjectInfo( SdrObject& rSdrObj, sal_uInt32 nDffShapeId, sal_uInt32 nDffFlags )
{
- SdrObjectPtr xSdrObj;
- SfxObjectShell* pDocShell = GetDocShell();
- if( SvtModuleOptions().IsChart() && pDocShell && mxChart.is() && !mxChart->IsPivotChart() )
+ if( nDffShapeId > 0 )
{
- // create embedded chart object
- OUString aEmbObjName;
- Reference< XEmbeddedObject > xEmbObj = pDocShell->GetEmbeddedObjectContainer().
- CreateEmbeddedObject( SvGlobalName( SO3_SCH_CLASSID ).GetByteSequence(), aEmbObjName );
-
- /* Set the size to the embedded object, this prevents that font sizes
- of text objects are changed in the chart when the object is
- inserted into the draw page. */
- sal_Int64 nAspect = ::com::sun::star::embed::Aspects::MSOLE_CONTENT;
- MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xEmbObj->getMapUnit( nAspect ) );
- Size aSize( Window::LogicToLogic( rAnchorRect.GetSize(), MapMode( MAP_100TH_MM ), MapMode( aUnit ) ) );
- ::com::sun::star::awt::Size aAwtSize;
- aAwtSize.Width = aSize.Width();
- aAwtSize.Height = aSize.Height();
- xEmbObj->setVisualAreaSize( nAspect, aAwtSize );
-
- // create the container OLE object
- SdrOle2Obj* pSdrOleObj = new SdrOle2Obj( svt::EmbeddedObjectRef( xEmbObj, nAspect ), aEmbObjName, rAnchorRect );
- xSdrObj.reset( pSdrOleObj );
- xSdrObj->NbcSetLayer( SC_LAYER_FRONT );
-
- // convert Excel chart to OOo Chart
- if( svt::EmbeddedObjectRef::TryRunningState( xEmbObj ) )
- {
- Reference< XModel > xModel( xEmbObj->getComponent(), UNO_QUERY );
- mxChart->Convert( xModel, rProgress );
-
- Reference< XEmbedPersist > xPers( xEmbObj, UNO_QUERY );
- if( xPers.is() )
- xPers->storeOwn();
- }
+ maSdrInfoMap[ nDffShapeId ].Set( &rSdrObj, nDffFlags );
+ maSdrObjMap[ &rSdrObj ] = nDffShapeId;
}
-
- return xSdrObj.release();
}
-sal_Size XclImpChartObj::DoGetProgressSize() const
+void XclImpSolverContainer::RemoveSdrObjectInfo( SdrObject& rSdrObj )
{
- return mxChart.is() ? mxChart->GetProgressSize() : 0;
-}
-
-void XclImpChartObj::FinalizeTabChart()
-{
- /* #i44077# Calculate and store Escher anchor for sheet charts.
- Needed to get used area if this chart is inserted as OLE object. */
- DBG_ASSERT( mbOwnTab, "XclImpChartObj::FinalizeTabChart - not allowed for embedded chart objects" );
-
- // set uninitialized page to landscape
- if( !GetPageSettings().GetPageData().mbValid )
- GetPageSettings().SetPaperSize( EXC_PAPERSIZE_DEFAULT, false );
-
- // calculate size of the chart object
- const XclPageData& rPageData = GetPageSettings().GetPageData();
- Size aPaperSize( rPageData.GetScPaperSize() );
-
- long nWidth = XclTools::GetHmmFromTwips( aPaperSize.Width() );
- long nHeight = XclTools::GetHmmFromTwips( aPaperSize.Height() );
-
- // subtract page margins, give 1cm extra space
- nWidth -= (XclTools::GetHmmFromInch( rPageData.mfLeftMargin + rPageData.mfRightMargin ) + 2000);
- nHeight -= (XclTools::GetHmmFromInch( rPageData.mfTopMargin + rPageData.mfBottomMargin ) + 1000);
-
- // print column/row headers?
- if( rPageData.mbPrintHeadings )
+ // remove info of passed object from the maps
+ XclImpSdrObjMap::iterator aIt = maSdrObjMap.find( &rSdrObj );
+ if( aIt != maSdrObjMap.end() )
{
- nWidth -= 2000;
- nHeight -= 1000;
+ maSdrInfoMap.erase( aIt->second );
+ maSdrObjMap.erase( aIt );
}
- // create the Escher anchor
- XclEscherAnchor aAnchor( GetScTab() );
- aAnchor.SetRect( GetDoc(), Rectangle( 1000, 500, nWidth, nHeight ), MAP_100TH_MM );
- SetClientAnchor( aAnchor );
-}
-
-// Escher stream conversion ===================================================
-
-void XclImpSolverContainer::ReadSolverContainer( SvStream& rEscherStrm )
-{
- rEscherStrm >> *this;
-}
-
-void XclImpSolverContainer::InsertSdrObjectInfo( const XclImpDrawObjBase& rDrawObj, SdrObject* pSdrObj )
-{
- sal_uInt32 nShapeId = rDrawObj.GetShapeId();
- if( (nShapeId != 0) && pSdrObj )
- maSdrInfoMap[ nShapeId ].Set( pSdrObj, rDrawObj.GetShapeFlags() );
-}
-
-void XclImpSolverContainer::RemoveSdrObjectInfo( const XclImpDrawObjBase& rDrawObj )
-{
- maSdrInfoMap.erase( rDrawObj.GetShapeId() );
+ // remove info of all child objects of a group object
+ if( SdrObjGroup* pGroupObj = dynamic_cast< SdrObjGroup* >( &rSdrObj ) )
+ {
+ if( SdrObjList* pSubList = pGroupObj->GetSubList() )
+ {
+ // iterate flat over the list because this function already works recursively
+ SdrObjListIter aObjIt( *pSubList, IM_FLAT );
+ for( SdrObject* pChildObj = aObjIt.Next(); pChildObj; pChildObj = aObjIt.Next() )
+ RemoveSdrObjectInfo( *pChildObj );
+ }
+ }
}
void XclImpSolverContainer::UpdateConnectorRules()
@@ -1396,6 +2975,9 @@ void XclImpSolverContainer::RemoveConnectorRules()
for( SvxMSDffConnectorRule* pRule = GetFirstRule(); pRule; pRule = GetNextRule() )
delete pRule;
aCList.Clear();
+
+ maSdrInfoMap.clear();
+ maSdrObjMap.clear();
}
SvxMSDffConnectorRule* XclImpSolverContainer::GetFirstRule()
@@ -1408,26 +2990,28 @@ SvxMSDffConnectorRule* XclImpSolverContainer::GetNextRule()
return static_cast< SvxMSDffConnectorRule* >( aCList.Next() );
}
-void XclImpSolverContainer::UpdateConnection( sal_uInt32 nShapeId, SdrObject*& rpSdrObj, sal_uInt32* pnShapeFlags )
+void XclImpSolverContainer::UpdateConnection( sal_uInt32 nDffShapeId, SdrObject*& rpSdrObj, sal_uInt32* pnDffFlags )
{
- XclImpSdrInfoMap::const_iterator aIt = maSdrInfoMap.find( nShapeId );
+ XclImpSdrInfoMap::const_iterator aIt = maSdrInfoMap.find( nDffShapeId );
if( aIt != maSdrInfoMap.end() )
{
rpSdrObj = aIt->second.mpSdrObj;
- if( pnShapeFlags )
- *pnShapeFlags = aIt->second.mnShapeFlags;
+ if( pnDffFlags )
+ *pnDffFlags = aIt->second.mnDffFlags;
}
}
// ----------------------------------------------------------------------------
XclImpDffManager::XclImpDffManager(
- const XclImpRoot& rRoot, XclImpObjectManager& rObjManager, SvStream& rEscherStrm ) :
- SvxMSDffManager( rEscherStrm, rRoot.GetBasePath(), 0, 0, rRoot.GetDoc().GetDrawLayer(), 1440, COL_DEFAULT, 24, 0, &rRoot.GetTracer().GetBaseTracer() ),
+ const XclImpRoot& rRoot, XclImpObjectManager& rObjManager, SvStream& rDffStrm ) :
+ SvxMSDffManager( rDffStrm, rRoot.GetBasePath(), 0, 0, rRoot.GetDoc().GetDrawLayer(), 1440, COL_DEFAULT, 24, 0, &rRoot.GetTracer().GetBaseTracer() ),
+ SvxMSConvertOCXControls( rRoot.GetDocShell(), 0 ),
XclImpRoot( rRoot ),
mrObjManager( rObjManager ),
- mxOcxConverter( new XclImpOcxConverter( rRoot ) ),
- mnOleImpFlags( 0 )
+ mnOleImpFlags( 0 ),
+ mnLastCtrlIndex( -1 ),
+ mnCurrFormScTab( -1 )
{
SetSvxMSDffSettings( SVXMSDFF_SETTINGS_CROP_BITMAPS | SVXMSDFF_SETTINGS_IMPORT_EXCEL | SVXMSDFF_SETTINGS_IMPORT_IAS );
@@ -1440,6 +3024,13 @@ XclImpDffManager::XclImpDffManager(
if( pFilterOpt->IsPowerPoint2Impress() )
mnOleImpFlags |= OLE_POWERPOINT_2_STARIMPRESS;
}
+
+ // try to open the 'Ctls' storage stream containing OCX control properties
+ mxCtlsStrm = OpenStream( EXC_STREAM_CTLS );
+
+ // default text margin (convert EMU to drawing layer units)
+ mnDefTextMargin = EXC_OBJ_TEXT_MARGIN;
+ ScaleEmu( mnDefTextMargin );
}
XclImpDffManager::~XclImpDffManager()
@@ -1453,41 +3044,131 @@ void XclImpDffManager::StartProgressBar( sal_Size nProgressSize )
mxProgress->Activate();
}
-void XclImpDffManager::ProcessDrawingGroup( SvStream& rEscherStrm )
+void XclImpDffManager::ProcessObject( SdrObjList* pObjList, const XclImpDrawObjBase& rDrawObj )
+{
+ Rectangle aAnchorRect = rDrawObj.GetAnchorRect();
+ if( rDrawObj.IsProcessSdrObj() && rDrawObj.IsValidSize( aAnchorRect ) )
+ {
+ // CreateSdrObject() recursively creates embedded child objects
+ SdrObjectPtr xSdrObj( rDrawObj.CreateSdrObject( aAnchorRect, *mxProgress, false ) );
+ if( xSdrObj.is() )
+ rDrawObj.ProcessSdrObject( *xSdrObj );
+ // call InsertSdrObject() also, if SdrObject is missing
+ InsertSdrObject( pObjList, rDrawObj, xSdrObj.release() );
+ UpdateUsedArea( rDrawObj );
+ }
+}
+
+void XclImpDffManager::ProcessDrawingGroup( SvStream& rDffStrm )
{
- rEscherStrm.Seek( STREAM_SEEK_TO_BEGIN );
+ rDffStrm.Seek( STREAM_SEEK_TO_BEGIN );
DffRecordHeader aHeader;
- rEscherStrm >> aHeader;
+ rDffStrm >> aHeader;
if( aHeader.nRecType == DFF_msofbtDggContainer )
- ProcessDggContainer( rEscherStrm, aHeader );
+ ProcessDggContainer( rDffStrm, aHeader );
else
{
DBG_ERRORFILE( "XclImpDffManager::ProcessDrawingGroup - unexpected record" );
}
}
-void XclImpDffManager::ProcessDrawing( SvStream& rEscherStrm, sal_Size nStrmPos )
+void XclImpDffManager::ProcessDrawing( SvStream& rDffStrm, sal_Size nStrmPos )
{
- rEscherStrm.Seek( nStrmPos );
+ rDffStrm.Seek( nStrmPos );
DffRecordHeader aHeader;
- rEscherStrm >> aHeader;
+ rDffStrm >> aHeader;
if( aHeader.nRecType == DFF_msofbtDgContainer )
- ProcessDgContainer( rEscherStrm, aHeader );
+ ProcessDgContainer( rDffStrm, aHeader );
else
{
DBG_ERRORFILE( "XclImpDffManager::ProcessDrawing - unexpected record" );
}
}
-void XclImpDffManager::ProcessTabChart( const XclImpChartObj& rChartObj )
+SdrObject* XclImpDffManager::CreateSdrObject( const XclImpTbxObjBase& rTbxObj, const Rectangle& rAnchorRect )
+{
+ SdrObjectPtr xSdrObj;
+
+ OUString aServiceName = rTbxObj.GetServiceName();
+ if( aServiceName.getLength() > 0 ) try
+ {
+ // create the form control from scratch
+ Reference< XFormComponent > xFormComp( ScfApiHelper::CreateInstance( GetDocShell(), aServiceName ), UNO_QUERY_THROW );
+ // set current controls form, needed in virtual function InsertControl()
+ SetCurrentForm( rTbxObj.GetScTab() );
+ // try to insert the control into the form
+ ::com::sun::star::awt::Size aDummySize;
+ Reference< XShape > xShape;
+ if( mxCurrForm.is() && InsertControl( xFormComp, aDummySize, &xShape, TRUE ) )
+ {
+ xSdrObj.reset( rTbxObj.CreateSdrObjectFromShape( xShape, rAnchorRect ) );
+ // try to attach a macro to the control
+ ScriptEventDescriptor aDescriptor;
+ if( (mnLastCtrlIndex >= 0) && rTbxObj.FillMacroDescriptor( aDescriptor ) )
+ {
+ Reference< XEventAttacherManager > xEventMgr( mxCurrForm, UNO_QUERY_THROW );
+ xEventMgr->registerScriptEvent( mnLastCtrlIndex, aDescriptor );
+ }
+ }
+ }
+ catch( Exception& )
+ {
+ }
+
+ return xSdrObj.release();
+}
+
+SdrObject* XclImpDffManager::CreateSdrObject( const XclImpPictureObj& rPicObj, const Rectangle& rAnchorRect )
{
- Rectangle aAnchorRect = rChartObj.GetAnchorRect();
- if( rChartObj.IsValidSize( aAnchorRect ) )
+ SdrObjectPtr xSdrObj;
+
+ if( rPicObj.IsOcxControl() )
{
- SdrObjectPtr xSdrObj( CreateSdrObject( rChartObj, aAnchorRect ) );
- InsertSdrObject( rChartObj, xSdrObj.release() );
- UpdateUsedArea( rChartObj );
+ if( mxCtlsStrm.Is() ) try
+ {
+ /* set current controls form, needed in virtual function InsertControl()
+ called from ReadOCXExcelKludgeStream() */
+ SetCurrentForm( rPicObj.GetScTab() );
+ // seek to stream position of the extra data for this control
+ mxCtlsStrm->Seek( rPicObj.GetCtlsStreamPos() );
+ // read from mxCtlsStrm into xShape, insert the control model into the form
+ Reference< XShape > xShape;
+ if( mxCurrForm.is() && ReadOCXExcelKludgeStream( mxCtlsStrm, &xShape, TRUE ) )
+ xSdrObj.reset( rPicObj.CreateSdrObjectFromShape( xShape, rAnchorRect ) );
+ }
+ catch( Exception& )
+ {
+ }
+ }
+ else
+ {
+ SfxObjectShell* pDocShell = GetDocShell();
+ SotStorageRef xSrcStrg = GetRootStorage();
+ String aStrgName = rPicObj.GetOleStorageName();
+ if( pDocShell && xSrcStrg.Is() && (aStrgName.Len() > 0) )
+ {
+ // first try to resolve graphic from DFF storage
+ Graphic aGraphic;
+ Rectangle aVisArea;
+ if( !GetBLIP( GetPropertyValue( DFF_Prop_pib ), aGraphic, &aVisArea ) )
+ {
+ // if not found, use graphic from object (imported from IMGDATA record)
+ aGraphic = rPicObj.GetGraphic();
+ aVisArea = rPicObj.GetVisArea();
+ }
+ if( aGraphic.GetType() != GRAPHIC_NONE )
+ {
+ ErrCode nError = ERRCODE_NONE;
+ namespace cssea = ::com::sun::star::embed::Aspects;
+ sal_Int64 nAspects = rPicObj.IsSymbol() ? cssea::MSOLE_ICON : cssea::MSOLE_CONTENT;
+ xSdrObj.reset( CreateSdrOLEFromStorage(
+ aStrgName, xSrcStrg, pDocShell->GetStorage(), aGraphic,
+ rAnchorRect, aVisArea, 0, nError, mnOleImpFlags, nAspects ) );
+ }
+ }
}
+
+ return xSdrObj.release();
}
ScRange XclImpDffManager::GetUsedArea( SCTAB nScTab ) const
@@ -1501,20 +3182,25 @@ ScRange XclImpDffManager::GetUsedArea( SCTAB nScTab ) const
// virtual functions ----------------------------------------------------------
-void XclImpDffManager::ProcessClientAnchor2( SvStream& rEscherStrm,
+void XclImpDffManager::ProcessClientAnchor2( SvStream& rDffStrm,
DffRecordHeader& rHeader, void* /*pClientData*/, DffObjData& rObjData )
{
// find the OBJ record data related to the processed shape
if( XclImpDrawObjBase* pDrawObj = mrObjManager.FindDrawObj( rObjData.rSpHd ).get() )
{
- pDrawObj->ReadClientAnchor( rEscherStrm, rHeader );
+ DBG_ASSERT( rHeader.nRecType == DFF_msofbtClientAnchor, "XclImpDffManager::ProcessClientAnchor2 - no client anchor record" );
+ XclObjAnchor aAnchor( pDrawObj->GetScTab() );
+ rHeader.SeekToContent( rDffStrm );
+ rDffStrm.SeekRel( 2 ); // flags
+ rDffStrm >> aAnchor; // anchor format equal to BIFF5 OBJ records
+ pDrawObj->SetAnchor( aAnchor );
rObjData.aChildAnchor = pDrawObj->GetAnchorRect();
rObjData.bChildAnchor = sal_True;
}
}
-SdrObject* XclImpDffManager::ProcessObj( SvStream& rEscherStrm,
- DffObjData& rObjData, void* pClientData, Rectangle& /*rTextRect*/, SdrObject* pOldSdrObj )
+SdrObject* XclImpDffManager::ProcessObj( SvStream& rDffStrm,
+ DffObjData& rDffObjData, void* pClientData, Rectangle& /*rTextRect*/, SdrObject* pOldSdrObj )
{
/* pOldSdrObj passes a generated SdrObject. This function owns this object
and can modify it. The function has either to return it back to caller
@@ -1522,12 +3208,12 @@ SdrObject* XclImpDffManager::ProcessObj( SvStream& rEscherStrm,
SdrObjectPtr xSdrObj( pOldSdrObj );
// find the OBJ record data related to the processed shape
- XclImpDrawObjRef xDrawObj = mrObjManager.FindDrawObj( rObjData.rSpHd );
- const Rectangle& rAnchorRect = rObjData.aChildAnchor;
+ XclImpDrawObjRef xDrawObj = mrObjManager.FindDrawObj( rDffObjData.rSpHd );
+ const Rectangle& rAnchorRect = rDffObjData.aChildAnchor;
// #102378# Do not process the global page group shape (flag SP_FPATRIARCH)
- bool bGlobalPageGroup = ::get_flag< sal_uInt32 >( rObjData.nSpFlags, SP_FPATRIARCH );
- if( !xDrawObj || !xDrawObj->IsValid() || bGlobalPageGroup )
+ bool bGlobalPageGroup = ::get_flag< sal_uInt32 >( rDffObjData.nSpFlags, SP_FPATRIARCH );
+ if( !xDrawObj || !xDrawObj->IsProcessSdrObj() || bGlobalPageGroup )
return 0; // simply return, xSdrObj will be destroyed
/* Pass pointer to top-level object back to caller. If the processed
@@ -1550,70 +3236,34 @@ SdrObject* XclImpDffManager::ProcessObj( SvStream& rEscherStrm,
if( !bEmbeddedGroup && !xDrawObj->IsValidSize( rAnchorRect ) )
return 0; // simply return, xSdrObj will be destroyed
- // set shape information from Escher stream
- xDrawObj->SetShapeData( rObjData.nShapeId, rObjData.nSpFlags, GetPropertyValue( DFF_Prop_pib ) );
+ // set shape information from DFF stream
+ String aObjName = GetPropertyString( DFF_Prop_wzName, rDffStrm );
+ String aHyperlink = ReadHlinkProperty( rDffStrm );
+ bool bVisible = !GetPropertyBool( DFF_Prop_fHidden );
+ bool bAutoMargin = GetPropertyBool( DFF_Prop_AutoTextMargin );
+ xDrawObj->SetDffData( rDffObjData, aObjName, aHyperlink, bVisible, bAutoMargin );
/* Connect textbox data (string, alignment, text orientation) to object.
- #98132# don't ask for a text-ID, Escher export doesn't set one. */
- if( XclImpDrawingObj* pDrawingObj = dynamic_cast< XclImpDrawingObj* >( xDrawObj.get() ) )
- pDrawingObj->SetTxoData( mrObjManager.FindTxoData( rObjData.rSpHd ) );
+ #98132# don't ask for a text-ID, DFF export doesn't set one. */
+ if( XclImpTextObj* pTextObj = dynamic_cast< XclImpTextObj* >( xDrawObj.get() ) )
+ if( const XclImpObjTextData* pTextData = mrObjManager.FindTextData( rDffObjData.rSpHd ) )
+ pTextObj->SetTextData( *pTextData );
+
+ // copy line and fill formatting of TBX form controls from DFF properties
+ if( XclImpTbxObjBase* pTbxObj = dynamic_cast< XclImpTbxObjBase* >( xDrawObj.get() ) )
+ pTbxObj->SetDffProperties( *this );
// try to create a custom SdrObject that overwrites the passed object
- SdrObjectPtr xNewSdrObj( CreateCustomSdrObject( *xDrawObj, rAnchorRect ) );
- if( xNewSdrObj.get() )
- {
- // copy old shape name to new shape, if it does not have an own name
- if( xNewSdrObj->GetName().Len() == 0 )
- {
- if( xSdrObj.get() )
- xNewSdrObj->SetName( xSdrObj->GetName() );
- else
- xNewSdrObj->SetName( GetPropertyString( DFF_Prop_wzName, rEscherStrm ) );
- }
- // transfer ownership to xSdrObj
- xSdrObj = xNewSdrObj;
- }
- else if( xSdrObj.get() && (dynamic_cast< XclImpDrawingObj* >( xDrawObj.get() ) || dynamic_cast< XclImpOleObj* >( xDrawObj.get() )) )
- {
- // macro name and hyperlink for drawing objects and pictures (not for controls and charts)
- const String& rMacro = xDrawObj->GetMacroName();
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
- OUString aHlink = ReadHlinkProperty( rEscherStrm );
- if( (rMacro.Len() > 0) || (aHlink.getLength() > 0) )
-#else
- if( rMacro.Len() > 0 )
-#endif
- {
- if( ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( xSdrObj.get(), TRUE ) )
- {
- pInfo->SetMacro( XclControlObjHelper::GetScMacroName( rMacro ) );
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
- pInfo->SetHlink( aHlink );
-#endif
- }
- }
- }
+ SdrObjectPtr xNewSdrObj( xDrawObj->CreateSdrObject( rAnchorRect, *mxProgress, true ) );
+ if( xNewSdrObj.is() )
+ xSdrObj.reset( xNewSdrObj.release() );
// process the SdrObject
- if( xSdrObj.get() )
+ if( xSdrObj.is() )
{
- // maybe if there is no color, we could do this in ApplyAttributes (writer?, calc?)
+ // filled without color -> set system window color
if( GetPropertyBool( DFF_Prop_fFilled ) && !IsProperty( DFF_Prop_fillColor ) )
- xSdrObj->SetMergedItem( XFillColorItem( EMPTY_STRING, Color( COL_WHITE ) ) );
-
- // automatic margin is handled by host
- if( GetPropertyBool( DFF_Prop_AutoTextMargin ) )
- {
- sal_Int32 nMargin = EXC_ESCHER_AUTOMARGIN;
- ScaleEmu( nMargin );
- xSdrObj->SetMergedItem( SdrTextLeftDistItem( nMargin ) );
- xSdrObj->SetMergedItem( SdrTextRightDistItem( nMargin ) );
- xSdrObj->SetMergedItem( SdrTextUpperDistItem( nMargin ) );
- xSdrObj->SetMergedItem( SdrTextLowerDistItem( nMargin ) );
- }
-
- // #i39167# full width for text and textless objects regardless of alignment
- xSdrObj->SetMergedItem( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_BLOCK ) );
+ xSdrObj->SetMergedItem( XFillColorItem( EMPTY_STRING, GetPalette().GetColor( EXC_COLOR_WINDOWBACK ) ) );
// additional processing on the SdrObject
xDrawObj->ProcessSdrObject( *xSdrObj );
@@ -1625,15 +3275,15 @@ SdrObject* XclImpDffManager::ProcessObj( SvStream& rEscherStrm,
here. Happens e.g. for notes: The ProcessSdrObject() call above has
inserted the note into the document, and the SdrObject is not
needed anymore. */
- if( !xDrawObj->IsInsertSdr() )
+ if( !xDrawObj->IsInsertSdrObj() )
xSdrObj.reset();
}
/* Store the relation between shape ID and SdrObject for connectors. Must
be done here (and not in InsertSdrObject() function), otherwise all
SdrObjects embedded in groups would be lost. */
- if( xSdrObj.get() )
- maSolverCont.InsertSdrObjectInfo( *xDrawObj, xSdrObj.get() );
+ if( xSdrObj.is() )
+ maSolverCont.InsertSdrObjectInfo( *xSdrObj, xDrawObj->GetDffShapeId(), xDrawObj->GetDffFlags() );
return xSdrObj.release();
}
@@ -1654,27 +3304,59 @@ FASTBOOL XclImpDffManager::GetColorFromPalette( USHORT nIndex, Color& rColor ) c
return TRUE;
}
+sal_Bool XclImpDffManager::InsertControl( const Reference< XFormComponent >& rxFormComp,
+ const ::com::sun::star::awt::Size& /*rSize*/, Reference< XShape >* pxShape,
+ BOOL /*bFloatingCtrl*/ )
+{
+ if( GetDocShell() ) try
+ {
+ Reference< XIndexContainer > xFormIC( mxCurrForm, UNO_QUERY_THROW );
+ Reference< XControlModel > xCtrlModel( rxFormComp, UNO_QUERY_THROW );
+
+ // create the control shape
+ Reference< XShape > xShape( ScfApiHelper::CreateInstance( GetDocShell(), CREATE_OUSTRING( "com.sun.star.drawing.ControlShape" ) ), UNO_QUERY_THROW );
+ Reference< XControlShape > xCtrlShape( xShape, UNO_QUERY_THROW );
+
+ // insert the new control into the form
+ sal_Int32 nNewIndex = xFormIC->getCount();
+ xFormIC->insertByIndex( nNewIndex, Any( rxFormComp ) );
+ // on success: store new index of the control for later use (macro events)
+ mnLastCtrlIndex = nNewIndex;
+
+ // set control model at control shape and pass back shape to caller
+ xCtrlShape->setControl( xCtrlModel );
+ if( pxShape ) *pxShape = xShape;
+ return sal_True;
+ }
+ catch( Exception& )
+ {
+ DBG_ERRORFILE( "XclImpDffManager::InsertControl - cannot create form control" );
+ }
+
+ return sal_False;
+}
+
// private --------------------------------------------------------------------
-OUString XclImpDffManager::ReadHlinkProperty( SvStream& rEscherStrm ) const
+String XclImpDffManager::ReadHlinkProperty( SvStream& rDffStrm ) const
{
- /* Reads hyperlink data from a complex Escher property. Contents of this
+ /* Reads hyperlink data from a complex DFF property. Contents of this
property are equal to the HLINK record, import of this record is
implemented in class XclImpHyperlink. This function has to create an
instance of the XclImpStream class to be able to reuse the
functionality of XclImpHyperlink. */
- OUString aString;
+ String aString;
sal_uInt32 nBufferSize = GetPropertyValue( DFF_Prop_pihlShape );
- if( (0 < nBufferSize) && (nBufferSize <= 0xFFFF) && SeekToContent( DFF_Prop_pihlShape, rEscherStrm ) )
+ if( (0 < nBufferSize) && (nBufferSize <= 0xFFFF) && SeekToContent( DFF_Prop_pihlShape, rDffStrm ) )
{
// create a faked BIFF record that can be read by XclImpStream class
SvMemoryStream aMemStream;
aMemStream << sal_uInt16( 0 ) << static_cast< sal_uInt16 >( nBufferSize );
- // copy from Escher stream to memory stream
+ // copy from DFF stream to memory stream
::std::vector< sal_uInt8 > aBuffer( nBufferSize );
sal_uInt8* pnData = &aBuffer.front();
- if( rEscherStrm.Read( pnData, nBufferSize ) == nBufferSize )
+ if( rDffStrm.Read( pnData, nBufferSize ) == nBufferSize )
{
aMemStream.Write( pnData, nBufferSize );
@@ -1687,33 +3369,33 @@ OUString XclImpDffManager::ReadHlinkProperty( SvStream& rEscherStrm ) const
return aString;
}
-void XclImpDffManager::ProcessDggContainer( SvStream& rEscherStrm, const DffRecordHeader& rDggHeader )
+void XclImpDffManager::ProcessDggContainer( SvStream& rDffStrm, const DffRecordHeader& rDggHeader )
{
// seek to end of drawing group container
- rDggHeader.SeekToEndOfRecord( rEscherStrm );
+ rDggHeader.SeekToEndOfRecord( rDffStrm );
}
-void XclImpDffManager::ProcessDgContainer( SvStream& rEscherStrm, const DffRecordHeader& rDgHeader )
+void XclImpDffManager::ProcessDgContainer( SvStream& rDffStrm, const DffRecordHeader& rDgHeader )
{
sal_Size nEndPos = rDgHeader.GetRecEndFilePos();
- while( rEscherStrm.Tell() < nEndPos )
+ while( rDffStrm.Tell() < nEndPos )
{
DffRecordHeader aHeader;
- rEscherStrm >> aHeader;
+ rDffStrm >> aHeader;
switch( aHeader.nRecType )
{
case DFF_msofbtSolverContainer:
- ProcessSolverContainer( rEscherStrm, aHeader );
+ ProcessSolverContainer( rDffStrm, aHeader );
break;
case DFF_msofbtSpgrContainer:
- ProcessShGrContainer( rEscherStrm, aHeader );
+ ProcessShGrContainer( rDffStrm, aHeader );
break;
default:
- aHeader.SeekToEndOfRecord( rEscherStrm );
+ aHeader.SeekToEndOfRecord( rDffStrm );
}
}
// seek to end of drawing page container
- rDgHeader.SeekToEndOfRecord( rEscherStrm );
+ rDgHeader.SeekToEndOfRecord( rDffStrm );
// #i12638# #i37900# connector rules
maSolverCont.UpdateConnectorRules();
@@ -1721,126 +3403,98 @@ void XclImpDffManager::ProcessDgContainer( SvStream& rEscherStrm, const DffRecor
maSolverCont.RemoveConnectorRules();
}
-void XclImpDffManager::ProcessShGrContainer( SvStream& rEscherStrm, const DffRecordHeader& rShGrHeader )
+void XclImpDffManager::ProcessShGrContainer( SvStream& rDffStrm, const DffRecordHeader& rShGrHeader )
{
sal_Size nEndPos = rShGrHeader.GetRecEndFilePos();
- while( rEscherStrm.Tell() < nEndPos )
+ while( rDffStrm.Tell() < nEndPos )
{
DffRecordHeader aHeader;
- rEscherStrm >> aHeader;
+ rDffStrm >> aHeader;
switch( aHeader.nRecType )
{
case DFF_msofbtSpgrContainer:
case DFF_msofbtSpContainer:
- ProcessShContainer( rEscherStrm, aHeader );
+ ProcessShContainer( rDffStrm, aHeader );
break;
default:
- aHeader.SeekToEndOfRecord( rEscherStrm );
+ aHeader.SeekToEndOfRecord( rDffStrm );
}
}
// seek to end of shape group container
- rShGrHeader.SeekToEndOfRecord( rEscherStrm );
+ rShGrHeader.SeekToEndOfRecord( rDffStrm );
}
-void XclImpDffManager::ProcessSolverContainer( SvStream& rEscherStrm, const DffRecordHeader& rSolverHeader )
+void XclImpDffManager::ProcessSolverContainer( SvStream& rDffStrm, const DffRecordHeader& rSolverHeader )
{
// solver container wants to read the solver container header again
- rSolverHeader.SeekToBegOfRecord( rEscherStrm );
+ rSolverHeader.SeekToBegOfRecord( rDffStrm );
// read the entire solver container
- rEscherStrm >> maSolverCont;
+ rDffStrm >> maSolverCont;
// seek to end of solver container
- rSolverHeader.SeekToEndOfRecord( rEscherStrm );
+ rSolverHeader.SeekToEndOfRecord( rDffStrm );
}
-void XclImpDffManager::ProcessShContainer( SvStream& rEscherStrm, const DffRecordHeader& rShHeader )
+void XclImpDffManager::ProcessShContainer( SvStream& rDffStrm, const DffRecordHeader& rShHeader )
{
- rShHeader.SeekToBegOfRecord( rEscherStrm );
+ rShHeader.SeekToBegOfRecord( rDffStrm );
Rectangle aDummy;
const XclImpDrawObjBase* pDrawObj = 0;
/* The call to ImportObj() creates and returns a new SdrObject for the
- processed shape. This function takes ownership of the returned object.
- If the shape is a group object, all embedded objects are created
- recursively, and the returned group object contains them all.
- ImportObj() calls the virtual functions ProcessClientAnchor2() and
- ProcessObj() of the XclImpDffManager class. it writes the pointer to
- the related draw object data (OBJ record) into pDrawObj. */
- SdrObjectPtr xSdrObj( ImportObj( rEscherStrm, &pDrawObj, aDummy, aDummy, 0, 0 ) );
- if( pDrawObj && xSdrObj.get() )
- InsertSdrObject( *pDrawObj, xSdrObj.release() );
- rShHeader.SeekToEndOfRecord( rEscherStrm );
+ processed shape. We take ownership of the returned object here. If the
+ shape is a group object, all embedded objects are created recursively,
+ and the returned group object contains them all. ImportObj() calls the
+ virtual functions ProcessClientAnchor2() and ProcessObj() and writes
+ the pointer to the related draw object data (OBJ record) into pDrawObj. */
+ SdrObjectPtr xSdrObj( ImportObj( rDffStrm, &pDrawObj, aDummy, aDummy, 0, 0 ) );
+ if( pDrawObj && xSdrObj.is() )
+ InsertSdrObject( GetSdrPage( pDrawObj->GetScTab() ), *pDrawObj, xSdrObj.release() );
+ rShHeader.SeekToEndOfRecord( rDffStrm );
}
-void XclImpDffManager::InsertSdrObject( const XclImpDrawObjBase& rDrawObj, SdrObject* pSdrObj )
+void XclImpDffManager::InsertSdrObject( SdrObjList* pObjList, const XclImpDrawObjBase& rDrawObj, SdrObject* pSdrObj )
{
/* Take ownership of the passed object. If insertion fails (e.g. rDrawObj
states to skip insertion, or missing draw page), the object is
automatically deleted. */
SdrObjectPtr xSdrObj( pSdrObj );
- if( xSdrObj.get() && rDrawObj.IsInsertSdr() )
- if( SdrPage* pSdrPage = GetSdrPage( rDrawObj.GetScTab() ) )
- pSdrPage->InsertObject( xSdrObj.release() );
+ if( pObjList && xSdrObj.is() && rDrawObj.IsInsertSdrObj() )
+ pObjList->NbcInsertObject( xSdrObj.release() );
// SdrObject still here? Insertion failed, remove data from shape ID map.
- if( xSdrObj.get() )
- maSolverCont.RemoveSdrObjectInfo( rDrawObj );
+ if( xSdrObj.is() )
+ maSolverCont.RemoveSdrObjectInfo( *xSdrObj );
}
-SdrObject* XclImpDffManager::CreateCustomSdrObject( XclImpDrawObjBase& rDrawObj, const Rectangle& rAnchorRect )
+void XclImpDffManager::SetCurrentForm( SCTAB nScTab )
{
- SdrObjectPtr xSdrObj;
- if( XclImpOleObj* pOleObj = dynamic_cast< XclImpOleObj* >( &rDrawObj ) )
- xSdrObj.reset( CreateSdrObject( *pOleObj, rAnchorRect ) );
- else if( XclImpTbxControlObj* pTbxCtrlObj = dynamic_cast< XclImpTbxControlObj* >( &rDrawObj ) )
- xSdrObj.reset( CreateSdrObject( *pTbxCtrlObj, rAnchorRect ) );
- else if( XclImpChartObj* pChartObj = dynamic_cast< XclImpChartObj* >( &rDrawObj ) )
- xSdrObj.reset( CreateSdrObject( *pChartObj, rAnchorRect ) );
- else
- mxProgress->Progress();
- return xSdrObj.release();
-}
-
-SdrObject* XclImpDffManager::CreateSdrObject( XclImpOleObj& rOleObj, const Rectangle& rAnchorRect )
-{
- SdrObjectPtr xSdrObj;
- if( rOleObj.IsControl() )
- {
- // form control objects are created by the XclImpOcxConverter class
- xSdrObj.reset( mxOcxConverter->CreateSdrObject( rOleObj, rAnchorRect ) );
- }
- else
+ if( nScTab != mnCurrFormScTab )
{
- // it is a normal OLE object
- SfxObjectShell* pDocShell = GetDocShell();
- const String& rStorageName = rOleObj.GetStorageName();
- if( pDocShell && rStorageName.Len() )
+ mxCurrForm.clear();
+ mnCurrFormScTab = nScTab;
+
+ SdrPage* pSdrPage = GetSdrPage( nScTab );
+ if( GetDocShell() && pSdrPage ) try
{
- Graphic aGraph;
- Rectangle aVisArea;
- if( GetBLIP( rOleObj.GetShapeBlipId(), aGraph, &aVisArea ) )
+ Reference< XFormsSupplier > xFormsSupplier( pSdrPage->getUnoPage(), UNO_QUERY_THROW );
+ Reference< XNameContainer > xFormsNC = xFormsSupplier->getForms();
+ if( xFormsNC.is() )
{
- SotStorageRef xSrcStrg = GetRootStorage();
- ErrCode nError = ERRCODE_NONE;
- xSdrObj.reset( CreateSdrOLEFromStorage( rStorageName, xSrcStrg,
- pDocShell->GetStorage(), aGraph, rAnchorRect, aVisArea, 0, nError, mnOleImpFlags,
- rOleObj.IsIconified()
- ? ::com::sun::star::embed::Aspects::MSOLE_ICON
- : ::com::sun::star::embed::Aspects::MSOLE_CONTENT ) );
+ // find or create the Standard form used to insert the imported controls
+ OUString aFormName = CREATE_OUSTRING( "Standard" );
+ if( xFormsNC->hasByName( aFormName ) )
+ {
+ xFormsNC->getByName( aFormName ) >>= mxCurrForm;
+ }
+ else
+ {
+ mxCurrForm.set( ScfApiHelper::CreateInstance( GetDocShell(), CREATE_OUSTRING( "com.sun.star.form.component.Form" ) ), UNO_QUERY_THROW );
+ xFormsNC->insertByName( aFormName, Any( mxCurrForm ) );
+ }
}
}
+ catch( Exception& )
+ {
+ }
}
- mxProgress->Progress();
- return xSdrObj.release();
-}
-
-SdrObject* XclImpDffManager::CreateSdrObject( XclImpTbxControlObj& rTbxCtrlObj, const Rectangle& rAnchorRect )
-{
- SdrObjectPtr xSdrObj( mxOcxConverter->CreateSdrObject( rTbxCtrlObj, rAnchorRect ) );
- mxProgress->Progress();
- return xSdrObj.release();
-}
-
-SdrObject* XclImpDffManager::CreateSdrObject( const XclImpChartObj& rChartObj, const Rectangle& rAnchorRect )
-{
- return rChartObj.CreateSdrObject( rAnchorRect, *mxProgress );
}
void XclImpDffManager::UpdateUsedArea( const XclImpDrawObjBase& rDrawObj )
@@ -1868,6 +3522,28 @@ void XclImpDffManager::UpdateUsedArea( const XclImpDrawObjBase& rDrawObj )
XclImpObjectManager::XclImpObjectManager( const XclImpRoot& rRoot ) :
XclImpRoot( rRoot )
{
+ maDefObjNames[ EXC_OBJTYPE_GROUP ] = CREATE_STRING( "Group" );
+ maDefObjNames[ EXC_OBJTYPE_LINE ] = CREATE_STRING( "Line" );
+ maDefObjNames[ EXC_OBJTYPE_RECTANGLE ] = CREATE_STRING( "Rectangle" );
+ maDefObjNames[ EXC_OBJTYPE_OVAL ] = CREATE_STRING( "Oval" );
+ maDefObjNames[ EXC_OBJTYPE_ARC ] = CREATE_STRING( "Arc" );
+ maDefObjNames[ EXC_OBJTYPE_CHART ] = CREATE_STRING( "Chart" );
+ maDefObjNames[ EXC_OBJTYPE_TEXT ] = CREATE_STRING( "Text" );
+ maDefObjNames[ EXC_OBJTYPE_BUTTON ] = CREATE_STRING( "Button" );
+ maDefObjNames[ EXC_OBJTYPE_PICTURE ] = CREATE_STRING( "Picture" );
+ maDefObjNames[ EXC_OBJTYPE_POLYGON ] = CREATE_STRING( "Freeform" );
+ maDefObjNames[ EXC_OBJTYPE_CHECKBOX ] = CREATE_STRING( "Check Box" );
+ maDefObjNames[ EXC_OBJTYPE_OPTIONBUTTON ] = CREATE_STRING( "Option Button" );
+ maDefObjNames[ EXC_OBJTYPE_EDIT ] = CREATE_STRING( "Edit Box" );
+ maDefObjNames[ EXC_OBJTYPE_LABEL ] = CREATE_STRING( "Label" );
+ maDefObjNames[ EXC_OBJTYPE_DIALOG ] = CREATE_STRING( "Dialog Frame" );
+ maDefObjNames[ EXC_OBJTYPE_SPIN ] = CREATE_STRING( "Spinner" );
+ maDefObjNames[ EXC_OBJTYPE_SCROLLBAR ] = CREATE_STRING( "Scroll Bar" );
+ maDefObjNames[ EXC_OBJTYPE_LISTBOX ] = CREATE_STRING( "List Box" );
+ maDefObjNames[ EXC_OBJTYPE_GROUPBOX ] = CREATE_STRING( "Group Box" );
+ maDefObjNames[ EXC_OBJTYPE_DROPDOWN ] = CREATE_STRING( "Drop Down" );
+ maDefObjNames[ EXC_OBJTYPE_NOTE ] = CREATE_STRING( "Comment" );
+ maDefObjNames[ EXC_OBJTYPE_DRAWING ] = CREATE_STRING( "AutoShape" );
}
XclImpObjectManager::~XclImpObjectManager()
@@ -1876,28 +3552,54 @@ XclImpObjectManager::~XclImpObjectManager()
// *** Read Excel records *** -------------------------------------------------
-void XclImpObjectManager::ReadObj5( XclImpStream& rStrm )
+Graphic XclImpObjectManager::ReadImgData( XclImpStream& rStrm ) // static helper
{
- DBG_ASSERT_BIFF( GetBiff() == EXC_BIFF5 );
+ Graphic aGraphic;
+ sal_uInt16 nFormat, nEnv;
+ sal_uInt32 nDataSize;
+ rStrm >> nFormat >> nEnv >> nDataSize;
+ if( nDataSize <= rStrm.GetRecLeft() )
+ {
+ switch( nFormat )
+ {
+ case EXC_IMGDATA_WMF: ReadWmf( aGraphic, rStrm ); break;
+ case EXC_IMGDATA_BMP: ReadBmp( aGraphic, rStrm ); break;
+ default: DBG_ERRORFILE( "XclImpObjectManager::ReadImgData - unknown image format" );
+ }
+ }
+ return aGraphic;
+}
- sal_uInt16 nObjType, nObjId, nFlags, nMacroSize;
- XclEscherAnchor aAnchor( GetCurrScTab() );
+void XclImpObjectManager::ReadObj( XclImpStream& rStrm )
+{
+ XclImpDrawObjRef xDrawObj;
- rStrm.Ignore( 4 );
- rStrm >> nObjType >> nObjId >> nFlags >> aAnchor >> nMacroSize;
- rStrm.Ignore( 6 );
+ /* #i61786# In BIFF8 streams, OBJ records may occur without MSODRAWING
+ records. In this case, the OBJ records are in BIFF5 format. Do a sanity
+ check here that there is no DFF data loaded before. */
+ DBG_ASSERT( maDffStrm.Tell() == 0, "XclImpObjectManager::ReadObj - unexpected DFF stream data, OBJ will be ignored" );
+ if( maDffStrm.Tell() == 0 ) switch( GetBiff() )
+ {
+ case EXC_BIFF3:
+ xDrawObj = XclImpDrawObjBase::ReadObj3( rStrm );
+ break;
+ case EXC_BIFF4:
+ xDrawObj = XclImpDrawObjBase::ReadObj4( rStrm );
+ break;
+ case EXC_BIFF5:
+ case EXC_BIFF8:
+ xDrawObj = XclImpDrawObjBase::ReadObj5( rStrm );
+ break;
+ default:
+ DBG_ERROR_BIFF();
+ }
- // TODO: currently only charts are supported
- if( nObjType == EXC_OBJ_CMO_CHART )
+ if( xDrawObj.is() )
{
- // create and read chart object data
- XclImpChartObjRef xChartObj( new XclImpChartObj( GetRoot(), false ) );
- xChartObj->SetClientAnchor( aAnchor );
- xChartObj->ReadObj5( rStrm );
- if( StartChartSubStream( rStrm ) )
- xChartObj->ReadChartSubStream( rStrm );
- // no Escher stream in BIFF5 - abuse sheet chart functionality
- maTabCharts.push_back( xChartObj );
+ // insert into maRawObjs or into the last open group object
+ maRawObjs.InsertGrouped( xDrawObj );
+ // to be able to find objects by ID
+ maObjMapId[ xDrawObj->GetObjId() ] = xDrawObj;
}
}
@@ -1906,7 +3608,7 @@ void XclImpObjectManager::ReadMsoDrawingGroup( XclImpStream& rStrm )
DBG_ASSERT_BIFF( GetBiff() == EXC_BIFF8 );
// Excel continues this record with MSODRAWINGGROUP and CONTINUE records, hmm.
rStrm.ResetRecord( true, EXC_ID_MSODRAWINGGROUP );
- ReadEscherRecord( rStrm );
+ ReadDffRecord( rStrm );
}
void XclImpObjectManager::ReadMsoDrawing( XclImpStream& rStrm )
@@ -1915,7 +3617,7 @@ void XclImpObjectManager::ReadMsoDrawing( XclImpStream& rStrm )
// disable internal CONTINUE handling
rStrm.ResetRecord( false );
/* #i60510# real life: MSODRAWINGSELECTION record may contain garbage -
- this makes it impossible to process the Escher stream in one run.
+ this makes it impossible to process the DFF stream in one run.
Store stream start position for every sheet separately, will be used
to seek the stream to these positions later, when processing the next
sheet. */
@@ -1923,10 +3625,10 @@ void XclImpObjectManager::ReadMsoDrawing( XclImpStream& rStrm )
if( nTabIdx >= maTabStrmPos.size() )
{
maTabStrmPos.resize( nTabIdx, STREAM_SEEK_TO_END );
- maTabStrmPos.push_back( maEscherStrm.Tell() );
+ maTabStrmPos.push_back( maDffStrm.Tell() );
}
// read leading MSODRAWING record
- ReadEscherRecord( rStrm );
+ ReadDffRecord( rStrm );
// read following drawing records, but do not start following unrelated record
bool bLoop = true;
@@ -1936,7 +3638,7 @@ void XclImpObjectManager::ReadMsoDrawing( XclImpStream& rStrm )
case EXC_ID_MSODRAWINGSEL:
case EXC_ID_CONT:
rStrm.StartNextRecord();
- ReadEscherRecord( rStrm );
+ ReadDffRecord( rStrm );
break;
case EXC_ID_OBJ:
rStrm.StartNextRecord();
@@ -1956,27 +3658,29 @@ void XclImpObjectManager::ReadMsoDrawing( XclImpStream& rStrm )
void XclImpObjectManager::ReadNote( XclImpStream& rStrm )
{
- DBG_ASSERT_BIFF( GetBiff() == EXC_BIFF8 );
- XclAddress aXclPos;
- sal_uInt16 nFlags, nObjId;
- rStrm >> aXclPos >> nFlags >> nObjId;
-
- if( nObjId != EXC_OBJ_INVALID_ID )
+ switch( GetBiff() )
{
- SCTAB nScTab = GetCurrScTab();
- ScAddress aScNotePos( ScAddress::UNINITIALIZED );
- if( GetAddressConverter().ConvertAddress( aScNotePos, aXclPos, nScTab, true ) )
- if( XclImpNoteObj* pNoteObj = dynamic_cast< XclImpNoteObj* >( FindDrawObj( XclObjId( nScTab, nObjId ) ).get() ) )
- pNoteObj->SetNoteData( aScNotePos, nFlags );
+ case EXC_BIFF2:
+ case EXC_BIFF3:
+ case EXC_BIFF4:
+ case EXC_BIFF5:
+ ReadNote3( rStrm );
+ break;
+ case EXC_BIFF8:
+ ReadNote8( rStrm );
+ break;
+ default:
+ DBG_ERROR_BIFF();
}
}
void XclImpObjectManager::ReadTabChart( XclImpStream& rStrm )
{
DBG_ASSERT_BIFF( GetBiff() >= EXC_BIFF5 );
- XclImpChartObjRef xChartObj( new XclImpChartObj( GetRoot(), true ) );
+ ScfRef< XclImpChartObj > xChartObj( new XclImpChartObj( GetRoot(), true ) );
xChartObj->ReadChartSubStream( rStrm );
- maTabCharts.push_back( xChartObj );
+ // insert the chart as raw object without connected DFF data
+ maRawObjs.push_back( xChartObj );
}
// *** Drawing objects *** ----------------------------------------------------
@@ -1984,9 +3688,9 @@ void XclImpObjectManager::ReadTabChart( XclImpStream& rStrm )
XclImpDrawObjRef XclImpObjectManager::FindDrawObj( const DffRecordHeader& rHeader ) const
{
/* maObjMap stores objects by position of the client data (OBJ record) in
- the Escher stream, which is always behind shape start position of the
+ the DFF stream, which is always behind shape start position of the
passed header. The function upper_bound() finds the first element in
- the map whose key is greater then the start position of the header. Its
+ the map whose key is greater than the start position of the header. Its
end position is used to test whether the found object is really related
to the shape. */
XclImpDrawObjRef xDrawObj;
@@ -2005,24 +3709,23 @@ XclImpDrawObjRef XclImpObjectManager::FindDrawObj( const XclObjId& rObjId ) cons
return xDrawObj;
}
-XclImpTxoDataRef XclImpObjectManager::FindTxoData( const DffRecordHeader& rHeader ) const
+const XclImpObjTextData* XclImpObjectManager::FindTextData( const DffRecordHeader& rHeader ) const
{
- /* maTxoMap stores textbox data by position of the client data (TXO record)
- in the Escher stream, which is always behind shape start position of
- the passed header. The function upper_bound() finds the first element
- in the map whose key is greater then the start position of the header.
- Its end position is used to test whether the found object is really
- related to the shape. */
- XclImpTxoDataRef xTxoData;
- XclImpTxoMap::const_iterator aIt = maTxoMap.upper_bound( rHeader.GetRecBegFilePos() );
- if( (aIt != maTxoMap.end()) && (aIt->first <= rHeader.GetRecEndFilePos()) )
- xTxoData = aIt->second;
- return xTxoData;
+ /* maTextMap stores textbox data by position of the client data (TXO
+ record) in the DFF stream, which is always behind shape start position
+ of the passed header. The function upper_bound() finds the first
+ element in the map whose key is greater than the start position of the
+ header. Its end position is used to test whether the found object is
+ really related to the shape. */
+ XclImpObjTextMap::const_iterator aIt = maTextMap.upper_bound( rHeader.GetRecBegFilePos() );
+ if( (aIt != maTextMap.end()) && (aIt->first <= rHeader.GetRecEndFilePos()) )
+ return aIt->second.get();
+ return 0;
}
-void XclImpObjectManager::SetInvalidObj( SCTAB nScTab, sal_uInt16 nObjId )
+void XclImpObjectManager::SetSkipObj( SCTAB nScTab, sal_uInt16 nObjId )
{
- maInvalidObjs.push_back( XclObjId( nScTab, nObjId ) );
+ maSkipObjs.push_back( XclObjId( nScTab, nObjId ) );
}
// *** Drawing object conversion *** ------------------------------------------
@@ -2030,7 +3733,7 @@ void XclImpObjectManager::SetInvalidObj( SCTAB nScTab, sal_uInt16 nObjId )
XclImpDffManager& XclImpObjectManager::GetDffManager()
{
if( !mxDffManager )
- mxDffManager.reset( new XclImpDffManager( GetRoot(), *this, maEscherStrm ) );
+ mxDffManager.reset( new XclImpDffManager( GetRoot(), *this, maDffStrm ) );
return *mxDffManager;
}
@@ -2041,10 +3744,10 @@ void XclImpObjectManager::ConvertObjects()
// do nothing if the document does not contain a drawing layer
if( GetDoc().GetDrawLayer() )
{
- // process list of identifiers of invalid objects
- for( XclObjIdVec::const_iterator aVIt = maInvalidObjs.begin(), aVEnd = maInvalidObjs.end(); aVIt != aVEnd; ++aVIt )
+ // process list of identifiers of objects to be skipped
+ for( XclObjIdVec::const_iterator aVIt = maSkipObjs.begin(), aVEnd = maSkipObjs.end(); aVIt != aVEnd; ++aVIt )
if( XclImpDrawObjBase* pDrawObj = FindDrawObj( *aVIt ).get() )
- pDrawObj->SetInvalid();
+ pDrawObj->SetProcessSdrObj( false );
// get progress bar size for all valid objects
sal_Size nProgressSize = GetProgressSize();
@@ -2052,20 +3755,29 @@ void XclImpObjectManager::ConvertObjects()
{
XclImpDffManager& rDffManager = GetDffManager();
rDffManager.StartProgressBar( nProgressSize );
- // process the global container, contains pictures
+ // process drawing objects without DFF data
+ for( XclImpDrawObjVector::const_iterator aVIt = maRawObjs.begin(), aVEnd = maRawObjs.end(); aVIt != aVEnd; ++aVIt )
+ rDffManager.ProcessObject( GetSdrPage( (*aVIt)->GetScTab() ), **aVIt );
+ // process the global DFF container, contains pictures
if( !maTabStrmPos.empty() && (maTabStrmPos.front() > 0) )
- rDffManager.ProcessDrawingGroup( maEscherStrm );
+ rDffManager.ProcessDrawingGroup( maDffStrm );
// process the sheet records, this inserts the objects into the drawing layer
for( StreamPosVec::const_iterator aPIt = maTabStrmPos.begin(), aPEnd = maTabStrmPos.end(); aPIt != aPEnd; ++aPIt )
if( *aPIt != STREAM_SEEK_TO_END )
- rDffManager.ProcessDrawing( maEscherStrm, *aPIt );
- // chart sheets
- for( XclImpChartObjList::const_iterator aLIt = maTabCharts.begin(), aLEnd = maTabCharts.end(); aLIt != aLEnd; ++aLIt )
- rDffManager.ProcessTabChart( **aLIt );
+ rDffManager.ProcessDrawing( maDffStrm, *aPIt );
}
}
}
+String XclImpObjectManager::GetDefaultObjName( const XclImpDrawObjBase& rDrawObj ) const
+{
+ String aDefName;
+ DefObjNameMap::const_iterator aIt = maDefObjNames.find( rDrawObj.GetObjType() );
+ if( aIt != maDefObjNames.end() )
+ aDefName.Append( aIt->second );
+ return aDefName.Append( sal_Unicode( ' ' ) ).Append( String::CreateFromInt32( rDrawObj.GetObjId().mnObjId ) );
+}
+
ScRange XclImpObjectManager::GetUsedArea( SCTAB nScTab ) const
{
ScRange aScUsedArea( ScAddress::INITIALIZE_INVALID );
@@ -2076,113 +3788,166 @@ ScRange XclImpObjectManager::GetUsedArea( SCTAB nScTab ) const
// private --------------------------------------------------------------------
-void XclImpObjectManager::ReadEscherRecord( XclImpStream& rStrm )
+void XclImpObjectManager::ReadWmf( Graphic& rGraphic, XclImpStream& rStrm ) // static helper
{
- sal_Size nRecSize = rStrm.GetRecSize();
- if( nRecSize > 0 )
+ // extract graphic data from IMGDATA and following CONTINUE records
+ rStrm.Ignore( 8 );
+ SvMemoryStream aMemStrm;
+ rStrm.CopyToStream( aMemStrm, rStrm.GetRecLeft() );
+ aMemStrm.Seek( STREAM_SEEK_TO_BEGIN );
+ // import the graphic from memory stream
+ GDIMetaFile aGDIMetaFile;
+ if( ::ReadWindowMetafile( aMemStrm, aGDIMetaFile, 0 ) )
+ rGraphic = aGDIMetaFile;
+}
+
+void XclImpObjectManager::ReadBmp( Graphic& rGraphic, XclImpStream& rStrm ) // static helper
+{
+ // extract graphic data from IMGDATA and following CONTINUE records
+ SvMemoryStream aMemStrm;
+
+ /* Excel 3 and 4 seem to write broken BMP data. Usually they write a
+ DIBCOREHEADER (12 bytes) containing width, height, planes = 1, and
+ pixel depth = 32 bit. After that, 3 unused bytes are added before the
+ actual pixel data. This does even confuse Excel 5 and later, which
+ cannot read the image data correctly. */
+ if( rStrm.GetRoot().GetBiff() <= EXC_BIFF4 )
{
- ScfUInt8Vec aBuffer( nRecSize );
- // read from input stream
- rStrm.Seek( EXC_REC_SEEK_TO_BEGIN );
- rStrm.Read( &aBuffer.front(), nRecSize );
- // write to Escher stream
- maEscherStrm.Seek( STREAM_SEEK_TO_END );
- maEscherStrm.Write( &aBuffer.front(), nRecSize );
+ rStrm.PushPosition();
+ sal_uInt32 nHdrSize;
+ sal_uInt16 nWidth, nHeight, nPlanes, nDepth;
+ rStrm >> nHdrSize >> nWidth >> nHeight >> nPlanes >> nDepth;
+ if( (nHdrSize == 12) && (nPlanes == 1) && (nDepth == 32) )
+ {
+ rStrm.Ignore( 3 );
+ aMemStrm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
+ aMemStrm << nHdrSize << nWidth << nHeight << nPlanes << nDepth;
+ rStrm.CopyToStream( aMemStrm, rStrm.GetRecLeft() );
+ }
+ rStrm.PopPosition();
}
+
+ // no special handling above -> just copy the remaining record data
+ if( aMemStrm.Tell() == 0 )
+ rStrm.CopyToStream( aMemStrm, rStrm.GetRecLeft() );
+
+ // import the graphic from memory stream
+ aMemStrm.Seek( STREAM_SEEK_TO_BEGIN );
+ Bitmap aBitmap;
+ if( aBitmap.Read( aMemStrm, FALSE ) ) // read DIB without file header
+ rGraphic = aBitmap;
+}
+
+void XclImpObjectManager::ReadDffRecord( XclImpStream& rStrm )
+{
+ maDffStrm.Seek( STREAM_SEEK_TO_END );
+ rStrm.CopyRecordToStream( maDffStrm );
}
void XclImpObjectManager::ReadObj8( XclImpStream& rStrm )
{
- XclImpDrawObjRef xDrawObj;
- bool bLoop = true;
- while( bLoop && (rStrm.GetRecLeft() >= 4) )
- {
- sal_uInt16 nSubRecId, nSubRecSize;
- rStrm >> nSubRecId >> nSubRecSize;
- rStrm.PushPosition();
+ XclImpDrawObjRef xDrawObj = XclImpDrawObjBase::ReadObj8( rStrm );
+ // store the new object in the internal containers
+ maObjMap[ maDffStrm.Tell() ] = xDrawObj;
+ maObjMapId[ xDrawObj->GetObjId() ] = xDrawObj;
+}
- switch( nSubRecId )
- {
- case EXC_ID_OBJ_FTEND:
- bLoop = false;
- break;
- case EXC_ID_OBJ_FTCMO:
- DBG_ASSERT( !xDrawObj, "XclImpObjectManager::ReadObj8 - multiple FTCMO subrecords" );
- xDrawObj = XclImpDrawObjBase::ReadObjCmo( rStrm );
- bLoop = xDrawObj.is();
- break;
- default:
- DBG_ASSERT( xDrawObj.is(), "XclImpObjectManager::ReadObj8 - missing leading FTCMO subrecord" );
- if( xDrawObj.is() )
- xDrawObj->ReadSubRecord( rStrm, nSubRecId, nSubRecSize );
- }
+void XclImpObjectManager::ReadTxo( XclImpStream& rStrm )
+{
+ XclImpObjTextRef xTextData( new XclImpObjTextData );
+ maTextMap[ maDffStrm.Tell() ] = xTextData;
- rStrm.PopPosition();
- // sometimes the last subrecord has an invalid length -> min()
- rStrm.Ignore( ::std::min< sal_Size >( nSubRecSize, rStrm.GetRecLeft() ) );
- }
+ // 1) read the TXO record
+ xTextData->maData.ReadTxo8( rStrm );
- // try to read the chart substream
- if( XclImpChartObj* pChartObj = dynamic_cast< XclImpChartObj* >( xDrawObj.get() ) )
+ // 2) first CONTINUE with string
+ xTextData->mxString.reset();
+ bool bValid = true;
+ if( xTextData->maData.mnTextLen > 0 )
{
- // read complete chart substream from BOF to EOF records
- if( StartChartSubStream( rStrm ) )
- pChartObj->ReadChartSubStream( rStrm );
- // #90118# be able to read following CONTINUE record as MSODRAWING
- rStrm.ResetRecord( false );
+ bValid = (rStrm.GetNextRecId() == EXC_ID_CONT) && rStrm.StartNextRecord();
+ DBG_ASSERT( bValid, "XclImpObjectManager::ReadTxo - missing CONTINUE record" );
+ if( bValid )
+ xTextData->mxString.reset( new XclImpString( rStrm.ReadUniString( xTextData->maData.mnTextLen ) ) );
}
- // store the new object in the internal containers
- if( xDrawObj.is() )
+ // 3) second CONTINUE with formatting runs
+ if( xTextData->maData.mnFormatSize > 0 )
{
- maObjMap[ maEscherStrm.Tell() ] = xDrawObj;
- maObjMapId[ xDrawObj->GetObjId() ] = xDrawObj;
+ bValid = (rStrm.GetNextRecId() == EXC_ID_CONT) && rStrm.StartNextRecord();
+ DBG_ASSERT( bValid, "XclImpObjectManager::ReadTxo - missing CONTINUE record" );
+ if( bValid )
+ xTextData->ReadFormats( rStrm );
}
}
-void XclImpObjectManager::ReadTxo( XclImpStream& rStrm )
+void XclImpObjectManager::ReadNote3( XclImpStream& rStrm )
{
- XclImpTxoDataRef xTxo( new XclImpTxoData( GetRoot() ) );
- xTxo->ReadTxo( rStrm );
- maTxoMap[ maEscherStrm.Tell() ] = xTxo;
-}
+ XclAddress aXclPos;
+ sal_uInt16 nTotalLen;
+ rStrm >> aXclPos >> nTotalLen;
-bool XclImpObjectManager::StartChartSubStream( XclImpStream& rStrm )
-{
- bool bChartSubStrm = (rStrm.GetNextRecId() == EXC_ID5_BOF) && rStrm.StartNextRecord();
- DBG_ASSERT( bChartSubStrm, "XclImpObjectManager::StartChartSubStream - missing chart substream" );
- if( bChartSubStrm )
+ SCTAB nScTab = GetCurrScTab();
+ ScAddress aScNotePos( ScAddress::UNINITIALIZED );
+ if( GetAddressConverter().ConvertAddress( aScNotePos, aXclPos, nScTab, true ) )
{
- rStrm.ResetRecord( true );
- sal_uInt16 nBofType;
- rStrm.Ignore( 2 );
- rStrm >> nBofType;
- DBG_ASSERT( nBofType == EXC_BOF_CHART, "XclImpObjectManager::StartChartSubStream - no chart BOF record" );
- // return true, even if BOF record contains wrong substream identifier
+ sal_uInt16 nPartLen = ::std::min( nTotalLen, static_cast< sal_uInt16 >( rStrm.GetRecLeft() ) );
+ String aNoteText = rStrm.ReadRawByteString( nPartLen );
+ nTotalLen = nTotalLen - nPartLen;
+ while( (nTotalLen > 0) && (rStrm.GetNextRecId() == EXC_ID_NOTE) && rStrm.StartNextRecord() )
+ {
+ rStrm >> aXclPos >> nPartLen;
+ DBG_ASSERT( aXclPos.mnRow == 0xFFFF, "XclImpObjectManager::ReadNote3 - missing continuation NOTE record" );
+ if( aXclPos.mnRow == 0xFFFF )
+ {
+ DBG_ASSERT( nPartLen <= nTotalLen, "XclImpObjectManager::ReadNote3 - string too long" );
+ aNoteText.Append( rStrm.ReadRawByteString( nPartLen ) );
+ nTotalLen = nTotalLen - ::std::min( nTotalLen, nPartLen );
+ }
+ else
+ {
+ // seems to be a new note, record already started -> load the note
+ rStrm.Seek( EXC_REC_SEEK_TO_BEGIN );
+ ReadNote( rStrm );
+ nTotalLen = 0;
+ }
+ }
+ ScPostIt aScNote( aNoteText, GetDocPtr() );
+ GetDoc().SetNote( aScNotePos.Col(), aScNotePos.Row(), aScNotePos.Tab(), aScNote );
}
- return bChartSubStrm;
+}
+
+void XclImpObjectManager::ReadNote8( XclImpStream& rStrm )
+{
+ XclAddress aXclPos;
+ sal_uInt16 nFlags, nObjId;
+ rStrm >> aXclPos >> nFlags >> nObjId;
+
+ SCTAB nScTab = GetCurrScTab();
+ ScAddress aScNotePos( ScAddress::UNINITIALIZED );
+ if( GetAddressConverter().ConvertAddress( aScNotePos, aXclPos, nScTab, true ) )
+ if( nObjId != EXC_OBJ_INVALID_ID )
+ if( XclImpNoteObj* pNoteObj = dynamic_cast< XclImpNoteObj* >( FindDrawObj( XclObjId( nScTab, nObjId ) ).get() ) )
+ pNoteObj->SetNoteData( aScNotePos, nFlags );
}
sal_Size XclImpObjectManager::GetProgressSize() const
{
- sal_Size nProgressSize = 0;
+ sal_Size nProgressSize = maRawObjs.GetProgressSize();
for( XclImpObjMap::const_iterator aMIt = maObjMap.begin(), aMEnd = maObjMap.end(); aMIt != aMEnd; ++aMIt )
nProgressSize += aMIt->second->GetProgressSize();
- for( XclImpChartObjList::const_iterator aLIt = maTabCharts.begin(), aLEnd = maTabCharts.end(); aLIt != aLEnd; ++aLIt )
- nProgressSize += (*aLIt)->GetProgressSize();
return nProgressSize;
}
-// Escher property set helper =================================================
+// DFF property set helper ====================================================
-XclImpEscherPropSet::XclImpEscherPropSet( const XclImpRoot& rRoot ) :
+XclImpDffPropSet::XclImpDffPropSet( const XclImpRoot& rRoot ) :
XclImpRoot( rRoot ),
- maObjManager( rRoot ),
- mrDffManager( maObjManager.GetDffManager() )
+ maDffManager( maDummyStrm, rRoot.GetBasePath(), 0, 0, rRoot.GetDoc().GetDrawLayer(), 1440, COL_DEFAULT, 24, 0, &rRoot.GetTracer().GetBaseTracer() )
{
}
-void XclImpEscherPropSet::Read( XclImpStream& rStrm )
+void XclImpDffPropSet::Read( XclImpStream& rStrm )
{
sal_uInt32 nPropSetSize;
@@ -2194,21 +3959,21 @@ void XclImpEscherPropSet::Read( XclImpStream& rStrm )
mxMemStrm.reset( new SvMemoryStream );
rStrm.CopyToStream( *mxMemStrm, 8 + nPropSetSize );
mxMemStrm->Seek( STREAM_SEEK_TO_BEGIN );
- mrDffManager.ReadPropSet( *mxMemStrm, 0 );
+ maDffManager.ReadPropSet( *mxMemStrm, 0 );
}
-sal_uInt32 XclImpEscherPropSet::GetPropertyValue( sal_uInt16 nPropId, sal_uInt32 nDefault ) const
+sal_uInt32 XclImpDffPropSet::GetPropertyValue( sal_uInt16 nPropId, sal_uInt32 nDefault ) const
{
- return mrDffManager.GetPropertyValue( nPropId, nDefault );
+ return maDffManager.GetPropertyValue( nPropId, nDefault );
}
-void XclImpEscherPropSet::FillToItemSet( SfxItemSet& rItemSet ) const
+void XclImpDffPropSet::FillToItemSet( SfxItemSet& rItemSet ) const
{
if( mxMemStrm.get() )
- mrDffManager.ApplyAttributes( *mxMemStrm, rItemSet );
+ maDffManager.ApplyAttributes( *mxMemStrm, rItemSet );
}
-XclImpStream& operator>>( XclImpStream& rStrm, XclImpEscherPropSet& rPropSet )
+XclImpStream& operator>>( XclImpStream& rStrm, XclImpDffPropSet& rPropSet )
{
rPropSet.Read( rStrm );
return rStrm;
diff --git a/sc/source/filter/excel/xipage.cxx b/sc/source/filter/excel/xipage.cxx
index 68a54f36fe69..2a5252193728 100644
--- a/sc/source/filter/excel/xipage.cxx
+++ b/sc/source/filter/excel/xipage.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xipage.cxx,v $
- * $Revision: 1.18 $
+ * $Revision: 1.18.90.3 $
*
* This file is part of OpenOffice.org.
*
@@ -33,7 +33,6 @@
#include "xipage.hxx"
#include <svtools/itemset.hxx>
#include <vcl/graph.hxx>
-#include <vcl/bmpacc.hxx>
#include "scitems.hxx"
#include <svtools/eitem.hxx>
#include <svtools/intitem.hxx>
@@ -47,6 +46,7 @@
#include "attrib.hxx"
#include "xistream.hxx"
#include "xihelper.hxx"
+#include "xiescher.hxx"
// Page settings ==============================================================
@@ -169,49 +169,11 @@ void XclImpPageSettings::ReadPrintGridLines( XclImpStream& rStrm )
maData.mbPrintGrid = (rStrm.ReaduInt16() != 0);
}
-void XclImpPageSettings::ReadBitmap( XclImpStream& rStrm )
+void XclImpPageSettings::ReadImgData( XclImpStream& rStrm )
{
- sal_uInt32 nID;
- sal_uInt16 nWidth, nHeight, nPlanes, nDepth;
-
- rStrm >> nID;
- rStrm.Ignore( 8 );
- rStrm >> nWidth >> nHeight >> nPlanes >> nDepth;
-
- DBG_ASSERT( nID == EXC_BITMAP_UNKNOWNID, "XclImpPageSettings::ReadBitmap - wrong ID" );
- DBG_ASSERT( nDepth == 24, "XclImpPageSettings::ReadBitmap - wrong depth" );
- DBG_ASSERT( nPlanes == 1, "XclImpPageSettings::ReadBitmap - wrong plane count" );
- if( rStrm.IsValid() && (nID == EXC_BITMAP_UNKNOWNID) && (nDepth == 24) && (nPlanes == 1) )
- {
- sal_Size nPadding = nWidth % 4;
- if( rStrm.GetRecLeft() == (nWidth * 3 + nPadding) * nHeight )
- {
- sal_Int32 nVclWidth = nWidth;
- sal_Int32 nVclHeight = nHeight;
- Bitmap aBmp( Size( nVclWidth, nVclHeight ), nDepth );
- BitmapWriteAccess* pAccess = aBmp.AcquireWriteAccess();
- if( pAccess )
- {
- sal_uInt8 nBlue, nGreen, nRed;
- for( sal_Int32 nY = nVclHeight - 1; nY >= 0; --nY )
- {
- for( sal_Int32 nX = 0; nX < nVclWidth; ++nX )
- {
- rStrm >> nBlue >> nGreen >> nRed;
- pAccess->SetPixel( nY, nX, BitmapColor( nRed, nGreen, nBlue ) );
- }
- rStrm.Ignore( nPadding );
- }
-
- aBmp.ReleaseAccess( pAccess );
- maData.mxBrushItem.reset( new SvxBrushItem( Graphic( aBmp ), GPOS_TILED, ATTR_BACKGROUND ) );
- }
- }
- else
- {
- DBG_ERRORFILE( "XclImpPageSettings::ReadBitmap - record size invalid" );
- }
- }
+ Graphic aGraphic = XclImpObjectManager::ReadImgData( rStrm );
+ if( aGraphic.GetType() != GRAPHIC_NONE )
+ maData.mxBrushItem.reset( new SvxBrushItem( aGraphic, GPOS_TILED, ATTR_BACKGROUND ) );
}
void XclImpPageSettings::SetPaperSize( sal_uInt16 nXclPaperSize, bool bPortrait )
diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx
index 5b24ba4b070d..f0796b99de57 100644
--- a/sc/source/filter/excel/xipivot.cxx
+++ b/sc/source/filter/excel/xipivot.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xipivot.cxx,v $
- * $Revision: 1.20 $
+ * $Revision: 1.20.4.1 $
*
* This file is part of OpenOffice.org.
*
@@ -1272,7 +1272,7 @@ void XclImpPivotTable::ReadSxpi( XclImpStream& rStrm )
maPageFields.push_back( aPageInfo.mnField );
pField->SetPageFieldInfo( aPageInfo );
}
- GetObjectManager().SetInvalidObj( GetCurrScTab(), aPageInfo.mnObjId );
+ GetObjectManager().SetSkipObj( GetCurrScTab(), aPageInfo.mnObjId );
}
}
diff --git a/sc/source/filter/excel/xiroot.cxx b/sc/source/filter/excel/xiroot.cxx
index 5e7b392f1443..d5d11196e9a3 100644
--- a/sc/source/filter/excel/xiroot.cxx
+++ b/sc/source/filter/excel/xiroot.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xiroot.cxx,v $
- * $Revision: 1.24 $
+ * $Revision: 1.24.88.2 $
*
* This file is part of OpenOffice.org.
*
@@ -107,6 +107,13 @@ void XclImpRoot::SetAppFontEncoding( rtl_TextEncoding eAppFontEnc )
void XclImpRoot::InitializeTable( SCTAB /*nScTab*/ )
{
+ if( GetBiff() <= EXC_BIFF4 )
+ {
+ GetPalette().Initialize();
+ GetFontBuffer().Initialize();
+ GetNumFmtBuffer().Initialize();
+ GetXFBuffer().Initialize();
+ }
GetXFRangeBuffer().Initialize();
GetPageSettings().Initialize();
GetTabViewSettings().Initialize();
@@ -115,6 +122,7 @@ void XclImpRoot::InitializeTable( SCTAB /*nScTab*/ )
void XclImpRoot::FinalizeTable()
{
GetXFRangeBuffer().Finalize();
+ GetOldRoot().pColRowBuff->Convert( GetCurrScTab() );
GetPageSettings().Finalize();
GetTabViewSettings().Finalize();
}
diff --git a/sc/source/filter/excel/xistring.cxx b/sc/source/filter/excel/xistring.cxx
index d873100f7274..d6e0b3182d41 100644
--- a/sc/source/filter/excel/xistring.cxx
+++ b/sc/source/filter/excel/xistring.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xistring.cxx,v $
- * $Revision: 1.5 $
+ * $Revision: 1.5.90.1 $
*
* This file is part of OpenOffice.org.
*
@@ -146,6 +146,21 @@ void XclImpString::ReadFormats( XclImpStream& rStrm, XclFormatRunVec& rFormats,
}
}
+void XclImpString::ReadObjFormats( XclImpStream& rStrm, XclFormatRunVec& rFormats, sal_uInt16 nFormatSize )
+{
+ // number of formatting runs, each takes 8 bytes
+ sal_uInt16 nRunCount = nFormatSize / 8;
+ rFormats.clear();
+ rFormats.reserve( nRunCount );
+ for( sal_uInt16 nIdx = 0; nIdx < nRunCount; ++nIdx )
+ {
+ sal_uInt16 nChar, nFontIdx;
+ rStrm >> nChar >> nFontIdx;
+ rStrm.Ignore( 4 );
+ AppendFormat( rFormats, nChar, nFontIdx );
+ }
+}
+
// String iterator ============================================================
XclImpStringIterator::XclImpStringIterator( const XclImpString& rString ) :
diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index 7eff0c245846..7f1627e89e7f 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xistyle.cxx,v $
- * $Revision: 1.38 $
+ * $Revision: 1.38.14.4 $
*
* This file is part of OpenOffice.org.
*
@@ -34,6 +34,7 @@
#include <sfx2/printer.hxx>
#include <sfx2/objsh.hxx>
#include <svtools/ctrltool.hxx>
+#include <svx/editobj.hxx>
#include "scitems.hxx"
#include <svx/fontitem.hxx>
#include <svx/fhgtitem.hxx>
@@ -58,12 +59,14 @@
#include "attrib.hxx"
#include "stlpool.hxx"
#include "stlsheet.hxx"
+#include "cell.hxx"
#include "globstr.hrc"
#include "xltracer.hxx"
#include "xistream.hxx"
#include "xicontent.hxx"
#include "root.hxx"
+#include "colrowst.hxx"
// PALETTE record - color information =========================================
@@ -72,6 +75,11 @@ XclImpPalette::XclImpPalette( const XclImpRoot& rRoot ) :
{
}
+void XclImpPalette::Initialize()
+{
+ maColorTable.clear();
+}
+
ColorData XclImpPalette::GetColorData( sal_uInt16 nXclIndex ) const
{
if( nXclIndex >= EXC_COLOR_USEROFFSET )
@@ -112,10 +120,21 @@ XclImpFont::XclImpFont( const XclImpRoot& rRoot ) :
}
XclImpFont::XclImpFont( const XclImpRoot& rRoot, const XclFontData& rFontData ) :
- XclImpRoot( rRoot ),
- maData( rFontData ),
- mbHasCharSet( false )
+ XclImpRoot( rRoot )
{
+ SetFontData( rFontData, false );
+}
+
+void XclImpFont::SetAllUsedFlags( bool bUsed )
+{
+ mbFontNameUsed = mbHeightUsed = mbColorUsed = mbWeightUsed = mbEscapemUsed =
+ mbUnderlUsed = mbItalicUsed = mbStrikeUsed = mbOutlineUsed = mbShadowUsed = bUsed;
+}
+
+void XclImpFont::SetFontData( const XclFontData& rFontData, bool bHasCharSet )
+{
+ maData = rFontData;
+ mbHasCharSet = bHasCharSet;
if( maData.maStyle.Len() )
{
if( SfxObjectShell* pDocShell = GetDocShell() )
@@ -137,12 +156,6 @@ XclImpFont::XclImpFont( const XclImpRoot& rRoot, const XclFontData& rFontData )
SetAllUsedFlags( true );
}
-void XclImpFont::SetAllUsedFlags( bool bUsed )
-{
- mbFontNameUsed = mbHeightUsed = mbColorUsed = mbWeightUsed = mbEscapemUsed =
- mbUnderlUsed = mbItalicUsed = mbStrikeUsed = mbOutlineUsed = mbShadowUsed = bUsed;
-}
-
rtl_TextEncoding XclImpFont::GetFontEncoding() const
{
// #i63105# use text encoding from FONT record
@@ -406,30 +419,64 @@ void XclImpFont::GuessScriptType()
// ----------------------------------------------------------------------------
XclImpFontBuffer::XclImpFontBuffer( const XclImpRoot& rRoot ) :
- XclImpRoot( rRoot )
+ XclImpRoot( rRoot ),
+ maFont4( rRoot ),
+ maCtrlFont( rRoot )
{
- /* Application font for column width calculation,
- later filled with first font from font list. */
- maAppFont.maName.AssignAscii( "Arial" );
- maAppFont.mnHeight = 200;
- SetCharWidth( maAppFont );
+ Initialize();
+
+ // default font for form controls without own font information
+ XclFontData aCtrlFontData;
+ switch( GetBiff() )
+ {
+ case EXC_BIFF2:
+ case EXC_BIFF3:
+ case EXC_BIFF4:
+ case EXC_BIFF5:
+ aCtrlFontData.maName.AssignAscii( "Helv" );
+ aCtrlFontData.mnHeight = 160;
+ aCtrlFontData.mnWeight = EXC_FONTWGHT_BOLD;
+ break;
+ case EXC_BIFF8:
+ aCtrlFontData.maName.AssignAscii( "Tahoma" );
+ aCtrlFontData.mnHeight = 160;
+ aCtrlFontData.mnWeight = EXC_FONTWGHT_NORMAL;
+ break;
+ default:
+ DBG_ERROR_BIFF();
+ }
+ maCtrlFont.SetFontData( aCtrlFontData, false );
}
-void XclImpFontBuffer::ReadFont( XclImpStream& rStrm )
+void XclImpFontBuffer::Initialize()
{
- // Font with index 4 is not stored in an Excel file -> create a dummy font.
- if( maFontList.Count() == 4 )
- maFontList.Append( new XclImpFont( *GetFont( 0 ) ) );
+ maFontList.Clear();
+ // application font for column width calculation, later filled with first font from font list
+ XclFontData aAppFontData;
+ aAppFontData.maName.AssignAscii( "Arial" );
+ aAppFontData.mnHeight = 200;
+ aAppFontData.mnWeight = EXC_FONTWGHT_NORMAL;
+ UpdateAppFont( aAppFontData, false );
+}
+
+const XclImpFont* XclImpFontBuffer::GetFont( sal_uInt16 nFontIndex ) const
+{
+ /* Font with index 4 is not stored in an Excel file, but used e.g. by
+ BIFF5 form pushbutton objects. It is the bold default font. */
+ return (nFontIndex == 4) ? &maFont4 :
+ maFontList.GetObject( (nFontIndex < 4) ? nFontIndex : (nFontIndex - 1) );
+}
+
+void XclImpFontBuffer::ReadFont( XclImpStream& rStrm )
+{
XclImpFont* pFont = new XclImpFont( GetRoot() );
pFont->ReadFont( rStrm );
maFontList.Append( pFont );
if( maFontList.Count() == 1 )
{
- maAppFont = pFont->GetFontData();
- // #i3006# Calculate the width of '0' from first font and current printer.
- SetCharWidth( maAppFont );
+ UpdateAppFont( pFont->GetFontData(), pFont->HasCharSet() );
// #i71033# set text encoding from application font, if CODEPAGE is missing
SetAppFontEncoding( pFont->GetFontEncoding() );
}
@@ -456,6 +503,23 @@ void XclImpFontBuffer::WriteFontProperties( ScfPropertySet& rPropSet,
pFont->WriteFontProperties( rPropSet, eType, pFontColor );
}
+void XclImpFontBuffer::WriteDefaultCtrlFontProperties( ScfPropertySet& rPropSet ) const
+{
+ maCtrlFont.WriteFontProperties( rPropSet, EXC_FONTPROPSET_CONTROL );
+}
+
+void XclImpFontBuffer::UpdateAppFont( const XclFontData& rFontData, bool bHasCharSet )
+{
+ maAppFont = rFontData;
+ // #i3006# Calculate the width of '0' from first font and current printer.
+ SetCharWidth( maAppFont );
+
+ // font 4 is bold font 0
+ XclFontData aFont4Data( maAppFont );
+ aFont4Data.mnWeight = EXC_FONTWGHT_BOLD;
+ maFont4.SetFontData( aFont4Data, bHasCharSet );
+}
+
// FORMAT record - number formats =============================================
XclImpNumFmtBuffer::XclImpNumFmtBuffer( const XclImpRoot& rRoot ) :
@@ -465,6 +529,13 @@ XclImpNumFmtBuffer::XclImpNumFmtBuffer( const XclImpRoot& rRoot ) :
{
}
+void XclImpNumFmtBuffer::Initialize()
+{
+ maIndexMap.clear();
+ mnNextXclIdx = 0;
+ InitializeImport(); // base class
+}
+
void XclImpNumFmtBuffer::ReadFormat( XclImpStream& rStrm )
{
String aFormat;
@@ -575,39 +646,39 @@ void XclImpCellProt::FillToItemSet( SfxItemSet& rItemSet, bool bSkipPoolDefs ) c
void XclImpCellAlign::FillFromXF2( sal_uInt8 nFlags )
{
- ::extract_value( mnHorAlign, nFlags, 0, 3 );
+ mnHorAlign = ::extract_value< sal_uInt8 >( nFlags, 0, 3 );
}
void XclImpCellAlign::FillFromXF3( sal_uInt16 nAlign )
{
- ::extract_value( mnHorAlign, nAlign, 0, 3 );
+ mnHorAlign = ::extract_value< sal_uInt8 >( nAlign, 0, 3 );
mbLineBreak = ::get_flag( nAlign, EXC_XF_LINEBREAK ); // new in BIFF3
}
void XclImpCellAlign::FillFromXF4( sal_uInt16 nAlign )
{
FillFromXF3( nAlign );
- ::extract_value( mnVerAlign, nAlign, 4, 2 ); // new in BIFF4
- ::extract_value( mnOrient, nAlign, 6, 2 ); // new in BIFF4
+ mnVerAlign = ::extract_value< sal_uInt8 >( nAlign, 4, 2 ); // new in BIFF4
+ mnOrient = ::extract_value< sal_uInt8 >( nAlign, 6, 2 ); // new in BIFF4
}
void XclImpCellAlign::FillFromXF5( sal_uInt16 nAlign )
{
- ::extract_value( mnHorAlign, nAlign, 0, 3 );
- ::extract_value( mnVerAlign, nAlign, 4, 3 );
+ mnHorAlign = ::extract_value< sal_uInt8 >( nAlign, 0, 3 );
+ mnVerAlign = ::extract_value< sal_uInt8 >( nAlign, 4, 3 );
mbLineBreak = ::get_flag( nAlign, EXC_XF_LINEBREAK );
- ::extract_value( mnOrient, nAlign, 8, 2 );
+ mnOrient = ::extract_value< sal_uInt8 >( nAlign, 8, 2 );
}
void XclImpCellAlign::FillFromXF8( sal_uInt16 nAlign, sal_uInt16 nMiscAttrib )
{
- ::extract_value( mnHorAlign, nAlign, 0, 3 );
- ::extract_value( mnVerAlign, nAlign, 4, 3 );
+ mnHorAlign = ::extract_value< sal_uInt8 >( nAlign, 0, 3 );
+ mnVerAlign = ::extract_value< sal_uInt8 >( nAlign, 4, 3 );
mbLineBreak = ::get_flag( nAlign, EXC_XF_LINEBREAK );
- ::extract_value( mnRotation, nAlign, 8, 8 ); // new in BIFF8
- ::extract_value( mnIndent, nMiscAttrib, 0, 4 ); // new in BIFF8
- mbShrink = ::get_flag( nMiscAttrib, EXC_XF8_SHRINK ); // new in BIFF8
- ::extract_value( mnTextDir, nMiscAttrib, 6, 2 ); // new in BIFF8X
+ mnRotation = ::extract_value< sal_uInt8 >( nAlign, 8, 8 ); // new in BIFF8
+ mnIndent = ::extract_value< sal_uInt8 >( nMiscAttrib, 0, 4 ); // new in BIFF8
+ mbShrink = ::get_flag( nMiscAttrib, EXC_XF8_SHRINK ); // new in BIFF8
+ mnTextDir = ::extract_value< sal_uInt8 >( nMiscAttrib, 6, 2 ); // new in BIFF8
}
void XclImpCellAlign::FillToItemSet( SfxItemSet& rItemSet, const XclImpFont* pFont, bool bSkipPoolDefs ) const
@@ -670,65 +741,65 @@ void XclImpCellBorder::FillFromXF2( sal_uInt8 nFlags )
void XclImpCellBorder::FillFromXF3( sal_uInt32 nBorder )
{
- ::extract_value( mnTopLine, nBorder, 0, 3 );
- ::extract_value( mnLeftLine, nBorder, 8, 3 );
- ::extract_value( mnBottomLine, nBorder, 16, 3 );
- ::extract_value( mnRightLine, nBorder, 24, 3 );
- ::extract_value( mnTopColor, nBorder, 3, 5 );
- ::extract_value( mnLeftColor, nBorder, 11, 5 );
- ::extract_value( mnBottomColor, nBorder, 19, 5 );
- ::extract_value( mnRightColor, nBorder, 27, 5 );
+ mnTopLine = ::extract_value< sal_uInt8 >( nBorder, 0, 3 );
+ mnLeftLine = ::extract_value< sal_uInt8 >( nBorder, 8, 3 );
+ mnBottomLine = ::extract_value< sal_uInt8 >( nBorder, 16, 3 );
+ mnRightLine = ::extract_value< sal_uInt8 >( nBorder, 24, 3 );
+ mnTopColor = ::extract_value< sal_uInt16 >( nBorder, 3, 5 );
+ mnLeftColor = ::extract_value< sal_uInt16 >( nBorder, 11, 5 );
+ mnBottomColor = ::extract_value< sal_uInt16 >( nBorder, 19, 5 );
+ mnRightColor = ::extract_value< sal_uInt16 >( nBorder, 27, 5 );
SetUsedFlags( true, false );
}
void XclImpCellBorder::FillFromXF5( sal_uInt32 nBorder, sal_uInt32 nArea )
{
- ::extract_value( mnTopLine, nBorder, 0, 3 );
- ::extract_value( mnLeftLine, nBorder, 3, 3 );
- ::extract_value( mnBottomLine, nArea, 22, 3 );
- ::extract_value( mnRightLine, nBorder, 6, 3 );
- ::extract_value( mnTopColor, nBorder, 9, 7 );
- ::extract_value( mnLeftColor, nBorder, 16, 7 );
- ::extract_value( mnBottomColor, nArea, 25, 7 );
- ::extract_value( mnRightColor, nBorder, 23, 7 );
+ mnTopLine = ::extract_value< sal_uInt8 >( nBorder, 0, 3 );
+ mnLeftLine = ::extract_value< sal_uInt8 >( nBorder, 3, 3 );
+ mnBottomLine = ::extract_value< sal_uInt8 >( nArea, 22, 3 );
+ mnRightLine = ::extract_value< sal_uInt8 >( nBorder, 6, 3 );
+ mnTopColor = ::extract_value< sal_uInt16 >( nBorder, 9, 7 );
+ mnLeftColor = ::extract_value< sal_uInt16 >( nBorder, 16, 7 );
+ mnBottomColor = ::extract_value< sal_uInt16 >( nArea, 25, 7 );
+ mnRightColor = ::extract_value< sal_uInt16 >( nBorder, 23, 7 );
SetUsedFlags( true, false );
}
void XclImpCellBorder::FillFromXF8( sal_uInt32 nBorder1, sal_uInt32 nBorder2 )
{
- ::extract_value( mnLeftLine, nBorder1, 0, 4 );
- ::extract_value( mnRightLine, nBorder1, 4, 4 );
- ::extract_value( mnTopLine, nBorder1, 8, 4 );
- ::extract_value( mnBottomLine, nBorder1, 12, 4 );
- ::extract_value( mnLeftColor, nBorder1, 16, 7 );
- ::extract_value( mnRightColor, nBorder1, 23, 7 );
- ::extract_value( mnTopColor, nBorder2, 0, 7 );
- ::extract_value( mnBottomColor, nBorder2, 7, 7 );
- mbDiagTLtoBR = ::get_flag( nBorder1, EXC_XF_DIAGONAL_TL_TO_BR );
- mbDiagBLtoTR = ::get_flag( nBorder1, EXC_XF_DIAGONAL_BL_TO_TR );
+ mnLeftLine = ::extract_value< sal_uInt8 >( nBorder1, 0, 4 );
+ mnRightLine = ::extract_value< sal_uInt8 >( nBorder1, 4, 4 );
+ mnTopLine = ::extract_value< sal_uInt8 >( nBorder1, 8, 4 );
+ mnBottomLine = ::extract_value< sal_uInt8 >( nBorder1, 12, 4 );
+ mnLeftColor = ::extract_value< sal_uInt16 >( nBorder1, 16, 7 );
+ mnRightColor = ::extract_value< sal_uInt16 >( nBorder1, 23, 7 );
+ mnTopColor = ::extract_value< sal_uInt16 >( nBorder2, 0, 7 );
+ mnBottomColor = ::extract_value< sal_uInt16 >( nBorder2, 7, 7 );
+ mbDiagTLtoBR = ::get_flag( nBorder1, EXC_XF_DIAGONAL_TL_TO_BR );
+ mbDiagBLtoTR = ::get_flag( nBorder1, EXC_XF_DIAGONAL_BL_TO_TR );
if( mbDiagTLtoBR || mbDiagBLtoTR )
{
- ::extract_value( mnDiagLine, nBorder2, 21, 4 );
- ::extract_value( mnDiagColor, nBorder2, 14, 7 );
+ mnDiagLine = ::extract_value< sal_uInt8 >( nBorder2, 21, 4 );
+ mnDiagColor = ::extract_value< sal_uInt16 >( nBorder2, 14, 7 );
}
SetUsedFlags( true, true );
}
void XclImpCellBorder::FillFromCF8( sal_uInt16 nLineStyle, sal_uInt32 nLineColor, sal_uInt32 nFlags )
{
- ::extract_value( mnLeftLine, nLineStyle, 0, 4 );
- ::extract_value( mnRightLine, nLineStyle, 4, 4 );
- ::extract_value( mnTopLine, nLineStyle, 8, 4 );
- ::extract_value( mnBottomLine, nLineStyle, 12, 4 );
- ::extract_value( mnLeftColor, nLineColor, 0, 7 );
- ::extract_value( mnRightColor, nLineColor, 7, 7 );
- ::extract_value( mnTopColor, nLineColor, 16, 7 );
- ::extract_value( mnBottomColor, nLineColor, 23, 7 );
- mbLeftUsed = !::get_flag( nFlags, EXC_CF_BORDER_LEFT );
- mbRightUsed = !::get_flag( nFlags, EXC_CF_BORDER_RIGHT );
- mbTopUsed = !::get_flag( nFlags, EXC_CF_BORDER_TOP );
- mbBottomUsed = !::get_flag( nFlags, EXC_CF_BORDER_BOTTOM );
- mbDiagUsed = false;
+ mnLeftLine = ::extract_value< sal_uInt8 >( nLineStyle, 0, 4 );
+ mnRightLine = ::extract_value< sal_uInt8 >( nLineStyle, 4, 4 );
+ mnTopLine = ::extract_value< sal_uInt8 >( nLineStyle, 8, 4 );
+ mnBottomLine = ::extract_value< sal_uInt8 >( nLineStyle, 12, 4 );
+ mnLeftColor = ::extract_value< sal_uInt16 >( nLineColor, 0, 7 );
+ mnRightColor = ::extract_value< sal_uInt16 >( nLineColor, 7, 7 );
+ mnTopColor = ::extract_value< sal_uInt16 >( nLineColor, 16, 7 );
+ mnBottomColor = ::extract_value< sal_uInt16 >( nLineColor, 23, 7 );
+ mbLeftUsed = !::get_flag( nFlags, EXC_CF_BORDER_LEFT );
+ mbRightUsed = !::get_flag( nFlags, EXC_CF_BORDER_RIGHT );
+ mbTopUsed = !::get_flag( nFlags, EXC_CF_BORDER_TOP );
+ mbBottomUsed = !::get_flag( nFlags, EXC_CF_BORDER_BOTTOM );
+ mbDiagUsed = false;
}
namespace {
@@ -824,36 +895,36 @@ void XclImpCellArea::FillFromXF2( sal_uInt8 nFlags )
void XclImpCellArea::FillFromXF3( sal_uInt16 nArea )
{
- ::extract_value( mnPattern, nArea, 0, 6 );
- ::extract_value( mnForeColor, nArea, 6, 5 );
- ::extract_value( mnBackColor, nArea, 11, 5 );
+ mnPattern = ::extract_value< sal_uInt8 >( nArea, 0, 6 );
+ mnForeColor = ::extract_value< sal_uInt16 >( nArea, 6, 5 );
+ mnBackColor = ::extract_value< sal_uInt16 >( nArea, 11, 5 );
SetUsedFlags( true );
}
void XclImpCellArea::FillFromXF5( sal_uInt32 nArea )
{
- ::extract_value( mnPattern, nArea, 16, 6 );
- ::extract_value( mnForeColor, nArea, 0, 7 );
- ::extract_value( mnBackColor, nArea, 7, 7 );
+ mnPattern = ::extract_value< sal_uInt8 >( nArea, 16, 6 );
+ mnForeColor = ::extract_value< sal_uInt16 >( nArea, 0, 7 );
+ mnBackColor = ::extract_value< sal_uInt16 >( nArea, 7, 7 );
SetUsedFlags( true );
}
void XclImpCellArea::FillFromXF8( sal_uInt32 nBorder2, sal_uInt16 nArea )
{
- ::extract_value( mnPattern, nBorder2, 26, 6 );
- ::extract_value( mnForeColor, nArea, 0, 7 );
- ::extract_value( mnBackColor, nArea, 7, 7 );
+ mnPattern = ::extract_value< sal_uInt8 >( nBorder2, 26, 6 );
+ mnForeColor = ::extract_value< sal_uInt16 >( nArea, 0, 7 );
+ mnBackColor = ::extract_value< sal_uInt16 >( nArea, 7, 7 );
SetUsedFlags( true );
}
void XclImpCellArea::FillFromCF8( sal_uInt16 nPattern, sal_uInt16 nColor, sal_uInt32 nFlags )
{
- ::extract_value( mnForeColor, nColor, 0, 7 );
- ::extract_value( mnBackColor, nColor, 7, 7 );
- ::extract_value( mnPattern, nPattern, 10, 6 );
- mbForeUsed = !::get_flag( nFlags, EXC_CF_AREA_FGCOLOR );
- mbBackUsed = !::get_flag( nFlags, EXC_CF_AREA_BGCOLOR );
- mbPattUsed = !::get_flag( nFlags, EXC_CF_AREA_PATTERN );
+ mnForeColor = ::extract_value< sal_uInt16 >( nColor, 0, 7 );
+ mnBackColor = ::extract_value< sal_uInt16 >( nColor, 7, 7 );
+ mnPattern = ::extract_value< sal_uInt8 >( nPattern, 10, 6 );
+ mbForeUsed = !::get_flag( nFlags, EXC_CF_AREA_FGCOLOR );
+ mbBackUsed = !::get_flag( nFlags, EXC_CF_AREA_BGCOLOR );
+ mbPattUsed = !::get_flag( nFlags, EXC_CF_AREA_PATTERN );
if( mbBackUsed && (!mbPattUsed || (mnPattern == EXC_PATT_SOLID)) )
{
@@ -933,13 +1004,10 @@ void XclImpXF::ReadXF3( XclImpStream& rStrm )
sal_uInt8 nReadFont, nReadNumFmt;
rStrm >> nReadFont >> nReadNumFmt >> nTypeProt >> nAlign >> nArea >> nBorder;
- // XF type/parent
- mbCellXF = !::get_flag( nTypeProt, EXC_XF_STYLE ); // new in BIFF3
- ::extract_value( mnParent, nAlign, 4, 12 ); // new in BIFF3
- // attribute used flags
- sal_uInt8 nUsedFlags;
- ::extract_value( nUsedFlags, nTypeProt, 10, 6 );
- SetUsedFlags( nUsedFlags );
+ // XF type/parent, attribute used flags
+ mbCellXF = !::get_flag( nTypeProt, EXC_XF_STYLE ); // new in BIFF3
+ mnParent = ::extract_value< sal_uInt16 >( nAlign, 4, 12 ); // new in BIFF3
+ SetUsedFlags( ::extract_value< sal_uInt8 >( nTypeProt, 10, 6 ) );
// attributes
maProtection.FillFromXF3( nTypeProt );
@@ -957,13 +1025,10 @@ void XclImpXF::ReadXF4( XclImpStream& rStrm )
sal_uInt8 nReadFont, nReadNumFmt;
rStrm >> nReadFont >> nReadNumFmt >> nTypeProt >> nAlign >> nArea >> nBorder;
- // XF type/parent
+ // XF type/parent, attribute used flags
mbCellXF = !::get_flag( nTypeProt, EXC_XF_STYLE );
- ::extract_value( mnParent, nTypeProt, 4, 12 );
- // attribute used flags
- sal_uInt8 nUsedFlags;
- ::extract_value( nUsedFlags, nAlign, 10, 6 );
- SetUsedFlags( nUsedFlags );
+ mnParent = ::extract_value< sal_uInt16 >( nTypeProt, 4, 12 );
+ SetUsedFlags( ::extract_value< sal_uInt8 >( nAlign, 10, 6 ) );
// attributes
maProtection.FillFromXF3( nTypeProt );
@@ -980,13 +1045,10 @@ void XclImpXF::ReadXF5( XclImpStream& rStrm )
sal_uInt16 nTypeProt, nAlign;
rStrm >> mnXclFont >> mnXclNumFmt >> nTypeProt >> nAlign >> nArea >> nBorder;
- // XF type/parent
+ // XF type/parent, attribute used flags
mbCellXF = !::get_flag( nTypeProt, EXC_XF_STYLE );
- ::extract_value( mnParent, nTypeProt, 4, 12 );
- // attribute used flags
- sal_uInt8 nUsedFlags;
- ::extract_value( nUsedFlags, nAlign, 10, 6 );
- SetUsedFlags( nUsedFlags );
+ mnParent = ::extract_value< sal_uInt16 >( nTypeProt, 4, 12 );
+ SetUsedFlags( ::extract_value< sal_uInt8 >( nAlign, 10, 6 ) );
// attributes
maProtection.FillFromXF3( nTypeProt );
@@ -1001,13 +1063,10 @@ void XclImpXF::ReadXF8( XclImpStream& rStrm )
sal_uInt16 nTypeProt, nAlign, nMiscAttrib, nArea;
rStrm >> mnXclFont >> mnXclNumFmt >> nTypeProt >> nAlign >> nMiscAttrib >> nBorder1 >> nBorder2 >> nArea;
- // XF type/parent
+ // XF type/parent, attribute used flags
mbCellXF = !::get_flag( nTypeProt, EXC_XF_STYLE );
- ::extract_value( mnParent, nTypeProt, 4, 12 );
- // attribute used flags
- sal_uInt8 nUsedFlags;
- ::extract_value( nUsedFlags, nMiscAttrib, 10, 6 );
- SetUsedFlags( nUsedFlags );
+ mnParent = ::extract_value< sal_uInt16 >( nTypeProt, 4, 12 );
+ SetUsedFlags( ::extract_value< sal_uInt8 >( nMiscAttrib, 10, 6 ) );
// attributes
maProtection.FillFromXF3( nTypeProt );
@@ -1212,6 +1271,11 @@ XclImpXFBuffer::XclImpXFBuffer( const XclImpRoot& rRoot ) :
{
}
+void XclImpXFBuffer::Initialize()
+{
+ maXFList.Clear();
+}
+
void XclImpXFBuffer::ReadXF( XclImpStream& rStrm )
{
XclImpXF* pXF = new XclImpXF( GetRoot() );
@@ -1616,8 +1680,10 @@ void XclImpXFRangeBuffer::Finalize()
// apply cell merging
for( const ScRange* pRange = maMergeList.First(); pRange; pRange = maMergeList.Next() )
{
- bool bMultiCol = (pRange->aStart.Col() != pRange->aEnd.Col());
- bool bMultiRow = (pRange->aStart.Row() != pRange->aEnd.Row());
+ const ScAddress& rStart = pRange->aStart;
+ const ScAddress& rEnd = pRange->aEnd;
+ bool bMultiCol = rStart.Col() != rEnd.Col();
+ bool bMultiRow = rStart.Row() != rEnd.Row();
// set correct right border
if( bMultiCol )
SetBorderLine( *pRange, nScTab, BOX_LINE_RIGHT );
@@ -1626,8 +1692,17 @@ void XclImpXFRangeBuffer::Finalize()
SetBorderLine( *pRange, nScTab, BOX_LINE_BOTTOM );
// do merge
if( bMultiCol || bMultiRow )
- rDoc.DoMerge( nScTab, pRange->aStart.Col(), pRange->aStart.Row(),
- pRange->aEnd.Col(), pRange->aEnd.Row() );
+ rDoc.DoMerge( nScTab, rStart.Col(), rStart.Row(), rEnd.Col(), rEnd.Row() );
+ // #i93609# merged range in a single row: test if manual row height is needed
+ if( !bMultiRow )
+ {
+ bool bTextWrap = static_cast< const SfxBoolItem* >( rDoc.GetAttr( rStart.Col(), rStart.Row(), rStart.Tab(), ATTR_LINEBREAK ) )->GetValue();
+ if( !bTextWrap && (rDoc.GetCellType( rStart ) == CELLTYPE_EDIT) )
+ if( const EditTextObject* pEditObj = static_cast< const ScEditCell* >( rDoc.GetCell( rStart ) )->GetData() )
+ bTextWrap = pEditObj->GetParagraphCount() > 1;
+ if( bTextWrap )
+ GetOldRoot().pColRowBuff->SetManualRowHeight( rStart.Row() );
+ }
}
}
diff --git a/sc/source/filter/excel/xiview.cxx b/sc/source/filter/excel/xiview.cxx
index f1477992156f..a871bdd0c1d7 100644
--- a/sc/source/filter/excel/xiview.cxx
+++ b/sc/source/filter/excel/xiview.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xiview.cxx,v $
- * $Revision: 1.9 $
+ * $Revision: 1.9.90.1 $
*
* This file is part of OpenOffice.org.
*
@@ -127,18 +127,18 @@ void XclImpTabViewSettings::ReadWindow2( XclImpStream& rStrm, bool bChart )
sal_uInt16 nFlags;
rStrm >> nFlags >> maData.maFirstXclPos;
- // #i59590# real life: Excel ignores some view settings in chart sheets
+ // #i59590# #158194# real life: Excel ignores some view settings in chart sheets
maData.mbSelected = ::get_flag( nFlags, EXC_WIN2_SELECTED );
maData.mbDisplayed = ::get_flag( nFlags, EXC_WIN2_DISPLAYED );
maData.mbMirrored = !bChart && ::get_flag( nFlags, EXC_WIN2_MIRRORED );
maData.mbFrozenPanes = !bChart && ::get_flag( nFlags, EXC_WIN2_FROZEN );
maData.mbPageMode = !bChart && ::get_flag( nFlags, EXC_WIN2_PAGEBREAKMODE );
maData.mbDefGridColor = bChart || ::get_flag( nFlags, EXC_WIN2_DEFGRIDCOLOR );
- maData.mbShowFormulas = ::get_flag( nFlags, EXC_WIN2_SHOWFORMULAS );
- maData.mbShowGrid = ::get_flag( nFlags, EXC_WIN2_SHOWGRID );
- maData.mbShowHeadings = ::get_flag( nFlags, EXC_WIN2_SHOWHEADINGS );
- maData.mbShowZeros = ::get_flag( nFlags, EXC_WIN2_SHOWZEROS );
- maData.mbShowOutline = ::get_flag( nFlags, EXC_WIN2_SHOWOUTLINE );
+ maData.mbShowFormulas = !bChart && ::get_flag( nFlags, EXC_WIN2_SHOWFORMULAS );
+ maData.mbShowGrid = bChart || ::get_flag( nFlags, EXC_WIN2_SHOWGRID );
+ maData.mbShowHeadings = bChart || ::get_flag( nFlags, EXC_WIN2_SHOWHEADINGS );
+ maData.mbShowZeros = bChart || ::get_flag( nFlags, EXC_WIN2_SHOWZEROS );
+ maData.mbShowOutline = bChart || ::get_flag( nFlags, EXC_WIN2_SHOWOUTLINE );
switch( GetBiff() )
{
diff --git a/sc/source/filter/excel/xlchart.cxx b/sc/source/filter/excel/xlchart.cxx
index 369951ffd6b0..a05ae4a275c9 100644
--- a/sc/source/filter/excel/xlchart.cxx
+++ b/sc/source/filter/excel/xlchart.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xlchart.cxx,v $
- * $Revision: 1.12 $
+ * $Revision: 1.11.62.4 $
*
* This file is part of OpenOffice.org.
*
@@ -36,6 +36,7 @@
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/awt/Gradient.hpp>
+#include <com/sun/star/drawing/Hatch.hpp>
#include <com/sun/star/drawing/LineDash.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
@@ -451,8 +452,8 @@ static const XclChFormatInfo spFmtInfos[] =
{ EXC_CHOBJTYPE_FLOOR3D, EXC_CHPROPMODE_COMMON, EXC_COLOR_CHWINDOWTEXT, EXC_CHLINEFORMAT_HAIR, 23, EXC_CHFRAMETYPE_AUTO, true, false, true },
{ EXC_CHOBJTYPE_TEXT, EXC_CHPROPMODE_COMMON, EXC_COLOR_CHWINDOWTEXT, EXC_CHLINEFORMAT_HAIR, EXC_COLOR_CHWINDOWBACK, EXC_CHFRAMETYPE_INVISIBLE, false, true, true },
{ EXC_CHOBJTYPE_LEGEND, EXC_CHPROPMODE_COMMON, EXC_COLOR_CHWINDOWTEXT, EXC_CHLINEFORMAT_HAIR, EXC_COLOR_CHWINDOWBACK, EXC_CHFRAMETYPE_AUTO, true, true, true },
- { EXC_CHOBJTYPE_LINEARSERIES, EXC_CHPROPMODE_LINEARSERIES, EXC_COLOR_CHWINDOWTEXT, EXC_CHLINEFORMAT_SINGLE, EXC_COLOR_CHWINDOWBACK, EXC_CHFRAMETYPE_AUTO, false, false, false },
- { EXC_CHOBJTYPE_FILLEDSERIES, EXC_CHPROPMODE_FILLEDSERIES, EXC_COLOR_CHBORDERAUTO, EXC_CHLINEFORMAT_SINGLE, EXC_COLOR_CHWINDOWBACK, EXC_CHFRAMETYPE_AUTO, false, false, true },
+ { EXC_CHOBJTYPE_LINEARSERIES, EXC_CHPROPMODE_LINEARSERIES, 0xFFFF, EXC_CHLINEFORMAT_SINGLE, EXC_COLOR_CHWINDOWBACK, EXC_CHFRAMETYPE_AUTO, false, false, false },
+ { EXC_CHOBJTYPE_FILLEDSERIES, EXC_CHPROPMODE_FILLEDSERIES, EXC_COLOR_CHBORDERAUTO, EXC_CHLINEFORMAT_SINGLE, 0xFFFF, EXC_CHFRAMETYPE_AUTO, false, false, true },
{ EXC_CHOBJTYPE_AXISLINE, EXC_CHPROPMODE_COMMON, EXC_COLOR_CHWINDOWTEXT, EXC_CHLINEFORMAT_HAIR, EXC_COLOR_CHWINDOWBACK, EXC_CHFRAMETYPE_AUTO, false, false, false },
{ EXC_CHOBJTYPE_GRIDLINE, EXC_CHPROPMODE_COMMON, EXC_COLOR_CHWINDOWTEXT, EXC_CHLINEFORMAT_HAIR, EXC_COLOR_CHWINDOWBACK, EXC_CHFRAMETYPE_INVISIBLE, false, true, false },
{ EXC_CHOBJTYPE_TRENDLINE, EXC_CHPROPMODE_COMMON, EXC_COLOR_CHWINDOWTEXT, EXC_CHLINEFORMAT_DOUBLE, EXC_COLOR_CHWINDOWBACK, EXC_CHFRAMETYPE_INVISIBLE, false, false, false },
@@ -656,6 +657,10 @@ const sal_Char* const sppcAreaNamesFilled[] = { "FillStyle", "Color", "Transpare
const sal_Char* const sppcGradNamesCommon[] = { "FillStyle", "FillGradientName", 0 };
/** Property names for gradient area style in filled series objects. */
const sal_Char* const sppcGradNamesFilled[] = { "FillStyle", "GradientName", 0 };
+/** Property names for hatch area style in common objects. */
+const sal_Char* const sppcHatchNamesCommon[] = { "FillStyle", "FillHatchName", "FillColor", "FillBackground", 0 };
+/** Property names for hatch area style in filled series objects. */
+const sal_Char* const sppcHatchNamesFilled[] = { "FillStyle", "HatchName", "Color", "FillBackground", 0 };
/** Property names for bitmap area style. */
const sal_Char* const sppcBitmapNames[] = { "FillStyle", "FillBitmapName", "FillBitmapMode", 0 };
@@ -677,6 +682,8 @@ XclChPropSetHelper::XclChPropSetHelper() :
maAreaHlpFilled( sppcAreaNamesFilled ),
maGradHlpCommon( sppcGradNamesCommon ),
maGradHlpFilled( sppcGradNamesFilled ),
+ maHatchHlpCommon( sppcHatchNamesCommon ),
+ maHatchHlpFilled( sppcHatchNamesFilled ),
maBitmapHlp( sppcBitmapNames ),
maRotationHlp( sppcRotationNames ),
maLegendHlp( sppcLegendNames )
@@ -785,7 +792,7 @@ bool XclChPropSetHelper::ReadAreaProperties( XclChAreaFormat& rAreaFmt,
void XclChPropSetHelper::ReadEscherProperties(
XclChEscherFormat& rEscherFmt, XclChPicFormat& rPicFmt,
- XclChObjectTable& rGradientTable, XclChObjectTable& rBitmapTable,
+ XclChObjectTable& rGradientTable, XclChObjectTable& rHatchTable, XclChObjectTable& rBitmapTable,
const ScfPropertySet& rPropSet, XclChPropertyMode ePropMode )
{
namespace cssd = ::com::sun::star::drawing;
@@ -840,6 +847,23 @@ void XclChPropSetHelper::ReadEscherProperties(
}
break;
case cssd::FillStyle_HATCH:
+ {
+ // extract hatch from global hatch table
+ OUString aHatchName;
+ bool bFillBackground;
+ ScfPropSetHelper& rHatchHlp = GetHatchHelper( ePropMode );
+ rHatchHlp.ReadFromPropertySet( rPropSet );
+ rHatchHlp >> eApiStyle >> aHatchName >> aColor >> bFillBackground;
+ cssd::Hatch aHatch;
+ if( rHatchTable.GetObject( aHatchName ) >>= aHatch )
+ {
+ // convert to Escher properties
+ rEscherFmt.mxEscherSet.reset( new EscherPropertyContainer );
+ rEscherFmt.mxEscherSet->CreateEmbeddedHatchProperties( aHatch, aColor, bFillBackground );
+ rPicFmt.mnBmpMode = EXC_CHPICFORMAT_STACK;
+ }
+ }
+ break;
case cssd::FillStyle_BITMAP:
{
// extract bitmap URL from global bitmap table
@@ -1054,7 +1078,7 @@ void XclChPropSetHelper::WriteAreaProperties( ScfPropertySet& rPropSet,
}
void XclChPropSetHelper::WriteEscherProperties( ScfPropertySet& rPropSet,
- XclChObjectTable& rGradientTable, XclChObjectTable& rBitmapTable,
+ XclChObjectTable& rGradientTable, XclChObjectTable& /*rHatchTable*/, XclChObjectTable& rBitmapTable,
const XclChEscherFormat& rEscherFmt, const XclChPicFormat& rPicFmt,
XclChPropertyMode ePropMode )
{
@@ -1253,6 +1277,17 @@ ScfPropSetHelper& XclChPropSetHelper::GetGradientHelper( XclChPropertyMode eProp
return maGradHlpCommon;
}
+ScfPropSetHelper& XclChPropSetHelper::GetHatchHelper( XclChPropertyMode ePropMode )
+{
+ switch( ePropMode )
+ {
+ case EXC_CHPROPMODE_COMMON: return maHatchHlpCommon;
+ case EXC_CHPROPMODE_FILLEDSERIES: return maHatchHlpFilled;
+ default: DBG_ERRORFILE( "XclChPropSetHelper::GetHatchHelper - unknown property mode" );
+ }
+ return maHatchHlpCommon;
+}
+
// ============================================================================
XclChRootData::XclChRootData() :
@@ -1283,6 +1318,8 @@ void XclChRootData::InitConversion( XChartDocRef xChartDoc )
xFactory, SERVICE_DRAWING_DASHTABLE, CREATE_OUSTRING( "Excel line dash " ) ) );
mxGradientTable.reset( new XclChObjectTable(
xFactory, SERVICE_DRAWING_GRADIENTTABLE, CREATE_OUSTRING( "Excel gradient " ) ) );
+ mxHatchTable.reset( new XclChObjectTable(
+ xFactory, SERVICE_DRAWING_HATCHTABLE, CREATE_OUSTRING( "Excel hatch " ) ) );
mxBitmapTable.reset( new XclChObjectTable(
xFactory, SERVICE_DRAWING_BITMAPTABLE, CREATE_OUSTRING( "Excel bitmap " ) ) );
}
@@ -1291,6 +1328,7 @@ void XclChRootData::FinishConversion()
{
// forget formatting object tables
mxBitmapTable.reset();
+ mxHatchTable.reset();
mxGradientTable.reset();
mxLineDashTable.reset();
// forget chart document reference
diff --git a/sc/source/filter/excel/xldumper.cxx b/sc/source/filter/excel/xldumper.cxx
index adcec98172b2..e69de29bb2d1 100644
--- a/sc/source/filter/excel/xldumper.cxx
+++ b/sc/source/filter/excel/xldumper.cxx
@@ -1,2801 +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: xldumper.cxx,v $
- * $Revision: 1.18 $
- *
- * 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_sc.hxx"
-#include "xldumper.hxx"
-
-#if SCF_INCL_DUMPER
-#include <sfx2/docfile.hxx>
-#include "document.hxx"
-#include "fprogressbar.hxx"
-#include "xlchart.hxx"
-#include "xlcontent.hxx"
-#include "xlescher.hxx"
-#include "xlformula.hxx"
-#include "xlname.hxx"
-#include "xlpivot.hxx"
-#include "xltable.hxx"
-#include "xistring.hxx"
-#include "xiroot.hxx"
-#include "xistream.hxx"
-
-namespace scf {
-namespace dump {
-namespace xls {
-
-const sal_Unicode SCF_DUMP_BASECLASS = 'B';
-const sal_Unicode SCF_DUMP_FUNCSEP = ',';
-const sal_Unicode SCF_DUMP_LISTSEP = ',';
-const sal_Unicode SCF_DUMP_ADDRABS = '$';
-const sal_Unicode SCF_DUMP_RANGESEP = ':';
-const sal_Unicode SCF_DUMP_TABSEP = '!';
-const sal_Unicode SCF_DUMP_ARRAY_COL = ';';
-const sal_Unicode SCF_DUMP_ARRAY_ROW = '|';
-const sal_Unicode SCF_DUMP_EMPTYVALUE = '~';
-const sal_Unicode SCF_DUMP_CMDPROMPT = '?';
-const sal_Unicode SCF_DUMP_PLACEHOLDER = '\x01';
-
-// ============================================================================
-// ============================================================================
-
-namespace {
-
-inline sal_Int32 lclReadCol( XclImpStream& rStrm, bool bCol16Bit )
-{
- return bCol16Bit ? rStrm.ReaduInt16() : rStrm.ReaduInt8();
-}
-
-inline sal_Int32 lclReadRow( XclImpStream& rStrm, bool bRow32Bit )
-{
- return bRow32Bit ? rStrm.ReadInt32() : rStrm.ReaduInt16();
-}
-
-} // namespace
-
-// ----------------------------------------------------------------------------
-
-void Address::Read( XclImpStream& rStrm, bool bCol16Bit, bool bRow32Bit )
-{
- mnRow = lclReadRow( rStrm, bRow32Bit );
- mnCol = lclReadCol( rStrm, bCol16Bit );
-}
-
-// ----------------------------------------------------------------------------
-
-void Range::Read( XclImpStream& rStrm, bool bCol16Bit, bool bRow32Bit )
-{
- maFirst.mnRow = lclReadRow( rStrm, bRow32Bit );
- maLast.mnRow = lclReadRow( rStrm, bRow32Bit );
- maFirst.mnCol = lclReadCol( rStrm, bCol16Bit );
- maLast.mnCol = lclReadCol( rStrm, bCol16Bit );
-}
-
-// ----------------------------------------------------------------------------
-
-void RangeList::Read( XclImpStream& rStrm, bool bCol16Bit, bool bRow32Bit )
-{
- sal_uInt16 nCount;
- rStrm >> nCount;
- resize( nCount );
- for( iterator aIt = begin(), aEnd = end(); rStrm.IsValid() && (aIt != aEnd); ++aIt )
- aIt->Read( rStrm, bCol16Bit, bRow32Bit );
-}
-
-// ============================================================================
-
-void StringHelper::AppendAddrCol( String& rStr, sal_Int32 nCol, bool bRel )
-{
- if( !bRel ) rStr.Append( SCF_DUMP_ADDRABS );
- xub_StrLen nPos = rStr.Len();
- for( sal_Int32 nTemp = nCol; nTemp >= 0; (nTemp /= 26) -= 1 )
- rStr.Insert( static_cast< sal_Unicode >( 'A' + (nTemp % 26) ), nPos );
-}
-
-void StringHelper::AppendAddrRow( String& rStr, sal_Int32 nRow, bool bRel )
-{
- if( !bRel ) rStr.Append( SCF_DUMP_ADDRABS );
- AppendDec( rStr, nRow + 1 );
-}
-
-void StringHelper::AppendAddrName( String& rStr, sal_Unicode cPrefix, sal_Int32 nColRow, bool bRel )
-{
- rStr.Append( cPrefix );
- bool bWriteParen = bRel && (nColRow != 0);
- if( bWriteParen ) rStr.Append( '(' );
- if( !bRel || (nColRow != 0) ) AppendDec( rStr, nColRow );
- if( bWriteParen ) rStr.Append( ')' );
-}
-
-void StringHelper::AppendAddress( String& rStr, const Address& rPos )
-{
- AppendAddrCol( rStr, rPos.mnCol, true );
- AppendAddrRow( rStr, rPos.mnRow, true );
-}
-
-void StringHelper::AppendRange( String& rStr, const Range& rRange )
-{
- AppendAddress( rStr, rRange.maFirst );
- rStr.Append( SCF_DUMP_RANGESEP );
- AppendAddress( rStr, rRange.maLast );
-}
-
-void StringHelper::AppendRangeList( String& rStr, const RangeList& rRanges )
-{
- String aData;
- for( RangeList::const_iterator aIt = rRanges.begin(), aEnd = rRanges.end(); aIt != aEnd; ++aIt )
- {
- String aRange;
- AppendRange( aRange, *aIt );
- AppendToken( aData, aRange, SCF_DUMP_LISTSEP );
- }
- rStr.Append( aData );
-}
-
-void StringHelper::AppendAddress( String& rStr, const FormulaAddress& rPos, bool bNameMode )
-{
- if( bNameMode && (rPos.mbRelCol || rPos.mbRelRow) )
- {
- AppendAddrName( rStr, 'R', rPos.mnRow, rPos.mbRelRow );
- AppendAddrName( rStr, 'C', rPos.mnCol, rPos.mbRelCol );
- }
- else
- {
- AppendAddrCol( rStr, rPos.mnCol, rPos.mbRelCol );
- AppendAddrRow( rStr, rPos.mnRow, rPos.mbRelRow );
- }
-}
-
-void StringHelper::AppendRange( String& rStr, const FormulaRange& rRange, bool bNameMode )
-{
- AppendAddress( rStr, rRange.maFirst, bNameMode );
- rStr.Append( SCF_DUMP_RANGESEP );
- AppendAddress( rStr, rRange.maLast, bNameMode );
-}
-
-// ============================================================================
-// ============================================================================
-
-class StreamInput : public Input
-{
-public:
- inline explicit StreamInput( XclImpStream& rStrm ) : mrStrm( rStrm ) {}
- virtual ~StreamInput();
-
- virtual sal_Size GetSize() const;
- virtual sal_Size Tell() const;
- virtual void Seek( sal_Size nPos );
- virtual void SeekRel( sal_sSize nRelPos );
- virtual sal_Size Read( void* pBuffer, sal_Size nSize );
- virtual void ReadLine( String& rLine, rtl_TextEncoding eEnc );
-
- virtual StreamInput& operator>>( sal_Int8& rnData );
- virtual StreamInput& operator>>( sal_uInt8& rnData );
- virtual StreamInput& operator>>( sal_Int16& rnData );
- virtual StreamInput& operator>>( sal_uInt16& rnData );
- virtual StreamInput& operator>>( sal_Int32& rnData );
- virtual StreamInput& operator>>( sal_uInt32& rnData );
- virtual StreamInput& operator>>( float& rfData );
- virtual StreamInput& operator>>( double& rfData );
-
-private:
- XclImpStream& mrStrm;
-};
-
-// ----------------------------------------------------------------------------
-
-StreamInput::~StreamInput()
-{
-}
-
-sal_Size StreamInput::GetSize() const
-{
- return mrStrm.GetRecSize();
-}
-
-sal_Size StreamInput::Tell() const
-{
- return mrStrm.GetRecPos();
-}
-
-void StreamInput::Seek( sal_Size nPos )
-{
- mrStrm.Seek( nPos );
-}
-
-void StreamInput::SeekRel( sal_sSize nRelPos )
-{
- mrStrm.Seek( mrStrm.GetRecPos() + nRelPos );
-}
-
-sal_Size StreamInput::Read( void* pBuffer, sal_Size nSize )
-{
- return mrStrm.Read( pBuffer, nSize );
-}
-
-void StreamInput::ReadLine( String& /*rLine*/, rtl_TextEncoding /*eEnc*/ )
-{
- DBG_ERRORFILE( "scf::xls::dump::StreamInput::ReadLine - not implemented" );
-}
-
-StreamInput& StreamInput::operator>>( sal_Int8& rnData ) { mrStrm >> rnData; return *this; }
-StreamInput& StreamInput::operator>>( sal_uInt8& rnData ) { mrStrm >> rnData; return *this; }
-StreamInput& StreamInput::operator>>( sal_Int16& rnData ) { mrStrm >> rnData; return *this; }
-StreamInput& StreamInput::operator>>( sal_uInt16& rnData ) { mrStrm >> rnData; return *this; }
-StreamInput& StreamInput::operator>>( sal_Int32& rnData ) { mrStrm >> rnData; return *this; }
-StreamInput& StreamInput::operator>>( sal_uInt32& rnData ) { mrStrm >> rnData; return *this; }
-StreamInput& StreamInput::operator>>( float& rfData ) { mrStrm >> rfData; return *this; }
-StreamInput& StreamInput::operator>>( double& rfData ) { mrStrm >> rfData; return *this; }
-
-// ============================================================================
-// ============================================================================
-
-RecordHeaderObject::RecordHeaderObject( const InputObjectBase& rParent )
-{
- static const RecordHeaderConfigInfo saHeaderCfgInfo =
- {
- "RECORD-NAMES",
- "show-record-pos",
- "show-record-size",
- "show-record-id",
- "show-record-name",
- "show-record-body",
- };
- RecordHeaderBase::Construct( rParent, saHeaderCfgInfo );
- if( RecordHeaderBase::ImplIsValid() )
- mbMergeContRec = Cfg().GetBoolOption( "merge-continue-record", true );
-}
-
-void RecordHeaderObject::DumpRecordHeader( XclImpStream& rStrm )
-{
- MultiItemsGuard aMultiGuard( Out() );
- WriteEmptyItem( "REC" );
- if( IsShowRecPos() ) WriteHexItem( "pos", static_cast< sal_uInt32 >( GetCoreStream().Tell() - 4 ) );
- if( IsShowRecSize() ) WriteHexItem( "size", static_cast< sal_uInt32 >( rStrm.GetRecSize() ) );
- if( IsShowRecId() ) WriteHexItem( "id", rStrm.GetRecId() );
- if( IsShowRecName() ) WriteNameItem( "name", rStrm.GetRecId(), GetRecNames() );
-}
-
-bool RecordHeaderObject::ImplIsValid() const
-{
- return RecordHeaderBase::ImplIsValid();
-}
-
-// ============================================================================
-// ============================================================================
-
-BiffConfig::BiffConfig( const Config& rParent, XclBiff eBiff ) :
- meBiff( eBiff )
-{
- Config::Construct( rParent );
-}
-
-bool BiffConfig::ImplIsValid() const
-{
- return (meBiff != EXC_BIFF_UNKNOWN) && Config::ImplIsValid();
-}
-
-NameListRef BiffConfig::ImplGetNameList( const String& rKey ) const
-{
- NameListRef xList = Config::ImplGetNameList( rKey );
- if( !xList )
- {
- String aBaseKey( rKey );
- aBaseKey.AppendAscii( "-BIFF" );
- switch( meBiff )
- {
- // fall-through intended!
- case EXC_BIFF8: if( !xList ) xList = Config::ImplGetNameList( String( aBaseKey ).Append( '8' ) );
- case EXC_BIFF5: if( !xList ) xList = Config::ImplGetNameList( String( aBaseKey ).Append( '5' ) );
- case EXC_BIFF4: if( !xList ) xList = Config::ImplGetNameList( String( aBaseKey ).Append( '4' ) );
- case EXC_BIFF3: if( !xList ) xList = Config::ImplGetNameList( String( aBaseKey ).Append( '3' ) );
- case EXC_BIFF2: if( !xList ) xList = Config::ImplGetNameList( String( aBaseKey ).Append( '2' ) );
- break;
- default: DBG_ERROR_BIFF();
- }
- }
- return xList;
-}
-
-// ============================================================================
-
-RootData::RootData( SfxMedium& rMedium, XclBiff eBiff )
-{
- if( eBiff != EXC_BIFF_UNKNOWN )
- {
- mxDoc.reset( new ScDocument );
- mxRootData.reset( new XclImpRootData(
- eBiff, rMedium, SotStorageRef(), *mxDoc, ScfTools::GetSystemTextEncoding() ) );
- mxRoot.reset( new XclImpRoot( *mxRootData ) );
- }
-}
-
-RootData::~RootData()
-{
-}
-
-rtl_TextEncoding RootData::GetTextEncoding() const
-{
- return mxRoot->GetTextEncoding();
-}
-
-void RootData::SetTextEncoding( rtl_TextEncoding eTextEnc )
-{
- mxRoot->SetTextEncoding( eTextEnc );
-}
-
-bool RootData::ImplIsValid() const
-{
- return mxRoot.is();
-}
-
-// ============================================================================
-
-RootObjectBase::RootObjectBase()
-{
-}
-
-RootObjectBase::~RootObjectBase()
-{
-}
-
-void RootObjectBase::Construct( const ObjectBase& rParent, SvStream& rStrm, XclBiff eBiff )
-{
- StreamObjectRef xStrmObj( new SvStreamObject( rParent, rStrm ) );
- WrappedStreamObject::Construct( rParent, xStrmObj );
- ConstructRootObjBase( eBiff );
-}
-
-void RootObjectBase::Construct( const OleStorageObject& rParentStrg, const String& rStrmName, XclBiff eBiff )
-{
- StreamObjectRef xStrmObj( new OleStreamObject( rParentStrg, rStrmName ) );
- WrappedStreamObject::Construct( rParentStrg, xStrmObj );
- ConstructRootObjBase( eBiff );
-}
-
-void RootObjectBase::Construct( const RootObjectBase& rParent )
-{
- *this = rParent;
-}
-
-bool RootObjectBase::ImplIsValid() const
-{
- return IsValid( mxRootData ) && IsValid( mxBiffCfg ) && mxStrm.is() && WrappedStreamObject::ImplIsValid();
-}
-
-void RootObjectBase::ImplDumpExtendedHeader()
-{
- WrappedStreamObject::ImplDumpExtendedHeader();
- WriteNameItem( "biff-version", static_cast< sal_uInt32 >( meBiff ), "BIFF" );
-}
-
-ConfigRef RootObjectBase::ImplReconstructConfig()
-{
- mxBiffCfg.reset( new BiffConfig( Cfg(), meBiff ) );
- return mxBiffCfg;
-}
-
-InputRef RootObjectBase::ImplReconstructInput()
-{
- InputRef xNewIn;
- if( mxStrm.is() )
- xNewIn.reset( new StreamInput( *mxStrm ) );
- return xNewIn;
-}
-
-String RootObjectBase::GetErrorName( sal_uInt8 nErrCode ) const
-{
- return Cfg().GetName( mxErrCodes, nErrCode );
-}
-
-// ----------------------------------------------------------------------------
-
-double RootObjectBase::WriteRkItem( const sal_Char* pcName, sal_Int32 nRk )
-{
- MultiItemsGuard aMultiGuard( Out() );
- WriteHexItem( pcName, static_cast< sal_uInt32 >( nRk ), "RK-FLAGS" );
- double fValue = XclTools::GetDoubleFromRK( nRk );
- WriteDecItem( "decoded", fValue );
- return fValue;
-}
-
-void RootObjectBase::WriteBooleanItem( const sal_Char* pcName, sal_uInt8 nBool )
-{
- WriteDecItem( pcName, nBool, mxBoolean );
-}
-
-void RootObjectBase::WriteErrorCodeItem( const sal_Char* pcName, sal_uInt8 nErrCode )
-{
- WriteHexItem( pcName, nErrCode, mxErrCodes );
-}
-
-void RootObjectBase::WriteColIndexItem( const sal_Char* pcName, sal_Int32 nCol )
-{
- ItemGuard aItem( Out(), pcName );
- Out().WriteDec( nCol );
- aItem.Cont();
- StringHelper::AppendAddrCol( Out().GetLine(), nCol, true );
-}
-
-void RootObjectBase::WriteColRangeItem( const sal_Char* pcName, sal_Int32 nCol1, sal_Int32 nCol2 )
-{
- ItemGuard aItem( Out(), pcName );
- Out().WriteDec( nCol1 );
- Out().WriteChar( SCF_DUMP_RANGESEP );
- Out().WriteDec( nCol2 );
- aItem.Cont();
- StringHelper::AppendAddrCol( Out().GetLine(), nCol1, true );
- Out().WriteChar( SCF_DUMP_RANGESEP );
- StringHelper::AppendAddrCol( Out().GetLine(), nCol2, true );
-}
-
-void RootObjectBase::WriteRowIndexItem( const sal_Char* pcName, sal_Int32 nRow )
-{
- ItemGuard aItem( Out(), pcName );
- Out().WriteDec( nRow );
- aItem.Cont();
- StringHelper::AppendAddrRow( Out().GetLine(), nRow, true );
-}
-
-void RootObjectBase::WriteRowRangeItem( const sal_Char* pcName, sal_Int32 nRow1, sal_Int32 nRow2 )
-{
- ItemGuard aItem( Out(), pcName );
- Out().WriteDec( nRow1 );
- Out().WriteChar( SCF_DUMP_RANGESEP );
- Out().WriteDec( nRow2 );
- aItem.Cont();
- StringHelper::AppendAddrRow( Out().GetLine(), nRow1, true );
- Out().WriteChar( SCF_DUMP_RANGESEP );
- StringHelper::AppendAddrRow( Out().GetLine(), nRow2, true );
-}
-
-void RootObjectBase::WriteAddressItem( const sal_Char* pcName, const Address& rPos )
-{
- ItemGuard aItem( Out(), pcName );
- StringHelper::AppendAddress( Out().GetLine(), rPos );
-}
-
-void RootObjectBase::WriteRangeItem( const sal_Char* pcName, const Range& rRange )
-{
- ItemGuard aItem( Out(), pcName );
- StringHelper::AppendRange( Out().GetLine(), rRange );
-}
-
-void RootObjectBase::WriteRangeListItem( const sal_Char* pcName, const RangeList& rRanges )
-{
- MultiItemsGuard aMultiGuard( Out() );
- WriteEmptyItem( pcName );
- WriteDecItem( "count", static_cast< sal_uInt16 >( rRanges.size() ) );
- ItemGuard aItem( Out(), "ranges" );
- StringHelper::AppendRangeList( Out().GetLine(), rRanges );
-}
-
-// ----------------------------------------------------------------------------
-
-String RootObjectBase::DumpString( const sal_Char* pcName, XclStrFlags nFlags )
-{
- XclImpString aString;
- aString.Read( GetXclStream(), nFlags );
- WriteStringItem( pcName ? pcName : "text", aString.GetText() );
- return aString.GetText();
-}
-
-double RootObjectBase::DumpRk( const sal_Char* pcName )
-{
- sal_Int32 nRk;
- *mxStrm >> nRk;
- return WriteRkItem( pcName ? pcName : "rk-value", nRk );
-}
-
-sal_uInt8 RootObjectBase::DumpBoolean( const sal_Char* pcName )
-{
- sal_uInt8 nBool;
- *mxStrm >> nBool;
- WriteBooleanItem( pcName ? pcName : "boolean", nBool );
- return nBool;
-}
-
-sal_uInt8 RootObjectBase::DumpErrorCode( const sal_Char* pcName )
-{
- sal_uInt8 nErrCode;
- *mxStrm >> nErrCode;
- WriteErrorCodeItem( pcName ? pcName : "errorcode", nErrCode );
- return nErrCode;
-}
-
-Color RootObjectBase::DumpRgbColor( const sal_Char* pcName )
-{
- sal_uInt32 nRgb = mxStrm->ReaduInt32();
- Color aColor;
- aColor.SetRed( static_cast< sal_uInt8 >( nRgb & 0xFF ) );
- aColor.SetGreen( static_cast< sal_uInt8 >( (nRgb >> 8) & 0xFF ) );
- aColor.SetBlue( static_cast< sal_uInt8 >( (nRgb >> 16) & 0xFF ) );
- aColor.SetTransparency( static_cast< sal_uInt8 >( (nRgb >> 24) & 0xFF ) );
- WriteColorItem( pcName ? pcName : "color-rgb", aColor );
- return aColor;
-}
-
-rtl_TextEncoding RootObjectBase::DumpCodePage( const sal_Char* pcName )
-{
- sal_uInt16 nCodePage = DumpDec< sal_uInt16 >( pcName ? pcName : "codepage", "CODEPAGES" );
- return XclTools::GetTextEncoding( nCodePage );
-}
-
-void RootObjectBase::DumpFormulaResult( const sal_Char* pcName )
-{
- MultiItemsGuard aMultiGuard( Out() );
- sal_uInt8 pnResult[ 8 ];
- mxStrm->Read( pnResult, 8 );
- WriteArrayItem( pcName ? pcName : "result", pnResult, 8 );
- if( (pnResult[ 6 ] == 0xFF) && (pnResult[ 7 ] == 0xFF) )
- {
- sal_uInt8 nType = pnResult[ 0 ];
- sal_uInt8 nData = pnResult[ 2 ];
- WriteHexItem( "type", nType, mxResultType );
- switch( nType )
- {
- case EXC_FORMULA_RES_BOOL: WriteBooleanItem( "value", nData ); break;
- case EXC_FORMULA_RES_ERROR: WriteErrorCodeItem( "value", nData ); break;
- }
- }
- else
- WriteDecItem( "value", SVBT64ToDouble( pnResult ) );
-}
-
-sal_Int32 RootObjectBase::DumpColIndex( const sal_Char* pcName, bool bCol16Bit )
-{
- sal_Int32 nCol = lclReadCol( *mxStrm, bCol16Bit );
- WriteColIndexItem( pcName ? pcName : "col-idx", nCol );
- return nCol;
-}
-
-sal_Int32 RootObjectBase::DumpColRange( const sal_Char* pcName, bool bCol16Bit )
-{
- sal_Int32 nCol1 = lclReadCol( *mxStrm, bCol16Bit );
- sal_Int32 nCol2 = lclReadCol( *mxStrm, bCol16Bit );
- WriteColRangeItem( pcName ? pcName : "col-range", nCol1, nCol2 );
- return nCol2 - nCol1 + 1;
-}
-
-sal_Int32 RootObjectBase::DumpRowIndex( const sal_Char* pcName, bool bRow32Bit )
-{
- sal_Int32 nRow = lclReadRow( *mxStrm, bRow32Bit );
- WriteRowIndexItem( pcName ? pcName : "row-idx", nRow );
- return nRow;
-}
-
-sal_Int32 RootObjectBase::DumpRowRange( const sal_Char* pcName, bool bRow32Bit )
-{
- sal_Int32 nRow1 = lclReadRow( *mxStrm, bRow32Bit );
- sal_Int32 nRow2 = lclReadRow( *mxStrm, bRow32Bit );
- WriteRowRangeItem( pcName ? pcName : "row-range", nRow1, nRow2 );
- return nRow2 - nRow1 + 1;
-}
-
-Address RootObjectBase::DumpAddress( const sal_Char* pcName, bool bCol16Bit, bool bRow32Bit )
-{
- Address aPos;
- aPos.Read( *mxStrm, bCol16Bit, bRow32Bit );
- WriteAddressItem( pcName ? pcName : "addr", aPos );
- return aPos;
-}
-
-Range RootObjectBase::DumpRange( const sal_Char* pcName, bool bCol16Bit, bool bRow32Bit )
-{
- Range aRange;
- aRange.Read( *mxStrm, bCol16Bit, bRow32Bit );
- WriteRangeItem( pcName ? pcName : "range", aRange );
- return aRange;
-}
-
-void RootObjectBase::DumpRangeList( const sal_Char* pcName, bool bCol16Bit, bool bRow32Bit )
-{
- RangeList aRanges;
- aRanges.Read( *mxStrm, bCol16Bit, bRow32Bit );
- WriteRangeListItem( pcName ? pcName : "range-list", aRanges );
-}
-
-void RootObjectBase::DumpConstArrayHeader( sal_uInt32& rnCols, sal_uInt32& rnRows )
-{
- MultiItemsGuard aMultiGuard( Out() );
- rnCols = DumpDec< sal_uInt8 >( "width" );
- rnRows = DumpDec< sal_uInt16 >( "height" );
- switch( GetBiff() )
- {
- case EXC_BIFF2:
- case EXC_BIFF3:
- case EXC_BIFF4:
- case EXC_BIFF5:
- if( rnCols == 0 )
- rnCols = 256;
- break;
- case EXC_BIFF8:
- ++rnCols;
- ++rnRows;
- break;
- default: DBG_ERROR_BIFF();
- }
- ItemGuard aItem( Out(), "size" );
- Out().WriteDec( rnCols );
- Out().WriteChar( 'x' );
- Out().WriteDec( rnRows );
- aItem.Cont();
- Out().WriteDec( rnCols * rnRows );
-}
-
-String RootObjectBase::DumpConstValue()
-{
- MultiItemsGuard aMultiGuard( Out() );
- String aValue;
- switch( DumpDec< sal_uInt8 >( "type", mxConstType ) )
- {
- case EXC_CACHEDVAL_EMPTY:
- DumpUnused( 8 );
- aValue.Assign( SCF_DUMP_EMPTYVALUE );
- break;
- case EXC_CACHEDVAL_DOUBLE:
- DumpDec< double >( "value" );
- aValue = Out().GetLastItemValue();
- break;
- case EXC_CACHEDVAL_STRING:
- {
- XclStrFlags nFlags = (GetBiff() <= EXC_BIFF5) ? EXC_STR_8BITLENGTH : EXC_STR_DEFAULT;
- aValue = DumpString( "value", nFlags );
- StringHelper::Enclose( aValue, '"' );
- }
- break;
- case EXC_CACHEDVAL_BOOL:
- DumpBoolean( "value" );
- aValue = Out().GetLastItemValue();
- DumpUnused( 7 );
- break;
- case EXC_CACHEDVAL_ERROR:
- DumpErrorCode( "value" );
- aValue = Out().GetLastItemValue();
- DumpUnused( 7 );
- break;
- }
- return aValue;
-}
-
-// ----------------------------------------------------------------------------
-
-void RootObjectBase::ConstructRootObjBase( XclBiff eBiff )
-{
- if( WrappedStreamObject::ImplIsValid() )
- {
- SvStream& rStrm = GetStream();
- meBiff = (eBiff == EXC_BIFF_UNKNOWN) ? XclImpStream::DetectBiffVersion( rStrm ) : eBiff;
- mxRootData.reset( new RootData( GetCoreMedium(), meBiff ) );
- if( IsValid( mxRootData ) )
- mxStrm.reset( new XclImpStream( rStrm, mxRootData->GetRoot() ) );
- ReconstructConfig();
- ReconstructInput();
- }
- if( RootObjectBase::ImplIsValid() )
- {
- const Config& rCfg = Cfg();
- mxBoolean = rCfg.GetNameList( "BOOLEAN" );
- mxErrCodes = rCfg.GetNameList( "ERRORCODES" );
- mxConstType = rCfg.GetNameList( "CONSTVALUE-TYPE" );
- mxResultType = rCfg.GetNameList( "FORMULA-RESULTTYPE" );
- }
-}
-
-// ============================================================================
-
-SimpleObjectBase::~SimpleObjectBase()
-{
-}
-
-void SimpleObjectBase::Construct( const RootObjectBase& rParent )
-{
- RootObjectBase::Construct( rParent );
-}
-
-void SimpleObjectBase::ImplDumpHeader()
-{
-}
-
-void SimpleObjectBase::ImplDumpFooter()
-{
-}
-
-// ============================================================================
-// ============================================================================
-
-FormulaStack::FormulaStack() :
- mbError( false )
-{
-}
-
-void FormulaStack::PushOperand( const StringWrapper& rOp, const String& rTokClass )
-{
- maFmlaStack.push( rOp.GetString() );
- maClassStack.push( rTokClass );
-}
-
-void FormulaStack::PushOperand( const StringWrapper& rOp )
-{
- PushOperand( rOp, String( SCF_DUMP_BASECLASS ) );
-}
-
-void FormulaStack::PushUnaryOp( const StringWrapper& rLOp, const StringWrapper& rROp )
-{
- PushUnaryOp( maFmlaStack, rLOp.GetString(), rROp.GetString() );
- PushUnaryOp( maClassStack, rLOp.GetString(), rROp.GetString() );
-}
-
-void FormulaStack::PushBinaryOp( const StringWrapper& rOp )
-{
- PushBinaryOp( maFmlaStack, rOp.GetString() );
- PushBinaryOp( maClassStack, rOp.GetString() );
-}
-
-void FormulaStack::PushFuncOp( const StringWrapper& rFunc, const String& rTokClass, sal_uInt8 nParamCount )
-{
- PushFuncOp( maFmlaStack, rFunc.GetString(), nParamCount );
- PushFuncOp( maClassStack, rTokClass, nParamCount );
-}
-
-void FormulaStack::ReplaceOnTop( const String& rOld, const String& rNew )
-{
- if( !maFmlaStack.empty() )
- maFmlaStack.top().SearchAndReplace( rOld, rNew );
-}
-
-const String& FormulaStack::GetString( const StringStack& rStack ) const
-{
- static const String saStackError = SCF_DUMP_ERRSTRING( "stack" );
- return (mbError || rStack.empty()) ? saStackError : rStack.top();
-}
-
-void FormulaStack::PushUnaryOp( StringStack& rStack, const String& rLOp, const String& rROp )
-{
- if( Check( !rStack.empty() ) )
- rStack.top().Insert( rLOp, 0 ).Append( rROp );
-}
-
-void FormulaStack::PushBinaryOp( StringStack& rStack, const String& rOp )
-{
- String aSecond;
- if( Check( !rStack.empty() ) )
- {
- aSecond = rStack.top();
- rStack.pop();
- }
- if( Check( !rStack.empty() ) )
- rStack.top().Append( rOp ).Append( aSecond );
-}
-
-void FormulaStack::PushFuncOp( StringStack& rStack, const String& rOp, sal_uInt8 nParamCount )
-{
- String aFunc;
- for( sal_uInt8 nParam = 0; (nParam < nParamCount) && Check( !rStack.empty() ); ++nParam )
- {
- StringHelper::PrependToken( aFunc, rStack.top(), SCF_DUMP_FUNCSEP );
- rStack.pop();
- }
- StringHelper::Enclose( aFunc, '(', ')' );
- aFunc.Insert( rOp, 0 );
- rStack.push( aFunc );
-}
-
-// ============================================================================
-
-FormulaObject::FormulaObject( const RootObjectBase& rParent ) :
- mpcName( 0 ),
- mnSize( 0 )
-{
- RootObjectBase::Construct( rParent );
- ConstructFmlaObj();
-}
-
-FormulaObject::~FormulaObject()
-{
-}
-
-sal_uInt16 FormulaObject::ReadFormulaSize()
-{
- return (GetBiff() == EXC_BIFF2) ? GetXclStream().ReaduInt8() : GetXclStream().ReaduInt16();
-}
-
-sal_uInt16 FormulaObject::DumpFormulaSize( const sal_Char* pcName )
-{
- if( !pcName ) pcName = "formula-size";
- sal_uInt16 nSize = ReadFormulaSize();
- WriteDecItem( pcName, nSize );
- return nSize;
-}
-
-void FormulaObject::DumpCellFormula( const sal_Char* pcName, sal_uInt16 nSize )
-{
- DumpFormula( pcName, nSize, false );
-}
-
-void FormulaObject::DumpCellFormula( const sal_Char* pcName )
-{
- DumpFormula( pcName, false );
-}
-
-void FormulaObject::DumpNameFormula( const sal_Char* pcName, sal_uInt16 nSize )
-{
- DumpFormula( pcName, nSize, true );
-}
-
-void FormulaObject::DumpNameFormula( const sal_Char* pcName )
-{
- DumpFormula( pcName, true );
-}
-
-void FormulaObject::ImplDumpHeader()
-{
- MultiItemsGuard aMultiGuard( Out() );
- WriteEmptyItem( mpcName );
- WriteDecItem( "formula-size", mnSize );
-}
-
-void FormulaObject::ImplDumpBody()
-{
- if( mnSize == 0 ) return;
-
- bool bValid = mxTokens.is();
- mxStack.reset( new FormulaStack );
- maAddData.clear();
- IndentGuard aIndGuard( Out() );
- TableGuard aTabGuard( Out(), 8, 18 );
-
- Input& rIn = In();
- sal_Size nStartPos = rIn.Tell();
- sal_Size nEndPos = ::std::min( nStartPos + mnSize, rIn.GetSize() );
- while( bValid && (rIn.Tell() < nEndPos) )
- {
- MultiItemsGuard aMultiGuard( Out() );
- WriteHexItem( 0, static_cast< sal_uInt16 >( rIn.Tell() - nStartPos ) );
- sal_uInt8 nTokenId = DumpHex< sal_uInt8 >( 0, mxTokens );
- bValid = mxTokens->HasName( nTokenId );
- if( bValid )
- {
- sal_uInt8 nTokClass = XclTokenArrayHelper::GetTokenClass( nTokenId );
- sal_uInt8 nBaseId = XclTokenArrayHelper::GetBaseTokenId( nTokenId );
- if( nTokClass == EXC_TOKCLASS_NONE )
- {
- switch( nBaseId )
- {
- case EXC_TOKID_EXP: DumpExpToken( "EXP" ); break;
- case EXC_TOKID_TBL: DumpExpToken( "TBL" ); break;
- case EXC_TOKID_ADD: DumpBinaryOpToken( "+" ); break;
- case EXC_TOKID_SUB: DumpBinaryOpToken( "-" ); break;
- case EXC_TOKID_MUL: DumpBinaryOpToken( "*" ); break;
- case EXC_TOKID_DIV: DumpBinaryOpToken( "/" ); break;
- case EXC_TOKID_POWER: DumpBinaryOpToken( "^" ); break;
- case EXC_TOKID_CONCAT: DumpBinaryOpToken( "&" ); break;
- case EXC_TOKID_LT: DumpBinaryOpToken( "<" ); break;
- case EXC_TOKID_LE: DumpBinaryOpToken( "<=" ); break;
- case EXC_TOKID_EQ: DumpBinaryOpToken( "=" ); break;
- case EXC_TOKID_GE: DumpBinaryOpToken( ">=" ); break;
- case EXC_TOKID_GT: DumpBinaryOpToken( "<" ); break;
- case EXC_TOKID_NE: DumpBinaryOpToken( "<>" ); break;
- case EXC_TOKID_ISECT: DumpBinaryOpToken( " " ); break;
- case EXC_TOKID_LIST: DumpBinaryOpToken( "," ); break;
- case EXC_TOKID_RANGE: DumpBinaryOpToken( ":" ); break;
- case EXC_TOKID_UPLUS: DumpUnaryOpToken( "+", "" ); break;
- case EXC_TOKID_UMINUS: DumpUnaryOpToken( "-", "" ); break;
- case EXC_TOKID_PERCENT: DumpUnaryOpToken( "", "%" ); break;
- case EXC_TOKID_PAREN: DumpUnaryOpToken( "(", ")" ); break;
- case EXC_TOKID_MISSARG: DumpMissArgToken(); break;
- case EXC_TOKID_STR: DumpStringToken(); break;
- case EXC_TOKID_NLR: bValid = DumpNlrToken(); break;
- case EXC_TOKID_ATTR: bValid = DumpAttrToken(); break;
- case EXC_TOKID_SHEET: DumpSheetToken(); break;
- case EXC_TOKID_ENDSHEET: DumpEndSheetToken(); break;
- case EXC_TOKID_ERR: DumpErrorToken(); break;
- case EXC_TOKID_BOOL: DumpBoolToken(); break;
- case EXC_TOKID_INT: DumpIntToken(); break;
- case EXC_TOKID_NUM: DumpDoubleToken(); break;
- }
- }
- else
- {
- String aTokClass = Cfg().GetName( mxClasses, nTokClass );
- switch( nBaseId )
- {
- case EXC_TOKID_ARRAY: DumpArrayToken( aTokClass ); break;
- case EXC_TOKID_FUNC: DumpFuncToken( aTokClass ); break;
- case EXC_TOKID_FUNCVAR: DumpFuncVarToken( aTokClass ); break;
- case EXC_TOKID_NAME: DumpNameToken( aTokClass ); break;
- case EXC_TOKID_REF: DumpRefToken( aTokClass, false ); break;
- case EXC_TOKID_AREA: DumpAreaToken( aTokClass, false ); break;
- case EXC_TOKID_MEMAREA: DumpMemAreaToken( aTokClass, true ); break;
- case EXC_TOKID_MEMERR: DumpMemAreaToken( aTokClass, false ); break;
- case EXC_TOKID_MEMNOMEM: DumpMemAreaToken( aTokClass, false ); break;
- case EXC_TOKID_MEMFUNC: DumpMemFuncToken( aTokClass ); break;
- case EXC_TOKID_REFERR: DumpRefErrToken( aTokClass, false ); break;
- case EXC_TOKID_AREAERR: DumpRefErrToken( aTokClass, true ); break;
- case EXC_TOKID_REFN: DumpRefToken( aTokClass, true ); break;
- case EXC_TOKID_AREAN: DumpAreaToken( aTokClass, true ); break;
- case EXC_TOKID_MEMAREAN: DumpMemFuncToken( aTokClass ); break;
- case EXC_TOKID_MEMNOMEMN: DumpMemFuncToken( aTokClass ); break;
- case EXC_TOKID_FUNCCE: DumpCmdToken( aTokClass ); break;
- case EXC_TOKID_NAMEX: DumpNameXToken( aTokClass ); break;
- case EXC_TOKID_REF3D: DumpRef3dToken( aTokClass, mbNameMode ); break;
- case EXC_TOKID_AREA3D: DumpArea3dToken( aTokClass, mbNameMode ); break;
- case EXC_TOKID_REFERR3D: DumpRefErr3dToken( aTokClass, false ); break;
- case EXC_TOKID_AREAERR3D: DumpRefErr3dToken( aTokClass, true ); break;
- }
- }
- }
- }
- bValid = nEndPos == rIn.Tell();
- if( bValid )
- {
- DumpAddTokenData();
- WriteInfoItem( "formula", mxStack->GetFormulaString() );
- WriteInfoItem( "classes", mxStack->GetClassesString() );
- }
- else
- DumpBinary( SCF_DUMP_ERRASCII( "formula-error" ), nEndPos - rIn.Tell(), false );
-
- mpcName = 0;
- mnSize = 0;
-}
-
-void FormulaObject::DumpFormula( const sal_Char* pcName, sal_uInt16 nSize, bool bNameMode )
-{
- mpcName = pcName ? pcName : "formula";
- mnSize = nSize;
- mbNameMode = bNameMode;
- Dump();
-}
-
-void FormulaObject::DumpFormula( const sal_Char* pcName, bool bNameMode )
-{
- DumpFormula( pcName, ReadFormulaSize(), bNameMode );
-}
-
-// private --------------------------------------------------------------------
-
-void FormulaObject::ConstructFmlaObj()
-{
- if( RootObjectBase::ImplIsValid() )
- {
- mxFuncProv.reset( new XclFunctionProvider( GetXclRoot() ) );
-
- Config& rCfg = Cfg();
- mxClasses = rCfg.GetNameList( "TOKENCLASSES" );
- mxFuncNames = rCfg.GetNameList( "FUNCTIONNAMES" );
- mxParamCnt = rCfg.GetNameList( "PARAMCOUNT" );
- mxRelFlags = rCfg.GetNameList( "REFRELFLAGS" );
- mxNlrTypes = rCfg.GetNameList( "NLRTYPES" );
- mxAttrTypes = rCfg.GetNameList( "ATTRTYPES" );
- mxSpTypes = rCfg.GetNameList( "ATTRSPACETYPES" );
-
- // create classified token names
- mxTokens = rCfg.CreateNameList< ConstList >( "TOKENS" );
- mxTokens->IncludeList( rCfg.GetNameList( "BASETOKENS" ) );
-
- NameListRef xClassTokens = rCfg.GetNameList( "CLASSTOKENS" );
- if( mxClasses.is() && xClassTokens.is() )
- for( NameListBase::const_iterator aCIt = mxClasses->begin(), aCEnd = mxClasses->end(); aCIt != aCEnd; ++aCIt )
- for( NameListBase::const_iterator aTIt = xClassTokens->begin(), aTEnd = xClassTokens->end(); aTIt != aTEnd; ++aTIt )
- mxTokens->SetName( aCIt->first | aTIt->first, String( aTIt->second ).Append( aCIt->second ) );
- }
-}
-
-// ----------------------------------------------------------------------------
-
-namespace {
-
-String lclCreateName( const String& rRef, sal_uInt16 nNameIdx )
-{
- String aName = rRef;
- StringHelper::AppendIndexedText( aName, CREATE_STRING( "NAME" ), nNameIdx );
- return aName;
-}
-
-String lclCreateNlr( const String& rData, bool bRel = true )
-{
- String aNlr;
- if( !bRel ) aNlr.Append( SCF_DUMP_ADDRABS );
- StringHelper::AppendIndexedText( aNlr, CREATE_STRING( "NLR" ), rData );
- return aNlr;
-}
-
-String lclCreateNlr( const FormulaAddress& rPos )
-{
- String aAddr;
- StringHelper::AppendAddrCol( aAddr, rPos.mnCol, true );
- StringHelper::AppendAddrRow( aAddr, rPos.mnRow, true );
- return lclCreateNlr( aAddr, rPos.mbRelRow );
-}
-
-} // namespace
-
-// ----------------------------------------------------------------------------
-
-FormulaAddress FormulaObject::CreateTokenAddress( sal_uInt16 nCol, sal_uInt16 nRow, bool bRelC, bool bRelR, bool bNameMode ) const
-{
- FormulaAddress aPos;
- aPos.mnCol = nCol;
- if( bRelC && bNameMode ) aPos.mnCol -= 0x80;
- aPos.mbRelCol = bRelC;
- aPos.mnRow = nRow;
- if( bRelR && bNameMode ) aPos.mnRow -= ((GetBiff() <= EXC_BIFF5) ? 0x2000 : 0x8000);
- aPos.mbRelRow = bRelR;
- return aPos;
-}
-
-String FormulaObject::CreateFunc( sal_uInt16 nFuncIdx ) const
-{
- String aFunc;
- if( Cfg().HasName( mxFuncNames, nFuncIdx ) )
- aFunc = Cfg().GetName( mxFuncNames, nFuncIdx );
- else
- {
- bool bCmd = ::get_flag( nFuncIdx, EXC_TOK_FUNCVAR_CMD );
- aFunc = String::CreateFromAscii( bCmd ? "CMD" : "FUNC" );
- StringHelper::AppendIndex( aFunc, nFuncIdx & EXC_TOK_FUNCVAR_INDEXMASK );
- }
- return aFunc;
-}
-
-String FormulaObject::CreateRef( const String& rData ) const
-{
- return String( maRefPrefix ).Append( rData );
-}
-
-String FormulaObject::CreateName( sal_uInt16 nNameIdx ) const
-{
- return lclCreateName( maRefPrefix, nNameIdx );
-}
-
-String FormulaObject::CreatePlaceHolder( size_t nIdx ) const
-{
- String aStr;
- StringHelper::AppendDec( aStr, static_cast< sal_uInt32 >( nIdx ) );
- StringHelper::Enclose( aStr, SCF_DUMP_PLACEHOLDER );
- return aStr;
-}
-
-String FormulaObject::CreatePlaceHolder() const
-{
- return CreatePlaceHolder( maAddData.size() );
-}
-
-void FormulaObject::WriteTokenAddressItem( const sal_Char* pcName, const FormulaAddress& rPos, bool bNameMode )
-{
- ItemGuard aItem( Out(), pcName );
- StringHelper::AppendAddress( Out().GetLine(), rPos, bNameMode );
-}
-
-void FormulaObject::WriteTokenAddress3dItem( const sal_Char* pcName, const String& rRef, const FormulaAddress& rPos, bool bNameMode )
-{
- ItemGuard aItem( Out(), pcName );
- Out().WriteString( rRef );
- StringHelper::AppendAddress( Out().GetLine(), rPos, bNameMode );
-}
-
-void FormulaObject::WriteTokenRangeItem( const sal_Char* pcName, const FormulaRange& rRange, bool bNameMode )
-{
- ItemGuard aItem( Out(), pcName );
- StringHelper::AppendRange( Out().GetLine(), rRange, bNameMode );
-}
-
-void FormulaObject::WriteTokenRange3dItem( const sal_Char* pcName, const String& rRef, const FormulaRange& rRange, bool bNameMode )
-{
- ItemGuard aItem( Out(), pcName );
- Out().WriteString( rRef );
- StringHelper::AppendRange( Out().GetLine(), rRange, bNameMode );
-}
-
-sal_uInt16 FormulaObject::DumpTokenFuncIdx()
-{
- return DumpDec< sal_uInt16, sal_uInt8 >( GetBiff() >= EXC_BIFF4, "func-idx", mxFuncNames );
-}
-
-sal_uInt16 FormulaObject::DumpTokenCol( const sal_Char* pcName, bool& rbRelC, bool& rbRelR )
-{
- sal_uInt16 nCol = 0;
- if( GetBiff() <= EXC_BIFF5 )
- nCol = DumpDec< sal_uInt8 >( pcName );
- else
- {
- nCol = DumpHex< sal_uInt16 >( pcName, mxRelFlags );
- rbRelC = ::get_flag( nCol, EXC_TOK_REF_COLREL );
- rbRelR = ::get_flag( nCol, EXC_TOK_REF_ROWREL );
- nCol &= 0x00FF;
- }
- return nCol;
-}
-
-sal_uInt16 FormulaObject::DumpTokenRow( const sal_Char* pcName, bool& rbRelC, bool& rbRelR )
-{
- sal_uInt16 nRow = 0;
- if( GetBiff() <= EXC_BIFF5 )
- {
- nRow = DumpHex< sal_uInt16 >( pcName, mxRelFlags );
- rbRelC = ::get_flag( nRow, EXC_TOK_REF_COLREL );
- rbRelR = ::get_flag( nRow, EXC_TOK_REF_ROWREL );
- nRow &= 0x3FFF;
- }
- else
- nRow = DumpDec< sal_uInt16 >( pcName );
- return nRow;
-}
-
-FormulaAddress FormulaObject::DumpTokenAddress( bool bNameMode )
-{
- bool bRelC = false;
- bool bRelR = false;
- sal_uInt16 nRow = DumpTokenRow( "row", bRelC, bRelR );
- sal_uInt16 nCol = DumpTokenCol( "col", bRelC, bRelR );
- return CreateTokenAddress( nCol, nRow, bRelC, bRelR, bNameMode );
-}
-
-FormulaRange FormulaObject::DumpTokenRange( bool bNameMode )
-{
- bool bRelC1 = false;
- bool bRelR1 = false;
- bool bRelC2 = false;
- bool bRelR2 = false;
- sal_uInt16 nRow1 = DumpTokenRow( "row1", bRelC1, bRelR1 );
- sal_uInt16 nRow2 = DumpTokenRow( "row2", bRelC2, bRelR2 );
- sal_uInt16 nCol1 = DumpTokenCol( "col1", bRelC1, bRelR1 );
- sal_uInt16 nCol2 = DumpTokenCol( "col2", bRelC2, bRelR2 );
- FormulaRange aRange;
- aRange.maFirst = CreateTokenAddress( nCol1, nRow1, bRelC1, bRelR1, bNameMode );
- aRange.maLast = CreateTokenAddress( nCol2, nRow2, bRelC2, bRelR2, bNameMode );
- return aRange;
-}
-
-String FormulaObject::DumpTokenRefIdx()
-{
- sal_Int16 nRefIdx = DumpDec< sal_Int16 >( "ref-idx" );
- switch( GetBiff() )
- {
- case EXC_BIFF2: DumpUnused( 1 ); break;
- case EXC_BIFF3: DumpUnused( 2 ); break;
- case EXC_BIFF4: DumpUnused( 2 ); break;
- case EXC_BIFF5: DumpUnused( 8 ); break;
- case EXC_BIFF8: break;
- default: DBG_ERROR_BIFF();
- }
- String aRef = CREATE_STRING( "REF" );
- StringHelper::AppendIndex( aRef, nRefIdx );
- aRef.Append( SCF_DUMP_TABSEP );
- return aRef;
-}
-
-void FormulaObject::DumpTokenRefTabIdxs()
-{
- if( GetBiff() <= EXC_BIFF5 )
- {
- DumpDec< sal_Int16 >( "tab1" );
- DumpDec< sal_Int16 >( "tab2" );
- }
-}
-
-void FormulaObject::DumpIntToken()
-{
- DumpDec< sal_uInt16 >( "value" );
- mxStack->PushOperand( Out().GetLastItemValue() );
-}
-
-void FormulaObject::DumpDoubleToken()
-{
- DumpDec< double >( "value" );
- mxStack->PushOperand( Out().GetLastItemValue() );
-}
-
-void FormulaObject::DumpStringToken()
-{
- String aValue = DumpString( "value", EXC_STR_8BITLENGTH );
- StringHelper::Enclose( aValue, '"' );
- mxStack->PushOperand( aValue );
-}
-
-void FormulaObject::DumpBoolToken()
-{
- DumpBoolean( "value" );
- mxStack->PushOperand( Out().GetLastItemValue() );
-}
-
-void FormulaObject::DumpErrorToken()
-{
- DumpErrorCode( "value" );
- mxStack->PushOperand( Out().GetLastItemValue() );
-}
-
-void FormulaObject::DumpMissArgToken()
-{
- mxStack->PushOperand( String( SCF_DUMP_EMPTYVALUE ) );
-}
-
-void FormulaObject::DumpArrayToken( const String& rTokClass )
-{
- DumpUnused( (GetBiff() == EXC_BIFF2) ? 6 : 7 );
- mxStack->PushOperand( CreatePlaceHolder(), rTokClass );
- maAddData.push_back( ADDDATA_ARRAY );
-}
-
-void FormulaObject::DumpNameToken( const String& rTokClass )
-{
- sal_uInt16 nNameIdx = DumpDec< sal_uInt16 >( "name-idx" );
- switch( GetBiff() )
- {
- case EXC_BIFF2: DumpUnused( 5 ); break;
- case EXC_BIFF3:
- case EXC_BIFF4: DumpUnused( 8 ); break;
- case EXC_BIFF5: DumpUnused( 12 ); break;
- case EXC_BIFF8: DumpUnused( 2 ); break;
- default: DBG_ERROR_BIFF();
- }
- mxStack->PushOperand( CreateName( nNameIdx ), rTokClass );
-}
-
-void FormulaObject::DumpNameXToken( const String& rTokClass )
-{
- String aRef = DumpTokenRefIdx();
- sal_uInt16 nNameIdx = DumpDec< sal_uInt16 >( "name-idx" );
- DumpUnused( (GetBiff() <= EXC_BIFF5) ? 12 : 2 );
- mxStack->PushOperand( lclCreateName( aRef, nNameIdx ), rTokClass );
-}
-
-void FormulaObject::DumpRefToken( const String& rTokClass, bool bNameMode )
-{
- FormulaAddress aPos = DumpTokenAddress( bNameMode );
- WriteTokenAddressItem( "addr", aPos, bNameMode );
- mxStack->PushOperand( CreateRef( Out().GetLastItemValue() ), rTokClass );
-}
-
-void FormulaObject::DumpAreaToken( const String& rTokClass, bool bNameMode )
-{
- FormulaRange aRange = DumpTokenRange( bNameMode );
- WriteTokenRangeItem( "range", aRange, bNameMode );
- mxStack->PushOperand( CreateRef( Out().GetLastItemValue() ), rTokClass );
-}
-
-void FormulaObject::DumpRefErrToken( const String& rTokClass, bool bArea )
-{
- DumpUnused( ((GetBiff() <= EXC_BIFF5) ? 3 : 4) * (bArea ? 2 : 1) );
- mxStack->PushOperand( CreateRef( GetErrorName( EXC_ERR_REF ) ), rTokClass );
-}
-
-void FormulaObject::DumpRef3dToken( const String& rTokClass, bool bNameMode )
-{
- String aRef = DumpTokenRefIdx();
- DumpTokenRefTabIdxs();
- FormulaAddress aPos = DumpTokenAddress( bNameMode );
- WriteTokenAddress3dItem( "addr", aRef, aPos, bNameMode );
- mxStack->PushOperand( Out().GetLastItemValue(), rTokClass );
-}
-
-void FormulaObject::DumpArea3dToken( const String& rTokClass, bool bNameMode )
-{
- String aRef = DumpTokenRefIdx();
- DumpTokenRefTabIdxs();
- FormulaRange aRange = DumpTokenRange( bNameMode );
- WriteTokenRange3dItem( "range", aRef, aRange, bNameMode );
- mxStack->PushOperand( Out().GetLastItemValue(), rTokClass );
-}
-
-void FormulaObject::DumpRefErr3dToken( const String& rTokClass, bool bArea )
-{
- String aRef = DumpTokenRefIdx();
- DumpTokenRefTabIdxs();
- DumpUnused( ((GetBiff() <= EXC_BIFF5) ? 3 : 4) * (bArea ? 2 : 1) );
- aRef.Append( GetErrorName( EXC_ERR_REF ) );
- mxStack->PushOperand( aRef, rTokClass );
-}
-
-void FormulaObject::DumpMemFuncToken( const String& /*rTokClass*/ )
-{
- DumpDec< sal_uInt16, sal_uInt8 >( GetBiff() >= EXC_BIFF3, "size" );
-}
-
-void FormulaObject::DumpMemAreaToken( const String& rTokClass, bool bAddData )
-{
- DumpUnused( (GetBiff() == EXC_BIFF2) ? 3 : 4 );
- DumpMemFuncToken( rTokClass );
- if( bAddData )
- maAddData.push_back( ADDDATA_MEMAREA );
-}
-
-void FormulaObject::DumpExpToken( const StringWrapper& rName )
-{
- Address aPos;
- aPos.mnRow = DumpDec< sal_uInt16 >( "row" );
- aPos.mnCol = DumpDec< sal_uInt16, sal_uInt8 >( GetBiff() >= EXC_BIFF3, "col" );
- WriteAddressItem( "base-addr", aPos );
- String aOp = rName.GetString();
- StringHelper::AppendIndex( aOp, Out().GetLastItemValue() );
- mxStack->PushOperand( aOp );
-}
-
-void FormulaObject::DumpUnaryOpToken( const StringWrapper& rLOp, const StringWrapper& rROp )
-{
- mxStack->PushUnaryOp( rLOp, rROp );
-}
-
-void FormulaObject::DumpBinaryOpToken( const StringWrapper& rOp )
-{
- mxStack->PushBinaryOp( rOp );
-}
-
-void FormulaObject::DumpFuncToken( const String& rTokClass )
-{
- sal_uInt16 nFuncIdx = DumpTokenFuncIdx();
- String aFuncName = CreateFunc( nFuncIdx );
- if( const XclFunctionInfo* pFuncInfo = mxFuncProv->GetFuncInfoFromXclFunc( nFuncIdx ) )
- mxStack->PushFuncOp( aFuncName, rTokClass, pFuncInfo->mnMinParamCount );
- else
- mxStack->SetError();
-}
-
-void FormulaObject::DumpFuncVarToken( const String& rTokClass )
-{
- sal_uInt8 nParamCount = DumpDec< sal_uInt8 >( "param-count", mxParamCnt );
- bool bPrompt = ::get_flag( nParamCount, EXC_TOK_FUNCVAR_PROMPT );
- nParamCount &= EXC_TOK_FUNCVAR_COUNTMASK;
- sal_uInt16 nFuncIdx = DumpTokenFuncIdx();
- String aFuncName = CreateFunc( nFuncIdx );
- if( bPrompt ) aFuncName.Append( SCF_DUMP_CMDPROMPT );
- mxStack->PushFuncOp( aFuncName, rTokClass, nParamCount );
-}
-
-void FormulaObject::DumpCmdToken( const String& rTokClass )
-{
- sal_uInt8 nParamCount = DumpDec< sal_uInt8 >( "param-count" );
- sal_uInt16 nCmdIdx = DumpTokenFuncIdx() | EXC_TOK_FUNCVAR_CMD;
- mxStack->PushFuncOp( CreateFunc( nCmdIdx ), rTokClass, nParamCount );
-}
-
-void FormulaObject::DumpSheetToken()
-{
- DumpUnused( (GetBiff() == EXC_BIFF2) ? 4 : 6 );
- maRefPrefix = DumpTokenRefIdx();
-}
-
-void FormulaObject::DumpEndSheetToken()
-{
- DumpUnused( (GetBiff() == EXC_BIFF2) ? 3 : 4 );
- maRefPrefix.Erase();
-}
-
-bool FormulaObject::DumpAttrToken()
-{
- bool bValid = true;
- bool bBiff3 = GetBiff() >= EXC_BIFF3;
- sal_uInt8 nType = DumpHex< sal_uInt8 >( "type", mxAttrTypes );
- switch( nType )
- {
- case EXC_TOK_ATTR_VOLATILE:
- DumpUnused( bBiff3 ? 2 : 1 );
- break;
- case EXC_TOK_ATTR_IF:
- DumpDec< sal_uInt16, sal_uInt8 >( bBiff3, "skip" );
- break;
- case EXC_TOK_ATTR_CHOOSE:
- {
- sal_uInt16 nCount = DumpDec< sal_uInt16, sal_uInt8 >( bBiff3, "choices" );
- Out().ResetItemIndex();
- for( sal_uInt16 nIdx = 0; nIdx < nCount; ++nIdx )
- DumpDec< sal_uInt16, sal_uInt8 >( bBiff3, "#skip" );
- DumpDec< sal_uInt16, sal_uInt8 >( bBiff3, "skip-err" );
- }
- break;
- case EXC_TOK_ATTR_GOTO:
- DumpDec< sal_uInt16, sal_uInt8 >( bBiff3, "skip" );
- break;
- case EXC_TOK_ATTR_SUM:
- DumpUnused( bBiff3 ? 2 : 1 );
- mxStack->PushFuncOp( CREATE_STRING( "SUM" ), String( SCF_DUMP_BASECLASS ), 1 );
- break;
- case EXC_TOK_ATTR_ASSIGN:
- DumpUnused( bBiff3 ? 2 : 1 );
- break;
- case EXC_TOK_ATTR_SPACE:
- case EXC_TOK_ATTR_SPACE | EXC_TOK_ATTR_VOLATILE:
- switch( GetBiff() )
- {
- case EXC_BIFF3:
- DumpDec< sal_uInt16 >( "leading-spaces" );
- break;
- case EXC_BIFF4:
- case EXC_BIFF5:
- case EXC_BIFF8:
- DumpDec< sal_uInt8 >( "char-type", mxSpTypes );
- DumpDec< sal_uInt8 >( "char-count" );
- break;
- default:
- DBG_ERROR_BIFF();
- bValid = false;
- }
- break;
- default:
- bValid = false;
- }
- return bValid;
-}
-
-bool FormulaObject::DumpNlrToken()
-{
- const String aRefClass = Cfg().GetName( mxClasses, EXC_TOKCLASS_REF );
- const String aValClass = Cfg().GetName( mxClasses, EXC_TOKCLASS_VAL );
-
- bool bValid = true;
- sal_uInt8 nType = DumpHex< sal_uInt8 >( "type", mxNlrTypes );
- switch( nType )
- {
- case EXC_TOK_NLR_ERR: DumpNlrErrToken(); break;
- case EXC_TOK_NLR_ROWR: DumpNlrColRowToken( aRefClass, false ); break;
- case EXC_TOK_NLR_COLR: DumpNlrColRowToken( aRefClass, false ); break;
- case EXC_TOK_NLR_ROWV: DumpNlrColRowToken( aValClass, false ); break;
- case EXC_TOK_NLR_COLV: DumpNlrColRowToken( aValClass, false ); break;
- case EXC_TOK_NLR_RANGE: DumpNlrRangeToken( aRefClass, false ); break;
- case EXC_TOK_NLR_SRANGE: DumpNlrRangeToken( aRefClass, true ); break;
- case EXC_TOK_NLR_SROWR: DumpNlrColRowToken( aRefClass, true ); break;
- case EXC_TOK_NLR_SCOLR: DumpNlrColRowToken( aRefClass, true ); break;
- case EXC_TOK_NLR_SROWV: DumpNlrColRowToken( aValClass, true ); break;
- case EXC_TOK_NLR_SCOLV: DumpNlrColRowToken( aValClass, true ); break;
- case EXC_TOK_NLR_RANGEERR: DumpNlrRangeErrToken(); break;
- default: bValid = false;
- }
- return bValid;
-}
-
-void FormulaObject::DumpNlrErrToken()
-{
- DumpDec< sal_uInt32 >( "delname-idx" );
- mxStack->PushOperand( lclCreateNlr( GetErrorName( EXC_ERR_NAME ) ) );
-}
-
-void FormulaObject::DumpNlrColRowToken( const String& rTokClass, bool bAddData )
-{
- if( bAddData )
- {
- DumpUnused( 4 );
- mxStack->PushOperand( CreatePlaceHolder(), rTokClass );
- maAddData.push_back( ADDDATA_NLR );
- }
- else
- {
- FormulaAddress aPos = DumpTokenAddress( false );
- WriteInfoItem( "addr", lclCreateNlr( aPos ) );
- mxStack->PushOperand( Out().GetLastItemValue(), rTokClass );
- }
-}
-
-void FormulaObject::DumpNlrRangeToken( const String& rTokClass, bool bAddData )
-{
- if( bAddData )
- {
- DumpUnused( 4 );
- mxStack->PushOperand( CreatePlaceHolder(), rTokClass );
- maAddData.push_back( ADDDATA_NLR );
- }
- else
- {
- FormulaAddress aPos = DumpTokenAddress( false );
- WriteInfoItem( "addr", lclCreateNlr( aPos ) );
- mxStack->PushOperand( Out().GetLastItemValue(), rTokClass );
- }
- DumpUnknown( 1 );
- DumpRange( "target-range" );
-}
-
-void FormulaObject::DumpNlrRangeErrToken()
-{
- DumpDec< sal_uInt32 >( "delname-idx" );
- DumpUnused( 9 );
- mxStack->PushOperand( lclCreateNlr( GetErrorName( EXC_ERR_NAME ) ) );
-}
-
-void FormulaObject::DumpAddTokenData()
-{
- Output& rOut = Out();
- rOut.ResetItemIndex();
- for( AddDataTypeVec::const_iterator aIt = maAddData.begin(), aEnd = maAddData.end(); aIt != aEnd; ++aIt )
- {
- AddDataType eType = *aIt;
-
- {
- ItemGuard aItem( rOut, "#add-data" );
- switch( eType )
- {
- case ADDDATA_NLR: rOut.WriteAscii( "tNlr" ); break;
- case ADDDATA_ARRAY: rOut.WriteAscii( "tArray" ); break;
- case ADDDATA_MEMAREA: rOut.WriteAscii( "tMemArea" ); break;
- }
- }
-
- size_t nIdx = aIt - maAddData.begin();
- IndentGuard aIndGuard( rOut );
- switch( eType )
- {
- case ADDDATA_NLR: DumpAddDataNlr( nIdx ); break;
- case ADDDATA_ARRAY: DumpAddDataArray( nIdx ); break;
- case ADDDATA_MEMAREA: DumpAddDataMemArea( nIdx ); break;
- }
- }
-}
-
-void FormulaObject::DumpAddDataNlr( size_t nIdx )
-{
- sal_uInt32 nFlags = DumpHex< sal_uInt32 >( "flags", "NLRADDFLAGS" );
- sal_uInt32 nCount = nFlags & EXC_TOK_NLR_ADDMASK;
- String aAddrList;
- for( sal_uInt32 nPos = 0; nPos < nCount; ++nPos )
- {
- Address aPos;
- aPos.Read( GetXclStream() );
- String aAddr;
- StringHelper::AppendAddress( aAddr, aPos );
- StringHelper::AppendToken( aAddrList, aAddr, SCF_DUMP_LISTSEP );
- }
- WriteInfoItem( "stacked-positions", aAddrList );
- mxStack->ReplaceOnTop( CreatePlaceHolder( nIdx ), lclCreateNlr( aAddrList ) );
-}
-
-void FormulaObject::DumpAddDataArray( size_t nIdx )
-{
- sal_uInt32 nCols, nRows;
- DumpConstArrayHeader( nCols, nRows );
-
- String aOp;
- TableGuard aTabGuard( Out(), 17 );
- for( sal_uInt32 nRow = 0; nRow < nRows; ++nRow )
- {
- String aArrayLine;
- for( sal_uInt32 nCol = 0; nCol < nCols; ++nCol )
- StringHelper::AppendToken( aArrayLine, DumpConstValue(), SCF_DUMP_ARRAY_COL );
- StringHelper::AppendToken( aOp, aArrayLine, SCF_DUMP_ARRAY_ROW );
- }
- StringHelper::Enclose( aOp, '{', '}' );
- mxStack->ReplaceOnTop( CreatePlaceHolder( nIdx ), aOp );
-}
-
-void FormulaObject::DumpAddDataMemArea( size_t /*nIdx*/ )
-{
- DumpRangeList( 0, GetBiff() == EXC_BIFF8 );
-}
-
-// ============================================================================
-// ============================================================================
-
-RecordStreamObject::RecordStreamObject( const ObjectBase& rParent, SvStream& rStrm, XclBiff eBiff )
-{
- Construct( rParent, rStrm, eBiff );
-}
-
-RecordStreamObject::RecordStreamObject( const OleStorageObject& rParentStrg, const String& rStrmName, XclBiff eBiff )
-{
- Construct( rParentStrg, rStrmName, eBiff );
-}
-
-RecordStreamObject::~RecordStreamObject()
-{
-}
-
-void RecordStreamObject::Construct( const ObjectBase& rParent, SvStream& rStrm, XclBiff eBiff )
-{
- RootObjectBase::Construct( rParent, rStrm, eBiff );
- ConstructRecStrmObj();
-}
-
-void RecordStreamObject::Construct( const OleStorageObject& rParentStrg, const String& rStrmName, XclBiff eBiff )
-{
- RootObjectBase::Construct( rParentStrg, rStrmName, eBiff );
- ConstructRecStrmObj();
-}
-
-bool RecordStreamObject::ImplIsValid() const
-{
- return IsValid( mxHdrObj ) && IsValid( mxFmlaObj ) && IsValid( mxDffObj ) && RootObjectBase::ImplIsValid();
-}
-
-void RecordStreamObject::ImplDumpBody()
-{
- XclImpStream& rStrm = GetXclStream();
-
- ScfProgressBar aProgress( Core().GetDocShell(), maProgressName );
- sal_Int32 nSegId = aProgress.AddSegment( rStrm.GetSvStreamSize() );
- aProgress.ActivateSegment( nSegId );
-
- while( rStrm.StartNextRecord() )
- {
- aProgress.ProgressAbs( rStrm.GetSvStreamPos() );
-
- // record header
- rStrm.ResetRecord( mxHdrObj->IsMergeContRec() );
- ImplPreProcessRecord();
- mxHdrObj->DumpRecordHeader( rStrm );
-
- // record contents
- if( mxHdrObj->IsShowRecBody() )
- {
- IndentGuard aIndGuard( Out() );
- if( mxHdrObj->HasRecName( rStrm.GetRecId() ) )
- DumpRecordBody();
- else
- DumpRawBinary( rStrm.GetRecSize(), false );
- }
- if( !rStrm.IsValid() )
- WriteInfoItem( "stream-state", SCF_DUMP_ERR_STREAM );
-
- // postprocessing
- ImplPostProcessRecord();
- Out().EmptyLine();
- }
-}
-
-void RecordStreamObject::ImplPreProcessRecord()
-{
-}
-
-void RecordStreamObject::ImplDumpRecord()
-{
-}
-
-void RecordStreamObject::ImplPostProcessRecord()
-{
-}
-
-void RecordStreamObject::DumpRepeatedRecordId()
-{
- DumpHex< sal_uInt16 >( "repeated-rec-id", mxHdrObj->GetRecNames() );
- DumpUnused( 2 );
-}
-
-void RecordStreamObject::ConstructRecStrmObj()
-{
- if( RootObjectBase::ImplIsValid() )
- {
- mxHdrObj.reset( new RecordHeaderObject( *this ) );
- mxFmlaObj.reset( new FormulaObject( *this ) );
- mxDffObj.reset( new DffDumpObject( *this ) );
- }
-
- if( IsValid() )
- {
- maProgressName.AssignAscii( "Dumping stream '" ).Append( GetFullName() ).AppendAscii( "'." );
- mxSimpleRecs = Cfg().GetNameList( "SIMPLE-RECORDS" );
- }
-}
-
-void RecordStreamObject::DumpRecordBody()
-{
- XclImpStream& rStrm = GetXclStream();
- sal_uInt16 nRecId = rStrm.GetRecId();
- if( Cfg().HasName( mxSimpleRecs, nRecId ) )
- DumpSimpleRecord( Cfg().GetName( mxSimpleRecs, nRecId ) );
- else
- ImplDumpRecord();
- // remaining undumped data
- if( rStrm.GetRecPos() == 0 )
- DumpRawBinary( rStrm.GetRecSize(), false );
- else
- DumpRemaining( rStrm.GetRecLeft() );
-}
-
-void RecordStreamObject::DumpSimpleRecord( const String& rRecData )
-{
- ItemFormat aItemFmt;
- aItemFmt.Parse( rRecData );
- DumpItem( aItemFmt );
-}
-
-// ============================================================================
-
-WorkbookStreamObject::WorkbookStreamObject( const ObjectBase& rParent, SvStream& rStrm )
-{
- RecordStreamObject::Construct( rParent, rStrm, EXC_BIFF_UNKNOWN );
- ConstructWbStrmObj();
-}
-
-WorkbookStreamObject::WorkbookStreamObject( const OleStorageObject& rParentStrg, const String& rStrmName )
-{
- RecordStreamObject::Construct( rParentStrg, rStrmName, EXC_BIFF_UNKNOWN );
- ConstructWbStrmObj();
-}
-
-WorkbookStreamObject::~WorkbookStreamObject()
-{
- if( WorkbookStreamObject::ImplIsValid() )
- {
- Config& rCfg = Cfg();
- rCfg.EraseNameList( "FONTNAMES" );
- rCfg.EraseNameList( "FORMATS" );
- }
-}
-
-void WorkbookStreamObject::ImplPreProcessRecord()
-{
- XclImpStream& rStrm = GetXclStream();
- sal_uInt16 nRecId = rStrm.GetRecId();
-
- // record specific settings
- switch( nRecId )
- {
- case EXC_ID_CHEND:
- Out().DecIndent();
- break;
- }
-
- // special CONTINUE handling
- if( GetRecordHeader().IsMergeContRec() )
- {
- switch( nRecId )
- {
- case EXC_ID_OBJ:
- case EXC_ID_TXO:
- case EXC_ID_EOF:
- case EXC_ID_CONT:
- rStrm.ResetRecord( false );
- break;
- case EXC_ID_MSODRAWINGGROUP:
- case EXC_ID_CHESCHERFORMAT:
- rStrm.ResetRecord( true, nRecId );
- break;
- }
- }
-}
-
-void WorkbookStreamObject::ImplDumpRecord()
-{
- XclImpStream& rStrm = GetXclStream();
- sal_uInt16 nRecId = rStrm.GetRecId();
- sal_Size nRecSize = rStrm.GetRecSize();
- XclBiff eBiff = GetBiff();
-
- switch( nRecId )
- {
- case EXC_ID2_BOF:
- case EXC_ID3_BOF:
- case EXC_ID4_BOF:
- case EXC_ID5_BOF:
- DumpHex< sal_uInt16 >( "bof-type", "BOF-BIFFTYPE" );
- DumpHex< sal_uInt16 >( "sheet-type", "BOF-SHEETTYPE" );
- if( nRecSize >= 6 ) DumpDec< sal_uInt16 >( "build-id" );
- if( nRecSize >= 8 ) DumpDec< sal_uInt16 >( "build-year" );
- if( nRecSize >= 12 ) DumpHex< sal_uInt32 >( "history-flags", "BOF-HISTORY-FLAGS" );
- if( nRecSize >= 16 ) DumpDec< sal_uInt32 >( "lowest-ver" );
- break;
-
- case EXC_ID2_BLANK:
- case EXC_ID3_BLANK:
- DumpCellHeader( nRecId == EXC_ID2_BLANK );
- break;
-
- case EXC_ID2_BOOLERR:
- case EXC_ID3_BOOLERR:
- DumpCellHeader( nRecId == EXC_ID2_BOOLERR );
- DumpBoolErr();
- break;
-
- case EXC_ID_CH3DDATAFORMAT:
- DumpDec< sal_uInt8 >( "base", "CH3DDATAFORMAT-BASE" );
- DumpDec< sal_uInt8 >( "top", "CH3DDATAFORMAT-TOP" );
- break;
-
- case EXC_ID_CHAREAFORMAT:
- DumpRgbColor( "fg-color-rgb" );
- DumpRgbColor( "bg-color-rgb" );
- DumpPatternIdx< sal_uInt16 >();
- DumpHex< sal_uInt16 >( "flags", "CHAREAFORMAT-FLAGS" );
- if( eBiff == EXC_BIFF8 ) DumpColorIdx< sal_uInt16 >( "fg-color-idx" );
- if( eBiff == EXC_BIFF8 ) DumpColorIdx< sal_uInt16 >( "bg-color-idx" );
- break;
-
- case EXC_ID_CHAXESSET:
- DumpDec< sal_uInt16 >( "axesset-id", "CHAXESSET-ID" );
- DumpRect< sal_Int32 >( "position", (eBiff <= EXC_BIFF4) ? "CONV-TWIP-TO-CM" : "" );
- break;
-
- case EXC_ID_CHAXIS:
- DumpDec< sal_uInt16 >( "axis-type", "CHAXIS-TYPE" );
- if( eBiff <= EXC_BIFF4 )
- DumpRect< sal_Int32 >( "position", "CONV-TWIP-TO-CM" );
- else
- DumpUnused( 16 );
- break;
-
- case EXC_ID_CHBAR:
- DumpDec< sal_Int16 >( "overlap", "CONV-PERCENT-NEG" );
- DumpDec< sal_Int16 >( "gap", "CONV-PERCENT" );
- DumpHex< sal_uInt16 >( "flags", "CHBAR-FLAGS" );
- break;
-
- case EXC_ID_CHCHART:
- DumpRect< sal_Int32 >( "chart-frame", "CONV-PT1616-TO-CM", FORMATTYPE_FIX );
- break;
-
- case EXC_ID_CHCHART3D:
- DumpDec< sal_uInt16 >( "rotation-angle", "CONV-DEG" );
- DumpDec< sal_Int16 >( "elevation-angle", "CONV-DEG" );
- DumpDec< sal_uInt16 >( "eye-distance" );
- DumpDec< sal_uInt16 >( "relative-height", "CONV-PERCENT" );
- DumpDec< sal_uInt16 >( "relative-depth", "CONV-PERCENT" );
- DumpDec< sal_uInt16 >( "depth-gap", "CONV-PERCENT" );
- DumpHex< sal_uInt16 >( "flags", "CHCHART3D-FLAGS" );
- break;
-
- case EXC_ID_CHTYPEGROUP:
- DumpUnused( 16 );
- DumpHex< sal_uInt16 >( "flags", "CHTYPEGROUP-FLAGS" );
- if( eBiff >= EXC_BIFF5 ) DumpDec< sal_uInt16 >( "group-idx" );
- break;
-
- case EXC_ID_CHDATAFORMAT:
- DumpDec< sal_Int16 >( "point-idx", "CHDATAFORMAT-POINTIDX" );
- DumpDec< sal_Int16 >( "series-idx" );
- if( eBiff >= EXC_BIFF5 ) DumpDec< sal_Int16 >( "format-idx", "CHDATAFORMAT-FORMATIDX" );
- if( eBiff >= EXC_BIFF5 ) DumpHex< sal_uInt16 >( "flags", "CHDATAFORMAT-FLAGS" );
- break;
-
- case EXC_ID_CHESCHERFORMAT:
- GetDffDumper().Dump();
- break;
-
- case EXC_ID_CHFRAME:
- DumpDec< sal_uInt16 >( "format", "CHFRAME-FORMAT" );
- DumpHex< sal_uInt16 >( "flags", "CHFRAME-FLAGS" );
- break;
-
- case EXC_ID_CHFRAMEPOS:
- DumpDec< sal_uInt16 >( "object-type", "CHFRAMEPOS-OBJTYPE" );
- DumpDec< sal_uInt16 >( "size-mode", "CHFRAMEPOS-SIZEMODE" );
- DumpRect< sal_Int32 >( "position", (eBiff <= EXC_BIFF4) ? "CONV-TWIP-TO-CM" : "" );
- break;
-
- case EXC_ID_CHLABELRANGE:
- DumpDec< sal_uInt16 >( "axis-crossing" );
- DumpDec< sal_uInt16 >( "label-frequency" );
- DumpDec< sal_uInt16 >( "tick-frequency" );
- DumpHex< sal_uInt16 >( "flags", "CHLABELRANGE-FLAGS" );
- break;
-
- case EXC_ID_CHLABELRANGE2:
- DumpDec< sal_uInt16 >( "minimum-categ" );
- DumpDec< sal_uInt16 >( "maximum-categ" );
- DumpDec< sal_uInt16 >( "major-unit-value" );
- DumpDec< sal_uInt16 >( "major-unit" );
- DumpDec< sal_uInt16 >( "minor-unit-value" );
- DumpDec< sal_uInt16 >( "minor-unit" );
- DumpDec< sal_uInt16 >( "base-unit" );
- DumpDec< sal_uInt16 >( "axis-crossing-date" );
- DumpHex< sal_uInt16 >( "flags", "CHLABELRANGE2-FLAGS" );
- break;
-
- case EXC_ID_CHLEGEND:
- DumpRect< sal_Int32 >( "position", (eBiff <= EXC_BIFF4) ? "CONV-TWIP-TO-CM" : "" );
- DumpDec< sal_uInt8 >( "docked-pos", "CHLEGEND-DOCKPOS" );
- DumpDec< sal_uInt8 >( "spacing", "CHLEGEND-SPACING" );
- DumpHex< sal_uInt16 >( "flags", "CHLEGEND-FLAGS" );
- break;
-
- case EXC_ID_CHLINEFORMAT:
- DumpRgbColor();
- DumpDec< sal_uInt16 >( "line-type", "CHLINEFORMAT-LINETYPE" );
- DumpDec< sal_Int16 >( "line-weight", "CHLINEFORMAT-LINEWEIGHT" );
- DumpHex< sal_uInt16 >( "flags", "CHLINEFORMAT-FLAGS" );
- if( eBiff == EXC_BIFF8 ) DumpColorIdx< sal_uInt16 >();
- break;
-
- case EXC_ID_CHMARKERFORMAT:
- DumpRgbColor( "border-color-rgb" );
- DumpRgbColor( "fill-color-rgb" );
- DumpDec< sal_uInt16 >( "marker-type", "CHMARKERFORMAT-TYPE" );
- DumpHex< sal_uInt16 >( "flags", "CHMARKERFORMAT-FLAGS" );
- if( eBiff == EXC_BIFF8 ) DumpColorIdx< sal_uInt16 >( "border-color-idx" );
- if( eBiff == EXC_BIFF8 ) DumpColorIdx< sal_uInt16 >( "fill-color-idx" );
- if( eBiff == EXC_BIFF8 ) DumpDec< sal_Int32 >( "marker-size", "CONV-TWIP-TO-PT" );
- break;
-
- case EXC_ID_CHOBJECTLINK:
- DumpDec< sal_uInt16 >( "link-target", "CHOBJECTLINK-TARGET" );
- DumpDec< sal_Int16 >( "series-idx" );
- DumpDec< sal_Int16 >( "point-idx", "CHOBJECTLINK-POINT" );
- break;
-
- case EXC_ID_CHPICFORMAT:
- DumpDec< sal_uInt16 >( "bitmap-mode", "CHPICFORMAT-BITMAP-MODE" );
- DumpDec< sal_uInt16 >( "image-format", "CHPICFORMAT-IMAGE-FORMAT" );
- DumpHex< sal_uInt16 >( "flags", "CHPICFORMAT-FLAGS" );
- DumpDec< double >( "scaling-factor" );
- break;
-
- case EXC_ID_CHPIE:
- DumpDec< sal_uInt16 >( "angle", "CONV-DEG" );
- if( eBiff >= EXC_BIFF5 ) DumpDec< sal_uInt16 >( "hole-size" );
- if( eBiff >= EXC_BIFF8 ) DumpHex< sal_uInt16 >( "flags", "CHPIE-FLAGS" );
- break;
-
- case EXC_ID_CHPLOTGROWTH:
- DumpFix< sal_Int32 >( "horizontal-growth" );
- DumpFix< sal_Int32 >( "vertical-growth" );
- break;
-
- case EXC_ID_CHPROPERTIES:
- DumpHex< sal_uInt16 >( "flags", "CHPROPERTIES-FLAGS" );
- DumpDec< sal_uInt8 >( "empty-cells", "CHPROPERTIES-EMPTYCELLS" );
- break;
-
- case EXC_ID_CHSCATTER:
- if( eBiff == EXC_BIFF8 ) DumpDec< sal_uInt16 >( "bubble-size", "CONV-PERCENT" );
- if( eBiff == EXC_BIFF8 ) DumpDec< sal_uInt16 >( "size-type", "CHSCATTER-SIZETYPE" );
- if( eBiff == EXC_BIFF8 ) DumpHex< sal_uInt16 >( "flags", "CHSCATTER-FLAGS" );
- break;
-
- case EXC_ID_CHSERERRORBAR:
- DumpDec< sal_uInt8 >( "type", "CHSERERRORBAR-TYPE" );
- DumpDec< sal_uInt8 >( "source", "CHSERERRORBAR-SOURCE" );
- DumpBool< sal_uInt8 >( "draw-t-shape" );
- DumpBool< sal_uInt8 >( "draw-line" );
- DumpDec< double >( "value" );
- DumpDec< sal_uInt16 >( "custom-count" );
- break;
-
- case EXC_ID_CHSERIES:
- DumpDec< sal_uInt16 >( "categories-type", "CHSERIES-TYPE" );
- DumpDec< sal_uInt16 >( "values-type", "CHSERIES-TYPE" );
- DumpDec< sal_uInt16 >( "categories-count" );
- DumpDec< sal_uInt16 >( "values-count" );
- if( eBiff == EXC_BIFF8 ) DumpDec< sal_uInt16 >( "bubbles-type", "CHSERIES-TYPE" );
- if( eBiff == EXC_BIFF8 ) DumpDec< sal_uInt16 >( "bubbles-count" );
- break;
-
- case EXC_ID_CHSERTRENDLINE:
- switch( DumpDec< sal_uInt8 >( "type", "CHSERTRENDLINE-TYPE" ) )
- {
- case EXC_CHSERTREND_POLYNOMIAL: DumpDec< sal_uInt8 >( "order" ); break;
- case EXC_CHSERTREND_MOVING_AVG: DumpDec< sal_uInt8 >( "average-period" ); break;
- default: DumpUnused( 1 );
- }
- DumpDec< double >( "intercept" );
- DumpBool< sal_uInt8 >( "show-equation" );
- DumpBool< sal_uInt8 >( "show-r-sqrare" );
- DumpDec< double >( "forecast-forward" );
- DumpDec< double >( "forecast-backward" );
- break;
-
- case EXC_ID_CHSOURCELINK:
- DumpDec< sal_uInt8 >( "link-target", "CHSOURCELINK-TARGET" );
- DumpDec< sal_uInt8 >( "link-type", "CHSOURCELINK-TYPE" );
- DumpHex< sal_uInt16 >( "flags", "CHSOURCELINK-FLAGS" );
- DumpFormatIdx();
- GetFormulaDumper().DumpNameFormula();
- break;
-
- case EXC_ID_CHSTRING:
- DumpDec< sal_uInt16 >( "text-type", "CHSTRING-TYPE" );
- DumpString( "text", EXC_STR_8BITLENGTH );
- break;
-
- case EXC_ID_CHTEXT:
- DumpDec< sal_uInt8 >( "horizontal-align", "CHTEXT-HORALIGN" );
- DumpDec< sal_uInt8 >( "vertical-align", "CHTEXT-VERALIGN" );
- DumpDec< sal_uInt16 >( "fill-mode", "CHTEXT-FILLMODE" );
- DumpRgbColor();
- DumpRect< sal_Int32 >( "position", (eBiff <= EXC_BIFF4) ? "CONV-TWIP-TO-CM" : "" );
- DumpHex< sal_uInt16 >( "flags", "CHTEXT-FLAGS" );
- if( eBiff == EXC_BIFF8 ) DumpColorIdx< sal_uInt16 >();
- if( eBiff == EXC_BIFF8 ) DumpHex< sal_uInt16 >( "flags2", "CHTEXT-FLAGS2-BIFF8" );
- if( eBiff == EXC_BIFF8 ) DumpDec< sal_uInt16 >( "rotation", "TEXTROTATION" );
- break;
-
- case EXC_ID_CHTICK:
- DumpDec< sal_uInt8 >( "major-ticks", "CHTICK-TYPE" );
- DumpDec< sal_uInt8 >( "minor-ticks", "CHTICK-TYPE" );
- DumpDec< sal_uInt8 >( "label-position", "CHTICK-LABELPOS" );
- DumpDec< sal_uInt8 >( "fill-mode", "CHTEXT-FILLMODE" );
- DumpRgbColor( "label-color-rgb" );
- DumpUnused( 16 );
- DumpHex< sal_uInt16 >( "flags", "CHTICK-FLAGS" );
- if( eBiff == EXC_BIFF8 ) DumpColorIdx< sal_uInt16 >( "label-color-idx" );
- if( eBiff == EXC_BIFF8 ) DumpDec< sal_uInt16 >( "label-rotation", "TEXTROTATION" );
- break;
-
- case EXC_ID_CHUNITPROPERTIES:
- DumpRepeatedRecordId();
- DumpDec< sal_Int16 >( "preset", "CHUNITPROPERTIES-PRESET" );
- DumpDec< double >( "unit" );
- DumpHex< sal_uInt16 >( "flags", "CHUNITPROPERTIES-FLAGS" );
- break;
-
- case EXC_ID_CHVALUERANGE:
- DumpDec< double >( "minimum" );
- DumpDec< double >( "maximum" );
- DumpDec< double >( "major-inc" );
- DumpDec< double >( "minor-inc" );
- DumpDec< double >( "axis-crossing" );
- DumpHex< sal_uInt16 >( "flags", "CHVALUERANGE-FLAGS" );
- break;
-
- case EXC_ID_CHWRAPPEDRECORD:
- DumpRepeatedRecordId();
- break;
-
- case EXC_ID_CODEPAGE:
- Root().SetTextEncoding( DumpCodePage() );
- mbHasCodePage = true;
- break;
-
- case EXC_ID_COLINFO:
- DumpColRange();
- DumpDec< sal_uInt16 >( "col-width", "CONV-COLWIDTH" );
- DumpXfIdx( "default-xf-idx" );
- DumpHex< sal_uInt16 >( "flags", "COLINFO-FLAGS" );
- DumpUnused( 2 );
- break;
-
- case EXC_ID_COLUMNDEFAULT:
- Out().ResetItemIndex();
- for( sal_Int32 nCol = 0, nCount = DumpColRange(); nCol < nCount; ++nCol )
- DumpXfIdx( "#xf-idx", true );
- DumpUnused( 2 );
- break;
-
- case EXC_ID_COLWIDTH:
- DumpColRange( 0, false );
- DumpDec< sal_uInt16 >( "col-width", "CONV-COLWIDTH" );
- break;
-
- case EXC_ID_DCONNAME:
- DumpString( "source-name", (eBiff <= EXC_BIFF5) ? EXC_STR_8BITLENGTH : EXC_STR_DEFAULT );
- DumpString( "source-link", (eBiff <= EXC_BIFF5) ? EXC_STR_8BITLENGTH : EXC_STR_DEFAULT );
- break;
-
- case EXC_ID_DCONREF:
- DumpRange( "source-range", false );
- DumpString( "source-link", (eBiff <= EXC_BIFF5) ? EXC_STR_8BITLENGTH : EXC_STR_DEFAULT );
- break;
-
- case EXC_ID3_DEFROWHEIGHT:
- DumpHex< sal_uInt16 >( "flags", "DEFROWHEIGHT-FLAGS" );
- DumpDec< sal_uInt16 >( "row-height", "CONV-TWIP-TO-PT" );
- break;
-
- case EXC_ID2_DIMENSIONS:
- case EXC_ID3_DIMENSIONS:
- DumpRange( "used-area", true, (nRecId == EXC_ID3_DIMENSIONS) && (eBiff == EXC_BIFF8) );
- if( nRecId == EXC_ID3_DIMENSIONS ) DumpUnused( 2 );
- break;
-
- case EXC_ID2_FONT:
- case EXC_ID3_FONT:
- DumpFontRec();
- break;
-
- case EXC_ID2_FORMAT:
- case EXC_ID4_FORMAT:
- DumpFormatRec();
- break;
-
- case EXC_ID2_FORMULA:
- case EXC_ID3_FORMULA:
- case EXC_ID4_FORMULA:
- DumpCellHeader( eBiff == EXC_BIFF2 );
- DumpFormulaResult();
- DumpHex< sal_uInt16, sal_uInt8 >( eBiff != EXC_BIFF2, "flags", "FORMULA-FLAGS" );
- if( eBiff >= EXC_BIFF5 ) DumpUnused( 4 );
- GetFormulaDumper().DumpCellFormula();
- break;
-
- case EXC_ID_HLINK:
- DumpRange();
- DumpGuid( "std-link" );
- break;
-
- case EXC_ID2_INTEGER:
- DumpCellHeader( true );
- DumpDec< sal_uInt16 >( "value" );
- break;
-
- case EXC_ID2_LABEL:
- case EXC_ID3_LABEL:
- {
- sal_uInt16 nXfIdx = DumpCellHeader( nRecId == EXC_ID2_LABEL );
- rtl_TextEncoding eOldTextEnc = Root().GetTextEncoding();
- Root().SetTextEncoding( GetFontEncoding( nXfIdx ) );
- DumpString( "value", ((nRecId == EXC_ID2_LABEL) && (eBiff <= EXC_BIFF5)) ? EXC_STR_8BITLENGTH : EXC_STR_DEFAULT );
- Root().SetTextEncoding( eOldTextEnc );
- }
- break;
-
- case EXC_ID_LABELSST:
- DumpCellHeader();
- DumpDec< sal_uInt32 >( "sst-idx" );
- break;
-
- case EXC_ID_MSODRAWING:
- case EXC_ID_MSODRAWINGGROUP:
- case EXC_ID_MSODRAWINGSEL:
- GetDffDumper().Dump();
- break;
-
- case EXC_ID_NAME:
- case EXC_ID34_NAME:
- {
- DumpHex< sal_uInt16, sal_uInt8 >( eBiff != EXC_BIFF2, "flags", "NAME-FLAGS" );
- if( eBiff == EXC_BIFF2 ) DumpDec< sal_uInt8 >( "macro-type", "NAME-MACROTYPE-BIFF2" );
- DumpHex< sal_uInt8 >( "keyboard-shortcut" );
- sal_uInt8 nNameLen = DumpDec< sal_uInt8 >( "name-len" );
- sal_uInt16 nFmlaSize = GetFormulaDumper().DumpFormulaSize();
- if( eBiff >= EXC_BIFF5 )
- {
- DumpDec< sal_uInt16 >( "externsheet-idx", "NAME-SHEETIDX" );
- DumpDec< sal_uInt16 >( "sheet-idx", "NAME-SHEETIDX" );
- sal_uInt8 nMenuLen = DumpDec< sal_uInt8 >( "menu-text-len" );
- sal_uInt8 nDescrLen = DumpDec< sal_uInt8 >( "description-text-len" );
- sal_uInt8 nHelpLen = DumpDec< sal_uInt8 >( "help-text-len" );
- sal_uInt8 nStatusLen = DumpDec< sal_uInt8 >( "statusbar-text-len" );
- WriteStringItem( "name", (eBiff == EXC_BIFF8) ? rStrm.ReadUniString( nNameLen ) : rStrm.ReadRawByteString( nNameLen ) );
- GetFormulaDumper().DumpNameFormula( 0, nFmlaSize );
- if( nMenuLen > 0 ) WriteStringItem( "menu-text", (eBiff == EXC_BIFF8) ? rStrm.ReadUniString( nMenuLen ) : rStrm.ReadRawByteString( nMenuLen ) );
- if( nDescrLen > 0 ) WriteStringItem( "description-text", (eBiff == EXC_BIFF8) ? rStrm.ReadUniString( nDescrLen ) : rStrm.ReadRawByteString( nDescrLen ) );
- if( nHelpLen > 0 ) WriteStringItem( "help-text", (eBiff == EXC_BIFF8) ? rStrm.ReadUniString( nHelpLen ) : rStrm.ReadRawByteString( nHelpLen ) );
- if( nStatusLen > 0 ) WriteStringItem( "statusbar-text", (eBiff == EXC_BIFF8) ? rStrm.ReadUniString( nStatusLen ) : rStrm.ReadRawByteString( nStatusLen ) );
- }
- else
- {
- WriteStringItem( "name", rStrm.ReadRawByteString( nNameLen ) );
- GetFormulaDumper().DumpNameFormula( 0, nFmlaSize );
- if( eBiff == EXC_BIFF2 ) GetFormulaDumper().DumpFormulaSize();
- }
- }
- break;
-
- case EXC_ID2_NUMBER:
- case EXC_ID3_NUMBER:
- DumpCellHeader( nRecId == EXC_ID2_NUMBER );
- DumpDec< double >( "value" );
- break;
-
- case EXC_ID_OBJ:
- DumpObjRec();
- break;
-
- case EXC_ID_RK:
- DumpCellHeader();
- DumpRk( "value" );
- break;
-
- case EXC_ID2_ROW:
- {
- DumpRowIndex();
- DumpColIndex( "first-used-col-idx" );
- DumpColIndex( "first-free-col-idx" );
- DumpHex< sal_uInt16 >( "row-height", "ROW-HEIGHT" );
- DumpUnused( 2 );
- bool bHasDefXf = DumpBool< sal_uInt8 >( "has-default-xf" );
- DumpDec< sal_uInt16 >( "cell-offset" );
- if( bHasDefXf ) DumpXfIdx( "default-format", true );
- if( bHasDefXf ) DumpXfIdx( "default-xf-idx", false );
- }
- break;
-
- case EXC_ID3_ROW:
- DumpRowIndex();
- DumpColIndex( "first-used-col-idx" );
- DumpColIndex( "first-free-col-idx" );
- DumpHex< sal_uInt16 >( "row-height", "ROW-HEIGHT" );
- DumpUnused( (eBiff <= EXC_BIFF4) ? 2 : 4 );
- if( eBiff <= EXC_BIFF4 ) DumpDec< sal_uInt16 >( "cell-offset" );
- DumpHex< sal_uInt32 >( "flags", "ROW-FLAGS" );
- break;
-
- case EXC_ID_SST:
- DumpDec< sal_uInt32 >( "string-cell-count" );
- DumpDec< sal_uInt32 >( "sst-size" );
- Out().ResetItemIndex();
- while( rStrm.IsValid() && (rStrm.GetRecLeft() >= 3) )
- DumpString( "#entry" );
- break;
-
- case EXC_ID2_STRING:
- case EXC_ID3_STRING:
- DumpString( "result", ((nRecId == EXC_ID2_STRING) && (eBiff <= EXC_BIFF4)) ? EXC_STR_8BITLENGTH : EXC_STR_DEFAULT );
- break;
-
- case EXC_ID_SXDI:
- {
- DumpDec< sal_uInt16 >( "field-idx" );
- DumpDec< sal_uInt16 >( "function", "SXDI-FUNC" );
- DumpDec< sal_uInt16 >( "data-format", "SXDI-FORMAT" );
- DumpDec< sal_uInt16 >( "format-basefield-idx" );
- DumpDec< sal_uInt16 >( "format-baseitem-idx", "SXDI-BASEITEM" );
- DumpFormatIdx();
- sal_uInt16 nNameLen = DumpDec< sal_uInt16 >( "item-name-len", "SX-NAMELEN" );
- if( nNameLen != EXC_PT_NOSTRING )
- WriteStringItem( "item-name", rStrm.ReadUniString( nNameLen ) );
- }
- break;
-
- case EXC_ID_SXEXT:
- if( eBiff == EXC_BIFF8 )
- {
- DumpHex< sal_uInt16 >( "flags", "SXEXT-FLAGS" );
- DumpDec< sal_uInt16 >( "param-string-count" );
- DumpDec< sal_uInt16 >( "sql-statement-string-count" );
- DumpDec< sal_uInt16 >( "webquery-postmethod-string-count" );
- DumpDec< sal_uInt16 >( "server-pagefields-string-count" );
- DumpDec< sal_uInt16 >( "odbc-connection-string-count" );
- }
- break;
-
- case EXC_ID_SXIVD:
- Out().ResetItemIndex();
- for( sal_Size nIdx = 0, nCount = rStrm.GetRecLeft() / 2; nIdx < nCount; ++nIdx )
- DumpDec< sal_uInt16 >( "#field-idx" );
- break;
-
- case EXC_ID_SXLI:
- if( mnPTSxliIdx < 2 )
- {
- sal_uInt16 nCount = (mnPTSxliIdx == 0) ? mnPTRowFields : mnPTColFields;
- sal_Size nLineSize = 8 + 2 * nCount;
- Out().ResetItemIndex();
- while( rStrm.GetRecLeft() >= nLineSize )
- {
- WriteEmptyItem( "#line-data" );
- IndentGuard aIndGuard( Out() );
- MultiItemsGuard aMultiGuard( Out() );
- DumpDec< sal_uInt16 >( "ident-count" );
- DumpDec< sal_uInt16 >( "item-type", "SXLI-ITEMTYPE" );
- DumpDec< sal_uInt16 >( "used-count" );
- DumpHex< sal_uInt16 >( "flags", "SXLI-FLAGS" );
- String aItemList;
- for( sal_uInt16 nIdx = 0; nIdx < nCount; ++nIdx )
- StringHelper::AppendToken( aItemList, In().ReadValue< sal_uInt16 >() );
- WriteInfoItem( "item-idxs", aItemList );
- }
- ++mnPTSxliIdx;
- }
- break;
-
- case EXC_ID_SXSTRING:
- DumpString( "value" );
- break;
-
- case EXC_ID_SXVD:
- {
- DumpDec< sal_uInt16 >( "axis-type", "SXVD-AXISTYPE" );
- DumpDec< sal_uInt16 >( "subtotal-count" );
- DumpHex< sal_uInt16 >( "subtotals", "SXVD-SUBTOTALS" );
- DumpDec< sal_uInt16 >( "item-count" );
- sal_uInt16 nNameLen = DumpDec< sal_uInt16 >( "field-name-len", "SX-NAMELEN" );
- if( nNameLen != EXC_PT_NOSTRING )
- WriteStringItem( "field-name", rStrm.ReadUniString( nNameLen ) );
- }
- break;
-
- case EXC_ID_SXVDEX:
- DumpHex< sal_uInt32 >( "flags", "SXVDEX-FLAGS" );
- DumpDec< sal_uInt16 >( "autosort-basefield-idx" );
- DumpDec< sal_uInt16 >( "autoshow-basefield-idx" );
- DumpFormatIdx();
- break;
-
- case EXC_ID_SXVI:
- {
- DumpDec< sal_uInt16 >( "item-type", "SXVI-ITEMTYPE" );
- DumpHex< sal_uInt16 >( "flags", "SXVI-FLAGS" );
- DumpDec< sal_uInt16 >( "cache-idx" );
- sal_uInt16 nNameLen = DumpDec< sal_uInt16 >( "item-name-len", "SX-NAMELEN" );
- if( nNameLen != EXC_PT_NOSTRING )
- WriteStringItem( "item-name", rStrm.ReadUniString( nNameLen ) );
- }
- break;
-
- case EXC_ID_SXVIEW:
- {
- DumpRange( "output-range" );
- DumpRowIndex( "first-header-row" );
- DumpAddress( "first-data-pos" );
- DumpDec< sal_uInt16 >( "cache-idx" );
- DumpUnused( 2 );
- DumpDec< sal_uInt16 >( "default-data-axis", "SXVD-AXISTYPE" );
- DumpDec< sal_Int16 >( "default-data-pos" );
- DumpDec< sal_uInt16 >( "field-count" );
- mnPTRowFields = DumpDec< sal_uInt16 >( "row-field-count" );
- mnPTColFields = DumpDec< sal_uInt16 >( "column-field-count" );
- DumpDec< sal_uInt16 >( "page-field-count" );
- DumpDec< sal_uInt16 >( "data-field-count" );
- DumpDec< sal_uInt16 >( "data-row-count" );
- DumpDec< sal_uInt16 >( "data-column-count" );
- DumpHex< sal_uInt16 >( "flags", "SXVIEW-FLAGS" );
- DumpDec< sal_uInt16 >( "auto-format-idx" );
- sal_uInt16 nTabNameLen = DumpDec< sal_uInt16 >( "table-name-len" );
- sal_uInt16 nDataNameLen = DumpDec< sal_uInt16 >( "data-name-len" );
- WriteStringItem( "table-name", rStrm.ReadUniString( nTabNameLen ) );
- WriteStringItem( "data-name", rStrm.ReadUniString( nDataNameLen ) );
- mnPTSxliIdx = 0;
- }
- break;
-
- case EXC_ID2_XF:
- case EXC_ID3_XF:
- case EXC_ID4_XF:
- case EXC_ID5_XF:
- DumpXfRec();
- break;
- }
-}
-
-void WorkbookStreamObject::ImplPostProcessRecord()
-{
- XclImpStream& rStrm = GetXclStream();
- sal_uInt16 nRecId = rStrm.GetRecId();
-
- // record specific settings
- switch( nRecId )
- {
- case EXC_ID_CHBEGIN:
- Out().IncIndent();
- break;
- }
-}
-
-void WorkbookStreamObject::ConstructWbStrmObj()
-{
- if( IsValid() )
- {
- Config& rCfg = Cfg();
- mxColors = rCfg.GetNameList( "COLORS" );
- mxBorderStyles = rCfg.GetNameList( "BORDERSTYLES" );
- mxFillPatterns = rCfg.GetNameList( "FILLPATTERNS" );
- mxFontNames = rCfg.CreateNameList< ConstList >( "FONTNAMES" );
- mxFontNames->SetName( EXC_FONT_APP, "'Arial'/10pt" );
- mxFormats = rCfg.CreateNameList< ConstList >( "FORMATS" );
- mxFormats->IncludeList( rCfg.GetNameList( "BUILTIN-FORMATS" ) );
- mnFormatIdx = 0;
- mnPTRowFields = 0;
- mnPTColFields = 0;
- mnPTSxliIdx = 0;
- mbHasCodePage = false;
- }
-}
-
-const XclFontData* WorkbookStreamObject::GetFontData( sal_uInt16 nFontIdx ) const
-{
- return (nFontIdx < maFontDatas.size()) ? &maFontDatas[ nFontIdx ] : 0;
-}
-
-sal_uInt16 WorkbookStreamObject::GetXfData( sal_uInt16 nXfIdx ) const
-{
- return (nXfIdx < maXfDatas.size()) ? maXfDatas[ nXfIdx ] : EXC_FONT_NOTFOUND;
-}
-
-rtl_TextEncoding WorkbookStreamObject::GetFontEncoding( sal_uInt16 nXfIdx ) const
-{
- const XclFontData* pFontData = GetFontData( GetXfData( nXfIdx ) );
- rtl_TextEncoding eFontEnc = pFontData ? pFontData->GetFontEncoding() : Root().GetTextEncoding();
- return (eFontEnc == RTL_TEXTENCODING_DONTKNOW) ? Root().GetTextEncoding() : eFontEnc;
-}
-
-String WorkbookStreamObject::CreateFontName( const XclFontData& rFontData ) const
-{
- String aName = rFontData.maName;
- StringHelper::Enclose( aName, '\'' );
- StringHelper::AppendToken( aName, Cfg().GetName( "CONV-TWIP-TO-PT", rFontData.mnHeight ), '/' );
- if( rFontData.mnWeight > EXC_FONTWGHT_NORMAL )
- StringHelper::AppendToken( aName, CREATE_STRING( "bold" ), '/' );
- if( rFontData.mbItalic )
- StringHelper::AppendToken( aName, CREATE_STRING( "italic" ), '/' );
- return aName;
-}
-
-sal_uInt16 WorkbookStreamObject::DumpFontIdx( const sal_Char* pcName )
-{
- return DumpDec< sal_uInt16, sal_uInt8 >( GetBiff() >= EXC_BIFF5, pcName ? pcName : "font-idx", "FONTNAMES" );
-}
-
-sal_uInt16 WorkbookStreamObject::DumpFormatIdx( const sal_Char* pcName )
-{
- return DumpDec< sal_uInt16, sal_uInt8 >( GetBiff() >= EXC_BIFF5, pcName ? pcName : "fmt-idx", "FORMATS" );
-}
-
-sal_uInt16 WorkbookStreamObject::DumpXfIdx( const sal_Char* pcName, bool bBiff2Style )
-{
- if( !pcName ) pcName = "xf-idx";
- sal_uInt16 nXfIdx = 0;
- if( bBiff2Style )
- {
- DumpHex< sal_uInt8 >( pcName, "CELL-XFINDEX" );
- DumpHex< sal_uInt8 >( "fmt-font-idx", "CELL-XFFORMAT" );
- DumpHex< sal_uInt8 >( "style", "CELL-XFSTYLE" );
- }
- else
- nXfIdx = DumpDec< sal_uInt16 >( pcName );
- return nXfIdx;
-}
-
-sal_uInt16 WorkbookStreamObject::DumpCellHeader( bool bBiff2Style )
-{
- DumpAddress();
- return DumpXfIdx( 0, bBiff2Style );
-}
-
-void WorkbookStreamObject::DumpBoolErr()
-{
- MultiItemsGuard aMultiGuard( Out() );
- sal_uInt8 nValue = DumpHex< sal_uInt8 >( "value" );
- bool bErrCode = DumpBool< sal_uInt8 >( "is-errorcode" );
- if( bErrCode )
- WriteErrorCodeItem( "errorcode", nValue );
- else
- WriteBooleanItem( "boolean", nValue );
-}
-
-void WorkbookStreamObject::DumpFontRec()
-{
- if( maFontDatas.size() == 4 )
- maFontDatas.push_back( XclFontData() );
-
- Out().ResetItemIndex( static_cast< sal_Int64 >( maFontDatas.size() ) );
- WriteEmptyItem( "#font" );
- XclFontData aFontData;
- aFontData.mnHeight = DumpDec< sal_uInt16 >( "height", "CONV-TWIP-TO-PT" );
- sal_uInt16 nFlags = DumpHex< sal_uInt16 >( "flags", "FONT-FLAGS" );
- aFontData.mbItalic = ::get_flag( nFlags, EXC_FONTATTR_ITALIC );
- aFontData.mbStrikeout = ::get_flag( nFlags, EXC_FONTATTR_STRIKEOUT );
- aFontData.mbOutline = ::get_flag( nFlags, EXC_FONTATTR_OUTLINE );
- aFontData.mbShadow = ::get_flag( nFlags, EXC_FONTATTR_SHADOW );
- aFontData.mnWeight = ::get_flagvalue( nFlags, EXC_FONTATTR_BOLD, EXC_FONTWGHT_BOLD, EXC_FONTWGHT_NORMAL );
- aFontData.mnUnderline = ::get_flagvalue( nFlags, EXC_FONTATTR_UNDERLINE, EXC_FONTUNDERL_SINGLE, EXC_FONTUNDERL_NONE );
- if( GetBiff() >= EXC_BIFF3 )
- DumpColorIdx< sal_uInt16 >();
- if( GetBiff() >= EXC_BIFF5 )
- {
- aFontData.mnWeight = DumpDec< sal_uInt16 >( "weight", "FONT-WEIGHT" );
- aFontData.mnEscapem = DumpDec< sal_uInt16 >( "escapement", "FONT-ESCAPEMENT" );
- aFontData.mnUnderline = DumpDec< sal_uInt8 >( "underline", "FONT-UNDERLINE" );
- aFontData.mnFamily = DumpDec< sal_uInt8 >( "family", "FONT-FAMILY" );
- aFontData.mnCharSet = DumpDec< sal_uInt8 >( "charset", "FONT-CHARSET" );
- DumpUnused( 1 );
- }
- aFontData.maName = DumpString( "name", EXC_STR_8BITLENGTH );
-
- // append font data to vector
- mxFontNames->SetName( static_cast< sal_Int64 >( maFontDatas.size() ), CreateFontName( aFontData ) );
- maFontDatas.push_back( aFontData );
-
- // set font encoding as default text encoding in case of missing CODEPAGE record
- if( !mbHasCodePage && (maFontDatas.size() == 1) )
- Root().SetTextEncoding( aFontData.GetFontEncoding() );
-}
-
-void WorkbookStreamObject::DumpFormatRec()
-{
- sal_uInt16 nFormatIdx = 0;
- switch( GetBiff() )
- {
- case EXC_BIFF2:
- case EXC_BIFF3:
- nFormatIdx = mnFormatIdx++;
- Out().ResetItemIndex( nFormatIdx );
- WriteEmptyItem( "#fmt" );
- break;
- case EXC_BIFF4:
- nFormatIdx = mnFormatIdx++;
- Out().ResetItemIndex( nFormatIdx );
- WriteEmptyItem( "#fmt" );
- DumpUnused( 2 );
- break;
- case EXC_BIFF5:
- case EXC_BIFF8:
- GetXclStream() >> nFormatIdx;
- Out().ResetItemIndex( nFormatIdx );
- WriteEmptyItem( "#fmt" );
- WriteDecItem( "fmt-idx", nFormatIdx );
- break;
- default: DBG_ERROR_BIFF();
- }
- String aFormat = DumpString( "format", (GetBiff() <= EXC_BIFF5) ? EXC_STR_8BITLENGTH : EXC_STR_DEFAULT );
- mxFormats->SetName( nFormatIdx, aFormat );
-}
-
-void WorkbookStreamObject::DumpXfRec()
-{
- Out().ResetItemIndex( static_cast< sal_Int64 >( maXfDatas.size() ) );
- WriteEmptyItem( "#xf" );
- sal_uInt16 nFontIdx = DumpFontIdx();
- switch( GetBiff() )
- {
- case EXC_BIFF2:
- DumpUnused( 1 );
- DumpHex< sal_uInt8 >( "type-flags", "XF-TYPEFLAGS" );
- DumpHex< sal_uInt8 >( "style-flags", "XF-STYLEFLAGS" );
-
- break;
- case EXC_BIFF3:
- DumpFormatIdx();
- DumpHex< sal_uInt8 >( "type-flags", "XF-TYPEFLAGS" );
- DumpHex< sal_uInt8 >( "used-attributes", "XF-USEDATTRIBS-FLAGS" );
- DumpHex< sal_uInt16 >( "alignment", "XF-ALIGNMENT" );
- DumpHex< sal_uInt16 >( "fill-style", "XF-FILL" );
- DumpHex< sal_uInt32 >( "border-style", "XF-BORDER" );
- break;
- case EXC_BIFF4:
- DumpFormatIdx();
- DumpHex< sal_uInt16 >( "type-flags", "XF-TYPEFLAGS" );
- DumpHex< sal_uInt8 >( "alignment", "XF-ALIGNMENT" );
- DumpHex< sal_uInt8 >( "used-attributes", "XF-USEDATTRIBS-FLAGS" );
- DumpHex< sal_uInt16 >( "fill-style", "XF-FILL" );
- DumpHex< sal_uInt32 >( "border-style", "XF-BORDER" );
- break;
- case EXC_BIFF5:
- DumpFormatIdx();
- DumpHex< sal_uInt16 >( "type-flags", "XF-TYPEFLAGS" );
- DumpHex< sal_uInt8 >( "alignment", "XF-ALIGNMENT" );
- DumpHex< sal_uInt8 >( "orientation", "XF-ORIENTATTRIBS" );
- DumpHex< sal_uInt32 >( "fill-style", "XF-FILL" );
- DumpHex< sal_uInt32 >( "border-style", "XF-BORDER" );
- break;
- case EXC_BIFF8:
- DumpFormatIdx();
- DumpHex< sal_uInt16 >( "type-flags", "XF-TYPEFLAGS" );
- DumpHex< sal_uInt8 >( "alignment", "XF-ALIGNMENT" );
- DumpDec< sal_uInt8 >( "rotation", "TEXTROTATION" );
- DumpHex< sal_uInt8 >( "text-flags", "XF-TEXTFLAGS" );
- DumpHex< sal_uInt8 >( "used-attributes", "XF-USEDATTRIBS-FLAGS" );
- DumpHex< sal_uInt16 >( "border-style", "XF-BORDERSTYLE" );
- DumpHex< sal_uInt16 >( "border-color1", "XF-BORDERCOLOR1" );
- DumpHex< sal_uInt32 >( "border-color2", "XF-BORDERCOLOR2" );
- DumpHex< sal_uInt16 >( "fill-color", "XF-FILLCOLOR" );
- break;
- default: DBG_ERROR_BIFF();
- }
- maXfDatas.push_back( nFontIdx );
-}
-
-void WorkbookStreamObject::DumpObjRec()
-{
- switch( GetBiff() )
- {
- case EXC_BIFF5: DumpObjRec5(); break;
- case EXC_BIFF8: DumpObjRec8(); break;
- default:;
- }
-}
-
-void WorkbookStreamObject::DumpObjRec5()
-{
- DumpDec< sal_uInt32 >( "obj-count" );
- sal_uInt16 nObjType = DumpDec< sal_uInt16 >( "obj-type", "OBJ-TYPE" );
- DumpDec< sal_uInt16 >( "obj-id" );
- DumpHex< sal_uInt16 >( "flags", "OBJ-FLAGS" );
- GetDffDumper().DumpDffClientRect();
- DumpDec< sal_uInt16 >( "macro-len" );
- DumpUnused( 6 );
- switch( nObjType )
- {
- case EXC_OBJ_CMO_LINE:
- DumpColorIdx< sal_uInt8 >( "line-color-idx" );
- DumpDec< sal_uInt8 >( "line-type", "OBJ-LINETYPE" );
- DumpDec< sal_uInt8 >( "line-weight", "OBJ-LINEWEIGHT" );
- DumpHex< sal_uInt8 >( "line-flags", "OBJ-FLAGS-AUTO" );
- DumpHex< sal_uInt16 >( "line-end", "OBJ-LINEENDS" );
- DumpDec< sal_uInt8 >( "line-direction", "OBJ-LINEDIR" );
- DumpUnused( 1 );
- break;
- case EXC_OBJ_CMO_RECTANGLE:
- DumpColorIdx< sal_uInt8 >( "back-color-idx" );
- DumpColorIdx< sal_uInt8 >( "patt-color-idx" );
- DumpPatternIdx< sal_uInt8 >();
- DumpHex< sal_uInt8 >( "area-flags", "OBJ-FLAGS-AUTO" );
- DumpColorIdx< sal_uInt8 >( "line-color-idx" );
- DumpDec< sal_uInt8 >( "line-type", "OBJ-LINETYPE" );
- DumpDec< sal_uInt8 >( "line-weight", "OBJ-LINEWEIGHT" );
- DumpHex< sal_uInt8 >( "line-flags", "OBJ-FLAGS-AUTO" );
- DumpHex< sal_uInt16 >( "frame-style", "OBJ-FRAMESTYLE-FLAGS" );
- break;
- case EXC_OBJ_CMO_CHART:
- DumpColorIdx< sal_uInt8 >( "back-color-idx" );
- DumpColorIdx< sal_uInt8 >( "patt-color-idx" );
- DumpPatternIdx< sal_uInt8 >();
- DumpHex< sal_uInt8 >( "area-flags", "OBJ-FLAGS-AUTO" );
- DumpColorIdx< sal_uInt8 >( "line-color-idx" );
- DumpDec< sal_uInt8 >( "line-type", "OBJ-LINETYPE" );
- DumpDec< sal_uInt8 >( "line-weight", "OBJ-LINEWEIGHT" );
- DumpHex< sal_uInt8 >( "line-flags", "OBJ-FLAGS-AUTO" );
- DumpHex< sal_uInt16 >( "frame-style", "OBJ-FRAMESTYLE-FLAGS" );
- DumpHex< sal_uInt16 >( "chart-flags", "OBJ-CHART-FLAGS" );
- DumpUnused( 16 );
- break;
- }
-}
-
-void WorkbookStreamObject::DumpObjRec8()
-{
-}
-
-// ============================================================================
-
-PivotCacheStreamObject::PivotCacheStreamObject( const ObjectBase& rParent, SvStream& rStrm )
-{
- RecordStreamObject::Construct( rParent, rStrm, EXC_BIFF8 );
-}
-
-PivotCacheStreamObject::PivotCacheStreamObject( const OleStorageObject& rParentStrg, const String& rStrmName )
-{
- RecordStreamObject::Construct( rParentStrg, rStrmName, EXC_BIFF8 );
-}
-
-PivotCacheStreamObject::~PivotCacheStreamObject()
-{
-}
-
-void PivotCacheStreamObject::ImplDumpRecord()
-{
- XclImpStream& rStrm = GetXclStream();
- sal_uInt16 nRecId = rStrm.GetRecId();
-
- switch( nRecId )
- {
- case EXC_ID_SXDATETIME:
- {
- sal_uInt16 nYear, nMonth;
- sal_uInt8 nDay, nHour, nMin, nSec;
- rStrm >> nYear >> nMonth >> nDay >> nHour >> nMin >> nSec;
- DateTime aDateTime(
- Date( static_cast< USHORT >( nDay ), static_cast< USHORT >( nMonth ), static_cast< USHORT >( nYear ) ),
- Time( static_cast< ULONG >( nHour ), static_cast< ULONG >( nMin ), static_cast< ULONG >( nSec ) ) );
- WriteDateTimeItem( "value", aDateTime );
- }
- break;
-
- case EXC_ID_SXDB:
- DumpDec< sal_uInt32 >( "source-records" );
- DumpHex< sal_uInt16 >( "stream-id" );
- DumpHex< sal_uInt16 >( "flags", "SXDB-FLAGS" );
- DumpDec< sal_uInt16 >( "block-records" );
- DumpDec< sal_uInt16 >( "standard-field-count" );
- DumpDec< sal_uInt16 >( "total-field-count" );
- DumpUnused( 2 );
- DumpDec< sal_uInt16 >( "database-type", "SXDB-TYPE" );
- DumpString( "user-name" );
- break;
-
- case EXC_ID_SXFIELD:
- DumpHex< sal_uInt16 >( "flags", "SXFIELD-FLAGS" );
- DumpDec< sal_uInt16 >( "group-child-field" );
- DumpDec< sal_uInt16 >( "group-base-field" );
- DumpDec< sal_uInt16 >( "visible-items" );
- DumpDec< sal_uInt16 >( "group-items" );
- DumpDec< sal_uInt16 >( "base-items" );
- DumpDec< sal_uInt16 >( "original-items" );
- if( rStrm.GetRecLeft() >= 3 )
- DumpString( "item-name" );
- break;
-
- case EXC_ID_SXSTRING:
- DumpString( "value" );
- break;
- }
-}
-
-// ============================================================================
-
-VbaProjectStreamObject::VbaProjectStreamObject( const OleStorageObject& rParentStrg )
-{
- OleStreamObject::Construct( rParentStrg, CREATE_STRING( "PROJECT" ) );
-}
-
-void VbaProjectStreamObject::ImplDumpBody()
-{
- DumpTextStream( ScfTools::GetSystemTextEncoding() );
-}
-
-// ============================================================================
-// ============================================================================
-
-PivotCacheStorageObject::PivotCacheStorageObject( const OleStorageObject& rParentStrg )
-{
- OleStorageObject::Construct( rParentStrg, EXC_STORAGE_PTCACHE );
-}
-
-void PivotCacheStorageObject::ImplDumpBody()
-{
- for( OleStorageIterator aIt( *this ); aIt.IsValid(); ++aIt )
- if( aIt->IsStream() )
- PivotCacheStreamObject( *this, aIt->GetName() ).Dump();
-}
-
-// ============================================================================
-
-VbaProjectStorageObject::VbaProjectStorageObject( const OleStorageObject& rParentStrg )
-{
- OleStorageObject::Construct( rParentStrg, EXC_STORAGE_VBA_PROJECT );
-}
-
-void VbaProjectStorageObject::ImplDumpBody()
-{
- VbaProjectStreamObject( *this ).Dump();
- VbaStorageObject( *this ).Dump();
-}
-
-// ============================================================================
-
-VbaStorageObject::VbaStorageObject( const OleStorageObject& rParentStrg )
-{
- OleStorageObject::Construct( rParentStrg, EXC_STORAGE_VBA );
-}
-
-void VbaStorageObject::ImplDumpBody()
-{
- OleStreamObject( *this, CREATE_STRING( "dir" ) ).Dump();
- OleStreamObject( *this, CREATE_STRING( "ThisWorkbook" ) ).Dump();
- OleStreamObject( *this, CREATE_STRING( "_VBA_PROJECT" ) ).Dump();
-}
-
-// ============================================================================
-
-RootStorageObject::RootStorageObject( const ObjectBase& rParent )
-{
- OleStorageObject::Construct( rParent );
-}
-
-void RootStorageObject::ImplDumpBody()
-{
- ExtractStorageToFileSystem();
- WorkbookStreamObject( *this, EXC_STREAM_WORKBOOK ).Dump();
- WorkbookStreamObject( *this, EXC_STREAM_BOOK ).Dump();
- OlePropertyStreamObject( *this, CREATE_STRING( "\005SummaryInformation" ) ).Dump();
- OlePropertyStreamObject( *this, CREATE_STRING( "\005DocumentSummaryInformation" ) ).Dump();
- OleStreamObject( *this, EXC_STREAM_CTLS ).Dump();
- PivotCacheStorageObject( *this ).Dump();
- VbaProjectStorageObject( *this ).Dump();
-}
-
-// ============================================================================
-// ============================================================================
-
-Dumper::Dumper( SfxMedium& rMedium, SfxObjectShell* pDocShell )
-{
- ConfigRef xCfg( new Config( "XLSDUMPER" ) );
- DumperBase::Construct( xCfg, rMedium, pDocShell );
-}
-
-void Dumper::ImplDumpBody()
-{
- WorkbookStreamObject( *this, GetCoreStream() ).Dump();
- RootStorageObject( *this ).Dump();
-}
-
-// ============================================================================
-
-} // namespace xls
-} // namespace dump
-} // namespace scf
-
-#endif
-
diff --git a/sc/source/filter/excel/xldumper.dat b/sc/source/filter/excel/xldumper.dat
index a94a256fa84a..e69de29bb2d1 100644
--- a/sc/source/filter/excel/xldumper.dat
+++ b/sc/source/filter/excel/xldumper.dat
@@ -1,1649 +0,0 @@
-
-# dumper settings ============================================================
-
-# Path to base configuration data, relative to this file.
-include-config-file=../ftools/fdumper.dat
-
-# BIFF record settings -------------------------------------------------------
-
-# Show total stream position of the record (default=on).
-# 0=off, 1=on
-show-record-pos=0
-
-# Show total record size in bytes (including CONTINUE records, if enabled,
-# see 'merge-continue-record' option) (default=on).
-# 0=off, 1=on
-show-record-size=1
-
-# Show record identifier (default=on).
-# 0=off, 1=on
-show-record-id=1
-
-# Show record name, if known (default=on).
-# 0=off, 1=on
-show-record-name=1
-
-# Show record contents (default=on).
-# 0=off, 1=on
-show-record-body=1
-
-# Merge CONTINUE records with leading record (default=on).
-# 0=off - show CONTINUE records separately (hex dump)
-# 1=on - show contents of leading record together with following CONTINUE
-merge-continue-record=1
-
-# name maps ==================================================================
-#
-# List of constants
-# -----------------
-# Defines names for specific values.
-#
-# constlist = <LISTNAME>
-# begin
-# default = <constname> (default=?err:no-name)
-# include = <LISTNAME>[,<LISTNAME>...]
-# exclude = <value>[,<value>...]
-# quote-names = 0|1|false|true (default=0)
-# <value> = <constname>
-# end
-#
-# List of multiple contants per line
-# ----------------------------------
-# Defines names for contiguous ranges of values.
-#
-# multilist = <LISTNAME>
-# begin
-# default = <constname> (default=?err:no-name)
-# ignore-empty = 0|1|false|true (default=1)
-# include = <LISTNAME>[,<LISTNAME>...]
-# exclude = <value>[,<value>...]
-# <firstvalue> = <constname>[,<constname>...]
-# end
-#
-# List of multiple contants, shortened format
-# -------------------------------------------
-# Defines names for a contiguous range of values. The entire list definition
-# is given in a single text line.
-#
-# shortlist = <LISTNAME>,<firstvalue>,<constname>[,<constname>...]
-#
-# List of flags
-# -------------
-# Defines names for single bits in a bit field.
-#
-# flagslist = <LISTNAME>
-# begin
-# ignore = <bitfield> (default=0)
-# include = <LISTNAME>[,<LISTNAME>...]
-# exclude = <bitfield>[,<bitfield>...]
-# <bitmask> = <constname>
-# end
-#
-# List of flags and values in a bitfield
-# --------------------------------------
-# Defines names for single bits and for embedded values in a bit field.
-#
-# combilist = <LISTNAME>
-# begin
-# ignore = <bitfield> (default=0)
-# include = <LISTNAME>[,<LISTNAME>...]
-# exclude = <bitmask>[,<bitmask>...]
-# <bitmask> = <constname>
-# <bitfield> = <datatype>,<dataformat>,<constname>[,<LISTNAME>]
-# end
-#
-# Unit converter
-# --------------
-# Converts values and appends a unit name.
-#
-# unitconverter = <LISTNAME>,[/]<factor>,<unitname>
-
-# common ---------------------------------------------------------------------
-
-unitconverter=CONV-PERCENT-NEG,-1,%
-unitconverter=CONV-COLWIDTH,/256,chars
-
-shortlist=BIFF,0,biff2,biff3,biff4,biff5,biff8
-
-constlist=ERRORCODES
-begin
- 0x00=#NULL!
- 0x07=#DIV/0!
- 0x0F=#VALUE!
- 0x17=#REF!
- 0x1D=#NAME?
- 0x24=#NUM!
- 0x2A=#N/A
-end
-
-combilist=RK-FLAGS
-begin
- 0x00000001=div-100
- 0x00000002=integer
- 0xFFFFFFFC=int32,dec,value
-end
-
-multilist=EGA-COLORS
-begin
- 0=ega-black,ega-white,ega-red,ega-green,ega-blue,ega-yellow,ega-magenta,ega-cyan
-end
-
-constlist=COLORS-BIFF2
-begin
- include=EGA-COLORS
- default=''
- 24=sys-window-text
- 25=sys-window-bg
- 0x7FFF=sys-window-text
-end
-
-constlist=COLORS-BIFF5
-begin
- include=EGA-COLORS
- default=''
- 64=sys-window-text
- 65=sys-window-bg
- 67=sys-button-face
- 77=sys-window-text-chart
- 78=sys-window-bg-chart
- 79=auto-border-chart
- 80=sys-tooltip-bg
- 81=sys-tooltip-text
- 0x7FFF=sys-window-text
-end
-
-multilist=BORDERSTYLES-BIFF3
-begin
- 0=none,thin,medium,dash,dot,thick,double,hair
-end
-
-multilist=BORDERSTYLES-BIFF8
-begin
- include=BORDERSTYLES-BIFF3
- 8=medium-dash,thin-dash-dot,medium-dash-dot,thin-dash-dot-dot,medium-dash-dot-dot,slant-dash-dot
-end
-
-multilist=FILLPATTERNS-BIFF3
-begin
- 0=no-fill,solid-fill,50%-grey,75%-grey,25%-grey
- 5=hor-stripe,ver-stripe,rev-diag-stripe,diag-stripe,diag-crosshatch
- 10=thick-diag-crosshatch,thin-hor-stripe,thin-ver-stripe,thin-rev-diag-stripe,thin-diag-stripe
- 15=thin-hor-crosshatch,thin-diag-crosshatch,12.5%-grey,6.25%-grey
-end
-
-shortlist=TEXTORIENTATION,0,horizontal,stacked,90°-ccw,90°-cw
-
-constlist=TEXTROTATION-BIFF8
-begin
- default=''
- 255=stacked
-end
-
-multilist=BUILTIN-FORMATS
-begin
- quote-names=1
- 0=General,0,0.00,'#,##0','#,##0.00'
- 5='"$"#,##0_);\("$"#,##0\)','"$"#,##0_);[Red]\("$"#,##0\)','"$"#,##0.00_);\("$"#,##0.00\)','"$"#,##0.00_);[Red]\("$"#,##0.00\)',0%
- 10=0.00%,0.00E+00,# ?/?,# ??/??,M/D/YYYY
- 15=D-MMM-YY,D-MMM,MMM-YY,h:mm AM/PM,h:mm:ss AM/PM
- 20=h:mm,h:mm:ss,M/D/YYYY h:mm,General,General
- 25=General,General,M/D/YYYY,M/D/YYYY,M/D/YYYY
- 30=M/D/YYYY,M/D/YYYY,h:mm:ss,h:mm:ss,h:mm:ss
- 35=h:mm:ss,M/D/YYYY,'#,##0_);(#,##0)','#,##0_);[Red](#,##0)','#,##0.00_);(#,##0.00)'
- 40='#,##0.00_);[Red](#,##0.00)'
- 41='_(* #,##0_);_(* \(#,##0\);_(* "-"_);_(@_)'
- 42='_("$"* #,##0_);_("$"* \(#,##0\);_("$"* "-"_);_(@_)'
- 43='_(* #,##0.00_);_(* \(#,##0.00\);_(* "-"??_);_(@_)'
- 44='_("$"* #,##0.00_);_("$"* \(#,##0.00\);_("$"* "-"??_);_(@_)'
- 45=mm:ss,[h]:mm:ss,mm:ss.0,##0.0E+0,@
- 50=M/D/YYYY,M/D/YYYY,M/D/YYYY,M/D/YYYY,M/D/YYYY
- 55=M/D/YYYY,M/D/YYYY,M/D/YYYY,M/D/YYYY,0
- 60=0.00,'#,##0','#,##0.00','$#,##0_);($#,##0)','$#,##0_);[Red]($#,##0)'
- 65='$#,##0.00_);($#,##0.00)','$#,##0.00_);[Red]($#,##0.00)',0%,0.00%,# ?/?
- 70=# ??/??,M/D/YYYY,M/D/YYYY,D-MMM-YY,D-MMM
- 75=MMM-YY,h:mm,h:mm:ss,M/D/YYYY h:mm,mm:ss
- 80=[h]:mm:ss,mm:ss.0
-end
-
-constlist=CONSTVALUE-TYPE
-begin
- 0=empty
- 1=number
- 2=string
- 4=boolean
- 16=error
-end
-
-# formulas -------------------------------------------------------------------
-
-multilist=BASETOKENS-BIFF2
-begin
- 0x01=tExp,tTbl,tAdd,tSub,tMul,tDiv,tPower
- 0x08=tConcat,tLT,tLE,tEQ,tGE,tGT,tNE,tIsect
- 0x10=tList,tRange,tUplus,tUminus,tPercent,tParen,tMissArg,tStr
- 0x19=tAttr,tSheet,tEndSheet,tErr,tBool,tInt,tNum
-end
-
-constlist=BASETOKENS-BIFF5
-begin
- include=BASETOKENS-BIFF2
- exclude=0x1A,0x1B
-end
-
-constlist=BASETOKENS-BIFF8
-begin
- include=BASETOKENS-BIFF5
- 0x18=tNlr
-end
-
-constlist=TOKENCLASSES
-begin
- 0x20=R
- 0x40=V
- 0x60=A
-end
-
-multilist=CLASSTOKENS-BIFF2
-begin
- 0x00=tArray,tFunc,tFuncVar,tName,tRef,tArea,tMemArea,tMemErr
- 0x08=tMemNoMem,tMemFunc,tRefErr,tAreaErr,tRefN,tAreaN,tMemAreaN,tMemNoMemN
- 0x18=tFuncCE
-end
-
-constlist=CLASSTOKENS-BIFF4
-begin
- include=CLASSTOKENS-BIFF2
- exclude=0x18
-end
-
-multilist=CLASSTOKENS-BIFF5
-begin
- include=CLASSTOKENS-BIFF4
- 0x19=tNameX,tRef3d,tArea3d,tRefErr3d,tAreaErr3d
-end
-
-multilist=FUNCTIONNAMES
-begin
- 0=COUNT,IF,ISNA,ISERROR,SUM,AVERAGE,MIN,MAX,ROW,COLUMN
- 10=NA,NPV,STDEV,DOLLAR,FIXED,SIN,COS,TAN,ATAN,PI
- 20=SQRT,EXP,LN,LOG10,ABS,INT,SIGN,ROUND,LOOKUP,INDEX
- 30=REPT,MID,LEN,VALUE,TRUE,FALSE,AND,OR,NOT,MOD
- 40=DCOUNT,DSUM,DAVERAGE,DMIN,DMAX,DSTDEV,VAR,DVAR,TEXT,LINEST
- 50=TREND,LOGEST,GROWTH,GOTO,HALT,RETURN,PV,FV,NPER,PMT
- 60=RATE,MIRR,IRR,RAND,MATCH,DATE,TIME,DAY,MONTH,YEAR
- 70=WEEKDAY,HOUR,MINUTE,SECOND,NOW,AREAS,ROWS,COLUMNS,OFFSET,ABSREF
- 80=RELREF,ARGUMENT,SEARCH,TRANSPOSE,ERROR,STEP,TYPE,ECHO,SET.NAME,CALLER
- 90=DEREF,WINDOWS,SERIES,DOCUMENTS,ACTIVE.CELL,SELECTION,RESULT,ATAN2,ASIN,ACOS
- 100=CHOOSE,HLOOKUP,VLOOKUP,LINKS,INPUT,ISREF,GET.FORMULA,GET.NAME,SET.VALUE,LOG
- 110=EXEC,CHAR,LOWER,UPPER,PROPER,LEFT,RIGHT,EXACT,TRIM,REPLACE
- 120=SUBSTITUTE,CODE,NAMES,DIRECTORY,FIND,CELL,ISERR,ISTEXT,ISNUMBER,ISBLANK
- 130=T,N,FOPEN,FCLOSE,FSIZE,FREADLN,FREAD,FWRITELN,FWRITE,FPOS
- 140=DATEVALUE,TIMEVALUE,SLN,SYD,DDB,GET.DEF,REFTEXT,TEXTREF,INDIRECT,REGISTER
- 150=CALL,ADD.BAR,ADD.MENU,ADD.COMMAND,ENABLE.COMMAND,CHECK.COMMAND,RENAME.COMMAND,SHOW.BAR,DELETE.MENU,DELETE.COMMAND
- 160=GET.CHART.ITEM,DIALOG.BOX,CLEAN,MDETERM,MINVERSE,MMULT,FILES,IPMT,PPMT,COUNTA
- 170=CANCEL.KEY,FOR,WHILE,BREAK,NEXT,INITIATE,REQUEST,POKE,EXECUTE,TERMINATE
- 180=RESTART,HELP,GET.BAR,PRODUCT,FACT,GET.CELL,GET.WORKSPACE,GET.WINDOW,GET.DOCUMENT,DPRODUCT
- 190=ISNONTEXT,GET.NOTE,NOTE,STDEVP,VARP,DSTDDEVP,DVARP,TRUNC,ISLOGICAL,DBCOUNTA
- 200=DELETE.BAR,UNREGISTER,,USDOLLAR,FINDB,SEARCHB,REPLACEB,LEFTB,RIGHTB
- 210=MIDB,LENB,ROUNDUP,ROUNDDOWN,ASC,DBCS,RANK,,,ADDRESS
- 220=DAYS360,TODAY,VDB,ELSE,ELSE.IF,END.IF,FOR.CELL,MEDIAN,SUMPRODUCT,SINH
- 230=COSH,TANH,ASINH,ACOSH,ATANH,DGET,CREATE.OBJECT,VOLATILE,LAST.ERROR,CUSTOM.UNDO
- 240=CUSTOM.REPEAT,FORMULA.CONVERT,GET.LINK.INFO,TEXT.BOX,INFO,GROUP,GET.OBJECT,DB,PAUSE,
- 250=,RESUME,FREQUENCY,ADD.TOOLBAR,DELETE.TOOLBAR,EXTERN.CALL,RESET.TOOLBAR,EVALUATE,GET.TOOLBAR,GET.TOOL
- 260=SPELLING.CHECK,ERROR.TYPE,APP.TITLE,WINDOW.TITLE,SAVE.TOOLBAR,ENABLE.TOOL,PRESS.TOOL,REGISTER.ID,GET.WORKBOOK,AVEDEV
- 270=BETADIST,GAMMALN,BETAINV,BINOMDIST,CHIDIST,CHIINV,COMBIN,CONFIDENCE,CRITBINOM,EVEN
- 280=EXPONDIST,FDIST,FINV,FISHER,FISHERINV,FLOOR,GAMMADIST,GAMMAINV,CEILING,HYPGEOMDIST
- 290=LOGNORMDIST,LOGINV,NEGBINOMDIST,NORMDIST,NORMSDIST,NORMINV,NORMSINV,STANDARDIZE,ODD,PERMUT
- 300=POISSON,TDIST,WEIBULL,SUMXMY2,SUMX2MY2,SUMX2PY2,CHITEST,CORREL,COVAR,FORECAST
- 310=FTEST,INTERCEPT,PEARSON,RSQ,STEYX,SLOPE,TTEST,PROB,DEVSQ,GEOMEAN
- 320=HARMEAN,SUMSQ,KURT,SKEW,ZTEST,LARGE,SMALL,QUARTILE,PERCENTILE,PERCENTRANK
- 330=MODE,TRIMMEAN,TINV,,MOVIE.COMMAND,GET.MOVIE,CONCATENATE,POWER,PIVOT.ADD.DATA,GET.PIVOT.TABLE
- 340=GET.PIVOT.FIELD,GET.PIVOT.ITEM,RADIANS,DEGREES,SUBTOTAL,SUMIF,COUNTIF,COUNTBLANK,SCENARIO.GET,OPTIONS.LISTS.GET
- 350=ISPMT,DATEDIF,DATESTRING,NUMBERSTRING,ROMAN,OPEN.DIALOG,SAVE.DIALOG,VIEW.GET,GETPIVOTDATA,HYPERLINK
- 360=PHONETIC,AVERAGEA,MAXA,MINA,STDEVPA,VARPA,STDEVA,VARA,BAHTTEXT,THAIDAYOFWEEK
- 370=THAIDIGIT,THAIMONTHOFYEAR,THAINUMSOUND,THAINUMSTRING,THAISTRINGLENGTH,ISTHAIDIGIT,ROUNDBAHTDOWN,ROUNDBAHTUP,THAIYEAR,RTD
- 380=ISHYPERLINK
-end
-
-combilist=PARAMCOUNT
-begin
- 0x7F=uint8,dec,count
- 0x80=prompt
-end
-
-combilist=REFRELFLAGS
-begin
- 0x3FFF=uint16,dec,value
- 0x4000=col-rel
- 0x8000=row-rel
-end
-
-multilist=NLRTYPES
-begin
- 0x00=,tNlrErr,tNlrRowR,tNlrColR,,,tNlrRowV,tNlrColV
- 0x08=,,tNlrRange,tNlrSRange,tNlrSRowR,tNlrSColR,tNlrSRowV,tNlrSColV
- 0x10=tNlrRangeErr,,,,,,,
- 0x18=,,,,,tNlrSxName,,
-end
-
-combilist=NLRADDFLAGS
-begin
- 0x3FFFFFFF=uint32,dec,count
- 0x80000000=rel
-end
-
-flagslist=ATTRTYPES
-begin
- 0x01=volatile
- 0x02=if
- 0x04=choose
- 0x08=skip
- 0x10=sum
- 0x20=assign
- 0x40=space
-end
-
-multilist=ATTRSPACETYPES
-begin
- 0=space-before-token,cr-before-token,space-before-open,cr-before-open,space-before-close,cr-before-close,leading-space
-end
-
-# record names ---------------------------------------------------------------
-
-multilist=RECORD-NAMES-BIFF2
-begin
- # worksheet records
- 0x0000=DIMENSIONS,BLANK,INTEGER,NUMBER,LABEL,BOOLERR,FORMULA,STRING
- 0x0008=ROW,BOF,EOF,INDEX,CALCCOUNT,CALCMODE,PRECISION,REFMODE
- 0x0010=DELTA,ITERATION,PROTECT,PASSWORD,HEADER,FOOTER,EXTERNCOUNT,EXTERNSHEET
- 0x0018=NAME,WINDOWPROTECT,VERTICALPAGEBREAKS,HORIZONTALPAGEBREAKS,NOTE,SELECTION,FORMAT,BUILTINFMTCOUNT
- 0x0020=COLUMNDEFAULT,ARRAY,DATEMODE,EXTERNNAME,COLWIDTH,DEFAULTROWHEIGHT,LEFTMARGIN,RIGHTMARGIN
- 0x0028=TOPMARGIN,BOTTOMMARGIN,PRINTHEADERS,PRINTGRIDLINES,,,,FILEPASS
- 0x0030=,FONT,FONT2,PRINTSIZE,,INFOOPTS,TABLE,TABLE2
- 0x0038=WNDESK,,BEGINPREF,ENDPREF,CONTINUE,WINDOW1,WINDOW2,
- 0x0040=BACKUP,PANE,CODEPAGE,XF,IXFE,EFONT,SHOWSCROLL,SHOWFORMULA
- 0x0048=STATUSBAR,SHORTMENUS,DDEENABLED,AUTODEC,MENUKEY,PLS|ZOOM,MENUUND,MOVESEL
- 0x0050=DCON,DCONREF,DCONNAME,,,DEFCOLWIDTH,,
- # worksheet records new in BIFF3, but supported in BIFF2 streams
- 0x0200=DIMENSIONS,BLANK,,NUMBER,LABEL,BOOLERR,,
- 0x027E=RK
- # BIFF5 style BOF
- 0x0809=BOF
- # chart records
- 0x1000=,CHUNITS,CHCHART,CHSERIES,CHSOURCELINK,,CHDATAFORMAT,CHLINEFORMAT
- 0x1008=,CHMARKERFORMAT,CHAREAFORMAT,CHPIEFORMAT,CHATTACHEDLABEL,CHSTRING,,
- 0x1010=,,,,CHTYPEGROUP,CHLEGEND,CHSERIESLIST,CHBAR
- 0x1018=CHLINE,CHPIE,CHAREA,CHSCATTER,CHCHARTLINE,CHAXIS,CHTICK,CHVALUERANGE
- 0x1020=CHLABELRANGE,CHAXISLINE,CHFORMATLINK,,CHDEFAULTTEXT,CHTEXT,CHFONT,CHOBJECTLINK
- 0x1028=,,,,,CHARROW,,CHARROWHEAD
- 0x1030=,,CHFRAME,CHBEGIN,CHEND,CHPLOTFRAME,CHCHARTSIZE,CHRELPOSITION
- 0x1038=CHARROWRELPOS,,CHCHART3D,,,,,
-end
-
-multilist=RECORD-NAMES-BIFF3
-begin
- include=RECORD-NAMES-BIFF2
- # worksheet records
- exclude=0x0006,0x0008,0x0009,0x000B,0x0018,0x0020,0x0021,0x0023,0x0024,0x0025,0x0031,0x0036,0x0037,0x003E,0x0043,0x0044,0x0045
- 0x0050=,,,,,,BUILTINFMTCOUNT,
- 0x0058=TOOLBAR,XCT,CRN,FILESHARING,WRITEACCESS,OBJ,UNCALCED,SAFERECALC
- 0x0060=TEMPLATE,INTL,,OBJPROTECT,,,,
- 0x0068=,,,,,,,
- 0x0070=,,,,,,,
- 0x0078=,,,,,COLINFO,,IMDATA
- 0x0080=GUTS,WSBOOL,GRIDSET,HCENTER,VCENTER,,WRITEPROT,ADDIN
- 0x0088=EDG,PUB,NOTEOFF,LH,COUNTRY,HIDEOBJ,,
- 0x0090=SORT,SUB,PALETTE,,LHRECORD,LHNGRAPH,,
- 0x0200=,,,,,,FORMULA,STRING
- 0x0208=ROW,BOF,,INDEX,,,,
- 0x0218=NAME
- 0x0221=ARRAY
- 0x0223=EXTERNNAME
- 0x0225=DEFAULTROWHEIGHT
- 0x0231=FONT
- 0x0236=TABLE
- 0x023E=WINDOW2
- 0x0243=XF
- 0x0293=STYLE
- # chart records
- 0x103C=CHPICFORMAT
-end
-
-multilist=RECORD-NAMES-BIFF4
-begin
- include=RECORD-NAMES-BIFF3
- # worksheet/workbook records
- exclude=0x0206,0x0209,0x001E,0x0243
- 0x0085=BOUNDSHEET
- 0x0088=,,,,,,SHEETSOFFSET,SHEETHEADER
- 0x0090=,,,,,SOUND,SYNC
- 0x0098=LPR,STANDARDWIDTH,FNGROUPNAME,,FNGROUPCOUNT,,,
- 0x00A0=SCL,SETUP,FNPROTO,PROJEXTSHEET,,,,
- 0x00A8=DRAGDROP,COORDLIST,,GCW,,,,
- 0x0406=FORMULA
- 0x0409=BOF
- 0x041E=FORMAT
- 0x0443=XF
- 0x04BC=SHRFMLA
- # chart records
- 0x1038=,,,CHMULTILINK,,CHDROPBAR,CHRADARLINE,CHSURFACE
-end
-
-multilist=RECORD-NAMES-BIFF5
-begin
- include=RECORD-NAMES-BIFF4
- # worksheet/workbook records
- exclude=0x0409,0x0218,0x0223,0x0231,0x0443
- 0x0006=FORMULA
- 0x0018=NAME
- 0x0023=EXTERNNAME
- 0x0031=FONT
- 0x0098=,,,FILTERMODE,,AUTOFILTERINFO,AUTOFILTER,
- 0x00A8=,,,,,,SCENMAN,SCENARIO
- 0x00B0=SXVIEW,SXVD,SXVI,,SXIVD,SXLI,SXPI,
- 0x00B8=DOCROUTE,RECIPNAME,,,SHRFMLA,MULRK,MULBLANK,
- 0x00C0=,MMS,ADDMENU,DELMENU,,SXDI,SXDB,SXFIELD
- 0x00C8=SXINDEXLIST,SXDOUBLE,SXBOOLEAN,SXERROR,SXINTEGER,SXSTRING,SXDATETIME,SXEMPTY
- 0x00D0=SXTBL,SXTBRGITEM,SXTBPG,OBPROJ,,SXIDSTM,RSTRING,DBCELL
- 0x00D8=SXNUMGROUP,SXGROUPINFO,BOOKBOOL,REVERT,SXEXT|PARAMQRY,SCENPROTECT,OLESIZE,UDDESC
- 0x00E0=XF,INTERFACEHDR,INTERFACEEND,SXVS,,,,
- 0x0206=FORMULA
- # chart records
- exclude=0x1004,0x102D,0x102F,0x1036,0x1037,0x1038,0x103B
- 0x1040=CHRADARAREA,CHAXESSET,,CHLEGENDENTRY,CHPROPERTIES,CHSERGROUP,CHUSEDAXESSETS,
- 0x1048=CHPIVOTREF,,CHSERPARENT,CHSERTRENDLINE,,,CHFORMAT,CHPOS
- 0x1050=CHFORMATRUNS,CHSOURCELINK,,,,,,
- 0x1058=,,,CHSERERRORBAR,,CHSERIESFORMAT,,
-end
-
-multilist=RECORD-NAMES-BIFF8
-begin
- include=RECORD-NAMES-BIFF5
- # worksheet/workbook records
- 0x00E0=,,,,,CELLMERGING,,
- 0x00E8=,BITMAP,,MSODRAWINGGROUP,MSODRAWING,MSODRAWINGSELECTION,,PHONETIC
- 0x00F0=SXRULE,SXEX,SXFILT,,,,SXNAME,SXSELECT
- 0x00F8=SXPAIR,SXFMLA,,SXFORMAT,SST,LABELSST,,EXTSST
- 0x0100=SXVDEX,,,SXFORMULA,,,,
- 0x0120=,,SXDBEX,,,,,
- 0x0130=,,,,,,,CHTRINSERT
- 0x0138=CHTRINFO,,,CHTRCELLCONTENT,,TABID,,
- 0x0140=CHTRMOVERANGE,,,,,,,
- 0x0148=,,,,,CHTRINSERTTAB,,
- 0x0158=,,,,,,,LABELRANGES
- 0x0160=USESELFS,DSF,XL5MODIFY,,,,,
- 0x0190=,,,,,,CHTRHEADER,
- 0x01A8=,USERBVIEW,USERSVIEWBEGIN,USERSVIEWEND,,QSI,SUPBOOK,PROT4REV
- 0x01B0=CONDFMT,CF,DVAL,,,DCONBIN,TXO,REFRESHALL
- 0x01B8=HLINK,NLRDELNAME,CODENAME,SXFDBTYPE,PROT4REVPASS,,DV,
- 0x0800=SCREENTIP,,,WEBQRYSETTINGS,WEBQRYTABLES,,,
- 0x0850=,CHWRAPPEDRECORD,,,,,,CHUNITPROPERTIES
- 0x0858=CHPIVOTREF,,,,,,,
- 0x0860=,,SHEETLAYOUT,,,,,SHEETPROTECTION
- # chart records
- 0x1058=,,,,,,,CH3DDATAFORMAT
- 0x1060=CHFONTBASE,CHPIEEXT,CHLABELRANGE2,CHDATATABLE,CHPLOTGROWTH,CHSERINDEX,CHESCHERFORMAT,CHPIEEXTSETT
-end
-
-# simple records -------------------------------------------------------------
-
-constlist=SIMPLE-RECORDS-BIFF2
-begin
- 0x000C=uint16,dec,max-iterations
- 0x000D=int16,dec,calc-mode,CALCMODE
- 0x000E=uint16,bool,calc-precise
- 0x000F=uint16,dec,ref-mode,REFMODE
- 0x0010=double,dec,epsilon
- 0x0011=uint16,bool,iterate-recursive
- 0x0012=uint16,bool,workbook-protected
- 0x0013=uint16,hex,password-hash
- 0x0016=uint16,dec,externsheets
- 0x0019=uint16,bool,window-protected
- 0x001F=uint16,dec,builtin-fmt-count
- 0x0022=uint16,dec,null-date,DATEMODE
- 0x0025=uint16,hex,rowheight-flags,DEFROWHEIGHT-FLAGS
- 0x0026=double,dec,left-margin,CONV-INCH-TO-CM
- 0x0027=double,dec,right-margin,CONV-INCH-TO-CM
- 0x0028=double,dec,top-margin,CONV-INCH-TO-CM
- 0x0029=double,dec,bottom-margin,CONV-INCH-TO-CM
- 0x002A=uint16,bool,print-sheet-headers
- 0x002B=uint16,bool,print-gridlines
- 0x0040=uint16,bool,backup-on-save
- 0x0044=uint16,dec,xf-idx
- 0x0045=uint16,dec,font-color-idx,COLORS
- 0x0055=uint16,dec,default-col-width
- 0x100B=uint16,dec,extrusion,CONV-PERCENT
- 0x100C=uint16,hex,flags,CHATTACHEDLABEL-FLAGS
- 0x1018=uint16,hex,flags,CHLINE-FLAGS
- 0x101A=uint16,hex,flags,CHAREA-FLAGS
- 0x101C=uint16,dec,line-type,CHCHARTLINE-TYPE
- 0x1021=uint16,dec,axisline-id,CHAXISLINE-ID
- 0x1024=uint16,dec,text-idx
- 0x1026=uint16,dec,font-idx,FONTNAMES
- 0x1045=uint16,dec,group-idx
- 0x1046=uint16,dec,used-axessets
- 0x104A=uint16,dec,series-idx
- 0x104E=uint16,dec,fmt-idx,FORMATS
-end
-
-constlist=SIMPLE-RECORDS-BIFF3
-begin
- include=SIMPLE-RECORDS-BIFF2
- 0x0056=uint16,dec,builtin-fmt-count
- 0x005E=uint16,unused
- 0x005F=uint16,bool,recalc-on-save
- 0x0063=uint16,bool,objects-protected
- 0x0081=uint16,hex,flags,WSBOOL-FLAGS
- 0x0082=uint16,bool,print-gridlines-changed
- 0x0083=uint16,bool,horizontal-centered
- 0x0084=uint16,bool,vertical-centered
- 0x008D=uint16,dec,object-mode,HIDEOBJ
-end
-
-constlist=SIMPLE-RECORDS-BIFF4
-begin
- include=SIMPLE-RECORDS-BIFF3
- 0x0099=uint16,dec,standard-col-width,CONV-COLWIDTH
- 0x009C=uint16,dec,func-group-count
- 0x103D=uint16,dec,bar-dist
- 0x103E=uint16,hex,flags,CHRADAR-FLAGS
- 0x103F=uint16,hex,flags,CHSURFACE-FLAGS
-end
-
-constlist=SIMPLE-RECORDS-BIFF5
-begin
- include=SIMPLE-RECORDS-BIFF4
- 0x00C9=double,dec,value
- 0x00CA=uint16,bool,value
- 0x00CB=uint16,hex,error-code,ERRORCODES
- 0x00CC=int16,dec,value
- 0x00D5=uint16,hex,pivotcache-stream-id
- 0x00D8=uint16,hex,flags,SXNUMGROUP-FLAGS
- 0x00DA=uint16,bool,strip-cached-values
- 0x00DD=uint16,bool,scenarios-protected
- 0x00E3=uint16,dec,source-type,SXVS-TYPE
- 0x1040=uint16,hex,flags,CHRADAR-FLAGS
- 0x105D=uint16,hex,flags,CHSERIESFORMAT-FLAGS
-end
-
-constlist=SIMPLE-RECORDS-BIFF8
-begin
- include=SIMPLE-RECORDS-BIFF5
- 0x00E1=uint16,dec,codepage,CODEPAGES
- 0x0160=uint16,bool,use-nat-lang-refs
- 0x0161=uint16,bool,double-stream
- 0x01AF=uint16,bool,revlog-protected
- 0x01B7=uint16,bool,refresh-all
- 0x01BB=uint16,dec,sql-data-type,SXFDBTYPE-DATATYPE
- 0x01BC=uint16,hex,password-hash
- 0x1065=uint16,dec,series-idx
-end
-
-# BOF ------------------------------------------------------------------------
-
-constlist=BOF-BIFFTYPE
-begin
- 0x0000=from-id
- 0x0007=biff2
- 0x0200=biff2
- 0x0300=biff3
- 0x0400=biff4
- 0x0500=biff5
- 0x0600=biff8
-end
-
-constlist=BOF-SHEETTYPE
-begin
- 0x0005=globals
- 0x0006=vb-module
- 0x0010=sheet
- 0x0020=chart
- 0x0040=macro
- 0x0100=workspace
-end
-
-flagslist=BOF-HISTORY-FLAGS
-begin
- 0x00000001=windows
- 0x00000002=risc
- 0x00000004=beta
- 0x00000008=win-any
- 0x00000010=mac-any
- 0x00000020=beta-any
- 0x00000100=risc-any
- # missing mac here?
-end
-
-# CALCMODE -------------------------------------------------------------------
-
-shortlist=CALCMODE,-1,automatic-no-table,manual,automatic
-
-# CH3DDATAFORMAT -------------------------------------------------------------
-
-shortlist=CH3DDATAFORMAT-BASE,0,rectangular,circular
-shortlist=CH3DDATAFORMAT-TOP,0,straight,sharp,trunc
-
-# CHAREA ---------------------------------------------------------------------
-
-flagslist=CHAREA-FLAGS
-begin
- 0x0001=stacked
- 0x0002=percent
- 0x0004=shadow
-end
-
-# CHAREAFORMAT ---------------------------------------------------------------
-
-flagslist=CHAREAFORMAT-FLAGS
-begin
- 0x0001=auto
- 0x0002=swap-negative
-end
-
-# CHATTACHEDLABEL ------------------------------------------------------------
-
-flagslist=CHATTACHEDLABEL-FLAGS
-begin
- 0x0001=show-value
- 0x0002=show-percent
- 0x0004=show-categ-percent
- 0x0008=smoothed
- 0x0010=show-categ
- 0x0020=show-bubble
-end
-
-# CHAXESSET ------------------------------------------------------------------
-
-shortlist=CHAXESSET-ID,0,primary,secondary
-
-# CHAXIS ---------------------------------------------------------------------
-
-shortlist=CHAXIS-TYPE,0,x-axis,y-axis,z-axis
-
-# CHAXISLINE -----------------------------------------------------------------
-
-shortlist=CHAXISLINE-ID,0,axisline,major-grid,minor-grid,wall
-
-# CHBAR ----------------------------------------------------------------------
-
-flagslist=CHBAR-FLAGS
-begin
- 0x0001=horizontal
- 0x0002=stacked
- 0x0004=percent
- 0x0008=shadow
-end
-
-# CHCHART3D ------------------------------------------------------------------
-
-flagslist=CHCHART3D-FLAGS
-begin
- 0x0001=real3d
- 0x0002=clustered
- 0x0004=auto-height
- 0x0010=has-walls
- 0x0020=2d-plotarea
-end
-
-# CHTYPEGROUP ----------------------------------------------------------------
-
-flagslist=CHTYPEGROUP-FLAGS
-begin
- 0x0001=varied-colors
-end
-
-# CHCHARTLINE ----------------------------------------------------------------
-
-shortlist=CHCHARTLINE-TYPE,0,drop-line,hi-lo-line,series-connector
-
-# CHDATAFORMAT ---------------------------------------------------------------
-
-constlist=CHDATAFORMAT-POINTIDX
-begin
- default=''
- -1=all-points
-end
-
-constlist=CHDATAFORMAT-FORMATIDX
-begin
- default=''
- -3=axesset-global
-end
-
-flagslist=CHDATAFORMAT-FLAGS
-begin
- 0x0001=excel4-colors
-end
-
-# CHFRAME --------------------------------------------------------------------
-
-shortlist=CHFRAME-FORMAT,0,standard,,,,shadow
-
-flagslist=CHFRAME-FLAGS
-begin
- 0x0001=auto-size
- 0x0002=auto-pos
-end
-
-# CHFRAMEPOS -----------------------------------------------------------------
-
-shortlist=CHFRAMEPOS-OBJTYPE,2,any,,,legend
-shortlist=CHFRAMEPOS-SIZEMODE,1,manual,auto
-
-# CHLABELRANGE ---------------------------------------------------------------
-
-flagslist=CHLABELRANGE-FLAGS
-begin
- 0x0001=cross-between-categ
- 0x0002=maximum-axis-cross
- 0x0004=reverse-order
-end
-
-# CHLABELRANGE2 --------------------------------------------------------------
-
-flagslist=CHLABELRANGE2-FLAGS
-begin
- 0x0001=auto-minimum
- 0x0002=auto-maximum
- 0x0004=auto-major
- 0x0008=auto-minor
- 0x0010=date-axis
- 0x0020=auto-base
- 0x0040=auto-axis-cross
- 0x0080=auto-date
-end
-
-# CHLEGEND -------------------------------------------------------------------
-
-shortlist=CHLEGEND-DOCKPOS,0,bottom,top-left,top,right,left,,,manual
-shortlist=CHLEGEND-SPACING,0,close,medium,open
-
-flagslist=CHLEGEND-FLAGS
-begin
- 0x0001=docked
- 0x0002=auto-series
- 0x0004=auto-pos-x
- 0x0008=auto-pos-y
- 0x0010=stacked
- 0x0020=data-table
-end
-
-# CHLINE ---------------------------------------------------------------------
-
-flagslist=CHLINE-FLAGS
-begin
- 0x0001=stacked
- 0x0002=percent
- 0x0004=shadow
-end
-
-# CHLINEFORMAT ---------------------------------------------------------------
-
-shortlist=CHLINEFORMAT-LINETYPE,0,solid,dash,dot,dash-dot,dash-dot-dot,none,25%-pattern,50%-pattern,75%-pattern
-shortlist=CHLINEFORMAT-LINEWEIGHT,-1,hair,thin,medium,thick
-
-flagslist=CHLINEFORMAT-FLAGS
-begin
- 0x0001=auto
- 0x0004=axis-enabled
-end
-
-# CHMARKERFORMAT -------------------------------------------------------------
-
-shortlist=CHMARKERFORMAT-TYPE,0,none,square,diamond,triangle,cross,star,dow-jones,std-dev,circle,plus
-
-flagslist=CHMARKERFORMAT-FLAGS
-begin
- 0x0001=auto
- 0x0010=no-fill
- 0x0020=no-border
-end
-
-# CHOBJECTLINK ---------------------------------------------------------------
-
-shortlist=CHOBJECTLINK-TARGET,0,none,title,y-axis,x-axis,datapoint,legend,none,z-axis,,,,,axis-unit
-
-constlist=CHOBJECTLINK-POINT
-begin
- default=''
- -2=unknown
- -1=all-points
-end
-
-# CHPICFORMAT ----------------------------------------------------------------
-
-shortlist=CHPICFORMAT-BITMAP-MODE,1,stretched,stacked,stacked-scaled
-
-constlist=CHPICFORMAT-IMAGE-FORMAT
-begin
- 2=wmf
- 9=bmp
- 19=?emf
-end
-
-shortlist=CHPICFORMAT-ENV,1,windows,apple
-
-combilist=CHPICFORMAT-FLAGS
-begin
- 0x00FF=uint16,dec,environment,CHPICFORMAT-ENV
- 0x0100=format-only
- 0x0200=top-bottom
- 0x0400=front-back
- 0x0800=left-right
-end
-
-# CHPIE ----------------------------------------------------------------------
-
-flagslist=CHPIE-FLAGS
-begin
- 0x0001=shadow
- 0x0002=connectors
-end
-
-# CHRADAR, CHRADARAREA -------------------------------------------------------
-
-flagslist=CHRADAR-FLAGS
-begin
- 0x0001=axis-labels
- 0x0002=shadow
-end
-
-# CHPROPERTIES ---------------------------------------------------------------
-
-shortlist=CHPROPERTIES-EMPTYCELLS,0,do-not-plot,as-zero,interpolated
-
-flagslist=CHPROPERTIES-FLAGS
-begin
- 0x0001=manual-format
- 0x0002=plot-visible-only
- 0x0004=fixed-size
- 0x0008=manual-plotarea
-end
-
-# CHSCATTER ------------------------------------------------------------------
-
-shortlist=CHSCATTER-SIZETYPE,0,none,area,width
-
-flagslist=CHSCATTER-FLAGS
-begin
- 0x0001=bubbles
- 0x0002=show-negative
- 0x0004=shadow
-end
-
-# CHSERERRORBAR --------------------------------------------------------------
-
-shortlist=CHSERERRORBAR-TYPE,1,x-plus,x-minus,y-plus,y-minus
-shortlist=CHSERERRORBAR-SOURCE,1,percent,fixed,std-deviation,custom,std-error
-
-# CHSERIES -------------------------------------------------------------------
-
-shortlist=CHSERIES-TYPE,0,date,numeric,sequence,text
-
-# CHSERIESFORMAT -------------------------------------------------------------
-
-flagslist=CHSERIESFORMAT-FLAGS
-begin
- 0x0001=spline
- 0x0002=bubbles-3d
- 0x0004=shadow
-end
-
-# CHSERTRENDLINE -------------------------------------------------------------
-
-shortlist=CHSERTRENDLINE-TYPE,0,poynomial,exponential,logarithmic,power,moving-average
-
-# CHSOURCELINK ---------------------------------------------------------------
-
-shortlist=CHSOURCELINK-TARGET,0,title,values,category,bubbles
-shortlist=CHSOURCELINK-TYPE,0,default,constant,sheet-link
-
-flagslist=CHSOURCELINK-FLAGS
-begin
- 0x0001=custom-numfmt
-end
-
-# CHSTRING -------------------------------------------------------------------
-
-shortlist=CHSTRING-TYPE,0,text,category-default,value-default,x-prefix,x-postfix,y-prefix,y-postfix,comment
-
-# CHSURFACE ------------------------------------------------------------------
-
-flagslist=CHSURFACE-FLAGS
-begin
- 0x0001=filled
- 0x0002=shadow
-end
-
-# CHTEXT ---------------------------------------------------------------------
-
-shortlist=CHTEXT-HORALIGN,1,left,center,right,block,distribute
-shortlist=CHTEXT-VERALIGN,1,top,center,bottom,block,distribute
-shortlist=CHTEXT-FILLMODE,1,transparent,opaque
-
-combilist=CHTEXT-FLAGS-BIFF2
-begin
- 0x0001=auto-color
- 0x0002=show-symbol
- 0x0004=show-value
- 0x0008=vertical
- 0x0010=auto-text
- 0x0020=default-format
- 0x0040=deleted
- 0x0080=auto-fill
-end
-
-combilist=CHTEXT-FLAGS-BIFF3
-begin
- include=CHTEXT-FLAGS-BIFF2
- 0x0700=uint8,dec,orientation,TEXTORIENTATION
-end
-
-combilist=CHTEXT-FLAGS-BIFF5
-begin
- include=CHTEXT-FLAGS-BIFF3
- 0x0800=show-categ-percent
- 0x1000=show-percent
-end
-
-combilist=CHTEXT-FLAGS-BIFF8
-begin
- include=CHTEXT-FLAGS-BIFF5
- 0x2000=show-bubble-size
- 0x4000=show-categ
-end
-
-shortlist=CHTEXT-PLACEMENT-BIFF8,0,default,outside,inside,center,axis,above,below,left,right,auto,manual
-
-combilist=CHTEXT-FLAGS2-BIFF8
-begin
- ignore=0xFFF0
- 0x000F=uint8,dec,placement,CHTEXT-PLACEMENT-BIFF8
-end
-
-# CHTICK ---------------------------------------------------------------------
-
-shortlist=CHTICK-TYPE,0,none,inside,outside,both
-# TODO: really different label positions in BIFF2-BIFF4?
-shortlist=CHTICK-LABELPOS-BIFF2,0,none,near,below,above
-shortlist=CHTICK-LABELPOS-BIFF5,0,none,below,above,near
-
-flagslist=CHTICK-FLAGS-BIFF2
-begin
- 0x0001=auto-color
- 0x0002=auto-fill
-end
-
-combilist=CHTICK-FLAGS-BIFF3
-begin
- include=CHTICK-FLAGS-BIFF2
- 0x001C=uint8,dec,orientation,TEXTORIENTATION
- 0x0020=auto-rotation
-end
-
-# CHUNITPROPERTIES -----------------------------------------------------------
-
-shortlist=CHUNITPROPERTIES-PRESET,-1,manual,none,hundred,thousand,(10000),(100000),million,(10million),(100million),billion,trillion
-
-flagslist=CHUNITPROPERTIES-FLAGS
-begin
- 0x0002=show-unit
-end
-
-# CHVALUERANGE ---------------------------------------------------------------
-
-flagslist=CHVALUERANGE-FLAGS
-begin
- ignore=0x0100
- 0x0001=auto-minimum
- 0x0002=auto-maximum
- 0x0004=auto-major
- 0x0008=auto-minor
- 0x0010=auto-axis-cross
- 0x0020=logarithmic
- 0x0040=reverse-order
- 0x0080=maximum-axis-cross
-end
-
-# COLINFO --------------------------------------------------------------------
-
-combilist=COLINFO-FLAGS
-begin
- 0x0001=hidden
- 0x0700=uint8,dec,outline-level
- 0x1000=outline-collapsed
-end
-
-# DATEMODE -------------------------------------------------------------------
-
-shortlist=DATEMODE,0,1899-12-31,1904-01-01
-
-# DEFROWHEIGHT ---------------------------------------------------------------
-
-combilist=DEFROWHEIGHT-FLAGS-BIFF2
-begin
- 0x7FFF=uint16,dec,row-height,CONV-TWIP-TO-PT
- 0x8000=unchanged
-end
-
-flagslist=DEFROWHEIGHT-FLAGS-BIFF3
-begin
- 0x0001=unsynced
- 0x0002=hidden
- 0x0004=add-space-above
- 0x0008=add-space-below
-end
-
-# FONT -----------------------------------------------------------------------
-
-flagslist=FONT-FLAGS
-begin
- 0x0001=bold
- 0x0002=italic
- 0x0004=underline
- 0x0008=strikeout
-end
-
-constlist=FONT-WEIGHT
-begin
- 400=normal
- 700=bold
-end
-
-multilist=FONT-UNDERLINE
-begin
- 0x00=none,single,double
- 0x21=single-acc,double-acc
-end
-
-constlist=FONT-CHARSET
-begin
- 0=win-1252-latin-1
- 1=system-default
- 2=symbol
- 77=apple-roman
- 128=win-932-japanese-shift-jis
- 129=win-949-korean-hangul
- 130=win-1361-korean-johab
- 134=win-936-chinese-simplified-gbk
- 136=win-950-chinese-traditional-big5
- 161=win-1253-greek
- 162=win-1254-turkish
- 163=win-1258-vietnamese
- 177=win-1255-hebrew
- 178=win-1256-arabic
- 186=win-1257-baltic
- 204=win-1251-cyrillic
- 222=win-874-thai
- 238=win-1250-latin-2-central-european
- 255=ibm-850-latin-1
-end
-
-shortlist=FONT-ESCAPEMENT,0,none,superscript,subscript
-shortlist=FONT-FAMILY,0,none,roman,swiss,modern,script,decorative
-
-# FORMULA --------------------------------------------------------------------
-
-flagslist=FORMULA-FLAGS-BIFF2
-begin
- 0x0001=recalc-always
-end
-
-flagslist=FORMULA-FLAGS-BIFF3
-begin
- include=FORMULA-FLAGS-BIFF2
- 0x0002=recalc-onload
-end
-
-flagslist=FORMULA-FLAGS-BIFF5
-begin
- include=FORMULA-FLAGS-BIFF3
- 0x0008=shared-fmla
-end
-
-shortlist=FORMULA-RESULTTYPE,0,string,boolean,error,empty
-
-# HIDEOBJ --------------------------------------------------------------------
-
-shortlist=HIDEOBJ,0,show,placeholder,hide
-
-# OBJ ------------------------------------------------------------------------
-
-multilist=OBJ-TYPE-BIFF5
-begin
- 0=group,line,rect,oval,arc,chart,textbox,button,pic,polygon
- 10=,checkbox,optbutton,edit,label,dialog,spin,scrollbar,listbox,groupbox
- 20=dropdown
-end
-
-multilist=OBJ-TYPE-BIFF8
-begin
- include=OBJ-TYPE-BIFF5
- 25=note
- 30=drawing
-end
-
-flagslist=OBJ-FLAGS-BIFF5
-begin
- 0x0001=selected
- 0x0002=auto-size
- 0x0004=auto-move
- 0x0010=protected
- 0x0080=grouped
- 0x0100=hidden
- 0x0200=visible
- 0x0400=printable
-end
-
-flagslist=OBJ-FLAGS-AUTO-BIFF5
-begin
- 0x0001=auto
-end
-
-shortlist=OBJ-LINETYPE,0,solid,dash,dot,dash-dot,dash-dot-dot,25%-pattern,50%-pattern,75%-pattern
-shortlist=OBJ-LINEWEIGHT,0,hair,thin,medium,thick
-
-shortlist=OBJ-ARROWHEAD-TYPE-BIFF5,0,none,open,filled,double-end-open,double-end-filled
-shortlist=OBJ-ARROWHEAD-WIDTH-BIFF5,0,narrow,medium,wide
-shortlist=OBJ-ARROWHEAD-LENGTH-BIFF5,0,short,medium,long
-
-combilist=OBJ-LINEENDS-BIFF5
-begin
- 0x000F=uint8,dec,arrowhead-type,OBJ-ARROWHEAD-TYPE
- 0x00F0=uint8,dec,arrowhead-width,OBJ-ARROWHEAD-WIDTH
- 0x0F00=uint8,dec,arrowhead-length,OBJ-ARROWHEAD-LENGTH
-end
-
-shortlist=OBJ-LINEDIR-BIFF5,0,topleft-to-bottomright,topright-to-bottomleft,bottomright-to-topleft,bottomleft-to-topright
-
-combilist=OBJ-FRAMESTYLE-FLAGS-BIFF5
-begin
- 0x0001=rounded
- 0x0002=shadow
- 0x03FC=uint16,dec,rounded-diameter
-end
-
-flagslist=OBJ-CHART-FLAGS-BIFF5
-begin
- 0x0001=linked-to-sheet
-end
-
-# NAME -----------------------------------------------------------------------
-
-flagslist=NAME-FLAGS-BIFF2
-begin
- 0x02=macro
- 0x04=complex
-end
-
-shortlist=NAME-MACROTYPE-BIFF2,0,none,function,procedure
-
-flagslist=NAME-FLAGS-BIFF3
-begin
- 0x0001=hidden
- 0x0002=function
- 0x0004=command
- 0x0008=macro
- 0x0010=complex
- 0x0020=builtin
-end
-
-combilist=NAME-FLAGS-BIFF4
-begin
- include=NAME-FLAGS-BIFF3
- 0x0FC0=uint16,dec,func-group,NAME-FUNCGROUP
-end
-
-combilist=NAME-FLAGS-BIFF5
-begin
- include=NAME-FLAGS-BIFF4
- 0x0004=vba
- 0x1000=binary
-end
-
-shortlist=NAME-FUNCGROUP,0,none,financial,date-time,math-trig,statistical,lookup-ref,database,text,logical,information,commands,customizing,macro-control,dde-external,user-definded
-
-constlist=NAME-SHEETIDX
-begin
- default=''
- 0=global
-end
-
-# REFMODE --------------------------------------------------------------------
-
-shortlist=REFMODE,0,R1C1,A1
-
-# ROW ------------------------------------------------------------------------
-
-combilist=ROW-HEIGHT
-begin
- 0x7FFF=uint16,dec,height,CONV-TWIP-TO-PT
- 0x8000=default-height
-end
-
-combilist=ROW-FLAGS
-begin
- ignore=0x00000100
- 0x00000007=uint8,dec,outline-level
- 0x00000010=outline-collapsed
- 0x00000020=hidden
- 0x00000040=manual-height
- 0x00000080=has-default-xf
- 0x0FFF0000=uint16,dec,default-xf-idx
- 0x10000000=add-space-above
- 0x20000000=add-space-below
-end
-
-# common for pivot tables ----------------------------------------------------
-
-constlist=SX-NAMELEN
-begin
- default=''
- 0xFFFF=name-in-cache
-end
-
-# SXDB -----------------------------------------------------------------------
-
-flagslist=SXDB-FLAGS
-begin
- 0x0001=save-data
- 0x0002=invalid
- 0x0004=refresh-on-load
- 0x0008=opt-cache
- 0x0010=backgr-query
- 0x0020=enable-refresh
-end
-
-constlist=SXDB-TYPE
-begin
- 1=worksheet
- 2=external
- 4=consolidation
- 8=scenario
-end
-
-# SXDI -----------------------------------------------------------------------
-
-shortlist=SXDI-FUNC,0,sum,count-all,average,max,min,product,count-num,std-dev,std-dev-p,variance,variance-p
-shortlist=SXDI-FORMAT,0,normal,diff-from,percent-of,percent-diff-from,running-total-in,percent-of-row,percent-of-column,percent-of-total,index
-
-multilist=SXDI-BASEITEM
-begin
- default=''
- 0x7FFB=previous-item,next-item
-end
-
-# SXEXT ----------------------------------------------------------------------
-
-combilist=SXEXT-FLAGS
-begin
- 0x0007=uint8,dec,source-type,SXEXT-SOURCETYPE
- 0x0008=odbc-connection
- 0x0010=odbc-sql
- 0x0020=server-pagefields
- 0x0040=webquery
- 0x0080=save-password
- 0x0100=tables-html-only
-end
-
-shortlist=SXEXT-SOURCETYPE,1,odbc,dao,,webquery
-
-# SXFDBTYPE ------------------------------------------------------------------
-
-shortlist=SXFDBTYPE-DATATYPE,0,unknown,char,numeric,decimal,integer,small-int,float,real,double,datetime,,,var-char
-
-# SXFIELD --------------------------------------------------------------------
-
-combilist=SXFIELD-FLAGS
-begin
- 0x0001=has-items
- 0x0002=postpone-items
- 0x0004=calculated
- 0x0008=has-child
- 0x0010=numeric-group
- 0x0020=16bit-indexes
- 0x0DE0=uint16,hex,data-type,SXFIELD-TYPE,noshift
-end
-
-constlist=SXFIELD-TYPE
-begin
- 0x0000=none
- 0x0480=string-only
- 0x0520=integer-optdouble
- 0x0560=double-only
- 0x05A0=string-integer-optdouble
- 0x05E0=string-double-only
- 0x0900=date-only
- 0x0980=date-empty-only
- 0x0D00=date-number
- 0x0D80=date-string-optnumber
-end
-
-# SXLI -----------------------------------------------------------------------
-
-shortlist=SXLI-ITEMTYPE,0,data,default,sum,count-num,average,max,min,product,count-num,std-dev,std-dev-p,variance,variance-p,grandtotal,blank-line
-
-combilist=SXLI-FLAGS
-begin
- 0x0001=field-name
- 0x01FE=uint16,dec,data-field-idx
- 0x0200=subtotal
- 0x0400=blocktotal
- 0x0800=grandtotal
- 0x1000=multi-data
-end
-
-# SXNUMGROUP -----------------------------------------------------------------
-
-combilist=SXNUMGROUP-FLAGS
-begin
- 0x0001=auto-min
- 0x0002=auto-max
- 0x003C=uint8,dec,data-type,SXNUMGROUP-TYPE
-end
-
-shortlist=SXNUMGROUP-TYPE,1,second,minute,hour,day,month,quarter,year,numeric
-
-# SXVD -----------------------------------------------------------------------
-
-flagslist=SXVD-AXISTYPE
-begin
- 0x0001=row
- 0x0002=column
- 0x0004=page
- 0x0008=data
-end
-
-flagslist=SXVD-SUBTOTALS
-begin
- 0x0001=default
- 0x0002=sum
- 0x0004=count-all
- 0x0008=average
- 0x0010=max
- 0x0020=min
- 0x0040=product
- 0x0080=count-num
- 0x0100=std-dev
- 0x0200=std-dev-p
- 0x0400=variance
- 0x0800=variance-p
-end
-
-# SXVDEX ---------------------------------------------------------------------
-
-combilist=SXVDEX-FLAGS
-begin
- 0x00000001=show-all-items
- 0x00000002=drag-to-row
- 0x00000004=drag-to-column
- 0x00000008=drag-to-page
- 0x00000010=drag-to-hide
- 0x00000080=server-based
- 0x00000200=autosort
- 0x00000400=autosort-ascending
- 0x00000800=autoshow
- 0x00001000=autoshow-top-values
- 0x00002000=calculated
- 0x00200000=layout-report
- 0x00400000=layout-blank
- 0x00800000=layout-top
- 0xFF000000=uint8,dec,autoshow-item-count
-end
-
-# SXVI -----------------------------------------------------------------------
-
-multilist=SXVI-ITEMTYPE
-begin
- 0=data,default,sum,count-num,average,max,min,product,count-num,std-dev,std-dev-p,variance,variance-p,grandtotal
- 254=page,none
-end
-
-flagslist=SXVI-FLAGS
-begin
- 0x0001=hidden
- 0x0002=hide-detail
- 0x0004=calculated
- 0x0008=missing
-end
-
-# SXVIEW ---------------------------------------------------------------------
-
-flagslist=SXVIEW-FLAGS
-begin
- 0x0001=row-grandtotals
- 0x0002=column-grandtotals
- 0x0008=auto-format
- 0x0010=size-auto-format
- 0x0020=font-auto-format
- 0x0040=align-auto-format
- 0x0080=border-auto-format
- 0x0100=pattern-auto-format
- 0x0200=number-auto-format
-end
-
-# SXVS -----------------------------------------------------------------------
-
-flagslist=SXVS-TYPE
-begin
- 0x0001=spreadsheet
- 0x0002=extern
- 0x0004=consolidation-area
- 0x0008=pivot-table
- 0x0010=scenario
-end
-
-# WSBOOL ---------------------------------------------------------------------
-
-shortlist=WSBOOL-WINDOWPOS,0,tiled,horizontal,vertical,cascaded
-
-flagslist=WSBOOL-FLAGS-BIFF3
-begin
- 0x0001=show-autopagebreak
- 0x0010=dialog-sheet
- 0x0020=outline-autostyle
- 0x0040=outline-buttons-below
- 0x0080=outline-buttons-right
- 0x0100=fit-to-pages
- 0x0200=skip-linked-values
- 0x0400=show-row-outline
- 0x0800=show-column-outline
-end
-
-flagslist=WSBOOL-FLAGS-BIFF4
-begin
- include=WSBOOL-FLAGS-BIFF3
- 0x3000=uint8,dec,window-pos,WSBOOL-WINDOWPOS
- 0x4000=lotus-expr-eval
- 0x8000=lotus-formula-edit
-end
-
-flagslist=WSBOOL-FLAGS-BIFF5
-begin
- include=WSBOOL-FLAGS-BIFF4
- exclude=0x0200,0x3000
-end
-
-# XF -------------------------------------------------------------------------
-
-shortlist=XF-HORALIGN,0,general,left,center,right,fill,block,center-across-sel,distribute
-shortlist=XF-VERALIGN,0,top,center,bottom,justify,distribute
-shortlist=XF-TEXTDIRECTION,0,context,left-to-right,right-to-left
-
-flagslist=XF-PROTECTION-FLAGS
-begin
- 0x01=locked
- 0x02=formula-hidden
- 0x04=style-xf
-end
-
-flagslist=XF-USEDATTRIBS-FLAGS
-begin
- 0x04=format
- 0x08=font
- 0x10=alignment
- 0x20=border
- 0x40=area
- 0x80=protection
-end
-
-combilist=XF-STYLEFLAGS-BIFF2
-begin
- 0x07=uint8,dec,hor-align,XF-HORALIGN
- 0x08=left-border
- 0x10=right-border
- 0x20=top-border
- 0x40=bottom-border
- 0x80=fill
-end
-
-combilist=XF-TYPEFLAGS-BIFF2
-begin
- 0x3F=uint8,dec,fmt-idx,FORMATS
- 0x40=locked
- 0x80=formula-hidden
-end
-
-flagslist=XF-TYPEFLAGS-BIFF3
-begin
- include=XF-PROTECTION-FLAGS
-end
-
-combilist=XF-TYPEFLAGS-BIFF4
-begin
- include=XF-TYPEFLAGS-BIFF3
- 0xFFF0=uint16,dec,parent-xf-idx
-end
-
-combilist=XF-ALIGNMENT-BIFF3
-begin
- 0x0007=uint8,dec,hor-align,XF-HORALIGN
- 0x0008=text-wrap
- 0xFFF0=uint16,dec,parent-xf-idx
-end
-
-combilist=XF-ALIGNMENT-BIFF4
-begin
- 0x07=uint8,dec,hor-align,XF-HORALIGN
- 0x08=text-wrap
- 0x30=uint8,dec,ver-align,XF-VERALIGN
- 0xC0=uint8,dec,orientation,TEXTORIENTATION
-end
-
-combilist=XF-ALIGNMENT-BIFF5
-begin
- 0x07=uint8,dec,hor-align,XF-HORALIGN
- 0x08=text-wrap
- 0x70=uint8,dec,ver-align,XF-VERALIGN
-end
-
-combilist=XF-ORIENTATTRIBS-BIFF5
-begin
- include=XF-USEDATTRIBS-FLAGS
- 0x03=uint8,dec,orientation,TEXTORIENTATION
-end
-
-combilist=XF-TEXTFLAGS-BIFF8
-begin
- 0x0F=uint8,dec,indent
- 0x10=shrink-to-fit
- 0xC0=uint8,dec,text-dir,XF-TEXTDIRECTION
-end
-
-combilist=XF-FILL-BIFF3
-begin
- 0x003F=uint8,dec,fill-pattern,FILLPATTERNS
- 0x07C0=uint8,dec,fg-color-idx,COLORS
- 0xF800=uint8,dec,bg-color-idx,COLORS
-end
-
-combilist=XF-BORDER-BIFF3
-begin
- 0x00000007=uint8,dec,top-style,BORDERSTYLES
- 0x000000F8=uint8,dec,top-color,COLORS
- 0x00000700=uint8,dec,left-style,BORDERSTYLES
- 0x0000F800=uint8,dec,left-color,COLORS
- 0x00070000=uint8,dec,bottom-style,BORDERSTYLES
- 0x00F80000=uint8,dec,bottom-color,COLORS
- 0x07000000=uint8,dec,right-style,BORDERSTYLES
- 0xF8000000=uint8,dec,right-color,COLORS
-end
-
-combilist=XF-FILL-BIFF5
-begin
- 0x0000007F=uint8,dec,fg-color-idx,COLORS
- 0x00003F80=uint8,dec,bg-color-idx,COLORS
- 0x003F0000=uint8,dec,fill-pattern,FILLPATTERNS
- 0x01C00000=uint8,dec,bottom-style,BORDERSTYLES
- 0xFE000000=uint8,dec,bottom-color,COLORS
-end
-
-combilist=XF-BORDER-BIFF5
-begin
- 0x00000007=uint8,dec,top-style,BORDERSTYLES
- 0x00000038=uint8,dec,left-style,BORDERSTYLES
- 0x000001C0=uint8,dec,right-style,BORDERSTYLES
- 0x0000FE00=uint8,dec,top-color,COLORS
- 0x007F0000=uint8,dec,left-color,COLORS
- 0x3F800000=uint8,dec,right-color,COLORS
-end
-
-combilist=XF-BORDERSTYLE-BIFF8
-begin
- 0x000F=uint8,dec,left-style,BORDERSTYLES
- 0x00F0=uint8,dec,right-style,BORDERSTYLES
- 0x0F00=uint8,dec,top-style,BORDERSTYLES
- 0xF000=uint8,dec,bottom-style,BORDERSTYLES
-end
-
-combilist=XF-BORDERCOLOR1-BIFF8
-begin
- 0x007F=uint8,dec,left-color,COLORS
- 0x3F80=uint8,dec,right-color,COLORS
- 0x4000=diag-tl-to-br
- 0x8000=diag-bl-to-tr
-end
-
-combilist=XF-BORDERCOLOR2-BIFF8
-begin
- 0x0000007F=uint8,dec,top-color,COLORS
- 0x00003F80=uint8,dec,bottom-color,COLORS
- 0x001FC000=uint8,dec,diag-color,COLORS
- 0x01E00000=uint8,dec,diag-style,BORDERSTYLES
- 0xFC000000=uint8,dec,fill-pattern,FILLPATTERNS
-end
-
-combilist=XF-FILLCOLOR-BIFF8
-begin
- 0x007F=uint8,dec,fg-color-idx,COLORS
- 0x3F80=uint8,dec,bg-color-idx,COLORS
-end
-
-# BIFF2 XF index field -------------------------------------------------------
-
-constlist=XFINDEX-BIFF2
-begin
- default=''
- 63=from-ixfe
-end
-
-combilist=CELL-XFINDEX-BIFF2
-begin
- 0x3F=uint8,dec,xf-idx,XFINDEX-BIFF2
- 0x40=locked
- 0x80=formula-hidden
-end
-
-combilist=CELL-XFFORMAT-BIFF2
-begin
- 0x3F=uint8,dec,fmt-idx,FORMATS
- 0xC0=uint8,dec,font-idx,FONTNAMES
-end
-
-combilist=CELL-XFSTYLE-BIFF2
-begin
- include=XF-STYLEFLAGS-BIFF2
-end
-
-# ============================================================================
-
diff --git a/sc/source/filter/excel/xlescher.cxx b/sc/source/filter/excel/xlescher.cxx
index 45bdd31c33c2..e66f60d6fe0e 100644
--- a/sc/source/filter/excel/xlescher.cxx
+++ b/sc/source/filter/excel/xlescher.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xlescher.cxx,v $
- * $Revision: 1.14 $
+ * $Revision: 1.14.90.8 $
*
* This file is part of OpenOffice.org.
*
@@ -30,8 +30,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
+
#include "xlescher.hxx"
#include <com/sun/star/drawing/XControlShape.hpp>
+#include <com/sun/star/script/ScriptEventDescriptor.hpp>
#include <svx/unoapi.hxx>
#include "document.hxx"
#include "xistream.hxx"
@@ -43,19 +45,43 @@ using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::drawing::XShape;
using ::com::sun::star::drawing::XControlShape;
using ::com::sun::star::awt::XControlModel;
+using ::com::sun::star::script::ScriptEventDescriptor;
// Structs and classes ========================================================
-// Escher client anchor -------------------------------------------------------
+XclObjId::XclObjId() :
+ mnScTab( SCTAB_INVALID ),
+ mnObjId( EXC_OBJ_INVALID_ID )
+{
+}
+
+XclObjId::XclObjId( SCTAB nScTab, sal_uInt16 nObjId ) :
+ mnScTab( nScTab ),
+ mnObjId( nObjId )
+{
+}
+
+bool operator==( const XclObjId& rL, const XclObjId& rR )
+{
+ return (rL.mnScTab == rR.mnScTab) && (rL.mnObjId == rR.mnObjId);
+}
+
+bool operator<( const XclObjId& rL, const XclObjId& rR )
+{
+ return (rL.mnScTab < rR.mnScTab) || ((rL.mnScTab == rR.mnScTab) && (rL.mnObjId < rR.mnObjId));
+}
+
+// ----------------------------------------------------------------------------
namespace {
/** Returns the scaling factor to calculate coordinates from twips. */
double lclGetTwipsScale( MapUnit eMapUnit )
{
- /* #111027# We cannot use OutputDevice::LogicToLogic() or the XclTools conversion
- functions to calculate drawing layer coordinates due to Calc's strange definition
- of a point (1 inch == 72.27 points, instead of 72 points). */
+ /* #111027# We cannot use OutputDevice::LogicToLogic() or the XclTools
+ conversion functions to calculate drawing layer coordinates due to
+ Calc's strange definition of a point (1 inch == 72.27 points, instead
+ of 72 points). */
double fScale = 1.0;
switch( eMapUnit )
{
@@ -66,7 +92,7 @@ double lclGetTwipsScale( MapUnit eMapUnit )
return fScale;
}
-/** Calculates a drawing layer X position (in twips) from an Escher object column position. */
+/** Calculates a drawing layer X position (in twips) from an object column position. */
long lclGetXFromCol( ScDocument& rDoc, SCTAB nScTab, sal_uInt16 nXclCol, sal_uInt16 nOffset, double fScale )
{
SCCOL nScCol = static_cast< SCCOL >( nXclCol );
@@ -74,7 +100,7 @@ long lclGetXFromCol( ScDocument& rDoc, SCTAB nScTab, sal_uInt16 nXclCol, sal_uIn
::std::min( nOffset / 1024.0, 1.0 ) * rDoc.GetColWidth( nScCol, nScTab )) + 0.5 );
}
-/** Calculates a drawing layer Y position (in twips) from an Escher object row position. */
+/** Calculates a drawing layer Y position (in twips) from an object row position. */
long lclGetYFromRow( ScDocument& rDoc, SCTAB nScTab, sal_uInt16 nXclRow, sal_uInt16 nOffset, double fScale )
{
SCROW nScRow = static_cast< SCROW >( nXclRow );
@@ -82,7 +108,7 @@ long lclGetYFromRow( ScDocument& rDoc, SCTAB nScTab, sal_uInt16 nXclRow, sal_uIn
::std::min( nOffset / 256.0, 1.0 ) * rDoc.GetRowHeight( nScRow, nScTab )) + 0.5 );
}
-/** Calculates an Escher object column position from a drawing layer X position (in twips). */
+/** Calculates an object column position from a drawing layer X position (in twips). */
void lclGetColFromX(
ScDocument& rDoc, SCTAB nScTab, sal_uInt16& rnXclCol,
sal_uInt16& rnOffset, sal_uInt16 nXclStartCol,
@@ -101,7 +127,7 @@ void lclGetColFromX(
rnOffset = nColW ? static_cast< sal_uInt16 >( (nTwipsX - rnStartW) * 1024.0 / nColW + 0.5 ) : 0;
}
-/** Calculates an Escher object row position from a drawing layer Y position (in twips). */
+/** Calculates an object row position from a drawing layer Y position (in twips). */
void lclGetRowFromY(
ScDocument& rDoc, SCTAB nScTab,
sal_uInt16& rnXclRow, sal_uInt16& rnOffset, sal_uInt16 nXclStartRow,
@@ -140,7 +166,7 @@ void lclMirrorRectangle( Rectangle& rRect )
// ----------------------------------------------------------------------------
-XclEscherAnchor::XclEscherAnchor( SCTAB nScTab ) :
+XclObjAnchor::XclObjAnchor( SCTAB nScTab ) :
mnScTab( nScTab ),
mnLX( 0 ),
mnTY( 0 ),
@@ -149,14 +175,14 @@ XclEscherAnchor::XclEscherAnchor( SCTAB nScTab ) :
{
}
-Rectangle XclEscherAnchor::GetRect( ScDocument& rDoc, MapUnit eMapUnit ) const
+Rectangle XclObjAnchor::GetRect( ScDocument& rDoc, MapUnit eMapUnit ) const
{
double fScale = lclGetTwipsScale( eMapUnit );
Rectangle aRect(
- lclGetXFromCol( rDoc, mnScTab, maXclRange.maFirst.mnCol, mnLX, fScale ),
- lclGetYFromRow( rDoc, mnScTab, maXclRange.maFirst.mnRow, mnTY, fScale ),
- lclGetXFromCol( rDoc, mnScTab, maXclRange.maLast.mnCol, mnRX + 1, fScale ),
- lclGetYFromRow( rDoc, mnScTab, maXclRange.maLast.mnRow, mnBY, fScale ) );
+ lclGetXFromCol( rDoc, mnScTab, maFirst.mnCol, mnLX, fScale ),
+ lclGetYFromRow( rDoc, mnScTab, maFirst.mnRow, mnTY, fScale ),
+ lclGetXFromCol( rDoc, mnScTab, maLast.mnCol, mnRX + 1, fScale ),
+ lclGetYFromRow( rDoc, mnScTab, maLast.mnRow, mnBY, fScale ) );
// #106948# adjust coordinates in mirrored sheets
if( rDoc.IsLayoutRTL( mnScTab ) )
@@ -164,7 +190,7 @@ Rectangle XclEscherAnchor::GetRect( ScDocument& rDoc, MapUnit eMapUnit ) const
return aRect;
}
-void XclEscherAnchor::SetRect( ScDocument& rDoc, const Rectangle& rRect, MapUnit eMapUnit )
+void XclObjAnchor::SetRect( ScDocument& rDoc, const Rectangle& rRect, MapUnit eMapUnit )
{
Rectangle aRect( rRect );
// #106948# adjust coordinates in mirrored sheets
@@ -173,124 +199,97 @@ void XclEscherAnchor::SetRect( ScDocument& rDoc, const Rectangle& rRect, MapUnit
double fScale = lclGetTwipsScale( eMapUnit );
long nDummy = 0;
- lclGetColFromX( rDoc, mnScTab, maXclRange.maFirst.mnCol, mnLX, 0, nDummy, aRect.Left(), fScale );
- lclGetColFromX( rDoc, mnScTab, maXclRange.maLast.mnCol, mnRX, maXclRange.maFirst.mnCol, nDummy, aRect.Right(), fScale );
+ lclGetColFromX( rDoc, mnScTab, maFirst.mnCol, mnLX, 0, nDummy, aRect.Left(), fScale );
+ lclGetColFromX( rDoc, mnScTab, maLast.mnCol, mnRX, maFirst.mnCol, nDummy, aRect.Right(), fScale );
nDummy = 0;
- lclGetRowFromY( rDoc, mnScTab, maXclRange.maFirst.mnRow, mnTY, 0, nDummy, aRect.Top(), fScale );
- lclGetRowFromY( rDoc, mnScTab, maXclRange.maLast.mnRow, mnBY, maXclRange.maFirst.mnRow, nDummy, aRect.Bottom(), fScale );
-}
-
-SvStream& operator>>( SvStream& rStrm, XclEscherAnchor& rAnchor )
-{
- return rStrm
- >> rAnchor.maXclRange.maFirst.mnCol >> rAnchor.mnLX
- >> rAnchor.maXclRange.maFirst.mnRow >> rAnchor.mnTY
- >> rAnchor.maXclRange.maLast.mnCol >> rAnchor.mnRX
- >> rAnchor.maXclRange.maLast.mnRow >> rAnchor.mnBY;
+ lclGetRowFromY( rDoc, mnScTab, maFirst.mnRow, mnTY, 0, nDummy, aRect.Top(), fScale );
+ lclGetRowFromY( rDoc, mnScTab, maLast.mnRow, mnBY, maFirst.mnRow, nDummy, aRect.Bottom(), fScale );
}
-SvStream& operator<<( SvStream& rStrm, const XclEscherAnchor& rAnchor )
-{
- return rStrm
- << rAnchor.maXclRange.maFirst.mnCol << rAnchor.mnLX
- << rAnchor.maXclRange.maFirst.mnRow << rAnchor.mnTY
- << rAnchor.maXclRange.maLast.mnCol << rAnchor.mnRX
- << rAnchor.maXclRange.maLast.mnRow << rAnchor.mnBY;
-}
+// ----------------------------------------------------------------------------
-XclImpStream& operator>>( XclImpStream& rStrm, XclEscherAnchor& rAnchor )
+XclObjLineData::XclObjLineData() :
+ mnColorIdx( EXC_OBJ_LINE_AUTOCOLOR ),
+ mnStyle( EXC_OBJ_LINE_SOLID ),
+ mnWidth( EXC_OBJ_LINE_HAIR ),
+ mnAuto( EXC_OBJ_LINE_AUTO )
{
- return rStrm
- >> rAnchor.maXclRange.maFirst.mnCol >> rAnchor.mnLX
- >> rAnchor.maXclRange.maFirst.mnRow >> rAnchor.mnTY
- >> rAnchor.maXclRange.maLast.mnCol >> rAnchor.mnRX
- >> rAnchor.maXclRange.maLast.mnRow >> rAnchor.mnBY;
}
-XclExpStream& operator<<( XclExpStream& rStrm, const XclEscherAnchor& rAnchor )
+XclImpStream& operator>>( XclImpStream& rStrm, XclObjLineData& rLineData )
{
return rStrm
- << rAnchor.maXclRange.maFirst.mnCol << rAnchor.mnLX
- << rAnchor.maXclRange.maFirst.mnRow << rAnchor.mnTY
- << rAnchor.maXclRange.maLast.mnCol << rAnchor.mnRX
- << rAnchor.maXclRange.maLast.mnRow << rAnchor.mnBY;
+ >> rLineData.mnColorIdx
+ >> rLineData.mnStyle
+ >> rLineData.mnWidth
+ >> rLineData.mnAuto;
}
// ----------------------------------------------------------------------------
-XclObjId::XclObjId() :
- mnScTab( SCTAB_INVALID ),
- mnObjId( EXC_OBJ_INVALID_ID )
-{
-}
-
-XclObjId::XclObjId( SCTAB nScTab, sal_uInt16 nObjId ) :
- mnScTab( nScTab ),
- mnObjId( nObjId )
-{
-}
-
-bool operator==( const XclObjId& rL, const XclObjId& rR )
+XclObjFillData::XclObjFillData() :
+ mnBackColorIdx( EXC_OBJ_LINE_AUTOCOLOR ),
+ mnPattColorIdx( EXC_OBJ_FILL_AUTOCOLOR ),
+ mnPattern( EXC_PATT_SOLID ),
+ mnAuto( EXC_OBJ_FILL_AUTO )
{
- return (rL.mnScTab == rR.mnScTab) && (rL.mnObjId == rR.mnObjId);
}
-bool operator<( const XclObjId& rL, const XclObjId& rR )
+XclImpStream& operator>>( XclImpStream& rStrm, XclObjFillData& rFillData )
{
- return (rL.mnScTab < rR.mnScTab) || ((rL.mnScTab == rR.mnScTab) && (rL.mnObjId < rR.mnObjId));
+ return rStrm
+ >> rFillData.mnBackColorIdx
+ >> rFillData.mnPattColorIdx
+ >> rFillData.mnPattern
+ >> rFillData.mnAuto;
}
// ----------------------------------------------------------------------------
-XclTxoData::XclTxoData() :
- mnFlags( 0 ),
- mnOrient( EXC_TXO_TEXTROT_NONE ),
+XclObjTextData::XclObjTextData() :
mnTextLen( 0 ),
- mnFormatSize( 0 )
-{
-}
-
-sal_uInt8 XclTxoData::GetXclHorAlignment() const
-{
- sal_uInt8 nXclAlign = 0;
- ::extract_value( nXclAlign, mnFlags, 1, 3 );
- return nXclAlign;
-}
-
-void XclTxoData::SetXclHorAlignment( sal_uInt8 nXclAlign )
-{
- ::insert_value( mnFlags, nXclAlign, 1, 3 );
-}
-
-sal_uInt8 XclTxoData::GetXclVerAlignment() const
+ mnFormatSize( 0 ),
+ mnLinkSize( 0 ),
+ mnDefFontIdx( EXC_FONT_APP ),
+ mnFlags( 0 ),
+ mnOrient( EXC_OBJ_ORIENT_NONE ),
+ mnButtonFlags( 0 ),
+ mnShortcut( 0 ),
+ mnShortcutEA( 0 )
{
- sal_uInt8 nXclAlign = 0;
- ::extract_value( nXclAlign, mnFlags, 4, 3 );
- return nXclAlign;
}
-void XclTxoData::SetXclVerAlignment( sal_uInt8 nXclAlign )
+void XclObjTextData::ReadObj3( XclImpStream& rStrm )
{
- ::insert_value( mnFlags, nXclAlign, 4, 3 );
+ rStrm >> mnTextLen;
+ rStrm.Ignore( 2 );
+ rStrm >> mnFormatSize >> mnDefFontIdx;
+ rStrm.Ignore( 2 );
+ rStrm >> mnFlags >> mnOrient;
+ rStrm.Ignore( 8 );
}
-XclImpStream& operator>>( XclImpStream& rStrm, XclTxoData& rData )
+void XclObjTextData::ReadObj5( XclImpStream& rStrm )
{
- rStrm >> rData.mnFlags >> rData.mnOrient;
- rStrm.Ignore( 6 );
- return rStrm >> rData.mnTextLen >> rData.mnFormatSize;
+ rStrm >> mnTextLen;
+ rStrm.Ignore( 2 );
+ rStrm >> mnFormatSize >> mnDefFontIdx;
+ rStrm.Ignore( 2 );
+ rStrm >> mnFlags >> mnOrient;
+ rStrm.Ignore( 2 );
+ rStrm >> mnLinkSize;
+ rStrm.Ignore( 2 );
+ rStrm >> mnButtonFlags >> mnShortcut >> mnShortcutEA;
}
-XclExpStream& operator<<( XclExpStream& rStrm, const XclTxoData& rData )
+void XclObjTextData::ReadTxo8( XclImpStream& rStrm )
{
- rStrm << rData.mnFlags << rData.mnOrient;
- rStrm.WriteZeroBytes( 6 );
- return rStrm << rData.mnTextLen << rData.mnFormatSize << sal_uInt32( 0 );
+ rStrm >> mnFlags >> mnOrient >> mnButtonFlags >> mnShortcut >> mnShortcutEA >> mnTextLen >> mnFormatSize;
}
-// ----------------------------------------------------------------------------
+// ============================================================================
-Reference< XControlModel > XclControlObjHelper::GetModelFromShape( Reference< XShape > xShape )
+Reference< XControlModel > XclControlHelper::GetControlModel( Reference< XShape > xShape )
{
Reference< XControlModel > xCtrlModel;
Reference< XControlShape > xCtrlShape( xShape, UNO_QUERY );
@@ -299,131 +298,68 @@ Reference< XControlModel > XclControlObjHelper::GetModelFromShape( Reference< XS
return xCtrlModel;
}
-OUString XclControlObjHelper::GetTbxServiceName( sal_uInt16 nCtrlType )
-{
- OUString aName;
-#define LCL_CREATE_NAME( name ) CREATE_OUSTRING( "com.sun.star.form.component." name )
- switch( nCtrlType )
- {
- case EXC_OBJ_CMO_BUTTON: aName = LCL_CREATE_NAME( "CommandButton" ); break;
- case EXC_OBJ_CMO_CHECKBOX: aName = LCL_CREATE_NAME( "CheckBox" ); break;
- case EXC_OBJ_CMO_OPTIONBUTTON: aName = LCL_CREATE_NAME( "RadioButton" ); break;
- case EXC_OBJ_CMO_LABEL: aName = LCL_CREATE_NAME( "FixedText" ); break;
- case EXC_OBJ_CMO_LISTBOX: aName = LCL_CREATE_NAME( "ListBox" ); break;
- case EXC_OBJ_CMO_GROUPBOX: aName = LCL_CREATE_NAME( "GroupBox" ); break;
- case EXC_OBJ_CMO_COMBOBOX: aName = LCL_CREATE_NAME( "ListBox" ); break; // it's a dropdown listbox
- case EXC_OBJ_CMO_SPIN: aName = LCL_CREATE_NAME( "SpinButton" ); break;
- case EXC_OBJ_CMO_SCROLLBAR: aName = LCL_CREATE_NAME( "ScrollBar" ); break;
- default: DBG_ERRORFILE( "XclControlObjHelper::GetTbxServiceName - unknown control type" );
- }
-#undef LCL_CREATE_NAME
- return aName;
-}
+#define EXC_MACRONAME_PRE "vnd.sun.star.script:Standard."
+#define EXC_MACRONAME_SUF "?language=Basic&location=document"
-OUString XclControlObjHelper::GetTbxControlName( sal_uInt16 nCtrlType )
+OUString XclControlHelper::GetScMacroName( const String& rXclMacroName )
{
- OUString aName;
- switch( nCtrlType )
- {
- case EXC_OBJ_CMO_BUTTON: aName = CREATE_OUSTRING( "CommandButton" ); break;
- case EXC_OBJ_CMO_CHECKBOX: aName = CREATE_OUSTRING( "CheckBox" ); break;
- case EXC_OBJ_CMO_OPTIONBUTTON: aName = CREATE_OUSTRING( "OptionButton" ); break;
- case EXC_OBJ_CMO_LABEL: aName = CREATE_OUSTRING( "Label" ); break;
- case EXC_OBJ_CMO_LISTBOX: aName = CREATE_OUSTRING( "ListBox" ); break;
- case EXC_OBJ_CMO_GROUPBOX: aName = CREATE_OUSTRING( "GroupBox" ); break;
- case EXC_OBJ_CMO_COMBOBOX: aName = CREATE_OUSTRING( "ComboBox" ); break;
- case EXC_OBJ_CMO_SPIN: aName = CREATE_OUSTRING( "SpinButton" ); break;
- case EXC_OBJ_CMO_SCROLLBAR: aName = CREATE_OUSTRING( "ScrollBar" ); break;
- default: DBG_ERRORFILE( "XclControlObjHelper::GetTbxControlName - unknown control type" );
- }
- return aName;
+ if( rXclMacroName.Len() > 0 )
+ return CREATE_OUSTRING( EXC_MACRONAME_PRE ) + rXclMacroName + CREATE_OUSTRING( EXC_MACRONAME_SUF );
+ return OUString();
}
-OUString XclControlObjHelper::GetTbxListenerType( sal_uInt16 nCtrlType )
+String XclControlHelper::GetXclMacroName( const OUString& rScMacroName )
{
- OUString aType;
- switch( nCtrlType )
- {
- case EXC_OBJ_CMO_BUTTON:
- case EXC_OBJ_CMO_CHECKBOX:
- case EXC_OBJ_CMO_OPTIONBUTTON:
- aType = CREATE_OUSTRING( "XActionListener" );
- break;
- case EXC_OBJ_CMO_LABEL:
- case EXC_OBJ_CMO_GROUPBOX:
- aType = CREATE_OUSTRING( "XMouseListener" );
- break;
- case EXC_OBJ_CMO_LISTBOX:
- case EXC_OBJ_CMO_COMBOBOX:
- aType = CREATE_OUSTRING( "XChangeListener" );
- break;
- case EXC_OBJ_CMO_SPIN:
- case EXC_OBJ_CMO_SCROLLBAR:
- aType = CREATE_OUSTRING( "XAdjustmentListener" );
- break;
- default:
- DBG_ERRORFILE( "XclControlObjHelper::GetTbxListenerType - unknown control type" );
- }
- return aType;
+ const OUString saMacroNamePre = CREATE_OUSTRING( EXC_MACRONAME_PRE );
+ const OUString saMacroNameSuf = CREATE_OUSTRING( EXC_MACRONAME_SUF );
+ sal_Int32 snScMacroNameLen = rScMacroName.getLength();
+ sal_Int32 snXclMacroNameLen = snScMacroNameLen - saMacroNamePre.getLength() - saMacroNameSuf.getLength();
+ if( (snXclMacroNameLen > 0) && rScMacroName.matchIgnoreAsciiCase( saMacroNamePre, 0 ) &&
+ rScMacroName.matchIgnoreAsciiCase( saMacroNameSuf, snScMacroNameLen - saMacroNameSuf.getLength() ) )
+ return rScMacroName.copy( saMacroNamePre.getLength(), snXclMacroNameLen );
+ return String::EmptyString();
}
-OUString XclControlObjHelper::GetTbxEventMethod( sal_uInt16 nCtrlType )
+static const struct
{
- OUString aMethod;
- switch( nCtrlType )
- {
- case EXC_OBJ_CMO_BUTTON:
- case EXC_OBJ_CMO_CHECKBOX:
- case EXC_OBJ_CMO_OPTIONBUTTON:
- aMethod = CREATE_OUSTRING( "actionPerformed" );
- break;
- case EXC_OBJ_CMO_LABEL:
- case EXC_OBJ_CMO_GROUPBOX:
- aMethod = CREATE_OUSTRING( "mouseReleased" );
- break;
- case EXC_OBJ_CMO_LISTBOX:
- case EXC_OBJ_CMO_COMBOBOX:
- aMethod = CREATE_OUSTRING( "changed" );
- break;
- case EXC_OBJ_CMO_SPIN:
- case EXC_OBJ_CMO_SCROLLBAR:
- aMethod = CREATE_OUSTRING( "adjustmentValueChanged" );
- break;
- default:
- DBG_ERRORFILE( "XclControlObjHelper::GetTbxEventMethod - unknown control type" );
- }
- return aMethod;
+ const sal_Char* mpcListenerType;
+ const sal_Char* mpcEventMethod;
}
-
-OUString XclControlObjHelper::GetTbxScriptType()
+spTbxListenerData[] =
{
- return CREATE_OUSTRING( "Script" );
-}
+ // Attention: MUST be in order of the XclTbxEventType enum!
+ /*EXC_TBX_EVENT_ACTION*/ { "XActionListener", "actionPerformed" },
+ /*EXC_TBX_EVENT_MOUSE*/ { "XMouseListener", "mouseReleased" },
+ /*EXC_TBX_EVENT_TEXT*/ { "XTextListener", "textChanged" },
+ /*EXC_TBX_EVENT_VALUE*/ { "XAdjustmentListener", "adjustmentValueChanged" },
+ /*EXC_TBX_EVENT_CHANGE*/ { "XChangeListener", "changed" }
+};
-#define EXC_TBX_MACRONAME_PRE "vnd.sun.star.script:Standard."
-#define EXC_TBX_MACRONAME_SUF "?language=Basic&location=document"
+#define EXC_MACROSCRIPT "Script"
-OUString XclControlObjHelper::GetScMacroName( const String& rXclMacroName )
+bool XclControlHelper::FillMacroDescriptor( ScriptEventDescriptor& rDescriptor,
+ XclTbxEventType eEventType, const String& rXclMacroName )
{
- return CREATE_OUSTRING( EXC_TBX_MACRONAME_PRE ) + rXclMacroName + CREATE_OUSTRING( EXC_TBX_MACRONAME_SUF );
+ if( rXclMacroName.Len() > 0 )
+ {
+ rDescriptor.ListenerType = OUString::createFromAscii( spTbxListenerData[ eEventType ].mpcListenerType );
+ rDescriptor.EventMethod = OUString::createFromAscii( spTbxListenerData[ eEventType ].mpcEventMethod );
+ rDescriptor.ScriptType = CREATE_OUSTRING( EXC_MACROSCRIPT );
+ rDescriptor.ScriptCode = GetScMacroName( rXclMacroName );
+ return true;
+ }
+ return false;
}
-String XclControlObjHelper::GetXclMacroName( const OUString& rScMacroName )
+String XclControlHelper::ExtractFromMacroDescriptor(
+ const ScriptEventDescriptor& rDescriptor, XclTbxEventType eEventType )
{
- static const OUString saMacroNamePre = CREATE_OUSTRING( EXC_TBX_MACRONAME_PRE );
- static const OUString saMacroNameSuf = CREATE_OUSTRING( EXC_TBX_MACRONAME_SUF );
- const sal_Int32 snMacroNamePreLen = static_cast< sal_Int32 >( sizeof( EXC_TBX_MACRONAME_PRE ) - 1 );
- const sal_Int32 snMacroNameSufLen = static_cast< sal_Int32 >( sizeof( EXC_TBX_MACRONAME_SUF ) - 1 );
-
- sal_Int32 snScMacroNameLen = rScMacroName.getLength();
- sal_Int32 snXclMacroNameLen = snScMacroNameLen - snMacroNamePreLen - snMacroNameSufLen;
-
- String aXclMacroName;
- if( (snXclMacroNameLen > 0) && rScMacroName.match( saMacroNamePre, 0 ) &&
- rScMacroName.match( saMacroNameSuf, snScMacroNameLen - snMacroNameSufLen ) )
- aXclMacroName = rScMacroName.copy( snMacroNamePreLen, snXclMacroNameLen );
-
- return aXclMacroName;
+ if( (rDescriptor.ScriptCode.getLength() > 0) &&
+ rDescriptor.ScriptType.equalsIgnoreAsciiCaseAscii( EXC_MACROSCRIPT ) &&
+ rDescriptor.ListenerType.equalsAscii( spTbxListenerData[ eEventType ].mpcListenerType ) &&
+ rDescriptor.EventMethod.equalsAscii( spTbxListenerData[ eEventType ].mpcEventMethod ) )
+ return GetXclMacroName( rDescriptor.ScriptCode );
+ return String::EmptyString();
}
// ============================================================================
diff --git a/sc/source/filter/excel/xlocx.cxx b/sc/source/filter/excel/xlocx.cxx
index 2dce5bd1965b..e69de29bb2d1 100644
--- a/sc/source/filter/excel/xlocx.cxx
+++ b/sc/source/filter/excel/xlocx.cxx
@@ -1,371 +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: xlocx.cxx,v $
- * $Revision: 1.22 $
- *
- * 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_sc.hxx"
-#include "xlocx.hxx"
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/container/XIndexContainer.hpp>
-#include <com/sun/star/drawing/XDrawPage.hpp>
-#include <com/sun/star/drawing/XControlShape.hpp>
-#include <com/sun/star/form/XFormsSupplier.hpp>
-#include <com/sun/star/form/XFormComponent.hpp>
-#include <com/sun/star/script/ScriptEventDescriptor.hpp>
-#include <com/sun/star/script/XEventAttacherManager.hpp>
-#include <svx/svdpage.hxx>
-#include <svx/unoapi.hxx>
-#include "fapihelper.hxx"
-#include "xiescher.hxx"
-#include "xeescher.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::XInterface;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::container::XIndexAccess;
-using ::com::sun::star::container::XIndexContainer;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::awt::XControlModel;
-using ::com::sun::star::form::XFormsSupplier;
-using ::com::sun::star::form::XFormComponent;
-using ::com::sun::star::drawing::XDrawPage;
-using ::com::sun::star::drawing::XShape;
-using ::com::sun::star::drawing::XControlShape;
-using ::com::sun::star::script::ScriptEventDescriptor;
-using ::com::sun::star::script::XEventAttacherManager;
-
-// OCX controls ===============================================================
-
-XclOcxConverter::XclOcxConverter( const XclRoot& rRoot ) :
- SvxMSConvertOCXControls( rRoot.GetDocShell(), 0 ),
- mrRoot( rRoot ),
- mnCurrScTab( SCTAB_MAX ),
- mnCachedScTab( SCTAB_MAX )
-{
-}
-
-XclOcxConverter::~XclOcxConverter()
-{
-}
-
-void XclOcxConverter::SetScTab( SCTAB nScTab )
-{
- /* Invalidate SvxMSConvertOCXControls::xFormComps whenever sheet index changes,
- otherwise GetDrawPage() will not be called in SvxMSConvertOCXControls::GetFormComps(). */
- if( mnCurrScTab != nScTab )
- {
- xFormComps.clear();
- mnCurrScTab = nScTab;
- }
-}
-
-void XclOcxConverter::SetDrawPage( SCTAB nScTab )
-{
- SetScTab( nScTab );
- GetDrawPage();
-}
-
-const Reference< XDrawPage >& XclOcxConverter::GetDrawPage()
-{
- // find and cache draw page if uninitialized or sheet index has been changed
- // xDrawPage is a member of the svx base class SvxMSConvertOCXControls
- if( !xDrawPage.is() || (mnCachedScTab != mnCurrScTab) )
- {
- // mnCurrTab is set in SetScTab() and contains sheet index of current control
- if( SdrPage* pPage = mrRoot.GetSdrPage( mnCurrScTab ) )
- {
- xDrawPage = Reference< XDrawPage >( pPage->getUnoPage(), UNO_QUERY );
- mnCachedScTab = mnCurrScTab;
- }
- }
-
- return xDrawPage;
-}
-
-// ----------------------------------------------------------------------------
-
-XclImpOcxConverter::XclImpOcxConverter( const XclImpRoot& rRoot ) :
- XclOcxConverter( rRoot ),
- XclImpRoot( rRoot ),
- mnLastIndex( -1 )
-{
- // try to open the 'Ctls' storage stream containing control properties
- mxStrm = OpenStream( EXC_STREAM_CTLS );
-}
-
-SdrObject* XclImpOcxConverter::CreateSdrObject( XclImpOleObj& rOcxCtrlObj, const Rectangle& rAnchorRect )
-{
- SdrObject* pSdrObj = 0;
-
- DBG_ASSERT( rOcxCtrlObj.IsControl(), "XclImpOcxConverter::CreateSdrObject - no control object" );
- if( mxStrm.Is() && rOcxCtrlObj.IsControl() )
- {
- // virtual call of GetDrawPage() needs current sheet index
- SetScTab( rOcxCtrlObj.GetScTab() );
-
- // stream position of the extra data for this control
- mxStrm->Seek( rOcxCtrlObj.GetCtlsStreamPos() );
-
- try
- {
- Reference< XShape > xShape;
- // reads from mxStrm into xShape, inserts the control model into the form of the sheet
- if( ReadOCXExcelKludgeStream( mxStrm, &xShape, TRUE ) )
- pSdrObj = FinalizeSdrObject( rOcxCtrlObj, xShape, rAnchorRect );
- }
- catch( Exception& )
- {
- DBG_ERRORFILE( "XclImpOcxConverter::CreateSdrObject - unexpected exception caught" );
- }
- }
- return pSdrObj;
-}
-
-SdrObject* XclImpOcxConverter::CreateSdrObject( XclImpTbxControlObj& rTbxCtrlObj, const Rectangle& rAnchorRect )
-{
- SdrObject* pSdrObj = 0;
-
- // virtual call of GetDrawPage() needs current sheet index
- SetScTab( rTbxCtrlObj.GetScTab() );
-
- Reference< XMultiServiceFactory > xFactory = GetServiceFactory();
- if( xFactory.is() )
- {
- Reference< XInterface > xInt( xFactory->createInstance( rTbxCtrlObj.GetServiceName() ) );
- Reference< XFormComponent > xFormComp( xInt, UNO_QUERY );
- if( xFormComp.is() )
- {
- Reference< XShape > xShape; // the shape to fill
- ::com::sun::star::awt::Size aSize; // dummy size
-
- // try to insert the control into the form
- if( InsertControl( xFormComp, aSize, &xShape, TRUE ) )
- {
- pSdrObj = FinalizeSdrObject( rTbxCtrlObj, xShape, rAnchorRect );
- // try to attach a macro to the control
- RegisterTbxMacro( rTbxCtrlObj );
- }
- }
- }
- return pSdrObj;
-}
-
-sal_Bool XclImpOcxConverter::InsertControl(
- const Reference< XFormComponent >& rxFormComp,
- const ::com::sun::star::awt::Size& /*rSize*/,
- Reference< XShape >* pxShape,
- BOOL /*bFloatingCtrl*/ )
-{
- sal_Bool bRet = sal_False;
-
- Reference< XIndexContainer > xFormCompsIC = GetFormComps();
- Reference< XMultiServiceFactory > xFactory = GetServiceFactory();
- if( xFormCompsIC.is() && xFactory.is() )
- {
- // store new index of the control for later use
- mnLastIndex = xFormCompsIC->getCount();
- // insert the new control into the form
- xFormCompsIC->insertByIndex( mnLastIndex, makeAny( rxFormComp ) );
-
- // create the control shape
- Reference< XShape > xShape( xFactory->createInstance(
- CREATE_OUSTRING( "com.sun.star.drawing.ControlShape" ) ), UNO_QUERY );
- if( xShape.is() )
- {
- // set control model at the shape
- Reference< XControlShape > xCtrlShape( xShape, UNO_QUERY );
- Reference< XControlModel > xCtrlModel( rxFormComp, UNO_QUERY );
- if( xCtrlShape.is() && xCtrlModel.is() )
- {
- xCtrlShape->setControl( xCtrlModel );
- if( pxShape )
- *pxShape = xShape;
- bRet = sal_True;
- }
- }
- }
-
- return bRet;
-}
-
-SdrObject* XclImpOcxConverter::FinalizeSdrObject( XclImpControlObjHelper& rCtrlObj,
- Reference< XShape > xShape, const Rectangle& rAnchorRect ) const
-{
- // store control model at passed Excel import object, used later to set more properties
- rCtrlObj.SetControlModel( XclControlObjHelper::GetModelFromShape( xShape ) );
-
- // get SdrObject from the shape and set anchor rectangle and layer ID
- SdrObject* pSdrObj = ::GetSdrObjectFromXShape( xShape );
- if( pSdrObj )
- {
- pSdrObj->NbcSetSnapRect( rAnchorRect ); // anchor rectangle
- pSdrObj->NbcSetLayer( SC_LAYER_CONTROLS ); // #i30543# insert into control layer
- }
- return pSdrObj;
-}
-
-void XclImpOcxConverter::RegisterTbxMacro( const XclImpTbxControlObj& rTbxCtrlObj )
-{
- ScriptEventDescriptor aEvent;
- if( (mnLastIndex >= 0) && rTbxCtrlObj.FillMacroDescriptor( aEvent ) )
- {
- Reference< XEventAttacherManager > xEventMgr( GetFormComps(), UNO_QUERY );
- if( xEventMgr.is() )
- {
- try
- {
- xEventMgr->registerScriptEvent( mnLastIndex, aEvent );
- }
- catch( Exception& )
- {
- DBG_ERRORFILE( "XclImpOcxConverter::RegisterTbxMacro - cannot register macro" );
- }
- }
- }
-}
-
-// ----------------------------------------------------------------------------
-
-XclExpOcxConverter::XclExpOcxConverter( const XclExpRoot& rRoot ) :
- XclOcxConverter( rRoot ),
- XclExpRoot( rRoot )
-{
-}
-
-#if EXC_EXP_OCX_CTRL
-
-XclExpOcxControlObj* XclExpOcxConverter::CreateCtrlObj( Reference< XShape > xShape )
-{
- ::std::auto_ptr< XclExpOcxControlObj > xOcxCtrl;
-
- Reference< XControlModel > xCtrlModel = XclControlObjHelper::GetModelFromShape( xShape );
- if( xCtrlModel.is() )
- {
- // output stream
- if( !mxStrm.Is() )
- mxStrm = OpenStream( EXC_STREAM_CTLS );
- if( mxStrm.Is() )
- {
- String aClassName;
- sal_uInt32 nStrmStart = static_cast< sal_uInt32 >( mxStrm->Tell() );
-
- // writes from xCtrlModel into mxStrm, raw class name returned in aClassName
- if( WriteOCXExcelKludgeStream( mxStrm, xCtrlModel, xShape->getSize(), aClassName ) )
- {
- sal_uInt32 nStrmSize = static_cast< sal_uInt32 >( mxStrm->Tell() - nStrmStart );
- // adjust the class name to "Forms.***.1"
- aClassName.InsertAscii( "Forms.", 0 ).AppendAscii( ".1" );
- xOcxCtrl.reset( new XclExpOcxControlObj( GetRoot(), xShape, aClassName, nStrmStart, nStrmSize ) );
- }
- }
- }
- return xOcxCtrl.release();
-}
-
-#else
-
-XclExpTbxControlObj* XclExpOcxConverter::CreateCtrlObj( Reference< XShape > xShape )
-{
- ::std::auto_ptr< XclExpTbxControlObj > xTbxCtrl( new XclExpTbxControlObj( GetRoot(), xShape ) );
- if( xTbxCtrl->GetObjType() == EXC_OBJ_CMO_UNKNOWN )
- xTbxCtrl.reset();
-
- if( xTbxCtrl.get() )
- {
- // find attached macro
- Reference< XControlModel > xCtrlModel = XclControlObjHelper::GetModelFromShape( xShape );
- ConvertTbxMacro( *xTbxCtrl, xCtrlModel );
- }
- return xTbxCtrl.release();
-}
-
-void XclExpOcxConverter::ConvertTbxMacro( XclExpTbxControlObj& rTbxCtrlObj, Reference< XControlModel > xCtrlModel )
-{
- // *** 1) try to find the index of the processed control in the form ***
-
- Reference< XIndexAccess > xFormIA; // needed in step 2) below
- sal_Int32 nFoundIdx = -1;
-
- // update xDrawPage member of svx base class with draw page of current sheet
- SetDrawPage( GetCurrScTab() );
- Reference< XFormsSupplier > xFormsSup( xDrawPage, UNO_QUERY );
-
- if( xFormsSup.is() && xCtrlModel.is() )
- {
- // search all existing forms in the draw page
- Reference< XIndexAccess > xFormsIA( xFormsSup->getForms(), UNO_QUERY );
- if( xFormsIA.is() )
- {
- for( sal_Int32 nFormIdx = 0, nFormCount = xFormsIA->getCount();
- (nFoundIdx < 0) && (nFormIdx < nFormCount); ++nFormIdx )
- {
- // get the XIndexAccess interface of the form with index nFormIdx
- if( xFormIA.set( xFormsIA->getByIndex( nFormIdx ), UNO_QUERY ) )
- {
- // search all elements (controls) of the current form by index
- for( sal_Int32 nCtrlIdx = 0, nCtrlCount = xFormIA->getCount();
- (nFoundIdx < 0) && (nCtrlIdx < nCtrlCount); ++nCtrlIdx )
- {
- // compare implementation pointers of the control models
- Reference< XControlModel > xCurrModel( xFormIA->getByIndex( nCtrlIdx ), UNO_QUERY );
- if( xCtrlModel.get() == xCurrModel.get() )
- nFoundIdx = nCtrlIdx;
- }
- }
- }
- }
- }
-
- // *** 2) try to find an attached macro ***
-
- if( xFormIA.is() && (nFoundIdx >= 0) )
- {
- Reference< XEventAttacherManager > xEventMgr( xFormIA, UNO_QUERY );
- if( xEventMgr.is() )
- {
- // loop over all events attached to the found control
- const Sequence< ScriptEventDescriptor > aEventSeq( xEventMgr->getScriptEvents( nFoundIdx ) );
- bool bFound = false;
- for( sal_Int32 nEventIdx = 0, nEventCount = aEventSeq.getLength();
- !bFound && (nEventIdx < nEventCount); ++nEventIdx )
- {
- // try to set the event data at the Excel control object, returns true on success
- bFound = rTbxCtrlObj.SetMacroLink( aEventSeq[ nEventIdx ] );
- }
- }
- }
-}
-
-#endif
-
-// ============================================================================
-
diff --git a/sc/source/filter/excel/xlpivot.cxx b/sc/source/filter/excel/xlpivot.cxx
index 54ab98f569bb..6559bade280e 100644
--- a/sc/source/filter/excel/xlpivot.cxx
+++ b/sc/source/filter/excel/xlpivot.cxx
@@ -255,9 +255,7 @@ void XclPCNumGroupInfo::SetScDateType( sal_Int32 nScType )
sal_uInt16 XclPCNumGroupInfo::GetXclDataType() const
{
- sal_uInt16 nXclType = 0;
- ::extract_value( nXclType, mnFlags, 2, 4 );
- return nXclType;
+ return ::extract_value< sal_uInt16 >( mnFlags, 2, 4 );
}
void XclPCNumGroupInfo::SetXclDataType( sal_uInt16 nXclType )
@@ -616,9 +614,7 @@ void XclPTFieldExtInfo::SetApiAutoShowMode( sal_Int32 nShowMode )
sal_Int32 XclPTFieldExtInfo::GetApiAutoShowCount() const
{
- sal_uInt8 nShowCount;
- ::extract_value( nShowCount, mnFlags, 24, 8 );
- return nShowCount;
+ return ::extract_value< sal_Int32 >( mnFlags, 24, 8 );
}
void XclPTFieldExtInfo::SetApiAutoShowCount( sal_Int32 nShowCount )
diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx
index df37f4a2c63d..e4980d8d368d 100644
--- a/sc/source/filter/excel/xlroot.cxx
+++ b/sc/source/filter/excel/xlroot.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xlroot.cxx,v $
- * $Revision: 1.32 $
+ * $Revision: 1.32.88.1 $
*
* This file is part of OpenOffice.org.
*
@@ -272,7 +272,7 @@ ScDBCollection& XclRoot::GetDatabaseRanges() const
SdrPage* XclRoot::GetSdrPage( SCTAB nScTab ) const
{
- return GetDoc().GetDrawLayer() ?
+ return ((nScTab >= 0) && GetDoc().GetDrawLayer()) ?
GetDoc().GetDrawLayer()->GetPage( static_cast< sal_uInt16 >( nScTab ) ) : 0;
}
diff --git a/sc/source/filter/ftools/fapihelper.cxx b/sc/source/filter/ftools/fapihelper.cxx
index 5053734451fc..53f9bae131be 100644
--- a/sc/source/filter/ftools/fapihelper.cxx
+++ b/sc/source/filter/ftools/fapihelper.cxx
@@ -37,6 +37,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
#include <com/sun/star/task/XInteractionRequest.hpp>
+#include <com/sun/star/beans/XPropertyState.hpp>
#include <comphelper/processfactory.hxx>
#include <tools/urlobj.hxx>
#include <sfx2/objsh.hxx>
@@ -53,10 +54,11 @@ using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Exception;
using ::com::sun::star::uno::UNO_QUERY;
+using ::com::sun::star::uno::UNO_QUERY_THROW;
using ::com::sun::star::uno::TypeClass_BOOLEAN;
using ::com::sun::star::uno::XInterface;
using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::beans::XPropertySetInfo;
+using ::com::sun::star::beans::XPropertyState;
using ::com::sun::star::lang::XServiceName;
using ::com::sun::star::lang::XMultiServiceFactory;
using ::com::sun::star::task::XInteractionHandler;
@@ -190,6 +192,20 @@ OUString ScfPropertySet::GetServiceName() const
// Get properties -------------------------------------------------------------
+bool ScfPropertySet::HasProperty( const OUString& rPropName ) const
+{
+ bool bHasProp = false;
+ try
+ {
+ Reference< XPropertyState > xPropState( mxPropSet, UNO_QUERY_THROW );
+ bHasProp = xPropState->getPropertyState( rPropName ) == ::com::sun::star::beans::PropertyState_DIRECT_VALUE;
+ }
+ catch( Exception& )
+ {
+ }
+ return bHasProp;
+}
+
bool ScfPropertySet::GetAnyProperty( Any& rValue, const OUString& rPropName ) const
{
bool bHasValue = false;
diff --git a/sc/source/filter/ftools/fdumper.cxx b/sc/source/filter/ftools/fdumper.cxx
index 6f3b6b9ae50b..e69de29bb2d1 100644
--- a/sc/source/filter/ftools/fdumper.cxx
+++ b/sc/source/filter/ftools/fdumper.cxx
@@ -1,2274 +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: fdumper.cxx,v $
- * $Revision: 1.11 $
- *
- * 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_sc.hxx"
-#include "fdumper.hxx"
-
-#if SCF_INCL_DUMPER
-#include <tools/datetime.hxx>
-#include <rtl/math.hxx>
-#include <osl/file.hxx>
-#include <tools/stream.hxx>
-#include <tools/color.hxx>
-#include <sfx2/docfile.hxx>
-
-namespace scf {
-namespace dump {
-
-const sal_Unicode SCF_UTF8_BOM = 0xFEFF;
-const xub_StrLen SCF_DUMP_MAXSTRLEN = 80;
-const xub_StrLen SCF_DUMP_INDENT = 2;
-const sal_Unicode SCF_DUMP_BINDOT = '.';
-const sal_Unicode SCF_DUMP_CFG_LISTSEP = ',';
-const sal_Unicode SCF_DUMP_CFG_QUOTE = '\'';
-const sal_Unicode SCF_DUMP_LISTSEP = '\n';
-const sal_Unicode SCF_DUMP_ITEMSEP = '=';
-const sal_Size SCF_DUMP_BYTESPERLINE = 16;
-const sal_Size SCF_DUMP_MAXARRAY = 16;
-
-// ============================================================================
-// ============================================================================
-
-ItemFormat::ItemFormat() :
- meDataType( DATATYPE_VOID ),
- meFmtType( FORMATTYPE_NONE )
-{
-}
-
-void ItemFormat::Set( DataType eDataType, FormatType eFmtType, const String& rItemName )
-{
- meDataType = eDataType;
- meFmtType = eFmtType;
- maItemName = rItemName;
- maItemNameUtf8 = StringHelper::ConvertToUtf8( rItemName );
- maListName.Erase();
-}
-
-void ItemFormat::Set( DataType eDataType, FormatType eFmtType, const String& rItemName, const String& rListName )
-{
- Set( eDataType, eFmtType, rItemName );
- maListName = rListName;
-}
-
-ScfStringVec::const_iterator ItemFormat::Parse( const ScfStringVec& rFormatVec )
-{
- Set( DATATYPE_VOID, FORMATTYPE_NONE, String::EmptyString() );
-
- ScfStringVec::const_iterator aIt = rFormatVec.begin(), aEnd = rFormatVec.end();
- String aDataType, aFmtType;
- if( aIt != aEnd ) aDataType = *aIt++;
- if( aIt != aEnd ) aFmtType = *aIt++;
- if( aIt != aEnd ) maItemName = *aIt++;
- if( aIt != aEnd ) maListName = *aIt++;
-
- meDataType = StringHelper::ConvertToDataType( aDataType );
- meFmtType = StringHelper::ConvertToFormatType( aFmtType );
- maItemNameUtf8 = StringHelper::ConvertToUtf8( maItemName );
-
- if( meFmtType == FORMATTYPE_NONE )
- {
- if( aFmtType.EqualsAscii( "unused" ) )
- Set( meDataType, FORMATTYPE_HEX, CREATE_STRING( SCF_DUMP_UNUSED ) );
- else if( aFmtType.EqualsAscii( "unknown" ) )
- Set( meDataType, FORMATTYPE_HEX, CREATE_STRING( SCF_DUMP_UNKNOWN ) );
- }
-
- return aIt;
-}
-
-ScfStringVec ItemFormat::Parse( const String& rFormatStr )
-{
- ScfStringVec aFormatVec;
- StringHelper::ConvertStringToStringList( aFormatVec, rFormatStr, false );
- ScfStringVec::const_iterator aIt = Parse( aFormatVec );
- const ScfStringVec& rFormatVec = aFormatVec;
- return ScfStringVec( aIt, rFormatVec.end() );
-}
-
-// ============================================================================
-// ============================================================================
-
-// append string to string ----------------------------------------------------
-
-void StringHelper::AppendString( String& rStr, const String& rData, xub_StrLen nWidth, sal_Unicode cFill )
-{
- if( rData.Len() < nWidth )
- rStr.Expand( rStr.Len() + nWidth - rData.Len(), cFill );
- rStr.Append( rData );
-}
-
-// append decimal -------------------------------------------------------------
-
-void StringHelper::AppendDec( String& rStr, sal_uInt8 nData, xub_StrLen nWidth, sal_Unicode cFill )
-{
- AppendString( rStr, String::CreateFromInt32( nData ), nWidth, cFill );
-}
-
-void StringHelper::AppendDec( String& rStr, sal_Int8 nData, xub_StrLen nWidth, sal_Unicode cFill )
-{
- AppendString( rStr, String::CreateFromInt32( nData ), nWidth, cFill );
-}
-
-void StringHelper::AppendDec( String& rStr, sal_uInt16 nData, xub_StrLen nWidth, sal_Unicode cFill )
-{
- AppendString( rStr, String::CreateFromInt32( nData ), nWidth, cFill );
-}
-
-void StringHelper::AppendDec( String& rStr, sal_Int16 nData, xub_StrLen nWidth, sal_Unicode cFill )
-{
- AppendString( rStr, String::CreateFromInt32( nData ), nWidth, cFill );
-}
-
-void StringHelper::AppendDec( String& rStr, sal_uInt32 nData, xub_StrLen nWidth, sal_Unicode cFill )
-{
- AppendString( rStr, String::CreateFromInt64( nData ), nWidth, cFill );
-}
-
-void StringHelper::AppendDec( String& rStr, sal_Int32 nData, xub_StrLen nWidth, sal_Unicode cFill )
-{
- AppendString( rStr, String::CreateFromInt32( nData ), nWidth, cFill );
-}
-
-void StringHelper::AppendDec( String& rStr, sal_uInt64 nData, xub_StrLen nWidth, sal_Unicode cFill )
-{
- /* Values greater than biggest signed 64bit integer will change to
- negative when converting to sal_Int64. Therefore, the trailing digit
- will be written separately. */
- String aData;
- if( nData > 9 )
- aData.Append( String::CreateFromInt64( static_cast< sal_Int64 >( nData / 10 ) ) );
- aData.Append( static_cast< sal_Unicode >( '0' + (nData % 10) ) );
- AppendString( rStr, aData, nWidth, cFill );
-}
-
-void StringHelper::AppendDec( String& rStr, sal_Int64 nData, xub_StrLen nWidth, sal_Unicode cFill )
-{
- AppendString( rStr, String::CreateFromInt64( nData ), nWidth, cFill );
-}
-
-void StringHelper::AppendDec( String& rStr, double fData, xub_StrLen nWidth, sal_Unicode cFill )
-{
- AppendString( rStr, String( ::rtl::math::doubleToUString( fData, rtl_math_StringFormat_G, 15, '.', true ) ), nWidth, cFill );
-}
-
-// append hexadecimal ---------------------------------------------------------
-
-void StringHelper::AppendHex( String& rStr, sal_uInt8 nData, bool bPrefix )
-{
- static const sal_Char spcHexDigits[] = "0123456789ABCDEF";
- static const String saPrefix = CREATE_STRING( "0x" );
- if( bPrefix )
- rStr.Append( saPrefix );
- rStr.Append( spcHexDigits[ (nData >> 4) & 0x0F ] ).Append( spcHexDigits[ nData & 0x0F ] );
-}
-
-void StringHelper::AppendHex( String& rStr, sal_Int8 nData, bool bPrefix )
-{
- AppendHex( rStr, static_cast< sal_uInt8 >( nData ), bPrefix );
-}
-
-void StringHelper::AppendHex( String& rStr, sal_uInt16 nData, bool bPrefix )
-{
- AppendHex( rStr, static_cast< sal_uInt8 >( nData >> 8 ), bPrefix );
- AppendHex( rStr, static_cast< sal_uInt8 >( nData ), false );
-}
-
-void StringHelper::AppendHex( String& rStr, sal_Int16 nData, bool bPrefix )
-{
- AppendHex( rStr, static_cast< sal_uInt16 >( nData ), bPrefix );
-}
-
-void StringHelper::AppendHex( String& rStr, sal_uInt32 nData, bool bPrefix )
-{
- AppendHex( rStr, static_cast< sal_uInt16 >( nData >> 16 ), bPrefix );
- AppendHex( rStr, static_cast< sal_uInt16 >( nData ), false );
-}
-
-void StringHelper::AppendHex( String& rStr, sal_Int32 nData, bool bPrefix )
-{
- AppendHex( rStr, static_cast< sal_uInt32 >( nData ), bPrefix );
-}
-
-void StringHelper::AppendHex( String& rStr, sal_uInt64 nData, bool bPrefix )
-{
- AppendHex( rStr, static_cast< sal_uInt32 >( nData >> 32 ), bPrefix );
- AppendHex( rStr, static_cast< sal_uInt32 >( nData ), false );
-}
-
-void StringHelper::AppendHex( String& rStr, sal_Int64 nData, bool bPrefix )
-{
- AppendHex( rStr, static_cast< sal_uInt64 >( nData ), bPrefix );
-}
-
-void StringHelper::AppendHex( String& rStr, double fData, bool bPrefix )
-{
- const sal_uInt32* pnData = reinterpret_cast< const sal_uInt32* >( &fData );
- AppendHex( rStr, pnData[ 0 ], bPrefix );
- AppendHex( rStr, pnData[ 1 ], false );
-}
-
-// append shortened hexadecimal -----------------------------------------------
-
-void StringHelper::AppendShortHex( String& rStr, sal_uInt8 nData, bool bPrefix )
-{
- if( nData != 0 )
- AppendHex( rStr, nData, bPrefix );
-}
-
-void StringHelper::AppendShortHex( String& rStr, sal_Int8 nData, bool bPrefix )
-{
- AppendShortHex( rStr, static_cast< sal_uInt8 >( nData ), bPrefix );
-}
-
-void StringHelper::AppendShortHex( String& rStr, sal_uInt16 nData, bool bPrefix )
-{
- if( nData > 0xFF )
- AppendHex( rStr, nData, bPrefix );
- else
- AppendShortHex( rStr, static_cast< sal_uInt8 >( nData ), bPrefix );
-}
-
-void StringHelper::AppendShortHex( String& rStr, sal_Int16 nData, bool bPrefix )
-{
- AppendShortHex( rStr, static_cast< sal_uInt16 >( nData ), bPrefix );
-}
-
-void StringHelper::AppendShortHex( String& rStr, sal_uInt32 nData, bool bPrefix )
-{
- if( nData > 0xFFFF )
- AppendHex( rStr, nData, bPrefix );
- else
- AppendShortHex( rStr, static_cast< sal_uInt16 >( nData ), bPrefix );
-}
-
-void StringHelper::AppendShortHex( String& rStr, sal_Int32 nData, bool bPrefix )
-{
- AppendShortHex( rStr, static_cast< sal_uInt32 >( nData ), bPrefix );
-}
-
-void StringHelper::AppendShortHex( String& rStr, sal_uInt64 nData, bool bPrefix )
-{
- if( nData > 0xFFFFFFFF )
- AppendHex( rStr, nData, bPrefix );
- else
- AppendShortHex( rStr, static_cast< sal_uInt32 >( nData ), bPrefix );
-}
-
-void StringHelper::AppendShortHex( String& rStr, sal_Int64 nData, bool bPrefix )
-{
- AppendShortHex( rStr, static_cast< sal_uInt64 >( nData ), bPrefix );
-}
-
-// append binary --------------------------------------------------------------
-
-void StringHelper::AppendBin( String& rStr, sal_uInt8 nData, bool bDots )
-{
- for( sal_uInt8 nMask = 0x80; nMask != 0; (nMask >>= 1) &= 0x7F )
- {
- rStr.Append( (nData & nMask) ? '1' : '0' );
- if( bDots && (nMask == 0x10) )
- rStr.Append( SCF_DUMP_BINDOT );
- }
-}
-
-void StringHelper::AppendBin( String& rStr, sal_Int8 nData, bool bDots )
-{
- AppendBin( rStr, static_cast< sal_uInt8 >( nData ), bDots );
-}
-
-void StringHelper::AppendBin( String& rStr, sal_uInt16 nData, bool bDots )
-{
- AppendBin( rStr, static_cast< sal_uInt8 >( nData >> 8 ), bDots );
- if( bDots )
- rStr.Append( SCF_DUMP_BINDOT );
- AppendBin( rStr, static_cast< sal_uInt8 >( nData ), bDots );
-}
-
-void StringHelper::AppendBin( String& rStr, sal_Int16 nData, bool bDots )
-{
- AppendBin( rStr, static_cast< sal_uInt16 >( nData ), bDots );
-}
-
-void StringHelper::AppendBin( String& rStr, sal_uInt32 nData, bool bDots )
-{
- AppendBin( rStr, static_cast< sal_uInt16 >( nData >> 16 ), bDots );
- if( bDots )
- rStr.Append( SCF_DUMP_BINDOT );
- AppendBin( rStr, static_cast< sal_uInt16 >( nData ), bDots );
-}
-
-void StringHelper::AppendBin( String& rStr, sal_Int32 nData, bool bDots )
-{
- AppendBin( rStr, static_cast< sal_uInt32 >( nData ), bDots );
-}
-
-void StringHelper::AppendBin( String& rStr, sal_uInt64 nData, bool bDots )
-{
- AppendBin( rStr, static_cast< sal_uInt32 >( nData >> 32 ), bDots );
- if( bDots )
- rStr.Append( SCF_DUMP_BINDOT );
- AppendBin( rStr, static_cast< sal_uInt32 >( nData ), bDots );
-}
-
-void StringHelper::AppendBin( String& rStr, sal_Int64 nData, bool bDots )
-{
- AppendBin( rStr, static_cast< sal_uInt64 >( nData ), bDots );
-}
-
-void StringHelper::AppendBin( String& rStr, double fData, bool bDots )
-{
- const sal_uInt32* pnData = reinterpret_cast< const sal_uInt32* >( &fData );
- AppendBin( rStr, pnData[ 0 ], bDots );
- if( bDots )
- rStr.Append( SCF_DUMP_BINDOT );
- AppendBin( rStr, pnData[ 1 ], bDots );
-}
-
-// append formatted value -----------------------------------------------------
-
-void StringHelper::AppendBool( String& rStr, bool bData )
-{
- rStr.AppendAscii( bData ? "true" : "false" );
-}
-
-// encoded text output --------------------------------------------------------
-
-void StringHelper::AppendCChar( String& rStr, sal_Unicode cChar, bool bPrefix )
-{
- static const String saXPrefix = CREATE_STRING( "\\x" );
- static const String saUPrefix = CREATE_STRING( "\\u" );
- if( cChar > 0x00FF )
- {
- if( bPrefix )
- rStr.Append( saUPrefix );
- AppendHex( rStr, static_cast< sal_uInt16 >( cChar ), false );
- }
- else
- {
- if( bPrefix )
- rStr.Append( saXPrefix );
- AppendHex( rStr, static_cast< sal_uInt8 >( cChar ), false );
- }
-}
-
-void StringHelper::AppendEncChar( String& rStr, sal_Unicode cChar, xub_StrLen nCount, bool bPrefix )
-{
- if( cChar < 0x0020 )
- {
- // C-style hex code
- String aCode;
- AppendCChar( aCode, cChar, bPrefix );
- for( xub_StrLen nIdx = 0; nIdx < nCount; ++nIdx )
- rStr.Append( aCode );
- }
- else if( nCount == 1 )
- rStr.Append( cChar );
- else
- rStr.Expand( rStr.Len() + nCount, cChar );
-}
-
-void StringHelper::AppendEncString( String& rStr, const String& rData, bool bPrefix )
-{
- xub_StrLen nBeg = 0;
- xub_StrLen nIdx = 0;
- xub_StrLen nEnd = rData.Len();
- while( nIdx < nEnd )
- {
- // find next character that needs encoding
- while( (nIdx < nEnd) && (rData.GetChar( nIdx ) >= 0x20) ) ++nIdx;
- // append portion
- if( nBeg < nIdx )
- {
- if( (nBeg == 0) && (nIdx == nEnd) )
- rStr.Append( rData );
- else
- rStr.Append( String( rData, nBeg, nIdx - nBeg ) );
- }
- // append characters to be encoded
- while( (nIdx < nEnd) && (rData.GetChar( nIdx ) < 0x20) )
- {
- AppendCChar( rStr, rData.GetChar( nIdx ), bPrefix );
- ++nIdx;
- }
- // adjust limits
- nBeg = nIdx;
- }
-}
-
-// token list -----------------------------------------------------------------
-
-void StringHelper::AppendToken( String& rStr, const String& rToken, sal_Unicode cSep )
-{
- if( (rStr.Len() > 0) && (rToken.Len() > 0) )
- rStr.Append( cSep );
- rStr.Append( rToken );
-}
-
-void StringHelper::AppendToken( String& rStr, sal_Int64 nToken, sal_Unicode cSep )
-{
- String aToken;
- AppendDec( aToken, nToken );
- AppendToken( rStr, aToken, cSep );
-}
-
-void StringHelper::PrependToken( String& rStr, const String& rToken, sal_Unicode cSep )
-{
- String aRet = rToken;
- AppendToken( aRet, rStr, cSep );
- rStr = aRet;
-}
-
-void StringHelper::PrependToken( String& rStr, sal_Int64 nToken, sal_Unicode cSep )
-{
- String aToken;
- AppendDec( aToken, nToken );
- PrependToken( rStr, aToken, cSep );
-}
-
-void StringHelper::AppendIndex( String& rStr, const String& rIdx )
-{
- rStr.Append( '[' ).Append( rIdx ).Append( ']' );
-}
-
-void StringHelper::AppendIndex( String& rStr, sal_Int64 nIdx )
-{
- String aToken;
- AppendDec( aToken, nIdx );
- AppendIndex( rStr, aToken );
-}
-
-void StringHelper::AppendIndexedText( String& rStr, const String& rData, const String& rIdx )
-{
- rStr.Append( rData );
- AppendIndex( rStr, rIdx );
-}
-
-void StringHelper::AppendIndexedText( String& rStr, const String& rData, sal_Int64 nIdx )
-{
- rStr.Append( rData );
- AppendIndex( rStr, nIdx );
-}
-
-String StringHelper::GetToken( const String& rData, xub_StrLen& rnPos, sal_Unicode cSep )
-{
- String aToken = rData.GetToken( 0, cSep, rnPos );
- TrimSpaces( aToken );
- return aToken;
-}
-
-// quoting and trimming -------------------------------------------------------
-
-void StringHelper::Enclose( String& rStr, sal_Unicode cOpen, sal_Unicode cClose )
-{
- rStr.Insert( cOpen, 0 ).Append( cClose ? cClose : cOpen );
-}
-
-void StringHelper::TrimSpaces( String& rStr )
-{
- xub_StrLen nPos = 0;
- while( (nPos < rStr.Len()) && ((rStr.GetChar( nPos ) == ' ') || (rStr.GetChar( nPos ) == '\t')) )
- ++nPos;
- rStr.Erase( 0, nPos );
- nPos = rStr.Len();
- while( (nPos > 0) && ((rStr.GetChar( nPos - 1 ) == ' ') || (rStr.GetChar( nPos - 1 ) == '\t')) )
- --nPos;
- rStr.Erase( nPos + 1 );
-}
-
-void StringHelper::TrimQuotes( String& rStr )
-{
- xub_StrLen nPos = 0;
- while( nPos < rStr.Len() )
- {
- // trim quotes
- if( (nPos < rStr.Len()) && (rStr.GetChar( nPos ) == SCF_DUMP_CFG_QUOTE) )
- {
- rStr.Erase( nPos, 1 );
- while( (nPos < rStr.Len()) && ((rStr.GetChar( nPos ) != SCF_DUMP_CFG_QUOTE) ||
- ((nPos + 1 < rStr.Len()) && (rStr.GetChar( nPos + 1 ) == SCF_DUMP_CFG_QUOTE))) )
- ++nPos;
- if( (nPos < rStr.Len()) && (rStr.GetChar( nPos ) == SCF_DUMP_CFG_QUOTE) )
- rStr.Erase( nPos, 1 );
- }
- // look for separator
- while( (nPos < rStr.Len()) && (rStr.GetChar( nPos ) != SCF_DUMP_CFG_LISTSEP) )
- ++nPos;
- if( (nPos < rStr.Len()) && (rStr.GetChar( nPos ) == SCF_DUMP_CFG_LISTSEP) )
- rStr.SetChar( nPos, SCF_DUMP_LISTSEP );
- ++nPos;
- }
-}
-
-// string conversion ----------------------------------------------------------
-
-ByteString StringHelper::ConvertToUtf8( const String& rStr )
-{
- return ByteString( rStr, RTL_TEXTENCODING_UTF8 );
-}
-
-DataType StringHelper::ConvertToDataType( const String& rStr )
-{
- DataType eType = DATATYPE_VOID;
- if( rStr.EqualsAscii( "int8" ) )
- eType = DATATYPE_INT8;
- else if( rStr.EqualsAscii( "uint8" ) )
- eType = DATATYPE_UINT8;
- else if( rStr.EqualsAscii( "int16" ) )
- eType = DATATYPE_INT16;
- else if( rStr.EqualsAscii( "uint16" ) )
- eType = DATATYPE_UINT16;
- else if( rStr.EqualsAscii( "int32" ) )
- eType = DATATYPE_INT32;
- else if( rStr.EqualsAscii( "uint32" ) )
- eType = DATATYPE_UINT32;
- else if( rStr.EqualsAscii( "int64" ) )
- eType = DATATYPE_INT64;
- else if( rStr.EqualsAscii( "uint64" ) )
- eType = DATATYPE_UINT64;
- else if( rStr.EqualsAscii( "float" ) )
- eType = DATATYPE_FLOAT;
- else if( rStr.EqualsAscii( "double" ) )
- eType = DATATYPE_DOUBLE;
- return eType;
-}
-
-FormatType StringHelper::ConvertToFormatType( const String& rStr )
-{
- FormatType eType = FORMATTYPE_NONE;
- if( rStr.EqualsAscii( "dec" ) )
- eType = FORMATTYPE_DEC;
- else if( rStr.EqualsAscii( "hex" ) )
- eType = FORMATTYPE_HEX;
- else if( rStr.EqualsAscii( "bin" ) )
- eType = FORMATTYPE_BIN;
- else if( rStr.EqualsAscii( "fix" ) )
- eType = FORMATTYPE_FIX;
- else if( rStr.EqualsAscii( "bool" ) )
- eType = FORMATTYPE_BOOL;
- return eType;
-}
-
-bool StringHelper::ConvertFromDec( sal_Int64& rnData, const String& rData )
-{
- xub_StrLen nPos = 0;
- xub_StrLen nLen = rData.Len();
- bool bNeg = false;
- if( (nLen > 0) && (rData.GetChar( 0 ) == '-') )
- {
- bNeg = true;
- ++nPos;
- }
- rnData = 0;
- for( ; nPos < nLen; ++nPos )
- {
- sal_Unicode cChar = rData.GetChar( nPos );
- if( (cChar < '0') || (cChar > '9') )
- return false;
- (rnData *= 10) += (cChar - '0');
- }
- if( bNeg )
- rnData *= -1;
- return true;
-}
-
-bool StringHelper::ConvertFromHex( sal_Int64& rnData, const String& rData )
-{
- rnData = 0;
- for( xub_StrLen nPos = 0, nLen = rData.Len(); nPos < nLen; ++nPos )
- {
- sal_Unicode cChar = rData.GetChar( nPos );
- if( ('0' <= cChar) && (cChar <= '9') )
- cChar -= '0';
- else if( ('A' <= cChar) && (cChar <= 'F') )
- cChar -= ('A' - 10);
- else if( ('a' <= cChar) && (cChar <= 'f') )
- cChar -= ('a' - 10);
- else
- return false;
- (rnData <<= 4) += cChar;
- }
- return true;
-}
-
-bool StringHelper::ConvertStringToInt( sal_Int64& rnData, const String& rData )
-{
- if( (rData.Len() > 2) && (rData.GetChar( 0 ) == '0') && ((rData.GetChar( 1 ) == 'X') || (rData.GetChar( 1 ) == 'x')) )
- return ConvertFromHex( rnData, rData.Copy( 2 ) );
- return ConvertFromDec( rnData, rData );
-}
-
-bool StringHelper::ConvertStringToDouble( double& rfData, const String& rData )
-{
- rtl_math_ConversionStatus eStatus = rtl_math_ConversionStatus_Ok;
- sal_Int32 nSize = 0;
- rfData = rtl::math::stringToDouble( rData, '.', '\0', &eStatus, &nSize );
- return (eStatus == rtl_math_ConversionStatus_Ok) && (nSize == static_cast< sal_Int32 >( rData.Len() ));
-}
-
-bool StringHelper::ConvertStringToBool( const String& rData )
-{
- if( rData.EqualsIgnoreCaseAscii( "true" ) )
- return true;
- if( rData.EqualsIgnoreCaseAscii( "false" ) )
- return false;
- sal_Int64 nData;
- return ConvertStringToInt( nData, rData ) && (nData != 0);
-}
-
-void StringHelper::ConvertStringToStringList( ScfStringVec& rVec, const String& rData, bool bIgnoreEmpty )
-{
- rVec.clear();
- xub_StrLen nTokenCnt = rData.GetTokenCount( SCF_DUMP_LISTSEP );
- xub_StrLen nPos = 0;
- for( xub_StrLen nToken = 0; nToken < nTokenCnt; ++nToken )
- {
- String aToken = GetToken( rData, nPos, SCF_DUMP_LISTSEP );
- if( !bIgnoreEmpty || (aToken.Len() > 0) )
- rVec.push_back( aToken );
- }
-}
-
-void StringHelper::ConvertStringToIntList( ScfInt64Vec& rVec, const String& rData, bool bIgnoreEmpty )
-{
- rVec.clear();
- xub_StrLen nTokenCnt = rData.GetTokenCount( SCF_DUMP_LISTSEP );
- xub_StrLen nPos = 0;
- sal_Int64 nData;
- for( xub_StrLen nToken = 0; nToken < nTokenCnt; ++nToken )
- {
- bool bOk = ConvertStringToInt( nData, GetToken( rData, nPos, SCF_DUMP_LISTSEP ) );
- if( !bIgnoreEmpty || bOk )
- rVec.push_back( bOk ? nData : 0 );
- }
-}
-
-// file names -----------------------------------------------------------------
-
-String StringHelper::ConvertFileNameToUrl( const String& rFileName )
-{
- ::rtl::OUString aOUFileUrl;
- bool bOk = ::osl::FileBase::getFileURLFromSystemPath( rFileName, aOUFileUrl ) == ::osl::FileBase::E_None;
- return bOk ? String( aOUFileUrl ) : String::EmptyString();
-}
-
-xub_StrLen StringHelper::GetFileNamePos( const String& rFileUrl )
-{
- xub_StrLen nSepPos = rFileUrl.SearchBackward( '/' );
- return (nSepPos == STRING_NOTFOUND) ? 0 : (nSepPos + 1);
-}
-
-// ============================================================================
-// ============================================================================
-
-Base::~Base()
-{
-}
-
-// ============================================================================
-// ============================================================================
-
-ConfigItemBase::~ConfigItemBase()
-{
-}
-
-void ConfigItemBase::ReadConfigBlock( SvStream& rStrm )
-{
- // first line must be "begin" item
- sal_Size nOldPos = rStrm.Tell();
- if( ReadConfigLine( rStrm ) == LINETYPE_BEGIN )
- ReadConfigBlockContents( rStrm );
- else
- rStrm.Seek( nOldPos );
-}
-
-void ConfigItemBase::ImplProcessConfigItemStr( SvStream& /*rStrm*/, const String& /*rKey*/, const String& /*rData*/ )
-{
-}
-
-void ConfigItemBase::ImplProcessConfigItemInt( SvStream& /*rStrm*/, sal_Int64 /*nKey*/, const String& /*rData*/ )
-{
-}
-
-void ConfigItemBase::ReadConfigBlockContents( SvStream& rStrm )
-{
- bool bLoop = true;
- while( bLoop && !rStrm.IsEof() )
- {
- String aKey, aData;
- switch( ReadConfigLine( rStrm, aKey, aData ) )
- {
- case LINETYPE_BEGIN:
- IgnoreConfigBlockContents( rStrm ); // ignore unknown embedded block
- break;
- case LINETYPE_END:
- bLoop = false;
- break;
- case LINETYPE_DATA:
- ProcessConfigItem( rStrm, aKey, aData );
- break;
- default:
- DBG_ERRORFILE( "scf::dump::ConfigItemBase::ReadConfigBlockContents - unknown config line type" );
- }
- }
-}
-
-void ConfigItemBase::IgnoreConfigBlockContents( SvStream& rStrm )
-{
- bool bLoop = true;
- while( bLoop && !rStrm.IsEof() )
- {
- switch( ReadConfigLine( rStrm ) )
- {
- case LINETYPE_BEGIN:
- IgnoreConfigBlockContents( rStrm );
- break;
- case LINETYPE_END:
- bLoop = false;
- break;
- default:;
- }
- }
-}
-
-ConfigItemBase::LineType ConfigItemBase::ReadConfigLine( SvStream& rStrm, String& rKey, String& rData ) const
-{
- String aLine;
- while( !rStrm.IsEof() && (aLine.Len() == 0) )
- {
- rStrm.ReadByteStringLine( aLine, RTL_TEXTENCODING_UTF8 );
- aLine.EraseLeadingChars( SCF_UTF8_BOM );
- StringHelper::TrimSpaces( aLine );
- if( aLine.Len() > 0 )
- {
- // ignore comments (starting with hash or semicolon)
- sal_Unicode cChar = aLine.GetChar( 0 );
- if( (cChar == '#') || (cChar == ';') )
- aLine.Erase();
- }
- }
-
- LineType eResult = LINETYPE_END;
- if( aLine.Len() > 0 )
- {
- xub_StrLen nEqPos = aLine.Search( '=' );
- if( nEqPos == STRING_NOTFOUND )
- {
- rKey = aLine;
- }
- else
- {
- rKey = aLine.Copy( 0, nEqPos );
- StringHelper::TrimSpaces( rKey );
- rData = aLine.Copy( nEqPos + 1 );
- StringHelper::TrimSpaces( rData );
- StringHelper::TrimQuotes( rData );
- }
-
- if( rKey.Len() > 0 )
- {
- eResult = LINETYPE_DATA;
- if( rData.Len() == 0 )
- {
- if( rKey.EqualsAscii( "begin" ) )
- eResult = LINETYPE_BEGIN;
- else if( rKey.EqualsAscii( "end" ) )
- eResult = LINETYPE_END;
- }
- }
- }
-
- return eResult;
-}
-
-ConfigItemBase::LineType ConfigItemBase::ReadConfigLine( SvStream& rStrm ) const
-{
- String aKey, aData;
- return ReadConfigLine( rStrm, aKey, aData );
-}
-
-void ConfigItemBase::ProcessConfigItem( SvStream& rStrm, const String& rKey, const String& rData )
-{
- sal_Int64 nKey;
- if( StringHelper::ConvertStringToInt( nKey, rKey ) )
- ImplProcessConfigItemInt( rStrm, nKey, rData );
- else
- ImplProcessConfigItemStr( rStrm, rKey, rData );
-}
-
-// ============================================================================
-
-NameListBase::~NameListBase()
-{
-}
-
-void NameListBase::SetName( sal_Int64 nKey, const StringWrapper& rNameWrp )
-{
- String aName = rNameWrp.GetString();
- StringHelper::TrimQuotes( aName );
- ImplSetName( nKey, aName );
-}
-
-void NameListBase::IncludeList( NameListRef xList )
-{
- if( xList.is() )
- {
- for( const_iterator aIt = xList->begin(), aEnd = xList->end(); aIt != aEnd; ++aIt )
- maMap[ aIt->first ] = aIt->second;
- ImplIncludeList( *xList );
- }
-}
-
-bool NameListBase::ImplIsValid() const
-{
- return true;
-}
-
-void NameListBase::ImplProcessConfigItemStr( SvStream& rStrm, const String& rKey, const String& rData )
-{
- if( rKey.EqualsAscii( "include" ) )
- Include( rData );
- else if( rKey.EqualsAscii( "exclude" ) )
- Exclude( rData );
- else
- ConfigItemBase::ImplProcessConfigItemStr( rStrm, rKey, rData );
-}
-
-void NameListBase::ImplProcessConfigItemInt( SvStream& /*rStrm*/, sal_Int64 nKey, const String& rData )
-{
- ImplSetName( nKey, rData );
-}
-
-void NameListBase::InsertRawName( sal_Int64 nKey, const String& rName )
-{
- maMap[ nKey ] = rName;
-}
-
-const String* NameListBase::FindRawName( sal_Int64 nKey ) const
-{
- const_iterator aIt = maMap.find( nKey );
- return (aIt == end()) ? 0 : &aIt->second;
-}
-
-void NameListBase::Include( const String& rListKeys )
-{
- ScfStringVec aVec;
- StringHelper::ConvertStringToStringList( aVec, rListKeys, true );
- for( ScfStringVec::const_iterator aIt = aVec.begin(), aEnd = aVec.end(); aIt != aEnd; ++aIt )
- IncludeList( mrCoreData.GetNameList( *aIt ) );
-}
-
-void NameListBase::Exclude( const String& rKeys )
-{
- ScfInt64Vec aVec;
- StringHelper::ConvertStringToIntList( aVec, rKeys, true );
- for( ScfInt64Vec::const_iterator aIt = aVec.begin(), aEnd = aVec.end(); aIt != aEnd; ++aIt )
- maMap.erase( *aIt );
-}
-
-// ============================================================================
-
-ConstList::ConstList( const ConfigCoreData& rCoreData ) :
- NameListBase( rCoreData ),
- maDefName( SCF_DUMP_ERR_NONAME ),
- mbQuoteNames( false )
-{
-}
-
-void ConstList::ImplProcessConfigItemStr( SvStream& rStrm, const String& rKey, const String& rData )
-{
- if( rKey.EqualsAscii( "default" ) )
- SetDefaultName( rData );
- else if( rKey.EqualsAscii( "quote-names" ) )
- SetQuoteNames( StringHelper::ConvertStringToBool( rData ) );
- else
- NameListBase::ImplProcessConfigItemStr( rStrm, rKey, rData );
-}
-
-void ConstList::ImplSetName( sal_Int64 nKey, const String& rName )
-{
- InsertRawName( nKey, rName );
-}
-
-String ConstList::ImplGetName( const Config& /*rCfg*/, sal_Int64 nKey ) const
-{
- const String* pName = FindRawName( nKey );
- String aName = pName ? *pName : maDefName;
- if( mbQuoteNames )
- StringHelper::Enclose( aName, '\'' );
- return aName;
-}
-
-String ConstList::ImplGetNameDbl( const Config& /*rCfg*/, double /*fValue*/ ) const
-{
- return String();
-}
-
-void ConstList::ImplIncludeList( const NameListBase& rList )
-{
- if( const ConstList* pConstList = dynamic_cast< const ConstList* >( &rList ) )
- {
- maDefName = pConstList->maDefName;
- mbQuoteNames = pConstList->mbQuoteNames;
- }
-}
-
-// ============================================================================
-
-MultiList::MultiList( const ConfigCoreData& rCoreData ) :
- ConstList( rCoreData ),
- mbIgnoreEmpty( true )
-{
-}
-
-void MultiList::SetNamesFromVec( sal_Int64 nStartKey, const ScfStringVec& rNames )
-{
- sal_Int64 nKey = nStartKey;
- for( ScfStringVec::const_iterator aIt = rNames.begin(), aEnd = rNames.end(); aIt != aEnd; ++aIt, ++nKey )
- if( !mbIgnoreEmpty || (aIt->Len() > 0) )
- InsertRawName( nKey, *aIt );
-}
-
-void MultiList::ImplProcessConfigItemStr( SvStream& rStrm, const String& rKey, const String& rData )
-{
- if( rKey.EqualsAscii( "ignore-empty" ) )
- mbIgnoreEmpty = StringHelper::ConvertStringToBool( rData );
- else
- ConstList::ImplProcessConfigItemStr( rStrm, rKey, rData );
-}
-
-void MultiList::ImplSetName( sal_Int64 nKey, const String& rName )
-{
- ScfStringVec aNames;
- StringHelper::ConvertStringToStringList( aNames, rName, false );
- SetNamesFromVec( nKey, aNames );
-}
-
-// ============================================================================
-
-FlagsList::FlagsList( const ConfigCoreData& rCoreData ) :
- NameListBase( rCoreData ),
- mnIgnore( 0 )
-{
-}
-
-void FlagsList::ImplProcessConfigItemStr( SvStream& rStrm, const String& rKey, const String& rData )
-{
- if( rKey.EqualsAscii( "ignore" ) )
- {
- sal_Int64 nIgnore;
- if( StringHelper::ConvertStringToInt( nIgnore, rData ) )
- SetIgnoreFlags( nIgnore );
- }
- else
- NameListBase::ImplProcessConfigItemStr( rStrm, rKey, rData );
-}
-
-void FlagsList::ImplSetName( sal_Int64 nKey, const String& rName )
-{
- InsertRawName( nKey, rName );
-}
-
-String FlagsList::ImplGetName( const Config& /*rCfg*/, sal_Int64 nKey ) const
-{
- sal_Int64 nFlags = nKey;
- ::set_flag( nFlags, mnIgnore, false );
- sal_Int64 nFound = 0;
- String aName;
- // add known flags
- for( const_iterator aIt = begin(), aEnd = end(); aIt != aEnd; ++aIt )
- {
- sal_Int64 nMask = aIt->first;
- if( ::get_flag( nFlags, nMask ) )
- StringHelper::AppendToken( aName, aIt->second );
- ::set_flag( nFound, nMask );
- }
- // add unknown flags
- ::set_flag( nFlags, nFound, false );
- if( nFlags != 0 )
- {
- String aUnknown = CREATE_STRING( SCF_DUMP_UNKNOWN );
- aUnknown.Append( SCF_DUMP_ITEMSEP );
- StringHelper::AppendShortHex( aUnknown, nFlags, true );
- StringHelper::Enclose( aUnknown, '(', ')' );
- StringHelper::AppendToken( aName, aUnknown );
- }
- return aName;
-}
-
-String FlagsList::ImplGetNameDbl( const Config& /*rCfg*/, double /*fValue*/ ) const
-{
- return String();
-}
-
-void FlagsList::ImplIncludeList( const NameListBase& rList )
-{
- if( const FlagsList* pFlagsList = dynamic_cast< const FlagsList* >( &rList ) )
- mnIgnore = pFlagsList->mnIgnore;
-}
-
-// ============================================================================
-
-CombiList::CombiList( const ConfigCoreData& rCoreData ) :
- FlagsList( rCoreData )
-{
-}
-
-void CombiList::ImplSetName( sal_Int64 nKey, const String& rName )
-{
- if( (nKey & (nKey - 1)) != 0 ) // more than a single bit set?
- {
- ExtItemFormat& rItemFmt = maFmtMap[ nKey ];
- ScfStringVec aRemain = rItemFmt.Parse( rName );
- rItemFmt.mbShiftValue = aRemain.empty() || !aRemain.front().EqualsAscii( "noshift" );
- }
- else
- {
- FlagsList::ImplSetName( nKey, rName );
- }
-}
-
-String CombiList::ImplGetName( const Config& rCfg, sal_Int64 nKey ) const
-{
- sal_Int64 nFlags = nKey;
- sal_Int64 nFound = 0;
- String aName;
- // add known flag fields
- for( ExtItemFormatMap::const_iterator aIt = maFmtMap.begin(), aEnd = maFmtMap.end(); aIt != aEnd; ++aIt )
- {
- sal_Int64 nMask = aIt->first;
- if( nMask != 0 )
- {
- const ExtItemFormat& rItemFmt = aIt->second;
-
- sal_uInt64 nUFlags = static_cast< sal_uInt64 >( nFlags );
- sal_uInt64 nUMask = static_cast< sal_uInt64 >( nMask );
- if( rItemFmt.mbShiftValue )
- while( (nUMask & 1) == 0 ) { nUFlags >>= 1; nUMask >>= 1; }
-
- sal_uInt64 nUValue = nUFlags & nUMask;
- sal_Int64 nSValue = static_cast< sal_Int64 >( nUValue );
- if( ::get_flag< sal_uInt64 >( nUValue, (nUMask + 1) >> 1 ) )
- ::set_flag( nSValue, static_cast< sal_Int64 >( ~nUMask ) );
-
- String aItem = rItemFmt.maItemName;
- String aValue;
- switch( rItemFmt.meDataType )
- {
- case DATATYPE_INT8: StringHelper::AppendValue( aValue, static_cast< sal_Int8 >( nSValue ), rItemFmt.meFmtType ); break;
- case DATATYPE_UINT8: StringHelper::AppendValue( aValue, static_cast< sal_uInt8 >( nUValue ), rItemFmt.meFmtType ); break;
- case DATATYPE_INT16: StringHelper::AppendValue( aValue, static_cast< sal_Int16 >( nSValue ), rItemFmt.meFmtType ); break;
- case DATATYPE_UINT16: StringHelper::AppendValue( aValue, static_cast< sal_uInt16 >( nUValue ), rItemFmt.meFmtType ); break;
- case DATATYPE_INT32: StringHelper::AppendValue( aValue, static_cast< sal_Int32 >( nSValue ), rItemFmt.meFmtType ); break;
- case DATATYPE_UINT32: StringHelper::AppendValue( aValue, static_cast< sal_uInt32 >( nUValue ), rItemFmt.meFmtType ); break;
- case DATATYPE_INT64: StringHelper::AppendValue( aValue, nSValue, rItemFmt.meFmtType ); break;
- case DATATYPE_UINT64: StringHelper::AppendValue( aValue, nUValue, rItemFmt.meFmtType ); break;
- case DATATYPE_FLOAT: StringHelper::AppendValue( aValue, static_cast< float >( nSValue ), rItemFmt.meFmtType ); break;
- case DATATYPE_DOUBLE: StringHelper::AppendValue( aValue, static_cast< double >( nSValue ), rItemFmt.meFmtType ); break;
- default:;
- }
- StringHelper::AppendToken( aItem, aValue, SCF_DUMP_ITEMSEP );
- if( rItemFmt.maListName.Len() > 0 )
- {
- String aValueName = rCfg.GetName( rItemFmt.maListName, static_cast< sal_Int64 >( nUValue ) );
- StringHelper::AppendToken( aItem, aValueName, SCF_DUMP_ITEMSEP );
- }
- StringHelper::Enclose( aItem, '(', ')' );
- StringHelper::AppendToken( aName, aItem );
- ::set_flag( nFound, nMask );
- }
- }
- ::set_flag( nFlags, nFound, false );
- StringHelper::AppendToken( aName, FlagsList::ImplGetName( rCfg, nFlags ) );
- return aName;
-}
-
-void CombiList::ImplIncludeList( const NameListBase& rList )
-{
- if( const CombiList* pCombiList = dynamic_cast< const CombiList* >( &rList ) )
- maFmtMap = pCombiList->maFmtMap;
- FlagsList::ImplIncludeList( rList );
-}
-
-// ============================================================================
-
-UnitConverter::UnitConverter( const ConfigCoreData& rCoreData ) :
- NameListBase( rCoreData ),
- mfFactor( 1.0 )
-{
-}
-
-void UnitConverter::ImplSetName( sal_Int64 /*nKey*/, const String& /*rName*/ )
-{
- // nothing to do
-}
-
-String UnitConverter::ImplGetName( const Config& rCfg, sal_Int64 nKey ) const
-{
- return ImplGetNameDbl( rCfg, static_cast< double >( nKey ) );
-}
-
-String UnitConverter::ImplGetNameDbl( const Config& /*rCfg*/, double fValue ) const
-{
- String aValue;
- StringHelper::AppendDec( aValue, mfFactor * fValue );
- aValue.Append( maUnitName );
- return aValue;
-}
-
-void UnitConverter::ImplIncludeList( const NameListBase& /*rList*/ )
-{
-}
-
-// ============================================================================
-
-NameListRef NameListWrapper::GetNameList( const Config& rCfg ) const
-{
- return mxList.is() ? mxList : (mxList = rCfg.GetNameList( maNameWrp.GetString() ));
-}
-
-// ============================================================================
-// ============================================================================
-
-ConfigCoreData::ConfigCoreData( const String& rFileName )
-{
- Construct( rFileName );
-}
-
-ConfigCoreData::~ConfigCoreData()
-{
-}
-
-void ConfigCoreData::Construct( const String& rFileName )
-{
- mbLoaded = false;
- String aFileUrl = StringHelper::ConvertFileNameToUrl( rFileName );
- if( aFileUrl.Len() > 0 )
- {
- xub_StrLen nNamePos = StringHelper::GetFileNamePos( aFileUrl );
- maConfigPath = aFileUrl.Copy( 0, nNamePos );
- mbLoaded = ReadConfigFile( aFileUrl );
- }
-}
-
-void ConfigCoreData::SetOption( const String& rKey, const String& rData )
-{
- maConfigData[ rKey ] = rData;
-}
-
-const String* ConfigCoreData::GetOption( const String& rKey ) const
-{
- ConfigDataMap::const_iterator aIt = maConfigData.find( rKey );
- return (aIt == maConfigData.end()) ? 0 : &aIt->second;
-}
-
-void ConfigCoreData::SetNameList( const String& rListName, NameListRef xList )
-{
- if( rListName.Len() > 0 )
- maNameLists[ rListName ] = xList;
-}
-
-void ConfigCoreData::EraseNameList( const String& rListName )
-{
- maNameLists.erase( rListName );
-}
-
-NameListRef ConfigCoreData::GetNameList( const String& rListName ) const
-{
- NameListRef xList;
- NameListMap::const_iterator aIt = maNameLists.find( rListName );
- if( aIt != maNameLists.end() )
- xList = aIt->second;
- return xList;
-}
-
-bool ConfigCoreData::ImplIsValid() const
-{
- return mbLoaded;
-}
-
-void ConfigCoreData::ImplProcessConfigItemStr( SvStream& rStrm, const String& rKey, const String& rData )
-{
- if( rKey.EqualsAscii( "include-config-file" ) )
- ReadConfigFile( String( maConfigPath ).Append( rData ) );
- else if( rKey.EqualsAscii( "constlist" ) )
- ReadNameList< ConstList >( rStrm, rData );
- else if( rKey.EqualsAscii( "multilist" ) )
- ReadNameList< MultiList >( rStrm, rData );
- else if( rKey.EqualsAscii( "flagslist" ) )
- ReadNameList< FlagsList >( rStrm, rData );
- else if( rKey.EqualsAscii( "combilist" ) )
- ReadNameList< CombiList >( rStrm, rData );
- else if( rKey.EqualsAscii( "shortlist" ) )
- CreateShortList( rData );
- else if( rKey.EqualsAscii( "unitconverter" ) )
- CreateUnitConverter( rData );
- else
- SetOption( rKey, rData );
-}
-
-bool ConfigCoreData::ReadConfigFile( const String& rFileUrl )
-{
- SvFileStream aStrm( rFileUrl, STREAM_READ | STREAM_SHARE_DENYWRITE | STREAM_NOCREATE );
- bool bLoaded = aStrm.IsOpen();
- if( bLoaded )
- ReadConfigBlockContents( aStrm );
- return bLoaded;
-}
-
-void ConfigCoreData::CreateShortList( const String& rData )
-{
- ScfStringVec aDataVec;
- StringHelper::ConvertStringToStringList( aDataVec, rData, false );
- if( aDataVec.size() >= 3 )
- {
- sal_Int64 nStartKey;
- if( StringHelper::ConvertStringToInt( nStartKey, aDataVec[ 1 ] ) )
- {
- ScfRef< MultiList > xList = CreateNameList< MultiList >( aDataVec[ 0 ] );
- if( xList.is() )
- {
- aDataVec.erase( aDataVec.begin(), aDataVec.begin() + 2 );
- xList->SetNamesFromVec( nStartKey, aDataVec );
- }
- }
- }
-}
-
-void ConfigCoreData::CreateUnitConverter( const String& rData )
-{
- ScfStringVec aDataVec;
- StringHelper::ConvertStringToStringList( aDataVec, rData, false );
- if( aDataVec.size() >= 3 )
- {
- String aFactor = aDataVec[ 1 ];
- bool bRecip = (aFactor.Len() > 0) && (aFactor.GetChar( 0 ) == '/');
- if( bRecip )
- aFactor.Erase( 0, 1 );
- double fFactor;
- if( StringHelper::ConvertStringToDouble( fFactor, aFactor ) && (fFactor != 0.0) )
- {
- ScfRef< UnitConverter > xList = CreateNameList< UnitConverter >( aDataVec[ 0 ] );
- if( xList.is() )
- {
- xList->SetFactor( bRecip ? (1.0 / fFactor) : fFactor );
- xList->SetUnitName( aDataVec[ 2 ] );
- }
- }
- }
-}
-
-// ============================================================================
-
-Config::Config( const Config& rParent ) :
- Base() // c'tor needs to be called explicitly to avoid compiler warning
-{
- Construct( rParent );
-}
-
-Config::Config( const String& rFileName )
-{
- Construct( rFileName );
-}
-
-Config::Config( const sal_Char* pcEnvVar )
-{
- Construct( pcEnvVar );
-}
-
-Config::~Config()
-{
-}
-
-void Config::Construct( const Config& rParent )
-{
- *this = rParent;
-}
-
-void Config::Construct( const String& rFileName )
-{
- mxCoreData.reset( new ConfigCoreData( rFileName ) );
-}
-
-void Config::Construct( const sal_Char* pcEnvVar )
-{
- if( pcEnvVar )
- if( const sal_Char* pcFileName = ::getenv( pcEnvVar ) )
- Construct( String::CreateFromAscii( pcFileName ) );
-}
-
-void Config::SetStringOption( const StringWrapper& rKey, const StringWrapper& rData )
-{
- mxCoreData->SetOption( rKey.GetString(), rData.GetString() );
-}
-
-const String& Config::GetStringOption( const StringWrapper& rKey, const String& rDefault ) const
-{
- const String* pData = ImplGetOption( rKey.GetString() );
- return pData ? *pData : rDefault;
-}
-
-bool Config::GetBoolOption( const StringWrapper& rKey, bool bDefault ) const
-{
- const String* pData = ImplGetOption( rKey.GetString() );
- return pData ? StringHelper::ConvertStringToBool( *pData ) : bDefault;
-}
-
-bool Config::IsDumperEnabled() const
-{
- return GetBoolOption( "enable-dumper", false );
-}
-
-bool Config::IsImportEnabled() const
-{
- return GetBoolOption( "enable-import", true );
-}
-
-void Config::SetNameList( const StringWrapper& rListName, NameListRef xList )
-{
- mxCoreData->SetNameList( rListName.GetString(), xList );
-}
-
-void Config::EraseNameList( const StringWrapper& rListName )
-{
- mxCoreData->EraseNameList( rListName.GetString() );
-}
-
-NameListRef Config::GetNameList( const StringWrapper& rListName ) const
-{
- return ImplGetNameList( rListName.GetString() );
-}
-
-bool Config::ImplIsValid() const
-{
- return IsValid( mxCoreData );
-}
-
-const String* Config::ImplGetOption( const String& rKey ) const
-{
- return mxCoreData->GetOption( rKey );
-}
-
-NameListRef Config::ImplGetNameList( const String& rListName ) const
-{
- return mxCoreData->GetNameList( rListName );
-}
-
-// ============================================================================
-// ============================================================================
-
-CoreData::CoreData( SfxMedium& rMedium, SfxObjectShell* pDocShell ) :
- mrMedium( rMedium ),
- mpDocShell( pDocShell )
-{
-}
-
-SvStream& CoreData::GetCoreStream()
-{
- return *mrMedium.GetInStream();
-}
-
-bool CoreData::ImplIsValid() const
-{
- return mrMedium.GetInStream() != 0;
-}
-
-// ============================================================================
-// ============================================================================
-
-bool Input::ImplIsValid() const
-{
- return true;
-}
-
-Input& operator>>( Input& rIn, sal_Int64& rnData )
-{
- return rIn >> *reinterpret_cast< double* >( &rnData );
-}
-
-Input& operator>>( Input& rIn, sal_uInt64& rnData )
-{
- return rIn >> *reinterpret_cast< double* >( &rnData );
-}
-
-// ============================================================================
-
-SvStreamInput::SvStreamInput( SvStream& rStrm ) :
- mrStrm( rStrm )
-{
-}
-
-SvStreamInput::~SvStreamInput()
-{
-}
-
-sal_Size SvStreamInput::GetSize() const
-{
- sal_Size nSize = 0;
- if( mrStrm.GetErrorCode() == SVSTREAM_OK )
- {
- sal_Size nPos = mrStrm.Tell();
- mrStrm.Seek( STREAM_SEEK_TO_END );
- nSize = mrStrm.Tell();
- mrStrm.Seek( nPos );
- }
- return nSize;
-}
-
-sal_Size SvStreamInput::Tell() const
-{
- return mrStrm.Tell();
-}
-
-void SvStreamInput::Seek( sal_Size nPos )
-{
- mrStrm.Seek( nPos );
-}
-
-void SvStreamInput::SeekRel( sal_sSize nRelPos )
-{
- mrStrm.SeekRel( nRelPos );
-}
-
-sal_Size SvStreamInput::Read( void* pBuffer, sal_Size nSize )
-{
- return mrStrm.Read( pBuffer, nSize );
-}
-
-void SvStreamInput::ReadLine( String& rLine, rtl_TextEncoding eEnc )
-{
- mrStrm.ReadByteStringLine( rLine, eEnc );
-}
-
-SvStreamInput& SvStreamInput::operator>>( sal_Int8& rnData ) { mrStrm >> rnData; return *this; }
-SvStreamInput& SvStreamInput::operator>>( sal_uInt8& rnData ) { mrStrm >> rnData; return *this; }
-SvStreamInput& SvStreamInput::operator>>( sal_Int16& rnData ) { mrStrm >> rnData; return *this; }
-SvStreamInput& SvStreamInput::operator>>( sal_uInt16& rnData ) { mrStrm >> rnData; return *this; }
-SvStreamInput& SvStreamInput::operator>>( sal_Int32& rnData ) { mrStrm >> rnData; return *this; }
-SvStreamInput& SvStreamInput::operator>>( sal_uInt32& rnData ) { mrStrm >> rnData; return *this; }
-SvStreamInput& SvStreamInput::operator>>( float& rfData ) { mrStrm >> rfData; return *this; }
-SvStreamInput& SvStreamInput::operator>>( double& rfData ) { mrStrm >> rfData; return *this; }
-
-// ============================================================================
-// ============================================================================
-
-Output::Output( SvStream& rStrm ) :
- mrStrm( rStrm ),
- mnCol( 0 ),
- mnItemLevel( 0 ),
- mnMultiLevel( 0 ),
- mnItemIdx( 0 ),
- mnLastItem( 0 )
-{
- WriteChar( SCF_UTF8_BOM );
- WriteAscii( "OpenOffice.org generic file dumper v1.0" );
- NewLine();
- EmptyLine();
-}
-
-// ----------------------------------------------------------------------------
-
-void Output::NewLine()
-{
- if( maLine.Len() > 0 )
- {
- mrStrm << maPrefixUtf8.GetBuffer() << maIndent.GetBuffer();
- mrStrm << StringHelper::ConvertToUtf8( maLine ).GetBuffer() << '\n';
- maLine.Erase();
- mnCol = 0;
- mnLastItem = 0;
- }
-}
-
-void Output::EmptyLine( size_t nCount )
-{
- for( size_t nIdx = 0; nIdx < nCount; ++nIdx )
- mrStrm << maPrefixUtf8.GetBuffer() << '\n';
-}
-
-void Output::SetPrefix( const String& rPrefix )
-{
- maPrefix = rPrefix;
- maPrefixUtf8 = StringHelper::ConvertToUtf8( rPrefix );
-}
-
-void Output::IncIndent()
-{
- maIndent.Expand( maIndent.Len() + SCF_DUMP_INDENT, ' ' );
-}
-
-void Output::DecIndent()
-{
- if( maIndent.Len() >= SCF_DUMP_INDENT )
- maIndent.Erase( 0, SCF_DUMP_INDENT );
-}
-
-void Output::ResetIndent()
-{
- maIndent.Erase();
-}
-
-void Output::StartTable( xub_StrLen nW1 )
-{
- StartTable( 1, &nW1 );
-}
-
-void Output::StartTable( xub_StrLen nW1, xub_StrLen nW2 )
-{
- xub_StrLen pnColWidths[ 2 ];
- pnColWidths[ 0 ] = nW1;
- pnColWidths[ 1 ] = nW2;
- StartTable( 2, pnColWidths );
-}
-
-void Output::StartTable( xub_StrLen nW1, xub_StrLen nW2, xub_StrLen nW3 )
-{
- xub_StrLen pnColWidths[ 3 ];
- pnColWidths[ 0 ] = nW1;
- pnColWidths[ 1 ] = nW2;
- pnColWidths[ 2 ] = nW3;
- StartTable( 3, pnColWidths );
-}
-
-void Output::StartTable( xub_StrLen nW1, xub_StrLen nW2, xub_StrLen nW3, xub_StrLen nW4 )
-{
- xub_StrLen pnColWidths[ 4 ];
- pnColWidths[ 0 ] = nW1;
- pnColWidths[ 1 ] = nW2;
- pnColWidths[ 2 ] = nW3;
- pnColWidths[ 3 ] = nW4;
- StartTable( 4, pnColWidths );
-}
-
-void Output::StartTable( size_t nColCount, const xub_StrLen* pnColWidths )
-{
- maColPos.clear();
- maColPos.push_back( 0 );
- xub_StrLen nColPos = 0;
- for( size_t nCol = 0; nCol < nColCount; ++nCol )
- {
- nColPos = nColPos + pnColWidths[ nCol ];
- maColPos.push_back( nColPos );
- }
-}
-
-void Output::Tab()
-{
- Tab( mnCol + 1 );
-}
-
-void Output::Tab( size_t nCol )
-{
- mnCol = nCol;
- if( mnCol < maColPos.size() )
- {
- xub_StrLen nColPos = maColPos[ mnCol ];
- maLine.Erase( (nColPos == 0) ? 0 : (nColPos - 1) );
- maLine.Expand( nColPos, ' ' );
- }
- else
- WriteChar( ' ', 2 );
-}
-
-void Output::EndTable()
-{
- maColPos.clear();
-}
-
-void Output::ResetItemIndex( sal_Int64 nIdx )
-{
- mnItemIdx = nIdx;
-}
-
-void Output::StartItem( const sal_Char* pcName )
-{
- if( mnItemLevel == 0 )
- {
- if( (mnMultiLevel > 0) && (maLine.Len() > 0) )
- Tab();
- if( pcName )
- {
- WriteItemName( pcName );
- WriteChar( SCF_DUMP_ITEMSEP );
- }
- }
- ++mnItemLevel;
- mnLastItem = maLine.Len();
-}
-
-void Output::ContItem()
-{
- if( mnItemLevel > 0 )
- {
- WriteChar( SCF_DUMP_ITEMSEP );
- mnLastItem = maLine.Len();
- }
-}
-
-void Output::EndItem()
-{
- if( mnItemLevel > 0 )
- {
- maLastItem = maLine.Copy( mnLastItem );
- if( (maLastItem.Len() == 0) && (mnLastItem > 0) && (maLine.GetChar( mnLastItem - 1 ) == SCF_DUMP_ITEMSEP) )
- maLine.Erase( mnLastItem - 1 );
- --mnItemLevel;
- }
- if( mnItemLevel == 0 )
- {
- if( mnMultiLevel == 0 )
- NewLine();
- }
- else
- ContItem();
-}
-
-void Output::StartMultiItems()
-{
- ++mnMultiLevel;
-}
-
-void Output::EndMultiItems()
-{
- if( mnMultiLevel > 0 )
- --mnMultiLevel;
- if( mnMultiLevel == 0 )
- NewLine();
-}
-
-// ----------------------------------------------------------------------------
-
-void Output::WriteChar( sal_Unicode cChar, xub_StrLen nCount )
-{
- StringHelper::AppendEncChar( maLine, cChar, nCount );
-}
-
-void Output::WriteAscii( const sal_Char* pcStr )
-{
- if( pcStr )
- maLine.AppendAscii( pcStr );
-}
-
-void Output::WriteString( const String& rStr )
-{
- StringHelper::AppendEncString( maLine, rStr );
-}
-
-void Output::WriteArray( const sal_uInt8* pnData, sal_Size nSize, sal_Unicode cSep )
-{
- const sal_uInt8* pnEnd = pnData ? (pnData + nSize) : 0;
- for( const sal_uInt8* pnByte = pnData; pnByte < pnEnd; ++pnByte )
- {
- if( pnByte > pnData )
- WriteChar( cSep );
- WriteHex( *pnByte, false );
- }
-}
-
-void Output::WriteBool( bool bData )
-{
- StringHelper::AppendBool( maLine, bData );
-}
-
-void Output::WriteColor( const Color& rColor )
-{
- WriteChar( 'a' );
- WriteDec( rColor.GetTransparency() );
- WriteAscii( ",r" );
- WriteDec( rColor.GetRed() );
- WriteAscii( ",g" );
- WriteDec( rColor.GetGreen() );
- WriteAscii( ",b" );
- WriteDec( rColor.GetBlue() );
-}
-
-void Output::WriteDateTime( const DateTime& rDateTime )
-{
- WriteDec( rDateTime.GetYear(), 4, '0' );
- WriteChar( '-' );
- WriteDec( rDateTime.GetMonth(), 2, '0' );
- WriteChar( '-' );
- WriteDec( rDateTime.GetDay(), 2, '0' );
- WriteChar( 'T' );
- WriteDec( rDateTime.GetHour(), 2, '0' );
- WriteChar( ':' );
- WriteDec( rDateTime.GetMin(), 2, '0' );
- WriteChar( ':' );
- WriteDec( rDateTime.GetSec(), 2, '0' );
-}
-
-// ----------------------------------------------------------------------------
-
-bool Output::ImplIsValid() const
-{
- return true;
-}
-
-void Output::WriteItemName( const sal_Char* pcName )
-{
- if( pcName && (*pcName == '#') )
- {
- WriteAscii( pcName + 1 );
- StringHelper::AppendIndex( maLine, mnItemIdx++ );
- }
- else
- WriteAscii( pcName );
-}
-
-// ============================================================================
-// ============================================================================
-
-ObjectBase::~ObjectBase()
-{
-}
-
-void ObjectBase::Construct( ConfigRef xConfig, CoreDataRef xCore, OutputRef xOut )
-{
- mxConfig = xConfig;
- mxCore = xCore;
- mxOut = xOut;
-}
-
-void ObjectBase::Construct( const ObjectBase& rParent )
-{
- Construct( rParent.mxConfig, rParent.mxCore, rParent.mxOut );
-}
-
-SfxMedium& ObjectBase::GetCoreMedium() const
-{
- return Core().GetMedium();
-}
-
-SvStream& ObjectBase::GetCoreStream() const
-{
- return *Core().GetMedium().GetInStream();
-}
-
-void ObjectBase::Dump()
-{
- if( IsValid() )
- {
- ImplDumpHeader();
- ImplDumpBody();
- ImplDumpFooter();
- }
-}
-
-bool ObjectBase::ImplIsValid() const
-{
- return IsValid( mxConfig ) && IsValid( mxCore ) && IsValid( mxOut );
-}
-
-ConfigRef ObjectBase::ImplReconstructConfig()
-{
- return mxConfig;
-}
-
-OutputRef ObjectBase::ImplReconstructOutput()
-{
- return mxOut;
-}
-
-void ObjectBase::ImplDumpHeader()
-{
-}
-
-void ObjectBase::ImplDumpBody()
-{
-}
-
-void ObjectBase::ImplDumpFooter()
-{
-}
-
-void ObjectBase::ReconstructConfig()
-{
- mxConfig = ImplReconstructConfig();
-}
-
-void ObjectBase::ReconstructOutput()
-{
- mxOut = ImplReconstructOutput();
-}
-
-void ObjectBase::WriteEmptyItem( const sal_Char* pcName )
-{
- ItemGuard aItem( *mxOut, pcName );
-}
-
-void ObjectBase::WriteInfoItem( const sal_Char* pcName, const StringWrapper& rData )
-{
- ItemGuard aItem( *mxOut, pcName );
- mxOut->WriteString( rData.GetString() );
-}
-
-void ObjectBase::WriteStringItem( const sal_Char* pcName, const String& rData )
-{
- ItemGuard aItem( *mxOut, pcName );
- mxOut->WriteAscii( "(len=" );
- mxOut->WriteDec( static_cast< sal_Int32 >( rData.Len() ) );
- mxOut->WriteAscii( ")," );
- String aValue = rData.Copy( 0, SCF_DUMP_MAXSTRLEN );
- StringHelper::Enclose( aValue, '\'' );
- mxOut->WriteString( aValue );
- if( rData.Len() > SCF_DUMP_MAXSTRLEN )
- mxOut->WriteAscii( ",cut" );
-}
-
-void ObjectBase::WriteArrayItem( const sal_Char* pcName, const sal_uInt8* pnData, sal_Size nSize, sal_Unicode cSep )
-{
- ItemGuard aItem( *mxOut, pcName );
- mxOut->WriteArray( pnData, nSize, cSep );
-}
-
-void ObjectBase::WriteBoolItem( const sal_Char* pcName, bool bData )
-{
- ItemGuard aItem( *mxOut, pcName );
- mxOut->WriteBool( bData );
-}
-
-void ObjectBase::WriteColorItem( const sal_Char* pcName, const Color& rColor )
-{
- ItemGuard aItem( *mxOut, pcName );
- WriteHexItem( pcName, rColor.GetColor() );
- mxOut->WriteColor( rColor );
-}
-
-void ObjectBase::WriteDateTimeItem( const sal_Char* pcName, const DateTime& rDateTime )
-{
- ItemGuard aItem( *mxOut, pcName );
- mxOut->WriteDateTime( rDateTime );
-}
-
-void ObjectBase::WriteGuidItem( const sal_Char* pcName, const String& rGuid )
-{
- ItemGuard aItem( *mxOut, pcName );
- mxOut->WriteString( rGuid );
- aItem.Cont();
- mxOut->WriteString( Cfg().GetStringOption( rGuid, String::EmptyString() ) );
-}
-
-// ============================================================================
-
-InputObjectBase::~InputObjectBase()
-{
-}
-
-void InputObjectBase::Construct( const ObjectBase& rParent, InputRef xIn )
-{
- ObjectBase::Construct( rParent );
- mxIn = xIn;
-}
-
-void InputObjectBase::Construct( const InputObjectBase& rParent )
-{
- Construct( rParent, rParent.mxIn );
-}
-
-bool InputObjectBase::ImplIsValid() const
-{
- return IsValid( mxIn ) && ObjectBase::ImplIsValid();
-}
-
-InputRef InputObjectBase::ImplReconstructInput()
-{
- return mxIn;
-}
-
-void InputObjectBase::ImplDumpBody()
-{
- DumpBinaryStream();
-}
-
-void InputObjectBase::ReconstructInput()
-{
- mxIn = ImplReconstructInput();
-}
-
-void InputObjectBase::SkipBlock( sal_Size nSize, bool bShowSize )
-{
- sal_Size nEndPos = ::std::min( mxIn->Tell() + nSize, mxIn->GetSize() );
- if( mxIn->Tell() < nEndPos )
- {
- if( bShowSize )
- WriteDecItem( "skipped-data-size", static_cast< sal_uInt64 >( nEndPos - mxIn->Tell() ) );
- mxIn->Seek( nEndPos );
- }
-}
-
-void InputObjectBase::DumpRawBinary( sal_Size nSize, bool bShowOffset, bool bStream )
-{
- Output& rOut = Out();
- TableGuard aTabGuard( rOut,
- bShowOffset ? 12 : 0,
- 3 * SCF_DUMP_BYTESPERLINE / 2 + 1,
- 3 * SCF_DUMP_BYTESPERLINE / 2 + 1,
- SCF_DUMP_BYTESPERLINE / 2 + 1 );
-
- sal_Size nMaxShowSize = Cfg().GetIntOption< sal_Size >(
- bStream ? "max-binary-stream-size" : "max-binary-data-size", STREAM_SEEK_TO_END );
-
- sal_Size nEndPos = ::std::min( mxIn->Tell() + nSize, mxIn->GetSize() );
- sal_Size nDumpEnd = ::std::min( mxIn->Tell() + nMaxShowSize, nEndPos );
-
- while( mxIn->Tell() < nDumpEnd )
- {
- rOut.WriteHex( static_cast< sal_uInt32 >( mxIn->Tell() ) );
- rOut.Tab();
-
- sal_uInt8 pnLineData[ SCF_DUMP_BYTESPERLINE ];
- sal_Size nLineSize = ::std::min( nDumpEnd - mxIn->Tell(), SCF_DUMP_BYTESPERLINE );
- mxIn->Read( pnLineData, nLineSize );
-
- const sal_uInt8* pnByte = 0;
- const sal_uInt8* pnEnd = 0;
- for( pnByte = pnLineData, pnEnd = pnLineData + nLineSize; pnByte != pnEnd; ++pnByte )
- {
- if( (pnByte - pnLineData) == (SCF_DUMP_BYTESPERLINE / 2) ) rOut.Tab();
- rOut.WriteHex( *pnByte, false );
- rOut.WriteChar( ' ' );
- }
-
- aTabGuard.Tab( 3 );
- for( pnByte = pnLineData, pnEnd = pnLineData + nLineSize; pnByte != pnEnd; ++pnByte )
- {
- if( (pnByte - pnLineData) == (SCF_DUMP_BYTESPERLINE / 2) ) rOut.Tab();
- rOut.WriteChar( static_cast< sal_Unicode >( (*pnByte < 0x20) ? '.' : *pnByte ) );
- }
- rOut.NewLine();
- }
-
- // skip undumped data
- SkipBlock( nEndPos - mxIn->Tell() );
-}
-
-void InputObjectBase::DumpBinary( const sal_Char* pcName, sal_Size nSize, bool bShowOffset )
-{
- WriteEmptyItem( pcName );
- IndentGuard aIndGuard( Out() );
- DumpRawBinary( nSize, bShowOffset );
-}
-
-void InputObjectBase::DumpArray( const sal_Char* pcName, sal_Size nSize, sal_Unicode cSep )
-{
- sal_Size nDumpSize = ::std::min( nSize, mxIn->GetSize() - mxIn->Tell() );
- if( nDumpSize > SCF_DUMP_MAXARRAY )
- {
- DumpBinary( pcName, nSize, false );
- }
- else if( nDumpSize > 1 )
- {
- sal_uInt8 pnData[ SCF_DUMP_MAXARRAY ];
- mxIn->Read( pnData, nDumpSize );
- WriteArrayItem( pcName, pnData, nDumpSize, cSep );
- }
- else if( nDumpSize == 1 )
- DumpHex< sal_uInt8 >( pcName );
-}
-
-void InputObjectBase::DumpRemaining( sal_Size nSize )
-{
- if( nSize > 0 )
- {
- if( Cfg().GetBoolOption( "show-trailing-unknown", true ) )
- DumpBinary( "remaining-data", nSize, false );
- else
- SkipBlock( nSize );
- }
-}
-
-void InputObjectBase::DumpBinaryStream( bool bShowOffset )
-{
- mxIn->Seek( STREAM_SEEK_TO_BEGIN );
- DumpRawBinary( mxIn->GetSize(), bShowOffset, true );
- Out().EmptyLine();
-}
-
-void InputObjectBase::DumpTextStream( rtl_TextEncoding eEnc, bool bShowLines )
-{
- Output& rOut = Out();
- TableGuard aTabGuard( rOut, bShowLines ? 8 : 0 );
-
- mxIn->Seek( STREAM_SEEK_TO_BEGIN );
-
- sal_uInt32 nLine = 0;
- while( mxIn->IsValidPos() )
- {
- String aLine;
- mxIn->ReadLine( aLine, eEnc );
- rOut.WriteDec( ++nLine, 6 );
- rOut.Tab();
- rOut.WriteString( aLine );
- rOut.NewLine();
- }
- rOut.EmptyLine();
-}
-
-String InputObjectBase::DumpGuid( const sal_Char* pcName )
-{
- sal_uInt8 pnData[ 16 ];
- mxIn->Read( pnData, sizeof( pnData ) );
- String aGuid;
- StringHelper::AppendHex( aGuid, SVBT32ToUInt32( pnData ), false );
- aGuid.Append( '-' );
- StringHelper::AppendHex( aGuid, SVBT16ToShort( pnData + 4 ), false );
- aGuid.Append( '-' );
- StringHelper::AppendHex( aGuid, SVBT16ToShort( pnData + 6 ), false );
- aGuid.Append( '-' );
- StringHelper::AppendHex( aGuid, pnData[ 8 ], false );
- StringHelper::AppendHex( aGuid, pnData[ 9 ], false );
- aGuid.Append( '-' );
- StringHelper::AppendHex( aGuid, pnData[ 10 ], false );
- StringHelper::AppendHex( aGuid, pnData[ 11 ], false );
- StringHelper::AppendHex( aGuid, pnData[ 12 ], false );
- StringHelper::AppendHex( aGuid, pnData[ 13 ], false );
- StringHelper::AppendHex( aGuid, pnData[ 14 ], false );
- StringHelper::AppendHex( aGuid, pnData[ 15 ], false );
- WriteGuidItem( pcName, aGuid );
- return aGuid;
-}
-
-void InputObjectBase::DumpItem( const ItemFormat& rItemFmt )
-{
- switch( rItemFmt.meDataType )
- {
- case DATATYPE_VOID: break;
- case DATATYPE_INT8: DumpValue< sal_Int8 >( rItemFmt ); break;
- case DATATYPE_UINT8: DumpValue< sal_uInt8 >( rItemFmt ); break;
- case DATATYPE_INT16: DumpValue< sal_Int16 >( rItemFmt ); break;
- case DATATYPE_UINT16: DumpValue< sal_uInt16 >( rItemFmt ); break;
- case DATATYPE_INT32: DumpValue< sal_Int32 >( rItemFmt ); break;
- case DATATYPE_UINT32: DumpValue< sal_uInt32 >( rItemFmt ); break;
- case DATATYPE_INT64: DumpValue< sal_Int64 >( rItemFmt ); break;
- case DATATYPE_UINT64: DumpValue< sal_uInt64 >( rItemFmt ); break;
- case DATATYPE_FLOAT: DumpValue< float >( rItemFmt ); break;
- case DATATYPE_DOUBLE: DumpValue< double >( rItemFmt ); break;
- default:;
- }
-}
-
-// ============================================================================
-// ============================================================================
-
-StreamObjectBase::~StreamObjectBase()
-{
-}
-
-void StreamObjectBase::Construct( const ObjectBase& rParent, SvStream& rStrm,
- const String& rPath, const String& rStrmName, InputRef xIn )
-{
- mpStrm = &rStrm;
- maPath = rPath;
- maName = rStrmName;
- InputObjectBase::Construct( rParent, xIn );
-}
-
-void StreamObjectBase::Construct( const ObjectBase& rParent,
- SvStream& rStrm, const String& rPath, const String& rStrmName )
-{
- InputRef xIn( new SvStreamInput( rStrm ) );
- Construct( rParent, rStrm, rPath, rStrmName, xIn );
-}
-
-void StreamObjectBase::Construct( const ObjectBase& rParent, SvStream& rStrm )
-{
- Construct( rParent, rStrm, String::EmptyString(), String::EmptyString() );
-}
-
-String StreamObjectBase::GetFullName() const
-{
- return String( maPath ).Append( '/' ).Append( maName );
-}
-
-sal_Size StreamObjectBase::GetStreamSize() const
-{
- sal_Size nPos = mpStrm->Tell();
- mpStrm->Seek( STREAM_SEEK_TO_END );
- sal_Size nSize = mpStrm->Tell();
- mpStrm->Seek( nPos );
- return nSize;
-}
-
-bool StreamObjectBase::ImplIsValid() const
-{
- return mpStrm && InputObjectBase::ImplIsValid();
-}
-
-void StreamObjectBase::ImplDumpHeader()
-{
- Output& rOut = Out();
- rOut.ResetIndent();
- rOut.WriteChar( '+' );
- rOut.WriteChar( '-', 77 );
- rOut.NewLine();
- {
- PrefixGuard aPreGuard( rOut, CREATE_STRING( "|" ) );
- WriteEmptyItem( "STREAM-BEGIN" );
- DumpStreamInfo( true );
- rOut.EmptyLine();
- }
- rOut.EmptyLine();
-}
-
-void StreamObjectBase::ImplDumpFooter()
-{
- Output& rOut = Out();
- rOut.ResetIndent();
- {
- PrefixGuard aPreGuard( rOut, CREATE_STRING( "|" ) );
- rOut.EmptyLine();
- DumpStreamInfo( false );
- WriteEmptyItem( "STREAM-END" );
- }
- rOut.WriteChar( '+' );
- rOut.WriteChar( '-', 77 );
- rOut.NewLine();
- rOut.EmptyLine();
-}
-
-void StreamObjectBase::ImplDumpExtendedHeader()
-{
- WriteDecItem( "stream-size", static_cast< sal_uInt64 >( GetStreamSize() ) );
-}
-
-void StreamObjectBase::DumpStreamInfo( bool bExtended )
-{
- IndentGuard aIndGuard( Out() );
- WriteStringItem( "stream-name", maName );
- WriteStringItem( "full-path", GetFullName() );
- if( bExtended )
- ImplDumpExtendedHeader();
-}
-
-// ============================================================================
-
-SvStreamObject::SvStreamObject( const ObjectBase& rParent, SvStream& rStrm )
-{
- Construct( rParent, rStrm );
-}
-
-SvStreamObject::~SvStreamObject()
-{
-}
-
-void SvStreamObject::Construct( const ObjectBase& rParent, SvStream& rStrm )
-{
- StreamObjectBase::Construct( rParent, rStrm );
-}
-
-// ============================================================================
-
-WrappedStreamObject::WrappedStreamObject( const ObjectBase& rParent, StreamObjectRef xStrmObj )
-{
- Construct( rParent, xStrmObj );
-}
-
-WrappedStreamObject::~WrappedStreamObject()
-{
-}
-
-void WrappedStreamObject::Construct( const ObjectBase& rParent, StreamObjectRef xStrmObj )
-{
- mxStrmObj = xStrmObj;
- if( IsValid( mxStrmObj ) )
- StreamObjectBase::Construct( rParent, mxStrmObj->GetStream(),
- mxStrmObj->GetStreamPath(), mxStrmObj->GetStreamName() );
-}
-
-bool WrappedStreamObject::ImplIsValid() const
-{
- return IsValid( mxStrmObj ) && StreamObjectBase::ImplIsValid();
-}
-
-// ============================================================================
-// ============================================================================
-
-RecordHeaderBase::~RecordHeaderBase()
-{
-}
-
-void RecordHeaderBase::Construct( const InputObjectBase& rParent, const RecordHeaderConfigInfo& rCfgInfo )
-{
- InputObjectBase::Construct( rParent );
- if( InputObjectBase::ImplIsValid() )
- {
- const Config& rCfg = Cfg();
- mxRecNames = rCfg.GetNameList( rCfgInfo.mpcRecNames );
- mbShowRecPos = rCfg.GetBoolOption( rCfgInfo.mpcShowRecPos, true );
- mbShowRecSize = rCfg.GetBoolOption( rCfgInfo.mpcShowRecSize, true );
- mbShowRecId = rCfg.GetBoolOption( rCfgInfo.mpcShowRecId, true );
- mbShowRecName = rCfg.GetBoolOption( rCfgInfo.mpcShowRecName, true );
- mbShowRecBody = rCfg.GetBoolOption( rCfgInfo.mpcShowRecBody, true );
- }
-}
-
-bool RecordHeaderBase::ImplIsValid() const
-{
- return IsValid( mxRecNames ) && InputObjectBase::ImplIsValid();
-}
-
-// ============================================================================
-// ============================================================================
-
-DumperBase::~DumperBase()
-{
-}
-
-void DumperBase::Construct( ConfigRef xConfig, CoreDataRef xCore )
-{
- if( IsValid( xConfig ) && IsValid( xCore ) && xConfig->IsDumperEnabled() )
- {
- String aOutName = xCore->GetMedium().GetPhysicalName();
- aOutName.AppendAscii( ".txt" );
- mxOutStrm.reset( new SvFileStream( aOutName, STREAM_WRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC ) );
- if( mxOutStrm->GetError() == SVSTREAM_OK )
- ObjectBase::Construct( xConfig, xCore, OutputRef( new Output( *mxOutStrm ) ) );
- }
-}
-
-void DumperBase::Construct( ConfigRef xConfig, SfxMedium& rMedium, SfxObjectShell* pDocShell )
-{
- CoreDataRef xCore( new CoreData( rMedium, pDocShell ) );
- Construct( xConfig, xCore );
-}
-
-bool DumperBase::IsImportEnabled() const
-{
- return !IsValid() || Cfg().IsImportEnabled();
-}
-
-// ============================================================================
-// ============================================================================
-
-} // namespace dump
-} // namespace scf
-
-#endif
-
diff --git a/sc/source/filter/ftools/fdumper.dat b/sc/source/filter/ftools/fdumper.dat
index 1b1ed180894d..e69de29bb2d1 100644
--- a/sc/source/filter/ftools/fdumper.dat
+++ b/sc/source/filter/ftools/fdumper.dat
@@ -1,440 +0,0 @@
-
-# dumper settings ============================================================
-
-# Enable entire dumper (default=off). If dumper is disabled, no output into
-# a text file is done. This option does not affect the options 'enable-import'
-# and 'extract-storage-streams'.
-# 0=off, 1=on
-enable-dumper=1
-
-# Enable import after dumping (default=on). Disabling this option allows
-# to dump a file without loading it. This option is independent from the
-# 'enable-dumper' option.
-# 0=off, 1=on
-enable-import=1
-
-# Extract storage streams to file system (default=off). This option is
-# independent from the 'enable-dumper' option.
-# 0=off, 1=on
-extract-storage-streams=0
-
-# Maximum size of binary stream dumps (default=infinite).
-max-binary-stream-size=0x1000
-
-# Maximum size of binary data blocks in content dumps (default=infinite).
-max-binary-data-size=0x0200
-
-# Shows unknown trailing data as binary dump (default=on).
-# 0=off, 1=on
-show-trailing-unknown=1
-
-# DFF record settings --------------------------------------------------------
-
-# Show total stream position of the DFF record (default=on).
-# 0=off, 1=on
-show-dff-record-pos=0
-
-# Show total DFF record size in bytes (default=on).
-# 0=off, 1=on
-show-dff-record-size=1
-
-# Show DFF record identifier (default=on).
-# 0=off, 1=on
-show-dff-record-id=1
-
-# Show DFF record name, if known (default=on).
-# 0=off, 1=on
-show-dff-record-name=1
-
-# Show DFF record contents (default=on).
-# 0=off, 1=on
-show-dff-record-body=1
-
-# name lists =================================================================
-
-unitconverter=CONV-PERCENT,1,%
-unitconverter=CONV-DEG,1,°
-unitconverter=CONV-INCH-TO-CM,2.54,cm
-unitconverter=CONV-TWIP-TO-PT,/20,pt
-unitconverter=CONV-PT-TO-CM,/28.346457,cm
-unitconverter=CONV-PT1616-TO-CM,/1857713.4,cm
-unitconverter=CONV-TWIP-TO-CM,/566.92913,cm
-
-constlist=BOOLEAN
-begin
- 0=FALSE
- default=TRUE
-end
-
-constlist=CODEPAGES
-begin
- 367=ascii
- 437=ibm-437-us
- 708=iso-8859-6
- 720=ibm-720-arabic
- 737=ibm-737-greek
- 775=ibm-775-baltic
- 850=ibm-850-latin-1
- 852=ibm-852-latin-2-central-european
- 855=ibm-855-cyrillic
- 857=ibm-857-turkish
- 858=ibm-858-multilingual-latin-1-with-euro
- 860=ibm-860-portuguese
- 861=ibm-861-icelandic
- 862=ibm-862-hebrew
- 863=ibm-863-canadian-french
- 864=ibm-864-arabic
- 865=ibm-865-nordic
- 866=ibm-866-cyrillic-russian
- 869=ibm-869-greek-modern
- 874=win-874-thai
- 932=win-932-japanese-shift-jis
- 936=win-936-chinese-simplified-gbk
- 949=win-949-korean-wansung
- 950=win-950-chinese-traditional-big5
- 1200=utf-16
- 1250=win-1250-latin-2-central-european
- 1251=win-1251-cyrillic
- 1252=win-1252-latin-1
- 1253=win-1253-greek
- 1254=win-1254-turkish
- 1255=win-1255-hebrew
- 1256=win-1256-arabic
- 1257=win-1257-baltic
- 1258=win-1258-vietnamese
- 1361=win-1361-korean-johab
- 10000=apple-roman
- 10001=apple-japanese
- 10002=apple-chinese-traditional
- 10003=apple-korean
- 10004=apple-arabic
- 10005=apple-hebrew
- 10006=apple-greek
- 10007=apple-cyrillic
- 10008=apple-chinese-simplified
- 10010=apple-romanian
- 10017=apple-ukrainian
- 10029=apple-central-european-with-euro
- 10079=apple-icelandic
- 10081=apple-turkish
- 10082=apple-croatian
- 20127=ascii
- 20866=koi8-r
- 21866=koi8-u
- 28591=iso-8859-1
- 28592=iso-8859-2
- 28593=iso-8859-3
- 28594=iso-8859-4
- 28595=iso-8859-5
- 28596=iso-8859-6
- 28597=iso-8859-7
- 28598=iso-8859-8
- 28599=iso-8859-9
- 28605=iso-8859-15
- 32768=apple-romanian
- 32769=win-1252-latin-1
- 50220=iso-2022-jp
- 50225=iso-2022-kr
- 51932=euc-jp
- 51936=euc-cn
- 51949=euc-kr
- 65000=utf-7
- 65001=utf-8
-end
-
-# DFF stream -----------------------------------------------------------------
-
-multilist=DFF-RECORD-NAMES
-begin
- 0xF000=DFFDGGCONTAINER,DFFBSTORECONTAINER,DFFDGCONTAINER,DFFSPGRCONTAINER,DFFSPCONTAINER,DFFSOLVERCONTAINER,DFFDGG,DFFBSE
- 0xF008=DFFDG,DFFSPGR,DFFSP,DFFOPT,DFFTEXTBOX,DFFCLIENTTEXTBOX,DFFANCHOR,DFFCHILDANCHOR
- 0xF010=DFFCLIENTANCHOR,DFFCLIENTDATA,DFFCONNECTORRULE,DFFALIGNRULE,DFFARCRULE,DFFCLIENTRULE,DFFCLASSID,DFFCALLOUTRULE
- # 0xF018-0xF117 reserved for pictures
- 0xF118=DFFREGROUPITEM,DFFSELECTION,DFFCOLORMRU,,,DFFDELETEDPSPL,DFFSPLITMENUCOLORS,DFFOLEOBJECT
- 0xF120=DFFCOLORSCHEME,,DFFUSERDEFPROP
-end
-
-combilist=DFF-RECORD-INST
-begin
- 0x000F=uint8,hex,version,DFF-RECORD-VERSION
- 0xFFF0=uint16,dec,instance
-end
-
-constlist=DFF-RECORD-VERSION
-begin
- default=''
- 15=container
-end
-
-flagslist=DFFCLIENTANCHOR-FLAGS
-begin
- 0x0001=pos-locked
- 0x0002=size-locked
-end
-
-combilist=DFFOPT-PROPERTY-ID
-begin
- 0x3FFF=uint16,dec,id,DFFOPT-PROPERTY-NAMES
- 0x4000=picture
- 0x8000=complex
-end
-
-multilist=DFFOPT-PROPERTY-NAMES
-begin
- # transform
- 0x0004=rotation
- # protection
- 0x007F=lock-flags
- # text
- 0x0080=text-id,text-left,text-top,text-right,text-bottom,text-wrap-mode,text-scale,text-anchor-mode
- 0x0088=text-flow,text-font-rotation,text-next-shape,text-bidi
- 0x00BF=text-flags
- # text geometry
- 0x00C0=text-unicode-string,text-rtf-string,text-curve-align,text-def-size,text-spacing,text-font-family
- 0x00FF=text-geometry-flags
- # picture
- 0x0100=pic-crop-top,pic-crop-bottom,pic-crop-left,pic-crop-right,pic-data,pic-file-name,pic-flags,pic-transparency-color
- 0x0108=pic-contrast,pic-brightness,pic-gamma,pic-id,pic-double-cr-mod,pic-fill-cr-mod,pic-line-cr-mod,pic-data-print
- 0x0110=pic-name-print,pic-flags-print
- 0x013F=pic-flags
- # geometry
- 0x0140=geo-left,geo-top,geo-right,geo-bottom,geo-shape-path,geo-vertices,geo-segment-info,geo-adjust-1
- 0x0148=geo-adjust-2,geo-adjust-3,geo-adjust-4,geo-adjust-5,geo-adjust-6,geo-adjust-7,geo-adjust-8,geo-adjust-9
- 0x0150=geo-adjust-10,geo-connect-points,geo-stretch-x,geo-stretch-y,geo-handles,geo-formulas,geo-text-recs
- 0x0158=geo-connector-type
- 0x017F=geo-flags
- # fill style
- 0x0180=fill-type,fill-color,fill-opacity,fill-back-color,fill-back-opacity,fill-cr-mod,fill-blip,fill-blip-name
- 0x0188=fill-blip-flags,fill-width,fill-height,fill-angle,fill-focus,fill-to-left,fill-to-top,fill-to-right
- 0x0190=fill-to-bottom,fill-rect-left,fill-rect-top,fill-rect-right,fill-rect-bottom,fill-dz-type,fill-shade-preset,fill-shade-colors
- 0x0198=fill-origin-x,fill-origin-y,fill-shape-origin-x,fill-shape-origin-y,fill-shade-type
- 0x01BF=fill-flags
- # line style
- 0x01C0=line-color,line-opacity,line-back-color,line-cr-mod,line-type,line-fill-blip,line-fill-blip-name,line-fill-blip-flags
- 0x01C8=line-fill-width,line-fill-height,line-fill-dz-type,line-width,line-miter-limit,line-style,line-dash,line-dash-style
- 0x01D0=line-start-arrow-head,line-end-arrow-head,line-start-arrow-width,line-start-arrow-length,line-end-arrow-width,line-end-arrow-length,line-join-style,line-end-cap-style
- 0x01FF=line-flags
- # shadow style
- 0x0200=shadow-type,shadow-color,shadow-highlight,shadow-cr-mod,shadow-opacity,shadow-offset-x,shadow-offset-y,shadow-2nd-offset-x
- 0x0208=shadow-2nd-offset-y,shadow-scale-x-to-x,shadow-scale-y-to-x,shadow-scale-x-to-y,shadow-scale-y-to-y,shadow-persp-x,shadow-persp-y,shadow-weight
- 0x0210=shadow-origin-x,shadow-origin-y
- 0x023F=shadow-flags
- # perspective
- 0x0240=persp-type,persp-offset-x,persp-offsety,persp-scale-x-to-x,persp-scale-y-to-x,persp-scale-x-to-y,persp-scale-y-to-y,persp-persp-x
- 0x0248=persp-persp-y,persp-weight,persp-origin-x,persp-origin-y
- 0x027F=persp-flags
- # 3d object
- 0x0280=3dobj-specular-amt,3dobj-diffuse-amt,3dobj-shininess,3dobj-edge-thickness,3dobj-extrude-forward,3dobj-extrude-backward,3dobj-extrude-plane,3dobj-extrusion-color
- 0x0288=3dobj-cr-mod
- 0x02BF=3dobj-flags
- # 3d style
- 0x02C0=3dstyle-y-rotation,3dstyle-x-rotation,3dstyle-rotation-axis-x,3dstyle-rotation-axis-y,3dstyle-rotation-axis-z,3dstyle-rotation,3dstyle-rotation-center-x,3dstyle-rotation-center-y
- 0x02C8=3dstyle-rotation-center-z,3dstyle-render-mode,3dstyle-tolerance,3dstyle-view-point-x,3dstyle-view-point-y,3dstyle-view-point-z,3dstyle-origin-x,3dstyle-origin-y
- 0x02D0=3dstyle-skew-angle,3dstyle-skew-amount,3dstyle-ambient-intensity,3dstyle-key-light-x,3dstyle-key-light-y,3dstyle-key-light-z,3dstyle-key-light-intensity,3dstyle-fill-light-x
- 0x02D8=3dstyle-fill-light-y,3dstyle-fill-light-z,3dstyle-fill-light-intensity
- 0x02FF=3dstyle-flags
- # shape 1
- 0x0301=,shape-master,,shape-connect-style,shape-bw-mod,shape-bw-mode-pure-bw,shape-bw-mode-bw
- 0x033F=shape1-flags
- # callout
- 0x0340=callout-type,callout-box-distance,callout-angle,callout-drop-type,callout-drop-distance,callout-length
- 0x037F=callout-flags
- # shape 2
- 0x0380=shape-name,shape-description,shape-hyperlink,shape-wrap-polygon-vertices,shape-wrap-left,shape-wrap-top,shape-wrap-right,shape-wrap-bottom
- 0x0388=shape-regroup-id
- 0x03BF=shape2-flags
-end
-
-flagslist=DFFOPT-LOCK-FLAGS
-begin
- 0x00000001=lock-against-grouping
- 0x00000002=lock-adjust-handles
- 0x00000004=lock-text
- 0x00000008=lock-vertices
- 0x00000010=lock-cropping
- 0x00000020=lock-against-select
- 0x00000040=lock-position
- 0x00000080=lock-aspect-ratio
- 0x00000100=lock-rotation
-end
-
-flagslist=DFFOPT-TEXT-FLAGS
-begin
- 0x00000001=fit-text-to-shape
- 0x00000002=fit-shape-to-text
- 0x00000004=rotate-text
- 0x00000008=auto-text-margin
- 0x00000010=select-text
-end
-
-flagslist=DFFOPT-TEXTGEO-FLAGS
-begin
- 0x00000001=strike-through
- 0x00000002=small-caps
- 0x00000004=shadow
- 0x00000008=underline
- 0x00000010=italic
- 0x00000020=bold
- 0x00000040=no-measure-along-path
- 0x00000080=stretch-height
- 0x00000100=scale-on-path
- 0x00000200=shrink-to-fit
- 0x00000400=stretch-to-fit
- 0x00000800=tightening
- 0x00001000=kerning
- 0x00002000=vertical
- 0x00004000=has-effect
- 0x00008000=reverse-rows
-end
-
-flagslist=DFFOPT-PICTURE-FLAGS
-begin
- 0x00000001=ole-alive
- 0x00000002=bi-level-display
- 0x00000004=grayscale
- 0x00000008=no-hit-test
-end
-
-flagslist=DFFOPT-GEO-FLAGS
-begin
- 0x00000001=fill-support
- 0x00000002=fill-shade-shape-support
- 0x00000004=fontwork-support
- 0x00000008=line-support
- 0x00000010=3d-support
- 0x00000020=shadow-support
-end
-
-flagslist=DFFOPT-FILL-FLAGS
-begin
- 0x00000001=no-fill-hit-test
- 0x00000002=use-large-rect
- 0x00000004=register-pattern
- 0x00000008=hit-test-fill
- 0x00000010=has-fill
-end
-
-flagslist=DFFOPT-LINE-FLAGS
-begin
- 0x00000001=draw-dash-for-invisible
- 0x00000002=register-pattern
- 0x00000004=hit-test-line
- 0x00000008=has-line
- 0x00000010=arrowhead-support
-end
-
-flagslist=DFFOPT-SHADOW-FLAGS
-begin
- 0x00000001=excel5-style
- 0x00000002=has-shadow
-end
-
-flagslist=DFFOPT-PERSP-FLAGS
-begin
- 0x00000001=has-perspective
-end
-
-flagslist=DFFOPT-3DOBJ-FLAGS
-begin
- 0x00000001=light-face
- 0x00000002=extrusion-color
- 0x00000004=metallic
- 0x00000008=has-3d
-end
-
-flagslist=DFFOPT-3DSTYLE-FLAGS
-begin
- 0x00000001=fill-color-harsh
- 0x00000002=key-color-harsh
- 0x00000004=parallel
- 0x00000008=rotation-center-auto
- 0x00000010=constrain-rotation
-end
-
-flagslist=DFFOPT-SHAPE1-FLAGS
-begin
- 0x00000001=background
- 0x00000002=delete-attached-object
- 0x00000008=lock-shape-type
- 0x00000010=prefer-rel-resize
- 0x00000020=ole-iconified
-end
-
-flagslist=DFFOPT-CALLOUT-FLAGS
-begin
- 0x00000001=length-specified
- 0x00000002=drop-auto
- 0x00000004=minus-y
- 0x00000008=minus-x
- 0x00000010=has-text-border
- 0x00000020=has-accent-bar
- 0x00000040=is-callout
-end
-
-flagslist=DFFOPT-SHAPE2-FLAGS
-begin
- 0x00000001=print
- 0x00000002=hidden
- 0x00000004=1d-adjustment
- 0x00000008=action-attached
- 0x00000010=notify-double-click
- 0x00000020=behind-text
- 0x00000040=wrap-edited
-end
-
-# OLE property stream --------------------------------------------------------
-
-F29F85E0-4FF9-1068-AB91-08002B27B3D9=GlobalDocProp
-D5CDD502-2E9C-101B-9397-08002B2CF9AE=BuiltinDocProp
-D5CDD505-2E9C-101B-9397-08002B2CF9AE=CustomDocProp
-
-constlist=OLEPROP-BYTE-ORDER
-begin
- 0xFEFF=big-endian
- 0xFFFE=little-endian
-end
-
-shortlist=OLEPROP-OSTYPE,0,dos,mac,win32,unix
-
-multilist=OLEPROP-BASEIDS
-begin
- quote-names=1
- default=''
- 0=dictionary,codepage
-end
-
-multilist=OLEPROP-GLOBALIDS
-begin
- include=OLEPROP-BASEIDS
- 2=title,subject,author,keywords,comments,template,last-author,rev-number
- 10=edit-time,last-printed,create-time,last-saved,page-count,word-count,char-count,thumbnail,appname,security
-end
-
-multilist=OLEPROP-BUILTINIDS
-begin
- include=OLEPROP-BASEIDS
- 2=category,pres-target,byte-count,line-count,para-count,slide-count,note-count,hidden-slide-count
- 10=clips,scale-crop,heading-pairs,part-titles,manager,company,links-uptodate
-end
-
-multilist=OLEPROP-TYPE-SIMPLE
-begin
- 0=empty,null,int16,int32,float,double,fixed,date,string8,dispatch
- 10=error,bool,variant,unknown,decimal,int8,uint8,uint16,uint32
- 20=int64,uint64,int,uint,void,hresult,ptr,savearray,c-array,userdef
- 30=string8,string16
- 64=time-stamp,blob,stream,storage,stream-obj,storage-obj
- 70=blob-obj,clip-fmt,guid,vers-stream
- 0x0FFF=str8-blob
-end
-
-combilist=OLEPROP-TYPE
-begin
- 0x0FFF=int32,dec,base-type,OLEPROP-TYPE-SIMPLE
- 0x1000=vector
- 0x2000=array
- 0x4000=byref
-end
-
-# ============================================================================
-
diff --git a/sc/source/filter/ftools/fdumperdff.cxx b/sc/source/filter/ftools/fdumperdff.cxx
index e96f2dd68171..e69de29bb2d1 100644
--- a/sc/source/filter/ftools/fdumperdff.cxx
+++ b/sc/source/filter/ftools/fdumperdff.cxx
@@ -1,233 +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: fdumperdff.cxx,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "precompiled_sc.hxx"
-#include "fdumperdff.hxx"
-
-#if SCF_INCL_DUMPER
-#include <svx/msdffdef.hxx>
-
-namespace scf {
-namespace dump {
-
-// ============================================================================
-// ============================================================================
-
-DffRecordHeaderObject::DffRecordHeaderObject( const InputObjectBase& rParent )
-{
- static const RecordHeaderConfigInfo saHeaderCfgInfo =
- {
- "DFF-RECORD-NAMES",
- "show-dff-record-pos",
- "show-dff-record-size",
- "show-dff-record-id",
- "show-dff-record-name",
- "show-dff-record-body",
- };
- RecordHeaderBase::Construct( rParent, saHeaderCfgInfo );
- if( RecordHeaderBase::ImplIsValid() )
- {
- mxRecInst = Cfg().GetNameList( "DFF-RECORD-INST" );
- mnRecSize = 0;
- mnRecId = 0xFFFF;
- mnVer = 0;
- mnInst = 0;
- mnBodyStart = 0;
- mnBodyEnd = 0;
- }
-}
-
-bool DffRecordHeaderObject::ImplIsValid() const
-{
- return IsValid( mxRecInst ) && RecordHeaderBase::ImplIsValid();
-}
-
-void DffRecordHeaderObject::ImplDumpBody()
-{
- // read record header
- sal_uInt16 nInstVer;
- In() >> nInstVer >> mnRecId >> mnRecSize;
-
- mnBodyStart = In().Tell();
- mnBodyEnd = ::std::min( static_cast< sal_Size >( mnBodyStart + mnRecSize ), In().GetSize() );
- mnVer = nInstVer & 0x000F;
- mnInst = (nInstVer & 0xFFF0) >> 4;
-
- // dump record header
- Out().EmptyLine();
- {
- MultiItemsGuard aMultiGuard( Out() );
- WriteEmptyItem( "DFFREC" );
- if( IsShowRecPos() ) WriteHexItem( "pos", static_cast< sal_uInt32 >( mnBodyStart - DFF_COMMON_RECORD_HEADER_SIZE ) );
- if( IsShowRecSize() ) WriteHexItem( "size", mnRecSize );
- if( IsShowRecId() ) WriteHexItem( "id", mnRecId );
- if( IsShowRecName() ) WriteNameItem( "name", mnRecId, GetRecNames() );
- }
- WriteHexItem( "instance", nInstVer, mxRecInst );
-}
-
-// ============================================================================
-// ============================================================================
-
-DffDumpObject::DffDumpObject( const InputObjectBase& rParent ) :
- InputObjectBase( rParent )
-{
- ConstructOwn();
-}
-
-DffDumpObject::~DffDumpObject()
-{
-}
-
-void DffDumpObject::DumpDffClientPos( const sal_Char* pcName, sal_Int32 nSubScale )
-{
- MultiItemsGuard aMultiGuard( Out() );
- TableGuard aTabGuard( Out(), 17 );
- DumpDec< sal_uInt16 >( pcName );
- ItemGuard aItem( Out(), "sub-units" );
- sal_uInt16 nSubUnits;
- In() >> nSubUnits;
- Out().WriteDec( nSubUnits );
- Out().WriteChar( '/' );
- Out().WriteDec( nSubScale );
-}
-
-void DffDumpObject::DumpDffClientRect()
-{
- DumpDffClientPos( "start-col", 1024 );
- DumpDffClientPos( "start-row", 256 );
- DumpDffClientPos( "end-col", 1024 );
- DumpDffClientPos( "end-row", 256 );
-}
-
-bool DffDumpObject::ImplIsValid() const
-{
- return IsValid( mxHdrObj ) && InputObjectBase::ImplIsValid();
-}
-
-void DffDumpObject::ImplDumpBody()
-{
- while( In().IsValidPos() )
- {
- // record header
- mxHdrObj->Dump();
- // record contents
- if( mxHdrObj->GetVer() != DFF_PSFLAG_CONTAINER )
- {
- if( mxHdrObj->IsShowRecBody() )
- DumpRecordBody();
- In().Seek( mxHdrObj->GetBodyEnd() );
- }
- }
-}
-
-void DffDumpObject::ConstructOwn()
-{
- if( InputObjectBase::ImplIsValid() )
- mxHdrObj.reset( new DffRecordHeaderObject( *this ) );
-}
-
-void DffDumpObject::DumpRecordBody()
-{
- IndentGuard aIndGuard( Out() );
-
- // record contents
- if( mxHdrObj->HasRecName() ) switch( mxHdrObj->GetRecId() )
- {
- case DFF_msofbtOPT:
- DumpDffOptRec();
- break;
- case DFF_msofbtClientAnchor:
- DumpHex< sal_uInt16 >( "flags", "DFFCLIENTANCHOR-FLAGS" );
- DumpDffClientRect();
- break;
- }
-
- // remaining undumped data
- sal_Size nPos = In().Tell();
- if( nPos == mxHdrObj->GetBodyStart() )
- DumpRawBinary( mxHdrObj->GetRecSize(), false );
- else if( nPos < mxHdrObj->GetBodyEnd() )
- DumpRemaining( mxHdrObj->GetBodyEnd() - nPos );
-}
-
-void DffDumpObject::DumpDffOptRec()
-{
- sal_uInt16 nInst = mxHdrObj->GetInst();
- sal_Size nBodyEnd = mxHdrObj->GetBodyEnd();
- Out().ResetItemIndex();
- for( sal_uInt16 nIdx = 0; (nIdx < nInst) && (In().Tell() < nBodyEnd); ++nIdx )
- {
- sal_uInt16 nPropId = DumpDffOptPropHeader();
- IndentGuard aIndent( Out() );
- DumpDffOptPropValue( nPropId, In().ReadValue< sal_uInt32 >() );
- }
-}
-
-sal_uInt16 DffDumpObject::DumpDffOptPropHeader()
-{
- MultiItemsGuard aMultiGuard( Out() );
- TableGuard aTabGuard( Out(), 11 );
- WriteEmptyItem( "#prop" );
- return DumpHex< sal_uInt16 >( "id", "DFFOPT-PROPERTY-ID" );
-}
-
-void DffDumpObject::DumpDffOptPropValue( sal_uInt16 nPropId, sal_uInt32 nValue )
-{
- switch( nPropId & 0x3FFF )
- {
- case DFF_Prop_LockAgainstGrouping: WriteHexItem( "flags", nValue, "DFFOPT-LOCK-FLAGS" ); break;
- case DFF_Prop_FitTextToShape: WriteHexItem( "flags", nValue, "DFFOPT-TEXT-FLAGS" ); break;
- case DFF_Prop_gtextFStrikethrough: WriteHexItem( "flags", nValue, "DFFOPT-TEXTGEO-FLAGS" ); break;
- case DFF_Prop_pictureActive: WriteHexItem( "flags", nValue, "DFFOPT-PICTURE-FLAGS" ); break;
- case DFF_Prop_fFillOK: WriteHexItem( "flags", nValue, "DFFOPT-GEO-FLAGS" ); break;
- case DFF_Prop_fNoFillHitTest: WriteHexItem( "flags", nValue, "DFFOPT-FILL-FLAGS" ); break;
- case DFF_Prop_fNoLineDrawDash: WriteHexItem( "flags", nValue, "DFFOPT-LINE-FLAGS" ); break;
- case DFF_Prop_fshadowObscured: WriteHexItem( "flags", nValue, "DFFOPT-SHADOW-FLAGS" ); break;
- case DFF_Prop_fPerspective: WriteHexItem( "flags", nValue, "DFFOPT-PERSP-FLAGS" ); break;
- case DFF_Prop_fc3DLightFace: WriteHexItem( "flags", nValue, "DFFOPT-3DOBJ-FLAGS" ); break;
- case DFF_Prop_fc3DFillHarsh: WriteHexItem( "flags", nValue, "DFFOPT-3DSTYLE-FLAGS" ); break;
- case DFF_Prop_fBackground: WriteHexItem( "flags", nValue, "DFFOPT-SHAPE1-FLAGS" ); break;
- case DFF_Prop_fCalloutLengthSpecified: WriteHexItem( "flags", nValue, "DFFOPT-CALLOUT-FLAGS" ); break;
- case DFF_Prop_fPrint: WriteHexItem( "flags", nValue, "DFFOPT-SHAPE2-FLAGS" ); break;
-
- default:
- WriteHexItem( "value", nValue );
- }
-}
-
-// ============================================================================
-// ============================================================================
-
-} // namespace dump
-} // namespace scf
-
-#endif
-
diff --git a/sc/source/filter/ftools/fdumperole.cxx b/sc/source/filter/ftools/fdumperole.cxx
index 7a82e38ae8dd..e69de29bb2d1 100644
--- a/sc/source/filter/ftools/fdumperole.cxx
+++ b/sc/source/filter/ftools/fdumperole.cxx
@@ -1,675 +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: fdumperole.cxx,v $
- * $Revision: 1.10 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "precompiled_sc.hxx"
-#include "fdumperole.hxx"
-
-#if SCF_INCL_DUMPER
-#include <tools/datetime.hxx>
-#include <tools/stream.hxx>
-#include <sfx2/docfile.hxx>
-#include <osl/file.hxx>
-
-#include <rtl/tencinfo.h>
-
-namespace scf {
-namespace dump {
-
-// ============================================================================
-// ============================================================================
-
-namespace {
-
-const sal_Int32 OLEPROP_ID_DICTIONARY = 0;
-const sal_Int32 OLEPROP_ID_CODEPAGE = 1;
-
-const sal_Int32 OLEPROP_TYPE_INT16 = 2;
-const sal_Int32 OLEPROP_TYPE_INT32 = 3;
-const sal_Int32 OLEPROP_TYPE_FLOAT = 4;
-const sal_Int32 OLEPROP_TYPE_DOUBLE = 5;
-const sal_Int32 OLEPROP_TYPE_DATE = 7;
-const sal_Int32 OLEPROP_TYPE_STRING = 8;
-const sal_Int32 OLEPROP_TYPE_STATUS = 10;
-const sal_Int32 OLEPROP_TYPE_BOOL = 11;
-const sal_Int32 OLEPROP_TYPE_VARIANT = 12;
-const sal_Int32 OLEPROP_TYPE_INT8 = 16;
-const sal_Int32 OLEPROP_TYPE_UINT8 = 17;
-const sal_Int32 OLEPROP_TYPE_UINT16 = 18;
-const sal_Int32 OLEPROP_TYPE_UINT32 = 19;
-const sal_Int32 OLEPROP_TYPE_INT64 = 20;
-const sal_Int32 OLEPROP_TYPE_UINT64 = 21;
-const sal_Int32 OLEPROP_TYPE_STRING8 = 30;
-const sal_Int32 OLEPROP_TYPE_STRING16 = 31;
-const sal_Int32 OLEPROP_TYPE_FILETIME = 64;
-const sal_Int32 OLEPROP_TYPE_BLOB = 65;
-const sal_Int32 OLEPROP_TYPE_STREAM = 66;
-const sal_Int32 OLEPROP_TYPE_STORAGE = 67;
-const sal_Int32 OLEPROP_TYPE_CLIPFMT = 71;
-
-const sal_uInt16 CODEPAGE_UNICODE = 1200;
-
-} // namespace
-
-// ============================================================================
-// ============================================================================
-
-OleStorageObject::OleStorageObject( const OleStorageObject& rParentStrg, const String& rStrgName )
-{
- Construct( rParentStrg, rStrgName );
-}
-
-OleStorageObject::OleStorageObject( const ObjectBase& rParent, SotStorageRef xRootStrg )
-{
- Construct( rParent, xRootStrg, String::EmptyString() );
-}
-
-OleStorageObject::OleStorageObject( const ObjectBase& rParent, SvStream& rRootStrm )
-{
- Construct( rParent, rRootStrm );
-}
-
-OleStorageObject::OleStorageObject( const ObjectBase& rParent )
-{
- Construct( rParent );
-}
-
-OleStorageObject::~OleStorageObject()
-{
-}
-
-void OleStorageObject::Construct( const ObjectBase& rParent, SotStorageRef xStrg, const String& rPath )
-{
- ObjectBase::Construct( rParent );
-
- if( xStrg.Is() && (xStrg->GetError() == ERRCODE_NONE) )
- {
- mxStrg = xStrg;
- maPath = rPath;
- maName = xStrg->GetName();
- }
-}
-
-void OleStorageObject::Construct( const OleStorageObject& rParentStrg, const String& rStrgName )
-{
- SotStorageRef xStrg = ScfTools::OpenStorageRead( rParentStrg.mxStrg, rStrgName );
- Construct( rParentStrg, xStrg, rParentStrg.GetFullName() );
-}
-
-void OleStorageObject::Construct( const ObjectBase& rParent, SvStream& rRootStrm )
-{
- SotStorageRef xRootStrg( new SotStorage( rRootStrm ) );
- Construct( rParent, xRootStrg, String::EmptyString() );
-}
-
-void OleStorageObject::Construct( const ObjectBase& rParent )
-{
- if( rParent.IsValid() )
- Construct( rParent, rParent.GetCoreStream() );
-}
-
-String OleStorageObject::GetFullName() const
-{
- return String( maPath ).Append( '/' ).Append( maName );
-}
-
-bool OleStorageObject::ImplIsValid() const
-{
- return mxStrg.Is() && ObjectBase::ImplIsValid();
-}
-
-void OleStorageObject::ImplDumpHeader()
-{
- Output& rOut = Out();
- rOut.ResetIndent();
- rOut.WriteChar( '+', 2 );
- rOut.WriteChar( '=', 76 );
- rOut.NewLine();
- {
- PrefixGuard aPreGuard( rOut, CREATE_STRING( "||" ) );
- WriteEmptyItem( "STORAGE-BEGIN" );
- DumpStorageInfo( true );
- rOut.EmptyLine();
- }
- rOut.EmptyLine();
-}
-
-void OleStorageObject::ImplDumpFooter()
-{
- Output& rOut = Out();
- rOut.ResetIndent();
- {
- PrefixGuard aPreGuard( rOut, CREATE_STRING( "||" ) );
- rOut.EmptyLine();
- DumpStorageInfo( false );
- WriteEmptyItem( "STORAGE-END" );
- }
- rOut.WriteChar( '+', 2 );
- rOut.WriteChar( '=', 76 );
- rOut.NewLine();
- rOut.EmptyLine();
-}
-
-void OleStorageObject::DumpStorageInfo( bool bExtended )
-{
- IndentGuard aIndGuard( Out() );
- WriteStringItem( "storage-name", maName );
- WriteStringItem( "full-path", GetFullName() );
-
- // directory
- if( bExtended )
- {
- OleStorageIterator aIt( mxStrg );
- WriteDecItem( "directory-size", static_cast< sal_uInt32 >( aIt.GetSize() ) );
-
- IndentGuard aDirIndGuard( Out() );
- for( ; aIt.IsValid(); ++aIt )
- {
- MultiItemsGuard aMultiGuard( Out() );
- TableGuard aTabGuard( Out(), 14 );
- const sal_Char* pcType = aIt->IsStream() ? "stream" :
- (aIt->IsStorage() ? "storage" : "unknown");
- WriteInfoItem( "type", pcType );
- WriteStringItem( "name", aIt->GetName() );
- }
- }
-}
-
-// ----------------------------------------------------------------------------
-
-namespace {
-
-void lclExtractStream( SotStorageStreamRef xInStrm, const String& rFileName )
-{
- if( xInStrm.Is() && (xInStrm->GetError() == SVSTREAM_OK) )
- {
- SvFileStream aOutStrm( rFileName, STREAM_WRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC );
- if( aOutStrm.IsOpen() )
- {
- xInStrm->Seek( STREAM_SEEK_TO_BEGIN );
- aOutStrm << *xInStrm;
- }
- }
-}
-
-void lclExtractStorage( SotStorageRef xStrg, const String& rDirName )
-{
- if( xStrg.Is() && (xStrg->GetError() == ERRCODE_NONE) )
- {
- // create directory in file system
- ::osl::FileBase::RC eRes = ::osl::Directory::create( rDirName );
- if( (eRes == ::osl::FileBase::E_None) || (eRes == ::osl::FileBase::E_EXIST) )
- {
- // process children of the storage
- for( OleStorageIterator aIt( xStrg ); aIt.IsValid(); ++aIt )
- {
- // encode all characters < 0x20
- String aSubName;
- StringHelper::AppendEncString( aSubName, aIt->GetName(), false );
-
- // replace all characters reserved in file system
- static const sal_Unicode spcReserved[] = { '/', '\\', ':', '*', '?', '<', '>', '|', 0 };
- xub_StrLen nPos = 0;
- while( (nPos = aSubName.SearchChar( spcReserved, nPos )) != STRING_NOTFOUND )
- aSubName.SetChar( nPos, '_' );
-
- // build full path
- String aFullName = rDirName;
- aFullName.Append( '/' ).Append( aSubName );
-
- // handle storages and streams
- if( aIt->IsStorage() )
- {
- SotStorageRef xSubStrg = ScfTools::OpenStorageRead( xStrg, aIt->GetName() );
- lclExtractStorage( xSubStrg, aFullName );
- }
- else if( aIt->IsStream() )
- {
- SotStorageStreamRef xSubStrm = ScfTools::OpenStorageStreamRead( xStrg, aIt->GetName() );
- lclExtractStream( xSubStrm, aFullName );
- }
- }
- }
- }
-}
-
-} // namespace
-
-// ----------------------------------------------------------------------------
-
-void OleStorageObject::ExtractStorageToFileSystem()
-{
- if( Cfg().GetBoolOption( "extract-storage-streams", false ) )
- {
- ::rtl::OUString aOUPathName;
- if( ::osl::FileBase::getFileURLFromSystemPath( GetCoreMedium().GetPhysicalName(), aOUPathName ) == ::osl::FileBase::E_None )
- {
- String aFullName = aOUPathName;
- xub_StrLen nSepPos = aFullName.SearchBackward( '/' );
- xub_StrLen nNamePos = (nSepPos == STRING_NOTFOUND) ? 0 : (nSepPos + 1);
- String aDirName = aFullName.Copy( nNamePos );
- aDirName.SearchAndReplaceAll( '.', '_' );
- aDirName.AppendAscii( "_ext" );
- aFullName.Erase( nNamePos ).Append( aDirName );
-
- SotStorageRef xRootStrg( new SotStorage( GetCoreStream() ) );
- lclExtractStorage( xRootStrg, aFullName );
- }
- }
-}
-
-// ============================================================================
-
-OleStorageIterator::OleStorageIterator( const OleStorageObject& rStrg )
-{
- Construct( rStrg.GetStorage() );
-}
-
-OleStorageIterator::OleStorageIterator( SotStorageRef xStrg )
-{
- Construct( xStrg );
-}
-
-OleStorageIterator::~OleStorageIterator()
-{
-}
-
-ULONG OleStorageIterator::GetSize() const
-{
- return mxInfoList.is() ? mxInfoList->Count() : 0;
-}
-
-const SvStorageInfo* OleStorageIterator::operator->() const
-{
- return IsValid() ? &mxInfoList->GetObject( mnIndex ) : 0;
-}
-
-OleStorageIterator& OleStorageIterator::operator++()
-{
- if( IsValid() )
- ++mnIndex;
- return *this;
-}
-
-void OleStorageIterator::Construct( SotStorageRef xStrg )
-{
- mnIndex = 0;
- if( xStrg.Is() )
- {
- mxInfoList.reset( new SvStorageInfoList );
- xStrg->FillInfoList( mxInfoList.get() );
- }
-}
-
-bool OleStorageIterator::ImplIsValid() const
-{
- return mxInfoList.is() && (mnIndex < mxInfoList->Count());
-}
-
-// ============================================================================
-// ============================================================================
-
-OleStreamObject::OleStreamObject( const OleStorageObject& rParentStrg, const String& rStrmName )
-{
- Construct( rParentStrg, rStrmName );
-}
-
-OleStreamObject::~OleStreamObject()
-{
-}
-
-void OleStreamObject::Construct( const OleStorageObject& rParentStrg, const String& rStrmName )
-{
- mxStrm = ScfTools::OpenStorageStreamRead( rParentStrg.GetStorage(), rStrmName );
- if( mxStrm.Is() && (mxStrm->GetError() == SVSTREAM_OK) )
- StreamObjectBase::Construct( rParentStrg, *mxStrm, rParentStrg.GetFullName(), rStrmName );
-}
-
-bool OleStreamObject::ImplIsValid() const
-{
- return mxStrm.Is() && StreamObjectBase::ImplIsValid();
-}
-
-// ============================================================================
-
-OlePropertyStreamObject::OlePropertyStreamObject( const OleStorageObject& rParentStrg, const String& rStrmName )
-{
- Construct( rParentStrg, rStrmName );
-}
-
-void OlePropertyStreamObject::Construct( const OleStorageObject& rParentStrg, const String& rStrmName )
-{
- OleStreamObject::Construct( rParentStrg, rStrmName );
-}
-
-void OlePropertyStreamObject::ImplDumpBody()
-{
- Input& rIn = In();
- Output& rOut = Out();
-
- ScfStringVec aGuidVec;
- ScfUInt32Vec aStartPosVec;
-
- // dump header
- WriteEmptyItem( "HEADER" );
- {
- IndentGuard aIndGuard( rOut );
- DumpHex< sal_uInt16 >( "byte-order", "OLEPROP-BYTE-ORDER" );
- DumpDec< sal_uInt16 >( "version" );
- DumpDec< sal_uInt16 >( "os-minor" );
- DumpDec< sal_uInt16 >( "os-type", "OLEPROP-OSTYPE" );
- DumpGuid( "guid" );
- sal_Int32 nSectCount = DumpDec< sal_Int32 >( "section-count" );
-
- // dump table of section positions
- {
- TableGuard aTabGuard( rOut, 15, 60 );
- rOut.ResetItemIndex();
- for( sal_Int32 nSectIdx = 0; (nSectIdx < nSectCount) && rIn.IsValidPos(); ++nSectIdx )
- {
- MultiItemsGuard aMultiGuard( rOut );
- WriteEmptyItem( "#section" );
- aGuidVec.push_back( DumpGuid( "guid" ) );
- aStartPosVec.push_back( DumpHex< sal_uInt32 >( "start-pos" ) );
- }
- }
- }
- rOut.EmptyLine();
-
- // dump sections
- for( size_t nSectIdx = 0; (nSectIdx < aStartPosVec.size()) && rIn.IsValidPos(); ++nSectIdx )
- DumpSection( aGuidVec[ nSectIdx ], aStartPosVec[ nSectIdx ] );
-}
-
-void OlePropertyStreamObject::DumpSection( const String& rGuid, sal_uInt32 nStartPos )
-{
- Input& rIn = In();
- Output& rOut = Out();
-
- // property ID names
- mxPropIds = Cfg().CreateNameList< ConstList >( "OLEPROP-IDS" );
- String aGuidName = Cfg().GetStringOption( rGuid, String::EmptyString() );
- if( aGuidName.EqualsAscii( "GlobalDocProp" ) )
- mxPropIds->IncludeList( Cfg().GetNameList( "OLEPROP-GLOBALIDS" ) );
- else if( aGuidName.EqualsAscii( "BuiltinDocProp" ) )
- mxPropIds->IncludeList( Cfg().GetNameList( "OLEPROP-BUILTINIDS" ) );
- else
- mxPropIds->IncludeList( Cfg().GetNameList( "OLEPROP-BASEIDS" ) );
-
- // property ID/position map
- typedef ::std::map< sal_Int32, sal_uInt32 > PropertyPosMap;
- PropertyPosMap aPropMap;
-
- // dump section header line
- WriteSectionHeader( rGuid, nStartPos );
-
- // seek to section
- IndentGuard aIndGuard( rOut );
- if( StartElement( nStartPos ) )
- {
- // dump section header
- DumpDec< sal_Int32 >( "size" );
- sal_Int32 nPropCount = DumpDec< sal_Int32 >( "property-count" );
-
- // dump table of property positions
- {
- TableGuard aTabGuard( rOut, 15, 25 );
- rOut.ResetItemIndex();
- for( sal_Int32 nPropIdx = 0; (nPropIdx < nPropCount) && rIn.IsValidPos(); ++nPropIdx )
- {
- MultiItemsGuard aMultiGuard( rOut );
- WriteEmptyItem( "#property" );
- sal_Int32 nPropId = DumpDec< sal_Int32 >( "id", mxPropIds );
- sal_uInt32 nPropPos = nStartPos + DumpHex< sal_uInt32 >( "start-pos" );
- aPropMap[ nPropId ] = nPropPos;
- }
- }
- }
- rOut.EmptyLine();
-
- // code page property
- meTextEnc = ScfTools::GetSystemTextEncoding();
- mbIsUnicode = false;
- PropertyPosMap::iterator aCodePageIt = aPropMap.find( OLEPROP_ID_CODEPAGE );
- if( aCodePageIt != aPropMap.end() )
- {
- DumpCodePageProperty( aCodePageIt->second );
- aPropMap.erase( aCodePageIt );
- }
-
- // dictionary property
- PropertyPosMap::iterator aDictIt = aPropMap.find( OLEPROP_ID_DICTIONARY );
- if( aDictIt != aPropMap.end() )
- {
- DumpDictionaryProperty( aDictIt->second );
- aPropMap.erase( aDictIt );
- }
-
- // other properties
- for( PropertyPosMap::const_iterator aIt = aPropMap.begin(), aEnd = aPropMap.end(); aIt != aEnd; ++aIt )
- DumpProperty( aIt->first, aIt->second );
-
- // remove the user defined list of property ID names
- Cfg().EraseNameList( "OLEPROP-IDS" );
-}
-
-void OlePropertyStreamObject::DumpProperty( sal_Int32 nPropId, sal_uInt32 nStartPos )
-{
- WritePropertyHeader( nPropId, nStartPos );
- IndentGuard aIndGuard( Out() );
- if( StartElement( nStartPos ) )
- DumpPropertyContents( nPropId );
- Out().EmptyLine();
-}
-
-void OlePropertyStreamObject::DumpCodePageProperty( sal_uInt32 nStartPos )
-{
- WritePropertyHeader( OLEPROP_ID_CODEPAGE, nStartPos );
- IndentGuard aIndGuard( Out() );
- if( StartElement( nStartPos ) )
- {
- sal_Int32 nType = DumpPropertyType();
- if( nType == OLEPROP_TYPE_INT16 )
- {
- sal_uInt16 nCodePage = DumpDec< sal_uInt16 >( "codepage", "CODEPAGES" );
- rtl_TextEncoding nNewTextEnc = rtl_getTextEncodingFromWindowsCodePage( nCodePage );
- if( nNewTextEnc != RTL_TEXTENCODING_DONTKNOW )
- meTextEnc = nNewTextEnc;
- mbIsUnicode = nCodePage == CODEPAGE_UNICODE;
- }
- else
- DumpPropertyContents( OLEPROP_ID_CODEPAGE );
- }
- Out().EmptyLine();
-}
-
-void OlePropertyStreamObject::DumpDictionaryProperty( sal_uInt32 nStartPos )
-{
- WritePropertyHeader( OLEPROP_ID_DICTIONARY, nStartPos );
- IndentGuard aIndGuard( Out() );
- if( StartElement( nStartPos ) )
- {
- sal_Int32 nCount = DumpDec< sal_Int32 >( "count" );
- for( sal_Int32 nIdx = 0; (nIdx < nCount) && In().IsValidPos(); ++nIdx )
- {
- MultiItemsGuard aMultiGuard( Out() );
- TableGuard aTabGuard( Out(), 10, 20 );
- sal_Int32 nId = DumpDec< sal_Int32 >( "id" );
- String aName = DumpString8( "name" );
- if( mxPropIds.is() )
- mxPropIds->SetName( nId, aName );
- }
- }
- Out().EmptyLine();
-}
-
-void OlePropertyStreamObject::DumpPropertyContents( sal_Int32 nPropId )
-{
- sal_Int32 nType = DumpPropertyType();
- if( ::get_flag< sal_Int32 >( nType, 0x1000 ) ) // vector
- {
- sal_Int32 nBaseType = nType & 0x0FFF;
- sal_Int32 nElemCount = DumpDec< sal_Int32 >( "element-count" );
- for( sal_Int32 nElemIdx = 0; (nElemIdx < nElemCount) && In().IsValidPos(); ++nElemIdx )
- {
- Out().ResetItemIndex( nElemIdx );
- WriteEmptyItem( "#element" );
- IndentGuard aIndGuard( Out() );
- DumpPropertyValue( nPropId, nBaseType );
- }
- }
- else if( !::get_flag< sal_Int32 >( nType, 0x7000 ) )
- {
- DumpPropertyValue( nPropId, nType );
- }
-}
-
-void OlePropertyStreamObject::DumpPropertyValue( sal_Int32 nPropId, sal_Int32 nBaseType )
-{
- switch( nBaseType )
- {
- case OLEPROP_TYPE_INT16: DumpDec< sal_Int16 >( "value" ); break;
- case OLEPROP_TYPE_INT32: DumpDec< sal_Int32 >( "value" ); break;
- case OLEPROP_TYPE_FLOAT: DumpDec< float >( "value" ); break;
- case OLEPROP_TYPE_DOUBLE: DumpDec< double >( "value" ); break;
- case OLEPROP_TYPE_DATE: DumpDec< double >( "date" ); break;
- case OLEPROP_TYPE_STRING: DumpString8( "value" ); break;
- case OLEPROP_TYPE_STATUS: DumpHex< sal_Int32 >( "status" ); break;
- case OLEPROP_TYPE_BOOL: DumpBool< sal_Int16 >( "value" ); break;
- case OLEPROP_TYPE_VARIANT: DumpPropertyContents( nPropId ); break;
- case OLEPROP_TYPE_INT8: DumpDec< sal_Int8 >( "value" ); break;
- case OLEPROP_TYPE_UINT8: DumpDec< sal_uInt8 >( "value" ); break;
- case OLEPROP_TYPE_UINT16: DumpDec< sal_uInt16 >( "value" ); break;
- case OLEPROP_TYPE_UINT32: DumpDec< sal_uInt32 >( "value" ); break;
- case OLEPROP_TYPE_INT64: DumpDec< sal_Int64 >( "value" ); break;
- case OLEPROP_TYPE_UINT64: DumpDec< sal_uInt64 >( "value" ); break;
- case OLEPROP_TYPE_STRING8: DumpString8( "value" ); break;
- case OLEPROP_TYPE_STRING16: DumpString16( "value" ); break;
- case OLEPROP_TYPE_FILETIME: DumpFileTime( "file-time" ); break;
- case OLEPROP_TYPE_BLOB: DumpBlob( "data" ); break;
- case OLEPROP_TYPE_STREAM: DumpString8( "stream-name" ); break;
- case OLEPROP_TYPE_STORAGE: DumpString8( "storage-name" ); break;
- case OLEPROP_TYPE_CLIPFMT: DumpBlob( "clip-data" ); break;
- }
-}
-
-sal_Int32 OlePropertyStreamObject::DumpPropertyType()
-{
- return DumpHex< sal_Int32 >( "type", "OLEPROP-TYPE" );
-}
-
-void OlePropertyStreamObject::DumpBlob( const sal_Char* pcName )
-{
- sal_Int32 nSize = DumpDec< sal_Int32 >( "data-size" );
- if( nSize > 0 )
- DumpBinary( pcName, nSize );
-}
-
-String OlePropertyStreamObject::DumpString8( const sal_Char* pcName )
-{
- sal_Int32 nLen = DumpDec< sal_Int32 >( "string-len" );
- return mbIsUnicode ? DumpCharArray16( pcName, nLen ) : DumpCharArray8( pcName, nLen );
-}
-
-String OlePropertyStreamObject::DumpCharArray8( const sal_Char* pcName, sal_Int32 nCharCount )
-{
- size_t nLen = static_cast< size_t >( ::std::max< sal_Int32 >( ::std::min< sal_Int32 >( nCharCount, 1024 ), 0 ) );
- ::std::vector< sal_Char > aBuffer( nLen + 1, 0 );
- In().Read( &aBuffer.front(), nLen );
- String aData( &aBuffer.front(), meTextEnc );
- WriteStringItem( pcName, aData );
- return aData;
-}
-
-String OlePropertyStreamObject::DumpString16( const sal_Char* pcName )
-{
- sal_Int32 nLen = DumpDec< sal_Int32 >( "string-len" );
- return DumpCharArray16( pcName, nLen );
-}
-
-String OlePropertyStreamObject::DumpCharArray16( const sal_Char* pcName, sal_Int32 nCharCount )
-{
- size_t nLen = static_cast< size_t >( ::std::max< sal_Int32 >( ::std::min< sal_Int32 >( nCharCount, 1024 ), 0 ) );
- ::std::vector< sal_Unicode > aBuffer;
- aBuffer.reserve( nLen + 1 );
- for( sal_Size nIdx = 0; nIdx < nLen; ++nIdx )
- aBuffer.push_back( static_cast< sal_Unicode >( In().ReadValue< sal_uInt16 >() ) );
- aBuffer.push_back( 0 );
- String aData( &aBuffer.front() );
- WriteStringItem( pcName, aData );
- if( nLen & 1 ) DumpUnused( 2 ); // always padding to 32bit
- return aData;
-}
-
-DateTime OlePropertyStreamObject::DumpFileTime( const sal_Char* pcName )
-{
- ItemGuard aItem( Out(), pcName );
- sal_uInt64 nFileTime = DumpDec< sal_uInt64 >( 0 );
- sal_uInt32 nLower = static_cast< sal_uInt32 >( nFileTime );
- sal_uInt32 nUpper = static_cast< sal_uInt32 >( nFileTime >> 32 );
- DateTime aDateTime = DateTime::CreateFromWin32FileDateTime( nLower, nUpper );
- aDateTime.ConvertToLocalTime();
- WriteDateTimeItem( 0, aDateTime );
- return aDateTime;
-}
-
-bool OlePropertyStreamObject::StartElement( sal_uInt32 nStartPos )
-{
- bool bPosOk = nStartPos < In().GetSize();
- if( bPosOk )
- In().Seek( static_cast< sal_Size >( nStartPos ) );
- else
- WriteInfoItem( "stream-state", SCF_DUMP_ERR_STREAM );
- return bPosOk;
-}
-
-void OlePropertyStreamObject::WriteSectionHeader( const String& rGuid, sal_uInt32 nStartPos )
-{
- MultiItemsGuard aMultiGuard( Out() );
- WriteEmptyItem( "SECTION" );
- WriteGuidItem( "guid", rGuid );
- WriteHexItem( "pos", nStartPos );
-}
-
-void OlePropertyStreamObject::WritePropertyHeader( sal_Int32 nPropId, sal_uInt32 nStartPos )
-{
- MultiItemsGuard aMultiGuard( Out() );
- WriteEmptyItem( "PROPERTY" );
- WriteDecItem( "id", nPropId, mxPropIds );
- WriteHexItem( "pos", nStartPos );
-}
-
-// ============================================================================
-// ============================================================================
-
-} // namespace dump
-} // namespace scf
-
-#endif
-
diff --git a/sc/source/filter/ftools/ftools.cxx b/sc/source/filter/ftools/ftools.cxx
index 1a0b05e690bb..7f62e2b55277 100644
--- a/sc/source/filter/ftools/ftools.cxx
+++ b/sc/source/filter/ftools/ftools.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ftools.cxx,v $
- * $Revision: 1.20 $
+ * $Revision: 1.20.4.1 $
*
* This file is part of OpenOffice.org.
*
diff --git a/sc/source/filter/ftools/makefile.mk b/sc/source/filter/ftools/makefile.mk
index e517d58b696e..9f79798ce262 100644
--- a/sc/source/filter/ftools/makefile.mk
+++ b/sc/source/filter/ftools/makefile.mk
@@ -1,14 +1,14 @@
#*************************************************************************
#
# 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: makefile.mk,v $
#
-# $Revision: 1.8 $
+# $Revision: 1.8.90.1 $
#
# This file is part of OpenOffice.org.
#
@@ -51,16 +51,11 @@ PROJECTPCHSOURCE=..\pch\filt_pch
SLOFILES = \
$(SLO)$/fapihelper.obj \
- $(SLO)$/fdumper.obj \
- $(SLO)$/fdumperdff.obj \
- $(SLO)$/fdumperole.obj \
$(SLO)$/fprogressbar.obj \
$(SLO)$/ftools.obj
EXCEPTIONSFILES = \
- $(SLO)$/fapihelper.obj \
- $(SLO)$/fdumper.obj \
- $(SLO)$/fdumperole.obj
+ $(SLO)$/fapihelper.obj
# --- Targets -------------------------------------------------------
diff --git a/sc/source/filter/inc/excimp8.hxx b/sc/source/filter/inc/excimp8.hxx
index ff1341d8f18b..2f3913f01c57 100644
--- a/sc/source/filter/inc/excimp8.hxx
+++ b/sc/source/filter/inc/excimp8.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: excimp8.hxx,v $
- * $Revision: 1.71 $
+ * $Revision: 1.71.14.1 $
*
* This file is part of OpenOffice.org.
*
@@ -61,7 +61,6 @@ class ImportExcel8 : public ImportExcel
void Precision( void ); // 0x0E
void Delta( void ); // 0x10
void Iteration( void ); // 0x11
- void Note( void ); // 0x1C
void WinProtection( void ); // 0x19
void Boundsheet( void ); // 0x85
void FilterMode( void ); // 0x9B
diff --git a/sc/source/filter/inc/fapihelper.hxx b/sc/source/filter/inc/fapihelper.hxx
index 9e91cd13b891..dd126cbcbbc8 100644
--- a/sc/source/filter/inc/fapihelper.hxx
+++ b/sc/source/filter/inc/fapihelper.hxx
@@ -172,6 +172,9 @@ public:
// Get properties ---------------------------------------------------------
+ /** Returns true, if the property set contains the specified property. */
+ bool HasProperty( const ::rtl::OUString& rPropName ) const;
+
/** Gets the specified property from the property set.
@return true, if the Any could be filled with the property value. */
bool GetAnyProperty( UnoAny& rValue, const ::rtl::OUString& rPropName ) const;
diff --git a/sc/source/filter/inc/fdumperdff.hxx b/sc/source/filter/inc/fdumperdff.hxx
index d55d7097a612..e69de29bb2d1 100644
--- a/sc/source/filter/inc/fdumperdff.hxx
+++ b/sc/source/filter/inc/fdumperdff.hxx
@@ -1,113 +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: fdumperdff.hxx,v $
- * $Revision: 1.3 $
- *
- * 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 SC_FDUMPERDFF_HXX
-#define SC_FDUMPERDFF_HXX
-
-#include "fdumper.hxx"
-
-#if SCF_INCL_DUMPER
-
-namespace scf {
-namespace dump {
-
-// ============================================================================
-// ============================================================================
-
-class DffRecordHeaderObject : public RecordHeaderBase
-{
-public:
- explicit DffRecordHeaderObject( const InputObjectBase& rParent );
-
- inline sal_uInt16 GetRecId() const { return mnRecId; }
- inline sal_uInt32 GetRecSize() const { return mnRecSize; }
- inline sal_Size GetBodyStart() const { return mnBodyStart; }
- inline sal_Size GetBodyEnd() const { return mnBodyEnd; }
-
- inline sal_uInt16 GetVer() const { return mnVer; }
- inline sal_uInt16 GetInst() const { return mnInst; }
-
- inline bool HasRecName() const { return GetRecNames()->HasName( mnRecId ); }
-
-protected:
- virtual bool ImplIsValid() const;
- virtual void ImplDumpBody();
-
-private:
- NameListRef mxRecInst;
- sal_Size mnBodyStart;
- sal_Size mnBodyEnd;
- sal_uInt32 mnRecSize;
- sal_uInt16 mnRecId;
- sal_uInt16 mnVer;
- sal_uInt16 mnInst;
-};
-
-// ============================================================================
-// ============================================================================
-
-class DffDumpObject : public InputObjectBase
-{
-public:
- explicit DffDumpObject( const InputObjectBase& rParent );
- virtual ~DffDumpObject();
-
- void DumpDffClientPos( const sal_Char* pcName, sal_Int32 nSubScale );
- void DumpDffClientRect();
-
-protected:
- virtual bool ImplIsValid() const;
- virtual void ImplDumpBody();
-
-private:
- void ConstructOwn();
-
- void DumpRecordBody();
-
- void DumpDffOptRec();
- sal_uInt16 DumpDffOptPropHeader();
- void DumpDffOptPropValue( sal_uInt16 nPropId, sal_uInt32 nValue );
-
-private:
- typedef ScfRef< DffRecordHeaderObject > DffRecHeaderObjRef;
- DffRecHeaderObjRef mxHdrObj;
-};
-
-typedef ScfRef< DffDumpObject > DffDumpObjectRef;
-
-// ============================================================================
-// ============================================================================
-
-} // namespace dump
-} // namespace scf
-
-#endif
-#endif
-
diff --git a/sc/source/filter/inc/ftools.hxx b/sc/source/filter/inc/ftools.hxx
index 93a0879322d8..0c4b51239f8f 100644
--- a/sc/source/filter/inc/ftools.hxx
+++ b/sc/source/filter/inc/ftools.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ftools.hxx,v $
- * $Revision: 1.24 $
+ * $Revision: 1.24.4.1 $
*
* This file is part of OpenOffice.org.
*
@@ -107,7 +107,7 @@ inline bool get_flag( Type nBitField, Type nMask )
{ return (nBitField & nMask) != 0; }
/** Returns nSet, if at least one bit of nMask is set in nBitField, otherwise nUnset. */
-template< typename Type, typename ReturnType >
+template< typename ReturnType, typename Type >
inline ReturnType get_flagvalue( Type nBitField, Type nMask, ReturnType nSet, ReturnType nUnset )
{ return ::get_flag( nBitField, nMask ) ? nSet : nUnset; }
@@ -115,9 +115,9 @@ inline ReturnType get_flagvalue( Type nBitField, Type nMask, ReturnType nSet, Re
@descr Returns in rnRet the data fragment from nBitField, that starts at bit nStartBit
(0-based, bit 0 is rightmost) with the width of nBitCount. rnRet will be right-aligned (normalized).
For instance: extract_value( n, 0x4321, 8, 4 ) stores 3 in n (value in bits 8-11). */
-template< typename Type, typename ReturnType >
-inline void extract_value( ReturnType& rnRet, Type nBitField, sal_uInt8 nStartBit, sal_uInt8 nBitCount )
-{ rnRet = static_cast< ReturnType >( ((1UL << nBitCount) - 1) & (nBitField >> nStartBit) ); }
+template< typename ReturnType, typename Type >
+inline ReturnType extract_value( Type nBitField, sal_uInt8 nStartBit, sal_uInt8 nBitCount )
+{ return static_cast< ReturnType >( ((1UL << nBitCount) - 1) & (nBitField >> nStartBit) ); }
// Write to bitfields ---------------------------------------------------------
diff --git a/sc/source/filter/inc/imp_op.hxx b/sc/source/filter/inc/imp_op.hxx
index 099c93c59878..66a58ffb67a4 100644
--- a/sc/source/filter/inc/imp_op.hxx
+++ b/sc/source/filter/inc/imp_op.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: imp_op.hxx,v $
- * $Revision: 1.43 $
+ * $Revision: 1.43.14.3 $
*
* This file is part of OpenOffice.org.
*
@@ -109,6 +109,7 @@ protected:
typedef ScfDelList< XclImpOutlineDataBuffer > XclImpOutlineListBuffer;
XclImpOutlineListBuffer* pOutlineListBuffer;
+ sal_Int16 mnLastRefIdx;
UINT16 nIxfeIndex; // merkt sich Angabe im IXFE-Record
UINT16 nLastXF; // letzter XF in Formula-Record
SCTAB nBdshtTab; // Counter fuer Boundsheet
@@ -137,7 +138,6 @@ protected:
void Protect( void ); // 0x12 Sheet Protection
BOOL Password( void ); // 0x13
void Externsheet( void ); // 0x17
- void Note( void ); // 0x1C
void Columndefault( void ); // 0x20
void Array25( void ); // 0x21
void Rec1904( void ); // 0x22
@@ -149,7 +149,6 @@ protected:
void Ixfe( void ); // 0x44
void DefColWidth( void ); // 0x55
void Builtinfmtcnt( void ); // 0x56
- void Obj( void ); // 0x5D
void Colinfo( void ); // 0x7D
void Wsbool( void ); // 0x81
void Boundsheet( void ); // 0x85
@@ -176,11 +175,6 @@ protected:
void Formula4( void ); // 0x0406 -> excform.cxx
void Bof4( void ); // 0x0409
void Bof5( void ); // 0x0809
- // ---------------------------------------------------------------
- void SetLineStyle( SfxItemSet&, sal_uInt16, sal_uInt16, sal_uInt16 );
- void SetFillStyle( SfxItemSet&, sal_uInt16, sal_uInt16, sal_uInt16 );
- SdrObject* LineObj( SfxItemSet&, const Point&, const Point& );
- SdrObject* RectObj( SfxItemSet&, const Point&, const Point& );
// ---------------------------------------------------------------
void Formula( const XclAddress& rXclPos,
diff --git a/sc/source/filter/inc/namebuff.hxx b/sc/source/filter/inc/namebuff.hxx
index 060422fe6b52..7838d6550807 100644
--- a/sc/source/filter/inc/namebuff.hxx
+++ b/sc/source/filter/inc/namebuff.hxx
@@ -35,6 +35,7 @@
#include <tools/string.hxx>
#include "compiler.hxx"
#include "root.hxx"
+#include "xiroot.hxx"
#include "rangenam.hxx"
#include <hash_map>
@@ -299,7 +300,7 @@ public:
inline ExtSheetBuffer( RootData* );
virtual ~ExtSheetBuffer();
- void Add( const String& rFilePathAndName,
+ sal_Int16 Add( const String& rFilePathAndName,
const String& rTabName, const BOOL bSameWorkbook = FALSE );
BOOL GetScTabIndex( UINT16 nExcSheetIndex, UINT16& rIn_LastTab_Out_ScIndex );
@@ -323,7 +324,7 @@ struct ExtName
UINT32 nStorageId;
UINT16 nFlags;
- inline ExtName( const String& r ) : aName( r ), nStorageId( 0 ) {}
+ inline ExtName( const String& r, sal_uInt16 n ) : aName( r ), nStorageId( 0 ), nFlags( n ) {}
BOOL IsDDE( void ) const;
};
@@ -331,28 +332,25 @@ struct ExtName
-class ExtNameBuff : private List, protected ExcRoot
+class ExtNameBuff : protected XclImpRoot
{
-private:
- static const sal_Char* pJoostTest;
-protected:
public:
- inline ExtNameBuff( RootData* );
- virtual ~ExtNameBuff();
+ explicit ExtNameBuff( const XclImpRoot& rRoot );
- void AddDDE( const String& rName );
- void AddOLE( const String& rName, UINT32 nStorageId );
- void AddName( const String& rName );
+ void AddDDE( const String& rName, sal_Int16 nRefIdx );
+ void AddOLE( const String& rName, sal_Int16 nRefIdx, UINT32 nStorageId );
+ void AddName( const String& rName, sal_Int16 nRefIdx );
- const ExtName* GetName( const UINT16 nExcelIndex ) const;
+ const ExtName* GetNameByIndex( sal_Int16 nRefIdx, sal_uInt16 nNameIdx ) const;
- void Reset( void );
-};
+ void Reset();
+private:
+ typedef ::std::vector< ExtName > ExtNameVec;
+ typedef ::std::map< sal_Int16, ExtNameVec > ExtNameMap;
-inline ExtNameBuff::ExtNameBuff( RootData* p ) : ExcRoot( p )
-{
-}
+ ExtNameMap maExtNames;
+};
#endif
diff --git a/sc/source/filter/inc/root.hxx b/sc/source/filter/inc/root.hxx
index a488c644e0cd..3aa94ca542b1 100644
--- a/sc/source/filter/inc/root.hxx
+++ b/sc/source/filter/inc/root.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: root.hxx,v $
- * $Revision: 1.44 $
+ * $Revision: 1.44.14.1 $
*
* This file is part of OpenOffice.org.
*
@@ -47,6 +47,7 @@ class ExtNameBuff;
class ExtSheetBuffer;
class ExcelToSc;
+class XclImpColRowSettings;
class XclImpAutoFilterBuffer;
class XclImpPivotCacheList;
class _ScRangeListTabs;
@@ -70,6 +71,7 @@ struct RootData // -> Inkarnation jeweils im ImportExcel-Objekt!
ShrfmlaBuffer* pShrfmlaBuff;
ExtNameBuff* pExtNameBuff;
ExcelToSc* pFmlaConverter;
+ XclImpColRowSettings* pColRowBuff; // Col/Row-Einstellungen 1 Tabelle
// Biff8
XclImpAutoFilterBuffer* pAutoFilterBuffer; // ranges for autofilter and advanced filter
diff --git a/sc/source/filter/inc/xcl97esc.hxx b/sc/source/filter/inc/xcl97esc.hxx
index 5e82f0d36ae6..00281461f289 100644
--- a/sc/source/filter/inc/xcl97esc.hxx
+++ b/sc/source/filter/inc/xcl97esc.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xcl97esc.hxx,v $
- * $Revision: 1.13 $
+ * $Revision: 1.13.14.3 $
*
* This file is part of OpenOffice.org.
*
@@ -35,26 +35,31 @@
#include <tools/table.hxx>
#include <tools/stack.hxx>
#include "xlescher.hxx"
-#include "xlocx.hxx"
+#include "xeroot.hxx"
+
+// 0 = Export TBX form controls, 1 = Export OCX form controls.
+#define EXC_EXP_OCX_CTRL 0
namespace utl { class TempFile; }
// --- class XclEscherEx ---------------------------------------------
-struct RootData;
class SvStream;
class XclObj;
class XclEscherHostAppData;
class XclEscherClientData;
class XclEscherClientTextbox;
+#if EXC_EXP_OCX_CTRL
+class XclExpOcxControlObj;
+#else
+class XclExpTbxControlObj;
+#endif
-class XclEscherEx : public EscherEx
+class XclEscherEx : public EscherEx, protected XclExpRoot
{
private:
List aOffsetMap;
Stack aStack;
- XclExpOcxConverter aOcxConverter; /// Export of form controls.
- RootData& rRootData;
utl::TempFile* pPicTempFile;
SvStream* pPicStrm;
XclObj* pCurrXclObj;
@@ -66,8 +71,7 @@ private:
void DeleteCurrAppData();
public:
- XclEscherEx( SvStream& rStrm, UINT32 nDrawings,
- RootData& rRoot );
+ XclEscherEx( const XclExpRoot& rRoot, SvStream& rStrm, UINT32 nDrawings );
virtual ~XclEscherEx();
/// maintains OffsetMap
@@ -90,6 +94,27 @@ public:
/// Flush and merge PicStream into EscherStream
void EndDocument();
+
+#if EXC_EXP_OCX_CTRL
+ /** Creates an OCX form control OBJ record from the passed form control.
+ @descr Writes the form control data to the 'Ctls' stream. */
+ XclExpOcxControlObj* CreateCtrlObj( ::com::sun::star::uno::Reference<
+ ::com::sun::star::drawing::XShape > xShape );
+
+private:
+ SotStorageStreamRef mxCtlsStrm; /// The 'Ctls' stream.
+#else
+ /** Creates a TBX form control OBJ record from the passed form control. */
+ XclExpTbxControlObj* CreateCtrlObj( ::com::sun::star::uno::Reference<
+ ::com::sun::star::drawing::XShape > xShape );
+
+private:
+ /** Tries to get the name of a Basic macro from a control. */
+ void ConvertTbxMacro(
+ XclExpTbxControlObj& rTbxCtrlObj,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::awt::XControlModel > xCtrlModel );
+#endif
};
@@ -109,7 +134,7 @@ inline ULONG XclEscherEx::GetLastOffsetMapPos() const
struct RootData;
-class XclEscher
+class XclEscher : protected XclExpRoot
{
private:
utl::TempFile* pTempFile;
@@ -117,13 +142,13 @@ private:
XclEscherEx* pEx;
public:
- XclEscher( UINT32 nDrawings, RootData& rRoot );
+ XclEscher( const XclExpRoot& rRoot, UINT32 nDrawings );
~XclEscher();
inline XclEscherEx* GetEx() const { return pEx; }
inline SvStream& GetStrm() const { return *pStrm; }
- void AddSdrPage( const XclExpRoot& rRoot );
+ void AddSdrPage();
};
@@ -142,20 +167,20 @@ public:
};
-// Escher client anchor =======================================================
+// DFF client anchor ==========================================================
class Rectangle;
class SdrObject;
class ScAddress;
-/** Represents the position (anchor) of an Escher object in a Calc document. */
-class XclExpEscherAnchor : public EscherExClientAnchor_Base, protected XclExpRoot
+/** Represents the position (anchor) of an object in a Calc document. */
+class XclExpDffAnchor : public EscherExClientAnchor_Base, protected XclExpRoot
{
public:
- /** Constructs a dummy Escher client anchor. */
- explicit XclExpEscherAnchor( const XclExpRoot& rRoot, sal_uInt16 nFlags = 0 );
- /** Constructs an Escher client anchor directly from an SdrObject. */
- explicit XclExpEscherAnchor( const XclExpRoot& rRoot, const SdrObject& rSdrObj );
+ /** Constructs a dummy client anchor. */
+ explicit XclExpDffAnchor( const XclExpRoot& rRoot, sal_uInt16 nFlags = 0 );
+ /** Constructs a client anchor directly from an SdrObject. */
+ explicit XclExpDffAnchor( const XclExpRoot& rRoot, const SdrObject& rSdrObj );
/** Sets the flags according to the passed SdrObject. */
void SetFlags( const SdrObject& rSdrObj );
@@ -164,31 +189,31 @@ public:
@param rRect The object anchor rectangle to be exported (in twips). */
virtual void WriteData( EscherEx& rEx, const Rectangle& rRect );
- /** Writes the Escher anchor structure with the current anchor position. */
+ /** Writes the anchor structure with the current anchor position. */
void WriteData( EscherEx& rEx ) const;
protected: // for access in derived classes
- XclEscherAnchor maAnchor; /// The client anchor data.
- sal_uInt16 mnFlags; /// Flags for Escher stream export.
+ XclObjAnchor maAnchor; /// The client anchor data.
+ sal_uInt16 mnFlags; /// Flags for DFF stream export.
};
// ----------------------------------------------------------------------------
-/** Represents the position (anchor) of an Escher note object. */
-class XclExpEscherNoteAnchor : public XclExpEscherAnchor
+/** Represents the position (anchor) of a note object. */
+class XclExpDffNoteAnchor : public XclExpDffAnchor
{
public:
- explicit XclExpEscherNoteAnchor( const XclExpRoot& rRoot, const Rectangle& rRect );
+ explicit XclExpDffNoteAnchor( const XclExpRoot& rRoot, const Rectangle& rRect );
};
// ----------------------------------------------------------------------------
-/** Represents the position (anchor) of an Escher cell dropdown object. */
-class XclExpEscherDropDownAnchor : public XclExpEscherAnchor
+/** Represents the position (anchor) of a cell dropdown object. */
+class XclExpDffDropDownAnchor : public XclExpDffAnchor
{
public:
- explicit XclExpEscherDropDownAnchor( const XclExpRoot& rRoot, const ScAddress& rScPos );
+ explicit XclExpDffDropDownAnchor( const XclExpRoot& rRoot, const ScAddress& rScPos );
};
@@ -207,18 +232,16 @@ public:
// --- class XclEscherClientTextbox ----------------------------------
class SdrTextObj;
-struct RootData;
-class XclEscherClientTextbox : public EscherExClientRecord_Base
+class XclEscherClientTextbox : public EscherExClientRecord_Base, protected XclExpRoot
{
private:
- RootData& rRootData;
const SdrTextObj& rTextObj;
XclObj* pXclObj;
public:
XclEscherClientTextbox(
- RootData& rRoot,
+ const XclExpRoot& rRoot,
const SdrTextObj& rObj,
XclObj* pObj
);
diff --git a/sc/source/filter/inc/xcl97rec.hxx b/sc/source/filter/inc/xcl97rec.hxx
index 8740af2c70e5..c4e9ac72f8f3 100644
--- a/sc/source/filter/inc/xcl97rec.hxx
+++ b/sc/source/filter/inc/xcl97rec.hxx
@@ -169,7 +169,7 @@ public:
// set corresponding Excel object type in OBJ/ftCmo
void SetEscherShapeType( UINT16 nType );
- inline void SetEscherShapeTypeGroup() { mnObjType = EXC_OBJ_CMO_GROUP; }
+ inline void SetEscherShapeTypeGroup() { mnObjType = EXC_OBJTYPE_GROUP; }
/** If set to true, this object has created its own escher data.
@descr This causes the function EscherEx::EndShape() to not post process
diff --git a/sc/source/filter/inc/xechart.hxx b/sc/source/filter/inc/xechart.hxx
index 7e4b4df309f9..7c83b38a71fc 100644
--- a/sc/source/filter/inc/xechart.hxx
+++ b/sc/source/filter/inc/xechart.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xechart.hxx,v $
- * $Revision: 1.8 $
+ * $Revision: 1.7.62.2 $
*
* This file is part of OpenOffice.org.
*
@@ -650,6 +650,7 @@ typedef ScfRef< XclExpChSerErrorBar > XclExpChSerErrorBarRef;
class XclExpChSeries : public XclExpChGroupBase, protected XclExpChRoot
{
public:
+ typedef ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDiagram > XDiagramRef;
typedef ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > XDataSeriesRef;
typedef ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence > XLabeledDataSeqRef;
typedef ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XRegressionCurve > XRegressionCurveRef;
@@ -658,11 +659,13 @@ public:
explicit XclExpChSeries( const XclExpChRoot& rRoot, sal_uInt16 nSeriesIdx );
/** Converts the passed data series (source links and formatting). */
- bool ConvertDataSeries( XDataSeriesRef xDataSeries,
+ bool ConvertDataSeries(
+ XDiagramRef xDiagram, XDataSeriesRef xDataSeries,
const XclChExtTypeInfo& rTypeInfo,
sal_uInt16 nGroupIdx, sal_uInt16 nFormatIdx );
/** Converts the passed data series for stock charts. */
- bool ConvertStockSeries( XDataSeriesRef xDataSeries,
+ bool ConvertStockSeries(
+ XDataSeriesRef xDataSeries,
const ::rtl::OUString& rValueRole,
sal_uInt16 nGroupIdx, sal_uInt16 nFormatIdx, bool bCloseSymbol );
/** Converts the passed error bar settings (called at trend line child series). */
@@ -847,7 +850,7 @@ public:
void ConvertType( XDiagramRef xDiagram, XChartTypeRef xChartType,
sal_Int32 nApiAxesSetIdx, bool b3dChart, bool bSwappedAxesSet, bool bHasXLabels );
/** Converts and inserts all series from the passed chart type. */
- void ConvertSeries( XChartTypeRef xChartType,
+ void ConvertSeries( XDiagramRef xDiagram, XChartTypeRef xChartType,
sal_Int32 nGroupAxesSetIdx, bool bPercent, bool bConnectorLines );
/** Converts and inserts category ranges for all inserted series. */
void ConvertCategSequence( XLabeledDataSeqRef xCategSeq );
@@ -876,7 +879,8 @@ private:
/** Returns an unused format index to be used for the next created series. */
sal_uInt16 GetFreeFormatIdx() const;
/** Creates all data series of any chart type except stock charts. */
- void CreateDataSeries( XDataSeriesRef xDataSeries );
+ void CreateDataSeries( XDiagramRef xDiagram,
+ XDataSeriesRef xDataSeries );
/** Creates all data series of a stock chart. */
void CreateAllStockSeries( XChartTypeRef xChartType,
XDataSeriesRef xDataSeries );
diff --git a/sc/source/filter/inc/xeescher.hxx b/sc/source/filter/inc/xeescher.hxx
index 23f004c64fb2..788f3665cf9a 100644
--- a/sc/source/filter/inc/xeescher.hxx
+++ b/sc/source/filter/inc/xeescher.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xeescher.hxx,v $
- * $Revision: 1.10 $
+ * $Revision: 1.10.90.4 $
*
* This file is part of OpenOffice.org.
*
@@ -31,6 +31,7 @@
#ifndef SC_XEESCHER_HXX
#define SC_XEESCHER_HXX
+#include <vcl/graph.hxx>
#include "xlescher.hxx"
#include "xcl97rec.hxx"
@@ -41,12 +42,28 @@ namespace com { namespace sun { namespace star {
// ============================================================================
+/** Provides export of bitmap data to an IMGDATA record. */
+class XclExpImgData : public XclExpRecordBase
+{
+public:
+ explicit XclExpImgData( const Graphic& rGraphic, sal_uInt16 nRecId );
+
+ /** Writes the BITMAP record. */
+ virtual void Save( XclExpStream& rStrm );
+
+private:
+ Graphic maGraphic; /// The VCL graphic.
+ sal_uInt16 mnRecId; /// Record identifier for the IMGDATA record.
+};
+
+// ============================================================================
+
/** Helper class for form controils to manage spreadsheet links . */
-class XclExpControlObjHelper : protected XclExpRoot
+class XclExpControlHelper : protected XclExpRoot
{
public:
- explicit XclExpControlObjHelper( const XclExpRoot& rRoot );
- virtual ~XclExpControlObjHelper();
+ explicit XclExpControlHelper( const XclExpRoot& rRoot );
+ virtual ~XclExpControlHelper();
protected:
/** Tries to get spreadsheet cell link and source range link from the passed shape. */
@@ -77,7 +94,7 @@ private:
#if EXC_EXP_OCX_CTRL
/** Represents an OBJ record for an OCX form control. */
-class XclExpOcxControlObj : public XclObj, public XclExpControlObjHelper
+class XclExpOcxControlObj : public XclObj, public XclExpControlHelper
{
public:
explicit XclExpOcxControlObj(
@@ -98,7 +115,7 @@ private:
#else
/** Represents an OBJ record for an TBX form control. */
-class XclExpTbxControlObj : public XclObj, public XclExpControlObjHelper
+class XclExpTbxControlObj : public XclObj, public XclExpControlHelper
{
public:
explicit XclExpTbxControlObj(
@@ -122,15 +139,16 @@ private:
private:
ScfInt16Vec maMultiSel; /// Indexes of all selected entries in a multi selection.
XclTokenArrayRef mxMacroLink; /// Token array containing a link to an attached macro.
+ XclTbxEventType meEventType; /// Type of supported macro event.
sal_Int32 mnHeight; /// Height of the control.
sal_uInt16 mnState; /// Checked/unchecked state.
sal_Int16 mnLineCount; /// Combobox dropdown line count.
sal_Int16 mnSelEntry; /// Selected entry in combobox (1-based).
- sal_Int16 mnScrollValue; /// Scrollbar: Current value.
- sal_Int16 mnScrollMin; /// Scrollbar: Minimum value.
- sal_Int16 mnScrollMax; /// Scrollbar: Maximum value.
- sal_Int16 mnScrollStep; /// Scrollbar: Single step.
- sal_Int16 mnScrollPage; /// Scrollbar: Page step.
+ sal_uInt16 mnScrollValue; /// Scrollbar: Current value.
+ sal_uInt16 mnScrollMin; /// Scrollbar: Minimum value.
+ sal_uInt16 mnScrollMax; /// Scrollbar: Maximum value.
+ sal_uInt16 mnScrollStep; /// Scrollbar: Single step.
+ sal_uInt16 mnScrollPage; /// Scrollbar: Page step.
bool mbFlatButton; /// False = 3D button style; True = Flat button style.
bool mbFlatBorder; /// False = 3D border style; True = Flat border style.
bool mbMultiSel; /// true = Multi selection in listbox.
diff --git a/sc/source/filter/inc/xepage.hxx b/sc/source/filter/inc/xepage.hxx
index 57446693576e..7653cf3c2b1b 100644
--- a/sc/source/filter/inc/xepage.hxx
+++ b/sc/source/filter/inc/xepage.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xepage.hxx,v $
- * $Revision: 1.6 $
+ * $Revision: 1.6.90.1 $
*
* This file is part of OpenOffice.org.
*
@@ -92,23 +92,6 @@ private:
sal_uInt16 mnMaxPos; /// Maximum row/column for BIFF8 page breaks.
};
-// Background bitmap ----------------------------------------------------------
-
-class Graphic;
-
-/** Provides export of a background bitmap of a sheet (record BITMAP). */
-class XclExpBitmap : public XclExpRecordBase
-{
-public:
- explicit XclExpBitmap( const Graphic& rGraphic );
-
- /** Writes the BITMAP record. */
- virtual void Save( XclExpStream& rStrm );
-
-private:
- const Graphic& mrGraphic; /// The VCL graphic.
-};
-
// Page settings ==============================================================
/** Contains all page (print) settings records for a single sheet. */
diff --git a/sc/source/filter/inc/xichart.hxx b/sc/source/filter/inc/xichart.hxx
index ada3f4e82217..676e39461c34 100644
--- a/sc/source/filter/inc/xichart.hxx
+++ b/sc/source/filter/inc/xichart.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xichart.hxx,v $
- * $Revision: 1.14 $
+ * $Revision: 1.13.62.5 $
*
* This file is part of OpenOffice.org.
*
@@ -71,6 +71,9 @@ namespace com { namespace sun { namespace star {
}
} } }
+struct XclObjLineData;
+struct XclObjFillData;
+
// Common =====================================================================
class ScfProgressBar;
@@ -291,10 +294,6 @@ public:
inline explicit XclImpChFrameBase() {}
/** Creates a new frame object with specific default formatting. */
explicit XclImpChFrameBase( const XclChFormatInfo& rFmtInfo );
- /** Creates a new frame object with the passed formatting. */
- explicit XclImpChFrameBase(
- const XclChLineFormat& rLineFmt,
- const XclChAreaFormat& rAreaFmt );
/** Reads a frame formatting record (called by base class). */
virtual void ReadSubRecord( XclImpStream& rStrm );
@@ -312,6 +311,14 @@ public:
inline bool HasArea() const { return mxEscherFmt.is() || IsAutoArea() || mxAreaFmt->HasArea(); }
protected:
+ /** Converts and writes the contained line formatting to the passed property set. */
+ void ConvertLineBase( const XclImpChRoot& rRoot,
+ ScfPropertySet& rPropSet, XclChObjectType eObjType,
+ sal_uInt16 nFormatIdx = EXC_CHDATAFORMAT_UNKNOWN ) const;
+ /** Converts and writes the contained area formatting to the passed property set. */
+ void ConvertAreaBase( const XclImpChRoot& rRoot,
+ ScfPropertySet& rPropSet, XclChObjectType eObjType,
+ sal_uInt16 nFormatIdx = EXC_CHDATAFORMAT_UNKNOWN ) const;
/** Converts and writes the contained data to the passed property set. */
void ConvertFrameBase( const XclImpChRoot& rRoot,
ScfPropertySet& rPropSet, XclChObjectType eObjType,
@@ -337,16 +344,13 @@ public:
explicit XclImpChFrame(
const XclImpChRoot& rRoot,
XclChObjectType eObjType );
- /** Creates a new frame object with the passed formatting. */
- explicit XclImpChFrame(
- const XclImpChRoot& rRoot,
- const XclChLineFormat& rLineFmt,
- const XclChAreaFormat& rAreaFmt,
- XclChObjectType eObjType );
/** Reads the CHFRAME record (called by base class). */
virtual void ReadHeaderRecord( XclImpStream& rStrm );
+ /** Sets formatting from BIFF3-BIFF5 OBJ record, if own formatting is invisible. */
+ void UpdateObjFrame( const XclObjLineData& rLineData, const XclObjFillData& rFillData );
+
/** Converts and writes the contained data to the passed property set. */
void Convert( ScfPropertySet& rPropSet ) const;
@@ -654,10 +658,10 @@ public:
/** Converts and writes the contained data to the passed property set. */
void Convert( ScfPropertySet& rPropSet, const XclChExtTypeInfo& rTypeInfo ) const;
- /** Writes the area format for a data point in a series with automatic point colors. */
- void ConvertVarPoint( ScfPropertySet& rPropSet, sal_uInt16 nFormatIdx ) const;
/** Writes the line format only, e.g. for trend lines or error bars. */
void ConvertLine( ScfPropertySet& rPropSet, XclChObjectType eObjType ) const;
+ /** Writes the area format only for the series or a data point. */
+ void ConvertArea( ScfPropertySet& rPropSet, sal_uInt16 nFormatIdx ) const;
private:
/** Removes unused formatting (e.g. pie distance in a bar chart). */
@@ -1321,8 +1325,8 @@ public:
/** Reads a CHDATAFORMAT group describing a series format or a data point format. */
void ReadChDataFormat( XclImpStream& rStrm );
- /** Sets new chart background formatting. */
- void SetChartFrameFormat( const XclChLineFormat& rLineFmt, const XclChAreaFormat& rAreaFmt );
+ /** Sets formatting from BIFF3-BIFF5 OBJ record, if own formatting is invisible. */
+ void UpdateObjFrame( const XclObjLineData& rLineData, const XclObjFillData& rFillData );
/** Returns the specified chart type group. */
XclImpChTypeGroupRef GetTypeGroup( sal_uInt16 nGroupIdx ) const;
@@ -1386,10 +1390,8 @@ public:
/** Reads the complete chart substream (BOF/EOF block).
@descr The passed stream must be located in the BOF record of the chart substream. */
void ReadChartSubStream( XclImpStream& rStrm );
- /** Sets new chart background formatting.
- @descr Used for BIFF5, where background formatting information is
- contained in the chart OBJ record. */
- void SetChartFrameFormat( const XclChLineFormat& rLineFmt, const XclChAreaFormat& rAreaFmt );
+ /** Sets formatting from BIFF3-BIFF5 OBJ record, if own formatting is invisible. */
+ void UpdateObjFrame( const XclObjLineData& rLineData, const XclObjFillData& rFillData );
/** Returns the number of units on the progress bar needed for the chart. */
sal_Size GetProgressSize() const;
diff --git a/sc/source/filter/inc/xiescher.hxx b/sc/source/filter/inc/xiescher.hxx
index 347a2e4dcecc..68b5291bdc0e 100644
--- a/sc/source/filter/inc/xiescher.hxx
+++ b/sc/source/filter/inc/xiescher.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xiescher.hxx,v $
- * $Revision: 1.28 $
+ * $Revision: 1.28.90.14 $
*
* This file is part of OpenOffice.org.
*
@@ -32,77 +32,60 @@
#define SC_XIESCHER_HXX
#include <vector>
-#include <list>
#include <map>
#include <svx/msdffimp.hxx>
+#include <svx/msocximex.hxx>
+#include <vcl/graph.hxx>
#include "xlescher.hxx"
#include "xiroot.hxx"
#include "xistring.hxx"
namespace com { namespace sun { namespace star {
- namespace script { struct ScriptEventDescriptor; }
+ namespace drawing { class XShape; }
+ namespace form { class XForm; }
} } }
class ScfProgressBar;
class ScfPropertySet;
+class XclImpChart;
-// Text box data ==============================================================
-
-class XclImpTxoData : protected XclImpRoot
-{
-public:
- explicit XclImpTxoData( const XclImpRoot& rRoot );
-
- /** Reads a TXO record and following CONTINUE records for string and formatting data. */
- void ReadTxo( XclImpStream& rStrm );
-
- /** Returns the text orientation. */
- inline sal_uInt16 GetOrientation() const { return maData.mnOrient; }
- /** Returns the string data, if there is any. */
- inline const XclImpString* GetString() const { return mxString.get(); }
-
- /** Sets the text to the passed SdrObject, if it can take text. */
- void ProcessSdrObject( SdrObject& rSdrObj ) const;
-
-private:
- XclTxoData maData; /// Data from the TXO record.
- XclImpStringRef mxString; /// Plain or rich string.
-};
-
-typedef ScfRef< XclImpTxoData > XclImpTxoDataRef;
-
-// Escher objects =============================================================
+// Drawing objects ============================================================
class XclImpDrawObjBase;
typedef ScfRef< XclImpDrawObjBase > XclImpDrawObjRef;
/** Base class for drawing objects (OBJ records). */
-class XclImpDrawObjBase : protected XclImpRoot, ScfNoCopy
+class XclImpDrawObjBase : protected XclImpRoot
{
public:
explicit XclImpDrawObjBase( const XclImpRoot& rRoot );
virtual ~XclImpDrawObjBase();
- /** Reads the FTCMO subrecord (common object data) in an OBJ record, returns a new object. */
- static XclImpDrawObjRef ReadObjCmo( XclImpStream& rStrm );
- /** Reads the contents of the specified subrecord of an OBJ record from stream. */
- virtual void ReadSubRecord( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize );
- /** Reads the client anchor from an msofbtClientAnchor Escher record. */
- void ReadClientAnchor( SvStream& rEscherStrm, const DffRecordHeader& rHeader );
-
- /** Sets common object data from FTCMO subrecord. */
- void SetObjData( sal_uInt16 nObjType, sal_uInt16 nObjId, sal_uInt16 nObjFlags );
- /** Sets shape data from Escher stream. */
- void SetShapeData( sal_uInt32 nShapeId, sal_uInt32 nShapeFlags, sal_uInt32 nShapeBlipId );
+ /** Reads the BIFF3 OBJ record, returns a new drawing object. */
+ static XclImpDrawObjRef ReadObj3( XclImpStream& rStrm );
+ /** Reads the BIFF4 OBJ record, returns a new drawing object. */
+ static XclImpDrawObjRef ReadObj4( XclImpStream& rStrm );
+ /** Reads the BIFF5 OBJ record, returns a new drawing object. */
+ static XclImpDrawObjRef ReadObj5( XclImpStream& rStrm );
+ /** Reads the BIFF8 OBJ record, returns a new drawing object. */
+ static XclImpDrawObjRef ReadObj8( XclImpStream& rStrm );
+
/** Sets whether this is an area object (then its width and height must be greater than 0). */
inline void SetAreaObj( bool bAreaObj ) { mbAreaObj = bAreaObj; }
+ /** If set to true, a new SdrObject will be created while in DFF import. */
+ inline void SetSimpleMacro( bool bMacro ) { mbSimpleMacro = bMacro; }
+
+ /** Sets shape data from DFF stream. */
+ void SetDffData( const DffObjData& rDffObjData, const String& rObjName, const String& rHyperlink, bool bVisible, bool bAutoMargin );
/** Sets the object anchor explicitly. */
- void SetClientAnchor( const XclEscherAnchor& rAnchor );
+ void SetAnchor( const XclObjAnchor& rAnchor );
- /** If set, the SdrObject will not be created, processed, or inserted into the draw page. */
- inline void SetInvalid() { mbValid = false; }
- /** If set, the SdrObject will be created or processed, but not be inserted into the draw page. */
- inline void SetSkipInsertSdr() { mbInsSdr = false; }
+ /** If set to false, the SdrObject will not be created, processed, or inserted into the draw page. */
+ inline void SetProcessSdrObj( bool bProcess ) { mbProcessSdr = bProcess; }
+ /** If set to false, the SdrObject will be created or processed, but not be inserted into the draw page. */
+ inline void SetInsertSdrObj( bool bInsert ) { mbInsertSdr = bInsert; }
+ /** If set to true, a new SdrObject will be created while in DFF import. */
+ inline void SetCustomDffObj( bool bCustom ) { mbCustomDff = bCustom; }
/** Returns the Calc sheet index of this object. */
inline SCTAB GetScTab() const { return maObjId.mnScTab; }
@@ -110,22 +93,22 @@ public:
inline const XclObjId& GetObjId() const { return maObjId; }
/** Returns the Excel object type from OBJ record. */
inline sal_uInt16 GetObjType() const { return mnObjType; }
+ /** Returns the name of this object, may generate a default name. */
+ String GetObjName() const;
/** Returns associated macro name, if set, otherwise zero length string. */
- const String GetMacroName() const { return maMacroName; }
+ inline const String& GetMacroName() const { return maMacroName; }
- /** Returns the shape identifier used in the Escher stream. */
- inline sal_uInt32 GetShapeId() const { return mnShapeId; }
- /** Returns the shape flags from the Escher stream. */
- inline sal_uInt32 GetShapeFlags() const { return mnShapeFlags; }
- /** Returns the BLIP identifier for the meta file. */
- inline sal_uInt32 GetShapeBlipId() const { return mnShapeBlipId; }
+ /** Returns the shape identifier used in the DFF stream. */
+ inline sal_uInt32 GetDffShapeId() const { return mnDffShapeId; }
+ /** Returns the shape flags from the DFF stream. */
+ inline sal_uInt32 GetDffFlags() const { return mnDffFlags; }
- /** Returns true, if the object is valid and will be processed.. */
- inline bool IsValid() const { return mbValid; }
- /** Returns true, if the SdrObject will be created or processed, but not be inserted into the draw page. */
- inline bool IsInsertSdr() const { return mbInsSdr; }
- /** Returns true, if Escher object is printable. */
- inline bool IsPrintable() const { return ::get_flag( mnObjFlags, EXC_OBJ_CMO_PRINTABLE ); }
+ /** Returns true, if the object is hidden. */
+ inline bool IsHidden() const { return mbHidden; }
+ /** Returns true, if the object is visible. */
+ inline bool IsVisible() const { return mbVisible; }
+ /** Returns true, if the object is printable. */
+ inline bool IsPrintable() const { return mbPrintable; }
/** Returns true, if the passed size is valid for this object. */
bool IsValidSize( const Rectangle& rAnchorRect ) const;
@@ -134,65 +117,339 @@ public:
/** Returns the area on the drawing layer for this object. */
Rectangle GetAnchorRect() const;
+ /** Returns true, if the object is valid and will be processed.. */
+ inline bool IsProcessSdrObj() const { return mbProcessSdr && !mbHidden; }
+ /** Returns true, if the SdrObject will be created or processed, but not be inserted into the draw page. */
+ inline bool IsInsertSdrObj() const { return mbInsertSdr; }
+
/** Returns the needed size on the progress bar (calls virtual DoGetProgressSize() function). */
sal_Size GetProgressSize() const;
+ /** Creates and returns an SdrObject from the contained data. Caller takes ownership! */
+ SdrObject* CreateSdrObject( const Rectangle& rAnchorRect, ScfProgressBar& rProgress, bool bDffImport ) const;
/** Additional processing for the passed SdrObject (calls virtual DoProcessSdrObj() function). */
void ProcessSdrObject( SdrObject& rSdrObj ) const;
protected:
+ /** Reads the object name in a BIFF5 OBJ record. */
+ void ReadName5( XclImpStream& rStrm, sal_uInt16 nNameLen );
+ /** Reads the macro link in a BIFF3 OBJ record. */
+ void ReadMacro3( XclImpStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the macro link in a BIFF4 OBJ record. */
+ void ReadMacro4( XclImpStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the macro link in a BIFF5 OBJ record. */
+ void ReadMacro5( XclImpStream& rStrm, sal_uInt16 nMacroSize );
/** Reads the contents of the ftMacro sub structure in an OBJ record. */
- void ReadMacro( XclImpStream& rStrm );
+ void ReadMacro8( XclImpStream& rStrm );
+
+ /** Converts the passed line formatting to the passed SdrObject. */
+ void ConvertLineStyle( SdrObject& rSdrObj, const XclObjLineData& rLineData ) const;
+ /** Converts the passed fill formatting to the passed SdrObject. */
+ void ConvertFillStyle( SdrObject& rSdrObj, const XclObjFillData& rFillData ) const;
+ /** Converts the passed frame flags to the passed SdrObject. */
+ void ConvertFrameStyle( SdrObject& rSdrObj, sal_uInt16 nFrameFlags ) const;
+
+ /** Returns a solid line color from the passed line data struct. */
+ Color GetSolidLineColor( const XclObjLineData& rLineData ) const;
+ /** Returns a solid fill color from the passed fill data struct. */
+ Color GetSolidFillColor( const XclObjFillData& rFillData ) const;
+
+ /** Derived classes read the contents of the a BIFF3 OBJ record from the passed stream. */
+ virtual void DoReadObj3( XclImpStream& rStrm, sal_uInt16 nMacroSize );
+ /** Derived classes read the contents of the a BIFF4 OBJ record from the passed stream. */
+ virtual void DoReadObj4( XclImpStream& rStrm, sal_uInt16 nMacroSize );
+ /** Derived classes read the contents of the a BIFF5 OBJ record from the passed stream. */
+ virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
+ /** Derived classes read the contents of the specified subrecord of a BIFF8 OBJ record from stream. */
+ virtual void DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize );
/** Derived classes may return a progress bar size different from 1. */
virtual sal_Size DoGetProgressSize() const;
+ /** Derived classes create and return a new SdrObject from the contained data. Caller takes ownership! */
+ virtual SdrObject* DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const;
/** Derived classes may perform additional processing for the passed SdrObject. */
virtual void DoProcessSdrObj( SdrObject& rSdrObj ) const;
private:
- typedef ScfRef< XclEscherAnchor > XclEscherAnchorRef;
+ /** Reads the contents of a BIFF3 OBJ record. */
+ void ImplReadObj3( XclImpStream& rStrm );
+ /** Reads the contents of a BIFF4 OBJ record. */
+ void ImplReadObj4( XclImpStream& rStrm );
+ /** Reads the contents of a BIFF5 OBJ record. */
+ void ImplReadObj5( XclImpStream& rStrm );
+ /** Reads the contents of a BIFF8 OBJ record. */
+ void ImplReadObj8( XclImpStream& rStrm );
+
+private:
+ typedef ScfRef< XclObjAnchor > XclObjAnchorRef;
- XclEscherAnchorRef mxAnchor; /// The position of the object in the containing sheet.
+ XclObjAnchorRef mxAnchor; /// The position of the object in the containing sheet.
XclObjId maObjId; /// Sheet index and object identifier.
sal_uInt16 mnObjType; /// The Excel object type from OBJ record.
- sal_uInt16 mnObjFlags; /// Additional flags from OBJ record.
- sal_uInt32 mnShapeId; /// Shape ID from Escher stream.
- sal_uInt32 mnShapeFlags; /// Shape flags from Escher stream.
- sal_uInt32 mnShapeBlipId; /// The BLIP identifier (meta file).
+ sal_uInt32 mnDffShapeId; /// Shape ID from DFF stream.
+ sal_uInt32 mnDffFlags; /// Shape flags from DFF stream.
+ String maObjName; /// Name of the object.
String maMacroName; /// Name of an attached macro.
- bool mbValid; /// true = Object is valid, do processing and insertion.
+ String maHyperlink; /// On-click hyperlink URL.
+ bool mbHidden; /// true = Object is hidden.
+ bool mbVisible; /// true = Object is visible.
+ bool mbPrintable; /// true = Object is printable.
bool mbAreaObj; /// true = Width and height must be greater than 0.
- bool mbInsSdr; /// true = Insert the SdrObject into draw page.
+ bool mbAutoMargin; /// true = Set automatic text margin.
+ bool mbSimpleMacro; /// true = Create simple macro link and hyperlink.
+ bool mbProcessSdr; /// true = Object is valid, do processing and insertion.
+ bool mbInsertSdr; /// true = Insert the SdrObject into draw page.
+ bool mbCustomDff; /// true = Recreate SdrObject in DFF import.
+};
+
+// ----------------------------------------------------------------------------
+
+class XclImpDrawObjVector : public ::std::vector< XclImpDrawObjRef >
+{
+public:
+ inline explicit XclImpDrawObjVector() {}
+
+ /** Tries to insert the passed object into the last group or appends it. */
+ void InsertGrouped( XclImpDrawObjRef xDrawObj );
+
+ /** Returns the needed size on the progress bar for all contained objects. */
+ sal_Size GetProgressSize() const;
};
// ----------------------------------------------------------------------------
-/** A simple drawing object, e.g. line, rectangle, textbox, or bitmap. */
-class XclImpDrawingObj : public XclImpDrawObjBase
+/** A placeholder object for unknown object types. */
+class XclImpPhObj : public XclImpDrawObjBase
{
public:
- /** @param bAreaObj true = Width and height of the object must be greater than 0. */
- explicit XclImpDrawingObj( const XclImpRoot& rRoot, bool bAreaObj );
+ explicit XclImpPhObj( const XclImpRoot& rRoot );
+};
- /** Stores the passed textbox data from a TXO record. */
- inline void SetTxoData( XclImpTxoDataRef xTxoData ) { mxTxoData = xTxoData; }
+// ----------------------------------------------------------------------------
- /** Returns the text orientation from the contained textbox data. */
- inline sal_uInt16 GetOrientation() const { return mxTxoData.is() ? mxTxoData->GetOrientation() : EXC_TXO_TEXTROT_NONE; }
- /** Returns the string from the contained textbox data. */
- inline const XclImpString* GetString() const { return mxTxoData.is() ? mxTxoData->GetString() : 0; }
+/** A group object. */
+class XclImpGroupObj : public XclImpDrawObjBase
+{
+public:
+ explicit XclImpGroupObj( const XclImpRoot& rRoot );
+
+ /** Tries to insert the drawing object into this or a nested group. */
+ bool TryInsert( XclImpDrawObjRef xDrawObj );
+
+protected:
+ /** Reads the contents of the a BIFF3 OBJ record from the passed stream. */
+ virtual void DoReadObj3( XclImpStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the contents of the a BIFF4 OBJ record from the passed stream. */
+ virtual void DoReadObj4( XclImpStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
+ virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
+ /** Returns a progress bar size that takes all group children into account. */
+ virtual sal_Size DoGetProgressSize() const;
+ /** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
+ virtual SdrObject* DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const;
+
+protected:
+ XclImpDrawObjVector maChildren; /// Grouped objects.
+ sal_uInt16 mnFirstUngrouped; /// Object identfier of first object not grouped into this group.
+};
+
+// ----------------------------------------------------------------------------
+
+/** A line object. */
+class XclImpLineObj : public XclImpDrawObjBase
+{
+public:
+ explicit XclImpLineObj( const XclImpRoot& rRoot );
+
+protected:
+ /** Reads the contents of the a BIFF3 OBJ record from the passed stream. */
+ virtual void DoReadObj3( XclImpStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the contents of the a BIFF4 OBJ record from the passed stream. */
+ virtual void DoReadObj4( XclImpStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
+ virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
+ /** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
+ virtual SdrObject* DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const;
+
+protected:
+ XclObjLineData maLineData; /// BIFF5 line formatting.
+ sal_uInt16 mnArrows; /// Line arrows.
+ sal_uInt8 mnStartPoint; /// Starting point.
+};
+
+// ----------------------------------------------------------------------------
+
+/** A rectangle or oval object. */
+class XclImpRectObj : public XclImpDrawObjBase
+{
+public:
+ explicit XclImpRectObj( const XclImpRoot& rRoot );
+
+protected:
+ /** Reads fil data, line data, and frame flags. */
+ void ReadFrameData( XclImpStream& rStrm );
+
+ /** Converts fill formatting, line formattind, and frame style. */
+ void ConvertRectStyle( SdrObject& rSdrObj ) const;
+
+ /** Reads the contents of the a BIFF3 OBJ record from the passed stream. */
+ virtual void DoReadObj3( XclImpStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the contents of the a BIFF4 OBJ record from the passed stream. */
+ virtual void DoReadObj4( XclImpStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
+ virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
+ /** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
+ virtual SdrObject* DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const;
+
+protected:
+ XclObjFillData maFillData; /// BIFF5 fill formatting.
+ XclObjLineData maLineData; /// BIFF5 line formatting.
+ sal_uInt16 mnFrameFlags; /// Additional flags.
+};
+
+// ----------------------------------------------------------------------------
+
+/** An oval object. */
+class XclImpOvalObj : public XclImpRectObj
+{
+public:
+ explicit XclImpOvalObj( const XclImpRoot& rRoot );
protected:
+ /** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
+ virtual SdrObject* DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const;
+};
+
+// ----------------------------------------------------------------------------
+
+/** An arc object. */
+class XclImpArcObj : public XclImpDrawObjBase
+{
+public:
+ explicit XclImpArcObj( const XclImpRoot& rRoot );
+
+protected:
+ /** Reads the contents of the a BIFF3 OBJ record from the passed stream. */
+ virtual void DoReadObj3( XclImpStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the contents of the a BIFF4 OBJ record from the passed stream. */
+ virtual void DoReadObj4( XclImpStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
+ virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
+ /** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
+ virtual SdrObject* DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const;
+
+protected:
+ XclObjFillData maFillData; /// BIFF5 fill formatting.
+ XclObjLineData maLineData; /// BIFF5 line formatting.
+ sal_uInt8 mnQuadrant; /// Visible quadrant of the circle.
+};
+
+// ----------------------------------------------------------------------------
+
+/** A polygon object. */
+class XclImpPolygonObj : public XclImpRectObj
+{
+public:
+ explicit XclImpPolygonObj( const XclImpRoot& rRoot );
+
+protected:
+ /** Reads the COORDLIST record following the OBJ record. */
+ void ReadCoordList( XclImpStream& rStrm );
+
+ /** Reads the contents of the a BIFF4 OBJ record from the passed stream. */
+ virtual void DoReadObj4( XclImpStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
+ virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
+ /** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
+ virtual SdrObject* DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const;
+
+protected:
+ typedef ::std::vector< Point > PointVector;
+ PointVector maCoords; /// Coordinates relative to bounding rectangle.
+ sal_uInt16 mnPolyFlags; /// Additional flags.
+ sal_uInt16 mnPointCount; /// Polygon point count.
+};
+
+// ----------------------------------------------------------------------------
+
+struct XclImpObjTextData
+{
+ XclObjTextData maData; /// BIFF5 text data.
+ XclImpStringRef mxString; /// Plain or rich string.
+
+ /** Reads a byte string from the passed stream. */
+ void ReadByteString( XclImpStream& rStrm );
+ /** Reads text formatting from the passed stream. */
+ void ReadFormats( XclImpStream& rStrm );
+};
+
+// ----------------------------------------------------------------------------
+
+/** A drawing object supporting text contents. Used for all simple objects in BIFF8. */
+class XclImpTextObj : public XclImpRectObj
+{
+public:
+ explicit XclImpTextObj( const XclImpRoot& rRoot );
+
+ /** Stores the passed textbox data. */
+ inline void SetTextData( const XclImpObjTextData& rTextData ) { maTextData = rTextData; }
+
+protected:
+ /** Reads the contents of the a BIFF3 OBJ record from the passed stream. */
+ virtual void DoReadObj3( XclImpStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the contents of the a BIFF4 OBJ record from the passed stream. */
+ virtual void DoReadObj4( XclImpStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
+ virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
+ /** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
+ virtual SdrObject* DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const;
/** Inserts the contained text data at the passed object. */
virtual void DoProcessSdrObj( SdrObject& rSdrObj ) const;
+protected:
+ XclImpObjTextData maTextData; /// Textbox data from BIFF5 OBJ or BIFF8 TXO record.
+};
+
+// ----------------------------------------------------------------------------
+
+/** A chart object. This is the drawing object wrapper for the chart data. */
+class XclImpChartObj : public XclImpRectObj
+{
+public:
+ /** @param bOwnTab True = chart is on an own sheet; false = chart is an embedded object. */
+ explicit XclImpChartObj( const XclImpRoot& rRoot, bool bOwnTab = false );
+
+ /** Reads the complete chart substream (BOF/EOF block). */
+ void ReadChartSubStream( XclImpStream& rStrm );
+
+protected:
+ /** Reads the contents of the a BIFF3 OBJ record from the passed stream. */
+ virtual void DoReadObj3( XclImpStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the contents of the a BIFF4 OBJ record from the passed stream. */
+ virtual void DoReadObj4( XclImpStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
+ virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
+ /** Reads the contents of the specified subrecord of a BIFF8 OBJ record from stream. */
+ virtual void DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize );
+ /** Returns the needed size on the progress bar. */
+ virtual sal_Size DoGetProgressSize() const;
+ /** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
+ virtual SdrObject* DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const;
+
+private:
+ /** Calculates the object anchor of a sheet chart (chart fills one page). */
+ void FinalizeTabChart();
+
private:
- XclImpTxoDataRef mxTxoData; /// Textbox data from TXO record.
+ typedef ScfRef< XclImpChart > XclImpChartRef;
+
+ XclImpChartRef mxChart; /// The chart itself (BOF/EOF substream data).
+ bool mbOwnTab; /// true = own sheet; false = embedded object.
};
// ----------------------------------------------------------------------------
/** A note object, which is a specialized text box objext. */
-class XclImpNoteObj : public XclImpDrawingObj
+class XclImpNoteObj : public XclImpTextObj
{
public:
explicit XclImpNoteObj( const XclImpRoot& rRoot );
@@ -211,37 +468,45 @@ private:
// ----------------------------------------------------------------------------
-/** Helper class for form controils to manage spreadsheet links . */
-class XclImpControlObjHelper
+/** Helper base class for TBX and OCX form controls to manage spreadsheet links. */
+class XclImpControlHelper
{
public:
- typedef ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > XControlModelRef;
+ explicit XclImpControlHelper( const XclImpRoot& rRoot, XclCtrlBindMode eBindMode );
+ virtual ~XclImpControlHelper();
-public:
- explicit XclImpControlObjHelper( XclCtrlBindMode eBindMode );
- virtual ~XclImpControlObjHelper();
+ /** Returns true, if a linked cell address is present. */
+ inline bool HasCellLink() const { return mxCellLink.is(); }
+ /** Returns true, if a linked source cell range is present. */
+ inline bool HasSourceRange() const { return mxSrcRange.is(); }
- /** Sets the control model from the created form control object. */
- inline void SetControlModel( XControlModelRef xCtrlModel ) { mxCtrlModel = xCtrlModel; }
+ /** Returns the SdrObject from the passed control shape and sets the bounding rectangle. */
+ SdrObject* CreateSdrObjectFromShape(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape,
+ const Rectangle& rAnchorRect ) const;
+
+ /** Sets additional properties to the form control model, calls virtual DoProcessControl(). */
+ void ProcessControl( const XclImpDrawObjBase& rDrawObj ) const;
protected:
/** Reads the formula for the linked cell from the current position of the stream. */
- void ReadCellLinkFormula( XclImpStream& rStrm );
+ void ReadCellLinkFormula( XclImpStream& rStrm, bool bWithBoundSize );
/** Reads the formula for the source range from the current position of the stream. */
- void ReadSrcRangeFormula( XclImpStream& rStrm );
+ void ReadSourceRangeFormula( XclImpStream& rStrm, bool bWithBoundSize );
- /** Returns true, if a linked cell address is present. */
- inline bool HasCellLink() const { return mxCellLink.is(); }
- /** Returns true, if a linked source cell range is present. */
- inline bool HasSourceRange() const { return mxSrcRange.is(); }
+ /** Derived classes will set additional properties for the current form control. */
+ virtual void DoProcessControl( ScfPropertySet& rPropSet ) const;
- /** Returns the property set of the form control object. */
- ScfPropertySet GetControlPropSet() const;
- /** Tries to set a spreadsheet cell link and source range link at the passed form control. */
- void ConvertSheetLinks( const XclImpRoot& rRoot, SdrObject& rSdrObj ) const;
+private:
+ /** Reads a list of cell ranges from a formula at the current stream position. */
+ void ReadRangeList( ScRangeList& rScRanges, XclImpStream& rStrm );
+ /** Reads leading formula size and a list of cell ranges from a formula if the leading size is not zero. */
+ void ReadRangeList( ScRangeList& rScRanges, XclImpStream& rStrm, bool bWithBoundSize );
private:
- XControlModelRef mxCtrlModel; /// Model of the created form control object.
+ const XclImpRoot& mrRoot; /// Not derived from XclImpRoot to allow multiple inheritance.
+ mutable ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ mxShape; /// The UNO wrapper of the control shape.
ScfRef< ScAddress > mxCellLink; /// Linked cell in the Calc document.
ScfRef< ScRange > mxSrcRange; /// Source data range in the Calc document.
XclCtrlBindMode meBindMode; /// Value binding mode.
@@ -249,148 +514,416 @@ private:
// ----------------------------------------------------------------------------
-/** An old form control object (does not use the OLE mechanism, but is a "simple" drawing object). */
-class XclImpTbxControlObj : public XclImpDrawingObj, public XclImpControlObjHelper
+/** Base class for textbox based form controls. */
+class XclImpTbxObjBase : public XclImpTextObj, public XclImpControlHelper
{
public:
- explicit XclImpTbxControlObj( const XclImpRoot& rRoot );
+ explicit XclImpTbxObjBase( const XclImpRoot& rRoot );
- /** Reads the contents of the specified subrecord of an OBJ record from stream. */
- virtual void ReadSubRecord( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize );
+ /** Sets line and fill formatting from the passed DFF property set. */
+ void SetDffProperties( const DffPropSet& rDffPropSet );
- /** Returns the complete component service name for this control. */
- ::rtl::OUString GetServiceName() const;
- /** Tries to fill the passed descriptor with imported macro data.
- @return true = Control is associated with a macro, rEvent contains valid data. */
+ /** Returns the service name of the control component to be created. */
+ inline ::rtl::OUString GetServiceName() const { return DoGetServiceName(); }
+ /** Fills the passed macro event descriptor. */
bool FillMacroDescriptor(
- ::com::sun::star::script::ScriptEventDescriptor& rEvent ) const;
+ ::com::sun::star::script::ScriptEventDescriptor& rDescriptor ) const;
protected:
- /** Overloaded to do additional processing on the SdrObject. */
+ /** Sets control text formatting. */
+ void ConvertFont( ScfPropertySet& rPropSet ) const;
+ /** Sets control label and text formatting. */
+ void ConvertLabel( ScfPropertySet& rPropSet ) const;
+
+ /** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
+ virtual SdrObject* DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const;
+ /** Additional processing on the SdrObject, calls new virtual function DoProcessControl(). */
virtual void DoProcessSdrObj( SdrObject& rSdrObj ) const;
-private:
- /** Reads the contents of the ftCbls sub structure in an OBJ record. */
- void ReadCbls( XclImpStream& rStrm );
- /** Reads the contents of the ftCblsFmla sub structure in an OBJ record. */
- void ReadCblsFmla( XclImpStream& rStrm );
- /** Reads the contents of the ftLbsData sub structure in an OBJ record. */
- void ReadLbsData( XclImpStream& rStrm );
- /** Reads the contents of the ftSbs sub structure in an OBJ record. */
+ /** Derived classes return the service name of the control component to be created. */
+ virtual ::rtl::OUString DoGetServiceName() const = 0;
+ /** Derived classes return the type of the macro event to be created. */
+ virtual XclTbxEventType DoGetEventType() const = 0;
+};
+
+// ----------------------------------------------------------------------------
+
+/** A button control. */
+class XclImpButtonObj : public XclImpTbxObjBase
+{
+public:
+ explicit XclImpButtonObj( const XclImpRoot& rRoot );
+
+protected:
+ /** Sets additional properties for the current form control. */
+ virtual void DoProcessControl( ScfPropertySet& rPropSet ) const;
+ /** Returns the service name of the control component to be created. */
+ virtual ::rtl::OUString DoGetServiceName() const;
+ /** Returns the type of the macro event to be created. */
+ virtual XclTbxEventType DoGetEventType() const;
+};
+
+// ----------------------------------------------------------------------------
+
+/** A checkbox control. */
+class XclImpCheckBoxObj : public XclImpTbxObjBase
+{
+public:
+ explicit XclImpCheckBoxObj( const XclImpRoot& rRoot );
+
+protected:
+ /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
+ virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
+ /** Reads the contents of the specified subrecord of a BIFF8 OBJ record from stream. */
+ virtual void DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize );
+ /** Sets additional properties for the current form control. */
+ virtual void DoProcessControl( ScfPropertySet& rPropSet ) const;
+ /** Returns the service name of the control component to be created. */
+ virtual ::rtl::OUString DoGetServiceName() const;
+ /** Returns the type of the macro event to be created. */
+ virtual XclTbxEventType DoGetEventType() const;
+
+protected:
+ sal_uInt16 mnState;
+ sal_uInt16 mnCheckBoxFlags;
+};
+
+// ----------------------------------------------------------------------------
+
+/** An option button control. */
+class XclImpOptionButtonObj : public XclImpCheckBoxObj
+{
+public:
+ explicit XclImpOptionButtonObj( const XclImpRoot& rRoot );
+
+protected:
+ /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
+ virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
+ /** Reads the contents of the specified subrecord of a BIFF8 OBJ record from stream. */
+ virtual void DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize );
+ /** Sets additional properties for the current form control. */
+ virtual void DoProcessControl( ScfPropertySet& rPropSet ) const;
+ /** Returns the service name of the control component to be created. */
+ virtual ::rtl::OUString DoGetServiceName() const;
+ /** Returns the type of the macro event to be created. */
+ virtual XclTbxEventType DoGetEventType() const;
+
+protected:
+ sal_uInt16 mnNextInGroup; /// Next option button in a group.
+ sal_uInt16 mnFirstInGroup; /// 1 = Button is the first in a group.
+};
+
+// ----------------------------------------------------------------------------
+
+/** A label control. */
+class XclImpLabelObj : public XclImpTbxObjBase
+{
+public:
+ explicit XclImpLabelObj( const XclImpRoot& rRoot );
+
+protected:
+ /** Sets additional properties for the current form control. */
+ virtual void DoProcessControl( ScfPropertySet& rPropSet ) const;
+ /** Returns the service name of the control component to be created. */
+ virtual ::rtl::OUString DoGetServiceName() const;
+ /** Returns the type of the macro event to be created. */
+ virtual XclTbxEventType DoGetEventType() const;
+};
+
+// ----------------------------------------------------------------------------
+
+/** A groupbox control. */
+class XclImpGroupBoxObj : public XclImpTbxObjBase
+{
+public:
+ explicit XclImpGroupBoxObj( const XclImpRoot& rRoot );
+
+protected:
+ /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
+ virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
+ /** Reads the contents of the specified subrecord of a BIFF8 OBJ record from stream. */
+ virtual void DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize );
+ /** Sets additional properties for the current form control. */
+ virtual void DoProcessControl( ScfPropertySet& rPropSet ) const;
+ /** Returns the service name of the control component to be created. */
+ virtual ::rtl::OUString DoGetServiceName() const;
+ /** Returns the type of the macro event to be created. */
+ virtual XclTbxEventType DoGetEventType() const;
+
+protected:
+ sal_uInt16 mnGroupBoxFlags;
+};
+
+// ----------------------------------------------------------------------------
+
+/** A dialog control. */
+class XclImpDialogObj : public XclImpTbxObjBase
+{
+public:
+ explicit XclImpDialogObj( const XclImpRoot& rRoot );
+
+protected:
+ /** Sets additional properties for the current form control. */
+ virtual void DoProcessControl( ScfPropertySet& rPropSet ) const;
+ /** Returns the service name of the control component to be created. */
+ virtual ::rtl::OUString DoGetServiceName() const;
+ /** Returns the type of the macro event to be created. */
+ virtual XclTbxEventType DoGetEventType() const;
+};
+
+// ----------------------------------------------------------------------------
+
+/** An edit control. */
+class XclImpEditObj : public XclImpTbxObjBase
+{
+public:
+ explicit XclImpEditObj( const XclImpRoot& rRoot );
+
+protected:
+ /** REturns true, if the field type is numeric. */
+ bool IsNumeric() const;
+
+ /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
+ virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
+ /** Reads the contents of the specified subrecord of a BIFF8 OBJ record from stream. */
+ virtual void DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize );
+ /** Sets additional properties for the current form control. */
+ virtual void DoProcessControl( ScfPropertySet& rPropSet ) const;
+ /** Returns the service name of the control component to be created. */
+ virtual ::rtl::OUString DoGetServiceName() const;
+ /** Returns the type of the macro event to be created. */
+ virtual XclTbxEventType DoGetEventType() const;
+
+protected:
+ sal_uInt16 mnContentType;
+ sal_uInt16 mnMultiLine;
+ sal_uInt16 mnScrollBar;
+ sal_uInt16 mnListBoxObjId;
+};
+
+// ----------------------------------------------------------------------------
+
+/** Base class of scrollable form controls (spin button, scrollbar, listbox, dropdown). */
+class XclImpTbxObjScrollableBase : public XclImpTbxObjBase
+{
+public:
+ explicit XclImpTbxObjScrollableBase( const XclImpRoot& rRoot );
+
+protected:
+ /** Reads scrollbar data. */
void ReadSbs( XclImpStream& rStrm );
- /** Reads the contents of the ftGboData sub structure in an OBJ record. */
- void ReadGboData( XclImpStream& rStrm );
-private:
- ScfInt16Vec maMultiSel; /// Indexes of all selected entries in a multi selection.
- sal_uInt16 mnState; /// Checked/unchecked state.
- sal_Int16 mnSelEntry; /// Index of selected entry (1-based).
- sal_Int16 mnSelType; /// Selection type.
- sal_Int16 mnLineCount; /// Combobox dropdown line count.
- sal_Int16 mnScrollValue; /// Scrollbar: Current value.
- sal_Int16 mnScrollMin; /// Scrollbar: Minimum value.
- sal_Int16 mnScrollMax; /// Scrollbar: Maximum value.
- sal_Int16 mnScrollStep; /// Scrollbar: Single step.
- sal_Int16 mnScrollPage; /// Scrollbar: Page step.
- bool mbFlatButton; /// False = 3D button style; True = Flat button style.
- bool mbFlatBorder; /// False = 3D border style; True = Flat border style.
- bool mbScrollHor; /// Scrollbar: true = horizontal.
+ /** Reads the contents of the specified subrecord of a BIFF8 OBJ record from stream. */
+ virtual void DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize );
+
+protected:
+ sal_uInt16 mnValue;
+ sal_uInt16 mnMin;
+ sal_uInt16 mnMax;
+ sal_uInt16 mnStep;
+ sal_uInt16 mnPageStep;
+ sal_uInt16 mnOrient;
+ sal_uInt16 mnThumbWidth;
+ sal_uInt16 mnScrollFlags;
};
// ----------------------------------------------------------------------------
-/** A common Escher OLE object, or an OLE form control. */
-class XclImpOleObj : public XclImpDrawObjBase, public XclImpControlObjHelper
+/** A spinbutton control. */
+class XclImpSpinButtonObj : public XclImpTbxObjScrollableBase
{
public:
- explicit XclImpOleObj( const XclImpRoot& rRoot );
+ explicit XclImpSpinButtonObj( const XclImpRoot& rRoot );
- /** Reads the contents of the specified subrecord of an OBJ record from stream. */
- virtual void ReadSubRecord( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize );
+protected:
+ /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
+ virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
+ /** Sets additional properties for the current form control. */
+ virtual void DoProcessControl( ScfPropertySet& rPropSet ) const;
+ /** Returns the service name of the control component to be created. */
+ virtual ::rtl::OUString DoGetServiceName() const;
+ /** Returns the type of the macro event to be created. */
+ virtual XclTbxEventType DoGetEventType() const;
+};
- /** Allows to detect whether the object is iconified. */
- inline bool IsIconified() const { return mbAsSymbol; }
- /** Returns true, if this object is a form control, and false, if it is a common OLE object. */
- inline bool IsControl() const { return mbControl && mbUseCtlsStrm; }
+// ----------------------------------------------------------------------------
- /** Returns the OLE storage name used in the Excel document. */
- inline const String& GetStorageName() const { return maStorageName; }
- /** Returns the position in Ctrl stream for additional form control data. */
- inline sal_Size GetCtlsStreamPos() const { return mnCtlsStrmPos; }
+/** A scrollbar control. */
+class XclImpScrollBarObj : public XclImpTbxObjScrollableBase
+{
+public:
+ explicit XclImpScrollBarObj( const XclImpRoot& rRoot );
protected:
- /** Overloaded to do additional processing on the SdrObject. */
- virtual void DoProcessSdrObj( SdrObject& rSdrObj ) const;
+ /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
+ virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
+ /** Sets additional properties for the current form control. */
+ virtual void DoProcessControl( ScfPropertySet& rPropSet ) const;
+ /** Returns the service name of the control component to be created. */
+ virtual ::rtl::OUString DoGetServiceName() const;
+ /** Returns the type of the macro event to be created. */
+ virtual XclTbxEventType DoGetEventType() const;
+};
-private:
- /** Reads the contents of the ftPioGrbit sub structure in an OBJ record. */
- void ReadPioGrbit( XclImpStream& rStrm );
- /** Reads the contents of the ftPictFmla sub structure in an OBJ record. */
- void ReadPictFmla( XclImpStream& rStrm, sal_uInt16 nRecSize );
+// ----------------------------------------------------------------------------
-private:
- String maStorageName; /// Name of the OLE storage for this object.
- sal_Size mnCtlsStrmPos; /// Position in 'Ctls' stream for controls.
- bool mbAsSymbol; /// true = Show as symbol.
- bool mbLinked; /// true = Linked; false = Embedded.
- bool mbControl; /// true = Form control, false = OLE object.
- bool mbUseCtlsStrm; /// true = Form control data in 'Ctls' stream, false = Own storage.
+/** Base class for list controls (listbox, dropdown). */
+class XclImpTbxObjListBase : public XclImpTbxObjScrollableBase
+{
+public:
+ explicit XclImpTbxObjListBase( const XclImpRoot& rRoot );
+
+protected:
+ /** Reads common listbox settings. */
+ void ReadLbsData( XclImpStream& rStrm );
+ /** Sets common listbox/dropdown formatting attributes. */
+ void SetBoxFormatting( ScfPropertySet& rPropSet ) const;
+
+protected:
+ sal_uInt16 mnEntryCount;
+ sal_uInt16 mnSelEntry;
+ sal_uInt16 mnListFlags;
+ sal_uInt16 mnEditObjId;
+ bool mbHasDefFontIdx;
};
// ----------------------------------------------------------------------------
-struct XclChLineFormat;
-struct XclChAreaFormat;
-class XclImpChart;
+/** A listbox control. */
+class XclImpListBoxObj : public XclImpTbxObjListBase
+{
+public:
+ explicit XclImpListBoxObj( const XclImpRoot& rRoot );
-/** A chart object. This is the drawing object wrapper for the chart data. */
-class XclImpChartObj : public XclImpDrawObjBase
+protected:
+ /** Reads listbox settings and selection. */
+ void ReadFullLbsData( XclImpStream& rStrm, sal_Size nRecLeft );
+
+ /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
+ virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
+ /** Reads the contents of the specified subrecord of a BIFF8 OBJ record from stream. */
+ virtual void DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize );
+ /** Sets additional properties for the current form control. */
+ virtual void DoProcessControl( ScfPropertySet& rPropSet ) const;
+ /** Returns the service name of the control component to be created. */
+ virtual ::rtl::OUString DoGetServiceName() const;
+ /** Returns the type of the macro event to be created. */
+ virtual XclTbxEventType DoGetEventType() const;
+
+protected:
+ ScfUInt8Vec maSelection;
+};
+
+// ----------------------------------------------------------------------------
+
+/** A dropdown listbox control. */
+class XclImpDropDownObj : public XclImpTbxObjListBase
{
public:
- /** @param bOwnTab True = chart is on an own sheet; false = chart is an embedded object. */
- explicit XclImpChartObj( const XclImpRoot& rRoot, bool bOwnTab );
+ explicit XclImpDropDownObj( const XclImpRoot& rRoot );
- /** Reads remaining data from a BIFF5 OBJ record. */
- void ReadObj5( XclImpStream& rStrm );
- /** Reads the complete chart substream (BOF/EOF block).
- @descr The passed stream must be located in the BOF record of the chart substream. */
- void ReadChartSubStream( XclImpStream& rStrm );
+protected:
+ /** Returns the type of the dropdown control. */
+ sal_uInt16 GetDropDownType() const;
+
+ /** Reads dropdown box settings. */
+ void ReadFullLbsData( XclImpStream& rStrm );
+
+ /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
+ virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
+ /** Reads the contents of the specified subrecord of a BIFF8 OBJ record from stream. */
+ virtual void DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize );
+ /** Sets additional properties for the current form control. */
+ virtual void DoProcessControl( ScfPropertySet& rPropSet ) const;
+ /** Returns the service name of the control component to be created. */
+ virtual ::rtl::OUString DoGetServiceName() const;
+ /** Returns the type of the macro event to be created. */
+ virtual XclTbxEventType DoGetEventType() const;
+
+protected:
+ sal_uInt16 mnLeft;
+ sal_uInt16 mnTop;
+ sal_uInt16 mnRight;
+ sal_uInt16 mnBottom;
+ sal_uInt16 mnDropDownFlags;
+ sal_uInt16 mnLineCount;
+ sal_uInt16 mnMinWidth;
+};
+
+// ----------------------------------------------------------------------------
+
+/** A picture, an embedded or linked OLE object, or an OCX form control. */
+class XclImpPictureObj : public XclImpRectObj, public XclImpControlHelper
+{
+public:
+ explicit XclImpPictureObj( const XclImpRoot& rRoot );
- /** Creates and returns a new SdrObject that contains the chart. Caller takes ownership! */
- SdrObject* CreateSdrObject( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const;
+ /** Returns the graphic imported from the IMGDATA record. */
+ inline const Graphic& GetGraphic() const { return maGraphic; }
+ /** Returns the visible area of the imported graphic. */
+ inline const Rectangle& GetVisArea() const { return maVisArea; }
+
+ /** Returns true, if the OLE object will be shown as symbol. */
+ inline bool IsSymbol() const { return mbSymbol; }
+ /** Returns the storage name for the OLE object. */
+ String GetOleStorageName() const;
+
+ /** Returns true, if this object is an OCX form control. */
+ inline bool IsOcxControl() const { return mbEmbedded && mbControl && mbUseCtlsStrm; }
+ /** Returns the position in the 'Ctls' stream for additional form control data. */
+ inline sal_Size GetCtlsStreamPos() const { return mnCtlsStrmPos; }
+ /** Returns the size in the 'Ctls' stream for additional form control data. */
+ inline sal_Size GetCtlsStreamSize() const { return mnCtlsStrmSize; }
protected:
- /** Returns the needed size on the progress bar. */
- virtual sal_Size DoGetProgressSize() const;
+ /** Reads the contents of the a BIFF3 OBJ record from the passed stream. */
+ virtual void DoReadObj3( XclImpStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the contents of the a BIFF4 OBJ record from the passed stream. */
+ virtual void DoReadObj4( XclImpStream& rStrm, sal_uInt16 nMacroSize );
+ /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
+ virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
+ /** Reads the contents of the specified subrecord of a BIFF8 OBJ record from stream. */
+ virtual void DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize );
+ /** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
+ virtual SdrObject* DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const;
+ /** Overloaded to do additional processing on the SdrObject. */
+ virtual void DoProcessSdrObj( SdrObject& rSdrObj ) const;
private:
- /** Calculates the object anchor of a sheet chart (chart fills one page). */
- void FinalizeTabChart();
+ /** Reads and sets the picture flags from a BIFF3-BIFF5 OBJ picture record. */
+ void ReadFlags3( XclImpStream& rStrm );
+ /** Reads the contents of the OBJFLAGS subrecord. */
+ void ReadFlags8( XclImpStream& rStrm );
+ /** Reads the contents of the OBJPICTFMLA subrecord. */
+ void ReadPictFmla( XclImpStream& rStrm, sal_uInt16 nLinkSize );
private:
- typedef ScfRef< XclImpChart > XclImpChartRef;
- typedef ScfRef< XclChLineFormat > XclChLineFmtRef;
- typedef ScfRef< XclChAreaFormat > XclChAreaFmtRef;
-
- XclImpChartRef mxChart; /// The chart itself (BOF/EOF substream data).
- XclChLineFmtRef mxLineFmt; /// Line formatting for chart frame (BIFF5).
- XclChAreaFmtRef mxAreaFmt; /// Area formatting for chart frame (BIFF5).
- bool mbOwnTab; /// true = own sheet; false = embedded object.
+ Graphic maGraphic; /// Picture or OLE placeholder graphic.
+ Rectangle maVisArea; /// Size of graphic.
+ String maClassName; /// Class name of embedded OLE object.
+ sal_uInt32 mnStorageId; /// Identifier of the storage for this object.
+ sal_Size mnCtlsStrmPos; /// Position in 'Ctls' stream for this control.
+ sal_Size mnCtlsStrmSize; /// Size in 'Ctls' stream for this control.
+ bool mbEmbedded; /// true = Embedded OLE object.
+ bool mbLinked; /// true = Linked OLE object.
+ bool mbSymbol; /// true = Show as symbol.
+ bool mbControl; /// true = Form control, false = OLE object.
+ bool mbUseCtlsStrm; /// true = Form control data in 'Ctls' stream, false = Own storage.
};
-// Escher stream conversion ===================================================
+// DFF stream conversion ======================================================
/** The solver container collects all connector rules for connected objects. */
class XclImpSolverContainer : public SvxMSDffSolverContainer
{
public:
/** Reads the entire solver container. Stream must point to begin of container header. */
- void ReadSolverContainer( SvStream& rEscherStrm );
+ void ReadSolverContainer( SvStream& rDffStrm );
- /** Inserts a new pointer to an SdrObject by the related shape ID. */
- void InsertSdrObjectInfo( const XclImpDrawObjBase& rDrawObj, SdrObject* pSdrObj );
- /** Removes a pointer to an SdrObject by the related shape ID. */
- void RemoveSdrObjectInfo( const XclImpDrawObjBase& rDrawObj );
+ /** Inserts information about a new SdrObject. */
+ void InsertSdrObjectInfo( SdrObject& rSdrObj, sal_uInt32 nDffShapeId, sal_uInt32 nDffFlags );
+ /** Removes inforamtion of an SdrObject (and all child objects if it is a group). */
+ void RemoveSdrObjectInfo( SdrObject& rSdrObj );
/** Inserts the SdrObject pointers into all connector rules. */
void UpdateConnectorRules();
@@ -403,95 +936,113 @@ private:
/** Returns the next connector rule from the internal list. */
SvxMSDffConnectorRule* GetNextRule();
/** Updates the data of a connected shape in a connector rule. */
- void UpdateConnection( sal_uInt32 nShapeId, SdrObject*& rpSdrObj, sal_uInt32* pnShapeFlags = 0 );
+ void UpdateConnection( sal_uInt32 nDffShapeId, SdrObject*& rpSdrObj, sal_uInt32* pnDffFlags = 0 );
private:
/** Stores data about an SdrObject processed during import. */
struct XclImpSdrInfo
{
SdrObject* mpSdrObj; /// Pointer to an SdrObject.
- sal_uInt32 mnShapeFlags; /// Shape flags from escher stream.
- inline explicit XclImpSdrInfo() : mpSdrObj( 0 ), mnShapeFlags( 0 ) {}
- inline void Set( SdrObject* pSdrObj, sal_uInt32 nShapeFlags )
- { mpSdrObj = pSdrObj; mnShapeFlags = nShapeFlags; }
+ sal_uInt32 mnDffFlags; /// Shape flags from DFF stream.
+ inline explicit XclImpSdrInfo() : mpSdrObj( 0 ), mnDffFlags( 0 ) {}
+ inline void Set( SdrObject* pSdrObj, sal_uInt32 nDffFlags )
+ { mpSdrObj = pSdrObj; mnDffFlags = nDffFlags; }
};
typedef ::std::map< sal_uInt32, XclImpSdrInfo > XclImpSdrInfoMap;
+ typedef ::std::map< SdrObject*, sal_uInt32 > XclImpSdrObjMap;
- XclImpSdrInfoMap maSdrInfoMap; /// Maps shape IDs to SdrObjects.
+ XclImpSdrInfoMap maSdrInfoMap; /// Maps shape IDs to SdrObjects and flags.
+ XclImpSdrObjMap maSdrObjMap; /// Maps SdrObjects to shape IDs.
};
// ----------------------------------------------------------------------------
class XclImpObjectManager;
-class XclImpOcxConverter;
+class SdrObjList;
-/** Derived from SvxMSDffManager, contains core implementation of Escher stream import. */
-class XclImpDffManager : public SvxMSDffManager, protected XclImpRoot
+/** Derived from SvxMSDffManager and SvxMSConvertOCXControls, contains core
+ implementation of DFF stream import and OCX form control import.
+ */
+class XclImpDffManager : protected SvxMSDffManager, protected SvxMSConvertOCXControls, protected XclImpRoot
{
public:
explicit XclImpDffManager(
const XclImpRoot& rRoot,
XclImpObjectManager& rObjManager,
- SvStream& rEscherStrm );
+ SvStream& rDffStrm );
virtual ~XclImpDffManager();
/** Initializes the internal progress bar with the passed size and starts it. */
void StartProgressBar( sal_Size nProgressSize );
- /** Processes the leading drawing group container in the Escher stream. */
- void ProcessDrawingGroup( SvStream& rEscherStrm );
- /** Processes a drawing container for a sheet in the Escher stream, converts all objects. */
- void ProcessDrawing( SvStream& rEscherStrm, sal_Size nStrmPos );
- /** Processes a chart from an Excel chart sheet, converts it to a chart object. */
- void ProcessTabChart( const XclImpChartObj& rChartObj );
+ /** Processes BIFF5 drawing objects without DFF data, inserts into the passed object list. */
+ void ProcessObject( SdrObjList* pObjList, const XclImpDrawObjBase& rDrawObj );
+ /** Processes the leading drawing group container in the DFF stream. */
+ void ProcessDrawingGroup( SvStream& rDffStrm );
+ /** Processes a drawing container for a sheet in the DFF stream, converts all objects. */
+ void ProcessDrawing( SvStream& rDffStrm, sal_Size nStrmPos );
+
+ /** Creates the SdrObject for the passed Excel TBX form control object. */
+ SdrObject* CreateSdrObject( const XclImpTbxObjBase& rTbxObj, const Rectangle& rAnchorRect );
+ /** Creates the SdrObject for the passed Excel OLE object or OCX form control object. */
+ SdrObject* CreateSdrObject( const XclImpPictureObj& rPicObj, const Rectangle& rAnchorRect );
+
+ /** Returns the default text margin in drawing layer units. */
+ inline sal_Int32 GetDefaultTextMargin() const { return mnDefTextMargin; }
/** Returns the used area in the sheet with the passed index. */
ScRange GetUsedArea( SCTAB nScTab ) const;
protected:
- /** Reads the client anchor from the Escher stream and sets it at the correct Escher object. */
+ // virtual functions of SvxMSDffManager
+
+ /** Reads the client anchor from the DFF stream and sets it at the correct object. */
virtual void ProcessClientAnchor2(
- SvStream& rEscherStrm,
+ SvStream& rDffStrm,
DffRecordHeader& rHeader,
void* pClientData,
DffObjData& rObjData );
- /** Processes an Escher object, reads properties from Escher stream. */
+ /** Processes an DFF object, reads properties from DFF stream. */
virtual SdrObject* ProcessObj(
- SvStream& rEscherStrm,
- DffObjData& rObjData,
+ SvStream& rDffStrm,
+ DffObjData& rDffObjData,
void* pClientData,
Rectangle& rTextRect,
SdrObject* pOldSdrObj = 0 );
- /** Returns the BLIP stream position, based on the passed Escher stream position. */
+ /** Returns the BLIP stream position, based on the passed DFF stream position. */
virtual ULONG Calc_nBLIPPos( ULONG nOrgVal, ULONG nStreamPos ) const;
/** Returns a color from the Excel color palette. */
virtual FASTBOOL GetColorFromPalette( USHORT nIndex, Color& rColor ) const;
+ // virtual functions of SvxMSConvertOCXControls
+
+ /** Inserts the passed control rxFComp into the form. Needs call to SetCurrentForm() before. */
+ virtual sal_Bool InsertControl(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::form::XFormComponent >& rxFormComp,
+ const ::com::sun::star::awt::Size& rSize,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::drawing::XShape >* pxShape,
+ BOOL bFloatingCtrl );
+
private:
/** Reads contents of a hyperlink property and returns the extracted URL. */
- ::rtl::OUString ReadHlinkProperty( SvStream& rEscherStrm ) const;
+ String ReadHlinkProperty( SvStream& rDffStrm ) const;
/** Processes a drawing group container (global drawing data). */
- void ProcessDggContainer( SvStream& rEscherStrm, const DffRecordHeader& rDggHeader );
+ void ProcessDggContainer( SvStream& rDffStrm, const DffRecordHeader& rDggHeader );
/** Processes a drawing container (all drawing data of a sheet). */
- void ProcessDgContainer( SvStream& rEscherStrm, const DffRecordHeader& rDgHeader );
+ void ProcessDgContainer( SvStream& rDffStrm, const DffRecordHeader& rDgHeader );
/** Processes the global shape group container (all shapes of a sheet). */
- void ProcessShGrContainer( SvStream& rEscherStrm, const DffRecordHeader& rShGrHeader );
+ void ProcessShGrContainer( SvStream& rDffStrm, const DffRecordHeader& rShGrHeader );
/** Processes the solver container (connectors of a sheet). */
- void ProcessSolverContainer( SvStream& rEscherStrm, const DffRecordHeader& rSolverHeader );
+ void ProcessSolverContainer( SvStream& rDffStrm, const DffRecordHeader& rSolverHeader );
/** Processes a shape or shape group container (one top-level shape). */
- void ProcessShContainer( SvStream& rEscherStrm, const DffRecordHeader& rShHeader );
+ void ProcessShContainer( SvStream& rDffStrm, const DffRecordHeader& rShHeader );
/** Inserts the passed SdrObject into the document. This function takes ownership of pSdrObj! */
- void InsertSdrObject( const XclImpDrawObjBase& rDrawObj, SdrObject* pSdrObj );
-
- /** Tries to create a custom SdrObject for specific object types. */
- SdrObject* CreateCustomSdrObject( XclImpDrawObjBase& rDrawObj, const Rectangle& rAnchorRect );
- /** Creates the SdrObject for the passed Excel OLE object. */
- SdrObject* CreateSdrObject( XclImpOleObj& rOleObj, const Rectangle& rAnchorRect );
- /** Creates the SdrObject for the passed Excel textbox control object. */
- SdrObject* CreateSdrObject( XclImpTbxControlObj& rTbxCtrlObj, const Rectangle& rAnchorRect );
- /** Creates the SdrObject for the passed Excel chart object. */
- SdrObject* CreateSdrObject( const XclImpChartObj& rChartObj, const Rectangle& rAnchorRect );
+ void InsertSdrObject( SdrObjList* pObjList, const XclImpDrawObjBase& rDrawObj, SdrObject* pSdrObj );
+ /** Stores the standard controls form for the passed sheet in mxCurrForm member. */
+ void SetCurrentForm( SCTAB nScTab );
/** Updates the used area of a sheet with the position and size of the passed object. */
void UpdateUsedArea( const XclImpDrawObjBase& rDrawObj );
@@ -499,14 +1050,18 @@ private:
private:
typedef ::std::map< SCTAB, ScRange > ScRangeMap;
typedef ScfRef< ScfProgressBar > ScfProgressBarRef;
- typedef ScfRef< XclImpOcxConverter > XclImpOcxConvRef;
XclImpObjectManager& mrObjManager; /// The Excel object manager.
XclImpSolverContainer maSolverCont; /// The solver container for connector rules.
+ SotStorageStreamRef mxCtlsStrm; /// The 'Ctls' stream for OCX form controls.
ScRangeMap maUsedAreaMap; /// Used ranges for all sheets.
ScfProgressBarRef mxProgress; /// The progress bar used in ProcessObj().
- XclImpOcxConvRef mxOcxConverter; /// The form controls converter.
+ ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >
+ mxCurrForm; /// Controls form of current sheet (needed in virtual functions).
sal_uInt32 mnOleImpFlags; /// Application OLE import settings.
+ sal_Int32 mnDefTextMargin; /// Default margin in text boxes.
+ sal_Int32 mnLastCtrlIndex; /// Last insertion index of a form control (for macro events).
+ SCTAB mnCurrFormScTab; /// Sheet index of form stored in mxCurrForm.
};
// The object manager =========================================================
@@ -520,9 +1075,11 @@ public:
// *** Read Excel records *** ---------------------------------------------
- /** Reads the OBJ record (BIFF5 only). */
- void ReadObj5( XclImpStream& rStrm );
+ /** Reads and returns a bitmap from the IMGDATA record. */
+ static Graphic ReadImgData( XclImpStream& rStrm );
+ /** Reads a plain OBJ record (without leading DFF data). */
+ void ReadObj( XclImpStream& rStrm );
/** Reads the MSODRAWINGGROUP record. */
void ReadMsoDrawingGroup( XclImpStream& rStrm );
/** Reads the MSODRAWING or MSODRAWINGSELECTION record. */
@@ -536,74 +1093,88 @@ public:
// *** Drawing objects *** ------------------------------------------------
- /** Finds the OBJ record data related to the Escher shape at the passed position. */
+ /** Finds the OBJ record data related to the DFF shape at the passed position. */
XclImpDrawObjRef FindDrawObj( const DffRecordHeader& rHeader ) const;
/** Finds the OBJ record data specified by the passed object identifier. */
XclImpDrawObjRef FindDrawObj( const XclObjId& rObjId ) const;
- /** Finds the TXO record data related to the Escher shape at the passed position. */
- XclImpTxoDataRef FindTxoData( const DffRecordHeader& rHeader ) const;
+ /** Finds the textbox data related to the DFF shape at the passed position. */
+ const XclImpObjTextData* FindTextData( const DffRecordHeader& rHeader ) const;
- /** Sets the object with the passed identification to be ignored on import. */
- void SetInvalidObj( SCTAB nScTab, sal_uInt16 nObjId );
+ /** Sets the object with the passed identification to be skipped on import. */
+ void SetSkipObj( SCTAB nScTab, sal_uInt16 nObjId );
// *** Drawing object conversion *** --------------------------------------
- /** Returns the DFF manager (Escher stream converter). Don't call before the Escher stream is read. */
+ /** Returns the DFF manager (DFF stream converter). Don't call before the DFF stream is read. */
XclImpDffManager& GetDffManager();
/** Inserts all objects into the Calc document. */
void ConvertObjects();
+ /** Returns the default name for the passed object. */
+ String GetDefaultObjName( const XclImpDrawObjBase& rDrawObj ) const;
/** Returns the used area in the sheet with the passed index. */
ScRange GetUsedArea( SCTAB nScTab ) const;
// ------------------------------------------------------------------------
private:
- /** Reads contents of an Escher record and append data to internal Escher stream. */
- void ReadEscherRecord( XclImpStream& rStrm );
+ /** Reads and returns a bitmap from WMF/PICT format. */
+ static void ReadWmf( Graphic& rGraphic, XclImpStream& rStrm );
+ /** Reads and returns a bitmap from BMP format. */
+ static void ReadBmp( Graphic& rGraphic, XclImpStream& rStrm );
+
+ /** Reads contents of an DFF record and append data to internal DFF stream. */
+ void ReadDffRecord( XclImpStream& rStrm );
/** Reads a BIFF8 OBJ record following an MSODRAWING record. */
void ReadObj8( XclImpStream& rStrm );
- /** Reads the TXO record. */
+ /** Reads the TXO record and following CONTINUE records containing string and formatting. */
void ReadTxo( XclImpStream& rStrm );
- /** Tries to start a complete chart substream by checking if next record is a BOF. */
- bool StartChartSubStream( XclImpStream& rStrm );
+ /** Reads a BIFF3-BIFF5 NOTE record. */
+ void ReadNote3( XclImpStream& rStrm );
+ /** Reads a BIFF8 NOTE record. */
+ void ReadNote8( XclImpStream& rStrm );
/** Returns the size of the progress bar shown while processing all objects. */
sal_Size GetProgressSize() const;
// ------------------------------------------------------------------------
private:
- typedef ::std::vector< sal_Size > StreamPosVec;
typedef ::std::map< sal_Size, XclImpDrawObjRef > XclImpObjMap;
typedef ::std::map< XclObjId, XclImpDrawObjRef > XclImpObjMapById;
- typedef ::std::map< sal_Size, XclImpTxoDataRef > XclImpTxoMap;
- typedef ScfRef< XclImpChartObj > XclImpChartObjRef;
- typedef ::std::list< XclImpChartObjRef > XclImpChartObjList;
- typedef ScfRef< XclImpDffManager > XclImpDffMgrRef;
+ typedef ScfRef< XclImpObjTextData > XclImpObjTextRef;
+ typedef ::std::map< sal_Size, XclImpObjTextRef > XclImpObjTextMap;
typedef ::std::vector< XclObjId > XclObjIdVec;
- SvMemoryStream maEscherStrm; /// Copy of Escher stream in memory.
- StreamPosVec maTabStrmPos; /// Start positions of Escher data for sheets.
- XclImpObjMap maObjMap; /// Maps drawing objects to Escher stream position.
- XclImpObjMapById maObjMapId; /// Maps drawing objects to sheet index and object ID.
- XclImpTxoMap maTxoMap; /// Maps TXO textbox data to sheet index and object ID.
- XclImpChartObjList maTabCharts; /// Charts imported from Excel chart sheets.
- XclImpDffMgrRef mxDffManager; /// The Escher stream converter.
- XclObjIdVec maInvalidObjs; /// All Escher objects to skip.
+ typedef ::std::map< sal_uInt16, String > DefObjNameMap;
+ typedef ::std::vector< sal_Size > StreamPosVec;
+ typedef ScfRef< XclImpDffManager > XclImpDffMgrRef;
+
+ XclImpDrawObjVector maRawObjs; /// BIFF5 objects without DFF data.
+ XclImpObjMap maObjMap; /// Maps BIFF8 drawing objects to DFF stream position.
+ XclImpObjMapById maObjMapId; /// Maps BIFF8 drawing objects to sheet index and object ID.
+ XclImpObjTextMap maTextMap; /// Maps BIFF8 TXO textbox data to DFF stream position.
+ XclObjIdVec maSkipObjs; /// All objects to be skipped.
+
+ DefObjNameMap maDefObjNames; /// Default base names for all object types.
+ SvMemoryStream maDffStrm; /// Copy of DFF stream in memory.
+ StreamPosVec maTabStrmPos; /// Start positions of DFF stream fragments for all sheets.
+ XclImpDffMgrRef mxDffManager; /// The DFF stream converter.
};
-// Escher property set helper =================================================
+// DFF property set helper ====================================================
+
+/** This class reads an DFF property set (msofbtOPT record).
-/** This class reads an Escher property set (msofbtOPT record).
- @descr It can return separate property values or an item set which contains
- items translated from these properties. */
-class XclImpEscherPropSet : protected XclImpRoot
+ It can return separate property values or an item set which contains items
+ translated from these properties.
+ */
+class XclImpDffPropSet : protected XclImpRoot
{
public:
- explicit XclImpEscherPropSet( const XclImpRoot& rRoot );
+ explicit XclImpDffPropSet( const XclImpRoot& rRoot );
- /** Reads an Escher property set from the stream.
- @descr The stream must point to the start of an Escher record containing properties. */
+ /** Reads an DFF property set from the stream.
+ @descr The stream must point to the start of an DFF record containing properties. */
void Read( XclImpStream& rStrm );
/** Returns the specified property or the default value, if not extant. */
@@ -615,12 +1186,12 @@ public:
private:
typedef ::std::auto_ptr< SvMemoryStream > SvMemoryStreamPtr;
- XclImpObjectManager maObjManager; /// Local object manager, contains SVX DFF manager.
- XclImpDffManager& mrDffManager; /// Reference to DFF manager contained in object manager.
+ SvMemoryStream maDummyStrm; /// Dummy stream for DFF manager.
+ SvxMSDffManager maDffManager; /// DFF manager.
SvMemoryStreamPtr mxMemStrm; /// Helper stream.
};
-XclImpStream& operator>>( XclImpStream& rStrm, XclImpEscherPropSet& rPropSet );
+XclImpStream& operator>>( XclImpStream& rStrm, XclImpDffPropSet& rPropSet );
// ============================================================================
diff --git a/sc/source/filter/inc/xipage.hxx b/sc/source/filter/inc/xipage.hxx
index 780cf08f3cf0..3b052418b945 100644
--- a/sc/source/filter/inc/xipage.hxx
+++ b/sc/source/filter/inc/xipage.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xipage.hxx,v $
- * $Revision: 1.8 $
+ * $Revision: 1.7.90.2 $
*
* This file is part of OpenOffice.org.
*
@@ -63,8 +63,8 @@ public:
void ReadPrintHeaders( XclImpStream& rStrm );
/** Reads a PRINTGRIDLINES record. */
void ReadPrintGridLines( XclImpStream& rStrm );
- /** Reads a BITMAP record and creates the SvxBrushItem. */
- void ReadBitmap( XclImpStream& rStrm );
+ /** Reads an IMGDATA record and creates the SvxBrushItem. */
+ void ReadImgData( XclImpStream& rStrm );
/** Overrides paper size and orientation (used in sheet-charts). */
void SetPaperSize( sal_uInt16 nXclPaperSize, bool bPortrait );
diff --git a/sc/source/filter/inc/xiroot.hxx b/sc/source/filter/inc/xiroot.hxx
index 6f2e8ec309b7..dfa2ca030efe 100644
--- a/sc/source/filter/inc/xiroot.hxx
+++ b/sc/source/filter/inc/xiroot.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xiroot.hxx,v $
- * $Revision: 1.22 $
+ * $Revision: 1.22.88.1 $
*
* This file is part of OpenOffice.org.
*
diff --git a/sc/source/filter/inc/xistring.hxx b/sc/source/filter/inc/xistring.hxx
index 2f96d830bebd..66bc88515d8c 100644
--- a/sc/source/filter/inc/xistring.hxx
+++ b/sc/source/filter/inc/xistring.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xistring.hxx,v $
- * $Revision: 1.4 $
+ * $Revision: 1.4.90.1 $
*
* This file is part of OpenOffice.org.
*
@@ -61,6 +61,8 @@ public:
inline void ReadFormats( XclImpStream& rStrm ) { ReadFormats( rStrm, maFormats ); }
/** Reads and appends nRunCount formatting runs from stream. */
inline void ReadFormats( XclImpStream& rStrm, sal_uInt16 nRunCount ) { ReadFormats( rStrm, maFormats, nRunCount ); }
+ /** Reads and appends formatting runs from an OBJ or TXO record. */
+ inline void ReadObjFormats( XclImpStream& rStrm, sal_uInt16 nFormatSize ) { ReadObjFormats( rStrm, maFormats, nFormatSize ); }
/** Returns true, if the string is empty. */
inline bool IsEmpty() const { return maString.Len() == 0; }
@@ -78,6 +80,8 @@ public:
static void ReadFormats( XclImpStream& rStrm, XclFormatRunVec& rFormats );
/** Reads and appends nRunCount formatting runs from stream. */
static void ReadFormats( XclImpStream& rStrm, XclFormatRunVec& rFormats, sal_uInt16 nRunCount );
+ /** Reads and appends formatting runs from an OBJ or TXO record. */
+ static void ReadObjFormats( XclImpStream& rStrm, XclFormatRunVec& rFormats, sal_uInt16 nFormatSize );
private:
String maString; /// The text data of the string.
diff --git a/sc/source/filter/inc/xistyle.hxx b/sc/source/filter/inc/xistyle.hxx
index 3f6f736aa63d..fe43aa75c331 100644
--- a/sc/source/filter/inc/xistyle.hxx
+++ b/sc/source/filter/inc/xistyle.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xistyle.hxx,v $
- * $Revision: 1.23 $
+ * $Revision: 1.23.90.2 $
*
* This file is part of OpenOffice.org.
*
@@ -55,6 +55,9 @@ class XclImpPalette : public XclDefaultPalette
public:
explicit XclImpPalette( const XclImpRoot& rRoot );
+ /** Clears all buffered data, used to set up for a new sheet. */
+ void Initialize();
+
/** Returns the RGB color data for a (non-zero-based) Excel palette entry.
@descr First looks for a color read from file, then looks for a default color.
@return The color from current or default palette or COL_AUTO, if nothing else found. */
@@ -88,9 +91,13 @@ public:
/** Sets all font attributes to used or unused. */
void SetAllUsedFlags( bool bUsed );
+ /** Sets the passed font data and all used flags to 'used'. */
+ void SetFontData( const XclFontData& rFontData, bool bHasCharSet );
/** Returns read-only access to font data. */
inline const XclFontData& GetFontData() const { return maData; }
+ /** Returns true, if the font character set is valid. */
+ inline bool HasCharSet() const { return mbHasCharSet; }
/** Returns true, if the font contains superscript or subscript. */
inline bool HasEscapement() const { return maData.mnEscapem != EXC_FONTESC_NONE; }
/** Returns the text encoding for strings used with this font. */
@@ -165,9 +172,11 @@ class XclImpFontBuffer : protected XclImpRoot, ScfNoCopy
public:
explicit XclImpFontBuffer( const XclImpRoot& rRoot );
+ /** Clears all buffered data, used to set up for a new sheet. */
+ void Initialize();
+
/** Returns the object that stores all contents of a FONT record. */
- inline const XclImpFont* GetFont( sal_uInt16 nFontIndex ) const
- { return maFontList.GetObject( nFontIndex ); }
+ const XclImpFont* GetFont( sal_uInt16 nFontIndex ) const;
/** Returns the application font data of this file, needed i.e. for column width. */
inline const XclFontData& GetAppFontData() const { return maAppFont; }
@@ -188,10 +197,18 @@ public:
void WriteFontProperties(
ScfPropertySet& rPropSet, XclFontPropSetType eType,
sal_uInt16 nFontIdx, const Color* pFontColor = 0 ) const;
+ /** Writes default font properties for form controls to the passed property set. */
+ void WriteDefaultCtrlFontProperties( ScfPropertySet& rPropSet ) const;
+
+private:
+ /** Updates the application default font. */
+ void UpdateAppFont( const XclFontData& rFontData, bool bHasCharSet );
private:
ScfDelList< XclImpFont > maFontList; /// List of all FONT records in the Excel file.
XclFontData maAppFont; /// Application font (for column width).
+ XclImpFont maFont4; /// Built-in font with index 4.
+ XclImpFont maCtrlFont; /// BIFF5 default form controls font (Helv,8pt,bold).
};
// FORMAT record - number formats =============================================
@@ -202,6 +219,9 @@ class XclImpNumFmtBuffer : public XclNumFmtBuffer, protected XclImpRoot
public:
explicit XclImpNumFmtBuffer( const XclImpRoot& rRoot );
+ /** Clears all buffered data, used to set up for a new sheet. */
+ void Initialize();
+
/** Reads a FORMAT record. */
void ReadFormat( XclImpStream& rStrm );
/** Creates the number formats in the Calc document. */
@@ -452,6 +472,9 @@ class XclImpXFBuffer : protected XclImpRoot, ScfNoCopy
public:
explicit XclImpXFBuffer( const XclImpRoot& rRoot );
+ /** Clears all buffered data, used to set up for a new sheet. */
+ void Initialize();
+
/** Reads an XF record. */
void ReadXF( XclImpStream& rStrm );
/** Reads a STYLE record. */
diff --git a/sc/source/filter/inc/xlchart.hxx b/sc/source/filter/inc/xlchart.hxx
index 50f8ea5d42f3..5e01ecfaf1fc 100644
--- a/sc/source/filter/inc/xlchart.hxx
+++ b/sc/source/filter/inc/xlchart.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xlchart.hxx,v $
- * $Revision: 1.15 $
+ * $Revision: 1.14.62.3 $
*
* This file is part of OpenOffice.org.
*
@@ -51,6 +51,7 @@ namespace com { namespace sun { namespace star {
#define SERVICE_DRAWING_BITMAPTABLE CREATE_OUSTRING( "com.sun.star.drawing.BitmapTable" )
#define SERVICE_DRAWING_DASHTABLE CREATE_OUSTRING( "com.sun.star.drawing.DashTable" )
#define SERVICE_DRAWING_GRADIENTTABLE CREATE_OUSTRING( "com.sun.star.drawing.GradientTable" )
+#define SERVICE_DRAWING_HATCHTABLE CREATE_OUSTRING( "com.sun.star.drawing.HatchTable" )
#define SERVICE_CHART2_AXIS CREATE_OUSTRING( "com.sun.star.chart2.Axis" )
#define SERVICE_CHART2_CARTESIANCOORDSYS2D CREATE_OUSTRING( "com.sun.star.chart2.CartesianCoordinateSystem2d" )
@@ -187,7 +188,7 @@ const sal_uInt16 EXC_CHSERIES_INVALID = 0xFFFF; /// Invalid series i
const sal_uInt16 EXC_ID_CHDATAFORMAT = 0x1006;
-const sal_uInt16 EXC_CHDATAFORMAT_MAXPOINT = 31999; /// Maximum valid point index.
+const sal_uInt16 EXC_CHDATAFORMAT_MAXPOINTCOUNT = 32000; /// Maximum number of data points.
const sal_uInt16 EXC_CHDATAFORMAT_DEFAULT = 0xFFFD; /// As format index: global default for an axes set.
const sal_uInt16 EXC_CHDATAFORMAT_UNKNOWN = 0xFFFE; /// As point index: unknown format, don't use.
const sal_uInt16 EXC_CHDATAFORMAT_ALLPOINTS = 0xFFFF; /// As point index: default for a series.
@@ -1269,6 +1270,7 @@ public:
XclChEscherFormat& rEscherFmt,
XclChPicFormat& rPicFmt,
XclChObjectTable& rGradientTable,
+ XclChObjectTable& rHatchTable,
XclChObjectTable& rBitmapTable,
const ScfPropertySet& rPropSet,
XclChPropertyMode ePropMode );
@@ -1300,6 +1302,7 @@ public:
void WriteEscherProperties(
ScfPropertySet& rPropSet,
XclChObjectTable& rGradientTable,
+ XclChObjectTable& rHatchTable,
XclChObjectTable& rBitmapTable,
const XclChEscherFormat& rEscherFmt,
const XclChPicFormat& rPicFmt,
@@ -1324,6 +1327,8 @@ private:
ScfPropSetHelper& GetAreaHelper( XclChPropertyMode ePropMode );
/** Returns a gradient property set helper according to the passed property mode. */
ScfPropSetHelper& GetGradientHelper( XclChPropertyMode ePropMode );
+ /** Returns a hatch property set helper according to the passed property mode. */
+ ScfPropSetHelper& GetHatchHelper( XclChPropertyMode ePropMode );
private:
ScfPropSetHelper maLineHlpCommon; /// Properties for lines in common objects.
@@ -1333,6 +1338,8 @@ private:
ScfPropSetHelper maAreaHlpFilled; /// Properties for areas in filled series.
ScfPropSetHelper maGradHlpCommon; /// Properties for gradients in common objects.
ScfPropSetHelper maGradHlpFilled; /// Properties for gradients in filled series.
+ ScfPropSetHelper maHatchHlpCommon; /// Properties for hatches in common objects.
+ ScfPropSetHelper maHatchHlpFilled; /// Properties for hatches in filled series.
ScfPropSetHelper maBitmapHlp; /// Properties for bitmaps.
ScfPropSetHelper maRotationHlp; /// Properties for text rotation.
ScfPropSetHelper maLegendHlp; /// Properties for legend.
@@ -1360,6 +1367,7 @@ public:
inline XclChObjectTable& GetLineDashTable() const { return *mxLineDashTable; }
inline XclChObjectTable& GetGradientTable() const { return *mxGradientTable; }
+ inline XclChObjectTable& GetHatchTable() const { return *mxHatchTable; }
inline XclChObjectTable& GetBitmapTable() const { return *mxBitmapTable; }
/** Starts the API chart document conversion. Must be called once before any API access. */
@@ -1377,6 +1385,7 @@ private:
XclChFmtInfoProvRef mxFmtInfoProv; /// Provides info about auto formatting.
XclChObjectTableRef mxLineDashTable; /// Container for line dash styles.
XclChObjectTableRef mxGradientTable; /// Container for gradient fill styles.
+ XclChObjectTableRef mxHatchTable; /// Container for hatch fill styles.
XclChObjectTableRef mxBitmapTable; /// Container for bitmap fill styles.
};
diff --git a/sc/source/filter/inc/xlescher.hxx b/sc/source/filter/inc/xlescher.hxx
index 921cbf99c94b..97fb5674bb2d 100644
--- a/sc/source/filter/inc/xlescher.hxx
+++ b/sc/source/filter/inc/xlescher.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xlescher.hxx,v $
- * $Revision: 1.22 $
+ * $Revision: 1.22.90.12 $
*
* This file is part of OpenOffice.org.
*
@@ -34,12 +34,22 @@
#include <vcl/mapunit.hxx>
#include "fapihelper.hxx"
#include "xladdress.hxx"
+#include "xlstyle.hxx"
-// Constants and Enumerations =================================================
+namespace com { namespace sun { namespace star {
+ namespace drawing { class XShape; }
+ namespace awt { class XControlModel; }
+ namespace script { struct ScriptEventDescriptor; }
+} } }
-// misc -----------------------------------------------------------------------
+class SdrObject;
+class Rectangle;
+class ScDocument;
+class SvStream;
+class XclImpStream;
+class XclExpStream;
-const long EXC_ESCHER_AUTOMARGIN = 20000; /// Automatic text margin.
+// Constants and Enumerations =================================================
// (0x001C) NOTE --------------------------------------------------------------
@@ -51,87 +61,191 @@ const sal_uInt16 EXC_NOTE5_MAXLEN = 2048;
const sal_uInt16 EXC_ID_OBJ = 0x005D;
-const sal_uInt16 EXC_OBJ_INVALID_ID = 0x0000;
-
-// sub records
-const sal_uInt16 EXC_ID_OBJ_FTEND = 0x0000; /// End of OBJ.
-const sal_uInt16 EXC_ID_OBJ_FTMACRO = 0x0004; /// Macro link.
-const sal_uInt16 EXC_ID_OBJ_FTGMO = 0x0006; /// Group marker.
-const sal_uInt16 EXC_ID_OBJ_FTCF = 0x0007; /// Clipboard format.
-const sal_uInt16 EXC_ID_OBJ_FTPIOGRBIT = 0x0008; /// Option flags.
-const sal_uInt16 EXC_ID_OBJ_FTPICTFMLA = 0x0009; /// OLE link formula.
-const sal_uInt16 EXC_ID_OBJ_FTCBLS = 0x000A; /// Check box/radio button data.
-const sal_uInt16 EXC_ID_OBJ_FTSBS = 0x000C; /// Scroll bar data.
-const sal_uInt16 EXC_ID_OBJ_FTSBSFMLA = 0x000E; /// Scroll bar/list box/combo box cell link.
-const sal_uInt16 EXC_ID_OBJ_FTGBODATA = 0x000F; /// Group box data.
-const sal_uInt16 EXC_ID_OBJ_FTLBSDATA = 0x0013; /// List box/combo box data.
-const sal_uInt16 EXC_ID_OBJ_FTCBLSFMLA = 0x0014; /// Check box/radio button cell link.
-const sal_uInt16 EXC_ID_OBJ_FTCMO = 0x0015; /// Common object settings.
-const sal_uInt16 EXC_ID_OBJ_FTUNKNOWN = 0xFFFF; /// For internal use only.
-
-// ftCmo: object types
-const sal_uInt16 EXC_OBJ_CMO_GROUP = 0x0000;
-const sal_uInt16 EXC_OBJ_CMO_LINE = 0x0001;
-const sal_uInt16 EXC_OBJ_CMO_RECTANGLE = 0x0002;
-const sal_uInt16 EXC_OBJ_CMO_ELLIPSE = 0x0003;
-const sal_uInt16 EXC_OBJ_CMO_ARC = 0x0004;
-const sal_uInt16 EXC_OBJ_CMO_CHART = 0x0005;
-const sal_uInt16 EXC_OBJ_CMO_TEXT = 0x0006;
-const sal_uInt16 EXC_OBJ_CMO_BUTTON = 0x0007;
-const sal_uInt16 EXC_OBJ_CMO_PICTURE = 0x0008;
-const sal_uInt16 EXC_OBJ_CMO_POLYGON = 0x0009;
-const sal_uInt16 EXC_OBJ_CMO_CHECKBOX = 0x000B;
-const sal_uInt16 EXC_OBJ_CMO_OPTIONBUTTON = 0x000C;
-const sal_uInt16 EXC_OBJ_CMO_EDIT = 0x000D;
-const sal_uInt16 EXC_OBJ_CMO_LABEL = 0x000E;
-const sal_uInt16 EXC_OBJ_CMO_DIALOG = 0x000F;
-const sal_uInt16 EXC_OBJ_CMO_SPIN = 0x0010;
-const sal_uInt16 EXC_OBJ_CMO_SCROLLBAR = 0x0011;
-const sal_uInt16 EXC_OBJ_CMO_LISTBOX = 0x0012;
-const sal_uInt16 EXC_OBJ_CMO_GROUPBOX = 0x0013;
-const sal_uInt16 EXC_OBJ_CMO_COMBOBOX = 0x0014;
-const sal_uInt16 EXC_OBJ_CMO_NOTE = 0x0019;
-const sal_uInt16 EXC_OBJ_CMO_DRAWING = 0x001E;
-const sal_uInt16 EXC_OBJ_CMO_UNKNOWN = 0xFFFF; /// For internal use only.
-
-// ftCmo: flags
-const sal_uInt16 EXC_OBJ_CMO_PRINTABLE = 0x0010; /// Object printable
-
-// ftPioGrbit: flags
-const sal_uInt16 EXC_OBJ_PIO_MANUALSIZE = 0x0001;
-const sal_uInt16 EXC_OBJ_PIO_LINKED = 0x0002;
-const sal_uInt16 EXC_OBJ_PIO_SYMBOL = 0x0008;
-const sal_uInt16 EXC_OBJ_PIO_CONTROL = 0x0010; /// Form control.
-const sal_uInt16 EXC_OBJ_PIO_CTLSSTREAM = 0x0020; /// Data in Ctls stream.
-const sal_uInt16 EXC_OBJ_PIO_AUTOLOAD = 0x0200;
-
-// ftCbls: Check box/radio button data
-const sal_uInt16 EXC_OBJ_CBLS_STATEMASK = 0x0003;
-const sal_uInt16 EXC_OBJ_CBLS_STATE_UNCHECK = 0x0000;
-const sal_uInt16 EXC_OBJ_CBLS_STATE_CHECK = 0x0001;
-const sal_uInt16 EXC_OBJ_CBLS_STATE_TRI = 0x0002;
-const sal_uInt16 EXC_OBJ_CBLS_FLAT = 0x0001;
-
-// ftGboData: Group box data
-const sal_uInt16 EXC_OBJ_GBO_FLAT = 0x0001;
-
-// ftLbsData: List box data
-const sal_uInt16 EXC_OBJ_LBS_SELMASK = 0x0030; /// Mask for selection type.
-const sal_uInt16 EXC_OBJ_LBS_SEL_SIMPLE = 0x0000; /// Simple selection.
-const sal_uInt16 EXC_OBJ_LBS_SEL_MULTI = 0x0010; /// Multi selection.
-const sal_uInt16 EXC_OBJ_LBS_SEL_EXT = 0x0020; /// Extended selection.
-const sal_uInt16 EXC_OBJ_LBS_FLAT = 0x0008;
-const sal_uInt16 EXC_OBJ_LBS_COMBOMASK = 0x0003; /// Mask for combobox style.
-const sal_uInt16 EXC_OBJ_LBS_COMBO_STD = 0x0000; /// Standard combo box.
-const sal_uInt16 EXC_OBJ_LBS_COMBO_SIMPLE = 0x0002; /// Simple dropdown without field.
-const sal_uInt16 EXC_OBJ_LBS_FILTERED = 0x0008; /// Drowdown style: filtered.
-
-// ftSbs: Spin button/scrollbar data
-const sal_uInt16 EXC_OBJ_SBS_HORIZONTAL = 0x0001;
-const sal_uInt16 EXC_OBJ_SBS_DEFAULTFLAGS = 0x0001;
-const sal_uInt16 EXC_OBJ_SBS_FLAT = 0x0008;
-const sal_Int16 EXC_OBJ_SBS_MINSCROLL = 0;
-const sal_Int16 EXC_OBJ_SBS_MAXSCROLL = 30000;
+const sal_uInt16 EXC_OBJ_INVALID_ID = 0;
+
+// object types
+const sal_uInt16 EXC_OBJTYPE_GROUP = 0;
+const sal_uInt16 EXC_OBJTYPE_LINE = 1;
+const sal_uInt16 EXC_OBJTYPE_RECTANGLE = 2;
+const sal_uInt16 EXC_OBJTYPE_OVAL = 3;
+const sal_uInt16 EXC_OBJTYPE_ARC = 4;
+const sal_uInt16 EXC_OBJTYPE_CHART = 5;
+const sal_uInt16 EXC_OBJTYPE_TEXT = 6;
+const sal_uInt16 EXC_OBJTYPE_BUTTON = 7;
+const sal_uInt16 EXC_OBJTYPE_PICTURE = 8;
+const sal_uInt16 EXC_OBJTYPE_POLYGON = 9; // new in BIFF4
+const sal_uInt16 EXC_OBJTYPE_CHECKBOX = 11; // new in BIFF5
+const sal_uInt16 EXC_OBJTYPE_OPTIONBUTTON = 12;
+const sal_uInt16 EXC_OBJTYPE_EDIT = 13;
+const sal_uInt16 EXC_OBJTYPE_LABEL = 14;
+const sal_uInt16 EXC_OBJTYPE_DIALOG = 15;
+const sal_uInt16 EXC_OBJTYPE_SPIN = 16;
+const sal_uInt16 EXC_OBJTYPE_SCROLLBAR = 17;
+const sal_uInt16 EXC_OBJTYPE_LISTBOX = 18;
+const sal_uInt16 EXC_OBJTYPE_GROUPBOX = 19;
+const sal_uInt16 EXC_OBJTYPE_DROPDOWN = 20;
+const sal_uInt16 EXC_OBJTYPE_NOTE = 25; // new in BIFF8
+const sal_uInt16 EXC_OBJTYPE_DRAWING = 30;
+const sal_uInt16 EXC_OBJTYPE_UNKNOWN = 0xFFFF; /// For internal use only.
+
+// BIFF3-BIFF5 flags
+const sal_uInt16 EXC_OBJ_HIDDEN = 0x0100;
+const sal_uInt16 EXC_OBJ_VISIBLE = 0x0200;
+const sal_uInt16 EXC_OBJ_PRINTABLE = 0x0400;
+
+// BIFF5 line formatting
+const sal_uInt8 EXC_OBJ_LINE_AUTOCOLOR = 64;
+
+const sal_uInt8 EXC_OBJ_LINE_SOLID = 0;
+const sal_uInt8 EXC_OBJ_LINE_DASH = 1;
+const sal_uInt8 EXC_OBJ_LINE_DOT = 2;
+const sal_uInt8 EXC_OBJ_LINE_DASHDOT = 3;
+const sal_uInt8 EXC_OBJ_LINE_DASHDOTDOT = 4;
+const sal_uInt8 EXC_OBJ_LINE_MEDTRANS = 5;
+const sal_uInt8 EXC_OBJ_LINE_DARKTRANS = 6;
+const sal_uInt8 EXC_OBJ_LINE_LIGHTTRANS = 7;
+const sal_uInt8 EXC_OBJ_LINE_NONE = 255;
+
+const sal_uInt8 EXC_OBJ_LINE_HAIR = 0;
+const sal_uInt8 EXC_OBJ_LINE_THIN = 1;
+const sal_uInt8 EXC_OBJ_LINE_MEDIUM = 2;
+const sal_uInt8 EXC_OBJ_LINE_THICK = 3;
+
+const sal_uInt8 EXC_OBJ_LINE_AUTO = 0x01;
+
+const sal_uInt8 EXC_OBJ_ARROW_NONE = 0;
+const sal_uInt8 EXC_OBJ_ARROW_OPEN = 1;
+const sal_uInt8 EXC_OBJ_ARROW_FILLED = 2;
+const sal_uInt8 EXC_OBJ_ARROW_OPENBOTH = 3;
+const sal_uInt8 EXC_OBJ_ARROW_FILLEDBOTH = 4;
+
+const sal_uInt8 EXC_OBJ_ARROW_NARROW = 0;
+const sal_uInt8 EXC_OBJ_ARROW_MEDIUM = 1;
+const sal_uInt8 EXC_OBJ_ARROW_WIDE = 2;
+
+const sal_uInt8 EXC_OBJ_LINE_TL = 0;
+const sal_uInt8 EXC_OBJ_LINE_TR = 1;
+const sal_uInt8 EXC_OBJ_LINE_BR = 2;
+const sal_uInt8 EXC_OBJ_LINE_BL = 3;
+
+// BIFF5 fill formatting
+const sal_uInt8 EXC_OBJ_FILL_AUTOCOLOR = 65;
+
+const sal_uInt8 EXC_OBJ_FILL_AUTO = 0x01;
+
+// BIFF5 frame formatting
+const sal_uInt16 EXC_OBJ_FRAME_SHADOW = 0x0002;
+
+// BIFF5 text objects
+const sal_uInt8 EXC_OBJ_HOR_LEFT = 1;
+const sal_uInt8 EXC_OBJ_HOR_CENTER = 2;
+const sal_uInt8 EXC_OBJ_HOR_RIGHT = 3;
+const sal_uInt8 EXC_OBJ_HOR_JUSTIFY = 4;
+
+const sal_uInt8 EXC_OBJ_VER_TOP = 1;
+const sal_uInt8 EXC_OBJ_VER_CENTER = 2;
+const sal_uInt8 EXC_OBJ_VER_BOTTOM = 3;
+const sal_uInt8 EXC_OBJ_VER_JUSTIFY = 4;
+
+const sal_uInt16 EXC_OBJ_ORIENT_NONE = 0;
+const sal_uInt16 EXC_OBJ_ORIENT_STACKED = 1; /// Stacked top to bottom.
+const sal_uInt16 EXC_OBJ_ORIENT_90CCW = 2; /// 90 degr. counterclockwise.
+const sal_uInt16 EXC_OBJ_ORIENT_90CW = 3; /// 90 degr. clockwise.
+
+const sal_uInt16 EXC_OBJ_TEXT_AUTOSIZE = 0x0080;
+const sal_uInt16 EXC_OBJ_TEXT_LOCKED = 0x0200;
+
+const sal_Int32 EXC_OBJ_TEXT_MARGIN = 20000; /// Automatic text margin (EMUs).
+
+// BIFF5 arc objects
+const sal_uInt8 EXC_OBJ_ARC_TR = 0;
+const sal_uInt8 EXC_OBJ_ARC_TL = 1;
+const sal_uInt8 EXC_OBJ_ARC_BL = 2;
+const sal_uInt8 EXC_OBJ_ARC_BR = 3;
+
+// BIFF5 polygon objects
+const sal_uInt16 EXC_OBJ_POLY_CLOSED = 0x0100;
+
+// BIFF5 pictures/OLE objects
+const sal_uInt16 EXC_OBJ_PIC_MANUALSIZE = 0x0001;
+const sal_uInt16 EXC_OBJ_PIC_DDE = 0x0002;
+const sal_uInt16 EXC_OBJ_PIC_SYMBOL = 0x0008;
+const sal_uInt16 EXC_OBJ_PIC_CONTROL = 0x0010; /// Form control (BIFF8).
+const sal_uInt16 EXC_OBJ_PIC_CTLSSTREAM = 0x0020; /// Data in Ctls stream (BIFF8).
+const sal_uInt16 EXC_OBJ_PIC_AUTOLOAD = 0x0200; /// Auto-load form control (BIFF8).
+
+// BIFF5 button objects
+const sal_uInt16 EXC_OBJ_BUTTON_DEFAULT = 0x0001;
+const sal_uInt16 EXC_OBJ_BUTTON_HELP = 0x0002;
+const sal_uInt16 EXC_OBJ_BUTTON_CANCEL = 0x0004;
+const sal_uInt16 EXC_OBJ_BUTTON_CLOSE = 0x0008;
+
+// BIFF5 checkboxs, radio buttons
+const sal_uInt16 EXC_OBJ_CHECKBOX_UNCHECKED = 0;
+const sal_uInt16 EXC_OBJ_CHECKBOX_CHECKED = 1;
+const sal_uInt16 EXC_OBJ_CHECKBOX_TRISTATE = 2;
+const sal_uInt16 EXC_OBJ_CHECKBOX_FLAT = 0x0001;
+
+// BIFF5 editbox objects
+const sal_uInt16 EXC_OBJ_EDIT_TEXT = 0;
+const sal_uInt16 EXC_OBJ_EDIT_INTEGER = 1;
+const sal_uInt16 EXC_OBJ_EDIT_DOUBLE = 2;
+const sal_uInt16 EXC_OBJ_EDIT_REFERENCE = 3;
+const sal_uInt16 EXC_OBJ_EDIT_FORMULA = 4;
+
+// BIFF5 scrollbars/spinbuttons
+const sal_uInt16 EXC_OBJ_SCROLLBAR_MIN = 0;
+const sal_uInt16 EXC_OBJ_SCROLLBAR_MAX = 30000;
+
+const sal_uInt16 EXC_OBJ_SCROLLBAR_HOR = 0x0001;
+
+const sal_uInt16 EXC_OBJ_SCROLLBAR_DEFFLAGS = 0x0001;
+const sal_uInt16 EXC_OBJ_SCROLLBAR_FLAT = 0x0008;
+
+// BIFF5 listboxes/dropdowns
+const sal_uInt8 EXC_OBJ_LISTBOX_SINGLE = 0; /// Single selection.
+const sal_uInt8 EXC_OBJ_LISTBOX_MULTI = 1; /// Multi selection.
+const sal_uInt8 EXC_OBJ_LISTBOX_RANGE = 2; /// Range selection.
+
+const sal_uInt16 EXC_OBJ_LISTBOX_EDIT = 0x0002;
+const sal_uInt16 EXC_OBJ_LISTBOX_FLAT = 0x0008;
+
+// BIFF5 dropdown listboxes
+const sal_uInt16 EXC_OBJ_DROPDOWN_LISTBOX = 0; /// Listbox, text not editable.
+const sal_uInt16 EXC_OBJ_DROPDOWN_COMBOBOX = 1; /// Dropdown listbox with editable text.
+const sal_uInt16 EXC_OBJ_DROPDOWN_SIMPLE = 2; /// Dropdown button only, no text area.
+const sal_uInt16 EXC_OBJ_DROPDOWN_MAX = 3;
+const sal_uInt16 EXC_OBJ_DROPDOWN_FILTERED = 0x0008; /// Drowdown style: filtered.
+
+// BIFF5 groupboxes
+const sal_uInt16 EXC_OBJ_GROUPBOX_FLAT = 0x0001;
+
+// BIFF8 sub records
+const sal_uInt16 EXC_ID_OBJEND = 0x0000; /// End of OBJ.
+const sal_uInt16 EXC_ID_OBJMACRO = 0x0004; /// Macro link.
+const sal_uInt16 EXC_ID_OBJBUTTON = 0x0005; /// Button data.
+const sal_uInt16 EXC_ID_OBJGMO = 0x0006; /// Group marker.
+const sal_uInt16 EXC_ID_OBJCF = 0x0007; /// Clipboard format.
+const sal_uInt16 EXC_ID_OBJFLAGS = 0x0008; /// Option flags.
+const sal_uInt16 EXC_ID_OBJPICTFMLA = 0x0009; /// OLE link formula.
+const sal_uInt16 EXC_ID_OBJCBLS = 0x000A; /// Check box/radio button data.
+const sal_uInt16 EXC_ID_OBJRBO = 0x000B; /// Radio button group data.
+const sal_uInt16 EXC_ID_OBJSBS = 0x000C; /// Scroll bar data.
+const sal_uInt16 EXC_ID_OBJNTS = 0x000D; /// Note data.
+const sal_uInt16 EXC_ID_OBJSBSFMLA = 0x000E; /// Scroll bar/list box/combo box cell link.
+const sal_uInt16 EXC_ID_OBJGBODATA = 0x000F; /// Group box data.
+const sal_uInt16 EXC_ID_OBJEDODATA = 0x0010; /// Edit box data.
+const sal_uInt16 EXC_ID_OBJRBODATA = 0x0011; /// Radio button group data.
+const sal_uInt16 EXC_ID_OBJCBLSDATA = 0x0012; /// Check box/radio button data.
+const sal_uInt16 EXC_ID_OBJLBSDATA = 0x0013; /// List box/combo box data.
+const sal_uInt16 EXC_ID_OBJCBLSFMLA = 0x0014; /// Check box/radio button cell link.
+const sal_uInt16 EXC_ID_OBJCMO = 0x0015; /// Common object settings.
+const sal_uInt16 EXC_ID_OBJUNKNOWN = 0xFFFF; /// For internal use only.
+
+// BIFF8 OBJCMO: flags
+const sal_uInt16 EXC_OBJCMO_PRINTABLE = 0x0010; /// Object printable.
+const sal_uInt16 EXC_OBJCMO_AUTOLINE = 0x2000; /// Automatic line formatting.
+const sal_uInt16 EXC_OBJCMO_AUTOFILL = 0x4000; /// Automatic fill formatting.
/** Value binding mode for cells linked to form controls. */
enum XclCtrlBindMode
@@ -140,6 +254,24 @@ enum XclCtrlBindMode
EXC_CTRL_BINDPOSITION /// Binds cell to position in control (e.g. listbox selection index).
};
+// (0x007F) IMGDATA -----------------------------------------------------------
+
+const sal_uInt16 EXC_ID3_IMGDATA = 0x007F;
+const sal_uInt16 EXC_ID8_IMGDATA = 0x00E9;
+
+const sal_uInt16 EXC_IMGDATA_WMF = 2;
+const sal_uInt16 EXC_IMGDATA_BMP = 9;
+
+const sal_uInt16 EXC_IMGDATA_WIN = 1;
+const sal_uInt16 EXC_IMGDATA_MAC = 2;
+
+const sal_uInt32 EXC_IMGDATA_MAXREC8 = 0x201C;
+const sal_uInt32 EXC_IMGDATA_MAXCONT8 = 0x2014;
+
+// (0x00A9) COORDLIST ---------------------------------------------------------
+
+const sal_uInt16 EXC_ID_COORDLIST = 0x00A9;
+
// (0x00EB) MSODRAWINGGROUP ---------------------------------------------------
const sal_uInt16 EXC_ID_MSODRAWINGGROUP = 0x00EB;
@@ -161,42 +293,35 @@ const sal_uInt16 EXC_ID_MSODRAWINGSEL = 0x00ED;
const sal_uInt16 EXC_ID_TXO = 0x01B6;
-const sal_uInt8 EXC_TXO_HOR_LEFT = 0x01;
-const sal_uInt8 EXC_TXO_HOR_CENTER = 0x02;
-const sal_uInt8 EXC_TXO_HOR_RIGHT = 0x03;
-const sal_uInt8 EXC_TXO_HOR_JUSTIFY = 0x04;
+// TXO constants are eqzal to BIFF5 OBJ text object flags
-const sal_uInt8 EXC_TXO_VER_TOP = 0x01;
-const sal_uInt8 EXC_TXO_VER_CENTER = 0x02;
-const sal_uInt8 EXC_TXO_VER_BOTTOM = 0x03;
-const sal_uInt8 EXC_TXO_VER_JUSTIFY = 0x04;
+// Structs and classes ========================================================
-const sal_uInt16 EXC_TXO_TEXTROT_NONE = 0x0000;
-const sal_uInt16 EXC_TXO_TEXTROT_STACKED = 0x0001; /// Stacked top to bottom.
-const sal_uInt16 EXC_TXO_TEXTROT_90_CCW = 0x0002; /// 90 degr. counterclockwise.
-const sal_uInt16 EXC_TXO_TEXTROT_90_CW = 0x0003; /// 90 degr. clockwise.
+/** Identifies a drawing object by sheet index and object identifier. */
+struct XclObjId
+{
+ SCTAB mnScTab; /// Calc sheet index.
+ sal_uInt16 mnObjId; /// Excel object identifier.
-// Structs and classes ========================================================
+ explicit XclObjId();
+ explicit XclObjId( SCTAB nScTab, sal_uInt16 nObjId );
+};
-// Escher client anchor -------------------------------------------------------
+bool operator==( const XclObjId& rL, const XclObjId& rR );
+bool operator<( const XclObjId& rL, const XclObjId& rR );
-class Rectangle;
-class ScDocument;
-class SvStream;
-class XclImpStream;
-class XclExpStream;
+// ----------------------------------------------------------------------------
-/** Represents the position (anchor) of an Escher object in a Calc document. */
-struct XclEscherAnchor
+/** Represents the position (anchor) of an object in a Calc document. */
+struct XclObjAnchor : public XclRange
{
- XclRange maXclRange; /// Cell range address.
SCTAB mnScTab; /// Calc sheet index.
sal_uInt16 mnLX; /// X offset in left column (1/1024 of column width).
sal_uInt16 mnTY; /// Y offset in top row (1/256 of row height).
sal_uInt16 mnRX; /// X offset in right column (1/1024 of column width).
sal_uInt16 mnBY; /// Y offset in bottom row (1/256 of row height).
- explicit XclEscherAnchor( SCTAB nScTab );
+ explicit XclObjAnchor( SCTAB nScTab );
/** Calculates a rectangle from the contained coordinates. */
Rectangle GetRect( ScDocument& rDoc, MapUnit eMapUnit ) const;
@@ -204,82 +329,122 @@ struct XclEscherAnchor
void SetRect( ScDocument& rDoc, const Rectangle& rRect, MapUnit eMapUnit );
};
-SvStream& operator>>( SvStream& rStrm, XclEscherAnchor& rAnchor );
-SvStream& operator<<( SvStream& rStrm, const XclEscherAnchor& rAnchor );
-
-XclImpStream& operator>>( XclImpStream& rStrm, XclEscherAnchor& rAnchor );
-XclExpStream& operator<<( XclExpStream& rStrm, const XclEscherAnchor& rAnchor );
+template< typename StreamType >
+StreamType& operator>>( StreamType& rStrm, XclObjAnchor& rAnchor )
+{
+ return rStrm
+ >> rAnchor.maFirst.mnCol >> rAnchor.mnLX
+ >> rAnchor.maFirst.mnRow >> rAnchor.mnTY
+ >> rAnchor.maLast.mnCol >> rAnchor.mnRX
+ >> rAnchor.maLast.mnRow >> rAnchor.mnBY;
+}
+
+template< typename StreamType >
+StreamType& operator<<( StreamType& rStrm, const XclObjAnchor& rAnchor )
+{
+ return rStrm
+ << rAnchor.maFirst.mnCol << rAnchor.mnLX
+ << rAnchor.maFirst.mnRow << rAnchor.mnTY
+ << rAnchor.maLast.mnCol << rAnchor.mnRX
+ << rAnchor.maLast.mnRow << rAnchor.mnBY;
+}
// ----------------------------------------------------------------------------
-/** Identifies an Escher object by sheet index and object identifier. */
-struct XclObjId
+struct XclObjLineData
{
- SCTAB mnScTab; /// Calc sheet index.
- sal_uInt16 mnObjId; /// Excel object identifier.
+ sal_uInt8 mnColorIdx;
+ sal_uInt8 mnStyle;
+ sal_uInt8 mnWidth;
+ sal_uInt8 mnAuto;
- explicit XclObjId();
- explicit XclObjId( SCTAB nScTab, sal_uInt16 nObjId );
+ explicit XclObjLineData();
+
+ inline bool IsAuto() const { return ::get_flag( mnAuto, EXC_OBJ_LINE_AUTO ); }
+ inline bool IsVisible() const { return IsAuto() || (mnStyle != EXC_OBJ_LINE_NONE); }
};
-bool operator==( const XclObjId& rL, const XclObjId& rR );
-bool operator<( const XclObjId& rL, const XclObjId& rR );
+XclImpStream& operator>>( XclImpStream& rStrm, XclObjLineData& rLineData );
// ----------------------------------------------------------------------------
-/** Contains data of a TXO record for text boxes. */
-struct XclTxoData
+struct XclObjFillData
{
- sal_uInt16 mnFlags; /// Option flags and alignment.
- sal_uInt16 mnOrient; /// Text orientation.
- sal_uInt16 mnTextLen; /// Length of the string.
- sal_uInt16 mnFormatSize; /// Size of the format run buffer (bytes).
-
- explicit XclTxoData();
+ sal_uInt8 mnBackColorIdx;
+ sal_uInt8 mnPattColorIdx;
+ sal_uInt8 mnPattern;
+ sal_uInt8 mnAuto;
- sal_uInt8 GetXclHorAlignment() const;
- void SetXclHorAlignment( sal_uInt8 nXclAlign );
+ explicit XclObjFillData();
- sal_uInt8 GetXclVerAlignment() const;
- void SetXclVerAlignment( sal_uInt8 nXclAlign );
+ inline bool IsAuto() const { return ::get_flag( mnAuto, EXC_OBJ_FILL_AUTO ); }
+ inline bool IsFilled() const { return IsAuto() || (mnPattern != EXC_PATT_NONE); }
};
-XclImpStream& operator>>( XclImpStream& rStrm, XclTxoData& rData );
-XclExpStream& operator<<( XclExpStream& rStrm, const XclTxoData& rData );
+XclImpStream& operator>>( XclImpStream& rStrm, XclObjFillData& rFillData );
// ----------------------------------------------------------------------------
-namespace com { namespace sun { namespace star {
- namespace drawing { class XShape; }
- namespace awt { class XControlModel; }
-} } }
+struct XclObjTextData
+{
+ sal_uInt16 mnTextLen;
+ sal_uInt16 mnFormatSize;
+ sal_uInt16 mnLinkSize;
+ sal_uInt16 mnDefFontIdx;
+ sal_uInt16 mnFlags;
+ sal_uInt16 mnOrient;
+ sal_uInt16 mnButtonFlags;
+ sal_uInt16 mnShortcut;
+ sal_uInt16 mnShortcutEA;
+
+ explicit XclObjTextData();
+
+ /** Reads text data from a BIFF3/BIFF4 OBJ record. */
+ void ReadObj3( XclImpStream& rStrm );
+ /** Reads text data from a BIFF5 OBJ record. */
+ void ReadObj5( XclImpStream& rStrm );
+ /** Reads text data from a BIFF8 TXO record. */
+ void ReadTxo8( XclImpStream& rStrm );
+
+ inline sal_uInt8 GetHorAlign() const { return ::extract_value< sal_uInt8 >( mnFlags, 1, 3 ); }
+ inline sal_uInt8 GetVerAlign() const { return ::extract_value< sal_uInt8 >( mnFlags, 4, 3 ); }
+};
-class SdrObject;
+// ============================================================================
+
+enum XclTbxEventType
+{
+ EXC_TBX_EVENT_ACTION, /// XActionListener.actionPerformed
+ EXC_TBX_EVENT_MOUSE, /// XMouseListener.mouseReleased
+ EXC_TBX_EVENT_TEXT, /// XTextListener.textChanged
+ EXC_TBX_EVENT_VALUE, /// XAdjustmentListener.adjustmentValueChanged
+ EXC_TBX_EVENT_CHANGE /// XChangeListener.changed
+};
+
+// ----------------------------------------------------------------------------
/** Provides static helper functions for form controls. */
-class XclControlObjHelper
+class XclControlHelper
{
public:
/** Returns the API control model from the passed API shape object. */
static ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >
- GetModelFromShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
-
- /** Returns the component service name for the passed control type. */
- static ::rtl::OUString GetTbxServiceName( sal_uInt16 nCtrlType );
- /** Returns a default control name for the passed control type. */
- static ::rtl::OUString GetTbxControlName( sal_uInt16 nCtrlType );
-
- /** Returns the listener type (interface name) for macro events for the passed control type. */
- static ::rtl::OUString GetTbxListenerType( sal_uInt16 nCtrlType );
- /** Returns the event method (function name) for macro events for the passed control type. */
- static ::rtl::OUString GetTbxEventMethod( sal_uInt16 nCtrlType );
- /** Returns the script type string needed for a script event descriptor. */
- static ::rtl::OUString GetTbxScriptType();
+ GetControlModel( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
/** Returns the Calc macro name from an Excel macro name. */
static ::rtl::OUString GetScMacroName( const String& rXclMacroName );
/** Returns the Excel macro name from a Calc macro name. */
static String GetXclMacroName( const ::rtl::OUString& rScMacroName );
+
+ /** Fills the macro descriptor according to the passed macro name. */
+ static bool FillMacroDescriptor(
+ ::com::sun::star::script::ScriptEventDescriptor& rDescriptor,
+ XclTbxEventType eEventType,
+ const String& rXclMacroName );
+ /** Tries to extract an Excel macro name from the passed macro descriptor. */
+ static String ExtractFromMacroDescriptor(
+ const ::com::sun::star::script::ScriptEventDescriptor& rDescriptor,
+ XclTbxEventType eEventType );
};
// ============================================================================
diff --git a/sc/source/filter/inc/xlocx.hxx b/sc/source/filter/inc/xlocx.hxx
index 0d469e35007c..e69de29bb2d1 100644
--- a/sc/source/filter/inc/xlocx.hxx
+++ b/sc/source/filter/inc/xlocx.hxx
@@ -1,152 +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: xlocx.hxx,v $
- * $Revision: 1.15 $
- *
- * 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 SC_XLOCX_HXX
-#define SC_XLOCX_HXX
-
-#include <svx/msocximex.hxx>
-#include "xiroot.hxx"
-#include "xeroot.hxx"
-
-// 0 = Export TBX form controls, 1 = Export OCX form controls.
-#define EXC_EXP_OCX_CTRL 0
-
-// OCX controls ===============================================================
-
-/** Converter base class for import and export of OXC controls.
- @descr The purpose of this class is to manage all the draw pages occuring in a
- spreadsheet document. Derived classes implement import or export of the controls. */
-class XclOcxConverter : protected SvxMSConvertOCXControls
-{
-protected:
- explicit XclOcxConverter( const XclRoot& rRoot );
- virtual ~XclOcxConverter();
-
- /** Sets the sheet index of the currently processed object. GetDrawPage() needs this. */
- void SetScTab( SCTAB nScTab );
- /** Calls SetScTab() with the passed sheet index and updates the xDrawPage base class member. */
- void SetDrawPage( SCTAB nScTab );
-
-private:
- /** Returns the current draw page. */
- virtual const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >&
- GetDrawPage();
-
-private:
- const XclRoot& mrRoot; /// Root data.
- SCTAB mnCurrScTab; /// Stores sheet index of an object for GetDrawPage().
- SCTAB mnCachedScTab; /// Sheet index of cached draw page.
-};
-
-// ----------------------------------------------------------------------------
-
-class Rectangle;
-class SdrObject;
-class XclImpOleObj;
-class XclImpTbxControlObj;
-class XclImpControlObjHelper;
-
-/** Converter for import of OXC controls. */
-class XclImpOcxConverter : public XclOcxConverter, protected XclImpRoot
-{
-public:
- explicit XclImpOcxConverter( const XclImpRoot& rRoot );
-
- /** Reads the control formatting data for the passed object and creates the SdrUnoObj. */
- SdrObject* CreateSdrObject( XclImpOleObj& rOcxCtrlObj, const Rectangle& rAnchorRect );
- /** Creates the SdrUnoObj for the passed TBX form control object. */
- SdrObject* CreateSdrObject( XclImpTbxControlObj& rTbxCtrlObj, const Rectangle& rAnchorRect );
-
-private:
- /** Inserts the passed control rxFComp into the form. */
- virtual sal_Bool InsertControl(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::form::XFormComponent >& rxFComp,
- const ::com::sun::star::awt::Size& rSize,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::drawing::XShape >* pxShape,
- BOOL bFloatingCtrl );
-
- /** Returns the SdrObject from the passed shape. Sets the passed anchor rectangle. */
- SdrObject* FinalizeSdrObject(
- XclImpControlObjHelper& rCtrlObj,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::drawing::XShape > xShape,
- const Rectangle& rAnchorRect ) const;
- /** Tries to register a Basic macro for the control. */
- void RegisterTbxMacro( const XclImpTbxControlObj& rTbxCtrlObj );
-
-private:
- SotStorageStreamRef mxStrm; /// The 'Ctls' stream in the Excel file.
- sal_Int32 mnLastIndex; /// Last insertion index of a control.
-};
-
-// ----------------------------------------------------------------------------
-
-class SdrObject;
-#if EXC_EXP_OCX_CTRL
-class XclExpOcxControlObj;
-#else
-class XclExpTbxControlObj;
-#endif
-class XclExpCtrlLinkHelper;
-
-/** Converter for export of OXC controls. */
-class XclExpOcxConverter : public XclOcxConverter, protected XclExpRoot
-{
-public:
- explicit XclExpOcxConverter( const XclExpRoot& rRoot );
-
-#if EXC_EXP_OCX_CTRL
- /** Creates an OCX form control OBJ record from the passed form control.
- @descr Writes the form control data to the 'Ctls' stream. */
- XclExpOcxControlObj* CreateCtrlObj( ::com::sun::star::uno::Reference<
- ::com::sun::star::drawing::XShape > xShape );
-
-private:
- SotStorageStreamRef mxStrm; /// The 'Ctls' stream.
-#else
- /** Creates a TBX form control OBJ record from the passed form control. */
- XclExpTbxControlObj* CreateCtrlObj( ::com::sun::star::uno::Reference<
- ::com::sun::star::drawing::XShape > xShape );
-
-private:
- /** Tries to get the name of a Basic macro from a control. */
- void ConvertTbxMacro(
- XclExpTbxControlObj& rTbxCtrlObj,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::awt::XControlModel > xCtrlModel );
-#endif
-};
-
-// ============================================================================
-
-#endif
-
diff --git a/sc/source/filter/inc/xlpage.hxx b/sc/source/filter/inc/xlpage.hxx
index 7f83eb658dc8..59339970fd56 100644
--- a/sc/source/filter/inc/xlpage.hxx
+++ b/sc/source/filter/inc/xlpage.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xlpage.hxx,v $
- * $Revision: 1.8 $
+ * $Revision: 1.8.90.1 $
*
* This file is part of OpenOffice.org.
*
@@ -93,13 +93,6 @@ const sal_uInt16 EXC_SETUP_NOTES_END = 0x0200;
const sal_uInt16 EXC_PAPERSIZE_DEFAULT = 0;
-// (0x00E9) BITMAP ------------------------------------------------------------
-
-const sal_uInt16 EXC_ID_BITMAP = 0x00E9;
-const sal_uInt32 EXC_BITMAP_UNKNOWNID = 0x00010009;
-const sal_uInt32 EXC_BITMAP_MAXREC = 0x201C;
-const sal_uInt32 EXC_BITMAP_MAXCONT = 0x2014;
-
// ============================================================================
// Page settings ==============================================================
diff --git a/sc/source/filter/inc/xlstyle.hxx b/sc/source/filter/inc/xlstyle.hxx
index ac56f254492c..6087914c8af9 100644
--- a/sc/source/filter/inc/xlstyle.hxx
+++ b/sc/source/filter/inc/xlstyle.hxx
@@ -463,6 +463,9 @@ public:
protected:
typedef ::std::map< sal_uInt16, XclNumFmt > XclNumFmtMap;
+ /** Clears all buffered data, used to set up for a new sheet. */
+ void InitializeImport();
+
/** Returns the current number format map. */
inline const XclNumFmtMap& GetFormatMap() const { return maFmtMap; }
diff --git a/sc/source/filter/xcl97/makefile.mk b/sc/source/filter/xcl97/makefile.mk
index 48bb754c237a..a5194358179a 100644
--- a/sc/source/filter/xcl97/makefile.mk
+++ b/sc/source/filter/xcl97/makefile.mk
@@ -1,14 +1,14 @@
#*************************************************************************
#
# 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: makefile.mk,v $
#
-# $Revision: 1.16 $
+# $Revision: 1.16.88.1 $
#
# This file is part of OpenOffice.org.
#
@@ -57,6 +57,7 @@ SLOFILES = \
$(SLO)$/XclExpChangeTrack.obj
EXCEPTIONSFILES = \
+ $(SLO)$/xcl97esc.obj \
$(SLO)$/xcl97rec.obj
# --- Targets -------------------------------------------------------
diff --git a/sc/source/filter/xcl97/xcl97esc.cxx b/sc/source/filter/xcl97/xcl97esc.cxx
index 4e603bc99611..4be890dd3903 100644
--- a/sc/source/filter/xcl97/xcl97esc.cxx
+++ b/sc/source/filter/xcl97/xcl97esc.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xcl97esc.cxx,v $
- * $Revision: 1.26 $
+ * $Revision: 1.26.90.3 $
*
* This file is part of OpenOffice.org.
*
@@ -31,12 +31,21 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
#include "xcl97esc.hxx"
+
+#include <com/sun/star/awt/XControlModel.hpp>
+#include <com/sun/star/embed/XClassifiedObject.hpp>
+#include <com/sun/star/form/XFormsSupplier.hpp>
+#include <com/sun/star/script/ScriptEventDescriptor.hpp>
+#include <com/sun/star/script/XEventAttacherManager.hpp>
+
+#include <svx/svdpage.hxx>
#include <svx/outlobj.hxx>
#include <svx/svdotext.hxx>
#include <svx/svdobj.hxx>
#include <svx/svdoole2.hxx>
#include <svx/unoapi.hxx>
#include <svx/fmglob.hxx>
+#include <svx/msocximex.hxx>
#include <vcl/outdev.hxx>
#include <unotools/tempfile.hxx>
#include <unotools/ucbstreamhelper.hxx>
@@ -52,17 +61,26 @@
#include "xcl97rec.hxx"
#include "xehelper.hxx"
#include "xechart.hxx"
-#include <com/sun/star/embed/XClassifiedObject.hpp>
-using namespace com::sun::star;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::uno::Exception;
+using ::com::sun::star::uno::UNO_QUERY;
+using ::com::sun::star::uno::UNO_QUERY_THROW;
+using ::com::sun::star::container::XIndexAccess;
+using ::com::sun::star::embed::XClassifiedObject;
+using ::com::sun::star::drawing::XShape;
+using ::com::sun::star::awt::XControlModel;
+using ::com::sun::star::form::XFormsSupplier;
+using ::com::sun::star::script::ScriptEventDescriptor;
+using ::com::sun::star::script::XEventAttacherManager;
// --- class XclEscherEx ---------------------------------------------
-XclEscherEx::XclEscherEx( SvStream& rStrm, UINT32 nDrawings, RootData& rRoot )
+XclEscherEx::XclEscherEx( const XclExpRoot& rRoot, SvStream& rStrm, UINT32 nDrawings )
:
EscherEx( rStrm, nDrawings ),
- aOcxConverter( *rRoot.pER ),
- rRootData( rRoot ),
+ XclExpRoot( rRoot ),
pPicTempFile( NULL ),
pPicStrm( NULL ),
pCurrXclObj( NULL ),
@@ -164,8 +182,6 @@ sal_Bool ImplXclEscherExIsFontwork( const SdrObject* pObj )
EscherExHostAppData* XclEscherEx::StartShape( const com::sun::star::uno::Reference<
com::sun::star::drawing::XShape >& rShape )
{
- const XclExpRoot& rRoot = *rRootData.pER;
-
if ( nAdditionalText )
nAdditionalText++;
BOOL bInGroup = ( pCurrXclObj != NULL );
@@ -182,7 +198,7 @@ EscherExHostAppData* XclEscherEx::StartShape( const com::sun::star::uno::Referen
pCurrAppData = new XclEscherHostAppData;
const SdrObject* pObj = GetSdrObject( rShape );
if ( !pObj )
- pCurrXclObj = new XclObjAny( rRoot ); // just what is it?!?
+ pCurrXclObj = new XclObjAny( GetRoot() ); // just what is it?!?
else
{
pCurrXclObj = NULL;
@@ -191,37 +207,37 @@ EscherExHostAppData* XclEscherEx::StartShape( const com::sun::star::uno::Referen
if( nObjType == OBJ_OLE2 )
{
//! not-const because GetObjRef may load the OLE object
- uno::Reference < embed::XClassifiedObject > xObj( ((SdrOle2Obj*)pObj)->GetObjRef(), uno::UNO_QUERY );
+ Reference < XClassifiedObject > xObj( ((SdrOle2Obj*)pObj)->GetObjRef(), UNO_QUERY );
if ( xObj.is() )
{
SvGlobalName aObjClsId( xObj->getClassID() );
if ( SotExchange::IsChart( aObjClsId ) )
{ // yes, it's a chart diagram
- rRootData.pObjRecs->Add( new XclExpChartObj( rRoot, rShape ) );
+ GetOldRoot().pObjRecs->Add( new XclExpChartObj( GetRoot(), rShape ) );
pCurrXclObj = NULL; // no metafile or whatsoever
}
else // metafile and OLE object
- pCurrXclObj = new XclObjOle( rRoot, *pObj );
+ pCurrXclObj = new XclObjOle( GetRoot(), *pObj );
}
else // just a metafile
- pCurrXclObj = new XclObjAny( rRoot );
+ pCurrXclObj = new XclObjAny( GetRoot() );
}
else if( nObjType == OBJ_UNO )
{
- pCurrXclObj = aOcxConverter.CreateCtrlObj( rShape );
+ pCurrXclObj = CreateCtrlObj( rShape );
if( !pCurrXclObj )
- pCurrXclObj = new XclObjAny( rRoot ); // just a metafile
+ pCurrXclObj = new XclObjAny( GetRoot() ); // just a metafile
}
else if( pObj->GetLayer() != SC_LAYER_INTERN )
{
// #107540# ignore permanent note shapes
// #i12190# do not ignore callouts (do not filter by object type ID)
- pCurrXclObj = new XclObjAny( rRoot ); // just a metafile
+ pCurrXclObj = new XclObjAny( GetRoot() ); // just a metafile
}
}
if ( pCurrXclObj )
{
- if ( !rRootData.pObjRecs->Add( pCurrXclObj ) )
+ if ( !GetOldRoot().pObjRecs->Add( pCurrXclObj ) )
{ // maximum count reached, object got deleted
pCurrXclObj = NULL;
}
@@ -236,7 +252,7 @@ EscherExHostAppData* XclEscherEx::StartShape( const com::sun::star::uno::Referen
{
/* Create a dummy anchor carrying the flags. Real coordinates are
calculated later in WriteData(EscherEx&,const Rectangle&). */
- XclExpEscherAnchor* pAnchor = new XclExpEscherAnchor( rRoot );
+ XclExpDffAnchor* pAnchor = new XclExpDffAnchor( GetRoot() );
pAnchor->SetFlags( *pObj );
pCurrAppData->SetClientAnchor( pAnchor );
}
@@ -246,14 +262,13 @@ EscherExHostAppData* XclEscherEx::StartShape( const com::sun::star::uno::Referen
const OutlinerParaObject* pParaObj = pTextObj->GetOutlinerParaObject();
if( pParaObj )
pCurrAppData->SetClientTextbox(
- new XclEscherClientTextbox(
- rRootData, *pTextObj, pCurrXclObj ) );
+ new XclEscherClientTextbox( GetRoot(), *pTextObj, pCurrXclObj ) );
}
}
else
{
if ( !bInGroup )
- pCurrAppData->SetClientAnchor( new XclExpEscherAnchor( rRoot ) );
+ pCurrAppData->SetClientAnchor( new XclExpDffAnchor( GetRoot() ) );
}
}
else if ( nAdditionalText == 3 )
@@ -283,11 +298,11 @@ void XclEscherEx::EndShape( UINT16 nShapeType, UINT32 nShapeID )
// escher data of last shape not written? -> delete it from object list
if( nShapeID == 0 )
{
- XclObj* pLastObj = static_cast< XclObj* >( rRootData.pObjRecs->Last() );
+ XclObj* pLastObj = static_cast< XclObj* >( GetOldRoot().pObjRecs->Last() );
DBG_ASSERT( pLastObj == pCurrXclObj, "XclEscherEx::EndShape - wrong object" );
if ( pLastObj == pCurrXclObj )
{
- rRootData.pObjRecs->Remove();
+ GetOldRoot().pObjRecs->Remove();
DELETEZ( pCurrXclObj );
}
}
@@ -340,16 +355,118 @@ void XclEscherEx::EndDocument()
Flush( pPicStrm );
}
+#if EXC_EXP_OCX_CTRL
+
+XclExpOcxControlObj* XclEscherEx::CreateCtrlObj( Reference< XShape > xShape )
+{
+ ::std::auto_ptr< XclExpOcxControlObj > xOcxCtrl;
+
+ Reference< XControlModel > xCtrlModel = XclControlHelper::GetControlModel( xShape );
+ if( xCtrlModel.is() )
+ {
+ // output stream
+ if( !mxCtlsStrm.Is() )
+ mxCtlsStrm = OpenStream( EXC_STREAM_CTLS );
+ if( mxCtlsStrm.Is() )
+ {
+ String aClassName;
+ sal_uInt32 nStrmStart = static_cast< sal_uInt32 >( mxCtlsStrm->Tell() );
+
+ // writes from xCtrlModel into mxCtlsStrm, raw class name returned in aClassName
+ if( SvxMSConvertOCXControls::WriteOCXExcelKludgeStream( mxCtlsStrm, xCtrlModel, xShape->getSize(), aClassName ) )
+ {
+ sal_uInt32 nStrmSize = static_cast< sal_uInt32 >( mxCtlsStrm->Tell() - nStrmStart );
+ // adjust the class name to "Forms.***.1"
+ aClassName.InsertAscii( "Forms.", 0 ).AppendAscii( ".1" );
+ xOcxCtrl.reset( new XclExpOcxControlObj( GetRoot(), xShape, aClassName, nStrmStart, nStrmSize ) );
+ }
+ }
+ }
+ return xOcxCtrl.release();
+}
+
+#else
+
+XclExpTbxControlObj* XclEscherEx::CreateCtrlObj( Reference< XShape > xShape )
+{
+ ::std::auto_ptr< XclExpTbxControlObj > xTbxCtrl( new XclExpTbxControlObj( GetRoot(), xShape ) );
+ if( xTbxCtrl->GetObjType() == EXC_OBJTYPE_UNKNOWN )
+ xTbxCtrl.reset();
+
+ if( xTbxCtrl.get() )
+ {
+ // find attached macro
+ Reference< XControlModel > xCtrlModel = XclControlHelper::GetControlModel( xShape );
+ ConvertTbxMacro( *xTbxCtrl, xCtrlModel );
+ }
+ return xTbxCtrl.release();
+}
+
+void XclEscherEx::ConvertTbxMacro( XclExpTbxControlObj& rTbxCtrlObj, Reference< XControlModel > xCtrlModel )
+{
+ SdrPage* pSdrPage = GetSdrPage( GetCurrScTab() );
+ if( xCtrlModel.is() && GetDocShell() && pSdrPage ) try
+ {
+ Reference< XFormsSupplier > xFormsSupplier( pSdrPage->getUnoPage(), UNO_QUERY_THROW );
+ Reference< XIndexAccess > xFormsIA( xFormsSupplier->getForms(), UNO_QUERY_THROW );
+
+ // 1) try to find the index of the processed control in the form
+
+ Reference< XIndexAccess > xFormIA; // needed in step 2) below
+ sal_Int32 nFoundIdx = -1;
+
+ // search all existing forms in the draw page
+ for( sal_Int32 nFormIdx = 0, nFormCount = xFormsIA->getCount();
+ (nFoundIdx < 0) && (nFormIdx < nFormCount); ++nFormIdx )
+ {
+ // get the XIndexAccess interface of the form with index nFormIdx
+ if( xFormIA.set( xFormsIA->getByIndex( nFormIdx ), UNO_QUERY ) )
+ {
+ // search all elements (controls) of the current form by index
+ for( sal_Int32 nCtrlIdx = 0, nCtrlCount = xFormIA->getCount();
+ (nFoundIdx < 0) && (nCtrlIdx < nCtrlCount); ++nCtrlIdx )
+ {
+ // compare implementation pointers of the control models
+ Reference< XControlModel > xCurrModel( xFormIA->getByIndex( nCtrlIdx ), UNO_QUERY );
+ if( xCtrlModel.get() == xCurrModel.get() )
+ nFoundIdx = nCtrlIdx;
+ }
+ }
+ }
+
+ // 2) try to find an attached macro
+
+ if( xFormIA.is() && (nFoundIdx >= 0) )
+ {
+ Reference< XEventAttacherManager > xEventMgr( xFormIA, UNO_QUERY_THROW );
+ // loop over all events attached to the found control
+ const Sequence< ScriptEventDescriptor > aEventSeq( xEventMgr->getScriptEvents( nFoundIdx ) );
+ bool bFound = false;
+ for( sal_Int32 nEventIdx = 0, nEventCount = aEventSeq.getLength();
+ !bFound && (nEventIdx < nEventCount); ++nEventIdx )
+ {
+ // try to set the event data at the Excel control object, returns true on success
+ bFound = rTbxCtrlObj.SetMacroLink( aEventSeq[ nEventIdx ] );
+ }
+ }
+ }
+ catch( Exception& )
+ {
+ }
+}
+
+#endif
// --- class XclEscher -----------------------------------------------
-XclEscher::XclEscher( UINT32 nDrawings, RootData& rRoot )
+XclEscher::XclEscher( const XclExpRoot& rRoot, UINT32 nDrawings ) :
+ XclExpRoot( rRoot )
{
pTempFile = new utl::TempFile;
pTempFile->EnableKillingFile();
pStrm = utl::UcbStreamHelper::CreateStream( pTempFile->GetURL(), STREAM_STD_READWRITE );
pStrm->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- pEx = new XclEscherEx( *pStrm, nDrawings, rRoot );
+ pEx = new XclEscherEx( rRoot, *pStrm, nDrawings );
}
@@ -361,9 +478,9 @@ XclEscher::~XclEscher()
}
-void XclEscher::AddSdrPage( const XclExpRoot& rRoot )
+void XclEscher::AddSdrPage()
{
- if( SdrPage* pPage = rRoot.GetSdrPage( rRoot.GetCurrScTab() ) )
+ if( SdrPage* pPage = GetSdrPage( GetCurrScTab() ) )
pEx->AddSdrPage( *pPage );
// #106213# the first dummy object may still be open
DBG_ASSERT( pEx->GetGroupLevel() <= 1, "XclEscher::AddSdrPage - still groups open?" );
@@ -374,14 +491,14 @@ void XclEscher::AddSdrPage( const XclExpRoot& rRoot )
// Escher client anchor =======================================================
-XclExpEscherAnchor::XclExpEscherAnchor( const XclExpRoot& rRoot, sal_uInt16 nFlags ) :
+XclExpDffAnchor::XclExpDffAnchor( const XclExpRoot& rRoot, sal_uInt16 nFlags ) :
XclExpRoot( rRoot ),
maAnchor( rRoot.GetCurrScTab() ),
mnFlags( nFlags )
{
}
-XclExpEscherAnchor::XclExpEscherAnchor( const XclExpRoot& rRoot, const SdrObject& rSdrObj ) :
+XclExpDffAnchor::XclExpDffAnchor( const XclExpRoot& rRoot, const SdrObject& rSdrObj ) :
XclExpRoot( rRoot ),
maAnchor( rRoot.GetCurrScTab() )
{
@@ -389,14 +506,14 @@ XclExpEscherAnchor::XclExpEscherAnchor( const XclExpRoot& rRoot, const SdrObject
maAnchor.SetRect( GetDoc(), rSdrObj.GetCurrentBoundRect(), MAP_100TH_MM );
}
-void XclExpEscherAnchor::SetFlags( const SdrObject& rSdrObj )
+void XclExpDffAnchor::SetFlags( const SdrObject& rSdrObj )
{
// Special case "page anchor" (X==0,Y==1) -> lock pos and size.
const Point& rPos = rSdrObj.GetAnchorPos();
mnFlags = ((rPos.X() == 0) && (rPos.Y() == 1)) ? EXC_ESC_ANCHOR_LOCKED : 0;
}
-void XclExpEscherAnchor::WriteData( EscherEx& rEx, const Rectangle& rRect )
+void XclExpDffAnchor::WriteData( EscherEx& rEx, const Rectangle& rRect )
{
// the rectangle is already in twips
maAnchor.SetRect( GetDoc(), rRect, MAP_TWIP );
@@ -404,7 +521,7 @@ void XclExpEscherAnchor::WriteData( EscherEx& rEx, const Rectangle& rRect )
}
-void XclExpEscherAnchor::WriteData( EscherEx& rEx ) const
+void XclExpDffAnchor::WriteData( EscherEx& rEx ) const
{
rEx.AddAtom( 18, ESCHER_ClientAnchor );
rEx.GetStream() << mnFlags << maAnchor;
@@ -413,8 +530,8 @@ void XclExpEscherAnchor::WriteData( EscherEx& rEx ) const
// ----------------------------------------------------------------------------
-XclExpEscherNoteAnchor::XclExpEscherNoteAnchor( const XclExpRoot& rRoot, const Rectangle& rRect ) :
- XclExpEscherAnchor( rRoot, EXC_ESC_ANCHOR_SIZELOCKED )
+XclExpDffNoteAnchor::XclExpDffNoteAnchor( const XclExpRoot& rRoot, const Rectangle& rRect ) :
+ XclExpDffAnchor( rRoot, EXC_ESC_ANCHOR_SIZELOCKED )
{
maAnchor.SetRect( GetDoc(), rRect, MAP_100TH_MM );
}
@@ -422,12 +539,12 @@ XclExpEscherNoteAnchor::XclExpEscherNoteAnchor( const XclExpRoot& rRoot, const R
// ----------------------------------------------------------------------------
-XclExpEscherDropDownAnchor::XclExpEscherDropDownAnchor( const XclExpRoot& rRoot, const ScAddress& rScPos ) :
- XclExpEscherAnchor( rRoot, EXC_ESC_ANCHOR_POSLOCKED )
+XclExpDffDropDownAnchor::XclExpDffDropDownAnchor( const XclExpRoot& rRoot, const ScAddress& rScPos ) :
+ XclExpDffAnchor( rRoot, EXC_ESC_ANCHOR_POSLOCKED )
{
- GetAddressConverter().ConvertAddress( maAnchor.maXclRange.maFirst, rScPos, true );
- maAnchor.maXclRange.maLast.mnCol = maAnchor.maXclRange.maFirst.mnCol + 1;
- maAnchor.maXclRange.maLast.mnRow = maAnchor.maXclRange.maFirst.mnRow + 1;
+ GetAddressConverter().ConvertAddress( maAnchor.maFirst, rScPos, true );
+ maAnchor.maLast.mnCol = maAnchor.maFirst.mnCol + 1;
+ maAnchor.maLast.mnRow = maAnchor.maFirst.mnRow + 1;
maAnchor.mnLX = maAnchor.mnTY = maAnchor.mnRX = maAnchor.mnBY = 0;
}
@@ -444,10 +561,10 @@ void XclEscherClientData::WriteData( EscherEx& rEx ) const
// --- class XclEscherClientTextbox -------------------------------------
-XclEscherClientTextbox::XclEscherClientTextbox( RootData& rRoot,
+XclEscherClientTextbox::XclEscherClientTextbox( const XclExpRoot& rRoot,
const SdrTextObj& rObj, XclObj* pObj )
:
- rRootData( rRoot ),
+ XclExpRoot( rRoot ),
rTextObj( rObj ),
pXclObj( pObj )
{
@@ -456,7 +573,7 @@ XclEscherClientTextbox::XclEscherClientTextbox( RootData& rRoot,
void XclEscherClientTextbox::WriteData( EscherEx& /*rEx*/ ) const
{
- pXclObj->SetText( *rRootData.pER, rTextObj );
+ pXclObj->SetText( GetRoot(), rTextObj );
}
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index bf58888d47ab..7845ef682082 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -349,26 +349,26 @@ void XclObj::SetEscherShapeType( UINT16 nType )
switch ( nType )
{
case ESCHER_ShpInst_Line :
- mnObjType = EXC_OBJ_CMO_LINE;
+ mnObjType = EXC_OBJTYPE_LINE;
break;
case ESCHER_ShpInst_Rectangle :
case ESCHER_ShpInst_RoundRectangle :
- mnObjType = EXC_OBJ_CMO_RECTANGLE;
+ mnObjType = EXC_OBJTYPE_RECTANGLE;
break;
case ESCHER_ShpInst_Ellipse :
- mnObjType = EXC_OBJ_CMO_ELLIPSE;
+ mnObjType = EXC_OBJTYPE_OVAL;
break;
case ESCHER_ShpInst_Arc :
- mnObjType = EXC_OBJ_CMO_ARC;
+ mnObjType = EXC_OBJTYPE_ARC;
break;
case ESCHER_ShpInst_TextBox :
- mnObjType = EXC_OBJ_CMO_TEXT;
+ mnObjType = EXC_OBJTYPE_TEXT;
break;
case ESCHER_ShpInst_PictureFrame :
- mnObjType = EXC_OBJ_CMO_PICTURE;
+ mnObjType = EXC_OBJTYPE_PICTURE;
break;
default:
- mnObjType = EXC_OBJ_CMO_DRAWING;
+ mnObjType = EXC_OBJTYPE_DRAWING;
}
}
@@ -389,14 +389,14 @@ void XclObj::SetText( const XclExpRoot& rRoot, const SdrTextObj& rObj )
void XclObj::WriteBody( XclExpStream& rStrm )
{
- DBG_ASSERT( mnObjType != EXC_OBJ_CMO_UNKNOWN, "XclObj::WriteBody - unknown type" );
+ DBG_ASSERT( mnObjType != EXC_OBJTYPE_UNKNOWN, "XclObj::WriteBody - unknown type" );
// create a substream to be able to create subrecords
SvMemoryStream aMemStrm;
::std::auto_ptr< XclExpStream > pXclStrm( new XclExpStream( aMemStrm, rStrm.GetRoot() ) );
// write the ftCmo subrecord
- pXclStrm->StartRecord( EXC_ID_OBJ_FTCMO, 18 );
+ pXclStrm->StartRecord( EXC_ID_OBJCMO, 18 );
*pXclStrm << mnObjType << nObjId << nGrbit;
pXclStrm->WriteZeroBytes( 12 );
pXclStrm->EndRecord();
@@ -405,7 +405,7 @@ void XclObj::WriteBody( XclExpStream& rStrm )
WriteSubRecs( *pXclStrm );
// write the ftEnd subrecord
- pXclStrm->StartRecord( EXC_ID_OBJ_FTEND, 0 );
+ pXclStrm->StartRecord( EXC_ID_OBJEND, 0 );
pXclStrm->EndRecord();
// copy the data to the OBJ record
@@ -449,7 +449,7 @@ void XclObj::SaveTextRecs( XclExpStream& rStrm )
XclObjComment::XclObjComment( const XclExpRoot& rRoot, const Rectangle& rRect, const EditTextObject& rEditObj, SdrObject* pCaption, bool bVisible )
:
- XclObj( rRoot, EXC_OBJ_CMO_NOTE, true )
+ XclObj( rRoot, EXC_OBJTYPE_NOTE, true )
{
ProcessEscherObj(rRoot, rRect, pCaption, bVisible);
// TXO
@@ -512,7 +512,7 @@ void XclObjComment::ProcessEscherObj( const XclExpRoot& rRoot, const Rectangle&
aPropOpt.AddOpt( ESCHER_Prop_fPrint, nFlags ); // bool field
aPropOpt.Commit( pEx->GetStream() );
- XclExpEscherNoteAnchor( rRoot, rRect ).WriteData( *pEx);
+ XclExpDffNoteAnchor( rRoot, rRect ).WriteData( *pEx);
pEx->AddAtom( 0, ESCHER_ClientData ); // OBJ record
pMsodrawing->UpdateStopPos();
@@ -540,7 +540,7 @@ void XclObjComment::Save( XclExpStream& rStrm )
// --- class XclObjDropDown ------------------------------------------
XclObjDropDown::XclObjDropDown( const XclExpRoot& rRoot, const ScAddress& rPos, BOOL bFilt ) :
- XclObj( rRoot, EXC_OBJ_CMO_COMBOBOX, true ),
+ XclObj( rRoot, EXC_OBJTYPE_DROPDOWN, true ),
bIsFiltered( bFilt )
{
SetLocked( TRUE );
@@ -559,7 +559,7 @@ XclObjDropDown::XclObjDropDown( const XclExpRoot& rRoot, const ScAddress& rPos,
aPropOpt.AddOpt( ESCHER_Prop_fPrint, 0x000A0000 ); // bool field
aPropOpt.Commit( pEx->GetStream() );
- XclExpEscherDropDownAnchor( rRoot, rPos ).WriteData( *pEx );
+ XclExpDffDropDownAnchor( rRoot, rPos ).WriteData( *pEx );
pEx->AddAtom( 0, ESCHER_ClientData ); // OBJ record
pMsodrawing->UpdateStopPos();
@@ -576,16 +576,17 @@ XclObjDropDown::~XclObjDropDown()
void XclObjDropDown::WriteSubRecs( XclExpStream& rStrm )
{
// ftSbs subrecord - Scroll bars (dummy)
- rStrm.StartRecord( EXC_ID_OBJ_FTSBS, 20 );
+ rStrm.StartRecord( EXC_ID_OBJSBS, 20 );
rStrm.WriteZeroBytes( 20 );
rStrm.EndRecord();
// ftLbsData subrecord - Listbox data
- sal_uInt16 nComboStyle = EXC_OBJ_LBS_COMBO_SIMPLE;
- ::set_flag( nComboStyle, EXC_OBJ_LBS_FILTERED, bIsFiltered );
- rStrm.StartRecord( EXC_ID_OBJ_FTLBSDATA, 16 );
+ sal_uInt16 nDropDownFlags = 0;
+ ::insert_value( nDropDownFlags, EXC_OBJ_DROPDOWN_SIMPLE, 0, 2 );
+ ::set_flag( nDropDownFlags, EXC_OBJ_DROPDOWN_FILTERED, bIsFiltered );
+ rStrm.StartRecord( EXC_ID_OBJLBSDATA, 16 );
rStrm << (UINT32)0 << (UINT16)0 << (UINT16)0x0301 << (UINT16)0
- << nComboStyle << sal_uInt16( 20 ) << sal_uInt16( 130 );
+ << nDropDownFlags << sal_uInt16( 20 ) << sal_uInt16( 130 );
rStrm.EndRecord();
}
@@ -594,14 +595,14 @@ void XclObjDropDown::WriteSubRecs( XclExpStream& rStrm )
sal_uInt8 lcl_GetHorAlignFromItemSet( const SfxItemSet& rItemSet )
{
- sal_uInt8 nHorAlign = EXC_TXO_HOR_LEFT;
+ sal_uInt8 nHorAlign = EXC_OBJ_HOR_LEFT;
switch( static_cast< const SvxAdjustItem& >( rItemSet.Get( EE_PARA_JUST ) ).GetAdjust() )
{
- case SVX_ADJUST_LEFT: nHorAlign = EXC_TXO_HOR_LEFT; break;
- case SVX_ADJUST_CENTER: nHorAlign = EXC_TXO_HOR_CENTER; break;
- case SVX_ADJUST_RIGHT: nHorAlign = EXC_TXO_HOR_RIGHT; break;
- case SVX_ADJUST_BLOCK: nHorAlign = EXC_TXO_HOR_JUSTIFY; break;
+ case SVX_ADJUST_LEFT: nHorAlign = EXC_OBJ_HOR_LEFT; break;
+ case SVX_ADJUST_CENTER: nHorAlign = EXC_OBJ_HOR_CENTER; break;
+ case SVX_ADJUST_RIGHT: nHorAlign = EXC_OBJ_HOR_RIGHT; break;
+ case SVX_ADJUST_BLOCK: nHorAlign = EXC_OBJ_HOR_JUSTIFY; break;
default:;
}
return nHorAlign;
@@ -609,23 +610,23 @@ sal_uInt8 lcl_GetHorAlignFromItemSet( const SfxItemSet& rItemSet )
sal_uInt8 lcl_GetVerAlignFromItemSet( const SfxItemSet& rItemSet )
{
- sal_uInt8 nVerAlign = EXC_TXO_VER_TOP;
+ sal_uInt8 nVerAlign = EXC_OBJ_VER_TOP;
switch( static_cast< const SdrTextVertAdjustItem& >( rItemSet.Get( SDRATTR_TEXT_VERTADJUST ) ).GetValue() )
{
- case SDRTEXTVERTADJUST_TOP: nVerAlign = EXC_TXO_VER_TOP; break;
- case SDRTEXTVERTADJUST_CENTER: nVerAlign = EXC_TXO_VER_CENTER; break;
- case SDRTEXTVERTADJUST_BOTTOM: nVerAlign = EXC_TXO_VER_BOTTOM; break;
- case SDRTEXTVERTADJUST_BLOCK: nVerAlign = EXC_TXO_VER_JUSTIFY; break;
+ case SDRTEXTVERTADJUST_TOP: nVerAlign = EXC_OBJ_VER_TOP; break;
+ case SDRTEXTVERTADJUST_CENTER: nVerAlign = EXC_OBJ_VER_CENTER; break;
+ case SDRTEXTVERTADJUST_BOTTOM: nVerAlign = EXC_OBJ_VER_BOTTOM; break;
+ case SDRTEXTVERTADJUST_BLOCK: nVerAlign = EXC_OBJ_VER_JUSTIFY; break;
}
return nVerAlign;
}
XclTxo::XclTxo( const String& rString, sal_uInt16 nFontIx ) :
mpString( new XclExpString( rString ) ),
- mnRotation( EXC_TXO_TEXTROT_NONE ),
- mnHorAlign( EXC_TXO_HOR_LEFT ),
- mnVerAlign( EXC_TXO_VER_TOP )
+ mnRotation( EXC_OBJ_ORIENT_NONE ),
+ mnHorAlign( EXC_OBJ_HOR_LEFT ),
+ mnVerAlign( EXC_OBJ_VER_TOP )
{
if( mpString->Len() )
{
@@ -637,9 +638,9 @@ XclTxo::XclTxo( const String& rString, sal_uInt16 nFontIx ) :
XclTxo::XclTxo( const XclExpRoot& rRoot, const SdrTextObj& rTextObj ) :
mpString( XclExpStringHelper::CreateString( rRoot, rTextObj ) ),
- mnRotation( EXC_TXO_TEXTROT_NONE ),
- mnHorAlign( EXC_TXO_HOR_LEFT ),
- mnVerAlign( EXC_TXO_VER_TOP )
+ mnRotation( EXC_OBJ_ORIENT_NONE ),
+ mnHorAlign( EXC_OBJ_HOR_LEFT ),
+ mnVerAlign( EXC_OBJ_VER_TOP )
{
// additional alignment and orientation items
const SfxItemSet& rItemSet = rTextObj.GetMergedItemSet();
@@ -653,18 +654,18 @@ XclTxo::XclTxo( const XclExpRoot& rRoot, const SdrTextObj& rTextObj ) :
// rotation
long nAngle = rTextObj.GetRotateAngle();
if( (4500 < nAngle) && (nAngle < 13500) )
- mnRotation = EXC_TXO_TEXTROT_90_CCW;
+ mnRotation = EXC_OBJ_ORIENT_90CCW;
else if( (22500 < nAngle) && (nAngle < 31500) )
- mnRotation = EXC_TXO_TEXTROT_90_CW;
+ mnRotation = EXC_OBJ_ORIENT_90CW;
else
- mnRotation = EXC_TXO_TEXTROT_NONE;
+ mnRotation = EXC_OBJ_ORIENT_NONE;
}
XclTxo::XclTxo( const XclExpRoot& rRoot, const EditTextObject& rEditObj, SdrObject* pCaption ) :
mpString( XclExpStringHelper::CreateString( rRoot, rEditObj ) ),
- mnRotation( EXC_TXO_TEXTROT_NONE ),
- mnHorAlign( EXC_TXO_HOR_LEFT ),
- mnVerAlign( EXC_TXO_VER_TOP )
+ mnRotation( EXC_OBJ_ORIENT_NONE ),
+ mnHorAlign( EXC_OBJ_HOR_LEFT ),
+ mnVerAlign( EXC_OBJ_VER_TOP )
{
if(pCaption)
{
@@ -693,7 +694,7 @@ XclTxo::XclTxo( const XclExpRoot& rRoot, const EditTextObject& rEditObj, SdrObje
// orientation alignment
const SvxWritingModeItem& rItem = static_cast< const SvxWritingModeItem& >( rItemSet.Get( SDRATTR_TEXTDIRECTION ) );
if( rItem.GetValue() == com::sun::star::text::WritingMode_TB_RL )
- mnRotation = EXC_TXO_TEXTROT_90_CW;
+ mnRotation = EXC_OBJ_ORIENT_90CW;
}
}
@@ -749,7 +750,7 @@ sal_Size XclTxo::GetLen() const
// --- class XclObjOle -------------------------------------------
XclObjOle::XclObjOle( const XclExpRoot& rRoot, const SdrObject& rObj ) :
- XclObj( rRoot, EXC_OBJ_CMO_PICTURE ),
+ XclObj( rRoot, EXC_OBJTYPE_PICTURE ),
rOleObj( rObj ),
pRootStorage( rRoot.GetRootStorage() )
{
@@ -799,26 +800,25 @@ void XclObjOle::WriteSubRecs( XclExpStream& rStrm )
SvxMSExportOLEObjects aOLEExpFilt( nFl );
aOLEExpFilt.ExportOLEObject( xObj, *xOleStg );
- // ftCf subrecord, undocumented as usual
- rStrm.StartRecord( EXC_ID_OBJ_FTCF, 2 );
+ // OBJCF subrecord, undocumented as usual
+ rStrm.StartRecord( EXC_ID_OBJCF, 2 );
rStrm << UINT16(0x0002);
rStrm.EndRecord();
- // ftPioGrbit subrecord, undocumented as usual
- rStrm.StartRecord( EXC_ID_OBJ_FTPIOGRBIT, 2 );
- sal_uInt16 nPioGrbit = 0x0001;
- if ( ((SdrOle2Obj&)rOleObj).GetAspect() == embed::Aspects::MSOLE_ICON )
- ::set_flag( nPioGrbit, EXC_OBJ_PIO_SYMBOL );
- rStrm << nPioGrbit;
+ // OBJFLAGS subrecord, undocumented as usual
+ rStrm.StartRecord( EXC_ID_OBJFLAGS, 2 );
+ sal_uInt16 nFlags = EXC_OBJ_PIC_MANUALSIZE;
+ ::set_flag( nFlags, EXC_OBJ_PIC_SYMBOL, ((SdrOle2Obj&)rOleObj).GetAspect() == embed::Aspects::MSOLE_ICON );
+ rStrm << nFlags;
rStrm.EndRecord();
- // ftPictFmla subrecord, undocumented as usual
+ // OBJPICTFMLA subrecord, undocumented as usual
XclExpString aName( xOleStg->GetUserName() );
UINT16 nPadLen = (UINT16)(aName.GetSize() & 0x01);
UINT16 nFmlaLen = static_cast< sal_uInt16 >( 12 + aName.GetSize() + nPadLen );
UINT16 nSubRecLen = nFmlaLen + 6;
- rStrm.StartRecord( EXC_ID_OBJ_FTPICTFMLA, nSubRecLen );
+ rStrm.StartRecord( EXC_ID_OBJPICTFMLA, nSubRecLen );
rStrm << nFmlaLen
<< sal_uInt16( 5 ) << sal_uInt32( 0 ) << sal_uInt8( 2 )
<< sal_uInt32( 0 ) << sal_uInt8( 3 )
@@ -842,7 +842,7 @@ void XclObjOle::Save( XclExpStream& rStrm )
// --- class XclObjAny -------------------------------------------
XclObjAny::XclObjAny( const XclExpRoot& rRoot ) :
- XclObj( rRoot, EXC_OBJ_CMO_UNKNOWN )
+ XclObj( rRoot, EXC_OBJTYPE_UNKNOWN )
{
}
@@ -852,14 +852,14 @@ XclObjAny::~XclObjAny()
void XclObjAny::WriteSubRecs( XclExpStream& rStrm )
{
- if( mnObjType == EXC_OBJ_CMO_GROUP )
+ if( mnObjType == EXC_OBJTYPE_GROUP )
// ftGmo subrecord
- rStrm << EXC_ID_OBJ_FTGMO << UINT16(2) << UINT16(0);
+ rStrm << EXC_ID_OBJGMO << UINT16(2) << UINT16(0);
}
void XclObjAny::Save( XclExpStream& rStrm )
{
- if( mnObjType == EXC_OBJ_CMO_GROUP )
+ if( mnObjType == EXC_OBJTYPE_GROUP )
// old size + ftGmo
AddRecSize( 6 );
diff --git a/sc/source/ui/inc/cellsh.hxx b/sc/source/ui/inc/cellsh.hxx
index ca13ce63a20b..0bcb2fd20eb9 100644
--- a/sc/source/ui/inc/cellsh.hxx
+++ b/sc/source/ui/inc/cellsh.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: cellsh.hxx,v $
- * $Revision: 1.9 $
+ * $Revision: 1.9.90.1 $
*
* This file is part of OpenOffice.org.
*
@@ -69,6 +69,9 @@ private:
DECL_LINK( ClipboardChanged, TransferableDataHelper* );
DECL_LINK( DialogClosed, AbstractScLinkedAreaDlg* );
+ bool IsFullScreen() const;
+ void SetFullScreen( bool bSet );
+
public:
TYPEINFO();
@@ -101,7 +104,6 @@ public:
void ExecutePageSel( SfxRequest& rReq );
void ExecuteMove( SfxRequest& rReq );
void GetStateCursor( SfxItemSet& rSet );
-
};
#endif
diff --git a/sc/source/ui/inc/formatsh.hxx b/sc/source/ui/inc/formatsh.hxx
index 85ea4b71d88d..06e819a031ef 100644
--- a/sc/source/ui/inc/formatsh.hxx
+++ b/sc/source/ui/inc/formatsh.hxx
@@ -45,6 +45,7 @@ class ScFormatShell: public SfxShell
protected:
ScViewData* GetViewData(){return pViewData;}
+ const ScViewData* GetViewData() const {return pViewData;}
public:
diff --git a/sc/source/ui/inc/navipi.hxx b/sc/source/ui/inc/navipi.hxx
index 9a1236a1facc..54434427d459 100644
--- a/sc/source/ui/inc/navipi.hxx
+++ b/sc/source/ui/inc/navipi.hxx
@@ -31,15 +31,10 @@
#ifndef SC_NAVIPI_HXX
#define SC_NAVIPI_HXX
-#ifndef _TOOLBOX_HXX //autogen
+#include <vector>
#include <vcl/toolbox.hxx>
-#endif
-#ifndef _FIELD_HXX //autogen
#include <vcl/field.hxx>
-#endif
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
#include <svtools/stdctrl.hxx>
#include <svtools/poolitem.hxx>
#include <svtools/lstner.hxx>
@@ -73,29 +68,42 @@ enum NavListMode { NAV_LMODE_NONE = 0x4000,
//========================================================================
// class ScScenarioListBox -----------------------------------------------
//========================================================================
+
class ScScenarioListBox : public ListBox
{
public:
- ScScenarioListBox( Window* pParent );
- ~ScScenarioListBox();
+ explicit ScScenarioListBox( ScScenarioWindow& rParent );
+ virtual ~ScScenarioListBox();
- void UpdateEntries( List* pNewEntryList );
+ void UpdateEntries( List* pNewEntryList );
protected:
- virtual void Select();
- virtual void DoubleClick();
- virtual void GetFocus();
- virtual void LoseFocus();
- virtual long Notify( NotifyEvent& rNEvt );
+ virtual void Select();
+ virtual void DoubleClick();
+ virtual long Notify( NotifyEvent& rNEvt );
+
+private:
+ struct ScenarioEntry
+ {
+ String maName;
+ String maComment;
+ bool mbProtected;
+
+ inline explicit ScenarioEntry() : mbProtected( false ) {}
+ };
+ typedef ::std::vector< ScenarioEntry > ScenarioList;
+
+private:
+ const ScenarioEntry* GetSelectedEntry() const;
+
+ void ExecuteScenarioSlot( USHORT nSlotId );
+ void SelectScenario();
+ void EditScenario();
+ void DeleteScenario( bool bQueryBox );
private:
- ScScenarioWindow& rParent;
- List aEntryList;
- String aCurText;
- Accelerator* pAccel;
- void ClearEntryList();
- void CopyEntryList( List& rNewList );
- DECL_LINK( AccelSelectHdl, Accelerator * );
+ ScScenarioWindow& mrParent;
+ ScenarioList maEntries;
};
//========================================================================
@@ -245,8 +253,8 @@ private:
RowEdit aEdRow;
CommandToolBox aTbxCmd;
ScContentTree aLbEntries;
- ScDocListBox aLbDocuments;
ScScenarioWindow aWndScenarios;
+ ScDocListBox aLbDocuments;
Timer aContentTimer;
diff --git a/sc/source/ui/navipi/makefile.mk b/sc/source/ui/navipi/makefile.mk
index f971ee06467b..cfa2f84297d0 100644
--- a/sc/source/ui/navipi/makefile.mk
+++ b/sc/source/ui/navipi/makefile.mk
@@ -1,14 +1,14 @@
#*************************************************************************
#
# 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: makefile.mk,v $
#
-# $Revision: 1.6 $
+# $Revision: 1.6.90.1 $
#
# This file is part of OpenOffice.org.
#
@@ -43,9 +43,14 @@ TARGET=navipi
# --- Files --------------------------------------------------------
-CXXFILES = navipi.cxx navcitem.cxx scenwnd.cxx content.cxx
-SLOFILES = $(SLO)$/navipi.obj $(SLO)$/navcitem.obj $(SLO)$/scenwnd.obj \
- $(SLO)$/content.obj
+SLOFILES = \
+ $(SLO)$/navipi.obj \
+ $(SLO)$/navcitem.obj \
+ $(SLO)$/scenwnd.obj \
+ $(SLO)$/content.obj
+
+EXCEPTIONSFILES = \
+ $(SLO)$/scenwnd.obj
SRS1NAME=$(TARGET)
SRC1FILES = navipi.src
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index 257382c1c6f0..a71bbbd52981 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -670,8 +670,8 @@ ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, Win
aEdRow ( this, ScResId( ED_ROW ) ),
aTbxCmd ( this, ScResId( TBX_CMD ) ),
aLbEntries ( this, ScResId( LB_ENTRIES ) ),
- aLbDocuments( this, ScResId( LB_DOCUMENTS ) ),
aWndScenarios( this,ScResId( STR_QHLP_SCEN_LISTBOX), ScResId(STR_QHLP_SCEN_COMMENT)),
+ aLbDocuments( this, ScResId( LB_DOCUMENTS ) ),
aStrDragMode ( ScResId( STR_DRAGMODE ) ),
aStrDisplay ( ScResId( STR_DISPLAY ) ),
aStrActiveWin( ScResId( STR_ACTIVEWIN ) ),
diff --git a/sc/source/ui/navipi/scenwnd.cxx b/sc/source/ui/navipi/scenwnd.cxx
index bd688f611889..55f26b682034 100644
--- a/sc/source/ui/navipi/scenwnd.cxx
+++ b/sc/source/ui/navipi/scenwnd.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: scenwnd.cxx,v $
- * $Revision: 1.9 $
+ * $Revision: 1.9.90.1 $
*
* This file is part of OpenOffice.org.
*
@@ -48,19 +48,13 @@
#include "sc.hrc"
#include "globstr.hrc"
-//------------------------------------------------------------------------
-
-
//========================================================================
// class ScScenarioWindow ------------------------------------------------
//========================================================================
-// -----------------------------------------------------------------------
-
-ScScenarioListBox::ScScenarioListBox( Window* pParent )
- : ListBox ( pParent, WB_BORDER ),
- rParent ( (ScScenarioWindow&)*pParent ),
- pAccel ( NULL )
+ScScenarioListBox::ScScenarioListBox( ScScenarioWindow& rParent ) :
+ ListBox( &rParent, WB_BORDER | WB_TABSTOP ),
+ mrParent( rParent )
{
Font aFont( GetFont() );
aFont.SetTransparent( TRUE );
@@ -68,151 +62,71 @@ ScScenarioListBox::ScScenarioListBox( Window* pParent )
SetFont( aFont );
}
-// -----------------------------------------------------------------------
-
-__EXPORT ScScenarioListBox::~ScScenarioListBox()
+ScScenarioListBox::~ScScenarioListBox()
{
- ClearEntryList();
- delete pAccel;
}
-// -----------------------------------------------------------------------
-
void ScScenarioListBox::UpdateEntries( List* pNewEntryList )
{
- ClearEntryList();
Clear();
+ maEntries.clear();
+
+ if( !pNewEntryList )
+ return;
- if ( pNewEntryList )
+ switch( pNewEntryList->Count() )
{
- if ( pNewEntryList->Count() > 1 )
- {
- CopyEntryList( *pNewEntryList );
- SetUpdateMode( FALSE );
+ case 0:
+ // no scenarios in current sheet
+ mrParent.SetComment( EMPTY_STRING );
+ break;
- String* pEntry = (String*)aEntryList.First();
+ case 1:
+ // sheet is a scenario container, comment only
+ mrParent.SetComment( *static_cast< String* >( pNewEntryList->First() ) );
+ break;
- while ( pEntry )
+ default:
+ {
+ // sheet contains scenarios
+ DBG_ASSERT( pNewEntryList->Count() % 3 == 0, "ScScenarioListBox::UpdateEntries - wrong list size" );
+ SetUpdateMode( FALSE );
+ String* pEntry = static_cast< String* >( pNewEntryList->First() );
+ while( pEntry )
{
- InsertEntry( *pEntry, LISTBOX_APPEND );
- aEntryList.Next(); // Skip the comment
- aEntryList.Next(); // Skip the protection
- pEntry = (String*)aEntryList.Next();
+ ScenarioEntry aEntry;
+
+ // first entry of a triple is the scenario name
+ aEntry.maName = *pEntry;
+ // second entry of a triple is the scenario comment
+ if( (pEntry = static_cast< String* >( pNewEntryList->Next() )) != 0 )
+ aEntry.maComment = *pEntry;
+ // third entry of a triple is the protection ("0" = not protected, "1" = protected)
+ if( (pEntry = static_cast< String* >( pNewEntryList->Next() )) != 0 )
+ aEntry.mbProtected = (pEntry->Len() > 0) && (pEntry->GetChar( 0 ) != '0');
+
+ maEntries.push_back( aEntry );
+ InsertEntry( aEntry.maName, LISTBOX_APPEND );
+ pEntry = static_cast< String* >( pNewEntryList->Next() );
}
-
SetUpdateMode( TRUE );
SetNoSelection();
- rParent.SetComment( EMPTY_STRING );
+ mrParent.SetComment( EMPTY_STRING );
}
- else if ( pNewEntryList->Count() == 1 )
- // Tabelle ist Scenario-Tabelle: nur Kommentar
- rParent.SetComment( *((String*)pNewEntryList->First()) );
- else
- rParent.SetComment( EMPTY_STRING ); // normale Tabelle ohne Szenarien
}
}
-// -----------------------------------------------------------------------
-
-void ScScenarioListBox::ClearEntryList()
-{
- String* pEntry = (String*)aEntryList.First();
-
- while ( pEntry )
- {
- delete pEntry;
- pEntry = (String*)aEntryList.Next();
- }
- aEntryList.Clear();
-}
-
-// -----------------------------------------------------------------------
-
-void ScScenarioListBox::CopyEntryList( List& rNewList )
-{
- if ( aEntryList.Count() > 0 )
- ClearEntryList();
-
- String* pEntry = (String*)rNewList.First();
-
- while ( pEntry )
- {
- aEntryList.Insert( new String( *pEntry ), LIST_APPEND );
- pEntry = (String*)rNewList.Next();
- }
-}
-
-// -----------------------------------------------------------------------
-
-void __EXPORT ScScenarioListBox::Select()
-{
- String* pEntry = (String*)aEntryList.GetObject( (GetSelectEntryPos()*3)+1 );
-
- if ( pEntry )
- rParent.SetComment( *pEntry );
-}
-
-// -----------------------------------------------------------------------
-
-void __EXPORT ScScenarioListBox::DoubleClick()
-{
- SfxStringItem aStringItem( SID_SELECT_SCENARIO, GetSelectEntry() );
-
- SfxViewFrame* pViewFrm = SfxViewFrame::Current();
- if (pViewFrm)
- pViewFrm->GetDispatcher()->Execute( SID_SELECT_SCENARIO,
- SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD,
- &aStringItem, 0L, 0L );
-}
-
-// -----------------------------------------------------------------------
-
-void __EXPORT ScScenarioListBox::GetFocus()
+void ScScenarioListBox::Select()
{
- pAccel = new Accelerator;
-
- pAccel->InsertItem( 1, KeyCode( KEY_RETURN ) );
- pAccel->InsertItem( 2, KeyCode( KEY_ESCAPE ) );
- pAccel->SetSelectHdl( LINK( this, ScScenarioListBox, AccelSelectHdl ) );
-
- Application::InsertAccel( pAccel );
- aCurText = GetText();
+ if( const ScenarioEntry* pEntry = GetSelectedEntry() )
+ mrParent.SetComment( pEntry->maComment );
}
-// -----------------------------------------------------------------------
-
-void __EXPORT ScScenarioListBox::LoseFocus()
+void ScScenarioListBox::DoubleClick()
{
- Application::RemoveAccel( pAccel );
- delete pAccel;
- pAccel = NULL;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( ScScenarioListBox, AccelSelectHdl, Accelerator *, pSelAccel )
-{
- if ( !pSelAccel ) return 0;
-
- switch ( pSelAccel->GetCurKeyCode().GetCode() )
- {
- case KEY_RETURN:
- Select();
- break;
-
- case KEY_ESCAPE:
- SelectEntry( aCurText );
- Select();
- break;
-
- default:
- break;
- }
- return 0;
+ SelectScenario();
}
-//---------------------------------------------------------------
-
long ScScenarioListBox::Notify( NotifyEvent& rNEvt )
{
bool bHandled = false;
@@ -220,10 +134,16 @@ long ScScenarioListBox::Notify( NotifyEvent& rNEvt )
if( rNEvt.GetType() == EVENT_KEYINPUT )
{
KeyCode aCode = rNEvt.GetKeyEvent()->GetKeyCode();
- if( KEY_RETURN == aCode.GetCode() )
+ switch( aCode.GetCode() )
{
- DoubleClick();
- bHandled = true;
+ case KEY_RETURN:
+ SelectScenario();
+ bHandled = true;
+ break;
+ case KEY_DELETE:
+ DeleteScenario( true );
+ bHandled = true;
+ break;
}
}
else if ( rNEvt.GetType() == EVENT_COMMAND && GetSelectEntryCount() )
@@ -231,38 +151,24 @@ long ScScenarioListBox::Notify( NotifyEvent& rNEvt )
const CommandEvent* pCEvt = rNEvt.GetCommandEvent();
if ( pCEvt && pCEvt->GetCommand() == COMMAND_CONTEXTMENU )
{
- String* pProtect = (String*)aEntryList.GetObject( (GetSelectEntryPos()*3)+2 );
- if(pProtect && pProtect->GetChar(0) == '0')
+ if( const ScenarioEntry* pEntry = GetSelectedEntry() )
{
- ScPopupMenu aPopup( ScResId( RID_POPUP_NAVIPI_SCENARIO ) );
- aPopup.Execute( this, pCEvt->GetMousePosPixel() );
- if (aPopup.WasHit())
+ if( !pEntry->mbProtected )
{
- String aName = GetSelectEntry();
- USHORT nId = aPopup.GetSelected();
- if ( nId == RID_NAVIPI_SCENARIO_DELETE )
+ ScPopupMenu aPopup( ScResId( RID_POPUP_NAVIPI_SCENARIO ) );
+ aPopup.Execute( this, pCEvt->GetMousePosPixel() );
+ if (aPopup.WasHit())
{
- short nRes = QueryBox( NULL, WinBits( WB_YES_NO | WB_DEF_YES ),
- ScGlobal::GetRscString(STR_QUERY_DELSCENARIO) ).Execute();
- if ( nRes == RET_YES )
+ switch( aPopup.GetSelected() )
{
- SfxStringItem aStringItem( SID_DELETE_SCENARIO, aName );
- SfxViewFrame* pViewFrm = SfxViewFrame::Current();
- if (pViewFrm)
- pViewFrm->GetDispatcher()->Execute( SID_DELETE_SCENARIO,
- SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD,
- &aStringItem, 0L, 0L );
+ case RID_NAVIPI_SCENARIO_DELETE:
+ DeleteScenario( true );
+ break;
+ case RID_NAVIPI_SCENARIO_EDIT:
+ EditScenario();
+ break;
}
}
- else if ( nId == RID_NAVIPI_SCENARIO_EDIT )
- {
- SfxStringItem aStringItem( SID_EDIT_SCENARIO, aName );
- SfxViewFrame* pViewFrm = SfxViewFrame::Current();
- if (pViewFrm)
- pViewFrm->GetDispatcher()->Execute( SID_EDIT_SCENARIO,
- SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD,
- &aStringItem, 0L, 0L );
- }
}
}
bHandled = true;
@@ -272,6 +178,39 @@ long ScScenarioListBox::Notify( NotifyEvent& rNEvt )
return bHandled ? 1 : ListBox::Notify( rNEvt );
}
+const ScScenarioListBox::ScenarioEntry* ScScenarioListBox::GetSelectedEntry() const
+{
+ size_t nPos = GetSelectEntryPos();
+ return (nPos < maEntries.size()) ? &maEntries[ nPos ] : 0;
+}
+
+void ScScenarioListBox::ExecuteScenarioSlot( USHORT nSlotId )
+{
+ if( SfxViewFrame* pViewFrm = SfxViewFrame::Current() )
+ {
+ SfxStringItem aStringItem( nSlotId, GetSelectEntry() );
+ pViewFrm->GetDispatcher()->Execute( nSlotId, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD, &aStringItem, 0L, 0L );
+ }
+}
+
+void ScScenarioListBox::SelectScenario()
+{
+ if( GetSelectEntryCount() > 0 )
+ ExecuteScenarioSlot( SID_SELECT_SCENARIO );
+}
+
+void ScScenarioListBox::EditScenario()
+{
+ if( GetSelectEntryCount() > 0 )
+ ExecuteScenarioSlot( SID_EDIT_SCENARIO );
+}
+
+void ScScenarioListBox::DeleteScenario( bool bQueryBox )
+{
+ if( GetSelectEntryCount() > 0 )
+ if( !bQueryBox || (::QueryBox( 0, WinBits( WB_YES_NO | WB_DEF_YES ), ScGlobal::GetRscString( STR_QUERY_DELSCENARIO ) ).Execute() == RET_YES) )
+ ExecuteScenarioSlot( SID_DELETE_SCENARIO );
+}
//========================================================================
// class ScScenarioWindow ------------------------------------------------
@@ -279,10 +218,9 @@ long ScScenarioListBox::Notify( NotifyEvent& rNEvt )
ScScenarioWindow::ScScenarioWindow( Window* pParent,const String& aQH_List,
const String& aQH_Comment)
- : Window ( pParent ),
- aLbScenario ( this ),
- aEdComment ( this, WB_BORDER | WB_LEFT
- | WB_READONLY | WB_VSCROLL )
+ : Window ( pParent, WB_TABSTOP | WB_DIALOGCONTROL ),
+ aLbScenario ( *this ),
+ aEdComment ( this, WB_BORDER | WB_LEFT | WB_READONLY | WB_VSCROLL | WB_TABSTOP )
{
Font aFont( GetFont() );
aFont.SetTransparent( TRUE );
@@ -310,7 +248,7 @@ ScScenarioWindow::ScScenarioWindow( Window* pParent,const String& aQH_List,
// -----------------------------------------------------------------------
-__EXPORT ScScenarioWindow::~ScScenarioWindow()
+ScScenarioWindow::~ScScenarioWindow()
{
}
diff --git a/sc/source/ui/src/popup.src b/sc/source/ui/src/popup.src
index 36c222555890..6ce799518bd3 100644
--- a/sc/source/ui/src/popup.src
+++ b/sc/source/ui/src/popup.src
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: popup.src,v $
- * $Revision: 1.58 $
+ * $Revision: 1.58.90.1 $
*
* This file is part of OpenOffice.org.
*
@@ -349,7 +349,7 @@ Menu RID_POPUP_EDIT
{
Identifier = SID_SET_SUPER_SCRIPT ;
HelpID = SID_SET_SUPER_SCRIPT ;
- Text [ en-US ] = "S~uperscript" ;
+ Text [ en-US ] = "Su~perscript" ;
};
MenuItem
{
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 26a8e2122cba..97bec0eb9fcb 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -1058,6 +1058,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
pDocSh->GetUndoManager()->LeaveListAction();
}
+ delete pDlg;
}
}
break;
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 97a0dff17ec2..b05b86608a4f 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: cellsh3.cxx,v $
- * $Revision: 1.24 $
+ * $Revision: 1.24.90.1 $
*
* This file is part of OpenOffice.org.
*
@@ -895,6 +895,8 @@ void ScCellShell::Execute( SfxRequest& rReq )
pTabViewShell->ResetBrushDocument(); // abort format paint brush
else if (pTabViewShell->HasHintWindow())
pTabViewShell->RemoveHintWindow(); // Eingabemeldung abschalten
+ else if( IsFullScreen() )
+ SetFullScreen( false );
else
{
// TODO/LATER: when is this code executed?
@@ -961,5 +963,27 @@ void ScCellShell::Execute( SfxRequest& rReq )
}
}
+bool ScCellShell::IsFullScreen() const
+{
+ USHORT nSlot = SID_WIN_FULLSCREEN;
+ ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell();
+ SfxBindings& rBindings = pTabViewShell->GetViewFrame()->GetBindings();
+ SfxPoolItem* pItem = 0;
+ bool bIsFullScreen = false;
+
+ if (rBindings.QueryState( nSlot, pItem ) >= SFX_ITEM_DEFAULT)
+ bIsFullScreen = static_cast< SfxBoolItem* >( pItem )->GetValue();
+ return bIsFullScreen;
+}
+
+void ScCellShell::SetFullScreen( bool bSet )
+{
+ if( IsFullScreen() != bSet )
+ {
+ ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell();
+ SfxBoolItem aItem( SID_WIN_FULLSCREEN, bSet );
+ pTabViewShell->GetDispatcher()->Execute( SID_WIN_FULLSCREEN, SFX_CALLMODE_RECORD, &aItem, 0L );
+ }
+}
diff --git a/scaddins/source/analysis/analysis.cxx b/scaddins/source/analysis/analysis.cxx
index 57afc69bcbee..5f9e60d9b428 100644
--- a/scaddins/source/analysis/analysis.cxx
+++ b/scaddins/source/analysis/analysis.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: analysis.cxx,v $
- * $Revision: 1.46 $
+ * $Revision: 1.46.20.1 $
*
* This file is part of OpenOffice.org.
*
@@ -687,7 +687,7 @@ sal_Int32 SAL_CALL AnalysisAddIn::getEomonth( constREFXPS& xOpt, sal_Int32 nDate
else if( nNewMonth < 1 )
{
nNewMonth = -nNewMonth;
- nYear = sal::static_int_cast<sal_uInt16>( nYear + ( nNewMonth / 12 ) );
+ nYear = sal::static_int_cast<sal_uInt16>( nYear - ( nNewMonth / 12 ) );
nYear--;
nNewMonth %= 12;
nNewMonth = 12 - nNewMonth;