diff options
Diffstat (limited to 'sc/source/filter/excel')
57 files changed, 981 insertions, 567 deletions
diff --git a/sc/source/filter/excel/colrowst.cxx b/sc/source/filter/excel/colrowst.cxx index b1ec8752de7b..3a48aa6b96ba 100644 --- a/sc/source/filter/excel/colrowst.cxx +++ b/sc/source/filter/excel/colrowst.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: colrowst.cxx,v $ - * $Revision: 1.34.32.1 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -43,6 +40,7 @@ #include "xltable.hxx" #include "xistream.hxx" #include "xistyle.hxx" +#include "queryparam.hxx" // for filter manager #include "excimp8.hxx" diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx index 45633b1d07e4..bba1543dd403 100644 --- a/sc/source/filter/excel/excdoc.cxx +++ b/sc/source/filter/excel/excdoc.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: excdoc.cxx,v $ - * $Revision: 1.69.60.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -40,10 +37,10 @@ #include <svx/svdobj.hxx> #include <svx/svditer.hxx> #include <svx/svdpage.hxx> -#include <svx/lrspitem.hxx> -#include <svx/ulspitem.hxx> -#include <svtools/intitem.hxx> -#include <svtools/zformat.hxx> +#include <editeng/lrspitem.hxx> +#include <editeng/ulspitem.hxx> +#include <svl/intitem.hxx> +#include <svl/zformat.hxx> #include <sot/storage.hxx> #include <sfx2/objsh.hxx> #include <tools/urlobj.hxx> @@ -233,7 +230,7 @@ void ExcTable::FillAsHeader( ExcBoundsheetList& rBoundsheetList ) Add( new XclExpFilePass( GetRoot() ) ); Add( new XclExpInterfaceHdr( nCodePage ) ); Add( new XclExpUInt16Record( EXC_ID_MMS, 0 ) ); - Add( new XclExpEmptyRecord( EXC_ID_INTERFACEEND ) ); + Add( new XclExpInterfaceEnd ); Add( new XclExpWriteAccess ); } diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx index 8365ef0db3f9..3a43a23cd624 100644 --- a/sc/source/filter/excel/excel.cxx +++ b/sc/source/filter/excel/excel.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: excel.cxx,v $ - * $Revision: 1.26.32.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -43,7 +40,7 @@ #include <com/sun/star/document/XFilter.hpp> #include <com/sun/star/document/XImporter.hpp> #include "scitems.hxx" -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include "filter.hxx" #include "document.hxx" #include "xistream.hxx" diff --git a/sc/source/filter/excel/excform.cxx b/sc/source/filter/excel/excform.cxx index 6d83f263d47b..5642c098027e 100644 --- a/sc/source/filter/excel/excform.cxx +++ b/sc/source/filter/excel/excform.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: excform.cxx,v $ - * $Revision: 1.52.4.1 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/sc/source/filter/excel/excform8.cxx b/sc/source/filter/excel/excform8.cxx index 10fc15c633b6..608d65dfc801 100644 --- a/sc/source/filter/excel/excform8.cxx +++ b/sc/source/filter/excel/excform8.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: excform8.cxx,v $ - * $Revision: 1.47.134.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index deaa3b375c6d..e424ad2d95fe 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: excimp8.cxx,v $ - * $Revision: 1.127.4.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -36,27 +33,27 @@ #include <scitems.hxx> #include <comphelper/processfactory.hxx> -#include <svtools/fltrcfg.hxx> +#include <unotools/fltrcfg.hxx> #include <svtools/wmf.hxx> -#include <svx/eeitem.hxx> +#include <editeng/eeitem.hxx> #include <sfx2/docfile.hxx> #include <sfx2/objsh.hxx> -#include <svx/brshitem.hxx> -#include <svx/editdata.hxx> -#include <svx/editeng.hxx> -#include <svx/editobj.hxx> -#include <svx/editstat.hxx> -#include <svx/colritem.hxx> -#include <svx/udlnitem.hxx> -#include <svx/wghtitem.hxx> -#include <svx/postitem.hxx> -#include <svx/crsditem.hxx> -#include <svx/flditem.hxx> +#include <editeng/brshitem.hxx> +#include <editeng/editdata.hxx> +#include <editeng/editeng.hxx> +#include <editeng/editobj.hxx> +#include <editeng/editstat.hxx> +#include <editeng/colritem.hxx> +#include <editeng/udlnitem.hxx> +#include <editeng/wghtitem.hxx> +#include <editeng/postitem.hxx> +#include <editeng/crsditem.hxx> +#include <editeng/flditem.hxx> #include <svx/xflclit.hxx> -#include <svx/svxmsbas.hxx> +#include <filter/msfilter/svxmsbas.hxx> #include <vcl/graph.hxx> #include <vcl/bmpacc.hxx> @@ -102,6 +99,10 @@ #include <com/sun/star/document/XDocumentProperties.hpp> #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> +#include <basic/basmgr.hxx> +#include <cppuhelper/component_context.hxx> +#include <com/sun/star/container/XNameContainer.hpp> +#include <sfx2/app.hxx> using namespace com::sun::star; @@ -113,7 +114,7 @@ using namespace com::sun::star; ImportExcel8::ImportExcel8( XclImpRootData& rImpData, SvStream& rStrm ) : - ImportExcel( rImpData, rStrm ) + ImportExcel( rImpData, rStrm ), mnTab(0) { delete pFormConv; @@ -236,9 +237,15 @@ void ImportExcel8::Codename( BOOL bWorkbookGlobals ) if( aName.Len() ) { if( bWorkbookGlobals ) + { GetExtDocOptions().GetDocSettings().maGlobCodeName = aName; + GetDoc().SetCodeName( aName ); + } else + { GetExtDocOptions().AppendCodeName( aName ); + GetDoc().SetCodeName( mnTab++, aName ); + } } } } @@ -248,16 +255,6 @@ void ImportExcel8::SheetProtection( void ) GetSheetProtectBuffer().ReadOptions( aIn, GetCurrScTab() ); } -bool lcl_hasVBAEnabled() -{ - uno::Reference< beans::XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY); - // test if vba service is present - uno::Reference< uno::XComponentContext > xCtx( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY ); - uno::Reference< uno::XInterface > xGlobals( xCtx->getValueByName( ::rtl::OUString::createFromAscii( "/singletons/ooo.vba.theGlobals") ), uno::UNO_QUERY ); - - return xGlobals.is(); -} - void ImportExcel8::ReadBasic( void ) { bHasBasic = TRUE; @@ -273,7 +270,7 @@ void ImportExcel8::ReadBasic( void ) if( bLoadCode || bLoadStrg ) { SvxImportMSVBasic aBasicImport( *pShell, *xRootStrg, bLoadCode, bLoadStrg ); - bool bAsComment = !bLoadExecutable || !lcl_hasVBAEnabled(); + bool bAsComment = !bLoadExecutable; aBasicImport.Import( EXC_STORAGE_VBA_PROJECT, EXC_STORAGE_VBA, bAsComment ); } } diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx index 1a2a35b44f83..9a66325db419 100644 --- a/sc/source/filter/excel/excrecds.cxx +++ b/sc/source/filter/excel/excrecds.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: excrecds.cxx,v $ - * $Revision: 1.88 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -38,37 +35,37 @@ #include "excrecds.hxx" #include <map> -#include <svx/countryid.hxx> +#include <filter/msfilter/countryid.hxx> #include "scitems.hxx" -#include <svx/eeitem.hxx> +#include <editeng/eeitem.hxx> #include <sfx2/objsh.hxx> -#include <svx/editdata.hxx> -#include <svx/editeng.hxx> -#include <svx/editobj.hxx> -#include <svx/editstat.hxx> +#include <editeng/editdata.hxx> +#include <editeng/editeng.hxx> +#include <editeng/editobj.hxx> +#include <editeng/editstat.hxx> -#include <svx/flditem.hxx> -#include <svx/flstitem.hxx> +#include <editeng/flditem.hxx> +#include <editeng/flstitem.hxx> #include <svx/algitem.hxx> -#include <svx/boxitem.hxx> -#include <svx/brshitem.hxx> +#include <editeng/boxitem.hxx> +#include <editeng/brshitem.hxx> #include <svx/pageitem.hxx> -#include <svx/paperinf.hxx> -#include <svx/sizeitem.hxx> -#include <svx/ulspitem.hxx> -#include <svx/fhgtitem.hxx> -#include <svx/escpitem.hxx> -#include <svtools/intitem.hxx> -#include <svtools/zforlist.hxx> -#include <svtools/zformat.hxx> +#include <editeng/paperinf.hxx> +#include <editeng/sizeitem.hxx> +#include <editeng/ulspitem.hxx> +#include <editeng/fhgtitem.hxx> +#include <editeng/escpitem.hxx> +#include <svl/intitem.hxx> +#include <svl/zforlist.hxx> +#include <svl/zformat.hxx> #include <svtools/ctrltool.hxx> #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <string.h> @@ -457,7 +454,7 @@ XclExpCountry::XclExpCountry( const XclExpRoot& rRoot ) : /* #i31530# set document country as UI country too - needed for correct behaviour of number formats. */ mnUICountry = mnDocCountry = static_cast< sal_uInt16 >( - ::svx::ConvertLanguageToCountry( rRoot.GetDocLanguage() ) ); + ::msfilter::ConvertLanguageToCountry( rRoot.GetDocLanguage() ) ); } void XclExpCountry::WriteBody( XclExpStream& rStrm ) diff --git a/sc/source/filter/excel/exctools.cxx b/sc/source/filter/excel/exctools.cxx index 22ede7548203..e6453c2f11e2 100644 --- a/sc/source/filter/excel/exctools.cxx +++ b/sc/source/filter/excel/exctools.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: exctools.cxx,v $ - * $Revision: 1.61.32.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -36,12 +33,12 @@ //------------------------------------------------------------------------ #include "scitems.hxx" -#include <svx/eeitem.hxx> +#include <editeng/eeitem.hxx> -#include <svx/editdata.hxx> -#include <svx/editeng.hxx> -#include <svx/editobj.hxx> -#include <svx/editstat.hxx> +#include <editeng/editdata.hxx> +#include <editeng/editeng.hxx> +#include <editeng/editobj.hxx> +#include <editeng/editstat.hxx> #include "document.hxx" #include "patattr.hxx" diff --git a/sc/source/filter/excel/expop2.cxx b/sc/source/filter/excel/expop2.cxx index 774f517dada6..dbe70ae6a0ee 100644 --- a/sc/source/filter/excel/expop2.cxx +++ b/sc/source/filter/excel/expop2.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: expop2.cxx,v $ - * $Revision: 1.35.14.1 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -35,11 +32,11 @@ //------------------------------------------------------------------------ -#include <svtools/fltrcfg.hxx> +#include <unotools/fltrcfg.hxx> #include <sfx2/objsh.hxx> #include <sfx2/docinf.hxx> -#include <svx/svxmsbas.hxx> +#include <filter/msfilter/svxmsbas.hxx> #include "scerrors.hxx" #include "scextopt.hxx" diff --git a/sc/source/filter/excel/fontbuff.cxx b/sc/source/filter/excel/fontbuff.cxx index f1e2c920a731..dca6723181ae 100644 --- a/sc/source/filter/excel/fontbuff.cxx +++ b/sc/source/filter/excel/fontbuff.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: fontbuff.cxx,v $ - * $Revision: 1.16 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -34,14 +31,14 @@ #include "lotfntbf.hxx" #include "scitems.hxx" -#include <svx/cntritem.hxx> -#include <svx/crsditem.hxx> -#include <svx/eeitem.hxx> -#include <svx/postitem.hxx> -#include <svx/shdditem.hxx> -#include <svx/escpitem.hxx> -#include <svx/udlnitem.hxx> -#include <svx/wghtitem.hxx> +#include <editeng/cntritem.hxx> +#include <editeng/crsditem.hxx> +#include <editeng/eeitem.hxx> +#include <editeng/postitem.hxx> +#include <editeng/shdditem.hxx> +#include <editeng/escpitem.hxx> +#include <editeng/udlnitem.hxx> +#include <editeng/wghtitem.hxx> #include <sfx2/printer.hxx> #include "attrib.hxx" diff --git a/sc/source/filter/excel/frmbase.cxx b/sc/source/filter/excel/frmbase.cxx index db50598d30b6..78883b4a5c76 100644 --- a/sc/source/filter/excel/frmbase.cxx +++ b/sc/source/filter/excel/frmbase.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: frmbase.cxx,v $ - * $Revision: 1.10.32.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx index 5b11b943d2c2..e62f050f2351 100644 --- a/sc/source/filter/excel/impop.cxx +++ b/sc/source/filter/excel/impop.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: impop.cxx,v $ - * $Revision: 1.95.36.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -33,21 +30,21 @@ #include "imp_op.hxx" -#include <svx/countryid.hxx> +#include <filter/msfilter/countryid.hxx> #include "scitems.hxx" -#include <svx/eeitem.hxx> +#include <editeng/eeitem.hxx> -#include <svx/editdata.hxx> -#include <svx/editeng.hxx> -#include <svx/editobj.hxx> -#include <svx/editstat.hxx> -#include <svx/flditem.hxx> +#include <editeng/editdata.hxx> +#include <editeng/editeng.hxx> +#include <editeng/editobj.hxx> +#include <editeng/editstat.hxx> +#include <editeng/flditem.hxx> #include <svx/pageitem.hxx> -#include <svx/colritem.hxx> +#include <editeng/colritem.hxx> #include <sfx2/printer.hxx> #include <sfx2/docfile.hxx> -#include <svtools/zforlist.hxx> +#include <svl/zforlist.hxx> #include <sfx2/objsh.hxx> #include "docuno.hxx" @@ -731,12 +728,12 @@ void ImportExcel::Country( void ) maStrm >> nUICountry >> nDocCountry; // Store system language in XclRoot - LanguageType eLanguage = ::svx::ConvertCountryToLanguage( static_cast< ::svx::CountryId >( nDocCountry ) ); + LanguageType eLanguage = ::msfilter::ConvertCountryToLanguage( static_cast< ::msfilter::CountryId >( nDocCountry ) ); if( eLanguage != LANGUAGE_DONTKNOW ) SetDocLanguage( eLanguage ); // Set Excel UI language in add-in name translator - eLanguage = ::svx::ConvertCountryToLanguage( static_cast< ::svx::CountryId >( nUICountry ) ); + eLanguage = ::msfilter::ConvertCountryToLanguage( static_cast< ::msfilter::CountryId >( nUICountry ) ); if( eLanguage != LANGUAGE_DONTKNOW ) SetUILanguage( eLanguage ); } diff --git a/sc/source/filter/excel/makefile.mk b/sc/source/filter/excel/makefile.mk index 4c94b0712d89..33a5babda815 100644 --- a/sc/source/filter/excel/makefile.mk +++ b/sc/source/filter/excel/makefile.mk @@ -1,15 +1,11 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.42.90.3 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/sc/source/filter/excel/namebuff.cxx b/sc/source/filter/excel/namebuff.cxx index b01f5a728263..7db7d17ed307 100644 --- a/sc/source/filter/excel/namebuff.cxx +++ b/sc/source/filter/excel/namebuff.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: namebuff.cxx,v $ - * $Revision: 1.26.32.1 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx index 53ec6b74907d..637a4777c8ed 100644 --- a/sc/source/filter/excel/read.cxx +++ b/sc/source/filter/excel/read.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: read.cxx,v $ - * $Revision: 1.70.88.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -1195,6 +1192,7 @@ FltError ImportExcel8::Read( void ) case EXC_ID_SXDI: rPTableMgr.ReadSxdi( maStrm ); break; case EXC_ID_SXVDEX: rPTableMgr.ReadSxvdex( maStrm ); break; case EXC_ID_SXEX: rPTableMgr.ReadSxex( maStrm ); break; + case EXC_ID_SXVIEWEX9: rPTableMgr.ReadSxViewEx9( maStrm ); break; } } break; @@ -1229,6 +1227,9 @@ FltError ImportExcel8::Read( void ) eLastErr = SCWARN_IMPORT_ROW_OVERFLOW; else if( rAddrConv.IsColTruncated() ) eLastErr = SCWARN_IMPORT_COLUMN_OVERFLOW; + + if( GetBiff() == EXC_BIFF8 ) + GetPivotTableManager().MaybeRefreshPivotTables(); } return eLastErr; diff --git a/sc/source/filter/excel/tokstack.cxx b/sc/source/filter/excel/tokstack.cxx index 34c2b9284fed..8685f404543a 100644 --- a/sc/source/filter/excel/tokstack.cxx +++ b/sc/source/filter/excel/tokstack.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: tokstack.cxx,v $ - * $Revision: 1.14.32.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx index 12a17c2d7f14..1564b2db834e 100644 --- a/sc/source/filter/excel/xechart.cxx +++ b/sc/source/filter/excel/xechart.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xechart.cxx,v $ - * $Revision: 1.10.62.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -59,7 +56,7 @@ #include <com/sun/star/chart2/TickmarkStyle.hpp> #include <vcl/outdev.hxx> -#include <svx/escherex.hxx> +#include <filter/msfilter/escherex.hxx> #include "document.hxx" #include "rangelst.hxx" diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index 1d09082ede82..7bfd57be7290 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xecontent.cxx,v $ - * $Revision: 1.23 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -40,11 +37,11 @@ #include <com/sun/star/sheet/XAreaLink.hpp> #include <sfx2/objsh.hxx> #include <tools/urlobj.hxx> -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #include <formula/grammar.hxx> #include "scitems.hxx" -#include <svx/eeitem.hxx> -#include <svx/flditem.hxx> +#include <editeng/eeitem.hxx> +#include <editeng/flditem.hxx> #include "document.hxx" #include "validat.hxx" #include "unonames.hxx" @@ -748,19 +745,19 @@ void XclExpCFImpl::WriteBody( XclExpStream& rStrm ) // font used flag for underline -> 0 = used, 1 = default sal_uInt32 nFontFlags3 = mbUnderlUsed ? 0 : EXC_CF_FONT_UNDERL; - rStrm.WriteZeroBytes( 64 ); + rStrm.WriteZeroBytesToRecord( 64 ); rStrm << nHeight << nStyle << maFontData.mnWeight << EXC_FONTESC_NONE << maFontData.mnUnderline; - rStrm.WriteZeroBytes( 3 ); + rStrm.WriteZeroBytesToRecord( 3 ); rStrm << nColor << sal_uInt32( 0 ) << nFontFlags1 << EXC_CF_FONT_ESCAPEM // escapement never used -> set the flag << nFontFlags3; - rStrm.WriteZeroBytes( 16 ); + rStrm.WriteZeroBytesToRecord( 16 ); rStrm << sal_uInt16( 1 ); // must be 1 } diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx index 4853fff46d9c..2df531a9b932 100644 --- a/sc/source/filter/excel/xeescher.cxx +++ b/sc/source/filter/excel/xeescher.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xeescher.cxx,v $ - * $Revision: 1.24.128.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -50,8 +47,8 @@ #include <vcl/bmpacc.hxx> #include <svx/svdoole2.hxx> #include <svx/svdocapt.hxx> -#include <svx/outlobj.hxx> -#include <svx/editobj.hxx> +#include <editeng/outlobj.hxx> +#include <editeng/editobj.hxx> #include <unotools/tempfile.hxx> #include <unotools/ucbstreamhelper.hxx> diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx index 849ac080bb1d..34e48671a3bc 100644 --- a/sc/source/filter/excel/xeformula.cxx +++ b/sc/source/filter/excel/xeformula.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xeformula.cxx,v $ - * $Revision: 1.25.30.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index 45a44b2c88d1..bce037bd05c1 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xehelper.cxx,v $ - * $Revision: 1.31.148.1 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -35,21 +32,21 @@ #include <sfx2/objsh.hxx> #include <vcl/font.hxx> #include <tools/urlobj.hxx> -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #include <svtools/ctrltool.hxx> #include <svx/svdotext.hxx> -#include <svx/outlobj.hxx> +#include <editeng/outlobj.hxx> #include "scitems.hxx" -#include <svx/fhgtitem.hxx> -#include <svx/flstitem.hxx> -#include <svx/colritem.hxx> -#include <svx/eeitem.hxx> -#include <svx/flditem.hxx> -#include <svx/escpitem.hxx> -#include <svx/svxfont.hxx> +#include <editeng/fhgtitem.hxx> +#include <editeng/flstitem.hxx> +#include <editeng/colritem.hxx> +#include <editeng/eeitem.hxx> +#include <editeng/flditem.hxx> +#include <editeng/escpitem.hxx> +#include <editeng/svxfont.hxx> #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include "document.hxx" #include "docpool.hxx" #include "cell.hxx" @@ -415,7 +412,7 @@ XclExpStringRef lclCreateFormattedString( nScript = nLastScript; // construct font from current text portion - SvxFont aFont( XclExpFontBuffer::GetFontFromItemSet( rItemSet, nScript ) ); + SvxFont aFont( XclExpFontHelper::GetFontFromItemSet( rRoot, rItemSet, nScript ) ); // Excel start position of this portion sal_uInt16 nXclPortionStart = xString->Len(); @@ -529,7 +526,7 @@ XclExpStringRef lclCreateFormattedString( sal_Int16 nScript = xBreakIt->getScriptType( aXclPortionText, 0 ); if( nScript == ApiScriptType::WEAK ) nScript = nLastScript; - SvxFont aFont( XclExpFontBuffer::GetFontFromItemSet( aItemSet, nScript ) ); + SvxFont aFont( XclExpFontHelper::GetFontFromItemSet( rRoot, aItemSet, nScript ) ); nLastScript = nScript; // add escapement diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx index 47f101f4c351..421a15b6da95 100644 --- a/sc/source/filter/excel/xelink.cxx +++ b/sc/source/filter/excel/xelink.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xelink.cxx,v $ - * $Revision: 1.21.134.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -34,7 +31,7 @@ #include <algorithm> #include <unotools/collatorwrapper.hxx> -#include <svtools/zforlist.hxx> +#include <svl/zforlist.hxx> #include "document.hxx" #include "cell.hxx" #include "scextopt.hxx" diff --git a/sc/source/filter/excel/xename.cxx b/sc/source/filter/excel/xename.cxx index 004fbfa2932c..af275bef7eef 100644 --- a/sc/source/filter/excel/xename.cxx +++ b/sc/source/filter/excel/xename.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xename.cxx,v $ - * $Revision: 1.11 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/sc/source/filter/excel/xepage.cxx b/sc/source/filter/excel/xepage.cxx index 36d7a9dc31b7..753d43e8d584 100644 --- a/sc/source/filter/excel/xepage.cxx +++ b/sc/source/filter/excel/xepage.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xepage.cxx,v $ - * $Revision: 1.15.90.1 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -32,15 +29,15 @@ #include "precompiled_sc.hxx" #include "xepage.hxx" -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #include "scitems.hxx" -#include <svtools/eitem.hxx> -#include <svtools/intitem.hxx> +#include <svl/eitem.hxx> +#include <svl/intitem.hxx> #include <svx/pageitem.hxx> -#include <svx/sizeitem.hxx> -#include <svx/lrspitem.hxx> -#include <svx/ulspitem.hxx> -#include <svx/brshitem.hxx> +#include <editeng/sizeitem.hxx> +#include <editeng/lrspitem.hxx> +#include <editeng/ulspitem.hxx> +#include <editeng/brshitem.hxx> #include "document.hxx" #include "stlpool.hxx" #include "stlsheet.hxx" diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx index 69b323e1e718..cb248f0eaf76 100644 --- a/sc/source/filter/excel/xepivot.cxx +++ b/sc/source/filter/excel/xepivot.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xepivot.cxx,v $ - * $Revision: 1.22 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -42,7 +39,7 @@ #include <rtl/math.hxx> #include <tools/date.hxx> -#include <svtools/zformat.hxx> +#include <svl/zformat.hxx> #include <sot/storage.hxx> #include "document.hxx" #include "dpobject.hxx" @@ -67,6 +64,7 @@ using ::com::sun::star::sheet::DataPilotFieldSortInfo; using ::com::sun::star::sheet::DataPilotFieldAutoShowInfo; using ::com::sun::star::sheet::DataPilotFieldLayoutInfo; using ::com::sun::star::sheet::DataPilotFieldReference; +using ::rtl::OUString; using ::rtl::OString; using ::rtl::OUString; @@ -975,6 +973,11 @@ void XclExpPTItem::SetPropertiesFromMember( const ScDPSaveMember& rSaveMem ) { ::set_flag( maItemInfo.mnFlags, EXC_SXVI_HIDDEN, !rSaveMem.GetIsVisible() ); ::set_flag( maItemInfo.mnFlags, EXC_SXVI_HIDEDETAIL, !rSaveMem.GetShowDetails() ); + + // visible name + const OUString* pVisName = rSaveMem.GetLayoutName(); + if (pVisName && !pVisName->equals(GetItemName())) + maItemInfo.SetVisName(*pVisName); } void XclExpPTItem::WriteBody( XclExpStream& rStrm ) @@ -1032,6 +1035,31 @@ sal_uInt16 XclExpPTField::GetItemIndex( const String& rName, sal_uInt16 nDefault // fill data -------------------------------------------------------------- +/** + * Calc's subtotal names are escaped with backslashes ('\'), while Excel's + * are not escaped at all. + */ +static OUString lcl_convertCalcSubtotalName(const OUString& rName) +{ + OUStringBuffer aBuf; + const sal_Unicode* p = rName.getStr(); + sal_Int32 n = rName.getLength(); + bool bEscaped = false; + for (sal_Int32 i = 0; i < n; ++i) + { + const sal_Unicode c = p[i]; + if (!bEscaped && c == sal_Unicode('\\')) + { + bEscaped = true; + continue; + } + + aBuf.append(c); + bEscaped = false; + } + return aBuf.makeStringAndClear(); +} + void XclExpPTField::SetPropertiesFromDim( const ScDPSaveDimension& rSaveDim ) { // orientation @@ -1043,8 +1071,16 @@ void XclExpPTField::SetPropertiesFromDim( const ScDPSaveDimension& rSaveDim ) ::set_flag( maFieldExtInfo.mnFlags, EXC_SXVDEX_SHOWALL, rSaveDim.GetShowEmpty() ); // visible name - if( rSaveDim.HasLayoutName() && (rSaveDim.GetLayoutName() != GetFieldName()) ) - maFieldInfo.SetVisName( rSaveDim.GetLayoutName() ); + const OUString* pLayoutName = rSaveDim.GetLayoutName(); + if (pLayoutName && !pLayoutName->equals(GetFieldName())) + maFieldInfo.SetVisName(*pLayoutName); + + const rtl::OUString* pSubtotalName = rSaveDim.GetSubtotalName(); + if (pSubtotalName) + { + OUString aSubName = lcl_convertCalcSubtotalName(*pSubtotalName); + maFieldExtInfo.mpFieldTotalName.reset(new rtl::OUString(aSubName)); + } // subtotals XclPTSubtotalVec aSubtotals; @@ -1111,7 +1147,11 @@ void XclExpPTField::SetDataPropertiesFromDim( const ScDPSaveDimension& rSaveDim rDataInfo.SetApiAggFunc( eFunc ); // visible name - rDataInfo.SetVisName( lclGetDataFieldCaption( GetFieldName(), eFunc ) ); + const rtl::OUString* pVisName = rSaveDim.GetLayoutName(); + if (pVisName) + rDataInfo.SetVisName(*pVisName); + else + rDataInfo.SetVisName( lclGetDataFieldCaption( GetFieldName(), eFunc ) ); // result field reference if( const DataPilotFieldReference* pFieldRef = rSaveDim.GetReferenceValue() ) @@ -1220,9 +1260,10 @@ XclExpPivotTable::XclExpPivotTable( const XclExpRoot& rRoot, const ScDPObject& r // pivot table properties from DP object mnOutScTab = rOutScRange.aStart.Tab(); maPTInfo.maTableName = rDPObj.GetName(); - maPTInfo.maDataName = ScGlobal::GetRscString( STR_PIVOT_DATA ); maPTInfo.mnCacheIdx = mrPCache.GetCacheIndex(); + maPTViewEx9Info.Init( rDPObj ); + if( const ScDPSaveData* pSaveData = rDPObj.GetSaveData() ) { // additional properties from ScDPSaveData @@ -1302,6 +1343,10 @@ void XclExpPivotTable::Save( XclExpStream& rStrm ) WriteSxli( rStrm, maPTInfo.mnDataCols, maPTInfo.mnColFields ); // SXEX WriteSxex( rStrm ); + // QSISXTAG + WriteQsiSxTag( rStrm ); + // SXVIEWEX9 + WriteSxViewEx9( rStrm ); } } @@ -1335,6 +1380,15 @@ void XclExpPivotTable::SetPropertiesFromDP( const ScDPSaveData& rSaveData ) ::set_flag( maPTInfo.mnFlags, EXC_SXVIEW_COLGRAND, rSaveData.GetColumnGrand() ); ::set_flag( maPTExtInfo.mnFlags, EXC_SXEX_DRILLDOWN, rSaveData.GetDrillDown() ); mbFilterBtn = rSaveData.GetFilterButton(); + const ScDPSaveDimension* pDim = rSaveData.GetExistingDataLayoutDimension(); + if (!pDim) + return; + + const rtl::OUString* pLayoutName = pDim->GetLayoutName(); + if (pLayoutName) + maPTInfo.maDataName = *pLayoutName; + else + maPTInfo.maDataName = ScGlobal::GetRscString(STR_PIVOT_DATA); } void XclExpPivotTable::SetFieldPropertiesFromDim( const ScDPSaveDimension& rSaveDim ) @@ -1442,13 +1496,21 @@ void XclExpPivotTable::Finalize() rnDataXclRow = rnXclRow1 + maPTInfo.mnColFields + 1; if( maDataFields.empty() ) ++rnDataXclRow; + + bool bExtraHeaderRow = (0 == maPTViewEx9Info.mnGridLayout && maPTInfo.mnColFields == 0); + if (bExtraHeaderRow) + // Insert an extra row only when there is no column field. + ++rnDataXclRow; + rnXclCol2 = ::std::max( rnXclCol2, rnDataXclCol ); rnXclRow2 = ::std::max( rnXclRow2, rnDataXclRow ); maPTInfo.mnDataCols = rnXclCol2 - rnDataXclCol + 1; maPTInfo.mnDataRows = rnXclRow2 - rnDataXclRow + 1; // first heading - maPTInfo.mnFirstHeadRow = rnXclRow1 + 1; + maPTInfo.mnFirstHeadRow = rnXclRow1; + if (bExtraHeaderRow) + maPTInfo.mnFirstHeadRow += 2; } // records ---------------------------------------------------------------- @@ -1528,6 +1590,72 @@ void XclExpPivotTable::WriteSxex( XclExpStream& rStrm ) const rStrm.EndRecord(); } +void XclExpPivotTable::WriteQsiSxTag( XclExpStream& rStrm ) const +{ + rStrm.StartRecord( 0x0802, 32 ); + + sal_uInt16 nRecordType = 0x0802; + sal_uInt16 nDummyFlags = 0x0000; + sal_uInt16 nTableType = 1; // 0 = query table : 1 = pivot table + + rStrm << nRecordType << nDummyFlags << nTableType; + + // General flags + bool bEnableRefresh = true; + bool bPCacheInvalid = false; + bool bOlapPTReport = false; + + sal_uInt16 nFlags = 0x0000; + if (bEnableRefresh) nFlags |= 0x0001; + if (bPCacheInvalid) nFlags |= 0x0002; + if (bOlapPTReport) nFlags |= 0x0004; + rStrm << nFlags; + + // Feature-specific options. The value differs depending on the table + // type, but we assume the table type is always pivot table. + sal_uInt32 nOptions = 0x00000000; + bool bNoStencil = false; + bool bHideTotal = false; + bool bEmptyRows = false; + bool bEmptyCols = false; + if (bNoStencil) nOptions |= 0x00000001; + if (bHideTotal) nOptions |= 0x00000002; + if (bEmptyRows) nOptions |= 0x00000008; + if (bEmptyCols) nOptions |= 0x00000010; + rStrm << nOptions; + + enum ExcelVersion + { + Excel2000 = 0, + ExcelXP = 1, + Excel2003 = 2, + Excel2007 = 3 + }; + ExcelVersion eXclVer = Excel2000; + sal_uInt8 nOffsetBytes = 16; + rStrm << static_cast<sal_uInt8>(eXclVer) // version table last refreshed + << static_cast<sal_uInt8>(eXclVer) // minimum version to refresh + << nOffsetBytes + << static_cast<sal_uInt8>(eXclVer); // first version created + + rStrm << XclExpString(maPTInfo.maTableName); + rStrm << static_cast<sal_uInt16>(0x0001); // no idea what this is for. + + rStrm.EndRecord(); +} + +void XclExpPivotTable::WriteSxViewEx9( XclExpStream& rStrm ) const +{ + // Until we sync the autoformat ids only export if using grid header layout + // That could only have been set via xls import so far. + if ( 0 == maPTViewEx9Info.mnGridLayout ) + { + rStrm.StartRecord( EXC_ID_SXVIEWEX9, 17 ); + rStrm << maPTViewEx9Info; + rStrm.EndRecord(); + } +} + // ============================================================================ namespace { diff --git a/sc/source/filter/excel/xerecord.cxx b/sc/source/filter/excel/xerecord.cxx index e13ed29258ed..fed58411aa5c 100644 --- a/sc/source/filter/excel/xerecord.cxx +++ b/sc/source/filter/excel/xerecord.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xerecord.cxx,v $ - * $Revision: 1.10.32.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/sc/source/filter/excel/xeroot.cxx b/sc/source/filter/excel/xeroot.cxx index 636a83ea3e47..834873740d68 100644 --- a/sc/source/filter/excel/xeroot.cxx +++ b/sc/source/filter/excel/xeroot.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xeroot.cxx,v $ - * $Revision: 1.23 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -33,10 +30,10 @@ #include <sfx2/docfile.hxx> #include <sfx2/sfxsids.hrc> -#include <svtools/saveopt.hxx> -#include <svtools/itemset.hxx> -#include <svtools/stritem.hxx> -#include <svtools/eitem.hxx> +#include <unotools/saveopt.hxx> +#include <svl/itemset.hxx> +#include <svl/stritem.hxx> +#include <svl/eitem.hxx> #include "xecontent.hxx" #include "xltracer.hxx" #include "xeescher.hxx" diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index 10d23eccdf27..f828079c8735 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xestream.cxx,v $ - * $Revision: 1.11.30.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -259,6 +256,17 @@ void XclExpStream::WriteZeroBytes( sal_Size nBytes ) WriteRawZeroBytes( nBytes ); } +void XclExpStream::WriteZeroBytesToRecord( sal_Size nBytes ) +{ + if (!mbInRec) + // not in record. + return; + + sal_uInt8 nZero = 0; + for (sal_Size i = 0; i < nBytes; ++i) + *this << nZero; +} + sal_Size XclExpStream::CopyFromStream( SvStream& rInStrm, sal_Size nBytes ) { sal_Size nStrmPos = rInStrm.Tell(); @@ -578,7 +586,7 @@ void XclExpBiff8Encrypter::Init( const String& aPass, const sal_uInt8 nDocId[16] maCodec.InitKey(mnPassw, mnDocId); // generate salt hash. - ::svx::MSCodec_Std97 aCodec; + ::msfilter::MSCodec_Std97 aCodec; aCodec.InitKey(mnPassw, mnDocId); aCodec.CreateSaltDigest(nSalt, mnSaltDigest); diff --git a/sc/source/filter/excel/xestring.cxx b/sc/source/filter/excel/xestring.cxx index 9af8dbfdd851..cd0b083aa208 100644 --- a/sc/source/filter/excel/xestring.cxx +++ b/sc/source/filter/excel/xestring.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xestring.cxx,v $ - * $Revision: 1.13.32.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -423,7 +420,8 @@ void XclExpString::WriteFormats( XclExpStream& rStrm, bool bWriteSize ) const void XclExpString::Write( XclExpStream& rStrm ) const { - WriteHeader( rStrm ); + if (!mbSkipHeader) + WriteHeader( rStrm ); WriteBuffer( rStrm ); if( IsWriteFormats() ) // only in BIFF8 included in string WriteFormats( rStrm ); @@ -589,6 +587,7 @@ void XclExpString::Init( sal_Int32 nCurrLen, XclStrFlags nFlags, sal_uInt16 nMax mbSmartFlags = bBiff8 && ::get_flag( nFlags, EXC_STR_SMARTFLAGS ); mbSkipFormats = ::get_flag( nFlags, EXC_STR_SEPARATEFORMATS ); mbWrapped = false; + mbSkipHeader = ::get_flag( nFlags, EXC_STR_NOHEADER ); mnMaxLen = nMaxLen; SetStrLen( nCurrLen ); diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index 2172a7678763..315282098cec 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xestyle.cxx,v $ - * $Revision: 1.33.32.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -37,19 +34,19 @@ #include <set> #include <com/sun/star/i18n/ScriptType.hpp> #include <vcl/font.hxx> -#include <svtools/zformat.hxx> -#include <svtools/languageoptions.hxx> +#include <svl/zformat.hxx> +#include <svl/languageoptions.hxx> #include <sfx2/printer.hxx> #include "scitems.hxx" #include <svx/algitem.hxx> -#include <svx/boxitem.hxx> -#include <svx/bolnitem.hxx> +#include <editeng/boxitem.hxx> +#include <editeng/bolnitem.hxx> #include <svx/rotmodit.hxx> -#include <svx/colritem.hxx> -#include <svx/brshitem.hxx> -#include <svx/frmdiritem.hxx> -#include <svx/eeitem.hxx> -#include <svx/escpitem.hxx> +#include <editeng/colritem.hxx> +#include <editeng/brshitem.hxx> +#include <editeng/frmdiritem.hxx> +#include <editeng/eeitem.hxx> +#include <editeng/escpitem.hxx> #include "document.hxx" #include "stlpool.hxx" #include "stlsheet.hxx" @@ -823,6 +820,120 @@ void XclExpPalette::WriteBody( XclExpStream& rStrm ) namespace { +typedef ::std::pair< USHORT, sal_Int16 > WhichAndScript; + +sal_Int16 lclCheckFontItems( const SfxItemSet& rItemSet, + const WhichAndScript& rWAS1, const WhichAndScript& rWAS2, const WhichAndScript& rWAS3 ) +{ + if( ScfTools::CheckItem( rItemSet, rWAS1.first, false ) ) return rWAS1.second; + if( ScfTools::CheckItem( rItemSet, rWAS2.first, false ) ) return rWAS2.second; + if( ScfTools::CheckItem( rItemSet, rWAS3.first, false ) ) return rWAS3.second; + return 0; +}; + +} // namespace + +/*static*/ sal_Int16 XclExpFontHelper::GetFirstUsedScript( const XclExpRoot& rRoot, const SfxItemSet& rItemSet ) +{ + namespace ApiScriptType = ::com::sun::star::i18n::ScriptType; + + /* #i17050# #i107170# We need to determine which font items are set in the + item set, and which script type we should prefer according to the + current language settings. */ + + static const WhichAndScript WAS_LATIN( ATTR_FONT, ::com::sun::star::i18n::ScriptType::LATIN ); + static const WhichAndScript WAS_ASIAN( ATTR_CJK_FONT, ::com::sun::star::i18n::ScriptType::ASIAN ); + static const WhichAndScript WAS_CMPLX( ATTR_CTL_FONT, ::com::sun::star::i18n::ScriptType::COMPLEX ); + + /* #114008# do not let a font from a parent style override an explicit + cell font. */ + + sal_Int16 nDefScript = rRoot.GetDefApiScript(); + sal_Int16 nScript = 0; + const SfxItemSet* pCurrSet = &rItemSet; + + while( (nScript == 0) && pCurrSet ) + { + switch( nDefScript ) + { + case ApiScriptType::LATIN: + nScript = lclCheckFontItems( *pCurrSet, WAS_LATIN, WAS_CMPLX, WAS_ASIAN ); + break; + case ApiScriptType::ASIAN: + nScript = lclCheckFontItems( *pCurrSet, WAS_ASIAN, WAS_CMPLX, WAS_LATIN ); + break; + case ApiScriptType::COMPLEX: + nScript = lclCheckFontItems( *pCurrSet, WAS_CMPLX, WAS_ASIAN, WAS_LATIN ); + break; + default: + DBG_ERRORFILE( "XclExpFontHelper::GetFirstUsedScript - unknown script type" ); + nScript = ApiScriptType::LATIN; + }; + pCurrSet = pCurrSet->GetParent(); + } + + return nScript; +} + +/*static*/ Font XclExpFontHelper::GetFontFromItemSet( const XclExpRoot& rRoot, const SfxItemSet& rItemSet, sal_Int16 nScript ) +{ + namespace ApiScriptType = ::com::sun::star::i18n::ScriptType; + + // if WEAK is passed, guess script type from existing items in the item set + if( nScript == ApiScriptType::WEAK ) + nScript = GetFirstUsedScript( rRoot, rItemSet ); + + // convert to core script type constants + BYTE nScScript = SCRIPTTYPE_LATIN; + switch( nScript ) + { + case ApiScriptType::LATIN: nScScript = SCRIPTTYPE_LATIN; break; + case ApiScriptType::ASIAN: nScScript = SCRIPTTYPE_ASIAN; break; + case ApiScriptType::COMPLEX: nScScript = SCRIPTTYPE_COMPLEX; break; + default: DBG_ERRORFILE( "XclExpFontHelper::GetFontFromItemSet - unknown script type" ); + } + + // fill the font object + Font aFont; + ScPatternAttr::GetFont( aFont, rItemSet, SC_AUTOCOL_RAW, 0, 0, 0, nScScript ); + return aFont; +} + +/*static*/ bool XclExpFontHelper::CheckItems( const XclExpRoot& rRoot, const SfxItemSet& rItemSet, sal_Int16 nScript, bool bDeep ) +{ + static const USHORT pnCommonIds[] = { + ATTR_FONT_UNDERLINE, ATTR_FONT_CROSSEDOUT, ATTR_FONT_CONTOUR, + ATTR_FONT_SHADOWED, ATTR_FONT_COLOR, ATTR_FONT_LANGUAGE, 0 }; + static const USHORT pnLatinIds[] = { + ATTR_FONT, ATTR_FONT_HEIGHT, ATTR_FONT_WEIGHT, ATTR_FONT_POSTURE, 0 }; + static const USHORT pnAsianIds[] = { + ATTR_CJK_FONT, ATTR_CJK_FONT_HEIGHT, ATTR_CJK_FONT_WEIGHT, ATTR_CJK_FONT_POSTURE, 0 }; + static const USHORT pnComplexIds[] = { + ATTR_CTL_FONT, ATTR_CTL_FONT_HEIGHT, ATTR_CTL_FONT_WEIGHT, ATTR_CTL_FONT_POSTURE, 0 }; + + bool bUsed = ScfTools::CheckItems( rItemSet, pnCommonIds, bDeep ); + if( !bUsed ) + { + namespace ApiScriptType = ::com::sun::star::i18n::ScriptType; + // if WEAK is passed, guess script type from existing items in the item set + if( nScript == ApiScriptType::WEAK ) + nScript = GetFirstUsedScript( rRoot, rItemSet ); + // check the correct items + switch( nScript ) + { + case ApiScriptType::LATIN: bUsed = ScfTools::CheckItems( rItemSet, pnLatinIds, bDeep ); break; + case ApiScriptType::ASIAN: bUsed = ScfTools::CheckItems( rItemSet, pnAsianIds, bDeep ); break; + case ApiScriptType::COMPLEX: bUsed = ScfTools::CheckItems( rItemSet, pnComplexIds, bDeep ); break; + default: DBG_ERRORFILE( "XclExpFontHelper::CheckItems - unknown script type" ); + } + } + return bUsed; +} + +// ---------------------------------------------------------------------------- + +namespace { + sal_uInt32 lclCalcHash( const XclFontData& rFontData ) { sal_uInt32 nHash = rFontData.maName.Len(); @@ -993,7 +1104,8 @@ sal_uInt16 XclExpFontBuffer::Insert( const SfxItemSet& rItemSet, sal_Int16 nScript, XclExpColorType eColorType, bool bAppFont ) { // #i17050# #114008# #115495# script type now provided by caller - return Insert( GetFontFromItemSet( rItemSet, nScript ), eColorType, bAppFont ); + Font aFont = XclExpFontHelper::GetFontFromItemSet( GetRoot(), rItemSet, nScript ); + return Insert( aFont, eColorType, bAppFont ); } sal_uInt16 XclExpFontBuffer::Insert( const ScPatternAttr& rPattern, @@ -1022,90 +1134,6 @@ void XclExpFontBuffer::SaveXml( XclExpXmlStream& rStrm ) rStyleSheet->endElement( XML_fonts ); } -sal_Int16 XclExpFontBuffer::GetFirstUsedScript( const SfxItemSet& rItemSet ) -{ - /* #i17050# We need to determine if a CJK or CTL font item is set in the - item set. It is possible that both may be present. In this case, - we will choose CJK. Either option is equally correct. */ - - namespace ApiScriptType = ::com::sun::star::i18n::ScriptType; - sal_Int16 nScript = ApiScriptType::LATIN; - - // #114008# do not let a font from a parent style override an explicit cell font - const SfxItemSet* pCurrSet = &rItemSet; - bool bFound = false; - while( !bFound && pCurrSet ) - { - bFound = true; - if( ScfTools::CheckItem( *pCurrSet, ATTR_CJK_FONT, false ) ) - nScript = ApiScriptType::ASIAN; - else if( ScfTools::CheckItem( *pCurrSet, ATTR_CTL_FONT, false ) ) - nScript = ApiScriptType::COMPLEX; - else if( ScfTools::CheckItem( *pCurrSet, ATTR_FONT, false ) ) - nScript = ApiScriptType::LATIN; - else - bFound = false; - pCurrSet = pCurrSet->GetParent(); - } - - return nScript; -} - -Font XclExpFontBuffer::GetFontFromItemSet( const SfxItemSet& rItemSet, sal_Int16 nScript ) -{ - namespace ApiScriptType = ::com::sun::star::i18n::ScriptType; - - // if WEAK is passed, guess script type from existing items in the item set - if( nScript == ApiScriptType::WEAK ) - nScript = GetFirstUsedScript( rItemSet ); - - // convert to core script type constants - BYTE nScScript = SCRIPTTYPE_LATIN; - switch( nScript ) - { - case ApiScriptType::LATIN: nScScript = SCRIPTTYPE_LATIN; break; - case ApiScriptType::ASIAN: nScScript = SCRIPTTYPE_ASIAN; break; - case ApiScriptType::COMPLEX: nScScript = SCRIPTTYPE_COMPLEX; break; - default: DBG_ERRORFILE( "XclExpFontBuffer::GetFontFromItemSet - unknown script type" ); - } - - // fill the font object - Font aFont; - ScPatternAttr::GetFont( aFont, rItemSet, SC_AUTOCOL_RAW, 0, 0, 0, nScScript ); - return aFont; -} - -bool XclExpFontBuffer::CheckItems( const SfxItemSet& rItemSet, sal_Int16 nScript, bool bDeep ) -{ - static const USHORT pnCommonIds[] = { - ATTR_FONT_UNDERLINE, ATTR_FONT_CROSSEDOUT, ATTR_FONT_CONTOUR, - ATTR_FONT_SHADOWED, ATTR_FONT_COLOR, ATTR_FONT_LANGUAGE, 0 }; - static const USHORT pnLatinIds[] = { - ATTR_FONT, ATTR_FONT_HEIGHT, ATTR_FONT_WEIGHT, ATTR_FONT_POSTURE, 0 }; - static const USHORT pnAsianIds[] = { - ATTR_CJK_FONT, ATTR_CJK_FONT_HEIGHT, ATTR_CJK_FONT_WEIGHT, ATTR_CJK_FONT_POSTURE, 0 }; - static const USHORT pnComplexIds[] = { - ATTR_CTL_FONT, ATTR_CTL_FONT_HEIGHT, ATTR_CTL_FONT_WEIGHT, ATTR_CTL_FONT_POSTURE, 0 }; - - bool bUsed = ScfTools::CheckItems( rItemSet, pnCommonIds, bDeep ); - if( !bUsed ) - { - namespace ApiScriptType = ::com::sun::star::i18n::ScriptType; - // if WEAK is passed, guess script type from existing items in the item set - if( nScript == ApiScriptType::WEAK ) - nScript = GetFirstUsedScript( rItemSet ); - // check the correct items - switch( nScript ) - { - case ApiScriptType::LATIN: bUsed = ScfTools::CheckItems( rItemSet, pnLatinIds, bDeep ); break; - case ApiScriptType::ASIAN: bUsed = ScfTools::CheckItems( rItemSet, pnAsianIds, bDeep ); break; - case ApiScriptType::COMPLEX: bUsed = ScfTools::CheckItems( rItemSet, pnComplexIds, bDeep ); break; - default: DBG_ERRORFILE( "XclExpFontBuffer::CheckItems - unknown script type" ); - } - } - return bUsed; -} - // private -------------------------------------------------------------------- void XclExpFontBuffer::InitDefaultFonts() @@ -1885,7 +1913,8 @@ XclExpXF::XclExpXF( const XclExpRoot& rRoot, const SfxStyleSheetBase& rStyleShee mnParentXFId( XclExpXFBuffer::GetXFIdFromIndex( EXC_XF_STYLEPARENT ) ) { bool bDefStyle = (rStyleSheet.GetName() == ScGlobal::GetRscString( STR_STYLENAME_STANDARD )); - Init( const_cast< SfxStyleSheetBase& >( rStyleSheet ).GetItemSet(), ::com::sun::star::i18n::ScriptType::WEAK, + sal_Int16 nScript = bDefStyle ? GetDefApiScript() : ::com::sun::star::i18n::ScriptType::WEAK; + Init( const_cast< SfxStyleSheetBase& >( rStyleSheet ).GetItemSet(), nScript, NUMBERFORMAT_ENTRY_NOT_FOUND, EXC_FONT_NOTFOUND, false, bDefStyle ); } @@ -1947,7 +1976,7 @@ void XclExpXF::Init( const SfxItemSet& rItemSet, sal_Int16 nScript, if( nForceXclFont == EXC_FONT_NOTFOUND ) { mnXclFont = GetFontBuffer().Insert( rItemSet, nScript, EXC_COLOR_CELLTEXT, bDefStyle ); - mbFontUsed = XclExpFontBuffer::CheckItems( rItemSet, nScript, IsStyleXF() ); + mbFontUsed = XclExpFontHelper::CheckItems( GetRoot(), rItemSet, nScript, IsStyleXF() ); } else { diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index ef30e9a78f6d..e9aaa70bceba 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xetable.cxx,v $ - * $Revision: 1.18.126.1 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -35,7 +32,7 @@ #include <map> #include <com/sun/star/i18n/ScriptType.hpp> #include "scitems.hxx" -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #include "document.hxx" #include "dociter.hxx" #include "olinetab.hxx" diff --git a/sc/source/filter/excel/xeview.cxx b/sc/source/filter/excel/xeview.cxx index 649bc0de32e6..c342b5a40ea1 100644 --- a/sc/source/filter/excel/xeview.cxx +++ b/sc/source/filter/excel/xeview.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xeview.cxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index 5eb1c81fd886..6734f90948e4 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xichart.cxx,v $ - * $Revision: 1.20.62.14 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -34,6 +31,7 @@ #include "xichart.hxx" #include <algorithm> +#include <memory> #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/drawing/Direction3D.hpp> @@ -75,6 +73,8 @@ #include "tokenarray.hxx" #include "token.hxx" #include "compiler.hxx" +#include "reftokenhelper.hxx" +#include "chartlis.hxx" #include "fprogressbar.hxx" #include "xltracer.hxx" #include "xistream.hxx" @@ -796,6 +796,22 @@ Sequence< Reference< XFormattedString > > XclImpChSourceLink::CreateStringSequen return ScfApiHelper::VectorToSequence( aStringVec ); } +void XclImpChSourceLink::FillSourceLink( ::std::vector< ScSharedTokenRef >& rTokens ) const +{ + if( !mxTokenArray.is() ) + // no links to fill. + return; + + mxTokenArray->Reset(); + for (FormulaToken* p = mxTokenArray->First(); p; p = mxTokenArray->Next()) + { + ScSharedTokenRef pToken(static_cast<ScToken*>(p->Clone())); + if (ScRefTokenHelper::isRef(pToken)) + // This is a reference token. Store it. + ScRefTokenHelper::join(rTokens, pToken); + } +} + // Text ======================================================================= XclImpChFontBase::~XclImpChFontBase() @@ -1842,6 +1858,18 @@ Reference< XDataSeries > XclImpChSeries::CreateDataSeries() const return xDataSeries; } +void XclImpChSeries::FillAllSourceLinks( ::std::vector< ScSharedTokenRef >& rTokens ) const +{ + if( mxValueLink.is() ) + mxValueLink->FillSourceLink( rTokens ); + if( mxCategLink.is() ) + mxCategLink->FillSourceLink( rTokens ); + if( mxTitleLink.is() ) + mxTitleLink->FillSourceLink( rTokens ); + if( mxBubbleLink.is() ) + mxBubbleLink->FillSourceLink( rTokens ); +} + void XclImpChSeries::ReadChSourceLink( XclImpStream& rStrm ) { XclImpChSourceLinkRef xSrcLink( new XclImpChSourceLink( GetChRoot() ) ); @@ -3488,7 +3516,7 @@ XclImpChTextRef XclImpChChart::GetDefaultText( XclChTextType eTextType ) const return maDefTexts.get( nDefTextId ); } -void XclImpChChart::Convert( Reference< XChartDocument > xChartDoc, XclImpDffConverter& rDffConv ) const +void XclImpChChart::Convert( Reference< XChartDocument > xChartDoc, XclImpDffConverter& rDffConv, const OUString& rObjName ) const { // initialize conversion (locks the model to suppress any internal updates) InitConversion( xChartDoc ); @@ -3531,6 +3559,22 @@ void XclImpChChart::Convert( Reference< XChartDocument > xChartDoc, XclImpDffCon // unlock the model FinishConversion( rDffConv ); + + // start listening to this chart + ScDocument& rDoc = GetRoot().GetDoc(); + if( ScChartListenerCollection* pChartCollection = rDoc.GetChartListenerCollection() ) + { + ::std::auto_ptr< ::std::vector< ScSharedTokenRef > > xRefTokens( new ::std::vector< ScSharedTokenRef > ); + for( XclImpChSeriesVec::const_iterator aIt = maSeries.begin(), aEnd = maSeries.end(); aIt != aEnd; ++aIt ) + (*aIt)->FillAllSourceLinks( *xRefTokens ); + if( !xRefTokens->empty() ) + { + ::std::auto_ptr< ScChartListener > xListener( new ScChartListener( rObjName, &rDoc, xRefTokens.release() ) ); + xListener->SetUsed( true ); + xListener->StartListeningTo(); + pChartCollection->Insert( xListener.release() ); + } + } } void XclImpChChart::ReadChSeries( XclImpStream& rStrm ) @@ -3842,13 +3886,13 @@ sal_Size XclImpChart::GetProgressSize() const (mxChartDrawing.is() ? mxChartDrawing->GetProgressSize() : 0); } -void XclImpChart::Convert( Reference< XModel > xModel, XclImpDffConverter& rDffConv, const Rectangle& rChartRect ) const +void XclImpChart::Convert( Reference< XModel > xModel, XclImpDffConverter& rDffConv, const OUString& rObjName, const Rectangle& rChartRect ) const { Reference< XChartDocument > xChartDoc( xModel, UNO_QUERY ); if( xChartDoc.is() ) { if( mxChartData.is() ) - mxChartData->Convert( xChartDoc, rDffConv ); + mxChartData->Convert( xChartDoc, rDffConv, rObjName ); if( mxChartDrawing.is() ) mxChartDrawing->ConvertObjects( rDffConv, xModel, rChartRect ); } diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx index ad98b0439cf5..e095ef987615 100644 --- a/sc/source/filter/excel/xicontent.cxx +++ b/sc/source/filter/excel/xicontent.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xicontent.cxx,v $ - * $Revision: 1.31.88.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -34,21 +31,21 @@ #include <sfx2/objsh.hxx> #include <sfx2/docfile.hxx> #include <tools/urlobj.hxx> -#include <svx/editeng.hxx> -#include <svx/editobj.hxx> -#include <svx/linkmgr.hxx> -#include <svtools/itemset.hxx> +#include <editeng/editeng.hxx> +#include <editeng/editobj.hxx> +#include <sfx2/linkmgr.hxx> +#include <svl/itemset.hxx> #include "scitems.hxx" -#include <svx/eeitem.hxx> -#include <svtools/intitem.hxx> -#include <svtools/stritem.hxx> -#include <svx/flditem.hxx> -#include <svx/fhgtitem.hxx> -#include <svx/wghtitem.hxx> -#include <svx/udlnitem.hxx> -#include <svx/postitem.hxx> -#include <svx/colritem.hxx> -#include <svx/crsditem.hxx> +#include <editeng/eeitem.hxx> +#include <svl/intitem.hxx> +#include <svl/stritem.hxx> +#include <editeng/flditem.hxx> +#include <editeng/fhgtitem.hxx> +#include <editeng/wghtitem.hxx> +#include <editeng/udlnitem.hxx> +#include <editeng/postitem.hxx> +#include <editeng/colritem.hxx> +#include <editeng/crsditem.hxx> #include "document.hxx" #include "editutil.hxx" #include "cell.hxx" diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index dd4b0753d97d..31fec234dceb 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xiescher.cxx,v $ - * $Revision: 1.57.52.8 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -56,8 +53,8 @@ #include <rtl/logfile.hxx> #include <sfx2/objsh.hxx> -#include <svtools/moduleoptions.hxx> -#include <svtools/fltrcfg.hxx> +#include <unotools/moduleoptions.hxx> +#include <unotools/fltrcfg.hxx> #include <svtools/wmf.hxx> #include <comphelper/types.hxx> #include <comphelper/classids.hxx> @@ -79,18 +76,18 @@ #include <svx/svdocapt.hxx> #include <svx/svdouno.hxx> #include <svx/svdpage.hxx> -#include <svx/editobj.hxx> -#include <svx/outliner.hxx> -#include <svx/outlobj.hxx> +#include <editeng/editobj.hxx> +#include <editeng/outliner.hxx> +#include <editeng/outlobj.hxx> #include <svx/unoapi.hxx> #include <svx/svditer.hxx> -#include <svx/writingmodeitem.hxx> +#include <editeng/writingmodeitem.hxx> #include "scitems.hxx" -#include <svx/eeitem.hxx> -#include <svx/colritem.hxx> +#include <editeng/eeitem.hxx> +#include <editeng/colritem.hxx> #include <svx/xflclit.hxx> -#include <svx/adjitem.hxx> +#include <editeng/adjitem.hxx> #include <svx/xlineit.hxx> #include <svx/xlinjoit.hxx> #include <svx/xlntrit.hxx> @@ -105,6 +102,7 @@ #include "convuno.hxx" #include "postit.hxx" #include "globstr.hrc" +#include "chartlis.hxx" #include "fprogressbar.hxx" #include "xltracer.hxx" @@ -1422,38 +1420,121 @@ void XclImpTextObj::DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& (with no content) while exporting to XLS, which can cause a corrupted exported document. */ - // 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; + default: + case EXC_OBJ_ORIENT_NONE: + { + eWriteMode = csst::WritingMode_LR_TB; + 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; + } + 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; + } + } + break; + + case EXC_OBJ_ORIENT_90CCW: + { + if( SdrObjCustomShape* pObjCustomShape = dynamic_cast< SdrObjCustomShape* >( &rSdrObj ) ) + { + double fAngle = 180.0; + com::sun::star::beans::PropertyValue aTextRotateAngle; + aTextRotateAngle.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "TextRotateAngle" ) ); + aTextRotateAngle.Value <<= fAngle; + SdrCustomShapeGeometryItem aGeometryItem((SdrCustomShapeGeometryItem&)pObjCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )); + aGeometryItem.SetPropertyValue( aTextRotateAngle ); + pObjCustomShape->SetMergedItem( aGeometryItem ); + } + eWriteMode = csst::WritingMode_TB_RL; + switch( maTextData.maData.GetHorAlign() ) + { + case EXC_OBJ_HOR_LEFT: eVerAlign = SDRTEXTVERTADJUST_TOP; break; + case EXC_OBJ_HOR_CENTER: eVerAlign = SDRTEXTVERTADJUST_CENTER; break; + case EXC_OBJ_HOR_RIGHT: eVerAlign = SDRTEXTVERTADJUST_BOTTOM; break; + case EXC_OBJ_HOR_JUSTIFY: eVerAlign = SDRTEXTVERTADJUST_BLOCK; break; + } + MSO_Anchor eTextAnchor = (MSO_Anchor)GetObjectManager().GetDffManager().GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop ); + switch( eTextAnchor ) + { + case mso_anchorTopCentered : + case mso_anchorMiddleCentered : + case mso_anchorBottomCentered : + { + eHorAlign = SVX_ADJUST_CENTER; + } + break; + + default: + { + switch( maTextData.maData.GetVerAlign() ) + { + case EXC_OBJ_VER_TOP: eHorAlign = SVX_ADJUST_RIGHT; break; + case EXC_OBJ_VER_CENTER: eHorAlign = SVX_ADJUST_CENTER; break; + case EXC_OBJ_VER_BOTTOM: eHorAlign = SVX_ADJUST_LEFT; break; + case EXC_OBJ_VER_JUSTIFY: eHorAlign = SVX_ADJUST_BLOCK; break; + } + } + } + } + break; + + case EXC_OBJ_ORIENT_STACKED: // PASSTHROUGH INTENDED + { + // sj: STACKED is not supported, maybe it can be optimized here a bit + } + case EXC_OBJ_ORIENT_90CW: + { + eWriteMode = csst::WritingMode_TB_RL; + switch( maTextData.maData.GetHorAlign() ) + { + case EXC_OBJ_HOR_LEFT: eVerAlign = SDRTEXTVERTADJUST_BOTTOM; break; + case EXC_OBJ_HOR_CENTER: eVerAlign = SDRTEXTVERTADJUST_CENTER; break; + case EXC_OBJ_HOR_RIGHT: eVerAlign = SDRTEXTVERTADJUST_TOP; break; + case EXC_OBJ_HOR_JUSTIFY: eVerAlign = SDRTEXTVERTADJUST_BLOCK; break; + } + MSO_Anchor eTextAnchor = (MSO_Anchor)GetObjectManager().GetDffManager().GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop ); + switch ( eTextAnchor ) + { + case mso_anchorTopCentered : + case mso_anchorMiddleCentered : + case mso_anchorBottomCentered : + { + eHorAlign = SVX_ADJUST_CENTER; + } + break; + + default: + { + switch( maTextData.maData.GetVerAlign() ) + { + case EXC_OBJ_VER_TOP: eHorAlign = SVX_ADJUST_LEFT; break; + case EXC_OBJ_VER_CENTER: eHorAlign = SVX_ADJUST_CENTER; break; + case EXC_OBJ_VER_BOTTOM: eHorAlign = SVX_ADJUST_RIGHT; break; + case EXC_OBJ_VER_JUSTIFY: eHorAlign = SVX_ADJUST_BLOCK; break; + } + } + } + } + break; } + rSdrObj.SetMergedItem( SvxAdjustItem( eHorAlign, EE_PARA_JUST ) ); + rSdrObj.SetMergedItem( SdrTextVertAdjustItem( eVerAlign ) ); rSdrObj.SetMergedItem( SvxWritingModeItem( eWriteMode, SDRATTR_TEXTDIRECTION ) ); } } @@ -1587,10 +1668,9 @@ void XclImpChartObj::DoPostProcessSdrObj( XclImpDffConverter& rDffConv, SdrObjec Reference< XEmbeddedObject > xEmbObj = pSdrOleObj->GetObjRef(); if( xEmbObj.is() && ::svt::EmbeddedObjectRef::TryRunningState( xEmbObj ) ) try { - Reference< XModel > xModel( xEmbObj->getComponent(), UNO_QUERY_THROW ); - mxChart->Convert( xModel, rDffConv, rSdrObj.GetLogicRect() ); - Reference< XEmbedPersist > xPersist( xEmbObj, UNO_QUERY_THROW ); + Reference< XModel > xModel( xEmbObj->getComponent(), UNO_QUERY_THROW ); + mxChart->Convert( xModel, rDffConv, xPersist->getEntryName(), rSdrObj.GetLogicRect() ); xPersist->storeOwn(); } catch( Exception& ) @@ -3988,6 +4068,10 @@ void XclImpObjectManager::ConvertObjects() aDffConv.StartProgressBar( nProgressSize ); for( XclImpSheetDrawingMap::iterator aIt = maSheetDrawings.begin(), aEnd = maSheetDrawings.end(); aIt != aEnd; ++aIt ) aIt->second->ConvertObjects( aDffConv ); + + ScChartListenerCollection* pChartListeners = GetDoc().GetChartListenerCollection(); + if( pChartListeners && (pChartListeners->GetCount() > 0) ) + pChartListeners->SetDirty(); } String XclImpObjectManager::GetDefaultObjName( const XclImpDrawObjBase& rDrawObj ) const diff --git a/sc/source/filter/excel/xiformula.cxx b/sc/source/filter/excel/xiformula.cxx index f6b030aa8250..40c6ef9be374 100644 --- a/sc/source/filter/excel/xiformula.cxx +++ b/sc/source/filter/excel/xiformula.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xiformula.cxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/sc/source/filter/excel/xihelper.cxx b/sc/source/filter/excel/xihelper.cxx index 47b42ad51e93..1afcba154c4a 100644 --- a/sc/source/filter/excel/xihelper.cxx +++ b/sc/source/filter/excel/xihelper.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xihelper.cxx,v $ - * $Revision: 1.29 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -31,12 +28,12 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sc.hxx" #include "xihelper.hxx" -#include <svtools/itemset.hxx> -#include <svx/editobj.hxx> +#include <svl/itemset.hxx> +#include <editeng/editobj.hxx> #include <tools/urlobj.hxx> #include "scitems.hxx" -#include <svx/eeitem.hxx> -#include <svx/flditem.hxx> +#include <editeng/eeitem.hxx> +#include <editeng/flditem.hxx> #include "document.hxx" #include "cell.hxx" #include "rangelst.hxx" diff --git a/sc/source/filter/excel/xilink.cxx b/sc/source/filter/excel/xilink.cxx index 00268215a5dc..1183b077b626 100644 --- a/sc/source/filter/excel/xilink.cxx +++ b/sc/source/filter/excel/xilink.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xilink.cxx,v $ - * $Revision: 1.25.46.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/sc/source/filter/excel/xiname.cxx b/sc/source/filter/excel/xiname.cxx index 502e643b6c76..70ff46a0d741 100644 --- a/sc/source/filter/excel/xiname.cxx +++ b/sc/source/filter/excel/xiname.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xiname.cxx,v $ - * $Revision: 1.10 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/sc/source/filter/excel/xipage.cxx b/sc/source/filter/excel/xipage.cxx index 1aa00cf34d8f..c689d0eb7feb 100644 --- a/sc/source/filter/excel/xipage.cxx +++ b/sc/source/filter/excel/xipage.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xipage.cxx,v $ - * $Revision: 1.18.90.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -31,16 +28,16 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sc.hxx" #include "xipage.hxx" -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #include <vcl/graph.hxx> #include "scitems.hxx" -#include <svtools/eitem.hxx> -#include <svtools/intitem.hxx> +#include <svl/eitem.hxx> +#include <svl/intitem.hxx> #include <svx/pageitem.hxx> -#include <svx/sizeitem.hxx> -#include <svx/lrspitem.hxx> -#include <svx/ulspitem.hxx> -#include <svx/brshitem.hxx> +#include <editeng/sizeitem.hxx> +#include <editeng/lrspitem.hxx> +#include <editeng/ulspitem.hxx> +#include <editeng/brshitem.hxx> #include "document.hxx" #include "stlsheet.hxx" #include "attrib.hxx" diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx index 87c6173dcb77..29e27a698a42 100644 --- a/sc/source/filter/excel/xipivot.cxx +++ b/sc/source/filter/excel/xipivot.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xipivot.cxx,v $ - * $Revision: 1.20.4.1 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -39,8 +36,8 @@ #include <com/sun/star/sheet/DataPilotFieldReference.hpp> #include <tools/datetime.hxx> -#include <svtools/zformat.hxx> -#include <svtools/intitem.hxx> +#include <svl/zformat.hxx> +#include <svl/intitem.hxx> #include "document.hxx" #include "cell.hxx" @@ -48,7 +45,9 @@ #include "dpdimsave.hxx" #include "dpobject.hxx" #include "dpshttab.hxx" +#include "dpoutputgeometry.hxx" #include "scitems.hxx" +#include "attrib.hxx" #include "xltracer.hxx" #include "xistream.hxx" @@ -60,13 +59,17 @@ #include "excform.hxx" #include "xltable.hxx" +#include <vector> + using ::rtl::OUString; +using ::rtl::OUStringBuffer; using ::com::sun::star::sheet::DataPilotFieldOrientation; using ::com::sun::star::sheet::DataPilotFieldOrientation_DATA; using ::com::sun::star::sheet::DataPilotFieldSortInfo; using ::com::sun::star::sheet::DataPilotFieldAutoShowInfo; using ::com::sun::star::sheet::DataPilotFieldLayoutInfo; using ::com::sun::star::sheet::DataPilotFieldReference; +using ::std::vector; // ============================================================================ // Pivot cache @@ -847,6 +850,11 @@ void XclImpPivotCache::ReadPivotCacheStream( XclImpStream& rStrm ) } } +bool XclImpPivotCache::IsRefreshOnLoad() const +{ + return static_cast<bool>(maPCInfo.mnFlags & 0x0004); +} + // ============================================================================ // Pivot table // ============================================================================ @@ -882,6 +890,8 @@ void XclImpPTItem::ConvertItem( ScDPSaveDimension& rSaveDim ) const ScDPSaveMember& rMember = *rSaveDim.GetMemberByName( *pItemName ); rMember.SetIsVisible( !::get_flag( maItemInfo.mnFlags, EXC_SXVI_HIDDEN ) ); rMember.SetShowDetails( !::get_flag( maItemInfo.mnFlags, EXC_SXVI_HIDEDETAIL ) ); + if (maItemInfo.HasVisName()) + rMember.SetLayoutName(*maItemInfo.GetVisName()); } } @@ -1022,6 +1032,28 @@ void XclImpPTField::ConvertDataField( ScDPSaveData& rSaveData ) const // private -------------------------------------------------------------------- +/** + * Convert Excel-encoded subtotal name to a Calc-encoded one. + */ +static OUString lcl_convertExcelSubtotalName(const OUString& rName) +{ + OUStringBuffer aBuf; + const sal_Unicode* p = rName.getStr(); + sal_Int32 n = rName.getLength(); + for (sal_Int32 i = 0; i < n; ++i) + { + const sal_Unicode c = p[i]; + if (c == sal_Unicode('\\')) + { + aBuf.append(c); + aBuf.append(c); + } + else + aBuf.append(c); + } + return aBuf.makeStringAndClear(); +} + ScDPSaveDimension* XclImpPTField::ConvertRCPField( ScDPSaveData& rSaveData ) const { const String& rFieldName = GetFieldName(); @@ -1043,7 +1075,7 @@ ScDPSaveDimension* XclImpPTField::ConvertRCPField( ScDPSaveData& rSaveData ) con // visible name if( const String* pVisName = maFieldInfo.GetVisName() ) if( pVisName->Len() > 0 ) - rSaveDim.SetLayoutName( pVisName ); + rSaveDim.SetLayoutName( *pVisName ); // subtotal function(s) XclPTSubtotalVec aSubtotalVec; @@ -1075,6 +1107,13 @@ ScDPSaveDimension* XclImpPTField::ConvertRCPField( ScDPSaveData& rSaveData ) con // grouping info pCacheField->ConvertGroupField( rSaveData, mrPTable.GetVisFieldNames() ); + // custom subtotal name + if (maFieldExtInfo.mpFieldTotalName.get()) + { + OUString aSubName = lcl_convertExcelSubtotalName(*maFieldExtInfo.mpFieldTotalName); + rSaveDim.SetSubtotalName(aSubName); + } + return &rSaveDim; } @@ -1099,7 +1138,7 @@ void XclImpPTField::ConvertDataFieldInfo( ScDPSaveDimension& rSaveDim, const Xcl // visible name if( const String* pVisName = rDataInfo.GetVisName() ) if( pVisName->Len() > 0 ) - rSaveDim.SetLayoutName( pVisName ); + rSaveDim.SetLayoutName( *pVisName ); // aggregation function rSaveDim.SetFunction( static_cast< USHORT >( rDataInfo.GetApiAggFunc() ) ); @@ -1134,7 +1173,8 @@ void XclImpPTField::ConvertItems( ScDPSaveDimension& rSaveDim ) const XclImpPivotTable::XclImpPivotTable( const XclImpRoot& rRoot ) : XclImpRoot( rRoot ), - maDataOrientField( *this, EXC_SXIVD_DATA ) + maDataOrientField( *this, EXC_SXIVD_DATA ), + mpDPObj(NULL) { } @@ -1296,6 +1336,11 @@ void XclImpPivotTable::ReadSxex( XclImpStream& rStrm ) rStrm >> maPTExtInfo; } +void XclImpPivotTable::ReadSxViewEx9( XclImpStream& rStrm ) +{ + rStrm >> maPTViewEx9Info; +} + // ---------------------------------------------------------------------------- void XclImpPivotTable::Convert() @@ -1331,6 +1376,10 @@ void XclImpPivotTable::Convert() if( const XclImpPTField* pField = GetField( *aIt ) ) pField->ConvertPageField( aSaveData ); + // We need to import hidden fields because hidden fields may contain + // special settings for subtotals (aggregation function, filters, custom + // name etc.) and members (hidden, custom name etc.). + // hidden fields for( sal_uInt16 nField = 0, nCount = GetFieldCount(); nField < nCount; ++nField ) if( const XclImpPTField* pField = GetField( nField ) ) @@ -1359,11 +1408,112 @@ void XclImpPivotTable::Convert() // create the DataPilot ScDPObject* pDPObj = new ScDPObject( GetDocPtr() ); pDPObj->SetName( maPTInfo.maTableName ); + if (maPTInfo.maDataName.Len() > 0) + aSaveData.GetDataLayoutDimension()->SetLayoutName(maPTInfo.maDataName); + + if (maPTViewEx9Info.maGrandTotalName.Len() > 0) + aSaveData.SetGrandTotalName(maPTViewEx9Info.maGrandTotalName); + pDPObj->SetSaveData( aSaveData ); pDPObj->SetSheetDesc( aDesc ); pDPObj->SetOutRange( aOutRange ); pDPObj->SetAlive( TRUE ); - GetDoc().GetDPCollection()->Insert( pDPObj ); + pDPObj->SetHeaderLayout( maPTViewEx9Info.mnGridLayout == 0 ); + + GetDoc().GetDPCollection()->InsertNewTable(pDPObj); + mpDPObj = pDPObj; + + ApplyMergeFlags(aOutRange, aSaveData); +} + +void XclImpPivotTable::MaybeRefresh() +{ + if (mpDPObj && mxPCache->IsRefreshOnLoad()) + { + // 'refresh table on load' flag is set. Refresh the table now. Some + // Excel files contain partial table output when this flag is set. + ScRange aOutRange = mpDPObj->GetOutRange(); + mpDPObj->Output(aOutRange.aStart); + } +} + +void XclImpPivotTable::ApplyMergeFlags(const ScRange& rOutRange, const ScDPSaveData& rSaveData) +{ + // Apply merge flags for varoius datapilot controls. + + ScDPOutputGeometry aGeometry(rOutRange, false, ScDPOutputGeometry::XLS); + aGeometry.setColumnFieldCount(maPTInfo.mnColFields); + aGeometry.setPageFieldCount(maPTInfo.mnPageFields); + aGeometry.setDataFieldCount(maPTInfo.mnDataFields); + + // Excel includes data layout field in the row field count. We need to + // subtract it. + bool bDataLayout = maPTInfo.mnDataFields > 1; + aGeometry.setRowFieldCount(maPTInfo.mnRowFields - static_cast<sal_uInt32>(bDataLayout)); + + ScDocument& rDoc = GetDoc(); + + vector<ScAddress> aPageBtns; + aGeometry.getPageFieldPositions(aPageBtns); + vector<ScAddress>::const_iterator itr = aPageBtns.begin(), itrEnd = aPageBtns.end(); + for (; itr != itrEnd; ++itr) + { + sal_uInt16 nMFlag = SC_MF_BUTTON; + String aName; + rDoc.GetString(itr->Col(), itr->Row(), itr->Tab(), aName); + if (rSaveData.HasInvisibleMember(aName)) + nMFlag |= SC_MF_HIDDEN_MEMBER; + + rDoc.ApplyFlagsTab(itr->Col(), itr->Row(), itr->Col(), itr->Row(), itr->Tab(), nMFlag); + rDoc.ApplyFlagsTab(itr->Col()+1, itr->Row(), itr->Col()+1, itr->Row(), itr->Tab(), SC_MF_AUTO); + } + + vector<ScAddress> aColBtns; + aGeometry.getColumnFieldPositions(aColBtns); + itr = aColBtns.begin(); + itrEnd = aColBtns.end(); + for (; itr != itrEnd; ++itr) + { + sal_Int16 nMFlag = SC_MF_BUTTON | SC_MF_BUTTON_POPUP; + String aName; + rDoc.GetString(itr->Col(), itr->Row(), itr->Tab(), aName); + if (rSaveData.HasInvisibleMember(aName)) + nMFlag |= SC_MF_HIDDEN_MEMBER; + rDoc.ApplyFlagsTab(itr->Col(), itr->Row(), itr->Col(), itr->Row(), itr->Tab(), nMFlag); + } + + vector<ScAddress> aRowBtns; + aGeometry.getRowFieldPositions(aRowBtns); + if (aRowBtns.empty()) + { + if (bDataLayout) + { + // No row fields, but the data layout button exists. + SCROW nRow = aGeometry.getRowFieldHeaderRow(); + SCCOL nCol = rOutRange.aStart.Col(); + SCTAB nTab = rOutRange.aStart.Tab(); + rDoc.ApplyFlagsTab(nCol, nRow, nCol, nRow, nTab, SC_MF_BUTTON); + } + } + else + { + itr = aRowBtns.begin(); + itrEnd = aRowBtns.end(); + for (; itr != itrEnd; ++itr) + { + sal_Int16 nMFlag = SC_MF_BUTTON | SC_MF_BUTTON_POPUP; + String aName; + rDoc.GetString(itr->Col(), itr->Row(), itr->Tab(), aName); + if (rSaveData.HasInvisibleMember(aName)) + nMFlag |= SC_MF_HIDDEN_MEMBER; + rDoc.ApplyFlagsTab(itr->Col(), itr->Row(), itr->Col(), itr->Row(), itr->Tab(), nMFlag); + } + if (bDataLayout) + { + --itr; // move back to the last row field position. + rDoc.ApplyFlagsTab(itr->Col(), itr->Row(), itr->Col(), itr->Row(), itr->Tab(), SC_MF_BUTTON); + } + } } // ============================================================================ @@ -1458,6 +1608,12 @@ void XclImpPivotTableManager::ReadSxex( XclImpStream& rStrm ) maPTables.back()->ReadSxex( rStrm ); } +void XclImpPivotTableManager::ReadSxViewEx9( XclImpStream& rStrm ) +{ + if( !maPTables.empty() ) + maPTables.back()->ReadSxViewEx9( rStrm ); +} + // ---------------------------------------------------------------------------- void XclImpPivotTableManager::ReadPivotCaches( XclImpStream& rStrm ) @@ -1472,5 +1628,11 @@ void XclImpPivotTableManager::ConvertPivotTables() (*aIt)->Convert(); } +void XclImpPivotTableManager::MaybeRefreshPivotTables() +{ + for( XclImpPivotTableVec::iterator aIt = maPTables.begin(), aEnd = maPTables.end(); aIt != aEnd; ++aIt ) + (*aIt)->MaybeRefresh(); +} + // ============================================================================ diff --git a/sc/source/filter/excel/xiroot.cxx b/sc/source/filter/excel/xiroot.cxx index 9176e073189e..3384cf248c87 100644 --- a/sc/source/filter/excel/xiroot.cxx +++ b/sc/source/filter/excel/xiroot.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xiroot.cxx,v $ - * $Revision: 1.24.88.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/sc/source/filter/excel/xistream.cxx b/sc/source/filter/excel/xistream.cxx index a040f21b1c4f..98db9dcb4471 100644 --- a/sc/source/filter/excel/xistream.cxx +++ b/sc/source/filter/excel/xistream.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xistream.cxx,v $ - * $Revision: 1.22.30.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -678,56 +675,56 @@ XclImpStream& XclImpStream::operator>>( double& rfValue ) sal_Int8 XclImpStream::ReadInt8() { - sal_Int8 nValue; + sal_Int8 nValue(0); operator>>( nValue ); return nValue; } sal_uInt8 XclImpStream::ReaduInt8() { - sal_uInt8 nValue; + sal_uInt8 nValue(0); operator>>( nValue ); return nValue; } sal_Int16 XclImpStream::ReadInt16() { - sal_Int16 nValue; + sal_Int16 nValue(0); operator>>( nValue ); return nValue; } sal_uInt16 XclImpStream::ReaduInt16() { - sal_uInt16 nValue; + sal_uInt16 nValue(0); operator>>( nValue ); return nValue; } sal_Int32 XclImpStream::ReadInt32() { - sal_Int32 nValue; + sal_Int32 nValue(0); operator>>( nValue ); return nValue; } sal_uInt32 XclImpStream::ReaduInt32() { - sal_uInt32 nValue; + sal_uInt32 nValue(0); operator>>( nValue ); return nValue; } float XclImpStream::ReadFloat() { - float fValue; + float fValue(0.0); operator>>( fValue ); return fValue; } double XclImpStream::ReadDouble() { - double fValue; + double fValue(0.0); operator>>( fValue ); return fValue; } diff --git a/sc/source/filter/excel/xistring.cxx b/sc/source/filter/excel/xistring.cxx index d6e0b3182d41..cb2645bec538 100644 --- a/sc/source/filter/excel/xistring.cxx +++ b/sc/source/filter/excel/xistring.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xistring.cxx,v $ - * $Revision: 1.5.90.1 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx index 07368f6db680..4e0ff5079471 100644 --- a/sc/source/filter/excel/xistyle.cxx +++ b/sc/source/filter/excel/xistyle.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xistyle.cxx,v $ - * $Revision: 1.38.14.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -34,26 +31,26 @@ #include <sfx2/printer.hxx> #include <sfx2/objsh.hxx> #include <svtools/ctrltool.hxx> -#include <svx/editobj.hxx> +#include <editeng/editobj.hxx> #include "scitems.hxx" -#include <svx/fontitem.hxx> -#include <svx/fhgtitem.hxx> -#include <svx/wghtitem.hxx> -#include <svx/udlnitem.hxx> -#include <svx/postitem.hxx> -#include <svx/crsditem.hxx> -#include <svx/cntritem.hxx> -#include <svx/shdditem.hxx> -#include <svx/escpitem.hxx> +#include <editeng/fontitem.hxx> +#include <editeng/fhgtitem.hxx> +#include <editeng/wghtitem.hxx> +#include <editeng/udlnitem.hxx> +#include <editeng/postitem.hxx> +#include <editeng/crsditem.hxx> +#include <editeng/cntritem.hxx> +#include <editeng/shdditem.hxx> +#include <editeng/escpitem.hxx> #include <svx/algitem.hxx> -#include <svx/boxitem.hxx> -#include <svx/bolnitem.hxx> +#include <editeng/boxitem.hxx> +#include <editeng/bolnitem.hxx> #include <svx/rotmodit.hxx> -#include <svx/colritem.hxx> -#include <svx/brshitem.hxx> -#include <svx/frmdiritem.hxx> -#include <svx/eeitem.hxx> -#include <svx/flstitem.hxx> +#include <editeng/colritem.hxx> +#include <editeng/brshitem.hxx> +#include <editeng/frmdiritem.hxx> +#include <editeng/eeitem.hxx> +#include <editeng/flstitem.hxx> #include "document.hxx" #include "docpool.hxx" #include "attrib.hxx" diff --git a/sc/source/filter/excel/xiview.cxx b/sc/source/filter/excel/xiview.cxx index a871bdd0c1d7..6eeee8e04839 100644 --- a/sc/source/filter/excel/xiview.cxx +++ b/sc/source/filter/excel/xiview.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xiview.cxx,v $ - * $Revision: 1.9.90.1 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/sc/source/filter/excel/xladdress.cxx b/sc/source/filter/excel/xladdress.cxx index 9f2bde6672f1..d0c1a925f8ab 100644 --- a/sc/source/filter/excel/xladdress.cxx +++ b/sc/source/filter/excel/xladdress.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xladdress.cxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/sc/source/filter/excel/xlchart.cxx b/sc/source/filter/excel/xlchart.cxx index fbc51dbb7517..41e682f85808 100644 --- a/sc/source/filter/excel/xlchart.cxx +++ b/sc/source/filter/excel/xlchart.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xlchart.cxx,v $ - * $Revision: 1.11.62.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -48,15 +45,15 @@ #include <com/sun/star/chart/DataLabelPlacement.hpp> #include <rtl/math.hxx> -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #include <svx/xfillit0.hxx> #include <svx/xflclit.hxx> #include <svx/xfltrit.hxx> #include <svx/xflgrit.hxx> #include <svx/xbtmpit.hxx> #include <svx/unomid.hxx> -#include <svx/escherex.hxx> - +#include <filter/msfilter/escherex.hxx> +#include <editeng/memberids.hrc> #include "global.hxx" #include "xlconst.hxx" #include "xlstyle.hxx" diff --git a/sc/source/filter/excel/xlescher.cxx b/sc/source/filter/excel/xlescher.cxx index 491e34408d94..538fd7fd7242 100644 --- a/sc/source/filter/excel/xlescher.cxx +++ b/sc/source/filter/excel/xlescher.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xlescher.cxx,v $ - * $Revision: 1.14.90.8 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx index b8c18eb3e7c0..c46df189ab74 100644 --- a/sc/source/filter/excel/xlformula.cxx +++ b/sc/source/filter/excel/xlformula.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xlformula.cxx,v $ - * $Revision: 1.27 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/sc/source/filter/excel/xlpage.cxx b/sc/source/filter/excel/xlpage.cxx index d1bea1addcec..a59c6f761667 100644 --- a/sc/source/filter/excel/xlpage.cxx +++ b/sc/source/filter/excel/xlpage.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xlpage.cxx,v $ - * $Revision: 1.9 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -32,11 +29,11 @@ #include "precompiled_sc.hxx" #include "xlpage.hxx" #include <sfx2/printer.hxx> -#include <svx/svxenum.hxx> -#include <svx/paperinf.hxx> +#include <editeng/svxenum.hxx> +#include <editeng/paperinf.hxx> #include <vcl/svapp.hxx> #include "scitems.hxx" -#include <svx/brshitem.hxx> +#include <editeng/brshitem.hxx> #include "global.hxx" #include "xlconst.hxx" diff --git a/sc/source/filter/excel/xlpivot.cxx b/sc/source/filter/excel/xlpivot.cxx index d36950b2494d..ed7aadd0a410 100644 --- a/sc/source/filter/excel/xlpivot.cxx +++ b/sc/source/filter/excel/xlpivot.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xlpivot.cxx,v $ - * $Revision: 1.12.32.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -31,6 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sc.hxx" #include "dpgroup.hxx" +#include "dpsave.hxx" #include "xestream.hxx" #include "xistream.hxx" #include "xestring.hxx" @@ -581,7 +579,9 @@ XclExpStream& operator<<( XclExpStream& rStrm, const XclPTFieldInfo& rInfo ) XclPTFieldExtInfo::XclPTFieldExtInfo() : mnFlags( EXC_SXVDEX_DEFAULTFLAGS ), mnSortField( EXC_SXVDEX_SORT_OWN ), - mnShowField( EXC_SXVDEX_SHOW_NONE ) + mnShowField( EXC_SXVDEX_SHOW_NONE ), + mnNumFmt(0), + mpFieldTotalName(NULL) { } @@ -639,10 +639,19 @@ void XclPTFieldExtInfo::SetApiLayoutMode( sal_Int32 nLayoutMode ) XclImpStream& operator>>( XclImpStream& rStrm, XclPTFieldExtInfo& rInfo ) { - return rStrm - >> rInfo.mnFlags - >> rInfo.mnSortField - >> rInfo.mnShowField; + sal_uInt8 nNameLen = 0; + rStrm >> rInfo.mnFlags + >> rInfo.mnSortField + >> rInfo.mnShowField + >> rInfo.mnNumFmt + >> nNameLen; + + rStrm.Ignore(10); + if (nNameLen != 0xFF) + // Custom field total name is used. Pick it up. + rInfo.mpFieldTotalName.reset(new rtl::OUString(rStrm.ReadUniString(nNameLen, 0))); + + return rStrm; } XclExpStream& operator<<( XclExpStream& rStrm, const XclPTFieldExtInfo& rInfo ) @@ -650,9 +659,23 @@ XclExpStream& operator<<( XclExpStream& rStrm, const XclPTFieldExtInfo& rInfo ) rStrm << rInfo.mnFlags << rInfo.mnSortField << rInfo.mnShowField - << EXC_SXVDEX_FORMAT_NONE - << sal_uInt16( 0xFFFF ); // unknown - rStrm.WriteZeroBytes( 8 ); // unknown + << EXC_SXVDEX_FORMAT_NONE; + + if (rInfo.mpFieldTotalName.get() && rInfo.mpFieldTotalName->getLength() > 0) + { + rtl::OUString aFinalName = *rInfo.mpFieldTotalName; + if (aFinalName.getLength() >= 254) + aFinalName = aFinalName.copy(0, 254); + sal_uInt8 nNameLen = static_cast<sal_uInt8>(aFinalName.getLength()); + rStrm << nNameLen; + rStrm.WriteZeroBytes(10); + rStrm << XclExpString(aFinalName, EXC_STR_NOHEADER); + } + else + { + rStrm << sal_uInt16(0xFFFF); + rStrm.WriteZeroBytes(8); + } return rStrm; } @@ -923,3 +946,86 @@ XclExpStream& operator<<( XclExpStream& rStrm, const XclPTExtInfo& rInfo ) // ============================================================================ +// Pivot table autoformat settings ============================================ + +/** +classic : 10 08 00 00 00 00 00 00 20 00 00 00 01 00 00 00 00 +default : 10 08 00 00 00 00 00 00 20 00 00 00 01 00 00 00 00 +report01 : 10 08 02 00 00 00 00 00 20 00 00 00 00 10 00 00 00 +report02 : 10 08 02 00 00 00 00 00 20 00 00 00 01 10 00 00 00 +report03 : 10 08 02 00 00 00 00 00 20 00 00 00 02 10 00 00 00 +report04 : 10 08 02 00 00 00 00 00 20 00 00 00 03 10 00 00 00 +report05 : 10 08 02 00 00 00 00 00 20 00 00 00 04 10 00 00 00 +report06 : 10 08 02 00 00 00 00 00 20 00 00 00 05 10 00 00 00 +report07 : 10 08 02 00 00 00 00 00 20 00 00 00 06 10 00 00 00 +report08 : 10 08 02 00 00 00 00 00 20 00 00 00 07 10 00 00 00 +report09 : 10 08 02 00 00 00 00 00 20 00 00 00 08 10 00 00 00 +report10 : 10 08 02 00 00 00 00 00 20 00 00 00 09 10 00 00 00 +table01 : 10 08 00 00 00 00 00 00 20 00 00 00 0a 10 00 00 00 +table02 : 10 08 00 00 00 00 00 00 20 00 00 00 0b 10 00 00 00 +table03 : 10 08 00 00 00 00 00 00 20 00 00 00 0c 10 00 00 00 +table04 : 10 08 00 00 00 00 00 00 20 00 00 00 0d 10 00 00 00 +table05 : 10 08 00 00 00 00 00 00 20 00 00 00 0e 10 00 00 00 +table06 : 10 08 00 00 00 00 00 00 20 00 00 00 0f 10 00 00 00 +table07 : 10 08 00 00 00 00 00 00 20 00 00 00 10 10 00 00 00 +table08 : 10 08 00 00 00 00 00 00 20 00 00 00 11 10 00 00 00 +table09 : 10 08 00 00 00 00 00 00 20 00 00 00 12 10 00 00 00 +table10 : 10 08 00 00 00 00 00 00 20 00 00 00 13 10 00 00 00 +none : 10 08 00 00 00 00 00 00 20 00 00 00 15 10 00 00 00 +**/ + +XclPTViewEx9Info::XclPTViewEx9Info() : + mbReport( 0 ), + mnAutoFormat( 0 ), + mnGridLayout( 0x10 ) +{ +} + +void XclPTViewEx9Info::Init( const ScDPObject& rDPObj ) +{ + if( rDPObj.GetHeaderLayout() ) + { + mbReport = 0; + mnAutoFormat = 1; + mnGridLayout = 0; + } + else + { + // Report1 for now + // TODO : sync with autoformat indicies + mbReport = 2; + mnAutoFormat = 1; + mnGridLayout = 0x10; + } + + const ScDPSaveData* pData = rDPObj.GetSaveData(); + if (pData) + { + const rtl::OUString* pGrandTotal = pData->GetGrandTotalName(); + if (pGrandTotal) + maGrandTotalName = *pGrandTotal; + } +} + +XclImpStream& operator>>( XclImpStream& rStrm, XclPTViewEx9Info& rInfo ) +{ + rStrm.Ignore( 2 ); + rStrm >> rInfo.mbReport; /// 2 for report* fmts ? + rStrm.Ignore( 6 ); + rStrm >> rInfo.mnAutoFormat >> rInfo.mnGridLayout; + rInfo.maGrandTotalName = rStrm.ReadUniString(); + return rStrm; +} + +XclExpStream& operator<<( XclExpStream& rStrm, const XclPTViewEx9Info& rInfo ) +{ + return rStrm + << EXC_PT_AUTOFMT_HEADER + << rInfo.mbReport + << EXC_PT_AUTOFMT_ZERO + << EXC_PT_AUTOFMT_FLAGS + << rInfo.mnAutoFormat + << rInfo.mnGridLayout + << XclExpString(rInfo.maGrandTotalName, EXC_STR_DEFAULT, EXC_PT_MAXSTRLEN); +} + diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx index 0b6af9da2e63..8a22b05828b9 100644 --- a/sc/source/filter/excel/xlroot.cxx +++ b/sc/source/filter/excel/xlroot.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xlroot.cxx,v $ - * $Revision: 1.32.88.1 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -33,16 +30,15 @@ #include "xlroot.hxx" #include <com/sun/star/i18n/ScriptType.hpp> #include <vcl/svapp.hxx> -#include <svtools/stritem.hxx> -#include <svtools/languageoptions.hxx> -#include <svtools/useroptions.hxx> +#include <svl/stritem.hxx> +#include <svl/languageoptions.hxx> #include <sfx2/objsh.hxx> #include <sfx2/printer.hxx> #include <sfx2/docfile.hxx> #include <vcl/font.hxx> -#include <svx/editstat.hxx> +#include <editeng/editstat.hxx> #include "scitems.hxx" -#include <svx/eeitem.hxx> +#include <editeng/eeitem.hxx> #include "document.hxx" #include "docpool.hxx" #include "docuno.hxx" @@ -55,7 +51,7 @@ #include "xlstyle.hxx" #include "xlchart.hxx" #include "xltracer.hxx" - +#include <unotools/useroptions.hxx> #include "root.hxx" namespace ApiScriptType = ::com::sun::star::i18n::ScriptType; @@ -96,12 +92,10 @@ XclRootData::XclRootData( XclBiff eBiff, SfxMedium& rMedium, mnScTab( 0 ), mbExport( bExport ) { - // user name - maUserName = SvtUserOptions().GetLastName(); + maUserName = SvtUserOptions().GetLastName(); if( maUserName.Len() == 0 ) maUserName = CREATE_STRING( "Calc" ); - // default script type, e.g. for empty cells switch( ScGlobal::GetDefaultScriptType() ) { case SCRIPTTYPE_LATIN: mnDefApiScript = ApiScriptType::LATIN; break; diff --git a/sc/source/filter/excel/xlstyle.cxx b/sc/source/filter/excel/xlstyle.cxx index 401f135b381a..4a48584da7fa 100644 --- a/sc/source/filter/excel/xlstyle.cxx +++ b/sc/source/filter/excel/xlstyle.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xlstyle.cxx,v $ - * $Revision: 1.27.32.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -40,7 +37,7 @@ #include <vcl/font.hxx> #include <rtl/tencinfo.h> #include <toolkit/unohlp.hxx> -#include <svx/svxfont.hxx> +#include <editeng/svxfont.hxx> #include "global.hxx" #include "xlroot.hxx" diff --git a/sc/source/filter/excel/xltools.cxx b/sc/source/filter/excel/xltools.cxx index 6398e25b9be7..926eb3e54fdc 100644 --- a/sc/source/filter/excel/xltools.cxx +++ b/sc/source/filter/excel/xltools.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xltools.cxx,v $ - * $Revision: 1.31.32.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -34,9 +31,9 @@ #include <algorithm> #include <math.h> #include <sal/mathconf.h> -#include <vcl/fontcvt.hxx> +#include <unotools/fontcvt.hxx> #include <sfx2/objsh.hxx> -#include <svx/editstat.hxx> +#include <editeng/editstat.hxx> #include "xestream.hxx" #include "document.hxx" #include "docuno.hxx" diff --git a/sc/source/filter/excel/xltracer.cxx b/sc/source/filter/excel/xltracer.cxx index 48044c8401f4..7dadbde8198a 100644 --- a/sc/source/filter/excel/xltracer.cxx +++ b/sc/source/filter/excel/xltracer.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xltracer.cxx,v $ - * $Revision: 1.10.32.1 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -33,7 +30,7 @@ // ============================================================================ #include "xltracer.hxx" -#include <svx/msfiltertracer.hxx> +#include <filter/msfilter/msfiltertracer.hxx> #include "address.hxx" using ::rtl::OUString; diff --git a/sc/source/filter/excel/xlview.cxx b/sc/source/filter/excel/xlview.cxx index e3290e844bd5..d9cbbbb4b7c0 100644 --- a/sc/source/filter/excel/xlview.cxx +++ b/sc/source/filter/excel/xlview.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xlview.cxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify |